Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SVTK_Renderer Class Reference

#include <SVTK_Renderer.h>

Inheritance diagram for SVTK_Renderer:
Inheritance graph

Public Member Functions

 vtkTypeMacro (SVTK_Renderer, vtkObject)
 
vtkRenderer * GetDevice ()
 Get its device. More...
 
virtual void Initialize (vtkRenderWindowInteractor *theInteractor, SVTK_Selector *theSelector)
 Initialize the class. More...
 
virtual void AddActor (VTKViewer_Actor *theActor, bool theIsAdjustActors=true)
 Publishes pointed actor into the renderer. More...
 
virtual void RemoveActor (VTKViewer_Actor *theActor, bool theIsAdjustActors=true)
 Removes pointed actor from the renderer. More...
 
VTKViewer_TransformGetTransform ()
 Get special container that keeps scaling of the scene. More...
 
virtual void SetScale (double theScale[3])
 Allows to apply a scale on the whole scene. More...
 
void GetScale (double theScale[3])
 Allows to get a scale that is applied on the whole scene. More...
 
void SetSelectionProp (const double &theRed=1, const double &theGreen=1, const double &theBlue=0, const int &theWidth=5)
 Applies color and size (PointSize and LineWidth) of primitives in selection mode. More...
 
void SetPreselectionProp (const double &theRed=0, const double &theGreen=1, const double &theBlue=1, const int &theWidth=5)
 Applies color and size (PointSize and LineWidth) of primitives in preselection mode. More...
 
void SetSelectionTolerance (const double &theTolNodes=0.025, const double &theTolCell=0.001, const double &theTolObjects=0.025)
 Setup requested tolerance for the picking. More...
 
void AdjustActors ()
 Adjust all intenal actors (trihedron and graduated rules) to the scene. More...
 
void SetTrihedronSize (double theSize, const bool theRelative=true)
 Set size of the trihedron in percents from bounding box of the scene. More...
 
double GetTrihedronSize () const
 Get size of the trihedron in percents from bounding box of the scene. More...
 
bool IsTrihedronRelative () const
 Shows if the size of the trihedron is relative. More...
 
VTKViewer_TrihedronGetTrihedron ()
 Get trihedron control. More...
 
bool IsTrihedronDisplayed ()
 Is trihedron displayed. More...
 
void OnViewTrihedron ()
 Toggle trihedron visibility. More...
 
void SetTrihedronVisibility (const bool)
 Set Toggle trihedron visibility. More...
 
void OnAdjustTrihedron ()
 Adjust size of the trihedron to the bounding box of the scene. More...
 
SVTK_CubeAxesActor2DGetCubeAxes ()
 Get graduated rules control. More...
 
bool IsCubeAxesDisplayed ()
 Is graduated rules displayed. More...
 
void OnViewCubeAxes ()
 Toggle graduated rules visibility. More...
 
void OnAdjustCubeAxes ()
 Adjust size of the graduated rules to the bounding box of the scene. More...
 
void OnFitAll ()
 Fit all presentation in the scene into the window. More...
 
void onFitSelection ()
 Fit all selected presentation in the scene. More...
 
void OnResetView ()
 Set camera into predefined state. More...
 
void OnResetClippingRange ()
 Reset camera clipping range to adjust the range to the bounding box of the scene. More...
 
void OnFrontView ()
 To reset direction of the camera to front view. More...
 
void OnBackView ()
 To reset direction of the camera to back view. More...
 
void OnTopView ()
 To reset direction of the camera to top view. More...
 
void OnBottomView ()
 To reset direction of the camera to bottom view. More...
 
void OnRightView ()
 To reset direction of the camera to right view. More...
 
void OnLeftView ()
 To reset direction of the camera to left view. More...
 
void onClockWiseView ()
 To rotate view 90 degrees clockwise. More...
 
void onAntiClockWiseView ()
 To rotate view 90 degrees counterclockwise. More...
 

Static Public Member Functions

static SVTK_RendererNew ()
 

Protected Member Functions

 SVTK_Renderer ()
 
 ~SVTK_Renderer ()
 
virtual bool OnAdjustActors ()
 

Static Protected Member Functions

static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

Protected Attributes

double myPriority
 
vtkSmartPointer
< vtkCallbackCommand > 
myEventCallbackCommand
 
vtkSmartPointer< vtkRenderer > myDevice
 
vtkRenderWindowInteractormyInteractor
 
vtkSmartPointer< SVTK_SelectormySelector
 
vtkSmartPointer
< VTKViewer_Transform
myTransform
 
vtkSmartPointer< vtkPointPicker > myPointPicker
 
vtkSmartPointer< vtkCellPicker > myCellPicker
 
vtkSmartPointer< SVTK_AreaPickermyPointAreaPicker
 
vtkSmartPointer< SVTK_AreaPickermyCellAreaPicker
 
vtkSmartPointer< vtkProperty > myPreHighlightProperty
 
vtkSmartPointer< vtkProperty > myHighlightProperty
 
vtkSmartPointer
< SVTK_CubeAxesActor2D
myCubeAxes
 
vtkSmartPointer
< VTKViewer_Trihedron
myTrihedron
 
double myTrihedronSize
 
bool myIsTrihedronRelative
 
double myBndBox [6]
 

Detailed Description

The class is a container for #vtkRenderer instance. Main goal of the class is to apply common behaviour to all SALOME_Actor, like selection and preselection colors. Also, the class is responsible for management of internal actors like trihedron an so on.

Constructor & Destructor Documentation

SVTK_Renderer::SVTK_Renderer ( )
protected

Constructor

References ProcessEvents(), SALOME_LINE_WIDTH, and SALOME_POINT_SIZE.

SVTK_Renderer::~SVTK_Renderer ( )
protected

Destructor

References VTK::ActorCollectionCopy::GetActors().

Member Function Documentation

void SVTK_Renderer::AddActor ( VTKViewer_Actor theActor,
bool  theIsAdjustActors = true 
)
virtual

Publishes pointed actor into the renderer

void SVTK_Renderer::AdjustActors ( )

Adjusts size of actors

References ResetCameraClippingRange().

SVTK_CubeAxesActor2D * SVTK_Renderer::GetCubeAxes ( )
Returns
graduated rules control
vtkRenderer * SVTK_Renderer::GetDevice ( )
Returns
renderer's device
void SVTK_Renderer::GetScale ( double  theScale[3])

Allows to get a scale that is applied on the whole scene

VTKViewer_Transform * SVTK_Renderer::GetTransform ( )

Get special container that keeps scaling of the scene

VTKViewer_Trihedron * SVTK_Renderer::GetTrihedron ( )
Returns
trihedron control
double SVTK_Renderer::GetTrihedronSize ( ) const
Returns
size of the trihedron in percents from bounding box of the scene
void SVTK_Renderer::Initialize ( vtkRenderWindowInteractor theInteractor,
SVTK_Selector theSelector 
)
virtual

Initialize renderer

bool SVTK_Renderer::IsCubeAxesDisplayed ( )
Returns
true if graduated rules displayed
bool SVTK_Renderer::IsTrihedronDisplayed ( )
Returns
true if trihedron is displayed

References VTKViewer_Trihedron::eOn.

bool SVTK_Renderer::IsTrihedronRelative ( ) const
Returns
true if the size of the trihedron is relative
static SVTK_Renderer* SVTK_Renderer::New ( )
static
bool SVTK_Renderer::OnAdjustActors ( )
protectedvirtual
void SVTK_Renderer::OnAdjustCubeAxes ( )

Adjust size of the graduated rules to the bounding box of the scene

void SVTK_Renderer::OnAdjustTrihedron ( )

Adjust size of the trihedron to the bounding box of the scene

void SVTK_Renderer::onAntiClockWiseView ( )

To rotate view 90 degrees counterclockwise

void SVTK_Renderer::OnBackView ( )

To reset direction of the camera to back view

void SVTK_Renderer::OnBottomView ( )

To reset direction of the camera to bottom view

void SVTK_Renderer::onClockWiseView ( )

To rotate view 90 degrees clockwise

void SVTK_Renderer::OnFitAll ( )

Fit all presentation in the scene into the window

References VTKViewer_Trihedron::eOnlyLineOn, ResetCamera(), and ResetCameraClippingRange().

void SVTK_Renderer::onFitSelection ( )

Fit all selected presentation in the scene

References ComputeBounds(), VTK::ActorCollectionCopy::GetActors(), GetDevice(), Handle(), isBoundValid(), and mySelector.

void SVTK_Renderer::OnFrontView ( )

To reset direction of the camera to front view

void SVTK_Renderer::OnLeftView ( )

To reset direction of the camera to left view

void SVTK_Renderer::OnResetClippingRange ( )

Reset camera clipping range to adjust the range to the bounding box of the scene

References ResetCameraClippingRange().

void SVTK_Renderer::OnResetView ( )

Sets camera into predefined state

References VTKViewer_Trihedron::eOnlyLineOn, and ResetCamera().

void SVTK_Renderer::OnRightView ( )

To reset direction of the camera to right view

void SVTK_Renderer::OnTopView ( )

To reset direction of the camera to top view

void SVTK_Renderer::OnViewCubeAxes ( )

Toggle graduated rules visibility

void SVTK_Renderer::OnViewTrihedron ( )

Toggle trihedron visibility

void SVTK_Renderer::ProcessEvents ( vtkObject object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotected

Main process event method

References OnResetView().

void SVTK_Renderer::RemoveActor ( VTKViewer_Actor theActor,
bool  theIsAdjustActors = true 
)
virtual

Removes pointed actor from the renderer

void SVTK_Renderer::SetPreselectionProp ( const double &  theRed = 0,
const double &  theGreen = 1,
const double &  theBlue = 1,
const int &  theWidth = 5 
)

Applies color and size (PointSize and LineWidth) of primitives in preselection mode

void SVTK_Renderer::SetScale ( double  theScale[3])
virtual

Allows to apply a scale on the whole scene

References VTK::ActorCollectionCopy::GetActors().

void SVTK_Renderer::SetSelectionProp ( const double &  theRed = 1,
const double &  theGreen = 1,
const double &  theBlue = 0,
const int &  theWidth = 5 
)

Applies color and size (PointSize and LineWidth) of primitives in selection mode

void SVTK_Renderer::SetSelectionTolerance ( const double &  theTolNodes = 0.025,
const double &  theTolCell = 0.001,
const double &  theTolObjects = 0.025 
)

Setup requested tolerance for the picking

void SVTK_Renderer::SetTrihedronSize ( double  theSize,
const bool  theRelative = true 
)

Set size of the trihedron

Parameters
theSize- new size
theRelative- if it is true, then size is mesured in percents from bounding box of the scene, otherwise - in viewer units
void SVTK_Renderer::SetTrihedronVisibility ( const bool  show)

Set trihedron visibility

SVTK_Renderer::vtkTypeMacro ( SVTK_Renderer  ,
vtkObject   
)

Member Data Documentation

double SVTK_Renderer::myBndBox[6]
protected
vtkSmartPointer<SVTK_AreaPicker> SVTK_Renderer::myCellAreaPicker
protected
vtkSmartPointer<vtkCellPicker> SVTK_Renderer::myCellPicker
protected
vtkSmartPointer<SVTK_CubeAxesActor2D> SVTK_Renderer::myCubeAxes
protected
vtkSmartPointer<vtkRenderer> SVTK_Renderer::myDevice
protected
vtkSmartPointer<vtkCallbackCommand> SVTK_Renderer::myEventCallbackCommand
protected
vtkSmartPointer<vtkProperty> SVTK_Renderer::myHighlightProperty
protected
vtkRenderWindowInteractor* SVTK_Renderer::myInteractor
protected
bool SVTK_Renderer::myIsTrihedronRelative
protected
vtkSmartPointer<SVTK_AreaPicker> SVTK_Renderer::myPointAreaPicker
protected
vtkSmartPointer<vtkPointPicker> SVTK_Renderer::myPointPicker
protected
vtkSmartPointer<vtkProperty> SVTK_Renderer::myPreHighlightProperty
protected
double SVTK_Renderer::myPriority
protected
vtkSmartPointer<SVTK_Selector> SVTK_Renderer::mySelector
protected
vtkSmartPointer<VTKViewer_Transform> SVTK_Renderer::myTransform
protected
vtkSmartPointer<VTKViewer_Trihedron> SVTK_Renderer::myTrihedron
protected
double SVTK_Renderer::myTrihedronSize
protected

The documentation for this class was generated from the following files: