- }*/
- if (aGShape.get() != NULL) {
- // get plane parameters
- if (!aPlane.get()) {
- std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aGShape));
- aPlane = aFace->getPlane();
- }
- if (!aPlane.get())
- return;
- 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();
- }*/
-
- // Rotate view if the sketcher plane is selected only from preview planes
- // Preview planes are created only if there is no any shape
- bool aRotate = Config_PropManager::boolean(SKETCH_TAB_NAME, "rotate_to_plane");
- if (aRotate) {
- myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
- }
- PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
- if (aModule)
- aModule->onViewTransformed();