diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-10-26 22:00:51 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-10-26 22:00:51 +0000 |
| commit | 73edade30f70b4c0ad94c9561b4e4ec0675465b0 (patch) | |
| tree | de55f48e427afc5faf8fb97467a8f79b86820b0f /src/box3d.cpp | |
| parent | fix crash (diff) | |
| download | inkscape-73edade30f70b4c0ad94c9561b4e4ec0675465b0.tar.gz inkscape-73edade30f70b4c0ad94c9561b4e4ec0675465b0.zip | |
Added some consts.
(bzr r12729)
Diffstat (limited to 'src/box3d.cpp')
| -rw-r--r-- | src/box3d.cpp | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp index ff99fccba..32442746d 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -1325,53 +1325,50 @@ SPGroup *box3d_convert_to_group(SPBox3D *box) return SP_GROUP(doc->getObjectByRepr(grepr)); } -const char *SPBox3D::displayName() { +const char *SPBox3D::displayName() const { return _("3D Box"); } -gchar *SPBox3D::description() { +gchar *SPBox3D::description() const { // We could put more details about the 3d box here return g_strdup(""); } static inline void -box3d_push_back_corner_pair(SPBox3D *box, std::list<std::pair<Geom::Point, Geom::Point> > &pts, int c1, int c2) { +box3d_push_back_corner_pair(SPBox3D const *box, std::list<std::pair<Geom::Point, Geom::Point> > &pts, int c1, int c2) { pts.push_back(std::make_pair(box3d_get_corner_screen(box, c1, false), box3d_get_corner_screen(box, c2, false))); } -void SPBox3D::convert_to_guides() { - SPBox3D* item = this; - SPBox3D *box = item; - +void SPBox3D::convert_to_guides() const { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (!prefs->getBool("/tools/shapes/3dbox/convertguides", true)) { - box->convert_to_guides(); + this->convert_to_guides(); return; } std::list<std::pair<Geom::Point, Geom::Point> > pts; /* perspective lines in X direction */ - box3d_push_back_corner_pair(box, pts, 0, 1); - box3d_push_back_corner_pair(box, pts, 2, 3); - box3d_push_back_corner_pair(box, pts, 4, 5); - box3d_push_back_corner_pair(box, pts, 6, 7); + box3d_push_back_corner_pair(this, pts, 0, 1); + box3d_push_back_corner_pair(this, pts, 2, 3); + box3d_push_back_corner_pair(this, pts, 4, 5); + box3d_push_back_corner_pair(this, pts, 6, 7); /* perspective lines in Y direction */ - box3d_push_back_corner_pair(box, pts, 0, 2); - box3d_push_back_corner_pair(box, pts, 1, 3); - box3d_push_back_corner_pair(box, pts, 4, 6); - box3d_push_back_corner_pair(box, pts, 5, 7); + box3d_push_back_corner_pair(this, pts, 0, 2); + box3d_push_back_corner_pair(this, pts, 1, 3); + box3d_push_back_corner_pair(this, pts, 4, 6); + box3d_push_back_corner_pair(this, pts, 5, 7); /* perspective lines in Z direction */ - box3d_push_back_corner_pair(box, pts, 0, 4); - box3d_push_back_corner_pair(box, pts, 1, 5); - box3d_push_back_corner_pair(box, pts, 2, 6); - box3d_push_back_corner_pair(box, pts, 3, 7); + box3d_push_back_corner_pair(this, pts, 0, 4); + box3d_push_back_corner_pair(this, pts, 1, 5); + box3d_push_back_corner_pair(this, pts, 2, 6); + box3d_push_back_corner_pair(this, pts, 3, 7); - sp_guide_pt_pairs_to_guides(item->document, pts); + sp_guide_pt_pairs_to_guides(this->document, pts); } /* |
