CigiBaseSymbolCircleDef Class Reference

#include <CigiBaseSymbolCircleDef.h>

Inheritance diagram for CigiBaseSymbolCircleDef:

CigiBaseVariableSizePckt CigiBasePacket CigiSymbolCircleDefV3_3 List of all members.

Public Types

 Line = 0
 Fill = 1
enum  DrawingStyleGrp { Line = 0, Fill = 1 }

Public Member Functions

 CigiBaseSymbolCircleDef (void)
virtual ~CigiBaseSymbolCircleDef (void)
 CigiBaseSymbolCircleDef (const CigiBaseSymbolCircleDef &BaseIn)
CigiBaseSymbolCircleDefoperator= (const CigiBaseSymbolCircleDef &BaseIn)
virtual int Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const =0
virtual int Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec)=0
virtual int GetTruePacketSize (CigiBaseVariableSizePckt &refPacket)
virtual int GetCnvt (CigiVersionID &CnvtVersion, CigiCnvtInfoType::Type &CnvtInfo)
int SetSymbolID (const Cigi_uint16 SymbolIDIn, bool bndchk=true)
Cigi_uint16 GetSymbolID (void) const
int SetDrawingStyle (const DrawingStyleGrp DrawingStyleIn, bool bndchk=true)
DrawingStyleGrp GetDrawingStyle (void) const
int SetStipplePattern (const Cigi_uint16 StipplePatternIn, bool bndchk=true)
Cigi_uint16 GetStipplePattern (void) const
int SetLineWidth (const float LineWidthIn, bool bndchk=true)
float GetLineWidth (void) const
int SetStipplePatternLen (const float StipplePatternLenIn, bool bndchk=true)
float GetStipplePatternLen (void) const
int GetCircleCount (void)
virtual CigiBaseCircleSymbolDataAddCircle (void)=0
virtual int RemoveCircle (int CircleIndex, bool bndchk=true)=0
CigiBaseCircleSymbolDataGetCircle (int CircleIndex, bool bndchk=true)
void ClearCircles (void)

Protected Attributes

Cigi_uint16 SymbolID
DrawingStyleGrp DrawingStyle
Cigi_uint16 StipplePattern
float LineWidth
float StipplePatternLen
std::vector< CigiBaseCircleSymbolData * > Circles

Friends

class CigiSymbolCircleDefV3_3

Detailed Description

The base class for all packets.

Definition at line 62 of file CigiBaseSymbolCircleDef.h.


Member Enumeration Documentation

enum CigiBaseSymbolCircleDef::DrawingStyleGrp

The enumeration for the CigiBaseSymbolCircleDef Datum type Group

Enumerator:
Line 
Fill 

Definition at line 75 of file CigiBaseSymbolCircleDef.h.

00076    {
00077       Line=0,
00078       Fill=1
00079    };


Constructor & Destructor Documentation

CigiBaseSymbolCircleDef::CigiBaseSymbolCircleDef ( void   ) 

General Constructor

Definition at line 55 of file CigiBaseSymbolCircleDef.cpp.

00056 {
00057 }

CigiBaseSymbolCircleDef::~CigiBaseSymbolCircleDef ( void   )  [virtual]

General Destructor

Definition at line 62 of file CigiBaseSymbolCircleDef.cpp.

References Circles.

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 }

CigiBaseSymbolCircleDef::CigiBaseSymbolCircleDef ( const CigiBaseSymbolCircleDef BaseIn  ) 

Copy Constructor

Definition at line 79 of file CigiBaseSymbolCircleDef.cpp.

References DrawingStyle, LineWidth, StipplePattern, StipplePatternLen, and SymbolID.

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 }


Member Function Documentation

virtual CigiBaseCircleSymbolData* CigiBaseSymbolCircleDef::AddCircle ( void   )  [pure virtual]

A pure virtual Create Circle function. This function is not implemented in this class. The implemented function will create a circle object and insert a pointer into the Circle Vector.

Returns:
The pointer to the new circle object. If the circle exceeds the maximum number of circles or the circle object cannot be created, this will return a NULL pointer.

Implemented in CigiSymbolCircleDefV3_3.

void CigiBaseSymbolCircleDef::ClearCircles ( void   ) 

Removes all the circles in this symbol.

Definition at line 236 of file CigiBaseSymbolCircleDef.cpp.

References Circles, and CigiBaseVariableSizePckt::VariableDataSize.

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 }

CigiBaseCircleSymbolData * CigiBaseSymbolCircleDef::GetCircle ( int  CircleIndex,
bool  bndchk = true 
)

Gets a pointer to a circle object.

Parameters:
CircleIndex - The index of the desired circle.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
The pointer to the desired circle object. If the circle does not exist, the return is a NULL pointer.

Definition at line 210 of file CigiBaseSymbolCircleDef.cpp.

References Circles.

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 }

int CigiBaseSymbolCircleDef::GetCircleCount ( void   ) 

Gets the StipplePatternLen with bound checking control

Returns:
Gets the number of circles contained in this symbol.

Definition at line 202 of file CigiBaseSymbolCircleDef.cpp.

References Circles.

00203 {
00204    return(Circles.size());
00205 }

int CigiBaseSymbolCircleDef::GetCnvt ( CigiVersionID CnvtVersion,
CigiCnvtInfoType::Type CnvtInfo 
) [virtual]

A virtual Conversion Information function. This function provides conversion information for this packet.

Parameters:
CnvtVersion - The CIGI version to which this packet is being converted.
CnvtInfo - The information needed for conversion
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBasePacket.

Definition at line 110 of file CigiBaseSymbolCircleDef.cpp.

References CIGI_SUCCESS, CIGI_SYMBOL_CIRCLE_DEFINITION_PACKET_ID_V3_3, CigiCnvtInfoType::CigiCnvtInfoStruct::CnvtPacketID, CigiVersionID::GetCombinedCigiVersion(), CigiCnvtInfoType::CigiCnvtInfoStruct::ProcID, CigiProcessType::ProcNone, and CigiProcessType::ProcStd.

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 }

DrawingStyleGrp CigiBaseSymbolCircleDef::GetDrawingStyle ( void   )  const [inline]

Gets the DrawingStyle with bound checking control

Returns:
DrawingStyle (Line, Fill)

Definition at line 200 of file CigiBaseSymbolCircleDef.h.

References DrawingStyle.

00200 { return(DrawingStyle); }

float CigiBaseSymbolCircleDef::GetLineWidth ( void   )  const [inline]

Gets the LineWidth with bound checking control

Returns:
LineWidth of this symbol in Symbol Surface units.

Definition at line 243 of file CigiBaseSymbolCircleDef.h.

References LineWidth.

00243 { return(LineWidth); }

Cigi_uint16 CigiBaseSymbolCircleDef::GetStipplePattern ( void   )  const [inline]

Gets the StipplePattern with bound checking control

Returns:
The StipplePattern to be used with this symbol.

Definition at line 223 of file CigiBaseSymbolCircleDef.h.

References StipplePattern.

00223 { return(StipplePattern); }

float CigiBaseSymbolCircleDef::GetStipplePatternLen ( void   )  const [inline]

Gets the StipplePatternLen with bound checking control

Returns:
The length in symbol surface units of the line that a single copy of the stipple pattern occupies. (StipplePatternLen)

Definition at line 265 of file CigiBaseSymbolCircleDef.h.

References StipplePatternLen.

00265 { return(StipplePatternLen); }

Cigi_uint16 CigiBaseSymbolCircleDef::GetSymbolID ( void   )  const [inline]

Gets the SymbolID with bound checking control

Returns:
SymbolID

Definition at line 181 of file CigiBaseSymbolCircleDef.h.

References SymbolID.

00181 { return(SymbolID); }

virtual int CigiBaseSymbolCircleDef::GetTruePacketSize ( CigiBaseVariableSizePckt refPacket  )  [inline, virtual]

A pure virtual function to determine the size that the packet will take up when packed. This function is not implemented in this class.

Parameters:
refPacket - A pointer to the current pack point.
Returns:
The size that the packet will take up when packed

Implements CigiBaseVariableSizePckt.

Definition at line 140 of file CigiBaseSymbolCircleDef.h.

References CigiBaseVariableSizePckt::GetVariableDataSize(), and CigiBasePacket::PacketSize.

00141    { return(PacketSize + refPacket.GetVariableDataSize()); }

CigiBaseSymbolCircleDef & CigiBaseSymbolCircleDef::operator= ( const CigiBaseSymbolCircleDef BaseIn  ) 

Assignment operator

Definition at line 93 of file CigiBaseSymbolCircleDef.cpp.

References DrawingStyle, LineWidth, StipplePattern, StipplePatternLen, and SymbolID.

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 }

virtual int CigiBaseSymbolCircleDef::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [pure virtual]

A pure virtual Pack function. This function is not implemented in this class.

Parameters:
Base - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket)
Buff - A pointer to the current pack point.
Spec - A pointer to special data.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseVariableSizePckt.

Implemented in CigiSymbolCircleDefV3_3.

virtual int CigiBaseSymbolCircleDef::RemoveCircle ( int  CircleIndex,
bool  bndchk = true 
) [pure virtual]

A pure virtual Remove Circle function. This function is not implemented in this class. The implemented function will remove a Circle object from the Circle Vector.

Parameters:
CircleIndex - The index of the circle to delete from this symbol.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implemented in CigiSymbolCircleDefV3_3.

int CigiBaseSymbolCircleDef::SetDrawingStyle ( const DrawingStyleGrp  DrawingStyleIn,
bool  bndchk = true 
)

Sets the DrawingStyle with bound checking control

Parameters:
DrawingStyleIn - Specifies the drawing style for this symbol (Line, Fill)
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 136 of file CigiBaseSymbolCircleDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and DrawingStyle.

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 }

int CigiBaseSymbolCircleDef::SetLineWidth ( const float  LineWidthIn,
bool  bndchk = true 
)

Sets the LineWidth with bound checking control

Parameters:
LineWidthIn - Specifies the line width for this symbol in Symbol Surface units.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 158 of file CigiBaseSymbolCircleDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and LineWidth.

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 }

int CigiBaseSymbolCircleDef::SetStipplePattern ( const Cigi_uint16  StipplePatternIn,
bool  bndchk = true 
) [inline]

Sets the StipplePattern with bound checking control

Parameters:
StipplePatternIn - Specifies the stipple pattern to be used with this symbol.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 213 of file CigiBaseSymbolCircleDef.h.

References CIGI_SUCCESS, and StipplePattern.

00214    {
00215       StipplePattern = StipplePatternIn;
00216       return(CIGI_SUCCESS);
00217    }

int CigiBaseSymbolCircleDef::SetStipplePatternLen ( const float  StipplePatternLenIn,
bool  bndchk = true 
)

Sets the StipplePatternLen with bound checking control

Parameters:
StipplePatternLenIn - Specifies the length in symbol surface units of the line that a single copy of the stipple pattern occupies.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 180 of file CigiBaseSymbolCircleDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and StipplePatternLen.

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 }

int CigiBaseSymbolCircleDef::SetSymbolID ( const Cigi_uint16  SymbolIDIn,
bool  bndchk = true 
) [inline]

Sets the SymbolID with bound checking control

Parameters:
SymbolIDIn - Specifies the ID number for this symbol
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 171 of file CigiBaseSymbolCircleDef.h.

References CIGI_SUCCESS, and SymbolID.

00172    {
00173       SymbolID = SymbolIDIn;
00174       return(CIGI_SUCCESS);
00175    }

virtual int CigiBaseSymbolCircleDef::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [pure virtual]

A pure virtual Unpack function. This function is not implemented in this class.

Parameters:
Buff - A pointer to the current pack point.
Swap - N/A for V1 & V2
Spec - A pointer to special data.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseVariableSizePckt.

Implemented in CigiSymbolCircleDefV3_3.


Friends And Related Function Documentation

friend class CigiSymbolCircleDefV3_3 [friend]

Definition at line 66 of file CigiBaseSymbolCircleDef.h.


Member Data Documentation

std::vector<CigiBaseCircleSymbolData *> CigiBaseSymbolCircleDef::Circles [protected]

Circles
A dynamic array of circles in this symbol

Definition at line 358 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiSymbolCircleDefV3_3::AddCircle(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), ClearCircles(), GetCircle(), GetCircleCount(), CigiSymbolCircleDefV3_3::operator=(), CigiSymbolCircleDefV3_3::Pack(), CigiSymbolCircleDefV3_3::RemoveCircle(), CigiSymbolCircleDefV3_3::Unpack(), and ~CigiBaseSymbolCircleDef().

DrawingStyleGrp CigiBaseSymbolCircleDef::DrawingStyle [protected]

DrawingStyle
The drawing style of this symbol.
Line
Fill

Definition at line 333 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiBaseSymbolCircleDef(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), GetDrawingStyle(), CigiSymbolCircleDefV3_3::operator=(), operator=(), CigiSymbolCircleDefV3_3::Pack(), SetDrawingStyle(), and CigiSymbolCircleDefV3_3::Unpack().

float CigiBaseSymbolCircleDef::LineWidth [protected]

LineWidth
The width of the line used in this symbol in symbol surface units.

Definition at line 345 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiBaseSymbolCircleDef(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), GetLineWidth(), CigiSymbolCircleDefV3_3::operator=(), operator=(), CigiSymbolCircleDefV3_3::Pack(), SetLineWidth(), and CigiSymbolCircleDefV3_3::Unpack().

Cigi_uint16 CigiBaseSymbolCircleDef::StipplePattern [protected]

StipplePattern
The binary Stipple Pattern to use on this symbol.

Definition at line 339 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiBaseSymbolCircleDef(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), GetStipplePattern(), CigiSymbolCircleDefV3_3::operator=(), operator=(), CigiSymbolCircleDefV3_3::Pack(), SetStipplePattern(), and CigiSymbolCircleDefV3_3::Unpack().

float CigiBaseSymbolCircleDef::StipplePatternLen [protected]

StipplePatternLen
The length in symbol surface units along the line that a single copy of the stipple pattern will occupy.

Definition at line 352 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiBaseSymbolCircleDef(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), GetStipplePatternLen(), CigiSymbolCircleDefV3_3::operator=(), operator=(), CigiSymbolCircleDefV3_3::Pack(), SetStipplePatternLen(), and CigiSymbolCircleDefV3_3::Unpack().

Cigi_uint16 CigiBaseSymbolCircleDef::SymbolID [protected]

SymbolID
The ID number of this symbol.

Definition at line 325 of file CigiBaseSymbolCircleDef.h.

Referenced by CigiBaseSymbolCircleDef(), CigiSymbolCircleDefV3_3::CigiSymbolCircleDefV3_3(), GetSymbolID(), CigiSymbolCircleDefV3_3::operator=(), operator=(), CigiSymbolCircleDefV3_3::Pack(), SetSymbolID(), and CigiSymbolCircleDefV3_3::Unpack().


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:06 2009 for CCL by  doxygen 1.4.7