20#ifndef _vctAngleRotation2_h
21#define _vctAngleRotation2_h
59 cmnThrow(std::runtime_error(
"vctAngleRotation2: This rotation is not normalized"));
67 template <
class _inputType>
69 if (! input.IsNormalized()) {
70 cmnThrow(std::runtime_error(
"vctAngleRotation2: Input is not normalized"));
105 template <
class _containerType>
109 From(matrixRotation);
139 if (normalizeInput) {
147 template <
class _containerType>
151 if (normalizeInput) {
164 inline const AngleType &
Angle(
void)
const {
165 return this->AngleMember;
169 return this->AngleMember;
193 this->AngleMember = angle;
199 template <
class _containerType>
205 this->AngleMember = atan2(matrixRotation.Element(0, 1), matrixRotation.Element(0, 0));
225 this->AngleMember = angle;
231 template <
class _containerType>
253 this->AngleMember = angle;
258 template <
class _containerType>
261 AngleMember = atan2(matrixRotation.Element(0, 1), matrixRotation.Element(0, 0));
338 std::stringstream outputStream;
340 return outputStream.str();
344 inline void ToStream(std::ostream & outputStream)
const {
345 outputStream <<
"Angle: "
352 bool headerOnly =
false,
const std::string & headerPrefix =
"")
const {
354 outputStream << headerPrefix <<
"angle";
356 outputStream << this->
Angle();
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition cmnTypeTraits.h:155
static Type Tolerance(void)
Definition cmnTypeTraits.h:170
Define a rotation based on an angle for a space of dimension 2.
Definition vctAngleRotation2.h:45
ThisType Normalized(void) const
Definition vctAngleRotation2.h:317
ThisType & From(const AngleType angle) CISST_THROW(std
Definition vctAngleRotation2.h:190
std::string ToString(void) const
Definition vctAngleRotation2.h:337
VCT_CONTAINER_TRAITS_TYPEDEFS(double)
cmnTypeTraits< AngleType > TypeTraits
Definition vctAngleRotation2.h:50
ThisType & InverseOf(const ThisType &otherRotation)
Definition vctAngleRotation2.h:279
bool IsNormalized(AngleType CMN_UNUSED(tolerance)=TypeTraits::Tolerance()) const
Definition vctAngleRotation2.h:332
vctAngleRotation2(const AngleType angle) CISST_THROW(std
Definition vctAngleRotation2.h:98
ThisType & FromRaw(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition vctAngleRotation2.h:260
ThisType & From(const vctMatrixRotation2Base< _containerType > &matrixRotation) CISST_THROW(std
Definition vctAngleRotation2.h:201
void SerializeRaw(std::ostream &outputStream) const
Definition vctAngleRotation2.h:361
AngleType AngleMember
Definition vctAngleRotation2.h:53
ThisType & InverseSelf(void)
Definition vctAngleRotation2.h:272
void ToStreamRaw(std::ostream &outputStream, const char CMN_UNUSED(delimiter)=' ', bool headerOnly=false, const std::string &headerPrefix="") const
Definition vctAngleRotation2.h:351
AngleType & Angle(void)
Definition vctAngleRotation2.h:168
const AngleType & Angle(void) const
Definition vctAngleRotation2.h:164
static CISST_EXPORT const ThisType & Identity()
vctAngleRotation2 ThisType
Definition vctAngleRotation2.h:49
ThisType & FromNormalized(const AngleType angle)
Definition vctAngleRotation2.h:223
void ThrowUnlessIsNormalized(const _inputType &input) const CISST_THROW(std
Definition vctAngleRotation2.h:68
ThisType & NormalizedSelf(void)
Definition vctAngleRotation2.h:296
vctAngleRotation2()
Definition vctAngleRotation2.h:78
ThisType & FromNormalized(const vctMatrixRotation2Base< _containerType > &matrixRotation)
Definition vctAngleRotation2.h:233
@ DIMENSION
Definition vctAngleRotation2.h:48
ThisType & FromRaw(const AngleType angle)
Definition vctAngleRotation2.h:251
void ThrowUnlessIsNormalized(void) const CISST_THROW(std
Definition vctAngleRotation2.h:57
vctAngleRotation2(const AngleType angle, bool normalizeInput)
Definition vctAngleRotation2.h:136
void DeSerializeRaw(std::istream &inputStream)
Definition vctAngleRotation2.h:367
ThisType Inverse(void) const
Definition vctAngleRotation2.h:287
void ToStream(std::ostream &outputStream) const
Definition vctAngleRotation2.h:344
vctAngleRotation2(const vctMatrixRotation2Base< _containerType > &matrixRotation, bool normalizeInput)
Definition vctAngleRotation2.h:148
vctAngleRotation2(const vctMatrixRotation2Base< _containerType > &matrixRotation) CISST_THROW(std
Definition vctAngleRotation2.h:106
ThisType & NormalizedOf(const ThisType &otherRotation)
Definition vctAngleRotation2.h:309
Define a rotation matrix for a space of dimension 2.
Definition vctMatrixRotation2Base.h:56
ThisType Normalized(void) const
Definition vctMatrixRotation2Base.h:617
Declaration of various constants.
const double cmnPI
Definition cmnConstants.h:38
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data) CISST_THROW(std
Definition cmnDeSerializer.h:82
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_UNUSED(argument)
Definition cmnPortability.h:497
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
Declaration of cmnSerializer and functions cmnSerializeRaw.
void cmnSerializeRaw(std::ostream &outputStream, const _elementType &data) CISST_THROW(std
Definition cmnSerializer.h:76
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76
std::ostream & operator<<(std::ostream &output, const vctAngleRotation2 &angleRotation)
Definition vctAngleRotation2.h:376
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > ThisType
Definition vctDynamicConstMatrixBase.h:86
Macros to export the symbols of cisstVector (in a Dll).
Declaration of vctFixedSizeVector.