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

Debuging the mesh initializer.

parent 50049593
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ class tnlStaticArray
   template< typename Array >
   bool operator != ( const Array& array ) const;

   void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;

   bool load( tnlFile& file);
@@ -183,6 +185,8 @@ class tnlStaticArray< 1, Element >
   template< typename Array >
   bool operator != ( const Array& array ) const;

   void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;

   bool load( tnlFile& file);
@@ -290,6 +294,8 @@ class tnlStaticArray< 2, Element >
   template< typename Array >
   bool operator != ( const Array& array ) const;

   void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;

   bool load( tnlFile& file);
@@ -409,6 +415,8 @@ class tnlStaticArray< 3, Element >
   template< typename Array >
   bool operator != ( const Array& array ) const;

   void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;

   bool load( tnlFile& file);
+1 −5
Original line number Diff line number Diff line
@@ -272,8 +272,6 @@ template< typename Element,
          typename Index >
void tnlArray< Element, Device, Index > :: setValue( const Element& e )
{
   tnlAssert( this -> size != 0,
              cerr << "Array name is " << this -> getName() );
   tnlArrayOperations< Device > :: setMemory( this -> getData(), e, this -> getSize() );
}

@@ -322,8 +320,6 @@ template< typename Element,
          typename Index >
bool tnlArray< Element, Device, Index > :: save( tnlFile& file ) const
{
   tnlAssert( this -> size != 0,
              cerr << "You try to save empty vector. Its name is " << this -> getName() );
   if( ! tnlObject :: save( file ) )
      return false;
#ifdef HAVE_NOT_CXX11
@@ -363,9 +359,9 @@ bool tnlArray< Element, Device, Index > :: load( tnlFile& file )
      cerr << "Error: The size " << _size << " of the file is not a positive number or zero." << endl;
      return false;
   }
   setSize( _size );
   if( _size )
   {
      setSize( _size );
      if( ! tnlArrayIO< Element, Device, Index >::load( file, this -> data, this -> size ) )
      {
         cerr << "I was not able to load " << this->getType()
+6 −0
Original line number Diff line number Diff line
@@ -159,6 +159,12 @@ bool tnlStaticArray< 1, Element >::operator != ( const Array& array ) const
   return ! this->operator == ( array );
}

template< typename Element >
void tnlStaticArray< 1, Element >::setValue( const ElementType& val )
{
   data[ 0 ] = val;
}

template< typename Element >
bool tnlStaticArray< 1, Element >::save( tnlFile& file ) const
{
+6 −0
Original line number Diff line number Diff line
@@ -194,6 +194,12 @@ bool tnlStaticArray< 2, Element >::operator != ( const Array& array ) const
   return ! this->operator == ( array );
}

template< typename Element >
void tnlStaticArray< 2, Element >::setValue( const ElementType& val )
{
   data[ 1 ] = data[ 0 ] = val;
}

template< typename Element >
bool tnlStaticArray< 2, Element >::save( tnlFile& file ) const
{
+6 −0
Original line number Diff line number Diff line
@@ -218,6 +218,12 @@ bool tnlStaticArray< 3, Element >::operator != ( const Array& array ) const
   return ! this->operator == ( array );
}

template< typename Element >
void tnlStaticArray< 3, Element >::setValue( const ElementType& val )
{
   data[ 2 ] = data[ 1 ] = data[ 0 ] = val;
}

template< typename Element >
bool tnlStaticArray< 3, Element >::save( tnlFile& file ) const
{
Loading