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