325 lines
9.9 KiB
C++
325 lines
9.9 KiB
C++
// DbWaterTank.h: interface for the TDbWaterTank class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_DBWATERTANK_H__941F50AB_F7DF_4E13_AB0E_DB50DC62526F__INCLUDED_)
|
|
#define AFX_DBWATERTANK_H__941F50AB_F7DF_4E13_AB0E_DB50DC62526F__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
/*============================================================================*
|
|
* Copyright(c), 1994-2007, Beijing Tangent Engineering Software Co.Ltd.
|
|
* 作 者: 沈睿
|
|
* 创建时间: 大约在冬季
|
|
* 描 述: 水箱
|
|
* 归属项目: 给排水
|
|
* 历史记录: 2008-6-26 补头文件注释
|
|
=============================================================================*/
|
|
|
|
#include "NodePrototype.h"
|
|
|
|
class PS_EXP TDbWaterTank : public TDbEntity
|
|
{
|
|
DECLARE_TENTBASE();
|
|
ACRX_DECLARE_MEMBERS(TDbWaterTank);
|
|
private:
|
|
static const Adesk::UInt8 g_nVersion;
|
|
public:
|
|
TDbWaterTank();
|
|
protected:
|
|
XPoint m_ptLocation; // 设备基点
|
|
XPoint m_ptHoleInsert; // 人孔位置
|
|
XPoint m_ptOverfallStart;// 溢流管起点
|
|
XPoint m_ptOverfallEnd; // 溢流管终点
|
|
XPoint m_ptWaterIn1; // 进水管1
|
|
XPoint m_ptWaterIn2; // 进水管2
|
|
XPoint m_ptWaterInFrom; // 进水管起点
|
|
BOOL m_bNeedHole;
|
|
BOOL m_bNeedSleeper;
|
|
Adesk::UInt8 m_iShape; //0: 圆形(立式) 1:方形 2: 圆形(卧式)
|
|
Adesk::UInt8 m_iShowType; //0:平面 1:主立面 2:左立面 3:系统
|
|
Adesk::UInt8 m_iSleeperNum;
|
|
Adesk::UInt8 m_iSleeperPos;
|
|
double m_nHighLine;
|
|
double m_nLowLine;
|
|
double m_nHoleWidth;
|
|
double m_nSleeperWidth; //枕木高度. 宽度固定为0.2M
|
|
double m_nHeight;
|
|
double m_nLength; //圆形时,存储直径
|
|
double m_nWidth;
|
|
double m_nRotation;
|
|
double m_nOverfallEle; //溢流管标高
|
|
double m_nRushEle; //泻水管标高
|
|
double m_nWaterInEle; //进水管标高
|
|
double m_nSpare;
|
|
AcDbHardPointerId m_idDashLayer;
|
|
AcDbHardPointerId m_idBlock3d; // 三维图块
|
|
BOOL m_bHoleIsRect; // 方形人孔还是圆形人孔 8.0数据
|
|
Adesk::UInt8 m_iSpare; // 保留 8.0数据
|
|
XPoint m_ptSpare; // 保留 8.0数据
|
|
XString m_sSpare; // 保留 8.0数据
|
|
public:
|
|
void SetLocation(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptLocation=pt;
|
|
}
|
|
virtual XPoint GetLocation() const { return m_ptLocation;}
|
|
void SetHoleInsert(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptHoleInsert=pt;
|
|
}
|
|
XPoint GetHoleInsert() const { return m_ptHoleInsert;}
|
|
void SetOverfallStart(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptOverfallStart=pt;
|
|
}
|
|
XPoint GetOverfallStart() const { return m_ptOverfallStart;}
|
|
void SetOverfallEnd(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptOverfallEnd=pt;
|
|
}
|
|
XPoint GetOverfallEnd() const { return m_ptOverfallEnd;}
|
|
void SetWaterIn1(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptWaterIn1=pt;
|
|
}
|
|
XPoint GetWaterIn1() const { return m_ptWaterIn1;}
|
|
void SetWaterIn2(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptWaterIn2=pt;
|
|
}
|
|
XPoint GetWaterIn2() const { return m_ptWaterIn2;}
|
|
void SetWaterInFrom(const XPoint &pt) {
|
|
assertWriteEnabled();
|
|
m_ptWaterInFrom=pt;
|
|
}
|
|
XPoint GetWaterInFrom() const { return m_ptWaterInFrom;}
|
|
AcDbObjectId GetBlock3d() const {
|
|
return m_idBlock3d;
|
|
}
|
|
void SetBlock3d(const AcDbObjectId &id) {
|
|
assertWriteEnabled();
|
|
m_idBlock3d=id;
|
|
}
|
|
void SetNeedHole(BOOL bFlag) {
|
|
assertWriteEnabled();
|
|
m_bNeedHole=bFlag;
|
|
}
|
|
BOOL IsNeedHole() const { return m_bNeedHole;}
|
|
void SetNeedSleeper(BOOL bFlag) {
|
|
assertWriteEnabled();
|
|
m_bNeedSleeper=bFlag;
|
|
}
|
|
BOOL IsNeedSleeper() const { return m_bNeedSleeper;}
|
|
int GetShape() const {
|
|
return m_iShape;
|
|
}
|
|
void SetShape(int nShape) {
|
|
assertWriteEnabled();
|
|
m_iShape=nShape;
|
|
}
|
|
int GetShowType() const {
|
|
return m_iShowType;
|
|
}
|
|
void SetShowType(int nType) {
|
|
assertWriteEnabled();
|
|
m_iShowType=nType;
|
|
}
|
|
int GetSleeperNum() const {
|
|
return m_iSleeperNum;
|
|
}
|
|
void SetSleeperNum(int nSleeperNum) {
|
|
assertWriteEnabled();
|
|
m_iSleeperNum = nSleeperNum;
|
|
}
|
|
int GetSleeperPos() const {
|
|
return m_iSleeperPos;
|
|
}
|
|
void SetSleeperPos(int nSleeperPos) {
|
|
assertWriteEnabled();
|
|
m_iSleeperPos = nSleeperPos;
|
|
}
|
|
|
|
double GetHighLine() const {
|
|
return m_nHighLine;
|
|
}
|
|
void SetHighLine(double dHighLine) {
|
|
assertWriteEnabled();
|
|
m_nHighLine=dHighLine;
|
|
}
|
|
double GetLowLine() const {
|
|
return m_nLowLine;
|
|
}
|
|
void SetLowLine(double dLowLine) {
|
|
assertWriteEnabled();
|
|
m_nLowLine=dLowLine;
|
|
}
|
|
double GetOverfallEle() const {
|
|
return m_nOverfallEle;
|
|
}
|
|
void SetOverfallEle(double dOverfallEle) {
|
|
assertWriteEnabled();
|
|
m_nOverfallEle=dOverfallEle;
|
|
}
|
|
double GetRushEle() const {
|
|
return m_nRushEle;
|
|
}
|
|
void SetRushEle(double dRushEle) {
|
|
assertWriteEnabled();
|
|
m_nRushEle=dRushEle;
|
|
}
|
|
double GetWaterInEle() const {
|
|
return m_nWaterInEle;
|
|
}
|
|
void SetWaterInEle(double dWaterInEle) {
|
|
assertWriteEnabled();
|
|
m_nWaterInEle=dWaterInEle;
|
|
}
|
|
double GetHoleWidth() const {
|
|
return m_nHoleWidth;
|
|
}
|
|
void SetHoleWidth(double dHoleWidth) {
|
|
assertWriteEnabled();
|
|
m_nHoleWidth=dHoleWidth;
|
|
}
|
|
double GetSleeperWidth() const {
|
|
return m_nSleeperWidth;
|
|
}
|
|
void SetSleeperWidth(double dSleeperWidth) {
|
|
assertWriteEnabled();
|
|
m_nSleeperWidth=dSleeperWidth;
|
|
}
|
|
|
|
double GetSleeperLen() const // cet 2011.6.14 modify
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
double dSleeperLen = 0.0;
|
|
if (!fd.GFD(_T("SLEEPER_LEN"), dSleeperLen))
|
|
{
|
|
dSleeperLen = GetOldSleeperLen();
|
|
}
|
|
return dSleeperLen;
|
|
}
|
|
|
|
void SetSleeperLen(double dSleeperLen) // cet 2011.6.14 modify
|
|
{
|
|
assertWriteEnabled();
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("SLEEPER_LEN"), dSleeperLen);
|
|
}
|
|
|
|
// zxl 2012.12.03 add
|
|
double GetElev() const
|
|
{
|
|
const TEntityFields &fd = GetFields();
|
|
double dElev = 0.0;
|
|
if (!fd.GFD(_T("TANK_ELEV"), dElev))
|
|
{
|
|
dElev = 0.0;
|
|
}
|
|
return dElev;
|
|
}
|
|
void SetElev(double dElev, bool bInitElev = true)// bInitElev为true时,重新定义标高,否则只记录标高 zxl 2012.12.03 add
|
|
{
|
|
assertWriteEnabled();
|
|
TEntityFields &fd = Fields();
|
|
fd.SFD(_T("TANK_ELEV"), dElev);
|
|
if (bInitElev)
|
|
{
|
|
m_ptLocation.z = GetElev() * 1000;
|
|
m_ptHoleInsert.z = GetElev() * 1000;
|
|
}
|
|
}
|
|
|
|
double GetHeight() const {
|
|
return m_nHeight;
|
|
}
|
|
void SetHeight(double dHeight) {
|
|
assertWriteEnabled();
|
|
m_nHeight=dHeight;
|
|
}
|
|
double GetLength() const {
|
|
return m_nLength;
|
|
}
|
|
void SetLength(double dLength) {
|
|
assertWriteEnabled();
|
|
m_nLength=dLength;
|
|
}
|
|
double GetWidth() const {
|
|
return m_nWidth;
|
|
}
|
|
void SetWidth(double dWidth) {
|
|
assertWriteEnabled();
|
|
m_nWidth=dWidth;
|
|
}
|
|
double GetRotation() const {
|
|
return m_nRotation;
|
|
}
|
|
void SetRotation(double dRotation) {
|
|
assertWriteEnabled();
|
|
m_nRotation=dRotation;
|
|
}
|
|
double GetSpare() const {
|
|
return m_nSpare;
|
|
}
|
|
void SetSpare(double dSpare) {
|
|
assertWriteEnabled();
|
|
m_nSpare=dSpare;
|
|
}
|
|
void SetDashLayer(const AcDbObjectId& id) {
|
|
assertWriteEnabled();
|
|
m_idDashLayer=id;
|
|
}
|
|
void SetHoleRect(BOOL bTrue){
|
|
assertWriteEnabled();
|
|
m_bHoleIsRect = bTrue;
|
|
}
|
|
BOOL HoleIsRect(){
|
|
return m_bHoleIsRect;
|
|
}
|
|
AcDbObjectId GetTextLayer() const {
|
|
return m_idDashLayer;
|
|
}
|
|
|
|
public: // Override TDbEntity
|
|
virtual void CopyPropertiesFrom(AcDbEntity *pSrc, unsigned gMatchFlag);
|
|
virtual Acad::ErrorStatus GetGripText(int idx, CString &cs) const;
|
|
virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
|
|
virtual Acad::ErrorStatus ExplodeOrDraw2d(XExplodeDraw &dc) const;
|
|
virtual Acad::ErrorStatus ExplodeOrDraw3d(XExplodeDraw &dc) const;
|
|
virtual void GetTips(DList<TObjInfoUnit> &) const; //取动态属性显示数据
|
|
virtual int GetFirstVersion()const{return 7;}
|
|
virtual TSubText* HitTestText(XPoint pt)const {return NULL;};
|
|
|
|
public: // Override AcDbEntity
|
|
virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints, AcDbIntArray& osnapModes, AcDbIntArray& geomIds) const;
|
|
virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset);
|
|
virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
|
|
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler*);
|
|
virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
|
|
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler*);
|
|
virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler*) const;
|
|
private:
|
|
Acad::ErrorStatus DrawPlan(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus DrawSysTank(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus DrawMainSect(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus DrawLeftSect(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus DrawCircleSect0(XExplodeDraw &dc) const; //圆立式 立面
|
|
Acad::ErrorStatus DrawCirclePlan2(XExplodeDraw &dc) const; //圆卧式 平面
|
|
Acad::ErrorStatus DrawCircleLeftSect2(XExplodeDraw &dc) const; //圆卧式 左立面
|
|
Acad::ErrorStatus DrawCircleMainSect2(XExplodeDraw &dc) const; //圆卧式 主立面
|
|
Acad::ErrorStatus Draw3dBox(XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus Draw3dCover(XExplodeDraw &dc, XVector3D vt, XPoint pt) const;
|
|
void DrawPLine(XPoint ptStart, XPoint ptEnd, XExplodeDraw &dc) const;
|
|
Acad::ErrorStatus DrawWaterLevel(XPoint pt1, XPoint pt2, double nScale, XExplodeDraw &dc) const;
|
|
|
|
private:
|
|
|
|
double GetOldSleeperLen() const; // cet 2011.6.14 add 获得默认枕木长
|
|
|
|
};
|
|
|
|
#endif // !defined(AFX_DBWATERTANK_H__941F50AB_F7DF_4E13_AB0E_DB50DC62526F__INCLUDED_)
|