7 #ifndef __PlusXmlUtils_h 8 #define __PlusXmlUtils_h 10 #include <igsioXmlUtils.h> 11 #include "vtkXMLUtilities.h" 27 LOG_ERROR(
"Reading device set configuration file failed: invalid config input");
32 LOG_ERROR(
"Reading device set configuration file failed: filename is not specified");
36 std::string filePath = filename;
37 if (!vtksys::SystemTools::FileExists(filePath.c_str(),
true))
40 if (!vtksys::SystemTools::FileExists(filePath.c_str(),
true))
42 LOG_ERROR(
"Reading device set configuration file failed: " << filename <<
" does not exist in the current directory or in " <<
vtkPlusConfig::GetInstance()->GetDeviceSetConfigurationDirectory());
47 vtkSmartPointer<vtkXMLDataElement> rootElement = vtkSmartPointer<vtkXMLDataElement>::Take(vtkXMLUtilities::ReadElementFromFile(filePath.c_str()));
48 if (rootElement == NULL)
50 LOG_ERROR(
"Reading device set configuration file failed: syntax error in " << filename);
53 config->DeepCopy(rootElement);
58 #endif //__PlusXmlUtils_h
static vtkPlusConfig * GetInstance()
Utility methods for XML tree manipulation.
std::string GetDeviceSetConfigurationPath(const std::string &subPath)
static PlusStatus ReadDeviceSetConfigurationFromFile(vtkXMLDataElement *config, const char *filename)