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

Method getPyPathValue

src/App/PropertyGeo.cpp:206–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206bool PropertyVector::getPyPathValue(const ObjectIdentifier& path, Py::Object& res) const
207{
208 Base::Unit unit = getUnit();
209 if (unit == Unit::One) {
210 return false;
211 }
212
213 std::string p = path.getSubPathStr();
214 if (p == ".x") {
215 res = Py::asObject(new QuantityPy(new Quantity(getValue().x, unit)));
216 }
217 else if (p == ".y") {
218 res = Py::asObject(new QuantityPy(new Quantity(getValue().y, unit)));
219 }
220 else if (p == ".z") {
221 res = Py::asObject(new QuantityPy(new Quantity(getValue().z, unit)));
222 }
223 else {
224 return false;
225 }
226 return true;
227}
228
229
230//**************************************************************************

Callers 1

getPyValueMethod · 0.45

Calls 9

toDegreesFunction · 0.85
getSubPathStrMethod · 0.80
getUnitFunction · 0.70
getValueFunction · 0.70
getRotationMethod · 0.45
getRawValueMethod · 0.45
getYawPitchRollMethod · 0.45
getValueMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected