BREAKING CHANGE: source that names Hi.Geom.Vec3d or Hi.Geom.Vec2d as the vector type must say vec3d_t / vec2d_t. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Hi.Disp;
|
|
using Hi.Disp.Flag;
|
|
using Hi.Geom;
|
|
using Hi.Coloring;
|
|
|
|
namespace Sample.Disp
|
|
{
|
|
/// <summary>
|
|
/// Demonstrates the use of discrete RGB colors for rendering multiple objects.
|
|
/// Shows how to apply different colors to similar geometric shapes using the
|
|
/// <see cref="ColorUtil.GetDiscreteRGB_Env"/> method from <see cref="ColorUtil"/> class.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// ### Source Code
|
|
/// [!code-csharp[SampleCode](~/../Hi.Sample/Disp/DemoDiscreteRgb.cs)]
|
|
/// </remarks>
|
|
public class DemoDiscreteRgb : IDisplayee
|
|
{
|
|
/// <inheritdoc/>
|
|
public void Display(Bind bind)
|
|
{
|
|
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
|
|
new Box3d(0, 0, 0, 1, 1, 1).ToDraw_Face().Display(bind);
|
|
|
|
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
|
|
new Box3d(1, 0, 0, 2, 1, 1).ToDraw_Face().Display(bind);
|
|
|
|
bind.Rgb = ColorUtil.GetDiscreteRGB_Env();
|
|
new Box3d(2, 0, 0, 3, 1, 1).ToDraw_Face().Display(bind);
|
|
}
|
|
/// <inheritdoc/>
|
|
public void ExpandToBox3d(Box3d dst)
|
|
{
|
|
dst.Expand(new vec3d_t(0, 0, 0));
|
|
dst.Expand(new vec3d_t(3, 1, 1));
|
|
}
|
|
|
|
static void Main()
|
|
{
|
|
DemoUtil.Present("Demo Discrete I",
|
|
new DispList(new CoordinateDrawing(), new DemoDiscreteRgb()));
|
|
}
|
|
|
|
}
|
|
}
|