OpendTect-6_4  6.4
emmanager.h
Go to the documentation of this file.
1 #ifndef emmanager_h
2 #define emmanager_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: 4-11-2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "earthmodelmod.h"
17 #include "sets.h"
18 #include "bufstring.h"
19 #include "callback.h"
20 #include "factory.h"
21 #include "ptrman.h"
22 #include "ranges.h"
23 #include "multiid.h"
24 #include "emposid.h"
25 #include "emundo.h"
26 
27 class Undo;
28 class IOObj;
29 class IOObjContext;
30 class TaskRunner;
31 class Executor;
32 class uiEMPartServer;
33 
34 template <class T> class Selector;
35 
36 namespace EM
37 {
38 class EMObject;
39 class SurfaceIOData;
40 class SurfaceIODataSelection;
41 
46 mExpClass(EarthModel) EMManager : public CallBacker
47 {
48 public:
49  EMManager();
50  ~EMManager();
51 
52  inline int nrLoadedObjects() const { return objects_.size(); }
53  inline int size() const { return nrLoadedObjects(); }
54  EM::ObjectID objectID(int idx) const;
55  bool objectExists(const EMObject*) const;
56 
57  EMObject* loadIfNotFullyLoaded(const MultiID&,TaskRunner* =0);
63  EMObject* getObject(const ObjectID&);
64  const EMObject* getObject(const ObjectID&) const;
65  EMObject* createTempObject(const char* type);
66 
67  BufferString objectName(const MultiID&) const;
69  const char* objectType(const MultiID&) const;
72  ObjectID getObjectID(const MultiID&) const;
76  MultiID getMultiID(const ObjectID&) const;
81  void burstAlertToAll(bool yn);
82 
83  void removeSelected(const ObjectID&,const Selector<Coord3>&,
84  TaskRunner*);
85  bool readDisplayPars(const MultiID&,IOPar&) const;
86  bool writeDisplayPars(const MultiID&,const IOPar&) const;
87  bool getSurfaceData(const MultiID&,SurfaceIOData&,
88  uiString& errmsg) const;
89 
91 
92 protected:
93 
94  mStruct(EarthModel) EMObjUndo
95  {
96  EMObjUndo(const EM::ObjectID& id)
97  : undo_(*new EMUndo()),id_(id) {}
98 
99  ~EMObjUndo() { delete &undo_; }
100  Undo& undo_;
101  EM::ObjectID id_;
102  };
103 
105 
107  /*don't use it, only for keep ABI */
108 
110 
111  void levelToBeRemoved(CallBacker*);
112  static const char* displayparameterstr();
113 
114  bool readParsFromDisplayInfoFile(const MultiID&,
115  IOPar&)const;
116  bool readParsFromGeometryInfoFile(const MultiID&,
117  IOPar&)const;
118  int undoIndexOf(const EM::ObjectID& id);
119 
120 public:
121 
122  // Don't use unless you know what you are doing
123 
124  void setEmpty();
125 
126  Executor* objectLoader(const MultiID&,
127  const SurfaceIODataSelection* =0);
128  Executor* objectLoader(const TypeSet<MultiID>&,
129  const SurfaceIODataSelection* =0,
130  TypeSet<MultiID>* idstobeloaded =0);
134  EM::ObjectID createObject(const char* type,const char* name);
138  /*Interface from EMObject to report themselves */
139  void addObject(EMObject*);
140  void removeObject(const EMObject*);
141 
142  Undo& undo();
143  /*don't use it, only for keep ABI */
144  const Undo& undo() const;
145  /*don't use it, only for keep ABI */
146 
147  void eraseUndoList();
148  Undo& undo(const EM::ObjectID&);
149 
150 };
151 
152 
153 mDefineFactory1Param( EarthModel, EMObject, EMManager&, EMOF );
154 
155 mGlobal(EarthModel) EMManager& EMM();
156 mGlobal(EarthModel) bool canOverwrite(const MultiID&);
157 
158 } // namespace EM
159 
160 #endif
int size() const
Definition: emmanager.h:53
#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
Definition: ioobj.h:58
#define mStruct(module)
Definition: commondefs.h:165
#define mGlobal(module)
Definition: commondefs.h:163
Data interesting for Surface I/O.
Definition: emsurfaceiodata.h:30
int nrLoadedObjects() const
Definition: emmanager.h:52
Undo & undo_
Definition: emmanager.h:106
mDefineFactory1Param(EarthModel, EMObject, EMManager &, EMOF)
Definition: uistring.h:89
Earth Model UI Part Server.
Definition: uiempartserv.h:55
Class to handle undo/redo information.
Definition: undo.h:42
Definition: callback.h:254
bool canOverwrite(const MultiID &)
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
Manages the loaded/half loaded EM objects in OpendTect.
Definition: emmanager.h:46
Notifier< EMManager > addRemove
Definition: emmanager.h:90
Set position UndoEvent.
Definition: emundo.h:33
Interface for classes that select on basis of a key.
Definition: selector.h:25
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
ObjectSet< EMObject > objects_
Definition: emmanager.h:109
Base class for all EarthModel objects.
Definition: emobject.h:158
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
Surface I/O data selection.
Definition: emsurfaceiodata.h:62
ObjectSet< EMObjUndo > undolist_
Definition: emmanager.h:102
EMManager & EMM()
Compound key consisting of ints.
Definition: multiid.h:25
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62

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