33 : ::NamedObject(nm) {}
35 : ::NamedObject(d.name())
40 inline int size()
const {
return dah_.size(); }
41 inline float dah(
int idx)
const {
return dah_[idx]; }
42 virtual float value(
int idx)
const = 0;
43 virtual bool insertAtDah(
float dah,
float val) = 0;
45 virtual void remove(
int idx )
46 { dah_.removeSingle(idx); removeAux(idx); }
48 { dah_.erase(); eraseAux(); }
49 inline bool isEmpty()
const {
return size() == 0; }
53 float dahStep(
bool min_else_average)
const;
55 void addToDahFrom(
int fromidx,
float extradah);
56 void removeFromDahFrom(
int fromidx,
float extradah);
60 float*
dahArr() {
return dah_.arr(); }
61 const float*
dahArr()
const {
return dah_.arr(); }
67 virtual void removeAux(
int) = 0;
68 virtual void eraseAux() = 0;
72 #define mWellDahObjInsertAtDah(dh,v,vals,ascvalonly)\ 74 if ( mIsUdf(v) ) return false;\ 75 const bool ascendingvalonly = (ascvalonly); \ 76 if ( dah_.isEmpty() || dh >= dah_[dah_.size()-1] )\ 78 if ( !dah_.isEmpty() && ascendingvalonly && v <= vals[dah_.size()-1] )\ 80 dah_ += dh; vals += val;\ 84 if ( ascendingvalonly && v >= vals[0] )\ 86 dah_.insert( 0, dh ); vals.insert( 0, v );\ 89 const int insertidx = indexOf( dh );\ 90 if ( insertidx<0 ) return false;\ 91 if ( ascendingvalonly && (v <= vals[insertidx] || v >= vals[insertidx+1]) )\ 93 dah_.insert( insertidx+1, dh ); vals.insert( insertidx+1, v );\ #define mExpClass(module)
Definition: commondefs.h:160
DahObj(const DahObj &d)
Definition: welldahobj.h:34
int size() const
Definition: welldahobj.h:40
const float * dahArr() const
Definition: welldahobj.h:61
virtual void setEmpty()
Definition: welldahobj.h:47
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
float dah(int idx) const
Definition: welldahobj.h:41
float * dahArr()
Definition: welldahobj.h:60
Definition: directionalsurvey.h:19
DahObj(const char *nm=0)
Definition: welldahobj.h:32
bool isEmpty() const
Definition: welldahobj.h:49
Depth/Distance along hole object.
Definition: welldahobj.h:28
~DahObj()
Definition: welldahobj.h:37
Object with a name.
Definition: namedobj.h:35
TypeSet< float > dah_
Definition: welldahobj.h:65