Files
envi-code/SourceCode/Code2026/tg_shs/shs_annotate/materialstructctrl.h
T
2026-09-28 15:28:50 +08:00

53 lines
1.3 KiB
C++

#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<TMaterialStruct> 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<TMaterialStruct> &maters) {
for(int i=0; i<maters.Length(); i++) {
m_lstMaters.Append(new TMaterialStruct(maters[i]));
}
}
void SetRotation(double nRot) {
m_nRotation=nRot;
}
void SetScale(double scale) {
m_nScale=scale;
}
void SetMaterialLen(double nLen) {
m_nMaterialLen=nLen;
}
void UpdateView();
};
#endif