FIX: fix color painting bugs

1. fix a crash when loading a 3mf painting with color idx larger than 15
2. fix the facets not display issue if painted with color 15

Signed-off-by: yifan.wu <yifan.wu@bambulab.com>
Change-Id: Idb53b6bb2d3665412815222ab9a1d47948afed56
This commit is contained in:
yifan.wu 2022-08-17 17:08:17 +08:00 committed by Lane.Wei
parent ad311a66d6
commit 4f44ca4117
3 changed files with 6 additions and 7 deletions

View file

@ -7,12 +7,10 @@
#include <cfloat>
#include "Point.hpp"
#include "TriangleMesh.hpp"
#include "libslic3r/Model.hpp"
namespace Slic3r {
enum class EnforcerBlockerType : int8_t;
// Following class holds information about selected triangles. It also has power
// to recursively subdivide the triangles and make the selection finer.
class TriangleSelector
@ -275,7 +273,7 @@ public:
std::pair<std::vector<std::pair<int, int>>, std::vector<bool>> serialize() const;
// Load serialized data. Assumes that correct mesh is loaded.
void deserialize(const std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>& data, bool needs_reset = true, EnforcerBlockerType max_ebt = (EnforcerBlockerType)std::numeric_limits<int8_t>::max());
void deserialize(const std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>& data, bool needs_reset = true, EnforcerBlockerType max_ebt = EnforcerBlockerType::ExtruderMax);
// For all triangles, remove the flag indicating that the triangle was selected by seed fill.
void seed_fill_unselect_all_triangles();
@ -312,7 +310,7 @@ protected:
void set_division(int sides_to_split, int special_side_idx);
// Get/set current state.
void set_state(EnforcerBlockerType type) { assert(! is_split()); state = type; }
void set_state(EnforcerBlockerType type) { assert(!is_split()); state = type; }
EnforcerBlockerType get_state() const { assert(! is_split()); return state; }
// Set if the triangle has been selected or unselected by seed fill.