mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 15:14:07 -06:00
05aceef936
* Make sure all contourmap copies are getting the correct case set for cell filters when creating/copying maps. * Rewrite polyline part manager to be more generic, not just linked to annotations. * Add new partmgr for cell filters to draw polygon filter outlines in both eclipse and geomech views * Show lines/spheres for polygon filter outline * Add color edit for line and spheres * Add support for z plane lock in poygon filter outline * Add new flags for enabling filter and/or polyline display * Add K range filter to polygon filter * Enable picking automatically when creating a new polygon filter
90 lines
3.2 KiB
C++
90 lines
3.2 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2021 Equinor ASA
|
|
//
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
//
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
// for more details.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RivCellFilterPartMgr.h"
|
|
|
|
#include "Rim3dView.h"
|
|
#include "RimCellFilterCollection.h"
|
|
#include "RimPolygonFilter.h"
|
|
|
|
#include "RivPolylinePartMgr.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RivCellFilterPartMgr::RivCellFilterPartMgr( Rim3dView* view )
|
|
: m_rimView( view )
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RivCellFilterPartMgr::~RivCellFilterPartMgr()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RivCellFilterPartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* model,
|
|
const caf::DisplayCoordTransform* displayCoordTransform,
|
|
const cvf::BoundingBox& boundingBox )
|
|
{
|
|
createCellFilterPartManagers();
|
|
|
|
for ( auto& partMgr : m_cellFilterPartMgrs )
|
|
{
|
|
partMgr->appendDynamicGeometryPartsToModel( model, displayCoordTransform, boundingBox );
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RivCellFilterPartMgr::createCellFilterPartManagers()
|
|
{
|
|
std::vector<RimCellFilterCollection*> colls;
|
|
m_rimView->descendantsIncludingThisOfType( colls );
|
|
|
|
if ( colls.empty() ) return;
|
|
auto coll = colls.front();
|
|
|
|
clearGeometryCache();
|
|
|
|
for ( auto filter : coll->filters() )
|
|
{
|
|
RimPolygonFilter* polyFilter = dynamic_cast<RimPolygonFilter*>( filter );
|
|
if ( polyFilter )
|
|
{
|
|
RivPolylinePartMgr* ppm = new RivPolylinePartMgr( m_rimView, polyFilter, coll );
|
|
m_cellFilterPartMgrs.push_back( ppm );
|
|
}
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RivCellFilterPartMgr::clearGeometryCache()
|
|
{
|
|
m_cellFilterPartMgrs.clear();
|
|
}
|