OpendTect  6.3
visannot.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: Kris Tingdahl
8  Date: Jan 2002
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "visosg.h"
15 #include "visobject.h"
16 #include "color.h"
17 #include "trckeyzsampling.h"
18 #include "position.h"
19 #include "sets.h"
20 
21 class AxisInfo;
22 class FontData;
23 class Color;
24 class uiString;
25 
26 namespace osg
27 {
28  class Geode;
29  class Array;
30  class Group;
31  class Geometry;
32  class Vec3f;
33 }
34 
35 namespace osgGeo
36 {
37  class OneSideRender;
38 }
39 
40 namespace visBase
41 {
42 class Text2;
43 class DataObjectGroup;
44 
51 {
52 public:
53  static Annotation* create()
55 
56  void showText(bool yn);
57  bool isTextShown() const;
58 
59  void showScale(bool yn);
60  bool isScaleShown() const;
61 
62  bool canShowGridLines() const;
63  void showGridLines(bool yn);
64  bool isGridLinesShown() const;
65 
66  const FontData& getFont() const;
67  void setFont(const FontData&);
68 
69  void setTrcKeyZSampling(const TrcKeyZSampling&);
70  const TrcKeyZSampling& getTrcKeyZSampling() const;
71  void setScale(const TrcKeyZSampling&);
72  /*<! TrcKeyZSampling(false) as input takes default
73  axis scale of survey box instead */
74  const TrcKeyZSampling& getScale() const;
75 
76  void setScaleFactor(int dim,int scale);
77 
78  void setText(int dim,const uiString&);
79  void fillPar(IOPar&) const;
80  bool usePar(const IOPar&);
81 
82  void setDisplayTransformation(const mVisTrans*);
83  const mVisTrans* getDisplayTransformation() const
84  { return displaytrans_; }
85  virtual void setPixelDensity(float);
86  const Text2* getAnnotTexts() const { return axisannot_; }
87 
88 
89  void setScene(Scene*);
90  void allowShading(bool yn) { allowshading_=yn; }
91 private:
92  ~Annotation();
93  void firstTraversal(CallBacker*);
94  void initGridLines();
95  void updateGridLines();
96  void updateTextPos();
97  void updateTextColor(CallBacker*);
98  void getAxisCoords(int,osg::Vec3f&,osg::Vec3f&) const;
99  void setCorner( int, float, float, float );
100 
101  int scalefactor_[3];
102 
107  osg::Array* gridlinecoords_;
108  osg::Geode* geode_;
109  osgGeo::OneSideRender* gridlines_;
113 
115 
118 
119  static const char* textprefixstr();
120  static const char* cornerprefixstr();
121  static const char* showtextstr();
122  static const char* showscalestr();
123 };
124 
125 } // namespace visBase
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
osg::Geometry * box_
Definition: visannot.h:106
Definition: visdatagroup.h:24
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
void allowShading(bool yn)
Definition: visannot.h:90
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:35
Definition: uistring.h:88
Data needed to make an actual font.
Definition: fontdata.h:18
static Annotation * create()
Definition: visannot.h:53
osg::Geode * geode_
Definition: visannot.h:108
const Text2 * getAnnotTexts() const
Definition: visannot.h:86
const visBase::Transformation * displaytrans_
Definition: visannot.h:114
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
RefMan< Text2 > axisnames_
Definition: visannot.h:110
#define mVisTrans
Definition: visdata.h:25
Definition: vistext.h:98
RefMan< Text2 > axisannot_
Definition: visannot.h:111
TrcKeyZSampling tkzsdefaultscale_
Definition: visannot.h:104
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:32
visBase::Scene * scene_
Definition: visannot.h:112
bool allowshading_
Definition: visannot.h:117
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
TrcKeyZSampling tkzs_
Definition: visannot.h:103
Definition: visannot.h:40
Scene manages all DataObjects and has some managing functions such as the selection management and va...
Definition: visscene.h:38
virtual void setFont(const QFont &)
override Qt
Definition: i_uiobjqtbody.h:31
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
Annotation is a simple wireframe box with text on its axis.
Definition: visannot.h:50
osgGeo::OneSideRender * gridlines_
Definition: visannot.h:109
TrcKeyZSampling scale_
Definition: visannot.h:105
#define mCreateDataObj(clss)
Definition: visdata.h:210
Definition: visobject.h:67
Color annotcolor_
Definition: visannot.h:116
Definition: arraytesselator.h:19
Definition: ptrman.h:200
FixedString Geometry()
Definition: keystrs.h:68
osg::Array * gridlinecoords_
Definition: visannot.h:107

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