CigiBaseSymbolTextDef Class Reference

#include <CigiBaseSymbolTextDef.h>

Inheritance diagram for CigiBaseSymbolTextDef:

CigiBaseVariableSizePckt CigiBasePacket CigiSymbolTextDefV3_3 List of all members.

Public Types

 TopLeft = 0
 TopCenter = 1
 TopRight = 2
 CenterLeft = 3
 Center = 4
 CenterRight = 5
 BottomLeft = 6
 BottomCenter = 7
 BottomRight = 8
 LeftToRight = 0
 TopToBottom = 1
 RightToLeft = 2
 BottomToTop = 3
enum  AlignmentGrp {
  TopLeft = 0, TopCenter = 1, TopRight = 2, CenterLeft = 3,
  Center = 4, CenterRight = 5, BottomLeft = 6, BottomCenter = 7,
  BottomRight = 8
}
enum  OrientationGrp { LeftToRight = 0, TopToBottom = 1, RightToLeft = 2, BottomToTop = 3 }

Public Member Functions

 CigiBaseSymbolTextDef (void)
virtual ~CigiBaseSymbolTextDef (void)
 CigiBaseSymbolTextDef (const CigiBaseSymbolTextDef &BaseIn)
CigiBaseSymbolTextDefoperator= (const CigiBaseSymbolTextDef &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 SetAlignment (const AlignmentGrp AlignmentIn, bool bndchk=true)
AlignmentGrp GetAlignment (void) const
int SetOrientation (const OrientationGrp OrientationIn, bool bndchk=true)
OrientationGrp GetOrientation (void) const
int SetFontID (const Cigi_uint8 FontIDIn, bool bndchk=true)
Cigi_uint8 GetFontID (void) const
int SetFontSize (const float FontSizeIn, bool bndchk=true)
float GetFontSize (void) const
int SetText (const std::string &TextIn, bool bndchk=true)
int GetTextSize (void) const
const std::string & GetText (void)

Protected Attributes

Cigi_uint16 SymbolID
AlignmentGrp Alignment
OrientationGrp Orientation
Cigi_uint8 FontID
float FontSize
std::string Text

Static Protected Attributes

static const int MaxCharCnt = 235

Friends

class CigiSymbolTextDefV3_3

Detailed Description

The base class for all packets.

Definition at line 61 of file CigiBaseSymbolTextDef.h.


Member Enumeration Documentation

enum CigiBaseSymbolTextDef::AlignmentGrp

The enumeration for the CigiBaseSymbolTextDef Datum type Group

Enumerator:
TopLeft 
TopCenter 
TopRight 
CenterLeft 
Center 
CenterRight 
BottomLeft 
BottomCenter 
BottomRight 

Definition at line 74 of file CigiBaseSymbolTextDef.h.

00075    {
00076       TopLeft=0,
00077       TopCenter=1,
00078       TopRight=2,
00079       CenterLeft=3,
00080       Center=4,
00081       CenterRight=5,
00082       BottomLeft=6,
00083       BottomCenter=7,
00084       BottomRight=8,
00085    };

enum CigiBaseSymbolTextDef::OrientationGrp

The enumeration for the CigiBaseSymbolTextDef Datum type Group

Enumerator:
LeftToRight 
TopToBottom 
RightToLeft 
BottomToTop 

Definition at line 91 of file CigiBaseSymbolTextDef.h.

00092    {
00093       LeftToRight=0,
00094       TopToBottom=1,
00095       RightToLeft=2,
00096       BottomToTop=3,
00097    };


Constructor & Destructor Documentation

CigiBaseSymbolTextDef::CigiBaseSymbolTextDef ( void   ) 

General Constructor

Definition at line 55 of file CigiBaseSymbolTextDef.cpp.

00056 {
00057 }

CigiBaseSymbolTextDef::~CigiBaseSymbolTextDef ( void   )  [virtual]

General Destructor

Definition at line 62 of file CigiBaseSymbolTextDef.cpp.

00063 {
00064 }

CigiBaseSymbolTextDef::CigiBaseSymbolTextDef ( const CigiBaseSymbolTextDef BaseIn  ) 

Copy Constructor

Definition at line 70 of file CigiBaseSymbolTextDef.cpp.

References Alignment, FontSize, Orientation, SymbolID, Text, and CigiBaseVariableSizePckt::VariableDataSize.

00071 {
00072    SymbolID = BaseIn.SymbolID;
00073    Alignment = BaseIn.Alignment;
00074    Orientation = BaseIn.Orientation;
00075    FontSize = BaseIn.FontSize;
00076    VariableDataSize = BaseIn.VariableDataSize;
00077    Text = BaseIn.Text;
00078 }


Member Function Documentation

AlignmentGrp CigiBaseSymbolTextDef::GetAlignment ( void   )  const [inline]

Gets the Alignment with bound checking control

Returns:
The text alignment to be used for this text. (TopLeft, TopCenter, TopRight, CenterLeft, Center, CenterRight, BottomLeft, BottomCenter, BottomRight)

Definition at line 222 of file CigiBaseSymbolTextDef.h.

References Alignment.

00222 { return(Alignment); }

int CigiBaseSymbolTextDef::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 including the type of conversion and the packet id.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Reimplemented from CigiBasePacket.

Definition at line 99 of file CigiBaseSymbolTextDef.cpp.

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

00101 {
00102    if(CnvtVersion.GetCombinedCigiVersion() < 0x303)
00103    {
00104       CnvtInfo.ProcID = CigiProcessType::ProcNone;
00105       CnvtInfo.CnvtPacketID = 0;
00106    }
00107    else
00108    {
00109       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00110       CnvtInfo.CnvtPacketID = CIGI_SYMBOL_TEXT_DEFINITION_PACKET_ID_V3_3;
00111    }
00112 
00113    return(CIGI_SUCCESS);
00114 }

Cigi_uint8 CigiBaseSymbolTextDef::GetFontID ( void   )  const [inline]

Gets the FontID with bound checking control

Returns:
The ID of the font to be used for this text.

Definition at line 266 of file CigiBaseSymbolTextDef.h.

References FontID.

00266 { return(FontID); }

float CigiBaseSymbolTextDef::GetFontSize ( void   )  const [inline]

Gets the FontSize with bound checking control

Returns:
The size of the font to be used in

Definition at line 285 of file CigiBaseSymbolTextDef.h.

References FontSize.

00285 { return(FontSize); }

OrientationGrp CigiBaseSymbolTextDef::GetOrientation ( void   )  const [inline]

Gets the Orientation with bound checking control

Returns:
The text orientation to be used for this text. (LeftToRight, TopToBottom, RightToLeft, BottomToTop)

Definition at line 243 of file CigiBaseSymbolTextDef.h.

References Orientation.

00243 { return(Orientation); }

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

Gets the SymbolID with bound checking control

Returns:
The ID of this Symbol.

Definition at line 199 of file CigiBaseSymbolTextDef.h.

References SymbolID.

00199 { return(SymbolID); }

const std::string& CigiBaseSymbolTextDef::GetText ( void   )  [inline]

Gets the Text

Returns:
The current symbology text

Definition at line 308 of file CigiBaseSymbolTextDef.h.

References Text.

00308 { return(Text); }

int CigiBaseSymbolTextDef::GetTextSize ( void   )  const [inline]

Gets the TextSize with bound checking control

Returns:
The current size of the text.

Definition at line 303 of file CigiBaseSymbolTextDef.h.

References CigiBaseVariableSizePckt::VariableDataSize.

00303 { return(VariableDataSize); }

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

A virtual function to determine the size that the packet will take up when packed.

Parameters:
refPacket - A pointer to the packet being checked.
Returns:
The size that the packet will take up when packed

Implements CigiBaseVariableSizePckt.

Definition at line 157 of file CigiBaseSymbolTextDef.h.

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

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

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

Assignment operator

Definition at line 83 of file CigiBaseSymbolTextDef.cpp.

References Alignment, FontSize, Orientation, SymbolID, Text, and CigiBaseVariableSizePckt::VariableDataSize.

00084 {
00085    SymbolID = BaseIn.SymbolID;
00086    Alignment = BaseIn.Alignment;
00087    Orientation = BaseIn.Orientation;
00088    FontSize = BaseIn.FontSize;
00089    VariableDataSize = BaseIn.VariableDataSize;
00090    Text = BaseIn.Text;
00091 
00092    return(*this);
00093 }

virtual int CigiBaseSymbolTextDef::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 CigiSymbolTextDefV3_3.

int CigiBaseSymbolTextDef::SetAlignment ( const AlignmentGrp  AlignmentIn,
bool  bndchk = true 
)

Sets the Alignment with bound checking control

Parameters:
AlignmentIn - Specifies the type of text alignment to be used for this text. (TopLeft, TopCenter, TopRight, CenterLeft, Center, CenterRight, BottomLeft, BottomCenter, BottomRight)
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 125 of file CigiBaseSymbolTextDef.cpp.

References Alignment, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00126 {
00127 
00128 #ifndef CIGI_NO_BND_CHK
00129    if(bndchk && ((AlignmentIn < 0)||(AlignmentIn > 8)))
00130    {
00131 #ifndef CIGI_NO_EXCEPT
00132       throw CigiValueOutOfRangeException("Alignment", (int)AlignmentIn,0,8);
00133 #endif
00134       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00135    }
00136 #endif
00137 
00138    Alignment = AlignmentIn;
00139 
00140    return(CIGI_SUCCESS);
00141 
00142 }

int CigiBaseSymbolTextDef::SetFontID ( const Cigi_uint8  FontIDIn,
bool  bndchk = true 
) [inline]

Sets the FontID with bound checking control

Parameters:
FontIDIn - Specifies the font (by ID number) to be used for this text.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 256 of file CigiBaseSymbolTextDef.h.

References CIGI_SUCCESS, and FontID.

00257    {
00258       FontID = FontIDIn;
00259       return(CIGI_SUCCESS);
00260    }

int CigiBaseSymbolTextDef::SetFontSize ( const float  FontSizeIn,
bool  bndchk = true 
)

Sets the FontSize with bound checking control

Parameters:
FontSizeIn - Specifies the size of the font in UV units to be used for this text.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 169 of file CigiBaseSymbolTextDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and FontSize.

00170 {
00171 
00172 #ifndef CIGI_NO_BND_CHK
00173    if(bndchk && (FontSize < 0.0))
00174    {
00175 #ifndef CIGI_NO_EXCEPT
00176       throw CigiValueOutOfRangeException("FontSize", (double)FontSizeIn,">=",0.0);
00177 #endif
00178       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00179    }
00180 #endif
00181 
00182    FontSize = FontSizeIn;
00183 
00184    return(CIGI_SUCCESS);
00185 
00186 }

int CigiBaseSymbolTextDef::SetOrientation ( const OrientationGrp  OrientationIn,
bool  bndchk = true 
)

Sets the Orientation with bound checking control

Parameters:
OrientationIn - Specifies the text orientation to be used for this text. (LeftToRight, TopToBottom, RightToLeft, BottomToTop)
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 147 of file CigiBaseSymbolTextDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and Orientation.

00148 {
00149 
00150 #ifndef CIGI_NO_BND_CHK
00151    if(bndchk && ((OrientationIn < 0)||(OrientationIn > 3)))
00152    {
00153 #ifndef CIGI_NO_EXCEPT
00154       throw CigiValueOutOfRangeException("Orientation", (int)OrientationIn,0,3);
00155 #endif
00156       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00157    }
00158 #endif
00159 
00160    Orientation = OrientationIn;
00161 
00162    return(CIGI_SUCCESS);
00163 
00164 }

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

Sets the SymbolID with bound checking control

Parameters:
SymbolIDIn - The user assigned Symbol ID
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 189 of file CigiBaseSymbolTextDef.h.

References CIGI_SUCCESS, and SymbolID.

00190    {
00191       SymbolID = SymbolIDIn;
00192       return(CIGI_SUCCESS);
00193    }

int CigiBaseSymbolTextDef::SetText ( const std::string &  TextIn,
bool  bndchk = true 
)

Sets the Text with bound checking control

Parameters:
TextIn - A standard string of text.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 191 of file CigiBaseSymbolTextDef.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, MaxCharCnt, Text, and CigiBaseVariableSizePckt::VariableDataSize.

Referenced by CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3().

00192 {
00193 
00194    int TxtSz = TextIn.size();
00195 
00196 #ifndef CIGI_NO_BND_CHK
00197    if(bndchk && ((TxtSz < 0)||(TxtSz > MaxCharCnt)))
00198    {
00199 #ifndef CIGI_NO_EXCEPT
00200       throw CigiValueOutOfRangeException("TextSize", (int)TxtSz,1,MaxCharCnt);
00201 #endif
00202       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00203    }
00204 #endif
00205 
00206 
00207    Text = TextIn;
00208 
00209    if(TxtSz > MaxCharCnt)
00210    {
00211       Text.resize(MaxCharCnt,0);
00212       TxtSz = MaxCharCnt;
00213    }
00214 
00215    int Term = 0;
00216 
00217    if(TxtSz < 4)
00218       Term = 4 - TxtSz;
00219    else
00220       Term = 8 - ((TxtSz - 4) % 8);
00221 
00222    VariableDataSize = TxtSz + Term;
00223 
00224    return(CIGI_SUCCESS);
00225 
00226 }

virtual int CigiBaseSymbolTextDef::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 CigiSymbolTextDefV3_3.


Friends And Related Function Documentation

friend class CigiSymbolTextDefV3_3 [friend]

Definition at line 65 of file CigiBaseSymbolTextDef.h.


Member Data Documentation

AlignmentGrp CigiBaseSymbolTextDef::Alignment [protected]

SymbolState
The alignment of this symbol.
This is the position of the anchor or reference point.
TopLeft
TopCenter
TopRight
CenterLeft
Center
CenterRight
BottomLeft
BottomCenter
BottomRight

Definition at line 336 of file CigiBaseSymbolTextDef.h.

Referenced by CigiBaseSymbolTextDef(), CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetAlignment(), operator=(), CigiSymbolTextDefV3_3::Pack(), SetAlignment(), and CigiSymbolTextDefV3_3::Unpack().

Cigi_uint8 CigiBaseSymbolTextDef::FontID [protected]

FontID
The font id number.

Definition at line 352 of file CigiBaseSymbolTextDef.h.

Referenced by CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetFontID(), CigiSymbolTextDefV3_3::Pack(), SetFontID(), and CigiSymbolTextDefV3_3::Unpack().

float CigiBaseSymbolTextDef::FontSize [protected]

FontSize
The size of the font in UV coordinates

Definition at line 358 of file CigiBaseSymbolTextDef.h.

Referenced by CigiBaseSymbolTextDef(), CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetFontSize(), operator=(), CigiSymbolTextDefV3_3::Pack(), SetFontSize(), and CigiSymbolTextDefV3_3::Unpack().

const int CigiBaseSymbolTextDef::MaxCharCnt = 235 [static, protected]

MaxCharCnt
The maximum number of bytes not including NULLs

Definition at line 370 of file CigiBaseSymbolTextDef.h.

Referenced by SetText().

OrientationGrp CigiBaseSymbolTextDef::Orientation [protected]

Orientation
The orientation of the text.
LeftToRight
TopToBottom
RightToLeft
BottomToTop

Definition at line 346 of file CigiBaseSymbolTextDef.h.

Referenced by CigiBaseSymbolTextDef(), CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetOrientation(), operator=(), CigiSymbolTextDefV3_3::Pack(), SetOrientation(), and CigiSymbolTextDefV3_3::Unpack().

Cigi_uint16 CigiBaseSymbolTextDef::SymbolID [protected]

SymbolID
The Id for this symbol

Definition at line 320 of file CigiBaseSymbolTextDef.h.

Referenced by CigiBaseSymbolTextDef(), CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetSymbolID(), operator=(), CigiSymbolTextDefV3_3::Pack(), SetSymbolID(), and CigiSymbolTextDefV3_3::Unpack().

std::string CigiBaseSymbolTextDef::Text [protected]

Text
The symbol text

Definition at line 364 of file CigiBaseSymbolTextDef.h.

Referenced by CigiBaseSymbolTextDef(), CigiSymbolTextDefV3_3::CigiSymbolTextDefV3_3(), GetText(), operator=(), CigiSymbolTextDefV3_3::Pack(), SetText(), and CigiSymbolTextDefV3_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