LibreCAD
|
#include <lwpolyline.h>
Public Member Functions | |
LWPolyline (const std::vector< LWVertex2D > &vertex, double width, double elevation, double tickness, bool closed, geo::Coordinate const &extrusionDirection, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr) | |
LWPolyline (const LWPolyline_CSPtr other, bool sameID=false) | |
double | width () const |
double | elevation () const |
double | tickness () const |
geo::Coordinate const & | extrusionDirection () const |
std::vector< LWVertex2D > const & | vertex () const |
bool | closed () const |
virtual std::vector < EntityCoordinate > | snapPoints (const geo::Coordinate &coord, const SimpleSnapConstrain &constrain, double minDistanceToSnap, int maxNumberOfSnapPoints) const override |
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 override |
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... | |
std::tuple< geo::Coordinate, std::shared_ptr< const geo::Vector >, std::shared_ptr < const geo::Arc > > | nearestPointOnPath2 (const geo::Coordinate &coord) const |
virtual CADEntity_CSPtr | move (const geo::Coordinate &offset) const override |
move, moves by an offset More... | |
virtual CADEntity_CSPtr | copy (const geo::Coordinate &offset) const override |
copy, copies by an offset More... | |
virtual CADEntity_CSPtr | rotate (const geo::Coordinate &rotation_center, const double rotation_angle) const override |
rotate, rotate operation More... | |
virtual CADEntity_CSPtr | scale (const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override |
scale, scales the entity More... | |
virtual CADEntity_CSPtr | mirror (const geo::Coordinate &axis1, const geo::Coordinate &axis2) const override |
virtual const geo::Area | boundingBox () const override |
boundingBox of the entity More... | |
virtual CADEntity_CSPtr | modify (Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo, Block_CSPtr block) const override |
modify Return a new entity with the same ID bit with possible modified metainfo and/pr layer information #return new entity with same ID More... | |
std::vector< CADEntity_CSPtr > const | asEntities () const |
virtual void | accept (GeoEntityVisitor &v) const override |
virtual void | dispatch (EntityDispatch &ed) const override |
virtual std::map< unsigned int, lc::geo::Coordinate > | dragPoints () const override |
Get all points of the entity that can be dragged. More... | |
virtual CADEntity_CSPtr | setDragPoints (std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override |
Return modified entity. More... | |
![]() | |
CADEntity () | |
CADEntity (Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr) | |
CADEntity Constructor. More... | |
CADEntity (CADEntity_CSPtr cadEntity, bool sameID) | |
CADEntity (CADEntity_CSPtr cadEntity) | |
virtual | ~CADEntity ()=default |
Layer_CSPtr | layer () const |
layer return the layer this entity is placed on More... | |
template<typename T > | |
const std::shared_ptr< const T > | metaInfo (std::string metaName) const |
MetaInfo_CSPtr | metaInfo () const |
Block_CSPtr | block () const |
Return the current entity block. More... | |
![]() | |
ID () | |
Default constructor, provides a new unique ID to each entity. More... | |
ID (ID_DATATYPE) | |
virtual | ~ID ()=default |
ID_DATATYPE | id () const |
returns the ID of the entity More... | |
bool | operator== (const ID &id) const |
void | setID (ID_DATATYPE id) |
![]() | |
virtual | ~Visitable ()=default |
Private Member Functions | |
void | generateEntities () |
Generate entities of the polyline. More... | |
Private Attributes | |
const std::vector< LWVertex2D > | _vertex |
const double | _width |
const double | _elevation |
const double | _tickness |
const bool | _closed |
const geo::Coordinate | _extrusionDirection |
std::vector< CADEntity_CSPtr > | _entities |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
static std::atomic< ID_DATATYPE > | __idCounter |
![]() | |
CADEntity (const lc::builder::CADEntityBuilder &builder) | |
Lightweight polyline
Definition at line 86 of file lwpolyline.h.
LWPolyline::LWPolyline | ( | const std::vector< LWVertex2D > & | vertex, |
double | width, | ||
double | elevation, | ||
double | tickness, | ||
bool | closed, | ||
geo::Coordinate const & | extrusionDirection, | ||
const Layer_CSPtr | layer, | ||
const MetaInfo_CSPtr | metaInfo = nullptr , |
||
const Block_CSPtr | block = nullptr |
||
) |
LWPolyline Constructor
width | of the vertex on each entity |
elevation | of the polyline |
tickness | of the polyline |
extrusionDirection | of the polyline |
vertex | entries of the polyline |
layer | |
metaInfo |
Definition at line 15 of file lwpolyline.cpp.
LWPolyline::LWPolyline | ( | const LWPolyline_CSPtr | other, |
bool | sameID = false |
||
) |
Definition at line 36 of file lwpolyline.cpp.
|
inlineoverridevirtual |
Reimplemented from lc::entity::CADEntity.
Definition at line 213 of file lwpolyline.h.
std::vector< CADEntity_CSPtr > const LWPolyline::asEntities | ( | ) | const |
Return a vector of entities for this polyline The vector will contain entity::vector and entity::Arc items
Definition at line 299 of file lwpolyline.cpp.
|
overridevirtual |
boundingBox of the entity
Implements lc::entity::CADEntity.
Definition at line 92 of file lwpolyline.cpp.
|
inline |
Definition at line 133 of file lwpolyline.h.
|
overridevirtual |
copy, copies by an offset
geo::Coordinate | offset |
Implements lc::entity::CADEntity.
Definition at line 57 of file lwpolyline.cpp.
|
inlineoverridevirtual |
Implements lc::entity::CADEntity.
Definition at line 215 of file lwpolyline.h.
|
overridevirtual |
Get all points of the entity that can be dragged.
Implements lc::Draggable.
Definition at line 267 of file lwpolyline.cpp.
|
inline |
Definition at line 117 of file lwpolyline.h.
|
inline |
Definition at line 125 of file lwpolyline.h.
|
private |
Generate entities of the polyline.
Definition at line 126 of file lwpolyline.cpp.
|
inlineoverridevirtual |
Implements lc::entity::CADEntity.
Definition at line 193 of file lwpolyline.h.
|
overridevirtual |
modify Return a new entity with the same ID bit with possible modified metainfo and/pr layer information #return new entity with same ID
Implements lc::entity::CADEntity.
Definition at line 109 of file lwpolyline.cpp.
|
overridevirtual |
move, moves by an offset
geo::Coordinate | offset |
Implements lc::entity::CADEntity.
Definition at line 46 of file lwpolyline.cpp.
|
overridevirtual |
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 |
Implements lc::Snapable.
Definition at line 229 of file lwpolyline.cpp.
std::tuple< geo::Coordinate, std::shared_ptr< const geo::Vector >, std::shared_ptr< const geo::Arc > > LWPolyline::nearestPointOnPath2 | ( | const geo::Coordinate & | coord | ) | const |
Definition at line 234 of file lwpolyline.cpp.
|
overridevirtual |
rotate, rotate operation
geo::Coordinate | rotation_center |
double | rotation_angle |
Implements lc::entity::CADEntity.
Definition at line 67 of file lwpolyline.cpp.
|
overridevirtual |
scale, scales the entity
geo::Coordinate | scale_center |
double | scale_factor |
Implements lc::entity::CADEntity.
Definition at line 78 of file lwpolyline.cpp.
|
overridevirtual |
Return modified entity.
dragPoints | Modified points |
Implements lc::Draggable.
Definition at line 280 of file lwpolyline.cpp.
|
overridevirtual |
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 |
Implements lc::Snapable.
Definition at line 162 of file lwpolyline.cpp.
|
inline |
Definition at line 121 of file lwpolyline.h.
|
inline |
Definition at line 129 of file lwpolyline.h.
|
inline |
Definition at line 113 of file lwpolyline.h.
|
private |
Definition at line 156 of file lwpolyline.h.
|
private |
Definition at line 154 of file lwpolyline.h.
|
private |
Definition at line 158 of file lwpolyline.h.
|
private |
Definition at line 157 of file lwpolyline.h.
|
private |
Definition at line 155 of file lwpolyline.h.
|
private |
Definition at line 152 of file lwpolyline.h.
|
private |
Definition at line 153 of file lwpolyline.h.