mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#404) Use only one structure for well path geometry
This commit is contained in:
parent
1977578d90
commit
c4eee507a8
@ -90,7 +90,7 @@ RivWellPathPartMgr::RivWellPathPartMgr(RimWellPathCollection* wellPathCollection
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellPathPartMgr::~RivWellPathPartMgr()
|
||||
{
|
||||
|
||||
clearAllBranchData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -106,15 +106,14 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
|
||||
|
||||
if (wellPathGeometry->m_wellPathPoints.size() < 2) return;
|
||||
|
||||
m_wellBranches.clear();
|
||||
clearAllBranchData();
|
||||
double wellPathRadius = m_wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize;
|
||||
|
||||
cvf::Vec3d textPosition = wellPathGeometry->m_wellPathPoints[0];
|
||||
|
||||
// Generate the well path geometry as a line and pipe structure
|
||||
{
|
||||
m_wellBranches.push_back(RivPipeBranchData());
|
||||
RivPipeBranchData& pbd = m_wellBranches.back();
|
||||
RivPipeBranchData& pbd = m_pipeBranchData;
|
||||
|
||||
pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator;
|
||||
|
||||
@ -243,17 +242,14 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
|
||||
buildWellPathParts(displayModelOffset, characteristicCellSize, wellPathClipBoundingBox);
|
||||
}
|
||||
|
||||
std::list<RivPipeBranchData>::iterator it;
|
||||
for (it = m_wellBranches.begin(); it != m_wellBranches.end(); ++it)
|
||||
if (m_pipeBranchData.m_surfacePart.notNull())
|
||||
{
|
||||
if (it->m_surfacePart.notNull())
|
||||
{
|
||||
model->addPart(it->m_surfacePart.p());
|
||||
}
|
||||
if (it->m_centerLinePart.notNull())
|
||||
{
|
||||
model->addPart(it->m_centerLinePart.p());
|
||||
}
|
||||
model->addPart(m_pipeBranchData.m_surfacePart.p());
|
||||
}
|
||||
|
||||
if (m_pipeBranchData.m_centerLinePart.notNull())
|
||||
{
|
||||
model->addPart(m_pipeBranchData.m_centerLinePart.p());
|
||||
}
|
||||
|
||||
if (m_wellLabelPart.notNull())
|
||||
@ -262,6 +258,9 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::setScaleTransform( cvf::Transform * scaleTransform )
|
||||
{
|
||||
if (m_scaleTransform.isNull() || m_scaleTransform.p() != scaleTransform)
|
||||
@ -270,3 +269,15 @@ void RivWellPathPartMgr::setScaleTransform( cvf::Transform * scaleTransform )
|
||||
scheduleGeometryRegen();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::clearAllBranchData()
|
||||
{
|
||||
m_pipeBranchData.m_pipeGeomGenerator = NULL;
|
||||
m_pipeBranchData.m_surfacePart = NULL;
|
||||
m_pipeBranchData.m_surfaceDrawable = NULL;
|
||||
m_pipeBranchData.m_centerLinePart = NULL;
|
||||
m_pipeBranchData.m_centerLineDrawable = NULL;
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ private:
|
||||
bool m_needsTransformUpdate;
|
||||
|
||||
void buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox);
|
||||
void clearAllBranchData();
|
||||
|
||||
struct RivPipeBranchData
|
||||
{
|
||||
@ -71,7 +72,6 @@ private:
|
||||
};
|
||||
|
||||
RivPipeBranchData m_pipeBranchData;
|
||||
std::list<RivPipeBranchData> m_wellBranches;
|
||||
cvf::ref<cvf::Part> m_wellLabelPart;
|
||||
|
||||
cvf::ref<cvf::ScalarMapper> m_scalarMapper;
|
||||
|
Loading…
Reference in New Issue
Block a user