OpendTect-6_4  6.4
flatposdata.h
Go to the documentation of this file.
1 #ifndef flatposdata_h
2 #define flatposdata_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Bril
8  Date: Feb 2007
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "ranges.h"
16 #include "indexinfo.h"
17 
27 {
28 public:
30  : x1rg_(0,0,1)
31  , x2rg_(0,0,1)
32  , x1pos_(0)
33  , x1offs_(0) {}
34  FlatPosData( const FlatPosData& fpd )
35  : x1pos_(0) { *this = fpd; }
36  ~FlatPosData() { delete [] x1pos_; }
37  FlatPosData& operator =(const FlatPosData&);
38  FlatPosData* clone() { return new FlatPosData(*this); }
39 
40  void setRange(bool forx1,
41  const StepInterval<double>&);
42  inline const StepInterval<double>& range( bool forx1 ) const
43  { return forx1 ? x1rg_ : x2rg_; }
44  void setX1Pos(float*,int sz,double offs);
48 
49  inline int nrPts( bool forx1 ) const
50  { return range(forx1).nrSteps() + 1; }
51  float width( bool forx1 ) const
52  { return ( float )( range(forx1).width() ); }
53  IndexInfo indexInfo(bool forx1,double pos) const;
54 
55  double position(bool forx1,int) const;
57  void getPositions(bool forx1,TypeSet<float>&) const;
59  float* getPositions(bool forx1) const;
62  inline double offset( bool forx1 ) const
63  { return forx1 ? x1offs_ : 0; }
65 
66  inline bool isIrregular() const
67  { return x1pos_ && nrPts(true) > 2; }
68  inline void setRegular()
69  { setRange( true, range(true) ); }
70 
71 protected:
72 
75 
76  float* x1pos_;
77  double x1offs_;
78 
79  inline StepInterval<double>& rg( bool forx1 )
80  { return forx1 ? x1rg_ : x2rg_; }
81 };
82 
83 
84 #endif
double offset(bool forx1) const
For use with getPositions.
Definition: flatposdata.h:62
#define mExpClass(module)
Definition: commondefs.h:160
float * x1pos_
Definition: flatposdata.h:76
Positioning of flat &#39;bulk&#39; data. Only the &#39;x1&#39; axis can be irregular.
Definition: flatposdata.h:26
FlatPosData(const FlatPosData &fpd)
Definition: flatposdata.h:34
int nrPts(bool forx1) const
Definition: flatposdata.h:49
~FlatPosData()
Definition: flatposdata.h:36
float width(bool forx1) const
Definition: flatposdata.h:51
Info on (floating-point) position in an array or StepInterval.
Definition: indexinfo.h:23
double x1offs_
Definition: flatposdata.h:77
const StepInterval< double > & range(bool forx1) const
Definition: flatposdata.h:42
StepInterval< double > x2rg_
Definition: flatposdata.h:74
void setRegular()
Definition: flatposdata.h:68
StepInterval< double > x1rg_
Definition: flatposdata.h:73
FlatPosData()
Definition: flatposdata.h:29
bool isIrregular() const
Definition: flatposdata.h:66
StepInterval< double > & rg(bool forx1)
Definition: flatposdata.h:79
FlatPosData * clone()
Definition: flatposdata.h:38

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