106 lines
2.1 KiB
C++
106 lines
2.1 KiB
C++
#if !defined(__KTDimLeaderJIG_H__)
|
|
#define __KTDimLeaderJIG_H__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
class KTDimLeaderJig : public AcEdJig
|
|
{
|
|
public:
|
|
KTDimLeaderJig();
|
|
virtual ~KTDimLeaderJig();
|
|
|
|
// 拖放创建护栏,返回的曲线内存由调用者管理
|
|
BOOL DragCreate(AcGePoint3d ptBase, double dTextH,double dTextW,int ntype,LPCTSTR pszup,
|
|
LPCTSTR pszdown,LPCTSTR pszPrompt,AcDbObjectId idSt,AcDbObjectId idLayer, AcDbVoidPtrArray& arpEnt);
|
|
|
|
protected:
|
|
virtual AcEdJig::DragStatus sampler();
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
|
|
AcGePoint3d m_ptLast;
|
|
AcGePoint3d m_ptFirst;
|
|
AcGePoint3d m_ptUp,m_ptDown;
|
|
|
|
|
|
AcDbLine* m_Line1;
|
|
AcDbLine* m_Line2;
|
|
AcDbMText *m_ptextu;
|
|
AcDbMText *m_ptextd;
|
|
|
|
double m_dTextH;
|
|
double m_dTextW;
|
|
|
|
|
|
AcDbObjectId m_idTextS;
|
|
AcDbObjectId m_idTextL;
|
|
|
|
CString m_sTextup;
|
|
CString m_sTextdown;
|
|
int m_ntype;
|
|
public:
|
|
AcGePoint3d m_ptDynamic;
|
|
|
|
|
|
class KTDumbEntity : public AcDbEntity
|
|
{
|
|
public:
|
|
KTDumbEntity() {}
|
|
virtual ~KTDumbEntity() {}
|
|
void FreeEntsBuffer(AcDbVoidPtrArray& arPtrs)
|
|
{
|
|
AcDbEntity* pEnt = NULL;
|
|
while (arPtrs.length() > 0)
|
|
{
|
|
pEnt = (AcDbEntity*)arPtrs.first();
|
|
if (pEnt != NULL)
|
|
delete pEnt;
|
|
arPtrs.removeFirst();
|
|
}
|
|
}
|
|
virtual Adesk::Boolean subWorldDraw(AcGiWorldDraw* mode)
|
|
{
|
|
assertReadEnabled();
|
|
AcDbVoidPtrArray arPtrs;
|
|
AcDbEntity* pEnt;
|
|
int iLen = m_arpEntity.length();
|
|
for (int i = 0; i < iLen; i++)
|
|
{
|
|
pEnt = AcDbEntity::cast((AcDbObject*)m_arpEntity[i]);
|
|
if (pEnt == NULL)
|
|
continue;
|
|
|
|
AcDbMText * pMtext = AcDbMText::cast(pEnt);
|
|
if (pMtext != NULL)
|
|
{
|
|
pMtext->explode(arPtrs);
|
|
for (int j = 0;j<arPtrs.length();j++)
|
|
{
|
|
pEnt = AcDbEntity::cast((AcDbObject*)arPtrs[j]);
|
|
pEnt->worldDraw(mode);
|
|
}
|
|
FreeEntsBuffer(arPtrs);
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
pEnt->worldDraw(mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Adesk::kTrue;
|
|
}
|
|
|
|
AcDbVoidPtrArray m_arpEntity;
|
|
};
|
|
|
|
KTDumbEntity m_cDumbEntity;
|
|
};
|
|
|
|
#endif // !defined(__KTDimLeaderJIG_H__)
|