13 #include <vtkCommand.h>
14 #include <vtkOrientationMarkerWidget.h>
15 #include <vtkRenderer.h>
16 #include <vtkSmartPointer.h>
19 #include <cpPlugins/Interface/Interface.h>
20 #include <cpPlugins/Interface/ProcessObject.h>
21 #include <cpPlugins/Interface/Image.h>
22 #include <cpPlugins/Interface/DataObject.h>
23 #include <cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h>
25 // -------------------------------------------------------------------------
28 class DoubleClickCommand
32 typedef DoubleClickCommand Self;
35 vtkTypeMacro( DoubleClickCommand, vtkCommand );
38 static DoubleClickCommand* New( );
40 void SetMainWnd( MainWnd* wnd );
41 void Execute( vtkObject* caller, unsigned long eid, void* data );
44 DoubleClickCommand( );
45 virtual ~DoubleClickCommand( );
48 // Purposely not implemented
49 DoubleClickCommand( const Self& );
50 Self& operator=( const Self& );
56 // -------------------------------------------------------------------------
62 // -------------------------------------------------------------------------
71 friend class DoubleClickCommand;
76 typedef cpPlugins::Interface::Interface TPluginsInterface;
77 typedef cpPlugins::Interface::Object TPluginObject;
78 typedef cpPlugins::Interface::DataObject TPluginData;
79 typedef cpPlugins::Interface::Image TPluginImage;
80 typedef cpPlugins::Interface::ProcessObject TPlugin;
81 typedef cpPlugins::Interface::Parameters TParameters;
82 typedef cpPlugins::Extensions::Visualization::MPRWithDifferentWindows TMPR;
84 typedef std::map< std::string, std::string > TStringMap;
89 DoubleClickPluginType,
96 SegmentationPluginCategory = 0,
97 SegmentationFilteringPluginCategory,
98 MeshProcessingPluginCategory,
103 explicit MainWnd( QWidget* parent = 0 );
107 void _LoadApplicationPreferences( );
108 bool _LoadPlugins( );
109 bool _CheckClassesInPlugins( const TStringMap& classes );
110 void _AddPluginActions(
111 const TStringMap& classes, QMenu* menu, const char* method
113 TPluginImage* _LoadImage(
114 const std::string& image_type, const std::string& image_dim
116 void _UpdateEnabledFlags( );
118 bool _ParametersDialog( const TParameters& parameters );
119 void _ExecuteDoubleClickPlugin( const double* pnt );
122 void _JoinSegmentations( );
128 void _SliceMesh( int axis );
129 static void _SliceEventCallback(
131 long unsigned int eventId,
132 void* clientData, void* callData
137 void _triggered_actionReloadPlugins( );
138 void _triggered_actionOpenInputImage( );
139 void _triggered_actionOpenSegmentedImage( );
140 void _triggered_actionSwitchMode( );
142 void _triggered_actionSegmentImage( );
143 void _triggered_actionFilterSegmentation( );
144 void _triggered_actionProcessMesh( );
147 void triggered_aOpenSegmentedImage( );
148 void triggered_aFilterSegmentedImage( );
149 void triggered_aSegmentedImageToMesh( );
150 void triggered_aLoadInputImage( );
151 void triggered_aLoadSegmentedImage( );
157 // Application preferences
158 std::string m_ApplicationPreferencesFile;
159 TStringMap m_ApplicationPreferences;
162 std::string m_PluginsConfigurationFile;
163 TPluginsInterface m_Plugins;
165 // Needed object from plugins
166 TStringMap m_BaseClasses;
167 TStringMap m_SegmentationClasses;
168 TStringMap m_SegmentationFilterClasses;
169 TStringMap m_MeshFilterClasses;
172 std::string m_LastOpenedFile;
175 TPluginImage* m_InputImage;
176 TPluginImage* m_SegmentedImage;
178 // Visualization stuff
182 TPlugin* m_ActivePlugin;
183 QWidget* m_ActiveParameters;
184 Self::PluginType m_ActivePluginType;
185 Self::PluginCategory m_ActivePluginCategory;
187 vtkSmartPointer< DoubleClickCommand > m_DoubleClickCommand;
190 #endif // __MAINWND__H__