/************************************************************************/
/* X3DParser.cpp */
/************************************************************************/
/************************************************************************/
/* First of all, thanks a lot for this great library. I spent too much time to learn this library and finally I got success.
// I couldn't find any material to learn this library but anyway I have done what I wanted to do.
//
// Now the only issue is with speed during importing X3D file.
// I don't understand why just 422 KB file takes too much to import/parse. I tried with several models, the famous one is dino.x3d (vertices = 2151, faces = 4300),
// It takes much time to parse approximate 1 minutes to parse. What I am not getting is, how can be xerces library too slow to parse XML file.
// I tried with debug lib, release lib, did everything, but still not getting the better results as I am getting with WRL files.
// There is no issue with WRL files, but when I try to import X3D files, parsing of x3d files take too long time, even my application gets stuck.
// Below is the source code from X3DParser.cpp file. I spent too much time to find this issue. The issue is with parser->parse(xmlFile); this line.
// I put cout<< in order to follow execution process, so finally what I find is, the execusion gets stuck at parser->parse(xmlFile); this line.
// Could you please tell me whats the issue with parsing of XML X3D files ? Why parsing of x3d is so slow ?
/************************************************************************/
std::cout<<"check 0....."<<std::endl;
beginParse();
std::cout<<"check 1....."<<std::endl;
int errorCount = 0;
try
{
std::cout<<"check 2....."<<std::endl;
X3DParserHandlers handler;
parser->setContentHandler(&handler);
std::cout<<"check 3....."<<std::endl;
parser->setErrorHandler(&handler);
parser->setDTDHandler(&handler);
std::cout<<"check 4....."<<std::endl;
parser->parse(xmlFile); // here the execution gets stuck, dino.x3d (vertices = 2151, faces = 4300) takes 1 minute on this line in Visual Studio 2010 Release mode.
std::cout<<"check 5....."<<std::endl;
errorCount = parser->getErrorCount();
std::cout<<"check 6....."<<std::endl;
} catch (const XMLException& e) {
XMLPlatformUtils::Terminate();
endParse();
return false;
}
delete parser;
std::cout<<"check 7....."<<std::endl;
XMLPlatformUtils::Terminate();
std::cout<<"check 8....."<<std::endl;
endParse();
std::cout<<"check 9....."<<std::endl;
if (0 < errorCount)
return false;
parsing issue with .x3d files, while .wrl files are OK.