summaryrefslogtreecommitdiffstats
path: root/src/vanishing-point.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2014-10-24 02:33:47 +0000
committerJon A. Cruz <jon@joncruz.org>2014-10-24 02:33:47 +0000
commite2ae473da92a1f96e307e3f1f3e206cad7bd1c38 (patch)
treec0611f76bf1e080e34cecdb8fd89b6a07289c68a /src/vanishing-point.cpp
parentTranslations. Brazilian Portuguese translation update by Victor Westmann. (diff)
downloadinkscape-e2ae473da92a1f96e307e3f1f3e206cad7bd1c38.tar.gz
inkscape-e2ae473da92a1f96e307e3f1f3e206cad7bd1c38.zip
Initial removal of box3d outdated GTKish macros.
(bzr r13634)
Diffstat (limited to '')
-rw-r--r--src/vanishing-point.cpp52
1 files changed, 27 insertions, 25 deletions
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 <j.b.c.engelen@ewi.utwente.nl>
* Maximilian Albert <Anhalter42@gmx.de>
* Abhishek Sharma
+ * Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2005-2007 authors
*
@@ -256,11 +257,10 @@ std::list<SPBox3D *>
VanishingPoint::selectedBoxes(Inkscape::Selection *sel) {
std::list<SPBox3D *> 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<SPItem *>(i->data);
+ SPBox3D *box = dynamic_cast<SPBox3D *>(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<SPItem *>(i->data);
+ SPBox3D *box = dynamic_cast<SPBox3D *>(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<SPItem *>(i->data);
+ SPBox3D *box = dynamic_cast<SPBox3D *>(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<SPItem *>(i->data);
+ SPBox3D *box = dynamic_cast<SPBox3D *>(item);
+ if (box) {
+ this->drawLinesForFace (box, Proj::X);
+ this->drawLinesForFace (box, Proj::Y);
+ this->drawLinesForFace (box, Proj::Z);
+ }
}
}