///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "cafPdmPointer.h" #include "cvfArray.h" #include "cvfBase.h" #include "cvfBoundingBox.h" #include "cvfObject.h" #include "cvfVector3.h" #include #include class RigMainGrid; class RigActiveCellInfo; class RigResultAccessor; class RimIntersection; class RivIntersectionHexGridInterface; class RivIntersectionVertexWeights; namespace cvf { class ScalarMapper; class DrawableGeo; } class RivIntersectionGeometryGenerator : public cvf::Object { public: RivIntersectionGeometryGenerator(RimIntersection* crossSection, std::vector > &polylines, const cvf::Vec3d& extrusionDirection, const RivIntersectionHexGridInterface* grid, bool isFlattened, const cvf::Vec3d& flattenedPolylineStartPoint); ~RivIntersectionGeometryGenerator() override; bool isAnyGeometryPresent() const; // Generate geometry cvf::ref generateSurface(); cvf::ref createMeshDrawable(); cvf::ref createFaultMeshDrawable(); cvf::ref createLineAlongPolylineDrawable(); cvf::ref createLineAlongExtrusionLineDrawable(const std::vector& extrusionLine); cvf::ref createPointsFromPolylineDrawable(); cvf::ref createPointsFromExtrusionLineDrawable(const std::vector& extrusionLine); const std::vector >& flattenedOrOffsettedPolyLines() { return m_flattenedOrOffsettedPolyLines; } const std::vector > & faultMeshLabelAndAnchorPositions() { return m_faultMeshLabelAndAnchorPositions; } // Mapping between cells and geometry const std::vector& triangleToCellIndex() const; const std::vector& triangleVxToCellCornerInterpolationWeights() const; const cvf::Vec3fArray* triangleVxes() const; RimIntersection* crossSection() const; cvf::Mat4d unflattenTransformMatrix(const cvf::Vec3d& intersectionPointFlat); private: void calculateArrays(); void calculateSegementTransformPrLinePoint(); void calculateFlattenedOrOffsetedPolyline(); //static size_t indexToNextValidPoint(const std::vector& polyLine, // const cvf::Vec3d extrDir, // size_t idxToStartOfLineSegment); RimIntersection* m_crossSection; cvf::cref m_hexGrid; const std::vector > m_polyLines; cvf::Vec3d m_extrusionDirection; bool m_isFlattened; cvf::Vec3d m_flattenedPolylineStartPoint; // Output arrays cvf::ref m_triangleVxes; cvf::ref m_cellBorderLineVxes; cvf::ref m_faultCellBorderLineVxes; std::vector m_triangleToCellIdxMap; std::vector m_triVxToCellCornerWeights; std::vector > m_flattenedOrOffsettedPolyLines; std::vector > m_segementTransformPrLinePoint; std::vector > m_faultMeshLabelAndAnchorPositions; };