protected override void BuildMesh(GeoObject o, Del3D meshBuilder, params object[] oparams) { if (meshBuilder != null) { o.Mesh = meshBuilder(oparams); } }
protected void SetWireframeViewAndSelection(GeoObject o) { if (o.WireframeView) { GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line); GL.Disable(EnableCap.Lighting); if (o.IsSelected) { GL.Enable(EnableCap.ColorMaterial); GL.Color3(0.5, 1, 0); } else { GL.Disable(EnableCap.ColorMaterial); GL.Color3(1.0, 0.0, 0.0); } } else { GL.Enable(EnableCap.Lighting); GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill); if (o.IsSelected) { GL.Enable(EnableCap.ColorMaterial); GL.Color3(0.5, 1, 0); } else { GL.Disable(EnableCap.ColorMaterial); } } }
public override void SlotChanged(object sender, object e) { Mesh.CNC_Turning.Machine_Stuff.ToolSet.Slot slot = e as Mesh.CNC_Turning.Machine_Stuff.ToolSet.Slot; if (slot != null) { Tool tool = slot.Tool; tool.WireframeView = this.m_WireframeView; ActiveTool = tool; } else ActiveTool = null; }
protected abstract void BuildMesh(GeoObject o, Del3D meshBuilder, params object[] oparams);
private void Do2DBooleanOps(GeoObject geoObject, BVHPolyMesh2D tsv) { RoughPartGeoObject o = geoObject as RoughPartGeoObject; RoughPartConcentricMesh3D mesh = o.Mesh as RoughPartConcentricMesh3D; if (mesh.Poly2D.HECount == 0) // nothing to do return; BoolDifference subtractor = new BoolDifference(o.VBOManager); BVHPolyMesh2D meshA = mesh.Poly2D; subtractor.Subtract(mesh.Poly2D.BVH, tsv.BVH); mesh.Poly2D = GetMesh(subtractor.MeshesA); mesh.Poly2D.BVH = new BVH(mesh.Poly2D); #if DEBUG foreach (AABRHalfEdge2 h in mesh.Poly2D.HalfEdgeIterator()) { if (h.Origin.X == h.Next.Origin.X && h.Origin.Y == h.Next.Origin.Y) throw new Exception("Vertices are the same"); if (h.Bucket == null) throw new Exception("Halfedge has no corresponding bucket"); if(h == h.Twin) throw new Exception("HalfEdge is not correct"); if (h == h.Next) throw new Exception("HalfEdge is not correct"); } #endif o.UpdateMesh(); }