OpendTect-6_4  6.4
uibasemap.h
Go to the documentation of this file.
1 #ifndef uibasemap_h
2 #define uibasemap_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Raman K Singh
9  Date: Jul 2010
10 ________________________________________________________________________
11 
12 -*/
13 
14 
15 #include "uitoolsmod.h"
16 #include "basemap.h"
17 #include "uigroup.h"
18 
19 
20 class uiGraphicsItem;
21 class uiGraphicsScene;
22 class uiGraphicsView;
23 class uiWorld2Ui;
24 
26 {
27 public:
29  virtual ~uiBaseMapObject();
30 
31  BaseMapObject* getObject();
32 
33  bool hasChanged() const { return changed_; }
34  void resetChangeFlag() { changed_ = false; }
35  void setTransform(const uiWorld2Ui*);
36  const char* name() const;
37  virtual void show(bool yn);
38  virtual bool isShown() const;
39 
40  uiGraphicsItem& graphItem() { return graphitem_; }
41  const uiGraphicsItem& graphItem() const { return graphitem_; }
42  uiGraphicsItem& labelItem() { return labelitem_; }
43  const uiGraphicsItem& labelItem() const { return labelitem_; }
44  void showLabels(bool yn);
45  bool labelsShown() const { return showlabels_; }
46 
47  virtual void update();
48  virtual void updateStyle();
49 
50  virtual void getMousePosInfo(Coord3&,TrcKey&,float& val,
51  BufferString& info) const;
52 protected:
53  friend class uiBaseMap;
54 
55  void changedCB(CallBacker*);
56  void changedStyleCB(CallBacker*);
57  void changedZValueCB(CallBacker*);
58  void leftClickCB(CallBacker*);
59  void rightClickCB(CallBacker*);
60  void addToGraphItem(uiGraphicsItem&);
61 
62  uiGraphicsItem& graphitem_;
63  uiGraphicsItem& labelitem_;
66 
67  bool changed_;
69 
70 private:
71  void addLabel(uiGraphicsItem&);
72 };
73 
74 
75 mExpClass(uiTools) uiBaseMap : public BaseMap, public uiGroup
76 {
77 public:
79  virtual ~uiBaseMap();
80 
81  void setView(const uiWorldRect&);
82 
83  virtual void addObject(BaseMapObject*);
84  BaseMapObject* getObject(int id);
86 
88 
89  bool hasChanged();
90  inline void setChangeFlag() { changed_ = true; }
91  void resetChangeFlag();
93  void removeObject(const BaseMapObject*);
94  void show(const BaseMapObject&,bool yn);
95 
96  void showLabels(bool yn);
97  bool labelsShown() const;
98 
100 
101  const uiBaseMapObject* uiObjectAt(const Geom::Point2D<float>&) const;
102  const char* nameOfItemAt(const Geom::Point2D<float>&) const;
103  void getMousePosInfo(BufferString& name,Coord3&,
104  TrcKey&,float& val,
105  BufferString& info) const;
106 
107  uiGraphicsItem& worldItem() { return worlditem_;}
108  void centerWorldItem(bool);
109  inline uiGraphicsView& view() { return view_; }
111  inline const uiWorld2Ui& getWorld2Ui() const { return w2ui_; }
112 
115 
116 protected:
117 
118  int indexOf(const BaseMapObject*) const;
119 
121  uiGraphicsItem& worlditem_;
123  bool changed_;
125 
127 
128  void reSizeCB(CallBacker*);
129  virtual void reDraw(bool deep=true);
130  void updateTransform();
131 
132 private:
134 };
135 
136 #endif
Class to provide coordinate conversion between a cartesian coordinate system (or any other transforme...
Definition: uiworld2ui.h:55
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
bool labelsShown() const
Definition: uibasemap.h:45
uiWorld2Ui & w2ui_
Definition: uibasemap.h:133
Definition: uibasemap.h:75
BaseMapObject * getObject(int id)
ObjectSet< uiBaseMapObject > objects_
Definition: uibasemap.h:122
uiGraphicsItem & graphItem()
Definition: uibasemap.h:40
void getMousePosInfo(BufferString &name, Coord3 &, TrcKey &, float &val, BufferString &info) const
ObjectSet< uiBaseMapObject > & getObjects()
Definition: uibasemap.h:87
BaseMapObject * bmobject_
Definition: uibasemap.h:68
void centerWorldItem(bool)
virtual void reDraw(bool deep=true)
bool hasChanged() const
Definition: uibasemap.h:33
void resetChangeFlag()
CNotifier< uiBaseMap, int > objectAdded
Definition: uibasemap.h:113
const uiGraphicsItem & graphItem() const
Definition: uibasemap.h:41
bool hasChanged()
Definition: uiparent.h:26
bool centerworlditem_
Definition: uibasemap.h:124
uiGraphicsItem & worldItem()
Definition: uibasemap.h:107
bool labelsShown() const
virtual ~uiBaseMap()
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
void showLabels(bool yn)
uiGraphicsItem & worlditem_
Definition: uibasemap.h:121
Definition: basemap.h:118
const uiWorld2Ui & getWorld2Ui() const
Definition: uibasemap.h:111
const uiBaseMapObject * uiObjectAt(const Geom::Point2D< float > &) const
bool showlabels_
Definition: uibasemap.h:64
bool changed_
Definition: uibasemap.h:67
void show(const BaseMapObject &, bool yn)
uiBaseMapObject * getUiObject(int id)
void updateTransform()
uiGraphicsScene & scene()
void setChangeFlag()
Definition: uibasemap.h:90
const uiGraphicsItem & labelItem() const
Definition: uibasemap.h:43
A cartesian coordinate in 3D space.
Definition: coord.h:72
void setView(const uiWorldRect &)
uiGraphicsItem & graphitem_
Definition: uibasemap.h:62
void reSizeCB(CallBacker *)
void resetChangeFlag()
Definition: uibasemap.h:34
uiGraphicsView & view()
Definition: uibasemap.h:109
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
uiGraphicsItem & labelItem()
Definition: uibasemap.h:42
uiBaseMap(uiParent *)
Definition: uigraphicsview.h:51
const char * nameOfItemAt(const Geom::Point2D< float > &) const
CNotifier< uiBaseMap, int > objectRemoved
Definition: uibasemap.h:114
uiGraphicsView & view_
Definition: uibasemap.h:120
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
Definition: uibasemap.h:25
uiWorldRect wr_
Definition: uibasemap.h:126
Definition: basemap.h:30
bool changed_
Definition: uibasemap.h:123
virtual void addObject(BaseMapObject *)
Definition: uigraphicsscene.h:39
void removeObject(const BaseMapObject *)
Owned by caller.
uiGraphicsItem & labelitem_
Definition: uibasemap.h:63
const uiWorld2Ui * transform_
Definition: uibasemap.h:65

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