74 lines
1.5 KiB
C++
74 lines
1.5 KiB
C++
#include "stdafx.h"
|
|
#include "TGripImp.h"
|
|
#include "TGripData.h"
|
|
|
|
#if (ADS>15)
|
|
const TCHAR* GripCback::GripToolTipFunc(AcDbGripData* pThis)
|
|
{
|
|
TWT_GRIPAPPDATA* pAppData = (TWT_GRIPAPPDATA*)pThis->appData();
|
|
if (pAppData != NULL)
|
|
{
|
|
return pAppData->sGripTip;
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
bool GripCback::WorldDrawfunc( AcDbGripData* pThis,
|
|
AcGiWorldDraw* pWd,
|
|
const AcDbObjectId& entId,
|
|
AcDbGripOperations::DrawType type,
|
|
AcGePoint3d* cursor,
|
|
double dGripSize)
|
|
{
|
|
|
|
AcGePoint3d point = pThis->gripPoint();
|
|
AcGeVector3d normal(0,0,1);
|
|
AcGePoint3d ptGe[2],ptRec[4];
|
|
|
|
//°´ 5 ¸öÏñËØµã
|
|
int nColor = pWd->subEntityTraits().color();
|
|
pWd->subEntityTraits().setColor(255);
|
|
AcGiFillType eFill = pWd->subEntityTraits().fillType();
|
|
pWd->subEntityTraits().setFillType(kAcGiFillAlways);
|
|
|
|
double dCmd = PixelToWcs(5);
|
|
double dOne = PixelToWcs(1);
|
|
|
|
//ˮƽ
|
|
ptGe[0] = point;
|
|
ptGe[0].x -= dCmd;
|
|
ptGe[1] = point;
|
|
ptGe[1].x += dCmd;
|
|
|
|
ptRec[0] = ptGe[0];
|
|
ptRec[0].y -= dOne;
|
|
ptRec[1] = ptGe[0];
|
|
ptRec[1].y += dOne;
|
|
ptRec[2] = ptGe[1];
|
|
ptRec[2].y += dOne;
|
|
ptRec[3] = ptGe[1];
|
|
ptRec[3].y -= dOne;
|
|
|
|
pWd->geometry().polygon(4,ptRec);
|
|
|
|
//´¹Ö±
|
|
ptGe[0] = point;
|
|
ptGe[0].y += dCmd;
|
|
ptGe[1] = point;
|
|
ptGe[1].y -= dCmd;
|
|
|
|
ptRec[0] = ptGe[0];
|
|
ptRec[0].x -= dOne;
|
|
ptRec[1] = ptGe[0];
|
|
ptRec[1].x += dOne;
|
|
ptRec[2] = ptGe[1];
|
|
ptRec[2].x += dOne;
|
|
ptRec[3] = ptGe[1];
|
|
ptRec[3].x -= dOne;
|
|
|
|
pWd->geometry().polygon(4,ptRec);
|
|
pWd->subEntityTraits().setFillType(eFill);
|
|
pWd->subEntityTraits().setColor(nColor);
|
|
return true;
|
|
}
|
|
#endif |