opencascade 设置选择过滤器

发布时间 2024-01-02 10:32:10作者: drink_crow

如果 occ 提供几个类不能满足,可以参考如下代码

class myfilter : public SelectMgr_Filter {
public:
  using SelectMgr_Filter::SelectMgr_Filter;
  
  // 过滤掉文字标签对象
  virtual Standard_Boolean IsOk(const Handle< SelectMgr_EntityOwner > &anObj) const override {
    return !anObj->Selectable()->IsKind(STANDARD_TYPE(AIS_TextLabel));
  }
}


...
context->AddFilter(new myfilter);