2015-11-17 02:23:33 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2018-09-21 04:43:03 -05:00
|
|
|
//
|
2015-11-17 02:23:33 -06:00
|
|
|
// 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.
|
2018-09-21 04:43:03 -05:00
|
|
|
//
|
2015-11-17 02:23:33 -06:00
|
|
|
// 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.
|
2018-09-21 04:43:03 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-11-17 02:23:33 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-09-05 02:43:17 -05:00
|
|
|
|
2018-09-21 07:09:32 -05:00
|
|
|
#include "cvfArray.h"
|
2015-11-17 02:23:33 -06:00
|
|
|
#include "cvfColor4.h"
|
2018-02-16 07:37:59 -06:00
|
|
|
#include "cvfMatrix4.h"
|
2018-09-21 04:43:03 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
2018-02-16 07:37:59 -06:00
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
#include "cafPdmPointer.h"
|
2015-11-19 04:41:16 -06:00
|
|
|
|
2018-04-10 08:35:10 -05:00
|
|
|
#include <QString>
|
|
|
|
|
2018-02-07 04:40:48 -06:00
|
|
|
#include <list>
|
2018-04-10 08:35:10 -05:00
|
|
|
#include <vector>
|
2015-11-17 02:23:33 -06:00
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2018-09-21 04:43:03 -05:00
|
|
|
class ModelBasicList;
|
|
|
|
class Transform;
|
|
|
|
class Part;
|
|
|
|
class ScalarMapper;
|
|
|
|
class DrawableGeo;
|
|
|
|
} // namespace cvf
|
2015-11-17 02:23:33 -06:00
|
|
|
|
2017-01-17 08:11:02 -06:00
|
|
|
class RigFemPart;
|
|
|
|
class RigFemResultAddress;
|
|
|
|
class RigGeoMechCaseData;
|
2015-11-19 04:41:16 -06:00
|
|
|
class RigMainGrid;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RigResultAccessor;
|
2018-03-12 03:21:27 -05:00
|
|
|
class Rim3dView;
|
2015-11-17 02:23:33 -06:00
|
|
|
class RimCellEdgeColors;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RimEclipseCellColors;
|
2016-09-21 03:48:25 -05:00
|
|
|
class RimIntersection;
|
2018-02-01 10:45:22 -06:00
|
|
|
class RivTernaryScalarMapper;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RivIntersectionGeometryGenerator;
|
|
|
|
class RivIntersectionHexGridInterface;
|
|
|
|
class RivIntersectionVertexWeights;
|
2018-02-07 04:40:48 -06:00
|
|
|
class RivPipeGeometryGenerator;
|
2015-11-17 02:23:33 -06:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
|
2016-09-21 03:32:29 -05:00
|
|
|
class RivIntersectionPartMgr : public cvf::Object
|
2015-11-17 02:23:33 -06:00
|
|
|
{
|
|
|
|
public:
|
2018-01-25 10:37:22 -06:00
|
|
|
explicit RivIntersectionPartMgr(RimIntersection* rimCrossSection, bool isFlattened = false);
|
2015-11-17 02:23:33 -06:00
|
|
|
|
|
|
|
void applySingleColorEffect();
|
2018-09-21 04:43:03 -05:00
|
|
|
void updateCellResultColor(size_t timeStepIndex,
|
|
|
|
const cvf::ScalarMapper* scalarColorMapper,
|
2018-02-01 10:45:22 -06:00
|
|
|
const RivTernaryScalarMapper* ternaryColorMapper);
|
2015-11-17 02:23:33 -06:00
|
|
|
|
2015-11-17 10:21:53 -06:00
|
|
|
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
|
|
|
void appendMeshLinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
2018-03-12 03:21:27 -05:00
|
|
|
void appendPolylinePartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
2016-10-18 07:25:31 -05:00
|
|
|
|
2018-02-07 04:40:48 -06:00
|
|
|
const RimIntersection* intersection() const;
|
2016-10-18 07:25:31 -05:00
|
|
|
|
2018-03-09 11:01:13 -06:00
|
|
|
cvf::Mat4d unflattenTransformMatrix(const cvf::Vec3d& intersectionPointFlat);
|
2015-11-19 04:41:16 -06:00
|
|
|
|
2016-10-20 09:09:27 -05:00
|
|
|
public:
|
2018-09-21 04:43:03 -05:00
|
|
|
static void calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
|
|
|
const std::vector<size_t>& triangleToCellIdxMap,
|
|
|
|
const RigResultAccessor* resultAccessor,
|
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
|
|
|
static void
|
|
|
|
calculateNodeOrElementNodeBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
|
|
|
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
|
|
|
const std::vector<float>& resultValues,
|
|
|
|
bool isElementNodalResult,
|
|
|
|
const RigFemPart* femPart,
|
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
|
|
|
static void calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
|
|
|
const std::vector<float>& resultValues,
|
2018-01-11 04:35:08 -06:00
|
|
|
const std::vector<size_t>& triangleToCellIdx,
|
2018-09-21 04:43:03 -05:00
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
|
|
|
static void calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
|
|
|
|
const cvf::Vec3fArray* triangelVertices,
|
|
|
|
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
|
|
|
RigGeoMechCaseData* caseData,
|
|
|
|
const RigFemResultAddress& resVarAddress,
|
|
|
|
int timeStepIdx,
|
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
|
|
|
static void calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
|
|
|
const cvf::Vec3fArray* triangelVertices,
|
|
|
|
const RigFemResultAddress& resVarAddress,
|
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
2015-11-19 04:41:16 -06:00
|
|
|
private:
|
2018-02-07 04:40:48 -06:00
|
|
|
void generatePartGeometry();
|
2018-09-21 04:43:03 -05:00
|
|
|
void createFaultLabelParts(const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors);
|
2018-02-07 04:40:48 -06:00
|
|
|
void createPolyLineParts(bool useBufferObjects);
|
|
|
|
void createExtrusionDirParts(bool useBufferObjects);
|
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
cvf::ref<RivIntersectionHexGridInterface> createHexGridInterface();
|
2015-11-17 02:23:33 -06:00
|
|
|
|
2018-02-07 04:40:48 -06:00
|
|
|
private:
|
2018-01-25 10:37:22 -06:00
|
|
|
caf::PdmPointer<RimIntersection> m_rimCrossSection;
|
2015-11-17 02:23:33 -06:00
|
|
|
|
2018-09-21 04:43:03 -05:00
|
|
|
cvf::ref<RivIntersectionGeometryGenerator> m_crossSectionGenerator;
|
2018-04-10 08:35:10 -05:00
|
|
|
|
2018-09-21 04:43:03 -05:00
|
|
|
cvf::ref<cvf::Part> m_crossSectionFaces;
|
|
|
|
cvf::ref<cvf::Part> m_crossSectionGridLines;
|
|
|
|
cvf::ref<cvf::Part> m_crossSectionFaultGridLines;
|
|
|
|
cvf::ref<cvf::Part> m_faultMeshLabels;
|
|
|
|
cvf::ref<cvf::Part> m_faultMeshLabelLines;
|
|
|
|
cvf::ref<cvf::Part> m_highlightLineAlongPolyline;
|
|
|
|
cvf::ref<cvf::Part> m_highlightPointsForPolyline;
|
|
|
|
cvf::ref<cvf::Part> m_highlightLineAlongExtrusionDir;
|
|
|
|
cvf::ref<cvf::Part> m_highlightPointsForExtrusionDir;
|
2015-11-17 02:23:33 -06:00
|
|
|
|
2018-09-21 04:43:03 -05:00
|
|
|
cvf::ref<cvf::Vec2fArray> m_crossSectionFacesTextureCoords;
|
2018-01-25 10:37:22 -06:00
|
|
|
|
2018-02-07 04:40:48 -06:00
|
|
|
struct RivPipeBranchData
|
|
|
|
{
|
2018-09-21 04:43:03 -05:00
|
|
|
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
|
|
|
|
cvf::ref<cvf::Part> m_surfacePart;
|
|
|
|
cvf::ref<cvf::Part> m_centerLinePart;
|
2018-02-07 04:40:48 -06:00
|
|
|
};
|
|
|
|
std::list<RivPipeBranchData> m_wellBranches;
|
|
|
|
|
2018-09-21 04:43:03 -05:00
|
|
|
bool m_isFlattened;
|
2015-11-17 02:23:33 -06:00
|
|
|
};
|