00001
00045 #define _EXPORT_CCL_
00046
00047 #include "CigiBaseArtPartCtrl.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CigiBaseArtPartCtrl::CigiBaseArtPartCtrl()
00061 {
00062
00063 }
00064
00065
00066
00067
00068
00069
00070 CigiBaseArtPartCtrl::~CigiBaseArtPartCtrl()
00071 {
00072
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 int CigiBaseArtPartCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00085 CigiCnvtInfoType::Type &CnvtInfo)
00086 {
00087 CnvtInfo.ProcID = CigiProcessType::ProcStd;
00088
00089
00090 if(CnvtVersion.CigiMajorVersion < 3)
00091 CnvtInfo.CnvtPacketID = CIGI_ART_PART_CTRL_PACKET_ID_V2;
00092 else
00093 CnvtInfo.CnvtPacketID = CIGI_ART_PART_CTRL_PACKET_ID_V3;
00094
00095 return(CIGI_SUCCESS);
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 int CigiBaseArtPartCtrl::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
00128
00129 int CigiBaseArtPartCtrl::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
00150
00151 int CigiBaseArtPartCtrl::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