OpendTect-6_4  6.4
ui3dviewer.h
Go to the documentation of this file.
1 #ifndef ui3dviewer_h
2 #define ui3dviewer_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Lammertink
9  Date: 07/02/2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiosgmod.h"
16 #include "uiobj.h"
17 #include "uigroup.h"
18 #include "color.h"
19 #include "position.h"
20 #include "enums.h"
21 
22 class BufferStringSet;
23 class FontData;
24 class ui3DViewerBody;
25 
26 namespace visBase { class Scene; class PolygonSelection; class SceneColTab; }
27 namespace osgViewer { class View; }
28 
29 mExpClass(uiOSG) ui3DViewer : public uiObject
30 {
31 friend class ui3DViewerBody;
32 
33 public:
35  bool direct,
36  const char* nm="ui3DViewer");
37  ~ui3DViewer();
38 
39  void setMapView(bool yn);
40  bool isMapView() const;
41 
42  void setSceneID(int);
44  const visBase::Scene* getScene() const;
45  int sceneID() const;
46 
47  void setViewMode(bool);
48  bool isViewMode() const;
49 
50  void enableAnimation(bool);
51  bool isAnimationEnabled() const;
52 
53  void rotateH(float angle);
54  void rotateV(float angle);
55  void dolly(float rel); // relative size
56  void setCameraZoom(float);
57  float getCameraZoom();
58  const Coord3 getCameraPosition() const;
59 
60  enum PlaneType { X, Y, Z, Inl, Crl, YZ };
61  void viewPlane(PlaneType);
62  void align();
63 
67  StereoType getStereoType() const;
68  void setStereoOffset(float);
69  float getStereoOffset() const;
70 
71  void setMouseWheelZoomFactor(float);
74  float getMouseWheelZoomFactor() const;
75 
77  bool getReversedMouseWheelDirection() const;
78 
79  void viewAll(bool animate=true);
80  void toHomePos();
81  void saveHomePos();
82  void showRotAxis(bool);
83  void setAnnotationColor(const Color&);
84  Color getAnnotationColor() const;
85  void setAnnotationFont(const FontData&);
86  bool rotAxisShown() const;
87  void toggleCameraType();
88  bool isCameraPerspective() const;
89 
94 
95  void setBackgroundColor(const Color&);
96  Color getBackgroundColor() const;
97 
99 
104 
105  void setKeyBindings(const char* keybindname);
106  void getAllKeyBindings(BufferStringSet&) const;
107  const char* getCurrentKeyBindings() const;
108 
111  const osgViewer::View* getOsgViewerMainView() const;
112  const osgViewer::View* getOsgViewerHudView() const;
113  void setScenesPixelDensity(float dpi);
114  float getScenesPixelDensity() const;
115 
116  void fillPar(IOPar&) const;
117  bool usePar(const IOPar&);
118  void savePropertySettings() const;
119 
120  static FixedString sKeyBindingSettingsKey();
121 
122 private:
123 
124  static const char* sKeySceneID() { return "Scene ID"; }
125  static const char* sKeyAnimate() { return "Animate"; }
126  static const char* sKeyBGColor() { return "Background color"; }
127  static const char* sKeyStereo() { return "Stereo viewing"; }
128  static const char* sKeyQuadBuf() { return "Quad buffer"; }
129  static const char* sKeyStereoOff() { return "Stereo offset"; }
130  static const char* sKeyPrintDlg() { return "Print dlg"; }
131  static const char* sKeyPersCamera() { return "Perspective camera"; }
132 
134 
135  uiObjectBody& mkBody(uiParent*,bool direct,const char*);
136 
137 };
138 
139 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Coord3 getCameraPosition() const
static const char * sKeyAnimate()
Definition: ui3dviewer.h:125
ui3DViewerBody * osgbody_
Definition: ui3dviewer.h:133
Definition: ui3dviewerbody.h:142
PlaneType
Definition: ui3dviewer.h:60
StereoType
Definition: ui3dviewer.h:64
bool isMapView() const
Definition: ui3dviewerbody.h:150
void setCameraZoom(float val)
static const char * sKeyBGColor()
Definition: ui3dviewer.h:126
OD::String that holds an existing text string.
Definition: fixedstring.h:29
Definition: visdata.h:28
const osgViewer::View * getOsgViewerHudView() const
Definition: ui3dviewerbody.h:139
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Baseclass for different body implementation (direct & indirect) of OSG.
Definition: ui3dviewerbody.h:61
Definition: ui3dviewerbody.h:120
void setStereoOffset(float)
void setAnnotationFont(const FontData &)
void setMouseWheelZoomFactor(float)
bool setStereoType(StereoType)
void setBackgroundColor(const Color &)
The base class for most UI elements.
Definition: uiobj.h:38
visBase::SceneColTab * getSceneColTab()
Definition: uiparent.h:26
Notifier< ui3DViewer > viewmodechanged
Definition: ui3dviewer.h:101
Set of BufferString objects.
Definition: bufstringset.h:28
Data needed to make an actual font.
Definition: fontdata.h:20
static const char * sKeyPersCamera()
Definition: ui3dviewer.h:131
float getMouseWheelZoomFactor() const
static const char * sKeySceneID()
Definition: ui3dviewer.h:124
static const char * sKeyQuadBuf()
Definition: ui3dviewer.h:128
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
FixedString None()
Definition: keystrs.h:90
const osgViewer::View * getOsgViewerMainView() const
Definition: ui3dviewerbody.h:138
bool isViewMode() const
WheelMode getWheelDisplayMode() const
static const char * sKeyStereo()
Definition: ui3dviewer.h:127
Notifier< ui3DViewer > destroyed
Definition: ui3dviewer.h:100
void viewAll(bool animate)
Definition: vispolygonselection.h:40
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool getReversedMouseWheelDirection() const
Definition: ui3dviewer.h:29
void setWheelDisplayMode(WheelMode)
CNotifier< ui3DViewer, bool > pageupdown
Definition: ui3dviewer.h:102
virtual void setViewMode(bool viewmode, bool trigger)
WheelMode
Definition: ui3dviewer.h:90
static const char * sKeyStereoOff()
Definition: ui3dviewer.h:129
void setMapView(bool yn)
void setReversedMouseWheelDirection(bool)
float getStereoOffset() const
void setScenesPixelDensity(float dpi)
bool isAnimationEnabled() const
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
A cartesian coordinate in 3D space.
Definition: coord.h:72
void saveHomePos()
visBase::Scene * getScene()
Definition: ui3dviewerbody.h:72
Definition: ui3dviewerbody.h:142
Definition: visannot.h:43
void setSceneID(int)
Definition: visscenecoltab.h:30
Scene manages all DataObjects and has some managing functions such as the selection management and va...
Definition: visscene.h:40
Geom::Size2D< int > getViewportSizePixels() const
CallBack * vmcb
Definition: ui3dviewer.h:103
StereoType getStereoType() const
Color getBackgroundColor() const
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
static const char * sKeyPrintDlg()
Definition: ui3dviewer.h:130
visBase::PolygonSelection * getPolygonSelector()
Definition: ui3dviewerbody.h:120
Definition: ui3dviewer.h:60
CallBacks object-oriented (object + method).
Definition: callback.h:57
void toggleCameraType()
void showRotAxis(bool)
bool isCameraPerspective() const
float getCameraZoom() const
Definition: ui3dviewerbody.h:120

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