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

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