App: Add methods to get base and direction of datum element
Add the methods DatumElement::getBasePoint() and DatumElement::getDirection() to hide implementation details and guarantee consistent behaviour. Using the methods fixes several regressions in: * Constraint::getDirection * PolarPattern::getTransformations
This commit is contained in:
@@ -87,6 +87,21 @@ bool DatumElement::isOriginFeature()
|
||||
return lcs ? lcs->isOrigin() : false;
|
||||
}
|
||||
|
||||
Base::Vector3d DatumElement::getBasePoint() const
|
||||
{
|
||||
Base::Placement plc = Placement.getValue();
|
||||
return plc.getPosition();
|
||||
}
|
||||
|
||||
Base::Vector3d DatumElement::getDirection() const
|
||||
{
|
||||
Base::Vector3d dir(0.0, 0.0, 1.0);
|
||||
Base::Placement plc = Placement.getValue();
|
||||
Base::Rotation rot = plc.getRotation();
|
||||
rot.multVec(dir, dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
LocalCoordinateSystem::LocalCoordinateSystem()
|
||||
|
||||
Reference in New Issue
Block a user