occ添加新的捕捉模式

时间:2024-10-26 14:37:32

Load (theSelection,
theShape,
theType,
theDeflection,
theDeviationAngle,
isAutoTriangulation,
thePriority,
theNbPOnEdge,
theMaxParam);

// loading of selectables...
for (theSelection->Init(); theSelection->More(); theSelection->Next())
{
Handle(SelectMgr_EntityOwner) anOwner
= Handle(SelectMgr_EntityOwner)::DownCast (theSelection->Sensitive()->OwnerId());
anOwner->Set (theSelectableObj);
}

每一种捕捉模式都对应一个the Selection->Next()

如果想加入垂足捕捉,切点捕捉,则重新加入一种模式就可以了

myStdFilters[IMode] = new StdSelect_ShapeTypeFilter(aType);

加入一种新的挑选模式

void SelectMgr_Selection
::Add (const Handle(SelectBasics_SensitiveEntity)& aprimitive)
{
// if input is null:
// in debug mode raise exception
Standard_NullObject_Raise_if
(aprimitive.IsNull(), "Null sensitive entity is added to the selection");
// in release mode do not add
if (!aprimitive.IsNull())
myentities.Append(aprimitive);  myEntities在一个模式下,所有可以选择的实体
}