26 #ifndef __OsirixParser__
27 #define __OsirixParser__
32 #ifdef kernelParserOsirix_BUILD_SHARED
33 #define kernelParserOsirix_EXPORT __declspec( dllexport )
35 #define kernelParserOsirix_EXPORT __declspec( dllimport )
37 #define kernelParserOsirix_CDECL __cdecl
39 #define kernelParserOsirix_EXPORT
40 #define kernelParserOsirix_CDECL
41 #endif // defined(_WIN32)
50 #include <xercesc/parsers/XercesDOMParser.hpp>
51 #include <xercesc/dom/DOM.hpp>
52 #include <xercesc/dom/DOMErrorHandler.hpp>
53 #include <xercesc/dom/DOMLocator.hpp>
54 #include <xercesc/sax/HandlerBase.hpp>
55 #include <xercesc/util/XMLString.hpp>
56 #include <xercesc/util/PlatformUtils.hpp>
60 using namespace xercesc;
74 OsirixParser(std::string xsdfile =
"",
double* spacing = NULL,
int* extent = NULL);
80 int ParseFile(
const char* xmlfile);
83 std::string getErrorLine();
85 std::string getContoursFileName();
97 return contoursnameMM;
100 return contoursnamePX;
150 void saveCreaContoursFormat();
152 void writeHeader(FILE* pFile);
153 void writeContours(FILE* pFile);
154 void writeContoursStatic(FILE* pFile);
156 void setErrorLine(DOMNodeList* list);
158 void getUserData(DOMElement* element);
160 void getData(DOMNodeList* list, std::vector<std::string>& vect, std::string tagname);
162 DOMNode* getLastNode(DOMNodeList* list);
164 void parseOSIRIX_DICT(DOMNodeList* list);
165 void parseOSIRIX_POINT_MM(DOMNodeList* list);
166 void parseOSIRIX_POINT_PX(DOMNodeList* list);
189 virtual void warning (
const SAXParseException &exc);
191 virtual void error (
const SAXParseException &exc);
193 virtual void fatalError (
const SAXParseException &exc);
195 virtual void resetErrors ();
197 std::string getErrorMsg();