4 using namespace entity;
10 double const lineSpacingFactor,
12 std::string
const& explicitValue,
17 const Layer_CSPtr layer,
18 const MetaInfo_CSPtr metaInfo,
19 const Block_CSPtr block) :
21 Dimension(definitionPoint, middleOfText, attachmentPoint, textAngle, lineSpacingFactor, lineSpacingStyle, explicitValue),
24 _definitionPoint2(definitionPoint2),
25 _definitionPoint3(definitionPoint3) {
33 _angle(other->_angle),
34 _oblique(other->_oblique),
35 _definitionPoint2(other->_definitionPoint2),
36 _definitionPoint3(other->_definitionPoint3) {
42 std::string
const& explicitValue,
43 const Layer_CSPtr layer,
44 const MetaInfo_CSPtr metaInfo,
45 const Block_CSPtr block) {
46 return std::make_shared<DimLinear>(p1,
48 TextConst::AttachmentPoint::Middle_center,
51 TextConst::LineSpacingStyle::AtLeast,
66 auto newDimLinear = std::make_shared<DimLinear>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2 + offset, this->
_definitionPoint3 + offset, this->
_angle, this->
_oblique, this->
layer(), this->
metaInfo());
67 newDimLinear->setID(this->
id());
72 auto newDimLinear = std::make_shared<DimLinear>(this->
definitionPoint() + offset, this->
middleOfText() + offset, this->
attachmentPoint(), this->
textAngle(), this->
lineSpacingFactor(), this->
lineSpacingStyle(), this->
explicitValue(), this->
_definitionPoint2 + offset, this->
_definitionPoint3 + offset, this->
_angle, this->
_oblique, this->
layer(), this->
metaInfo());
77 auto newDimLinear = std::make_shared<DimLinear>(this->
definitionPoint().
rotate(rotation_center, rotation_angle),
78 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->
_definitionPoint3.
rotate(rotation_center, rotation_angle), this->
_angle, this->
_oblique, this->
layer(), this->
metaInfo());
83 auto newDimLinear = std::make_shared<DimLinear>(this->
definitionPoint().
scale(scale_center, scale_factor),
84 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->
_definitionPoint3.
scale(scale_center, scale_factor), this->
_angle, this->
_oblique, this->
layer(), this->
metaInfo());
93 CADEntity_CSPtr
DimLinear::modify(Layer_CSPtr layer,
const MetaInfo_CSPtr metaInfo, Block_CSPtr block)
const {
94 auto newDimLinear = std::make_shared<DimLinear>(
129 std::map<unsigned int, geo::Coordinate>
dragPoints;
142 auto newEntity = std::make_shared<DimLinear>(dragPoints.at(0),
155 newEntity->setID(
id());
158 catch(std::out_of_range& e) {
159 return shared_from_this();
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
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override
scale, scales the entity
std::string explicitValue() const
Layer_CSPtr layer() const
layer return the layer this entity is placed on
virtual CADEntity_CSPtr setDragPoints(std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override
Return modified entity.
Coordinate scale(const double &scale_factor) const
virtual CADEntity_CSPtr copy(const geo::Coordinate &offset) const override
copy, copies by an offset
MetaInfo_CSPtr metaInfo() const
static DimLinear_SPtr dimAuto(geo::Coordinate const &p1, geo::Coordinate const &p2, geo::Coordinate const &middleOfText, std::string const &explicitValue, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
const geo::Coordinate & middleOfText() const noexcept
TextConst::AttachmentPoint const & attachmentPoint() 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 _definitionPoint3
Coordinate rotate(const Coordinate &angleVector) const
rotate around (0.,0.) with a given angle vector
const geo::Coordinate & definitionPoint3() const noexcept
double lineSpacingFactor() const
Block_CSPtr block() const
Return the current entity block.
DimLinear(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 &definitionPoint2, geo::Coordinate const &definitionPoint3, const double angle, const double oblique, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
DimLinear, DimLinear constructor with metatypes.
const geo::Coordinate _definitionPoint2
virtual std::map< unsigned int, lc::geo::Coordinate > dragPoints() const override
Get all points of the entity that can be dragged.
virtual CADEntity_CSPtr rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const override
rotate, rotate operation
const geo::Coordinate & definitionPoint2() const noexcept
virtual const geo::Area boundingBox() const override
boundingBox of the entity