Go to the source code of this file.
|
| class | LineRectangleClipper< T > |
| | Clips a line between two points by a rectangle. The line may be completely outside, completely inside or partially inside. If partially inside, new endpoints are calculated. More...
|
| |
| #define mAdjustPoint |
( |
|
which | ) |
|
Value:{ \
Geom::Point2D<T> newpoint; \
newpoint.x_ = start.x_ + castDouble2T( dx * t##which ); \
newpoint.y_ = start.y_ + castDouble2T( dy * t##which ); \
which##changed_ = which##_ != newpoint; \
which##_ = newpoint; \
}
| #define mBoundaryClip |
( |
|
delta, |
|
|
|
offset |
|
) |
| |
Value:{ \
if ( delta ) \
{ \
double tnew = (double) (offset) / (delta); \
if ( (delta) < 0 ) \
{ \
if ( tnew > tstop ) return; \
if ( tnew > tstart ) tstart = tnew; \
} \
else \
{ \
if ( tnew < tstart ) return; \
if ( tnew < tstop ) tstop = tnew; \
} \
} \
else \
if ( (offset) < 0 ) return; \
}