#2609 Cleanup RimWellPath ready for refactor into two classes

This commit is contained in:
Jacob Støren
2018-06-18 17:13:30 +02:00
parent 22bf33d02f
commit 5059201126
4 changed files with 186 additions and 117 deletions

View File

@@ -69,9 +69,31 @@ public:
RimWellPath();
virtual ~RimWellPath();
QString name() const;
void setName(const QString& name);
const QString associatedSimulationWellName() const;
int associatedSimulationWellBranch() const;
bool tryAssociateWithSimulationWell();
bool isAssociatedWithSimulationWell() const;
QString filepath() const;
void setFilepath(const QString& path);
bool readWellPathFile(QString * errorMessage, RifWellPathImporter* wellPathImporter);
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
int wellPathIndexInFile() const; // -1 means none.
void setWellPathIndexInFile(int index);
void setUnitSystem(RiaEclipseUnitTools::UnitSystem unitSystem);
RiaEclipseUnitTools::UnitSystem unitSystem() const;
RigWellPath* wellPathGeometry();
const RigWellPath* wellPathGeometry() const;
void addWellLogFile(RimWellLogFile* logFileInfo);
void deleteWellLogFile(RimWellLogFile* logFileInfo);
void detachWellLogFile(RimWellLogFile* logFileInfo);
std::vector<RimWellLogFile*> wellLogFiles() const;
void setFormationsGeometry(cvf::ref<RigWellPathFormations> wellPathFormations);
bool readWellPathFormationsFile(QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter);
@@ -82,6 +104,28 @@ public:
void add3dWellLogCurve(Rim3dWellLogCurve* rim3dWellLogCurve);
Rim3dWellLogCurveCollection* rim3dWellLogCurveCollection() const;
const RimWellPathCompletions* completions() const;
RimFishbonesCollection* fishbonesCollection();
const RimFishbonesCollection* fishbonesCollection() const;
RimPerforationCollection* perforationIntervalCollection();
const RimPerforationCollection* perforationIntervalCollection() const;
RimWellPathFractureCollection* fractureCollection();
const RimWellPathFractureCollection* fractureCollection() const;
bool showWellPathLabel() const;
bool showWellPath() const;
cvf::Color3f wellPathColor() const;
void setWellPathColor(const cvf::Color3f& color );
double combinedScaleFactor() const;
double wellPathRadius(double characteristicCellSize) const;
double wellPathRadiusScaleFactor() const;
protected:
// Override PdmObject
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual caf::PdmFieldHandle* objectToggleField() override;
@@ -89,56 +133,6 @@ public:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual void initAfterRead() override;
QString name() const;
void setName(const QString& name);
std::vector<RimWellLogFile*> wellLogFiles() const;
caf::PdmField<QString> filepath;
caf::PdmField<int> wellPathIndexInFile; // -1 means none.
caf::PdmField<QString> m_simWellName;
caf::PdmField<int> m_branchIndex;
caf::PdmField<bool> showWellPathLabel;
caf::PdmField<bool> showWellPath;
caf::PdmField<cvf::Color3f> wellPathColor;
double wellPathRadius(double characteristicCellSize) const;
caf::PdmField<double> wellPathRadiusScaleFactor;
RimFishbonesCollection* fishbonesCollection();
const RimFishbonesCollection* fishbonesCollection() const;
RimPerforationCollection* perforationIntervalCollection();
const RimPerforationCollection* perforationIntervalCollection() const;
const RimWellPathCompletions* completions() const;
RimWellPathFractureCollection* fractureCollection();
const RimWellPathFractureCollection* fractureCollection() const;
RigWellPath* wellPathGeometry();
const RigWellPath* wellPathGeometry() const;
bool readWellPathFile(QString * errorMessage, RifWellPathImporter* wellPathImporter);
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
double combinedScaleFactor() const;
void setUnitSystem(RiaEclipseUnitTools::UnitSystem unitSystem);
RiaEclipseUnitTools::UnitSystem unitSystem() const;
static RimWellPath* fromFilePath(QString filePath);
const QString associatedSimulationWellName() const;
int associatedSimulationWellBranch() const;
bool tryAssociateWithSimulationWell();
bool isAssociatedWithSimulationWell() const;
bool tryMatchName(QString wellPathName,
const std::vector<QString>& simWellNames,
std::function<QString(QString)> stringFormatter = nullptr);
private:
void setWellPathGeometry(RigWellPath* wellPathModel);
@@ -157,29 +151,47 @@ private:
static size_t simulationWellBranchCount(const QString& simWellName);
private:
// Fields
caf::PdmField<QString> m_name;
caf::PdmField<QString> m_filepath;
caf::PdmField<int> m_wellPathIndexInFile; // -1 means none.
caf::PdmField<QString> m_simWellName;
caf::PdmField<int> m_branchIndex;
caf::PdmField<RiaEclipseUnitTools::UnitSystemType> m_unitSystem;
caf::PdmField<QString> id;
caf::PdmField<QString> sourceSystem;
caf::PdmField<QString> utmZone;
caf::PdmField<QString> updateDate;
caf::PdmField<QString> updateUser;
caf::PdmField<QString> m_surveyType;
caf::PdmField<double> m_datumElevation;
caf::PdmField<RiaEclipseUnitTools::UnitSystemType> m_unitSystem;
caf::PdmChildField<RimWellPathCompletions*> m_completions;
cvf::ref<RigWellPath> m_wellPath;
cvf::ref<RigWellPathFormations> m_wellPathFormations;
caf::PdmField<QString> m_name;
caf::PdmField<QString> m_wellPathFormationFilePath;
caf::PdmField<QString> m_formationKeyInFile;
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
caf::PdmField<cvf::Color3f> m_wellPathColor;
caf::PdmField<bool> m_showWellPath;
caf::PdmField<bool> m_showWellPathLabel;
caf::PdmField<double> m_wellPathRadiusScaleFactor;
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
caf::PdmChildField<RimWellPathCompletions*> m_completions;
// Geometry and data
cvf::ref<RigWellPath> m_wellPath;
cvf::ref<RigWellPathFormations> m_wellPathFormations;
// Obsolete fields
caf::PdmChildField<RimWellLogFile*> m_wellLogFile_OBSOLETE;
};