OpendTect-6_4  6.4
datapackbase.h
Go to the documentation of this file.
1 #ifndef datapackbase_h
2 #define datapackbase_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra and Helene Huck
9  Date: January 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 
17 #include "bindatadesc.h"
18 #include "bufstringset.h"
19 #include "datapack.h"
20 #include "position.h"
21 #include "trckeysampling.h"
22 #include "valseries.h"
23 
24 template <class T> class Array2D;
25 template <class T> class Array3D;
26 template <class T> class Array3DImpl;
27 
28 class FlatPosData;
29 class Scaler;
30 class TaskRunner;
31 namespace ZDomain { class Info; }
32 
33 
36 mExpClass(General) PointDataPack : public DataPack
37 {
38 public:
39 
40  virtual int size() const = 0;
41  virtual BinID binID(int) const = 0;
42  virtual float z(int) const = 0;
43  virtual Coord coord(int) const;
44  virtual int trcNr(int) const { return 0; }
45 
46  virtual bool simpleCoords() const { return true; }
48  virtual bool isOrdered() const { return false;}
50 
51 protected:
52 
53  PointDataPack( const char* categry )
54  : DataPack( categry ) {}
55 
56 };
57 
64 mExpClass(General) FlatDataPack : public DataPack
65 {
66 public:
67  FlatDataPack(const char* categry,
70  FlatDataPack(const FlatDataPack&);
71  ~FlatDataPack();
72 
73  virtual Array2D<float>& data() { return *arr2d_; }
74  const Array2D<float>& data() const
75  { return const_cast<FlatDataPack*>(this)
76  ->data(); }
77  virtual float getPosDistance(bool dim0,float posfidx) const
78  { return mUdf(float); }
79 
80  virtual FlatPosData& posData() { return posdata_; }
81  const FlatPosData& posData() const
82  { return const_cast<FlatDataPack*>(this)
83  ->posData(); }
84  virtual const char* dimName( bool dim0 ) const
85  { return dim0 ? "X1" : "X2"; }
86 
87  virtual Coord3 getCoord(int,int) const;
90 
91  virtual bool posDataIsCoord() const { return true; }
92  // Alternative positions for dim0
93  virtual void getAltDim0Keys(BufferStringSet&) const {}
95  virtual double getAltDim0Value(int ikey,int idim0) const;
96  virtual bool dimValuesInInt(const char* key) const
97  { return false; }
98 
99  virtual void getAuxInfo(int idim0,int idim1,IOPar&) const {}
100 
101  virtual float nrKBytes() const;
102  virtual void dumpInfo(IOPar&) const;
103 
104  virtual int size(bool dim0) const;
105 
106 protected:
107 
108  FlatDataPack(const char* category);
111 
114 
115 private:
116 
117  void init();
118 
119 };
120 
121 
125 {
126 public:
127  MapDataPack(const char* cat,
128  Array2D<float>*);
129  ~MapDataPack();
130 
131  Array2D<float>& data();
132  FlatPosData& posData();
133  const Array2D<float>& rawData() const { return *arr2d_; }
134  const FlatPosData& rawPosData() const { return posdata_; }
135  void setDimNames(const char*,const char*,bool forxy);
136  const char* dimName( bool dim0 ) const;
137 
139  bool posDataIsCoord() const { return isposcoord_; }
140  void setPosCoord(bool yn);
142  virtual void getAuxInfo(int idim0,int idim1,IOPar&) const;
143  void setProps(StepInterval<double> inlrg,
144  StepInterval<double> crlrg,
145  bool,BufferStringSet*);
146  void initXYRotArray(TaskRunner* = 0 );
147 
148  void setRange( StepInterval<double> dim0rg,
149  StepInterval<double> dim1rg,
150  bool forxy );
151 
152 protected:
153 
154  float getValAtIdx(int,int) const;
155  friend class MapDataPackXYRotater;
156 
162 };
163 
164 
165 
170 {
171 public:
172 
173  virtual Array3D<float>& data();
174  const Array3D<float>& data() const;
175 
176  virtual const char* dimName(char dim) const;
177  virtual double getPos(char dim,int idx) const;
178  int size(char dim) const;
179  virtual float nrKBytes() const;
180  virtual void dumpInfo(IOPar&) const;
181 
182 
183 protected:
184  VolumeDataPack(const char* categry,
185  Array3D<float>*);
187  ~VolumeDataPack();
188 
189  VolumeDataPack(const char* category);
192 
194 };
195 
196 
197 
200 mExpClass(General) SeisDataPack : public DataPack
201 {
202 public:
203  ~SeisDataPack();
204 
205  virtual bool is2D() const = 0;
206  virtual int nrTrcs() const = 0;
207  virtual TrcKey getTrcKey(int globaltrcidx) const = 0;
208  virtual int getGlobalIdx(const TrcKey&) const = 0;
209  virtual int getNearestGlobalIdx(const TrcKey&) const;
210 
211  void getPath(TrcKeyPath&) const;
212 
213  virtual bool addComponent(const char* nm) = 0;
214 
215  virtual const StepInterval<float>& getZRange() const = 0;
216 
217  const OffsetValueSeries<float> getTrcStorage(
218  int comp,int globaltrcidx) const;
219  OffsetValueSeries<float> getTrcStorage(int comp,int globaltrcidx);
220 
221  const float* getTrcData(int comp,int globaltrcidx) const;
222  float* getTrcData(int comp,int globaltrcidx);
223 
224  int nrComponents() const
225  { return arrays_.size(); }
226  bool isEmpty() const
227  { return arrays_.isEmpty(); }
228  bool validComp( int comp ) const
229  { return arrays_.validIdx( comp ); }
230  void setComponentName(const char*,int comp=0);
231  const char* getComponentName(int comp=0) const;
232 
233  static const char* categoryStr(bool isvertical,bool is2d);
234 
235  const Array3DImpl<float>& data(int component=0) const;
236  Array3DImpl<float>& data(int component=0);
237 
238  void setZDomain(const ZDomain::Info&);
239  const ZDomain::Info& zDomain() const
240  { return *zdomaininfo_; }
241 
242  void setScaler(const Scaler&);
243  void deleteScaler();
244  const Scaler* getScaler() const { return scaler_; }
245 
246  void setRefNrs( const TypeSet<float>& refnrs )
247  { refnrs_ = refnrs; }
248  float getRefNr(int globaltrcidx) const;
249 
250  const BinDataDesc& getDataDesc() const { return desc_; }
251  void setDataDesc(const BinDataDesc&);
252  //<! Will remove incompatible arrays if any
253 
254  float nrKBytes() const;
255  void dumpInfo(IOPar&) const;
256  void setRandomLineID(int);
257  int getRandomLineID() const;
258 
259  int getComponentIdx(const char* nm,
260  int defcompidx=-1) const;
261 
262 protected:
263  SeisDataPack(const char*,const BinDataDesc*);
264 
265  bool addArray(int sz0,int sz1,int sz2);
266  bool addArrayNoInit(int sz0,int sz1,int sz2);
267 
273  const Scaler* scaler_;
274  int rdlid_;
275 };
276 
277 #endif
#define mExpClass(module)
Definition: commondefs.h:160
BinDataDesc desc_
Definition: datapackbase.h:272
Threads::Lock initlock_
Definition: datapackbase.h:161
const Array2D< float > & rawData() const
Definition: datapackbase.h:133
ZDomain::Info * zdomaininfo_
Definition: datapackbase.h:271
virtual bool dimValuesInInt(const char *key) const
Definition: datapackbase.h:96
bool posDataIsCoord() const
Definition: datapackbase.h:139
const BinDataDesc & getDataDesc() const
Definition: datapackbase.h:250
DataPack for 2D data to be plotted on a Map.
Definition: datapackbase.h:124
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
Positioning of flat &#39;bulk&#39; data. Only the &#39;x1&#39; axis can be irregular.
Definition: flatposdata.h:26
const Array2D< float > & data() const
Definition: datapackbase.h:74
Array3D< float > * arr3d_
Definition: datapackbase.h:193
virtual bool simpleCoords() const
If true, coords are always SI().tranform(b)
Definition: datapackbase.h:46
DataPack for volume data. Should be renamed to VolumeDataPack later.
Definition: datapackbase.h:200
Array2D< float > * xyrotarr2d_
Definition: datapackbase.h:157
bool init()
virtual FlatPosData & posData()
Definition: datapackbase.h:80
TypeSet< float > refnrs_
Definition: datapackbase.h:270
DataPack for volume data, where the dims correspond to inl/crl/z .
Definition: datapackbase.h:169
Array2D< float > * arr2d_
Definition: datapackbase.h:112
ValueSeries of offsets.
Definition: valseries.h:69
virtual Array2D< float > & data()
Definition: datapackbase.h:73
A cartesian coordinate in 2D space.
Definition: coord.h:25
virtual const char * dimName(bool dim0) const
Definition: datapackbase.h:84
Set of BufferString objects.
Definition: bufstringset.h:28
virtual bool isOrdered() const
If yes, one can draw a line between the pts.
Definition: datapackbase.h:48
DataPack for point data.
Definition: datapackbase.h:36
FlatPosData & xyrotposdata_
Definition: datapackbase.h:158
const ZDomain::Info & zDomain() const
Definition: datapackbase.h:239
bool isposcoord_
Definition: datapackbase.h:159
A data packet: data+positioning and more that needs to be shared.
Definition: datapack.h:34
Set of pointers to objects.
Definition: commontypes.h:32
virtual bool posDataIsCoord() const
Definition: datapackbase.h:91
const FlatPosData & rawPosData() const
Definition: datapackbase.h:134
PointDataPack(const char *categry)
Definition: datapackbase.h:53
TypeSet< BufferString > axeslbls_
Definition: datapackbase.h:160
virtual int trcNr(int) const
Definition: datapackbase.h:44
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
int nrComponents() const
Definition: datapackbase.h:224
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
const Scaler * scaler_
Definition: datapackbase.h:273
virtual void getAltDim0Keys(BufferStringSet &) const
First one is &#39;default&#39;.
Definition: datapackbase.h:93
bool isEmpty() const
Definition: datapackbase.h:226
void setRefNrs(const TypeSet< float > &refnrs)
Definition: datapackbase.h:246
Scaling of floating point numbers.
Definition: scaler.h:33
FlatPosData & posdata_
Definition: datapackbase.h:113
A cartesian coordinate in 3D space.
Definition: coord.h:72
const Scaler * getScaler() const
Definition: datapackbase.h:244
BufferStringSet componentnames_
Definition: datapackbase.h:268
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
bool is2D(const PicksType &picks)
Definition: pickset.h:142
Implementation of Array3D.
Definition: arrayndimpl.h:151
ObjectSet< Array3DImpl< float > > arrays_
Definition: datapackbase.h:269
DataPack for flat data.
Definition: datapackbase.h:64
bool validComp(int comp) const
Definition: datapackbase.h:228
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
const FlatPosData & posData() const
Definition: datapackbase.h:81
virtual float getPosDistance(bool dim0, float posfidx) const
Definition: datapackbase.h:77
Description of binary data.
Definition: bindatadesc.h:43
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
Information of z-domain.
Definition: zdomain.h:91
int rdlid_
Definition: datapackbase.h:274
Definition: zdomain.h:20
virtual void getAuxInfo(int idim0, int idim1, IOPar &) const
Definition: datapackbase.h:99

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