CigiBaseSymbolCircleDef.cpp

Go to the documentation of this file.
00001 
00040 #define _EXPORT_CCL_
00041 
00042 
00043 #include "CigiBaseSymbolCircleDef.h"
00044 #include "CigiExceptions.h"
00045 
00046 using namespace std;
00047 
00048 // ====================================================================
00049 // Construction/Destruction
00050 // ====================================================================
00051 
00052 // ================================================
00053 // CigiBaseSymbolCircleDef
00054 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00055 CigiBaseSymbolCircleDef::CigiBaseSymbolCircleDef(void)
00056 {
00057 }
00058 
00059 // ================================================
00060 // ~CigiBaseSymbolCircleDef
00061 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00062 CigiBaseSymbolCircleDef::~CigiBaseSymbolCircleDef(void)
00063 {
00064    CigiBaseCircleSymbolData *pCircle;
00065    vector<CigiBaseCircleSymbolData *>::iterator iCircle;
00066    for(iCircle=Circles.begin();iCircle!=Circles.end();iCircle++)
00067    {
00068       pCircle = *iCircle;
00069       if(pCircle != NULL)
00070          delete pCircle;
00071    }
00072    Circles.clear();
00073 }
00074 
00075 
00076 // ================================================
00077 // CigiBaseSymbolCircleDef - Copy constructor
00078 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00079 CigiBaseSymbolCircleDef::CigiBaseSymbolCircleDef(const CigiBaseSymbolCircleDef &BaseIn)
00080 {
00081    SymbolID = BaseIn.SymbolID;
00082    DrawingStyle = BaseIn.DrawingStyle;
00083    StipplePattern = BaseIn.StipplePattern;
00084    LineWidth = BaseIn.LineWidth;
00085    StipplePatternLen = BaseIn.StipplePatternLen;
00086 
00087    // The Circle Vector should be copied in the specific version class
00088 }
00089 
00090 // ================================================
00091 // Copy operator
00092 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00093 CigiBaseSymbolCircleDef & CigiBaseSymbolCircleDef::operator=(const CigiBaseSymbolCircleDef &BaseIn)
00094 {
00095    SymbolID = BaseIn.SymbolID;
00096    DrawingStyle = BaseIn.DrawingStyle;
00097    StipplePattern = BaseIn.StipplePattern;
00098    LineWidth = BaseIn.LineWidth;
00099    StipplePatternLen = BaseIn.StipplePatternLen;
00100 
00101    // The Circle Vector should be copied in the specific version class
00102 
00103    return(*this);
00104 }
00105 
00106 
00107 // ====================================================================
00108 // Conversion Control
00109 // ====================================================================
00110 int CigiBaseSymbolCircleDef::GetCnvt(CigiVersionID &CnvtVersion,
00111                                 CigiCnvtInfoType::Type &CnvtInfo)
00112 {
00113    if(CnvtVersion.GetCombinedCigiVersion() < 0x303)
00114    {
00115       CnvtInfo.ProcID = CigiProcessType::ProcNone;
00116       CnvtInfo.CnvtPacketID = 0;
00117    }
00118    else
00119    {
00120       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00121       CnvtInfo.CnvtPacketID = CIGI_SYMBOL_CIRCLE_DEFINITION_PACKET_ID_V3_3;
00122    }
00123 
00124    return(CIGI_SUCCESS);
00125 }
00126 
00127 
00128 // ====================================================================
00129 // Accessors
00130 // ====================================================================
00131 
00132 
00133 // ================================================
00134 // SetDrawingStyle
00135 // ================================================
00136 int CigiBaseSymbolCircleDef::SetDrawingStyle(const DrawingStyleGrp DrawingStyleIn, bool bndchk)
00137 {
00138 
00139 #ifndef CIGI_NO_BND_CHK
00140    if(bndchk && ((DrawingStyleIn < 0)||(DrawingStyleIn > 1)))
00141    {
00142 #ifndef CIGI_NO_EXCEPT
00143       throw CigiValueOutOfRangeException("DrawingStyle", (int)DrawingStyleIn,0,1);
00144 #endif
00145       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00146    }
00147 #endif
00148 
00149    DrawingStyle = DrawingStyleIn;
00150 
00151    return(CIGI_SUCCESS);
00152 
00153 }
00154 
00155 // ================================================
00156 // SetLineWidth
00157 // ================================================
00158 int CigiBaseSymbolCircleDef::SetLineWidth(const float LineWidthIn, bool bndchk)
00159 {
00160 
00161 #ifndef CIGI_NO_BND_CHK
00162    if(bndchk && (LineWidthIn < 0.0))
00163    {
00164 #ifndef CIGI_NO_EXCEPT
00165       throw CigiValueOutOfRangeException("LineWidth", (double)LineWidthIn,">=",0.0);
00166 #endif
00167       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00168    }
00169 #endif
00170 
00171    LineWidth = LineWidthIn;
00172 
00173    return(CIGI_SUCCESS);
00174 
00175 }
00176 
00177 // ================================================
00178 // SetStipplePatternLen
00179 // ================================================
00180 int CigiBaseSymbolCircleDef::SetStipplePatternLen(const float StipplePatternLenIn, bool bndchk)
00181 {
00182 
00183 #ifndef CIGI_NO_BND_CHK
00184    if(bndchk && (StipplePatternLenIn < 0.0))
00185    {
00186 #ifndef CIGI_NO_EXCEPT
00187       throw CigiValueOutOfRangeException("StipplePatternLen", (double)StipplePatternLenIn,">=",0.0);
00188 #endif
00189       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00190    }
00191 #endif
00192 
00193    StipplePatternLen = StipplePatternLenIn;
00194 
00195    return(CIGI_SUCCESS);
00196 
00197 }
00198 
00199 // ================================================
00200 // GetCircleCount
00201 // ================================================
00202 int CigiBaseSymbolCircleDef::GetCircleCount(void)
00203 {
00204    return(Circles.size());
00205 }
00206 
00207 // ================================================
00208 // GetCircle
00209 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00210 CigiBaseCircleSymbolData * CigiBaseSymbolCircleDef::GetCircle(int CircleIndex, bool bndchk)
00211 {
00212    CigiBaseCircleSymbolData * pCircle = NULL;
00213 
00214    if((CircleIndex >= 0) && ((Cigi_uint8)CircleIndex < Circles.size()))
00215    {
00216       pCircle = Circles[CircleIndex];
00217    }
00218    else
00219    {
00220 #ifndef CIGI_NO_BND_CHK
00221       if(bndchk)
00222       {
00223 #ifndef CIGI_NO_EXCEPT
00224          throw CigiValueOutOfRangeException("CircleIndex", (int)CircleIndex,0,Circles.size());
00225 #endif
00226       }
00227 #endif
00228    }
00229 
00230    return(pCircle);
00231 }
00232 
00233 // ================================================
00234 // ClearCircles
00235 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00236 void CigiBaseSymbolCircleDef::ClearCircles(void)
00237 {
00238    CigiBaseCircleSymbolData *pCircle;
00239    vector<CigiBaseCircleSymbolData *>::iterator iCircle;
00240    for(iCircle=Circles.begin();iCircle!=Circles.end();iCircle++)
00241    {
00242       pCircle = *iCircle;
00243       if(pCircle != NULL)
00244          delete pCircle;
00245    }
00246    Circles.clear();
00247    VariableDataSize = 0;
00248 }
00249 
00250 

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