]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/DataObject.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / DataObject.h
index 9a8901e0c54e8c7f030fc5c2f4a41fd791ec83ed..05b70239dc06bda7ff7ac5e7451bbca89f050b95 100644 (file)
@@ -1,47 +1,75 @@
 #ifndef __CPPLUGINS__INTERFACE__DATAOBJECT__H__
 #define __CPPLUGINS__INTERFACE__DATAOBJECT__H__
 
-#include <map>
-#include <string>
-#include <itkDataObject.h>
 #include <cpPlugins/Interface/Object.h>
 
+#include <itkObject.h>
+#include <vtkSmartPointer.h>
+#include <vtkObject.h>
+
 namespace cpPlugins
 {
   namespace Interface
   {
+    // Some forward declarations
     class ProcessObject;
 
     /**
      */
-    class DataObject
+    class cpPlugins_Interface_EXPORT DataObject
       : public Object
     {
     public:
-      typedef DataObject Self;
-      typedef Object     Superclass;
+      typedef DataObject                      Self;
+      typedef Object                          Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
 
     public:
-      DataObject( );
-      virtual ~DataObject( );
+      itkNewMacro( Self );
+      itkTypeMacro( DataObject, Object );
+      cpPlugins_Id_Macro( DataObject, BasicObject );
+
+    public:
+      ProcessObject* GetSource( );
+      const ProcessObject* GetSource( ) const;
+      void SetSource( ProcessObject* src );
 
-      virtual std::string GetClassName( ) const;
+      void DisconnectPipeline( );
 
-      itk::DataObject* GetDataObject( ) const;
-      virtual void SetDataObject( itk::DataObject* src );
+      template< class T >
+        inline T* GetITK( );
 
-      ProcessObject* GetSource( ) const;
-      void SetSource( ProcessObject* src );
+      template< class T >
+        inline const T* GetITK( ) const;
+
+      template< class T >
+        inline T* GetVTK( );
+
+      template< class T >
+        inline const T* GetVTK( ) const;
 
     protected:
-      itk::DataObject::Pointer m_DataObject;
-      ProcessObject*           m_Source;
+      DataObject( );
+      virtual ~DataObject( );
+
+    private:
+      // Purposely not implemented
+      DataObject( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      itk::Object::Pointer         m_ITKObject;
+      vtkSmartPointer< vtkObject > m_VTKObject;
+      ProcessObject*               m_Source;
     };
 
   } // ecapseman
 
 } // ecapseman
 
+#include <cpPlugins/Interface/DataObject.hxx>
+
 #endif // __CPPLUGINS__INTERFACE__DATAOBJECT__H__
 
 // eof - $RCSfile$