X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fcircle.h;fp=src%2Fbase%2Fcircle.h;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=99cedd6ade902d956f5d9a2e762ea0cc3e8fa8dc;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/circle.h b/src/base/circle.h deleted file mode 100644 index 99cedd6..0000000 --- a/src/base/circle.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __CIRCLE_H__ -#define __CIRCLE_H__ - -#include "atomicentity.h" - -/** - * Holds the data that defines a circle. - */ -class CircleData -{ - public: - CircleData() - { - } - - CircleData(const Vector & center, double radius) - { - this->center = center; - this->radius = radius; - } - - void reset() - { - center = Vector(false); - radius = 0.0; - } - - bool isValid() - { - return (center.valid && radius > RS_TOLERANCE); - } - - friend class Circle; - - friend std::ostream & operator<<(std::ostream & os, const CircleData & ad) - { - os << "(" << ad.center << "/" << ad.radius << ")"; - return os; - } - - public: - Vector center; - double radius; -}; - -/** - * Class for a circle entity. - * - * @author Andrew Mustun - */ -class Circle: public AtomicEntity -{ - public: - Circle(EntityContainer * parent, const CircleData & d); - virtual ~Circle(); - - virtual Entity * clone(); - virtual RS2::EntityType rtti() const; - virtual bool isEdge() const; - CircleData getData(); - virtual VectorSolutions getRefPoints(); - virtual Vector getStartpoint() const; - virtual Vector getEndpoint() const; - double getDirection1() const; - double getDirection2() const; - Vector getCenter(); - void setCenter(const Vector & c); - double getRadius(); - void setRadius(double r); - double getAngleLength() const; - virtual double getLength(); - - bool createFromCR(const Vector & c, double r); - bool createFrom2P(const Vector & p1, const Vector & p2); - bool createFrom3P(const Vector & p1, const Vector & p2, const Vector & p3); - virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, - double * dist = NULL, Entity ** entity = NULL); - virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); - virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); - virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); - virtual Vector getNearestDist(double distance, bool startp); - 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 moveRef(const Vector & ref, const Vector & offset); - virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const Circle & a); - - virtual void calculateBorders(); - - protected: - CircleData data; -}; - -#endif