]> Shamusworld >> Repos - architektonas/blobdiff - src/base/selection.cpp
In the middle of chasing down MDI not activating bug, renaming of Graphic to
[architektonas] / src / base / selection.cpp
index ce50e01c0f8a73e5e365b560218e361b29a556f9..8550de145d9a4b4335df4a1deff703178712ab3c 100644 (file)
@@ -33,7 +33,8 @@ Selection::Selection(EntityContainer & container, GraphicView * graphicView)
 {
        this->container = &container;
        this->graphicView = graphicView;
-       graphic = container.getGraphic();
+#warning "!!! Need to rename graphic to drawing !!!"
+       graphic = container.GetDrawing();
 }
 
 /**
@@ -148,12 +149,9 @@ void Selection::selectIntersected(const Vector & v1, const Vector & v2, bool sel
        Line line(NULL, LineData(v1, v2));
        bool inters;
 
-       for (Entity* e=container->firstEntity(); e!=NULL;
-                       e=container->nextEntity()) {
-       //for (uint i=0; i<container->count(); ++i) {
-               //Entity* e = container->entityAt(i);
-
-               if (e!=NULL && e->isVisible())
+       for(Entity * e=container->firstEntity(); e!=NULL; e=container->nextEntity())
+       {
+               if (e && e->isVisible())
                {
                        inters = false;
 
@@ -245,33 +243,37 @@ void Selection::selectContour(Entity * e)
                //for (uint i=0; i<container->count(); ++i) {
                        //Entity* en = container->entityAt(i);
 
-                       if (en!=NULL && en->isVisible() &&
-                               en->isAtomic() && en->isSelected()!=select &&
-                               (en->getLayer()==NULL || en->getLayer()->isLocked()==false))
+                       if (en && en->isVisible() && en->isAtomic()
+                               && en->isSelected() != select && (en->getLayer() == NULL
+                               || en->getLayer()->isLocked() == false))
                        {
                                ae = (AtomicEntity *)en;
                                bool doit = false;
 
                                // startpoint connects to 1st point
-                               if (ae->getStartpoint().distanceTo(p1)<1.0e-4) {
+                               if (ae->getStartpoint().distanceTo(p1) < 1.0e-4)
+                               {
                                        doit = true;
                                        p1 = ae->getEndpoint();
                                }
 
                                // endpoint connects to 1st point
-                               else if (ae->getEndpoint().distanceTo(p1)<1.0e-4) {
+                               else if (ae->getEndpoint().distanceTo(p1) < 1.0e-4)
+                               {
                                        doit = true;
                                        p1 = ae->getStartpoint();
                                }
 
                                // startpoint connects to 2nd point
-                               else if (ae->getStartpoint().distanceTo(p2)<1.0e-4) {
+                               else if (ae->getStartpoint().distanceTo(p2) < 1.0e-4)
+                               {
                                        doit = true;
                                        p2 = ae->getEndpoint();
                                }
 
                                // endpoint connects to 1st point
-                               else if (ae->getEndpoint().distanceTo(p2)<1.0e-4) {
+                               else if (ae->getEndpoint().distanceTo(p2) < 1.0e-4)
+                               {
                                        doit = true;
                                        p2 = ae->getStartpoint();
                                }
@@ -296,7 +298,8 @@ void Selection::selectContour(Entity * e)
                                }
                        }
                }
-       } while(found);
+       }
+       while(found);
 }
 
 /**