Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef GEOM_VTKTrihedron_H
00030 #define GEOM_VTKTrihedron_H
00031
00032 #include "GEOM_OBJECT_defs.hxx"
00033
00034 #include <Geom_Axis2Placement.hxx>
00035 #include "SALOME_Actor.h"
00036 #include "VTKViewer_Trihedron.h"
00037
00038 class vtkRenderer;
00039 class vtkPolyDataMapper;
00040
00041
00042
00043
00044
00045
00046
00047 class GEOM_OBJECT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
00048 {
00049
00050 protected:
00051 GEOM_VTKTrihedron();
00052 GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
00053 virtual ~GEOM_VTKTrihedron();
00054
00055 public:
00056 vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
00057 static GEOM_VTKTrihedron* New();
00058
00059 virtual vtkFloatingPointType GetSize() { return mySize;}
00060
00061 virtual void SetVisibility( int theVisibility );
00062 virtual void SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
00063 virtual void VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
00064 virtual void VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
00065
00066 virtual void AddToRender( vtkRenderer* theRenderer );
00067 virtual void RemoveFromRender( vtkRenderer* theRenderer );
00068
00069 virtual int GetVisibleActorCount( vtkRenderer* theRenderer );
00070
00071 void SetPlacement( const Handle(Geom_Axis2Placement)& );
00072
00073 virtual vtkMapper* GetMapper();
00074
00075 virtual void Render(vtkRenderer *, vtkMapper *);
00076 virtual bool IsSetCamera() const;
00077 virtual bool IsResizable() const;
00078 virtual void SetSize( vtkFloatingPointType );
00079 virtual void SetCamera( vtkCamera* );
00080
00081 void SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
00082 void GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
00083
00084 virtual bool hasHighlight() { return true; }
00085
00086 virtual void Highlight( bool theHighlight );
00087 virtual bool PreHighlight( vtkInteractorStyle* theInteractorStyle,
00088 SVTK_SelectionEvent* theSelectionEvent,
00089 bool theIsHighlight );
00090
00091 protected:
00092 virtual void ResetAxesColors();
00093 virtual void SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse = false );
00094
00095 protected:
00096 VTKViewer_Axis* myAxis[3];
00097 vtkPolyDataMapper* myMapper;
00098 vtkFloatingPointType mySize;
00099 gp_Pnt myLocation;
00100 gp_Dir myDirX, myDirY, myDirZ;
00101 vtkFloatingPointType myColor[ 3 ];
00102 vtkFloatingPointType myDefaultColor[ 3 ];
00103 vtkFloatingPointType myPreHighlightColor[ 3 ];
00104 vtkFloatingPointType myHighlightColor[ 3 ];
00105 };
00106
00107 #endif