OpendTect-6_4  6.4
visrandomtrackdragger.h
Go to the documentation of this file.
1 #ifndef visrandomtrackdragger_h
2 #define visrandomtrackdragger_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: Feb 2006
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "visobject.h"
17 #include "objectset.h"
18 #include "position.h"
19 #include "ranges.h"
20 
21 
22 namespace osg { class Switch; }
23 
24 namespace visBase
25 {
26 
30 class Transformation;
31 class Dragger;
32 class MarkerSet;
33 class PlaneDragCBHandler;
34 class PolyLine;
35 
36 
38 {
39  friend class PlaneDragCBHandler;
40 
41 public:
44 
45  int nrKnots() const;
46  Coord getKnot(int) const;
47  void setKnot(int,const Coord&);
48  void insertKnot(int,const Coord&);
49  void removeKnot(int);
50 
51  void showAdjacentPanels(int knotidx,bool yn);
52  bool areAdjacentPanelsShown(int knotidx) const;
53  void showAllPanels(bool yn);
54  bool areAllPanelsShown() const;
55 
56  Interval<float> getDepthRange() const;
57  void setDepthRange(const Interval<float>&);
58 
59  void setDisplayTransformation(const mVisTrans*);
60  const mVisTrans* getDisplayTransformation() const;
61 
62  void setLimits(const Coord3& start,
63  const Coord3& stop,
64  const Coord3& step);
65 
66  void updateZLimit( const Interval<float>& zborder );
67 
68  void showPlaneDraggers(bool yn,int minsizeinsteps=0);
69 
70  void setTransDragKeys(bool trans1d,int keys,
71  int groupidx=0);
72  int getTransDragKeys(bool trans1d,
73  int groupidx=0) const;
74 
75  CNotifier<RandomTrackDragger,int> motion;
76  Notifier<RandomTrackDragger> movefinished;
77 
78  NotifierAccess* rightClicked() { return &rightclicknotifier_; }
79  const TypeSet<int>* rightClickedPath() const;
80  const EventInfo* rightClickedEventInfo() const;
81 
82 protected:
84 
85  void startCB(CallBacker*);
86  void moveCB(CallBacker*);
87  void finishCB(CallBacker*);
88 
89  void triggerRightClick(const EventInfo* eventinfo);
90 
91  void doSetKnot(int,const Coord&);
92 
93  void followActiveDragger(int activeidx);
94  void updatePanels();
95  void postponePanelUpdate(bool);
96  void turnPanelOn(int planeidx,bool yn);
97  void setPanelsPolygonOffset(bool);
98 
99  void removePlaneDraggerCBHandler(int idx);
100  void addPlaneDraggerCBHandler();
101 
102  void updatePlaneDraggers();
103  void updateKnotColor(int idx,bool horoverlap);
104  bool canShowPlaneDragger(int planeidx,
105  bool& horoverlap) const;
106  void snapToLimits(Coord3& pos) const;
107  Coord3 getPlaneBoundingBoxInSteps(int planeidx) const;
108 
109  bool doesKnotStickToBorder(int knotidx) const;
110  unsigned char getOnBorderFlags(int knotidx) const;
111 
112  void showRotationAxis(bool yn,int planeidx=0,
113  Coord normpickedpos=Coord::udf());
114 
115  int getDragControlIdx(bool trans1d,int groupidx,
116  bool docreate);
117  int getDragControlIdx(bool trans1d,
118  int groupidx) const;
119 
121  /* Contains four coupled draggers per knot:
122  idx%4==0: 2D horizontal dragger at start depth
123  idx%4==1: 1D vertical dragger at start depth
124  idx%4==2: 2D horizontal dragger at stop depth
125  idx%4==3: 1D vertical dragger at stop depth */
127 
129 
130  osg::Switch* panels_;
131  osg::Switch* planedraggers_;
132  osg::Switch* rotationaxis_;
133 
136 
139 
141 
144 
147 
150 
152 
153  struct DragControl
154  {
155  DragControl(bool trans1d,int groupidx);
157 
158  bool trans1d_;
162  };
163 
165 
166  static const char* sKeyDraggerScale() { return "subDraggerScale"; }
167 
168 public:
169  int getKnotIdx(const TypeSet<int>& pickpath) const;
170  void handleEvents(bool yn);
171  bool isHandlingEvents() const;
172 };
173 
174 } // namespace visBase
175 
176 #endif
#define mExpClass(module)
Definition: commondefs.h:160
static const char * sKeyDraggerScale()
Definition: visrandomtrackdragger.h:166
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Notifier< RandomTrackDragger > rightclicknotifier_
Definition: visrandomtrackdragger.h:148
BoolTypeSet showadjacents_
Definition: visrandomtrackdragger.h:134
const visBase::Transformation * displaytrans_
Definition: visrandomtrackdragger.h:151
Interface class for Notifier. See comments there.
Definition: callback.h:161
bool postponepanelupdate_
Definition: visrandomtrackdragger.h:140
int modkeymask_
Definition: visrandomtrackdragger.h:161
Interval< float > zrange_
Definition: visrandomtrackdragger.h:142
int mousebutmask_
Definition: visrandomtrackdragger.h:160
A cartesian coordinate in 2D space.
Definition: coord.h:25
const EventInfo * rightclickeventinfo_
Definition: visrandomtrackdragger.h:149
Interval of values.
Definition: commontypes.h:31
ObjectSet< PlaneDragCBHandler > planedraghandlers_
Definition: visrandomtrackdragger.h:128
Definition: visrandomtrackdragger.h:153
Definition: callback.h:254
Set of pointers to objects.
Definition: commontypes.h:32
~DragControl()
Definition: visrandomtrackdragger.h:156
bool showallpanels_
Definition: visrandomtrackdragger.h:135
#define mVisTrans
Definition: visdata.h:31
osg::Switch * rotationaxis_
Definition: visrandomtrackdragger.h:132
static RandomTrackDragger * create()
Definition: visrandomtrackdragger.h:42
Definition: visrandomtrackdragger.h:37
osg::Switch * planedraggers_
Definition: visrandomtrackdragger.h:131
A cartesian coordinate in 3D space.
Definition: coord.h:72
bool trans1d_
Definition: visrandomtrackdragger.h:158
static const Coord & udf()
int groupidx_
Definition: visrandomtrackdragger.h:159
osg::Switch * panels_
Definition: visrandomtrackdragger.h:130
Definition: visannot.h:43
ObjectSet< Dragger > draggers_
Definition: visrandomtrackdragger.h:120
Interval< float > zborder_
Definition: visrandomtrackdragger.h:146
bool showplanedraggers_
Definition: visrandomtrackdragger.h:137
Open Scene Graph.
Definition: visannot.h:29
Definition: visevent.h:44
Notifier with automatic capsule creation.
Definition: callback.h:395
#define mCreateDataObj(clss)
Definition: visdata.h:209
int planedraggerminsizeinsteps_
Definition: visrandomtrackdragger.h:138
Definition: visobject.h:72
Geom::Rectangle< double > horborder_
Definition: visrandomtrackdragger.h:145
ObjectSet< DragControl > dragcontrols_
Definition: visrandomtrackdragger.h:164
ObjectSet< MarkerSet > draggermarkers_
Definition: visrandomtrackdragger.h:126

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