ResInsight/ApplicationCode/ProjectDataModel/RimFracture.h

122 lines
4.7 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
2017-02-15 04:29:44 -06:00
#include "RimFractureTemplate.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include "cvfMatrix4.h"
2017-02-15 04:29:44 -06:00
#include "cvfPlane.h"
2017-02-15 04:29:44 -06:00
#include "cafPdmChildField.h"
#include "cafPdmFieldCvfVec3d.h"
2017-01-19 03:43:23 -06:00
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
2017-01-19 03:43:23 -06:00
class RigFracture;
2017-02-06 06:22:18 -06:00
class RimEclipseCase;
2017-01-19 03:43:23 -06:00
class RimEllipseFractureTemplate;
class RivWellFracturePartMgr;
//==================================================================================================
///
///
//==================================================================================================
class RimFracture : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimFracture(void);
virtual ~RimFracture(void);
caf::PdmField<QString> name;
caf::PdmField<double> azimuth;
caf::PdmField<double> perforationLength;
caf::PdmField<int> stimPlanTimeIndexToPlot;
2017-01-19 03:43:23 -06:00
cvf::Vec3d anchorPosition();
void setAnchorPosition(const cvf::Vec3d& pos);
virtual void setAzimuth() =0;
2017-01-10 03:53:54 -06:00
cvf::Mat4f transformMatrix();
2017-01-19 03:43:23 -06:00
const RigFracture* attachedRigFracture() const;
void setFractureTemplate(RimFractureTemplate* fractureTemplate);
RimFractureTemplate* attachedFractureDefinition() const;
RivWellFracturePartMgr* fracturePartManager();
bool hasValidGeometry() const;
void computeGeometry();
void setRecomputeGeometryFlag();
const std::vector<cvf::uint>& triangleIndices() const;
const std::vector<cvf::Vec3f>& nodeCoords() const;
2017-01-19 06:35:07 -06:00
std::vector<size_t> getPotentiallyFracturedCells();
void computeTransmissibility(RimEclipseCase* caseToApply);
2017-01-19 03:43:23 -06:00
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
2017-01-19 06:35:07 -06:00
virtual caf::PdmFieldHandle* userDescriptionField() override;
cvf::Vec3d fracturePosition() const;
2017-01-10 03:53:54 -06:00
protected:
2017-01-19 03:43:23 -06:00
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
2017-02-15 04:29:44 -06:00
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
2017-01-10 03:53:54 -06:00
private:
bool isRecomputeGeometryFlagSet();
2017-01-19 03:43:23 -06:00
cvf::Vec3d fracturePositionForUi() const;
QString createOneBasedIJK() const;
//Functions for area calculations - should these be in separate class
bool planeCellIntersectionPolygons(size_t cellindex, std::vector<std::vector<cvf::Vec3d> > & polygons, cvf::Vec3d & localX, cvf::Vec3d & localY, cvf::Vec3d & localZ);
2017-01-19 06:35:07 -06:00
protected:
caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate;
2017-01-19 03:43:23 -06:00
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
2017-01-19 06:35:07 -06:00
caf::PdmProxyValueField<QString> m_displayIJK;
2017-01-19 03:43:23 -06:00
2017-01-19 06:35:07 -06:00
private:
caf::PdmField<cvf::Vec3d> m_anchorPosition;
2017-01-19 03:43:23 -06:00
cvf::ref<RigFracture> m_rigFracture;
bool m_recomputeGeometry;
2017-01-19 06:35:07 -06:00
caf::PdmField<int> m_i; // Zero based indexing
caf::PdmField<int> m_j; // Zero based indexing
caf::PdmField<int> m_k; // Zero based indexing
2017-01-10 03:53:54 -06:00
2017-01-19 03:43:23 -06:00
cvf::ref<RivWellFracturePartMgr> m_rivFracture;
};