]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Erase and nullify the shape for invalid profile.
authormzn <mzn@opencascade.com>
Mon, 2 Dec 2013 06:48:05 +0000 (06:48 +0000)
committermzn <mzn@opencascade.com>
Mon, 2 Dec 2013 06:48:05 +0000 (06:48 +0000)
src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx
src/HYDROGUI/HYDROGUI_Shape.cxx

index 531283864e94314f5640f8b3515e496e1d12df5a..269cd83e7d2f72e0ed9941e7612f72f263b0a584 100644 (file)
@@ -67,10 +67,8 @@ void HYDROGUI_GeoreferencementOp::startOperation()
   aPanel->reset();
 
   if ( myInitialMode == All ) {
-    //@MZN aPanel->setMode( anAllMode );
     onModeActivated( HYDROGUI_GeoreferencementDlg::AllProfiles );
   } else if ( myInitialMode == Selected ) {
-    //@MZN aPanel->setMode( aSelectionMode );
     onModeActivated( HYDROGUI_GeoreferencementDlg::SelectedProfiles );
   }
 
index f37fe90051c061ca6b1765bd183b3482b294862b..9e36f73d2307986c0eb7ae74eb90949fe407f5b1 100644 (file)
@@ -291,22 +291,18 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
       Handle(HYDROData_Profile) aProfile =
         Handle(HYDROData_Profile)::DownCast( myObject );
 
+      TopoDS_Wire aProfileWire;
+
       if ( aProfile->IsValid() ) {
         TopoDS_Shape aProfileShape = aProfile->GetShape3D();
 
-        if ( !aProfileShape.IsNull() ) {
-          if ( aProfileShape.ShapeType() == TopAbs_WIRE ) {
-            TopoDS_Wire aProfileWire = TopoDS::Wire( aProfileShape );
-            setWire( aProfileWire, false, false );  
-          } else {
-            myTopoShape = aProfileShape;
-            myDisplayMode = AIS_WireFrame;
-
-            buildShape();
-            updateShape( false, false );
-          }
+        if ( !aProfileShape.IsNull() && 
+             aProfileShape.ShapeType() == TopAbs_WIRE ) {
+          aProfileWire = TopoDS::Wire( aProfileShape );
         }
       }
+
+      setWire( aProfileWire, false, false );  
     }
   }
  
@@ -483,8 +479,10 @@ void HYDROGUI_Shape::buildShape()
   // Erase previously created shape
   erase();
 
-  if ( myTopoShape.IsNull() )
+  if ( myTopoShape.IsNull() ) {
+    myShape.Nullify();
     return;
+  }
 
   QString aTextureFileName = getTextureFileName();
   bool anIsTexture = !aTextureFileName.isEmpty();