+ else { // selection happens in OCC viewer(on body) of in the OB browser
+ if (aSelAttr) {
+ aGShape = aSelAttr->value();
+ }
+ }
+ if (aGShape.get() != NULL) {
+ // get plane parameters
+ std::shared_ptr<GeomAPI_Pln> aPlane = GeomAlgoAPI_FaceBuilder::plane(aGShape);
+ std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
+ gp_XYZ aXYZ = aDir->impl<gp_Dir>().XYZ();
+ double aTwist = 0.0;
+
+ // orienting projection is not needed: it is done in GeomAlgoAPI_FaceBuilder::plane
+ /*if (aGShape->impl<TopoDS_Shape>().Orientation() == TopAbs_REVERSED) {
+ aXYZ.Reverse();
+ }*/
+
+ myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
+ }
+ // 3. Clear text in the label
+ myLabel->setText("");
+ myLabel->setToolTip("");
+ disconnect(workshop()->selector(), SIGNAL(selectionChanged()),
+ this, SLOT(onSelectionChanged()));
+ // 4. deactivate face selection filter
+ activateFilters(false);
+
+ // 5. Clear selection mode and define sketching mode
+ //XGUI_Displayer* aDisp = workshop()->displayer();
+ //aDisp->closeLocalContexts();
+ emit planeSelected(plane());
+ // after the plane is selected in the sketch, the sketch selection should be activated
+ // it can not be performed in the sketch label widget because, we don't need to switch off
+ // the selection by any label deactivation, but need to switch it off by stop the sketch
+ activateSelection(true);
+
+ // 6. Update sketcher actions
+ XGUI_ActionsMgr* anActMgr = workshop()->actionsMgr();
+ anActMgr->update();
+ myWorkshop->viewer()->update();