OpendTect  6.3
emmanager.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kristofer Tingdahl
8  Date: 4-11-2002
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "earthmodelmod.h"
15 #include "notify.h"
16 #include "factory.h"
17 #include "ptrman.h"
18 #include "ranges.h"
19 #include "dbkey.h"
20 #include "emposid.h"
21 #include "emundo.h"
22 
23 class Undo;
24 class IOObj;
25 class IOObjContext;
26 class TaskRunner;
27 class Executor;
28 class uiEMPartServer;
29 
30 template <class T> class Selector;
31 
32 namespace EM
33 {
34 class EMObject;
35 class SurfaceIOData;
36 class SurfaceIODataSelection;
37 
42 mExpClass(EarthModel) EMManager : public CallBacker
43 {
44 public:
45  EMManager();
46  ~EMManager();
47 
48  inline int nrLoadedObjects() const { return objects_.size(); }
49  inline int size() const { return nrLoadedObjects(); }
50  EM::ObjectID objectID(int idx) const;
51  bool objectExists(const EMObject*) const;
52 
53  EMObject* loadIfNotFullyLoaded(const DBKey&,TaskRunner* =0);
59  EMObject* getObject(const ObjectID&);
60  const EMObject* getObject(const ObjectID&) const;
61  EMObject* createTempObject(const char* type);
62 
63  BufferString objectName(const DBKey&) const;
65  const char* objectType(const DBKey&) const;
68  ObjectID getObjectID(const DBKey&) const;
72  DBKey getDBKey(const ObjectID&) const;
77  void burstAlertToAll(bool yn);
78 
79  void removeSelected(const ObjectID&,const Selector<Coord3>&,
80  TaskRunner*);
81  bool readDisplayPars(const DBKey&,IOPar&) const;
82  bool writeDisplayPars(const DBKey&,const IOPar&) const;
83  bool getSurfaceData(const DBKey&,SurfaceIOData&,
84  uiString& errmsg) const;
85 
87 
88 protected:
89 
91 
92  mStruct(EarthModel) EMObjUndo
93  {
94  EMObjUndo( const EM::ObjectID& id )
95  : undo_( *new EMUndo() ), id_ ( id ) {}
96 
97  ~EMObjUndo() { delete &undo_; }
98  Undo& undo_;
99  EM::ObjectID id_;
100  };
101 
103 
104  void levelSetChgCB(CallBacker*);
105  static const char* displayparameterstr();
106 
107  bool readParsFromDisplayInfoFile(const DBKey&,
108  IOPar&)const;
109  bool readParsFromGeometryInfoFile(const DBKey&,
110  IOPar&)const;
111  int undoIndexOf(const EM::ObjectID& id);
112 
113 public:
114 
115  // Don't use unless you know what you are doing
116 
117  void setEmpty();
118 
119  Executor* objectLoader(const DBKey&,
120  const SurfaceIODataSelection* =0);
121  Executor* objectLoader(const DBKeySet&,
122  const SurfaceIODataSelection* =0,
123  DBKeySet* idstobeloaded =0);
127  EM::ObjectID createObject(const char* type,const char* name);
131  /*Interface from EMObject to report themselves */
132  void addObject(EMObject*);
133  void removeObject(const EMObject*);
134 
135  void eraseUndoList();
136  Undo& undo(const EM::ObjectID&);
137 
138 };
139 
140 
141 mDefineFactory1Param( EarthModel, EMObject, EMManager&, EMOF );
142 
143 mGlobal(EarthModel) EMManager& EMM();
144 mGlobal(EarthModel) bool canOverwrite(const DBKey&);
145 
146 } // namespace EM
int size() const
Definition: emmanager.h:49
#define mExpClass(module)
Definition: commondefs.h:157
od_int32 ObjectID
Definition: emposid.h:22
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
Definition: ioobj.h:57
#define mStruct(module)
Definition: commondefs.h:162
#define mGlobal(module)
Definition: commondefs.h:160
Data interesting for Surface I/O.
Definition: emsurfaceiodata.h:28
int nrLoadedObjects() const
Definition: emmanager.h:48
Definition: dbkey.h:98
mDefineFactory1Param(EarthModel, EMObject, EMManager &, EMOF)
Definition: uistring.h:88
Earth Model UI Part Server.
Definition: uiempartserv.h:50
bool canOverwrite(const DBKey &)
Class to handle undo/redo information.
Definition: undo.h:40
Class to help setup a callback handling.
Definition: notify.h:121
Set of pointers to objects.
Definition: commontypes.h:28
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Class that can execute a task.
Definition: task.h:193
Manages the loaded/half loaded EM objects in OpendTect.
Definition: emmanager.h:42
Notifier< EMManager > addRemove
Definition: emmanager.h:86
Set position UndoEvent.
Definition: emundo.h:31
Interface for classes that select on basis of a key.
Definition: selector.h:23
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
ObjectSet< EMObject > objects_
Definition: emmanager.h:90
Base class for all EarthModel objects.
Definition: emobject.h:117
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:23
Full key to any object in the OpendTect data store.
Definition: dbkey.h:36
Surface I/O data selection.
Definition: emsurfaceiodata.h:60
ObjectSet< EMObjUndo > undolist_
Definition: emmanager.h:100
EMManager & EMM()
Specification to enable chunkwise execution of a process.
Definition: executor.h:38
Holds the context for selecting and/or creating IOObjs.
Definition: ioobjctxt.h:59

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