8 * Holds the data that defines a block.
15 BlockData(const QString & name1, const Vector & basePoint1, bool frozen1):
16 name(name1), basePoint(basePoint1), frozen(frozen1) {}
20 return (!name.isEmpty() && basePoint.valid);
25 * Block name. Acts as an id.
29 * Base point of the Block. Usually 0/0 since blocks can be moved around
30 * using the insertion point of Insert entities.
38 * A block is a group of entities. A block unlike an other entity
39 * container has a base point which defines the offset of the
40 * block. Note that although technically possible, a block should
41 * never be part of the entity tree of a graphic. Blocks are
42 * stored in a seperate list inside the graphic document (a block list).
43 * The graphic can contain Insert entities that refer to such
46 * blocks are documents and can therefore be handled by graphic views.
48 * @author Andrew Mustun
50 class Block: public Document
52 friend class BlockList;
55 Block(EntityContainer * parent, const BlockData & d);
58 virtual Entity * clone();
59 virtual RS2::EntityType rtti() const;
60 QString getName() const;
61 Vector getBasePoint() const;
62 virtual LayerList * getLayerList();
63 virtual BlockList * getBlockList();
64 virtual void newDoc();
66 virtual bool saveAs(const QString & filename, RS2::FormatType type);
67 virtual bool open(const QString &, RS2::FormatType);
68 friend std::ostream & operator<<(std::ostream & os, const Block & b);
69 void setName(const QString & n);
70 bool isFrozen() const;
72 void freeze(bool freeze);
73 virtual void setModified(bool m);
77 * Base point of the Block. Usually 0/0 since blocks can be moved around
78 * using the insertion point of Insert entities.
82 * Block name. Acts as an id.