![]() |
Mapper
0.9.0
API documentation
|
Object type which can be used for line, area and combined symbols. More...
#include <object.h>
Classes | |
struct | Intersection |
Returned by calcAllIntersectionsWith(). More... | |
class | Intersections |
std::vector of Intersection with the ability to sort them and remove duplicates. More... | |
Public Member Functions | |
PathObject (const Symbol *symbol=nullptr) | |
Constructs a PathObject, optionally assigning a symbol. More... | |
PathObject (const Symbol *symbol, const MapCoordVector &coords, Map *map=nullptr) | |
Constructs a PathObject, assigning initial coords and optionally the map pointer. More... | |
PathObject (const Symbol *symbol, const PathObject &proto, MapCoordVector::size_type piece) | |
Constructs a PathObject, assigning initial coords from a single piece of a line. More... | |
PathObject (const PathPart &proto_part) | |
Constructs a PathObject, initialized from the given part of another object. More... | |
PathObject * | duplicate () const override |
Creates a duplicate of the path object. More... | |
PathObject & | operator= (const PathObject &other)=delete |
void | copyFrom (const Object &other) override |
Replaces this object's contents by those of the other. More... | |
bool | validate () const override |
void | normalize () |
Checks the path for valid flags, and makes corrections as necessary. More... | |
bool | intersectsBox (const QRectF &box) const override |
Checks if a path point (excluding curve control points) is included in the given box. More... | |
MapCoordVector::size_type | getCoordinateCount () const |
Returns the number of coordinates, including curve handles and close points. More... | |
MapCoord | getCoordinate (MapCoordVector::size_type pos) const |
Returns the i-th coordinate. More... | |
MapCoord & | getCoordinateRef (MapCoordVector::size_type pos) |
Returns a non-const reference to the i-th coordinate. More... | |
void | setCoordinate (MapCoordVector::size_type pos, const MapCoord &c) |
Replaces the i-th coordinate with c. More... | |
void | addCoordinate (MapCoordVector::size_type pos, const MapCoord &c) |
Adds the coordinate at the given index. More... | |
void | addCoordinate (const MapCoord &c, bool start_new_part=false) |
Adds the coordinate at the end, optionally starting a new part. More... | |
void | deleteCoordinate (MapCoordVector::size_type pos, bool adjust_other_coords, int delete_bezier_point_action=-1) |
Deletes a coordinate from the path. More... | |
void | clearCoordinates () |
Deletes all coordinates of the object. More... | |
void | assignCoordinates (const PathObject &proto, MapCoordVector::size_type first, MapCoordVector::size_type last) |
Assigns the given prototype's coordinates subset to this object's coordinates. More... | |
PathPartVector::const_iterator | findPartForIndex (MapCoordVector::size_type coords_index) const |
Finds the path part containing the given coord index. More... | |
PathPartVector::iterator | findPartForIndex (MapCoordVector::size_type coords_index) |
Finds the path part containing the given coord index. More... | |
PathPartVector::size_type | findPartIndexForIndex (MapCoordVector::size_type coords_index) const |
Finds the path part containing the given coord index. More... | |
PathCoord | findPathCoordForIndex (MapCoordVector::size_type index) const |
Returns the path coordinate for the map coordinate with given index. More... | |
bool | isCurveHandle (MapCoordVector::size_type index) const |
Returns true if the given index is a curve handle. More... | |
const PathPartVector & | parts () const |
Returns the vector of path parts. More... | |
PathPartVector & | parts () |
Returns the vector of path parts. More... | |
void | deletePart (PathPartVector::size_type part_index) |
Deletes the i-th path part. More... | |
void | transform (const QTransform &t) override |
Transforms the coordinates and the pattern origin. More... | |
qreal | getPatternRotation () const |
Returns the rotation of the object pattern. More... | |
void | setPatternRotation (qreal rotation) |
Sets the rotation of the object pattern. More... | |
MapCoord | getPatternOrigin () const |
Returns the origin of the object pattern. More... | |
void | setPatternOrigin (const MapCoord &origin) |
Sets the origin of the object pattern. More... | |
void | calcClosestPointOnPath (MapCoordF coord, float &out_distance_sq, PathCoord &out_path_coord, MapCoordVector::size_type start_index=0, MapCoordVector::size_type end_index=std::numeric_limits< PathPartVector::size_type >::max()) const |
Calculates the closest point on the path to the given coordinate, returns the squared distance of these points and PathCoord information for the point on the path. More... | |
void | calcClosestCoordinate (MapCoordF coord, float &out_distance_sq, MapCoordVector::size_type &out_index) const |
Calculates the closest control point coordinate to the given coordinate, returns the squared distance of these points and the index of the control point. More... | |
MapCoordVector::size_type | subdivide (const PathCoord &path_coord) |
Splits the path at the position given by path_coord. More... | |
MapCoordVector::size_type | subdivide (MapCoordVector::size_type index, float param) |
Splits the path in the curve which starts at the given index. More... | |
bool | canBeConnected (const PathObject *other, double connect_threshold_sq) const |
Returns if connectIfClose() would change something with the given parameters. More... | |
bool | connectIfClose (PathObject *other, double connect_threshold_sq) |
Returns if the objects were connected (if so, you can delete the other object). More... | |
void | connectPathParts (PathPartVector::size_type part_index, const PathObject *other, PathPartVector::size_type other_part_index, bool prepend, bool merge_ends=true) |
Connects the given parts, optionally merging the end coordinates at the center position, and copying over the coordindates from other. More... | |
std::vector< PathObject * > | removeFromLine (PathPartVector::size_type part_index, PathCoord::length_type clen_begin, PathCoord::length_type clen_end) const |
Returns the result of removing the section between begin and end from the path. More... | |
std::vector< PathObject * > | splitLineAt (const PathCoord &split_pos) const |
Returns the result of splitting the path at the given inner position. More... | |
void | changePathBounds (PathPartVector::size_type part_index, PathCoord::length_type start_len, PathCoord::length_type end_len) |
Replaces the path with a non-empty range of it starting and ending at the given lengths. More... | |
void | appendPath (const PathObject *other) |
Appends (copies) the coordinates of other to this path. More... | |
void | appendPathPart (const PathPart &part) |
Appends (copies) the coordinates of a specific part to this path. More... | |
void | reverse () |
Reverses the object's coordinates, resulting in switching the start / end / mid / dash symbol direction for line symbols. More... | |
void | closeAllParts () |
Ensures that all parts are closed. More... | |
bool | convertToCurves (PathObject **undo_duplicate=nullptr) |
Converts all polygonal sections in this path to splines. More... | |
PathPart::size_type | convertRangeToCurves (const PathPart &part, PathPart::size_type start_index, PathPart::size_type end_index) |
Converts the given range of coordinates to a spline by inserting handles. More... | |
bool | simplify (PathObject **undo_duplicate, double threshold) |
Tries to remove points while retaining the path shape as much as possible. More... | |
int | isPointOnPath (MapCoordF coord, float tolerance, bool treat_areas_as_paths, bool extended_selection) const |
See Object::isPointOnObject() More... | |
bool | isPointInsideArea (const MapCoordF &coord) const |
Returns true if the given coordinate is inside the area defined by this object, which must be closed. More... | |
double | calcMaximumDistanceTo (MapCoordVector::size_type start_index, MapCoordVector::size_type end_index, const PathObject *other, MapCoordVector::size_type other_start_index, MapCoordVector::size_type other_end_index) const |
Calculates the maximum distance of the given coord ranges of two objects. More... | |
void | calcAllIntersectionsWith (const PathObject *other, Intersections &out) const |
Calculates and adds all intersections with the other path to out. More... | |
void | updatePathCoords () const |
Called by Object::update() More... | |
void | recalculateParts () |
Called by Object::load() 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... | |
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 | |
PathObject (const PathObject &proto) | |
Constructs a PathObject, initialized from the given prototype. More... | |
void | partSizeChanged (PathPartVector::iterator part, MapCoordVector::difference_type change) |
Adjusts the end index of the given part and the start/end indexes of the following parts. More... | |
void | prepareDeleteBezierPoint (MapCoordVector::size_type pos, int delete_bezier_point_action) |
void | setClosingPoint (MapCoordVector::size_type index, const MapCoord &coord) |
Sets coord as the point which closes a part: sets the correct flags on it and replaces the coord at the given index by it. More... | |
void | updateEvent () const override |
void | createRenderables (ObjectRenderables &output, Symbol::RenderableOptions options) const override |
![]() | |
Object (const Object &proto) | |
Constructs a Object, initialized from the given prototype. More... | |
Static Protected Member Functions | |
static void | calcBezierPointDeletionRetainingShapeFactors (MapCoord p0, MapCoord p1, MapCoord p2, MapCoord q0, MapCoord q1, MapCoord q2, MapCoord q3, double &out_pfactor, double &out_qfactor) |
Calculates the factors which should be applied to the length of the remaining bezier curve handle vectors when deleting a point joining two bezier curves to try to retain the original curves' shape. More... | |
static void | calcBezierPointDeletionRetainingShapeOptimization (MapCoord p0, MapCoord p1, MapCoord p2, MapCoord q0, MapCoord q1, MapCoord q2, MapCoord q3, double &out_pfactor, double &out_qfactor) |
Uses nonlinear optimization to improve the first result obtained by calcBezierPointDeletionRetainingShapeFactors(). More... | |
static float | calcBezierPointDeletionRetainingShapeCost (MapCoord p0, MapCoordF p1, MapCoordF p2, MapCoord p3, PathObject *reference) |
Is used internally by calcBezierPointDeletionRetainingShapeOptimization() to calculate the current cost. More... | |
Friends | |
class | PathPart |
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 be used for line, area and combined symbols.
Has a dynamic number of coordinates.
The coordinates are divided into one or multiple PathParts. A PathPart is ended by a coordinate with the "hole point" flag. For all types of flags which can be set, see the MapCoord documentation.
|
explicit |
Constructs a PathObject, optionally assigning a symbol.
|
explicit |
Constructs a PathObject, assigning initial coords and optionally the map pointer.
|
explicit |
Constructs a PathObject, assigning initial coords from a single piece of a line.
"Piece" refers to a single straight or curved arc from the point identified by parameter piece to the immediate next point on the path.
If the path is not closed, and piece refers to the last element in the path (part), then the arc ending in the point referred to by piece is returned instead.
|
explicitprotected |
Constructs a PathObject, initialized from the given prototype.
|
explicit |
Constructs a PathObject, initialized from the given part of another object.
void OpenOrienteering::PathObject::addCoordinate | ( | MapCoordVector::size_type | pos, |
const MapCoord & | c | ||
) |
Adds the coordinate at the given index.
void OpenOrienteering::PathObject::addCoordinate | ( | const MapCoord & | c, |
bool | start_new_part = false |
||
) |
Adds the coordinate at the end, optionally starting a new part.
If starting a new part, make sure that the last coord of the old part has the hole point flag!
void OpenOrienteering::PathObject::appendPath | ( | const PathObject * | other | ) |
Appends (copies) the coordinates of other to this path.
void OpenOrienteering::PathObject::appendPathPart | ( | const PathPart & | part | ) |
Appends (copies) the coordinates of a specific part to this path.
The other object is determined from the part's path property.
void OpenOrienteering::PathObject::assignCoordinates | ( | const PathObject & | proto, |
MapCoordVector::size_type | first, | ||
MapCoordVector::size_type | last | ||
) |
Assigns the given prototype's coordinates subset to this object's coordinates.
The range must be within one part. Last may be smaller than first iff the path is closed.
void OpenOrienteering::PathObject::calcAllIntersectionsWith | ( | const PathObject * | other, |
PathObject::Intersections & | out | ||
) | const |
Calculates and adds all intersections with the other path to out.
Note: intersections are not sorted and may contain duplicates! To clean them up, call clean() on the Intersections object after adding all intersections with objects you are interested in.
|
staticprotected |
Is used internally by calcBezierPointDeletionRetainingShapeOptimization() to calculate the current cost.
Evaluates the distance between p0 ... p3 and the reference path.
|
staticprotected |
Calculates the factors which should be applied to the length of the remaining bezier curve handle vectors when deleting a point joining two bezier curves to try to retain the original curves' shape.
This is a simple version, the result should be optimized with calcBezierPointDeletionRetainingShapeOptimization().
p0, p1, p2, q0 make up the first original curve, q0, q1, q2, q3 make up the second original curve. out_pfactor is set to the factor to apply to the vector (p1 - p0), out_qfactor is set to the factor to apply to the vector (q2 - q3),
|
staticprotected |
Uses nonlinear optimization to improve the first result obtained by calcBezierPointDeletionRetainingShapeFactors().
void OpenOrienteering::PathObject::calcClosestCoordinate | ( | MapCoordF | coord, |
float & | out_distance_sq, | ||
MapCoordVector::size_type & | out_index | ||
) | const |
Calculates the closest control point coordinate to the given coordinate, returns the squared distance of these points and the index of the control point.
Convert out_distance_sq to double (so avoiding conversions).
Return index rather than writing to the provided reference.
void OpenOrienteering::PathObject::calcClosestPointOnPath | ( | MapCoordF | coord, |
float & | out_distance_sq, | ||
PathCoord & | out_path_coord, | ||
MapCoordVector::size_type | start_index = 0 , |
||
MapCoordVector::size_type | end_index = std::numeric_limits<PathPartVector::size_type>::max() |
||
) | const |
Calculates the closest point on the path to the given coordinate, returns the squared distance of these points and PathCoord information for the point on the path.
This does not need to be an existing path coordinate. This method is usually called to find the position on the path the user clicked on. part_index can be set to a valid part index to constrain searching to this specific path part.
Convert out_distance_sq to double (so avoiding conversions).
Return PathCoord rather than writing to the provided reference.
double OpenOrienteering::PathObject::calcMaximumDistanceTo | ( | MapCoordVector::size_type | start_index, |
MapCoordVector::size_type | end_index, | ||
const PathObject * | other, | ||
MapCoordVector::size_type | other_start_index, | ||
MapCoordVector::size_type | other_end_index | ||
) | const |
Calculates the maximum distance of the given coord ranges of two objects.
bool OpenOrienteering::PathObject::canBeConnected | ( | const PathObject * | other, |
double | connect_threshold_sq | ||
) | const |
Returns if connectIfClose() would change something with the given parameters.
void OpenOrienteering::PathObject::changePathBounds | ( | PathPartVector::size_type | part_index, |
PathCoord::length_type | start_len, | ||
PathCoord::length_type | end_len | ||
) |
Replaces the path with a non-empty range of it starting and ending at the given lengths.
For open paths, the end length must be greater than the start length. For closed paths, an end length smaller than or equal to the start length will cause the resulting path to span the original start/end point.
void OpenOrienteering::PathObject::clearCoordinates | ( | ) |
Deletes all coordinates of the object.
void OpenOrienteering::PathObject::closeAllParts | ( | ) |
Ensures that all parts are closed.
Useful for objects with area-only symbols.
bool OpenOrienteering::PathObject::connectIfClose | ( | PathObject * | other, |
double | connect_threshold_sq | ||
) |
Returns if the objects were connected (if so, you can delete the other object).
If one of the paths has to be reversed, it is done for the "other" path. Otherwise, the "other" path is not changed.
void OpenOrienteering::PathObject::connectPathParts | ( | PathPartVector::size_type | part_index, |
const PathObject * | other, | ||
PathPartVector::size_type | other_part_index, | ||
bool | prepend, | ||
bool | merge_ends = true |
||
) |
Connects the given parts, optionally merging the end coordinates at the center position, and copying over the coordindates from other.
PathPart::size_type OpenOrienteering::PathObject::convertRangeToCurves | ( | const PathPart & | part, |
PathPart::size_type | start_index, | ||
PathPart::size_type | end_index | ||
) |
Converts the given range of coordinates to a spline by inserting handles.
The range must consist of only polygonal segments before.
bool OpenOrienteering::PathObject::convertToCurves | ( | PathObject ** | undo_duplicate = nullptr | ) |
Converts all polygonal sections in this path to splines.
If at least one section is converted, returns true and returns an undo duplicate if the corresponding pointer is set.
|
overridevirtual |
Replaces this object's contents by those of the other.
Reimplemented from OpenOrienteering::Object.
|
overrideprotectedvirtual |
Reimplemented from OpenOrienteering::Object.
void OpenOrienteering::PathObject::deleteCoordinate | ( | MapCoordVector::size_type | pos, |
bool | adjust_other_coords, | ||
int | delete_bezier_point_action = -1 |
||
) |
Deletes a coordinate from the path.
When requesting a control point of a bezier arc to be deleted, the other control point is deleted, too.
If the number of regular points in the coordinate's part is not more than two, the whole part is delete from the object.
pos | Index of the coordinate to delete. |
adjust_other_coords | If set and the deleted coordinate was joining two bezier curves, adapts the adjacent curves with a strategy defined by delete_bezier_point_action. adjust_other_coords does not work when deleting bezier curve handles! |
delete_bezier_point_action | Must be an enum value from Settings::DeleteBezierPointAction if adjust_other_coords is set. |
void OpenOrienteering::PathObject::deletePart | ( | PathPartVector::size_type | part_index | ) |
Deletes the i-th path part.
|
overridevirtual |
Creates a duplicate of the path object.
Use asPath() on the result to obtain an object of type PathObject.
Implements OpenOrienteering::Object.
PathPartVector::const_iterator OpenOrienteering::PathObject::findPartForIndex | ( | MapCoordVector::size_type | coords_index | ) | const |
Finds the path part containing the given coord index.
PathPartVector::iterator OpenOrienteering::PathObject::findPartForIndex | ( | MapCoordVector::size_type | coords_index | ) |
Finds the path part containing the given coord index.
PathPartVector::size_type OpenOrienteering::PathObject::findPartIndexForIndex | ( | MapCoordVector::size_type | coords_index | ) | const |
Finds the path part containing the given coord index.
PathCoord OpenOrienteering::PathObject::findPathCoordForIndex | ( | MapCoordVector::size_type | index | ) | const |
|
inline |
Returns the i-th coordinate.
|
inline |
Returns the number of coordinates, including curve handles and close points.
|
inline |
Returns a non-const reference to the i-th coordinate.
Normally you should modify coordinates via PathObject::setCoordinate. Unlike that function, modifying a coordinate directly via the reference will not keep the first and last point of a closed path in sync.
|
inline |
Returns the origin of the object pattern.
Only has an effect in combination with a symbol interpreting this value.
|
inline |
Returns the rotation of the object pattern.
Only has an effect in combination with a symbol interpreting this value.
Checks if a path point (excluding curve control points) is included in the given box.
Implements OpenOrienteering::Object.
bool OpenOrienteering::PathObject::isCurveHandle | ( | MapCoordVector::size_type | index | ) | const |
Returns true if the given index is a curve handle.
Returns true if the given coordinate is inside the area defined by this object, which must be closed.
void OpenOrienteering::PathObject::normalize | ( | ) |
Checks the path for valid flags, and makes corrections as necessary.
|
delete |
|
inline |
Returns the vector of path parts.
|
inline |
Returns the vector of path parts.
Marks the output as dirty.
|
protected |
Adjusts the end index of the given part and the start/end indexes of the following parts.
output_dirty must be set before calling this function.
|
protected |
void OpenOrienteering::PathObject::recalculateParts | ( | ) |
Called by Object::load()
std::vector< PathObject * > OpenOrienteering::PathObject::removeFromLine | ( | PathPartVector::size_type | part_index, |
PathCoord::length_type | clen_begin, | ||
PathCoord::length_type | clen_end | ||
) | const |
Returns the result of removing the section between begin and end from the path.
begin and end must belong to the path part with the given part_index. However, objects with holes, and part_index values greater than 0, are not supported at the moment.
Returns an empty vector when nothing remains after removal.
void OpenOrienteering::PathObject::reverse | ( | ) |
Reverses the object's coordinates, resulting in switching the start / end / mid / dash symbol direction for line symbols.
|
protected |
Sets coord as the point which closes a part: sets the correct flags on it and replaces the coord at the given index by it.
TODO: make separate methods? Setting coords exists already.
void OpenOrienteering::PathObject::setCoordinate | ( | MapCoordVector::size_type | pos, |
const MapCoord & | c | ||
) |
Replaces the i-th coordinate with c.
void OpenOrienteering::PathObject::setPatternOrigin | ( | const MapCoord & | origin | ) |
Sets the origin of the object pattern.
Only has an effect in combination with a symbol interpreting this value.
void OpenOrienteering::PathObject::setPatternRotation | ( | qreal | rotation | ) |
Sets the rotation of the object pattern.
Only has an effect in combination with a symbol interpreting this value.
bool OpenOrienteering::PathObject::simplify | ( | PathObject ** | undo_duplicate, |
double | threshold | ||
) |
Tries to remove points while retaining the path shape as much as possible.
If at least one point is changed, returns true and returns an undo duplicate if the corresponding pointer is set.
std::vector< PathObject * > OpenOrienteering::PathObject::splitLineAt | ( | const PathCoord & | split_pos | ) | const |
Returns the result of splitting the path at the given inner position.
Returns an empty vector when the object is not changed by the split. This happens when the path is not closed and split_pos is the begin or end of the path, or when the object has got more than a single PathPart.
MapCoordVector::size_type OpenOrienteering::PathObject::subdivide | ( | const PathCoord & | path_coord | ) |
Splits the path at the position given by path_coord.
Must not be called while isOutputDirty() returns true.
Returns the index of the added point.
MapCoordVector::size_type OpenOrienteering::PathObject::subdivide | ( | MapCoordVector::size_type | index, |
float | param | ||
) |
Splits the path in the curve which starts at the given index.
The second parameter determines the split position between begin and end of the curve (0.0 ... 1.0).
Must not be called while isOutputDirty() returns true.
|
overridevirtual |
Transforms the coordinates and the pattern origin.
Implements OpenOrienteering::Object.
|
overrideprotectedvirtual |
Reimplemented from OpenOrienteering::Object.
void OpenOrienteering::PathObject::updatePathCoords | ( | ) | const |
Called by Object::update()
|
overridevirtual |
Reimplemented from OpenOrienteering::Object.
|
friend |