Do not generate volumes' raycaster for preview

This commit is contained in:
enricoturri1966 2022-12-12 08:27:19 +01:00
parent 0d512a4256
commit 2bcb62d447
3 changed files with 10 additions and 6 deletions

View File

@ -452,9 +452,11 @@ int GLVolumeCollection::load_object_volume(
v.printable = instance->printable;
#if ENABLE_SMOOTH_NORMALS
v.model.init_from(*mesh, true);
if (m_use_raycasters)
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
#else
v.model.init_from(*mesh);
if (m_use_raycasters)
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
#endif // ENABLE_SMOOTH_NORMALS
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);

View File

@ -397,6 +397,7 @@ private:
Slope m_slope;
bool m_show_sinking_contours{ false };
bool m_show_non_manifold_edges{ true };
bool m_use_raycasters{ true };
public:
GLVolumePtrs volumes;
@ -445,6 +446,7 @@ public:
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_use_raycasters(bool value) { m_use_raycasters = value; }
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; }

View File

@ -643,7 +643,7 @@ const ColorRGBA GCodeViewer::Neutral_Color = ColorRGBA::DARK_GRAY();
GCodeViewer::GCodeViewer()
{
m_extrusions.reset_role_visibility_flags();
m_shells.volumes.set_use_raycasters(false);
// m_sequential_view.skip_invisible_moves = true;
}