///////////////////////////////////////////////////////////////////////////////// // // 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 "RivIntersectionGeometryGeneratorInterface.h" #include "cvfArray.h" #include "cvfBoundingBox.h" #include "cvfObject.h" #include "cvfVector3.h" #include #include class RigMainGrid; class RigActiveCellInfo; class RigResultAccessor; class RimExtrudedCurveIntersection; class RivIntersectionHexGridInterface; class RivIntersectionVertexWeights; class RimSurface; namespace cvf { class ScalarMapper; class DrawableGeo; } // namespace cvf class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface { public: RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection, std::vector>& polylines, const cvf::Vec3d& extrusionDirection, RivIntersectionHexGridInterface* grid, bool isFlattened, const cvf::Vec3d& flattenedPolylineStartPoint ); ~RivExtrudedCurveIntersectionGeometryGenerator() override; // Generate geometry cvf::ref generateSurface( cvf::UByteArray* visibleCells ); 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>& faultMeshLabelAndAnchorPositions(); cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; // GeomGen Interface bool isAnyGeometryPresent() const override; std::map> transformedSurfaceIntersectionPolylines() const; const std::vector& triangleToCellIndex() const override; const std::vector& triangleVxToCellCornerInterpolationWeights() const override; const cvf::Vec3fArray* triangleVxes() const override; const cvf::Vec3fArray* cellMeshVxes() const override; const cvf::Vec3fArray* faultMeshVxes() const override; void ensureGeometryIsCalculated(); private: void calculateArrays( cvf::UByteArray* visibleCells ); void calculateLineSegementTransforms(); void calculateTransformedPolyline(); void calculateSurfaceIntersectionPoints(); RimExtrudedCurveIntersection* intersection() const; const std::vector>& flattenedOrOffsettedPolyLines(); cvf::Vec3d transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord, size_t lineIndex, size_t segmentIndex ); private: RimExtrudedCurveIntersection* m_intersection; cvf::ref 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_transformedPolyLines; std::vector> m_lineSegmentTransforms; std::vector> m_faultMeshLabelAndAnchorPositions; std::map> m_transformedSurfaceIntersectionPolylines; };