コード例 #1
0
        private void BuildMeshes(String fileName)
        {
            // Read Input XML and build geometry
            this.geo = new Mesh.Geometry(directoryPath + fileName);

            // Subscribe to add and remove triangle events
            this.geo.TriangleAdded += geo_TriangleAdded;

            try
            {
                this.geo.Load();
            }
            catch (ApplicationException appEx)
            {
                MessageBox.Show(appEx.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (Exception)
            {
                MessageBox.Show("Error while reading input file", "Error",
                    MessageBoxButton.OK, MessageBoxImage.Error);
            }

            // Build meshes based on geometry
            try
            {
                this.geo.BuildMeshes();
            }
            catch (ApplicationException appEx)
            {
                MessageBox.Show(appEx.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (Exception)
            {
                MessageBox.Show("Error while building mesh", "Error",
                    MessageBoxButton.OK, MessageBoxImage.Error);
            }

            this.geo.SaveVTK();
        }
コード例 #2
0
ファイル: Region.cs プロジェクト: naszta/MeshGenerator
 public Region(Geometry geo)
 {
     this.Contours = new List<Contour>();
     this.Geo = geo;
 }