X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fentitycontainer.h;fp=src%2Fbase%2Fentitycontainer.h;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=f05572401446de5ebfd20d535073866c51bd7f90;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/entitycontainer.h b/src/base/entitycontainer.h deleted file mode 100644 index f055724..0000000 --- a/src/base/entitycontainer.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef __ENTITYCONTAINER_H__ -#define __ENTITYCONTAINER_H__ - -#include -#include "arc.h" -#include "circle.h" -#include "ellipse.h" -#include "entity.h" -#include "line.h" -#include "point.h" - -/** - * Class representing a tree of entities. - * Typical entity containers are graphics, polylines, groups, texts, ...) - * - * @author Andrew Mustun - */ -class EntityContainer: public Entity -{ - public: - EntityContainer(EntityContainer * parent = NULL, bool owner = true); - //EntityContainer(const EntityContainer& ec); - virtual ~EntityContainer(); - - virtual Entity * clone(); - virtual void detach(); - virtual RS2::EntityType rtti() const; - void reparent(EntityContainer * parent); - virtual bool isContainer() const; - virtual bool isAtomic() const; - virtual double getLength(); - - virtual void undoStateChanged(bool undone); - virtual void setVisible(bool v); - - virtual bool setSelected(bool select = true); - virtual bool toggleSelected(); - - virtual void selectWindow(Vector v1, Vector v2, bool select = true, bool cross = false); - - virtual void addEntity(Entity * entity); - virtual void insertEntity(int index, Entity * entity); - virtual void replaceEntity(int index, Entity * entity); - virtual bool removeEntity(Entity * entity); - virtual Entity * firstEntity(RS2::ResolveLevel level = RS2::ResolveNone); - virtual Entity * lastEntity(RS2::ResolveLevel level = RS2::ResolveNone); - virtual Entity * nextEntity(RS2::ResolveLevel level = RS2::ResolveNone); - virtual Entity * prevEntity(RS2::ResolveLevel level = RS2::ResolveNone); - virtual Entity * entityAt(uint index); - virtual Entity * currentEntity(); - virtual int entityAt(); - virtual int findEntity(Entity * entity); - virtual void clear(); - - // Q3PtrListIterator createIterator(); -// QListIterator createIterator(); - - virtual bool isEmpty(); - virtual unsigned long int count(); - virtual unsigned long int countDeep(); - virtual unsigned long int countSelected(); - virtual void setAutoUpdateBorders(bool enable); - virtual void adjustBorders(Entity * entity); - virtual void calculateBorders(); - virtual void forcedCalculateBorders(); - virtual void updateDimensions(); - virtual void updateInserts(); - virtual void updateSplines(); - virtual void update(); - virtual void renameInserts(const QString & oldName, const QString & newName); - - virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); - - Entity * getNearestEntity(const Vector & point, double * dist = NULL, - RS2::ResolveLevel level = RS2::ResolveAll); - - 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 getNearestIntersection(const Vector & coord, double * dist = NULL); - virtual Vector getNearestRef(const Vector & coord, double * dist = NULL); - virtual Vector getNearestSelectedRef(const Vector & coord, double * dist = NULL); - - virtual double getDistanceToPoint(const Vector & coord, Entity ** entity, - RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); - - virtual bool optimizeContours(); - - virtual bool hasEndpointsWithinWindow(Vector v1, Vector v2); - - 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); - virtual void moveRef(const Vector & ref, const Vector & offset); - virtual void moveSelectedRef(const Vector & ref, const Vector & offset); - virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, EntityContainer & ec); - - protected: - /** entities in the container */ - QList entities; - - /** sub container used only temporarly for iteration. */ - EntityContainer * subContainer; - - /** - * Class variable: - * Automatically update the borders of the container when entities - * are added or removed. - */ - static bool autoUpdateBorders; - - private: - QListIterator entityIterator; -}; - -#endif // __ENTITYCONTAINER_H__