LibreCAD
|
A ellipse that can be put in a drawing. More...
#include <ellipse.h>
Public Member Functions | |
Ellipse (const geo::Coordinate ¢er, const geo::Coordinate &majorP, double minorRadius, double startAngle, double endAngle, bool reversed, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr) | |
Create ellipse. More... | |
Ellipse (const Ellipse_CSPtr other, bool sameID=false) | |
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< lc::geo::Coordinate > | findBoxPoints () const |
virtual std::vector < EntityCoordinate > | snapPoints (const geo::Coordinate &coord, const SimpleSnapConstrain &constrain, double minDistanceToSnap, int maxNumberOfSnapPoints) const override |
see interface Snapable 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... | |
virtual void | accept (GeoEntityVisitor &v) const override |
virtual void | dispatch (EntityDispatch &ed) const override |
Public Member Functions inherited from lc::entity::CADEntity | |
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... | |
Public Member Functions inherited from lc::ID | |
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) |
Public Member Functions inherited from lc::Visitable | |
virtual | ~Visitable ()=default |
Public Member Functions inherited from lc::geo::Ellipse | |
Ellipse (const Coordinate ¢er, const Coordinate &majorP, double minorRadius, double startAngle, double endAngle, bool reversed=false) | |
const Coordinate | center () const |
center, Returns Center point of Ellipse More... | |
const Coordinate | majorP () const |
majorP, Returns major point of the ellipse, relative to center More... | |
double | minorRadius () const |
minorRadius, Returns the minor radius of ellipse More... | |
double | startAngle () const |
startAngle, Returns Start elliptic!! angle of ellipse More... | |
double | endAngle () const |
endAngle, Return the end elliptic!! angle of ellipse More... | |
Coordinate | getPoint (const double &angle) const |
getPoint, return a point on ellipse with given elliptic angle More... | |
Coordinate | startPoint () const |
startPoint, start point of ellipse More... | |
Coordinate | endPoint () const |
endPoint, end point of ellipse More... | |
std::vector< Coordinate > | findPotentialNearestPoints (const Coordinate &coord) const |
findPotentialNearestPoints More... | |
Coordinate | nearestPointOnPath (const Coordinate &coord) const |
nearestPointOnPath, (ignore if it arc) More... | |
Coordinate | nearestPointOnEntity (const Coordinate &coord) const |
nearestPointOnEntity, ( not ignore arc) More... | |
bool | isArc () const |
isArc More... | |
bool | isReversed () const |
double | ratio () const |
ratio of major radius to minor radius More... | |
double | majorRadius () const |
Major Radius. More... | |
double | getAngle () const |
getAngle of MajorP More... | |
double | getEllipseAngle (const Coordinate &coord) const |
getEllipseAngle More... | |
bool | isAngleBetween (double angle) const |
Ellipse | georotate (const Coordinate ¢er, const double rotation_angle) const |
rotate an ellipse at a center by an angle More... | |
Ellipse | geoscale (const Coordinate ¢er, const Coordinate &factor) const |
scale an ellipse at some center by some factor More... | |
const maths::Equation | equation () const |
Returns the quadratic equation. More... | |
Public Member Functions inherited from lc::geo::Base | |
virtual | ~Base ()=default |
Additional Inherited Members | |
Static Public Member Functions inherited from lc::Snapable | |
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 Public Attributes inherited from lc::ID | |
static std::atomic< ID_DATATYPE > | __idCounter |
Protected Member Functions inherited from lc::entity::CADEntity | |
CADEntity (const lc::builder::CADEntityBuilder &builder) | |
A ellipse that can be put in a drawing.
A Ellipse is a graphics elipse item that can be put on a drawing using a CreateEntity operation.
Ellipse::Ellipse | ( | const geo::Coordinate & | center, |
const geo::Coordinate & | majorP, | ||
double | minorRadius, | ||
double | startAngle, | ||
double | endAngle, | ||
bool | reversed, | ||
const Layer_CSPtr | layer, | ||
const MetaInfo_CSPtr | metaInfo = nullptr , |
||
const Block_CSPtr | block = nullptr |
||
) |
Create ellipse.
center | |
majorP | relative to center |
minorRadius | |
startAngle | |
endAngle | |
reversed | |
layer | |
metaInfo | |
block |
Definition at line 9 of file ellipse.cpp.
Ellipse::Ellipse | ( | const Ellipse_CSPtr | other, |
bool | sameID = false |
||
) |
Definition at line 22 of file ellipse.cpp.
|
inlineoverridevirtual |
Reimplemented from lc::entity::CADEntity.
|
overridevirtual |
boundingBox of the entity
Implements lc::entity::CADEntity.
Definition at line 112 of file ellipse.cpp.
|
overridevirtual |
copy, copies by an offset
geo::Coordinate | offset |
Implements lc::entity::CADEntity.
Definition at line 42 of file ellipse.cpp.
|
inlineoverridevirtual |
Implements lc::entity::CADEntity.
std::vector< lc::geo::Coordinate > Ellipse::findBoxPoints | ( | ) | const |
Definition at line 158 of file ellipse.cpp.
|
overridevirtual |
Implements lc::entity::CADEntity.
Definition at line 87 of file ellipse.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 139 of file ellipse.cpp.
|
overridevirtual |
move, moves by an offset
geo::Coordinate | offset |
Implements lc::entity::CADEntity.
Definition at line 29 of file ellipse.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 282 of file ellipse.cpp.
|
overridevirtual |
rotate, rotate operation
geo::Coordinate | rotation_center |
double | rotation_angle |
Implements lc::entity::CADEntity.
Definition at line 54 of file ellipse.cpp.
|
overridevirtual |
scale, scales the entity
geo::Coordinate | scale_center |
double | scale_factor |
Implements lc::entity::CADEntity.
Definition at line 70 of file ellipse.cpp.
|
overridevirtual |
see interface Snapable
Implements lc::Snapable.
Definition at line 226 of file ellipse.cpp.