#include <qgsoverlayobject.h>
Public Member Functions | |
QgsOverlayObject (int width=0, int height=0, double rotation=0, QgsGeometry *geometry=0) | |
virtual | ~QgsOverlayObject () |
QgsOverlayObject (const QgsOverlayObject &other) | |
QgsOverlayObject & | operator= (const QgsOverlayObject &other) |
GEOSGeometry * | getGeosGeometry () |
Returns the feature geometry in geos format. | |
void | releaseGeosGeometry (GEOSGeometry *the_geom) |
Feature geometry is released when object is destructed so this function is empty. | |
int | width () const |
int | height () const |
double | rotation () const |
QgsGeometry * | geometry () |
const QgsGeometry * | geometry () const |
QgsPoint | position () const |
QList< QgsPoint > | positions () const |
void | setHeight (int height) |
void | setWidth (int width) |
void | setRotation (double rotation) |
void | setGeometry (QgsGeometry *g) |
Set geometry. | |
void | addPosition (const QgsPoint &position) |
Adds a position in map coordinates. | |
Private Attributes | |
int | mWidth |
Width of the bounding box in pixels. | |
int | mHeight |
Height of the bounding box in pixels. | |
QList< QgsPoint > | mPositions |
Position of the object in map coordinates. | |
double | mRotation |
Rotation of the object. | |
QgsGeometry * | mGeometry |
Copy of the feature geometry. |
It stores a copy of the feature geometry as this information is commonly used to calculate object placement
Definition at line 32 of file qgsoverlayobject.h.
QgsOverlayObject::QgsOverlayObject | ( | int | width = 0 , |
|
int | height = 0 , |
|||
double | rotation = 0 , |
|||
QgsGeometry * | geometry = 0 | |||
) |
Definition at line 21 of file qgsoverlayobject.cpp.
QgsOverlayObject::~QgsOverlayObject | ( | ) | [virtual] |
QgsOverlayObject::QgsOverlayObject | ( | const QgsOverlayObject & | other | ) |
QgsOverlayObject & QgsOverlayObject::operator= | ( | const QgsOverlayObject & | other | ) |
Definition at line 36 of file qgsoverlayobject.cpp.
References geometry(), height(), mGeometry, mHeight, mPositions, mRotation, mWidth, positions(), rotation(), and width().
GEOSGeometry * QgsOverlayObject::getGeosGeometry | ( | ) |
Returns the feature geometry in geos format.
The calling function does _not_ take ownership of the generated object. The geometry is in map coordinates
Definition at line 46 of file qgsoverlayobject.cpp.
References QgsGeometry::asGeos(), and mGeometry.
void QgsOverlayObject::releaseGeosGeometry | ( | GEOSGeometry * | the_geom | ) | [inline] |
Feature geometry is released when object is destructed so this function is empty.
This function is deprecated and does nothing
Definition at line 48 of file qgsoverlayobject.h.
int QgsOverlayObject::width | ( | ) | const [inline] |
int QgsOverlayObject::height | ( | ) | const [inline] |
double QgsOverlayObject::rotation | ( | ) | const [inline] |
QgsGeometry* QgsOverlayObject::geometry | ( | ) | [inline] |
Definition at line 54 of file qgsoverlayobject.h.
Referenced by QgsPALGeometry::getGeosGeometry(), operator=(), and QgsOverlayObject().
const QgsGeometry* QgsOverlayObject::geometry | ( | ) | const [inline] |
Definition at line 55 of file qgsoverlayobject.h.
QgsPoint QgsOverlayObject::position | ( | ) | const |
QList<QgsPoint> QgsOverlayObject::positions | ( | ) | const [inline] |
void QgsOverlayObject::setHeight | ( | int | height | ) | [inline] |
Definition at line 60 of file qgsoverlayobject.h.
void QgsOverlayObject::setWidth | ( | int | width | ) | [inline] |
Definition at line 61 of file qgsoverlayobject.h.
void QgsOverlayObject::setRotation | ( | double | rotation | ) | [inline] |
Definition at line 62 of file qgsoverlayobject.h.
void QgsOverlayObject::setGeometry | ( | QgsGeometry * | g | ) |
Set geometry.
This class takes ownership of the object
Definition at line 61 of file qgsoverlayobject.cpp.
References mGeometry.
void QgsOverlayObject::addPosition | ( | const QgsPoint & | position | ) |
Adds a position in map coordinates.
Definition at line 56 of file qgsoverlayobject.cpp.
References mPositions.
Referenced by QgsPALObjectPositionManager::findObjectPositions().
int QgsOverlayObject::mWidth [private] |
Width of the bounding box in pixels.
Definition at line 72 of file qgsoverlayobject.h.
Referenced by operator=().
int QgsOverlayObject::mHeight [private] |
Height of the bounding box in pixels.
Definition at line 74 of file qgsoverlayobject.h.
Referenced by operator=().
QList<QgsPoint> QgsOverlayObject::mPositions [private] |
Position of the object in map coordinates.
Note that it is possible that an object has several positions, e.g. a multiobject or an object that is split into multiple parts by the edge of the view extent. It is also possible that there is no position (e.g. geometry too small). In that case
Definition at line 79 of file qgsoverlayobject.h.
Referenced by addPosition(), operator=(), and position().
double QgsOverlayObject::mRotation [private] |
Rotation of the object.
Definition at line 81 of file qgsoverlayobject.h.
Referenced by operator=().
QgsGeometry* QgsOverlayObject::mGeometry [private] |
Copy of the feature geometry.
A copy is necessary because in QGIS geometries are deleted after drawing. The geometry is in map coordinates
Definition at line 84 of file qgsoverlayobject.h.
Referenced by getGeosGeometry(), operator=(), QgsOverlayObject(), setGeometry(), and ~QgsOverlayObject().