]> Creatis software - cpPlugins.git/commitdiff
Some syntax simplifations
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 31 Dec 2014 10:05:47 +0000 (11:05 +0100)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 31 Dec 2014 10:05:47 +0000 (11:05 +0100)
12 files changed:
cmake/cpPluginsConfig.cmake.in
lib/cpPlugins/Interface/Image.cxx
lib/cpPlugins/Interface/Mesh.h
lib/cpPlugins/Interface/Object.cxx
lib/cpPlugins/Interface/Object.h
lib/cpPlugins/Interface/PolyLineParametricPath.cxx
lib/cpPlugins/Plugins/ImageReader.h
lib/cpPlugins/Plugins/ImageSeriesReader.h
lib/cpPlugins/Plugins/ImageWriter.h
lib/cpPlugins/Plugins/MarchingCubes.h
lib/cpPlugins/Plugins/MeshReader.h
lib/cpPlugins/Plugins/RGBImageToHSVChannelsFilter.h

index 23f0a8948d3c7852b3d6a076e1d3d8f049839557..e7ae468322fcd699e3d926e8f25de3a3e4bdf202 100644 (file)
@@ -31,10 +31,22 @@ FIND_PATH(
   @CMAKE_INSTALL_PREFIX@/include
   )
 
+FIND_PATH(
+  cpPlugins_INCLUDE_DIR4
+  Pluma/cpPlugins_Pluma_Export.h
+  PATHS
+  /usr/include
+  /usr/local/include
+  @PROJECT_SOURCE_DIR@/lib/third_party
+  @PROJECT_BINARY_DIR@/lib/third_party
+  @CMAKE_INSTALL_PREFIX@/include
+  )
+
 INCLUDE_DIRECTORIES(
   ${cpPlugins_INCLUDE_DIR1}
   ${cpPlugins_INCLUDE_DIR2}
   ${cpPlugins_INCLUDE_DIR3}
+  ${cpPlugins_INCLUDE_DIR4}
   )
 
 FIND_LIBRARY(
index 23cea6efeb9d4eac78d76080d94f4eede33c3224..c72663d5dbda9f65cb3cc2eddf021e64b4796fa3 100644 (file)
@@ -17,7 +17,9 @@
 
 // -------------------------------------------------------------------------
 #define cpPlugins_Image_RGB( p, d, o, f )                               \
-  if( dynamic_cast< itk::Image< itk::RGBPixel< p >, d >* >( o ) != NULL ) \
+  if(                                                                   \
+    dynamic_cast< itk::Image< itk::RGBPixel< p >, d >* >( o ) != NULL   \
+    )                                                                   \
     this->f< itk::RGBPixel< p >, d >( )
 
 // -------------------------------------------------------------------------
index 241da35309cac492dfea071d86be5fa226af0407..a1f06771b7410c41190b230f5899a7e8faddc30b 100644 (file)
@@ -47,10 +47,6 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      /*
-        itk::ProcessObject::Pointer m_Mesh2VTKMeshData;
-        vtkMeshData* m_VTKMeshData;
-      */
       vtkMapper* m_Mapper;
     };
 
index 3868b2c2c24d342006338530a35abae77e6b8616..1792a506442b2a589cdddeb5fb7964503c7a030d 100644 (file)
@@ -28,6 +28,6 @@ cpPlugins::Interface::Object::
 }
 
 // -------------------------------------------------------------------------
-PLUMA_PROVIDER_SOURCE( cpPlugins::Interface::Object, 1, 1 );
+CPPLUGINS_PROVIDER_SOURCE( cpPlugins::Interface::Object, 1, 1 );
 
 // eof - $RCSfile$
index b15d1f0824ccfb87e9c5542642d681918ce77205..fe86f1bc7efbb140e4b0e4f571bcc72e811bfd54 100644 (file)
@@ -8,7 +8,7 @@
 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 
 // -------------------------------------------------------------------------
-#define PLUMA_PROVIDER_HEADER_BEGIN_CPPLUGINS( TYPE )           \
+#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE )                 \
   class cpPlugins_Interface_EXPORT TYPE##Provider               \
     : public pluma::Provider                                    \
   {                                                             \
     { return( PLUMA_INTERFACE_VERSION ); }
 
 // -------------------------------------------------------------------------
-#define PLUMA_PROVIDER_HEADER_END_CPPLUGINS };
+#define CPPLUGINS_PROVIDER_HEADER_END };
 
 // -------------------------------------------------------------------------
-#define PLUMA_PROVIDER_HEADER_CPPLUGINS( TYPE )         \
-  PLUMA_PROVIDER_HEADER_BEGIN_CPPLUGINS( TYPE )         \
-  virtual TYPE::Pointer create( ) const = 0;            \
-  PLUMA_PROVIDER_HEADER_END_CPPLUGINS
+#define CPPLUGINS_PROVIDER_HEADER( TYPE )               \
+  CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE )               \
+    virtual TYPE::Pointer create( ) const = 0;          \
+  CPPLUGINS_PROVIDER_HEADER_END
 
 // -------------------------------------------------------------------------
-#define PLUMA_INHERIT_PROVIDER_CPPLUGINS( TYPE, SUPER ) \
-  class TYPE##Provider                                  \
-    : public SUPER##Provider                            \
-  {                                                     \
-  public:                                               \
-    SUPER::Pointer create( ) const                      \
-    {                                                   \
-      TYPE::Pointer a = TYPE::New( );                   \
-      SUPER::Pointer b = a.GetPointer( );               \
-      return( b );                                      \
-    }                                                   \
+#define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion )       \
+  PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
+
+// -------------------------------------------------------------------------
+#define CPPLUGINS_INHERIT_PROVIDER( TYPE )                              \
+  class TYPE##Provider                                                  \
+    : public cpPlugins::Interface::ObjectProvider                       \
+  {                                                                     \
+  public:                                                               \
+    cpPlugins::Interface::Object::Pointer create( ) const               \
+    {                                                                   \
+      TYPE::Pointer a = TYPE::New( );                                   \
+      cpPlugins::Interface::Object::Pointer b = a.GetPointer( );        \
+      return( b );                                                      \
+    }                                                                   \
   };
 
 namespace cpPlugins
@@ -79,8 +83,10 @@ namespace cpPlugins
       Self& operator=( const Self& );
     };
 
-    // TODO: doc
-    PLUMA_PROVIDER_HEADER_CPPLUGINS( Object );
+    /**
+     * Plugin provider
+     */
+    CPPLUGINS_PROVIDER_HEADER( Object );
 
   } // ecapseman
 
index 23fa0c7a6a44e4f1d0d28fddb7bd0dcdce1aa555..37be8af02bd7d8639c6066fa142cbbed7f0cda87 100644 (file)
@@ -81,13 +81,13 @@ _VTK( itk::DataObject* ref_image )
       image->TransformContinuousIndexToPhysicalPoint( idx, pnt );
       x = double( pnt[ 0 ] );
       y = double( pnt[ 1 ] );
-      z = ( D == 3 )? double( pnt[ 2 ] ): double( 0 );
+      z = ( D >= 3 )? double( pnt[ 2 ] ): double( 0 );
     }
     else
     {
       x = double( idx[ 0 ] );
       y = double( idx[ 1 ] );
-      z = ( D == 3 )? double( idx[ 2 ] ): double( 0 );
+      z = ( D >= 3 )? double( idx[ 2 ] ): double( 0 );
 
     } // fi
     points->InsertNextPoint( x, y, z );
index 2c73d70ddaae32af73b48c100a43b072c46b82ee..b16cf0ea34002b77a5d1b28cf6bab9f89bdbf997 100644 (file)
@@ -49,10 +49,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      ImageReader,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( ImageReader );
 
   } // ecapseman
 
index 9bd9bc2c5c806552c2a5e81345c1fae3c2e9dfbb..7577b676b8104f25ccb3fca3d687e1bf1b7ff7ef 100644 (file)
@@ -49,10 +49,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      ImageSeriesReader,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( ImageSeriesReader );
 
   } // ecapseman
 
index 1dcd98f5dbaf9534c2634a3160aca1b8cb10d95a..4278ed76563e267575e869be25d566f53d3bbbc0 100644 (file)
@@ -49,10 +49,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      ImageWriter,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( ImageWriter );
 
   } // ecapseman
 
index cf616b0df858da91ada5fb8b7cd4e22a838c1061..7ce3afde66f0340fbf6ecd657f32c8a6e5517fd6 100644 (file)
@@ -49,10 +49,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      MarchingCubes,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( MarchingCubes );
 
   } // ecapseman
 
index bfd94264acab27dc6b5450dae41a61cbf843519b..f16f843926e296fae4f81b33055e8ad658c00c7c 100644 (file)
@@ -49,10 +49,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      MeshReader,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( MeshReader );
 
   } // ecapseman
 
index d9fe353a84ec9e1f9a08621d762988ce4d5bce06..f995835c4a29b05316fee79c0c8a00ce269ae278 100644 (file)
@@ -51,10 +51,7 @@ namespace cpPlugins
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
-      RGBImageToHSVChannelsFilter,
-      cpPlugins::Interface::Object
-      );
+    CPPLUGINS_INHERIT_PROVIDER( RGBImageToHSVChannelsFilter );
 
   } // ecapseman