From 67d7669188c8940656c080b91151a305d1dd51a5 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Wed, 21 Mar 2012 08:56:38 +0000 Subject: [PATCH] switched to use RunXmlScript always (missing '\n' at the end of xml script was a problem) --- modules/highgui/src/cap_openni.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/modules/highgui/src/cap_openni.cpp b/modules/highgui/src/cap_openni.cpp index 6dca74a..9167e29 100644 --- a/modules/highgui/src/cap_openni.cpp +++ b/modules/highgui/src/cap_openni.cpp @@ -41,15 +41,10 @@ #include "precomp.hpp" #include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" -#ifdef HAVE_OPENNI -#define HACK_WITH_XML +#ifdef HAVE_OPENNI -#ifdef HACK_WITH_XML #include -#include -#endif - #include "XnCppWrapper.h" const std::string XMLConfig = @@ -79,7 +74,7 @@ const std::string XMLConfig = "" "" "" -""; +"\n"; class CvCapture_OpenNI : public CvCapture { @@ -206,22 +201,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index ) return; } -#ifdef HACK_WITH_XML - // Write configuration to the temporary file. - // This is a hack, because there is a bug in RunXmlScript(). - // TODO: remove hack when bug in RunXmlScript() will be fixed. - std::string xmlFilename = "opencv_kinect_configure.xml"; - std::ofstream outfile( xmlFilename.c_str() ); - outfile.write( XMLConfig.c_str(), XMLConfig.length() ); - outfile.close(); - - status = context.RunXmlScriptFromFile( xmlFilename.c_str() ); - - // Remove temporary configuration file. - remove( xmlFilename.c_str() ); -#else status = context.RunXmlScript( XMLConfig.c_str() ); -#endif if( status != XN_STATUS_OK ) { std::cerr << "CvCapture_OpenNI::CvCapture_OpenNI : Failed to run xml script: " -- 2.7.4