1 #ifndef __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__
2 #define __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__
4 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
5 #include <cpPlugins/Interface/Config.h>
7 #ifdef cpPlugins_Interface_QT4
14 #include <vtkSmartPointer.h>
15 #include <vtkPolyDataMapper.h>
16 #include <vtkPolyDataNormals.h>
17 #include <vtkQuadricLODActor.h>
18 #include <vtkStripper.h>
20 #include <cpExtensions/Visualization/MPRObjects.h>
22 // -------------------------------------------------------------------------
23 class QTreeWidgetItem;
31 // -------------------------------------------------------------------------
38 class cpPlugins_Interface_EXPORT BaseMPRWidget
44 typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
46 typedef TMPRObjects::TStyle TStyle;
47 typedef TMPRObjects::TMouseCommand TMouseCommand;
48 typedef TMPRObjects::TMouseWheelCommand TMouseWheelCommand;
49 typedef TMPRObjects::TKeyCommand TKeyCommand;
50 typedef TMPRObjects::TVoidCommand TVoidCommand;
51 typedef TMPRObjects::TMouseMoveCommand TMouseMoveCommand;
52 typedef TMPRObjects::TMouseClickCommand TMouseClickCommand;
53 typedef TMPRObjects::TMouseDoubleClickCommand TMouseDoubleClickCommand;
54 typedef TMPRObjects::TExposeCommand TExposeCommand;
55 typedef TMPRObjects::TConfigureCommand TConfigureCommand;
56 typedef TMPRObjects::TEnterCommand TEnterCommand;
57 typedef TMPRObjects::TLeaveCommand TLeaveCommand;
60 explicit BaseMPRWidget( QWidget* parent = 0 );
61 virtual ~BaseMPRWidget( );
63 // Some visualization accessors
66 const std::string& name,
67 const std::string& parent = ""
71 const std::string& name,
72 const std::string& parent,
73 const double& r, const double& g, const double& b
77 const std::string& name,
78 const std::string& parent
82 const std::string& name,
83 const std::string& parent,
84 const double& r, const double& g, const double& b
88 // Visual objects accessors
89 std::string GetSelectedData( ) const;
92 QTreeWidgetItem* _FindItem( const std::string& name ) const;
93 QTreeWidgetItem* _UpdateItem(
94 const std::string& name,
95 const std::string& parent
98 void _Add3DActor( vtkProp3D* prop );
101 void _SyncBottom( int a, int b );
102 void _SyncTop( int a, int b );
105 Ui::BaseMPRWidget* m_UI;
106 vtkSmartPointer< TMPRObjects > m_MPRObjects;
110 vtkSmartPointer< vtkPolyDataNormals > Normals;
111 vtkSmartPointer< vtkStripper > Stripper;
112 vtkSmartPointer< vtkPolyDataMapper > Mapper;
113 vtkSmartPointer< vtkQuadricLODActor > Actor;
115 PolyDataActor( vtkPolyData* pd );
118 std::map< std::string, vtkImageData* > m_Images;
119 std::map< std::string, PolyDataActor* > m_Meshes;
120 std::map< std::string, std::string > m_Tree;
122 QVTKWidget* m_VTK[ 4 ];
129 #endif // cpPlugins_Interface_QT4
131 #endif // __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__