#1543 Naming and fixes from review

This commit is contained in:
Bjørnar Grip Fjær
2017-06-02 10:35:52 +02:00
parent a52d70c424
commit b82aed4bfc
17 changed files with 28 additions and 20 deletions

View File

@@ -87,7 +87,7 @@ void RimCompletionCellIntersectionCalc::calculateFishbonesIntersections(const Ri
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, fishbonesSubs->coordsForLateral(sub.subIndex, lateralIndex));
for (auto& intersection : intersections)
{
values[intersection.m_hexIndex] = RimDefines::FISHBONE;
values[intersection.m_hexIndex] = RimDefines::FISHBONES;
}
}
}

View File

@@ -103,7 +103,7 @@ void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* comple
firstAncestorOrThisOfTypeAsserted(project);
if (project)
{
project->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
project->reloadCompletionTypeResultsInAllViews();
}
}

View File

@@ -291,7 +291,7 @@ void RimFishbonesMultipleSubs::fieldChangedByUi(const caf::PdmFieldHandle* chang
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
proj->reloadCompletionTypeResultsInAllViews();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -77,7 +77,7 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
proj->reloadCompletionTypeResultsInAllViews();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -145,7 +145,7 @@ void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changed
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
proj->reloadCompletionTypeResultsInAllViews();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -70,7 +70,7 @@ namespace caf
{
addItem(RimDefines::WELL_PATH, "WELL_PATH", "Well Path");
addItem(RimDefines::PERFORATION_INTERVAL, "PERFORATION_INTERVAL", "Perforation Interval");
addItem(RimDefines::FISHBONE, "FISHBONE", "Fishbone");
addItem(RimDefines::FISHBONES, "FISHBONES", "Fishbones");
setDefault(RimDefines::WELL_PATH);
}

View File

@@ -46,7 +46,7 @@ public:
enum CompletionType {
WELL_PATH,
PERFORATION_INTERVAL,
FISHBONE
FISHBONES
};
static bool isPerCellFaceResult(const QString& resultName);

View File

@@ -249,7 +249,7 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseCase::removeResult(RimDefines::ResultCatType type, const QString& resultName)
void RimEclipseCase::removeEclipseResultAndScheduleRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName)
{
m_matrixModelResults->clearScalarResult(type, resultName);

View File

@@ -78,7 +78,7 @@ public:
RimEclipseView* createAndAddReservoirView();
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
void removeResult(RimDefines::ResultCatType type, const QString& resultName);
void removeEclipseResultAndScheduleRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName);
virtual QString locationOnDisc() const { return QString(); }
virtual QString gridFileName() const { return QString(); }

View File

@@ -387,7 +387,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
std::vector< std::tuple<QString, int, cvf::Color3ub> > categories;
caf::AppEnum<RimDefines::CompletionType> wellPath(RimDefines::WELL_PATH);
caf::AppEnum<RimDefines::CompletionType> fishbone(RimDefines::FISHBONE);
caf::AppEnum<RimDefines::CompletionType> fishbone(RimDefines::FISHBONES);
caf::AppEnum<RimDefines::CompletionType> perforationInterval(RimDefines::PERFORATION_INTERVAL);
categories.push_back(std::make_tuple(wellPath.uiText(), wellPath.index(), cvf::Color3::RED));

View File

@@ -766,11 +766,19 @@ bool RimProject::showPlotWindow() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::removeResult(RimDefines::ResultCatType type, const QString & resultName)
void RimProject::reloadCompletionTypeResultsInAllViews()
{
removeEclipseResultAndRedrawAllViews(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::removeEclipseResultAndRedrawAllViews(RimDefines::ResultCatType type, const QString & resultName)
{
for (RimEclipseCase* eclipseCase : activeOilField()->analysisModels->cases)
{
eclipseCase->removeResult(type, resultName);
eclipseCase->removeEclipseResultAndScheduleRedrawAllViews(type, resultName);
}
}

View File

@@ -108,7 +108,8 @@ public:
bool show3DWindow() const;
bool showPlotWindow() const;
void removeResult(RimDefines::ResultCatType type, const QString& resultName);
void reloadCompletionTypeResultsInAllViews();
protected:
// Overridden methods
@@ -120,6 +121,7 @@ protected:
private:
void appendScriptItems(QMenu* menu, RimScriptCollection* scriptCollection);
void removeEclipseResultAndRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName);
private:
caf::PdmField<QString> m_projectFileVersionString;

View File

@@ -243,7 +243,7 @@ void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
this->firstAncestorOrThisOfTypeAsserted(proj);
if (changedField == &showWellPath)
{
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
proj->reloadCompletionTypeResultsInAllViews();
}
else
{

View File

@@ -217,7 +217,7 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
RimProject* proj;
firstAncestorOrThisOfTypeAsserted(proj);
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
proj->reloadCompletionTypeResultsInAllViews();
}