#7739 Preparations : Expose reservoir cell IDs used to generate geometry

This commit is contained in:
Magne Sjaastad 2021-05-31 08:09:13 +02:00
parent d132accd1d
commit 6e0dadbdaa
15 changed files with 111 additions and 7 deletions

View File

@ -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;
}

View File

@ -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();

View File

@ -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;
}

View File

@ -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();

View File

@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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();

View File

@ -48,6 +48,16 @@ void AppEnum<RimBoxIntersection::SinglePlaneState>::setUp()
CAF_PDM_SOURCE_INIT( RimBoxIntersection, "IntersectionBox" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RivIntersectionGeometryGeneratorIF* RimBoxIntersection::intersectionGeometryGenerator() const
{
if ( m_intersectionBoxPartMgr.notNull() ) return m_intersectionBoxPartMgr->intersectionGeometryGenerator();
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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;

View File

@ -75,6 +75,16 @@ void caf::AppEnum<RimExtrudedCurveIntersection::CrossSectionDirEnum>::setUp()
CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CrossSection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RivIntersectionGeometryGeneratorIF* RimExtrudedCurveIntersection::intersectionGeometryGenerator() const
{
if ( m_crossSectionPartMgr.notNull() ) return m_crossSectionPartMgr->intersectionGeometryGenerator();
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -87,9 +87,10 @@ public:
std::vector<std::vector<cvf::Vec3d>> 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<cvf::Vec3d> polyLinesForExtrusionDirection() const;
void appendPointToExtrusionDirection( const cvf::Vec3d& point );

View File

@ -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<RivIntersectionHexGridInterface> createHexGridInterface();
virtual const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const = 0;
protected:
virtual RimIntersectionResultsDefinitionCollection* findSeparateResultsCollection();

View File

@ -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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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<QString> m_name;
caf::PdmPtrField<RimSurface*> m_surface;

View File

@ -483,3 +483,29 @@ std::vector<RimRegularLegendConfig*> RimSurfaceInViewCollection::legendConfigs()
return configs;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<const RivIntersectionGeometryGeneratorIF*> RimSurfaceInViewCollection::intersectionGeometryGenerators() const
{
std::vector<const RivIntersectionGeometryGeneratorIF*> 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;
}

View File

@ -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<RimRegularLegendConfig*> legendConfigs();
std::vector<const RivIntersectionGeometryGeneratorIF*> intersectionGeometryGenerators() const;
protected:
void initAfterRead() override;
void initAfterRead() override;
caf::PdmFieldHandle* userDescriptionField() override;
private: