Salome HOME
4848a0b11435e5d1360004e84f942f5f5416f8c0
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Actor.cxx
1
2 #include <HYDROGUI_Actor.h>
3 #include <GEOM_PainterPolyDataMapper.h>
4 #include <GEOM_DeviceActor.h>
5 #include <GEOM_VertexSource.h>
6 #include <GEOM_EdgeSource.h>
7 #include <GEOM_WireframeFace.h>
8 #include <GEOM_ShadingFace.h>
9
10 HYDROGUI_Actor* HYDROGUI_Actor::New()
11 {
12   HYDROGUI_Actor* anObject = new HYDROGUI_Actor(); 
13   anObject->SetMapper( anObject->myPolyDataMapper.Get()); 
14   return anObject; 
15 }
16
17 void HYDROGUI_Actor::SetMapper( vtkMapper* theMapper )
18
19   SALOME_Actor::SetMapper(theMapper); 
20 }
21
22 /*double* HYDROGUI_Actor::GetBounds()
23 {
24   double* aBounds = GEOM_Actor::GetBounds();
25   return aBounds;
26 }*/
27
28 void HYDROGUI_Actor::SetTransform( VTKViewer_Transform* theTransform )
29 {
30   SALOME_Actor::SetTransform( theTransform );
31   myVertexActor       ->GetDeviceActor()->SetTransform( theTransform );
32   myIsolatedEdgeActor ->GetDeviceActor()->SetTransform( theTransform );
33   myOneFaceEdgeActor  ->GetDeviceActor()->SetTransform( theTransform );
34   mySharedEdgeActor   ->GetDeviceActor()->SetTransform( theTransform );
35   myWireframeFaceActor->GetDeviceActor()->SetTransform( theTransform );
36   myShadingFaceActor  ->GetDeviceActor()->SetTransform( theTransform );
37   myHighlightActor    ->GetDeviceActor()->SetTransform( theTransform );
38 }
39
40 void HYDROGUI_Actor::SetShape( const TopoDS_Shape& theShape,
41                                float theDeflection,
42                                bool theIsVector )
43 {
44   GEOM_Actor::SetShape( theShape, theDeflection, theIsVector ); 
45
46   if( myIsolatedEdgeSource->IsEmpty() )
47     myIsolatedEdgeActor->GetDeviceActor()->SetInfinitive( true );
48
49   if( myOneFaceEdgeSource->IsEmpty() )
50     myOneFaceEdgeActor->GetDeviceActor()->SetInfinitive( true );
51
52   if( mySharedEdgeSource->IsEmpty() )
53     mySharedEdgeActor->GetDeviceActor()->SetInfinitive( true );
54
55   if( myWireframeFaceSource->IsEmpty() )
56     myWireframeFaceActor->GetDeviceActor()->SetInfinitive( true );
57
58   if( myShadingFaceSource->IsEmpty() )
59     myShadingFaceActor->GetDeviceActor()->SetInfinitive( true );
60 }