mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-29 06:13:16 +08:00
ENH:Unified color scheme for sectional views
jira: STUDIO-10704 Change-Id: I957f71f1610d000c89d81647b21c1f3afe79855e
This commit is contained in:
parent
986f0c72b8
commit
0f27f9d00d
@ -7,7 +7,7 @@
|
|||||||
#include "slic3r/GUI/GUI_App.hpp"
|
#include "slic3r/GUI/GUI_App.hpp"
|
||||||
#include "slic3r/GUI/Camera.hpp"
|
#include "slic3r/GUI/Camera.hpp"
|
||||||
#include "slic3r/GUI/Plater.hpp"
|
#include "slic3r/GUI/Plater.hpp"
|
||||||
|
#include "slic3r/GUI/OpenGLManager.hpp"
|
||||||
#include "libslic3r/PresetBundle.hpp"
|
#include "libslic3r/PresetBundle.hpp"
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
@ -430,7 +430,7 @@ void CommonGizmosDataObjects::ObjectClipper::render_cut(const std::vector<size_t
|
|||||||
clipper.first->set_plane(*m_clp);
|
clipper.first->set_plane(*m_clp);
|
||||||
clipper.first->set_transformation(trafo);
|
clipper.first->set_transformation(trafo);
|
||||||
clipper.first->set_limiting_plane(ClippingPlane(Vec3d::UnitZ(), -SINKING_Z_THRESHOLD));
|
clipper.first->set_limiting_plane(ClippingPlane(Vec3d::UnitZ(), -SINKING_Z_THRESHOLD));
|
||||||
clipper.first->render_cut({1.0f, 0.37f, 0.0f, 1.0f}, &ignore_idxs_local);
|
clipper.first->render_cut(OpenGLManager::get_cut_plane_color(), &ignore_idxs_local);
|
||||||
clipper.first->render_contour({1.f, 1.f, 1.f, 1.f}, &ignore_idxs_local);
|
clipper.first->render_contour({1.f, 1.f, 1.f, 1.f}, &ignore_idxs_local);
|
||||||
|
|
||||||
// Now update the ignore idxs. Find the first element belonging to the next clipper,
|
// Now update the ignore idxs. Find the first element belonging to the next clipper,
|
||||||
@ -618,7 +618,7 @@ void SupportsClipper::render_cut() const
|
|||||||
m_clipper->set_plane(*ocl->get_clipping_plane());
|
m_clipper->set_plane(*ocl->get_clipping_plane());
|
||||||
m_clipper->set_transformation(supports_trafo);
|
m_clipper->set_transformation(supports_trafo);
|
||||||
|
|
||||||
m_clipper->render_cut({1.0f, 0.f, 0.37f, 1.0f});
|
m_clipper->render_cut(OpenGLManager::get_cut_plane_color());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ void ModelObjectsClipper::render_cut() const
|
|||||||
clipper->set_plane(*m_clp);
|
clipper->set_plane(*m_clp);
|
||||||
clipper->set_transformation(trafo);
|
clipper->set_transformation(trafo);
|
||||||
// BBS
|
// BBS
|
||||||
clipper->render_cut({0.25f, 0.25f, 0.25f, 1.0f});
|
clipper->render_cut(OpenGLManager::get_cut_plane_color());
|
||||||
|
|
||||||
++clipper_id;
|
++clipper_id;
|
||||||
}
|
}
|
||||||
|
@ -476,6 +476,7 @@ bool OpenGLManager::m_use_manually_generated_mipmaps = true;
|
|||||||
OpenGLManager::EMultisampleState OpenGLManager::s_multisample = OpenGLManager::EMultisampleState::Unknown;
|
OpenGLManager::EMultisampleState OpenGLManager::s_multisample = OpenGLManager::EMultisampleState::Unknown;
|
||||||
OpenGLManager::EFramebufferType OpenGLManager::s_framebuffers_type = OpenGLManager::EFramebufferType::Unknown;
|
OpenGLManager::EFramebufferType OpenGLManager::s_framebuffers_type = OpenGLManager::EFramebufferType::Unknown;
|
||||||
bool OpenGLManager::s_b_initialized = false;
|
bool OpenGLManager::s_b_initialized = false;
|
||||||
|
ColorRGBA OpenGLManager::s_cut_plane_color = {1.0f, 0.37f, 0.0f, 1.0f};
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// Part of hack to remove crash when closing the application on OSX 10.9.5 when building against newer wxWidgets
|
// Part of hack to remove crash when closing the application on OSX 10.9.5 when building against newer wxWidgets
|
||||||
OpenGLManager::OSInfo OpenGLManager::s_os_info;
|
OpenGLManager::OSInfo OpenGLManager::s_os_info;
|
||||||
@ -1013,6 +1014,14 @@ wxGLCanvas* OpenGLManager::create_wxglcanvas(wxWindow& parent, EMSAAType msaa_ty
|
|||||||
return new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
|
return new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenGLManager::set_cut_plane_color(ColorRGBA color) {
|
||||||
|
s_cut_plane_color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ColorRGBA &OpenGLManager::get_cut_plane_color(){
|
||||||
|
return s_cut_plane_color;
|
||||||
|
}
|
||||||
|
|
||||||
void OpenGLManager::detect_multisample(int* attribList)
|
void OpenGLManager::detect_multisample(int* attribList)
|
||||||
{
|
{
|
||||||
int wxVersion = wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + wxRELEASE_NUMBER;
|
int wxVersion = wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + wxRELEASE_NUMBER;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define slic3r_OpenGLManager_hpp_
|
#define slic3r_OpenGLManager_hpp_
|
||||||
|
|
||||||
#include "GLShadersManager.hpp"
|
#include "GLShadersManager.hpp"
|
||||||
|
#include "libslic3r/Color.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -210,6 +211,8 @@ private:
|
|||||||
static EMultisampleState s_multisample;
|
static EMultisampleState s_multisample;
|
||||||
static EFramebufferType s_framebuffers_type;
|
static EFramebufferType s_framebuffers_type;
|
||||||
static bool m_use_manually_generated_mipmaps;
|
static bool m_use_manually_generated_mipmaps;
|
||||||
|
static ColorRGBA s_cut_plane_color;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OpenGLManager();
|
OpenGLManager();
|
||||||
~OpenGLManager();
|
~OpenGLManager();
|
||||||
@ -252,6 +255,9 @@ public:
|
|||||||
static wxGLCanvas* create_wxglcanvas(wxWindow& parent, EMSAAType msaa_type = EMSAAType::Disabled);
|
static wxGLCanvas* create_wxglcanvas(wxWindow& parent, EMSAAType msaa_type = EMSAAType::Disabled);
|
||||||
static const GLInfo& get_gl_info() { return s_gl_info; }
|
static const GLInfo& get_gl_info() { return s_gl_info; }
|
||||||
static bool use_manually_generated_mipmaps() { return m_use_manually_generated_mipmaps; }
|
static bool use_manually_generated_mipmaps() { return m_use_manually_generated_mipmaps; }
|
||||||
|
static void set_cut_plane_color(ColorRGBA);
|
||||||
|
static const ColorRGBA &get_cut_plane_color();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void detect_multisample(int* attribList);
|
static void detect_multisample(int* attribList);
|
||||||
void _bind_frame_buffer(const std::string& name, EMSAAType msaa_type, uint32_t t_width = 0, uint32_t t_height = 0);
|
void _bind_frame_buffer(const std::string& name, EMSAAType msaa_type, uint32_t t_width = 0, uint32_t t_height = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user