QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 }
 A handy way to refer to the four boundaries. More...
 

Static Public Member Functions

static QgsConstWkbPtr clippedLineWKB (QgsConstWkbPtr &wkb, const QgsRectangle &clipExtent, QPolygonF &line)
 Reads a polyline from WKB and clips it to clipExtent. More...
 
static void trimFeature (QVector< double > &x, QVector< double > &y, bool shapeOpen)
 Trims the given feature to a rectangular box. More...
 
static void trimPolygon (QPolygonF &pts, const QgsRectangle &clipRect)
 

Static Public Attributes

static const double MAX_X = 16000
 
static const double MAX_Y = 16000
 
static const double MIN_X = -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).

Definition at line 40 of file qgsclipper.h.

Member Enumeration Documentation

◆ Boundary

A handy way to refer to the four boundaries.

Enumerator
XMax 
XMin 
YMax 
YMin 

Definition at line 70 of file qgsclipper.h.

Member Function Documentation

◆ clippedLineWKB()

QgsConstWkbPtr QgsClipper::clippedLineWKB ( QgsConstWkbPtr 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

Definition at line 41 of file qgsclipper.cpp.

◆ trimFeature()

void QgsClipper::trimFeature ( QVector< double > &  x,
QVector< double > &  y,
bool  shapeOpen 
)
inlinestatic

Trims the given feature to a rectangular box.

Returns the trimmed feature in x and y. The shapeOpen parameter determines whether the function treats the points as a closed shape (polygon), or as an open shape (linestring).

Note
not available in python bindings on android

Definition at line 160 of file qgsclipper.h.

◆ trimPolygon()

void QgsClipper::trimPolygon ( QPolygonF pts,
const QgsRectangle clipRect 
)
inlinestatic

Definition at line 181 of file qgsclipper.h.

Member Data Documentation

◆ MAX_X

const double QgsClipper::MAX_X = 16000
static

Definition at line 63 of file qgsclipper.h.

◆ MAX_Y

const double QgsClipper::MAX_Y = 16000
static

Definition at line 65 of file qgsclipper.h.

◆ MIN_X

const double QgsClipper::MIN_X = -16000
static

Definition at line 64 of file qgsclipper.h.

◆ MIN_Y

const double QgsClipper::MIN_Y = -16000
static

Definition at line 66 of file qgsclipper.h.


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