53 mPen.setColor( color );
54 QColor fillColor( color.red(), color.green(), color.blue(), 63 );
55 mBrush.setColor( fillColor );
56 mBrush.setStyle( Qt::SolidPattern );
64 mPen.setWidth( width );
83 QPolygonF polygon( line.size() );
85 for (
int i = 0; i < line.size(); i++ )
90 p->drawPolyline( polygon );
101 for (
int i = 0; i < polygon.size(); i++ )
103 if ( polygon[i].empty() )
continue;
106 ring.reserve( polygon[i].
size() + 1 );
108 for (
int j = 0; j < polygon[i].size(); j++ )
112 if ( 0 == j || std::abs( ring.back().x() - cur.x() ) > 1 || std::abs( ring.back().y() - cur.y() ) > 1 )
114 ring.push_back( cur );
118 ring.push_back( ring[ 0 ] );
120 path.addPolygon( ring );
152 for (
int i = 0; i < m.size(); i++ )
171 for (
int i = 0; i < m.size(); i++ )
189 for (
int i = 0; i < m.size(); i++ )
A rectangle specified with double values.
bool isEmpty() const
test if rectangle is empty
void setXMaximum(double x)
Set the maximum x value.
double yMaximum() const
Get the y maximum value (top side of rectangle)
QgsMultiPolyline asMultiPolyline() const
return contents of the geometry as a multi linestring if wkbType is WKBMultiLineString, otherwise an empty list
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
QgsPolygon asPolygon() const
return contents of the geometry as a polygon if wkbType is WKBPolygon, otherwise an empty list ...
An abstract class for items that can be placed on the map canvas.
void paintPolygon(QPainter *p, QgsPolygon polygon)
A geometry is the spatial representation of a feature.
Map canvas is a class for displaying all GIS data types on a canvas.
QgsMultiPolygon asMultiPolygon() const
return contents of the geometry as a multi polygon if wkbType is WKBMultiPolygon, otherwise an empty ...
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double xMaximum() const
Get the x maximum value (right side of rectangle)
bool hasCrsTransformEnabled() const
returns true if projections are enabled for this layer set
const QgsCoordinateReferenceSystem & destinationCrs() const
returns CRS of destination coordinate reference system
void setYMinimum(double y)
Set the minimum y value.
void updateRect()
recalculates needed rectangle
void paintPoint(QPainter *p, QgsPoint point)
QVector< QgsPolygon > QgsMultiPolygon
a collection of QgsPolygons that share a common collection of attributes
QVector< QgsPoint > QgsMultiPoint
a collection of QgsPoints that share a common collection of attributes
QGis::WkbType wkbType() const
Returns type of wkb (point / linestring / polygon etc.)
virtual void paint(QPainter *p)
QVector< QgsPolyline > QgsPolygon
polygon: first item of the list is outer ring, inner rings (if any) start from second item ...
A class to represent a point geometry.
QPointF toCanvasCoordinates(const QgsPoint &point)
transformation from map coordinates to screen coordinates
A class to represent a vector.
QVector< QgsPolyline > QgsMultiPolyline
a collection of QgsPolylines that share a common collection of attributes
QgsPolyline asPolyline() const
return contents of the geometry as a polyline if wkbType is WKBLineString, otherwise an empty list ...
QgsRectangle boundingBox()
Returns the bounding box of this feature.
void paintLine(QPainter *p, QgsPolyline line)
void setColor(const QColor &color)
void setYMaximum(double y)
Set the maximum y value.
QgsMultiPoint asMultiPoint() const
return contents of the geometry as a multi point if wkbType is WKBMultiPoint, otherwise an empty list...
QgsMapCanvas * mMapCanvas
pointer to map canvas
QgsMapRenderer * mapRenderer()
void setRect(const QgsRectangle &r)
sets canvas item rectangle
int transform(const QgsCoordinateTransform &ct)
Transform this geometry as described by CoordinateTranasform ct.
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
QgsRectangle extent() const
Returns the current zoom exent of the map canvas.
double width() const
Width of the rectangle.
QgsPoint asPoint() const
return contents of the geometry as a point if wkbType is WKBPoint, otherwise returns [0...
Represents a vector layer which manages a vector based data sets.
double xMinimum() const
Get the x minimum value (left side of rectangle)
void setXMinimum(double x)
Set the minimum x value.