7 using namespace entity;
10 const std::string text_value,
13 const std::string style,
17 const Layer_CSPtr layer,
18 const MetaInfo_CSPtr metaInfo,
19 const Block_CSPtr block) :
21 _insertion_point(insertion_point),
22 _text_value(text_value),
26 _textgeneration(textgeneration),
32 _insertion_point(other->_insertion_point),
33 _text_value(other->_text_value),
34 _height(other->_height),
35 _angle(other->_angle),
36 _style(other->_style),
37 _textgeneration(other->_textgeneration),
38 _valign(other->_valign),
39 _halign(other->_halign) {
53 newText->setID(this->
id());
58 auto newText = std::make_shared<Text>(
69 newText->setID(this->
id());
74 auto newText = std::make_shared<Text>(
89 auto newText = std::make_shared<Text>(
92 this->
_height * std::sqrt(scale_factor.
x() * scale_factor.
y()),
100 newText->setID(this->
id());
109 CADEntity_CSPtr
Text::modify(Layer_CSPtr layer,
const MetaInfo_CSPtr metaInfo, Block_CSPtr block)
const {
110 auto newText = std::make_shared<Text>(
123 newText->setID(this->
id());
129 std::map<unsigned int, geo::Coordinate>
dragPoints;
139 newEntity->setID(
id());
142 catch(std::out_of_range& e) {
143 return shared_from_this();
std::string const & style() const
double x() const
Returns x of Coordinate.
const TextConst::HAlign _halign
virtual CADEntity_CSPtr copy(const geo::Coordinate &offset) const override
copy, copies line by an offset
virtual CADEntity_CSPtr setDragPoints(std::map< unsigned int, lc::geo::Coordinate > dragPoints) const override
Return modified entity.
const TextConst::VAlign _valign
Layer_CSPtr layer() const
layer return the layer this entity is placed on
double y() const
Returns y of Coordinate.
Coordinate scale(const double &scale_factor) const
virtual const geo::Area boundingBox() const override
boundingBox of the entity
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override
scale, scales the entity
const TextConst::DrawingDirection _textgeneration
MetaInfo_CSPtr metaInfo() const
std::string const & text_value() const
const geo::Coordinate _insertion_point
double const angle() const
Text(const geo::Coordinate &insertion_point, const std::string text_value, const double height, const double angle, const std::string style, const TextConst::DrawingDirection textgeneration, const TextConst::HAlign halign, const TextConst::VAlign valign, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
Text, default constructor.
Coordinate rotate(const Coordinate &angleVector) const
rotate around (0.,0.) with a given angle vector
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
Block_CSPtr block() const
Return the current entity block.
TextConst::VAlign const & valign() const
TextConst::HAlign const & halign() const
const std::string _text_value
TextConst::DrawingDirection const & textgeneration() 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...
virtual CADEntity_CSPtr move(const geo::Coordinate &offset) const override
move, moves by an offset