CigiBaseViewCtrl.cpp

Go to the documentation of this file.
00001 
00045 #define _EXPORT_CCL_
00046 
00047 #include "CigiBaseViewCtrl.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050 
00051 
00052 // ====================================================================
00053 // Construction/Destruction
00054 // ====================================================================
00055 
00056 
00057 // ================================================
00058 // CigiBaseViewCtrl
00059 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00060 CigiBaseViewCtrl::CigiBaseViewCtrl()
00061 {
00062 
00063 }
00064 
00065 
00066 
00067 // ================================================
00068 // ~CigiBaseViewCtrl
00069 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00070 CigiBaseViewCtrl::~CigiBaseViewCtrl()
00071 {
00072 
00073 }
00074 
00075 
00076 // ====================================================================
00077 // Conversion Control
00078 // ====================================================================
00079 
00080 
00081 // ================================================
00082 // GetCnvt
00083 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00084 int CigiBaseViewCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00085                               CigiCnvtInfoType::Type &CnvtInfo)
00086 {
00087    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00088 
00089    // V1 & V2 have the same packet id number
00090    if(CnvtVersion.CigiMajorVersion < 3)
00091       CnvtInfo.CnvtPacketID = CIGI_VIEW_CTRL_PACKET_ID_V2;
00092    else
00093       CnvtInfo.CnvtPacketID = CIGI_VIEW_CTRL_PACKET_ID_V3;
00094 
00095    return(CIGI_SUCCESS);
00096 }
00097 
00098 
00099 // ====================================================================
00100 // Accessors
00101 // ====================================================================
00102 
00103 
00104 // ================================================
00105 // Roll
00106 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00107 int CigiBaseViewCtrl::SetRoll(const float RollIn, bool bndchk)
00108 {
00109 
00110 #ifndef CIGI_NO_BND_CHK
00111    if(bndchk && ((RollIn < -180.0)||(RollIn > 180.0)))
00112    {
00113 #ifndef CIGI_NO_EXCEPT
00114       throw CigiValueOutOfRangeException("Roll",(float)RollIn,-180.0,180.0);
00115 #endif
00116       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00117    }
00118 #endif
00119 
00120    Roll = RollIn;
00121    return(CIGI_SUCCESS);
00122 
00123 }
00124 
00125 
00126 // ================================================
00127 // Pitch
00128 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00129 int CigiBaseViewCtrl::SetPitch(const float PitchIn, bool bndchk)
00130 {
00131 
00132 #ifndef CIGI_NO_BND_CHK
00133    if(bndchk && ((PitchIn < -90.0)||(PitchIn > 90.0)))
00134    {
00135 #ifndef CIGI_NO_EXCEPT
00136       throw CigiValueOutOfRangeException("Pitch",(float)PitchIn,-90.0,90.0);
00137 #endif
00138       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00139    }
00140 #endif
00141 
00142    Pitch = PitchIn;
00143    return(CIGI_SUCCESS);
00144 
00145 }
00146 
00147 
00148 // ================================================
00149 // Yaw
00150 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00151 int CigiBaseViewCtrl::SetYaw(const float YawIn, bool bndchk)
00152 {
00153 
00154 #ifndef CIGI_NO_BND_CHK
00155    if(bndchk && ((YawIn < 0.0)||(YawIn > 360.0)))
00156    {
00157 #ifndef CIGI_NO_EXCEPT
00158       throw CigiValueOutOfRangeException("Yaw",(float)YawIn,0.0,360.0);
00159 #endif
00160       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00161    }
00162 #endif
00163 
00164    Yaw = YawIn;
00165    return(CIGI_SUCCESS);
00166 
00167 }
00168 
00169 

Generated on Wed Apr 29 08:59:57 2009 for CCL by  doxygen 1.4.7