mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-01 16:43:03 -06:00
Copy changes from dev-branch into main
History of main branch was difficult to merge. Take a copy of dev-branch, and merge both ways between dev and main after the release.
This commit is contained in:
1 parent
5688838899
commit
06f9c6126d
1778 files changed
+35036
-12457
No files matched your search
@@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
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<cvf::Part>& partCollection,
|
||||
const cvf::Camera* camera,
|
||||
cvf::ModelBasicList* model,
|
||||
bool computeScalingFactor );
|
||||
|
||||
static cvf::ref<cvf::Part> createPartFromPolyline( const cvf::Color3f& color, const std::vector<cvf::Vec3d>& polyLine );
|
||||
|
||||
static cvf::ref<cvf::DrawableText> createDrawableText( cvf::Font* font,
|
||||
const cvf::Color3f& textColor,
|
||||
const cvf::Color3f& backgroundColor,
|
||||
const std::string& text,
|
||||
const cvf::Vec3f& position );
|
||||
|
||||
static cvf::ref<cvf::DrawableText>
|
||||
createDrawableTextNoBackground( cvf::Font* font, const cvf::Color3f& textColor, const std::string& text, const cvf::Vec3f& position );
|
||||
|
||||
static cvf::ref<cvf::Part> createPart( cvf::DrawableText* drawableText );
|
||||
|
||||
private:
|
||||
LabelPositionStrategy m_overrideStrategy;
|
||||
int m_labelCountHint;
|
||||
};
|
||||
Reference in new issue
Block a user