CigiBaseShortArtPartCtrl.cpp

Go to the documentation of this file.
00001 
00045 #define _EXPORT_CCL_
00046 
00047 #include "CigiBaseShortArtPartCtrl.h"
00048 #include "CigiArtPartCtrlV3.h"
00049 #include "CigiSwapping.h"
00050 #include "CigiExceptions.h"
00051 
00052 
00053 // ====================================================================
00054 // Construction/Destruction
00055 // ====================================================================
00056 
00057 
00058 // ================================================
00059 // CigiBaseShortArtPartCtrl
00060 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00061 CigiBaseShortArtPartCtrl::CigiBaseShortArtPartCtrl()
00062 {
00063 
00064 }
00065 
00066 
00067 
00068 // ================================================
00069 // ~CigiBaseShortArtPartCtrl
00070 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00071 CigiBaseShortArtPartCtrl::~CigiBaseShortArtPartCtrl()
00072 {
00073 
00074 }
00075 
00076 
00077 // ====================================================================
00078 // Conversion Control
00079 // ====================================================================
00080 
00081 
00082 // ================================================
00083 // GetCnvt
00084 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00085 int CigiBaseShortArtPartCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00086                                       CigiCnvtInfoType::Type &CnvtInfo)
00087 {
00088    if(CnvtVersion.CigiMajorVersion < 3)
00089    {
00090       // V1 & V2 of the Art Part packet
00091       //  uses the same packet id number
00092       CnvtInfo.ProcID = CigiProcessType::ProcShortArtPartToArtPart;
00093       CnvtInfo.CnvtPacketID = CIGI_ART_PART_CTRL_PACKET_ID_V2;
00094    }
00095    else
00096    {
00097       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00098       CnvtInfo.CnvtPacketID = CIGI_SHORT_ART_PART_CTRL_PACKET_ID_V3;
00099    }
00100 
00101    return(CIGI_SUCCESS);
00102 }
00103 
00104 
00105 // ================================================
00106 // SpecialConversion
00107 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00108 int CigiBaseShortArtPartCtrl::SpecialConversion(CigiVersionID &CnvtVersion,
00109    Cigi_uint8 ArtPartID, CigiArtPartCtrlV3 *ArtPart)
00110 {
00111    if(ArtPart == NULL)
00112    {
00113 #ifndef CIGI_NO_EXCEPT
00114       throw CigiNullPointerException();
00115 #endif
00116       return(CIGI_ERROR_UNEXPECTED_NULL);
00117    }
00118 
00119    ArtPart->SetArtPartID(ArtPartID);
00120    ArtPart->SetEntityID(EntityID);
00121 
00122    if((ArtPart1 == ArtPartID) && ArtPart1En)
00123    {
00124       ArtPart->SetArtPartEn(true);
00125       switch(DofSelect1)
00126       {
00127       case Xoff:
00128          ArtPart->SetXOff(Dof1);
00129          ArtPart->SetXOffEn(true);
00130          break;
00131       case Yoff:
00132          ArtPart->SetYOff(Dof1);
00133          ArtPart->SetYOffEn(true);
00134          break;
00135       case Zoff:
00136          ArtPart->SetZOff(Dof1);
00137          ArtPart->SetZOffEn(true);
00138          break;
00139       case Yaw:
00140          ArtPart->SetYaw(Dof1);
00141          ArtPart->SetYawEn(true);
00142          break;
00143       case Pitch:
00144          ArtPart->SetPitch(Dof1);
00145          ArtPart->SetPitchEn(true);
00146          break;
00147       case Roll:
00148          ArtPart->SetRoll(Dof1);
00149          ArtPart->SetRollEn(true);
00150          break;
00151       default:
00152          break;
00153       }
00154    }
00155 
00156    if((ArtPart2 == ArtPartID) && ArtPart2En)
00157    {
00158       ArtPart->SetArtPartEn(true);
00159       switch(DofSelect2)
00160       {
00161       case Xoff:
00162          ArtPart->SetXOff(Dof2);
00163          ArtPart->SetXOffEn(true);
00164          break;
00165       case Yoff:
00166          ArtPart->SetYOff(Dof2);
00167          ArtPart->SetYOffEn(true);
00168          break;
00169       case Zoff:
00170          ArtPart->SetZOff(Dof2);
00171          ArtPart->SetZOffEn(true);
00172          break;
00173       case Yaw:
00174          ArtPart->SetYaw(Dof2);
00175          ArtPart->SetYawEn(true);
00176          break;
00177       case Pitch:
00178          ArtPart->SetPitch(Dof2);
00179          ArtPart->SetPitchEn(true);
00180          break;
00181       case Roll:
00182          ArtPart->SetRoll(Dof2);
00183          ArtPart->SetRollEn(true);
00184          break;
00185       default:
00186          break;
00187       }
00188    }
00189 
00190    return(CIGI_SUCCESS);
00191 }
00192 
00193 
00194 // ====================================================================
00195 // Accessors
00196 // ====================================================================
00197 
00198 
00199 // ================================================
00200 // DofSelect1
00201 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00202 int CigiBaseShortArtPartCtrl::SetDofSelect1(const DofSelectGrp DofSelect1In, bool bndchk)
00203 {
00204 
00205 #ifndef CIGI_NO_BND_CHK
00206    if(bndchk && ((DofSelect1In < 0)||(DofSelect1In > 6)))
00207    {
00208 #ifndef CIGI_NO_EXCEPT
00209       throw CigiValueOutOfRangeException("DofSelect1",(DofSelectGrp)DofSelect1In,0,6);
00210 #endif
00211       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00212    }
00213 #endif
00214 
00215    DofSelect1 = DofSelect1In;
00216    return(CIGI_SUCCESS);
00217 
00218 }
00219 
00220 
00221 // ================================================
00222 // DofSelect2
00223 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00224 int CigiBaseShortArtPartCtrl::SetDofSelect2(const DofSelectGrp DofSelect2In, bool bndchk)
00225 {
00226 
00227 #ifndef CIGI_NO_BND_CHK
00228    if(bndchk && ((DofSelect2In < 0)||(DofSelect2In > 6)))
00229    {
00230 #ifndef CIGI_NO_EXCEPT
00231       throw CigiValueOutOfRangeException("DofSelect2",(DofSelectGrp)DofSelect2In,0,6);
00232 #endif
00233       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00234    }
00235 #endif
00236 
00237    DofSelect2 = DofSelect2In;
00238    return(CIGI_SUCCESS);
00239 
00240 }
00241 
00242 

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