18#ifndef __vtkMRMLIOOptionsDescription_h
19#define __vtkMRMLIOOptionsDescription_h
21#include "vtkMRMLLogicExport.h"
24#include <vtkSmartPointer.h>
25#include <vtkVariant.h>
43 void PrintSelf(ostream& os, vtkIndent indent)
override;
60 void AddBoolOption(
const std::string& property,
const std::string& label,
const std::string& toolTip,
bool defaultValue);
61 void AddIntOption(
const std::string& property,
const std::string& label,
const std::string& toolTip,
int defaultValue,
int minimum,
int maximum);
63 const std::string& label,
64 const std::string& toolTip,
69 void AddStringOption(
const std::string& property,
const std::string& label,
const std::string& toolTip,
const std::string& defaultValue);
71 const std::string& label,
72 const std::string& toolTip,
73 const std::vector<std::string>& defaultValue,
74 const std::string& separator =
";");
76 void AddEnumOption(
const std::string& property,
const std::string& label,
const std::string& toolTip,
const vtkVariant& defaultValue);
77 void AddEnumChoice(
const std::string& property,
const vtkVariant& value,
const std::string& label);
80 const std::string& label,
81 const std::string& toolTip,
82 const std::string& defaultNodeID,
83 const std::vector<std::string>& nodeClasses,
164 vtkInternal* Internal;
vtkMRMLIOProperties * GetDefaults()
std::vector< std::string > GetFileNames()
Get all file names from the properties.
bool GetNthOptionHasRange(int index)
Returns true if the option has a range (int and double options).
void AddIntOption(const std::string &property, const std::string &label, const std::string &toolTip, int defaultValue, int minimum, int maximum)
int GetNthOptionDecimals(int index)
Number of decimals of a double option. Returns -1 if not specified.
std::string GetNthOptionType(int index)
Option type: "bool", "int", "double", "string", "stringList", "enum", or "node".
double GetNthOptionMinimum(int index)
std::vector< std::string > GetNthOptionNodeClasses(int index)
Node classes, whether "None" can be selected, and whether hidden nodes are shown (node options).
std::string GetFileName()
Get the file name from the properties. If multiple file names are specified then the first one is ret...
std::string GetNthOptionToolTip(int index)
void SetOptionEnabled(const std::string &property, bool enabled)
Set additional attributes of an option.
void SetOptionShowHidden(const std::string &property, bool showHidden)
Show nodes that are hidden from editors in node selectors.
void AddDoubleOption(const std::string &property, const std::string &label, const std::string &toolTip, double defaultValue, double minimum, double maximum, int decimals)
void SetOptionWidget(const std::string &property, const std::string &widget)
Hint for choosing a specific widget (for example "colorTable").
bool GetNthOptionNoneEnabled(int index)
void RemoveAllOptions()
Remove all options.
int GetNthOptionNumberOfChoices(int index)
Choices of an enum option.
void SetDefaults(vtkMRMLIOProperties *defaults)
Default values specified by the application (for example, from user settings).
bool GetNthOptionEnabled(int index)
void AddEnumChoice(const std::string &property, const vtkVariant &value, const std::string &label)
int GetOptionIndex(const std::string &property)
Get index of the option that sets the specified property. Returns -1 if not found.
static vtkMRMLIOOptionsDescription * New()
std::string ToJSON()
Get the description of all options as JSON.
bool GetNthOptionVisible(int index)
vtkVariant GetNthOptionChoiceValue(int index, int choiceIndex)
std::string GetNthOptionChoiceLabel(int index, int choiceIndex)
vtkMRMLIOOptionsDescription()
vtkVariant GetNthOptionValue(int index)
std::string GetNthOptionLabel(int index)
void AddNodeOption(const std::string &property, const std::string &label, const std::string &toolTip, const std::string &defaultNodeID, const std::vector< std::string > &nodeClasses, bool noneEnabled)
Add an option for selecting a MRML node. The value is the node ID.
void AddStringOption(const std::string &property, const std::string &label, const std::string &toolTip, const std::string &defaultValue)
void SetProperties(vtkMRMLIOProperties *properties)
Context and current values of options (for example, edited by the user). These values take precedence...
~vtkMRMLIOOptionsDescription() override
vtkMRMLIOProperties * GetProperties()
void SetOptionVisible(const std::string &property, bool visible)
void AddStringListOption(const std::string &property, const std::string &label, const std::string &toolTip, const std::vector< std::string > &defaultValue, const std::string &separator=";")
void PrintSelf(ostream &os, vtkIndent indent) override
bool HasOption(const std::string &property)
void AddBoolOption(const std::string &property, const std::string &label, const std::string &toolTip, bool defaultValue)
Add an option. If an option already exists for the property then it is replaced.
std::string GetNthOptionWidget(int index)
Hint for choosing a specific widget (for example "colorTable"). Empty if not specified.
void GetOptionValues(vtkMRMLIOProperties *values)
Get the effective values of all options. Options that have empty string or string list values are not...
std::vector< std::string > GetNthOptionStringListValue(int index)
Effective value of a string list option.
void AddEnumOption(const std::string &property, const std::string &label, const std::string &toolTip, const vtkVariant &defaultValue)
Add an option that can have one of the values added by AddEnumChoice().
bool GetBoolOptionValue(const std::string &property, bool defaultValue=false)
Effective value of a boolean option. Returns defaultValue if the option is not found.
std::string GetNthOptionProperty(int index)
int GetNumberOfOptions()
Number of options.
std::string GetNthOptionSeparator(int index)
Separator of items of a string list option.
double GetNthOptionMaximum(int index)
vtkVariant GetOptionValue(const std::string &property)
bool GetNthOptionShowHidden(int index)