mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			132 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			132 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsclipper.h                                                *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
%Feature ARM // Some parts are not available in sip bindings on ARM because of qreal double vs. float issues
 | 
						|
 | 
						|
 | 
						|
class QgsClipper
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
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).
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsclipper.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
 | 
						|
 | 
						|
    static const double MAX_X;
 | 
						|
    static const double MIN_X;
 | 
						|
    static const double MAX_Y;
 | 
						|
    static const double MIN_Y;
 | 
						|
 | 
						|
 | 
						|
    enum Boundary
 | 
						|
    {
 | 
						|
      XMax,
 | 
						|
      XMin,
 | 
						|
      YMax,
 | 
						|
      YMin,
 | 
						|
      ZMax,
 | 
						|
      ZMin,
 | 
						|
    };
 | 
						|
 | 
						|
    static void trimFeature( QVector<double> &x,
 | 
						|
                             QVector<double> &y,
 | 
						|
                             bool shapeOpen );
 | 
						|
%Docstring
 | 
						|
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
 | 
						|
%End
 | 
						|
 | 
						|
    static void trimPolygon( QPolygonF &pts, const QgsRectangle &clipRect );
 | 
						|
%Docstring
 | 
						|
Trims the given polygon to a rectangular box, by modifying the given polygon in place.
 | 
						|
 | 
						|
:param pts: polygon as 2D coordinates
 | 
						|
:param clipRect: clipping rectangle
 | 
						|
%End
 | 
						|
 | 
						|
 | 
						|
 | 
						|
    static QPolygonF clippedLine( const QgsCurve &curve, const QgsRectangle &clipExtent );
 | 
						|
%Docstring
 | 
						|
Takes a linestring and clips it to clipExtent
 | 
						|
 | 
						|
:param curve: the linestring
 | 
						|
:param clipExtent: clipping bounds
 | 
						|
 | 
						|
:return: clipped line coordinates
 | 
						|
%End
 | 
						|
 | 
						|
    static QPolygonF clippedLine( const QPolygonF &curve, const QgsRectangle &clipExtent );
 | 
						|
%Docstring
 | 
						|
Takes a 2D ``curve`` and clips it to clipExtent.
 | 
						|
 | 
						|
:param curve: the linestring
 | 
						|
:param clipExtent: clipping bounds
 | 
						|
 | 
						|
:return: clipped line coordinates
 | 
						|
 | 
						|
.. versionadded:: 3.16
 | 
						|
%End
 | 
						|
 | 
						|
    static bool clipLineSegment( double left, double right, double bottom, double top, double &x0 /In,Out/, double &y0 /In,Out/, double &x1 /In,Out/, double &y1 /In,Out/ );
 | 
						|
%Docstring
 | 
						|
Clips a line segment to a rectangle.
 | 
						|
 | 
						|
An implementation of the 'Fast clipping' algorithm (Sobkow et al. 1987, Computers & Graphics Vol.11, 4, p.459-467).
 | 
						|
 | 
						|
:param left: x-coordinate of left side of rectangle
 | 
						|
:param right: x-coordinate of right side of rectangle
 | 
						|
:param bottom: y-coordinate of bottom side of rectangle
 | 
						|
:param top: y-coordinate of top side of rectangle
 | 
						|
:param x0: x-coordinate of start of line
 | 
						|
:param y0: y-coordinate of start of line
 | 
						|
:param x1: x-coordinate of end of line
 | 
						|
:param y1: y-coordinate of end of line
 | 
						|
 | 
						|
:return: ``True`` if line was clipped.
 | 
						|
 | 
						|
.. versionadded:: 3.26
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsclipper.h                                                *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 |