Salome HOME
refs #1327: debug of scaling operations
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index ba8a9d8fb85d1094aedfa3ac9270371762d13660..c34f2cc9522f4807a01529c4c8848175aa1fc626 100644 (file)
@@ -424,10 +424,11 @@ void HYDROGUI_Shape::setFace( const TopoDS_Face& theFace,
 
 void HYDROGUI_Shape::setShape( const TopoDS_Shape& theShape,
                                const bool          theToDisplay,
-                               const bool          theIsUpdateViewer )
+                               const bool          theIsUpdateViewer,
+                               const int           theDisplayMode )
 {
   myTopoShape = theShape;
-  myDisplayMode = AIS_Shaded;
+  myDisplayMode = theDisplayMode;
 
   buildShape();
   updateShape( theToDisplay, theIsUpdateViewer );
@@ -479,10 +480,10 @@ void HYDROGUI_Shape::setZLayer( const int theZLayer )
     myContext->SetZLayer( myShape, myZLayer );
 }
 
-Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
+Handle(AIS_InteractiveObject) HYDROGUI_Shape::createShape() const
 {
   if( myTopoShape.IsNull() ) {
-    return Handle_AIS_InteractiveObject();
+    return Handle(AIS_InteractiveObject)();
   }
 
   TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType();
@@ -506,13 +507,13 @@ Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
 void HYDROGUI_Shape::buildShape()
 {
   // Erase previously created shape
-  erase();
+  erase(false);
 
   myShape = createShape();
   if( myShape.IsNull() )
     return;
 
-  Handle_AIS_Shape anAISShape = Handle_AIS_Shape::DownCast( myShape );
+  Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( myShape );
   if( !anAISShape.IsNull() )
     anAISShape ->SetHLRAngleAndDeviation( 0.001 );
 
@@ -522,9 +523,8 @@ void HYDROGUI_Shape::buildShape()
   if ( !myObject.IsNull() && !myObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) )
     myShape->SetTransparency( 0 );
   myShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode );
-  myShape->SetSelectionMode( (Standard_Integer)mySelectionMode );
 
-    // Init default params for shape
+  // Init default params for shape
   const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes();
   if ( !anAttributes.IsNull() )
   {
@@ -676,4 +676,4 @@ void HYDROGUI_Shape::setDisplayMode( int theDisplayMode )
 void HYDROGUI_Shape::setSelectionMode( int theSelectionMode )
 {
   mySelectionMode = theSelectionMode;
-}
\ No newline at end of file
+}