Use project polygons from polygon cell filter

* Use RimPolygonInView to edit locally defined polygon
* Add scaling to polygon in view
* Move polygon line visualization to RimGridView
* Rename to polygonInViewCollection
* Show appearance for local polygon
This commit is contained in:
Magne Sjaastad
2024-02-22 15:13:29 +01:00
committed by GitHub
parent 055c0d4c8c
commit a3d520e26e
32 changed files with 582 additions and 645 deletions

View File

@@ -54,7 +54,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.h
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.h
@@ -112,7 +111,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp
${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp
${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.cpp
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools.cpp

View File

@@ -1,88 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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<RimCellFilterCollection>();
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();
}

View File

@@ -1,60 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmPointer.h"
#include "cvfAssert.h"
#include "cvfCollection.h"
#include "cvfObject.h"
namespace cvf
{
class BoundingBox;
class Part;
class ModelBasicList;
class Transform;
class Font;
} // namespace cvf
namespace caf
{
class DisplayCoordTransform;
}
class Rim3dView;
class RivPolylinePartMgr;
class RivCellFilterPartMgr : public cvf::Object
{
public:
RivCellFilterPartMgr( Rim3dView* view );
~RivCellFilterPartMgr() override;
void appendGeometryPartsToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
const cvf::BoundingBox& boundingBox );
void clearGeometryCache();
private:
void createCellFilterPartManagers();
private:
caf::PdmPointer<Rim3dView> m_rimView;
cvf::Collection<RivPolylinePartMgr> m_cellFilterPartMgrs;
};