]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/BoundingBox.h
Code cleaning
[cpPlugins.git] / lib / cpPlugins / BoundingBox.h
diff --git a/lib/cpPlugins/BoundingBox.h b/lib/cpPlugins/BoundingBox.h
new file mode 100644 (file)
index 0000000..b29cf2d
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef __CPPLUGINS__BOUNDINGBOX__H__
+#define __CPPLUGINS__BOUNDINGBOX__H__
+
+#include <vector>
+#include <cpPlugins/DataObject.h>
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT BoundingBox
+    : public DataObject
+  {
+  public:
+    typedef BoundingBox                     Self;
+    typedef DataObject                      Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( BoundingBox, DataObject );
+    cpPlugins_Id_Macro( BoundingBox, Object );
+
+  public:
+    void SetDataObject( DataObject* o );
+    virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
+    virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
+
+    void Copy( Self* other );
+    void Blend( Self* other );
+
+    template< class _TPoint >
+      inline void SetMinimum( const _TPoint& p );
+
+    template< class _TPoint >
+      inline void SetMaximum( const _TPoint& p );
+
+    template< class _TPoint >
+      inline _TPoint GetMinimum( ) const;
+
+    template< class _TPoint >
+      inline _TPoint GetMaximum( ) const;
+
+  protected:
+    BoundingBox( );
+    virtual ~BoundingBox( );
+
+    template< class _TPoint >
+      inline void _SetPoint( unsigned int m, const _TPoint& p );
+
+    template< class _TPoint >
+      inline _TPoint _GetPoint( unsigned int m ) const;
+
+    template< unsigned int _NDim >
+      inline bool _ITKImage( itk::LightObject* o );
+
+    template< class _TScalar, unsigned int _NDim >
+      inline bool _ITKPointSet( itk::LightObject* o );
+
+  private:
+    // Purposely not implemented
+    BoundingBox( const Self& );
+    Self& operator=( const Self& );
+
+  protected:
+    std::vector< double > m_Points[ 2 ];
+  };
+
+} // ecapseman
+
+#include <cpPlugins/BoundingBox.hxx>
+
+#endif // __CPPLUGINS__BOUNDINGBOX__H__
+
+// eof - $RCSfile$