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

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