Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HandPose.h

Go to the documentation of this file.
00001 
00002 //
00003 //    Title     :  HandPose.h
00004 //    Project     :  OSCAR Version 2.0
00005 //    Created     :  1/04/1996
00006 //    Author      :  Chetan Kapoor
00007 //    Platforms   :  All
00008 //    Copyright   :  The University of Texas at Austin, 2002. All rights reserved.
00009 //
00010 //          This software and documentation constitute an unpublished work
00011 //          and contain valuable trade secrets and proprietary information
00012 //          belonging to the University. None of the foregoing material may be
00013 //          copied or duplicated or disclosed without the express, written
00014 //          permission of University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY
00015 //          AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION,
00016 //          INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 //          PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY
00018 //          THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
00019 //          NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF
00020 //          THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the
00021 //          University be liable for incidental, special, indirect, direct or
00022 //          consequential damages or loss of profits, interruption of business,
00023 //          or related expenses which may arise from use of software or documentation,
00024 //          including but not limited to those resulting from defects in software
00025 //          and/or documentation, or loss or inaccuracy of data of any kind.
00026 //
00027 //    Purpose     :  This file contains the declaration of class HandPose
00028 //               (A six long vector holding x, y, z coordinates and the
00029 //              orientation called Roll Pitch Yaw over here. Could be
00030 //              anything though).
00031 //
00032 //-----------------------------------------------------------------------------
00033 //
00034 //    $Revisions$
00035 //
00036 //      1-30-97 Troy Harden
00037 //        I overloaded the () operator to allow changing of vector values.
00038 //
00039 //      9-25-02 Chetan Kapoor
00040 //        Modified HandPose to now use the functionality of Orientation
00041 //        Added Get/Set methods to convert to and from other objects
00042 //
00043 //    $Log: HandPose.h,v $
00044 //    Revision 1.11  2005/03/18 23:05:23  chetan
00045 //    Fixed g++ compile warnings. Removed virtual inheritance from Base, added initialization of base class in copy constructors, added newline at EOF
00046 //
00047 //    Revision 1.10  2005/03/14 22:04:16  pmarch
00048 //    Added to namespace OSCAR and removed "RR" from front of class names.
00049 //
00050 //    Revision 1.9  2005/01/06 22:54:41  chetan
00051 //    Added default constructors
00052 //
00053 //    Revision 1.8  2004/07/19 20:02:07  djung
00054 //    DUMMY_ERROR fix fix
00055 //
00056 //    Revision 1.7  2004/07/19 16:37:03  edjung
00057 //    -made fix to constructors for ANSI C++ compliance with temporary OSCARError objects
00058 //    -added DUMMY_ERROR class
00059 //
00060 //    Revision 1.6  2004/05/26 20:02:01  pmarch
00061 //    Added /defgroup and /ingroup tags.
00062 //
00063 //    Revision 1.5  2003/09/09 17:13:12  eswint
00064 //    - Changed #include "Math/..." to #include "..."
00065 //
00066 //    Revision 1.4  2003/09/05 19:36:03  eswint
00067 //    - Edited comments
00068 //
00069 //    Revision 1.3  2003/09/04 22:48:50  eswint
00070 //    - Changed default arguments: OSCARError(0,"No Error"...) to OSCARError(noError) and String(" ") to String("")
00071 //
00072 //    Revision 1.2  2003/08/26 22:26:31  eswint
00073 //    - Made construction from OrientationType explicit
00074 //
00075 //    Revision 1.1  2003/08/18 15:23:39  eswint
00076 //    Initial Commit
00077 //
00078 //
00080 #ifndef HandPose_hpp
00081 #define HandPose_hpp
00082 
00083 #include "Math/CoordinateVector.h"
00084 #include "Math/Orientation.h"
00085 #include "Math/SpatialXform.h"
00086 #include "Math/Vector3.h"
00087 #include "Math/Xform.h"
00088 
00090 namespace OSCAR {
00106   class HandPose : public CoordinateVector
00107   {
00108   public:
00109 
00116     HandPose();
00117 
00125     explicit HandPose(Orientation::OrientationType oType);
00126 
00140     HandPose(double x, double y, double z, double o1, double o2, double o3, Orientation::OrientationType oType = Orientation::FixedXYZ);
00141 
00159     HandPose(double x, double y, double z, double o1, double o2, double o3,
00160       const CoordinateStatusArray& statArray,
00161                Orientation::OrientationType oType = Orientation::FixedXYZ,
00162                OSCARError& err = DUMMY_ERROR(noError));
00163 
00173     HandPose(double *array, Orientation::OrientationType oType = Orientation::FixedXYZ);
00174 
00188     HandPose(double *array, const CoordinateStatusArray& statArray, Orientation::OrientationType oType = Orientation::FixedXYZ,
00189                OSCARError& err = DUMMY_ERROR(noError));
00190 
00201     HandPose(const CoordinateStatusArray& statArray, OSCARError& err = DUMMY_ERROR(noError));
00202 
00209     HandPose(const HandPose& rhs);
00210 
00216     virtual ~HandPose();
00217 
00224     double& X();
00225 
00232     double& Y();
00233 
00240     double& Z();
00241 
00248     double& O1();
00249 
00256     double& O2();
00257 
00264     double& O3();
00265 
00272     double GetX() const;
00273 
00280     double GetY() const;
00281 
00288     double GetZ()  const;
00289 
00296     double GetO1() const;
00297 
00304     double GetO2() const;
00305 
00312     double GetO3() const;
00313 
00321     bool Get(Vector3& position) const;
00322 
00330     bool Get(Orientation& orientation) const;
00331 
00339     bool Get(Rot3by3& rotation) const;
00340 
00348     bool Get(Quaternion& quat) const;
00349 
00357     bool Get(Xform& xform) const;
00358 
00366     bool Get(SpatialXform& spatial) const;
00367 
00378     bool Get(Vector3& axis, double& angle, AngleUnits angUnits = Radians) const;
00379 
00380 
00388     bool Set(const Vector3& position);  // sets the position coordinates
00389 
00397     bool Set(const Orientation& orientation);
00398 
00407     bool Set(const Rot3by3& rotation);
00408 
00417     bool Set(const Quaternion& quat);
00418 
00426     bool Set(const Xform& xform);
00427 
00436     bool Set(const SpatialXform& spatial);
00437 
00447     bool Set(const Vector3& axis, double angle, AngleUnits angUnits = Radians);
00448 
00449 
00456     Orientation:: OrientationType GetOrientationType() const;
00457 
00465     bool SetOrientationType(Orientation::OrientationType oType);
00466 
00475     bool ConvertType(Orientation::OrientationType oType);
00476 
00487     bool Subtract(const HandPose& rhs, HandPose& result) const;
00488 
00498     HandPose  operator-(const HandPose& rhs) const;
00499 
00507     HandPose& operator=(const HandPose& rhs);
00508 
00517     HandPose& operator=(const Vector& rhs);
00518 
00531     HandPose& operator()(double x,double y,double z,double o1,double o2,double o3);
00532 
00533   protected:
00534     Orientation::OrientationType   oType;
00535   };
00536 
00537 
00538   #include "HandPose.ipp"
00539 }
00540 
00541 #endif  // HandPose_hpp
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations