/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */ /* $Id: vctRandom.cpp,v 1.15 2007/04/26 19:33:57 anton Exp $ Author(s): Anton Deguet Created on: 2005-01-31 (C) Copyright 2005-2007 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- This software is provided "as is" under an open source license, with no warranty. The complete license can be found in license.txt and http://www.cisst.org/cisst/license.txt. --- end cisst license --- */ #include #include #include #include #include #include #include #include template void vctRandom(vctMatrixRotation3Base<_containerType> & matrixRotation) { typedef typename _containerType::value_type value_type; vctQuaternionRotation3Base > quaternionRotation; vctRandom(quaternionRotation); matrixRotation.From(quaternionRotation); } template void vctRandom(vctMatrixRotation3Base > &); template void vctRandom(vctMatrixRotation3Base > &); template void vctRandom(vctMatrixRotation3Base > &); template void vctRandom(vctMatrixRotation3Base > &); template void vctRandom(vctQuaternionRotation3Base<_containerType> & quaternionRotation) { typedef typename _containerType::value_type value_type; vctRandom(quaternionRotation, (value_type) -1.0, (value_type) 1.0); quaternionRotation.NormalizedSelf(); } template void vctRandom(vctQuaternionRotation3Base > &); template void vctRandom(vctQuaternionRotation3Base > &); template void vctRandom(vctQuaternionRotation3Base > &); template void vctRandom(vctQuaternionRotation3Base > &); template void vctRandom(vctAxisAngleRotation3<_elementType> & axisAngleRotation) { typedef _elementType value_type; vctQuaternionRotation3Base > quaternionRotation; vctRandom(quaternionRotation); axisAngleRotation.FromRaw(quaternionRotation); } template void vctRandom(vctAxisAngleRotation3 &); template void vctRandom(vctAxisAngleRotation3 &); template void vctRandom(vctRodriguezRotation3Base<_containerType> & rodriguezRotation) { typedef typename _containerType::value_type value_type; vctAxisAngleRotation3 axisAngleRotation; vctRandom(axisAngleRotation); rodriguezRotation.FromRaw(axisAngleRotation); } template void vctRandom(vctRodriguezRotation3Base > &); template void vctRandom(vctRodriguezRotation3Base > &); template void vctRandom(vctRodriguezRotation3Base > &); template void vctRandom(vctRodriguezRotation3Base > &); template void vctRandom(vctMatrixRotation2Base<_containerType> & matrixRotation) { vctAngleRotation2 angleRotation; vctRandom(angleRotation); matrixRotation.From(angleRotation); } template void vctRandom(vctMatrixRotation2Base > &); template void vctRandom(vctMatrixRotation2Base > &); template void vctRandom(vctMatrixRotation2Base > &); template void vctRandom(vctMatrixRotation2Base > &); void vctRandom(vctAngleRotation2 & angleRotation) { cmnRandomSequence & randomSequence = cmnRandomSequence::GetInstance(); randomSequence.ExtractRandomValue(0.0, 2 * cmnPI, angleRotation.Angle()); } // **************************************************************************** // Change History // **************************************************************************** // // $Log: vctRandom.cpp,v $ // Revision 1.15 2007/04/26 19:33:57 anton // All files in libraries: Applied new license text, separate copyright and // updated dates, added standard header where missing. // // Revision 1.14 2007/02/27 15:49:35 anton // vctRandom: Added template instantiation for transformation based on // dynamic containers of floats. // // Revision 1.13 2007/01/29 03:29:37 anton // cisstVector: Update quaternion and quaternion based rotation to reflect new // class structure (see ticket #263). // // Revision 1.12 2007/01/26 21:23:22 anton // cisstVector: Updated vctMatrixRotation3 code to reflect new design (i.e. avoid // derived class and use typedef instead, see ticket #263. // // Revision 1.11 2007/01/24 15:14:35 anton // cisstVector: Removed remaining references to vctMatrixRotation2.h. // // Revision 1.10 2006/11/20 20:33:19 anton // Licensing: Applied new license to cisstCommon, cisstVector, cisstNumerical, // cisstInteractive, cisstImage and cisstOSAbstraction. // // Revision 1.9 2005/12/01 22:11:58 anton // cisstVector: 2D transformations, added a base class for rotation matrix 2. // // Revision 1.8 2005/11/15 03:23:02 anton // vctRandom: Added support for vctRodriguezRotation3 and vctAxisAngleRotation3. // // Revision 1.7 2005/10/17 21:59:57 anton // cisst: Introduced cmnPI and co. Updated whole repository. See #131. // // Revision 1.6 2005/09/26 15:41:46 anton // cisst: Added modelines for emacs and vi. // // Revision 1.5 2005/09/01 06:18:08 anton // cisstVector transformations: Added a level of abstraction for all classes // derived from fixed size containers (vctQuaternion, vctQuaternionRotation3, // vctMatrixRotation3, vctRodriguezRotation3). These classes are now derived // from vctXyzBase<_containerType>. This will ease the SWIG wrapping. // // Revision 1.4 2005/07/22 18:54:49 ofri // vctRandom.cpp: In response to ticket #156, moved the #include of the rotation // and frame headers to the cpp file. This seems to reduce the test compilation // dependencies and time significantly. // // Revision 1.3 2005/05/19 19:29:01 anton // cisst libs: Added the license to cisstCommon and cisstVector // // Revision 1.2 2005/02/24 01:51:50 anton // cisstVector: Added classes vctAngleRotation2 and vctMatrixRotation2. This // code has not been tested. The normalization and conversion methods have // to be reviewed. // // Revision 1.1 2005/02/04 16:56:54 anton // cisstVector: Added classes vctAxisAngleRotation3 and vctRodriguezRotation3 // as planed in ticket #109. Also updated vctMatrixRotation3 to use these new // classes. Other updates include vctRandom(rotation), new vctTypes and // forward declarations. // // // ****************************************************************************