#pragma once #include "RBList.h" #include "ADSGePoint3d.h" #include "RBGroups.h" class ADSGePoint3d; class PickEntSet; class EntitySet : public RBList { public: EntitySet(); EntitySet(const ads_name n); EntitySet(const EntitySet &ent); EntitySet(LPCTSTR handle); ~EntitySet(); void operator = (const ads_name n); void operator = (const EntitySet &n); int operator !() const; void operator > (ads_name entother) const; int operator == (const ads_name ent) const; int operator == (const EntitySet &ent) const; operator TLong_ptr *(); operator void *(); // 下列函数没有采用ADS命名规则,不建议使用 int In(const PickEntSet *pSelectionSet) const; int Redraw(int mode = 1) const; int RedrawAll(int mode = 1) const; int Delete() const; int Update() const; int Erase() const; // member functions about groups int Make(); int Modify() const; int _GetGroups(); // member functions that can get a EntitySet Name; int UserSelect(LPCTSTR prompt,ads_point pt); int UserSelect(LPCTSTR prompt = NULL); int UserSelect(LPCTSTR prompt,ADSGePoint3d &pt); int FilterSelect(LPCTSTR prompt, const RBList &mask, ads_point res); int FilterSelect(LPCTSTR prompt, const RBList &mask); int FilterSelect1(ads_real distPrec, LPCTSTR prmpt, const RBList &mask, ads_point res = NULL); int GetLast(); int GetNext(const EntitySet &et); int CreateByHandle(LPCTSTR handle); int Handent(LPCTSTR handle); int handent(LPCTSTR handle); int GetData(int cd,void *buf); int SetData(int cd,...); int Make(int,...); int MakeEx(int, ...); int GetNext(); // member functions to implement Extended Data Access; static const TCHAR *ApplicationName; static int AssignAppName(const TCHAR *s); // 不建议使用 int GetGroups(int getEx = 1); int GetGroups(const TCHAR *appName); void FreeGroups(); // 采用ADS命名规则, 建议使用 int entgetx(); int entgetx(const TCHAR *appName); int Match(const RBList &exlist); int MatchEx(const RBGroups *tag, const RBGroups *data); int MatchEx(int tag, const TCHAR *data); int MatchEx(int tag, int data) ; int MatchEx(int tag, ads_real data); int MatchEx(int tag, const RBGroups * data); int MatchBase(const RBGroups &rb); int MatchBase(const RBList &baseList); int GetExtend(ads_point lowPt, ads_point upPt, ads_matrix mat = NULL); int GetExtend(ads_point cen, ads_real *x, ads_real *y, ads_real *z = NULL); int Is(const TCHAR *entType); int XTransform(ads_matrix mat); int Move(const ADSGePoint3d & basept, ADSGePoint3d & res) const; //动态拖动 int Rotate(const ADSGePoint3d &src, ads_real *res = NULL) const; int Scale(const ADSGePoint3d &src, ads_real *res = NULL) const; RBGroups * SearchByTagCode(int tag_code); RBGroups * SearchDataByTag(int tag); // 扩充实体的操作 int GetInt (int tag_code, int &buf); int GetReal(int tag_code, ads_real &buf); int GetRString(int tag_cdoe,TCHAR *&buf); int GetString (int tag_code,TCHAR *buf); int GetPoint(int tag_code, ADSGePoint3d &buf); int GetRBinary(int tag_code, short &nBufLen, const char * &buf); int SetInt (int tag_code,int buf); int SetReal(int tag_code,ads_real buf); int SetString (int tag_code, const TCHAR *buf, int isHandle = 0); int SetPoint(int tag_code, const ADSGePoint3d &buf); int SetBinary(int tag_code, short nBufLen, const char * buf); // API 2.0 // support simple type string & int & real int SetExData(int tag_code,...); int GetExData(int tag_code,void *buf); // 删除指定的扩充实体数据 int DeleteTag(int tag_code); int RemoveXData(); int SetStruct(void *buf,int len, int tag_code = EX_STRUCT); int GetStruct(void *buf,int len, int tag_code = EX_STRUCT); public: ads_name name; PGroups groupsEx; private: int CreateTag(void *buf,int tag_code,int type); void _MakeExGroups(); }; typedef EntitySet EntityEx;