OpendTect-6_4  6.4
visdragger.h
Go to the documentation of this file.
1 #ifndef visdragger_h
2 #define visdragger_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: December 2003
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "visobject.h"
17 #include "position.h"
18 #include "visosg.h"
19 
20 namespace osgManipulator { class Dragger; }
21 namespace osg
22 {
23  class MatrixTransform;
24  class Node;
25 }
26 
27 namespace visBase
28 {
29 
33 class DraggerCallbackHandler;
34 class Transformation;
35 
37 {
38 public:
39 
44 
45  virtual void setDisplayTransformation( const mVisTrans* );
46  const mVisTrans* getDisplayTransformation() const;
47 
48  void setSpaceLimits(const Interval<float>& x,
49  const Interval<float>& y,
50  const Interval<float>& z);
51 
52 protected:
53  friend class DraggerCallbackHandler;
54  DraggerBase();
55  ~DraggerBase();
56 
57  virtual void notifyStart() = 0;
58  virtual void notifyStop() = 0;
59  virtual void notifyMove() = 0;
60 
62  osgManipulator::Dragger* osgdragger_;
63  osg::Group* osgroot_;
64 
65  void initDragger(osgManipulator::Dragger*);
66 
67  Interval<float> spaceranges_[3];
68 
69 private:
70  DraggerCallbackHandler* cbhandler_;
71 
72 public:
73  void handleEvents(bool yn);
74  bool isHandlingEvents() const;
75 };
76 
77 
79 {
80 public:
81  static Dragger* create()
83 
84  enum Type { Translate1D, Translate2D, Translate3D,
85  Scale3D };
86  void setDraggerType(Type);
87 
88  void setPos(const Coord3&);
89  Coord3 getPos() const;
90 
91  void setSize(const float);
92  float getSize() const;
93 
94  void setArrowColor(const Color&);
95  const Color& getArrowColor() const;
96 
97  void setRotation(const Coord3&, const float);
98  void setDefaultRotation();
99  bool defaultRotation() const;
100 
101  void setOwnShape(DataObject*,bool activeshape);
103  bool selectable() const;
104 
105  NotifierAccess* rightClicked() { return &rightclicknotifier_; }
106  const TypeSet<int>* rightClickedPath() const;
107  const EventInfo* rightClickedEventInfo() const;
108  void updateDragger( bool active );
109  void setDisplayTransformation( const mVisTrans* );
110 
111 protected:
112  ~Dragger();
113  void triggerRightClick(const EventInfo* eventinfo);
114  virtual void notifyStart();
115  virtual void notifyStop();
116  virtual void notifyMove();
117  osg::MatrixTransform* createDefaultDraggerGeometry();
118  osg::MatrixTransform* createTranslateDefaultGeometry();
119  void setScaleAndTranslation(bool move=false);
120 
121 
124 
131 
133  float rotangle_;
135 
136 public:
137  bool isMoving() const;
138 };
139 
140 } // namespace visBase
141 
142 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: visdragger.h:36
Notifier< DraggerBase > started
Definition: visdragger.h:40
Coord3 rotation_
Definition: visdragger.h:132
const visBase::Transformation * displaytrans_
Definition: visdragger.h:61
Notifier< DraggerBase > finished
Definition: visdragger.h:42
DraggerCallbackHandler * cbhandler_
Definition: visdragger.h:70
float draggersizescale_
Definition: visdragger.h:129
Notifier< Dragger > rightclicknotifier_
Definition: visdragger.h:122
Notifier< DraggerBase > motion
Definition: visdragger.h:41
Interface class for Notifier. See comments there.
Definition: callback.h:161
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:65
Color arrowcolor_
Definition: visdragger.h:134
Coord3 markerpos_
Definition: visdragger.h:128
Type
Definition: visdragger.h:84
Definition: callback.h:254
Definition: visdragger.h:20
bool is2dtranslate_
Definition: visdragger.h:127
#define mVisTrans
Definition: visdata.h:31
static Dragger * create()
Definition: visdragger.h:81
bool ismarkershape_
Definition: visdragger.h:126
const EventInfo * rightclickeventinfo_
Definition: visdragger.h:123
A cartesian coordinate in 3D space.
Definition: coord.h:72
NotifierAccess * rightClicked()
Definition: visdragger.h:105
osg::Group * osgroot_
Definition: visdragger.h:63
Definition: visannot.h:43
Notifier< DraggerBase > changed
Definition: visdragger.h:43
Open Scene Graph.
Definition: visannot.h:29
Definition: visevent.h:44
DataObject * inactiveshape_
Definition: visdragger.h:125
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
#define mCreateDataObj(clss)
Definition: visdata.h:209
osgManipulator::Dragger * osgdragger_
Definition: visdragger.h:62
float defaultdraggergeomsize_
Definition: visdragger.h:130
Definition: visdragger.h:78
float rotangle_
Definition: visdragger.h:133

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