OpendTect-6_4  6.4
uiodannottreeitem.h
Go to the documentation of this file.
1 #ifndef uiodannottreeitem_h
2 #define uiodannottreeitem_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: January 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 #include "uiodmainmod.h"
16 
17 #include "uioddisplaytreeitem.h"
18 #include "color.h"
19 #include "pickset.h"
20 
23 public:
26 
27  int sceneID() const;
28 
29 protected:
30  bool init();
31  const char* parentType() const;
32  virtual bool rightClick(uiTreeViewItem*);
33 };
34 
35 
38 public:
39  const char* name() const { return getName(); }
40  static const char* getName()
41  { return typeid(uiODAnnotTreeItemFactory).name();}
42  uiTreeItem* create() const { return new uiODAnnotParentTreeItem; }
43  uiTreeItem* create(int,uiTreeItem*) const;
44 };
45 
46 
49  typedef uiODTreeItem inheritedClass;
50 public:
53 
55 
56 protected:
57  bool readPicks(Pick::Set&);
58  virtual const char* parentType() const;
59  virtual bool init();
60  void prepareForShutdown();
61  virtual bool showSubMenu();
62  virtual int defScale() const { return -1; }
63 
64  virtual uiTreeItem* createSubItem(int,Pick::Set&) = 0;
65  virtual const char* managerName() const = 0;
66  virtual const char* oldSelKey() const = 0;
67 
68 
69 
70  void setRemovedCB(CallBacker*);
71  void addPickSet(Pick::Set* ps);
72  void removePickSet(Pick::Set* ps);
73 
75 };
76 
77 
78 
81 public:
82  static bool doesNameExist(const char*);
83  static char createIOEntry(const char* nm,bool overwrite,
84  MultiID&,const char* mannm);
89  Pick::Set* getSet() { return set_; }
90 
91 protected:
92  uiODAnnotSubItem(Pick::Set&,int displayid=-1);
94  virtual ~uiODAnnotSubItem();
95  void prepareForShutdown();
96  void removeStuff();
97  bool init();
98  virtual const char* parentType() const =0;
99  virtual void fillStoragePar(IOPar&) const {}
100 
101  virtual void clickCB(CallBacker*) {}
102  virtual void mouseMoveCB(CallBacker*) {}
103  virtual void rightclickCB(CallBacker*) {}
104 
105  virtual void createMenu(MenuHandler*,bool istb);
106  virtual void handleMenuCB(CallBacker*);
107 
108  virtual bool hasScale() const { return false; }
109  virtual void setScale(float);
110  void setColor(Color);
111  void scaleChg(CallBacker*);
112 
113  void store() const;
114  void storeAs( bool trywithoutdlg=false ) const;
115 
116  virtual const char* managerName() const = 0;
117 
118  float defscale_;
119 
124 };
125 
126 
129 public:
130  ScaleBarSubItem(Pick::Set&,int displayid=-1);
131  bool init();
132  static const char* sKeyManager() { return "ScaleBarAnnotations"; }
133 
134 protected:
135  ~ScaleBarSubItem() { removeStuff(); }
136 
137  const char* parentType() const;
138  void fillStoragePar(IOPar&) const;
139 
140  void createMenu(MenuHandler*,bool istb);
141  void handleMenuCB(CallBacker*);
142  void propertyChange(CallBacker*);
143 
144  const char* managerName() const { return sKeyManager();}
145 
147 
148 };
149 
152 public:
153 
154  ArrowSubItem(Pick::Set& pck,int displayid=-1);
155  bool init();
156 
157  static const char* sKeyManager() { return "ArrowAnnotations"; }
158 
159 protected:
160  ~ArrowSubItem() { removeStuff(); }
161  virtual const char* parentType() const;
162 
163  void fillStoragePar(IOPar&) const;
164  void createMenu(MenuHandler*,bool istb);
165  void handleMenuCB(CallBacker*);
166  void propertyChange(CallBacker*);
167 
170 
171  bool hasScale() const { return false; }
172  const char* managerName() const { return sKeyManager(); }
173 
174  static const char* sKeyArrowType() { return "Arrow Type"; }
175  static const char* sKeyLineWidth() { return "Line width"; }
176 
177 };
178 
179 
182 public:
183  ImageSubItem(Pick::Set&,int displayid=-1);
184  bool init();
185  static const char* sKeyManager() { return "ImageAnnotations"; }
186 
187 protected:
188  ~ImageSubItem() { removeStuff(); }
189  const char* parentType() const;
190  void fillStoragePar(IOPar&) const;
191 
192  void createMenu(MenuHandler*,bool istb);
193  void handleMenuCB(CallBacker*);
194 
195  void retrieveFileName(CallBacker*);
196 
197  void updateColumnText(int col);
198 
199  bool hasScale() const { return true; }
200  const char* managerName() const { return sKeyManager();}
201 
202  void selectFileName() const;
203 
205 };
206 
207 
208 #define mDefineParentItem(type,typestr,defsz) \
209 class type##ParentItem : public uiODAnnotTreeItem \
210 { \
211 public: \
212  type##ParentItem() \
213  : uiODAnnotTreeItem(typestr)\
214  { \
215  mAttachCB( Pick::Mgr().setToBeRemoved, \
216  type##ParentItem::setRemovedCB ); \
217  } \
218 protected: \
219  uiTreeItem* createSubItem(int di,Pick::Set& pck) \
220  { return new type##SubItem(pck,di); } \
221  const char* managerName() const { return type##SubItem::sKeyManager(); } \
222  const char* oldSelKey() const { return typestr.getFullString().buf(); } \
223  int defScale() const { return defsz; } \
224  void setRemovedCB(CallBacker*); \
225 }; \
226 
227 
228 mDefineParentItem(Arrow,mToUiStringTodo("Arrows"),1000);
229 mDefineParentItem(Image,mToUiStringTodo("Image"),1000);
230 mDefineParentItem(ScaleBar,mToUiStringTodo("Scale Bar"),1000);
231 
232 
233 #endif
#define mExpClass(module)
Definition: commondefs.h:160
uiODTreeItem inheritedClass
Definition: uiodannottreeitem.h:49
static const char * sKeyManager()
Definition: uiodannottreeitem.h:132
virtual void rightclickCB(CallBacker *)
Definition: uiodannottreeitem.h:103
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: menuhandler.h:187
Definition: uiodannottreeitem.h:36
Definition: uiodtreeitem.h:27
~ScaleBarSubItem()
Definition: uiodannottreeitem.h:135
OpendTect application top level object.
Definition: uiodmain.h:41
static const char * sKeyManager()
Definition: uiodannottreeitem.h:185
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
~ArrowSubItem()
Definition: uiodannottreeitem.h:160
MenuItem storemnuitem_
Definition: uiodannottreeitem.h:121
bool init()
uiTreeItem * create() const
Definition: uiodannottreeitem.h:42
Pick::Set * set_
Definition: uiodannottreeitem.h:123
virtual bool hasScale() const
Definition: uiodannottreeitem.h:108
virtual int defScale() const
Definition: uiodannottreeitem.h:62
bool hasScale() const
Definition: uiodannottreeitem.h:199
Definition: uiodannottreeitem.h:21
Definition: uistring.h:89
Definition: uioddisplaytreeitem.h:24
Definition: uiodtreeitem.h:80
Definition: uiodannottreeitem.h:79
static const char * sKeyArrowType()
Definition: uiodannottreeitem.h:174
const char * managerName() const
Definition: uiodannottreeitem.h:144
virtual void mouseMoveCB(CallBacker *)
Definition: uiodannottreeitem.h:102
Set of picks with something in common.
Definition: pickset.h:31
MenuItem storeasmnuitem_
Definition: uiodannottreeitem.h:122
static const char * sKeyLineWidth()
Definition: uiodannottreeitem.h:175
MenuItem propmnuitem_
Definition: uiodannottreeitem.h:146
Definition: uitreeview.h:201
MenuItem filemnuitem_
Definition: uiodannottreeitem.h:204
MenuItem propmnuitem_
Definition: uiodannottreeitem.h:168
const char * managerName() const
Definition: uiodannottreeitem.h:172
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: menuhandler.h:76
#define mMenuOnAnyButton
Definition: uiodtreeitem.h:91
MenuItem scalemnuitem_
Definition: uiodannottreeitem.h:120
virtual void clickCB(CallBacker *)
Definition: uiodannottreeitem.h:101
Definition: uiodannottreeitem.h:180
#define mDefineParentItem(type, typestr, defsz)
Definition: uiodannottreeitem.h:208
virtual void fillStoragePar(IOPar &) const
Definition: uiodannottreeitem.h:99
float defscale_
Definition: uiodannottreeitem.h:118
Definition: uiodannottreeitem.h:47
~ImageSubItem()
Definition: uiodannottreeitem.h:188
const char * name() const
Definition: uiodannottreeitem.h:39
static uiHor3DInterpol * create(uiParent *)
static const char * getName()
Definition: uiodannottreeitem.h:40
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
int arrowtype_
Definition: uiodannottreeitem.h:169
bool hasScale() const
Definition: uiodannottreeitem.h:171
Pick::Set * getSet()
Definition: uiodannottreeitem.h:89
#define mToUiStringTodo(i)
Definition: uistring.h:303
uiString typestr_
Definition: uiodannottreeitem.h:74
const char * managerName() const
Definition: uiodannottreeitem.h:200
Definition: uitreeitemmanager.h:34
Definition: uiodannottreeitem.h:127
Compound key consisting of ints.
Definition: multiid.h:25
Definition: uiodannottreeitem.h:150
static const char * sKeyManager()
Definition: uiodannottreeitem.h:157

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