OpendTect-6_4  6.4
view2ddata.h
Go to the documentation of this file.
1 #ifndef view2ddata_h
2 #define view2ddata_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  CopyRight: (C) dGB Beheer B.V.
8  Author: Umesh Sinha
9  Date: Apr 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiviewer2dmod.h"
16 #include "callback.h"
17 #include "refcount.h"
18 
19 #include "view2ddataman.h"
20 
21 class uiFlatViewWin;
23 
24 mExpClass(uiViewer2D) Vw2DDataObject : public CallBacker
26 public:
27 
28  virtual const char* getClassName() const { return "Not impl"; }
29 
30  int id() const { return id_; }
31  void setID(int nid) { id_ = nid; }
32 
33  const char* name() const;
34  virtual void setName(const char*);
35 
36  virtual NotifierAccess* deSelection() { return 0; }
37 
38  virtual bool fillPar(IOPar&) const;
39  virtual bool usePar(const IOPar&);
40 
41  static const char* sKeyMID() { return "ID"; }
42 
43 protected:
45 
46  virtual void triggerDeSel() {}
47 
48  int id_;
50 
51  friend class Vw2DDataManager;
52 };
53 
54 
56 {
57 public:
58 
59  virtual bool fillPar(IOPar&) const;
60  virtual bool usePar(const IOPar&);
61 
62  const EM::ObjectID& emID() const { return emid_; }
63 
64 protected:
67 
70  virtual void setEditors() = 0;
71 
73 };
74 
75 
76 #define _mCreateVw2DDataObj(clss,id,win,editors) \
77 { \
78  return (clss*) createInternal(id,win,editors); \
79 } \
80  \
81 private: \
82  static Vw2DDataObject* createInternal(const EM::ObjectID&, \
83  uiFlatViewWin*,const ObjectSet<uiFlatViewAuxDataEditor>&); \
84  clss(const clss&); \
85  clss& operator =(const clss&); \
86 public: \
87  static void initClass(); \
88  static const char* getStaticClassName(); \
89  \
90  virtual const char* getClassName() const; \
91 protected:
92 
93 #define _mDeclVw2DConstr(clss,oid,win,ed) \
94  clss(const EM::ObjectID& oid,uiFlatViewWin* win, \
95  const ObjectSet<uiFlatViewAuxDataEditor>& ed); \
96 public:
97 
98 #define mCreateVw2DDataObj(clss,oid,win,ed) \
99  _mCreateVw2DDataObj(clss,oid,win,ed) \
100  _mDeclVw2DConstr(clss,oid,win,ed)
101 
102 
103 #define mImplVisVwr2DInitClass( clss) \
104 void clss::initClass() \
105 { \
106  Vw2DDataManager::factory().addCreator( \
107  clss::createInternal, #clss ); \
108 }
109 
110 #define mCreateVw2DFactoryEntryNoInitClass( clss ) \
111 const char* clss::getStaticClassName() { return #clss; } \
112 const char* clss::getClassName() const \
113 { return clss::getStaticClassName(); } \
114 Vw2DDataObject* clss::createInternal(const EM::ObjectID& oid, \
115  uiFlatViewWin* win,const ObjectSet<uiFlatViewAuxDataEditor>& eds) \
116 { \
117  return new clss(oid,win,eds); \
118 }
119 
120 
121 #define mCreateVw2DFactoryEntry( clss) \
122 mImplVisVwr2DInitClass( clss ); \
123 mCreateVw2DFactoryEntryNoInitClass( clss );
124 
125 
126 #endif
#define mExpClass(module)
Definition: commondefs.h:160
od_int32 ObjectID
Definition: emposid.h:24
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
const ObjectSet< uiFlatViewAuxDataEditor > & auxdataeditors_
Definition: view2ddata.h:72
EM::ObjectID emid_
Definition: view2ddata.h:69
Interface class for Notifier. See comments there.
Definition: callback.h:161
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
mRefCountImpl(Vw2DDataObject) public
Definition: view2ddata.h:25
Definition: view2ddataman.h:24
BufferString * name_
Definition: view2ddata.h:49
int id_
Definition: view2ddata.h:48
const EM::ObjectID & emID() const
Definition: view2ddata.h:62
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: view2ddata.h:24
Definition: view2ddata.h:55
static const char * sKeyMID()
Definition: view2ddata.h:41
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
virtual void triggerDeSel()
Definition: view2ddata.h:46
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Flatview auxiliary data editor.
Definition: uiflatauxdataeditor.h:23
Base class for windows containing one or more uiFlatViewer(s).
Definition: uiflatviewwin.h:31
uiFlatViewWin * viewerwin_
Definition: view2ddata.h:68
virtual NotifierAccess * deSelection()
Definition: view2ddata.h:36

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