![]() |
Mapper
0.9.0
API documentation
|
Implements the logic to move sets of objects and / or object points for edit tools. More...
#include <object_mover.h>
Public Types | |
enum | HandleOpMode { Never, Click } |
Public Member Functions | |
ObjectMover (Map *map, const MapCoordF &start_pos) | |
Creates a mover for the map with the given cursor start position. More... | |
void | setStartPos (const MapCoordF &start_pos) |
Sets the start position. More... | |
void | setCornerTolerance (qreal corner_tolerance) |
Sets corner point tolerance. More... | |
void | addObject (Object *object) |
Adds an object to the set of elements to move. More... | |
void | addPoint (PathObject *object, MapCoordVector::size_type point_index) |
Adds a point to the set of elements to move. More... | |
void | addLine (PathObject *object, MapCoordVector::size_type start_point_index) |
Adds a line to the set of elements to move. More... | |
void | addTextHandle (TextObject *text, MapCoordVector::size_type handle) |
Adds a text handle to the set of elements to move. More... | |
void | move (const MapCoordF &cursor_pos, HandleOpMode move_opposite_handles, qint32 *out_dx=nullptr, qint32 *out_dy=nullptr) |
Moves the elements. More... | |
void | move (qint32 dx, qint32 dy, HandleOpMode move_opposite_handles) |
Overload of move() taking delta values. More... | |
Implements the logic to move sets of objects and / or object points for edit tools.
Creates a mover for the map with the given cursor start position.
void OpenOrienteering::ObjectMover::addLine | ( | PathObject * | object, |
MapCoordVector::size_type | start_point_index | ||
) |
Adds a line to the set of elements to move.
void OpenOrienteering::ObjectMover::addObject | ( | Object * | object | ) |
Adds an object to the set of elements to move.
void OpenOrienteering::ObjectMover::addPoint | ( | PathObject * | object, |
MapCoordVector::size_type | point_index | ||
) |
Adds a point to the set of elements to move.
void OpenOrienteering::ObjectMover::addTextHandle | ( | TextObject * | text, |
MapCoordVector::size_type | handle | ||
) |
Adds a text handle to the set of elements to move.
void OpenOrienteering::ObjectMover::move | ( | const MapCoordF & | cursor_pos, |
HandleOpMode | move_opposite_handles, | ||
qint32 * | out_dx = nullptr , |
||
qint32 * | out_dy = nullptr |
||
) |
Moves the elements.
move_opposite_handles | Opposite curve handles either operate in "click in" mode or move independently. |
out_dx | returns the move along the x coordinate in map units |
out_dy | returns the move along the y coordinate in map units |
void OpenOrienteering::ObjectMover::move | ( | qint32 | dx, |
qint32 | dy, | ||
HandleOpMode | move_opposite_handles | ||
) |
Overload of move() taking delta values.
void OpenOrienteering::ObjectMover::setCornerTolerance | ( | qreal | corner_tolerance | ) |
Sets corner point tolerance.
A curve anchor point is considered a corner point during editing when the moving curve handle is more than corner_tolerance away from the direction line set by the opposite handle.
corner_tolerance | Maximum difference in vector directions in millimeters. |
void OpenOrienteering::ObjectMover::setStartPos | ( | const MapCoordF & | start_pos | ) |
Sets the start position.