OpendTect-6_4  6.4
attriboutput.h
Go to the documentation of this file.
1 #ifndef attriboutput_h
2 #define attriboutput_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: 07-10-1999
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "attributeenginemod.h"
16 #include "bufstringset.h"
17 #include "datapointset.h"
18 #include "trckeyzsampling.h"
19 #include "ranges.h"
20 #include "refcount.h"
21 #include "seistype.h"
22 #include "uistring.h"
23 
24 class BinDataDesc;
25 class BinIDValueSet;
27 class SeisTrc;
28 class SeisTrcInfo;
29 class SeisTrcBuf;
30 class SeisTrcWriter;
31 class Scaler;
32 namespace Seis { class SelData; }
33 
34 namespace Attrib
35 {
36 class DataHolder;
37 class Data2DHolder;
38 class Processor;
39 
44 mExpClass(AttributeEngine) Output
45 { mRefCountImpl(Output);
46 public:
47  Output();
48 
49  virtual bool getDesiredVolume(TrcKeyZSampling&) const
50  { return true; }
51  virtual bool useCoords() const { return false;}
52  virtual bool wantsOutput(const BinID&) const; // overrule it
53  virtual bool wantsOutput(const Coord&) const; // or this one
54 
55  virtual const RegularSeisDataPack* getDataPack() const { return 0; }
56  virtual RegularSeisDataPack* getDataPack(float) { return 0; }
57 
58  virtual void getDesiredOutputs( TypeSet<int>& outputs ) const
59  { outputs = desoutputs_; }
60  void setDesiredOutputs( const TypeSet<int>& outputs )
61  { desoutputs_ = outputs; }
62 
63  virtual TypeSet<Interval<int> > getLocalZRanges(const BinID&,float,
64  TypeSet<float>&) const;
65  virtual TypeSet<Interval<int> > getLocalZRanges(const Coord&,float,
66  TypeSet<float>&) const;
67  virtual void collectData(const DataHolder&,float step,
68  const SeisTrcInfo&) = 0;
69  virtual SeisTrc* getTrc() { return 0; }
70  virtual bool writeTrc() { return true; }
71  virtual void deleteTrc() {}
72  const Seis::SelData& getSelData() { return *seldata_; }
73  Pos::GeomID curGeomID() const;
74  virtual void adjustInlCrlStep(const TrcKeyZSampling&) {}
75  virtual bool finishWrite() { return false; }
76 
77  static const char* outputstr();
78  static const char* cubekey();
79  static const char* tskey();
80  static const char* surfkey();
81  static const char* scalekey();
82  static const char* varzlinekey();
83 
84  virtual const char* errMsg() const { return ""; }
85 
86 protected:
87 
90  void doSetGeometry(const TrcKeyZSampling&);
91  void ensureSelType(Seis::SelType);
92 };
93 
94 
95 #define mImplDefAttribOutputFns(typ) \
96  virtual bool wantsOutput( const typ& t ) const \
97  { return Output::wantsOutput(t); } \
98  virtual TypeSet<Interval<int> > getLocalZRanges( const typ& t,float f, \
99  TypeSet<float>& ts ) const \
100  { return Output::getLocalZRanges(t,f,ts); }
101 
106 mExpClass(AttributeEngine) DataPackOutput : public Output
107 {
108 public:
110 
111  const RegularSeisDataPack* getDataPack() const;
112  virtual RegularSeisDataPack*getDataPack(float);
113 
114  bool getDesiredVolume(TrcKeyZSampling&) const;
115  void setGeometry( const TrcKeyZSampling& cs )
116  { doSetGeometry(cs); }
117  void setUndefValue( float v ) { udfval_ = v; }
118 
119  bool wantsOutput(const BinID&) const;
120  TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
121  TypeSet<float>&) const;
123  virtual void collectData(const DataHolder&,float step,
124  const SeisTrcInfo&);
125  virtual void adjustInlCrlStep(const TrcKeyZSampling&);
126 
127 protected:
128  TrcKeyZSampling desiredvolume_;
129  TrcKeyZSampling dcsampling_; //can differ from desiredvolume_
130  //(special cases with decimated cubes smaller
131  //than desired display)
132  TypeSet< Interval<int> > sampleinterval_;
134  float udfval_;
135 
136  void init(float refstep,const BinDataDesc* bdd=0);
137 };
138 
139 
144 mExpClass(AttributeEngine) SeisTrcStorOutput : public Output
146 public:
147  SeisTrcStorOutput(const TrcKeyZSampling&,
148  const Pos::GeomID);
150 
151  virtual bool doInit();
152  virtual void set2D( bool yn = true ) { is2d_ = yn; }
153  virtual bool useCoords() const { return false;}
154  bool getDesiredVolume(TrcKeyZSampling&) const;
155  bool wantsOutput(const BinID&) const;
156  virtual TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
157  TypeSet<float>&) const;
159  bool setStorageID(const MultiID&);
160  void setGeometry( const TrcKeyZSampling& cs )
161  { doSetGeometry(cs); }
162 
163  bool doUsePar(const IOPar&);
164  virtual bool finishWrite();
165  virtual void collectData(const DataHolder&,float step,
166  const SeisTrcInfo&);
167  virtual bool writeTrc();
168  SeisTrc* getTrc() { return trc_; }
169  void setTrcGrow( bool yn ) { growtrctosi_ = yn; }
171  { outptypes_ = typ; }
172  void setOutpNames( const BufferStringSet& nms )
173  { outpnames_ = nms; }
174 
175  virtual const char* errMsg() const
176  { return errmsg_.getFullString(); }
177 
178  static const char* seisidkey();
179  static const char* attribkey();
180  static const char* inlrangekey();
181  static const char* crlrangekey();
182  static const char* depthrangekey();
183 
184 protected:
185 
187  TrcKeyZSampling desiredvolume_;
190  bool is2d_;
192 
203 
205  friend class Processor;
206 
207 public:
208  void deleteTrc(); //only if you do not use writeTrc
209 
210 };
211 
212 
219 public:
221  DataPointSet*,float);
222 
223  bool doInit();
224  void set2D(bool) {}
225  bool useCoords() const { return true; }
226 
227  virtual bool wantsOutput(const Coord&) const;
228  TypeSet< Interval<int> > getLocalZRanges(const Coord&,float,
229  TypeSet<float>&) const;
231  void setTrcsBounds(Interval<float>);
232 
233  virtual bool finishWrite();
234  virtual void collectData(const DataHolder&,float step,
235  const SeisTrcInfo&);
236  void setMaxDistBetwTrcs( float maxdist )
237  { maxdisttrcs_ = maxdist; }
238 protected:
239 
240  const TrcKeyZSampling getCS();
241 
243  float stdtrcsz_;
245  float outval_;
247 };
248 
249 
254 mExpClass(AttributeEngine) TwoDOutput : public Output
255 {
256 public:
257  TwoDOutput(const Interval<int>&,
258  const Interval<float>&,
259  Pos::GeomID);
260  ~TwoDOutput();
261 
262  bool doInit();
263  bool wantsOutput(const BinID&) const;
264  TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
265  TypeSet<float>&) const;
267  void setGeometry(const Interval<int>&,
268  const Interval<float>&);
269  bool getDesiredVolume(TrcKeyZSampling&) const;
270  void setOutput(Data2DHolder&);
271 
272  void collectData(const DataHolder&,float step,
273  const SeisTrcInfo&);
274  const char* errMsg() const { return errmsg_.str(); }
275 
276 protected:
277 
280 
282 };
283 
284 
289 mExpClass(AttributeEngine) LocationOutput : public Output
290 {
291 public:
294 
296  { return true;}
297  bool wantsOutput(const BinID&) const;
298  TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
299  TypeSet<float>&) const;
301  virtual void collectData(const DataHolder&,float step,
302  const SeisTrcInfo&);
303  void setPossibleBinIDDuplic() { arebiddupl_ = true; }
304 
305  //TODO : check where we want to put this: output?
306  static const char* filenamekey();
307  static const char* locationkey();
308  static const char* attribkey();
309  static const char* surfidkey();
310 
311 protected:
313 
315 
316  void computeAndSetVals(const DataHolder&,
317  float,float*);
318  bool areBIDDuplicated() const;
319 };
320 
321 
326 mExpClass(AttributeEngine) TrcSelectionOutput : public Output
327 {
328 public:
330  float outval =0);
331  ~TrcSelectionOutput() ;
332 
333  bool getDesiredVolume(TrcKeyZSampling&) const;
334  bool wantsOutput(const BinID&) const;
335  TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
336  TypeSet<float>&) const;
338  void setOutput(SeisTrcBuf*);
339  void setTrcsBounds(Interval<float>);
340  virtual void collectData(const DataHolder&,float,
341  const SeisTrcInfo&);
342  void setGeomID(Pos::GeomID);
343 
344 protected:
345  const BinIDValueSet& bidvalset_;
346  SeisTrcBuf* outpbuf_;
347  float outval_;
348  float stdtrcsz_;
349  float stdstarttime_;
350 };
351 
352 
357 mExpClass(AttributeEngine) TableOutput : public Output
358 {
359 public:
362 
364  { return true;}
365  bool useCoords() const;
366  bool wantsOutput(const BinID&) const;
367  bool wantsOutput(const Coord&) const;
368  bool wantsOutput(const TrcKey&) const;
369 
370  virtual void collectData(const DataHolder&,float step,
371  const SeisTrcInfo&);
372 
373  //ABI frozen: special function for 6.0 only, replaces the virtual one above
374  void collectDataSpecial60(const DataHolder&,
375  float step,
376  const SeisTrcInfo&,
377  const TrcKey&);
378 
379  TypeSet< Interval<int> > getLocalZRanges(const BinID&,float,
380  TypeSet<float>&) const;
381  TypeSet< Interval<int> > getLocalZRanges(const Coord&,float,
382  TypeSet<float>&) const;
383  TypeSet< Interval<int> > getLocalZRanges(const TrcKey&,float,
384  TypeSet<float>&) const;
385 
386  void setMaxDistBetwTrcs( float maxdist )
387  { maxdisttrcs_ = maxdist; }
388  void setMedianDistBetwTrcs(float mediandist);
389  void setPossibleBinIDDuplic() { arebiddupl_ = true; }
390  void initPairsTable();
391 
392 protected:
394 
400 
401  void computeAndSetVals(const DataHolder&,float,
402  float,float*);
403  bool areBIDDuplicated() const;
404  void addLocalInterval(TypeSet<Interval<int> >&,
406  int,float) const;
407 
409  {
413 
415  : gid_(-1)
416  , tid_(-1)
417  , rid_(-1) {};
418 
420  Pos::TraceID tid,
421  DataPointSet::RowID rid )
422  : gid_(gid)
423  , tid_(tid)
424  , rid_(rid) {};
425 
426  bool operator == ( PosAndRowIDPair other ) const
427  { return other.gid_ == gid_ &&
428  other.tid_ == tid_ &&
429  other.rid_ == rid_;
430  }
431 
432  bool operator > ( PosAndRowIDPair other ) const
433  { return gid_ > other.gid_
434  || (gid_==other.gid_ && tid_>other.tid_)
435  || (gid_==other.gid_ && tid_==other.tid_
436  && rid_>other.rid_); }
437 
438  bool matchesTrcKey( const TrcKey& tkey ) const
439  { return gid_ == tkey.geomID()
440  && tid_ == tkey.trcNr(); }
441  };
442 
444 };
445 
446 
447 } // namespace Attrib
448 
449 
450 #endif
#define mRefCountImpl(ClassName)
Macro to setup a class with destructor for reference counting.
Definition: refcount.h:163
TypeSet< Interval< int > > sampleinterval_
Definition: attriboutput.h:188
#define mExpClass(module)
Definition: commondefs.h:160
Attribute Processor.
Definition: attribprocessor.h:34
TypeSet< Interval< int > > sampleinterval_
Definition: attriboutput.h:278
SeisTrcWriter * writer_
Definition: attriboutput.h:194
Summary for a Seismic object.
Definition: segydirectdef.h:23
DataPointSet & datapointset_
Definition: attriboutput.h:393
Pos::GeomID & geomID()
const char * str() const
Definition: odstring.h:48
Data2DHolder * output_
Definition: attriboutput.h:281
TypeSet< int > desoutputs_
Definition: attriboutput.h:89
Scaler * scaler_
Definition: attriboutput.h:198
void setTrcGrow(bool yn)
Definition: attriboutput.h:169
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
~TableOutput()
Definition: attriboutput.h:361
Set of data points with group selection.
Definition: datapointset.h:48
const Seis::SelData & getSelData()
Definition: attriboutput.h:72
TypeSet< Seis::DataType > outptypes_
Definition: attriboutput.h:199
bool arebiddupl_
Definition: attriboutput.h:395
virtual void adjustInlCrlStep(const TrcKeyZSampling &)
Definition: attriboutput.h:74
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Index_Type TraceID
Definition: commontypes.h:51
virtual RegularSeisDataPack * getDataPack(float)
Definition: attriboutput.h:56
uiString errmsg_
Definition: attriboutput.h:191
void set2D(bool)
Definition: attriboutput.h:224
virtual bool useCoords() const
Definition: attriboutput.h:51
void setUndefValue(float v)
Definition: attriboutput.h:117
void setOutpNames(const BufferStringSet &nms)
Definition: attriboutput.h:172
~LocationOutput()
Definition: attriboutput.h:293
PosAndRowIDPair(Pos::GeomID gid, Pos::TraceID tid, DataPointSet::RowID rid)
Definition: attriboutput.h:419
bool init()
virtual const char * errMsg() const
Definition: attriboutput.h:84
Pos::TraceID tid_
Definition: attriboutput.h:411
int RowID
Definition: datapointset.h:52
float maxdisttrcs_
Definition: attriboutput.h:397
Class that holds 2d seismic data or attribute data.
Definition: attribdataholder.h:82
Definition: seiswrite.h:41
virtual bool getDesiredVolume(TrcKeyZSampling &) const
Definition: attriboutput.h:49
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
virtual bool finishWrite()
Definition: attriboutput.h:75
Seismic trace storage Output.
Definition: attriboutput.h:144
Definition: uistring.h:89
void setPossibleBinIDDuplic()
Definition: attriboutput.h:389
A cartesian coordinate in 2D space.
Definition: coord.h:25
Set of BufferString objects.
Definition: bufstringset.h:28
float stdtrcsz_
Definition: attriboutput.h:243
virtual bool writeTrc()
Definition: attriboutput.h:70
void setDesiredOutputs(const TypeSet< int > &outputs)
Definition: attriboutput.h:60
Interval of values.
Definition: commontypes.h:31
SelType
Definition: seistype.h:26
Output at an assorted selection of traces.
Definition: attriboutput.h:326
Output at discrete locations ( For example a pickset. )
Definition: attriboutput.h:289
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
virtual void set2D(bool yn=true)
Definition: attriboutput.h:152
virtual void deleteTrc()
Definition: attriboutput.h:71
#define mImplDefAttribOutputFns(typ)
Definition: attriboutput.h:95
void setGeometry(const TrcKeyZSampling &cs)
Definition: attriboutput.h:115
bool useCoords() const
Definition: attriboutput.h:225
DataPointSet * poszvalues_
Definition: attriboutput.h:242
BufferString errmsg_
Definition: attriboutput.h:279
void setMaxDistBetwTrcs(float maxdist)
Definition: attriboutput.h:386
TypeSet< float > distpicktrc_
Definition: attriboutput.h:399
SeisTrc * getTrc()
Definition: attriboutput.h:168
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
float maxdisttrcs_
Definition: attriboutput.h:246
float stdstarttime_
Definition: attriboutput.h:244
bool storinited_
Definition: attriboutput.h:196
virtual SeisTrc * getTrc()
Definition: attriboutput.h:69
Position.
Definition: commontypes.h:42
Simple 2D Output.
Definition: attriboutput.h:254
Information for a seismic trace, AKA trace header info.
Definition: seisinfo.h:27
DataPointSet::RowID rid_
Definition: attriboutput.h:412
Scaling of floating point numbers.
Definition: scaler.h:33
float mediandisttrcs_
Definition: attriboutput.h:398
virtual void getDesiredOutputs(TypeSet< int > &outputs) const
Definition: attriboutput.h:58
float writez0shift_
Definition: attriboutput.h:204
IOPar * auxpars_
Definition: attriboutput.h:189
FixedString Output()
Definition: keystrs.h:97
bool is2d_
Definition: attriboutput.h:190
contains input (sub-)selection data from a cube or lineset
Definition: seisselection.h:82
BinIDValueSet & bidvalset_
Definition: attriboutput.h:312
bool getDesiredVolume(TrcKeyZSampling &) const
Definition: attriboutput.h:295
TrcKeyZSampling desiredvolume_
Definition: attriboutput.h:187
Index_Type GeomID
Definition: commontypes.h:52
TypeSet< PosAndRowIDPair > parpset_
Definition: attriboutput.h:443
Attribute DataPack Output.
Definition: attriboutput.h:106
virtual bool useCoords() const
Definition: attriboutput.h:153
virtual const RegularSeisDataPack * getDataPack() const
Definition: attriboutput.h:55
Holds the attribute data.
Definition: attribdataholder.h:43
SeisTrc * trc_
Definition: attriboutput.h:193
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: attriboutput.h:408
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
Seismic trace.
Definition: seistrc.h:34
BufferString errmsg_
Definition: horizontracker.h:119
Pos::GeomID gid_
Definition: attriboutput.h:410
PosAndRowIDPair()
Definition: attriboutput.h:414
bool matchesTrcKey(const TrcKey &tkey) const
Definition: attriboutput.h:438
BinID prevpos_
Definition: attriboutput.h:195
set of seismic traces.
Definition: seisbuf.h:31
Output at a selection of locations.
Definition: attriboutput.h:357
A Pos::IdxPairValueSet with BinIDs.
Definition: binidvalset.h:23
IdxType trcNr() const
float outval_
Definition: attriboutput.h:245
virtual const char * errMsg() const
Definition: attriboutput.h:175
2D trace Output with variable Z range.
Definition: attriboutput.h:217
int firstattrcol_
Definition: attriboutput.h:396
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
bool arebiddupl_
Definition: attriboutput.h:314
BufferString attribname_
Definition: attriboutput.h:197
void setOutpTypes(const TypeSet< Seis::DataType > &typ)
Definition: attriboutput.h:170
Base class for attribute Output.
Definition: attriboutput.h:44
Description of binary data.
Definition: bindatadesc.h:43
MultiID & storid_
Definition: attriboutput.h:186
BufferString datatype_
Definition: attriboutput.h:201
BufferStringSet outpnames_
Definition: attriboutput.h:202
bool getDesiredVolume(TrcKeyZSampling &) const
Definition: attriboutput.h:363
Compound key consisting of ints.
Definition: multiid.h:25
Semblance Attribute.
Definition: attribdataholder.h:25
bool growtrctosi_
Definition: attriboutput.h:200
Seis::SelData * seldata_
Definition: attriboutput.h:88

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