'gouraud' shader modified to allow to draw an object with two different colors in Cut Gizmo

This commit is contained in:
enricoturri1966 2023-02-09 15:03:39 +01:00 committed by YuSanka
parent b40473be51
commit 224ee922c5
10 changed files with 89 additions and 24 deletions

View file

@ -387,6 +387,12 @@ private:
// plane coeffs for clipping in shaders
std::array<double, 4> m_clipping_plane;
// plane coeffs for render volumes with different colors in shaders
// used by cut gizmo
std::array<double, 4> m_color_clip_plane;
bool m_use_color_clip_plane{ false };
std::array<ColorRGBA, 2> m_color_clip_plane_colors{ ColorRGBA::RED(), ColorRGBA::BLUE() };
struct Slope
{
// toggle for slope rendering
@ -445,6 +451,10 @@ public:
const std::array<float, 2>& get_z_range() const { return m_z_range; }
const std::array<double, 4>& get_clipping_plane() const { return m_clipping_plane; }
void set_use_color_clip_plane(bool use) { m_use_color_clip_plane = use; }
void set_color_clip_plane(const std::array<double, 4>& coeffs) { m_color_clip_plane = coeffs; }
void set_color_clip_plane_colors(const std::array<ColorRGBA, 2>& colors) { m_color_clip_plane_colors = colors; }
bool is_slope_active() const { return m_slope.active; }
void set_slope_active(bool active) { m_slope.active = active; }