![]() |
Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Represents a json object or list. More...
#include <Libs/MRML/Core/vtkMRMLJsonElement.h>
Public Types | |
typedef vtkObject | Superclass |
enum | Type { UNKNOWN = 0 , OBJECT = 1 , ARRAY = 2 , STRING = 3 , BOOL = 4 , INT = 5 , DOUBLE = 6 } |
Public Member Functions | |
VTK_NEWINSTANCE vtkMRMLJsonElement * | GetArrayItem (int childItemIndex) |
bool | GetArrayItemsStringProperty (const char *arrayName, const char *propertyName, std::vector< std::string > &propertyValues) |
VTK_NEWINSTANCE vtkMRMLJsonElement * | GetArrayProperty (const char *arrayName) |
int | GetArraySize () |
Returns the number of elements in this array. | |
bool | GetBoolProperty (const char *propertyName) |
Get Boolean property value. | |
bool | GetBoolProperty (const char *propertyName, bool &propertyValue) |
VTK_NEWINSTANCE vtkMRMLJsonElement * | GetChildMemberItem (int childItemIndex) |
virtual const char * | GetClassName () |
VTK_NEWINSTANCE vtkCodedEntry * | GetCodedEntryProperty (const char *propertyName) |
VTK_NEWINSTANCE vtkDoubleArray * | GetDoubleArrayProperty (const char *propertyName) |
double | GetDoubleProperty (const char *propertyName) |
bool | GetDoubleProperty (const char *propertyName, double &propertyValue) |
int | GetIntProperty (const char *propertyName) |
bool | GetIntProperty (const char *propertyName, int &propertyValue) |
bool | GetMatrix4x4Property (const char *propertyName, double v[16], bool flipRasLps) |
Type | GetMemberType (const char *propertyName) |
VTK_NEWINSTANCE vtkMRMLJsonElement * | GetObjectItem (int childItemIndex) |
VTK_NEWINSTANCE vtkMRMLJsonElement * | GetObjectProperty (const char *objectName) |
std::string | GetObjectPropertyNameByIndex (int childItemIndex) |
Get object member name by index. | |
int | GetObjectSize () |
Returns the number of elements in this object. | |
std::string | GetSchema () |
Get the JSON schema name. | |
std::string | GetStringProperty (const char *propertyName) |
bool | GetStringProperty (const char *propertyName, std::string &propertyValue) |
bool | GetStringVectorProperty (const char *propertyName, std::vector< std::string > &arrayValues) |
Type | GetType () |
Returns this element type. | |
virtual vtkMRMLMessageCollection * | GetUserMessages () |
Returns user-displayable messages that may contain details about any failed operation. | |
bool | GetVectorProperty (const char *propertyName, double *v, int numberOfComponents=3) |
bool | HasErrors () |
Returns true if user messages contain error messages. | |
bool | HasMember (const char *propertyName) |
Returns true if the JSON object contains a member by this name. | |
virtual int | IsA (const char *type) |
bool | IsArray () |
Returns true if this element is an array. | |
bool | IsObject () |
Returns true if this element is an object. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkMRMLJsonElement * | New () |
static vtkMRMLJsonElement * | SafeDownCast (vtkObject *o) |
Static Public Attributes | |
static const std::string | XML_NAME_VALUE_SEPARATOR |
static const std::string | XML_SEPARATOR |
Protected Member Functions | |
void | operator= (const vtkMRMLJsonElement &) |
vtkMRMLJsonElement () | |
vtkMRMLJsonElement (const vtkMRMLJsonElement &) | |
~vtkMRMLJsonElement () override | |
Protected Attributes | |
vtkInternal * | Internal |
vtkNew< vtkMRMLMessageCollection > | UserMessages |
Friends | |
class | vtkInternal |
class | vtkMRMLJsonReader |
Represents a json object or list.
Definition at line 32 of file vtkMRMLJsonElement.h.
typedef vtkObject vtkMRMLJsonElement::Superclass |
Definition at line 36 of file vtkMRMLJsonElement.h.
Enumerator | |
---|---|
UNKNOWN | |
OBJECT | |
ARRAY | |
STRING | |
BOOL | |
INT | |
DOUBLE |
Definition at line 49 of file vtkMRMLJsonElement.h.
|
protected |
|
overrideprotected |
|
protected |
VTK_NEWINSTANCE vtkMRMLJsonElement * vtkMRMLJsonElement::GetArrayItem | ( | int | childItemIndex | ) |
Returns the n-th object elements in this array. Only in C++: The caller must take ownership of the returned object.
bool vtkMRMLJsonElement::GetArrayItemsStringProperty | ( | const char * | arrayName, |
const char * | propertyName, | ||
std::vector< std::string > & | propertyValues ) |
Get property values from each item of an array. If no such property is found or it is not the right type then false is returned.
VTK_NEWINSTANCE vtkMRMLJsonElement * vtkMRMLJsonElement::GetArrayProperty | ( | const char * | arrayName | ) |
Get an array element from a property. If no such property is found or it is not the right type then nullptr is returned. Only in C++: The caller must take ownership of the returned object.
int vtkMRMLJsonElement::GetArraySize | ( | ) |
Returns the number of elements in this array.
bool vtkMRMLJsonElement::GetBoolProperty | ( | const char * | propertyName | ) |
Get Boolean property value.
bool vtkMRMLJsonElement::GetBoolProperty | ( | const char * | propertyName, |
bool & | propertyValue ) |
Get Boolean property value. If a Boolean property by the specified name is found then set it in propertyValue and return true. If a Boolean property by the specified name is not found then return false.
VTK_NEWINSTANCE vtkMRMLJsonElement * vtkMRMLJsonElement::GetChildMemberItem | ( | int | childItemIndex | ) |
Similar to GetObjectItem, but it returns the n-th elements for any type. Only in C++: The caller must take ownership of the returned object.
|
virtual |
Reimplemented in vtkMRMLMarkupsJsonElement.
VTK_NEWINSTANCE vtkCodedEntry * vtkMRMLJsonElement::GetCodedEntryProperty | ( | const char * | propertyName | ) |
Get a coded entry object from a property. If no such property is found or it is not the right type then nullptr is returned. Only in C++: The caller must take ownership of the returned object.
VTK_NEWINSTANCE vtkDoubleArray * vtkMRMLJsonElement::GetDoubleArrayProperty | ( | const char * | propertyName | ) |
Get a variable-size, potentially multi-component floating-point vector from a property. If no such property is found or it is not the right type then nullptr is returned. Only in C++: The caller must take ownership of the returned object.
double vtkMRMLJsonElement::GetDoubleProperty | ( | const char * | propertyName | ) |
Get double-precision floating point property value. If no such property is found or it is not double then 0.0 is returned.
bool vtkMRMLJsonElement::GetDoubleProperty | ( | const char * | propertyName, |
double & | propertyValue ) |
Get double-precision floating point property value. If a double property by the specified name is found then set it in propertyValue and return true. If a double property by the specified name is not found then return false.
int vtkMRMLJsonElement::GetIntProperty | ( | const char * | propertyName | ) |
Get integer property value. If no such property is found or it is not integer then 0 is returned.
bool vtkMRMLJsonElement::GetIntProperty | ( | const char * | propertyName, |
int & | propertyValue ) |
Get integer property value. If an integer property by the specified name is found then set it in propertyValue and return true. If an integer double property by the specified name is not found then return false.
bool vtkMRMLJsonElement::GetMatrix4x4Property | ( | const char * | propertyName, |
double | v[16], | ||
bool | flipRasLps ) |
Get 4x4 matrix from a property. If no such property is found or it is not the right type then false is returned. If flipRasLps is set to true then the matrix is converted between LPS/RAS coordinate system (multiplied by diag(-1,-1,1,1) matrix).
Type vtkMRMLJsonElement::GetMemberType | ( | const char * | propertyName | ) |
VTK_NEWINSTANCE vtkMRMLJsonElement * vtkMRMLJsonElement::GetObjectItem | ( | int | childItemIndex | ) |
Returns the n-th elements in this object as object. Only in C++: The caller must take ownership of the returned object.
VTK_NEWINSTANCE vtkMRMLJsonElement * vtkMRMLJsonElement::GetObjectProperty | ( | const char * | objectName | ) |
Get an object element from a property. If no such property is found or it is not the right type then nullptr is returned. Only in C++: The caller must take ownership of the returned object.
std::string vtkMRMLJsonElement::GetObjectPropertyNameByIndex | ( | int | childItemIndex | ) |
Get object member name by index.
int vtkMRMLJsonElement::GetObjectSize | ( | ) |
Returns the number of elements in this object.
std::string vtkMRMLJsonElement::GetSchema | ( | ) |
Get the JSON schema name.
std::string vtkMRMLJsonElement::GetStringProperty | ( | const char * | propertyName | ) |
Get string property value. Returns empty string if no such string property is found.
bool vtkMRMLJsonElement::GetStringProperty | ( | const char * | propertyName, |
std::string & | propertyValue ) |
Get string property value. If a string property by the specified name is found then set it in propertyValue and return true. If a string property by the specified name is not found then return false.
bool vtkMRMLJsonElement::GetStringVectorProperty | ( | const char * | propertyName, |
std::vector< std::string > & | arrayValues ) |
Get a vector of string values from a property. If no such property is found or it is not the right type then false is returned.
Type vtkMRMLJsonElement::GetType | ( | ) |
Returns this element type.
|
virtual |
Returns user-displayable messages that may contain details about any failed operation.
bool vtkMRMLJsonElement::GetVectorProperty | ( | const char * | propertyName, |
double * | v, | ||
int | numberOfComponents = 3 ) |
Get a fixed-size vector of floating point values from a property. If no such property is found or it is not the right type then false is returned.
bool vtkMRMLJsonElement::HasErrors | ( | ) |
Returns true if user messages contain error messages.
bool vtkMRMLJsonElement::HasMember | ( | const char * | propertyName | ) |
Returns true if the JSON object contains a member by this name.
|
virtual |
Reimplemented in vtkMRMLMarkupsJsonElement.
bool vtkMRMLJsonElement::IsArray | ( | ) |
Returns true if this element is an array.
bool vtkMRMLJsonElement::IsObject | ( | ) |
Returns true if this element is an object.
|
static |
|
static |
|
protected |
|
override |
|
static |
|
friend |
Definition at line 185 of file vtkMRMLJsonElement.h.
|
friend |
Definition at line 186 of file vtkMRMLJsonElement.h.
|
protected |
Definition at line 184 of file vtkMRMLJsonElement.h.
|
protected |
Definition at line 181 of file vtkMRMLJsonElement.h.
|
static |
Definition at line 41 of file vtkMRMLJsonElement.h.
|
static |
Definition at line 40 of file vtkMRMLJsonElement.h.