OpendTect-6_4  6.4
flatauxdataeditor.h
Go to the documentation of this file.
1 #ifndef flatauxdataeditor_h
2 #define flatauxdataeditor_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kris
8  Date: Mar 2007
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "flatview.h"
16 #include "callback.h"
17 #include "geometry.h"
18 #include "keyenum.h"
19 #include "posidxpair2coord.h"
20 
21 class MouseEventHandler;
22 class MouseEvent;
23 class MenuHandler;
24 
25 namespace FlatView
26 {
27 
28 class AuxDataEditor;
29 
30 #define mCtrlLeftButton ( (OD::ButtonState) (OD::LeftButton+OD::ControlButton) )
31 
36 mExpClass(General) Sower : public CallBacker
37 {
38  friend class AuxDataEditor;
39 
40 public:
41  enum SowingMode { Lasering=-2, Erasing=-1, Idle=0,
42  Furrowing, FirstSowing, SequentSowing };
43 
44  SowingMode mode() { return mode_; }
45 
46  void reInitSettings();
47 
48  void reverseSowingOrder(bool yn=true);
49  void alternateSowingOrder(bool yn=true);
50  void intersow(bool yn=true);
51 
52  bool moreToSow() const;
53  void stopSowing();
54 
55  Geom::Point2D<int> pivotPos() const;
56 
57  bool accept(const MouseEvent&,bool released=false);
58  bool activate(const Color&,const MouseEvent&);
59  bool activate(const OD::LineStyle&,const MouseEvent&);
60 
61  void setSequentSowMask(bool yn=true,
63  void setIfDragInvertMask(bool yn=true,
65  void setLaserMask(bool yn=true,
67  void setEraserMask(bool yn=true,
71 
72 protected:
74  ~Sower();
75 
76  void setView(const Rect& wv,
77  const Geom::Rectangle<int>& mouserect);
78 
79  bool acceptMouse(const MouseEvent&,bool released);
80  bool acceptTablet(const MouseEvent&,bool released);
81  bool acceptLaser(const MouseEvent&,bool released);
82  bool acceptEraser(const MouseEvent&,bool released);
83 
84  void reset();
85 
95 
98  bool intersow_;
99 
104 
109 };
110 
111 
120 {
121  friend class Sower;
122 
123 public:
125  virtual ~AuxDataEditor();
126  int addAuxData(FlatView::AuxData*,bool doedit);
131  void removeAuxData(int id);
132  void enableEdit(int id,bool allowadd,bool allowmove,
133  bool allowdelete);
134  void enablePolySel(int id,bool allowsel);
135  void setAddAuxData(int id);
137  int getAddAuxData() const;
141 
142  void setView(const Rect& wv,
143  const Geom::Rectangle<int>& mouserect);
147  const Geom::PixRectangle<int>& getMouseArea() const { return mousearea_; }
148  Rect getWorldRect(int dataid) const;
149  void limitMovement(const Rect*);
153  bool isDragging() const { return mousedown_; }
154 
155  int getSelPtDataID() const;
156  const TypeSet<int>& getSelPtIdx() const;
157  const Point& getSelPtPos() const;
158 
172  void setSelectionPolygonRectangle(bool);
174  bool getSelectionPolygonRectangle() const;
176  const OD::LineStyle& getSelectionPolygonLineStyle() const;
177  void setSelectionPolygonLineStyle(
178  const OD::LineStyle&);
179  void getPointSelections(TypeSet<int>& ids,
180  TypeSet<int>& idxs) const;
184  const Viewer& viewer() const { return viewer_; }
185  Viewer& viewer() { return viewer_; }
186 
187  Sower& sower() { return *sower_; }
188 
189  void setSelActive( bool yn );
190  bool isSelActive() const { return isselactive_; }
191  const TypeSet<int>& getIds() const;
192  const ObjectSet<AuxData>& getAuxData() const;
193 
194  void removePolygonSelected(int dataid);
196  void setMenuHandler(MenuHandler*);
197  MenuHandler* getMenuHandler();
198 
199  MouseEventHandler& mouseEventHandler() { return mousehandler_; }
200 
201  const Point* markerPosAt(const Geom::Point2D<int>& mousepos) const;
202  void setSelectionPolygonVisible(bool);
204 
205 protected:
206  void getPointSelections( const ObjectSet<AuxData>& polygon,
207  TypeSet<int>& ids, TypeSet<int>& idxs) const;
211  bool removeSelectionPolygon();
213  void mousePressCB(CallBacker*);
214  void mouseReleaseCB(CallBacker*);
215  void mouseMoveCB(CallBacker*);
216 
217  void findSelection(const Geom::Point2D<int>&,
218  int& seldatasetidx,
219  TypeSet<int>* selptidxlist) const;
220  bool updateSelection(const Geom::Point2D<int>&);
222 
223  int dataSetIdxAt(const Geom::Point2D<int>&) const;
224 
234 
242 
247  bool hasmoved_;
248 
253 
255 };
256 
257 
258 }; // namespace FlatView
259 
260 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Class that represents non-bitmap data to be displayed in a flatviewer, such as markers, lines and more.
Definition: flatview.h:34
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Notifier< AuxDataEditor > releaseSelection
Definition: flatauxdataeditor.h:203
Definition: menuhandler.h:187
OD::ButtonState sequentsowmask_
Definition: flatauxdataeditor.h:100
Geom::Point2D< int > prevpt_
Definition: flatauxdataeditor.h:241
int addauxdataid_
Definition: flatauxdataeditor.h:235
SowingMode mode_
Definition: flatauxdataeditor.h:91
Notifier< Sower > sowingEnd
Definition: flatauxdataeditor.h:69
Point selptcoord_
Definition: flatauxdataeditor.h:251
Rect * movementlimit_
Definition: flatauxdataeditor.h:252
TypeSet< int > selptidx_
Definition: flatauxdataeditor.h:250
SowingMode
Definition: flatauxdataeditor.h:41
Viewer & viewer_
Definition: flatauxdataeditor.h:225
Definition: draw.h:118
bool polygonselrect_
Definition: flatauxdataeditor.h:238
SowingMode mode()
Definition: flatauxdataeditor.h:44
TypeSet< int > bendpoints_
Definition: flatauxdataeditor.h:94
Sower * sower_
Definition: flatauxdataeditor.h:226
Geom::PixRectangle< int > mouserectangle_
Definition: flatauxdataeditor.h:90
CNotifier< AuxDataEditor, bool > removeSelected
Definition: flatauxdataeditor.h:168
ObjectSet< MouseEvent > eventlist_
Definition: flatauxdataeditor.h:92
Notifier< AuxDataEditor > movementStarted
Definition: flatauxdataeditor.h:159
bool isselactive_
Definition: flatauxdataeditor.h:239
int furrowstamp_
Definition: flatauxdataeditor.h:108
Definition: keyenum.h:27
int curknotid_
Definition: flatauxdataeditor.h:106
bool reversesowingorder_
Definition: flatauxdataeditor.h:96
bool intersow_
Definition: flatauxdataeditor.h:98
Flat Viewer using FlatView::Data and FlatView::Appearance.
Definition: flatview.h:324
Definition: keyenum.h:23
Definition: callback.h:254
Rect curview_
Definition: flatauxdataeditor.h:244
OD::ButtonState lasermask_
Definition: flatauxdataeditor.h:102
TypeSet< Coord > mousecoords_
Definition: flatauxdataeditor.h:93
ButtonState
Definition: keyenum.h:20
const Geom::PixRectangle< int > & getMouseArea() const
Definition: flatauxdataeditor.h:147
BoolTypeSet doedit_
Definition: flatauxdataeditor.h:233
OD::ButtonState ifdraginvertmask_
Definition: flatauxdataeditor.h:101
int seldatasetidx_
Definition: flatauxdataeditor.h:249
bool isDragging() const
Definition: flatauxdataeditor.h:153
MouseEventHandler & mouseeventhandler_
Definition: flatauxdataeditor.h:89
MouseEventHandler & mousehandler_
Definition: flatauxdataeditor.h:245
bool mousedown_
Definition: flatauxdataeditor.h:246
MenuHandler * menuhandler_
Definition: flatauxdataeditor.h:254
MouseEventHandler & mouseEventHandler()
Definition: flatauxdataeditor.h:199
BoolTypeSet allowmove_
Definition: flatauxdataeditor.h:230
AuxDataEditor & editor_
Definition: flatauxdataeditor.h:86
Definition: mouseevent.h:162
Notifier< AuxDataEditor > movementFinished
Definition: flatauxdataeditor.h:160
Editor for FlatView::AuxData. Allows the end-user to click-drag-release the points in data...
Definition: flatauxdataeditor.h:119
Notifier< Sower > sowing
Definition: flatauxdataeditor.h:70
Class to sow/select points with mouse.
Definition: flatauxdataeditor.h:36
BoolTypeSet allowpolysel_
Definition: flatauxdataeditor.h:232
Sower & sower()
Definition: flatauxdataeditor.h:187
AuxData * feedback_
Definition: flatauxdataeditor.h:240
AuxData * sowingline_
Definition: flatauxdataeditor.h:88
Pos::IdxPair2Coord transformation_
Definition: flatauxdataeditor.h:87
BoolTypeSet allowadd_
Definition: flatauxdataeditor.h:229
Notifier< AuxDataEditor > addAuxDataChange
Definition: flatauxdataeditor.h:140
Notifier with automatic capsule creation.
Definition: callback.h:395
bool hasmoved_
Definition: flatauxdataeditor.h:247
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
OD::ButtonState erasermask_
Definition: flatauxdataeditor.h:103
Geom::PixRectangle< int > mousearea_
Definition: flatauxdataeditor.h:243
TypeSet< int > ids_
Definition: flatauxdataeditor.h:228
ObjectSet< AuxData > polygonsel_
Definition: flatauxdataeditor.h:236
ObjectSet< AuxData > auxdata_
Definition: flatauxdataeditor.h:227
bool singleseeded_
Definition: flatauxdataeditor.h:105
int curknotstamp_
Definition: flatauxdataeditor.h:107
Definition: bitmap2rgb.h:18
Viewer & viewer()
Definition: flatauxdataeditor.h:185
BoolTypeSet allowremove_
Definition: flatauxdataeditor.h:231
OD::LineStyle polygonsellst_
Definition: flatauxdataeditor.h:237
Definition: mouseevent.h:73
Encapsulates linear transform from (i,j) index to (x,y) coordinates.
Definition: posidxpair2coord.h:26
bool alternatesowingorder_
Definition: flatauxdataeditor.h:97
const Viewer & viewer() const
Definition: flatauxdataeditor.h:184
bool isSelActive() const
Definition: flatauxdataeditor.h:190
#define mCtrlLeftButton
Definition: flatauxdataeditor.h:30

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