Include cleanup: do not include Model.hpp from 3DScene.hpp

This commit is contained in:
Lukas Matena 2020-05-24 00:01:34 +02:00
parent f78f5c85be
commit fb9d8b2025
9 changed files with 44 additions and 35 deletions

View file

@ -724,7 +724,7 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
glsafe(::glDisable(GL_BLEND));
}
bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, ModelInstance::EPrintVolumeState* out_state)
bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, ModelInstanceEPrintVolumeState* out_state)
{
if (config == nullptr)
return false;
@ -738,7 +738,7 @@ bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, M
// Allow the objects to protrude below the print bed
print_volume.min(2) = -1e10;
ModelInstance::EPrintVolumeState state = ModelInstance::PVS_Inside;
ModelInstanceEPrintVolumeState state = ModelInstancePVS_Inside;
bool contained_min_one = false;
@ -757,11 +757,11 @@ bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, M
if (contained)
contained_min_one = true;
if ((state == ModelInstance::PVS_Inside) && volume->is_outside)
state = ModelInstance::PVS_Fully_Outside;
if ((state == ModelInstancePVS_Inside) && volume->is_outside)
state = ModelInstancePVS_Fully_Outside;
if ((state == ModelInstance::PVS_Fully_Outside) && volume->is_outside && print_volume.intersects(bb))
state = ModelInstance::PVS_Partly_Outside;
if ((state == ModelInstancePVS_Fully_Outside) && volume->is_outside && print_volume.intersects(bb))
state = ModelInstancePVS_Partly_Outside;
}
if (out_state != nullptr)

View file

@ -6,7 +6,8 @@
#include "libslic3r/Line.hpp"
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Model.hpp"
//#include "libslic3r/Model.hpp"
#include "libslic3r/Geometry.hpp"
#include <functional>
@ -40,6 +41,9 @@ class ExtrusionMultiPath;
class ExtrusionLoop;
class ExtrusionEntity;
class ExtrusionEntityCollection;
class ModelObject;
class ModelVolume;
enum ModelInstanceEPrintVolumeState : unsigned char;
// A container for interleaved arrays of 3D vertices and normals,
// possibly indexed by triangles and / or quads.
@ -578,7 +582,7 @@ public:
// returns true if all the volumes are completely contained in the print volume
// returns the containment state in the given out_state, if non-null
bool check_outside_state(const DynamicPrintConfig* config, ModelInstance::EPrintVolumeState* out_state);
bool check_outside_state(const DynamicPrintConfig* config, ModelInstanceEPrintVolumeState* out_state);
void reset_outside_state();
void update_colors_by_extruder(const DynamicPrintConfig* config);

View file

@ -1694,7 +1694,7 @@ void GLCanvas3D::reset_volumes()
int GLCanvas3D::check_volumes_outside_state() const
{
ModelInstance::EPrintVolumeState state;
ModelInstanceEPrintVolumeState state;
m_volumes.check_outside_state(m_config, &state);
return (int)state;
}
@ -2578,15 +2578,15 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
// checks for geometry outside the print volume to render it accordingly
if (!m_volumes.empty())
{
ModelInstance::EPrintVolumeState state;
ModelInstanceEPrintVolumeState state;
const bool contained_min_one = m_volumes.check_outside_state(m_config, &state);
_set_warning_texture(WarningTexture::ObjectClashed, state == ModelInstance::PVS_Partly_Outside);
_set_warning_texture(WarningTexture::ObjectOutside, state == ModelInstance::PVS_Fully_Outside);
_set_warning_texture(WarningTexture::ObjectClashed, state == ModelInstancePVS_Partly_Outside);
_set_warning_texture(WarningTexture::ObjectOutside, state == ModelInstancePVS_Fully_Outside);
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS,
contained_min_one && !m_model->objects.empty() && state != ModelInstance::PVS_Partly_Outside));
contained_min_one && !m_model->objects.empty() && state != ModelInstancePVS_Partly_Outside));
}
else
{

View file

@ -15,6 +15,8 @@
#include "GLSelectionRectangle.hpp"
#include "MeshUtils.hpp"
#include "libslic3r/Slicing.hpp"
#include <float.h>
#include <wx/timer.h>
@ -33,13 +35,13 @@ class wxGLContext;
namespace Slic3r {
class Bed3D;
struct Camera;
class BackgroundSlicingProcess;
class GCodePreviewData;
struct ThumbnailData;
struct SlicingParameters;
enum LayerHeightEditActionType : unsigned int;
class ModelObject;
class ModelInstance;
class PrintObject;
namespace GUI {

View file

@ -3,9 +3,9 @@
#include <wx/panel.h>
#include "libslic3r/Point.hpp"
#include "libslic3r/CustomGCode.hpp"
#include <string>
#include "libslic3r/Model.hpp"
class wxNotebook;
class wxGLCanvas;

View file

@ -2626,7 +2626,7 @@ void Plater::priv::object_list_changed()
{
const bool export_in_progress = this->background_process.is_export_scheduled(); // || ! send_gcode_file.empty());
// XXX: is this right?
const bool model_fits = view3D->check_volumes_outside_state() == ModelInstance::PVS_Inside;
const bool model_fits = view3D->check_volumes_outside_state() == ModelInstancePVS_Inside;
sidebar->enable_buttons(!model.objects.empty() && !export_in_progress && model_fits);
}
@ -3318,7 +3318,7 @@ void Plater::priv::set_current_panel(wxPanel* panel)
// see: Plater::priv::object_list_changed()
// FIXME: it may be better to have a single function making this check and let it be called wherever needed
bool export_in_progress = this->background_process.is_export_scheduled();
bool model_fits = view3D->check_volumes_outside_state() != ModelInstance::PVS_Partly_Outside;
bool model_fits = view3D->check_volumes_outside_state() != ModelInstancePVS_Partly_Outside;
if (!model.objects.empty() && !export_in_progress && model_fits)
this->q->reslice();
// keeps current gcode preview, if any

View file

@ -3,8 +3,10 @@
#include <set>
#include "libslic3r/Geometry.hpp"
#include "libslic3r/Model.hpp"
#include "3DScene.hpp"
#if ENABLE_RENDER_SELECTION_CENTER
class GLUquadric;
typedef class GLUquadric GLUquadricObj;