From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/box3d.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/box3d.cpp') diff --git a/src/box3d.cpp b/src/box3d.cpp index c4c2728e4..0a33ee306 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -259,8 +259,8 @@ void box3d_position_set(SPBox3D *box) { /* This draws the curve and calls requestDisplayUpdate() for each side (the latter is done in box3d_side_position_set() to avoid update conflicts with the parent box) */ - for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast(obj); + for (auto& obj: box->_children) { + Box3DSide *side = dynamic_cast(&obj); if (side) { box3d_side_position_set(side); } @@ -275,8 +275,8 @@ Geom::Affine SPBox3D::set_transform(Geom::Affine const &xform) { gdouble const sw = hypot(ret[0], ret[1]); gdouble const sh = hypot(ret[2], ret[3]); - for ( SPObject *child = firstChild(); child; child = child->getNext() ) { - SPItem *childitem = dynamic_cast(child); + for (auto& child: _children) { + SPItem *childitem = dynamic_cast(&child); if (childitem) { // Adjust stroke width childitem->adjust_stroke(sqrt(fabs(sw * sh))); @@ -1074,8 +1074,8 @@ box3d_recompute_z_orders (SPBox3D *box) { static std::map box3d_get_sides(SPBox3D *box) { std::map sides; - for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast(obj); + for (auto& obj: box->_children) { + Box3DSide *side = dynamic_cast(&obj); if (side) { sides[Box3D::face_to_int(side->getFaceId())] = side; } @@ -1217,8 +1217,8 @@ static void box3d_extract_boxes_rec(SPObject *obj, std::list &boxes) if (box) { boxes.push_back(box); } else if (dynamic_cast(obj)) { - for ( SPObject *child = obj->firstChild(); child; child = child->getNext() ) { - box3d_extract_boxes_rec(child, boxes); + for (auto& child: obj->_children) { + box3d_extract_boxes_rec(&child, boxes); } } } @@ -1276,8 +1276,8 @@ SPGroup *box3d_convert_to_group(SPBox3D *box) // create a new group and add the sides (converted to ordinary paths) as its children Inkscape::XML::Node *grepr = xml_doc->createElement("svg:g"); - for ( SPObject *obj = box->firstChild(); obj; obj = obj->getNext() ) { - Box3DSide *side = dynamic_cast(obj); + for (auto& obj: box->_children) { + Box3DSide *side = dynamic_cast(&obj); if (side) { Inkscape::XML::Node *repr = box3d_side_convert_to_path(side); grepr->appendChild(repr); -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/box3d.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/box3d.cpp') diff --git a/src/box3d.cpp b/src/box3d.cpp index 0a33ee306..f8ef158b2 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -259,7 +259,7 @@ void box3d_position_set(SPBox3D *box) { /* This draws the curve and calls requestDisplayUpdate() for each side (the latter is done in box3d_side_position_set() to avoid update conflicts with the parent box) */ - for (auto& obj: box->_children) { + for (auto& obj: box->children) { Box3DSide *side = dynamic_cast(&obj); if (side) { box3d_side_position_set(side); @@ -275,7 +275,7 @@ Geom::Affine SPBox3D::set_transform(Geom::Affine const &xform) { gdouble const sw = hypot(ret[0], ret[1]); gdouble const sh = hypot(ret[2], ret[3]); - for (auto& child: _children) { + for (auto& child: children) { SPItem *childitem = dynamic_cast(&child); if (childitem) { // Adjust stroke width @@ -1074,7 +1074,7 @@ box3d_recompute_z_orders (SPBox3D *box) { static std::map box3d_get_sides(SPBox3D *box) { std::map sides; - for (auto& obj: box->_children) { + for (auto& obj: box->children) { Box3DSide *side = dynamic_cast(&obj); if (side) { sides[Box3D::face_to_int(side->getFaceId())] = side; @@ -1217,7 +1217,7 @@ static void box3d_extract_boxes_rec(SPObject *obj, std::list &boxes) if (box) { boxes.push_back(box); } else if (dynamic_cast(obj)) { - for (auto& child: obj->_children) { + for (auto& child: obj->children) { box3d_extract_boxes_rec(&child, boxes); } } @@ -1276,7 +1276,7 @@ SPGroup *box3d_convert_to_group(SPBox3D *box) // create a new group and add the sides (converted to ordinary paths) as its children Inkscape::XML::Node *grepr = xml_doc->createElement("svg:g"); - for (auto& obj: box->_children) { + for (auto& obj: box->children) { Box3DSide *side = dynamic_cast(&obj); if (side) { Inkscape::XML::Node *repr = box3d_side_convert_to_path(side); -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/box3d.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/box3d.cpp') diff --git a/src/box3d.cpp b/src/box3d.cpp index c4c2728e4..e50cc4afb 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -23,18 +23,12 @@ #include "box3d.h" #include "box3d-side.h" #include "ui/tools/box3d-tool.h" -#include "proj_pt.h" -#include "transf_mat_3x4.h" #include "perspective-line.h" -#include "inkscape.h" -#include "persp3d.h" -#include "line-geometry.h" #include "persp3d-reference.h" #include "uri.h" #include <2geom/line.h> #include "sp-guide.h" #include "sp-namedview.h" -#include "preferences.h" #include "desktop.h" -- cgit v1.2.3