#ifndef __FPA__VTK__IMAGE__OBSERVER3D__H__ #define __FPA__VTK__IMAGE__OBSERVER3D__H__ #include #include #include #include #include #include namespace fpa { namespace VTK { namespace Image { /** */ template< class _TFilter, class _TRenderWindow > class Observer3D : public itk::Command { public: typedef Observer3D Self; typedef itk::Command Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef _TFilter TFilter; typedef _TRenderWindow TRenderWindow; typedef typename TFilter::TInputImage TImage; typedef typename TFilter::TVertex TVertex; typedef typename TFilter::TVertexCompare TVertexCompare; typedef std::set< TVertex > TVertices; public: itkNewMacro( Self ); itkTypeMacro( Observer3D, itkCommand ); itkGetConstMacro( RenderPercentage, double ); itkSetMacro( RenderPercentage, double ); public: void SetRenderWindow( _TRenderWindow* rw ); void Render( ); void Execute( itk::Object* c, const itk::EventObject& e ) fpa_OVERRIDE { this->Execute( ( const itk::Object* )( c ), e ); } void Execute( const itk::Object* c, const itk::EventObject& e ) fpa_OVERRIDE; protected: Observer3D( ); virtual ~Observer3D( ); private: Observer3D( const Self& ); // Not impl. void operator=( const Self& ); // Not impl. protected: vtkSmartPointer< vtkPolyData > m_PolyData; vtkSmartPointer< vtkPolyDataMapper > m_PolyDataMapper; vtkSmartPointer< vtkActor > m_PolyDataActor; std::map< TVertex, unsigned long, TVertexCompare > m_PointsToReplace; std::map< TVertex, unsigned long, TVertexCompare > m_PointsInFront; _TRenderWindow* m_RenderWindow; unsigned long m_Count; unsigned long m_RenderCount; double m_RenderPercentage; }; } // ecapseman } // ecapseman } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __FPA__VTK__IMAGE__OBSERVER3D__H__ // eof - $RCSfile$