Files
envi-code/SourceCode/Code2026/tg_shs/shs_annotate/SymbolAnnotateJig.h
T

446 lines
9.5 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#ifndef _SYMBOLANNOTATE_JIG_H_
2026-09-28 15:28:50 +08:00
#define _SYMBOLANNOTATE_JIG_H_
#include "EdJigEx.h"
#include "ElevDlg.h"
#include "IndexDimDlg.h"
#include "LeaderTextDlg.h"
#include "coorddlg.h"
#include "SectionDlg.h"
2026-10-04 00:04:20 +08:00
//以下类是从EditSymbolAnnotate.cpp文件中分离出来 by lgy 20120109
2026-09-28 15:28:50 +08:00
extern TARCH_IMPEXP int g_bTextAdjust;
//extern AcDbObjectId InitTextStyle(const TCHAR *pszStyle);
extern GEOAPI int DragPickSet(PickSet &ss, XPoint &ptBase);
//extern TARCH_IMPEXP int DragMovePickSet(PickSet &ss, const TCHAR *pszPrompt, const XPoint &ptBase, XPoint &ptFinal);
2026-10-04 00:04:20 +08:00
extern int TARCH_IMPEXP g_nSymbArrowStyle; // sg add 090119,JIG过程中支持预览箭头样式
2026-09-28 15:28:50 +08:00
extern XPoint pptfirst;
static double sAngle;
extern XPoint pptfirst_; // [11/12/2007 nsh]
extern double sAngle_;
2026-10-04 00:04:20 +08:00
// Command:作法标注
2026-09-28 15:28:50 +08:00
class TComposingEdJig : public TSymbEdJig {
public:
enum TComposingOper {kNone=0, kTextLine=1, kTurnPoint=2,};
protected:
TComposingOper m_nOperCode;
// 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;
}
};
2026-10-04 00:04:20 +08:00
// add by xly on 100916 有圆点时的jig方式
2026-09-28 15:28:50 +08:00
class TComposingAddOtherPtJig : public TSymbEdJig
{
public:
TComposingAddOtherPtJig(XPoint ptStart, XPoint ptBase);
public:
2026-10-04 00:04:20 +08:00
AcGePoint3d m_ptLeader; // 引线的拐点
AcGePoint3d m_ptFirstVertexes; // 引线的端点
AcDbLine m_line; // 引线
2026-09-28 15:28:50 +08:00
public:
int DoIt(int *pKeyIndex = NULL);
virtual DragStatus GetPoint(AcGePoint3d &pt);
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
};
2026-10-04 00:04:20 +08:00
// Command: 指向索引
2026-09-28 15:28:50 +08:00
class TIndexPointerEdJig : public TSymbEdJig
{
public:
enum TIndexOper {
kNone = 0,
kSourceExtent = 1,
kTurnPoint = 2,
kTextBasePoint = 3,
kViewDirection = 4,
2026-10-04 00:04:20 +08:00
kAddedTurn = 5, // 剖切线中多出来的那个点
kMoreCuts = 6, // 其他剖切点
2026-09-28 15:28:50 +08:00
};
2026-10-04 00:04:20 +08:00
double m_dFixAngle; // add by cwk on 060706,固定角度值
2026-09-28 15:28:50 +08:00
bool m_bFixAngle;
protected:
TIndexOper m_nOperCode;
TDbSymbIndexPointer *m_pDrawEnt; // I/O
AcDbCircle m_drawEnt;
CArray<XLine, XLine&> m_arCutAdded;
XLine m_cutCurrDrag;
CIndexDimDlg *m_pDlg; //
public:
TIndexPointerEdJig(TDbSymbIndexPointer *);
int DoIt(int *pKeyIndex = NULL);
void AttachDlg(CIndexDimDlg* pDlg) {m_pDlg = pDlg;}
2026-10-04 00:04:20 +08:00
// 根据索引初始化索引线
2026-09-28 15:28:50 +08:00
void InitCutLine();
protected:
virtual AcEdJig::DragStatus GetPoint(XPoint &pt);
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
public:
void SetOperCode(TIndexPointerEdJig::TIndexOper opCode) {
m_nOperCode = opCode;
}
};
// Add by lcf on 2005-06-24
/////////////////////////////////////////////////////////////
2026-10-04 00:04:20 +08:00
// Command:箭头引注
2026-09-28 15:28:50 +08:00
class TArrowEdJig : public TSymbEdJig
{
public:
enum TArrowOper {kNone=0, kLinePoint=1, kArcPoint=2, kArcMidPoint=3, kArcRadius=4};
protected:
TArrowOper m_nOperCode;
TDbSymbArrow *m_pDrawEnt;
BOOL m_bFirst;
public:
TArrowEdJig(TDbSymbArrow *);
virtual int DoIt(int *pKeyIndex = NULL);
virtual DragStatus GetPoint(XPoint &pt);
protected:
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
public:
void SetOperCode(TArrowEdJig::TArrowOper opCode) { m_nOperCode = opCode; }
TArrowOper GetOperCode() {return m_nOperCode;}
};
//////////////////////////////////////////////////////////////////////////
2026-10-04 00:04:20 +08:00
// 坐标标注
2026-09-28 15:28:50 +08:00
// [10/22/2007 nsh]
2026-10-04 00:04:20 +08:00
static CString dAngle; // 保存角度
static XPoint savePoint; // 保存第一点的坐标
2026-09-28 15:28:50 +08:00
// --end--
class TCoordEdJig : public TSymbEdJig
{
protected:
// I/O
TDbSymbCoord *m_pDrawEnt;
public:
TCoordEdJig(TDbSymbCoord *);
virtual int DoIt();
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
public:
// [10/19/2007 nsh]
2026-10-04 00:04:20 +08:00
double m_dFixAngle; // 得到固定的角度值
BOOL m_bFixAngle; // 判断时候选定了固定角度的选项
2026-09-28 15:28:50 +08:00
// --end--
2026-10-04 00:04:20 +08:00
XPoint m_saveFirstPt; // sg add 120618,记忆第1点坐标,主要为了接收外面传过来的值,给savePoint赋值
2026-09-28 15:28:50 +08:00
};
// Add by lcf 2005-06-30
2026-10-04 00:04:20 +08:00
// 图名标注
2026-09-28 15:28:50 +08:00
class TDrawingNameJig : public AcEdJig
{
public:
TDrawingNameJig(TDbDrawingName *pEnt);
int start(int *pKeyIndex = NULL);
AcDbEntity* entity() const;
DragStatus sampler();
Adesk::Boolean update();
void SetPrompt(const TCHAR *pszPrompt);
void SetKeyword(const TCHAR *pszKeyword);
private:
2026-10-04 00:04:20 +08:00
const TCHAR *m_pszPrompt; //提示信息
const TCHAR *m_pszKeyword; //关键字
TDbDrawingName *m_pDrawEnt; //临时实体
2026-09-28 15:28:50 +08:00
AcGePoint3d m_ptIns;
};
class TLeaderEdJig : public TSymbEdJig
{
public:
enum TLeaderOper { kNone=0, kLeader=1, kTextLine=2, kVertex=3, };
// add by cwk
double m_dFixAngle;
BOOL m_bFixAngle;
protected:
2026-10-04 00:04:20 +08:00
// 输入
2026-09-28 15:28:50 +08:00
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;
2026-10-04 00:04:20 +08:00
//add by lgy 20120206 引出标注角度固定角度不起作用
2026-09-28 15:28:50 +08:00
void SetDlg(CLeaderDlg *pLeadDlg);
CLeaderDlg *m_pDlg;
public:
void SetOperCode(TLeaderEdJig::TLeaderOper nCode)
{
m_nOperCode = nCode;
}
};
2026-10-04 00:04:20 +08:00
// sg add 090330,引出标注,添加其他点时使用
2026-09-28 15:28:50 +08:00
class TLeaderAddOtherPtJig : public TSymbEdJig
{
public:
AcGePoint3d m_ptLeader;
AcGePoint3d m_ptFirstVertexes;
AcDbLine m_line;
2026-10-04 00:04:20 +08:00
BOOL m_bUpdateDlg; // 兼顾对象编辑和绘制对话框,标志是否时时获取对话框上的“多点共线”
2026-09-28 15:28:50 +08:00
CLeaderDlg *m_pDlg;
BOOL m_bAllOnLine;
2026-10-04 00:04:20 +08:00
double m_nLayoutRotation;//引线平行 add by lxb on 111229
BOOL m_bLeaderParall; //对象编辑时,对象是否带有引线平行属性
2026-09-28 15:28:50 +08:00
public:
2026-10-04 00:04:20 +08:00
TLeaderAddOtherPtJig(CLeaderDlg *pDlg, XPoint ptStart, XPoint ptBase,double dLayoutRotation); // 绘制函数调用
TLeaderAddOtherPtJig(BOOL bAllPtsOnLine, XPoint ptStart, XPoint ptBase,double dLayoutRotation,BOOL b); // 对象编辑调用
2026-09-28 15:28:50 +08:00
int DoIt(int *pKeyIndex = NULL);
virtual DragStatus GetPoint(XPoint &pt);
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
};
2026-10-04 00:04:20 +08:00
//绘制索引编号的JIG类TDrawingIndexEdJig
2026-09-28 15:28:50 +08:00
//add by lxb on 2011/12/21
class TDrawingIndexEdJig:public AcEdJig
{
public:
TDrawingIndexEdJig(TDbSymbDrawingIndex *pEnt,TCHAR *pszPormat,TCHAR *pszKeyWord);
~TDrawingIndexEdJig();
virtual AcEdJig::DragStatus sampler();
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
AcEdJig::DragStatus doIt();
private:
TDbSymbDrawingIndex *m_pEnt;
2026-10-04 00:04:20 +08:00
AcGePoint3d m_ptCur; //鼠标当前坐标
2026-09-28 15:28:50 +08:00
AcGePoint3d m_ptLast;
2026-10-04 00:04:20 +08:00
TCHAR *m_pszPormat; //提示语
2026-09-28 15:28:50 +08:00
TCHAR *m_pszKeyWord;
};
class TElevEdJig : public TSymbEdJig
{
public:
enum TElevOper { kNone=0, kDirection=1, kBaseLine=2, kLeader=3, kMove=4};
double m_dPointX;
AcGePoint3d m_ptBase;
double m_fBaseElev; // M
protected:
2026-10-04 00:04:20 +08:00
// 输入
2026-09-28 15:28:50 +08:00
TElevEdJig::TElevOper m_nOperCode;
// I/O
TDbSymbElevation *m_pDrawEnt;
public:
TElevEdJig(TDbSymbElevation *);
virtual 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(TElevEdJig::TElevOper nCode) {
m_nOperCode = nCode;
}
};
2026-10-04 00:04:20 +08:00
// 指北针
2026-09-28 15:28:50 +08:00
class TNorthThumbEdJig : public TSymbEdJig {
public:
enum TNorthOper {kNone=0, kCenter=1, kDirection=2, };
protected:
TNorthOper m_nOperCode;
// I/O
TDbSymbNorthThumb *m_pDrawEnt;
public:
TNorthThumbEdJig(TDbSymbNorthThumb *);
virtual int DoIt(int *pKeyIndex=NULL);
virtual DragStatus GetPoint(XPoint &pt);
virtual BOOL IsPosChanged(XPoint ptNew) const;
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
public:
void SetOperCode(TNorthThumbEdJig::TNorthOper opCode) {
m_nOperCode=opCode;
}
};
2026-10-04 00:04:20 +08:00
// 对称轴
2026-09-28 15:28:50 +08:00
class TSymmetryEdJig : public TSymbEdJig {
protected:
// I/O
TDbSymbSymmetry *m_pDrawEnt;
public:
TSymmetryEdJig(TDbSymbSymmetry *);
virtual DragStatus GetPoint(XPoint &pt);
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
};
2026-10-04 00:04:20 +08:00
// 剖面剖切
2026-09-28 15:28:50 +08:00
class TSectionEdJig : public TSymbEdJig {
public:
enum TSectionOper {kNone=0, kSectPoint=1, kSectPointOther=2, kViewDirection=3};
protected:
int GetRetCode(int nRetCode, int *kewyIdx=NULL) const;
protected:
TSectionOper m_nOperCode;
int m_iFlag2;
2026-10-04 00:04:20 +08:00
//add by lgy 20120320 添加改变量控制那种方式jig剖面符号
2026-09-28 15:28:50 +08:00
int m_nMode;
CSectionDlg *m_pDlg;
// I/O
TDbSymbSection *m_pDrawEnt;
TDbSymbSection m_drawEnt;
public:
TSectionEdJig(TDbSymbSection *);
int DoIt(int *pKeyIndex=NULL);
2026-10-04 00:04:20 +08:00
//add by lgy 20120320 设置剖面符号绘制的方式
2026-09-28 15:28:50 +08:00
void SetJigMode(int nMode);
2026-10-04 00:04:20 +08:00
void SetJigDlg(CSectionDlg *pDlg); //设置与jig交互的对话框
2026-09-28 15:28:50 +08:00
protected:
virtual AcEdJig::DragStatus GetPoint(XPoint &pt);
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
public:
void SetOperCode(TSectionEdJig::TSectionOper opCode) {
m_nOperCode=opCode;
}
int GetiFlag2();
};
2026-10-04 00:04:20 +08:00
//add by lgy 20120410 9.0新功能绘制云线
2026-09-28 15:28:50 +08:00
class TCloudLineJig : public TSymbEdJig
{
public:
TCloudLineJig(TDbSymbModi *pModi, XPoint ptFirst, double dMax, double dMin);
~TCloudLineJig();
public:
virtual int DoIt(int *pKeyIndex = NULL);
virtual DragStatus GetPoint(XPoint &pt);
protected:
virtual Adesk::Boolean update();
virtual AcDbEntity* entity() const;
private:
XPoint m_ptFirst;
double m_dMax;
double m_dMin;
XPoly2D m_pline;
TDbSymbModi *m_pModi;
};
#endif