X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fhatch.h;fp=src%2Fbase%2Fhatch.h;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=6d1959b39868a0d04298ce88757240a8a476c2ef;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/hatch.h b/src/base/hatch.h deleted file mode 100644 index 6d1959b..0000000 --- a/src/base/hatch.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef __HATCH_H__ -#define __HATCH_H__ - -#include "entity.h" -#include "entitycontainer.h" - -/** - * Holds the data that defines a hatch entity. - */ -class HatchData -{ - public: - /** - * Default constructor. Leaves the data object uninitialized. - */ - HatchData() {} - - /** - * @param solid true: solid fill, false: pattern. - * @param scale Pattern scale or spacing. - * @param pattern Pattern name. - */ - HatchData(bool solid, double scale, double angle, const QString & pattern) - { - this->solid = solid; - this->scale = scale; - this->angle = angle; - this->pattern = pattern; - - //std::cout << "RS_H__atchData: " << pattern.latin1() << "\n"; - } - - friend std::ostream & operator<<(std::ostream & os, const HatchData & td) - { - os << "(" << td.pattern.toAscii().data() << ")"; - return os; - } - - public: - bool solid; - double scale; - double angle; - QString pattern; -}; - -/** - * Class for a hatch entity. - * - * @author James Hammons - * @author Andrew Mustun - */ -class Hatch: public EntityContainer -{ - public: - Hatch(EntityContainer * parent, const HatchData & d); - virtual ~Hatch(); - - virtual Entity * clone(); - virtual RS2::EntityType rtti() const; - virtual bool isContainer() const; - HatchData getData() const; - bool validate(); - int countLoops(); - - /** @return true if this is a solid fill. false if it is a pattern hatch. */ - bool isSolid() const; - void setSolid(bool solid); - QString getPattern(); - void setPattern(const QString & pattern); - double getScale(); - void setScale(double scale); - double getAngle(); - void setAngle(double angle); - - virtual void calculateBorders(); - void update(); - void activateContour(bool on); - virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); - virtual double getLength(); - virtual double getDistanceToPoint(const Vector & coord, Entity ** entity = NULL, - RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); - - friend std::ostream & operator<<(std::ostream & os, const Hatch & p); - - protected: - HatchData data; - EntityContainer * hatch; - bool updateRunning; - bool needOptimization; -}; - -#endif // __HATCH_H__