mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-11 03:11:49 +08:00
Do not generate volumes' raycaster for preview
This commit is contained in:
parent
0d512a4256
commit
2bcb62d447
@ -437,9 +437,9 @@ std::vector<int> GLVolumeCollection::load_object(
|
|||||||
|
|
||||||
int GLVolumeCollection::load_object_volume(
|
int GLVolumeCollection::load_object_volume(
|
||||||
const ModelObject* model_object,
|
const ModelObject* model_object,
|
||||||
int obj_idx,
|
int obj_idx,
|
||||||
int volume_idx,
|
int volume_idx,
|
||||||
int instance_idx)
|
int instance_idx)
|
||||||
{
|
{
|
||||||
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
||||||
const int extruder_id = model_volume->extruder_id();
|
const int extruder_id = model_volume->extruder_id();
|
||||||
@ -452,10 +452,12 @@ int GLVolumeCollection::load_object_volume(
|
|||||||
v.printable = instance->printable;
|
v.printable = instance->printable;
|
||||||
#if ENABLE_SMOOTH_NORMALS
|
#if ENABLE_SMOOTH_NORMALS
|
||||||
v.model.init_from(*mesh, true);
|
v.model.init_from(*mesh, true);
|
||||||
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
if (m_use_raycasters)
|
||||||
|
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
||||||
#else
|
#else
|
||||||
v.model.init_from(*mesh);
|
v.model.init_from(*mesh);
|
||||||
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
if (m_use_raycasters)
|
||||||
|
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
||||||
#endif // ENABLE_SMOOTH_NORMALS
|
#endif // ENABLE_SMOOTH_NORMALS
|
||||||
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
||||||
if (model_volume->is_model_part()) {
|
if (model_volume->is_model_part()) {
|
||||||
|
@ -397,6 +397,7 @@ private:
|
|||||||
Slope m_slope;
|
Slope m_slope;
|
||||||
bool m_show_sinking_contours{ false };
|
bool m_show_sinking_contours{ false };
|
||||||
bool m_show_non_manifold_edges{ true };
|
bool m_show_non_manifold_edges{ true };
|
||||||
|
bool m_use_raycasters{ true };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GLVolumePtrs volumes;
|
GLVolumePtrs volumes;
|
||||||
@ -445,6 +446,7 @@ public:
|
|||||||
bool empty() const { return volumes.empty(); }
|
bool empty() const { return volumes.empty(); }
|
||||||
void set_range(double low, double high) { for (GLVolume* vol : this->volumes) vol->set_range(low, high); }
|
void set_range(double low, double high) { for (GLVolume* vol : this->volumes) vol->set_range(low, high); }
|
||||||
|
|
||||||
|
void set_use_raycasters(bool value) { m_use_raycasters = value; }
|
||||||
void set_print_volume(const PrintVolume& print_volume) { m_print_volume = print_volume; }
|
void set_print_volume(const PrintVolume& print_volume) { m_print_volume = print_volume; }
|
||||||
|
|
||||||
void set_z_range(float min_z, float max_z) { m_z_range[0] = min_z; m_z_range[1] = max_z; }
|
void set_z_range(float min_z, float max_z) { m_z_range[0] = min_z; m_z_range[1] = max_z; }
|
||||||
|
@ -643,7 +643,7 @@ const ColorRGBA GCodeViewer::Neutral_Color = ColorRGBA::DARK_GRAY();
|
|||||||
GCodeViewer::GCodeViewer()
|
GCodeViewer::GCodeViewer()
|
||||||
{
|
{
|
||||||
m_extrusions.reset_role_visibility_flags();
|
m_extrusions.reset_role_visibility_flags();
|
||||||
|
m_shells.volumes.set_use_raycasters(false);
|
||||||
// m_sequential_view.skip_invisible_moves = true;
|
// m_sequential_view.skip_invisible_moves = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user