source: flair-src/trunk/lib/FlairCore/src/OneAxisRotation.cpp@ 169

Last change on this file since 169 was 167, checked in by Sanahuja Guillaume, 7 years ago

modifs pour template vectors

File size: 1.8 KB
RevLine 
[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
28using std::string;
29
[15]30namespace flair {
31namespace core {
[2]32
[167]33template void OneAxisRotation::ComputeRotation(core::Vector3D<float> &) const;
34template void OneAxisRotation::ComputeRotation(core::Vector3D<double> &) const;
35
[15]36OneAxisRotation::OneAxisRotation(const gui::LayoutPosition *position,
37 string name)
38 : gui::GroupBox(position, name) {
39 pimpl_ = new OneAxisRotation_impl(this);
[2]40}
41
[15]42OneAxisRotation::~OneAxisRotation() { delete pimpl_; }
[2]43
[167]44template <typename T> void OneAxisRotation::ComputeRotation(Vector3D<T> &vector) const {
[15]45 pimpl_->ComputeRotation(vector);
[2]46}
47
[15]48void OneAxisRotation::ComputeRotation(Euler &euler) const {
49 pimpl_->ComputeRotation(euler);
[2]50}
51
[15]52void OneAxisRotation::ComputeRotation(Quaternion &quaternion) const {
53 pimpl_->ComputeRotation(quaternion);
[2]54}
55
[15]56void OneAxisRotation::ComputeRotation(RotationMatrix &matrix) const {
57 pimpl_->ComputeRotation(matrix);
[2]58}
59
[144]60float OneAxisRotation::GetAngle() const {
[147]61 return Euler::ToRadian(pimpl_->GetAngle());
[144]62}
63
64int OneAxisRotation::GetAxis() const {
65 return pimpl_->GetAxis();
66}
67
[2]68} // end namespace core
69} // end namespace flair
Note: See TracBrowser for help on using the repository browser.