X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverUNV%2FDriverUNV_W_SMDS_Mesh.cxx;h=2f37d9a8fa81238660e4dc0ef251beaaec75627e;hb=d4a710ce52f6e76786a7b3845e2f7975dc9a00b1;hp=a3e10c2c1bad17e5674bfeda57eaf1df4fe29e7e;hpb=14a1f504199129beff09e8ec1aeb95e989d5497a;p=modules%2Fsmesh.git diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index a3e10c2c1..2f37d9a8f 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -32,9 +32,11 @@ #include "utilities.h" +#include "UNV164_Structure.hxx" #include "UNV2411_Structure.hxx" #include "UNV2412_Structure.hxx" #include "UNV2417_Structure.hxx" +#include "UNV2420_Structure.hxx" #include "UNV_Utilities.hxx" #include @@ -64,6 +66,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() Status aResult = DRS_OK; std::ofstream out_stream(myFile.c_str()); try{ + + UNV164::Write( out_stream ); // unit system + UNV2420::Write( out_stream, myMeshName ); // Coordinate system + { using namespace UNV2411; TDataSet aDataSet2411; @@ -71,14 +77,15 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() //----------------------------------- MESSAGE("Perform - myMesh->NbNodes() = "<NbNodes()); SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(); - for(; aNodesIter->more();){ + TRecord aRec; + while ( aNodesIter->more() ) + { const SMDS_MeshNode* aNode = aNodesIter->next(); - TRecord aRec; + aRec.label = aNode->GetID(); aRec.coord[0] = aNode->X(); aRec.coord[1] = aNode->Y(); aRec.coord[2] = aNode->Z(); - const TNodeLab& aLabel = aNode->GetID(); - aDataSet2411.insert(TDataSet::value_type(aLabel,aRec)); + aDataSet2411.push_back( aRec ); } MESSAGE("Perform - aDataSet2411.size() = "<NbEdges() = "<NbEdges()); if(myMesh->NbEdges()){ SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator(); - for(; anIter->more();){ + while( anIter->more() ) + { const SMDS_MeshEdge* anElem = anIter->next(); - TElementLab aLabel = anElem->GetID(); int aNbNodes = anElem->NbNodes(); TRecord aRec; + aRec.label = anElem->GetID(); aRec.node_labels.reserve(aNbNodes); SMDS_ElemIteratorPtr aNodesIter; aNodesIter = anElem->nodesIteratorToUNV(); @@ -105,24 +113,27 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() } else { aRec.fe_descriptor_id = 11; } - for(; aNodesIter->more();){ + while( aNodesIter->more()) + { const SMDS_MeshElement* aNode = aNodesIter->next(); aRec.node_labels.push_back(aNode->GetID()); } - aDataSet2412.insert(TDataSet::value_type(aLabel,aRec)); + aDataSet2412.push_back(aRec); } MESSAGE("Perform - aDataSet2412.size() = "<NbFaces() = "<NbFaces()); - if(myMesh->NbFaces()){ + if ( myMesh->NbFaces() ) + { SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); - for(; anIter->more();){ + while ( anIter->more()) + { const SMDS_MeshFace* anElem = anIter->next(); if ( anElem->IsPoly() ) continue; - TElementLab aLabel = anElem->GetID(); int aNbNodes = anElem->NbNodes(); TRecord aRec; + aRec.label = anElem->GetID(); aRec.node_labels.reserve(aNbNodes); SMDS_ElemIteratorPtr aNodesIter; aNodesIter = anElem->nodesIteratorToUNV(); @@ -150,18 +161,18 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() default: continue; } - aDataSet2412.insert(TDataSet::value_type(aLabel,aRec)); + aDataSet2412.push_back(aRec); } MESSAGE("Perform - aDataSet2412.size() = "<NbVolumes() = "<NbVolumes()); - if(myMesh->NbVolumes()){ + if ( myMesh->NbVolumes() ) + { SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator(); - for(; anIter->more();){ + while ( anIter->more()) + { const SMDS_MeshVolume* anElem = anIter->next(); - TElementLab aLabel = anElem->GetID(); - int aNbNodes = anElem->NbNodes(); //MESSAGE("aNbNodes="<0){ TRecord aRec; + aRec.label = anElem->GetID(); aRec.fe_descriptor_id = anId; aRec.node_labels.reserve(aNbNodes); - for(; aNodesIter->more() && aRec.node_labels.size() < aNbNodes; ) { + while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes ) + { const SMDS_MeshElement* aNode = aNodesIter->next(); aRec.node_labels.push_back(aNode->GetID()); } - aDataSet2412.insert(TDataSet::value_type(aLabel,aRec)); + aDataSet2412.push_back(aRec); } } MESSAGE("Perform - aDataSet2412.size() = "<