LibreCAD
|
#include <snapable.h>
Public Member Functions | |
virtual std::vector < lc::EntityCoordinate > | snapPoints (const geo::Coordinate &coord, const SimpleSnapConstrain &simpleSnapConstrain, double minDistanceToSnap, int maxNumberOfSnapPoints) const =0 |
Find a number of snap points the line has available This function returns a ordered list, closest to coord and can return multiple snap points. More... | |
virtual geo::Coordinate | nearestPointOnPath (const geo::Coordinate &coord) const =0 |
Find the nearest point on the path for this entity for the coordinate coord The path of a entity that it can possibly take. More... | |
Static Public Member Functions | |
static void | remove_ifDistanceGreaterThen (std::vector< EntityCoordinate > &points, const geo::Coordinate &reference, const double distance) |
static void | snapPointsCleanup (std::vector< EntityCoordinate > &points, const geo::Coordinate &reference, const unsigned int maxNumberOfSnapPoints, const double minDistanceToSnap) |
Any entity that we can snap against needs to implement the snapable interface
Definition at line 13 of file snapable.h.
|
pure virtual |
Find the nearest point on the path for this entity for the coordinate coord The path of a entity that it can possibly take.
For example for any Arc the path is the full circle if the start/stop angle is 0 to 2*pi
coord | Coordinate to lookup the nearest coordinate from |
Implemented in lc::entity::LWPolyline, lc::entity::Ellipse, lc::entity::Arc, lc::entity::Line, lc::entity::Spline, lc::entity::Image, lc::entity::Insert, lc::entity::Circle, and lc::entity::CustomEntity.
|
inlinestatic |
Remove point's from vector if the distance to references is > distance
Definition at line 39 of file snapable.h.
|
pure virtual |
Find a number of snap points the line has available This function returns a ordered list, closest to coord and can return multiple snap points.
coord | Coordinate to lookup the nearest coordinate from |
minDistanceToSnap | Minimum distance to the path to snap into. THis is a hint parameter and we should follow this, but it will be later filtered again |
maxNumberOfSnapPoints | Maximum number of snappoints that have to be looked up |
Implemented in lc::entity::LWPolyline, lc::entity::Ellipse, lc::entity::Arc, lc::entity::Line, lc::entity::Spline, lc::entity::Image, lc::entity::Insert, lc::entity::Circle, and lc::entity::CustomEntity.
|
inlinestatic |
Use this function in your snapPoints function to cleanup any additional point's and confirm to the requirements of maxNumberOfSnapPoints and minDistanceToSnap
Definition at line 53 of file snapable.h.