OpendTect-6_4  6.4
velocitypicks.h
Go to the documentation of this file.
1 #ifndef velocitypicks_h
2 #define velocitypicks_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: April 2005
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "velocitymod.h"
17 #include "multidimstorage.h"
18 #include "callback.h"
19 #include "color.h"
20 #include "emposid.h"
21 #include "enums.h"
22 #include "multiid.h"
23 #include "ranges.h"
24 #include "refcount.h"
25 #include "rowcol.h"
26 
27 class Undo;
28 class IOObj;
29 template <class T> class Smoother1D;
30 class BinIDValueSet;
31 class IOObjContext;
32 
33 namespace EM { class Horizon3D; }
34 
35 namespace Vel
36 {
37 
38 class PicksMgr;
39 
40 mExpClass(Velocity) Pick
41 {
42 public:
43  Pick(float depth=mUdf(float),
44  float vel=mUdf(float),
45  float offset=mUdf(float),EM::ObjectID=-1);
46  bool operator==(const Pick& b) const;
47 
48  float depth_;
49  float offset_;
50  float vel_;
52 };
53 
54 
57 mExpClass(Velocity) Picks : public CallBacker
59 public:
60  Picks();
61  Picks(bool zit);
62 
63  enum PickType { RMO, RMS, Delta, Epsilon, Eta };
65  PickType pickType() const;
66  void setPickType( PickType, bool resetcolor );
67  const char* zDomain() const;
68 
69  bool setColor(const Color&,bool savedefault);
71  const Color& getColor() const { return color_; }
72  bool getDefaultColor(Color&) const;
73 
74 
75  Undo& undo();
76 
77  void removeAll(bool undo=true,bool interactionend=true);
78  bool isEmpty() const;
79 
80 
81  void setSnappingInterval(const StepInterval<float>&);
82  const StepInterval<float>& getSnappingInterval() const { return snapper_; }
83  RowCol find(const BinID&,const Pick&) const;
84  RowCol set(const BinID&, const Pick&,
85  bool undo=true,bool interactionend=true);
86  void set(const RowCol&,
87  const Pick&,bool undo=true,
88  bool interactionend=true);
89  int get(const BinID&, TypeSet<float>* depths,
90  TypeSet<float>* vals,
93  bool interpolatehors ) const;
95  void get(const BinID&, TypeSet<Pick>&,
96  bool interpolatehors,
97  bool normalizerefoffset ) const;
99  bool get(const RowCol&, BinID&, Pick& );
100  void get(const EM::ObjectID&,TypeSet<RowCol>&) const;
101  void remove(const RowCol&,
102  bool undo=true,bool interactionend=true);
103 
104  const MultiDimStorage<Pick>& getAll() const { return picks_; }
105 
110  bool isChanged() const;
111  void resetChangedFlag() { changed_ = false; }
112 
113  bool store(const IOObj*);
116  const MultiID& storageID() const;
117  bool zIsTime() const { return zit_; }
118 
119  Smoother1D<float>* getSmoother() { return smoother_; }
120  const Smoother1D<float>* getSmoother() const { return smoother_; }
121  void setSmoother(Smoother1D<float>*);
123 
124  const char* errMsg() const;
125  static const char* sKeyIsTime();
126 
127  void setAll(float vel,bool undo=true);
128 
129  static const IOObjContext& getStorageContext();
130  static void setContextPickType(IOObjContext&,PickType);
131 
132  float refOffset() const { return refoffset_; }
133  void setReferenceOffset(float n);
134 
135  const MultiID& gatherID() const;
136  void setGatherID(const MultiID&);
137 
138 
139  void addHorizon(const MultiID&,
140  bool addzeroonfail=false);
141  void addHorizon(EM::Horizon3D*);
142  int nrHorizons() const;
143 
144  EM::ObjectID getHorizonID(int) const;
145  void removeHorizon(EM::ObjectID);
146  EM::Horizon3D* getHorizon(EM::ObjectID);
147  const EM::Horizon3D* getHorizon(EM::ObjectID) const;
148  bool interpolateVelocity(EM::ObjectID,
149  float searchradius,BinIDValueSet&) const;
153  char getHorizonStatus(const BinID&) const;
159  static const char* sKeyVelocityPicks();
160  static const char* sKeyRefOffset();
161  static const char* sKeyGatherID();
162  static const char* sKeyNrHorizons();
163  static const char* sKeyHorizonPrefix();
164  static const char* sKeyPickType();
165 
166 protected:
167  void getColorKey(BufferString&) const;
168  void removeHorizons();
169  friend class PicksMgr;
170  void fillIOObjPar(IOPar&) const;
171  bool useIOObjPar(const IOPar&);
172  float normalizeRMO(float depth,float rmo,
173  float offset) const;
177  void fillPar(IOPar&) const;
178  bool usePar(const IOPar&);
179 
180  void horizonChangeCB(CallBacker*);
181 
182  float refoffset_;
184  bool load(const IOObj*);
188 
190 
194 
197 
198  bool changed_;
199  bool zit_;
200 
201 };
202 
203 
204 mExpClass(Velocity) PicksMgr : public CallBacker
205 {
206 public:
207  PicksMgr();
208  ~PicksMgr();
209 
210  Picks* get(const MultiID&,bool gathermid,
211  bool create, bool forcefromstorage );
212 
213  const char* errMsg() const;
214 protected:
215  friend class Picks;
216 
217  void surveyChange(CallBacker*);
218 
221 };
222 
223 
224 mGlobal(Velocity) PicksMgr& VPM();
225 
226 } // namespace Vel
227 
228 #endif
#define mRefCountImpl(ClassName)
Macro to setup a class with destructor for reference counting.
Definition: refcount.h:163
Color color_
Definition: velocitypicks.h:196
#define mExpClass(module)
Definition: commondefs.h:160
od_int32 ObjectID
Definition: emposid.h:24
Velocity.
Definition: velocityfunction.h:32
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: multidimstorage.h:25
Definition: ioobj.h:58
BufferString errmsg_
Definition: velocitypicks.h:219
Definition: velocitypicks.h:57
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
PickType
Definition: velocitypicks.h:63
#define mGlobal(module)
Definition: commondefs.h:163
MultiID gatherid_
Definition: velocitypicks.h:183
const MultiDimStorage< Pick > & getAll() const
Definition: velocitypicks.h:104
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
bool zIsTime() const
Definition: velocitypicks.h:117
float depth_
Definition: velocitypicks.h:48
Undo * undo_
Definition: velocitypicks.h:189
ObjectSet< EM::Horizon3D > horizons_
Definition: velocitypicks.h:193
PicksMgr & VPM()
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
Definition: velocitypicks.h:204
Class to handle undo/redo information.
Definition: undo.h:42
const StepInterval< float > & getSnappingInterval() const
Definition: velocitypicks.h:82
MultiDimStorage< Pick > picks_
Definition: velocitypicks.h:187
void removeAll()
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
EM::ObjectID emobjid_
Definition: velocitypicks.h:51
Smoother1D< float > * getSmoother()
Definition: velocitypicks.h:119
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
const Color & getColor() const
Definition: velocitypicks.h:71
float vel_
Definition: velocitypicks.h:50
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Smoothes a 1d signal with an operator.
Definition: smoother1d.h:28
const T * find(const ObjectSet< T > &os, const S &val)
Get const object in set.
Definition: objectset.h:183
IdxPair used for its row() and col().
Definition: rowcol.h:25
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
static uiHor3DInterpol * create(uiParent *)
void resetChangedFlag()
Definition: velocitypicks.h:111
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
const Smoother1D< float > * getSmoother() const
Definition: velocitypicks.h:120
Definition: velocitypicks.h:63
StepInterval< float > snapper_
Definition: velocitypicks.h:185
float refoffset_
Definition: velocitypicks.h:182
Definition: picklocation.h:21
MultiID storageid_
Definition: velocitypicks.h:186
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
A Pos::IdxPairValueSet with BinIDs.
Definition: binidvalset.h:23
Notifier with automatic capsule creation.
Definition: callback.h:395
Smoother1D< float > * smoother_
Definition: velocitypicks.h:192
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
bool zit_
Definition: velocitypicks.h:199
const char * errMsg() const
Definition: horizontracker.h:61
3D Horizon. A Horizon is made up of one or more grids (so they can overlap at faults). The grids are defined by knot-points in a matrix and fillstyle in between the knots.
Definition: emhorizon3d.h:96
BufferString errmsg_
Definition: velocitypicks.h:191
CNotifier< Picks, const BinID & > change
Definition: velocitypicks.h:106
bool isEmpty(const NLAModel *mdl)
bool changed_
Definition: velocitypicks.h:198
float refOffset() const
Definition: velocitypicks.h:132
CNotifier< Picks, const BinID & > changelate
Definition: velocitypicks.h:107
PickType picktype_
Definition: velocitypicks.h:195
float offset_
Definition: velocitypicks.h:49
Compound key consisting of ints.
Definition: multiid.h:25
ObjectSet< Picks > velpicks_
Definition: velocitypicks.h:220
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