vtkSlicerCLIModuleLogic.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __vtkSlicerCLIModuleLogic_h
00014 #define __vtkSlicerCLIModuleLogic_h
00015
00016
00017 #include "vtkSlicerModuleLogic.h"
00018
00019
00020 #include "vtkMRMLCommandLineModuleNode.h"
00021
00022
00023 #include "vtkMRMLScene.h"
00024
00025
00026 #include <string>
00027
00028 #include "qSlicerBaseQTCLIExport.h"
00029
00030 typedef enum { CommandLineModule, SharedObjectModule, PythonModule } CommandLineModuleType;
00031
00032 class Q_SLICER_BASE_QTCLI_EXPORT vtkSlicerCLIModuleLogic :
00033 public vtkSlicerModuleLogic
00034 {
00035 public:
00036 static vtkSlicerCLIModuleLogic *New();
00037 vtkTypeMacro(vtkSlicerCLIModuleLogic,vtkSlicerModuleLogic);
00038 void PrintSelf(ostream& os, vtkIndent indent);
00039
00040
00041 virtual void ProcessMrmlEvents(vtkObject * vtkNotUsed(caller),
00042 unsigned long vtkNotUsed(event),
00043 void * vtkNotUsed(callData)){}
00044
00045
00046 vtkBooleanMacro (DeleteTemporaryFiles, int);
00047 vtkSetMacro (DeleteTemporaryFiles, int);
00048 vtkGetMacro (DeleteTemporaryFiles, int);
00049
00050
00051 vtkBooleanMacro (RedirectModuleStreams, int);
00052 vtkSetMacro (RedirectModuleStreams, int);
00053 vtkGetMacro (RedirectModuleStreams, int);
00054
00055
00056 void Apply( vtkMRMLCommandLineModuleNode* node );
00057 void ApplyAndWait ( vtkMRMLCommandLineModuleNode* node );
00058
00059
00060 void SetTemporaryDirectory(const char *tempdir)
00061 { this->TemporaryDirectory = tempdir; }
00062
00063
00064
00065
00066
00067
00068
00069 protected:
00070
00071 std::string ConstructTemporaryFileName(const std::string& tag,
00072 const std::string& type,
00073 const std::string& name,
00074 const std::vector<std::string>& extensions,
00075 CommandLineModuleType commandType) const;
00076 std::string ConstructTemporarySceneFileName(vtkMRMLScene *scene);
00077 std::string FindHiddenNodeID(const ModuleDescription& d,
00078 const ModuleParameter& p);
00079
00080
00081
00082 void ApplyTask(void *clientdata);
00083
00084
00085 static void ProgressCallback(void *);
00086
00087 private:
00088 vtkSlicerCLIModuleLogic();
00089 virtual ~vtkSlicerCLIModuleLogic();
00090 vtkSlicerCLIModuleLogic(const vtkSlicerCLIModuleLogic&);
00091 void operator=(const vtkSlicerCLIModuleLogic&);
00092
00093 int DeleteTemporaryFiles;
00094
00095 int RedirectModuleStreams;
00096
00097 vtkMRMLCommandLineModuleNode* CommandLineModuleNode;
00098
00099 std::string TemporaryDirectory;
00100
00101 };
00102
00103 #endif
00104