Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkPluginFilterWatcher.h
Go to the documentation of this file.
1 #ifndef __vtkPluginFilterWatcher_h
2 #define __vtkPluginFilterWatcher_h
3 
4 // ModuleDescriptionParser includes
5 #include <ModuleProcessInformation.h>
6 
7 // VTK includes
8 #include <vtkCommand.h>
9 #include <vtkAlgorithm.h>
10 
11 #include "vtkSlicerBaseCLIExport.h"
12 
13 // STD includes
14 #include <string>
15 
50 class vtkPluginWatcherStart;
51 class vtkPluginWatcherEnd;
52 class vtkPluginWatcherProgress;
53 
54 class VTK_SLICER_BASE_CLI_EXPORT vtkPluginFilterWatcher
55 {
56 public:
59  vtkPluginFilterWatcher(vtkAlgorithm* o,
60  const char *comment="",
61  ModuleProcessInformation *inf=0,
62  double fraction = 1.0,
63  double start = 0.0);
64 
66  virtual ~vtkPluginFilterWatcher();
67 
70  const char *GetNameOfClass ()
71  {
72  return (Process ? Process->GetClassName() : "None");
73  }
74 
78  void QuietOn() { this->SetQuiet(true);};
79  void QuietOff() { this->SetQuiet(false);};
80 
83  vtkAlgorithm *GetProcess () {return Process;};
84 
86  void SetSteps(int val) {Steps=val;};
87  int GetSteps() {return Steps;};
88 
90  double GetStart() {return this->Start;};
91  double GetFraction() {return this->Fraction;};
92 
95  void SetQuiet(bool val);
96  bool GetQuiet() {return Quiet;};
97 
99  std::string GetComment() {return Comment;};
100 
102  ModuleProcessInformation *GetProcessInformation() {return this->ProcessInformation;};
103 
104 
105 protected:
106 
107 private:
108  int Steps;
109  bool Quiet;
110  std::string Comment;
111  vtkAlgorithm *Process;
112 
113  ModuleProcessInformation *ProcessInformation;
114  double Fraction;
115  double Start;
116 
117  vtkPluginWatcherStart *StartFilterCommand;
118  vtkPluginWatcherEnd *EndFilterCommand;
119  vtkPluginWatcherProgress *ProgressFilterCommand;
120 
121  unsigned long StartTag;
122  unsigned long EndTag;
123  unsigned long ProgressTag;
124 };
125 
126 #endif
Simple mechanism for monitoring the pipeline events of a filter and reporting these events to std::co...
ModuleProcessInformation * GetProcessInformation()