[2] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[2] | 4 | // %flair:license}
|
---|
| 5 | // created: 2013/04/17
|
---|
| 6 | // filename: OneAxisRotation.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class defining a rotation around one axis
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
[15] | 18 | // this "filter" is in core but it should be in filter
|
---|
| 19 | // filter depends on sensoractuator
|
---|
| 20 | // sensoractuators depends on oneaxisrotation
|
---|
| 21 | // so if oneaxisrotation is in fiter we have a circular dependency
|
---|
| 22 | // TODO: fix this!
|
---|
[2] | 23 |
|
---|
| 24 | #include "OneAxisRotation.h"
|
---|
| 25 | #include "OneAxisRotation_impl.h"
|
---|
| 26 | #include <Euler.h>
|
---|
| 27 |
|
---|
| 28 | using std::string;
|
---|
| 29 |
|
---|
[15] | 30 | namespace flair {
|
---|
| 31 | namespace core {
|
---|
[2] | 32 |
|
---|
[167] | 33 | template void OneAxisRotation::ComputeRotation(core::Vector3D<float> &) const;
|
---|
| 34 | template void OneAxisRotation::ComputeRotation(core::Vector3D<double> &) const;
|
---|
| 35 |
|
---|
[187] | 36 | OneAxisRotation::OneAxisRotation(const gui::LayoutPosition *position,string name,RotationType_t rotationType)
|
---|
[15] | 37 | : gui::GroupBox(position, name) {
|
---|
[187] | 38 | pimpl_ = new OneAxisRotation_impl(this,(int)rotationType);
|
---|
[2] | 39 | }
|
---|
| 40 |
|
---|
[15] | 41 | OneAxisRotation::~OneAxisRotation() { delete pimpl_; }
|
---|
[2] | 42 |
|
---|
[167] | 43 | template <typename T> void OneAxisRotation::ComputeRotation(Vector3D<T> &vector) const {
|
---|
[15] | 44 | pimpl_->ComputeRotation(vector);
|
---|
[2] | 45 | }
|
---|
| 46 |
|
---|
[15] | 47 | void OneAxisRotation::ComputeRotation(Euler &euler) const {
|
---|
| 48 | pimpl_->ComputeRotation(euler);
|
---|
[2] | 49 | }
|
---|
| 50 |
|
---|
[15] | 51 | void OneAxisRotation::ComputeRotation(Quaternion &quaternion) const {
|
---|
| 52 | pimpl_->ComputeRotation(quaternion);
|
---|
[2] | 53 | }
|
---|
| 54 |
|
---|
[15] | 55 | void OneAxisRotation::ComputeRotation(RotationMatrix &matrix) const {
|
---|
| 56 | pimpl_->ComputeRotation(matrix);
|
---|
[2] | 57 | }
|
---|
| 58 |
|
---|
[144] | 59 | float OneAxisRotation::GetAngle() const {
|
---|
[147] | 60 | return Euler::ToRadian(pimpl_->GetAngle());
|
---|
[144] | 61 | }
|
---|
| 62 |
|
---|
| 63 | int OneAxisRotation::GetAxis() const {
|
---|
| 64 | return pimpl_->GetAxis();
|
---|
| 65 | }
|
---|
| 66 |
|
---|
[2] | 67 | } // end namespace core
|
---|
| 68 | } // end namespace flair
|
---|