]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Feature #229: Showing objects in VTK: Faces are shaded now in the same way as in...
authorrkv <rkv@opencascade.com>
Mon, 16 Dec 2013 05:42:02 +0000 (05:42 +0000)
committerrkv <rkv@opencascade.com>
Mon, 16 Dec 2013 05:42:02 +0000 (05:42 +0000)
src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx
src/HYDROGUI/HYDROGUI_VTKPrsShape.h

index 7512b0a39276be343d805dd695e0bd1badebc342..3a841ee33cbc9c67aabb2437ab98256d1321a0a6 100644 (file)
@@ -69,7 +69,8 @@ const double VTK_MIN_DEFLECTION = 0.001;
 // Purpose : Constructor
 //=======================================================================
 HYDROGUI_VTKPrsShape::HYDROGUI_VTKPrsShape( const Handle(HYDROData_Entity)& theObject )
-: HYDROGUI_VTKPrs( theObject )
+: HYDROGUI_VTKPrs( theObject ),
+myDisplayMode( GEOM_Actor::eWireframe )
 {
 }
 
@@ -95,6 +96,7 @@ void HYDROGUI_VTKPrsShape::compute()
     {
       GEOM_Actor* anActor = GEOM_Actor::New();
       anActor->SetShape( myTopoShape, VTK_MIN_DEFLECTION );
+      anActor->setDisplayMode( myDisplayMode );
       anActor->setIO( getIO() );
       AddObject( anActor );
 
@@ -146,6 +148,7 @@ void HYDROGUI_VTKPrsShape::buildShape()
           setWire( aPolylineWire, false, false );  
         } else {
           myTopoShape = aPolylineShape;
+          myDisplayMode = GEOM_Actor::eWireframe;
         }
       }
 
@@ -165,6 +168,7 @@ void HYDROGUI_VTKPrsShape::buildShape()
           setWire( aPolylineWire, false, false );  
         } else {
           myTopoShape = aPolylineShape;
+          myDisplayMode = GEOM_Actor::eWireframe;
         }
       }
 
@@ -267,15 +271,16 @@ void HYDROGUI_VTKPrsShape::buildShape()
 }
 
 void HYDROGUI_VTKPrsShape::setWire( const TopoDS_Wire& theWire,
-                              const bool         theToDisplay,
-                              const bool         theIsUpdateViewer )
+                                    const bool         theToDisplay,
+                                    const bool         theIsUpdateViewer )
 {
   myTopoShape = theWire;
+  myDisplayMode = GEOM_Actor::eWireframe;
 }
 
 void HYDROGUI_VTKPrsShape::setFaces( const TopoDS_Compound& theWires,
-                               const bool             theToDisplay,
-                               const bool             theIsUpdateViewer )
+                                     const bool             theToDisplay,
+                                     const bool             theIsUpdateViewer )
 {
   TopExp_Explorer anExp( theWires, TopAbs_WIRE );
   TopoDS_Compound aCompound;
@@ -296,11 +301,12 @@ void HYDROGUI_VTKPrsShape::setFaces( const TopoDS_Compound& theWires,
   }
 
   myTopoShape = aCompound;
+  myDisplayMode = GEOM_Actor::eShading;
 }
 
 void HYDROGUI_VTKPrsShape::setFace( const TopoDS_Wire& theWire,
-                              const bool         theToDisplay,
-                              const bool         theIsUpdateViewer )
+                                    const bool         theToDisplay,
+                                    const bool         theIsUpdateViewer )
 {
   BRepBuilderAPI_MakeFace aFaceBuilder( theWire, Standard_True );
   aFaceBuilder.Build();
@@ -312,15 +318,17 @@ void HYDROGUI_VTKPrsShape::setFace( const TopoDS_Wire& theWire,
 }
 
 void HYDROGUI_VTKPrsShape::setFace( const TopoDS_Face& theFace,
-                              const bool         theToDisplay,
-                              const bool         theIsUpdateViewer )
+                                    const bool         theToDisplay,
+                                    const bool         theIsUpdateViewer )
 {
   myTopoShape = theFace;
+  myDisplayMode = GEOM_Actor::eShading;
 }
 
 void HYDROGUI_VTKPrsShape::setShape( const TopoDS_Shape& theShape,
-                               const bool          theToDisplay,
-                               const bool          theIsUpdateViewer )
+                                     const bool          theToDisplay,
+                                     const bool          theIsUpdateViewer )
 {
   myTopoShape = theShape;
+  myDisplayMode = GEOM_Actor::eShading;
 }
index 54d9e471416a475748faf8d3c6a1d23ca7eca159..5492a1f9e5c73e091a3ca2a156d21095526ae21b 100644 (file)
@@ -83,7 +83,8 @@ protected:
 private:
   vtkWeakPointer< vtkScalarsToColors > myLookupTable;
   vtkNew< vtkPolyDataMapper >          myMapper;
-  TopoDS_Shape                   myTopoShape;
+  TopoDS_Shape                         myTopoShape;
+  int                                  myDisplayMode;
 };
 
 #endif