///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018- Equinor ASA // // 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 "RimEclipseContourMapProjection.h" #include "cafPdmPointer.h" #include "cafDisplayCoordTransform.h" #include "cvfBase.h" #include "cvfDrawableGeo.h" #include "cvfDrawableText.h" #include "cvfModelBasicList.h" #include "cvfObject.h" #include "cvfVector4.h" class RimEclipseContourMapView; namespace cvf { class Effect; } class RivContourMapProjectionPartMgr : public cvf::Object { public: RivContourMapProjectionPartMgr(RimContourMapProjection* contourMapProjection, RimGridView* contourMap); void createProjectionGeometry(); void appendProjectionToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform) const; void appendContourLinesToModel(const cvf::Camera* camera, cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform); void appendPickPointVisToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform) const; cvf::ref createTextureCoords(const std::vector& values) const; private: static cvf::ref createTextLabel(const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor); cvf::ref createProjectionMapPart(const caf::DisplayCoordTransform* displayCoordTransform) const; std::vector>> createContourPolygons(const caf::DisplayCoordTransform* displayCoordTransform, const std::vector>& labelBBoxes) const; std::vector> createContourLabels(const cvf::Camera* camera, const caf::DisplayCoordTransform* displayCoordTransform, std::vector>* labelBBoxes) const; cvf::ref createPickPointVisDrawable(const caf::DisplayCoordTransform* displayCoordTransform) const; bool lineOverlapsWithPreviousContourLevel(const cvf::Vec3d& lineCenter, const RimContourMapProjection::ContourPolygons* previousLevel) const; private: caf::PdmPointer m_contourMapProjection; caf::PdmPointer m_parentContourMap; std::vector m_contourLinePolygons; std::vector m_contourMapTriangles; std::vector> m_labelBoundingBoxes; cvf::ref m_labelEffect; };