summaryrefslogtreecommitdiffstats
path: root/src/vanishing-point.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-10-25 18:36:10 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-10-25 18:36:10 +0000
commit17f09296aa0beff56222e2d9c24f92a8ce94eef2 (patch)
tree9eae706e5f1145ee3184e41432f6d4315a53dce5 /src/vanishing-point.cpp
parentUpdate perspective-envelope to be affected by the clip or mask on LPE patch (diff)
parentCleaned casts from sp-shape by fixing member type. (diff)
downloadinkscape-17f09296aa0beff56222e2d9c24f92a8ce94eef2.tar.gz
inkscape-17f09296aa0beff56222e2d9c24f92a8ce94eef2.zip
Update to trunk r13638
(bzr r13341.1.286)
Diffstat (limited to 'src/vanishing-point.cpp')
-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 d1c8083de..13dd03ee3 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);
+ }
}
}