Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::vtkPointSetXMLParser Class Reference

Implementation of the vtkXMLParser interface for reading mitk::PointSets. More...

#include <vtkPointSetXMLParser.h>

Inheritance diagram for mitk::vtkPointSetXMLParser:
Collaboration diagram for mitk::vtkPointSetXMLParser:

Public Types

typedef mitk::PointSet PointSetType
 
typedef std::stack< std::string > ParseStack
 
typedef std::list< PointSetType::PointerPointSetList
 
typedef PointSetType::DataType::PointIdentifier PointIdentifier
 
typedef PointSetType::PointType PointType
 

Public Member Functions

 vtkTypeMacro (vtkPointSetXMLParser, vtkXMLParser)
 
virtual int InitializeParser () override
 
virtual int CleanupParser () override
 
virtual void StartElement (const char *name, const char **atts) override
 
virtual void EndElement (const char *name) override
 
virtual void CharacterDataHandler (const char *inData, int inLength) override
 
virtual mitk::ScalarType ParseScalarType (const std::string &data)
 
virtual PointIdentifier ParsePointIdentifier (const std::string &data)
 
virtual PointSetList GetParsedPointSets ()
 

Static Public Member Functions

static vtkPointSetXMLParserNew ()
 

Protected Member Functions

 vtkPointSetXMLParser ()
 
virtual ~vtkPointSetXMLParser ()
 

Protected Attributes

ParseStack m_ParseStack
 
PointSetList m_PointSetList
 
PointSetType::Pointer m_CurrentPointSet
 
PointType m_CurrentPoint
 
std::string m_CurId
 
std::string m_CurXString
 
std::string m_CurYString
 
std::string m_CurZString
 
PointIdentifier m_CurrentPointId
 
std::locale m_PreviousLocale
 

Detailed Description

Implementation of the vtkXMLParser interface for reading mitk::PointSets.

This class implements the XMLParser interface of the vtkXMLParser which is based on expat. It is used by the mitk::PointSetReader and is NOT INTENDED TO BE USED FROM THE END-USER. If you want to read point sets, use the mitk::PointSetReader.

Deprecated:
(as of 2014_10) Use mitk::IOUtils or mitk::FileReaderRegistry instead.

Definition at line 39 of file vtkPointSetXMLParser.h.

Member Typedef Documentation

typedef std::stack<std::string> mitk::vtkPointSetXMLParser::ParseStack

Definition at line 48 of file vtkPointSetXMLParser.h.

Constructor & Destructor Documentation

mitk::vtkPointSetXMLParser::vtkPointSetXMLParser ( )
protected

Definition at line 29 of file vtkPointSetXMLParser.cpp.

mitk::vtkPointSetXMLParser::~vtkPointSetXMLParser ( )
protectedvirtual

Definition at line 33 of file vtkPointSetXMLParser.cpp.

Member Function Documentation

void mitk::vtkPointSetXMLParser::CharacterDataHandler ( const char *  inData,
int  inLength 
)
overridevirtual

Handler function which is called, if characted data has been parsed by expat.

Parameters
inDataa char array containing the parsed string data
inLengththe length of the parsed data string.

Definition at line 143 of file vtkPointSetXMLParser.cpp.

References mitk::PointSetWriter::XML_ID, mitk::PointSetWriter::XML_X, mitk::PointSetWriter::XML_Y, and mitk::PointSetWriter::XML_Z.

int mitk::vtkPointSetXMLParser::CleanupParser ( )
overridevirtual

Definition at line 53 of file vtkPointSetXMLParser.cpp.

void mitk::vtkPointSetXMLParser::EndElement ( const char *  name)
overridevirtual

Handler function which is called, when a xml end-tag has been parsed.

Definition at line 99 of file vtkPointSetXMLParser.cpp.

References MITK_ERROR, mitk::OpDESELECTPOINT, mitk::OpINSERT, mitk::PointSetWriter::XML_POINT, and mitk::PointSetWriter::XML_POINT_SET.

mitk::vtkPointSetXMLParser::PointSetList mitk::vtkPointSetXMLParser::GetParsedPointSets ( )
virtual
Returns
the list of point sets which have been read from file. NOTE: your have to call the Parse() function, before this function.

Definition at line 182 of file vtkPointSetXMLParser.cpp.

int mitk::vtkPointSetXMLParser::InitializeParser ( )
overridevirtual

Definition at line 37 of file vtkPointSetXMLParser.cpp.

static vtkPointSetXMLParser* mitk::vtkPointSetXMLParser::New ( )
static
mitk::vtkPointSetXMLParser::PointIdentifier mitk::vtkPointSetXMLParser::ParsePointIdentifier ( const std::string &  data)
virtual

Converts the given data to an PointIdentifier

Definition at line 173 of file vtkPointSetXMLParser.cpp.

mitk::ScalarType mitk::vtkPointSetXMLParser::ParseScalarType ( const std::string &  data)
virtual

Converts the given data to mitk::ScalarType.

Definition at line 164 of file vtkPointSetXMLParser.cpp.

void mitk::vtkPointSetXMLParser::StartElement ( const char *  name,
const char **  atts 
)
overridevirtual

Handler function which is called, when a new xml start-tag has been parsed.

Definition at line 67 of file vtkPointSetXMLParser.cpp.

References mitk::New(), mitk::PointSetWriter::XML_POINT, and mitk::PointSetWriter::XML_POINT_SET.

mitk::vtkPointSetXMLParser::vtkTypeMacro ( vtkPointSetXMLParser  ,
vtkXMLParser   
)

Member Data Documentation

std::string mitk::vtkPointSetXMLParser::m_CurId
protected

Definition at line 122 of file vtkPointSetXMLParser.h.

PointType mitk::vtkPointSetXMLParser::m_CurrentPoint
protected

The current point which is processed by the parser.

Definition at line 120 of file vtkPointSetXMLParser.h.

PointIdentifier mitk::vtkPointSetXMLParser::m_CurrentPointId
protected

The current point id which is processed by the parser.

Definition at line 131 of file vtkPointSetXMLParser.h.

PointSetType::Pointer mitk::vtkPointSetXMLParser::m_CurrentPointSet
protected

The current point set which is processed by the parser.

Definition at line 114 of file vtkPointSetXMLParser.h.

std::string mitk::vtkPointSetXMLParser::m_CurXString
protected

Definition at line 123 of file vtkPointSetXMLParser.h.

std::string mitk::vtkPointSetXMLParser::m_CurYString
protected

Definition at line 124 of file vtkPointSetXMLParser.h.

std::string mitk::vtkPointSetXMLParser::m_CurZString
protected

Definition at line 125 of file vtkPointSetXMLParser.h.

ParseStack mitk::vtkPointSetXMLParser::m_ParseStack
protected

A stack containing the parsed start-tags. If an end tag is encountered, it is matched with the top element of the stack.

Definition at line 103 of file vtkPointSetXMLParser.h.

PointSetList mitk::vtkPointSetXMLParser::m_PointSetList
protected

Contains the parsed point sets.

Definition at line 108 of file vtkPointSetXMLParser.h.

std::locale mitk::vtkPointSetXMLParser::m_PreviousLocale
protected

Definition at line 133 of file vtkPointSetXMLParser.h.


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