7 #include "PlusConfigure.h" 8 #include "vtkDirectory.h" 9 #include "vtkMatrix4x4.h" 10 #include "vtkIGSIORecursiveCriticalSection.h" 11 #include "vtkXMLUtilities.h" 12 #include "vtksys/SystemTools.hxx" 17 #include "vtkDebugLeaksManager.h" 18 #include "vtkObjectFactory.h" 23 #elif defined(unix) || defined(__unix__) || defined(__unix) 25 #elif defined(__APPLE__) 27 #include <mach-o/dyld.h> 36 class vtkPlusConfigCleanup
43 ~vtkPlusConfigCleanup()
56 struct StaticVariables
58 vtkIGSIOSimpleRecursiveCriticalSection ConfigCreationCriticalSection;
59 vtkPlusConfigCleanup vtkPlusConfigCleanupGlobal;
61 StaticVariables staticVariables;
73 if (!vtkPlusConfig::Instance)
75 igsioLockGuard<vtkIGSIOSimpleRecursiveCriticalSection> criticalSectionGuardedLock(&(staticVariables.ConfigCreationCriticalSection));
77 if (vtkPlusConfig::Instance != NULL)
79 return vtkPlusConfig::Instance;
82 staticVariables.vtkPlusConfigCleanupGlobal.Use();
88 vtkObject* ret = vtkObjectFactory::CreateInstance(
"vtkPlusConfig");
91 vtkPlusConfig::Instance = static_cast<vtkPlusConfig*>(ret);
100 return vtkPlusConfig::Instance;
106 if (vtkPlusConfig::Instance == instance)
111 if (vtkPlusConfig::Instance)
113 vtkPlusConfig::Instance->Delete();
115 vtkPlusConfig::Instance = instance;
118 if (instance != NULL)
120 instance->Register(NULL);
126 : DeviceSetConfigurationData(NULL)
127 , ApplicationConfigurationData(NULL)
153 char cProgramPath[2048] = {
'\0'};
154 GetModuleFileName(NULL, cProgramPath, 2048);
156 #elif defined(__linux__) 157 const unsigned int cProgramPathSize = 2048;
158 char cProgramPath[cProgramPathSize] = {
'\0'};
161 if (readlink(
"/proc/self/exe", cProgramPath, cProgramPathSize) != -1)
164 std::string path = vtksys::SystemTools::CollapseFullPath(cProgramPath);
166 std::string fileName;
167 vtksys::SystemTools::SplitProgramPath(path.c_str(), dirName, fileName);
175 std::string path = vtksys::SystemTools::CollapseFullPath(
"./");
176 LOG_WARNING(
"Cannot get program path. PlusConfig.xml will be read from " << path);
179 #elif defined(__APPLE__) 180 char cProgramPath[2048];
181 uint32_t size =
sizeof(cProgramPath);
182 if (_NSGetExecutablePath(cProgramPath, &size) == 0)
184 std::string path = vtksys::SystemTools::CollapseFullPath(cProgramPath);
186 std::string fileName;
187 vtksys::SystemTools::SplitProgramPath(path.c_str(), dirName, fileName);
192 std::string path = vtksys::SystemTools::CollapseFullPath(
"./");
193 LOG_WARNING(
"Cannot get program path. PlusConfig.xml will be read from " << path);
231 std::string configFilePath = aConfigFile;
232 if (!vtksys::SystemTools::FileExists(configFilePath,
true))
235 if (!vtksys::SystemTools::FileExists(configFilePath,
true))
241 vtkXMLDataElement* configRootElement = vtkXMLUtilities::ReadElementFromFile(configFilePath.c_str());
242 if (configRootElement == NULL)
244 LOG_ERROR(
"Reading device set configuration file failed: syntax error in " << aConfigFile);
249 LOG_DEBUG(
"Device set configuration is read from file: " << aConfigFile);
250 std::ostringstream xmlFileContents;
251 igsioCommon::XML::PrintXML(xmlFileContents, vtkIndent(1), configRootElement);
252 LOG_DEBUG(
"Device set configuration file contents: " << std::endl << xmlFileContents.str());
254 return configRootElement;
260 LOG_TRACE(
"vtkPlusConfig::LoadApplicationConfiguration");
264 LOG_ERROR(
"Unable to read configuration - program directory has to be set first!");
269 bool saveNeeded =
false;
272 vtkSmartPointer<vtkXMLDataElement> applicationConfigurationRoot;
273 if (vtksys::SystemTools::FileExists(applicationConfigurationFilePath.c_str(),
true))
275 applicationConfigurationRoot.TakeReference(vtkXMLUtilities::ReadElementFromFile(applicationConfigurationFilePath.c_str()));
277 if (applicationConfigurationRoot == NULL)
279 LOG_DEBUG(
"Application configuration file is not found at '" << applicationConfigurationFilePath <<
"' - file will be created with default values");
280 applicationConfigurationRoot = vtkSmartPointer<vtkXMLDataElement>::New();
281 applicationConfigurationRoot->SetName(
"PlusConfig");
288 if (!igsioCommon::IsEqualInsensitive(applicationConfigurationRoot->GetName(),
"PlusConfig"))
290 LOG_ERROR(
"Invalid application configuration file (root XML element of the file '" << applicationConfigurationFilePath <<
"' should be 'PlusConfig' instead of '" << applicationConfigurationRoot->GetName() <<
"')");
296 if (applicationConfigurationRoot->GetScalarAttribute(
"LogLevel", logLevel))
302 LOG_INFO(
"LogLevel attribute is not found - default 'Info' log level will be used");
308 const char* lastDeviceSetConfigFile = applicationConfigurationRoot->GetAttribute(
"LastDeviceSetConfigurationFileName");
309 if ((lastDeviceSetConfigFile != NULL) && (STRCASECMP(lastDeviceSetConfigFile,
"") != 0))
315 LOG_DEBUG(
"Cannot read last used device set config file until you connect to one first");
319 const char* deviceSetDirectory = applicationConfigurationRoot->GetAttribute(
"DeviceSetConfigurationDirectory");
320 if ((deviceSetDirectory != NULL) && (STRCASECMP(deviceSetDirectory,
"") != 0))
326 LOG_INFO(
"Device set configuration directory is not set - default '../config' will be used");
338 const char* editorApplicationExecutable = applicationConfigurationRoot->GetAttribute(
"EditorApplicationExecutable");
339 if ((editorApplicationExecutable != NULL) && (STRCASECMP(editorApplicationExecutable,
"") != 0))
341 this->SetEditorApplicationExecutable(editorApplicationExecutable);
345 LOG_DEBUG(
"Editor application executable is not set - system default will be used");
349 SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, pf);
350 std::string fullPath = std::string(pf) +
"\\Notepad++\\notepad++.exe";
351 std::string application =
"notepad.exe";
352 if (vtksys::SystemTools::FileExists(fullPath.c_str()))
354 application = fullPath;
356 this->SetEditorApplicationExecutable(application.c_str());
357 #elif defined(unix) || defined(__unix__) || defined(__unix) 358 this->SetEditorApplicationExecutable(
"gedit");
360 this->SetEditorApplicationExecutable(
"TextEdit");
366 const char* outputDirectory = applicationConfigurationRoot->GetAttribute(
"OutputDirectory");
367 if ((outputDirectory != NULL) && (STRCASECMP(outputDirectory,
"") != 0))
373 LOG_DEBUG(
"Output directory is not set - default './Output' will be used");
381 LOG_ERROR(
"Unable to create device set configuration directory '" <<
GetOutputDirectory() <<
"'");
386 const char* imageDirectory = applicationConfigurationRoot->GetAttribute(
"ImageDirectory");
387 if ((imageDirectory != NULL) && (STRCASECMP(imageDirectory,
"") != 0))
393 LOG_INFO(
"Image directory is not set - default '../data' will be used");
399 const char* modelDirectory = applicationConfigurationRoot->GetAttribute(
"ModelDirectory");
400 if ((modelDirectory != NULL) && (STRCASECMP(modelDirectory,
"") != 0))
406 LOG_INFO(
"Model directory is not set - default '../config' will be used");
412 const char* scriptsDirectory = applicationConfigurationRoot->GetAttribute(
"ScriptsDirectory");
413 if ((scriptsDirectory != NULL) && (STRCASECMP(scriptsDirectory,
"") != 0))
419 LOG_INFO(
"Scripts directory is not set - default '../scripts' will be used");
435 LOG_TRACE(
"vtkPlusConfig::WriteApplicationConfiguration");
438 if (applicationConfigurationRoot == NULL)
441 vtkSmartPointer<vtkXMLDataElement> newApplicationConfigurationRoot = vtkSmartPointer<vtkXMLDataElement>::New();
442 newApplicationConfigurationRoot->SetName(
"PlusConfig");
444 applicationConfigurationRoot = newApplicationConfigurationRoot;
448 if (STRCASECMP(applicationConfigurationRoot->GetName(),
"PlusConfig") != 0)
450 LOG_ERROR(
"Invalid application configuration file (root XML element should be 'PlusConfig' found '" << applicationConfigurationRoot->GetName() <<
"' instead)");
455 applicationConfigurationRoot->SetAttribute(
"Date", vtksys::SystemTools::GetCurrentDateTime(
"%Y.%m.%d %X").c_str());
470 applicationConfigurationRoot->SetAttribute(
"OutputDirectory", this->
OutputDirectory.c_str());
473 applicationConfigurationRoot->SetAttribute(
"ImageDirectory", this->
ImageDirectory.c_str());
476 applicationConfigurationRoot->SetAttribute(
"ModelDirectory", this->
ModelDirectory.c_str());
479 applicationConfigurationRoot->SetAttribute(
"ScriptsDirectory", this->
ScriptsDirectory.c_str());
487 LOG_TRACE(
"vtkPlusConfig::GetNewDeviceSetConfigurationFileName");
489 std::string resultFileName;
492 LOG_WARNING(
"New configuration file name cannot be assembled due to absence of input configuration file name");
493 resultFileName =
"PlusConfiguration";
498 resultFileName = resultFileName.substr(0, resultFileName.find(
".xml"));
499 resultFileName = resultFileName.substr(resultFileName.find_last_of(
"/\\") + 1);
503 if (resultFileName.length() > 16)
505 std::string possibleDate = resultFileName.substr(resultFileName.length() - 15, 15);
506 std::string possibleDay = possibleDate.substr(0, 8);
507 std::string possibleTime = possibleDate.substr(9, 6);
508 if (atoi(possibleDay.c_str()) && atoi(possibleTime.c_str()))
510 resultFileName = resultFileName.substr(0, resultFileName.length() - 16);
515 resultFileName.append(
"_");
516 resultFileName.append(vtksys::SystemTools::GetCurrentDateTime(
"%Y%m%d_%H%M%S"));
517 resultFileName.append(
".xml");
519 return resultFileName;
525 LOG_TRACE(
"vtkPlusConfig::SaveApplicationConfigurationToFile");
529 LOG_ERROR(
"Failed to save application configuration to XML data!");
536 LOG_DEBUG(
"Application configuration file '" << applicationConfigurationFilePath <<
"' saved");
550 LOG_TRACE(
"vtkPlusConfig::WriteTransformToCoordinateDefinition(" << aFromCoordinateFrame <<
", " << aToCoordinateFrame <<
")");
552 if (aFromCoordinateFrame == NULL)
554 LOG_ERROR(
"Failed to write transform to CoordinateDefinitions - 'From' coordinate frame name is NULL");
558 if (aToCoordinateFrame == NULL)
560 LOG_ERROR(
"Failed to write transform to CoordinateDefinitions - 'To' coordinate frame name is NULL");
566 LOG_ERROR(
"Failed to write transform to CoordinateDefinitions - matrix is NULL");
572 if (deviceSetConfigRootElement == NULL)
574 LOG_ERROR(
"Failed to write transform to CoordinateDefinitions - config root element is NULL");
578 vtkXMLDataElement* coordinateDefinitions = deviceSetConfigRootElement->FindNestedElementWithName(
"CoordinateDefinitions");
579 if (coordinateDefinitions == NULL)
581 vtkSmartPointer<vtkXMLDataElement> newCoordinateDefinitions = vtkSmartPointer<vtkXMLDataElement>::New();
582 newCoordinateDefinitions->SetName(
"CoordinateDefinitions");
583 deviceSetConfigRootElement->AddNestedElement(newCoordinateDefinitions);
584 coordinateDefinitions = newCoordinateDefinitions;
588 vtkXMLDataElement* transformElement = NULL;
589 int nestedElementIndex(0);
590 while (nestedElementIndex < coordinateDefinitions->GetNumberOfNestedElements() && transformElement == NULL)
592 vtkXMLDataElement* nestedElement = coordinateDefinitions->GetNestedElement(nestedElementIndex);
593 const char* fromAttribute = nestedElement->GetAttribute(
"From");
594 const char* toAttribute = nestedElement->GetAttribute(
"To");
596 if (fromAttribute && toAttribute
597 && STRCASECMP(fromAttribute, aFromCoordinateFrame) == 0
598 && STRCASECMP(toAttribute, aToCoordinateFrame) == 0)
600 transformElement = nestedElement;
604 if (transformElement == NULL)
606 vtkSmartPointer<vtkXMLDataElement> newElement = vtkSmartPointer<vtkXMLDataElement>::New();
607 newElement->SetName(
"Transform");
608 newElement->SetAttribute(
"From", aFromCoordinateFrame);
609 newElement->SetAttribute(
"To", aToCoordinateFrame);
610 coordinateDefinitions->AddNestedElement(newElement);
611 transformElement = newElement;
614 double vectorMatrix[16] = {0};
615 vtkMatrix4x4::DeepCopy(vectorMatrix, aMatrix);
616 transformElement->SetVectorAttribute(
"Matrix", 16, vectorMatrix);
620 transformElement->SetDoubleAttribute(
"Error", aError);
625 transformElement->SetAttribute(
"Date", aDate);
629 transformElement->SetAttribute(
"Date", vtksys::SystemTools::GetCurrentDateTime(
"%Y.%m.%d %X").c_str());
638 LOG_TRACE(
"vtkPlusConfig::ReadTransformToCoordinateDefinition(" << aFromCoordinateFrame <<
", " << aToCoordinateFrame <<
")");
647 LOG_TRACE(
"vtkPlusConfig::ReadTransformToCoordinateDefinition(" << aFromCoordinateFrame <<
", " << aToCoordinateFrame <<
")");
649 if (aDeviceSetConfigRootElement == NULL)
651 LOG_ERROR(
"Failed read transform from CoordinateDefinitions - config root element is NULL");
655 if (aFromCoordinateFrame == NULL)
657 LOG_ERROR(
"Failed to read transform from CoordinateDefinitions - 'From' coordinate frame name is NULL");
661 if (aToCoordinateFrame == NULL)
663 LOG_ERROR(
"Failed to read transform from CoordinateDefinitions - 'To' coordinate frame name is NULL");
669 LOG_ERROR(
"Failed to read transform from CoordinateDefinitions - matrix is NULL");
673 vtkXMLDataElement* coordinateDefinitions = aDeviceSetConfigRootElement->FindNestedElementWithName(
"CoordinateDefinitions");
674 if (coordinateDefinitions == NULL)
676 LOG_ERROR(
"Failed read transform from CoordinateDefinitions - CoordinateDefinitions element not found");
680 for (
int nestedElementIndex = 0; nestedElementIndex < coordinateDefinitions->GetNumberOfNestedElements(); ++nestedElementIndex)
682 vtkXMLDataElement* nestedElement = coordinateDefinitions->GetNestedElement(nestedElementIndex);
683 if (STRCASECMP(nestedElement->GetName(),
"Transform") != 0)
689 const char* fromAttribute = nestedElement->GetAttribute(
"From");
690 const char* toAttribute = nestedElement->GetAttribute(
"To");
692 if (fromAttribute && toAttribute
693 && STRCASECMP(fromAttribute, aFromCoordinateFrame) == 0
694 && STRCASECMP(toAttribute, aToCoordinateFrame) == 0)
696 double vectorMatrix[16] = {0};
697 if (nestedElement->GetVectorAttribute(
"Matrix", 16, vectorMatrix))
699 aMatrix->DeepCopy(vectorMatrix);
703 LOG_ERROR(
"Unable to find 'Matrix' attribute of '" << aFromCoordinateFrame <<
"' to '" << aToCoordinateFrame <<
"' transform among the CoordinateDefinitions in the configuration file");
710 if (nestedElement->GetScalarAttribute(
"Error", error))
716 LOG_WARNING(
"Unable to find 'Error' attribute of '" << aFromCoordinateFrame <<
"' to '" << aToCoordinateFrame <<
"' transform among the CoordinateDefinitions in the configuration file");
722 const char*
date = nestedElement->GetAttribute(
"Date");
729 LOG_WARNING(
"Unable to find 'Date' attribute of '" << aFromCoordinateFrame <<
"' to '" << aToCoordinateFrame <<
"' transform among the CoordinateDefinitions in the configuration file");
737 LOG_DEBUG(
"Unable to find from '" << aFromCoordinateFrame <<
"' to '" << aToCoordinateFrame <<
"' transform among the CoordinateDefinitions in the configuration file");
745 LOG_TRACE(
"vtkPlusConfig::ReplaceElementInDeviceSetConfiguration(" << aElementName <<
")");
748 vtkXMLDataElement* orginalElement = deviceSetConfigRootElement->FindNestedElementWithName(aElementName);
749 if (orginalElement != NULL)
751 deviceSetConfigRootElement->RemoveNestedElement(orginalElement);
754 vtkXMLDataElement* newElement = aNewRootElement->FindNestedElementWithName(aElementName);
755 if (newElement != NULL)
757 deviceSetConfigRootElement->AddNestedElement(newElement);
762 if (orginalElement != NULL)
764 deviceSetConfigRootElement->AddNestedElement(orginalElement);
766 LOG_ERROR(
"No element with the name '" << aElementName <<
"' can be found in the given XML data element!");
776 LOG_TRACE(
"vtkPlusConfig::LookupElementWithNameContainingChildWithNameAndAttribute(" << aElementName <<
", " << aChildName <<
", " << (aChildAttributeName == NULL ?
"" : aChildAttributeName) <<
", " << (aChildAttributeValue == NULL ?
"" : aChildAttributeValue) <<
")");
780 LOG_ERROR(
"No input XML data element is specified!");
784 vtkXMLDataElement* firstElement = aConfig->LookupElementWithName(aElementName);
785 if (firstElement == NULL)
791 if (aChildAttributeName && aChildAttributeValue)
793 return firstElement->FindNestedElementWithNameAndAttribute(aChildName, aChildAttributeName, aChildAttributeValue);
797 return firstElement->FindNestedElementWithName(aChildName);
805 LOG_TRACE(
"vtkPlusConfig::GetFirstFileFoundInConfigurationDirectory(" << aFileName <<
")");
821 LOG_TRACE(
"vtkPlusConfig::GetFirstFileFoundInDirectory(" << aFileName <<
", " << aDirectory <<
")");
824 if (STRCASECMP(
"", result.c_str()) == 0)
826 LOG_WARNING(
"File " << aFileName <<
" was not found in directory " << aDirectory);
835 LOG_TRACE(
"vtkPlusConfig::FindFileRecursivelyInDirectory(" << aFileName <<
", " << aDirectory <<
")");
837 std::vector<std::string> directoryList;
838 directoryList.push_back(aDirectory);
841 std::string result = vtksys::SystemTools::FindFile(aFileName, directoryList,
true);
842 if (STRCASECMP(
"", result.c_str()))
848 vtkSmartPointer<vtkDirectory> dir = vtkSmartPointer<vtkDirectory>::New();
849 if (dir->Open(aDirectory))
851 for (
int i = 0;
i < dir->GetNumberOfFiles(); ++
i)
853 const char* fileOrDirectory = dir->GetFile(
i);
854 if ((! dir->FileIsDirectory(fileOrDirectory)) || (STRCASECMP(
".", fileOrDirectory) == 0) || (STRCASECMP(
"..", fileOrDirectory) == 0))
859 std::string fullPath(aDirectory);
860 fullPath.append(
"/");
861 fullPath.append(fileOrDirectory);
864 if (STRCASECMP(
"", result.c_str()))
872 LOG_DEBUG(
"Directory " << aDirectory <<
" cannot be opened");
883 LOG_TRACE(
"vtkPlusConfig::FindImagePath(" << aImagePath <<
")");
887 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
891 LOG_DEBUG(
"Absolute path not found at: " << aFoundAbsolutePath);
896 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
900 LOG_DEBUG(
"Absolute path not found at: " << aFoundAbsolutePath);
904 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
908 LOG_DEBUG(
"Absolute path not found at: " << aFoundAbsolutePath);
911 aFoundAbsolutePath = vtksys::SystemTools::CollapseFullPath(aImagePath.c_str(), vtksys::SystemTools::GetCurrentWorkingDirectory().c_str());
912 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
917 aFoundAbsolutePath =
"";
918 LOG_ERROR(
"Image with relative path '" << aImagePath <<
"' cannot be found neither relative to image directory (" <<
GetImageDirectory() <<
")" 919 <<
" nor relative to device set configuration file directory (" << configurationFileDirectory <<
")" <<
")" 921 <<
" nor the current working directory directory (" << vtksys::SystemTools::GetCurrentWorkingDirectory() <<
")");
928 LOG_TRACE(
"vtkPlusConfig::FindModelPath(" << aModelPath <<
")");
931 if (vtksys::SystemTools::FileExists(aModelPath.c_str()))
934 aFoundAbsolutePath = aModelPath;
937 LOG_DEBUG(
"Absolute path not found at: " << aModelPath);
942 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
946 LOG_DEBUG(
"Absolute path not found at: " << aFoundAbsolutePath);
949 std::string absoluteModelDirectoryPath =
GetModelPath(
".");
951 if (!aFoundAbsolutePath.empty())
954 LOG_DEBUG(
"Absolute path found at: " << aFoundAbsolutePath);
957 LOG_DEBUG(
"Absolute path not found in subdirectories: " << absoluteModelDirectoryPath);
961 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
964 LOG_DEBUG(
"Absolute path found at: " << aFoundAbsolutePath);
967 LOG_DEBUG(
"Absolute path not found at: " << aFoundAbsolutePath);
970 aFoundAbsolutePath = vtksys::SystemTools::CollapseFullPath(aModelPath.c_str(), vtksys::SystemTools::GetCurrentWorkingDirectory().c_str());
971 if (vtksys::SystemTools::FileExists(aFoundAbsolutePath.c_str()))
976 aFoundAbsolutePath =
"";
977 LOG_ERROR(
"Model with relative path '" << aModelPath <<
"' cannot be found neither within the model directory (" << absoluteModelDirectoryPath <<
")" 978 <<
" nor relative to device set configuration file directory (" << configurationFileDirectory <<
")" <<
")" 980 <<
" nor the current working directory directory (" << vtksys::SystemTools::GetCurrentWorkingDirectory() <<
")");
992 if (vtksys::SystemTools::FileIsFullPath(aPath.c_str()))
999 std::string absolutePath = vtksys::SystemTools::CollapseFullPath(aPath.c_str(), aBasePath.c_str());
1000 return absolutePath;
1071 std::string processNameWithExtension = executableName;
1073 processNameWithExtension +=
".exe";
virtual void SetApplicationConfigurationData(vtkXMLDataElement *)
vtkXMLDataElement * CreateDeviceSetConfigurationFromFile(const std::string &aConfigFile)
std::string ApplicationStartTimestamp
std::string GetOutputPath(const std::string &subPath)
vtkXMLDataElement * DeviceSetConfigurationData
std::string GetApplicationConfigurationFilePath() const
std::string GetPlusExecutablePath(const std::string &executableName)
std::string GetDeviceSetConfigurationDirectory()
PlusStatus ReplaceElementInDeviceSetConfiguration(const char *aElementName, vtkXMLDataElement *aNewRootElement)
std::string GetAbsolutePath(const std::string &aPath, const std::string &aBasePath)
std::string GetFirstFileFoundInConfigurationDirectory(const char *aFileName)
std::string GetDeviceSetConfigurationFileName()
Singleton class providing tools needed for handling the configuration - finding files,...
vtkXMLDataElement * ApplicationConfigurationData
std::string EditorApplicationExecutable
std::string GetImagePath(const std::string &subPath)
static void SetInstance(vtkPlusConfig *instance)
std::string DeviceSetConfigurationFileName
static vtkPlusConfig * GetInstance()
static vtkPlusConfig * New()
void SetImageDirectory(const std::string &aDir)
PlusStatus LoadApplicationConfiguration()
std::string FindFileRecursivelyInDirectory(const char *aFileName, const char *aDirectory)
PlusStatus SaveApplicationConfigurationToFile()
std::string GetImageDirectory()
PlusStatus FindImagePath(const std::string &aImagePath, std::string &aFoundAbsolutePath)
void SetProgramDirectory()
void SetDeviceSetConfigurationDirectory(const std::string &aDir)
std::string GetOutputDirectory()
static const char APPLICATION_CONFIGURATION_FILE_NAME[]
PlusStatus ReadTransformToCoordinateDefinition(const char *aFromCoordinateFrame, const char *aToCoordinateFrame, vtkMatrix4x4 *aMatrix, double *aError=NULL, std::string *aDate=NULL)
std::string GetScriptPath(const std::string &subPath)
std::string ModelDirectory
PlusStatus FindModelPath(const std::string &aModelPath, std::string &aFoundAbsolutePath)
std::string GetFirstFileFoundInDirectory(const char *aFileName, const char *aDirectory)
static vtkIGSIOLogger * Instance()
std::string GetModelPath(const std::string &subPath)
vtkXMLDataElement * LookupElementWithNameContainingChildWithNameAndAttribute(vtkXMLDataElement *aConfig, const char *aElementName, const char *aChildName, const char *aChildAttributeName, const char *aChildAttributeValue)
virtual vtkXMLDataElement * GetDeviceSetConfigurationData()
std::string OutputDirectory
std::string GetDeviceSetConfigurationPath(const std::string &subPath)
PlusStatus WriteApplicationConfiguration()
PlusStatus WriteTransformToCoordinateDefinition(const char *aFromCoordinateFrame, const char *aToCoordinateFrame, vtkMatrix4x4 *aMatrix, double aError=-1, const char *aDate=NULL)
void SetOutputDirectory(const std::string &aDir)
void SetDeviceSetConfigurationFileName(const std::string &aFilePath)
std::string ProgramDirectory
std::string ScriptsDirectory
std::string DeviceSetConfigurationDirectory
void SetDeviceSetConfigurationData(vtkXMLDataElement *deviceSetConfigurationData)
vtkPlusCommonExport std::string GetPlusLibVersionString()
std::string GetNewDeviceSetConfigurationFileName()
std::string ImageDirectory