| 174 | } |
| 175 | |
| 176 | void VRMLObject::SaveDocFile(Base::Writer& writer) const |
| 177 | { |
| 178 | // store the inline files of the VRML file |
| 179 | if (this->indexSave < Urls.getSize()) { |
| 180 | std::string url = Urls[this->indexSave]; |
| 181 | |
| 182 | Base::FileInfo fi(url); |
| 183 | // it can happen that the transient directory has changed after |
| 184 | // saving the 'URLs' in RestoreDocFile() and then we have to |
| 185 | // try again with the new transient directory. |
| 186 | if (!fi.exists()) { |
| 187 | std::string path = getDocument()->TransientDir.getValue(); |
| 188 | url = Resources[this->indexSave]; |
| 189 | url = path + "/" + url; |
| 190 | fi.setFile(url); |
| 191 | } |
| 192 | |
| 193 | this->indexSave++; |
| 194 | Base::ifstream file(fi, std::ios::in | std::ios::binary); |
| 195 | if (file) { |
| 196 | writer.Stream() << file.rdbuf(); |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | bool VRMLObject::restoreTextureFinished(Base::Reader& reader) |
| 202 | { |
no test coverage detected