4 using namespace entity;
10 double const lineSpacingFactor,
12 std::string
const& explicitValue,
15 const Layer_CSPtr layer,
16 const MetaInfo_CSPtr metaInfo,
17 const Block_CSPtr block) :
19 Dimension(definitionPoint, middleOfText, attachmentPoint, angle, lineSpacingFactor, lineSpacingStyle, explicitValue),
21 _definitionPoint2(definitionPoint2) {
27 double const lineSpacingFactor,
29 std::string
const& explicitValue,
32 const Layer_CSPtr layer,
33 const MetaInfo_CSPtr metaInfo,
34 const Block_CSPtr block) :
36 Dimension(definitionPoint, definitionPoint.mid(definitionPoint2), attachmentPoint, 0., lineSpacingFactor, lineSpacingStyle, explicitValue),
38 _definitionPoint2(definitionPoint2) {
44 _leader(other->_leader),
45 _definitionPoint2(other->definitionPoint2()) {
50 auto newDimDiametric = std::make_shared<DimDiametric>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2 + offset, this->
_leader, this->
layer(), this->
metaInfo());
51 newDimDiametric->setID(this->
id());
52 return newDimDiametric;
56 auto newDimDiametric = std::make_shared<DimDiametric>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2 + offset, this->
_leader, this->
layer(), this->
metaInfo());
57 return newDimDiametric;
61 auto newDimDiametric = std::make_shared<DimDiametric>(this->
definitionPoint().
rotate(rotation_center, rotation_angle),
62 this->
middleOfText().
rotate(rotation_center, rotation_angle), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2.
rotate(rotation_center, rotation_angle), this->
_leader, this->
layer(), this->
metaInfo());
63 return newDimDiametric;
67 auto newDimDiametric = std::make_shared<DimDiametric>(this->
definitionPoint().
scale(scale_center, scale_factor),
68 this->
middleOfText().
scale(scale_center, scale_factor), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2.
scale(scale_center, scale_factor), this->
_leader, this->
layer(), this->
metaInfo());
69 return newDimDiametric;
74 this->
middleOfText().
mirror(axis1, axis2), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2.
mirror(axis1, axis2), this->
_leader, this->
layer(), this->
metaInfo());
75 return newDimDiametric;
83 CADEntity_CSPtr
DimDiametric::modify(Layer_CSPtr layer,
const MetaInfo_CSPtr metaInfo, Block_CSPtr block)
const {
84 auto newDimDiametric = std::make_shared<DimDiametric>(
99 return newDimDiametric;
111 std::map<unsigned int, geo::Coordinate>
dragPoints;
123 auto newEntity = std::make_shared<DimDiametric>(dragPoints.at(0),
134 newEntity->setID(
id());
137 catch(std::out_of_range& e) {
138 return shared_from_this();
Coordinate mirror(const Coordinate &axis1, const Coordinate &axis2) const
mirror a coordinate
virtual CADEntity_CSPtr setDragPoints(std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override
Return modified entity.
virtual CADEntity_CSPtr move(const geo::Coordinate &offset) const override
move, moves by an offset
TextConst::LineSpacingStyle lineSpacingStyle() const
const geo::Coordinate & definitionPoint() const noexcept
move, moves by an offset
std::string explicitValue() const
Layer_CSPtr layer() const
layer return the layer this entity is placed on
Coordinate scale(const double &scale_factor) const
const geo::Coordinate _definitionPoint2
MetaInfo_CSPtr metaInfo() const
virtual CADEntity_CSPtr mirror(const geo::Coordinate &axis1, const geo::Coordinate &axis2) const override
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override
scale, scales the entity
const geo::Coordinate & middleOfText() const noexcept
virtual std::map< unsigned int, lc::geo::Coordinate > dragPoints() const override
Get all points of the entity that can be dragged.
TextConst::AttachmentPoint const & attachmentPoint() const
Coordinate rotate(const Coordinate &angleVector) const
rotate around (0.,0.) with a given angle vector
virtual CADEntity_CSPtr rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const override
rotate, rotate operation
double lineSpacingFactor() const
Block_CSPtr block() const
Return the current entity block.
virtual CADEntity_CSPtr copy(const geo::Coordinate &offset) const override
copy, copies by an offset
DimDiametric(geo::Coordinate const &definitionPoint, geo::Coordinate const &middleOfText, TextConst::AttachmentPoint const &attachmentPoint, double angle, double const lineSpacingFactor, TextConst::LineSpacingStyle const &lineSpacingStyle, std::string const &explicitValue, geo::Coordinate const &definitionPoint2, const double leader, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
DimDiametric.
geo::Coordinate definitionPoint2() const
virtual const geo::Area boundingBox() const override
boundingBox of the entity
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 informat...