Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLJsonWriter Class Reference

Writes properties into a JSON stream. More...

#include <Libs/MRML/Core/vtkMRMLJsonElement.h>

Inheritance diagram for vtkMRMLJsonWriter:
Collaboration diagram for vtkMRMLJsonWriter:

Public Types

typedef vtkObject Superclass
 

Public Member Functions

std::string ConvertXMLToJson (vtkXMLDataElement *xmlElement, const std::string &nodeTagName)
 
virtual const char * GetClassName ()
 
virtual vtkMRMLMessageCollectionGetUserMessages ()
 Returns user-displayable messages that may contain details about any failed operation.
 
bool HasErrors ()
 Returns true if user messages contain error messages.
 
virtual int IsA (const char *type)
 
bool isBool (const std::string &str)
 Utility functions to check string type.
 
bool isDouble (const std::string &str)
 
bool isInt (const std::string &str)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
std::string toLower (const std::string &str)
 Utility function to convert string to lower case.
 
void WriteArrayPropertyEnd ()
 This method must be called when all array items are written.
 
void WriteArrayPropertyStart (const std::string &propertyName)
 This method creates a new array as a property.
 
void WriteObjectEnd ()
 This method must be called when all properties of the object are written.
 
void WriteObjectPropertyEnd ()
 This method must be called when all properties of the object are written.
 
void WriteObjectPropertyStart (const std::string &propertyName)
 This method creates a new object as a property.
 
void WriteObjectStart ()
 This method creates a new object in an array.
 
bool WriteToFileBegin (const char *filePath, const char *schema)
 
bool WriteToFileEnd ()
 
bool WriteToStringBegin (const char *nodeTagName)
 
std::string WriteToStringEnd ()
 
void WriteStringProperty (const std::string &propertyName, const std::string &propertyValue)
 
void WriteStringVectorProperty (const std::string &propertyName, const std::vector< std::string > &arrayValues)
 
void WriteCodedEntryProperty (const std::string &propertyName, vtkCodedEntry *codedEntry)
 
void WriteStringPropertyIfNotEmpty (const std::string &propertyName, const std::string &propertyValue)
 
void WriteBoolProperty (const std::string &propertyName, bool propertyValue)
 
void WriteIntProperty (const std::string &propertyName, int propertyValue)
 
void WriteDoubleProperty (const std::string &propertyName, double propertyValue)
 
void WriteVectorProperty (const std::string &propertyName, double *v, int numberOfComponents=3)
 
void WriteMatrix4x4Property (const std::string &propertyName, double v[16], bool flipRasLps)
 
void WriteDoubleArrayProperty (const char *propertyName, vtkDoubleArray *doubleArray)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkMRMLJsonWriterNew ()
 
static vtkMRMLJsonWriterSafeDownCast (vtkObject *o)
 

Protected Member Functions

void operator= (const vtkMRMLJsonWriter &)
 
void processXMLElement (vtkXMLDataElement *xmlElement)
 
 vtkMRMLJsonWriter ()
 
 vtkMRMLJsonWriter (const vtkMRMLJsonWriter &)
 
 ~vtkMRMLJsonWriter () override
 

Protected Attributes

vtkInternalInternal
 
vtkNew< vtkMRMLMessageCollectionUserMessages
 

Friends

class vtkInternal
 

Detailed Description

Writes properties into a JSON stream.

Definition at line 231 of file vtkMRMLJsonElement.h.

Member Typedef Documentation

◆ Superclass

typedef vtkObject vtkMRMLJsonWriter::Superclass

Definition at line 235 of file vtkMRMLJsonElement.h.

Constructor & Destructor Documentation

◆ vtkMRMLJsonWriter() [1/2]

vtkMRMLJsonWriter::vtkMRMLJsonWriter ( )
protected

◆ ~vtkMRMLJsonWriter()

vtkMRMLJsonWriter::~vtkMRMLJsonWriter ( )
overrideprotected

◆ vtkMRMLJsonWriter() [2/2]

vtkMRMLJsonWriter::vtkMRMLJsonWriter ( const vtkMRMLJsonWriter & )
protected

Member Function Documentation

◆ ConvertXMLToJson()

std::string vtkMRMLJsonWriter::ConvertXMLToJson ( vtkXMLDataElement * xmlElement,
const std::string & nodeTagName )

Convert XML to JSON return string

◆ GetClassName()

virtual const char * vtkMRMLJsonWriter::GetClassName ( )
virtual

Reimplemented in vtkMRMLMarkupsJsonWriter.

◆ GetUserMessages()

virtual vtkMRMLMessageCollection * vtkMRMLJsonWriter::GetUserMessages ( )
virtual

Returns user-displayable messages that may contain details about any failed operation.

◆ HasErrors()

bool vtkMRMLJsonWriter::HasErrors ( )

Returns true if user messages contain error messages.

◆ IsA()

virtual int vtkMRMLJsonWriter::IsA ( const char * type)
virtual

Reimplemented in vtkMRMLMarkupsJsonWriter.

◆ isBool()

bool vtkMRMLJsonWriter::isBool ( const std::string & str)

Utility functions to check string type.

◆ isDouble()

bool vtkMRMLJsonWriter::isDouble ( const std::string & str)

◆ isInt()

bool vtkMRMLJsonWriter::isInt ( const std::string & str)

◆ IsTypeOf()

static int vtkMRMLJsonWriter::IsTypeOf ( const char * type)
static

◆ New()

static vtkMRMLJsonWriter * vtkMRMLJsonWriter::New ( )
static

◆ operator=()

void vtkMRMLJsonWriter::operator= ( const vtkMRMLJsonWriter & )
protected

◆ PrintSelf()

void vtkMRMLJsonWriter::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ processXMLElement()

void vtkMRMLJsonWriter::processXMLElement ( vtkXMLDataElement * xmlElement)
protected

◆ SafeDownCast()

static vtkMRMLJsonWriter * vtkMRMLJsonWriter::SafeDownCast ( vtkObject * o)
static

◆ toLower()

std::string vtkMRMLJsonWriter::toLower ( const std::string & str)

Utility function to convert string to lower case.

◆ WriteArrayPropertyEnd()

void vtkMRMLJsonWriter::WriteArrayPropertyEnd ( )

This method must be called when all array items are written.

◆ WriteArrayPropertyStart()

void vtkMRMLJsonWriter::WriteArrayPropertyStart ( const std::string & propertyName)

This method creates a new array as a property.

◆ WriteBoolProperty()

void vtkMRMLJsonWriter::WriteBoolProperty ( const std::string & propertyName,
bool propertyValue )

◆ WriteCodedEntryProperty()

void vtkMRMLJsonWriter::WriteCodedEntryProperty ( const std::string & propertyName,
vtkCodedEntry * codedEntry )

◆ WriteDoubleArrayProperty()

void vtkMRMLJsonWriter::WriteDoubleArrayProperty ( const char * propertyName,
vtkDoubleArray * doubleArray )

◆ WriteDoubleProperty()

void vtkMRMLJsonWriter::WriteDoubleProperty ( const std::string & propertyName,
double propertyValue )

◆ WriteIntProperty()

void vtkMRMLJsonWriter::WriteIntProperty ( const std::string & propertyName,
int propertyValue )

◆ WriteMatrix4x4Property()

void vtkMRMLJsonWriter::WriteMatrix4x4Property ( const std::string & propertyName,
double v[16],
bool flipRasLps )

◆ WriteObjectEnd()

void vtkMRMLJsonWriter::WriteObjectEnd ( )

This method must be called when all properties of the object are written.

◆ WriteObjectPropertyEnd()

void vtkMRMLJsonWriter::WriteObjectPropertyEnd ( )

This method must be called when all properties of the object are written.

◆ WriteObjectPropertyStart()

void vtkMRMLJsonWriter::WriteObjectPropertyStart ( const std::string & propertyName)

This method creates a new object as a property.

◆ WriteObjectStart()

void vtkMRMLJsonWriter::WriteObjectStart ( )

This method creates a new object in an array.

◆ WriteStringProperty()

void vtkMRMLJsonWriter::WriteStringProperty ( const std::string & propertyName,
const std::string & propertyValue )

Write simple value as an object property.

◆ WriteStringPropertyIfNotEmpty()

void vtkMRMLJsonWriter::WriteStringPropertyIfNotEmpty ( const std::string & propertyName,
const std::string & propertyValue )

◆ WriteStringVectorProperty()

void vtkMRMLJsonWriter::WriteStringVectorProperty ( const std::string & propertyName,
const std::vector< std::string > & arrayValues )

◆ WriteToFileBegin()

bool vtkMRMLJsonWriter::WriteToFileBegin ( const char * filePath,
const char * schema )

This method must be called before writing any properties to the output file. Returns true on success.

◆ WriteToFileEnd()

bool vtkMRMLJsonWriter::WriteToFileEnd ( )

This method must be called after writing all properties to the output file. Returns true on success.

◆ WriteToStringBegin()

bool vtkMRMLJsonWriter::WriteToStringBegin ( const char * nodeTagName)

This method must be called before writing any properties to the output file. Returns true on success.

◆ WriteToStringEnd()

std::string vtkMRMLJsonWriter::WriteToStringEnd ( )

This method must be called after writing all properties to the output file. Returns string representation of the JSON document.

◆ WriteVectorProperty()

void vtkMRMLJsonWriter::WriteVectorProperty ( const std::string & propertyName,
double * v,
int numberOfComponents = 3 )

Friends And Related Symbol Documentation

◆ vtkInternal

friend class vtkInternal
friend

Definition at line 312 of file vtkMRMLJsonElement.h.

Member Data Documentation

◆ Internal

vtkInternal* vtkMRMLJsonWriter::Internal
protected

Definition at line 311 of file vtkMRMLJsonElement.h.

◆ UserMessages

vtkNew<vtkMRMLMessageCollection> vtkMRMLJsonWriter::UserMessages
protected

Definition at line 308 of file vtkMRMLJsonElement.h.


The documentation for this class was generated from the following file: