Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

291 lines
11 KiB
C++

#pragma once
#include "DbPipeLabel.h"
#include "DbVerticalSection.h"
class CDbVerticalSectionFeed : public AecXDbEntityBaseEx, public CLabelStyle
{
public:
ACRX_DECLARE_MEMBERS(CDbVerticalSectionFeed);
private:
static const Adesk::UInt8 g_nVersion;
public:
CDbVerticalSectionFeed();
protected:
Adesk::UInt16 m_iScaleX; //X方向比例
Adesk::UInt16 m_iScaleY; //Y方向比例
Adesk::UInt16 m_iCalcMode; //计算模式 0:管顶平接 1:管底平接 2:水面平接 3:给水系统
XPoint m_ptIns; //插入点
XPointList m_lstPt; //地面井
double m_nStartDeep;//起点埋深
double m_nSpare; //保留
double m_nGridScale;//比例标尺
// DList<TWellData> m_lstWell; //管网系统
DList<TFeedWellData> m_lstFeedWell; //给水管网系统
XString m_sSheetHead;//纵断表头 以空格分行
// XString m_sSheetRow; //纵断表头行高 8.0数据
Adesk::UInt16 m_nCalcType; // cet 2016.5.11 add 计算方式 (0 已知管中标高 1 已知覆土厚度)
double m_nMaxDeep;
double m_nMinDeep;
AcDbHardPointerId m_idTextLayer;
AcDbHardPointerId m_idGridLayer;
AcDbHardPointerId m_idSectLayer;
AcDbHardPointerId m_idDoteLayer;
private: // cet 2016.7.5 add 临时变量,用于记录当前管井显示区域,管道信息
XPoint m_ptTop; // 显示区域顶面一点
XPoint m_ptBottom; // 显示区域底面一点
std::map<AcDbHandle, PIPEDATA> m_mapPipeData; // 管道信息
// cet 2017.9.6 add 临时变量,用于记录纵断面图四个点位置用于设置夹点,方便用户拖动对齐纵断面图
XPoint m_ptTopLeft;
XPoint m_ptTolRight;
XPoint m_ptBottomLeft;
XPoint m_ptBottomRight;
public:
const TCHAR* GetSheetHead() const {
return (const TCHAR*)m_sSheetHead;
}
void SetSheetHead(const TCHAR* szSheetHead) {
assertWriteEnabled();
m_sSheetHead = szSheetHead;
}
//8.0 新增接口,返回表行高
// const TCHAR* GetSheetRowHeight() const;
// void SetSheetRowHeight(const TCHAR* szSheetRowHeight);
// const TCHAR* GetSheetRow() const {
// return (const TCHAR*)m_sSheetRow;
// }
// void SetSheetRow(const TCHAR* szSheetRow) {
// assertWriteEnabled();
// m_sSheetRow = szSheetRow;
// }
double GetStartDeep() const {
return m_nStartDeep;
}
double GetMaxDeep() const {
return m_nMaxDeep;
}
double GetMinDeep() const {
return m_nMinDeep;
}
void SetStartDeep(double nStartDeep) {
assertWriteEnabled();
m_nStartDeep = nStartDeep;
}
double GetSpare() const {
return m_nSpare;
}
void SetSpare(double nSpare) {
assertWriteEnabled();
m_nSpare = nSpare;
}
double GetGridScale() const {
const EntityFields &fd = GetFields();
double nGridScale(0);
fd.GFD(_T("GRID_SCALE"), nGridScale);
return nGridScale;
}
void SetGridScale(double nGridScale) {
assertWriteEnabled();
m_nGridScale = nGridScale;
EntityFields &fd = Fields();
fd.SFD(_T("GRID_SCALE"), m_nGridScale);
}
int GetScaleX() const {
return m_iScaleX;
}
void SetScaleX(int iScaleX) {
assertWriteEnabled();
m_iScaleX = iScaleX;
}
int GetScaleY() const {
return m_iScaleY;
}
void SetScaleY(int iScaleY) {
assertWriteEnabled();
m_iScaleY = iScaleY;
}
int GetCalcMode() const {
return m_iCalcMode;
}
void SetCalcMode(int iCalcMode) {
assertWriteEnabled();
m_iCalcMode = iCalcMode;
}
void SetInsert(XPoint pt) {
assertWriteEnabled();
m_ptIns = pt;
}
const XPoint & GetInsert() const {
return m_ptIns;
}
void SetTextLayer(const AcDbObjectId& id) {
assertWriteEnabled();
m_idTextLayer = id;
}
AcDbObjectId GetTextLayer() const {
return m_idTextLayer;
}
void SetGridLayer(const AcDbObjectId& id) {
assertWriteEnabled();
m_idGridLayer = id;
}
AcDbObjectId GetGridLayer() const {
return m_idGridLayer;
}
void SetSectLayer(const AcDbObjectId& id) {
assertWriteEnabled();
m_idSectLayer = id;
}
AcDbObjectId GetSectLayer() const {
return m_idSectLayer;
}
void SetDoteLayer(const AcDbObjectId& id) {
assertWriteEnabled();
m_idDoteLayer = id;
}
AcDbObjectId GetDoteLayer() const {
return m_idDoteLayer;
}
// cet 2016.5.11 add 计算方式 0 已知管中标高 1 已知覆土厚度
void SetCalcType(int nType)
{
m_nCalcType = nType;
}
int GetCalcType()
{
return m_nCalcType;
}
void GetWellDatas(DList<TFeedWellData>& lstWell) const;
void SetWellDatas(DList<TFeedWellData>& lstWell);
void Calc();
//zxl 2013.12.5 add
bool IsDimEle() const;
void SetDimEle(bool bDim);
bool IsDimDist() const;
void SetDimDist(bool bDim);
// 是否显示交叉管
bool IsShowCrossPipe(TPipeSys::SysType sys) const;
// 设置交叉管显示
void SetShowCrossPipe(TPipeSys::SysType sys, bool bShow);
// cet 2015.9.18 判断该管道系统的交叉管是否显示(T20V2.0及后续版本使用)
bool IsShowCrossPipe(const CString &sSysName) const;
// cet 2015.9.18 设置交叉管显示(T20V2.0及后续版本使用)
void SetShowCrossPipe(const CString &sSysName, bool bShow);
// cet 2016.9.8 add 仅显示支路交点(非主干管道一端连接主干,另一端连接着井或化粪池的为支路)
bool IsOnlyShowBranch() const;
void SetOnlyShowBranch(bool bShow);
// cet 2016.8.8 add 显示支路等高交点(此支路泛指除主干外的所有连接管道路径)
bool IsShowEqualEleBranch() const;
void SetShowEqualEleBranch(bool bShow);
// cet 2017.8.24 add 是否显示穿过管道端点但没有与井或池连接的交叉管道
bool IsShowPipeEndNotLinkedPipe() const;
void SetShowPipeEndNotLinkedPipe(bool bShow);
// cet 2016.9.22 add 更新管道外径内径
void UpdatePipeOuterDnInnerDn(const AcDbObjectId &id, double dOuterDn, double dInnerDn);
//int HitTestOnVS(XPoint pt, double &nColWidth, double &nHeight, XPoint &ptRet);
//int HitTestOnVS2(XPoint pt, double &nColWidth, double &nHeight, XPoint &ptRet);
// 绘制过程中实时获取遮挡管线影响效率,现做出改进
// 更新遮挡管线 cet 2017.11.22 add
void UpdateHidePipes();
public:
// 2018.2.8 add 填充类型
CString GetFillingPattern() const;
void SetFillingPattern(const CString &sPattern);
// cet 2018.2.8 add 填充比例
double GetFillingRatio() const;
void SetFillingRatio(double dRatio);
// cet 2018.2.8 add 填充颜色
Adesk::UInt16 GetFillingColor() const;
void SetFillingColor(Adesk::UInt16 nColor);
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 Draw2d(AcGiDraw &dc) const;
virtual void GetTips(DList<ObjInfoUnit> &) const; //取动态属性显示数据
virtual int GetFirstVersion()const { return 8; }
virtual SubText* HitTestText(XPoint pt)const { return NULL; };
public: // Override AcDbEntity
virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
INT_PTR gsSelectionMark,
const AcGePoint3d& ptPick,
const AcGePoint3d& lastPoint,
const AcGeMatrix3d& viewXform,
AcGePoint3dArray& snapPoints,
AcDbIntArray& geomIds) const;
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;
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* ent,
AcDb::Intersect intType,
AcGePoint3dArray& points,
int thisGsMarker = 0,
int otherGsMarker = 0) const;
virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* ent,
AcDb::Intersect intType,
const AcGePlane& projPlane,
AcGePoint3dArray& points,
int thisGsMarker = 0,
int otherGsMarker = 0) const;
private:
// Acad::ErrorStatus DrawSection(AcGiDraw &dc) const; //绘制雨污断面 从左往右
// Acad::ErrorStatus DrawSectionFromRight(AcGiDraw &dc) const;//绘制雨污断面 从右往左
Acad::ErrorStatus DrawSectionFeed(AcGiDraw &dc) const; //绘制给水断面 从左往右
Acad::ErrorStatus DrawScale(AcGiDraw &dc, XPoint &ptEnd) const;
// Acad::ErrorStatus DrawCivilSheet(AcGiDraw &dc, XPoint ptEnd) const;
Acad::ErrorStatus DrawCivilSheetFeed(AcGiDraw &dc, XPoint ptEnd) const;
void DrawLine(XPoint ptStart, XPoint ptEnd, AcGiDraw &dc) const;
void DrawGridLine(XPoint ptStart, XPoint ptEnd, AcGiDraw &dc) const;
void DrawDoteLine(XPoint ptStart, XPoint ptEnd, AcGiDraw &dc) const;
void DrawBreakPipe(XPoint ptStart, XPoint ptEnd, AcGiDraw &dc) const;
void DrawPLine(XPoint ptStart, XPoint ptEnd, AcGiDraw &dc, double nWeight) const;
void DrawText(XPoint ptText, const TCHAR*szText, AcGiDraw::TextAlignment Align, AcGiDraw &dc, double nRotation = 0) const;
void DrawScaleArrow(XPoint ptStart, XPoint ptEnd, const TCHAR*szText, AcGiDraw &dc) const;
void DrawEllipse(XPoint ptCen, double nRadiusLong, double nRadiusShort, AcGiDraw &dc, const AcDbObjectId idLay, bool *pRet = NULL) const;
double GetAllPipeLen() const;
void GetAllPipes(DList<AcDbObjectId> &lstAllPipe) const;
BOOL GetFeedWellListData(DList<TWellData> &lstWellSys, DList<TFeedWellData> &lstFeedWellSys);
BOOL AppendIdArray(AcDbObjectIdArray &idArray, AcDbObjectId id) const;
int GetPipeIndex(TPipeSys::SysType sys) const;//zxl 2013.12.5 add
void GetLine(XLine &line) const; //zxl 2013.12.5 add获取sheet顶边所在的一条直线
void DimEle(const XPoint &ptCen, double nRadiusLong, double nRadiusShort, double dEle, CString &sText, bool bOnlyDimEle, AcGiDraw &dc) const; // cet 2011.6.2 add 标注碰撞标高
void DimDist(const CString &sDim, const XPoint &ptStart, const XPoint &ptEnd, AcGiDraw &dc, int &nDist, const double dDeep, const double dLong) const; // zxl 2013.12.05 add
// cet 2015.9.18 add 判断管道是否显示交叉点
bool IsShowCrossPipe(const AcDbObjectId &idPipe) const;
private:
// 外径
double OuterDn(const AcDbSoftPointerId &idPipe) const;
// 内径
double InnerDn(const AcDbSoftPointerId &idPipe) const;
// 初始化管道信息
void InitPipeData() const;
void InitPipeData(const AcDbSoftPointerId &idPipe, PIPEDATA &node) const;
// cet 2016.9.8 add 是否为支路(非主干管道一端连接主干,另一端连接着井或化粪池的为支路)
bool IsBrach(CDbPipe *pPipe, const AcDbObjectId &idMainLinked) const;
// cet 2016.9.22 add 获得管道外径内径值
void GetPipeOuterDnInnerDn(const AcDbObjectId &id, double &dOuterDn, double &dInnerDn) const;
// cet 2017.11.22 add 被遮挡管道
void ClearHidePipes();
// cet 2017.11.22 add 是否存储了遮挡数据
bool IsExistHideData() const;
// cet 2017.11.22 add 获取遮挡交点点信息
void GetCrossPointInfo(std::vector<CrossPoint> &vecCrossPoint) const;
// cet 2018.2.8 add 绘制填充
void DrawHatch(AcGiDraw &dc, XPoly2D &ploy) const;
};