X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverUNV%2FDriverUNV_W_SMDS_Mesh.cxx;h=68c33035c0c5d7279bed1bae09b46905e370fe90;hb=f016bdf914220827ec8f9a7048bc78fc3fb8c299;hp=cee15c2057d301426d32c2dbe35831f0e47dabb1;hpb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;p=modules%2Fsmesh.git diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index cee15c205..68c33035c 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -45,19 +45,23 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { Kernel_Utils::Localizer loc; Status aResult = DRS_OK; + + if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false)) + return DRS_TOO_LARGE_MESH; + #if defined(WIN32) && defined(UNICODE) std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile); std::ofstream out_stream(aFile.c_str()); #else std::ofstream out_stream(myFile.c_str()); #endif - try{ - + try + { UNV164::Write( out_stream ); // unit system UNV2420::Write( out_stream, myMeshName ); // Coordinate system std::vector< size_t > nodeLabelByID; - if ( myMesh->HasNumerationHoles() ) + if ( myMesh->HasNumerationHoles() && myRenumber ) nodeLabelByID.resize( myMesh->MaxNodeID() + 1 ); { @@ -71,7 +75,8 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() for ( aRec.label = 1; aNodesIter->more(); ++aRec.label ) { const SMDS_MeshNode* aNode = aNodesIter->next(); - // aRec.label = aNode->GetID(); -- IPAL54452 + if ( !myRenumber ) + aRec.label = aNode->GetID(); //-- IPAL54452 if ( !nodeLabelByID.empty() ) nodeLabelByID[ aNode->GetID() ] = aRec.label; aRec.coord[0] = aNode->X(); @@ -101,8 +106,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( anIter->more() ) { const SMDS_MeshEdge* anElem = anIter->next(); - // aRec.label = anElem->GetID(); -- IPAL54452 - ++aRec.label; + if ( myRenumber ) // -- IPAL54452 + ++aRec.label; + else + aRec.label = anElem->GetID(); if ( !elemLabelByID.empty() ) elemLabelByID[ anElem->GetID() ] = aRec.label; @@ -113,7 +120,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -134,10 +141,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() if ( anElem->IsPoly() ) continue; SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV(); - for ( aRec.node_labels.clear(); aNodesIter->more(); ) { + for ( aRec.node_labels.clear(); aNodesIter->more(); ) + { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -151,8 +159,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() default: continue; } - // aRec.label = anElem->GetID(); -- IPAL54452 - ++aRec.label; + if ( myRenumber ) + ++aRec.label; + else + aRec.label = anElem->GetID(); // -- IPAL54452 if ( !elemLabelByID.empty() ) elemLabelByID[ anElem->GetID() ] = aRec.label; @@ -184,8 +194,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() default: continue; } - // aRec.label = anElem->GetID(); -- IPAL54452 - ++aRec.label; + if ( myRenumber ) + ++aRec.label; // -- IPAL54452 + else + aRec.label = anElem->GetID(); if ( !elemLabelByID.empty() ) elemLabelByID[ anElem->GetID() ] = aRec.label; @@ -195,7 +207,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshElement* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -210,7 +222,8 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() // -------------------- { using namespace UNV2417; - if ( myGroups.size() > 0 ) { + if ( myGroups.size() > 0 ) + { TRecord aRec; TDataSet aDataSet2417; TGroupList::const_iterator aIter = myGroups.begin(); @@ -226,7 +239,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aNode = aIter->next(); if ( nodeLabelByID.empty() ) - aRec.NodeList.push_back( aNode->GetID() ); + aRec.NodeList.push_back( FromSmIdType( aNode->GetID()) ); else aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -236,7 +249,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aElem = aIter->next(); if ( elemLabelByID.empty() ) - aRec.ElementList.push_back( aElem->GetID() ); + aRec.ElementList.push_back( FromSmIdType(aElem->GetID()) ); else aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]); } @@ -256,11 +269,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() EXCEPTION(runtime_error,"ERROR: Output file not good."); } catch(const std::exception& exc){ - INFOS("Follow exception was cought:\n\t"<