5 #include "rs_document.h"
8 * Holds the data that defines a block.
15 RS_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 RS_Insert entities that refer to such
46 * blocks are documents and can therefore be handled by graphic views.
48 * @author Andrew Mustun
50 class RS_Block: public RS_Document
52 friend class RS_BlockList;
55 RS_Block(RS_EntityContainer * parent, const RS_BlockData & d);
58 virtual RS_Entity * clone();
59 virtual RS2::EntityType rtti() const;
60 QString getName() const;
61 Vector getBasePoint() const;
62 virtual RS_LayerList * getLayerList();
63 virtual RS_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 RS_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.