X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fblock.cpp;fp=src%2Fbase%2Fblock.cpp;h=967e7e52883e44eed8d8c5a72df4ecc58fa04c9b;hb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;hp=9d520fbe85af132138babc7967878901e17aa17e;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/block.cpp b/src/base/block.cpp index 9d520fb..967e7e5 100644 --- a/src/base/block.cpp +++ b/src/base/block.cpp @@ -24,19 +24,19 @@ * @param name The name of the block used as an identifier. * @param basePoint Base point (offset) of the block. */ -RS_Block::RS_Block(RS_EntityContainer * parent, const RS_BlockData & d): - RS_Document(parent), data(d) +Block::Block(EntityContainer * parent, const BlockData & d): + Document(parent), data(d) { - pen = RS_Pen(RS_Color(128, 128, 128), RS2::Width01, RS2::SolidLine); + pen = Pen(Color(128, 128, 128), RS2::Width01, RS2::SolidLine); } -RS_Block::~RS_Block() +Block::~Block() { } -RS_Entity * RS_Block::clone() +Entity * Block::clone() { - RS_Block * blk = new RS_Block(*this); + Block * blk = new Block(*this); #warning "!!! Need to port setAutoDelete() behaviour from Qt3 to Qt4 !!!" // blk->entities.setAutoDelete(entities.autoDelete()); blk->detach(); @@ -44,41 +44,41 @@ RS_Entity * RS_Block::clone() return blk; } -RS_LayerList * RS_Block::getLayerList() +LayerList * Block::getLayerList() { Drawing * g = getGraphic(); - if (g != NULL) + if (g) return g->getLayerList(); return NULL; } -RS_BlockList * RS_Block::getBlockList() +BlockList * Block::getBlockList() { Drawing * g = getGraphic(); - if (g != NULL) + if (g) return g->getBlockList(); return NULL; } -bool RS_Block::save() +bool Block::save() { Drawing * g = getGraphic(); - if (g != NULL) + if (g) return g->save(); return false; } -bool RS_Block::saveAs(const QString & filename, RS2::FormatType type) +bool Block::saveAs(const QString & filename, RS2::FormatType type) { Drawing * g = getGraphic(); - if (g != NULL) + if (g) return g->saveAs(filename, type); return false; @@ -87,7 +87,7 @@ bool RS_Block::saveAs(const QString & filename, RS2::FormatType type) /** * Sets the parent documents modified status to 'm'. */ -void RS_Block::setModified(bool m) +void Block::setModified(bool m) { Drawing * p = getGraphic(); @@ -98,7 +98,7 @@ void RS_Block::setModified(bool m) } /** @return RS2::EntityBlock */ -/*virtual*/ RS2::EntityType RS_Block::rtti() const +/*virtual*/ RS2::EntityType Block::rtti() const { return RS2::EntityBlock; } @@ -106,7 +106,7 @@ void RS_Block::setModified(bool m) /** * @return Name of this block (the name is an Id for this block). */ -QString RS_Block::getName() const +QString Block::getName() const { return data.name; } @@ -114,32 +114,32 @@ QString RS_Block::getName() const /** * @return base point of this block. */ -Vector RS_Block::getBasePoint() const +Vector Block::getBasePoint() const { return data.basePoint; } /** - * Reimplementation from RS_Document. Does nothing. + * Reimplementation from Document. Does nothing. */ -/*virtual*/ void RS_Block::newDoc() +/*virtual*/ void Block::newDoc() { // do nothing } /** - * Reimplementation from RS_Document. Does nothing. + * Reimplementation from Document. Does nothing. */ -/*virtual*/ bool RS_Block::open(const QString &, RS2::FormatType) +/*virtual*/ bool Block::open(const QString &, RS2::FormatType) { // do nothing return false; } -/*friend*/ std::ostream & operator<<(std::ostream & os, const RS_Block & b) +/*friend*/ std::ostream & operator<<(std::ostream & os, const Block & b) { os << " name: " << b.getName().toLatin1().data() << std::endl; - os << " entities: " << (RS_EntityContainer &)b << std::endl; + os << " entities: " << (EntityContainer &)b << std::endl; return os; } @@ -147,7 +147,7 @@ Vector RS_Block::getBasePoint() const * sets a new name for the block. Only called by blocklist to * assure that block names stay unique. */ -void RS_Block::setName(const QString & n) +void Block::setName(const QString & n) { data.name = n; } @@ -156,7 +156,7 @@ void RS_Block::setName(const QString & n) * @retval true if this block is frozen (invisible) * @retval false if this block isn't frozen (visible) */ -bool RS_Block::isFrozen() const +bool Block::isFrozen() const { return data.frozen; } @@ -165,7 +165,7 @@ bool RS_Block::isFrozen() const * Toggles the visibility of this block. * Freezes the block if it's not frozen, thaws the block otherwise */ -void RS_Block::toggle() +void Block::toggle() { data.frozen = !data.frozen; } @@ -175,7 +175,7 @@ void RS_Block::toggle() * * @param freeze true: freeze, false: defreeze */ -void RS_Block::freeze(bool freeze) +void Block::freeze(bool freeze) { data.frozen = freeze; }