128 lines
3.0 KiB
C++
128 lines
3.0 KiB
C++
#ifndef _XDBOSNAPPOINT_H__
|
|
#define _XDBOSNAPPOINT_H__
|
|
|
|
#include "PickEntSet.h"
|
|
// 为了绘制Osnap点而构造临时实体
|
|
class XDbOsnapPoint: public AcDbEntity
|
|
{
|
|
private:
|
|
//void *operator new[](size_t nSize) { return 0;}
|
|
void operator delete[](void *p) {};
|
|
|
|
public:
|
|
|
|
XDbOsnapPoint();
|
|
// 捕捉绘制点
|
|
void SetLocation(const XPoint &ptLoc);
|
|
XPoint GetLocation() const;
|
|
// 捕捉样式
|
|
void SetSnapShape(int nShape);
|
|
// 附加预览对象
|
|
void SetEntityEx(AcDbEntity *pEnt);
|
|
// 带矩形框或橡皮条显示时的基点
|
|
void SetBasePoint(const XPoint &pt);
|
|
// 绘制样式 0--捕捉点 1--带橡皮筋的捕捉点 2--带矩形框的捕捉点(1,2需设置基点)
|
|
void SetDrawShape(int nFlag);
|
|
// 设置矩形框的角度
|
|
void SetRectAngle(double dAngle);
|
|
// 是否绘制捕捉点
|
|
void SetDrawSnap(bool bSnap);
|
|
Adesk::Boolean subWorldDraw(AcGiWorldDraw *mode);
|
|
void subViewportDraw(AcGiViewportDraw *mode);
|
|
|
|
private:
|
|
|
|
// 绘制捕捉点图形
|
|
void DrawOsnapShape(AcGiViewportDraw *pVd);
|
|
// 根据m_nFlag绘制图形
|
|
void DrawShape(AcGiWorldDraw *mode);
|
|
|
|
private:
|
|
|
|
XPoint m_ptLoc; // 捕捉点位置
|
|
XPoint m_ptBase; // 基点
|
|
int m_nOsShape; // 捕捉点形状
|
|
int m_nFlag; // 绘制样式 0--捕捉点 1--带橡皮筋的捕捉点 2--带矩形框的捕捉点(1,2需设置基点)
|
|
AcDbEntity *m_pEntityEx; // 附加实体
|
|
double m_dRectAngle; // 绘制矩形框时的角度
|
|
bool m_bDrawSnap; // 是否绘制捕捉点
|
|
|
|
};
|
|
|
|
// 拖曳显示点
|
|
class XOsPointEdJig : public AcEdJig
|
|
{
|
|
|
|
public:
|
|
|
|
XOsPointEdJig();
|
|
virtual ~XOsPointEdJig();
|
|
void doIt();
|
|
virtual DragStatus sampler();
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
int GetRetCode(int *kwordId=NULL) const;
|
|
AcEdJig::DragStatus GetRetStatus() const;
|
|
// 关键字
|
|
void SetKeyWord(const TCHAR *pszKeyWord);
|
|
// 提示
|
|
void SetPrompt(const TCHAR *pszPormpt);
|
|
// 起点
|
|
void SetptFrom(const XPoint &ptFrom);
|
|
// 终点
|
|
void SetptTo(const XPoint &ptTo);
|
|
XPoint GetptTo() const;
|
|
// 拖动样式 0--不带橡皮巾; 1--待橡皮巾; 2--矩形拖曳
|
|
void SetUsageFlag(int nFlag);
|
|
// 矩形框角度
|
|
void SetRectAngle(double dAngle);
|
|
|
|
private:
|
|
|
|
int m_nRetCode; //返回码
|
|
const TCHAR *m_pszPrompt; //提示信息
|
|
const TCHAR *m_pszKeyword; //关键字
|
|
XDbOsnapPoint *m_pDrawEnt; //临时实体
|
|
XPoint m_ptTo;
|
|
int m_nOsShape;
|
|
};
|
|
|
|
// 为方便从数据库中开窗口搜索AcDbCurve的实体
|
|
class XCurvePickSet: public PickSet
|
|
{
|
|
|
|
protected:
|
|
|
|
XStringList m_lstLayerFilter, m_lstDxfNameFilter;
|
|
|
|
public:
|
|
|
|
XCurvePickSet();
|
|
void SetLayerFilter(XStringList &lstLay);
|
|
void SetDxfNameFilter(XStringList &lstDxf);
|
|
int GetByCrossing(const XPoint &ptLow, const XPoint &ptUp);
|
|
|
|
};
|
|
|
|
|
|
class TGSelectRoom
|
|
{
|
|
public:
|
|
TGSelectRoom(){ m_dWidth = 0.0;m_dLength = 0.0;};
|
|
~TGSelectRoom(){};
|
|
//房间选择
|
|
int SelectRoom(double dAngle);
|
|
|
|
|
|
double GetRoomWidth();
|
|
double GetRoomLength();
|
|
|
|
protected:
|
|
|
|
double m_dWidth;
|
|
double m_dLength;
|
|
private:
|
|
|
|
};
|
|
#endif
|