#ifndef __MATERIAL_STRUCT_CTRL_H #define __MATERIAL_STRUCT_CTRL_H #include "GsPreviewCtrl.h" struct TMaterialStruct { XString sName; //材料名称 XString sPattern; //材料颜色 int nColor; //ACAD 颜色 double nWidth; //厚度 TMaterialStruct(): nColor(0), nWidth(0) {} TMaterialStruct(const TCHAR *name, const TCHAR *pattern, int color, double width) { sName=name; sPattern=pattern; nColor=color; nWidth=width; } }; class CMaterialStructCtrl: public CGsPreviewCtrl { protected: AcDbDatabase m_dbPreview; DList m_lstMaters; double m_nMaterialLen; //构件长度,默认1000 double m_nRotation; //转角,水平0,垂直90 double m_nScale; //填充比例,默认100 int m_nColorFrame; //结构的颜色,默认2 int m_nColorLeader; //引线颜色,默认3 AcDbObjectIdArray m_idArray; AcDbObjectId m_idStyle; public: CMaterialStructCtrl(); void SetMaterials(const DList &maters) { for(int i=0; i