5 #include "atomicentity.h"
8 * Holds the data that defines a line.
14 * Default constructor. Leaves the data object uninitialized.
20 ImageData(int handle, const Vector & insertionPoint, const Vector & uVector, const Vector & vVector, const Vector & size, const QString & file, int brightness, int contrast, int fade)
22 this->handle = handle;
23 this->insertionPoint = insertionPoint;
24 this->uVector = uVector;
25 this->vVector = vVector;
28 this->brightness = brightness;
29 this->contrast = contrast;
33 friend std::ostream & operator<<(std::ostream & os, const ImageData & ld)
35 os << "(" << ld.insertionPoint << ")";
40 /** Handle of image definition. */
42 /** Insertion point. */
43 Vector insertionPoint;
44 /** u vector. Points along visual bottom of image. */
46 /** v vector. Points along visual left of image. */
48 /** Image size in pixel. */
50 /** Path to image file. */
52 /** Brightness (0..100, default: 50). */
54 /** Contrast (0..100, default: 50). */
56 /** Fade (0..100, default: 0). */
61 * Class for a bitmap image entity.
63 * @author Andrew Mustun
65 class Image: public AtomicEntity
68 Image(EntityContainer * parent, const ImageData & d);
71 virtual Entity * clone();
72 virtual RS2::EntityType rtti() const;
73 virtual void update();
74 ImageData getData() const;
75 virtual Vector getInsertionPoint() const;
76 void setInsertionPoint(Vector ip);
77 QString getFile() const;
78 void setFile(const QString & file);
79 Vector getUVector() const;
80 Vector getVVector() const;
82 int getHeight() const;
83 int getBrightness() const;
84 int getContrast() const;
86 int getHandle() const;
87 void setHandle(int h);
88 VectorSolutions getCorners();
89 double getImageWidth();
90 double getImageHeight();
92 virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
93 virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, double * dist = NULL, Entity * * entity = NULL);
94 virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
95 virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
96 virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL);
97 virtual double getDistanceToPoint(const Vector & coord, Entity * * entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
98 virtual double getLength();
99 virtual void move(Vector offset);
100 virtual void rotate(Vector center, double angle);
101 virtual void scale(Vector center, Vector factor);
102 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
103 /*virtual void stretch(Vector firstCorner,Vector secondCorner, Vector offset);*/
104 virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
106 friend std::ostream & operator<<(std::ostream & os, const Image & l);
108 virtual void calculateBorders();