mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Intersection : Add Python support for triangle and result values (#8505)
#8508 Python : Make sure an empty list will be received as empty list in Python Co-authored-by: magnesj <magnesj@users.noreply.github.com>
This commit is contained in:
@@ -52,12 +52,14 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
#include "cvfBoundingBox.h"
|
||||
@@ -73,7 +75,7 @@ void caf::AppEnum<RimExtrudedCurveIntersection::CrossSectionEnum>::setUp()
|
||||
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well" );
|
||||
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE, "CS_POLYLINE", "Polyline" );
|
||||
addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE, "CS_AZIMUTHLINE", "Azimuth and Dip" );
|
||||
setDefault( RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH );
|
||||
setDefault( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE );
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -87,7 +89,7 @@ void caf::AppEnum<RimExtrudedCurveIntersection::CrossSectionDirEnum>::setUp()
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CrossSection" );
|
||||
CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CurveIntersection", "CrossSection" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -196,14 +198,19 @@ void RimExtrudedCurveIntersection::configureForAzimuthLine()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Intersection", ":/CrossSection16x16.png" );
|
||||
CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name" );
|
||||
CAF_PDM_InitScriptableObject( "Intersection", ":/CrossSection16x16.png" );
|
||||
CAF_PDM_InitScriptableFieldWithScriptKeyword( &m_name, "UserDescription", "Name", QString( "Intersection Name" ), "Name" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_type, "Type", "Type" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_type, "Type", "Type" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_direction, "Direction", "Direction" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellPath, "WellPath", "Well Path " );
|
||||
CAF_PDM_InitFieldNoDefault( &m_simulationWell, "SimulationWell", "Simulation Well" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_userPolylineXyz, "Points", "Points", "", "Use Ctrl-C for copy and Ctrl-V for paste", "" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "Well Path " );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_simulationWell, "SimulationWell", "Simulation Well" );
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_userPolylineXyz,
|
||||
"Points",
|
||||
"Points",
|
||||
"",
|
||||
"Use Ctrl-C for copy and Ctrl-V for paste",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_userPolylineXydForUi, "PointsUi", "Points", "", "Use Ctrl-C for copy and Ctrl-V for paste", "" );
|
||||
m_userPolylineXydForUi.registerSetMethod( this, &RimExtrudedCurveIntersection::setPointsFromXYD );
|
||||
|
||||
@@ -38,19 +38,20 @@
|
||||
#include "RivBoxIntersectionPartMgr.h"
|
||||
#include "RivExtrudedCurveIntersectionPartMgr.h"
|
||||
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "CrossSectionCollection" );
|
||||
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "IntersectionCollection", "CrossSectionCollection" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionCollection::RimIntersectionCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Intersections", ":/CrossSections16x16.png" );
|
||||
CAF_PDM_InitScriptableObject( "Intersections", ":/CrossSections16x16.png" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_intersections, "CrossSections", "Intersections" );
|
||||
m_intersections.uiCapability()->setUiTreeHidden( true );
|
||||
@@ -404,6 +405,15 @@ void RimIntersectionCollection::onChildDeleted( caf::PdmChildArrayFieldHandle*
|
||||
rebuild3dView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::onChildAdded( caf::PdmFieldHandle* containerForNewObject )
|
||||
{
|
||||
syncronize2dIntersectionViews();
|
||||
rebuild3dView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -83,6 +83,8 @@ public:
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
Reference in New Issue
Block a user