]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Object.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Object.h
index b133fe70281e60724a4c0a6f021c119228ade2d8..92de13cb646f4823107a073628e5558dc3e5c065 100644 (file)
@@ -1,56 +1,15 @@
 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
 #define __CPPLUGINS__INTERFACE__OBJECT__H__
 
+#include <cpPlugins/Interface/Macros.h>
+
 #include <string>
-#include <Pluma/Pluma.hpp>
-#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 
-#define ITK_MANUAL_INSTANTIATION
 #include <itkObject.h>
 #include <itkObjectFactory.h>
 
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE )                 \
-  class cpPlugins_Interface_EXPORT TYPE##Provider               \
-    : public pluma::Provider                                    \
-  {                                                             \
-  private:                                                      \
-    friend class pluma::Pluma;                                  \
-    static const unsigned int PLUMA_INTERFACE_VERSION;          \
-    static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;   \
-    static const std::string PLUMA_PROVIDER_TYPE;               \
-    std::string plumaGetType( ) const                           \
-    { return( PLUMA_PROVIDER_TYPE ); }                          \
-  public:                                                       \
-    unsigned int getVersion( ) const                            \
-    { return( PLUMA_INTERFACE_VERSION ); }
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER_END };
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER( TYPE )               \
-  CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE )               \
-    virtual TYPE::Pointer create( ) const = 0;          \
-  CPPLUGINS_PROVIDER_HEADER_END
-
-// -------------------------------------------------------------------------
-#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 );                                                      \
-    }                                                                   \
-  };
+#include <vtkSmartPointer.h>
+#include <vtkObjectBase.h>
 
 namespace cpPlugins
 {
@@ -70,10 +29,31 @@ namespace cpPlugins
     public:
       itkNewMacro( Self );
       itkTypeMacro( Object, itkObject );
+      cpPlugins_Id_Macro( Object, BaseObject );
+
+      itkGetStringMacro( Name );
+      itkGetConstMacro( ViewX, float );
+      itkGetConstMacro( ViewY, float );
+
+      itkSetStringMacro( Name );
+      itkSetMacro( ViewX, float );
+      itkSetMacro( ViewY, float );
 
     public:
-      itkGetConstMacro( ClassName, std::string );
-      itkGetConstMacro( ClassCategory, std::string );
+      virtual void Modified( ) const;
+      void SetViewCoords( float x, float y );
+
+      template< class T >
+        inline T* GetITK( );
+
+      template< class T >
+        inline const T* GetITK( ) const;
+
+      template< class T >
+        inline T* GetVTK( );
+
+      template< class T >
+        inline const T* GetVTK( ) const;
 
     protected:
       Object( );
@@ -85,19 +65,20 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      std::string m_ClassName;
-      std::string m_ClassCategory;
-    };
+      itk::LightObject::Pointer        m_ITKObject;
+      vtkSmartPointer< vtkObjectBase > m_VTKObject;
+      std::string                      m_Name;
 
-    /**
-     * Plugin provider
-     */
-    CPPLUGINS_PROVIDER_HEADER( Object );
+      float m_ViewX;
+      float m_ViewY;
+    };
 
   } // ecapseman
 
 } // ecapseman
 
+#include <cpPlugins/Interface/Object.hxx>
+
 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
 
 // eof - $RCSfile$