OpendTect-6_4  6.4
mpeengine.h
Go to the documentation of this file.
1 #ifndef mpeengine_h
2 #define mpeengine_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 23-10-1996
10  RCS: $Id: mpeengine.h 38753 2015-04-11 21:19:18Z nanne.hemstra@dgbes.com $
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "mpeenginemod.h"
16 
17 #include "attribsel.h"
18 #include "callback.h"
19 #include "datapack.h"
20 #include "emposid.h"
21 #include "survgeom.h"
22 
23 class BufferStringSet;
24 class Executor;
25 
26 namespace EM { class EMObject; }
27 namespace Geometry { class Element; }
28 template <class T> class Selector;
29 
30 namespace MPE
31 {
32 
33 class EMTracker;
34 class HorizonTrackerMgr;
35 class ObjectEditor;
36 
38 {
39 public:
41  virtual bool checkInVolumeTrackMode() const = 0;
42  virtual bool checkActiveTracker() const = 0;
43  virtual bool checkStoredData(Attrib::SelSpec&,MultiID&) const = 0;
44  virtual bool checkPreloadedData(const MultiID&) const = 0;
45 };
46 
47 
52 mExpClass(MPEEngine) Engine : public CallBacker
54  mGlobal(MPEEngine) friend Engine& engine();
55 
56 public:
57  Engine();
58  virtual ~Engine();
59 
60  void init();
61 
62  const TrcKeyZSampling& activeVolume() const;
63  void setActiveVolume(const TrcKeyZSampling&);
65 
66  void setActive2DLine(Pos::GeomID);
67  Pos::GeomID activeGeomID() const;
68 
71 
72  void updateSeedOnlyPropagation(bool);
73 
74  enum TrackState { Started, Paused, Stopped };
75  TrackState getState() const { return state_; }
76  bool startTracking(uiString&);
77  bool startRetrack(uiString&);
78  bool startFromEdges(uiString&);
79  void stopTracking();
80  bool trackingInProgress() const;
81  void undo(uiString& errmsg);
82  void redo(uiString& errmsg);
83  bool canUnDo();
84  bool canReDo();
85  void enableTracking(bool yn);
88 
89  void removeSelectionInPolygon(
90  const Selector<Coord3>&,
91  TaskRunner*);
92  void getAvailableTrackerTypes(BufferStringSet&)const;
93 
94  int nrTrackersAlive() const;
95  int highestTrackerID() const;
96  const EMTracker* getTracker(int idx) const;
97  EMTracker* getTracker(int idx);
98  int getTrackerByObject(const EM::ObjectID&) const;
99  int getTrackerByObject(const char*) const;
100  int addTracker(EM::EMObject*);
101  void removeTracker(int idx);
103  void setActiveTracker(const EM::ObjectID&);
104  void setActiveTracker(EMTracker*);
105  EMTracker* getActiveTracker();
106 
107  /*Attribute stuff */
108  void setOneActiveTracker(const EMTracker*);
109  void unsetOneActiveTracker();
110  void getNeededAttribs(
111  TypeSet<Attrib::SelSpec>&) const;
112  TrcKeyZSampling getAttribCube(const Attrib::SelSpec&) const;
116  int getCacheIndexOf(const Attrib::SelSpec&) const;
117  DataPack::ID getAttribCacheID(const Attrib::SelSpec&) const;
118  bool hasAttribCache(const Attrib::SelSpec&) const;
119  bool setAttribData( const Attrib::SelSpec&,
120  DataPack::ID);
121  bool cacheIncludes(const Attrib::SelSpec&,
122  const TrcKeyZSampling&);
123  void swapCacheAndItsBackup();
124 
125  bool pickingOnSameData(const Attrib::SelSpec& oldss,
126  const Attrib::SelSpec& newss,
127  uiString& error) const;
128  bool isSelSpecSame(const Attrib::SelSpec& setupss,
129  const Attrib::SelSpec& clickedss) const;
130 
131  void updateFlatCubesContainer(const TrcKeyZSampling&,
132  int idx,bool);
134  ObjectSet<TrcKeyZSampling>* getTrackedFlatCubes(const int idx) const;
135  DataPack::ID getSeedPosDataPack(const TrcKey&,float z,
136  int nrtrcs,
137  const StepInterval<float>& zrg) const;
138 
139  /*Editors */
140  ObjectEditor* getEditor(const EM::ObjectID&,bool create);
141  void removeEditor(const EM::ObjectID&);
142 
143  void setValidator(TrackSettingsValidator*);
144  const char* errMsg() const;
145 
146  BufferString setupFileName(const MultiID&) const;
147 
148  void fillPar(IOPar&) const;
149  bool usePar(const IOPar&);
150  const TrcKeyPath* activePath() const;
151  void setActivePath(const TrcKeyPath*);
152  int activeRandomLineID() const;
153  void setActiveRandomLineID(int);
154  void refTracker(EM::ObjectID);
155  void unRefTracker(EM::ObjectID,bool nodel=false);
156  bool hasTracker(EM::ObjectID) const;
157 
159 
160 protected:
161 
164 
166 
171 
177  int rdlid_;
179 
180  bool prepareForTrackInVolume(uiString&);
181  bool prepareForRetrack();
182  bool trackInVolume();
183  bool trackFromEdges();
184  void trackingFinishedCB(CallBacker*);
185  EM::EMObject* getCurrentEMObject() const;
186 
187 
188  struct CacheSpecs
189  {
191  Pos::GeomID geomid=
193  : attrsel_(as),geomid_(geomid)
194  {}
195 
198  };
199 
204 
205  mStruct(MPEEngine) FlatCubeInfo
206  {
207  FlatCubeInfo()
208  :nrseeds_(1)
209  {
210  flatcs_.setEmpty();
211  }
212  TrcKeyZSampling flatcs_;
213  int nrseeds_;
214  };
215 
217 
218  static const char* sKeyNrTrackers(){ return "Nr Trackers"; }
219  static const char* sKeyObjectID() { return "ObjectID"; }
220  static const char* sKeyEnabled() { return "Is enabled"; }
221  static const char* sKeyTrackPlane(){ return "Track Plane"; }
222  static const char* sKeySeedConMode(){ return "Seed Connect Mode"; }
223 
224  void applClosingCB(CallBacker*);
225 };
226 
227 
228 mGlobal(MPEEngine) Engine& engine();
229 
230 } // namespace MPE
231 
232 #endif
int undoeventid_
Definition: mpeengine.h:174
#define mExpClass(module)
Definition: commondefs.h:160
od_int32 ObjectID
Definition: emposid.h:24
ObjectSet< HorizonTrackerMgr > trackermgrs_
Definition: mpeengine.h:168
static const char * sKeyNrTrackers()
Definition: mpeengine.h:218
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
TrcKeyZSampling activevolume_
Definition: mpeengine.h:163
virtual ~TrackSettingsValidator()
Definition: mpeengine.h:40
static Geometry::ID cUndefGeomID()
Definition: survgeom.h:136
#define mStruct(module)
Definition: commondefs.h:165
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
TrackState
Definition: mpeengine.h:74
#define mGlobal(module)
Definition: commondefs.h:163
Pos::GeomID geomid_
Definition: mpeengine.h:197
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
MPE stands for Model, Predict, Edit. Contains tracking and editing functions.
Definition: autotracker.h:32
bool init()
ObjectSet< CacheSpecs > attribbackupcachespecs_
Definition: mpeengine.h:203
Attrib::SelSpec attrsel_
Definition: mpeengine.h:196
Engine & engine()
ObjectSet< EMTracker > trackers_
Definition: mpeengine.h:169
TypeSet< DataPack::ID > attribbkpcachedatapackids_
Definition: mpeengine.h:202
TypeSet< DataPack::ID > attribcachedatapackids_
Definition: mpeengine.h:200
Tracks EM objects.
Definition: emtracker.h:40
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
int ID
Definition: datapack.h:38
static const char * sKeySeedConMode()
Definition: mpeengine.h:222
CacheSpecs(const Attrib::SelSpec &as, Pos::GeomID geomid=Survey::GeometryManager::cUndefGeomID())
Definition: mpeengine.h:190
MultiID midtoload
Definition: mpeengine.h:70
Definition: callback.h:254
Set of pointers to objects.
Definition: commontypes.h:32
Manages DataPacks.
Definition: datapack.h:141
BufferString errmsg_
Definition: mpeengine.h:162
int rdlid_
Definition: mpeengine.h:177
Pos::GeomID activegeomid_
Definition: mpeengine.h:165
static const char * sKeyObjectID()
Definition: mpeengine.h:219
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
Notifier< Engine > actionFinished
Definition: mpeengine.h:87
Notifier< Engine > actionCalled
Definition: mpeengine.h:86
static const char * sKeyEnabled()
Definition: mpeengine.h:220
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Abstraction of EM Object editing. It gives lists of which nodes that may be moved, and in what manner.
Definition: emeditor.h:47
ObjectSet< CacheSpecs > attribcachespecs_
Definition: mpeengine.h:201
static const char * sKeyTrackPlane()
Definition: mpeengine.h:221
Interface for classes that select on basis of a key.
Definition: selector.h:25
DataPackMgr & dpm_
Definition: mpeengine.h:175
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Definition: mpeengine.h:188
Index_Type GeomID
Definition: commontypes.h:52
ObjectSet< ObjectSet< FlatCubeInfo > > flatcubescontainer_
Definition: mpeengine.h:214
const TrcKeyPath * rdmlinetkpath_
Definition: mpeengine.h:176
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
static uiHor3DInterpol * create(uiParent *)
Base class for all EarthModel objects.
Definition: emobject.h:158
EMTracker * activetracker_
Definition: mpeengine.h:173
Notifier< Engine > loadEMObject
Definition: mpeengine.h:69
const EMTracker * oneactivetracker_
Definition: mpeengine.h:172
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
ObjectSet< ObjectEditor > editors_
Definition: mpeengine.h:170
Specifies an attribute selection (ID or output number of NN).
Definition: attribsel.h:45
TrackSettingsValidator * validator_
Definition: mpeengine.h:178
Notifier< Engine > trackeraddremove
Definition: mpeengine.h:102
const char * errMsg() const
Definition: horizontracker.h:61
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
Notifier< Engine > settingsChanged
Definition: mpeengine.h:158
Main engine for tracking EM objects like horizons, faults etc.,.
Definition: mpeengine.h:52
Definition: mpeengine.h:37
TrackState state_
Definition: mpeengine.h:167
Definition: arraytesselator.h:21
TrackState getState() const
Definition: mpeengine.h:75
Notifier< Engine > activevolumechange
Definition: mpeengine.h:64
Compound key consisting of ints.
Definition: multiid.h:25
Specification to enable chunkwise execution of a process.
Definition: executor.h:39

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