ResInsight/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h

117 lines
3.8 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Statoil ASA
// Copyright (C) Ceetron Solutions AS
2018-09-21 04:43:03 -05: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
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfArray.h"
#include "cvfColor4.h"
#include "cvfMatrix4.h"
2018-09-21 04:43:03 -05:00
#include "cvfObject.h"
#include "cvfVector3.h"
#include "cafPdmPointer.h"
#include <QString>
#include <list>
#include <vector>
namespace cvf
{
2018-09-21 04:43:03 -05:00
class ModelBasicList;
class Transform;
class Part;
class ScalarMapper;
class DrawableGeo;
} // namespace cvf
class RigFemPart;
class RigFemResultAddress;
class RigGeoMechCaseData;
class RigMainGrid;
class RigResultAccessor;
class Rim3dView;
class RimCellEdgeColors;
class RimEclipseCellColors;
class RimIntersection;
class RivTernaryScalarMapper;
class RivIntersectionGeometryGenerator;
class RivIntersectionHexGridInterface;
class RivIntersectionVertexWeights;
class RivPipeGeometryGenerator;
//==================================================================================================
///
///
//==================================================================================================
class RivIntersectionPartMgr : public cvf::Object
{
public:
explicit RivIntersectionPartMgr( RimIntersection* rimCrossSection, bool isFlattened = false );
void applySingleColorEffect();
void updateCellResultColor( size_t timeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
const RivTernaryScalarMapper* ternaryColorMapper );
void appendNativeCrossSectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void appendPolylinePartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
const RimIntersection* intersection() const;
cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat );
public:
private:
void generatePartGeometry();
void createFaultLabelParts( const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors );
void createPolyLineParts( bool useBufferObjects );
void createExtrusionDirParts( bool useBufferObjects );
private:
caf::PdmPointer<RimIntersection> m_rimCrossSection;
2018-09-21 04:43:03 -05:00
cvf::ref<RivIntersectionGeometryGenerator> m_crossSectionGenerator;
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;
2018-09-21 04:43:03 -05:00
cvf::ref<cvf::Vec2fArray> m_crossSectionFacesTextureCoords;
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;
};
std::list<RivPipeBranchData> m_wellBranches;
2018-09-21 04:43:03 -05:00
bool m_isFlattened;
};