2015-11-17 09:23:33 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
|
// Copyright (C) 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
|
|
|
|
|
|
2015-11-19 11:41:16 +01:00
|
|
|
#include "cvfBase.h"
|
|
|
|
|
#include "cvfObject.h"
|
2015-11-17 09:23:33 +01:00
|
|
|
#include "cvfColor4.h"
|
2015-11-19 11:41:16 +01:00
|
|
|
#include "cvfVector3.h"
|
2017-01-17 15:11:02 +01:00
|
|
|
#include "cvfArray.h"
|
2015-11-19 11:41:16 +01:00
|
|
|
|
2015-11-17 09:23:33 +01:00
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
|
{
|
|
|
|
|
class ModelBasicList;
|
|
|
|
|
class Transform;
|
|
|
|
|
class Part;
|
2017-01-17 15:11:02 +01:00
|
|
|
class ScalarMapper;
|
2015-11-17 09:23:33 +01:00
|
|
|
}
|
|
|
|
|
|
2017-01-17 15:11:02 +01:00
|
|
|
class RigFemPart;
|
|
|
|
|
class RigFemResultAddress;
|
|
|
|
|
class RigGeoMechCaseData;
|
2015-11-19 11:41:16 +01:00
|
|
|
class RigMainGrid;
|
2017-01-17 15:11:02 +01:00
|
|
|
class RigResultAccessor;
|
2015-11-17 09:23:33 +01:00
|
|
|
class RimCellEdgeColors;
|
2017-01-17 15:11:02 +01:00
|
|
|
class RimEclipseCellColors;
|
2016-09-21 10:48:25 +02:00
|
|
|
class RimIntersection;
|
2017-01-17 15:11:02 +01:00
|
|
|
class RivIntersectionGeometryGenerator;
|
|
|
|
|
class RivIntersectionHexGridInterface;
|
|
|
|
|
class RivIntersectionVertexWeights;
|
|
|
|
|
|
2015-11-17 09:23:33 +01:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
|
2016-09-21 10:32:29 +02:00
|
|
|
class RivIntersectionPartMgr : public cvf::Object
|
2015-11-17 09:23:33 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2017-03-06 11:18:34 +01:00
|
|
|
explicit RivIntersectionPartMgr(const RimIntersection* rimCrossSection);
|
2015-11-17 09:23:33 +01:00
|
|
|
|
|
|
|
|
void applySingleColorEffect();
|
2015-11-20 15:54:22 +01:00
|
|
|
void updateCellResultColor(size_t timeStepIndex);
|
2015-11-17 09:23:33 +01:00
|
|
|
|
2015-11-23 13:23:25 +01:00
|
|
|
|
2015-11-17 17:21:53 +01:00
|
|
|
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
|
|
|
|
void appendMeshLinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
2015-11-30 13:54:56 +01:00
|
|
|
void appendPolylinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
|
2015-11-17 09:23:33 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void updatePartEffect();
|
|
|
|
|
void generatePartGeometry();
|
2016-10-18 14:25:31 +02:00
|
|
|
|
|
|
|
|
void createPolyLineParts(bool useBufferObjects);
|
|
|
|
|
void createExtrusionDirParts(bool useBufferObjects);
|
|
|
|
|
|
2015-11-19 11:41:16 +01:00
|
|
|
void computeData();
|
|
|
|
|
|
2016-10-20 16:09:27 +02:00
|
|
|
public:
|
2015-11-23 13:23:25 +01:00
|
|
|
static void calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
|
|
|
|
const std::vector<size_t>& triangleToCellIdxMap,
|
|
|
|
|
const RigResultAccessor* resultAccessor,
|
|
|
|
|
const cvf::ScalarMapper* mapper);
|
2016-10-20 16:09:27 +02:00
|
|
|
|
2015-11-23 13:23:25 +01:00
|
|
|
static void calculateGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
2016-09-21 10:15:38 +02:00
|
|
|
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
|
2015-11-23 13:23:25 +01:00
|
|
|
const std::vector<float> &resultValues,
|
|
|
|
|
bool isElementNodalResult,
|
|
|
|
|
const RigFemPart* femPart,
|
|
|
|
|
const cvf::ScalarMapper* mapper);
|
2016-10-20 16:09:27 +02:00
|
|
|
|
|
|
|
|
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);
|
2016-10-20 10:49:44 +02:00
|
|
|
|
2016-11-01 12:04:56 +01:00
|
|
|
static void calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
|
|
|
|
const cvf::Vec3fArray* triangelVertices,
|
|
|
|
|
const RigFemResultAddress& resVarAddress,
|
|
|
|
|
const cvf::ScalarMapper* mapper);
|
|
|
|
|
|
2016-09-21 10:15:38 +02:00
|
|
|
cvf::ref<RivIntersectionHexGridInterface> createHexGridInterface();
|
2015-11-19 11:41:16 +01:00
|
|
|
private:
|
2015-11-17 09:23:33 +01:00
|
|
|
|
2016-09-21 10:48:25 +02:00
|
|
|
const RimIntersection* m_rimCrossSection;
|
2015-11-17 09:23:33 +01:00
|
|
|
|
|
|
|
|
cvf::Color3f m_defaultColor;
|
|
|
|
|
|
2016-09-21 10:36:11 +02:00
|
|
|
cvf::ref<RivIntersectionGeometryGenerator> m_crossSectionGenerator;
|
2015-11-20 15:54:22 +01:00
|
|
|
cvf::ref<cvf::Part> m_crossSectionFaces;
|
|
|
|
|
cvf::ref<cvf::Part> m_crossSectionGridLines;
|
|
|
|
|
cvf::ref<cvf::Vec2fArray> m_crossSectionFacesTextureCoords;
|
2015-11-17 09:23:33 +01:00
|
|
|
|
2015-11-30 08:10:10 +01:00
|
|
|
cvf::ref<cvf::Part> m_highlightLineAlongPolyline;
|
2015-11-30 13:54:56 +01:00
|
|
|
cvf::ref<cvf::Part> m_highlightPointsForPolyline;
|
2016-10-18 14:25:31 +02:00
|
|
|
|
|
|
|
|
cvf::ref<cvf::Part> m_highlightLineAlongExtrusionDir;
|
|
|
|
|
cvf::ref<cvf::Part> m_highlightPointsForExtrusionDir;
|
2015-11-17 09:23:33 +01:00
|
|
|
};
|
2016-10-20 10:49:44 +02:00
|
|
|
|