102 lines
1.9 KiB
C++
102 lines
1.9 KiB
C++
#if !defined(__KTSideJig_H__)
|
|
#define __KTSideJig_H__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
class KTSideJig : public AcEdJig
|
|
{
|
|
public:
|
|
KTSideJig();
|
|
virtual ~KTSideJig();
|
|
|
|
// 拖放创建护栏,返回的曲线内存由调用者管理
|
|
BOOL DragCreate(AcGePoint3dArray& pts, double dTextH,double dTextW,CStringArray &stexts,
|
|
int ntype,LPCTSTR pszPrompt,AcDbObjectId idSt,AcDbObjectId idLayer, AcDbVoidPtrArray& arpEnt);
|
|
|
|
protected:
|
|
virtual AcEdJig::DragStatus sampler();
|
|
virtual Adesk::Boolean update();
|
|
virtual AcDbEntity* entity() const;
|
|
|
|
|
|
AcGePoint3d m_ptDynamic;
|
|
AcGePoint3d m_ptLast;
|
|
AcGePoint3d m_ptFirst;
|
|
AcGePoint3dArray m_pts;
|
|
|
|
AcDbVoidPtrArray m_pTexts;
|
|
|
|
double m_dTextH;
|
|
double m_dTextW;
|
|
|
|
|
|
AcDbObjectId m_idTextS;
|
|
AcDbObjectId m_idTextL;
|
|
|
|
CStringArray m_sTexts;
|
|
int m_ntype;
|
|
|
|
|
|
|
|
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(__KTSideJig_H__)
|