10 #ifndef __vtkMRMLCommandLineModuleNode_h 11 #define __vtkMRMLCommandLineModuleNode_h 16 #include "vtkMRMLCLIExport.h" 18 class ModuleDescription;
31 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
36 virtual
void ReadXMLAttributes(const
char** atts) VTK_OVERRIDE;
39 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
45 virtual const
char* GetNodeTagName() VTK_OVERRIDE
46 {
return "CommandLineModule";}
54 ParameterChangedEvent = 17000,
70 const ModuleDescription& GetModuleDescription()
const;
71 ModuleDescription& GetModuleDescription();
72 std::string GetModuleDescriptionAsString()
const;
73 void SetModuleDescription(
const ModuleDescription& description);
97 CompletedWithErrors= Completed | ErrorsMask,
99 BusyMask = Scheduled | Running | Cancelling | Completing
109 void SetStatus(
int status,
bool modify=
true);
111 int GetStatus()
const;
115 const char* GetStatusString()
const;
118 void SetOutputText(
const std::string& text,
bool modify =
true);
120 const std::string GetOutputText()
const;
123 void SetErrorText(
const std::string& text,
bool modify =
true);
125 const std::string GetErrorText()
const;
144 AutoRunCancelsRunningProcess = 0x01,
148 AutoRunOnChangedParameter = 0x10,
153 AutoRunOnModifiedInputEvent = 0x20,
156 AutoRunOnOtherInputEvents = 0x40,
158 AutoRunOnAnyInputEvent = AutoRunOnModifiedInputEvent | AutoRunOnOtherInputEvents,
161 AutoRunEnabledMask = AutoRunOnChangedParameter | AutoRunOnAnyInputEvent
168 void SetAutoRun(
bool enable);
172 bool GetAutoRun()
const;
179 void SetAutoRunMode(
int autoRunMode);
183 int GetAutoRunMode()
const;
188 void SetAutoRunDelay(
unsigned int delayInMs);
193 unsigned int GetAutoRunDelay()
const;
197 vtkMTimeType GetLastRunTime()
const;
201 vtkMTimeType GetParameterMTime()
const;
205 vtkMTimeType GetInputMTime()
const;
209 bool ReadParameterFile(
const std::string& filename);
216 bool WriteParameterFile(
const std::string& filename,
bool withHandlesToBulkParameters =
true);
223 bool SetParameterAsNode(
const char* name,
vtkMRMLNode* value);
227 bool SetParameterAsString(
const char* name,
const std::string& value);
231 bool SetParameterAsInt(
const char* name,
int value);
235 bool SetParameterAsBool(
const char* name,
bool value);
239 bool SetParameterAsDouble(
const char* name,
double value);
243 bool SetParameterAsFloat(
const char* name,
float value);
245 std::string GetParameterAsString(
const char* name)
const;
247 void SetModuleDescription(
const char *name);
248 std::string GetModuleVersion()
const;
249 std::string GetModuleTitle()
const;
250 std::string GetModuleTarget()
const;
251 std::string GetModuleType()
const;
252 bool IsValidGroupId(
unsigned int group)
const;
253 bool IsValidParamId(
unsigned int group,
unsigned int param)
const;
254 unsigned int GetNumberOfParameterGroups()
const;
255 unsigned int GetNumberOfParametersInGroup(
unsigned int group)
const;
256 std::string GetParameterGroupLabel(
unsigned int group)
const;
257 std::string GetParameterGroupDescription(
unsigned int group)
const;
258 std::string GetParameterGroupAdvanced(
unsigned int group)
const;
259 std::string GetParameterTag(
unsigned int group,
unsigned int param)
const;
260 std::string GetParameterType(
unsigned int group,
unsigned int param)
const;
261 std::string GetParameterArgType(
unsigned int group,
unsigned int param)
const;
262 std::string GetParameterName(
unsigned int group,
unsigned int param)
const;
263 std::string GetParameterLongFlag(
unsigned int group,
unsigned int param)
const;
264 std::string GetParameterLabel(
unsigned int group,
unsigned int param)
const;
265 std::string GetParameterConstraints(
unsigned int group,
unsigned int param)
const;
266 std::string GetParameterMaximum(
unsigned int group,
unsigned int param)
const;
267 std::string GetParameterMinimum(
unsigned int group,
unsigned int param)
const;
268 std::string GetParameterDescription(
unsigned int group,
unsigned int param)
const;
269 std::string GetParameterChannel(
unsigned int group,
unsigned int param)
const;
270 std::string GetParameterIndex(
unsigned int group,
unsigned int param)
const;
272 std::string GetParameterDefault(
unsigned int group,
unsigned int param)
const;
273 std::string GetParameterValue(
unsigned int group,
unsigned int param)
const;
274 std::string GetParameterFlag(
unsigned int group,
unsigned int param)
const;
275 std::string GetParameterMultiple(
unsigned int group,
unsigned int param)
const;
276 std::string GetParameterFileExtensions(
unsigned int group,
unsigned int param)
const;
277 std::string GetParameterCoordinateSystem(
unsigned int group,
unsigned int param)
const;
282 bool IsInputDefaultValue(
const std::string& value)
const;
285 static int GetNumberOfRegisteredModules();
286 static const char* GetRegisteredModuleNameByIndex(
int idx);
287 static void RegisterModuleDescription(ModuleDescription md);
288 static bool HasRegisteredModule(
const std::string& name);
289 static ModuleDescription GetRegisteredModuleDescription(
const std::string& name);
292 virtual void Modified() VTK_OVERRIDE;
295 virtual
void ProcessMRMLEvents(vtkObject *caller,
unsigned long event,
296 void *callData) VTK_OVERRIDE;
305 vtkInternal * Internal;
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
CLINodeEvent
List of events that can be fired on or by the node.
virtual void Modified() VTK_OVERRIDE
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing the parameters allowing to run a command line interface module (CLI)...