Quantum GIS API Documentation  1.8
Public Member Functions | Private Attributes
QgsOverlayObject Class Reference

An object that holds information about the position and bounding box size of an overlay object. More...

#include <qgsoverlayobject.h>

Collaboration diagram for QgsOverlayObject:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QgsOverlayObject (int width=0, int height=0, double rotation=0, QgsGeometry *geometry=0)
virtual ~QgsOverlayObject ()
 QgsOverlayObject (const QgsOverlayObject &other)
QgsOverlayObjectoperator= (const QgsOverlayObject &other)
Q_DECL_DEPRECATED GEOSGeometry * getGeosGeometry ()
 Returns the feature geometry in geos format.
Q_DECL_DEPRECATED 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
QgsGeometrygeometry ()
const QgsGeometrygeometry () const
QgsPoint position () const
QList< QgsPointpositions () 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< QgsPointmPositions
 Position of the object in map coordinates.
double mRotation
 Rotation of the object.
QgsGeometrymGeometry
 Copy of the feature geometry.

Detailed Description

An object that holds information about the position and bounding box size of an overlay object.

It stores a copy of the feature geometry as this information is commonly used to calculate object placement

Note:
This class has been added in version 1.1

Definition at line 32 of file qgsoverlayobject.h.


Constructor & Destructor Documentation

QgsOverlayObject::QgsOverlayObject ( int  width = 0,
int  height = 0,
double  rotation = 0,
QgsGeometry geometry = 0 
)

Definition at line 21 of file qgsoverlayobject.cpp.

Definition at line 26 of file qgsoverlayobject.cpp.

References mGeometry.

Definition at line 31 of file qgsoverlayobject.cpp.

References geometry(), and mGeometry.


Member Function Documentation

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

Definition at line 56 of file qgsoverlayobject.h.

Referenced by QgsPALGeometry::getGeosGeometry(), operator=(), and QgsOverlayObject().

const QgsGeometry* QgsOverlayObject::geometry ( ) const [inline]

Definition at line 57 of file qgsoverlayobject.h.

Returns the feature geometry in geos format.

The calling function does _not_ take ownership of the generated object. The geometry is in map coordinates

Deprecated:
Please use geometry() and QgsGeometry::asGeos instead

Definition at line 46 of file qgsoverlayobject.cpp.

References QgsGeometry::asGeos(), and mGeometry.

int QgsOverlayObject::height ( ) const [inline]

Definition at line 54 of file qgsoverlayobject.h.

Referenced by operator=().

QgsOverlayObject & QgsOverlayObject::operator= ( const QgsOverlayObject other)

Definition at line 67 of file qgsoverlayobject.cpp.

References mPositions.

QList<QgsPoint> QgsOverlayObject::positions ( ) const [inline]

Definition at line 59 of file qgsoverlayobject.h.

Referenced by operator=().

Q_DECL_DEPRECATED void QgsOverlayObject::releaseGeosGeometry ( GEOSGeometry *  the_geom) [inline]

Feature geometry is released when object is destructed so this function is empty.

Deprecated:
nop

Definition at line 50 of file qgsoverlayobject.h.

double QgsOverlayObject::rotation ( ) const [inline]

Definition at line 55 of file qgsoverlayobject.h.

Referenced by operator=().

Set geometry.

This class takes ownership of the object

Definition at line 61 of file qgsoverlayobject.cpp.

References mGeometry.

void QgsOverlayObject::setHeight ( int  height) [inline]

Definition at line 62 of file qgsoverlayobject.h.

void QgsOverlayObject::setRotation ( double  rotation) [inline]

Definition at line 64 of file qgsoverlayobject.h.

void QgsOverlayObject::setWidth ( int  width) [inline]

Definition at line 63 of file qgsoverlayobject.h.

int QgsOverlayObject::width ( ) const [inline]

Definition at line 53 of file qgsoverlayobject.h.

Referenced by operator=().


Member Data Documentation

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 86 of file qgsoverlayobject.h.

Referenced by getGeosGeometry(), operator=(), QgsOverlayObject(), setGeometry(), and ~QgsOverlayObject().

Height of the bounding box in pixels.

Definition at line 76 of file qgsoverlayobject.h.

Referenced by operator=().

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 81 of file qgsoverlayobject.h.

Referenced by addPosition(), operator=(), and position().

double QgsOverlayObject::mRotation [private]

Rotation of the object.

Definition at line 83 of file qgsoverlayobject.h.

Referenced by operator=().

int QgsOverlayObject::mWidth [private]

Width of the bounding box in pixels.

Definition at line 74 of file qgsoverlayobject.h.

Referenced by operator=().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines