Exemple #1
0
        private void dumpButton_Click(object sender, EventArgs e)
        {
            Entity[] entList = model1.Entities.ToArray();

            for (int i = 0; i < entList.Length; i++)
            {
                Entity ent = entList[i];

                DetailsWindow df;

                StringBuilder sb = new StringBuilder();
#if NURBS
                if (ent is Brep)
                {
                    Brep solid3D = (Brep)ent;

                    switch (model1.SelectionFilterMode)
                    {
                    case selectionFilterType.Vertex:
                        for (int j = 0; j < solid3D.Vertices.Length; j++)
                        {
                            Brep.Vertex sv = (Brep.Vertex)solid3D.Vertices[j];

                            if (solid3D.GetVertexSelection(j))
                            {
                                sb.AppendLine("Vertex ID: " + j);
                                sb.AppendLine(sv.ToString());
                                sb.AppendLine("----------------------");
                                sb.Append(sv.Dump());
                                break;
                            }
                        }
                        break;

                    case selectionFilterType.Edge:
                        for (int j = 0; j < solid3D.Edges.Length; j++)
                        {
                            Brep.Edge se = solid3D.Edges[j];

                            if (solid3D.GetEdgeSelection(j))
                            {
                                sb.AppendLine("Edge ID: " + j);
                                sb.AppendLine(se.ToString());
                                sb.AppendLine("----------------------");
                                sb.Append(se.Dump());
                                break;
                            }
                        }
                        break;

                    case selectionFilterType.Face:

                        for (int j = 0; j < solid3D.Faces.Length; j++)
                        {
                            Brep.Face sf = solid3D.Faces[j];

                            if (solid3D.GetFaceSelection(j))
                            {
                                sb.AppendLine("Face ID: " + j);
                                sb.AppendLine(sf.Surface.ToString());
                                sb.AppendLine("----------------------");
                                sb.Append(sf.Dump());
                                break;
                            }
                        }
                        break;
                    }

                    if (sb.Length > 0)
                    {
                        df = new DetailsWindow();

                        df.contentTextBox.Text = sb.ToString();

                        df.Show();
                        return;
                    }
                }
#endif
                if (ent.Selected)
                {
                    sb.AppendLine("Entity ID: " + i);

                    sb.Append(ent.Dump());

                    df = new DetailsWindow();

                    df.contentTextBox.Text = sb.ToString();

                    df.Show();

                    break;
                }
            }
        }