 |
OpendTect
6.6
|
Go to the documentation of this file.
44 float distToLine(
const T&)
const;
49 template <
class T>
inline
51 const T& dir,
const T& step,
TypeSet<T>& line )
56 , dirlen_(
Math::
Sqrt(float(dir_[0]*dir_[0]+dir_[1]*dir_[1])))
60 template <
class T>
inline
63 if ( !dir_[0] && !dir_[1] )
69 const T& lastpos = line_[line_.size()-1];
71 float disttoline =
mUdf(
float);
77 const float dist = distToLine(candidate);
78 if ( dist<disttoline )
79 { bestrc = candidate; disttoline=dist; }
86 const float dist = distToLine(candidate);
87 if ( dist<disttoline )
88 { bestrc = candidate; disttoline=dist; }
91 if ( dir_[0] && dir_[1] )
96 const float dist = distToLine(candidate);
97 if ( dist<disttoline )
98 { bestrc = candidate; disttoline=dist; }
109 template <
class T>
inline
112 return fabs((dir_[0]*(rc[1]-start_[1])-dir_[1]*(rc[0]-start_[0]))/dirlen_);
116 template <
class T>
inline
119 if ( start[0]%step[0] != stop[0]%step[0]
120 || start[1]%step[1] != stop[1]%step[1] )
125 { output += T(start);
return true; }
132 while ( builder.
nextExtension()>0 && output[output.size()-1]!=stop )
Creates a line in RowCol space.
Definition: rcollinebuilder.h:28
RColLineBuilder(const T &start, const T &dir, const T &step, TypeSet< T > &line)
Definition: rcollinebuilder.h:50
const T & dir_
Definition: rcollinebuilder.h:39
bool makeLine(const T &start, const T &stop, TypeSet< T > &output, const T &step)
const float dirlen_
Definition: rcollinebuilder.h:41
const T & step_
Definition: rcollinebuilder.h:40
#define mClass(module)
Definition: commondefs.h:181
const T & start_
Definition: rcollinebuilder.h:38
int nextExtension()
Definition: rcollinebuilder.h:61
float distToLine(const T &) const
Definition: rcollinebuilder.h:110
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
TypeSet< T > & line_
Definition: rcollinebuilder.h:42
RowCol step_
Definition: horizontracker.h:140
Sets of (small) copyable elements.
Definition: commontypes.h:29
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021