#2431 : Removed obsolete struct

This commit is contained in:
Magne Sjaastad 2018-02-06 11:09:22 +01:00
parent daad891b24
commit 4fdb7671a8
2 changed files with 40 additions and 44 deletions

View File

@ -228,13 +228,11 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
// Generate the well path geometry as a line and pipe structure
{
RivPipeBranchData& pbd = m_pipeBranchData;
m_pipeGeomGenerator = new RivPipeGeometryGenerator;
pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator;
pbd.m_pipeGeomGenerator->setRadius(wellPathRadius);
pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount());
pbd.m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor());
m_pipeGeomGenerator->setRadius(wellPathRadius);
m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount());
m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor());
cvf::ref<cvf::Vec3dArray> cvfCoords = new cvf::Vec3dArray;
if (wellPathCollection->wellPathClip)
@ -264,11 +262,11 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
stepsize * (wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex] - wellPathGeometry->m_wellPathPoints[firstVisibleSegmentIndex - 1]);
clippedPoints.push_back(newPoint);
pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex - 1);
m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex - 1);
}
else
{
pbd.m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex);
m_pipeGeomGenerator->setFirstVisibleSegmentIndex(firstVisibleSegmentIndex);
}
for (size_t idx = firstVisibleSegmentIndex; idx < wellPathGeometry->m_wellPathPoints.size(); idx++)
@ -295,33 +293,33 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
textPosition = cvfCoords->get(0);
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
pbd.m_surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface();
pbd.m_centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine();
m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
m_surfaceDrawable = m_pipeGeomGenerator->createPipeSurface();
m_centerLineDrawable = m_pipeGeomGenerator->createCenterLine();
if (pbd.m_surfaceDrawable.notNull())
if (m_surfaceDrawable.notNull())
{
pbd.m_surfacePart = new cvf::Part;
pbd.m_surfacePart->setDrawable(pbd.m_surfaceDrawable.p());
m_surfacePart = new cvf::Part;
m_surfacePart->setDrawable(m_surfaceDrawable.p());
RivWellPathSourceInfo* sourceInfo = new RivWellPathSourceInfo(m_rimWellPath, m_rimView);
pbd.m_surfacePart->setSourceInfo(sourceInfo);
m_surfacePart->setSourceInfo(sourceInfo);
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(m_rimWellPath->wellPathColor()), caf::PO_1);
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
pbd.m_surfacePart->setEffect(eff.p());
m_surfacePart->setEffect(eff.p());
}
if (pbd.m_centerLineDrawable.notNull())
if (m_centerLineDrawable.notNull())
{
pbd.m_centerLinePart = new cvf::Part;
pbd.m_centerLinePart->setDrawable(pbd.m_centerLineDrawable.p());
m_centerLinePart = new cvf::Part;
m_centerLinePart->setDrawable(m_centerLineDrawable.p());
caf::MeshEffectGenerator gen(m_rimWellPath->wellPathColor());
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
pbd.m_centerLinePart->setEffect(eff.p());
m_centerLinePart->setEffect(eff.p());
}
}
@ -329,7 +327,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
textPosition.z() += 2.2 * characteristicCellSize;
m_wellLabelPart = nullptr;
if (wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty())
{
cvf::Font* font = RiaApplication::instance()->customFont();
@ -382,14 +379,14 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
if (m_pipeBranchData.m_surfacePart.notNull())
if (m_surfacePart.notNull())
{
model->addPart(m_pipeBranchData.m_surfacePart.p());
model->addPart(m_surfacePart.p());
}
if (m_pipeBranchData.m_centerLinePart.notNull())
if (m_centerLinePart.notNull())
{
model->addPart(m_pipeBranchData.m_centerLinePart.p());
model->addPart(m_centerLinePart.p());
}
if (m_wellLabelPart.notNull())
@ -431,11 +428,12 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::clearAllBranchData()
{
m_pipeBranchData.m_pipeGeomGenerator = nullptr;
m_pipeBranchData.m_surfacePart = nullptr;
m_pipeBranchData.m_surfaceDrawable = nullptr;
m_pipeBranchData.m_centerLinePart = nullptr;
m_pipeBranchData.m_centerLineDrawable = nullptr;
m_pipeGeomGenerator = nullptr;
m_surfacePart = nullptr;
m_surfaceDrawable = nullptr;
m_centerLinePart = nullptr;
m_centerLineDrawable = nullptr;
m_wellLabelPart = nullptr;
}
//--------------------------------------------------------------------------------------------------
@ -443,7 +441,7 @@ void RivWellPathPartMgr::clearAllBranchData()
//--------------------------------------------------------------------------------------------------
size_t RivWellPathPartMgr::segmentIndexFromTriangleIndex(size_t triangleIndex)
{
return m_pipeBranchData.m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex);
return m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex);
}
//--------------------------------------------------------------------------------------------------

View File

@ -48,6 +48,9 @@ class Rim3dView;
class QDateTime;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RivWellPathPartMgr : public cvf::Object
{
public:
@ -95,18 +98,13 @@ private:
inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection);
private:
caf::PdmPointer<RimWellPath> m_rimWellPath;
caf::PdmPointer<Rim3dView> m_rimView;
caf::PdmPointer<RimWellPath> m_rimWellPath;
caf::PdmPointer<Rim3dView> m_rimView;
struct RivPipeBranchData
{
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
cvf::ref<cvf::Part> m_surfacePart;
cvf::ref<cvf::DrawableGeo> m_surfaceDrawable;
cvf::ref<cvf::Part> m_centerLinePart;
cvf::ref<cvf::DrawableGeo> m_centerLineDrawable;
};
RivPipeBranchData m_pipeBranchData;
cvf::ref<cvf::Part> m_wellLabelPart;
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
cvf::ref<cvf::Part> m_surfacePart;
cvf::ref<cvf::DrawableGeo> m_surfaceDrawable;
cvf::ref<cvf::Part> m_centerLinePart;
cvf::ref<cvf::DrawableGeo> m_centerLineDrawable;
cvf::ref<cvf::Part> m_wellLabelPart;
};