36 bool operator >(
const Line2DPos& p )
const {
return nr_ > p.
nr_; }
37 bool operator <(
const Line2DPos& p )
const {
return nr_ < p.
nr_; }
38 bool operator >=(
const Line2DPos& p )
const {
return nr_>=p.
nr_; }
39 bool operator <=(
const Line2DPos& p )
const {
return nr_<=p.
nr_; }
55 : Line2DPos(n), z_(z) {}
68 Line2DData(
const char* lnm=0);
72 , lnm_(l2d.lineName())
73 , posns_(l2d.positions()){}
80 int size()
const {
return posns_.size();}
82 bool isEmpty()
const {
return posns_.isEmpty(); }
84 void add(
const Line2DPos&);
85 void remove(
int trcnr);
91 {
return gtIndex(crd); }
92 int nearestIdx(
const Coord&,
95 bool getPos(
const Coord& crd,Line2DPos& l2p,
97 bool getPos(
const Coord& crd,Line2DPos& l2p,
98 float threshold_distance)
const;
99 bool getPos(
int trcnr,Line2DPos&)
const;
101 void dump(
od_ostream&,
bool pretty=
true)
const;
103 bool write(
od_ostream&,
bool asc,
bool newlns=
false)
const;
110 Coord getNormal(
int trcnr)
const;
111 void compDistBetwTrcsStats(
float& max,
float& median)
const;
112 float distBetween(
int startnr,
int stopnr)
const;
114 bool coincidesWith(
const Line2DData&)
const;
126 int gtIndex(
int,
bool&)
const;
127 int gtIndex(
const Coord&,
double* sqdist=0)
const;
128 int getSegmentIndexClosestToPoint(
const Coord&)
const;
142 : ld_(ld), idx_(-1) {}
147 return idx_ < ld_.posns_.size();
151 inline const Line2DPos&
line2DPos()
const {
return ld_.posns_[idx_]; }
153 {
return idx_>=0 ? ld_.posns_[idx_].nr_ :
mUdf(
int); }
155 { idx_ = ld_.indexOf( trcnr ); }
#define mExpClass(module)
Definition: commondefs.h:160
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
const Line2DData & ld_
Definition: posinfo2d.h:157
int nr_
Definition: posinfo2d.h:41
const TypeSet< Line2DPos > & positions() const
Definition: posinfo2d.h:81
const StepInterval< float > & zRange() const
Definition: posinfo2d.h:75
void setEmpty()
Definition: posinfo2d.h:86
int nearestIdx(const Coord &crd) const
Definition: posinfo2d.h:90
int size() const
Definition: posinfo2d.h:80
void setLineName(const char *lnm)
Definition: posinfo2d.h:79
Line2DPos with a z value.
Definition: posinfo2d.h:51
TypeSet< Line2DPos > posns_
Definition: posinfo2d.h:123
Position info for a 2D line.
Definition: posinfo2d.h:65
A cartesian coordinate in 2D space.
Definition: coord.h:25
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
void reset()
Definition: posinfo2d.h:150
BufferString lnm_
Definition: posinfo2d.h:122
OD class for stream read.
Definition: od_istream.h:24
Line2DDataIterator(const Line2DData &ld)
Definition: posinfo2d.h:141
Set of (small) copyable elements.
Definition: commontypes.h:30
bool isEmpty() const
Definition: posinfo2d.h:82
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
One position on a 2D line.
Definition: posinfo2d.h:29
int idx_
Definition: posinfo2d.h:158
Line2DData(const Line2DData &l2d)
Definition: posinfo2d.h:70
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
void setTrcNr(int trcnr)
Definition: posinfo2d.h:154
bool next()
Definition: posinfo2d.h:144
StepInterval< float > zrg_
Definition: posinfo2d.h:121
Iterates through Line2DData.
Definition: posinfo2d.h:137
Position info, often segmented.
Definition: posinfo.h:40
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
float z_
Definition: posinfo2d.h:57
TypeSet< int > bendpoints_
Definition: posinfo2d.h:124
int trcNr() const
Definition: posinfo2d.h:152
Coord coord_
Definition: posinfo2d.h:42
void setZRange(const StepInterval< float > &zrg)
Definition: posinfo2d.h:77
Line2DPos3D(int n=0, float z=Values::Undef< float >::val())
Definition: posinfo2d.h:54
const Line2DPos & line2DPos() const
Definition: posinfo2d.h:151
Line2DPos(int n=0)
Definition: posinfo2d.h:33
const OD::String & lineName() const
Definition: posinfo2d.h:76