Salome HOME
Merging with WPdev
[modules/geom.git] / src / OBJECT / GEOM_VTKTrihedron.hxx
1 //  SALOME GEOM : 
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : GEOM_VTKTrihedron.h
25 //  Author : Sergey LITONIN
26 //  Module : SALOME
27 //  $Header: 
28
29 #ifndef GEOM_VTKTrihedron_H
30 #define GEOM_VTKTrihedron_H
31
32 #include "GEOM_OBJECT_defs.hxx"
33
34 #include <Geom_Axis2Placement.hxx>
35 #include "SALOME_Actor.h"
36 #include "VTKViewer_Trihedron.h"
37
38 class vtkActorCollection;
39 class vtkRenderer;
40 class vtkPolyDataMapper;
41
42 /*
43   Class       : GEOM_VTKTrihedron
44   Description : Class for displaying trihedron of local CS in VTK viewer.
45                 Placement of trihedron is chahged with SetPlacement() method
46 */
47
48 class GEOM_OBJECT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
49 {
50
51 protected:
52                                     GEOM_VTKTrihedron();
53                                     GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
54   virtual                           ~GEOM_VTKTrihedron();
55
56 public:
57                                     vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
58   static GEOM_VTKTrihedron*         New();
59
60   virtual vtkFloatingPointType      GetSize() { return mySize;}
61
62   virtual void                      SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
63   virtual void                      VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
64   virtual void                      VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
65
66   virtual void                      AddToRender( vtkRenderer* theRenderer );
67   virtual void                      RemoveFromRender( vtkRenderer* theRenderer );
68
69   virtual int                       GetVisibleActorCount( vtkRenderer* theRenderer );
70
71   void                              SetPlacement( const Handle(Geom_Axis2Placement)& );
72
73   virtual vtkMapper*                GetMapper();
74
75   virtual void                      Render(vtkRenderer *, vtkMapper *);
76   virtual bool                      IsSetCamera() const;
77   virtual bool                      IsResizable() const;
78   virtual void                      SetSize( vtkFloatingPointType );
79   virtual void                      SetCamera( vtkCamera* );
80
81   void                              SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
82   void                              GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
83
84   virtual bool                      hasHighlight() { return false; } 
85
86 protected:
87   VTKViewer_Axis*                   myAxis[3];
88   vtkPolyDataMapper*                myMapper;
89   vtkFloatingPointType              mySize;
90   gp_Pnt                            myLocation;
91   gp_Dir                            myDirX, myDirY, myDirZ;
92   vtkFloatingPointType              myColor[ 3 ];
93 };
94
95 #endif