+
+ // Issue 22638. Find out space dimension to read a 2D mesh from a file
+ // generated by SIMAIL from Simulog
+ if ( !in_stream.eof() )
+ {
+ int where = in_stream.tellg();
+
+ TRecord aRec;
+ in_stream >> aRec.label ;
+ if ( aRec.label == -1 ) return; // dataset end
+
+ dim = 0;
+ num_buf = read_line( in_stream );
+ for ( size_t i = 0; i < num_buf.size(); )
+ {
+ // skip spaces
+ while ( i < num_buf.size() && num_buf[i] == ' ' )
+ ++i;
+
+ dim += ( i < num_buf.size() );
+
+ // skip non-spaces
+ while ( i < num_buf.size() && num_buf[i] != ' ' )
+ ++i;
+ }
+ if ( dim == 0 )
+ return;
+
+ in_stream.seekg( where, in_stream.beg );
+ }
+
+ // read the rest records