- else {
- cout << "decimesh is started" << endl;
- system("decimesh");
- cout << "decimesh is finished" << endl;
-
- FILE* fic = fopen("x_h100.mesh", "r");
- char buf[200];
- do {
- fscanf(fic, "%s\n", buf);
- }
- while (strcmp(buf, "Vertices")!=0);
- int n_vtx;
- fscanf(fic, "%d\n", &n_vtx);
- cout << "number of vertices: " << n_vtx << endl;
-
- SMDS_MeshNode** nodes = new SMDS_MeshNode*[n_vtx+1];
- double coo_x, coo_y, coo_z;
- for (int i=1; i<=n_vtx; i++) {
- fscanf(fic, "%lf %lf %lf %*d\n", &coo_x, &coo_y, &coo_z);
- nodes[i] = meshDS->AddNode(coo_x, coo_y, coo_z);
- }
- cout << "nodes are updated" << endl;
-
- fscanf(fic, "%*s\n");
- int n_tri, n1, n2, n3, iFace;
- SMDS_MeshFace* face;
- fscanf(fic, "%d\n", &n_tri);
- cout << "number of triangles: " << n_tri << endl;
- for (int i=0; i<n_tri; i++) {
- fscanf(fic, "%d %d %d %d\n", &n1, &n2, &n3, &iFace);
- face = meshDS->AddFace(nodes[n3], nodes[n2], nodes[n1]);
- }
- cout << "triangles are updated" << endl;
-
- char *keyWord;
- fscanf(fic, "%s\n", keyWord);
- cout << "keyWord : " << keyWord << endl;
- int n_edges;
- SMDS_MeshEdge* edge;
- fscanf(fic, "%d\n", &n_edges);
- cout << "number of edges: " << n_edges << endl;
- for (int i=0; i<n_edges; i++) {
- fscanf(fic, "%d %d %*d\n", &n1, &n2);
- edge = meshDS->AddEdge(nodes[n1], nodes[n2]);
- //meshDS->SetMeshElementOnShape(edge, topo_edge);
- }
- cout << "edges are updated, and finished" << endl;