if (aPreviewOp)
{
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected();
- std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted();
+ // refill the features list with avoiding of the features, obtained only by vertex shape (TODO)
+ std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected(TopAbs_VERTEX);
+ std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted(TopAbs_VERTEX);
aPreviewOp->init(theFeature, aSelected, aHighlighted);
}
myWorkshop->actionsMgr()->updateCheckState();
}*/
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected()
+std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected(const int theShapeTypeToSkip)
{
std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
std::list<XGUI_ViewerPrs> aPresentations;
for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
TopoDS_Shape aShape = aContext->SelectedShape();
+ if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
+ continue;
boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
return aPresentations;
}
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted()
+std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted(const int theShapeTypeToSkip)
{
std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
std::list<XGUI_ViewerPrs> aPresentations;
for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
Handle(AIS_InteractiveObject) anIO = aContext->DetectedInteractive();
TopoDS_Shape aShape = aContext->DetectedShape();
+ if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
+ continue;
boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
aContext->ClearCurrents(false);
aContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
// set mouse sensitivity
- aContext->SetSensitivityMode(StdSelect_SM_WINDOW);
- aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
+ //aContext->SetSensitivityMode(StdSelect_SM_WINDOW);
+ //aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
}
// display or redisplay presentation
Handle(AIS_Shape) anAIS;
// const bool isUpdateViewer = true);
/// Returns a list of viewer selected presentations
+ /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
/// \return list of presentations
- std::list<XGUI_ViewerPrs> GetSelected();
+ std::list<XGUI_ViewerPrs> GetSelected(const int theShapeTypeToSkip = -1);
/// Returns a list of viewer highlited presentations
+ /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build
/// \return list of presentations
- std::list<XGUI_ViewerPrs> GetHighlighted();
+ std::list<XGUI_ViewerPrs> GetHighlighted(const int theShapeTypeToSkip = -1);
/// Display the shape and activate selection of sub-shapes
/// \param theFeature a feature instance