X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fselection.cpp;fp=src%2Fbase%2Fselection.cpp;h=8550de145d9a4b4335df4a1deff703178712ab3c;hb=a18a12fc3bcb18e5c7ca5494d7f97fb8b93f90a2;hp=ce50e01c0f8a73e5e365b560218e361b29a556f9;hpb=5adb444f3e523d3fd028617ced72d1ea6661db21;p=architektonas diff --git a/src/base/selection.cpp b/src/base/selection.cpp index ce50e01..8550de1 100644 --- a/src/base/selection.cpp +++ b/src/base/selection.cpp @@ -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; icount(); ++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; icount(); ++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); } /**