mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Camera target constrained to scene bounding box
This commit is contained in:
parent
10cf82774b
commit
198b23283c
3 changed files with 107 additions and 6 deletions
|
@ -153,9 +153,15 @@ class GLCanvas3D
|
|||
float zoom;
|
||||
float phi;
|
||||
// float distance;
|
||||
#if !ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
Vec3d target;
|
||||
#endif !// ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
|
||||
private:
|
||||
#if ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
Vec3d m_target;
|
||||
BoundingBoxf3 m_scene_box;
|
||||
#endif // ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
float m_theta;
|
||||
|
||||
public:
|
||||
|
@ -163,8 +169,16 @@ class GLCanvas3D
|
|||
|
||||
std::string get_type_as_string() const;
|
||||
|
||||
float get_theta() const;
|
||||
float get_theta() const { return m_theta; }
|
||||
void set_theta(float theta);
|
||||
|
||||
#if ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
const Vec3d& get_target() const { return m_target; }
|
||||
void set_target(const Vec3d& target, GLCanvas3D& canvas);
|
||||
|
||||
const BoundingBoxf3& get_scene_box() const { return m_scene_box; }
|
||||
void set_scene_box(const BoundingBoxf3& box, GLCanvas3D& canvas);
|
||||
#endif // ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
};
|
||||
|
||||
class Bed
|
||||
|
@ -782,7 +796,9 @@ private:
|
|||
wxWindow *m_external_gizmo_widgets_parent;
|
||||
#endif // not ENABLE_IMGUI
|
||||
|
||||
#if !ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
void viewport_changed();
|
||||
#endif // !ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
|
||||
public:
|
||||
GLCanvas3D(wxGLCanvas* canvas);
|
||||
|
@ -845,6 +861,9 @@ public:
|
|||
float get_camera_zoom() const;
|
||||
|
||||
BoundingBoxf3 volumes_bounding_box() const;
|
||||
#if ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
BoundingBoxf3 scene_bounding_box() const;
|
||||
#endif // ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
|
||||
bool is_layers_editing_enabled() const;
|
||||
bool is_layers_editing_allowed() const;
|
||||
|
@ -936,6 +955,10 @@ public:
|
|||
|
||||
void update_gizmos_on_off_state();
|
||||
|
||||
#if ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
void viewport_changed();
|
||||
#endif // ENABLE_CONSTRAINED_CAMERA_TARGET
|
||||
|
||||
private:
|
||||
bool _is_shown_on_screen() const;
|
||||
void _force_zoom_to_bed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue