Salome HOME
Corrections of examples path after install with scbi
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Actor.cxx
index 4848a0b11435e5d1360004e84f942f5f5416f8c0..7d12be8a179ffcdf6d645b16f9ff471ba4d77798 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include <HYDROGUI_Actor.h>
 #include <GEOM_PainterPolyDataMapper.h>
@@ -6,6 +23,26 @@
 #include <GEOM_EdgeSource.h>
 #include <GEOM_WireframeFace.h>
 #include <GEOM_ShadingFace.h>
+#include <VTKViewer_TransformFilter.h>
+#include <vtkAppendPolyData.h>
+#include <VTKViewer_Transform.h>
+
+HYDROGUI_Actor::HYDROGUI_Actor()
+{ 
+  myVertexActor->GetDeviceActor()->SetMapper( myVertexActor->GetDeviceActor()->GetMapper() );
+  myIsolatedEdgeActor->GetDeviceActor()->SetMapper( myIsolatedEdgeActor->GetDeviceActor()->GetMapper() );
+  myOneFaceEdgeActor->GetDeviceActor()->SetMapper( myOneFaceEdgeActor->GetDeviceActor()->GetMapper() );
+  mySharedEdgeActor->GetDeviceActor()->SetMapper( mySharedEdgeActor->GetDeviceActor()->GetMapper() );
+  myWireframeFaceActor->GetDeviceActor()->SetMapper( myWireframeFaceActor->GetDeviceActor()->GetMapper() );
+  myShadingFaceActor->SetInput(myShadingFaceSource->GetOutputPort(),false); 
+  myShadingFaceActor->GetDeviceActor()->SetMapper( myShadingFaceActor->GetDeviceActor()->GetMapper() );
+  GEOM_Actor::myHighlightActor->GetDeviceActor()->SetMapper( GEOM_Actor::myHighlightActor->GetDeviceActor()->GetMapper() );
+} 
+HYDROGUI_Actor::~HYDROGUI_Actor() 
+{ 
+} 
 
 HYDROGUI_Actor* HYDROGUI_Actor::New()
 {
@@ -15,26 +52,20 @@ HYDROGUI_Actor* HYDROGUI_Actor::New()
 }
 
 void HYDROGUI_Actor::SetMapper( vtkMapper* theMapper )
-{ 
-  SALOME_Actor::SetMapper(theMapper); 
-}
-
-/*double* HYDROGUI_Actor::GetBounds()
 {
-  double* aBounds = GEOM_Actor::GetBounds();
-  return aBounds;
-}*/
+  SALOME_Actor::SetMapper( theMapper );
+}
 
 void HYDROGUI_Actor::SetTransform( VTKViewer_Transform* theTransform )
 {
-  SALOME_Actor::SetTransform( theTransform );
+  Superclass::SetTransform(theTransform);
   myVertexActor       ->GetDeviceActor()->SetTransform( theTransform );
   myIsolatedEdgeActor ->GetDeviceActor()->SetTransform( theTransform );
   myOneFaceEdgeActor  ->GetDeviceActor()->SetTransform( theTransform );
   mySharedEdgeActor   ->GetDeviceActor()->SetTransform( theTransform );
   myWireframeFaceActor->GetDeviceActor()->SetTransform( theTransform );
   myShadingFaceActor  ->GetDeviceActor()->SetTransform( theTransform );
-  myHighlightActor    ->GetDeviceActor()->SetTransform( theTransform );
+  GEOM_Actor::myHighlightActor->GetDeviceActor()->SetTransform( theTransform );
 }
 
 void HYDROGUI_Actor::SetShape( const TopoDS_Shape& theShape,
@@ -56,5 +87,11 @@ void HYDROGUI_Actor::SetShape( const TopoDS_Shape& theShape,
     myWireframeFaceActor->GetDeviceActor()->SetInfinitive( true );
 
   if( myShadingFaceSource->IsEmpty() )
+  {
     myShadingFaceActor->GetDeviceActor()->SetInfinitive( true );
+  }
+  else
+  {
+    myShadingFaceSource->Update();
+  }
 }