mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 02:55:55 +08:00
Tech ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX merged into tech ENABLE_WORLD_COORDINATE
This commit is contained in:
parent
7af8f92f84
commit
cee18d5bde
@ -73,8 +73,6 @@
|
||||
#define ENABLE_WORLD_COORDINATE (1 && ENABLE_2_5_0_ALPHA1)
|
||||
// Enable showing world coordinates of volumes' offset relative to the instance containing them
|
||||
#define ENABLE_WORLD_COORDINATE_VOLUMES_LOCAL_OFFSET (0 && ENABLE_WORLD_COORDINATE)
|
||||
// Enable rendering the selection bounding box in the current reference system
|
||||
#define ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX (1 && ENABLE_WORLD_COORDINATE)
|
||||
// Enable showing the axes of the current reference system when sidebar hints are active
|
||||
#define ENABLE_WORLD_COORDINATE_SHOW_AXES (1 && ENABLE_WORLD_COORDINATE)
|
||||
// Enable alternate implementation of manipulating scale for instances and volumes
|
||||
|
@ -1472,7 +1472,7 @@ void Selection::render(float scale_factor)
|
||||
m_scale_factor = scale_factor;
|
||||
// render cumulative bounding box of selected volumes
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
BoundingBoxf3 box;
|
||||
Transform3d trafo;
|
||||
const ECoordinatesType coordinates_type = wxGetApp().obj_manipul()->get_coordinates_type();
|
||||
@ -1498,7 +1498,7 @@ void Selection::render(float scale_factor)
|
||||
render_bounding_box(box, trafo, ColorRGB::WHITE());
|
||||
#else
|
||||
render_bounding_box(get_bounding_box(), ColorRGB::WHITE());
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
#else
|
||||
render_selected_volumes();
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
@ -2194,11 +2194,11 @@ void Selection::render_synchronized_volumes()
|
||||
float color[3] = { 1.0f, 1.0f, 0.0f };
|
||||
#endif // !ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
const ECoordinatesType coordinates_type = wxGetApp().obj_manipul()->get_coordinates_type();
|
||||
BoundingBoxf3 box;
|
||||
Transform3d trafo;
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
|
||||
for (unsigned int i : m_list) {
|
||||
const GLVolume& volume = *(*m_volumes)[i];
|
||||
@ -2213,7 +2213,7 @@ void Selection::render_synchronized_volumes()
|
||||
continue;
|
||||
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
if (coordinates_type == ECoordinatesType::World) {
|
||||
box = v.transformed_convex_hull_bounding_box();
|
||||
trafo = Transform3d::Identity();
|
||||
@ -2229,7 +2229,7 @@ void Selection::render_synchronized_volumes()
|
||||
render_bounding_box(box, trafo, ColorRGB::YELLOW());
|
||||
#else
|
||||
render_bounding_box(v.transformed_convex_hull_bounding_box(), ColorRGB::YELLOW());
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
#else
|
||||
render_bounding_box(v.transformed_convex_hull_bounding_box(), color);
|
||||
#endif // ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
@ -2238,11 +2238,11 @@ void Selection::render_synchronized_volumes()
|
||||
}
|
||||
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
void Selection::render_bounding_box(const BoundingBoxf3& box, const Transform3d& trafo, const ColorRGB& color)
|
||||
#else
|
||||
void Selection::render_bounding_box(const BoundingBoxf3& box, const ColorRGB& color)
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
{
|
||||
#else
|
||||
void Selection::render_bounding_box(const BoundingBoxf3 & box, float* color) const
|
||||
@ -2347,32 +2347,32 @@ void Selection::render_bounding_box(const BoundingBoxf3 & box, float* color) con
|
||||
if (shader == nullptr)
|
||||
return;
|
||||
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
#if !ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
glsafe(::glPushMatrix());
|
||||
glsafe(::glMultMatrixd(trafo.data()));
|
||||
#endif // !ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
|
||||
shader->start_using();
|
||||
#if ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
shader->set_uniform("view_model_matrix", camera.get_view_matrix() * trafo);
|
||||
#else
|
||||
shader->set_uniform("view_model_matrix", camera.get_view_matrix());
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
m_box.set_color(to_rgba(color));
|
||||
m_box.render();
|
||||
shader->stop_using();
|
||||
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
#if !ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
glsafe(::glPopMatrix());
|
||||
#endif // !ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
#else
|
||||
::glBegin(GL_LINES);
|
||||
|
||||
|
@ -412,11 +412,11 @@ private:
|
||||
void set_bounding_boxes_dirty() { m_bounding_box.reset(); m_unscaled_instance_bounding_box.reset(); m_scaled_instance_bounding_box.reset(); }
|
||||
void render_synchronized_volumes();
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#if ENABLE_WORLD_COORDINATE
|
||||
void render_bounding_box(const BoundingBoxf3& box, const Transform3d& trafo, const ColorRGB& color);
|
||||
#else
|
||||
void render_bounding_box(const BoundingBoxf3& box, const ColorRGB& color);
|
||||
#endif // ENABLE_COORDINATE_DEPENDENT_SELECTION_BOX
|
||||
#endif // ENABLE_WORLD_COORDINATE
|
||||
#else
|
||||
void render_selected_volumes() const;
|
||||
void render_bounding_box(const BoundingBoxf3& box, float* color) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user