예제 #1
0
파일: MenuUIIO.cs 프로젝트: meshdgp/MeshDGP
        public void OpenTriMesh()
        {
             String filename =  SetUpOpenDialog();

             if (filename == null)
                 return;

             else
             {

                 
                 if (filename.EndsWith(".obj"))
                 {
                     NonManifoldMesh mesh = new NonManifoldMesh();
                     mesh.ReadObj(filename);

                     MeshRecord rec = new MeshRecord(filename, mesh);

                     GlobalData.Instance.SimpleMesh = rec;


                 }
             }
             GlobalData.Instance.OnChanged(EventArgs.Empty);

        }
예제 #2
0
        public void RenderData()
        {
            if (GlobalData.Instance.TriMesh != null)
            {
                OpenGLTriMesh.Instance.DrawTriMesh(GlobalData.Instance.TriMesh);
            }

            if (GlobalData.Instance.QuadMesh != null)
            {
                OpenGLTriMesh.Instance.DrawHalfEdgeQuadMesh(GlobalData.Instance.QuadMesh);
            }

            MeshRecord currMeshRecord = GlobalData.Instance.SimpleMesh;

            if (currMeshRecord != null)
            {
                OpenGLNonManifold.Instance.DrawMesh(currMeshRecord.Mesh);
            }

            if (GlobalData.Instance.TetMesh != null)
            {
                OpenGLTetMesh.Instance.DrawFlag(GlobalData.Instance.TetMesh);
            }
            if (GlobalData.Instance.ske != null)
            {
                OpenGLTriMesh.Instance.DrawSkeleton(GlobalData.Instance.ske);
            }

            if (GlobalData.Instance.boxes != null)
            {
                OpenGLOctree.Instance.DrawDynamicOctree(GlobalData.Instance.boxes);
            }
        }
예제 #3
0
        public void OpenTriMesh()
        {
            String filename = SetUpOpenDialog();

            if (filename == null)
            {
                return;
            }

            else
            {
                if (filename.EndsWith(".obj"))
                {
                    NonManifoldMesh mesh = new NonManifoldMesh();
                    mesh.ReadObj(filename);

                    MeshRecord rec = new MeshRecord(filename, mesh);

                    GlobalData.Instance.SimpleMesh = rec;
                }
            }
            GlobalData.Instance.OnChanged(EventArgs.Empty);
        }