187 lines
7.1 KiB
C++
187 lines
7.1 KiB
C++
// PipeStyle4.h: interface for the CPipeStyle4 class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#if !defined(AFX_PIPESTYLE4_H__E91AE70C_52AD_4BCC_99AF_8014C5DF3A11__INCLUDED_)
|
||
#define AFX_PIPESTYLE4_H__E91AE70C_52AD_4BCC_99AF_8014C5DF3A11__INCLUDED_
|
||
|
||
#if _MSC_VER > 1000
|
||
#pragma once
|
||
#endif // _MSC_VER > 1000
|
||
|
||
#include "PipeLine.h"
|
||
#include <afxtempl.h>
|
||
|
||
typedef CArray<CPipeLine*, CPipeLine*> LINEARR;
|
||
typedef CArray<AcDbObjectId, AcDbObjectId&> ARCARR;
|
||
|
||
|
||
/*============================================================================*
|
||
* Copyright(c), 1994-2007, Beijing Tangent Engineering Software Co.Ltd.
|
||
* 文 件 名: PipeStyle4.h
|
||
* 版 本: 3.0
|
||
* 作 者:
|
||
* 创建时间:
|
||
* 描 述: 地热盘管样式四——交叉平行型
|
||
* 归属项目: 暖通
|
||
* 历史记录: 1. sg modify,增加了有关颜色和线宽的内容
|
||
2. 2007-10-31 sg modify,增加了曲率半径、距墙距离等变量,进一步修
|
||
改了线宽、颜色
|
||
3. 2007-11-14 sg modify,增加分区
|
||
4. 2010-11-16,mcl modidy 增加供回图层区分、及供回口位置点设置
|
||
=============================================================================*/
|
||
class CPipeStyle4
|
||
{
|
||
public:
|
||
CPipeStyle4();
|
||
|
||
// CPipeStyle4(XPoint rectStartPt, XPoint rectEndPt, int nDist, double dbPGAng,
|
||
// int nEntryType);
|
||
CPipeStyle4(XPoint rectStartPt, XPoint rectEndPt, double dbPGAng,
|
||
int nEntryType, double dRadius, double dDistToWall,
|
||
int nLeftDist, int nMidDist, int nRightDist, int nDistB,
|
||
int nAreaType, double dLeftArea, double dRightArea,
|
||
BOOL bWeight, double dLineWeight, int nColorIndex); // sg modify
|
||
|
||
// add by myy 2015-1-30
|
||
CPipeStyle4(XPoint rectStartPt, XPoint rectEndPt, XPoint ptPickEntry, double dbPGAng, int nEntryType,
|
||
double dRadius, double dDistToWall, int nLeftDist, int nMidDist, int nRightDist, int nDistB,
|
||
int nAreaType, double dLeftArea, double dRightArea, BOOL bWeight, double dLineWeight, int nColorIndex);
|
||
// add end
|
||
|
||
virtual ~CPipeStyle4();
|
||
|
||
void InitVirtaulRect(); // 初始化虚拟矩形中的数据,用于构造函数,sg add
|
||
|
||
public:
|
||
void SetSameDist(BOOL bSame, int nDist); // 设置间距是否统一
|
||
|
||
void SetStartPt(ads_point rectStartPt);
|
||
void SetPGAng(double dbPGAng);
|
||
void SetEntryType(int nEntryType);
|
||
|
||
public:
|
||
//XPoint GetEntryPt(int nNum); // mcl changed 2010.12.13.获取虚拟矩形放倒后,用自身出口方向
|
||
XPoint GetEntryPt();
|
||
void GetCrossPts(XPoint &ptSupply, XPoint &ptReturn);
|
||
|
||
double GetMinDist(); // 获取所有区域间距中最小的,用于倒角,sg add
|
||
|
||
double GetLeftAreaDist(); // 获取左、右、中间区域真实宽度,sg add
|
||
double GetRightAreaDist();
|
||
double GetMidAreaDist();
|
||
|
||
void GetLRWallDist(); // 获取左右方向距墙距离,仅用于GetEntryPt函数中
|
||
|
||
|
||
public: // 绘制
|
||
// mcl add idRetLayer 2010.11.14 : 回水图层
|
||
bool DrawPGLine(XExplodeDraw &dc,AcDbObjectId idRetLayer = AcDbObjectId::kNull); // 主函数
|
||
|
||
|
||
protected:
|
||
bool DrawSingleLine(XExplodeDraw &dc); // 只绘制一条线,sg add
|
||
bool DrawSingle(XExplodeDraw &dc); // 只绘制一圈
|
||
void PreDrawSingle();
|
||
bool DrawMulti(); // 绘制多圈
|
||
|
||
void DealSameDist(); // 处理相同间距,sg add
|
||
void DealDifferentDist(); // 处理不同间距
|
||
|
||
bool IsEvenNum(int nNum); // 管道数是否是偶数
|
||
|
||
double GetLRDist(); // 获取左右宽度,sg add
|
||
double GetTBDist(); // 获取上下宽度
|
||
|
||
protected:
|
||
void NormalizeRect(); // 转换矩形到躺倒位置
|
||
void GetVirtaulRect(); // 得到虚拟矩形的四个顶点
|
||
void GetCenterPt(); // 得到矩形的中心点
|
||
void GetDiagAng(); // 得到对角线的锐角
|
||
void GetLengthofSide(); // 得到矩形边长
|
||
|
||
// 将虚拟点转换到真实坐标
|
||
void TransToActualPt(ads_point point, ads_point retPt);
|
||
// 将真实坐标转换到虚拟点
|
||
void TransToVirtualPt(ads_point point, ads_point retPt);
|
||
|
||
protected: // 创建LINEARR数组
|
||
void CreateLine1Arr(); // 创建1边直线
|
||
void CreateLine2Arr(); // 创建2边直线
|
||
void CreateLine3Arr(); // 创建3边直线
|
||
void CreateLine4Arr(); // 创建4边直线
|
||
|
||
protected: // 有关弧线
|
||
bool CreateArcArr(XExplodeDraw &dc,AcDbObjectId idRetLayer = AcDbObjectId::kNull); // 创建圆弧
|
||
bool CreateArc(ads_point StartPt, ads_point EndPt, ads_point CenPt,
|
||
AcDbObjectId &ObjID, XExplodeDraw &dc); // 创建一个圆弧
|
||
// 得到圆弧圆心
|
||
void GetArcCenterPt(ads_point EndPt, double dbAng, ads_point &actCenPt);
|
||
|
||
//add by dyw 20150416 在同一边上的开口互换m_dbAsissAng和开口点
|
||
void ChangeEntry(ads_point &ptStart);
|
||
public:
|
||
XPoint m_ptDrawSupply; // 实际绘制供水点
|
||
XPoint m_ptDrawReturn; // 实际绘制回水点
|
||
|
||
XPoint m_ptPickEntry; // add by myy 2015-1-30 开口点
|
||
BOOL m_bDefaultEntry;// add by myy 2015-1-30 是否是默认的八个开口
|
||
BOOL m_bDistance; // add by myy 2015-3-2 1、2点间距离是否小于1、4点间距离, 1:是, 0:不是
|
||
|
||
protected:
|
||
ads_point m_rectStartPt; // 矩形起点
|
||
ads_point m_rectEndPt; // 矩形终点
|
||
|
||
int m_nEntryType; // 入口方向
|
||
double m_dbPGAng; // 矩形倾斜角,盘管角度
|
||
double m_dbArcRadius; // 圆弧半径,曲率半径
|
||
|
||
BOOL m_bSameDist; // 是否统一间距
|
||
int m_nDist; // 间距,中区间距
|
||
int m_nLeftDist; // 左区间距,sg add
|
||
int m_nRightDist; // 右区间距
|
||
int m_nDistB; // 间距B
|
||
|
||
int m_nAreaType; // 划分区域的方式,0:宽度,1:比例,sg add
|
||
double m_dLeftArea; // 左区宽度或比例值
|
||
double m_dRightArea; // 右区宽度或比例值
|
||
|
||
int m_nColorInd; // 颜色,sg add
|
||
BOOL m_bWeight; // 是否粗显
|
||
double m_dLineWeight; // 管线线宽
|
||
|
||
protected:
|
||
int m_nNum; // 中间边的盘管数(n)
|
||
int m_nLeftNum; // 左区的盘管数(n),sg add
|
||
int m_nRightNum; // 右区的盘管数(n)
|
||
|
||
double m_dToWallLR; // 距墙距离,左右,会调整
|
||
double m_dToWallTB; // 距墙距离,上下
|
||
double m_dbSideDist; // 区域间距离
|
||
|
||
LINEARR m_LineArr1; // 1边直线数组
|
||
LINEARR m_LineArr2; // 2边直线数组
|
||
LINEARR m_LineArr3; // 3边直线数组
|
||
LINEARR m_LineArr4; // 4边直线数组
|
||
ARCARR m_ArcArr; // 圆弧数组
|
||
LINEARR m_LineArr5; // 开口边数组
|
||
|
||
ads_point m_CenterPt; // 矩形中心点
|
||
double m_dbDiagAng; // 对角线与矩形夹角的锐角
|
||
double m_dbDiagDist; // 对角线长度
|
||
double m_dbShortDist; // 矩形短边长度
|
||
double m_dbLongDist; // 矩形长边长度
|
||
|
||
ads_point m_ptLT; // 虚拟矩形左上角
|
||
ads_point m_ptLB; // 虚拟矩形左下角
|
||
ads_point m_ptRT; // 虚拟矩形右上角
|
||
ads_point m_ptRB; // 虚拟矩形右下角
|
||
|
||
double m_dbAssisAng; // 辅助角度
|
||
// 1:0,2:PI/2,3:PI/2*3,4:0,
|
||
// 5:PI,6:PI/2*3,7:PI/2,8:PI
|
||
double m_dbNormAng; // 转换矩形后的角度(一般为0,转换后为0.5*_PI)
|
||
};
|
||
|
||
#endif // !defined(AFX_PIPESTYLE4_H__E91AE70C_52AD_4BCC_99AF_8014C5DF3A11__INCLUDED_)
|