]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix for '0053430: 3D Sketch' issue.
authorrnv <rnv@opencascade.com>
Thu, 25 Aug 2016 12:21:19 +0000 (15:21 +0300)
committerrnv <rnv@opencascade.com>
Thu, 25 Aug 2016 12:21:19 +0000 (15:21 +0300)
src/EntityGUI/EntityGUI_3DSketcherDlg.cxx

index 47d1fd5d4ea41e78a3d5a188ce30b555717af69c..fd7b8688942cac1e6390adb2249e2156e106103e 100755 (executable)
@@ -1388,19 +1388,26 @@ void EntityGUI_3DSketcherDlg::displayTrihedron (int selMode)
 {
   // Add trihedron to preview
   SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
-
+  
+  SOCC_Viewer* anOCCViewer = dynamic_cast<SOCC_Viewer*>( vw->getViewManager()->getViewModel() );
+  if( !anOCCViewer )
+    return;
+  
+  Handle(AIS_InteractiveContext) anAISContext = anOCCViewer->getAISContext();
+  if( !anAISContext )
+    return;
+  
   gp_Pnt P(getLastPoint().x,getLastPoint().y,getLastPoint().z);
   Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(P,gp::DZ(),gp::DX());
   Handle(AIS_Trihedron) anIO = new AIS_Trihedron(anAxis);
-  anIO->GetContext()->Activate(anIO, selMode);
 
-  SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*>
-    (((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
+  SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*>( anOCCViewer->CreatePrs(0) );
 
   if (aSPrs) {
     aSPrs->PrependObject(anIO);
     GEOMBase_Helper::displayPreview(aSPrs, true, true);
   }
+  anAISContext->Activate(anIO, selMode);
 }
 
 //================================================================