CigiBaseShortSymbolCtrl.cpp

Go to the documentation of this file.
00001 
00040 #define _EXPORT_CCL_
00041 
00042 
00043 #include "CigiBaseShortSymbolCtrl.h"
00044 #include "CigiExceptions.h"
00045 
00046 
00047 // ====================================================================
00048 // Construction/Destruction
00049 // ====================================================================
00050 
00051 // ================================================
00052 // CigiBaseEntityCtrl
00053 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00054 CigiBaseShortSymbolCtrl::CigiBaseShortSymbolCtrl(void)
00055 {
00056 }
00057 
00058 // ================================================
00059 // ~CigiBaseEntityCtrl
00060 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00061 CigiBaseShortSymbolCtrl::~CigiBaseShortSymbolCtrl(void)
00062 {
00063 }
00064 
00065 
00066 // ====================================================================
00067 // Conversion Control
00068 // ====================================================================
00069 int CigiBaseShortSymbolCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00070                                 CigiCnvtInfoType::Type &CnvtInfo)
00071 {
00072    if(CnvtVersion.GetCombinedCigiVersion() < 0x303)
00073    {
00074       CnvtInfo.ProcID = CigiProcessType::ProcNone;
00075       CnvtInfo.CnvtPacketID = 0;
00076    }
00077    else
00078    {
00079       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00080       CnvtInfo.CnvtPacketID = CIGI_SHORT_SYMBOL_CONTROL_PACKET_ID_V3_3;
00081    }
00082 
00083    return(CIGI_SUCCESS);
00084 }
00085 
00086 
00087 // ====================================================================
00088 // Accessors
00089 // ====================================================================
00090 
00091 // ================================================
00092 // SetSymbolState
00093 // ================================================
00094 int CigiBaseShortSymbolCtrl::SetSymbolState(const CigiBaseSymbolCtrl::SymbolStateGrp SymbolStateIn, bool bndchk)
00095 {
00096 
00097 #ifndef CIGI_NO_BND_CHK
00098    if(bndchk && ((SymbolStateIn < 0)||(SymbolStateIn > 2)))
00099    {
00100 #ifndef CIGI_NO_EXCEPT
00101       throw CigiValueOutOfRangeException("SymbolState", (int)SymbolStateIn,0,2);
00102 #endif
00103       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00104    }
00105 #endif
00106 
00107    SymbolState = SymbolStateIn;
00108 
00109    return(CIGI_SUCCESS);
00110 
00111 }
00112 
00113 
00114 
00115 // ================================================
00116 // SetAttachState
00117 // ================================================
00118 int CigiBaseShortSymbolCtrl::SetAttachState(const CigiBaseSymbolCtrl::AttachStateGrp AttachStateIn, bool bndchk)
00119 {
00120 
00121 #ifndef CIGI_NO_BND_CHK
00122    if(bndchk && ((AttachStateIn < 0)||(AttachStateIn > 1)))
00123    {
00124 #ifndef CIGI_NO_EXCEPT
00125       throw CigiValueOutOfRangeException("AttachState", (int)AttachStateIn,0,1);
00126 #endif
00127       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00128    }
00129 #endif
00130 
00131    AttachState = AttachStateIn;
00132 
00133    return(CIGI_SUCCESS);
00134 
00135 }
00136 
00137 
00138 
00139 // ================================================
00140 // SetFlashCtrl
00141 // ================================================
00142 int CigiBaseShortSymbolCtrl::SetFlashCtrl(const CigiBaseSymbolCtrl::FlashCtrlGrp FlashCtrlIn, bool bndchk)
00143 {
00144 
00145 #ifndef CIGI_NO_BND_CHK
00146    if(bndchk && ((FlashCtrlIn < 0)||(FlashCtrlIn > 1)))
00147    {
00148 #ifndef CIGI_NO_EXCEPT
00149       throw CigiValueOutOfRangeException("FlashCtrl", (int)FlashCtrlIn,0,1);
00150 #endif
00151       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00152    }
00153 #endif
00154 
00155    FlashCtrl = FlashCtrlIn;
00156 
00157    return(CIGI_SUCCESS);
00158 
00159 }
00160 
00161 
00162 
00163 // ================================================
00164 // SetInheritColor
00165 // ================================================
00166 int CigiBaseShortSymbolCtrl::SetInheritColor(const CigiBaseSymbolCtrl::InheritColorGrp InheritColorIn, bool bndchk)
00167 {
00168 
00169 #ifndef CIGI_NO_BND_CHK
00170    if(bndchk && ((InheritColorIn < 0)||(InheritColorIn > 1)))
00171    {
00172 #ifndef CIGI_NO_EXCEPT
00173       throw CigiValueOutOfRangeException("InheritColor", (int)InheritColorIn,0,1);
00174 #endif
00175       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00176    }
00177 #endif
00178 
00179    InheritColor = InheritColorIn;
00180 
00181    return(CIGI_SUCCESS);
00182 
00183 }
00184 
00185 
00186 
00187 // ================================================
00188 // GetDatumType
00189 // ================================================
00190 CigiBaseShortSymbolCtrl::DatumTypeGrp CigiBaseShortSymbolCtrl::GetDatumType(int DatumId) const
00191 {
00192 
00193    //This must be bound checked!
00194    if((DatumId < 0)||(DatumId > 1))
00195    {
00196 #ifndef CIGI_NO_EXCEPT
00197       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00198 #endif
00199       return(None);
00200    }
00201 
00202    return(DatumType[(DatumId)]);
00203 
00204 }
00205 
00206 
00207 
00208 // ================================================
00209 // GetUIntDatum
00210 // ================================================
00211 Cigi_uint32 CigiBaseShortSymbolCtrl::GetUIntDatum(int DatumId) const
00212 {
00213 
00214    //This must be bound checked!
00215    if((DatumId < 0)||(DatumId > 1))
00216    {
00217 #ifndef CIGI_NO_EXCEPT
00218       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00219 #endif
00220       return(0);
00221    }
00222 
00223    return(Datum[(DatumId)].UIntValue);
00224 
00225 }
00226 
00227 
00228 
00229 // ================================================
00230 // GetColorDatum
00231 // ================================================
00232 int CigiBaseShortSymbolCtrl::GetColorDatum(int DatumId,
00233                                            Cigi_uint8 &RedValue,
00234                                            Cigi_uint8 &GreenValue,
00235                                            Cigi_uint8 &BlueValue,
00236                                            Cigi_uint8 &AlphaValue,
00237                                            bool bndchk)
00238 {
00239 
00240    //This must be bound checked!
00241    if((DatumId < 0)||(DatumId > 1))
00242    {
00243 #ifndef CIGI_NO_EXCEPT
00244       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00245 #endif
00246       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00247    }
00248 
00249    RedValue = (Cigi_uint8)((Datum[(DatumId)].UIntValue >> 24) & 0xff);
00250    GreenValue = (Cigi_uint8)((Datum[(DatumId)].UIntValue >> 16) & 0xff);
00251    BlueValue = (Cigi_uint8)((Datum[(DatumId)].UIntValue >> 8) & 0xff);
00252    AlphaValue = (Cigi_uint8)((Datum[(DatumId)].UIntValue) & 0xff);
00253 
00254    return(CIGI_SUCCESS);
00255 
00256 }
00257 
00258 
00259 
00260 // ================================================
00261 // GetFloatDatum
00262 // ================================================
00263 float CigiBaseShortSymbolCtrl::GetFloatDatum(int DatumId) const
00264 {
00265 
00266    //This must be bound checked!
00267    if((DatumId < 0)||(DatumId > 1))
00268    {
00269 #ifndef CIGI_NO_EXCEPT
00270       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00271 #endif
00272       return(0.0);
00273    }
00274 
00275    return(Datum[(DatumId)].FloatValue);
00276 
00277 }
00278 
00279 
00280 
00281 // ================================================
00282 // SetDatumNone
00283 // ================================================
00284 int CigiBaseShortSymbolCtrl::SetDatumNone(int DatumId, bool bndchk)
00285 {
00286 
00287    //This must be bound checked!
00288    if((DatumId < 0)||(DatumId > 1))
00289    {
00290 #ifndef CIGI_NO_EXCEPT
00291       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00292 #endif
00293       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00294    }
00295 
00296    DatumType[(DatumId)] = None;
00297    Datum[(DatumId)].UIntValue = 0;
00298 
00299    return(CIGI_SUCCESS);
00300 
00301 }
00302 
00303 
00304 
00305 // ================================================
00306 // SetSurfaceID
00307 // ================================================
00308 int CigiBaseShortSymbolCtrl::SetSurfaceID(int DatumId,
00309             const Cigi_uint16 SurfaceIDIn, bool bndchk)
00310 {
00311 
00312    //This must be bound checked!
00313    if((DatumId < 0)||(DatumId > 1))
00314    {
00315 #ifndef CIGI_NO_EXCEPT
00316       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00317 #endif
00318       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00319    }
00320 
00321    DatumType[(DatumId)] = SurfaceIdDatumType;
00322    Datum[(DatumId)].UIntValue = (Cigi_uint32)SurfaceIDIn;
00323 
00324    return(CIGI_SUCCESS);
00325 
00326 }
00327 
00328 
00329 
00330 // ================================================
00331 // SetParentSymbolID
00332 // ================================================
00333 int CigiBaseShortSymbolCtrl::SetParentSymbolID(int DatumId,
00334             const Cigi_uint16 ParentSymbolIDIn, bool bndchk)
00335 {
00336 
00337    //This must be bound checked!
00338    if((DatumId < 0)||(DatumId > 1))
00339    {
00340 #ifndef CIGI_NO_EXCEPT
00341       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00342 #endif
00343       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00344    }
00345 
00346    DatumType[(DatumId)] = ParentIdDatumType;
00347    Datum[(DatumId)].UIntValue = (Cigi_uint32)ParentSymbolIDIn;
00348 
00349    return(CIGI_SUCCESS);
00350 
00351 }
00352 
00353 
00354 
00355 // ================================================
00356 // SetLayer
00357 // ================================================
00358 int CigiBaseShortSymbolCtrl::SetLayer(int DatumId,
00359              const Cigi_uint8 LayerIn, bool bndchk)
00360 {
00361 
00362    //This must be bound checked!
00363    if((DatumId < 0)||(DatumId > 1))
00364    {
00365 #ifndef CIGI_NO_EXCEPT
00366       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00367 #endif
00368       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00369    }
00370 
00371    DatumType[(DatumId)] = LayerDatumType;
00372    Datum[(DatumId)].UIntValue = (Cigi_uint32)LayerIn;
00373 
00374    return(CIGI_SUCCESS);
00375 
00376 }
00377 
00378 
00379 
00380 // ================================================
00381 // SetFlashDutyCycle
00382 // ================================================
00383 int CigiBaseShortSymbolCtrl::SetFlashDutyCycle(int DatumId,
00384              const Cigi_uint8 FlashDutyCycleIn, bool bndchk)
00385 {
00386 
00387    //This must be bound checked!
00388    if((DatumId < 0)||(DatumId > 1))
00389    {
00390 #ifndef CIGI_NO_EXCEPT
00391       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00392 #endif
00393       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00394    }
00395 
00396 #ifndef CIGI_NO_BND_CHK
00397    if(bndchk && ((FlashDutyCycleIn < 0)||(FlashDutyCycleIn > 100)))
00398    {
00399 #ifndef CIGI_NO_EXCEPT
00400       throw CigiValueOutOfRangeException("FlashDutyCycle", (int)FlashDutyCycleIn,0,100);
00401 #endif
00402       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00403    }
00404 #endif
00405 
00406    DatumType[(DatumId)] = FlashDutyCycleDatumType;
00407    Datum[(DatumId)].UIntValue = (Cigi_uint32)FlashDutyCycleIn;
00408 
00409    return(CIGI_SUCCESS);
00410 
00411 }
00412 
00413 
00414 
00415 // ================================================
00416 // SetFlashDutyCycle
00417 // ================================================
00418 int CigiBaseShortSymbolCtrl::SetFlashPeriod(int DatumId,
00419                      const float FlashPeriodIn, bool bndchk)
00420 {
00421 
00422    //This must be bound checked!
00423    if((DatumId < 0)||(DatumId > 1))
00424    {
00425 #ifndef CIGI_NO_EXCEPT
00426       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00427 #endif
00428       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00429    }
00430 
00431    DatumType[(DatumId)] = FlashPeriodDatumType;
00432    Datum[(DatumId)].FloatValue = FlashPeriodIn;
00433 
00434    return(CIGI_SUCCESS);
00435 
00436 }
00437 
00438 
00439 
00440 // ================================================
00441 // SetUPosition
00442 // ================================================
00443 int CigiBaseShortSymbolCtrl::SetUPosition(int DatumId,
00444                      const float UPositionIn, bool bndchk)
00445 {
00446 
00447    //This must be bound checked!
00448    if((DatumId < 0)||(DatumId > 1))
00449    {
00450 #ifndef CIGI_NO_EXCEPT
00451       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00452 #endif
00453       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00454    }
00455 
00456    DatumType[(DatumId)] = UPositionDatumType;
00457    Datum[(DatumId)].FloatValue = UPositionIn;
00458 
00459    return(CIGI_SUCCESS);
00460 
00461 }
00462 
00463 
00464 
00465 // ================================================
00466 // SetVPosition
00467 // ================================================
00468 int CigiBaseShortSymbolCtrl::SetVPosition(int DatumId,
00469                      const float VPositionIn, bool bndchk)
00470 {
00471 
00472    //This must be bound checked!
00473    if((DatumId < 0)||(DatumId > 1))
00474    {
00475 #ifndef CIGI_NO_EXCEPT
00476       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00477 #endif
00478       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00479    }
00480 
00481    DatumType[(DatumId)] = VPositionDatumType;
00482    Datum[(DatumId)].FloatValue = VPositionIn;
00483 
00484    return(CIGI_SUCCESS);
00485 
00486 }
00487 
00488 
00489 
00490 // ================================================
00491 // SetRotation
00492 // ================================================
00493 int CigiBaseShortSymbolCtrl::SetRotation(int DatumId,
00494                      const float RotationIn, bool bndchk)
00495 {
00496 
00497    //This must be bound checked!
00498    if((DatumId < 0)||(DatumId > 1))
00499    {
00500 #ifndef CIGI_NO_EXCEPT
00501       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00502 #endif
00503       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00504    }
00505 
00506    DatumType[(DatumId)] = RotationDatumType;
00507    Datum[(DatumId)].FloatValue = RotationIn;
00508 
00509    return(CIGI_SUCCESS);
00510 
00511 }
00512 
00513 
00514 
00515 // ================================================
00516 // SetScaleU
00517 // ================================================
00518 int CigiBaseShortSymbolCtrl::SetScaleU(int DatumId,
00519                      const float ScaleUIn, bool bndchk)
00520 {
00521 
00522    //This must be bound checked!
00523    if((DatumId < 0)||(DatumId > 1))
00524    {
00525 #ifndef CIGI_NO_EXCEPT
00526       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00527 #endif
00528       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00529    }
00530 
00531    DatumType[(DatumId)] = ScaleUDatumType;
00532    Datum[(DatumId)].FloatValue = ScaleUIn;
00533 
00534    return(CIGI_SUCCESS);
00535 
00536 }
00537 
00538 
00539 
00540 // ================================================
00541 // SetScaleV
00542 // ================================================
00543 int CigiBaseShortSymbolCtrl::SetScaleV(int DatumId,
00544                      const float ScaleVIn, bool bndchk)
00545 {
00546 
00547    //This must be bound checked!
00548    if((DatumId < 0)||(DatumId > 1))
00549    {
00550 #ifndef CIGI_NO_EXCEPT
00551       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00552 #endif
00553       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00554    }
00555 
00556    DatumType[(DatumId)] = ScaleVDatumType;
00557    Datum[(DatumId)].FloatValue = ScaleVIn;
00558 
00559    return(CIGI_SUCCESS);
00560 
00561 }
00562 
00563 
00564 
00565 // ================================================
00566 // SetColor
00567 // ================================================
00568 int CigiBaseShortSymbolCtrl::SetColor(int DatumId,
00569                                       const Cigi_uint8 RedIn,
00570                                       const Cigi_uint8 GreenIn,
00571                                       const Cigi_uint8 BlueIn,
00572                                       const Cigi_uint8 AlphaIn,
00573                                       bool bndchk)
00574 {
00575 
00576    //This must be bound checked!
00577    if((DatumId < 0)||(DatumId > 1))
00578    {
00579 #ifndef CIGI_NO_EXCEPT
00580       throw CigiValueOutOfRangeException("DatumId", (int)DatumId,1,2);
00581 #endif
00582       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00583    }
00584 
00585    DatumType[(DatumId)] = ColorDatumType;
00586 
00587    Cigi_uint32 cColor = (Cigi_uint32)AlphaIn;
00588    Cigi_uint32 tColor =  (Cigi_uint32)RedIn;
00589    cColor |= ((tColor << 24) & 0xff000000);
00590    tColor =  (Cigi_uint32)GreenIn;
00591    cColor |= ((tColor << 16) & 0x00ff0000);
00592    tColor =  (Cigi_uint32)BlueIn;
00593    cColor |= ((tColor << 8) & 0x0000ff00);
00594    Datum[(DatumId)].UIntValue = cColor;
00595 
00596    return(CIGI_SUCCESS);
00597 
00598 }
00599 
00600 

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