///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2023 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 "cvfCollection.h" #include "cvfColor3.h" #include "cvfObject.h" #include "cvfVector3.h" #include #include namespace cvf { class Part; class Camera; class ModelBasicList; class DrawableText; class Font; } // namespace cvf class RivAnnotationTools { public: enum class LabelPositionStrategy { RIGHT, LEFT, LEFT_AND_RIGHT, COUNT_HINT, ALL, NONE, UNDEFINED }; RivAnnotationTools(); // By default, each annotation object has a label position strategy. Use this method to override the default. void setOverrideLabelPositionStrategy( LabelPositionStrategy strategy ); // When using COUNT_HINT, this number is used to determine the number of labels to show. void setCountHint( int countHint ); // Create labels for the given collection of parts. The labels are added to the given model. void addAnnotationLabels( const cvf::Collection& partCollection, const cvf::Camera* camera, cvf::ModelBasicList* model, bool computeScalingFactor ); static cvf::ref createPartFromPolyline( const cvf::Color3f& color, const std::vector& polyLine ); static cvf::ref createDrawableText( cvf::Font* font, const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor, const std::string& text, const cvf::Vec3f& position ); static cvf::ref createDrawableTextNoBackground( cvf::Font* font, const cvf::Color3f& textColor, const std::string& text, const cvf::Vec3f& position ); static cvf::ref createPart( cvf::DrawableText* drawableText ); private: LabelPositionStrategy m_overrideStrategy; int m_labelCountHint; };