diff --git a/ApplicationCode/ProjectDataModel/RimBoxIntersection.cpp b/ApplicationCode/ProjectDataModel/RimBoxIntersection.cpp index e0be51c8f2..9be7aa7e96 100644 --- a/ApplicationCode/ProjectDataModel/RimBoxIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimBoxIntersection.cpp @@ -55,6 +55,8 @@ RimBoxIntersection::RimBoxIntersection() { CAF_PDM_InitObject( "Intersection Box", ":/IntersectionBox16x16.png", "", "" ); + CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); + CAF_PDM_InitField( &m_singlePlaneState, "singlePlaneState", caf::AppEnum( SinglePlaneState::PLANE_STATE_NONE ), @@ -100,6 +102,30 @@ RimBoxIntersection::~RimBoxIntersection() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimBoxIntersection::userDescriptionField() +{ + return &m_name; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimBoxIntersection::name() const +{ + return m_name(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimBoxIntersection::setName( const QString& newName ) +{ + m_name = newName; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimBoxIntersection.h b/ApplicationCode/ProjectDataModel/RimBoxIntersection.h index 813f29b789..16ea4f1db6 100644 --- a/ApplicationCode/ProjectDataModel/RimBoxIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimBoxIntersection.h @@ -62,6 +62,9 @@ public: RimBoxIntersection(); ~RimBoxIntersection() override; + QString name() const override; + void setName( const QString& newName ); + cvf::Mat4d boxOrigin() const; cvf::Vec3d boxSize() const; SinglePlaneState singlePlaneState() const; @@ -76,6 +79,8 @@ public: void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position ); protected: + caf::PdmFieldHandle* userDescriptionField() override final; + void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; @@ -105,6 +110,8 @@ private: RiuViewer* viewer(); private: + caf::PdmField m_name; + caf::PdmField> m_singlePlaneState; caf::PdmField m_minXCoord; diff --git a/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp b/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp index 003d71f48c..10b6ec2a56 100644 --- a/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp @@ -83,6 +83,7 @@ CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CrossSection" ); RimExtrudedCurveIntersection::RimExtrudedCurveIntersection() { CAF_PDM_InitObject( "Intersection", ":/CrossSection16x16.png", "", "" ); + CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); CAF_PDM_InitFieldNoDefault( &type, "Type", "Type", "", "", "" ); CAF_PDM_InitFieldNoDefault( &direction, "Direction", "Direction", "", "", "" ); @@ -139,6 +140,30 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection() //-------------------------------------------------------------------------------------------------- RimExtrudedCurveIntersection::~RimExtrudedCurveIntersection() {} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimExtrudedCurveIntersection::userDescriptionField() +{ + return &m_name; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimExtrudedCurveIntersection::name() const +{ + return m_name(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimExtrudedCurveIntersection::setName( const QString& newName ) +{ + m_name = newName; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.h b/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.h index 6c4440d466..06d02b395a 100644 --- a/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimExtrudedCurveIntersection.h @@ -81,6 +81,9 @@ public: caf::PdmField inputExtrusionPointsFromViewerEnabled; caf::PdmField inputTwoAzimuthPointsFromViewerEnabled; + QString name() const override; + void setName( const QString& newName ); + std::vector> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const; void appendPointToPolyLine( const cvf::Vec3d& point ); @@ -106,6 +109,7 @@ public: void rebuildGeometryAndScheduleCreateDisplayModel(); protected: + caf::PdmFieldHandle* userDescriptionField() override final; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; @@ -117,6 +121,8 @@ protected: bool* useOptionsOnly ) override; private: + caf::PdmField m_name; + caf::PdmField m_branchIndex; caf::PdmField m_extentLength; caf::PdmField m_azimuthAngle; diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index f93758d397..e050f7eba1 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -31,14 +31,13 @@ #include "RimIntersectionResultsDefinitionCollection.h" #include "RivHexGridIntersectionTools.h" -CAF_PDM_SOURCE_INIT( RimIntersection, "RimIntersectionHandle" ); +CAF_PDM_ABSTRACT_SOURCE_INIT( RimIntersection, "RimIntersectionHandle" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RimIntersection::RimIntersection() { - CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); CAF_PDM_InitField( &m_isActive, "Active", true, "Active", "", "", "" ); m_isActive.uiCapability()->setUiHidden( true ); CAF_PDM_InitField( &m_showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "" ); @@ -51,22 +50,6 @@ RimIntersection::RimIntersection() //-------------------------------------------------------------------------------------------------- RimIntersection::~RimIntersection() {} -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimIntersection::name() const -{ - return m_name(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimIntersection::setName( const QString& newName ) -{ - m_name = newName; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -137,14 +120,6 @@ QList RimIntersection::calculateValueOptions( const caf: return options; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimIntersection::userDescriptionField() -{ - return &m_name; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.h b/ApplicationCode/ProjectDataModel/RimIntersection.h index e73faeeb95..d461c2214c 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersection.h @@ -35,17 +35,16 @@ public: RimIntersection(); ~RimIntersection() override; - QString name() const; - void setName( const QString& newName ); - bool isActive() const; - void setActive( bool isActive ); - bool isInactiveCellsVisible() const; + virtual QString name() const = 0; + + bool isActive() const; + void setActive( bool isActive ); + bool isInactiveCellsVisible() const; RimIntersectionResultDefinition* activeSeparateResultDefinition(); cvf::ref createHexGridInterface(); protected: - caf::PdmFieldHandle* userDescriptionField() override final; caf::PdmFieldHandle* objectToggleField() override final; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; @@ -54,7 +53,6 @@ protected: void defineSeparateDataSourceUi( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); void updateDefaultSeparateDataSource(); - caf::PdmField m_name; caf::PdmField m_isActive; caf::PdmField m_showInactiveCells; caf::PdmField m_useSeparateDataSource;