218 lines
6.4 KiB
C++
218 lines
6.4 KiB
C++
#include "stdafx.h"
|
|
#include "EdJigEx.h"
|
|
#include "DbSymbolAnnotate.h"
|
|
#include <DbDimension.h>
|
|
#include <TDbPipeMultDim.h>
|
|
#include <DbDoubleLinePipe.h>
|
|
|
|
// 为了编译通过,加4行
|
|
//static bool operator >(const XPoint&,const XPoint&){return false;}
|
|
//static bool operator <(const XPoint&,const XPoint&){return false;}
|
|
//static bool operator ==(const XPoint&,const XPoint&){return false;}
|
|
//static bool operator !=(const XPoint&,const XPoint&){return false;}
|
|
|
|
|
|
/********************************************************************
|
|
created: 2003/12/22
|
|
created: 22:12:2003 13:05
|
|
filename: f:\tg_dev\telecdev\twtkernal\jig.h
|
|
file path: f:\tg_dev\telecdev\twtkernal
|
|
file base: jig
|
|
file ext: h
|
|
author: 沈睿
|
|
|
|
purpose:
|
|
*********************************************************************/
|
|
|
|
|
|
// 拖曳显示点
|
|
class TDimensionEdJig : public AcEdJig
|
|
{
|
|
public:
|
|
TDimensionEdJig(TDbDimension2 *pDim, const TCHAR *pszPrompt, const TCHAR *pszKeyword=NULL);
|
|
~TDimensionEdJig();
|
|
int doIt();
|
|
virtual DragStatus sampler();
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
void Swap();
|
|
|
|
int GetRetCode(int *kwordId=NULL) const;
|
|
int m_nRetCode; //返回码
|
|
const TCHAR *m_pszPrompt; //提示信息
|
|
const TCHAR *m_pszKeyword; //关键字
|
|
TDbDimension2 *m_pDrawEnt; //临时实体,
|
|
TDbDimension2 *m_pTemp; //临时实体, 用于m_nFlag==3
|
|
|
|
XPoint m_ptDim;
|
|
int m_nFlag; //0--尺寸方向, 1--尺寸线位置, 2--第二个标注点, 3--其它标注点
|
|
|
|
//add by whl on 03/08/08
|
|
// DListStack<XPoint> ptStack;//标注点栈
|
|
// void Step();//当前点入栈
|
|
// void Undo();//撤消
|
|
// XPoint GetLastPoint();
|
|
// bool CanUndo();//是否可撤消
|
|
protected:
|
|
void FindAndRemoveSeg(XPoint pt);//由一标注点找出对应段并且正确去除之
|
|
};
|
|
|
|
class TLeaderEdJig : public TSymbEdJig {
|
|
public:
|
|
enum TLeaderOper { kNone=0, kLeader=1, kTextLine=2, kVertex=3, };
|
|
protected:
|
|
//输入
|
|
TLeaderEdJig::TLeaderOper m_nOperCode;
|
|
|
|
// I/O
|
|
TDbSymbMultiLeader *m_pDrawEnt;
|
|
public:
|
|
TLeaderEdJig(TDbSymbMultiLeader *);
|
|
int DoIt(int *pKeyIndex=NULL);
|
|
virtual DragStatus GetPoint(XPoint &pt);
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
XPoint GetDragPoint() const;
|
|
XPoint GetBasePoint() const;
|
|
public:
|
|
void SetOperCode(TLeaderEdJig::TLeaderOper nCode) {
|
|
m_nOperCode=nCode;
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class TDrawingIdxEdJig : public TSymbEdJig {
|
|
protected:
|
|
TDbSymbDrawingIndex *m_pDrawEnt;
|
|
public:
|
|
TDrawingIdxEdJig(TDbSymbDrawingIndex *pIdx);
|
|
virtual int DoIt(int *pKeyIndex=NULL);
|
|
DragStatus GetPoint(XPoint &pt);
|
|
XPoint m_ptRef;
|
|
protected:
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
};
|
|
|
|
|
|
|
|
//***************************************************************************************************
|
|
// 多管绘制
|
|
//***************************************************************************************************
|
|
|
|
class TMultPipePreview: public AcDbEntity
|
|
{
|
|
public:
|
|
TMultPipePreview(XPointList &lstPt, double nAng, BOOL bFromVPipe);
|
|
virtual ~TMultPipePreview();
|
|
virtual Adesk::Boolean subWorldDraw(AcGiWorldDraw *pWd);
|
|
XPointList m_lstStart, m_lstEnd, m_lstOld;
|
|
XPoint m_ptEnd;
|
|
double m_nAng;
|
|
BOOL m_bFromVPipe;
|
|
};
|
|
|
|
class TMultPipeJig : public TSymbEdJig {
|
|
protected:
|
|
XPoint m_ptStart, m_ptEnd;
|
|
public:
|
|
TMultPipePreview *m_pDrawEnt;
|
|
TMultPipeJig(XPointList &lstPt, double nAng, BOOL bFromVPipe);
|
|
~TMultPipeJig();
|
|
virtual int DoIt(int *pKeyIndex=NULL);
|
|
DragStatus GetPoint(XPoint &pt);
|
|
XPointList m_lstStart, m_lstEnd;
|
|
protected:
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
};
|
|
|
|
//***************************************************************************************************
|
|
// 绘制双管
|
|
//***************************************************************************************************
|
|
class TDoublePipeJig : public TSymbEdJig {
|
|
protected:
|
|
TDbDoubleLinePipe *m_pDrawEnt;
|
|
XPoint m_ptStart, m_ptEnd;
|
|
public:
|
|
TDoublePipeJig(XPoint pt1, BOOL bIsVPipe, double nWidth);
|
|
~TDoublePipeJig();
|
|
virtual int DoIt(int *pKeyIndex=NULL);
|
|
DragStatus GetPoint(XPoint &pt);
|
|
double m_nWidth;
|
|
BOOL m_bIsVPipe;
|
|
protected:
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
};
|
|
|
|
|
|
//***************************************************************************************************
|
|
// 绘制道路
|
|
//***************************************************************************************************
|
|
|
|
|
|
//class CRoadPreview: public AcDbEntity
|
|
//{
|
|
//public:
|
|
// CRoadPreview(XPoint ptStart, XPoint ptEnd, double nRoadWidth);
|
|
// virtual ~CRoadPreview();
|
|
// virtual Adesk::Boolean worldDraw(AcGiWorldDraw *pWd);
|
|
// XPoint m_ptStart, m_ptEnd;
|
|
// double m_nRoadWidth;
|
|
//};
|
|
//
|
|
//class TRoadJig : public TSymbEdJig {
|
|
//protected:
|
|
// CRoadPreview *m_pDrawEnt;
|
|
// XPoint m_ptStart, m_ptEnd;
|
|
//public:
|
|
// TRoadJig(XPoint pt1, double nRoadWidth);
|
|
// ~TRoadJig();
|
|
// virtual int DoIt(int *pKeyIndex=NULL);
|
|
// DragStatus GetPoint(XPoint &pt);
|
|
// double m_nRoadWidth;
|
|
// void SetStartPoint(XPoint pt);
|
|
// double m_nDist;
|
|
//protected:
|
|
// virtual Adesk::Boolean update();
|
|
// virtual AcDbEntity* entity() const;
|
|
//};
|
|
|
|
|
|
|
|
//***************************************************************************************************
|
|
// 多线引出
|
|
//***************************************************************************************************
|
|
|
|
class TComposingEdJig : public TSymbEdJig {
|
|
public:
|
|
enum TComposingOper {kNone=0, kTextLine=1, kTurnPoint=2, kDimPos=3};
|
|
|
|
//add for 多管引出标注
|
|
XPoint m_ptLeftUp,
|
|
m_ptRightUp,
|
|
m_ptLeftDown;
|
|
|
|
protected:
|
|
TComposingOper m_nOperCode;
|
|
CString m_cs1;
|
|
CString m_cs2;
|
|
|
|
// I/O
|
|
TDbSymbComposing *m_pDrawEnt;
|
|
public:
|
|
TComposingEdJig(TDbSymbComposing *);
|
|
virtual int DoIt(int *pKeyIndex=NULL);
|
|
DragStatus GetPoint(XPoint &pt);
|
|
protected:
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
public:
|
|
void SetOperCode(TComposingEdJig::TComposingOper opCode) {
|
|
m_nOperCode=opCode;
|
|
}
|
|
};
|