public override void OnInitialize() { base.OnInitialize(); int whichHeight = 112; int whichWidth = 300; int windingHeight = 140; int windingWidth = 300; m_WhichShape = new rbox_ctrl(0.0, Height - whichHeight, whichWidth, Height); AddChild(m_WhichShape); m_WhichShape.add_item("Nested Rects All CCW"); m_WhichShape.add_item("Nested Rects CCW, CW, CW"); m_WhichShape.add_item("Rects And Triangle"); m_WhichShape.add_item("Complex Path"); m_WhichShape.cur_item(0); m_WhichShape.background_color(new RGBA_Doubles(0.0, 0.0, 0.0, 0.1)); m_WhichShape.text_size(12.0); m_WhichShape.text_thickness(2); m_WindingRule = new rbox_ctrl(whichWidth + 100, Height - windingHeight, whichWidth + 100 + windingWidth, Height); AddChild(m_WindingRule); m_WindingRule.add_item("Winding ODD"); m_WindingRule.add_item("Winding NON-ZERO"); m_WindingRule.add_item("Winding POSITIVE"); m_WindingRule.add_item("Winding NEGATIVE"); m_WindingRule.add_item("Winding ABS >= 2"); m_WindingRule.cur_item(0); m_WindingRule.background_color(new RGBA_Doubles(0.0, 0.0, 0.0, 0.1)); m_WindingRule.text_size(12.0); m_WindingRule.text_thickness(2); m_EdgeFlag = new cbox_ctrl(10, Height - whichHeight - 40, "Turn on Edge Flag"); m_EdgeFlag.status(true); AddChild(m_EdgeFlag); m_BoundryOnly = new cbox_ctrl(10, Height - whichHeight - 20, "Render Only Boundary"); AddChild(m_BoundryOnly); Tesselate_Tests test = new Tesselate_Tests(); test.MatchesGLUTesselator(); }
public override void OnInitialize() { base.OnInitialize(); int whichHeight = 112; int whichWidth = 300; int windingHeight = 140; int windingWidth = 300; m_WhichShape = new rbox_ctrl(0.0, Height - whichHeight, whichWidth, Height); AddChild(m_WhichShape); m_WhichShape.add_item("Nested Rects All CCW"); m_WhichShape.add_item("Nested Rects CCW, CW, CW"); m_WhichShape.add_item("Rects And Triangle"); m_WhichShape.add_item("Complex Path"); m_WhichShape.cur_item(0); m_WhichShape.background_color(new RGBA_Doubles(0.0, 0.0, 0.0, 0.1)); m_WhichShape.text_size(12.0); m_WhichShape.text_thickness(2); m_WindingRule = new rbox_ctrl(whichWidth + 100, Height - windingHeight, whichWidth + 100 + windingWidth, Height); AddChild(m_WindingRule); m_WindingRule.add_item("Winding ODD"); m_WindingRule.add_item("Winding NON-ZERO"); m_WindingRule.add_item("Winding POSITIVE"); m_WindingRule.add_item("Winding NEGATIVE"); m_WindingRule.add_item("Winding ABS >= 2"); m_WindingRule.cur_item(0); m_WindingRule.background_color(new RGBA_Doubles(0.0, 0.0, 0.0, 0.1)); m_WindingRule.text_size(12.0); m_WindingRule.text_thickness(2); m_EdgeFlag = new cbox_ctrl(10, Height - whichHeight - 40, "Turn on Edge Flag"); m_EdgeFlag.status(true); AddChild(m_EdgeFlag); m_BoundryOnly = new cbox_ctrl(10, Height - whichHeight - 20, "Render Only Boundary"); AddChild(m_BoundryOnly); Tesselate_Tests test = new Tesselate_Tests(); test.MatchesGLUTesselator(); }
void Line(Tesselate_Tests.Vertex Vertex1, Tesselate_Tests.Vertex Vertex2, double lineWidth, RendererBase renderer, bool ArrowTip) { PathStorage line = new PathStorage(); line.move_to(Vertex1.m_X * m_Scale + m_XOffset, Vertex1.m_Y * m_Scale + m_YOffset); line.line_to(Vertex2.m_X * m_Scale + m_XOffset, Vertex2.m_Y * m_Scale + m_YOffset); // Drawing as an outline conv_stroke wideLine = new conv_stroke(line); wideLine.width(lineWidth); renderer.Render(wideLine, m_LineColor.GetAsRGBA_Bytes()); if(ArrowTip) { Ellipse Dot = new Ellipse( (Vertex2.m_X * m_Scale * 9 + Vertex1.m_X * m_Scale) / 10 + m_XOffset, (Vertex2.m_Y * m_Scale * 9 + Vertex1.m_Y * m_Scale) / 10 + m_YOffset, 3, 3); GetRenderer().Render(Dot, m_LineColor.GetAsRGBA_Bytes()); } }
void Triangle(Tesselate_Tests.Vertex Vertex1, Tesselate_Tests.Vertex Vertex2, Tesselate_Tests.Vertex Vertex3, RendererBase renderer) { PathStorage triangle = new PathStorage(); triangle.move_to(Vertex1.m_X * m_Scale + m_XOffset, Vertex1.m_Y * m_Scale + m_YOffset); triangle.line_to(Vertex2.m_X * m_Scale + m_XOffset, Vertex2.m_Y * m_Scale + m_YOffset); triangle.line_to(Vertex3.m_X * m_Scale + m_XOffset, Vertex3.m_Y * m_Scale + m_YOffset); renderer.Render(triangle, m_TriangleColor.GetAsRGBA_Bytes()); }