- fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read);
- exit(EXIT_FAILURE);
- }
- SCRUTE(myMesh);
- /****************************************************************************
- * NOMBRES D'OBJETS *
- ****************************************************************************/
- fprintf(stdout,"\n(****************************)\n");
- fprintf(stdout,"(* INFORMATIONS GENERALES : *)\n");
- fprintf(stdout,"(****************************)\n");
-
- /* Combien de noeuds ? */
- nbNodes = myMesh->NbNodes();
-
- /* Combien de mailles, faces ou aretes ? */
- Standard_Integer nb_of_nodes, nb_of_edges,nb_of_faces, nb_of_volumes;
- nb_of_edges = myMesh->NbEdges();
- nb_of_faces = myMesh->NbFaces();
- nb_of_volumes = myMesh->NbVolumes();
- nbCells = nb_of_edges + nb_of_faces + nb_of_volumes;
- SCRUTE(nb_of_edges);
- SCRUTE(nb_of_faces);
- SCRUTE(nb_of_volumes);
-
- fprintf(stdout,"%d %d\n",nbNodes,nbCells);
- fprintf(myFileId,"%d %d\n",nbNodes,nbCells);
-
- /****************************************************************************
- * ECRITURE DES NOEUDS *
- ****************************************************************************/
- fprintf(stdout,"\n(************************)\n");
- fprintf(stdout,"(* NOEUDS DU MAILLAGE : *)\n");
- fprintf(stdout,"(************************)\n");
-
- SMDS_MeshNodesIterator itNodes(myMesh);
-
- fprintf(myFileId,"%s\n", sUNV_SEPARATOR);
- fprintf(myFileId,"%s\n", sNODE_UNV_ID );
-
- for (;itNodes.More();itNodes.Next()) {
- const Handle(SMDS_MeshElement)& elem = itNodes.Value();
- const Handle(SMDS_MeshNode )& node = myMesh->GetNode(1, elem);
-
- fprintf(myFileId, sNODE_UNV_DESCR, node->GetID());
- fprintf(myFileId, "%25.16E%25.16E%25.16E\n", node->X(), node->Y(), node->Z());
- }
- fprintf(myFileId,"%s\n", sUNV_SEPARATOR);
-
- /****************************************************************************
- * ECRITURE DES ELEMENTS *
- ****************************************************************************/
- fprintf(stdout,"\n(**************************)\n");
- fprintf(stdout,"(* ELEMENTS DU MAILLAGE : *)\n");
- fprintf(stdout,"(**************************)");
- /* Ecriture des connectivites, noms, numeros des mailles */
-
- fprintf(myFileId,"%s\n", sUNV_SEPARATOR);
- fprintf(myFileId,"%s\n", sELT_UNV_ID );
-
- SMDS_MeshEdgesIterator itEdges(myMesh);
- for (;itEdges.More();itEdges.Next()) {
- const Handle(SMDS_MeshElement)& elem = itEdges.Value();
-
- switch (elem->NbNodes()) {
- case 2 : {
- fprintf(myFileId, sELT_BEAM_DESC1, elem->GetID(), 21, elem->NbNodes());
- fprintf(myFileId, sELT_BEAM_DESC2);
- fprintf(myFileId, "%10d%10d\n", elem->GetConnection(1), elem->GetConnection(2));
- break;
- }
- case 3 : {
- fprintf(myFileId, sELT_BEAM_DESC1, elem->GetID(), 24, elem->NbNodes());
- fprintf(myFileId, sELT_BEAM_DESC2);
- fprintf(myFileId, "%10d%10d%10d\n",elem->GetConnection(1), elem->GetConnection(2), elem->GetConnection(3));
- break;
+ using namespace UNV2411;
+ TDataSet aDataSet2411;
+ // -----------------------------------
+ // Storing SMDS nodes to the UNV file
+ // -----------------------------------
+ SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
+ TRecord aRec;
+ for ( aRec.label = 1; aNodesIter->more(); ++aRec.label )
+ {
+ const SMDS_MeshNode* aNode = aNodesIter->next();
+ // aRec.label = aNode->GetID(); -- IPAL54452
+ if ( !nodeLabelByID.empty() )
+ nodeLabelByID[ aNode->GetID() ] = aRec.label;
+ aRec.coord[0] = aNode->X();
+ aRec.coord[1] = aNode->Y();
+ aRec.coord[2] = aNode->Z();
+ aDataSet2411.push_back( aRec );