X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcontainer.cpp;h=976172fb38220f094838a7cc806ab1fa482a9712;hb=dbfab6256efe6b03e9750e33081d9dcdcdfc1c34;hp=e8a66e4d3ba040a178c7eadefc6a5c855adc6aa2;hpb=921bf050ffe5fc81a9ab377e634180e659ee5d5d;p=architektonas diff --git a/src/container.cpp b/src/container.cpp index e8a66e4..976172f 100644 --- a/src/container.cpp +++ b/src/container.cpp @@ -442,7 +442,6 @@ void Container::MoveContentsTo(Container * newContainer) return; // Shuffle the contents of this container to the new one -// for(unsigned int i=0; i::iterator i=objects.begin(); i!=objects.end(); i++) { newContainer->Add(*i); @@ -454,6 +453,18 @@ void Container::MoveContentsTo(Container * newContainer) } +void Container::CopyContentsTo(Container * newContainer) +{ + // Sanity check + if (newContainer == NULL) + return; + + // Shuffle the contents of this container to the new one + for(std::vector::iterator i=objects.begin(); i!=objects.end(); i++) + newContainer->Add((*i)->Copy()); +} + + void Container::MoveSelectedContentsTo(Container * newContainer) { // Sanity check @@ -537,6 +548,23 @@ same reference number. } +/*virtual*/ void Container::Rotate(Point point, double angle) +{ + for(std::vector::iterator i=objects.begin(); i!=objects.end(); i++) + (*i)->Rotate(point, angle); +} + + +/*virtual*/ void Container::RotateSelected(Point point, double angle) +{ + for(std::vector::iterator i=objects.begin(); i!=objects.end(); i++) + { + if ((*i)->state == OSSelected) + (*i)->Rotate(point, angle); + } +} + + /*virtual*/ void Container::Mirror(Point p1, Point p2) { for(std::vector::iterator i=objects.begin(); i!=objects.end(); i++) @@ -544,6 +572,16 @@ same reference number. } +/*virtual*/ void Container::MirrorSelected(Point p1, Point p2) +{ + for(std::vector::iterator i=objects.begin(); i!=objects.end(); i++) + { + if ((*i)->state == OSSelected) + (*i)->Mirror(p1, p2); + } +} + + /*virtual*/ void Container::Save(void) { Object::Save();