#927 Rename from cross section to intersection

This commit is contained in:
Magne Sjaastad 2016-10-25 10:03:55 +02:00
parent 3dd0829efa
commit 442fb04a97
13 changed files with 78 additions and 86 deletions

View File

@ -48,12 +48,12 @@ void RicAppendIntersectionFeature::onActionTriggered(bool isChecked)
caf::SelectionManager::instance()->objectsByType(&collection);
CVF_ASSERT(collection.size() == 1);
RimIntersectionCollection* crossSectionCollection = NULL;
collection[0]->firstAncestorOrThisOfType(crossSectionCollection);
RimIntersectionCollection* intersectionCollection = NULL;
collection[0]->firstAncestorOrThisOfType(intersectionCollection);
CVF_ASSERT(crossSectionCollection);
CVF_ASSERT(intersectionCollection);
RicAppendIntersectionFeatureCmd* cmd = new RicAppendIntersectionFeatureCmd(crossSectionCollection);
RicAppendIntersectionFeatureCmd* cmd = new RicAppendIntersectionFeatureCmd(intersectionCollection);
caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd);
}
@ -69,9 +69,9 @@ void RicAppendIntersectionFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicAppendIntersectionFeatureCmd::RicAppendIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection)
RicAppendIntersectionFeatureCmd::RicAppendIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection)
: CmdExecuteCommand(NULL),
m_crossSectionCollection(crossSectionCollection)
m_intersectionCollection(intersectionCollection)
{
}
@ -95,11 +95,11 @@ QString RicAppendIntersectionFeatureCmd::name()
//--------------------------------------------------------------------------------------------------
void RicAppendIntersectionFeatureCmd::redo()
{
CVF_ASSERT(m_crossSectionCollection);
CVF_ASSERT(m_intersectionCollection);
RimIntersection* crossSection = new RimIntersection();
crossSection->name = QString("Intersection");
m_crossSectionCollection->appendCrossSection(crossSection);
RimIntersection* intersection = new RimIntersection();
intersection->name = QString("Intersection");
m_intersectionCollection->appendIntersection(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -32,7 +32,7 @@ class RimIntersectionCollection;
class RicAppendIntersectionFeatureCmd : public caf::CmdExecuteCommand
{
public:
RicAppendIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection);
RicAppendIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection);
virtual ~RicAppendIntersectionFeatureCmd();
virtual QString name();
@ -40,7 +40,7 @@ public:
virtual void undo();
private:
caf::PdmPointer<RimIntersectionCollection> m_crossSectionCollection;
caf::PdmPointer<RimIntersectionCollection> m_intersectionCollection;
};

View File

@ -88,22 +88,22 @@ bool RicNewPolylineIntersectionFeature::handleEvent(cvf::Object* eventObject)
RicViewerEventObject* polylineUiEvent = dynamic_cast<RicViewerEventObject*>(eventObject);
if (polylineUiEvent)
{
RimIntersection* crossSection = selection[0];
RimIntersection* intersection = selection[0];
RimCase* rimCase = NULL;
crossSection->firstAncestorOrThisOfType(rimCase);
intersection->firstAncestorOrThisOfType(rimCase);
CVF_ASSERT(rimCase);
if (crossSection->inputPolyLineFromViewerEnabled())
if (intersection->inputPolyLineFromViewerEnabled())
{
crossSection->appendPointToPolyLine(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
intersection->appendPointToPolyLine(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
// Further Ui processing is stopped when true is returned
return true;
}
else if (crossSection->inputExtrusionPointsFromViewerEnabled())
else if (intersection->inputExtrusionPointsFromViewerEnabled())
{
crossSection->appendPointToExtrusionDirection(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
intersection->appendPointToExtrusionDirection(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
// Further Ui processing is stopped when true is returned
return true;
@ -117,9 +117,9 @@ bool RicNewPolylineIntersectionFeature::handleEvent(cvf::Object* eventObject)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicNewPolylineIntersectionFeatureCmd::RicNewPolylineIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection)
RicNewPolylineIntersectionFeatureCmd::RicNewPolylineIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection)
: CmdExecuteCommand(NULL),
m_crossSectionCollection(crossSectionCollection)
m_intersectionCollection(intersectionCollection)
{
}
@ -143,18 +143,18 @@ QString RicNewPolylineIntersectionFeatureCmd::name()
//--------------------------------------------------------------------------------------------------
void RicNewPolylineIntersectionFeatureCmd::redo()
{
CVF_ASSERT(m_crossSectionCollection);
CVF_ASSERT(m_intersectionCollection);
RimIntersection* crossSection = new RimIntersection();
crossSection->name = "Polyline";
crossSection->type = RimIntersection::CS_POLYLINE;
crossSection->inputPolyLineFromViewerEnabled = true;
RimIntersection* intersection = new RimIntersection();
intersection->name = "Polyline";
intersection->type = RimIntersection::CS_POLYLINE;
intersection->inputPolyLineFromViewerEnabled = true;
m_crossSectionCollection->appendCrossSection(crossSection);
m_intersectionCollection->appendIntersection(intersection);
RiuSelectionManager::instance()->deleteAllItems();
RiuMainWindow::instance()->selectAsCurrentItem(crossSection);
RiuMainWindow::instance()->selectAsCurrentItem(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -37,7 +37,7 @@ class RimIntersectionCollection;
class RicNewPolylineIntersectionFeatureCmd : public caf::CmdExecuteCommand
{
public:
RicNewPolylineIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection);
RicNewPolylineIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection);
virtual ~RicNewPolylineIntersectionFeatureCmd();
virtual QString name();
@ -45,7 +45,7 @@ public:
virtual void undo();
private:
caf::PdmPointer<RimIntersectionCollection> m_crossSectionCollection;
caf::PdmPointer<RimIntersectionCollection> m_intersectionCollection;
};

View File

@ -72,9 +72,9 @@ void RicNewSimWellIntersectionFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicNewSimWellIntersectionCmd::RicNewSimWellIntersectionCmd(RimIntersectionCollection* crossSectionCollection, RimEclipseWell* simWell)
RicNewSimWellIntersectionCmd::RicNewSimWellIntersectionCmd(RimIntersectionCollection* intersectionCollection, RimEclipseWell* simWell)
: CmdExecuteCommand(NULL),
m_crossSectionCollection(crossSectionCollection),
m_intersectionCollection(intersectionCollection),
m_wellPath(simWell)
{
}
@ -99,15 +99,15 @@ QString RicNewSimWellIntersectionCmd::name()
//--------------------------------------------------------------------------------------------------
void RicNewSimWellIntersectionCmd::redo()
{
CVF_ASSERT(m_crossSectionCollection);
CVF_ASSERT(m_intersectionCollection);
CVF_ASSERT(m_wellPath);
RimIntersection* crossSection = new RimIntersection();
crossSection->name = m_wellPath->name;
crossSection->type = RimIntersection::CS_SIMULATION_WELL;
crossSection->simulationWell = m_wellPath;
RimIntersection* intersection = new RimIntersection();
intersection->name = m_wellPath->name;
intersection->type = RimIntersection::CS_SIMULATION_WELL;
intersection->simulationWell = m_wellPath;
m_crossSectionCollection->appendCrossSection(crossSection);
m_intersectionCollection->appendIntersection(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@ class RimEclipseWell;
class RicNewSimWellIntersectionCmd : public caf::CmdExecuteCommand
{
public:
RicNewSimWellIntersectionCmd(RimIntersectionCollection* crossSectionCollection, RimEclipseWell* simWell);
RicNewSimWellIntersectionCmd(RimIntersectionCollection* intersectionCollection, RimEclipseWell* simWell);
virtual ~RicNewSimWellIntersectionCmd();
virtual QString name();
@ -41,7 +41,7 @@ public:
virtual void undo();
private:
caf::PdmPointer<RimIntersectionCollection> m_crossSectionCollection;
caf::PdmPointer<RimIntersectionCollection> m_intersectionCollection;
caf::PdmPointer<RimEclipseWell> m_wellPath;
};

View File

@ -81,9 +81,9 @@ void RicNewWellPathIntersectionFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicNewWellPathIntersectionFeatureCmd::RicNewWellPathIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection, RimWellPath* wellPath)
RicNewWellPathIntersectionFeatureCmd::RicNewWellPathIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection, RimWellPath* wellPath)
: CmdExecuteCommand(NULL),
m_crossSectionCollection(crossSectionCollection),
m_intersectionCollection(intersectionCollection),
m_wellPath(wellPath)
{
}
@ -108,15 +108,15 @@ QString RicNewWellPathIntersectionFeatureCmd::name()
//--------------------------------------------------------------------------------------------------
void RicNewWellPathIntersectionFeatureCmd::redo()
{
CVF_ASSERT(m_crossSectionCollection);
CVF_ASSERT(m_intersectionCollection);
CVF_ASSERT(m_wellPath);
RimIntersection* crossSection = new RimIntersection();
crossSection->name = m_wellPath->name;
crossSection->type = RimIntersection::CS_WELL_PATH;
crossSection->wellPath = m_wellPath;
RimIntersection* intersection = new RimIntersection();
intersection->name = m_wellPath->name;
intersection->type = RimIntersection::CS_WELL_PATH;
intersection->wellPath = m_wellPath;
m_crossSectionCollection->appendCrossSection(crossSection);
m_intersectionCollection->appendIntersection(intersection);
}
//--------------------------------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@ class RimWellPath;
class RicNewWellPathIntersectionFeatureCmd : public caf::CmdExecuteCommand
{
public:
RicNewWellPathIntersectionFeatureCmd(RimIntersectionCollection* crossSectionCollection, RimWellPath* wellPath);
RicNewWellPathIntersectionFeatureCmd(RimIntersectionCollection* intersectionCollection, RimWellPath* wellPath);
virtual ~RicNewWellPathIntersectionFeatureCmd();
virtual QString name();
@ -41,7 +41,7 @@ public:
virtual void undo();
private:
caf::PdmPointer<RimIntersectionCollection> m_crossSectionCollection;
caf::PdmPointer<RimIntersectionCollection> m_intersectionCollection;
caf::PdmPointer<RimWellPath> m_wellPath;
};

View File

@ -180,7 +180,7 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
return true;
if (m_reservoirView->crossSectionCollection()->hasActiveCrossSectionForSimulationWell(this))
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
return true;
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)

View File

@ -370,7 +370,7 @@ std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivIntersectionPartMgr* RimIntersection::crossSectionPartMgr()
RivIntersectionPartMgr* RimIntersection::intersectionPartMgr()
{
if (m_crossSectionPartMgr.isNull()) m_crossSectionPartMgr = new RivIntersectionPartMgr(this);

View File

@ -78,7 +78,7 @@ public:
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
void appendPointToPolyLine(const cvf::Vec3d& point);
RivIntersectionPartMgr* crossSectionPartMgr();
RivIntersectionPartMgr* intersectionPartMgr();
std::vector< std::vector <cvf::Vec3d> > polyLinesForExtrusionDirection() const;
void appendPointToExtrusionDirection(const cvf::Vec3d& point);

View File

@ -19,15 +19,15 @@
#include "RimIntersectionCollection.h"
#include "RimIntersection.h"
#include "RimEclipseWell.h"
#include "RimIntersection.h"
#include "RimIntersectionBox.h"
#include "RimView.h"
#include "RiuMainWindow.h"
#include "RivIntersectionPartMgr.h"
#include "RimIntersectionBox.h"
#include "RivIntersectionBoxPartMgr.h"
#include "RivIntersectionPartMgr.h"
CAF_PDM_SOURCE_INIT(RimIntersectionCollection, "CrossSectionCollection");
@ -39,8 +39,8 @@ RimIntersectionCollection::RimIntersectionCollection()
{
CAF_PDM_InitObject("Intersections", ":/CrossSections16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_crossSections, "CrossSections", "Intersections", "", "", "");
m_crossSections.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_intersections, "CrossSections", "Intersections", "", "", "");
m_intersections.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes", "", "", "");
m_intersectionBoxes.uiCapability()->setUiHidden(true);
@ -54,7 +54,7 @@ RimIntersectionCollection::RimIntersectionCollection()
//--------------------------------------------------------------------------------------------------
RimIntersectionCollection::~RimIntersectionCollection()
{
m_crossSections.deleteAllChildObjects();
m_intersections.deleteAllChildObjects();
m_intersectionBoxes.deleteAllChildObjects();
}
@ -73,18 +73,16 @@ void RimIntersectionCollection::applySingleColorEffect()
{
if(!this->isActive()) return;
for (size_t csIdx = 0; csIdx < m_crossSections.size(); ++csIdx)
for (RimIntersection* cs : m_intersections)
{
RimIntersection* cs = m_crossSections[csIdx];
if (cs->isActive)
{
cs->crossSectionPartMgr()->applySingleColorEffect();
cs->intersectionPartMgr()->applySingleColorEffect();
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
for (RimIntersectionBox* cs : m_intersectionBoxes)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->applySingleColorEffect();
@ -99,18 +97,16 @@ void RimIntersectionCollection::updateCellResultColor(size_t timeStepIndex)
{
if(!this->isActive()) return;
for(size_t csIdx = 0; csIdx < m_crossSections.size(); ++csIdx)
for (RimIntersection* cs : m_intersections)
{
RimIntersection* cs = m_crossSections[csIdx];
if(cs->isActive)
{
cs->crossSectionPartMgr()->updateCellResultColor(timeStepIndex);
cs->intersectionPartMgr()->updateCellResultColor(timeStepIndex);
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
for (RimIntersectionBox* cs : m_intersectionBoxes)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->updateCellResultColor(timeStepIndex);
@ -125,20 +121,18 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
{
if (!isActive) return;
for (size_t csIdx = 0; csIdx < m_crossSections.size(); ++csIdx)
for (RimIntersection* cs : m_intersections)
{
RimIntersection* cs = m_crossSections[csIdx];
if (cs->isActive)
{
cs->crossSectionPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
cs->crossSectionPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
cs->crossSectionPartMgr()->appendPolylinePartsToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendPolylinePartsToModel(model, scaleTransform);
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
for (RimIntersectionBox* cs : m_intersectionBoxes)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
@ -155,12 +149,12 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendCrossSection(RimIntersection* crossSection)
void RimIntersectionCollection::appendIntersection(RimIntersection* intersection)
{
m_crossSections.push_back(crossSection);
m_intersections.push_back(intersection);
updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(crossSection);
RiuMainWindow::instance()->selectAsCurrentItem(intersection);
RimView* rimView = NULL;
firstAncestorOrThisOfType(rimView);
@ -197,14 +191,12 @@ void RimIntersectionCollection::fieldChangedByUi(const caf::PdmFieldHandle* chan
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionCollection::hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const
bool RimIntersectionCollection::hasActiveIntersectionForSimulationWell(RimEclipseWell* eclipseWell) const
{
if (!isActive) return false;
for (size_t csIdx = 0; csIdx < m_crossSections.size(); ++csIdx)
for (RimIntersection* cs : m_intersections)
{
RimIntersection* cs = m_crossSections[csIdx];
if (cs->isActive &&
cs->type() == RimIntersection::CS_SIMULATION_WELL &&
cs->simulationWell() == eclipseWell)
@ -221,7 +213,7 @@ bool RimIntersectionCollection::hasActiveCrossSectionForSimulationWell(RimEclips
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::updateIntersectionBoxGeometry()
{
for (auto intersectionBox : m_intersectionBoxes)
for (RimIntersectionBox* intersectionBox : m_intersectionBoxes)
{
intersectionBox->updateBoxManipulatorGeometry();
}

View File

@ -48,10 +48,10 @@ public:
caf::PdmField<bool> isActive;
void appendCrossSection(RimIntersection* crossSection);
void appendIntersection(RimIntersection* intersection);
void appendIntersectionBox(RimIntersectionBox* intersectionBox);
bool hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const;
bool hasActiveIntersectionForSimulationWell(RimEclipseWell* eclipseWell) const;
void updateIntersectionBoxGeometry();
@ -66,6 +66,6 @@ protected:
virtual caf::PdmFieldHandle* objectToggleField();
private:
caf::PdmChildArrayField<RimIntersection*> m_crossSections;
caf::PdmChildArrayField<RimIntersection*> m_intersections;
caf::PdmChildArrayField<RimIntersectionBox*> m_intersectionBoxes;
};