9 using namespace entity;
20 const Layer_CSPtr layer,
21 const MetaInfo_CSPtr metaInfo,
22 const Block_CSPtr block) :
30 _brightness(brightness),
37 CADEntity(other, sameID), _name(other->_name), _base(other->_base), _uv(other->_uv), _vv(other->_vv), _width(other->_width), _height(other->_height),
38 _brightness(other->_brightness), _contrast(other->_contrast), _fade(other->_fade) {
43 std::vector<EntityCoordinate> points;
53 points.emplace_back(npoe, 2);
71 std::vector<geo::Coordinate> points;
88 auto newImage = std::make_shared<Image>(
_name,
_base + offset,
_uv,
_vv,
_width,
_height,
_brightness,
_contrast,
_fade,
layer(),
metaInfo());
89 newImage->setID(this->
id());
94 auto newImage = std::make_shared<Image>(
_name,
_base + offset,
_uv,
_vv,
_width,
_height,
_brightness,
_contrast,
_fade,
layer(),
metaInfo());
113 std::vector<geo::Coordinate> c;
120 c.emplace_back(0.,0.);
123 c.emplace_back(
_width, 0.);
126 std::vector<geo::Coordinate> c2 = HelperMethods::transform2d<geo::Coordinate>(c,
_uv.
x(),
_uv.
y(),
_vv.
x(),
_vv.
y(),
_base.
x(),
_base.
y());
130 std::for_each(c2.begin(), c2.end(), [&](
geo::Coordinate c) {area = area.merge(c);});
135 CADEntity_CSPtr
Image::modify(Layer_CSPtr layer,
const MetaInfo_CSPtr metaInfo, Block_CSPtr block)
const {
136 auto newImage = std::make_shared<Image>(
virtual CADEntity_CSPtr scale(const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor) const override
scale, scales 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...
static const uint16_t LOGICAL
double x() const
Returns x of Coordinate.
virtual const geo::Area boundingBox() const override
boundingBox of the entity
static const uint16_t ON_ENTITYPATH
double _fade
Brightness value, code 283, (0-100) default 0.
Layer_CSPtr layer() const
layer return the layer this entity is placed on
double y() const
Returns y of Coordinate.
virtual std::vector< EntityCoordinate > snapPoints(const geo::Coordinate &coord, const SimpleSnapConstrain &constrain, double minDistanceToSnap, int maxNumberOfSnapPoints) const override
Find a number of snap points the line has available This function returns a ordered list...
virtual CADEntity_CSPtr rotate(const geo::Coordinate &rotation_center, const double rotation_angle) const override
rotate, rotate operation
virtual CADEntity_CSPtr move(const geo::Coordinate &offset) const override
move, moves by an offset
MetaInfo_CSPtr metaInfo() const
Image(const std::string &name, const geo::Coordinate &base, const geo::Coordinate &uv, const geo::Coordinate &vv, double width, double height, double brightness, double contrast, double fade, const Layer_CSPtr layer, const MetaInfo_CSPtr metaInfo=nullptr, const Block_CSPtr block=nullptr)
static void snapPointsCleanup(std::vector< EntityCoordinate > &points, const geo::Coordinate &reference, const unsigned int maxNumberOfSnapPoints, const double minDistanceToSnap)
Block_CSPtr block() const
Return the current entity block.
double _brightness
Brightness value, code 281, (0-100) default 50.
virtual CADEntity_CSPtr copy(const geo::Coordinate &offset) const override
copy, copies Image by an offset
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...
const uint16_t constrain() const
double _contrast
Brightness value, code 282, (0-100) default 50.