OpendTect-6_4  6.4
tracedata.h
Go to the documentation of this file.
1 #ifndef tracedata_h
2 #define tracedata_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 10-5-1995
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "databuf.h"
17 #include "datainterp.h"
18 
20 class Scaler;
21 
22 
33 {
34 public:
35 
37  : data_(0), interp_(0), nrcomp_(0) {}
38  TraceData( const TraceData& td )
39  : data_(0), interp_(0), nrcomp_(0) { copyFrom(td);}
40  ~TraceData();
41  bool allOk() const;
42  bool isEmpty() const;
43 
44  inline TraceData& operator=( const TraceData& td )
45  { copyFrom( td ); return *this; }
46  void copyFrom(const TraceData&);
48  void copyFrom(const TraceData&,int comp_from,int comp_to);
50  void convertToFPs(bool preserve_data=true);
51 
52  inline int nrComponents() const
53  { return nrcomp_; }
54  inline int size( int icomp=0 ) const
55  { return icomp >= nrcomp_ ? 0 : data_[icomp]->size(); }
56  inline int bytesPerSample( int icomp=0 ) const
57  { return icomp >= nrcomp_ ? 1
58  : data_[icomp]->bytesPerSample(); }
59  inline bool isZero( int icomp=0 ) const
60  { return icomp >= nrcomp_ || data_[icomp]->isZero(); }
61 
62  bool isValidComp(int icomp=0) const;
63  float getValue(int isamp,int icomp=0) const;
64  void setValue(int isamp,float,int icomp=0);
65 
66  inline DataBuffer* getComponent( int icomp=0 )
67  { return data_[icomp]; }
68  inline const DataBuffer* getComponent( int icomp=0 ) const
69  { return data_[icomp]; }
70  inline TraceDataInterpreter* getInterpreter( int icomp=0 )
71  { return interp_[icomp]; }
72  inline const TraceDataInterpreter* getInterpreter( int icomp=0 ) const
73  { return interp_[icomp]; }
74 
75  void addComponent(int ns,const DataCharacteristics&,
76  bool cleardata=false);
77  void delComponent(int);
78  void setComponent(const DataCharacteristics&,int icomp=0);
79 
80  void reSize(int,int icomp=-1,bool copydata=false);
82  void scale(const Scaler&,int icomp=-1);
84  void zero(int icomp=-1);
86 
87  void handleDataSwapping();
89 
90 
91 protected:
92 
93 
96  int nrcomp_;
97 
98 };
99 
100 
101 
102 #endif
#define mExpClass(module)
Definition: commondefs.h:160
const TraceDataInterpreter * getInterpreter(int icomp=0) const
Definition: tracedata.h:72
TraceData & operator=(const TraceData &td)
Definition: tracedata.h:44
DataBuffer * getComponent(int icomp=0)
Definition: tracedata.h:66
DataBuffer ** data_
pre-swaps all buffers that need it
Definition: tracedata.h:94
int nrComponents() const
Definition: tracedata.h:52
int size(int icomp=0) const
Definition: tracedata.h:54
TraceData()
Definition: tracedata.h:36
const DataBuffer * getComponent(int icomp=0) const
Definition: tracedata.h:68
bool isZero(int icomp=0) const
Definition: tracedata.h:59
int nrcomp_
Definition: tracedata.h:96
DataInterpreter< float > TraceDataInterpreter
Definition: tracedata.h:19
byte-level data characteristics of stored data.
Definition: datachar.h:37
Scaling of floating point numbers.
Definition: scaler.h:33
TraceDataInterpreter ** interp_
Definition: tracedata.h:95
Raw data array with memory management.
Definition: databuf.h:22
TraceDataInterpreter * getInterpreter(int icomp=0)
Definition: tracedata.h:70
int bytesPerSample(int icomp=0) const
Definition: tracedata.h:56
TraceData(const TraceData &td)
Definition: tracedata.h:38
A set of data buffers and their interpreters.
Definition: tracedata.h:32
bool isEmpty(const NLAModel *mdl)
virtual double scale(double) const =0

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