22 #include "vtkObjectFactory.h"
39 vtkXMLParser::InitializeParser();
40 std::istream *stream = this->GetStream();
43 vtkErrorMacro(
"no stream available in XML file reader");
47 m_PreviousLocale = stream->getloc();
55 std::istream *stream = this->GetStream();
58 vtkErrorMacro(
"no stream available in XML file reader");
62 stream->imbue(m_PreviousLocale);
63 vtkXMLParser::CleanupParser();
69 std::string currentElement = name;
83 m_CurrentPoint[0] = 0.0f;
84 m_CurrentPoint[1] = 0.0f;
85 m_CurrentPoint[2] = 0.0f;
96 m_ParseStack.push(currentElement);
101 std::string currentElement = name;
107 if (m_ParseStack.top() != currentElement)
109 MITK_ERROR <<
"Top of parse stack ( " << m_ParseStack.top() <<
" ) is != currentEndElement ( " << currentElement
110 <<
" )!" << std::endl;
121 m_CurrentPointSet->UpdateOutputInformation();
122 m_PointSetList.push_back(m_CurrentPointSet);
130 m_CurrentPointId = ParsePointIdentifier(m_CurId);
131 m_CurrentPoint[0] = ParseScalarType(m_CurXString);
132 m_CurrentPoint[1] = ParseScalarType(m_CurYString);
133 m_CurrentPoint[2] = ParseScalarType(m_CurZString);
137 assert(m_CurrentPointSet.IsNotNull());
138 m_CurrentPointSet->ExecuteOperation(&popInsert);
139 m_CurrentPointSet->ExecuteOperation(&popDeactivate);
145 std::string currentElement = m_ParseStack.top();
148 m_CurId.append(inData, inLength);
152 m_CurXString.append(inData, inLength);
156 m_CurYString.append(inData, inLength);
160 m_CurZString.append(inData, inLength);
166 std::istringstream stm;
175 std::istringstream stm;
184 return m_PointSetList;
virtual int InitializeParser() override
static const char * XML_POINT
virtual PointIdentifier ParsePointIdentifier(const std::string &data)
DataCollection - Class to facilitate loading/accessing structured data.
Constants for most interaction classes, due to the generic StateMachines.
static const char * XML_ID
static const char * XML_POINT_SET
virtual void StartElement(const char *name, const char **atts) override
virtual PointSetList GetParsedPointSets()
virtual mitk::ScalarType ParseScalarType(const std::string &data)
Operation that handles all actions on one Point.
vtkStandardNewMacro(AnatomicalStructureColorPresets)
virtual ~vtkPointSetXMLParser()
virtual int CleanupParser() override
static const char * XML_Y
PointSetType::DataType::PointIdentifier PointIdentifier
static const char * XML_Z
static const char * XML_X
std::list< PointSetType::Pointer > PointSetList
virtual void CharacterDataHandler(const char *inData, int inLength) override
virtual void EndElement(const char *name) override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.