///////////////////////////////////////////////////////////////////////////////// // // 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 RivIntersectionHexGridInterface; class RimSurface; namespace cvf { class ScalarMapper; class DrawableGeo; } // namespace cvf class RivPolylineIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface { public: RivPolylineIntersectionGeometryGenerator( std::vector& polyline, RivIntersectionHexGridInterface* grid ); ~RivPolylineIntersectionGeometryGenerator() override; void generateIntersectionGeometry( cvf::UByteArray* visibleCells ); const cvf::Vec3fArray* polygonVxes() const; const std::vector& vertiesPerPolygon() const; const std::vector& polygonToCellIndex() const; // GeomGen Interface bool isAnyGeometryPresent() const override; const std::vector& triangleToCellIndex() const override; const std::vector& triangleVxToCellCornerInterpolationWeights() const override; const cvf::Vec3fArray* triangleVxes() const override; private: void calculateArrays( cvf::UByteArray* visibleCells ); static std::vector createPolylineSegmentCellCandidates( const RivIntersectionHexGridInterface& hexGrid, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint, const cvf::Vec3d& heightVector, const double topDepth, const double bottomDepth ); private: cvf::ref m_hexGrid; const std::vector m_polyline; // Output arrays cvf::ref m_triangleVxes; std::vector m_triangleToCellIdxMap; std::vector m_polygonToCellIdxMap; cvf::ref m_polygonVertices; std::vector m_verticesPerPolygon; };