[QGIS Commit] r10506 - trunk/qgis/python/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Apr 8 06:15:22 EDT 2009
Author: mhugent
Date: 2009-04-08 06:15:22 -0400 (Wed, 08 Apr 2009)
New Revision: 10506
Added:
trunk/qgis/python/core/qgsoverlayobject.sip
Modified:
trunk/qgis/python/core/core.sip
Log:
Add overlay object, modify core.sip to include it
Modified: trunk/qgis/python/core/core.sip
===================================================================
--- trunk/qgis/python/core/core.sip 2009-04-08 09:59:33 UTC (rev 10505)
+++ trunk/qgis/python/core/core.sip 2009-04-08 10:15:22 UTC (rev 10506)
@@ -42,6 +42,7 @@
%Include qgsmaptopixel.sip
%Include qgsmarkercatalogue.sip
%Include qgsmessageoutput.sip
+%Include qgsoverlayobject.sip
%Include qgspoint.sip
%Include qgsproject.sip
%Include qgsprovidermetadata.sip
@@ -69,4 +70,5 @@
%Include qgsvectordataprovider.sip
%Include qgsvectorfilewriter.sip
%Include qgsvectorlayer.sip
+%Include qgsvectoroverlay.sip
Added: trunk/qgis/python/core/qgsoverlayobject.sip
===================================================================
--- trunk/qgis/python/core/qgsoverlayobject.sip (rev 0)
+++ trunk/qgis/python/core/qgsoverlayobject.sip 2009-04-08 10:15:22 UTC (rev 10506)
@@ -0,0 +1,56 @@
+class CORE_EXPORT QgsOverlayObject: public pal::PalGeometry
+{
+%TypeHeaderCode
+#include "qgsoverlayobject.h"
+%End
+ public:
+ QgsOverlayObject( int width = 0, int height = 0, double rotation = 0, QgsGeometry* geometry = 0 );
+ virtual ~QgsOverlayObject();
+
+ //copy constructor and assignment operator necessary because of mGeometry
+ QgsOverlayObject( const QgsOverlayObject& other );
+ QgsOverlayObject& operator=( const QgsOverlayObject& other );
+
+
+ /**Returns the feature geometry in geos format. The calling function does _not_ take
+ ownership of the generated object*/
+ GEOSGeometry* getGeosGeometry();
+ /**Feature geometry is released when object is destructed so this function is empty*/
+ void releaseGeosGeometry( GEOSGeometry *the_geom ) {}
+
+ //getters
+ int width() const {return mWidth;}
+ int height() const {return mHeight;}
+ double rotation() const {return mRotation;}
+ QgsGeometry* geometry() {return mGeometry;}
+ const QgsGeometry* geometry() const {return mGeometry;}
+ QgsPoint position() const;
+ QList<QgsPoint> positions() const {return mPositions;}
+
+ //setters
+ void setHeight( int height ) {mHeight = height;}
+ void setWidth( int width ) {mWidth = width;}
+ void setRotation( double rotation ) {mRotation = rotation;}
+ /**Set geometry. This class takes ownership of the object*/
+ void setGeometry( QgsGeometry* g );
+ /**Adds a position in map coordinates*/
+ void addPosition( const QgsPoint& position );
+
+
+ private:
+
+ /**Width of the bounding box in pixels*/
+ int mWidth;
+ /**Height of the bounding box in pixels*/
+ int mHeight;
+ /**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*/
+ QList<QgsPoint> mPositions;
+ /**Rotation of the object*/
+ double mRotation;
+ /**Copy of the feature geometry. A copy is necessary because in QGIS geometries are deleted
+ after drawing*/
+ QgsGeometry* mGeometry;
+
+};
More information about the QGIS-commit
mailing list