QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
QgsClipper Class Reference

A class to trim lines and polygons to within a rectangular region. More...

#include <qgsclipper.h>

Public Types

enum  Boundary { XMax, XMin, YMax, YMin }

Static Public Member Functions

static void trimFeature (QVector< double > &x, QVector< double > &y, bool shapeOpen)
static void trimPolygon (QPolygonF &pts, const QgsRectangle &clipRect)
static const unsigned char * clippedLineWKB (const unsigned char *wkb, const QgsRectangle &clipExtent, QPolygonF &line)
 Reads a polyline from WKB and clips it to clipExtent.

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

Detailed Description

A class to trim lines and polygons to within a rectangular region.

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).

Member Enumeration Documentation

Enumerator:
XMax 
XMin 
YMax 
YMin 

Member Function Documentation

const unsigned char * QgsClipper::clippedLineWKB ( const unsigned char *  wkb,
const QgsRectangle clipExtent,
QPolygonF &  line 
)
static

Reads a polyline from WKB and clips it to clipExtent.

Parameters
wkbpointer to the start of the line wkb
clipExtentclipping bounds
lineout: clipped line coordinates
void QgsClipper::trimFeature ( QVector< double > &  x,
QVector< double > &  y,
bool  shapeOpen 
)
inlinestatic
void QgsClipper::trimPolygon ( QPolygonF &  pts,
const QgsRectangle clipRect 
)
inlinestatic

Member Data Documentation

const double QgsClipper::MAX_X = 16000
static
const double QgsClipper::MAX_Y = 16000
static
const double QgsClipper::MIN_X = -16000
static
const double QgsClipper::MIN_Y = -16000
static

The documentation for this class was generated from the following files: