mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#884 Intersection collection is responsible for adding box manipulator geometry to model used in 3D viewer
This commit is contained in:
@@ -96,10 +96,8 @@ RimIntersectionBox::RimIntersectionBox()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionBox::~RimIntersectionBox()
|
||||
{
|
||||
if (m_boxManipulator && viewer())
|
||||
if (m_boxManipulator)
|
||||
{
|
||||
viewer()->removeStaticModel(m_boxManipulator->model());
|
||||
|
||||
m_boxManipulator->deleteLater();
|
||||
}
|
||||
}
|
||||
@@ -144,6 +142,14 @@ void RimIntersectionBox::setFromOriginAndSize(const cvf::Vec3d& origin, const cv
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIntersectionBox::show3dManipulator() const
|
||||
{
|
||||
return m_show3DManipulator;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -213,6 +219,17 @@ RivIntersectionBoxPartMgr* RimIntersectionBox::intersectionBoxPartMgr()
|
||||
return m_intersectionBoxPartMgr.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::appendManipulatorPartsToModel(cvf::ModelBasicList* model)
|
||||
{
|
||||
if (show3dManipulator() && m_boxManipulator)
|
||||
{
|
||||
m_boxManipulator->appendPartsToModel(model);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -269,11 +286,6 @@ void RimIntersectionBox::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
|
||||
{
|
||||
if (m_boxManipulator)
|
||||
{
|
||||
if (viewer())
|
||||
{
|
||||
viewer()->removeStaticModel(m_boxManipulator->model());
|
||||
}
|
||||
|
||||
m_boxManipulator->deleteLater();
|
||||
m_boxManipulator = nullptr;
|
||||
}
|
||||
@@ -410,15 +422,10 @@ void RimIntersectionBox::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::slotScheduleRedraw()
|
||||
{
|
||||
if (viewer())
|
||||
{
|
||||
viewer()->addStaticModelOnce(m_boxManipulator->model());
|
||||
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
RimView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -32,6 +32,10 @@ class RicBoxManipulatorEventHandler;
|
||||
class RiuViewer;
|
||||
class RivIntersectionBoxPartMgr;
|
||||
|
||||
namespace cvf {
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
@@ -66,7 +70,9 @@ public:
|
||||
SinglePlaneState singlePlaneState() const;
|
||||
void setFromOriginAndSize(const cvf::Vec3d& origin, const cvf::Vec3d& size);
|
||||
|
||||
bool show3dManipulator() const;
|
||||
RivIntersectionBoxPartMgr* intersectionBoxPartMgr();
|
||||
void appendManipulatorPartsToModel(cvf::ModelBasicList* model);
|
||||
|
||||
void setToDefaultSizeBox();
|
||||
void setToDefaultSizeSlice(SinglePlaneState plane, const cvf::Vec3d& position);
|
||||
|
||||
@@ -147,6 +147,11 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
|
||||
{
|
||||
cs->intersectionBoxPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
|
||||
cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
|
||||
|
||||
if (cs->show3dManipulator())
|
||||
{
|
||||
cs->appendManipulatorPartsToModel(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user