/*============================================================================= NOTE: THIS FILE IS A HANDMADE WRAPPER FOR THE ManagedITK PROJECT. Project: ManagedITK Program: Insight Segmentation & Registration Toolkit Module: itkManagedVersor.cxx Language: C++/CLI Author: Dan Mueller $Date: 2007-04-11 16:26:16 +1000 (Wed, 11 Apr 2007) $ $Revision: 128 $ Copyright (c) Queensland University of Technology (QUT) 2007. All rights reserved. Portions of this code are covered under the ITK and VTK copyright. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =============================================================================*/ #pragma once #pragma warning( disable : 4635 ) // Disable warnings about XML doc comments #ifndef __itkManagedVersor_cxx #define __itkManagedVersor_cxx // Include some useful ManagedITK files #include "itkManagedQuaternion.cxx" #include "itkManagedPoint.cxx" #include "itkManagedVector.cxx" // Use some managed namespaces #using #using using namespace System; using namespace System::IO; using namespace System::Reflection; using namespace System::Diagnostics; using namespace System::Collections::Generic; namespace itk { /// ///This class is a managed replacement for itk::Versor. /// /// ///The difference between versors and quaternions is that quaternions ///can represent rotations and scale changes while versors are limited ///to rotations. ie. versors are unit or normalized quaternions, the ///tensor is always 1.0. The class does not provide many operations, ///it is only a basic wrapper for the actual XYZW data. /// public ref class itkVersor : itkQuaternion { public: /// ///Default constructor. The Versor is initialised to the identity. /// itkVersor ( ) : itkQuaternion( ) { } /// ///Component constructor. The Versor is initialised to the given XYZW components. /// itkVersor ( itkQuaternionValueType x, itkQuaternionValueType y, itkQuaternionValueType z, itkQuaternionValueType w ) : itkQuaternion( x, y, z, w ) { this->Normalize( ); } ///Set the Versor using the given ZYZW components. virtual void Set( itkQuaternionValueType x, itkQuaternionValueType y, itkQuaternionValueType z, itkQuaternionValueType w ) override { itkQuaternion::Set( x, y, z, w ); this->Normalize( ); } /// ///Set the Versor using a vector and angle. ///The unit vector parallel to the given vector will be used. ///The angle is expected in radians. /// virtual void Set( itkVector^ axis, itkQuaternionValueType angle ) override { itkQuaternion::Set( axis, angle ); this->Normalize( ); } ///Set the Versor as a rotation around the X-axis. virtual void SetRotationAroundX( itkQuaternionValueType angle ) override { itkQuaternion::SetRotationAroundX( angle ); this->Normalize( ); } ///Set the Quaternion as a rotation around the Y-axis. virtual void SetRotationAroundY( itkQuaternionValueType angle ) override { itkQuaternion::SetRotationAroundY( angle ); this->Normalize( ); } ///Set the Quaternion as a rotation around the Z-axis. virtual void SetRotationAroundZ( itkQuaternionValueType angle ) override { itkQuaternion::SetRotationAroundZ( angle ); this->Normalize( ); } }; // end ref class } // end namespace itk #endif