if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
return;
- int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648)
{
_callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true );
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
GetMeshDS()->Modified();
- int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp )
_callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities );
}
bool theAllElemsToGroup)
{
MESSAGE("MED_VERSION:"<< theVersion);
+
+ Driver_Mesh::Status status;
SMESH_TRY;
DriverMED_W_SMESHDS_Mesh myWriter;
}
}
// Perform export
- myWriter.Perform();
+ status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("MED");
}
//================================================================================
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
cmd += "\"";
system(cmd.c_str());
- ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
- /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
- /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
+ try {
+ ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
+ /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
+ /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
+ }
+ catch ( TooLargeForExport )
+ {
+ throw TooLargeForExport("SAUV");
+ }
#ifdef WIN32
cmd = "%PYTHONBIN% ";
#else
void SMESH_Mesh::ExportDAT(const char * file,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverDAT_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
myWriter.SetMeshId(_id);
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("DAT");
}
//================================================================================
void SMESH_Mesh::ExportUNV(const char * file,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+
+ SMESH_TRY;
DriverUNV_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
}
}
}
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("UNV");
}
//================================================================================
const char * name,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverSTL_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetIsAscii( isascii );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS);
myWriter.SetMeshId(_id);
if ( name ) myWriter.SetName( name );
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("STL");
}
//================================================================================
const char * meshName,
const bool groupElemsByType)
{
+
int res = Driver_Mesh::DRS_FAIL;
+ SMESH_TRY;
// pass group names to SMESHDS
std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin();
}
#endif
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( res == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("CGNS");
+
if ( res != Driver_Mesh::DRS_OK )
throw SALOME_Exception("Export failed");
}
const SMESHDS_Mesh* meshDS,
bool withRequiredGroups)
{
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverGMF_Write myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
myWriter.SetExportRequiredGroups( withRequiredGroups );
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("GMF");
}
//================================================================================
*/
//================================================================================
-int SMESH_Mesh::NbNodes() const
+smIdType SMESH_Mesh::NbNodes() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbNodes();
*/
//================================================================================
-int SMESH_Mesh::Nb0DElements() const
+smIdType SMESH_Mesh::Nb0DElements() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().Nb0DElements();
*/
//================================================================================
-int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbEdges(order);
*/
//================================================================================
-int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbFaces(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadTriangles() const
+smIdType SMESH_Mesh::NbBiQuadTriangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
*/
//================================================================================
-int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadQuadrangles() const
+smIdType SMESH_Mesh::NbBiQuadQuadrangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
*/
//================================================================================
-int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolygons(order);
*/
//================================================================================
-int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbVolumes(order);
*/
//================================================================================
-int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTetras(order);
*/
//================================================================================
-int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexas(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriQuadraticHexas() const
+smIdType SMESH_Mesh::NbTriQuadraticHexas() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
*/
//================================================================================
-int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPyramids(order);
*/
//================================================================================
-int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPrisms(order);
}
-int SMESH_Mesh::NbQuadPrisms() const
+smIdType SMESH_Mesh::NbQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadPrisms();
}
-int SMESH_Mesh::NbBiQuadPrisms() const
+smIdType SMESH_Mesh::NbBiQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbHexagonalPrisms() const
+smIdType SMESH_Mesh::NbHexagonalPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbPolyhedrons() const
+smIdType SMESH_Mesh::NbPolyhedrons() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolyhedrons();
*/
//================================================================================
-int SMESH_Mesh::NbBalls() const
+smIdType SMESH_Mesh::NbBalls() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBalls();
*/
//================================================================================
-int SMESH_Mesh::NbSubMesh() const
+smIdType SMESH_Mesh::NbSubMesh() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbSubMesh();
save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
if ( NbFaces(order) > 0 ) {
- int nb3 = NbTriangles(order);
- int nb4 = NbQuadrangles(order);
+ smIdType nb3 = NbTriangles(order);
+ smIdType nb4 = NbQuadrangles(order);
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
}
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
if ( NbVolumes(order) > 0 ) {
- int nb8 = NbHexas(order);
- int nb4 = NbTetras(order);
- int nb5 = NbPyramids(order);
- int nb6 = NbPrisms(order);
+ smIdType nb8 = NbHexas(order);
+ smIdType nb4 = NbTetras(order);
+ smIdType nb5 = NbPyramids(order);
+ smIdType nb6 = NbPrisms(order);
save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl;
save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
//purpose : Returns type of mesh element with certain id
//=======================================================================
-SMDSAbs_ElementType SMESH_Mesh::GetElementType( const int id, const bool iselem )
+SMDSAbs_ElementType SMESH_Mesh::GetElementType( const smIdType id, const bool iselem )
{
return _myMeshDS->GetElementType( id, iselem );
}