///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017 - Statoil ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimFractureTemplate.h" #include "cafAppEnum.h" #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmFieldCvfVec3d.h" #include "cafPdmFieldHandle.h" #include "cafPdmObject.h" #include "cafPdmPtrField.h" #include "cvfBase.h" #include "cvfObject.h" #include "cvfVector3.h" #include class RigStimPlanFractureDefinition; class RimStimPlanLegendConfig; //================================================================================================== /// /// //================================================================================================== class RimStimPlanFractureTemplate : public RimFractureTemplate { CAF_PDM_HEADER_INIT; public: RimStimPlanFractureTemplate(void); virtual ~RimStimPlanFractureTemplate(void); caf::PdmField wellPathDepthAtFracture; virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void setFileName(const QString& fileName); const QString& fileName(); QString fileNameWithOutPath(); void fractureGeometry(std::vector* nodeCoords, std::vector* triangleIndices); std::vector fracturePolygon(); std::vector getNegAndPosXcoords(); std::vector adjustedDepthCoordsAroundWellPathPosition(); std::vector getStimPlanTimeValues(); std::vector > getStimPlanPropertyNamesUnits() const; void computeMinMax(const QString& resultName, const QString& unitName, double* minValue, double* maxValue) const; void loadDataAndUpdate(); std::vector> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const; protected: virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override; private: void updateUiTreeName(); void readStimPlanXMLFile(QString * errorMessage); size_t readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream); static double getAttributeValueDouble(QXmlStreamReader &xmlStream, QString parameterName); static QString getAttributeValueString(QXmlStreamReader &xmlStream, QString parameterName); void getGriddingValues(QXmlStreamReader &xmlStream, std::vector& gridValues, size_t& startNegValues); std::vector> getAllDepthDataAtTimeStep(QXmlStreamReader &xmlStream, size_t startingNegValuesXs); caf::PdmField m_stimPlanFileName; cvf::ref m_stimPlanFractureDefinitionData; bool numberOfParameterValuesOK(std::vector> propertyValuesAtTimestep); void setDepthOfWellPathAtFracture(); };