Added PropertyVectorDistance::getPathValue() to return vector elements with correct unit.
This commit is contained in:
@@ -216,6 +216,18 @@ PropertyVectorDistance::PropertyVectorDistance()
|
||||
|
||||
}
|
||||
|
||||
const boost::any PropertyVectorDistance::getPathValue(const ObjectIdentifier &path) const
|
||||
{
|
||||
std::string p = path.getSubPathStr();
|
||||
|
||||
if (p == ".x" || p == ".y" || p == ".z") {
|
||||
// Convert double to quantity
|
||||
return Base::Quantity(boost::any_cast<double>(Property::getPathValue(path)), Unit::Length);
|
||||
}
|
||||
else
|
||||
return Property::getPathValue(path);
|
||||
}
|
||||
|
||||
PropertyVectorDistance::~PropertyVectorDistance()
|
||||
{
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ public:
|
||||
*/
|
||||
virtual ~PropertyVectorDistance();
|
||||
|
||||
const boost::any getPathValue(const ObjectIdentifier &path) const;
|
||||
|
||||
const char* getEditorName(void) const {
|
||||
return "Gui::PropertyEditor::PropertyVectorDistanceItem";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user