+ // check if a mesh is too large to export it using IDTYPE;
+ // check either max ID or number of elements
+ template< typename IDTYPE >
+ static bool IsMeshTooLarge( const SMDS_Mesh* mesh, bool checkIDs )
+ {
+ if ( sizeof( IDTYPE ) < sizeof( smIdType ))
+ {
+ const smIdType maxNB = ToSmIdType( std::numeric_limits< IDTYPE >::max() );
+ return (( checkIDs ? mesh->MaxNodeID() : mesh->NbNodes() ) > maxNB ||
+ ( checkIDs ? mesh->MaxElementID() : mesh->NbElements() > maxNB ));
+ }
+ return false;
+ }
+