From e71e984af918104579da59e45785fe1651c5e992 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 23 Jan 2019 02:58:28 +0100 Subject: =?UTF-8?q?Avoid=20the=20=E2=80=9Cusing=20std::*;=E2=80=9D=20or=20?= =?UTF-8?q?=E2=80=9Cusing=20namespace=20std;=E2=80=9D=20constructs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the code a lot less readable and greppable for no reason. --- src/graphlayout.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/graphlayout.cpp') diff --git a/src/graphlayout.cpp b/src/graphlayout.cpp index 6173854d9..4c244489c 100644 --- a/src/graphlayout.cpp +++ b/src/graphlayout.cpp @@ -16,7 +16,10 @@ #include #include #include +#include #include +#include +#include #include #include <2geom/transforms.h> @@ -36,7 +39,6 @@ #include "object/sp-path.h" #include "style.h" -using namespace std; using namespace cola; using namespace vpsc; @@ -52,19 +54,19 @@ bool isConnector(SPItem const * const item) { } struct CheckProgress: TestConvergence { - CheckProgress(double d, unsigned i, list & selected, Rectangles & rs, - map & nodelookup) + CheckProgress(double d, unsigned i, std::list & selected, Rectangles & rs, + std::map & nodelookup) : TestConvergence(d, i) , selected(selected) , rs(rs) , nodelookup(nodelookup) {} - bool operator()(const double new_stress, valarray & X, valarray & Y) override { + bool operator()(const double new_stress, std::valarray & X, std::valarray & Y) override { /* This is where, if we wanted to animate the layout, we would need to update * the positions of all objects and redraw the canvas and maybe sleep a bit cout << "stress="<::iterator i_iter=nodelookup.find(item->getId()); + std::map::iterator i_iter=nodelookup.find(item->getId()); if (i_iter == nodelookup.end()) continue; unsigned u = i_iter->second; - vector nlist = item->avoidRef->getAttachedConnectors(Avoid::runningFrom); - list connectors; + std::vector nlist = item->avoidRef->getAttachedConnectors(Avoid::runningFrom); + std::list connectors; connectors.insert(connectors.end(), nlist.begin(), nlist.end()); @@ -172,7 +174,7 @@ void graphlayout(std::vector const & items) { // If iv not in nodelookup we again treat the connector // as disconnected and continue - map::iterator v_pair = nodelookup.find(iv->getId()); + std::map::iterator v_pair = nodelookup.find(iv->getId()); if (v_pair != nodelookup.end()) { unsigned v = v_pair->second; //cout << "Edge: (" << u <<","< const & items) { } } EdgeLengths elengths(es.size(), 1); - vector cs; + std::vector cs; connectedComponents(rs, es, cs); for (Component * c: cs) { if (c->edges.size() < 2) continue; @@ -201,7 +203,7 @@ void graphlayout(std::vector const & items) { for (SPItem * item: selected) { if (!isConnector(item)) { - map::iterator i = nodelookup.find(item->getId()); + std::map::iterator i = nodelookup.find(item->getId()); if (i != nodelookup.end()) { Rectangle * r = rs[i->second]; Geom::OptRect item_box = item->desktopVisualBounds(); -- cgit v1.2.3