]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Parameters.h
MAC compilation issues solved... Now some tests please
[cpPlugins.git] / lib / cpPlugins / Interface / Parameters.h
index c93e160877d51275504aef98621a2f6a8433e5e4..3bf5d0140b8d068e36765a26208599dd0e284e6f 100644 (file)
@@ -70,12 +70,22 @@ class TiXmlElement;
         {                                                               \
           std::stringstream str;                                        \
           str << v;                                                     \
-          i->second.second = str.str( );                                \
+          if( i->second.second != str.str( ) )                          \
+          {                                                             \
+            i->second.second = str.str( );                              \
+            this->Modified( );                                          \
+          }                                                             \
         }                                                               \
         else                                                            \
-          i->second.second =                                            \
-            *( reinterpret_cast< const std::string* >( &v ) );          \
-        this->Modified( );                                              \
+        {                                                               \
+          const std::string* str =                                      \
+            reinterpret_cast< const std::string* >( &v );               \
+          if( i->second.second != *str )                                \
+          {                                                             \
+            i->second.second = *str;                                    \
+            this->Modified( );                                          \
+          }                                                             \
+        }                                                               \
       }                                                                 \
     }                                                                   \
   }
@@ -122,6 +132,7 @@ class TiXmlElement;
           str << i->second.second << "#";                               \
         str << v;                                                       \
         i->second.second = str.str( );                                  \
+        this->Modified( );                                              \
       }                                                                 \
     }                                                                   \
   }                                                                     \
@@ -131,7 +142,13 @@ class TiXmlElement;
     if( i != this->m_Parameters.end( ) )                                \
     {                                                                   \
       if( i->second.first == Self::Y##List )                            \
-        i->second.second = "";                                          \
+      {                                                                 \
+        if( i->second.second != "" )                                    \
+        {                                                               \
+          i->second.second = "";                                        \
+          this->Modified( );                                            \
+        }                                                               \
+      }                                                                 \
     }                                                                   \
   }
 
@@ -159,12 +176,10 @@ namespace cpPlugins
       enum Type
       {
         String       , Bool             , Int              ,
-        Uint         , Real             , Index            ,
-        Point        , Vector           , OpenFileName     ,
+        Uint         , Real             , OpenFileName     ,
         SaveFileName , PathName         , StringList       ,
         BoolList     , IntList          , UintList         ,
-        RealList     , IndexList        , PointList        ,
-        VectorList   , OpenFileNameList , SaveFileNameList ,
+        RealList     , OpenFileNameList , SaveFileNameList ,
         PathNameList , Choices          , NoType
       };
 
@@ -189,9 +204,6 @@ namespace cpPlugins
       cpPlugins_Parameters_Configure( Int );
       cpPlugins_Parameters_Configure( Uint );
       cpPlugins_Parameters_Configure( Real );
-      cpPlugins_Parameters_Configure( Index );
-      cpPlugins_Parameters_Configure( Point );
-      cpPlugins_Parameters_Configure( Vector );
       cpPlugins_Parameters_Configure( OpenFileName );
       cpPlugins_Parameters_Configure( SaveFileName );
       cpPlugins_Parameters_Configure( PathName );
@@ -200,9 +212,6 @@ namespace cpPlugins
       cpPlugins_Parameters_Configure( IntList );
       cpPlugins_Parameters_Configure( UintList );
       cpPlugins_Parameters_Configure( RealList );
-      cpPlugins_Parameters_Configure( IndexList );
-      cpPlugins_Parameters_Configure( PointList );
-      cpPlugins_Parameters_Configure( VectorList );
       cpPlugins_Parameters_Configure( OpenFileNameList );
       cpPlugins_Parameters_Configure( SaveFileNameList );
       cpPlugins_Parameters_Configure( PathNameList );
@@ -258,62 +267,10 @@ namespace cpPlugins
         const std::string& name, const std::string& choice
         );
 
-      // Some templated methods
-      template< class I >
-        I GetIndex(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class P >
-        P GetPoint(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class V >
-        V GetVector(
-          const std::string& name, const unsigned int& dim
-          ) const;
-
-      template< class I >
-        void SetIndex(
-          const std::string& name, const unsigned int& dim, const I& v
-          );
-      template< class P >
-        void SetPoint(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-      template< class V >
-        void SetVector(
-          const std::string& name, const unsigned int& dim, const V& v
-          );
-
-      template< class I >
-        std::vector< I > GetIndexList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class P >
-        std::vector< P > GetPointList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class V >
-        std::vector< V > GetVectorList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-
-      template< class I >
-        void AddToIndexList(
-          const std::string& name, const unsigned int& dim, const I& v
-          );
-      template< class P >
-        void AddToPointList(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-      template< class P >
-        void AddToVectorList(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-
-      void ClearIndexList( const std::string& name );
-      void ClearPointList( const std::string& name );
-      void ClearVectorList( const std::string& name );
+      std::string GetAcceptedFileExtensions( const std::string& name ) const;
+      void SetAcceptedFileExtensions(
+        const std::string& name, const std::string& extensions
+        );
 
       // XML "streaming"
       bool ToXML( TiXmlElement* parent_elem ) const;
@@ -333,16 +290,15 @@ namespace cpPlugins
       Self& operator=( const Self& other );
 
     protected:
-      TParameters m_Parameters;
-      ProcessObject* m_Process;
+      TParameters                          m_Parameters;
+      std::map< std::string, std::string > m_AcceptedFileExtensions;
+      ProcessObject*                       m_Process;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-#include <cpPlugins/Interface/Parameters.hxx>
-
 #endif // __CPPLUGINS__INTERFACE__PARAMETERS__H__
 
 // eof - $RCSfile$