-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change in overlay classes such that pal object and geos geometry don'…
…t appear in the public interfaces (important for python bindings) git-svn-id: http://svn.osgeo.org/qgis/trunk@10791 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
mhugent
committed
May 14, 2009
1 parent
d796bbc
commit 749390f
Showing
13 changed files
with
259 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,39 @@ | ||
class CORE_EXPORT QgsOverlayObject: public pal::PalGeometry | ||
class QgsOverlayObject | ||
{ | ||
%TypeHeaderCode | ||
#include "qgsoverlayobject.h" | ||
%End | ||
public: | ||
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 ); | ||
|
||
|
||
//this function fill not be wrapped to not depend on geos python bindings | ||
/**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 ) {} | ||
ownership of the generated object. The geometry is in map coordinates | ||
@note: this function is deprecated. Please use geometry() and QgsGeometry::asGeos instead*/ | ||
//GEOSGeometry* getGeosGeometry(); | ||
/**Feature geometry is released when object is destructed so this function is empty. This function is deprecated and does nothing*/ | ||
//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;} | ||
int width() const; | ||
int height() const; | ||
double rotation() const; | ||
QgsGeometry* geometry(); | ||
//const QgsGeometry* geometry() const; | ||
QgsPoint position() const; | ||
QList<QgsPoint> positions() const {return mPositions;} | ||
QList<QgsPoint> positions() const; | ||
|
||
//setters | ||
void setHeight( int height ) {mHeight = height;} | ||
void setWidth( int width ) {mWidth = width;} | ||
void setRotation( double rotation ) {mRotation = rotation;} | ||
void setHeight( int height ); | ||
void setWidth( int width ); | ||
void setRotation( double 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; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*************************************************************************** | ||
qgspalgeometry.cpp - description | ||
--------------------------------- | ||
begin : May 2009 | ||
copyright : (C) 2009 by Marco Hugentobler | ||
email : marco dot hugentobler at karto dot baug dot ethz dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgspalgeometry.h" | ||
#include "qgsgeometry.h" | ||
#include "qgsoverlayobject.h" | ||
#include <geos_c.h> | ||
|
||
QgsPALGeometry::QgsPALGeometry(QgsOverlayObject* op): mOverlayObjectPtr(op) | ||
{ | ||
} | ||
|
||
QgsPALGeometry::QgsPALGeometry(): mOverlayObjectPtr(0) | ||
{ | ||
} | ||
|
||
QgsPALGeometry::~QgsPALGeometry() | ||
{ | ||
} | ||
|
||
GEOSGeometry* QgsPALGeometry::getGeosGeometry() | ||
{ | ||
if(mOverlayObjectPtr) | ||
{ | ||
if(mOverlayObjectPtr->geometry()) | ||
{ | ||
return mOverlayObjectPtr->geometry()->asGeos(); | ||
} | ||
} | ||
return 0; | ||
} | ||
|
Oops, something went wrong.