16 #include "earthmodelmod.h" 33 namespace Geometry {
class Element; }
36 template <
class T>
class Array2D;
53 , flagfor2dviewer( false )
54 , event( EMObjectCallbackData::
Undef )
61 , attrib( data.attrib )
62 , flagfor2dviewer( data.flagfor2dviewer )
67 enum Event {
Undef, PositionChange, PosIDChange, PrefColorChange, Removal,
69 LockChange, BurstAlert, LockColorChange } event;
89 emcallbackdata_ += data;
95 return emcallbackdata_.validIdx(idx) ? emcallbackdata_[idx] : 0;
106 return emcallbackdata_.size();
130 virtual bool canGoTo()
const {
return false; }
144 enum Type { PermanentControlNode, TemporaryControlNode,
161 { prepareForDelete();
delete this; } );
164 Auto=(int)
'2', Gridding=(
int)
'3' };
167 virtual const char* getTypeStr()
const = 0;
168 virtual uiString getUserTypeStr()
const = 0;
170 void setMultiID(
const MultiID&);
172 virtual bool isOK()
const {
return true; }
174 void setName(
const char* nm ) { objname_ = nm; }
178 virtual void setNewName();
180 virtual int nrSections()
const = 0;
181 virtual SectionID sectionID(
int)
const = 0;
183 virtual bool canSetSectionName()
const;
184 virtual bool setSectionName(
const SectionID&,
const char*,
186 virtual int sectionIndex(
const SectionID&)
const;
193 const Color& preferredColor()
const;
194 void setPreferredColor(
const Color&,
195 bool addtohistory=
false);
198 void setBurstAlert(
bool yn);
199 bool hasBurstAlert()
const;
204 virtual bool isDefined(
const EM::PosID&)
const;
210 const Coord3&,
bool addtohistory);
211 virtual bool unSetPos(
const EM::PosID&,
bool addtohistory);
230 virtual void setLockColor(
const Color&);
231 virtual const Color& getLockColor()
const;
236 void setSelectionColor(
const Color&);
237 const Color& getSelectionColor()
const;
239 virtual bool enableGeometryChecks(
bool);
240 virtual bool isGeometryChecksEnabled()
const;
242 virtual bool isAtEdge(
const EM::PosID&)
const;
265 virtual int nrPosAttribs()
const;
266 virtual int posAttrib(
int idx)
const;
267 virtual void addPosAttrib(
int attr);
268 virtual void removePosAttribList(
int attr,
269 bool addtohistory=
true);
270 virtual void setPosAttrib(
const EM::PosID&,
271 int attr,
bool yn,
bool addtohistory=
true);
273 virtual bool isPosAttrib(
const EM::PosID&,
int attr)
const;
274 virtual const char* posAttribName(
int)
const;
275 virtual int addPosAttribName(
const char*);
278 void setPosAttrMarkerStyle(
int attr,
280 virtual void lockPosAttrib(
int attr,
bool yn);
281 virtual bool isPosAttribLocked(
int attr)
const;
288 void removeAllUnSeedPos();
290 void emptyRemovedPolySelectedPosBox();
305 virtual void lock(
bool yn) { locked_=yn;}
308 {
return insideselremoval_; }
316 void saveDisplayPars()
const;
318 virtual bool useDisplayPar(
const IOPar&);
319 virtual void fillDisplayPar(
IOPar&)
const;
321 static int sPermanentControlNode();
322 static int sTemporaryControlNode();
323 static int sEdgeControlNode();
324 static int sTerminationNode();
325 static int sSeedNode();
326 static int sIntersectionNode();
334 virtual void prepareForDelete()
const;
335 void posIDChangeCB(CallBacker*);
338 void useDisplayPars(
const IOPar&);
365 static const char* nrposattrstr();
366 static const char* posattrprefixstr();
367 static const char* posattrsectionstr();
368 static const char* posattrposidstr();
373 #define mDefineEMObjFuncs( clss ) \ 374 mODTextTranslationClass( clss ); \ 376 clss(EM::EMManager&); \ 377 static void initClass(); \ 378 static EMObject* create(EM::EMManager&); \ 379 static clss* create(const char* nm); \ 380 static FixedString typeStr(); \ 381 const char* getTypeStr() const; \ 386 #define mImplementEMObjFuncs( clss, typenm ) \ 387 void clss::initClass() \ 389 EMOF().addCreator( create, typeStr() ); \ 393 EMObject* clss::create( EM::EMManager& emm ) \ 395 EMObject* obj = new clss( emm ); \ 396 if ( !obj ) return 0; \ 398 emm.addObject( obj ); \ 399 obj->unRefNoDelete(); \ 403 clss* clss::create( const char* nm ) \ 405 const ObjectID objid = EMM().createObject( typeStr(), nm ); \ 406 EMObject* emobj = EMM().getObject( objid ); \ 407 mDynamicCastGet(clss*,newobj,emobj); \ 411 FixedString clss::typeStr() { return typenm; } \ 412 const char* clss::getTypeStr() const { return typeStr(); } \ 413 void clss::setNewName() \ 415 static int objnr = 1; \ 416 BufferString nm( "<New ", typenm, " " ); \ 417 nm.add( objnr++ ).add( ">" ); \ od_int16 SectionID
Definition: emposid.h:25
#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
BufferString objname_
Definition: emobject.h:339
Locks the lock, shutting out access from other threads if needed.
Definition: threadlock.h:85
virtual void getLinkedPos(const EM::PosID &posid, TypeSet< EM::PosID > &) const
Definition: emobject.h:252
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
T to(const F &fr)
Definition: convert.h:33
Event
Definition: emobject.h:67
FixedString Undef()
Definition: keystrs.h:142
virtual bool isNodeSourceType(const TrcKey &, NodeSourceType) const
Definition: emobject.h:218
Export_Basic uiString toUiString(ViewStyle)
Is an identifier for each position in the earthmodel.
Definition: emposid.h:37
bool locked_
Definition: emobject.h:355
Color & preferredcolor_
Definition: emobject.h:345
virtual int approximateSize() const
Definition: emobject.h:128
virtual bool hasLockedNodes() const
Definition: emobject.h:232
Definition: emobject.h:68
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
ObjectSet< PosAttrib > posattribs_
Definition: emobject.h:348
Type type_
Definition: emobject.h:148
virtual void unlockAll()
Definition: emobject.h:227
Position attribute.
Definition: emobject.h:139
TypeSet< int > attribs_
Definition: emobject.h:349
bool isSelRemoving() const
Definition: emobject.h:309
TypeSet< PosID > posids_
Definition: emobject.h:149
int attrib
Definition: emobject.h:73
Thread safe set of EMObjectCallbackData.
Definition: emobject.h:83
EM::PosID pid0
Definition: emobject.h:71
uiString uiName() const
Definition: emobject.h:177
Definition: uistring.h:89
virtual bool isOK() const
Definition: emobject.h:172
EMObjectCallbackData()
Definition: emobject.h:49
od_int64 SubID
Definition: emposid.h:26
virtual void setNodeLocked(const TrcKey &, bool locked)
Definition: emobject.h:221
FixedString None()
Definition: keystrs.h:90
Definition: emobject.h:145
ObjectSet< EMObjectCallbackData > emcallbackdata_
Definition: emobject.h:110
class EMManager & manager_
Definition: emobject.h:342
void setErrMsg(const uiString &m)
Definition: emobject.h:312
Set of pointers to objects.
Definition: commontypes.h:32
virtual void setChangedFlag()
Definition: emobject.h:299
Iterator that iterates a number of positions (normally all) on an EMObject. The object is created by ...
Definition: emobject.h:122
MultiID storageid_
Definition: emobject.h:341
void addCallBackData(EM::EMObjectCallbackData *data)
Definition: emobject.h:86
bool haslockednodes_
Definition: emobject.h:358
virtual bool isNodeLocked(const TrcKey &) const
Definition: emobject.h:222
virtual int maximumSize() const
Definition: emobject.h:129
Set of (small) copyable elements.
Definition: commontypes.h:30
int burstalertcount_
Definition: emobject.h:356
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class that can execute a task.
Definition: task.h:169
bool insideselremoval_
Definition: emobject.h:362
const ObjectID & id() const
Definition: emobject.h:166
const MultiID & multiID() const
Definition: emobject.h:169
virtual const Array2D< char > * getLockedNodes() const
Definition: emobject.h:229
virtual EM::PosID goTo(od_int64)
Definition: emobject.h:131
bool fullyloaded_
Definition: emobject.h:354
virtual bool isNodeSourceType(const PosID &, NodeSourceType) const
Definition: emobject.h:216
Manages the loaded/half loaded EM objects in OpendTect.
Definition: emmanager.h:46
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
bool selremoving_
Definition: emobject.h:363
virtual bool isLoaded() const
Definition: emobject.h:295
MarkerStyle3D & preferredmarkerstyle_
Definition: emobject.h:347
bool isInsideSelRemoval() const
Definition: emobject.h:307
EM::EMObjectCallbackData * getCallBackData(int idx)
Definition: emobject.h:92
EM::PosID pid1
Definition: emobject.h:72
bool isFullyLoaded() const
Definition: emobject.h:301
void setFullyLoaded(bool yn)
Definition: emobject.h:302
Interface for classes that select on basis of a key.
Definition: selector.h:25
virtual void lockAll()
Definition: emobject.h:226
virtual bool canGoTo() const
Definition: emobject.h:130
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
void clearData()
Definition: emobject.h:98
CNotifier< EMObject, const EMObjectCallbackData & > change
Definition: emobject.h:292
A cartesian coordinate in 3D space.
Definition: coord.h:72
Threads::Lock lock_
Definition: emobject.h:111
Definition: geomelement.h:37
Type
Definition: emobject.h:144
virtual ~EMObjectIterator()
Definition: emobject.h:125
virtual Executor * saver()
Definition: emobject.h:296
virtual void lock(bool yn)
Definition: emobject.h:305
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool flagfor2dviewer
Definition: emobject.h:74
uiString errmsg_
Definition: emobject.h:343
virtual bool isNodeLocked(const PosID &) const
Definition: emobject.h:224
void setName(const char *nm)
Definition: emobject.h:174
BufferString errmsg_
Definition: horizontracker.h:119
virtual Executor * loader()
Definition: emobject.h:294
Color selectioncolor_
Definition: emobject.h:360
PosAttrib()
Definition: emobject.h:142
EMObjectCallbackData(const EMObjectCallbackData &data)
Definition: emobject.h:58
Base class for all EarthModel objects.
Definition: emobject.h:158
OD::LineStyle & preferredlinestyle_
Definition: emobject.h:346
EM object callback data.
Definition: emobject.h:46
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
Notifier with automatic capsule creation.
Definition: callback.h:395
Threads::Lock setposlock_
Definition: emobject.h:357
NodeSourceType
Definition: emobject.h:163
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
virtual bool isLocked() const
Definition: emobject.h:304
ObjectID id_
Definition: emobject.h:340
virtual EMObjectIterator * createIterator(const EM::SectionID &, const TrcKeyZSampling *=0) const
Definition: emobject.h:259
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
virtual bool isChanged() const
Definition: emobject.h:297
Color lockcolor_
Definition: emobject.h:359
bool isEmpty(const NLAModel *mdl)
TrcKeyZSampling removebypolyposbox_
Definition: emobject.h:351
virtual bool removeSection(SectionID, bool hist)
Definition: emobject.h:187
virtual void setNodeSourceType(const TrcKey &, NodeSourceType)
Definition: emobject.h:214
int size() const
Definition: emobject.h:104
virtual void resetChangedFlag()
Definition: emobject.h:300
Definition: arraytesselator.h:21
bool locked_
Definition: emobject.h:150
IOObjContext * getIOObjContext(Seis::GeomType, bool forread)
Compound key consisting of ints.
Definition: multiid.h:25
bool changed_
Definition: emobject.h:353
virtual bool hasNodeSourceType(const PosID &) const
Definition: emobject.h:233
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
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:118
Definition: emobject.h:67