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

Implementing vector fields visualization in tnl-view.

parent ac40aaf0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -23,13 +23,15 @@
#include <core/tnlString.h>

template< typename T >
tnlString getParameterType() { return tnlString( "unknown type" ); };
tnlString getParameterType() { return T :: getType(); };

template<> inline tnlString getParameterType< bool >() { return tnlString( "bool" ); };
template<> inline tnlString getParameterType< int >() { return tnlString( "int" ); };
template<> inline tnlString getParameterType< long int >() { return tnlString( "long int" ); };
template<> inline tnlString getParameterType< char >() { return tnlString( "char" ); };
template<> inline tnlString getParameterType< float >() { return tnlString( "float" ); };
template<> inline tnlString getParameterType< double >() { return tnlString( "double" ); };
template<> inline tnlString getParameterType< long double >() { return tnlString( "long double" ); };
template<> inline tnlString getParameterType< tnlFloat >() { return tnlString( "tnlFloat" ); };
template<> inline tnlString getParameterType< tnlDouble> () { return tnlString( "tnlDouble" ); };

+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@ class tnlArray : public tnlObject

   tnlArray( const tnlString& name );

   tnlString getType() const;
   static tnlString getType();

   tnlString getTypeVirtual() const;

   bool setSize( Index size );

+3 −1
Original line number Diff line number Diff line
@@ -48,7 +48,9 @@ class tnlObject
    * Type getter. This returns the type in C++ style - for example the returned value
    * may look ass follows: "tnlVector< double, tnlCuda >".
    */
   virtual tnlString getType() const;
   static tnlString getType();

   virtual tnlString getTypeVirtual() const;

   /****
    *  Name getter
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ class tnlString
              int prefix_cut_off = 0,
              int sufix_cut_off = 0 );

   static tnlString getType();

   //! Copy constructor
   tnlString( const tnlString& str );

+15 −13
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <core/tnlAssert.h>
#include <string.h>
#include <core/tnlFile.h>
#include <core/tnlString.h>
#include "param-types.h"

//! Aliases for the coordinates
@@ -50,6 +51,8 @@ class tnlTuple
             const Real& v2,
             const Real& v3 );

   static tnlString getType();

   const Real& operator[]( int i ) const;

   Real& operator[]( int i );
@@ -222,6 +225,16 @@ tnlTuple< Size, Real > :: tnlTuple( const Real& v1,
   data[ 2 ] = v3;
}

template< int Size, typename Real >
tnlString tnlTuple< Size, Real > :: getType()
{
   return tnlString( "tnlTuple< " ) +
          tnlString( Size ) +
          tnlString( ", " ) +
          getParameterType< Real >() +
          tnlString( " >" );
}

template< int Size, typename Real >
const Real& tnlTuple< Size, Real > :: operator[]( int i ) const
{
@@ -628,15 +641,6 @@ ostream& operator << ( ostream& str, const tnlTuple< Size, Real >& v )
   return str;
};

template< int Size, typename Real > tnlString getParameterType()
{ 
   return tnlString( "tnlTuple< " ) +
          tnlString( Size ) +
          tnlString( ", " ) +
          tnlString( getParameterType< Real >() ) +
          tnlString( " >" );
};

template< typename Real >
tnlTuple< 3, Real > tnlVectorProduct( const tnlTuple< 3, Real >& u,
                                      const tnlTuple< 3, Real >& v )
@@ -679,6 +683,4 @@ Real tnlTriangleArea( const tnlTuple< 2, Real >& a,
   return 0.5 * sqrt( tnlScalarProduct( v, v ) );
};



#endif
Loading