geom/src/OBJECT/GEOM_VTKTrihedron.hxx

108 lines
4.3 KiB
C++
Raw Normal View History

2010-05-07 19:25:17 +06:00
// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-13 17:16:39 +05:00
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// 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.
2004-12-01 15:39:14 +05:00
//
2009-02-13 17:16:39 +05:00
// 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.
2004-12-01 15:39:14 +05:00
//
2009-02-13 17:16:39 +05:00
// 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
2004-12-01 15:39:14 +05:00
//
2009-02-13 17:16:39 +05:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2004-12-01 15:39:14 +05:00
//
2010-05-07 19:25:17 +06:00
2009-02-13 17:16:39 +05:00
// SALOME GEOM :
2004-12-01 15:39:14 +05:00
// File : GEOM_VTKTrihedron.h
// Author : Sergey LITONIN
// Module : SALOME
// $Header:
2009-02-13 17:16:39 +05:00
//
2004-12-01 15:39:14 +05:00
#ifndef GEOM_VTKTrihedron_H
#define GEOM_VTKTrihedron_H
#include "GEOM_OBJECT_defs.hxx"
2004-12-01 15:39:14 +05:00
#include <Geom_Axis2Placement.hxx>
#include "SALOME_Actor.h"
#include "VTKViewer_Trihedron.h"
class vtkRenderer;
class vtkPolyDataMapper;
/*
Class : GEOM_VTKTrihedron
Description : Class for displaying trihedron of local CS in VTK viewer.
Placement of trihedron is chahged with SetPlacement() method
*/
class GEOM_OBJECT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
2004-12-01 15:39:14 +05:00
{
protected:
GEOM_VTKTrihedron();
GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
virtual ~GEOM_VTKTrihedron();
public:
vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
static GEOM_VTKTrihedron* New();
virtual vtkFloatingPointType GetSize() { return mySize;}
2004-12-01 15:39:14 +05:00
2009-12-08 17:05:55 +05:00
virtual void SetVisibility( int theVisibility );
2004-12-01 15:39:14 +05:00
virtual void SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
virtual void VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
virtual void VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
virtual void AddToRender( vtkRenderer* theRenderer );
virtual void RemoveFromRender( vtkRenderer* theRenderer );
virtual int GetVisibleActorCount( vtkRenderer* theRenderer );
void SetPlacement( const Handle(Geom_Axis2Placement)& );
virtual vtkMapper* GetMapper();
virtual void Render(vtkRenderer *, vtkMapper *);
virtual bool IsSetCamera() const;
virtual bool IsResizable() const;
virtual void SetSize( vtkFloatingPointType );
2004-12-01 15:39:14 +05:00
virtual void SetCamera( vtkCamera* );
void SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
void GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
2004-12-01 15:39:14 +05:00
2009-12-08 17:05:55 +05:00
virtual bool hasHighlight() { return true; }
virtual void Highlight( bool theHighlight );
virtual bool PreHighlight( vtkInteractorStyle* theInteractorStyle,
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight );
protected:
virtual void ResetAxesColors();
virtual void SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse = false );
2004-12-01 15:39:14 +05:00
protected:
VTKViewer_Axis* myAxis[3];
vtkPolyDataMapper* myMapper;
vtkFloatingPointType mySize;
2004-12-01 15:39:14 +05:00
gp_Pnt myLocation;
gp_Dir myDirX, myDirY, myDirZ;
vtkFloatingPointType myColor[ 3 ];
2009-12-08 17:05:55 +05:00
vtkFloatingPointType myDefaultColor[ 3 ];
vtkFloatingPointType myPreHighlightColor[ 3 ];
vtkFloatingPointType myHighlightColor[ 3 ];
2004-12-01 15:39:14 +05:00
};
#endif