CigiBaseSymbolLineDef Class Reference

#include <CigiBaseSymbolLineDef.h>

Inheritance diagram for CigiBaseSymbolLineDef:

CigiBaseVariableSizePckt CigiBasePacket CigiSymbolLineDefV3_3 List of all members.

Public Types

 Points = 0
 Lines = 1
 LineStrip = 2
 LineLoop = 3
 Triangles = 4
 TriangleStrip = 5
 TriangleFan = 6
enum  PrimitiveGrp {
  Points = 0, Lines = 1, LineStrip = 2, LineLoop = 3,
  Triangles = 4, TriangleStrip = 5, TriangleFan = 6
}

Public Member Functions

 CigiBaseSymbolLineDef (void)
virtual ~CigiBaseSymbolLineDef (void)
 CigiBaseSymbolLineDef (const CigiBaseSymbolLineDef &BaseIn)
CigiBaseSymbolLineDefoperator= (const CigiBaseSymbolLineDef &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 SetPrimitive (const PrimitiveGrp PrimitiveIn, bool bndchk=true)
PrimitiveGrp GetPrimitive (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 GetVertexCount (void)
virtual CigiBaseVertexSymbolDataAddVertex (void)=0
virtual int RemoveVertex (int VertexIndex, bool bndchk=true)=0
CigiBaseVertexSymbolDataGetVertex (int VertexIndex, bool bndchk=true)
void ClearVertices (void)

Protected Attributes

Cigi_uint16 SymbolID
PrimitiveGrp Primitive
Cigi_uint16 StipplePattern
float LineWidth
float StipplePatternLen
std::vector< CigiBaseVertexSymbolData * > Vertices

Friends

class CigiSymbolLineDefV3_3

Detailed Description

The base class for all packets.

Definition at line 62 of file CigiBaseSymbolLineDef.h.


Member Enumeration Documentation

enum CigiBaseSymbolLineDef::PrimitiveGrp

The enumeration for the CigiBaseSymbolLineDef Datum type Group

Enumerator:
Points 
Lines 
LineStrip 
LineLoop 
Triangles 
TriangleStrip 
TriangleFan 

Definition at line 75 of file CigiBaseSymbolLineDef.h.

00076    {
00077       Points=0,
00078       Lines=1,
00079       LineStrip=2,
00080       LineLoop=3,
00081       Triangles=4,
00082       TriangleStrip=5,
00083       TriangleFan=6
00084    };


Constructor & Destructor Documentation

CigiBaseSymbolLineDef::CigiBaseSymbolLineDef ( void   ) 

General Constructor

Definition at line 55 of file CigiBaseSymbolLineDef.cpp.

00056 {
00057 }

CigiBaseSymbolLineDef::~CigiBaseSymbolLineDef ( void   )  [virtual]

General Destructor

Definition at line 62 of file CigiBaseSymbolLineDef.cpp.

References Vertices.

00063 {
00064    CigiBaseVertexSymbolData *pVtx;
00065    vector<CigiBaseVertexSymbolData *>::iterator iVtx;
00066    for(iVtx=Vertices.begin();iVtx!=Vertices.end();iVtx++)
00067    {
00068       pVtx = *iVtx;
00069       if(pVtx != NULL)
00070          delete pVtx;
00071    }
00072    Vertices.clear();
00073 }

CigiBaseSymbolLineDef::CigiBaseSymbolLineDef ( const CigiBaseSymbolLineDef BaseIn  ) 

Copy Constructor

Definition at line 79 of file CigiBaseSymbolLineDef.cpp.

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

00080 {
00081    SymbolID = BaseIn.SymbolID;
00082    Primitive = BaseIn.Primitive;
00083    StipplePattern = BaseIn.StipplePattern;
00084    LineWidth = BaseIn.LineWidth;
00085    StipplePatternLen = BaseIn.StipplePatternLen;
00086 
00087    // The Vertex Vector should be copied in the specific version class
00088 }


Member Function Documentation

virtual CigiBaseVertexSymbolData* CigiBaseSymbolLineDef::AddVertex ( void   )  [pure virtual]

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

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

Implemented in CigiSymbolLineDefV3_3.

void CigiBaseSymbolLineDef::ClearVertices ( void   ) 

Removes all vertices from the symbol.

Definition at line 236 of file CigiBaseSymbolLineDef.cpp.

References CigiBaseVariableSizePckt::VariableDataSize, and Vertices.

00237 {
00238    CigiBaseVertexSymbolData *pVtx;
00239    vector<CigiBaseVertexSymbolData *>::iterator iVtx;
00240    for(iVtx=Vertices.begin();iVtx!=Vertices.end();iVtx++)
00241    {
00242       pVtx = *iVtx;
00243       if(pVtx != NULL)
00244          delete pVtx;
00245    }
00246    Vertices.clear();
00247    VariableDataSize = 0;
00248 }

int CigiBaseSymbolLineDef::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 CigiBaseSymbolLineDef.cpp.

References CIGI_SUCCESS, CIGI_SYMBOL_LINE_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_LINE_DEFINITION_PACKET_ID_V3_3;
00122    }
00123 
00124    return(CIGI_SUCCESS);
00125 }

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

Gets the LineWidth with bound checking control

Returns:
The width in symbol surface units of the lines.

Definition at line 251 of file CigiBaseSymbolLineDef.h.

References LineWidth.

00251 { return(LineWidth); }

PrimitiveGrp CigiBaseSymbolLineDef::GetPrimitive ( void   )  const [inline]

Gets the Primitive with bound checking control

Returns:
The Primitive used in this symbol (Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan)

Definition at line 208 of file CigiBaseSymbolLineDef.h.

References Primitive.

00208 { return(Primitive); }

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

Gets the StipplePattern with bound checking control

Returns:
The binary Stipple Pattern to be applied to the lines.

Definition at line 231 of file CigiBaseSymbolLineDef.h.

References StipplePattern.

00231 { return(StipplePattern); }

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

Gets the StipplePatternLen with bound checking control

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

Definition at line 272 of file CigiBaseSymbolLineDef.h.

References StipplePatternLen.

00272 { return(StipplePatternLen); }

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

Gets the SymbolID with bound checking control

Returns:
The ID number of this Symbol.

Definition at line 186 of file CigiBaseSymbolLineDef.h.

References SymbolID.

00186 { return(SymbolID); }

virtual int CigiBaseSymbolLineDef::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 145 of file CigiBaseSymbolLineDef.h.

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

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

CigiBaseVertexSymbolData * CigiBaseSymbolLineDef::GetVertex ( int  VertexIndex,
bool  bndchk = true 
)

Gets a pointer to a Vertex object.

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

Definition at line 210 of file CigiBaseSymbolLineDef.cpp.

References Vertices.

00211 {
00212    CigiBaseVertexSymbolData * pVtx = NULL;
00213 
00214    if((VertexIndex >= 0) && ((Cigi_uint8)VertexIndex < Vertices.size()))
00215    {
00216       pVtx = Vertices[VertexIndex];
00217    }
00218    else
00219    {
00220 #ifndef CIGI_NO_BND_CHK
00221       if(bndchk)
00222       {
00223 #ifndef CIGI_NO_EXCEPT
00224          throw CigiValueOutOfRangeException("VertexIndex", (int)VertexIndex,0,Vertices.size());
00225 #endif
00226       }
00227 #endif
00228    }
00229 
00230    return(pVtx);
00231 }

int CigiBaseSymbolLineDef::GetVertexCount ( void   ) 

Gets the number of vertices contained in this symbol with bound checking control.

Returns:
The vertex count.

Definition at line 202 of file CigiBaseSymbolLineDef.cpp.

References Vertices.

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

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

Assignment operator

Definition at line 93 of file CigiBaseSymbolLineDef.cpp.

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

00094 {
00095    SymbolID = BaseIn.SymbolID;
00096    Primitive = BaseIn.Primitive;
00097    StipplePattern = BaseIn.StipplePattern;
00098    LineWidth = BaseIn.LineWidth;
00099    StipplePatternLen = BaseIn.StipplePatternLen;
00100 
00101    // The Vertex Vector should be copied in the specific version class
00102 
00103    return(*this);
00104 }

virtual int CigiBaseSymbolLineDef::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 CigiSymbolLineDefV3_3.

virtual int CigiBaseSymbolLineDef::RemoveVertex ( int  VertexIndex,
bool  bndchk = true 
) [pure virtual]

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

Parameters:
VertexIndex - The index of the vertex to be removed.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implemented in CigiSymbolLineDefV3_3.

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

Sets the LineWidth with bound checking control

Parameters:
LineWidthIn - The width in symbol surface units of the lines.
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 CigiBaseSymbolLineDef.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 CigiBaseSymbolLineDef::SetPrimitive ( const PrimitiveGrp  PrimitiveIn,
bool  bndchk = true 
)

Sets the Primitive with bound checking control

Parameters:
PrimitiveIn - Specifies the primatives used in this symbol. (Points, Lines, LineStrip, LineLoop, Triangles, TriangleStrip, TriangleFan)
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 CigiBaseSymbolLineDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and Primitive.

00137 {
00138 
00139 #ifndef CIGI_NO_BND_CHK
00140    if(bndchk && ((PrimitiveIn < 0)||(PrimitiveIn > 6)))
00141    {
00142 #ifndef CIGI_NO_EXCEPT
00143       throw CigiValueOutOfRangeException("Primitive", (int)PrimitiveIn,0,6);
00144 #endif
00145       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00146    }
00147 #endif
00148 
00149    Primitive = PrimitiveIn;
00150 
00151    return(CIGI_SUCCESS);
00152 
00153 }

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

Sets the StipplePattern with bound checking control

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

Definition at line 221 of file CigiBaseSymbolLineDef.h.

References CIGI_SUCCESS, and StipplePattern.

00222    {
00223       StipplePattern = StipplePatternIn;
00224       return(CIGI_SUCCESS);
00225    }

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

Sets the StipplePatternLen with bound checking control

Parameters:
StipplePatternLenIn - Specifies the length in symbol surface units that a single copy of the stipple pattern occupies in a line.
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 CigiBaseSymbolLineDef.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 CigiBaseSymbolLineDef::SetSymbolID ( const Cigi_uint16  SymbolIDIn,
bool  bndchk = true 
) [inline]

Sets the SymbolID with bound checking control

Parameters:
SymbolIDIn - The ID number of 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 176 of file CigiBaseSymbolLineDef.h.

References CIGI_SUCCESS, and SymbolID.

00177    {
00178       SymbolID = SymbolIDIn;
00179       return(CIGI_SUCCESS);
00180    }

virtual int CigiBaseSymbolLineDef::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 CigiSymbolLineDefV3_3.


Friends And Related Function Documentation

friend class CigiSymbolLineDefV3_3 [friend]

Definition at line 66 of file CigiBaseSymbolLineDef.h.


Member Data Documentation

float CigiBaseSymbolLineDef::LineWidth [protected]

LineWidth
The width of the lines in symbol surface units

Definition at line 357 of file CigiBaseSymbolLineDef.h.

Referenced by CigiBaseSymbolLineDef(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), GetLineWidth(), CigiSymbolLineDefV3_3::operator=(), operator=(), CigiSymbolLineDefV3_3::Pack(), SetLineWidth(), and CigiSymbolLineDefV3_3::Unpack().

PrimitiveGrp CigiBaseSymbolLineDef::Primitive [protected]

Primitive
The drawing primitive used in this symbol.
Points
Lines
LineStrip
LineLoop
Triangles
TriangleStrip
TriangleFan

Definition at line 345 of file CigiBaseSymbolLineDef.h.

Referenced by CigiBaseSymbolLineDef(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), GetPrimitive(), CigiSymbolLineDefV3_3::operator=(), operator=(), CigiSymbolLineDefV3_3::Pack(), SetPrimitive(), and CigiSymbolLineDefV3_3::Unpack().

Cigi_uint16 CigiBaseSymbolLineDef::StipplePattern [protected]

StipplePattern
The binary stipple pattern to be applied to the lines

Definition at line 351 of file CigiBaseSymbolLineDef.h.

Referenced by CigiBaseSymbolLineDef(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), GetStipplePattern(), CigiSymbolLineDefV3_3::operator=(), operator=(), CigiSymbolLineDefV3_3::Pack(), SetStipplePattern(), and CigiSymbolLineDefV3_3::Unpack().

float CigiBaseSymbolLineDef::StipplePatternLen [protected]

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

Definition at line 364 of file CigiBaseSymbolLineDef.h.

Referenced by CigiBaseSymbolLineDef(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), GetStipplePatternLen(), CigiSymbolLineDefV3_3::operator=(), operator=(), CigiSymbolLineDefV3_3::Pack(), SetStipplePatternLen(), and CigiSymbolLineDefV3_3::Unpack().

Cigi_uint16 CigiBaseSymbolLineDef::SymbolID [protected]

SymbolID
The ID number of the symbol.

Definition at line 332 of file CigiBaseSymbolLineDef.h.

Referenced by CigiBaseSymbolLineDef(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), GetSymbolID(), CigiSymbolLineDefV3_3::operator=(), operator=(), CigiSymbolLineDefV3_3::Pack(), SetSymbolID(), and CigiSymbolLineDefV3_3::Unpack().

std::vector<CigiBaseVertexSymbolData *> CigiBaseSymbolLineDef::Vertices [protected]

Vertices
A dynamic array of vertices.

Definition at line 370 of file CigiBaseSymbolLineDef.h.

Referenced by CigiSymbolLineDefV3_3::AddVertex(), CigiSymbolLineDefV3_3::CigiSymbolLineDefV3_3(), ClearVertices(), GetVertex(), GetVertexCount(), CigiSymbolLineDefV3_3::operator=(), CigiSymbolLineDefV3_3::Pack(), CigiSymbolLineDefV3_3::RemoveVertex(), CigiSymbolLineDefV3_3::Unpack(), and ~CigiBaseSymbolLineDef().


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