Пример #1
0
        protected DMesh3 MakeDebugGraphMesh()
        {
            DMesh3 graphMesh = new DMesh3();

            graphMesh.EnableVertexColors(Vector3f.One);
            foreach (int vid in Graph.VertexIndices())
            {
                if (TipVertices.Contains(vid))
                {
                    MeshEditor.AppendBox(graphMesh, Graph.GetVertex(vid), 0.3f, Colorf.Green);
                }
                else if (TipBaseVertices.Contains(vid))
                {
                    MeshEditor.AppendBox(graphMesh, Graph.GetVertex(vid), 0.225f, Colorf.Magenta);
                }
                else if (GroundVertices.Contains(vid))
                {
                    MeshEditor.AppendBox(graphMesh, Graph.GetVertex(vid), 0.35f, Colorf.Blue);
                }
                else
                {
                    MeshEditor.AppendBox(graphMesh, Graph.GetVertex(vid), 0.15f, Colorf.White);
                }
            }
            foreach (int eid in Graph.EdgeIndices())
            {
                Segment3d seg = Graph.GetEdgeSegment(eid);
                MeshEditor.AppendLine(graphMesh, seg, 0.1f);
            }
            return(graphMesh);
        }