MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / onChanged

Method onChanged

src/App/VRMLObject.cpp:62–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void 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
90PyObject* VRMLObject::getPyObject()
91{

Callers

nothing calls this directly

Calls 8

onChangedFunction · 0.85
getOriginalFileNameMethod · 0.80
dirPathMethod · 0.80
emptyMethod · 0.45
setSizeMethod · 0.45
getSizeMethod · 0.45
getValuesMethod · 0.45
set1ValueMethod · 0.45

Tested by

no test coverage detected