mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
- update methods of existing classes - add comment to methods missing in the sip bindings - split up collective sip files into single files and use same directory structure in python/ as in src/ - add a lot of missing classes (some might not make sense because of missing python methods in those classes) - remove some non-existing methods from the header files - add scripts/sipdiff - replace some usages of std::vector and std::set with QVector/QSet
58 lines
1.6 KiB
Plaintext
58 lines
1.6 KiB
Plaintext
|
|
class QgsMapCanvasItem : QGraphicsItem
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsmapcanvasitem.h>
|
|
%End
|
|
|
|
protected:
|
|
|
|
//! protected constructor: cannot be constructed directly
|
|
QgsMapCanvasItem( QgsMapCanvas* mapCanvas /TransferThis/ );
|
|
|
|
virtual ~QgsMapCanvasItem();
|
|
|
|
//! function to be implemented by derived classes
|
|
virtual void paint( QPainter * painter ) = 0;
|
|
|
|
//! paint function called by map canvas
|
|
virtual void paint( QPainter * painter,
|
|
const QStyleOptionGraphicsItem * option,
|
|
QWidget * widget = 0 );
|
|
|
|
//! schedules map canvas for repaint
|
|
void updateCanvas();
|
|
|
|
/**Sets render context parameters
|
|
@param p painter for rendering
|
|
@param context out: configured context
|
|
@return true in case of success
|
|
@note added in version 1.5*/
|
|
bool setRenderContextVariables( QPainter* p, QgsRenderContext& context ) const;
|
|
|
|
public:
|
|
|
|
//! called on changed extent or resize event to update position of the item
|
|
virtual void updatePosition();
|
|
|
|
//! default implementation for canvas items
|
|
virtual QRectF boundingRect() const;
|
|
|
|
//! sets current offset, to be called from QgsMapCanvas
|
|
void setPanningOffset( const QPoint& point );
|
|
|
|
//! returns canvas item rectangle
|
|
QgsRectangle rect() const;
|
|
|
|
//! sets canvas item rectangle
|
|
void setRect( const QgsRectangle& r );
|
|
|
|
//! transformation from screen coordinates to map coordinates
|
|
QgsPoint toMapCoordinates( const QPoint& point );
|
|
|
|
//! transformation from map coordinates to screen coordinates
|
|
QPointF toCanvasCoordinates( const QgsPoint& point );
|
|
};
|
|
|
|
|