Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-03-06 17:46:19 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-03-08 14:03:17 +0300
commitaa4c44dbea2bdb430f704f7777458ed9054d0d91 (patch)
tree43aa7b0ecc7cac70a0e14c1c7163d6aca6b1a4b9 /src/slic3r/GUI/Camera.hpp
parentaf72d781ad6bdcb09d2770fdd0d985be5fc8e9aa (diff)
Use unique camera shared by 3d view and preview (experimental)
Diffstat (limited to 'src/slic3r/GUI/Camera.hpp')
-rw-r--r--src/slic3r/GUI/Camera.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/slic3r/GUI/Camera.hpp b/src/slic3r/GUI/Camera.hpp
new file mode 100644
index 000000000..77d5e9d9a
--- /dev/null
+++ b/src/slic3r/GUI/Camera.hpp
@@ -0,0 +1,54 @@
+#ifndef slic3r_Camera_hpp_
+#define slic3r_Camera_hpp_
+
+#if ENABLE_SHARED_CAMERA
+
+#include "libslic3r/BoundingBox.hpp"
+
+namespace Slic3r {
+namespace GUI {
+
+struct Camera
+{
+ enum EType : unsigned char
+ {
+ Unknown,
+// Perspective,
+ Ortho,
+ Num_types
+ };
+
+ EType type;
+ float zoom;
+ float phi;
+// float distance;
+ bool requires_zoom_to_bed;
+
+private:
+ Vec3d m_target;
+ float m_theta;
+
+ BoundingBoxf3 m_scene_box;
+
+public:
+ Camera();
+
+ std::string get_type_as_string() const;
+
+ const Vec3d& get_target() const { return m_target; }
+ void set_target(const Vec3d& target);
+
+ float get_theta() const { return m_theta; }
+ void set_theta(float theta, bool apply_limit);
+
+ const BoundingBoxf3& get_scene_box() const { return m_scene_box; }
+ void set_scene_box(const BoundingBoxf3& box);
+};
+
+} // GUI
+} // Slic3r
+
+#endif // ENABLE_SHARED_CAMERA
+
+#endif // slic3r_Camera_hpp_
+