5 using namespace entity;
12 double const lineSpacingFactor,
14 std::string
const& explicitValue,
19 const Layer_CSPtr layer,
20 const MetaInfo_CSPtr metaInfo,
21 const Block_CSPtr block) :
23 Dimension(definitionPoint, middleOfText, attachmentPoint, textAngle, lineSpacingFactor, lineSpacingStyle, explicitValue),
24 _defLine11(defLine11),
25 _defLine12(defLine12),
26 _defLine21(defLine21),
27 _defLine22(defLine22) {
35 _defLine11(other->_defLine11),
36 _defLine12(other->_defLine12),
37 _defLine21(other->_defLine21),
38 _defLine22(other->_defLine22) {
45 std::string
const& explicitValue,
46 const Layer_CSPtr layer,
47 const MetaInfo_CSPtr metaInfo,
48 const Block_CSPtr block) {
51 return std::make_shared<DimAngular>(center,
53 TextConst::AttachmentPoint::Top_center,
56 TextConst::LineSpacingStyle::AtLeast,
70 auto newDimAngular = std::make_shared<DimAngular>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_defLine11 + offset, this->
_defLine12 + offset, this->
_defLine21 + offset, this->
_defLine22 + offset, this->
layer(), this->
metaInfo());
71 newDimAngular->setID(this->
id());
76 auto newDimAngular = std::make_shared<DimAngular>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_defLine11 + offset, this->
_defLine12 + offset, this->
_defLine21 + offset, this->
_defLine22 + offset, this->
layer(), this->
metaInfo());
81 auto newDimAngular = std::make_shared<DimAngular>(this->
definitionPoint().
rotate(rotation_center, rotation_angle),
82 this->
middleOfText().
rotate(rotation_center, rotation_angle), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_defLine11.
rotate(rotation_center, rotation_angle), this->
_defLine12.
rotate(rotation_center, rotation_angle), this->
_defLine21.
rotate(rotation_center, rotation_angle), this->
_defLine22.
rotate(rotation_center, rotation_angle), this->
layer(), this->
metaInfo());
87 auto newDimAngular = std::make_shared<DimAngular>(this->
definitionPoint().
scale(scale_center, scale_factor),
88 this->
middleOfText().
scale(scale_center, scale_factor), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_defLine11.
scale(scale_center, scale_factor), this->
_defLine12.
scale(scale_center, scale_factor), this->
_defLine21.
scale(scale_center, scale_factor), this->
_defLine22.
scale(scale_center, scale_factor), this->
layer(), this->
metaInfo());
94 this->
middleOfText().
mirror(axis1,axis2), this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_defLine11.
mirror(axis1,axis2), this->
_defLine12.
mirror(axis1,axis2), this->
_defLine21.
mirror(axis1,axis2), this->
_defLine22.
mirror(axis1,axis2), this->
layer(), this->
metaInfo());
103 CADEntity_CSPtr
DimAngular::modify(Layer_CSPtr layer,
const MetaInfo_CSPtr metaInfo, Block_CSPtr block)
const {
104 auto newDimAngular = std::make_shared<DimAngular>(
121 return newDimAngular;
141 std::map<unsigned int, geo::Coordinate>
dragPoints;
156 auto newEntity = std::make_shared<DimAngular>(dragPoints.at(0),
169 newEntity->setID(
id());
172 catch(std::out_of_range& e) {
173 return shared_from_this();
Coordinate mirror(const Coordinate &axis1, const Coordinate &axis2) const
mirror a coordinate
geo::Coordinate defLine21() const
virtual CADEntity_CSPtr rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const override
rotate, rotate operation
DimAngular(geo::Coordinate const &definitionPoint, geo::Coordinate const &middleOfText, TextConst::AttachmentPoint const &attachmentPoint, double textAngle, double const lineSpacingFactor, TextConst::LineSpacingStyle const &lineSpacingStyle, std::string const &explicitValue, geo::Coordinate const &_defLine11, geo::Coordinate const &_defLine12, geo::Coordinate const &_defLine21, geo::Coordinate const &_defLine22, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
virtual CADEntity_CSPtr setDragPoints(std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override
Return modified entity.
Coordinate mid(const Coordinate &other) const
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...
const geo::Coordinate _defLine21
TextConst::LineSpacingStyle lineSpacingStyle() const
const geo::Coordinate & definitionPoint() const noexcept
move, moves by an offset
const geo::Coordinate _defLine22
geo::Coordinate defLine12() const
std::string explicitValue() const
Layer_CSPtr layer() const
layer return the layer this entity is placed on
virtual CADEntity_CSPtr mirror(const geo::Coordinate &axis1, const geo::Coordinate &axis2) const override
static DimAngular_SPtr dimAuto(geo::Coordinate const ¢er, geo::Coordinate const &p1, geo::Coordinate const &p2, std::string const &explicitValue, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
geo::Coordinate defLine11() const
Coordinate scale(const double &scale_factor) const
MetaInfo_CSPtr metaInfo() const
const geo::Coordinate & middleOfText() const noexcept
TextConst::AttachmentPoint const & attachmentPoint() const
const geo::Coordinate _defLine11
Coordinate rotate(const Coordinate &angleVector) const
rotate around (0.,0.) with a given angle vector
virtual const geo::Area boundingBox() const override
boundingBox of the entity
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
const geo::Coordinate _defLine12
virtual std::map< unsigned int, lc::geo::Coordinate > dragPoints() const override
Get all points of the entity that can be dragged.
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override
scale, scales the entity
virtual CADEntity_CSPtr move(const geo::Coordinate &offset) const override
move, moves by an offset
geo::Coordinate defLine22() const