Tech ENABLE_COLOR_CLASSES - 1st installment -> Introduction of classes ColorRGB and ColorRGBA to unify color data definition and manipulation

This commit is contained in:
enricoturri1966 2021-12-22 10:45:35 +01:00
parent 48098fbaff
commit cd4094743e
53 changed files with 1810 additions and 60 deletions

View file

@ -144,7 +144,11 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
glsafe(::glTranslated(0.0, 0.0, z_shift));
glsafe(::glMultMatrixd(instance_matrix.data()));
#if ENABLE_COLOR_CLASSES
ColorRGBA render_color;
#else
std::array<float, 4> render_color;
#endif // ENABLE_COLOR_CLASSES
for (size_t i = 0; i < cache_size; ++i) {
const sla::SupportPoint& support_point = m_editing_mode ? m_editing_cache[i].support_point : m_normal_cache[i];
const bool& point_selected = m_editing_mode ? m_editing_cache[i].selected : false;
@ -226,10 +230,14 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
// Now render the drain holes:
if (has_holes && ! picking) {
#if ENABLE_COLOR_CLASSES
render_color = { 0.7f, 0.7f, 0.7f, 0.7f };
#else
render_color[0] = 0.7f;
render_color[1] = 0.7f;
render_color[2] = 0.7f;
render_color[3] = 0.7f;
#endif // ENABLE_COLOR_CLASSES
const_cast<GLModel*>(&m_cylinder)->set_color(-1, render_color);
if (shader)
shader->set_uniform("emission_factor", 0.5f);