Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

Orientation.h

Go to the documentation of this file.
00001 
00005 // SRM SDK Release 4.4.0 - December 7, 2009
00006 
00007 // - SRM spec. 4.4
00008 
00009 /*
00010  *                             NOTICE
00011  * 
00012  * This software is provided openly and freely for use in representing and
00013  * interchanging environmental data & databases.
00014  * 
00015  * This software was developed for use by the United States Government with
00016  * unlimited rights.  The software was developed under contract
00017  * DASG60-02-D-0006 TO-193 by Science Applications International Corporation.
00018  * The software is unclassified and is deemed as Distribution A, approved
00019  * for Public Release.
00020  * 
00021  * Use by others is permitted only upon the ACCEPTANCE OF THE TERMS AND
00022  * CONDITIONS, AS STIPULATED UNDER THE FOLLOWING PROVISIONS:
00023  * 
00024  *    1. Recipient may make unlimited copies of this software and give
00025  *       copies to other persons or entities as long as the copies contain
00026  *       this NOTICE, and as long as the same copyright notices that
00027  *       appear on, or in, this software remain.
00028  * 
00029  *    2. Trademarks. All trademarks belong to their respective trademark
00030  *       holders.  Third-Party applications/software/information are
00031  *       copyrighted by their respective owners.
00032  * 
00033  *    3. Recipient agrees to forfeit all intellectual property and
00034  *       ownership rights for any version created from the modification
00035  *       or adaptation of this software, including versions created from
00036  *       the translation and/or reverse engineering of the software design.
00037  * 
00038  *    4. Transfer.  Recipient may not sell, rent, lease, or sublicense
00039  *       this software.  Recipient may, however enable another person
00040  *       or entity the rights to use this software, provided that this
00041  *       AGREEMENT and NOTICE is furnished along with the software and
00042  *       /or software system utilizing this software.
00043  * 
00044  *       All revisions, modifications, created by the Recipient, to this
00045  *       software and/or related technical data shall be forwarded by the
00046  *       Recipient to the Government at the following address:
00047  * 
00048  *         SMDC
00049  *         Attention SEDRIS (TO193) TPOC
00050  *         P.O. Box 1500
00051  *         Hunstville, AL  35807-3801
00052  * 
00053  *         or via electronic mail to:  [email protected]
00054  * 
00055  *    5. No Warranty. This software is being delivered to you AS IS
00056  *       and there is no warranty, EXPRESS or IMPLIED, as to its use
00057  *       or performance.
00058  * 
00059  *       The RECIPIENT ASSUMES ALL RISKS, KNOWN AND UNKNOWN, OF USING
00060  *       THIS SOFTWARE.  The DEVELOPER EXPRESSLY DISCLAIMS, and the
00061  *       RECIPIENT WAIVES, ANY and ALL PERFORMANCE OR RESULTS YOU MAY
00062  *       OBTAIN BY USING THIS SOFTWARE OR DOCUMENTATION.  THERE IS
00063  *       NO WARRANTY, EXPRESS OR, IMPLIED, AS TO NON-INFRINGEMENT OF
00064  *       THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY
00065  *       PARTICULAR PURPOSE.  IN NO EVENT WILL THE DEVELOPER, THE
00066  *       UNITED STATES GOVERNMENT OR ANYONE ELSE ASSOCIATED WITH THE
00067  *       DEVELOPMENT OF THIS SOFTWARE BE HELD LIABLE FOR ANY CONSEQUENTIAL,
00068  *       INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS
00069  *       OR LOST SAVINGS WHATSOEVER.
00070  */
00071 
00072 // SRM_OTHERS_GOES_HERE
00073 
00074 // $Id: Orientation.h,v 1.47 2009/11/06 21:40:40 worleym Exp $
00075 
00076 #ifndef _Orientation_h
00077 #define _Orientation_h
00078 
00079 #if !defined(_WIN32)
00080 #define EXPORT_SRM_CPP_DLL
00081 #elif defined(BUILD_SRM_CPP) /* SRM CPP Case */
00082 #if !defined(EXPORT_SRM_CPP_DLL)
00083 #if defined(_LIB)
00084 #define EXPORT_SRM_CPP_DLL
00085 #elif defined(_USRDLL)
00086 #define EXPORT_SRM_CPP_DLL __declspec(dllexport)
00087 #else
00088 #define EXPORT_SRM_CPP_DLL __declspec(dllimport)
00089 #endif
00090 #endif
00091 #else /* SRM C Case */
00092 #define EXPORT_SRM_CPP_DLL
00093 #endif /* _WIN32 && EXPORT_DLL */
00094 
00095 #include "Exception.h"
00096 #include <string>
00097 
00098 namespace srm
00099 {
00103 class EXPORT_SRM_CPP_DLL Orientation
00104 {
00105 public:
00108     static const SRM_Long_Float epsilon;
00109 
00112     virtual Orientation & operator=(const Orientation &other);
00113 
00116     virtual SRM_Matrix_3x3 getMatrix3x3() const;
00117 
00120     virtual SRM_Axis_Angle_Params getAxisAngle() const;
00121 
00124     virtual SRM_Euler_Angles_ZXZ_Params getEulerAnglesZXZ() const;
00125 
00128     virtual SRM_Tait_Bryan_Angles_Params getTaitBryanAngles() const;
00129 
00132     virtual SRM_Quaternion_Params getQuaternion() const;
00133 
00138     virtual void setMatrix3x3(const SRM_Matrix_3x3 & params);
00139 
00144     virtual void setMatrix3x3
00145     (SRM_Long_Float a11, SRM_Long_Float a12, SRM_Long_Float a13,
00146      SRM_Long_Float a21, SRM_Long_Float a22, SRM_Long_Float a23,
00147      SRM_Long_Float a31, SRM_Long_Float a32, SRM_Long_Float a33);
00148 
00154     virtual void setAxisAngle(const SRM_Axis_Angle_Params & params);
00155 
00162     virtual void setAxisAngle(const SRM_Vector_3D & axis, SRM_Long_Float angle);
00163 
00170     virtual void setEulerAnglesZXZ(const SRM_Euler_Angles_ZXZ_Params & params);
00171 
00181     virtual void setEulerAnglesZXZ
00182     (
00183         SRM_Long_Float spin,
00184         SRM_Long_Float nutation,
00185         SRM_Long_Float precession
00186     );
00187 
00194     virtual void setTaitBryanAngles
00195     (
00196         const SRM_Tait_Bryan_Angles_Params & params
00197     );
00198 
00208     virtual void setTaitBryanAngles
00209     (
00210         SRM_Long_Float roll,
00211         SRM_Long_Float pitch,
00212         SRM_Long_Float yaw
00213     );
00214 
00220     virtual void setQuaternion(const SRM_Quaternion_Params & params );
00221 
00231     virtual void setQuaternion
00232     (
00233         SRM_Long_Float e0,
00234         SRM_Long_Float e1,
00235         SRM_Long_Float e2,
00236         SRM_Long_Float e3
00237     );
00238 
00241     virtual std::string toString() const = 0;
00242 
00245     virtual SRM_Ori_Rep_Type getOriRep() const = 0;
00246 
00251     virtual SRM_Vector_3D transformVector(const SRM_Vector_3D &vec ) const;
00252 
00253     static bool equivalence
00254     (
00255         const Orientation    &instance1,
00256         const Orientation    &instance2,
00257               SRM_Long_Float  tolerance = Orientation::epsilon
00258     );
00259 
00260     virtual bool equivalence
00261     (
00262         const Orientation    &compare_instance,
00263               SRM_Long_Float  tolerance = Orientation::epsilon
00264     ) const
00265     {
00266         return equivalence(*this, compare_instance, tolerance);
00267     }
00268 
00272     bool operator==( Orientation & rhs );
00273 
00274 private:
00277     mutable SRM_Matrix_3x3 _matrix_base;
00281     mutable bool _internal_data_is_current;
00282 
00283 protected:
00284     Orientation();
00287     const SRM_Matrix_3x3 & _get_matrix_base() const;
00288     const SRM_Matrix_3x3 & _get_matrix_base_unch() const;
00289     void _set_matrix_base(const SRM_Matrix_3x3 & matrix_base ) const;
00293     bool _get_internal_data_is_current() const;
00294     void _set_internal_data_is_current( bool internal_data_is_current) const;
00298     virtual void _updateIntData() const = 0;
00302     virtual void _updateRepData() = 0;
00303 };
00304 
00305 
00310 class EXPORT_SRM_CPP_DLL OrientationMatrix : public Orientation
00311 {
00312 public:
00315     OrientationMatrix();
00316 
00321     OrientationMatrix
00322     (SRM_Long_Float a11, SRM_Long_Float a12, SRM_Long_Float a13,
00323      SRM_Long_Float a21, SRM_Long_Float a22, SRM_Long_Float a23,
00324      SRM_Long_Float a31, SRM_Long_Float a32, SRM_Long_Float a33);
00325 
00330     OrientationMatrix(const SRM_Matrix_3x3 &params);
00331 
00334     OrientationMatrix(const Orientation &other);
00335 
00338     virtual Orientation & operator=(const Orientation &other);
00339 
00342     virtual std::string toString() const;
00343 
00346     virtual SRM_Ori_Rep_Type getOriRep() const
00347     {
00348         return SRM_ORI_REP_MATRIX_3X3;
00349     }
00350 
00353     static bool isValidParams(const SRM_Matrix_3x3 &params);
00354 
00359     static OrientationMatrix compose
00360     (
00361         const Orientation &left,
00362         const Orientation &right
00363     );
00364 
00367     static bool equivParams
00368     (
00369         const SRM_Matrix_3x3 &params1,
00370         const SRM_Matrix_3x3 &params2,
00371               SRM_Long_Float  tolerance = 0.0
00372     );
00373 
00374 protected:
00375     SRM_Matrix_3x3 _matrix;
00376 
00377     virtual void _updateIntData() const;
00378     virtual void _updateRepData();
00379 };
00380 
00381 
00386 class EXPORT_SRM_CPP_DLL OrientationAxisAngle : public Orientation
00387 {
00388 public:
00391     OrientationAxisAngle();
00392 
00399     OrientationAxisAngle(const SRM_Axis_Angle_Params & params);
00400 
00407     OrientationAxisAngle(const SRM_Vector_3D & axis, SRM_Long_Float angle );
00408 
00411     OrientationAxisAngle(const Orientation &other);
00412 
00415     virtual Orientation & operator=(const Orientation &other);
00416 
00419     virtual SRM_Axis_Angle_Params getAxisAngle() const
00420     {
00421         return _axis_angle;
00422     }
00423 
00429     virtual void setAxisAngle(const SRM_Axis_Angle_Params & params);
00430 
00437     virtual void setAxisAngle(const SRM_Vector_3D & axis, SRM_Long_Float angle)
00438     {
00439         Orientation::setAxisAngle(axis, angle);
00440     }
00441 
00444     virtual std::string toString() const;
00445 
00448     virtual SRM_Ori_Rep_Type getOriRep() const
00449     {
00450         return SRM_ORI_REP_AXIS_ANGLE;
00451     }
00452 
00455     static bool isValidParams(const SRM_Axis_Angle_Params & params );
00456 
00461     static OrientationAxisAngle compose
00462     (
00463         const Orientation &left,
00464         const Orientation &right
00465     );
00466 
00469     static bool equivParams
00470     (
00471         const SRM_Axis_Angle_Params &params1,
00472         const SRM_Axis_Angle_Params &params2,
00473               SRM_Long_Float         tolerance = 0.0
00474     );
00475 
00476 protected:
00477     SRM_Axis_Angle_Params _axis_angle;
00478 
00479     virtual void _updateIntData() const;
00480     virtual void _updateRepData();
00481 };
00482 
00483 
00488 class EXPORT_SRM_CPP_DLL OrientationEulerAnglesZXZ : public Orientation
00489 {
00490 public:
00493     OrientationEulerAnglesZXZ();
00494 
00501     OrientationEulerAnglesZXZ(const SRM_Euler_Angles_ZXZ_Params & params );
00502 
00512     OrientationEulerAnglesZXZ
00513     (
00514         SRM_Long_Float spin,
00515         SRM_Long_Float nutation,
00516         SRM_Long_Float precession
00517     );
00518 
00521     OrientationEulerAnglesZXZ(const Orientation &other);
00522 
00525     virtual Orientation & operator=(const Orientation &other);
00526 
00529     virtual SRM_Euler_Angles_ZXZ_Params getEulerAnglesZXZ() const
00530     {
00531         return _euler_angles;
00532     }
00533 
00540     virtual void setEulerAnglesZXZ
00541     (
00542         const SRM_Euler_Angles_ZXZ_Params & params
00543     );
00544 
00554     virtual void setEulerAnglesZXZ
00555     (
00556         SRM_Long_Float spin,
00557         SRM_Long_Float nutation,
00558         SRM_Long_Float precession
00559     )
00560     {
00561         Orientation::setEulerAnglesZXZ(spin, nutation, precession);
00562     }
00563 
00566     virtual std::string toString() const;
00567 
00570     virtual SRM_Ori_Rep_Type getOriRep() const
00571     {
00572         return SRM_ORI_REP_EULER_ANGLES_ZXZ;
00573     }
00574 
00578     static bool isValidParams(const SRM_Euler_Angles_ZXZ_Params &params);
00579 
00584     static OrientationEulerAnglesZXZ compose
00585     (
00586         const Orientation &left,
00587         const Orientation &right
00588     );
00589 
00592     static bool equivParams
00593     (
00594         const SRM_Euler_Angles_ZXZ_Params &params1,
00595         const SRM_Euler_Angles_ZXZ_Params &params2,
00596               SRM_Long_Float               tolerance = 0.0
00597     );
00598 
00599 protected:
00600     SRM_Euler_Angles_ZXZ_Params _euler_angles;
00601 
00602     virtual void _updateIntData() const;
00603     virtual void _updateRepData();
00604 };
00605 
00606 
00611 class EXPORT_SRM_CPP_DLL OrientationTaitBryanAngles : public Orientation
00612 {
00613 public:
00616     OrientationTaitBryanAngles();
00617 
00624     OrientationTaitBryanAngles(const SRM_Tait_Bryan_Angles_Params &params);
00625 
00635     OrientationTaitBryanAngles
00636     (
00637         SRM_Long_Float roll,
00638         SRM_Long_Float pitch,
00639         SRM_Long_Float yaw
00640     );
00641 
00644     OrientationTaitBryanAngles(const Orientation &other);
00645 
00648     virtual Orientation & operator=(const Orientation &other);
00649 
00652     virtual SRM_Tait_Bryan_Angles_Params getTaitBryanAngles() const
00653     {
00654         return _tait_bryan_angles;
00655     }
00656 
00663     virtual void setTaitBryanAngles
00664     (
00665         const SRM_Tait_Bryan_Angles_Params & params
00666     );
00667 
00677     virtual void setTaitBryanAngles
00678     (
00679         SRM_Long_Float roll,
00680         SRM_Long_Float pitch,
00681         SRM_Long_Float yaw
00682     )
00683     {
00684         Orientation::setTaitBryanAngles(roll, pitch, yaw);
00685     }
00686 
00689     virtual std::string toString() const;
00690 
00693     virtual SRM_Ori_Rep_Type getOriRep() const
00694     {
00695         return SRM_ORI_REP_TAIT_BRYAN_ANGLES;
00696     }
00697 
00701     static bool isValidParams(const SRM_Tait_Bryan_Angles_Params & params );
00702 
00707     static OrientationTaitBryanAngles compose
00708     (
00709         const Orientation &left,
00710         const Orientation &right
00711     );
00712 
00715     static bool equivParams
00716     (
00717         const SRM_Tait_Bryan_Angles_Params &params1,
00718         const SRM_Tait_Bryan_Angles_Params &params2,
00719               SRM_Long_Float                tolerance = 0.0
00720     );
00721 
00722 protected:
00723     SRM_Tait_Bryan_Angles_Params _tait_bryan_angles;
00724 
00725     virtual void _updateIntData() const;
00726     virtual void _updateRepData();
00727 };
00728 
00729 
00734 class EXPORT_SRM_CPP_DLL OrientationQuaternion : public Orientation
00735 {
00736 public:
00739     OrientationQuaternion();
00740 
00746     OrientationQuaternion(const SRM_Quaternion_Params &params);
00747 
00757     OrientationQuaternion
00758     (
00759         SRM_Long_Float e0,
00760         SRM_Long_Float e1,
00761         SRM_Long_Float e2,
00762         SRM_Long_Float e3
00763     );
00764 
00767     OrientationQuaternion(const Orientation &other);
00768 
00771     virtual Orientation & operator=(const Orientation &other);
00772 
00775     virtual SRM_Quaternion_Params getQuaternion() const
00776     {
00777         return _quaternion;
00778     }
00779 
00785     virtual void setQuaternion(const SRM_Quaternion_Params & params );
00786 
00796     virtual void setQuaternion
00797     (
00798         SRM_Long_Float e0,
00799         SRM_Long_Float e1,
00800         SRM_Long_Float e2,
00801         SRM_Long_Float e3
00802     )
00803     {
00804         Orientation::setQuaternion(e0, e1, e2, e3);
00805     }
00806 
00809     virtual std::string toString() const;
00810 
00813     virtual SRM_Ori_Rep_Type getOriRep() const
00814     {
00815         return SRM_ORI_REP_QUATERNION;
00816     }
00817 
00820     static bool isValidParams(const SRM_Quaternion_Params &params );
00821 
00826     static OrientationQuaternion compose
00827     (
00828         const Orientation &left,
00829         const Orientation &right
00830     );
00831 
00834     static bool equivParams
00835     (
00836         const SRM_Quaternion_Params &params1,
00837         const SRM_Quaternion_Params &params2,
00838               SRM_Long_Float         tolerance = 0.0
00839     );
00840 
00841 protected:
00842     SRM_Quaternion_Params _quaternion;
00843 
00844     virtual void _updateIntData() const;
00845     virtual void _updateRepData();
00846 };
00847 
00848 } // namespace srm
00849 
00850 #endif // _Orientation_h

Spatial Reference Model C++ API Version 4.4 - December 7, 2009
Copyright © 2009 SEDRIS Docs by Doxygen 1.3.2