PropertyPlacement: Convert x, y, z values to Quantities when using them in expressions.
This commit is contained in:
parent
d6052a5a27
commit
c861505bc9
|
@ -594,6 +594,18 @@ void PropertyPlacement::setPathValue(const ObjectIdentifier &path, const boost::
|
||||||
Property::setPathValue(path, value);
|
Property::setPathValue(path, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const boost::any PropertyPlacement::getPathValue(const ObjectIdentifier &path) const
|
||||||
|
{
|
||||||
|
std::string p = path.getSubPathStr();
|
||||||
|
|
||||||
|
if (p == ".Base.x" || p == ".Base.y" || p == ".Base.z") {
|
||||||
|
// Convert double to quantity
|
||||||
|
return Base::Quantity(boost::any_cast<double>(Property::getPathValue(path)), Unit::Length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return Property::getPathValue(path);
|
||||||
|
}
|
||||||
|
|
||||||
PyObject *PropertyPlacement::getPyObject(void)
|
PyObject *PropertyPlacement::getPyObject(void)
|
||||||
{
|
{
|
||||||
return new Base::PlacementPy(new Base::Placement(_cPos));
|
return new Base::PlacementPy(new Base::Placement(_cPos));
|
||||||
|
|
|
@ -265,6 +265,8 @@ public:
|
||||||
|
|
||||||
void setPathValue(const ObjectIdentifier &path, const boost::any &value);
|
void setPathValue(const ObjectIdentifier &path, const boost::any &value);
|
||||||
|
|
||||||
|
const boost::any getPathValue(const ObjectIdentifier &path) const;
|
||||||
|
|
||||||
const char* getEditorName(void) const {
|
const char* getEditorName(void) const {
|
||||||
return "Gui::PropertyEditor::PropertyPlacementItem";
|
return "Gui::PropertyEditor::PropertyPlacementItem";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user