|
[code]在下文中一共展示了AcDbEntity::highlight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: acdbOpenAcDbEntity
▲ 点赞 9 ▼
//
// This is where we take advantage of quite a bit of information
// provide by this big function to display multiline tooltip
// (new feature in Acad 2002) under the cursor aperture.
//
// It gets even more interesting when you mix it with OSNAP info.
//
// Have fun!
//
Acad::ErrorStatus
CSampleIPM::monitorInputPoint(
bool& bAppendToTooltipStr,
char*& pAdditionalTooltipString,
AcGiViewportDraw* pDrawContext,
AcApDocument* pDocument,
bool pointComputed,
int history,
const AcGePoint3d& lastPoint,
const AcGePoint3d& rawPoint,
const AcGePoint3d& grippedPoint,
const AcGePoint3d& cartesianSnappedPoint,
const AcGePoint3d& osnappedPoint,
AcDb::OsnapMask osnapMask,
const AcArray<AcDbCustomOsnapMode*>& customOsnapModes,
AcDb::OsnapMask osnapOverrides,
const AcArray<AcDbCustomOsnapMode*>& customOsnapOverrides,
const AcArray<AcDbObjectId>& apertureEntities,
const AcArray< AcDbObjectIdArray,
AcArrayObjectCopyReallocator< AcDbObjectIdArray > >& nestedApertureEntities,
const AcArray<int>& gsSelectionMark,
const AcArray<AcDbObjectId>& keyPointEntities,
const AcArray< AcDbObjectIdArray,
AcArrayObjectCopyReallocator< AcDbObjectIdArray > >& nestedKeyPointEntities,
const AcArray<int>& keyPointGsSelectionMark,
const AcArray<AcGeCurve3d*>& alignmentPaths,
const AcGePoint3d& computedPoint,
const char* pTooltipString)
{
char mtooltipStr[1024],
tempStr[100];
mtooltipStr[0] = '\0';
Acad::ErrorStatus es;
AcDbEntity* pEnt;
AcDbObjectId highlightId = AcDbObjectId::kNull;
if (pointComputed)
{
//
// Analyze the aperture entities.
//
if (apertureEntities.length() > 0)
{
if(strlen(mtooltipStr) > 0)
strcpy(mtooltipStr, "\nEntities under the cursor aperture:");
else
strcpy(mtooltipStr, "Entities under the cursor aperture:");
for (int i = 0; i < apertureEntities.length(); ++i)
{
if (Acad::eOk != (es = acdbOpenAcDbEntity(pEnt, apertureEntities[i], AcDb::kForRead)))
continue;
sprintf(tempStr, "\n %s%s%d%s", pEnt->isA()->name(), " <Object ID: ", pEnt->objectId(), ">");
strcat(mtooltipStr, tempStr);
pEnt->close();
// Analyze the nested aperture entities.
AcDbObjectIdArray nestedIds = nestedApertureEntities[i];
int length = nestedIds.length();
if (length > 1)
{
// There is a nested entitiy: get it.
AcDbEntity* pEnt2;
if (Acad::eOk == (es = acdbOpenAcDbEntity(pEnt2, nestedIds[length - 1], AcDb::kForRead))) {
sprintf(tempStr, "\n nested: %s", pEnt2->isA()->name());
strcat(mtooltipStr, tempStr);
pEnt2->close();
}
}
}
highlightId = apertureEntities[0];
}
//
// Analyze OSNAP.
//
if (history && Acad::eOsnapped)
{
char osnapInfo[500];
osnapInfo[0] = '\0';
switch (osnapMask)
{
case AcDb::kOsMaskEnd:
strcpy(osnapInfo, "\nOsnap:\n end");
break;
case AcDb::kOsMaskMid:
strcpy(osnapInfo, "\nOsnap:\n mid");
//.........这里部分代码省略.......[/code] |
|