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