#ifndef __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__ #define __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__ #include #include #ifdef cpPlugins_Interface_QT4 #include #include #include #include #include #include #include #include #include // ------------------------------------------------------------------------- class QTreeWidgetItem; class QVTKWidget; namespace Ui { class BaseMPRWidget; } // ------------------------------------------------------------------------- namespace cpPlugins { namespace Interface { /** */ class cpPlugins_Interface_EXPORT BaseMPRWidget : public QWidget { Q_OBJECT; public: typedef cpExtensions::Visualization::MPRObjects TMPRObjects; typedef TMPRObjects::TStyle TStyle; typedef TMPRObjects::TMouseCommand TMouseCommand; typedef TMPRObjects::TMouseWheelCommand TMouseWheelCommand; typedef TMPRObjects::TKeyCommand TKeyCommand; typedef TMPRObjects::TVoidCommand TVoidCommand; typedef TMPRObjects::TMouseMoveCommand TMouseMoveCommand; typedef TMPRObjects::TMouseClickCommand TMouseClickCommand; typedef TMPRObjects::TMouseDoubleClickCommand TMouseDoubleClickCommand; typedef TMPRObjects::TExposeCommand TExposeCommand; typedef TMPRObjects::TConfigureCommand TConfigureCommand; typedef TMPRObjects::TEnterCommand TEnterCommand; typedef TMPRObjects::TLeaveCommand TLeaveCommand; public: explicit BaseMPRWidget( QWidget* parent = 0 ); virtual ~BaseMPRWidget( ); // Some visualization accessors bool ShowImage( vtkImageData* image, const std::string& name, const std::string& parent = "" ); bool ShowImage( vtkImageData* image, const std::string& name, const std::string& parent, const double& r, const double& g, const double& b ); bool ShowMesh( vtkPolyData* mesh, const std::string& name, const std::string& parent ); bool ShowMesh( vtkPolyData* mesh, const std::string& name, const std::string& parent, const double& r, const double& g, const double& b ); void ClearAll( ); // Visual objects accessors std::string GetSelectedData( ) const; protected: QTreeWidgetItem* _FindItem( const std::string& name ) const; QTreeWidgetItem* _UpdateItem( const std::string& name, const std::string& parent ); void _Add3DActor( vtkProp3D* prop ); private slots: void _SyncBottom( int a, int b ); void _SyncTop( int a, int b ); protected: Ui::BaseMPRWidget* m_UI; vtkSmartPointer< TMPRObjects > m_MPRObjects; struct PolyDataActor { vtkSmartPointer< vtkPolyDataNormals > Normals; vtkSmartPointer< vtkStripper > Stripper; vtkSmartPointer< vtkPolyDataMapper > Mapper; vtkSmartPointer< vtkQuadricLODActor > Actor; PolyDataActor( vtkPolyData* pd ); }; std::map< std::string, vtkImageData* > m_Images; std::map< std::string, PolyDataActor* > m_Meshes; std::map< std::string, std::string > m_Tree; QVTKWidget* m_VTK[ 4 ]; }; } // ecapseman } // ecapseman #endif // cpPlugins_Interface_QT4 #endif // __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__ // eof - $RCSfile$