57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
#if !defined(AFX_PLACETREESTYLE_H__)
|
|
#define AFX_PLACETREESTYLE_H__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
// 任意布树命令交互
|
|
class CPlaceTreeStyle
|
|
{
|
|
private:
|
|
enum RegSelectMode{kSelect, kDraw};
|
|
|
|
public:
|
|
CPlaceTreeStyle();
|
|
~CPlaceTreeStyle();
|
|
|
|
public:
|
|
// 自由插入
|
|
bool FreedomPlaceTree();
|
|
|
|
// 拖动布树
|
|
bool DragPlaceTree();//上一版拖动布树,不支持弧线
|
|
bool DragPlaceTreeExtend();//支持弧线布树
|
|
|
|
// 路径匹配
|
|
bool PathPlaceTree();
|
|
|
|
//区域布置
|
|
bool RegPlaceTree();
|
|
|
|
int GetPolyLine(TGGePoly2D &poly2d, int &nSelectMode);//获取多段线,返回值: -1直接退出;0 获取Polyline失败;1 获取polyLine成功
|
|
int SelectPolyLine(TGGePoly2D &poly2d, int &nSelectMode);//选择多段线
|
|
int DrawPolyLine(TGGePoly2D &poly2d, int &nSelectMode);//绘制多段线
|
|
|
|
|
|
// 直线样式生成树
|
|
void LineStyle(AcDbLine *pLine, double dTreeDis, AcGePoint3dArray &ptAryInsert, BOOL bIsSetDis);
|
|
// 圆弧样式生成树
|
|
void ArcStyle(AcDbArc *pArc, double dTreeDis, AcGePoint3dArray &ptAryInsert, BOOL bIsSetDis, double dBugle);
|
|
// 多段线样式生成树
|
|
void PolyLineStyle(AcDbPolyline *pPolyLine, double dTreeDis, AcGePoint3dArray &ptAryInsert, BOOL bIsSetDis);
|
|
|
|
private:
|
|
// 造块
|
|
bool MakeBlockReference(AcGePoint3d ptInsert);
|
|
|
|
//给定屏幕一点,判断当前点在当前距离poly2d最近的线段的左侧还是右侧
|
|
//左侧为0, 右侧为1,其他
|
|
int OnWitchSideByPoitnOnPoly(XPoly2D poly2d, XPoint point);
|
|
|
|
//判断是否有偏移量,有偏移量进行预览,得到预览后的polyLine
|
|
bool GetPolyLineByOffsetPreviewJig(AcDbPolyline &polyLine);
|
|
};
|
|
|
|
#endif // !defined(AFX_PLACETREESTYLE_H__)
|