107 lines
2.4 KiB
C++
107 lines
2.4 KiB
C++
#ifndef __DUCTATTRI_H__
|
|
#define __DUCTATTRI_H__
|
|
#include <map>
|
|
#include <algorithm>
|
|
#include <functional>
|
|
#include <utility>
|
|
|
|
class CDuctAttriKey
|
|
{
|
|
public:
|
|
CDuctAttriKey();
|
|
CDuctAttriKey(const CString& csPipeSystem, const CString& csSystem);
|
|
CDuctAttriKey(const CDuctAttriKey& tSrc);
|
|
~CDuctAttriKey();
|
|
|
|
operator CString() const
|
|
{
|
|
CString csRet = _T("");
|
|
csRet += m_csPipeSystem;
|
|
csRet += m_csSystem;
|
|
return csRet;
|
|
}
|
|
|
|
bool SetSystem(const CString& csSystem);
|
|
bool SetPipeSystem(const CString& csPipeSystem);
|
|
|
|
CString GetSystem() const;
|
|
CString GetPipeSystem() const;
|
|
private:
|
|
CString m_csPipeSystem;
|
|
CString m_csSystem;
|
|
};
|
|
|
|
class CDuctAttriValue
|
|
{
|
|
public:
|
|
enum EFlag
|
|
{
|
|
eLayerNameChg = 0x0001,
|
|
eColorIndexChg = 0x0002,
|
|
eLineWidthChg = 0x0004,
|
|
eLineTypeChg = 0x0008,
|
|
eMatChg = 0x0010,
|
|
eNoChg = 0x0000,
|
|
eAllChg = 0x001f,
|
|
eDimkey = 0x0034,
|
|
};
|
|
|
|
CDuctAttriValue();
|
|
CDuctAttriValue(EFlag eFlag,
|
|
const CString& csLayerName,
|
|
int iColorIndex,
|
|
double dLineWidth,
|
|
const CString& csLineType,
|
|
const CString& csMat,
|
|
const CString& csDimKey);
|
|
CDuctAttriValue(const CDuctAttriValue& tSrc);
|
|
~CDuctAttriValue();
|
|
|
|
// Query Methods
|
|
EFlag GetFlag() const;
|
|
CString GetLayerName() const;
|
|
CString GetLayerNameNew() const;
|
|
int GetColorIndex() const;
|
|
double GetLineWidth() const;
|
|
CString GetLineType() const;
|
|
CString GetLineTypeNew() const;
|
|
CString GetMat() const;
|
|
CString GetDimKey() const;
|
|
|
|
// Set Methods
|
|
bool SetLayerName(const CString& csLayerName, EFlag eFlag = eNoChg);
|
|
bool SetColorIndex(const int& iColorIndex, EFlag eFlag = eNoChg);
|
|
bool SetLineWidth(const double& dLineWidth, EFlag eFlag = eNoChg);
|
|
bool SetLineType(const CString& csLineType, EFlag eFlag = eNoChg);
|
|
bool SetMat(const CString& csMat, EFlag eFlag = eNoChg);
|
|
bool SetDimKey(const CString& csMat, EFlag eFlag = eNoChg);
|
|
|
|
private:
|
|
EFlag m_eFlag;
|
|
CString m_csLayerName; //图层名用于检索图层表时的关键字
|
|
CString m_csLayerNameNew; //新图层名用于记录新值,以备修改所用
|
|
int m_iColorIndex;
|
|
double m_dLineWidth;
|
|
CString m_csLineType; //线型名用于检索线型表时的关键字
|
|
CString m_csLineTypeNew; //新线型名用于记录新值,以备修改所用
|
|
CString m_csDimKey; //标注代号
|
|
CString m_csMat;
|
|
};
|
|
|
|
class CDuctKeyLess
|
|
{
|
|
public:
|
|
bool operator() (CDuctAttriKey lhs, CDuctAttriKey rhs) const
|
|
{
|
|
CString csLhs = lhs;
|
|
CString csRhs = rhs;
|
|
|
|
return csLhs.Compare(csRhs) < 0;
|
|
}
|
|
};
|
|
|
|
typedef std::map<CDuctAttriKey, CDuctAttriValue, CDuctKeyLess> CDuctAttriMap;
|
|
|
|
#endif
|
|
|