FIX:add "visible" for GLModel
jira: STUDIO-10126 Change-Id: I95c7882db09e3a86012c0f1a184e505bfd0bdd87
This commit is contained in:
parent
968dc86710
commit
2676c47259
|
@ -1143,6 +1143,12 @@ void GLModel::render_instanced(unsigned int instances_vbo, unsigned int instance
|
||||||
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
|
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLModel::set_visible(bool flag) {
|
||||||
|
if (m_visible != flag) {
|
||||||
|
m_visible = flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool GLModel::send_to_gpu(Geometry &geometry)
|
bool GLModel::send_to_gpu(Geometry &geometry)
|
||||||
{
|
{
|
||||||
if (m_render_data.size() != 1) { return false; }
|
if (m_render_data.size() != 1) { return false; }
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace GUI {
|
||||||
|
|
||||||
BoundingBoxf3 m_bounding_box;
|
BoundingBoxf3 m_bounding_box;
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
|
bool m_visible = true;
|
||||||
public:
|
public:
|
||||||
GLModel() = default;
|
GLModel() = default;
|
||||||
virtual ~GLModel();
|
virtual ~GLModel();
|
||||||
|
@ -204,6 +204,8 @@ namespace GUI {
|
||||||
const BoundingBoxf3& get_bounding_box() const { return m_bounding_box; }
|
const BoundingBoxf3& get_bounding_box() const { return m_bounding_box; }
|
||||||
const std::string& get_filename() const { return m_filename; }
|
const std::string& get_filename() const { return m_filename; }
|
||||||
|
|
||||||
|
void set_visible(bool flag);
|
||||||
|
bool get_visible() const { return m_visible; }
|
||||||
private:
|
private:
|
||||||
bool send_to_gpu(Geometry& geometry);
|
bool send_to_gpu(Geometry& geometry);
|
||||||
bool send_to_gpu(RenderData &data, const std::vector<float> &vertices, const std::vector<unsigned int> &indices) const;
|
bool send_to_gpu(RenderData &data, const std::vector<float> &vertices, const std::vector<unsigned int> &indices) const;
|
||||||
|
|
|
@ -748,6 +748,9 @@ void PartPlate::render_icons(bool bottom, bool only_body, int hover_id)
|
||||||
render_icon_texture(m_partplate_list->m_plate_filament_map_icon, m_partplate_list->m_plate_set_filament_map_hovered_texture);
|
render_icon_texture(m_partplate_list->m_plate_filament_map_icon, m_partplate_list->m_plate_set_filament_map_hovered_texture);
|
||||||
else
|
else
|
||||||
render_icon_texture(m_partplate_list->m_plate_filament_map_icon, m_partplate_list->m_plate_set_filament_map_texture);
|
render_icon_texture(m_partplate_list->m_plate_filament_map_icon, m_partplate_list->m_plate_set_filament_map_texture);
|
||||||
|
m_partplate_list->m_plate_filament_map_icon.set_visible(true);
|
||||||
|
} else {
|
||||||
|
m_partplate_list->m_plate_filament_map_icon.set_visible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hover_id == PLATE_NAME_ID)
|
if (hover_id == PLATE_NAME_ID)
|
||||||
|
@ -769,6 +772,10 @@ void PartPlate::render_icons(bool bottom, bool only_body, int hover_id)
|
||||||
else
|
else
|
||||||
render_icon_texture(m_partplate_list->m_plate_settings_icon, m_partplate_list->m_plate_settings_changed_texture);
|
render_icon_texture(m_partplate_list->m_plate_settings_icon, m_partplate_list->m_plate_settings_changed_texture);
|
||||||
}
|
}
|
||||||
|
m_partplate_list->m_plate_settings_icon.set_visible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_partplate_list->m_plate_settings_icon.set_visible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render_plate_name_texture();
|
render_plate_name_texture();
|
||||||
|
@ -1013,6 +1020,9 @@ void PartPlate::on_render_for_picking() {
|
||||||
&m_partplate_list->m_lock_icon, &m_partplate_list->m_plate_settings_icon,
|
&m_partplate_list->m_lock_icon, &m_partplate_list->m_plate_settings_icon,
|
||||||
&m_partplate_list->m_plate_filament_map_icon, &m_plate_name_edit_icon};
|
&m_partplate_list->m_plate_filament_map_icon, &m_plate_name_edit_icon};
|
||||||
for (size_t i = 0; i < gl_models.size(); i++) {
|
for (size_t i = 0; i < gl_models.size(); i++) {
|
||||||
|
if (!gl_models[i]->get_visible()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
int hover_id = i;
|
int hover_id = i;
|
||||||
std::array<float, 4> color = picking_color_component(hover_id);
|
std::array<float, 4> color = picking_color_component(hover_id);
|
||||||
gl_models[i]->set_color(-1, color);
|
gl_models[i]->set_color(-1, color);
|
||||||
|
|
Loading…
Reference in New Issue