Commit e8c3dea0 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Debuging the mesh initializer.

parent 0f49d396
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ template< typename Type, typename Device, typename Index >
bool tnlFile :: read( Type* buffer,
                      const Index& elements )
{
   tnlAssert( elements >= 0,
              cerr << " elements = " << elements << endl; );
   if( ! elements )
      return true;
   if( ! fileOK )
   {
      cerr << "File " << fileName << " was not properly opened. " << endl;
@@ -230,6 +234,10 @@ template< class Type, typename Device, typename Index >
bool tnlFile ::  write( const Type* buffer,
                        const Index elements )
{
   tnlAssert( elements >= 0,
              cerr << " elements = " << elements << endl; );
   if( ! elements )
      return true;
   if( ! fileOK )
   {
      cerr << "File " << fileName << " was not properly opened. " << endl;
+7 −1
Original line number Diff line number Diff line
@@ -41,7 +41,10 @@ class tnlArrayIO< Element, Device, Index, true >
   {
      for( Index i = 0; i < elements; i++ )
         if( ! data[ i ].save( file ) )
         {
            cerr << "I was not able to save " << i << "-th of " << elements << " elements." << endl;
            return false;
         }
      return true;
   }

@@ -51,12 +54,15 @@ class tnlArrayIO< Element, Device, Index, true >
   {
      for( Index i = 0; i < elements; i++ )
         if( ! data[ i ].load( file ) )
         {
            cerr << "I was not able to load " << i << "-th of " << elements << " elements." << endl;
            return false;
         }
      return true;
   }
};

template< typename Element
template< typename Element,
          typename Device,
          typename Index >
class tnlArrayIO< Element, Device, Index, false >
+2 −2
Original line number Diff line number Diff line
@@ -51,8 +51,8 @@ template< typename Element,
tnlString tnlArray< Element, Device, Index > :: getType()
{
   return tnlString( "tnlArray< " ) +
                     getParameterType< Element >() +
                     Device :: getDeviceType() +
                     getParameterType< Element >() + ", " +
                     Device :: getDeviceType() + ", " +
                     getParameterType< Index >() +
                     " >";
};
+4 −2
Original line number Diff line number Diff line
@@ -164,11 +164,13 @@ bool tnlStaticArray< 1, Element >::save( tnlFile& file ) const
{
#ifdef HAVE_NOT_CXX11
   if( ! file. write< Element, tnlHost, int >( data, size ) )
      cerr << "Unable to write " << getType() << "." << endl;
#else
   if( ! file. write( data, size ) )
      cerr << "Unable to write " << getType() << "." << endl;
#endif
   {
      cerr << "Unable to write " << getType() << "." << endl;
      return false;
   }
   return true;
}

+4 −2
Original line number Diff line number Diff line
@@ -199,11 +199,13 @@ bool tnlStaticArray< 2, Element >::save( tnlFile& file ) const
{
#ifdef HAVE_NOT_CXX11
   if( ! file. write< Element, tnlHost, int >( data, size ) )
      cerr << "Unable to write " << getType() << "." << endl;
#else
   if( ! file. write( data, size ) )
      cerr << "Unable to write " << getType() << "." << endl;
#endif
   {
      cerr << "Unable to write " << getType() << "." << endl;
      return false;
   }
   return true;
}

Loading