10 #ifndef __vtkMRMLCommandLineModuleNode_h 11 #define __vtkMRMLCommandLineModuleNode_h 16 #include "vtkMRMLCLIExport.h" 18 class ModuleDescription;
31 void PrintSelf(ostream& os, vtkIndent indent)
override;
39 void WriteXML(ostream& of,
int indent)
override;
47 {
return "CommandLineModule";}
55 ParameterChangedEvent = 17000,
71 const ModuleDescription& GetModuleDescription()
const;
72 ModuleDescription& GetModuleDescription();
73 std::string GetModuleDescriptionAsString()
const;
74 void SetModuleDescription(
const ModuleDescription& description);
98 CompletedWithErrors= Completed | ErrorsMask,
100 BusyMask = Scheduled | Running | Cancelling | Completing
110 void SetStatus(
int status,
bool modify=
true);
112 int GetStatus()
const;
116 const char* GetStatusString()
const;
119 void SetOutputText(
const std::string& text,
bool modify =
true);
121 const std::string GetOutputText()
const;
124 void SetErrorText(
const std::string& text,
bool modify =
true);
126 const std::string GetErrorText()
const;
133 int GetProgress()
const;
147 AutoRunCancelsRunningProcess = 0x01,
151 AutoRunOnChangedParameter = 0x10,
156 AutoRunOnModifiedInputEvent = 0x20,
159 AutoRunOnOtherInputEvents = 0x40,
161 AutoRunOnAnyInputEvent = AutoRunOnModifiedInputEvent | AutoRunOnOtherInputEvents,
164 AutoRunEnabledMask = AutoRunOnChangedParameter | AutoRunOnAnyInputEvent
171 void SetAutoRun(
bool enable);
175 bool GetAutoRun()
const;
182 void SetAutoRunMode(
int autoRunMode);
186 int GetAutoRunMode()
const;
191 void SetAutoRunDelay(
unsigned int delayInMs);
196 unsigned int GetAutoRunDelay()
const;
200 vtkMTimeType GetLastRunTime()
const;
204 vtkMTimeType GetParameterMTime()
const;
208 vtkMTimeType GetInputMTime()
const;
212 bool ReadParameterFile(
const std::string& filename);
219 bool WriteParameterFile(
const std::string& filename,
bool withHandlesToBulkParameters =
true);
226 bool SetParameterAsNode(
const char* name,
vtkMRMLNode* value);
230 bool SetParameterAsString(
const char* name,
const std::string& value);
234 bool SetParameterAsInt(
const char* name,
int value);
238 bool SetParameterAsBool(
const char* name,
bool value);
242 bool SetParameterAsDouble(
const char* name,
double value);
246 bool SetParameterAsFloat(
const char* name,
float value);
248 std::string GetParameterAsString(
const char* name)
const;
250 void SetModuleDescription(
const char *name);
251 std::string GetModuleVersion()
const;
252 std::string GetModuleTitle()
const;
253 std::string GetModuleTarget()
const;
254 std::string GetModuleType()
const;
255 bool IsValidGroupId(
unsigned int group)
const;
256 bool IsValidParamId(
unsigned int group,
unsigned int param)
const;
257 unsigned int GetNumberOfParameterGroups()
const;
258 unsigned int GetNumberOfParametersInGroup(
unsigned int group)
const;
259 std::string GetParameterGroupLabel(
unsigned int group)
const;
260 std::string GetParameterGroupDescription(
unsigned int group)
const;
261 std::string GetParameterGroupAdvanced(
unsigned int group)
const;
262 std::string GetParameterTag(
unsigned int group,
unsigned int param)
const;
263 std::string GetParameterType(
unsigned int group,
unsigned int param)
const;
264 std::string GetParameterArgType(
unsigned int group,
unsigned int param)
const;
265 std::string GetParameterName(
unsigned int group,
unsigned int param)
const;
266 std::string GetParameterLongFlag(
unsigned int group,
unsigned int param)
const;
267 std::string GetParameterLabel(
unsigned int group,
unsigned int param)
const;
268 std::string GetParameterConstraints(
unsigned int group,
unsigned int param)
const;
269 std::string GetParameterMaximum(
unsigned int group,
unsigned int param)
const;
270 std::string GetParameterMinimum(
unsigned int group,
unsigned int param)
const;
271 std::string GetParameterDescription(
unsigned int group,
unsigned int param)
const;
272 std::string GetParameterChannel(
unsigned int group,
unsigned int param)
const;
273 std::string GetParameterIndex(
unsigned int group,
unsigned int param)
const;
275 std::string GetParameterDefault(
unsigned int group,
unsigned int param)
const;
276 std::string GetParameterValue(
unsigned int group,
unsigned int param)
const;
277 std::string GetParameterFlag(
unsigned int group,
unsigned int param)
const;
278 std::string GetParameterMultiple(
unsigned int group,
unsigned int param)
const;
279 std::string GetParameterFileExtensions(
unsigned int group,
unsigned int param)
const;
280 std::string GetParameterCoordinateSystem(
unsigned int group,
unsigned int param)
const;
285 bool IsInputDefaultValue(
const std::string& value)
const;
288 static int GetNumberOfRegisteredModules();
289 static const char* GetRegisteredModuleNameByIndex(
int idx);
290 static void RegisterModuleDescription(ModuleDescription md);
291 static bool HasRegisteredModule(
const std::string& name);
292 static ModuleDescription GetRegisteredModuleDescription(
const std::string& name);
299 void *callData)
override;
308 vtkInternal * Internal;
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
virtual void WriteXML(ostream &of, int indent)
CLINodeEvent
List of events that can be fired on or by the node.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
void Modified() 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)...