------------------------------------------------------------------------------
| 67 | |
| 68 | //------------------------------------------------------------------------------ |
| 69 | bool vtkURILoader::SetBaseFileName(const std::string& filepath) |
| 70 | { |
| 71 | if (!vtksys::SystemTools::FileExists(filepath)) |
| 72 | { |
| 73 | vtkErrorMacro("Can not find \"" << filepath << "\""); |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | auto fullPath = vtksys::SystemTools::CollapseFullPath(filepath); |
| 78 | if (fullPath.front() != '/') // add / for windows path |
| 79 | { |
| 80 | fullPath.insert(fullPath.begin(), '/'); |
| 81 | } |
| 82 | |
| 83 | this->Impl->BaseURI = vtkURI::Make("file", "", vtkURI::PercentEncode(fullPath)); |
| 84 | |
| 85 | return this->Impl->BaseURI; |
| 86 | } |
| 87 | |
| 88 | //------------------------------------------------------------------------------ |
| 89 | bool vtkURILoader::SetBaseDirectory(const std::string& dirpath) |