]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageIndexesContainerToPolyData.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageIndexesContainerToPolyData.h
diff --git a/lib/cpExtensions/Visualization/ImageIndexesContainerToPolyData.h b/lib/cpExtensions/Visualization/ImageIndexesContainerToPolyData.h
new file mode 100644 (file)
index 0000000..5129512
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGEINDEXESCONTAINERTOPOLYDATA__H__
+#define __CPEXTENSIONS__VISUALIZATION__IMAGEINDEXESCONTAINERTOPOLYDATA__H__
+
+#include <vtkPolyDataAlgorithm.h>
+#include <itkImageBase.h>
+
+namespace cpExtensions
+{
+  namespace Visualization
+  {
+    /**
+     */
+    template< class _TIndexes >
+    class ImageIndexesContainerToPolyData
+      : public vtkPolyDataAlgorithm
+    {
+    public:
+      typedef ImageIndexesContainerToPolyData Self;
+
+      typedef _TIndexes TIndexes;
+      typedef typename TIndexes::ComponentType TContainer;
+      typedef typename TContainer::value_type  TIndex;
+      typedef itk::ImageBase< TIndex::Dimension > TImage;
+
+    public:
+      vtkTypeMacro( ImageIndexesContainerToPolyData, vtkPolyDataAlgorithm );
+
+    public:
+      static Self* New( );
+
+      const TIndexes* GetInput( ) const;
+      const TImage* GetReferenceImage( ) const;
+      void SetInput( const TIndexes* c );
+      void SetReferenceImage( const TImage* i );
+
+    protected:
+      ImageIndexesContainerToPolyData( );
+      virtual ~ImageIndexesContainerToPolyData( );
+
+      int RequestData(
+        vtkInformation* information,
+        vtkInformationVector** input,
+        vtkInformationVector* output
+        );
+      int RequestInformation(
+        vtkInformation* information,
+        vtkInformationVector** input,
+        vtkInformationVector* output
+        );
+
+    private:
+      // Purposely not implemented
+      ImageIndexesContainerToPolyData( const Self& );
+      void operator=( const Self& );
+
+    protected:
+      const TIndexes* m_Indexes;
+      const TImage*   m_ReferenceImage;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Visualization/ImageIndexesContainerToPolyData.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif //  __CPEXTENSIONS__VISUALIZATION__IMAGEINDEXESCONTAINERTOPOLYDATA__H__
+
+// eof - $RCSfile$