OpendTect  6.3
vistext.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kristofer Tingdahl
8  Date: 4-22-2002
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "visosg.h"
15 #include "visobject.h"
16 #include "fontdata.h"
17 #include "position.h"
18 #include "uistring.h"
19 
20 
21 namespace osgText { class Font; }
22 
23 namespace osgGeo { class Text; }
24 
25 namespace osg { class Drawable; class Vec3f; class Geode; }
26 
27 namespace visBase
28 {
29 
31 {
32 public:
33  Text();
34  ~Text();
35 
36  enum Justification { Left, Right, Center, Top, Bottom,
37  TopLeft, TopRight, BottomLeft, BottomRight };
38 
39  enum CharacterSizeMode { Object, Screen, ObjectWithScreenMaximum };
40 
41  enum AxisAlignment { XY, ReversedXY, XZ, ReversedXZ,
42  YZ, ReversedYZ, OnScreen, User };
43 
44  void setPosition(const osg::Vec3f&);
45  void setPosition(const Coord3&,
46  bool scenespace = false);
47  Coord3 getPosition() const;
48 
49  void setFontData(const FontData&, float pixeldens);
50  const FontData& getFontData() const { return fontdata_; }
51 
52  void updateFontSize(float pixeldensity);
53 
54  void setText(const uiString&);
55  const uiString& getText() const { return text_; }
56 
57  void setColor(const Color&);
58  Color getColor() const;
59 
60  void setJustification(Justification);
61  int getJustification() const;
62 
63  osg::Drawable& getDrawable();
64  const osg::Drawable& getDrawable() const;
65 
66  void setDisplayTransformation( const mVisTrans*);
67  void setCharacterSizeMode( CharacterSizeMode );
68  void setAxisAlignment( AxisAlignment );
69 
70  void useRotateToScreenElevation(bool);
71  bool isRotateToScreenElevationUsed() const;
72  void setRotateToScreenElevationAngle(float);
73  float getRotateToScreenElevationAngle() const;
74  void setRotateToScreenElevationPlane(
75  const Coord3& refPlaneNormal);
76  Coord3 getRotateToScreenElevationPlane() const;
77 
78 protected:
82 
84 };
85 
86 
88 {
89 public:
90  virtual ~OsgFontCreator() {}
91  static osgText::Font* create(const FontData&);
92 protected:
93  static void setCreator(OsgFontCreator*);
94  virtual osgText::Font* createFont(const FontData&) = 0;
95 };
96 
97 
99 {
100 public:
101  static Text2* create()
103 
104  int nrTexts() const {return texts_.size();}
105  int addText();
106  void removeText(const Text*);
107  void removeAll();
108 
109  void setFontData(const FontData&);
110 
111  const Text* text(int idx=0) const;
112  Text* text(int idx=0);
113 
114  void setDisplayTransformation(const mVisTrans*);
115  void setPixelDensity(float);
116  float getPixelDensity() const { return pixeldensity_;}
117 
118 protected:
119  void translationChangeCB(CallBacker*);
120  ~Text2();
121  osg::Geode* geode_;
125 };
126 
127 
128 }; // Namespace
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
Definition: vistext.h:39
osgGeo::Text * osgtext_
Definition: vistext.h:80
static Text2 * create()
Definition: vistext.h:101
Definition: vistext.h:41
Definition: file.h:109
virtual ~OsgFontCreator()
Definition: vistext.h:90
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:35
uiString text_
Definition: vistext.h:81
Definition: vistext.h:36
Definition: uistring.h:88
Definition: vistext.h:30
FontData fontdata_
Definition: vistext.h:83
Data needed to make an actual font.
Definition: fontdata.h:18
AxisAlignment
Definition: vistext.h:41
Definition: vistext.h:37
ManagedObjectSet< Text > texts_
Definition: vistext.h:122
Definition: repos.h:23
3D point or vector
Definition: commontypes.h:57
void removeAll()
const visBase::Transformation * displaytransform_
Definition: vistext.h:124
#define mVisTrans
Definition: visdata.h:25
Definition: vistext.h:98
const uiString & getText() const
Definition: vistext.h:55
Definition: vistext.h:21
Definition: visannot.h:40
const visBase::Transformation * displaytrans_
Definition: vistext.h:79
static uiHor3DInterpol * create(uiParent *)
osg::Geode * geode_
Definition: vistext.h:121
CharacterSizeMode
Definition: vistext.h:39
Open Scene Graph.
Definition: visannot.h:26
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
float getPixelDensity() const
Definition: vistext.h:116
Definition: vistext.h:87
#define mCreateDataObj(clss)
Definition: visdata.h:210
Definition: visobject.h:67
Justification
Definition: vistext.h:36
const FontData & getFontData() const
Definition: vistext.h:50
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:49
float pixeldensity_
Definition: vistext.h:123
Definition: vistext.h:42

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017