diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.cpp index b53865d40d..8867ef5620 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.cpp @@ -215,3 +215,13 @@ void RivBoxIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model->addPart( m_intersectionBoxGridLines.p() ); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RivBoxIntersectionPartMgr::intersectionGeometryGenerator() const +{ + if ( m_intersectionBoxGenerator.notNull() ) return m_intersectionBoxGenerator.p(); + + return nullptr; +} diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.h b/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.h index 5cfef24b4f..54c3e15026 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivBoxIntersectionPartMgr.h @@ -60,6 +60,8 @@ public: void appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ); void appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ); + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const; + private: void updatePartEffect(); void generatePartGeometry(); diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp index 65cffd89c7..313b43f057 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp @@ -712,3 +712,13 @@ cvf::Mat4d RivExtrudedCurveIntersectionPartMgr::unflattenTransformMatrix( const { return m_intersectionGenerator->unflattenTransformMatrix( intersectionPointFlat ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RivExtrudedCurveIntersectionPartMgr::intersectionGeometryGenerator() const +{ + if ( m_intersectionGenerator.notNull() ) return m_intersectionGenerator.p(); + + return NULL; +} diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h index ae633e045f..4612801ac9 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h @@ -55,6 +55,7 @@ class RivExtrudedCurveIntersectionGeometryGenerator; class RivIntersectionHexGridInterface; class RivIntersectionVertexWeights; class RivPipeGeometryGenerator; +class RivIntersectionGeometryGeneratorIF; //================================================================================================== /// @@ -79,6 +80,8 @@ public: cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const; + public: private: void generatePartGeometry(); diff --git a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.cpp b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.cpp index 1c345700f5..1a4e2924bc 100644 --- a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.cpp @@ -264,6 +264,16 @@ QString RivSurfacePartMgr::resultInfoText( Rim3dView* view, uint hitPart, cvf::V return retval; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RivSurfacePartMgr::intersectionGeometryGenerator() const +{ + if ( m_intersectionGenerator.notNull() ) return m_intersectionGenerator.p(); + + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.h b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.h index d611e34f6f..08795ae59f 100644 --- a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.h +++ b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfacePartMgr.h @@ -36,6 +36,7 @@ class RigResultAccessor; class Rim3dView; class RivSurfaceIntersectionGeometryGenerator; +class RivIntersectionGeometryGeneratorIF; class RivSurfacePartMgr : public cvf::Object { @@ -50,6 +51,8 @@ public: QString resultInfoText( Rim3dView* view, uint hitPart, cvf::Vec3d hitPoint ); + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const; + private: void generatePartGeometry(); diff --git a/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.cpp b/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.cpp index a99ae8348e..de0dbbd4e4 100644 --- a/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.cpp @@ -48,6 +48,16 @@ void AppEnum::setUp() CAF_PDM_SOURCE_INIT( RimBoxIntersection, "IntersectionBox" ); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RimBoxIntersection::intersectionGeometryGenerator() const +{ + if ( m_intersectionBoxPartMgr.notNull() ) return m_intersectionBoxPartMgr->intersectionGeometryGenerator(); + + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.h b/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.h index 810494f4ca..9669a29a2d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.h +++ b/ApplicationLibCode/ProjectDataModel/RimBoxIntersection.h @@ -78,6 +78,8 @@ public: void setToDefaultSizeBox(); void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position ); + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const override; + protected: caf::PdmFieldHandle* userDescriptionField() final; diff --git a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp index 96e31055d3..e450fe5156 100644 --- a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp @@ -75,6 +75,16 @@ void caf::AppEnum::setUp() CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CrossSection" ); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RimExtrudedCurveIntersection::intersectionGeometryGenerator() const +{ + if ( m_crossSectionPartMgr.notNull() ) return m_crossSectionPartMgr->intersectionGeometryGenerator(); + + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h index 273f62c841..39741351bd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h +++ b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h @@ -87,9 +87,10 @@ public: std::vector> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const; void appendPointToPolyLine( const cvf::Vec3d& point ); - Rim2dIntersectionView* correspondingIntersectionView(); - RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr(); - void rebuildGeometry(); + Rim2dIntersectionView* correspondingIntersectionView(); + RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr(); + void rebuildGeometry(); + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const override; std::vector polyLinesForExtrusionDirection() const; void appendPointToExtrusionDirection( const cvf::Vec3d& point ); diff --git a/ApplicationLibCode/ProjectDataModel/RimIntersection.h b/ApplicationLibCode/ProjectDataModel/RimIntersection.h index f2c454face..bc2bab0f2b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimIntersection.h +++ b/ApplicationLibCode/ProjectDataModel/RimIntersection.h @@ -27,6 +27,7 @@ class RimIntersectionResultDefinition; class RivIntersectionHexGridInterface; class RimIntersectionResultsDefinitionCollection; +class RivIntersectionGeometryGeneratorIF; class RimIntersection : public caf::PdmObject { @@ -45,6 +46,8 @@ public: RimIntersectionResultDefinition* activeSeparateResultDefinition(); cvf::ref createHexGridInterface(); + virtual const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const = 0; + protected: virtual RimIntersectionResultsDefinitionCollection* findSeparateResultsCollection(); diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp index 1b34d3c8b9..646cdb0a81 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp @@ -141,6 +141,16 @@ RivSurfacePartMgr* RimSurfaceInView::surfacePartMgr() return m_surfacePartMgr.p(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RivIntersectionGeometryGeneratorIF* RimSurfaceInView::intersectionGeometryGenerator() const +{ + if ( m_surfacePartMgr.notNull() ) return m_surfacePartMgr->intersectionGeometryGenerator(); + + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h index 805ecfab4a..258135abfe 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h @@ -51,8 +51,9 @@ public: bool isNativeSurfaceResultsActive() const; RimSurfaceResultDefinition* surfaceResultDefinition(); - void clearGeometry(); - RivSurfacePartMgr* surfacePartMgr(); + void clearGeometry(); + RivSurfacePartMgr* surfacePartMgr(); + const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const override; void loadDataAndUpdate(); @@ -66,7 +67,7 @@ private: caf::PdmFieldHandle* userDescriptionField() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; caf::PdmProxyValueField m_name; caf::PdmPtrField m_surface; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp index b9c83925e3..7ffd524164 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp @@ -483,3 +483,29 @@ std::vector RimSurfaceInViewCollection::legendConfigs() return configs; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimSurfaceInViewCollection::intersectionGeometryGenerators() const +{ + std::vector generators; + + for ( auto surf : m_surfacesInView ) + { + if ( surf->isActive() && surf->isNativeSurfaceResultsActive() ) + { + auto generator = surf->intersectionGeometryGenerator(); + + if ( generator ) generators.push_back( generator ); + } + } + + for ( auto child : m_collectionsInView ) + { + auto childGenerators = child->intersectionGeometryGenerators(); + generators.insert( generators.end(), childGenerators.begin(), childGenerators.end() ); + } + + return generators; +} diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h index 950810d4b3..c793a183ce 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h @@ -37,6 +37,7 @@ class RimSurface; class RimSurfaceCollection; class RimRegularLegendConfig; class RiuViewer; +class RivIntersectionGeometryGeneratorIF; class RimSurfaceInViewCollection : public RimCheckableNamedObject { @@ -64,8 +65,10 @@ public: std::vector legendConfigs(); + std::vector intersectionGeometryGenerators() const; + protected: - void initAfterRead() override; + void initAfterRead() override; caf::PdmFieldHandle* userDescriptionField() override; private: