class CBarcode
{
public:
CBarcode();
CBarcode(ZcGePoint3d& basePoint,CString strBarcode,CString strShowText);
static BOOL CheckBarcod(CString strCorde);
void SetBarcode(ZcGePoint3d& basePoint,CString strBarcode,CString strShowText);
void DrawBarcode(ZcDbBlockTableRecord *pBlkTblRcd,BOOL bShowText=TRUE,double dWidth=0.2,int nHeight=8);
~CBarcode(void);
private:
ZcGePoint3d m_basePoint;
CString m_strBarcode;
CString m_strShowText;
CString GetBarcodeString(char c);
void DrawHatch(ZcDbBlockTableRecord *pBlkTblRcd,ZcGePoint3d pt,double dWidth,int nHeight);
};
CBarcode::CBarcode()
{
}
CBarcode::CBarcode(ZcGePoint3d& basePoint,CString strBarcode,CString strShowText)
{
m_basePoint=basePoint;
m_strBarcode=strBarcode;
m_strShowText=strShowText;
}
BOOL CBarcode::CheckBarcod(CString strCorde)
{
if (strCorde.IsEmpty()) return FALSE;
strCorde=strCorde.MakeLower();
int n=strCorde.GetLength();
for (int i=0;i<n;i++)
{
switch(strCorde.GetAt(i))
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':