OpendTect  6.3
emeditor.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: A.H. Bril
8  Date: 23-10-1996
9  Contents: Ranges
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "mpeenginemod.h"
15 #include "notify.h"
16 #include "emposid.h"
17 #include "factory.h"
18 #include "coord.h"
19 
20 class BufferStringSet;
21 
22 namespace EM { class EMObject; }
23 namespace Geometry { class ElementEditor; }
24 
25 namespace MPE
26 {
27 
44 mExpClass(MPEEngine) ObjectEditor : public RefCount::Referenced
45  , public CallBacker
46 {
47 public:
49 
50  const EM::EMObject& emObject() const { return *emobject_; }
51 
52  virtual void startEdit( const EM::PosID& );
53  virtual bool setPosition(const Coord3&);
54  virtual void finishEdit();
55 
56  bool canSnapAfterEdit(const EM::PosID&) const;
57  bool getSnapAfterEdit() const;
58  void setSnapAfterEdit(bool yn);
59 
60  void addUser() { nrusers_++; }
61  void removeUser() { nrusers_--; }
62  int nrUsers() const { return nrusers_; }
63 
64  virtual const
70  virtual int getAlongMovingStyle() const { return -1; }
73  virtual void setAlongMovingStyle(int index ) {}
77  virtual void getEditIDs(TypeSet<EM::PosID>&) const;
79  virtual bool addEditID( const EM::PosID& );
82  virtual bool removeEditID( const EM::PosID& );
86  virtual Coord3 getPosition(const EM::PosID&) const;
87  virtual bool mayTranslate1D(const EM::PosID&) const;
88  virtual Coord3 translation1DDirection(const EM::PosID&) const;
89 
90  virtual bool mayTranslate2D(const EM::PosID&) const;
91  virtual Coord3 translation2DNormal(const EM::PosID&) const;
92 
93  virtual bool mayTranslate3D(const EM::PosID&) const;
94 
95  virtual bool maySetNormal(const EM::PosID&) const;
96  virtual Coord3 getNormal(const EM::PosID&) const;
97 
98  virtual bool maySetDirection(const EM::PosID&) const;
99  virtual Coord3 getDirectionPlaneNormal(const EM::PosID&) const;
100  virtual Coord3 getDirection(const EM::PosID&) const;
101 
107  static void enableNodeCloning(bool yn=true);
108 
109 protected:
110  ~ObjectEditor();
111 
112  virtual bool setPosition(const EM::PosID&,
113  const Coord3&);
114  Geometry::ElementEditor* getEditor( const EM::SectionID& );
115  const Geometry::ElementEditor* getEditor( const EM::SectionID& ) const;
116  virtual Geometry::ElementEditor* createEditor( const EM::SectionID& )=0;
117 
118  void editPosChangeTrigger(CallBacker*);
119  void emSectionChange(CallBacker*);
120 
121  virtual void getAlongMovingNodes( const EM::PosID&,
123  TypeSet<float>* ) const;
128  virtual void cloneMovingNode(CallBacker*) {}
129 
137 
138  int nrusers_;
139 
140 private:
143 
145 
147 };
148 
149 mDefineFactory1Param( MPEEngine, ObjectEditor, EM::EMObject&, EditorFactory );
150 
151 } // namespace MPE
EM::PosID movingnode_
Definition: emeditor.h:131
od_int16 SectionID
Definition: emposid.h:23
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
int nrusers_
Definition: emeditor.h:138
void removeUser()
Definition: emeditor.h:61
Is an identifier for each position in the earthmodel.
Definition: emposid.h:35
TypeSet< float > alongmovingnodesfactors_
Definition: emeditor.h:136
MPE stands for Model, Predict, Edit. Contains tracking and editing functions.
Definition: autotracker.h:30
void addUser()
Definition: emeditor.h:60
mDefineFactory1Param(EarthModel, EMObject, EMManager &, EMOF)
TypeSet< EM::PosID > alongmovingnodes_
Definition: emeditor.h:134
Set of BufferString objects.
Definition: bufstringset.h:25
Definition: geeditor.h:23
Class to help setup a callback handling.
Definition: notify.h:121
3D point or vector
Definition: commontypes.h:57
virtual const BufferStringSet * getAlongMovingStyleNames() const
Definition: emeditor.h:65
virtual int getAlongMovingStyle() const
Definition: emeditor.h:70
RefMan< EM::EMObject > emobject_
Definition: emeditor.h:130
bool snapafterthisedit_
Definition: emeditor.h:144
Abstraction of EM Object editing. It gives lists of which nodes that may be moved, and in what manner.
Definition: emeditor.h:44
virtual void cloneMovingNode(CallBacker *)
Definition: emeditor.h:128
TypeSet< Coord3 > alongmovingnodesstart_
Definition: emeditor.h:135
const EM::EMObject & emObject() const
Definition: emeditor.h:50
ObjectSet< Geometry::ElementEditor > geeditors_
Definition: emeditor.h:141
int nrUsers() const
Definition: emeditor.h:62
TypeSet< EM::PosID > changedpids_
Definition: emeditor.h:133
Base class for all EarthModel objects.
Definition: emobject.h:117
TypeSet< EM::SectionID > sections_
Definition: emeditor.h:142
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:23
Notifier< ObjectEditor > editpositionchange
Definition: emeditor.h:102
bool snapafteredit_
Definition: emeditor.h:146
Coord3 startpos_
Definition: emeditor.h:132
Definition: arraytesselator.h:19
virtual void setAlongMovingStyle(int index)
Definition: emeditor.h:73

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