Salome HOME
92332c8c6f0a311f90c99c8aad2766ae11c029c8
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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_Axis2Placement.hxx>
33 #include "SALOME_Actor.h"
34 #include "VTKViewer_Trihedron.h"
35
36 #ifdef WNT
37 #include <SALOME_WNT.hxx>
38 #else
39 #define SALOME_WNT_EXPORT
40 #endif
41
42
43 class vtkActorCollection;
44 class vtkRenderer;
45 class vtkPolyDataMapper;
46
47 /*
48   Class       : GEOM_VTKTrihedron
49   Description : Class for displaying trihedron of local CS in VTK viewer.
50                 Placement of trihedron is chahged with SetPlacement() method
51 */
52
53 class SALOME_WNT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
54 {
55
56 protected:
57                                     GEOM_VTKTrihedron();
58                                     GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
59   virtual                           ~GEOM_VTKTrihedron();
60
61 public:
62                                     vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
63   static GEOM_VTKTrihedron*         New();
64
65   virtual float                     GetSize() { return mySize;}
66
67   virtual void                      SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
68   virtual void                      VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
69   virtual void                      VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
70
71   virtual void                      AddToRender( vtkRenderer* theRenderer );
72   virtual void                      RemoveFromRender( vtkRenderer* theRenderer );
73
74   virtual int                       GetVisibleActorCount( vtkRenderer* theRenderer );
75
76   void                              SetPlacement( const Handle(Geom_Axis2Placement)& );
77
78   virtual vtkMapper*                GetMapper();
79
80   virtual void                      Render(vtkRenderer *, vtkMapper *);
81   virtual bool                      IsSetCamera() const;
82   virtual bool                      IsResizable() const;
83   virtual void                      SetSize( float );
84   virtual void                      SetCamera( vtkCamera* );
85
86   void                              SetColor( float r, float g, float b );
87   void                              GetColor( float& r, float& g, float& b );
88
89   virtual bool                      hasHighlight() { return false; } 
90
91 protected:
92   vtkActorCollection*               myPresent;
93   VTKViewer_Axis*                   myAxis[3];
94   vtkPolyDataMapper*                myMapper;
95   float                             mySize;
96   gp_Pnt                            myLocation;
97   gp_Dir                            myDirX, myDirY, myDirZ;
98   float                             myColor[ 3 ];
99 };
100
101 #endif