(#404) Cleaned up includes and removed collection from constructor

This commit is contained in:
Magne Sjaastad 2015-12-03 19:31:34 +01:00
parent c4eee507a8
commit 27db48a336
3 changed files with 37 additions and 49 deletions

View File

@ -19,47 +19,35 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#include "cvfLibCore.h" #include "RivWellPathPartMgr.h"
#include "RiaApplication.h" #include "RiaApplication.h"
#include "RimEclipseCase.h"
#include "RimProject.h" #include "RigWellPath.h"
#include "RimWellPathCollection.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimScriptCollection.h"
#include "RimCaseCollection.h"
#include "RimEclipseCellColors.h"
#include "RimCellEdgeColors.h"
#include "RimCellRangeFilterCollection.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimEclipseWellCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimEclipseView.h"
#include "RigCaseData.h"
#include "RigCell.h"
#include "RivWellPathPartMgr.h"
#include "RivWellPathSourceInfo.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RivPipeGeometryGenerator.h" #include "RivPipeGeometryGenerator.h"
#include "cvfModelBasicList.h" #include "RivWellPathSourceInfo.h"
#include "cvfTransform.h"
#include "cvfPart.h" #include "cafEffectGenerator.h"
#include "cvfScalarMapperDiscreteLinear.h"
#include "cvfDrawableGeo.h" #include "cvfDrawableGeo.h"
#include "cvfDrawableText.h" #include "cvfDrawableText.h"
#include "cvfRay.h" #include "cvfFont.h"
#include "cafEffectGenerator.h" #include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfScalarMapperDiscreteLinear.h"
#include "cvfTransform.h"
#include "cvfqtUtils.h" #include "cvfqtUtils.h"
#include "RimOilField.h"
#include "RimEclipseCaseCollection.h"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RivWellPathPartMgr::RivWellPathPartMgr(RimWellPathCollection* wellPathCollection, RimWellPath* wellPath) RivWellPathPartMgr::RivWellPathPartMgr(RimWellPath* wellPath)
{ {
m_wellPathCollection = wellPathCollection;
m_rimWellPath = wellPath; m_rimWellPath = wellPath;
m_needsTransformUpdate = true; m_needsTransformUpdate = true;
@ -99,7 +87,9 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox) cvf::BoundingBox wellPathClipBoundingBox)
{ {
if (m_wellPathCollection.isNull()) return; RimWellPathCollection* wellPathCollection = NULL;
m_rimWellPath->firstAnchestorOrThisOfType(wellPathCollection);
if (!wellPathCollection) return;
RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry(); RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry();
if (!wellPathGeometry) return; if (!wellPathGeometry) return;
@ -107,7 +97,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
if (wellPathGeometry->m_wellPathPoints.size() < 2) return; if (wellPathGeometry->m_wellPathPoints.size() < 2) return;
clearAllBranchData(); clearAllBranchData();
double wellPathRadius = m_wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize; double wellPathRadius = wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize;
cvf::Vec3d textPosition = wellPathGeometry->m_wellPathPoints[0]; cvf::Vec3d textPosition = wellPathGeometry->m_wellPathPoints[0];
@ -118,17 +108,17 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator; pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator;
pbd.m_pipeGeomGenerator->setRadius(wellPathRadius); pbd.m_pipeGeomGenerator->setRadius(wellPathRadius);
pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(m_wellPathCollection->wellPathCrossSectionVertexCount()); pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(wellPathCollection->wellPathCrossSectionVertexCount());
pbd.m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor()); pbd.m_pipeGeomGenerator->setPipeColor( m_rimWellPath->wellPathColor());
cvf::ref<cvf::Vec3dArray> cvfCoords = new cvf::Vec3dArray; cvf::ref<cvf::Vec3dArray> cvfCoords = new cvf::Vec3dArray;
if (m_wellPathCollection->wellPathClip) if (wellPathCollection->wellPathClip)
{ {
std::vector<cvf::Vec3d> clippedPoints; std::vector<cvf::Vec3d> clippedPoints;
for (size_t idx = 0; idx < wellPathGeometry->m_wellPathPoints.size(); idx++) for (size_t idx = 0; idx < wellPathGeometry->m_wellPathPoints.size(); idx++)
{ {
cvf::Vec3d point = wellPathGeometry->m_wellPathPoints[idx]; cvf::Vec3d point = wellPathGeometry->m_wellPathPoints[idx];
if (point.z() < (wellPathClipBoundingBox.max().z() + m_wellPathCollection->wellPathClipZDistance)) if (point.z() < (wellPathClipBoundingBox.max().z() + wellPathCollection->wellPathClipZDistance))
clippedPoints.push_back(point); clippedPoints.push_back(point);
} }
if (clippedPoints.size() < 2) return; if (clippedPoints.size() < 2) return;
@ -188,7 +178,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
textPosition.z() += 1.2 * characteristicCellSize; textPosition.z() += 1.2 * characteristicCellSize;
m_wellLabelPart = NULL; m_wellLabelPart = NULL;
if (m_wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty()) if (wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty())
{ {
cvf::Font* standardFont = RiaApplication::instance()->standardFont(); cvf::Font* standardFont = RiaApplication::instance()->standardFont();
@ -198,7 +188,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
drawableText->setDrawBorder(false); drawableText->setDrawBorder(false);
drawableText->setDrawBackground(false); drawableText->setDrawBackground(false);
drawableText->setVerticalAlignment(cvf::TextDrawer::CENTER); drawableText->setVerticalAlignment(cvf::TextDrawer::CENTER);
drawableText->setTextColor(m_wellPathCollection->wellPathLabelColor()); drawableText->setTextColor(wellPathCollection->wellPathLabelColor());
cvf::String cvfString = cvfqt::Utils::toString(m_rimWellPath->name()); cvf::String cvfString = cvfqt::Utils::toString(m_rimWellPath->name());
@ -227,13 +217,16 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset,
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox) double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox)
{ {
if (m_wellPathCollection.isNull()) return; RimWellPathCollection* wellPathCollection = NULL;
m_rimWellPath->firstAnchestorOrThisOfType(wellPathCollection);
if (!wellPathCollection) return;
if (m_rimWellPath.isNull()) return; if (m_rimWellPath.isNull()) return;
if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) if (wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF)
return; return;
if (m_wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false ) if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false )
return; return;
if (m_needsTransformUpdate) if (m_needsTransformUpdate)

View File

@ -22,7 +22,6 @@
#include "cafPdmPointer.h" #include "cafPdmPointer.h"
#include "cvfBoundingBox.h" #include "cvfBoundingBox.h"
#include <list>
namespace cvf namespace cvf
{ {
@ -37,12 +36,11 @@ namespace cvf
class RivPipeGeometryGenerator; class RivPipeGeometryGenerator;
class RimProject; class RimProject;
class RimWellPath; class RimWellPath;
class RimWellPathCollection;
class RivWellPathPartMgr : public cvf::Object class RivWellPathPartMgr : public cvf::Object
{ {
public: public:
RivWellPathPartMgr(RimWellPathCollection* wellPathCollection, RimWellPath* wellPath); RivWellPathPartMgr(RimWellPath* wellPath);
~RivWellPathPartMgr(); ~RivWellPathPartMgr();
void setScaleTransform(cvf::Transform * scaleTransform); void setScaleTransform(cvf::Transform * scaleTransform);
@ -53,7 +51,6 @@ public:
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox); double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox);
private: private:
caf::PdmPointer<RimWellPathCollection> m_wellPathCollection;
caf::PdmPointer<RimWellPath> m_rimWellPath; caf::PdmPointer<RimWellPath> m_rimWellPath;
cvf::ref<cvf::Transform> m_scaleTransform; cvf::ref<cvf::Transform> m_scaleTransform;

View File

@ -129,7 +129,6 @@ caf::PdmFieldHandle* RimWellPath::userDescriptionField()
return &name; return &name;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -142,20 +141,21 @@ void RimWellPath::setSurveyType(QString surveyType)
wellPathColor = cvf::Color3f(0.0f, 0.333f, 0.999f); wellPathColor = cvf::Color3f(0.0f, 0.333f, 0.999f);
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivWellPathPartMgr* RimWellPath::partMgr() RivWellPathPartMgr* RimWellPath::partMgr()
{ {
if (m_wellPathPartMgr.isNull()) if (m_wellPathPartMgr.isNull())
{ {
RimWellPathCollection* wpColl; RimWellPathCollection* wpColl;
this->firstAnchestorOrThisOfType(wpColl); this->firstAnchestorOrThisOfType(wpColl);
if (wpColl) m_wellPathPartMgr = new RivWellPathPartMgr(wpColl, this); if (wpColl) m_wellPathPartMgr = new RivWellPathPartMgr(this);
} }
return m_wellPathPartMgr.p(); return m_wellPathPartMgr.p();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -168,7 +168,6 @@ void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
if (proj) proj->createDisplayModelAndRedrawAllViews(); if (proj) proj->createDisplayModelAndRedrawAllViews();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -177,7 +176,6 @@ caf::PdmFieldHandle* RimWellPath::objectToggleField()
return &showWellPath; return &showWellPath;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Read JSON or ascii file containing well path data /// Read JSON or ascii file containing well path data
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------