From d2c0d4f4b0909b59d5ade10e8939dac4ee8ff760 Mon Sep 17 00:00:00 2001 From: sebastianfreitag <freitag@vr.rwth-aachen.de> Date: Thu, 16 Jun 2016 16:40:11 +0200 Subject: [PATCH] APIADD: VistaTransformNode: convenience interfaces GetTranslation(), GetRotation(), GetTransform() --- .../GraphicsManager/VistaTransformNode.cpp | 27 +++++++++++++++++-- .../GraphicsManager/VistaTransformNode.h | 5 ++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.cpp b/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.cpp index ec21b3f46..ac35242d5 100644 --- a/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.cpp +++ b/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.cpp @@ -240,15 +240,38 @@ bool VistaTransformNode::GetTranslation( VistaVector3D& v3Translation ) const { return m_pBridge->GetTranslation( v3Translation, m_pData ); } -bool VistaTransformNode::GetRotation( VistaQuaternion& qRotation ) const + +VistaVector3D VistaTransformNode::GetTranslation() const +{ + VistaVector3D v3Translation; + this->GetTranslation(v3Translation); + return v3Translation; +} + +bool VistaTransformNode::GetRotation(VistaQuaternion& qRotation) const { return m_pBridge->GetRotation( qRotation, m_pData ); } -bool VistaTransformNode::GetTransform( VistaTransformMatrix& matTransform ) const + +VistaQuaternion VistaTransformNode::GetRotation() const +{ + VistaQuaternion qRotation; + this->GetRotation(qRotation); + return qRotation; +} + +bool VistaTransformNode::GetTransform(VistaTransformMatrix& matTransform) const { return m_pBridge->GetTransform( matTransform, m_pData ); } +VistaTransformMatrix VistaTransformNode::GetTransform() const +{ + VistaTransformMatrix matTransform; + this->GetTransform(matTransform); + return matTransform; +} + /*============================================================================*/ /* LOCAL VARS AND FUNCS */ /*============================================================================*/ diff --git a/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.h b/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.h index 6de1e5714..55e9f4a6d 100644 --- a/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.h +++ b/VistaCoreLibs/VistaKernel/GraphicsManager/VistaTransformNode.h @@ -103,6 +103,11 @@ public: using VistaNode::GetTranslation; using VistaNode::GetRotation; using VistaNode::GetTransform; + + // convenience interface + VistaVector3D GetTranslation() const; + VistaQuaternion GetRotation() const; + VistaTransformMatrix GetTransform() const; protected: -- GitLab