172 lines
3.2 KiB
C++
172 lines
3.2 KiB
C++
#pragma once
|
|
#include "ACString.h"
|
|
#include "WCString.h"
|
|
|
|
class EntityFields;
|
|
class 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:
|
|
|
|
//名称,不区分大小写
|
|
#ifdef _UNICODE
|
|
WCString m_sName;
|
|
#else
|
|
ACString m_sName;
|
|
#endif
|
|
|
|
//类型
|
|
DataType m_nType;
|
|
|
|
//数据,甚至可以是子对象
|
|
void* m_pData;
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
void Clear();
|
|
|
|
void ChangeType(DataType type);
|
|
};
|