Mapper  0.9.0
API documentation
Public Member Functions | Friends | List of all members
OpenOrienteering::OcdFileImport::OcdImportedPathObject Class Reference

#include <ocd_file_import.h>

Inheritance diagram for OpenOrienteering::OcdFileImport::OcdImportedPathObject:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::OcdFileImport::OcdImportedPathObject:
Collaboration graph
[legend]

Public Member Functions

 OcdImportedPathObject (Symbol *symbol=nullptr)
 
 OcdImportedPathObject (const OcdImportedPathObject &)=delete
 
 OcdImportedPathObject (OcdImportedPathObject &&)=delete
 
OcdImportedPathObjectoperator= (const OcdImportedPathObject &)=delete
 
OcdImportedPathObjectoperator= (OcdImportedPathObject &&)=delete
 
 ~OcdImportedPathObject () override
 
- Public Member Functions inherited from OpenOrienteering::PathObject
 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...
 
PathObjectduplicate () const override
 Creates a duplicate of the path object. More...
 
PathObjectoperator= (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...
 
MapCoordgetCoordinateRef (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 PathPartVectorparts () const
 Returns the vector of path parts. More...
 
PathPartVectorparts ()
 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...
 
- Public Member Functions inherited from OpenOrienteering::Object
 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...
 
Objectoperator= (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...
 
PointObjectasPoint ()
 Convenience cast to PointObject with type checking. More...
 
const PointObjectasPoint () const
 Convenience cast to PointObject with type checking. More...
 
PathObjectasPath ()
 Convenience cast to PathObject with type checking. More...
 
const PathObjectasPath () const
 Convenience cast to PathObject with type checking. More...
 
TextObjectasText ()
 Convenience cast to TextObject with type checking. More...
 
const TextObjectasText () 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 &center, 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 &center, 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 ObjectRenderablesrenderables () const
 Returns the renderables, read-only. More...
 
const MapCoordVectorgetRawCoordinateVector () 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 SymbolgetSymbol () const
 Returns the object's symbol. More...
 
const QRectFgetExtent () const
 NOTE: The extent is only valid after update() has been called! More...
 
void setMap (Map *map)
 Sets the object's map pointer. More...
 
MapgetMap () const
 Returns the object's map pointer. More...
 
const Tagstags () 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...
 

Friends

class OcdFileImport
 

Additional Inherited Members

- Public Types inherited from OpenOrienteering::Object
enum  Type { Point = 0, Path = 1, Text = 4 }
 Enumeration of possible object types. More...
 
typedef QHash< QString, QStringTags
 Defines a type which maps keys to values, to be used for tagging objects. More...
 
- Static Public Member Functions inherited from OpenOrienteering::Object
static Objectload (QXmlStreamReader &xml, Map *map, const SymbolDictionary &symbol_dict, const Symbol *symbol=nullptr)
 Loads the object in xml format from the given stream. More...
 
static ObjectgetObjectForType (Type type, const Symbol *symbol=nullptr)
 Constructs an object of the given type with the given symbol. More...
 
- Protected Member Functions inherited from OpenOrienteering::PathObject
 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
 
- Protected Member Functions inherited from OpenOrienteering::Object
 Object (const Object &proto)
 Constructs a Object, initialized from the given prototype. More...
 
- Static Protected Member Functions inherited from OpenOrienteering::PathObject
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...
 
- Protected Attributes inherited from OpenOrienteering::Object
Type type
 
const Symbolsymbol = nullptr
 
MapCoordVector coords
 
Mapmap = nullptr
 
Tags object_tags
 

Constructor & Destructor Documentation

◆ OcdImportedPathObject() [1/3]

OpenOrienteering::OcdFileImport::OcdImportedPathObject::OcdImportedPathObject ( Symbol symbol = nullptr)
inline

◆ OcdImportedPathObject() [2/3]

OpenOrienteering::OcdFileImport::OcdImportedPathObject::OcdImportedPathObject ( const OcdImportedPathObject )
delete

◆ OcdImportedPathObject() [3/3]

OpenOrienteering::OcdFileImport::OcdImportedPathObject::OcdImportedPathObject ( OcdImportedPathObject &&  )
delete

◆ ~OcdImportedPathObject()

OpenOrienteering::OcdFileImport::OcdImportedPathObject::~OcdImportedPathObject ( )
overridedefault

Member Function Documentation

◆ operator=() [1/2]

OcdImportedPathObject& OpenOrienteering::OcdFileImport::OcdImportedPathObject::operator= ( const OcdImportedPathObject )
delete

◆ operator=() [2/2]

OcdImportedPathObject& OpenOrienteering::OcdFileImport::OcdImportedPathObject::operator= ( OcdImportedPathObject &&  )
delete

Friends And Related Function Documentation

◆ OcdFileImport

friend class OcdFileImport
friend

The documentation for this class was generated from the following files: