]> Shamusworld >> Repos - architektonas/blobdiff - src/container.cpp
Changed Actions to emit signal when needing a graphical update.
[architektonas] / src / container.cpp
index e8a66e4d3ba040a178c7eadefc6a5c855adc6aa2..976172fb38220f094838a7cc806ab1fa482a9712 100644 (file)
@@ -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<objects.size(); i++)
        for(std::vector<Object *>::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<Object *>::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<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
+               (*i)->Rotate(point, angle);
+}
+
+
+/*virtual*/ void Container::RotateSelected(Point point, double angle)
+{
+       for(std::vector<Object *>::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<Object *>::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<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
+       {
+               if ((*i)->state == OSSelected)
+                       (*i)->Mirror(p1, p2);
+       }
+}
+
+
 /*virtual*/ void Container::Save(void)
 {
        Object::Save();