X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fblock.h;fp=src%2Fbase%2Fblock.h;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=c016d0ee1116504b2a381da78daf1ee613d769f0;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/block.h b/src/base/block.h deleted file mode 100644 index c016d0e..0000000 --- a/src/base/block.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef __BLOCK_H__ -#define __BLOCK_H__ - -#include -#include "document.h" - -/** - * Holds the data that defines a block. - */ -class BlockData -{ - public: - BlockData() {} - - BlockData(const QString & name1, const Vector & basePoint1, bool frozen1): - name(name1), basePoint(basePoint1), frozen(frozen1) {} - - bool isValid() - { - return (!name.isEmpty() && basePoint.valid); - } - - public: - /** - * Block name. Acts as an id. - */ - QString name; - /** - * Base point of the Block. Usually 0/0 since blocks can be moved around - * using the insertion point of Insert entities. - */ - Vector basePoint; - //! Frozen flag - bool frozen; -}; - -/** - * A block is a group of entities. A block unlike an other entity - * container has a base point which defines the offset of the - * block. Note that although technically possible, a block should - * never be part of the entity tree of a graphic. Blocks are - * stored in a seperate list inside the graphic document (a block list). - * The graphic can contain Insert entities that refer to such - * blocks. - * - * blocks are documents and can therefore be handled by graphic views. - * - * @author Andrew Mustun - */ -class Block: public Document -{ - friend class BlockList; - - public: - Block(EntityContainer * parent, const BlockData & d); - virtual ~Block(); - - virtual Entity * clone(); - virtual RS2::EntityType rtti() const; - QString getName() const; - Vector getBasePoint() const; - virtual LayerList * getLayerList(); - virtual BlockList * getBlockList(); - virtual void newDoc(); - virtual bool save(); - virtual bool saveAs(const QString & filename, RS2::FormatType type); - virtual bool open(const QString &, RS2::FormatType); - friend std::ostream & operator<<(std::ostream & os, const Block & b); - void setName(const QString & n); - bool isFrozen() const; - void toggle(); - void freeze(bool freeze); - virtual void setModified(bool m); - - protected: - /** - * Base point of the Block. Usually 0/0 since blocks can be moved around - * using the insertion point of Insert entities. - */ - //Vector basePoint; - /** - * Block name. Acts as an id. - */ - //QString name; - //! Block data - BlockData data; -}; - -#endif