![]() |
Mapper
0.9.0
API documentation
|
Object type which can only be used for point symbols, and is also the only object which can be used with them. More...
#include <object.h>
Public Member Functions | |
PointObject (const Symbol *symbol=nullptr) | |
Constructs a PointObject, optionally assigning the symbol. More... | |
PointObject * | duplicate () const override |
Creates a duplicate of the point. More... | |
PointObject & | operator= (const PointObject &other)=delete |
void | copyFrom (const Object &other) override |
Replaces the content of this object by that of another. More... | |
void | setPosition (qint32 x, qint32 y) |
Sets the point's position to a new position given in native map coordinates. More... | |
void | setPosition (const MapCoord &coord) |
Changes the point's position. More... | |
void | setPosition (const MapCoordF &coord) |
Changes the point's position. More... | |
MapCoordF | getCoordF () const |
Returns the point's position as MapCoordF. More... | |
MapCoord | getCoord () const |
Returns the point's coordinate. More... | |
void | transform (const QTransform &t) override |
Transforms the position. More... | |
bool | intersectsBox (const QRectF &box) const override |
Checks if a path point (excluding curve control points) is included in the given box. More... | |
![]() | |
Object (Type type, const Symbol *symbol=nullptr) | |
Creates an empty object with the given type and (optional) symbol. More... | |
Object (Type type, const Symbol *symbol, const MapCoordVector &coords, Map *map=nullptr) | |
Creates an empty object with the given type, symbol, coords and (optional) map. More... | |
virtual | ~Object () |
Destructs the object. More... | |
Object & | operator= (const Object &other)=delete |
bool | equals (const Object *other, bool compare_symbol) const |
Checks for equality with another object. More... | |
virtual bool | validate () const |
Type | getType () const |
Returns the object type determined by the subclass. More... | |
PointObject * | asPoint () |
Convenience cast to PointObject with type checking. More... | |
const PointObject * | asPoint () const |
Convenience cast to PointObject with type checking. More... | |
PathObject * | asPath () |
Convenience cast to PathObject with type checking. More... | |
const PathObject * | asPath () const |
Convenience cast to PathObject with type checking. More... | |
TextObject * | asText () |
Convenience cast to TextObject with type checking. More... | |
const TextObject * | asText () const |
Convenience cast to TextObject with type checking. More... | |
void | save (QXmlStreamWriter &xml) const |
Saves the object in xml format to the given stream. More... | |
qreal | getRotation () const |
Returns the rotation for this object (in radians). More... | |
void | setRotation (qreal new_rotation) |
Sets the object's rotation (in radians). More... | |
bool | update () const |
If the output_dirty flag is set, regenerates output and extent, and updates the object's map (if set). More... | |
void | forceUpdate () const |
Always regenerates output and extent, and updates the object's map (if set). More... | |
void | move (qint32 dx, qint32 dy) |
Moves the whole object. More... | |
void | move (const MapCoord &offset) |
Moves the whole object by the given offset. More... | |
virtual void | scale (const MapCoordF ¢er, double factor) |
Scales all coordinates, with the given scaling center. More... | |
virtual void | scale (double factor_x, double factor_y) |
Scales all coordinates, with the center (0, 0). More... | |
void | rotateAround (const MapCoordF ¢er, qreal angle) |
Rotates the whole object around the center point. More... | |
void | rotate (qreal angle) |
Rotates the whole object around the center (0, 0). More... | |
int | isPointOnObject (const MapCoordF &coord, float tolerance, bool treat_areas_as_paths, bool extended_selection) const |
Checks if the given coord, with the given tolerance, is on this object. More... | |
void | takeRenderables () |
Takes ownership of the renderables. More... | |
void | clearRenderables () |
Deletes the renderables (and extent), undoing update() More... | |
const ObjectRenderables & | renderables () const |
Returns the renderables, read-only. More... | |
const MapCoordVector & | getRawCoordinateVector () const |
Returns the raw MapCoordVector of the object. More... | |
void | setOutputDirty (bool dirty=true) |
Sets the object output's dirty state. More... | |
bool | isOutputDirty () const |
Returns if the object's output must be regenerated. More... | |
bool | setSymbol (const Symbol *new_symbol, bool no_checks) |
Changes the object's symbol, returns if successful. More... | |
const Symbol * | getSymbol () const |
Returns the object's symbol. More... | |
const QRectF & | getExtent () const |
NOTE: The extent is only valid after update() has been called! More... | |
void | setMap (Map *map) |
Sets the object's map pointer. More... | |
Map * | getMap () const |
Returns the object's map pointer. More... | |
const Tags & | tags () const |
Returns a const reference to the object's tags. More... | |
void | setTags (const Tags &tags) |
Replaces the object's tags. More... | |
QString | getTag (const QString &key) const |
Returns the value of the given tag key. More... | |
void | setTag (const QString &key, const QString &value) |
Sets the given tag key to the value. More... | |
void | removeTag (const QString &key) |
Removes the given tag key and its value. More... | |
void | includeControlPointsRect (QRectF &rect) const |
Extends a rectangle to enclose all of the object's control points. More... | |
Protected Member Functions | |
PointObject (const PointObject &proto) | |
Constructs a PointObject, initialized from the given prototype. More... | |
![]() | |
Object (const Object &proto) | |
Constructs a Object, initialized from the given prototype. More... | |
virtual void | updateEvent () const |
virtual void | createRenderables (ObjectRenderables &output, Symbol::RenderableOptions options) const |
Additional Inherited Members | |
![]() | |
enum | Type { Point = 0, Path = 1, Text = 4 } |
Enumeration of possible object types. More... | |
typedef QHash< QString, QString > | Tags |
Defines a type which maps keys to values, to be used for tagging objects. More... | |
![]() | |
static Object * | load (QXmlStreamReader &xml, Map *map, const SymbolDictionary &symbol_dict, const Symbol *symbol=nullptr) |
Loads the object in xml format from the given stream. More... | |
static Object * | getObjectForType (Type type, const Symbol *symbol=nullptr) |
Constructs an object of the given type with the given symbol. More... | |
![]() | |
Type | type |
const Symbol * | symbol = nullptr |
MapCoordVector | coords |
Map * | map = nullptr |
Tags | object_tags |
Object type which can only be used for point symbols, and is also the only object which can be used with them.
Has exactly one coordinate, and additionally a rotation parameter.
|
explicit |
Constructs a PointObject, optionally assigning the symbol.
|
explicitprotecteddefault |
Constructs a PointObject, initialized from the given prototype.
|
overridevirtual |
Replaces the content of this object by that of another.
Reimplemented from OpenOrienteering::Object.
|
overridevirtual |
Creates a duplicate of the point.
Use asPoint() on the result to obtain an object of type PointObject.
Implements OpenOrienteering::Object.
MapCoord OpenOrienteering::PointObject::getCoord | ( | ) | const |
Returns the point's coordinate.
MapCoordF OpenOrienteering::PointObject::getCoordF | ( | ) | const |
Returns the point's position as MapCoordF.
Checks if a path point (excluding curve control points) is included in the given box.
Implements OpenOrienteering::Object.
|
delete |
void OpenOrienteering::PointObject::setPosition | ( | qint32 | x, |
qint32 | y | ||
) |
Sets the point's position to a new position given in native map coordinates.
void OpenOrienteering::PointObject::setPosition | ( | const MapCoord & | coord | ) |
Changes the point's position.
void OpenOrienteering::PointObject::setPosition | ( | const MapCoordF & | coord | ) |
Changes the point's position.
|
overridevirtual |
Transforms the position.
Implements OpenOrienteering::Object.