Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

74 lines
1.6 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