From 70372c2e14ffa6c41b1a7b127663bb8472473085 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz>
Date: Sat, 6 Apr 2019 20:50:34 +0200
Subject: [PATCH] Removed deprecated type names from tnl-view and tnl-diff

---
 src/Tools/tnl-diff.h | 22 +++++++---------------
 src/Tools/tnl-view.h | 26 +++++++-------------------
 2 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/src/Tools/tnl-diff.h b/src/Tools/tnl-diff.h
index 01be8959fd..5443f953ac 100644
--- a/src/Tools/tnl-diff.h
+++ b/src/Tools/tnl-diff.h
@@ -434,11 +434,9 @@ bool computeDifferenceOfVectors( const MeshPointer& meshPointer, const Config::P
 template< typename MeshPointer, typename Value, typename Real, typename Index >
 bool computeDifference( const MeshPointer& meshPointer, const String& objectType, const Config::ParameterContainer& parameters )
 {
-   if( objectType == "Functions::MeshFunction" ||
-       objectType == "tnlMeshFunction" )  // TODO: remove deprecated type name
+   if( objectType == "Functions::MeshFunction" )
       return computeDifferenceOfMeshFunctions< MeshPointer, Value, Real, Index >( meshPointer, parameters );
-   if( objectType == "Containers::Vector" ||
-       objectType == "tnlVector" || objectType == "tnlSharedVector" )   // TODO: remove deprecated type name
+   if( objectType == "Containers::Vector" )
       return computeDifferenceOfVectors< MeshPointer, Value, Real, Index >( meshPointer, parameters );
    std::cerr << "Unknown object type " << objectType << "." << std::endl;
    return false;
@@ -452,15 +450,12 @@ bool setIndexType( const MeshPointer& meshPointer,
                    const Config::ParameterContainer& parameters )
 {
    String indexType;
-   if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-       parsedObjectType[ 0 ] == "tnlSharedVector" ||                     // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlVector" )                            //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
       indexType = parsedObjectType[ 3 ];
 
-   if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ||
-       parsedObjectType[ 0 ] == "tnlMeshFunction" )                      // TODO: remove deprecated type names
+   if( parsedObjectType[ 0 ] == "Functions::MeshFunction" )
       return computeDifference< MeshPointer, Value, Real, typename MeshPointer::ObjectType::IndexType >( meshPointer, parsedObjectType[ 0 ], parameters );
-   
+
    if( indexType == "int" )
       return computeDifference< MeshPointer, Value, Real, int >( meshPointer, parsedObjectType[ 0 ], parameters );
    if( indexType == "long-int" )
@@ -528,12 +523,9 @@ bool setValueType( const MeshPointer& meshPointer,
 {
    String elementType;
 
-   if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ||
-       parsedObjectType[ 0 ] == "tnlMeshFunction" )                         // TODO: remove deprecated type names
+   if( parsedObjectType[ 0 ] == "Functions::MeshFunction" )
       elementType = parsedObjectType[ 3 ];
-   if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-       parsedObjectType[ 0 ] == "tnlSharedVector" ||                        // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlVector" )                               //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
       elementType = parsedObjectType[ 1 ];
 
 
diff --git a/src/Tools/tnl-view.h b/src/Tools/tnl-view.h
index d7a25fd1ed..64c09e32bb 100644
--- a/src/Tools/tnl-view.h
+++ b/src/Tools/tnl-view.h
@@ -250,9 +250,7 @@ bool convertObject( const MeshPointer& meshPointer,
      std::cout << " writing to " << outputFileName << " ... " << std::flush;
 
 
-   if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-       parsedObjectType[ 0 ] == "tnlSharedVector" ||   // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlVector" )          //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
    {
       using MeshType = typename MeshPointer::ObjectType;
       // FIXME: why is MeshType::GlobalIndexType not the same as Index?
@@ -273,9 +271,7 @@ bool setDimension( const MeshPointer& meshPointer,
                     const Config::ParameterContainer& parameters )
 {
    int dimensions( 0 );
-   if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-       parsedObjectType[ 0 ] == "tnlVector" ||                          // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlSharedVector" )                     //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
       dimensions = 1;
    switch( dimensions )
    {
@@ -297,9 +293,7 @@ bool setIndexType( const MeshPointer& meshPointer,
                    const Config::ParameterContainer& parameters )
 {
    String indexType;
-   if( parsedObjectType[ 0 ] == "Containers::Vector" || 
-       parsedObjectType[ 0 ] == "tnlSharedVector" ||                       // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlVector" )                              //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
       indexType = parsedObjectType[ 3 ];
 
    if( indexType == "int" )
@@ -370,9 +364,7 @@ bool setValueType( const MeshPointer& meshPointer,
    String elementType;
 
    // TODO: Fix this even for arrays
-   if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-       parsedObjectType[ 0 ] == "tnlSharedVector" ||                           // TODO: remove deprecated type names
-       parsedObjectType[ 0 ] == "tnlVector" )                                  //
+   if( parsedObjectType[ 0 ] == "Containers::Vector" )
       elementType = parsedObjectType[ 1 ];
 
    if( elementType == "float" )
@@ -394,8 +386,7 @@ bool setValueType( const MeshPointer& meshPointer,
       std::cerr << "Unable to parse object type " << elementType << "." << std::endl;
       return false;
    }
-   if( parsedValueType[ 0 ] == "Containers::StaticVector" ||
-       parsedValueType[ 0 ] == "Containers::StaticVector" )               // TODO: remove deprecated type names
+   if( parsedValueType[ 0 ] == "Containers::StaticVector" )
       return setTupleType< MeshPointer >( meshPointer, inputFileName, parsedObjectType, parsedValueType, parameters );
 
    std::cerr << "Unknown element type " << elementType << "." << std::endl;
@@ -468,12 +459,9 @@ struct FilesProcessor
             error = true;
             continue;
          }
-         if( parsedObjectType[ 0 ] == "Containers::Vector" ||
-             parsedObjectType[ 0 ] == "tnlSharedVector" ||                    // TODO: remove deprecated type names
-             parsedObjectType[ 0 ] == "tnlVector" )                           //
+         if( parsedObjectType[ 0 ] == "Containers::Vector" )
             setValueType< MeshPointer >( meshPointer, inputFiles[ i ], parsedObjectType, parameters );
-         if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ||
-             parsedObjectType[ 0 ] == "tnlMeshFunction" )                     // TODO: remove deprecated type names
+         if( parsedObjectType[ 0 ] == "Functions::MeshFunction" )
             setMeshFunction< MeshPointer >( meshPointer, inputFiles[ i ], parsedObjectType, parameters );
          if( parsedObjectType[ 0 ] == "Functions::VectorField" )
             setVectorFieldSize< MeshPointer >( meshPointer, inputFiles[ i ], parsedObjectType, parameters );
-- 
GitLab