#include <qgsclipper.h>
Public Types | |
enum | Boundary { XMax, XMin, YMax, YMin } |
Static Public Member Functions | |
static void | trimFeature (std::vector< double > &x, std::vector< double > &y, bool shapeOpen) |
Static Public Attributes | |
static const double | MAX_X = 16000 |
static const double | MIN_X = -16000 |
static const double | MAX_Y = 16000 |
static const double | MIN_Y = -16000 |
Static Private Member Functions | |
static void | trimFeatureToBoundary (const std::vector< double > &inX, const std::vector< double > &inY, std::vector< double > &outX, std::vector< double > &outY, Boundary b, bool shapeOpen) |
static bool | inside (const double x, const double y, Boundary b) |
static QgsPoint | intersect (const double x1, const double y1, const double x2, const double y2, Boundary b) |
Static Private Attributes | |
static const double | SMALL_NUM = 1e-12 |
The functions in this class are likely to be called from within a render loop and hence need to as CPU efficient as possible. The main purpose of the functions in this class are to trim lines and polygons to lie within a rectangular region. This is necessary for drawing items to an X11 display which have a limit on the magnitude of the screen coordinates (+/- 32768, i.e. 16 bit integer).
Definition at line 40 of file qgsclipper.h.
enum QgsClipper::Boundary |
void QgsClipper::trimFeature | ( | std::vector< double > & | x, | |
std::vector< double > & | y, | |||
bool | shapeOpen | |||
) | [inline, static] |
Definition at line 116 of file qgsclipper.h.
References trimFeatureToBoundary(), XMax, XMin, YMax, and YMin.
Referenced by QgsVectorLayer::drawLineString(), and QgsVectorLayer::drawPolygon().
void QgsClipper::trimFeatureToBoundary | ( | const std::vector< double > & | inX, | |
const std::vector< double > & | inY, | |||
std::vector< double > & | outX, | |||
std::vector< double > & | outY, | |||
Boundary | b, | |||
bool | shapeOpen | |||
) | [inline, static, private] |
Definition at line 142 of file qgsclipper.h.
References inside(), intersect(), QgsPoint::x(), and QgsPoint::y().
Referenced by trimFeature().
bool QgsClipper::inside | ( | const double | x, | |
const double | y, | |||
Boundary | b | |||
) | [inline, static, private] |
QgsPoint QgsClipper::intersect | ( | const double | x1, | |
const double | y1, | |||
const double | x2, | |||
const double | y2, | |||
Boundary | b | |||
) | [inline, static, private] |
Definition at line 229 of file qgsclipper.h.
References MAX_X, MAX_Y, MIN_X, MIN_Y, QgsPoint::set(), SMALL_NUM, XMax, XMin, YMax, and YMin.
Referenced by trimFeatureToBoundary().
const double QgsClipper::MAX_X = 16000 [static] |
Definition at line 63 of file qgsclipper.h.
Referenced by QgsVectorLayer::drawFeature(), QgsVectorLayer::drawLineString(), QgsVectorLayer::drawPolygon(), inside(), and intersect().
const double QgsClipper::MIN_X = -16000 [static] |
const double QgsClipper::MAX_Y = 16000 [static] |
Definition at line 65 of file qgsclipper.h.
Referenced by QgsVectorLayer::drawFeature(), QgsVectorLayer::drawLineString(), QgsVectorLayer::drawPolygon(), inside(), and intersect().
const double QgsClipper::MIN_Y = -16000 [static] |
const double QgsClipper::SMALL_NUM = 1e-12 [static, private] |