Files
envi-code/SourceCode/Code2026/inc/AdsXRx/EntityField.h
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

192 lines
3.7 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : EntityField 类
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: EntityField 声明
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#ifndef _EntityField_H_
#define _EntityField_H_
#ifndef _XASTRING_H_
#include "XAString.h"
#endif
#ifndef _XWCSTRING_H_
#include "XWString.h"
#endif
#ifndef _XGLOBALDEF_H_
#include "XGlobalDef.h"
#endif
class EntityFields;
class GEOAPI EntityField
{
public:
enum DataType
{
kUnknown = -1,
kBoolean = 0,
kChar = 1,
kInt8 = 2,
kUInt8 = 3,
kInt16 = 4,
kUInt16 = 5,
kInt32 = 6,
kUInt32 = 7,
kGroup = 100,
kString = 101,
kDouble = 200,
kAcGePoint2d = 201,
kAcGePoint3d = 202,
kAcGeVector2d = 203,
kAcGeVector3d = 204,
kAcGeScale3d = 205,
kAcDbHardOwnershipId= 206,
kAcDbSoftOwnershipId= 207,
kAcDbHardPointerId = 208,
kAcDbSoftPointerId = 209,
kAcDbHandle = 210,
};
EntityField(const TCHAR *sName = _T(""),DataType type = kUnknown);
EntityField &operator =(const EntityField &ef);
EntityField(const EntityField&ef);
virtual ~EntityField();
const TCHAR* GetName()const;
void SetName(const TCHAR* sName);
DataType GetDataType()const;
void SetData(const Adesk::Boolean& val);
void SetData(const Adesk::Int8& val);
void SetData(const Adesk::UInt8& val);
void SetData(const Adesk::Int16& val);
void SetData(const Adesk::UInt16& val);
void SetData(const Adesk::Int32& val);
void SetData(const Adesk::UInt32& val);
void SetData(EntityFields *pVal);//仅内部使用!
void SetData(const EntityFields &val);
void SetData(const TCHAR* val);
void SetData(const double& val);
void SetData(const AcGePoint2d& val);
void SetData(const AcGePoint3d& val);
void SetData(const AcGeVector2d& val);
void SetData(const AcGeVector3d& val);
void SetData(const AcGeScale3d& val);
void SetData(const AcDbHardOwnershipId& val);
void SetData(const AcDbSoftOwnershipId& val);
void SetData(const AcDbHardPointerId& val);
void SetData(const AcDbSoftPointerId& val);
void SetData(const AcDbHandle&val);
bool GetData(Adesk::Boolean& val)const;
bool GetData(Adesk::Int8& val)const;
bool GetData(Adesk::UInt8& val)const;
bool GetData(Adesk::Int16& val)const;
bool GetData(Adesk::UInt16& val)const;
bool GetData(Adesk::Int32& val)const;
bool GetData(Adesk::UInt32& val)const;
bool GetData(EntityFields *&pVal)const;//仅内部使用!
bool GetData(EntityFields &val)const;
bool GetData(CString&val)const;
bool GetData(double& val)const;
bool GetData(AcGePoint2d& val)const;
bool GetData(AcGePoint3d& val)const;
bool GetData(AcGeVector2d& val)const;
bool GetData(AcGeVector3d& val)const;
bool GetData(AcGeScale3d& val)const;
bool GetData(AcDbHardOwnershipId& val)const;
bool GetData(AcDbSoftOwnershipId& val)const;
bool GetData(AcDbHardPointerId& val)const;
bool GetData(AcDbSoftPointerId& val)const;
bool GetData(AcDbHandle&val)const;
bool operator> (const EntityField&ent)const;
bool operator< (const EntityField&ent)const;
bool operator==(const EntityField&ent)const;
bool operator!=(const EntityField&ent)const;
void DwgIn(AcDbDwgFiler* pFiler);
void DwgOut(AcDbDwgFiler* pFiler)const;
void DxfIn(AcDbDxfFiler* pFiler);
void DxfOut(AcDbDxfFiler* pFiler)const;
protected:
//名称,不区分大小写
XString m_sName;
//类型
DataType m_nType;
//数据,甚至可以是子对象
void* m_pData;
private:
void Init();
void Clear();
void ChangeType(DataType type);
};
#endif