From e2ae473da92a1f96e307e3f1f3e206cad7bd1c38 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 23 Oct 2014 19:33:47 -0700 Subject: Initial removal of box3d outdated GTKish macros. (bzr r13634) --- src/vanishing-point.cpp | 52 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'src/vanishing-point.cpp') diff --git a/src/vanishing-point.cpp b/src/vanishing-point.cpp index bb6a2c4d7..2b419da70 100644 --- a/src/vanishing-point.cpp +++ b/src/vanishing-point.cpp @@ -6,6 +6,7 @@ * Johan Engelen * Maximilian Albert * Abhishek Sharma + * Jon A. Cruz * * Copyright (C) 2005-2007 authors * @@ -256,11 +257,10 @@ std::list VanishingPoint::selectedBoxes(Inkscape::Selection *sel) { std::list sel_boxes; for (GSList const* i = sel->itemList(); i != NULL; i = i->next) { - if (!SP_IS_BOX3D(i->data)) - continue; - SPBox3D *box = SP_BOX3D(i->data); - if (this->hasBox(box)) { - sel_boxes.push_back (box); + SPItem *item = static_cast(i->data); + SPBox3D *box = dynamic_cast(item); + if (box && this->hasBox(box)) { + sel_boxes.push_back(box); } } return sel_boxes; @@ -396,12 +396,13 @@ VPDragger::VPsOfSelectedBoxes() { // FIXME: Should we take the selection from the parent VPDrag? I guess it shouldn't make a difference. Inkscape::Selection *sel = sp_desktop_selection(inkscape_active_desktop()); for (GSList const* i = sel->itemList(); i != NULL; i = i->next) { - if (!SP_IS_BOX3D(i->data)) - continue; - SPBox3D *box = SP_BOX3D(i->data); - vp = this->findVPWithBox(box); - if (vp) { - sel_vps.insert (vp); + SPItem *item = static_cast(i->data); + SPBox3D *box = dynamic_cast(item); + if (box) { + vp = this->findVPWithBox(box); + if (vp) { + sel_vps.insert (vp); + } } } return sel_vps; @@ -577,14 +578,14 @@ VPDrag::updateDraggers () g_return_if_fail (this->selection != NULL); for (GSList const* i = this->selection->itemList(); i != NULL; i = i->next) { - SPItem *item = SP_ITEM(i->data); - if (!SP_IS_BOX3D (item)) continue; - SPBox3D *box = SP_BOX3D (item); - - VanishingPoint vp; - for (int i = 0; i < 3; ++i) { - vp.set(box3d_get_perspective(box), Proj::axes[i]); - addDragger (vp); + SPItem *item = static_cast(i->data); + SPBox3D *box = dynamic_cast(item); + if (box) { + VanishingPoint vp; + for (int i = 0; i < 3; ++i) { + vp.set(box3d_get_perspective(box), Proj::axes[i]); + addDragger (vp); + } } } } @@ -609,12 +610,13 @@ VPDrag::updateLines () g_return_if_fail (this->selection != NULL); for (GSList const* i = this->selection->itemList(); i != NULL; i = i->next) { - if (!SP_IS_BOX3D(i->data)) continue; - SPBox3D *box = SP_BOX3D (i->data); - - this->drawLinesForFace (box, Proj::X); - this->drawLinesForFace (box, Proj::Y); - this->drawLinesForFace (box, Proj::Z); + SPItem *item = static_cast(i->data); + SPBox3D *box = dynamic_cast(item); + if (box) { + this->drawLinesForFace (box, Proj::X); + this->drawLinesForFace (box, Proj::Y); + this->drawLinesForFace (box, Proj::Z); + } } } -- cgit v1.2.3