 |
OpendTect
6.6
|
Go to the documentation of this file.
32 inline bool isIntersecting()
const;
33 inline bool isStartChanged()
const;
34 inline bool isStopChanged()
const;
39 inline const T castDouble2T(
double)
const;
51 template <
class T>
inline
62 for (
int idx=1; idx<polyline.size(); idx++ )
64 clipper.
setLine( polyline[idx-1], polyline[idx] );
77 result += currentline;
78 (*currentline) += clipper.
getStart();
81 (*currentline) += clipper.
getStop();
88 template <
class T>
inline
91 , isintersecting_( true )
92 , startchanged_( false )
93 , stopchanged_( false )
99 template <
class T>
inline
104 return fabs(d-t1) < fabs(d-t2) ? t1 : t2;
108 #define mBoundaryClip( delta, offset ) \
112 double tnew = (double) (offset) / (delta); \
115 if ( tnew > tstop ) return; \
116 if ( tnew > tstart ) tstart = tnew; \
120 if ( tnew < tstart ) return; \
121 if ( tnew < tstop ) tstop = tnew; \
125 if ( (offset) < 0 ) return; \
128 #define mAdjustPoint( which ) \
130 Geom::Point2D<T> newpoint; \
131 newpoint.x = start.x + castDouble2T( dx * t##which ); \
132 newpoint.y = start.y + castDouble2T( dy * t##which ); \
133 which##changed_ = which##_ != newpoint; \
134 which##_ = newpoint; \
138 template <
class T>
inline
142 isintersecting_ =
false;
145 startchanged_ =
false;
146 stopchanged_ =
false;
151 const double dx = stop.
x - start.
x;
155 const double dy = stop.
y - start.
y;
159 isintersecting_ =
true;
169 template <
class T>
inline
171 {
return isintersecting_; }
174 template <
class T>
inline
176 {
return startchanged_; }
179 template <
class T>
inline
181 {
return stopchanged_; }
184 template <
class T>
inline
189 template <
class T>
inline
#define mAdjustPoint(which)
Definition: linerectangleclipper.h:128
const Geom::Point2D< T > & getStart() const
Definition: linerectangleclipper.h:185
Set of pointers to objects.
Definition: commontypes.h:31
Geom::Rectangle< T > rect_
Definition: linerectangleclipper.h:47
const T castDouble2T(double) const
Definition: linerectangleclipper.h:100
Geom::Point2D< T > start_
Definition: linerectangleclipper.h:44
bool isStartChanged() const
Definition: linerectangleclipper.h:175
#define mBoundaryClip(delta, offset)
Definition: linerectangleclipper.h:108
const Geom::Point2D< T > & getStop() const
Definition: linerectangleclipper.h:190
bool startchanged_
Definition: linerectangleclipper.h:42
bool stopchanged_
Definition: linerectangleclipper.h:43
void setLine(uiLineItem *, const LineParameters< float > &, const uiAxisHandler *xah, const uiAxisHandler *yah, const Interval< float > *xvalrg=0)
draws line not outside box defined by X and Y value ranges
#define mClass(module)
Definition: commondefs.h:181
Geom::Point2D< T > stop_
Definition: linerectangleclipper.h:45
bool isStopChanged() const
Definition: linerectangleclipper.h:180
void setLine(const Geom::Point2D< T > &start, const Geom::Point2D< T > &stop)
Definition: linerectangleclipper.h:139
void clipPolyLine(const Geom::Rectangle< T > &rect, const TypeSet< Geom::Point2D< T > > &polyline, ObjectSet< TypeSet< Geom::Point2D< T > > > &result)
Definition: linerectangleclipper.h:52
bool isIntersecting() const
Definition: linerectangleclipper.h:170
void deepErase(BufferStringSet &)
Basic point class.
Definition: geometry.h:27
bool isintersecting_
Definition: linerectangleclipper.h:41
T y
Definition: geometry.h:68
T x
Definition: geometry.h:67
LineRectangleClipper(const Geom::Rectangle< T > &)
Definition: linerectangleclipper.h:89
Basic 2D rectangle class.
Definition: geometry.h:118
Clips a line between two points by a rectangle. The line may be completely outside,...
Definition: linerectangleclipper.h:25
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