5 #include "entitycontainer.h"
8 * Holds the data that defines a hatch entity.
14 * Default constructor. Leaves the data object uninitialized.
19 * @param solid true: solid fill, false: pattern.
20 * @param scale Pattern scale or spacing.
21 * @param pattern Pattern name.
23 HatchData(bool solid, double scale, double angle, const QString & pattern)
28 this->pattern = pattern;
30 //std::cout << "RS_H__atchData: " << pattern.latin1() << "\n";
33 friend std::ostream & operator<<(std::ostream & os, const HatchData & td)
35 os << "(" << td.pattern.toAscii().data() << ")";
47 * Class for a hatch entity.
49 * @author James Hammons
50 * @author Andrew Mustun
52 class Hatch: public EntityContainer
55 Hatch(EntityContainer * parent, const HatchData & d);
58 virtual Entity * clone();
59 virtual RS2::EntityType rtti() const;
60 virtual bool isContainer() const;
61 HatchData getData() const;
65 /** @return true if this is a solid fill. false if it is a pattern hatch. */
67 void setSolid(bool solid);
69 void setPattern(const QString & pattern);
71 void setScale(double scale);
73 void setAngle(double angle);
75 virtual void calculateBorders();
77 void activateContour(bool on);
78 virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
79 virtual double getLength();
80 virtual double getDistanceToPoint(const Vector & coord, Entity ** entity = NULL,
81 RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
82 virtual void move(Vector offset);
83 virtual void rotate(Vector center, double angle);
84 virtual void scale(Vector center, Vector factor);
85 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
86 virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset);
88 friend std::ostream & operator<<(std::ostream & os, const Hatch & p);
92 EntityContainer * hatch;
94 bool needOptimization;