summaryrefslogtreecommitdiffstats
path: root/src/document.h
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2009-12-26 00:31:51 +0000
committerMaximilian Albert <maximilian.albert@gmail.com>2009-12-26 00:31:51 +0000
commitb0caf0cf11a3afdfbc9327641dde6ea7a8257fc5 (patch)
tree59ad390f9fcc86ccd7837124962f0e56cd0aa0da /src/document.h
parentFix compile when lcms is disabled (someone please check that this fix is corr... (diff)
downloadinkscape-b0caf0cf11a3afdfbc9327641dde6ea7a8257fc5.tar.gz
inkscape-b0caf0cf11a3afdfbc9327641dde6ea7a8257fc5.zip
Refactoring of 3D box tool, mainly to avoid unnecessary creation of perspectives.
(bzr r8910)
Diffstat (limited to 'src/document.h')
-rw-r--r--src/document.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/document.h b/src/document.h
index 06174c265..e83c37a96 100644
--- a/src/document.h
+++ b/src/document.h
@@ -55,6 +55,7 @@ namespace Inkscape {
class SP3DBox;
class Persp3D;
+class Persp3DImpl;
namespace Proj {
class TransfMat3x4;
@@ -107,17 +108,26 @@ struct SPDocument : public Inkscape::GC::Managed<>,
// Instance of the connector router
Avoid::Router *router;
- GSList *perspectives;
-
- Persp3D *current_persp3d; // "currently active" perspective (e.g., newly created boxes are attached to this one)
-
GSList *_collection_queue;
bool oldSignalsConnected;
- void add_persp3d(Persp3D * const persp);
- void remove_persp3d(Persp3D * const persp);
- void initialize_current_persp3d();
+ void setCurrentPersp3D(Persp3D * const persp);
+ inline void setCurrentPersp3DImpl(Persp3DImpl * const persp_impl) { current_persp3d_impl = persp_impl; }
+ /*
+ * getCurrentPersp3D returns current_persp3d (if non-NULL) or the first
+ * perspective in the defs. If no perspective exists, returns NULL.
+ */
+ Persp3D * getCurrentPersp3D();
+ Persp3DImpl * getCurrentPersp3DImpl();
+ void getPerspectivesInDefs(std::vector<Persp3D*> &list);
+ unsigned int numPerspectivesInDefs() {
+ std::vector<Persp3D*> list;
+ getPerspectivesInDefs(list);
+ return list.size();
+ }
+
+ //void initialize_current_persp3d();
sigc::connection connectModified(ModifiedSignal::slot_type slot);
sigc::connection connectURISet(URISetSignal::slot_type slot);
@@ -155,6 +165,9 @@ private:
SPDocument(SPDocument const &); // no copy
void operator=(SPDocument const &); // no assign
+ Persp3D *current_persp3d; /**< Currently 'active' perspective (to which, e.g., newly created boxes are attached) */
+ Persp3DImpl *current_persp3d_impl;
+
public:
sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot);
sigc::connection connectReconstructionFinish(ReconstructionFinish::slot_type slot);