mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add option to flip node order for both parts
Use data node coordinates to decide element sets
This commit is contained in:
parent
336dc575db
commit
0fd4ec6d0d
@ -99,6 +99,8 @@ RimFaultReactivationModel::RimFaultReactivationModel()
|
||||
CAF_PDM_InitField( &m_faultZoneCells, "FaultZoneCells", 0, "Fault Zone Width [cells]" );
|
||||
|
||||
CAF_PDM_InitField( &m_showModelPlane, "ShowModelPlane", true, "Show 2D Model" );
|
||||
CAF_PDM_InitField( &m_flipNodeOrderFW, "FlipNodeOrderFW", false, "FW: Flip Node Order" );
|
||||
CAF_PDM_InitField( &m_flipNodeOrderHW, "FlipNodeOrderHW", false, "HW: Flip Node Order" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fault, "Fault", "Fault" );
|
||||
m_fault.uiCapability()->setUiReadOnly( true );
|
||||
@ -342,6 +344,7 @@ void RimFaultReactivationModel::updateVisualization()
|
||||
m_2Dmodel->setGenerator( generator );
|
||||
m_2Dmodel->updateGeometry( m_startCellIndex, (cvf::StructGridInterface::FaceType)m_startCellFace() );
|
||||
m_2Dmodel->postProcessElementSets( eclipseCase() );
|
||||
m_2Dmodel->flipNodeOrder( m_flipNodeOrderFW, m_flipNodeOrderHW );
|
||||
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
@ -472,6 +475,9 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
|
||||
gridModelGrp->add( &m_modelThickness );
|
||||
|
||||
gridModelGrp->add( &m_flipNodeOrderFW );
|
||||
gridModelGrp->add( &m_flipNodeOrderHW );
|
||||
|
||||
auto appModelGrp = modelGrp->addNewGroup( "Appearance" );
|
||||
appModelGrp->setCollapsedByDefault();
|
||||
appModelGrp->add( &m_modelPart1Color );
|
||||
|
@ -162,6 +162,8 @@ private:
|
||||
caf::PdmField<cvf::Color3f> m_modelPart2Color;
|
||||
|
||||
caf::PdmField<bool> m_showModelPlane;
|
||||
caf::PdmField<bool> m_flipNodeOrderFW;
|
||||
caf::PdmField<bool> m_flipNodeOrderHW;
|
||||
|
||||
caf::PdmField<double> m_modelExtentFromAnchor;
|
||||
caf::PdmField<double> m_modelMinZ;
|
||||
|
@ -264,3 +264,12 @@ void RigFaultReactivationModel::postProcessElementSets( const RimEclipseCase* eC
|
||||
m_3dparts[part]->postProcessElementSets( eCase->mainGrid(), cellInfo );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFaultReactivationModel::flipNodeOrder( bool flipFW, bool flipHW )
|
||||
{
|
||||
if ( flipFW ) m_3dparts[GridPart::FW]->flipNodeOrder();
|
||||
if ( flipHW ) m_3dparts[GridPart::HW]->flipNodeOrder();
|
||||
}
|
@ -87,6 +87,7 @@ public:
|
||||
RimFaultReactivation::GridPart normalPointsAt() const;
|
||||
|
||||
void postProcessElementSets( const RimEclipseCase* eCase );
|
||||
void flipNodeOrder( bool flipFW, bool flipHW );
|
||||
|
||||
private:
|
||||
std::shared_ptr<RigFaultReactivationModelGenerator> m_generator;
|
||||
|
@ -688,7 +688,7 @@ void RigGriddedPart3d::postProcessElementSets( const RigMainGrid* mainGrid, cons
|
||||
{
|
||||
if ( usedElements.contains( element ) ) continue;
|
||||
|
||||
auto corners = elementCorners( element );
|
||||
auto corners = elementDataCorners( element );
|
||||
bool bActive = false;
|
||||
|
||||
size_t cellIdx = 0;
|
||||
@ -738,7 +738,7 @@ void RigGriddedPart3d::updateElementSet( ElementSets elSet,
|
||||
break;
|
||||
}
|
||||
|
||||
auto corners = elementCorners( elIdx + t );
|
||||
auto corners = elementDataCorners( elIdx + t );
|
||||
|
||||
size_t cellIdx = 0;
|
||||
for ( const auto& p : corners )
|
||||
@ -767,3 +767,15 @@ void RigGriddedPart3d::updateElementSet( ElementSets elSet,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGriddedPart3d::flipNodeOrder()
|
||||
{
|
||||
for ( auto& nodes : m_elementIndices )
|
||||
{
|
||||
std::swap( nodes[1], nodes[3] );
|
||||
std::swap( nodes[5], nodes[7] );
|
||||
}
|
||||
}
|
@ -61,6 +61,7 @@ public:
|
||||
void setUseLocalCoordinates( bool useLocalCoordinates );
|
||||
|
||||
void postProcessElementSets( const RigMainGrid* mainGrid, const RigActiveCellInfo* cellInfo );
|
||||
void flipNodeOrder();
|
||||
|
||||
bool useLocalCoordinates() const;
|
||||
double topHeight() const;
|
||||
|
Loading…
Reference in New Issue
Block a user