-
-
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.
[FEATURE]: text and form annotation tools are now in gui and app
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13189 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
mhugent
committed
Mar 29, 2010
1 parent
93d8bdc
commit 466e864
Showing
33 changed files
with
2,814 additions
and
5 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,74 @@ | ||
/**An annotation item can be either placed either on screen corrdinates or on map coordinates. | ||
It may reference a feature and displays that associatiation with a balloon like appearance*/ | ||
class QgsAnnotationItem: QgsMapCanvasItem | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsannotationitem.h> | ||
%End | ||
|
||
public: | ||
enum MouseMoveAction | ||
{ | ||
NoAction, | ||
MoveMapPosition, | ||
MoveFramePosition, | ||
ResizeFrameUp, | ||
ResizeFrameDown, | ||
ResizeFrameLeft, | ||
ResizeFrameRight, | ||
ResizeFrameLeftUp, | ||
ResizeFrameRightUp, | ||
ResizeFrameLeftDown, | ||
ResizeFrameRightDown | ||
}; | ||
|
||
QgsAnnotationItem( QgsMapCanvas* mapCanvas ); | ||
virtual ~QgsAnnotationItem(); | ||
|
||
/**Creates an editor widget (caller takes ownership)*/ | ||
virtual QDialog* createEditor() = 0; | ||
|
||
void updatePosition(); | ||
|
||
QRectF boundingRect() const; | ||
|
||
virtual QSizeF minimumFrameSize() const; | ||
|
||
/**Returns the mouse move behaviour for a given position | ||
@param pos the position in scene coordinates*/ | ||
QgsAnnotationItem::MouseMoveAction moveActionForPosition( const QPointF& pos) const; | ||
/**Returns suitable cursor shape for mouse move action*/ | ||
Qt::CursorShape cursorShapeForAction( MouseMoveAction moveAction ) const; | ||
|
||
//setters and getters | ||
void setMapPositionFixed( bool fixed ); | ||
bool mapPositionFixed() const; | ||
|
||
virtual void setMapPosition( const QgsPoint& pos ); | ||
QgsPoint mapPosition() const; | ||
|
||
void setFrameSize( const QSizeF& size ); | ||
QSizeF frameSize() const; | ||
|
||
void setOffsetFromReferencePoint( const QPointF& offset ); | ||
QPointF offsetFromReferencePoint() const; | ||
|
||
/**Set symbol that is drawn on map position. Takes ownership*/ | ||
void setMarkerSymbol( QgsMarkerSymbolV2* symbol ); | ||
const QgsMarkerSymbolV2* markerSymbol() const; | ||
|
||
void setFrameBorderWidth( double w ); | ||
double frameBorderWidth() const; | ||
|
||
void setFrameColor( const QColor& c ); | ||
QColor frameColor() const; | ||
|
||
void setFrameBackgroundColor( const QColor& c ); | ||
QColor frameBackgroundColor() const; | ||
|
||
virtual void writeXML( QDomDocument& doc ) const = 0; | ||
virtual void readXML( const QDomDocument& doc, const QDomElement& itemElem ) = 0; | ||
|
||
void _writeXML( QDomDocument& doc, QDomElement& itemElem ) const; | ||
void _readXML( const QDomDocument& doc, const QDomElement& annotationElem ); | ||
}; |
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,31 @@ | ||
class QgsFormAnnotationItem: QObject, QgsAnnotationItem | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsformannotationitem.h> | ||
%End | ||
|
||
public: | ||
QgsFormAnnotationItem( QgsMapCanvas* canvas, QgsVectorLayer* vlayer = 0, bool hasFeature = false, int feature = 0); | ||
~QgsFormAnnotationItem(); | ||
|
||
void paint( QPainter * painter ); | ||
|
||
//! paint function called by map canvas | ||
void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); | ||
|
||
/**Create a configuration dialog*/ | ||
QDialog* createEditor(); | ||
|
||
QSizeF minimumFrameSize() const; | ||
/**Returns the optimal frame size*/ | ||
QSizeF preferredFrameSize() const; | ||
|
||
/**Reimplemented from QgsAnnotationItem*/ | ||
void setMapPosition( const QgsPoint& pos ); | ||
|
||
void setDesignerForm( const QString& uiFile ); | ||
QString designerForm() const; | ||
|
||
void writeXML( QDomDocument& doc ) const; | ||
void readXML( const QDomDocument& doc, const QDomElement& itemElem ); | ||
}; |
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,21 @@ | ||
class QgsTextAnnotationItem: QgsAnnotationItem | ||
{ | ||
%TypeHeaderCode | ||
#include <qgstextannotationitem.h> | ||
%End | ||
public: | ||
QgsTextAnnotationItem( QgsMapCanvas* canvas ); | ||
~QgsTextAnnotationItem(); | ||
|
||
QDialog* createEditor(); | ||
|
||
/**Returns document (caller takes ownership)*/ | ||
QTextDocument* document() const; | ||
/**Sets document (does not take ownership)*/ | ||
void setDocument( const QTextDocument* doc ); | ||
|
||
void writeXML( QDomDocument& doc ) const; | ||
void readXML( const QDomDocument& doc, const QDomElement& itemElem ); | ||
|
||
void paint( QPainter* painter ); | ||
}; |
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
Oops, something went wrong.