LibreCAD
|
#include <insert.h>
Public Member Functions | |
Insert (Insert_CSPtr other, bool sameID=false) | |
~Insert () | |
const Block_CSPtr & | displayBlock () const |
const geo::Coordinate & | position () const |
const Document_SPtr & | document () const |
CADEntity_CSPtr | move (const geo::Coordinate &offset) const override |
Function for Move. More... | |
CADEntity_CSPtr | copy (const geo::Coordinate &offset) const override |
Function for Copy. More... | |
CADEntity_CSPtr | rotate (const geo::Coordinate &rotation_center, const double rotation_angle) const override |
Function implementation for rotate. More... | |
CADEntity_CSPtr | scale (const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override |
Function implementation for Scale. More... | |
CADEntity_CSPtr | mirror (const geo::Coordinate &axis1, const geo::Coordinate &axis2) const override |
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... | |
const geo::Area | boundingBox () const override |
boundingBox Return the bounding box of this entity. This should be as tight around the entity as possible but care should be taken that this routine is also as fast as possible. in essence, favor speed over tightness. This routine will in generally be used during testing if entities cross for example to find snap points and to build relationships of tree for example using quad trees More... | |
void | dispatch (EntityDispatch &dispatch) const override |
std::map< unsigned int, geo::Coordinate > | dragPoints () const override |
Get all points of the entity that can be dragged. More... | |
CADEntity_CSPtr | setDragPoints (std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override |
Return modified entity. More... | |
virtual std::vector < EntityCoordinate > | snapPoints (const geo::Coordinate &coord, const SimpleSnapConstrain &simpleSnapConstrain, 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... | |
![]() | |
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 |
virtual void | accept (GeoEntityVisitor &v) const override |
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 |
Protected Member Functions | |
Insert (const builder::InsertBuilder &builder) | |
![]() | |
CADEntity (const lc::builder::CADEntityBuilder &builder) | |
Private Member Functions | |
void | calculateBoundingBox () |
void | on_addEntityEvent (const lc::AddEntityEvent &) |
void | on_removeEntityEvent (const lc::RemoveEntityEvent &) |
Private Attributes | |
Document_SPtr | _document |
geo::Coordinate | _position |
Block_CSPtr | _displayBlock |
geo::Area | _boundingBox |
Friends | |
class | builder::InsertBuilder |
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 |
Insert::Insert | ( | Insert_CSPtr | other, |
bool | sameID = false |
||
) |
Definition at line 6 of file insert.cpp.
Insert::~Insert | ( | ) |
Definition at line 30 of file insert.cpp.
|
protected |
Definition at line 18 of file insert.cpp.
|
overridevirtual |
boundingBox Return the bounding box of this entity. This should be as tight around the entity as possible but care should be taken that this routine is also as fast as possible. in essence, favor speed over tightness. This routine will in generally be used during testing if entities cross for example to find snap points and to build relationships of tree for example using quad trees
Implements lc::entity::CADEntity.
Definition at line 72 of file insert.cpp.
|
private |
Definition at line 133 of file insert.cpp.
|
overridevirtual |
Function for Copy.
offset | the offset by which entity is to be copied |
Implements lc::entity::CADEntity.
Definition at line 50 of file insert.cpp.
|
overridevirtual |
const Block_CSPtr & Insert::displayBlock | ( | ) | const |
Definition at line 35 of file insert.cpp.
const Document_SPtr & Insert::document | ( | ) | const |
Definition at line 129 of file insert.cpp.
|
overridevirtual |
Get all points of the entity that can be dragged.
Implements lc::Draggable.
Definition at line 91 of file insert.cpp.
|
overridevirtual |
Implements lc::entity::CADEntity.
Definition at line 67 of file insert.cpp.
|
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 76 of file insert.cpp.
|
overridevirtual |
Function for Move.
offset | the offset by which entity is to be moved |
Implements lc::entity::CADEntity.
Definition at line 43 of file insert.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.
Reimplemented in lc::entity::CustomEntity.
Definition at line 125 of file insert.cpp.
|
private |
Definition at line 153 of file insert.cpp.
|
private |
Definition at line 159 of file insert.cpp.
const geo::Coordinate & Insert::position | ( | ) | const |
Definition at line 39 of file insert.cpp.
|
overridevirtual |
Function implementation for rotate.
angle | angle by which the entity is to be rotated. |
Implements lc::entity::CADEntity.
Definition at line 57 of file insert.cpp.
|
overridevirtual |
Function implementation for Scale.
scale_center | |
scale_factor |
Implements lc::entity::CADEntity.
Definition at line 62 of file insert.cpp.
|
overridevirtual |
Return modified entity.
dragPoints | Modified points |
Implements lc::Draggable.
Definition at line 99 of file insert.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.
Reimplemented in lc::entity::CustomEntity.
Definition at line 111 of file insert.cpp.
|
friend |
|
private |