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

Method setPathValue

src/App/PropertyStandard.cpp:143–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void PropertyInteger::setPathValue(const ObjectIdentifier& path, const boost::any& value)
144{
145 verifyPath(path);
146
147 if (value.type() == typeid(long)) {
148 setValue(boost::any_cast<long>(value));
149 }
150 else if (value.type() == typeid(int)) {
151 setValue(boost::any_cast<int>(value));
152 }
153 else if (value.type() == typeid(double)) {
154 setValue(boost::math::round(boost::any_cast<double>(value)));
155 }
156 else if (value.type() == typeid(float)) {
157 setValue(boost::math::round(boost::any_cast<float>(value)));
158 }
159 else if (value.type() == typeid(Quantity)) {
160 setValue(boost::math::round(boost::any_cast<Quantity>(value).getValue()));
161 }
162 else {
163 throw bad_cast();
164 }
165}
166
167
168//**************************************************************************

Callers

nothing calls this directly

Calls 9

pyObjectFromAnyFunction · 0.85
anyToStringFunction · 0.85
numSubComponentsMethod · 0.80
setValueFunction · 0.70
typeMethod · 0.45
getValueMethod · 0.45
c_strMethod · 0.45
ptrMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected