Salome HOME
Merge multi-study removal branch.
[modules/geom.git] / src / EntityGUI / EntityGUI.cxx
index 81e1b6272a4f26e8ffd28aae88b39e5d3486063e..019e0ad47ecfc812bffe84535a695a4a7ae17b2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewWindow.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Session.h>
 #include <SUIT_ViewWindow.h>
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
+#include "utilities.h"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
 #include "EntityGUI_SketcherDlg.h"        // Sketcher
 #include "EntityGUI_3DSketcherDlg.h"      // Sketcher
 #include "EntityGUI_IsolineDlg.h"         // Isoline
+#include "EntityGUI_SurfFromFaceDlg.h"    // Surface From Face
 #include "EntityGUI_SubShapeDlg.h"        // Method SUBSHAPE
 #include "EntityGUI_FeatureDetectorDlg.h" // Feature Detection
 #include "EntityGUI_PictureImportDlg.h"   // Import Picture in viewer
 #include "EntityGUI_FieldDlg.h"           // Create/Edit Field
+#include "EntityGUI_PolylineDlg.h"        // Create/Edit 2d polyline
 
 #include "GEOMImpl_Types.hxx"
 
@@ -105,6 +108,9 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpIsoline:    // ISOLINE
     aDlg = new EntityGUI_IsolineDlg( getGeometryGUI(), parent );
     break;
+  case GEOMOp::OpSurfaceFromFace:    // SURFACE FROM FACE
+    aDlg = new EntityGUI_SurfFromFaceDlg( getGeometryGUI(), parent );
+    break;
   case GEOMOp::OpExplode:    // EXPLODE
     aDlg = new EntityGUI_SubShapeDlg( getGeometryGUI(), parent );
     break;
@@ -188,6 +194,10 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
     SUIT_MessageBox::warning(parent, tr("WRN_WARNING"), tr("NO_FIELD"));
     break;
   }
+  case GEOMOp::Op2dPolylineEditor: // POLYLINE EDITOR
+    getGeometryGUI()->ActiveWorkingPlane();
+    aDlg = new EntityGUI_PolylineDlg( getGeometryGUI(), parent );
+    break;
   default:
     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
     break;
@@ -224,9 +234,9 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
     
         ic->InitSelected();
         if ( pe->modifiers() == Qt::ShiftModifier )
-          ic->ShiftSelect();  // Append selection
+          ic->ShiftSelect( Standard_True );  // Append selection
         else
-          ic->Select();       // New selection
+          ic->Select( Standard_True );       // New selection
 
         ic->InitSelected();
         if ( ic->MoreSelected() ) {
@@ -253,7 +263,7 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
         Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();   
 
         ic->InitSelected();
-        ic->Select();       // New selection
+        ic->Select( Standard_True );       // New selection
 
         ic->InitSelected();
         TopoDS_Shape aShape;
@@ -354,12 +364,8 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
   try {
     if ( !S1.IsNull() ) {
       /* erase any previous */
-#if OCC_VERSION_LARGE <= 0x06060000
-      ic->Erase( mySimulationShape1, Standard_True, Standard_False );
-#else
       ic->Erase( mySimulationShape1, Standard_True );
-#endif
-      ic->ClearPrs( mySimulationShape1 );
+      ic->ClearPrs( mySimulationShape1, 0, Standard_True );
 
       mySimulationShape1 = new AIS_Shape( TopoDS_Shape() );
       mySimulationShape1->Set( S1 );
@@ -370,12 +376,8 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
       mySimulationShape1->UnsetColor();
     }
     if ( !S2.IsNull() ) {
-#if OCC_VERSION_LARGE <= 0x06060000
-      ic->Erase( mySimulationShape2, Standard_True, Standard_False );
-#else
       ic->Erase( mySimulationShape2, Standard_True );
-#endif
-      ic->ClearPrs( mySimulationShape2 );
+      ic->ClearPrs( mySimulationShape2, 0, Standard_True );
 
       mySimulationShape2 = new AIS_Shape( TopoDS_Shape() );
       mySimulationShape2->Set( S2 );
@@ -418,15 +420,10 @@ void EntityGUI::EraseSimulationShape()
     if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
       OCCViewer_Viewer* v3d = ( (OCCViewer_ViewManager*)( vw->getViewManager() ) )->getOCCViewer();
       Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
-#if OCC_VERSION_LARGE <= 0x06060000
-      ic->Erase( mySimulationShape1, Standard_True, Standard_False );
-      ic->Erase( mySimulationShape2, Standard_True, Standard_False );
-#else 
       ic->Erase( mySimulationShape1, Standard_True );
       ic->Erase( mySimulationShape2, Standard_True );
-#endif
-      ic->ClearPrs( mySimulationShape1 );
-      ic->ClearPrs( mySimulationShape2 );
+      ic->ClearPrs( mySimulationShape1, 0, Standard_True );
+      ic->ClearPrs( mySimulationShape2, 0, Standard_True );
       ic->UpdateCurrentViewer();
     } 
   }