mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
GLCanvas3DManager moved from being a static member of _3DScene to be a normal member of GUI_App
This commit is contained in:
parent
47604b6326
commit
0b629eb905
24 changed files with 738 additions and 24 deletions
|
@ -8,7 +8,9 @@
|
|||
#include "GLToolbar.hpp"
|
||||
#include "Event.hpp"
|
||||
#include "3DBed.hpp"
|
||||
#if !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
#include "Camera.hpp"
|
||||
#endif // !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
#include "Selection.hpp"
|
||||
#include "Gizmos/GLGizmosManager.hpp"
|
||||
#include "GUI_ObjectLayers.hpp"
|
||||
|
@ -26,6 +28,9 @@ class wxMouseEvent;
|
|||
class wxTimerEvent;
|
||||
class wxPaintEvent;
|
||||
class wxGLCanvas;
|
||||
#if ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
class wxGLContext;
|
||||
#endif // ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
|
||||
// Support for Retina OpenGL on Mac OS
|
||||
#define ENABLE_RETINA_GL __APPLE__
|
||||
|
@ -406,9 +411,11 @@ private:
|
|||
LegendTexture m_legend_texture;
|
||||
WarningTexture m_warning_texture;
|
||||
wxTimer m_timer;
|
||||
#if !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
Bed3D& m_bed;
|
||||
Camera& m_camera;
|
||||
GLToolbar& m_view_toolbar;
|
||||
#endif // !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
LayersEditing m_layers_editing;
|
||||
Shader m_shader;
|
||||
Mouse m_mouse;
|
||||
|
@ -469,9 +476,17 @@ private:
|
|||
Labels m_labels;
|
||||
|
||||
public:
|
||||
#if ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
explicit GLCanvas3D(wxGLCanvas* canvas);
|
||||
#else
|
||||
GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar);
|
||||
#endif // ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
~GLCanvas3D();
|
||||
|
||||
#if ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
bool is_initialized() const { return m_initialized; }
|
||||
#endif // ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
|
||||
void set_context(wxGLContext* context) { m_context = context; }
|
||||
|
||||
wxGLCanvas* get_wxglcanvas() { return m_canvas; }
|
||||
|
@ -518,9 +533,14 @@ public:
|
|||
|
||||
void set_color_by(const std::string& value);
|
||||
|
||||
#if ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
void refresh_camera_scene_box();
|
||||
#else
|
||||
void refresh_camera_scene_box() { m_camera.set_scene_box(scene_bounding_box()); }
|
||||
const Camera& get_camera() const { return m_camera; }
|
||||
const Shader& get_shader() const { return m_shader; }
|
||||
Camera& get_camera() { return m_camera; }
|
||||
#endif // ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
const Shader& get_shader() const { return m_shader; }
|
||||
|
||||
BoundingBoxf3 volumes_bounding_box() const;
|
||||
BoundingBoxf3 scene_bounding_box() const;
|
||||
|
@ -614,7 +634,9 @@ public:
|
|||
|
||||
void update_ui_from_settings();
|
||||
|
||||
#if !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
float get_view_toolbar_height() const { return m_view_toolbar.get_height(); }
|
||||
#endif // !ENABLE_NON_STATIC_CANVAS_MANAGER
|
||||
|
||||
int get_move_volume_id() const { return m_mouse.drag.move_volume_idx; }
|
||||
int get_first_hover_volume_idx() const { return m_hover_volume_idxs.empty() ? -1 : m_hover_volume_idxs.front(); }
|
||||
|
@ -646,7 +668,6 @@ public:
|
|||
Linef3 mouse_ray(const Point& mouse_pos);
|
||||
|
||||
void set_mouse_as_dragging() { m_mouse.dragging = true; }
|
||||
void refresh_camera_scene_box() { m_camera.set_scene_box(scene_bounding_box()); }
|
||||
bool is_mouse_dragging() const { return m_mouse.dragging; }
|
||||
|
||||
double get_size_proportional_to_max_bed_size(double factor) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue