| 60 | } |
| 61 | |
| 62 | void VRMLObject::onChanged(const App::Property* prop) |
| 63 | { |
| 64 | if (restoreData) { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | if (prop == &VrmlFile) { |
| 69 | std::string orig = VrmlFile.getOriginalFileName(); |
| 70 | if (!orig.empty()) { |
| 71 | // store the path name of the VRML file |
| 72 | Base::FileInfo fi(orig); |
| 73 | this->vrmlPath = fi.dirPath(); |
| 74 | } |
| 75 | } |
| 76 | else if (prop == &Urls) { |
| 77 | // save the relative paths to the resource files in the project file |
| 78 | Resources.setSize(Urls.getSize()); |
| 79 | const std::vector<std::string>& urls = Urls.getValues(); |
| 80 | int index = 0; |
| 81 | for (const auto& it : urls) { |
| 82 | std::string output = getRelativePath(this->vrmlPath, it); |
| 83 | Resources.set1Value(index, output); |
| 84 | ++index; |
| 85 | } |
| 86 | } |
| 87 | GeoFeature::onChanged(prop); |
| 88 | } |
| 89 | |
| 90 | PyObject* VRMLObject::getPyObject() |
| 91 | { |