Fixed obvious merge conflicts

FDM supports gizmo uses the new common data infrastructure
This commit is contained in:
Lukas Matena 2020-04-07 19:44:29 +02:00
parent a380053a17
commit 17811598ac
3 changed files with 70 additions and 186 deletions

View file

@ -9,25 +9,28 @@
namespace Slic3r {
namespace GUI {
class ClippingPlane;
/*class ClippingPlane;
class MeshClipper;
class MeshRaycaster;
class MeshRaycaster;*/
enum class SLAGizmoEventType : unsigned char;
class GLGizmoFdmSupports : public GLGizmoBase
{
private:
ModelObject* m_model_object = nullptr;
/*ModelObject* m_model_object = nullptr;
ObjectID m_model_object_id = 0;
std::vector<ObjectID> m_volumes_ids;
int m_active_instance = -1;
float m_active_instance_bb_radius; // to cache the bb
float m_active_instance_bb_radius; // to cache the bb*/
const ModelObject* m_old_mo = nullptr;
int m_old_volumes_size = 0;
GLUquadricObj* m_quadric;
std::vector<std::unique_ptr<MeshRaycaster>> m_meshes_raycaster;
std::vector<const TriangleMesh*> m_meshes;
mutable std::vector<Vec2f> m_triangles;
//std::vector<std::unique_ptr<MeshRaycaster>> m_meshes_raycaster;
//std::vector<const TriangleMesh*> m_meshes;
//mutable std::vector<Vec2f> m_triangles;
float m_cursor_radius = 2.f;
std::vector<std::vector<bool>> m_selected_facets;
@ -37,7 +40,6 @@ public:
~GLGizmoFdmSupports() override;
void set_fdm_support_data(ModelObject* model_object, const Selection& selection);
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down);
ClippingPlane get_fdm_clipping_plane() const;
using NeighborData = std::pair<size_t, size_t>;
@ -47,9 +49,9 @@ private:
void on_render_for_picking() const override;
void render_triangles(const Selection& selection) const;
void render_clipping_plane(const Selection& selection) const;
//void render_clipping_plane(const Selection& selection) const;
void render_cursor_circle() const;
bool is_mesh_update_necessary() const;
//bool is_mesh_update_necessary() const;
void update_mesh();
float m_clipping_plane_distance = 0.f;
@ -62,11 +64,11 @@ private:
bool m_wait_for_up_event = false;
EState m_old_state = Off; // to be able to see that the gizmo has just been closed (see on_set_state)
mutable std::vector<std::unique_ptr<MeshClipper>> m_meshes_clipper;
//mutable std::vector<std::unique_ptr<MeshClipper>> m_meshes_clipper;
std::vector<std::vector<NeighborData>> m_neighbors; // pairs of vertex_index - facet_index for each mesh
void update_clipping_plane(bool keep_normal = false) const;
//void update_clipping_plane(bool keep_normal = false) const;
protected:
void on_set_state() override;
@ -78,6 +80,7 @@ protected:
bool on_is_selectable() const override;
void on_load(cereal::BinaryInputArchive& ar) override;
void on_save(cereal::BinaryOutputArchive& ar) const override;
CommonGizmosDataID on_get_requirements() const override;
};