2015-11-18 09:15:13 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
|
//
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
|
|
#include "cafAppEnum.h"
|
|
|
|
|
#include "cafPdmField.h"
|
2015-11-27 17:18:30 +01:00
|
|
|
#include "cafPdmFieldCvfVec3d.h"
|
2015-11-18 09:15:13 +01:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
#include "cafPdmPtrField.h"
|
|
|
|
|
|
2015-11-18 15:55:05 +01:00
|
|
|
#include "cvfBase.h"
|
2015-11-19 11:41:16 +01:00
|
|
|
#include "cvfObject.h"
|
2015-11-18 15:55:05 +01:00
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
2015-11-18 09:15:13 +01:00
|
|
|
class RimEclipseWell;
|
2015-11-18 12:16:04 +01:00
|
|
|
class RimEclipseWellCollection;
|
2015-11-18 15:55:05 +01:00
|
|
|
class RimWellPath;
|
2016-09-21 10:32:29 +02:00
|
|
|
class RivIntersectionPartMgr;
|
2015-11-18 09:15:13 +01:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
2016-09-21 10:48:25 +02:00
|
|
|
class RimIntersection : public caf::PdmObject
|
2015-11-18 09:15:13 +01:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum CrossSectionEnum
|
|
|
|
|
{
|
|
|
|
|
CS_WELL_PATH,
|
|
|
|
|
CS_SIMULATION_WELL,
|
2015-11-27 17:18:30 +01:00
|
|
|
CS_POLYLINE
|
2015-11-18 09:15:13 +01:00
|
|
|
};
|
|
|
|
|
|
2015-11-18 15:55:05 +01:00
|
|
|
enum CrossSectionDirEnum
|
|
|
|
|
{
|
|
|
|
|
CS_VERTICAL,
|
2016-10-18 10:22:20 +02:00
|
|
|
CS_HORIZONTAL,
|
2016-10-18 11:57:05 +02:00
|
|
|
CS_TWO_POINTS
|
2015-11-18 15:55:05 +01:00
|
|
|
};
|
|
|
|
|
|
2015-11-18 09:15:13 +01:00
|
|
|
public:
|
2016-09-21 10:48:25 +02:00
|
|
|
RimIntersection();
|
|
|
|
|
~RimIntersection();
|
2015-11-18 09:15:13 +01:00
|
|
|
|
2015-11-27 10:13:29 +01:00
|
|
|
caf::PdmField<QString> name;
|
|
|
|
|
caf::PdmField<bool> isActive;
|
2015-11-18 15:55:05 +01:00
|
|
|
|
|
|
|
|
caf::PdmField< caf::AppEnum< CrossSectionEnum > > type;
|
|
|
|
|
caf::PdmField< caf::AppEnum< CrossSectionDirEnum > > direction;
|
2015-11-27 13:35:17 +01:00
|
|
|
caf::PdmField< bool > showInactiveCells;
|
2015-11-18 09:15:13 +01:00
|
|
|
|
2015-11-27 10:13:29 +01:00
|
|
|
caf::PdmPtrField<RimWellPath*> wellPath;
|
|
|
|
|
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
2015-11-26 15:59:02 +01:00
|
|
|
|
2016-10-18 11:57:05 +02:00
|
|
|
caf::PdmField< bool > inputPolyLineFromViewerEnabled;
|
|
|
|
|
caf::PdmField< bool > inputExtrusionPointsFromViewerEnabled;
|
2015-11-30 13:23:11 +01:00
|
|
|
|
2015-11-27 10:13:29 +01:00
|
|
|
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
2016-10-18 14:25:31 +02:00
|
|
|
void appendPointToPolyLine(const cvf::Vec3d& point);
|
|
|
|
|
|
2016-10-25 10:03:55 +02:00
|
|
|
RivIntersectionPartMgr* intersectionPartMgr();
|
2015-11-19 11:41:16 +01:00
|
|
|
|
2016-10-18 14:25:31 +02:00
|
|
|
std::vector< std::vector <cvf::Vec3d> > polyLinesForExtrusionDirection() const;
|
|
|
|
|
void appendPointToExtrusionDirection(const cvf::Vec3d& point);
|
2015-11-27 17:18:30 +01:00
|
|
|
|
2016-10-18 10:22:20 +02:00
|
|
|
cvf::Vec3d extrusionDirection() const;
|
|
|
|
|
|
2015-11-18 09:15:13 +01:00
|
|
|
protected:
|
2015-11-27 10:13:29 +01:00
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField();
|
|
|
|
|
virtual caf::PdmFieldHandle* objectToggleField();
|
|
|
|
|
|
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
2015-11-27 17:18:30 +01:00
|
|
|
|
|
|
|
|
|
2015-11-27 10:13:29 +01:00
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
2015-11-27 17:18:30 +01:00
|
|
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
2015-11-27 10:13:29 +01:00
|
|
|
|
|
|
|
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
caf::PdmField<int> m_branchIndex;
|
|
|
|
|
caf::PdmField<double> m_extentLength;
|
2015-11-27 17:18:30 +01:00
|
|
|
|
2015-11-30 10:00:06 +01:00
|
|
|
caf::PdmField< std::vector< cvf::Vec3d> > m_userPolyline;
|
2016-10-18 10:22:20 +02:00
|
|
|
caf::PdmField< std::vector< cvf::Vec3d> > m_customExtrusionPoints;
|
|
|
|
|
|
2015-11-27 10:13:29 +01:00
|
|
|
RimEclipseWellCollection* simulationWellCollection();
|
|
|
|
|
void updateWellCenterline() const;
|
|
|
|
|
void updateWellExtentDefaultValue();
|
|
|
|
|
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
2015-11-27 11:27:06 +01:00
|
|
|
void clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const;
|
2015-11-27 10:13:29 +01:00
|
|
|
void updateName();
|
2015-11-27 17:18:30 +01:00
|
|
|
void rebuildGeometryAndScheduleCreateDisplayModel();
|
2015-11-27 10:13:29 +01:00
|
|
|
private:
|
2016-09-21 10:32:29 +02:00
|
|
|
cvf::ref<RivIntersectionPartMgr> m_crossSectionPartMgr;
|
2015-11-27 10:13:29 +01:00
|
|
|
|
|
|
|
|
mutable
|
|
|
|
|
std::vector< std::vector <cvf::Vec3d> > m_wellBranchCenterlines;
|
2015-11-18 09:15:13 +01:00
|
|
|
};
|