Version: 9.12.0
SVTK_Renderer Class Reference

#include <SVTK_Renderer.h>

Inheritance diagram for SVTK_Renderer:
Inheritance graph

Public Member Functions

 vtkTypeMacro (SVTK_Renderer, vtkObject) static SVTK_Renderer *New()
 
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 OnFitIObjects (const SALOME_ListIO &objects)
 Fit given presentations 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...
 

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_TransformmyTransform
 
vtkSmartPointer< vtkPointPicker > myPointPicker
 
vtkSmartPointer< vtkCellPicker > myCellPicker
 
vtkSmartPointer< SVTK_AreaPickermyPointAreaPicker
 
vtkSmartPointer< SVTK_AreaPickermyCellAreaPicker
 
vtkSmartPointer< vtkProperty > myPreHighlightProperty
 
vtkSmartPointer< vtkProperty > myHighlightProperty
 
vtkSmartPointer< SVTK_CubeAxesActor2DmyCubeAxes
 
vtkSmartPointer< VTKViewer_TrihedronmyTrihedron
 
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::SVTK_Renderer ( )
protected

◆ ~SVTK_Renderer()

SVTK_Renderer::~SVTK_Renderer ( )
protected

Destructor

References VTK::ActorCollectionCopy::GetActors().

Member Function Documentation

◆ AddActor()

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

Publishes pointed actor into the renderer.

Publishes pointed actor into the renderer

◆ AdjustActors()

void SVTK_Renderer::AdjustActors ( )

Adjust all intenal actors (trihedron and graduated rules) to the scene.

Adjusts size of actors

References ResetCameraClippingRange().

◆ GetCubeAxes()

SVTK_CubeAxesActor2D * SVTK_Renderer::GetCubeAxes ( )

Get graduated rules control.

Returns
graduated rules control

◆ GetDevice()

vtkRenderer * SVTK_Renderer::GetDevice ( )

Get its device.

Returns
renderer's device

◆ GetScale()

void SVTK_Renderer::GetScale ( double  theScale[3])

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

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

References theScale.

◆ GetTransform()

VTKViewer_Transform * SVTK_Renderer::GetTransform ( )

Get special container that keeps scaling of the scene.

Get special container that keeps scaling of the scene

◆ GetTrihedron()

VTKViewer_Trihedron * SVTK_Renderer::GetTrihedron ( )

Get trihedron control.

Returns
trihedron control

◆ GetTrihedronSize()

double SVTK_Renderer::GetTrihedronSize ( ) const

Get size of the trihedron in percents from bounding box of the scene.

Returns
size of the trihedron in percents from bounding box of the scene

◆ Initialize()

void SVTK_Renderer::Initialize ( vtkRenderWindowInteractor theInteractor,
SVTK_Selector theSelector 
)
virtual

Initialize the class.

Initialize renderer

◆ IsCubeAxesDisplayed()

bool SVTK_Renderer::IsCubeAxesDisplayed ( )

Is graduated rules displayed.

Returns
true if graduated rules displayed

◆ IsTrihedronDisplayed()

bool SVTK_Renderer::IsTrihedronDisplayed ( )

Is trihedron displayed.

Returns
true if trihedron is displayed

References VTKViewer_Trihedron::eOn.

◆ IsTrihedronRelative()

bool SVTK_Renderer::IsTrihedronRelative ( ) const

Shows if the size of the trihedron is relative.

Returns
true if the size of the trihedron is relative

◆ OnAdjustActors()

bool SVTK_Renderer::OnAdjustActors ( )
protectedvirtual

◆ OnAdjustCubeAxes()

void SVTK_Renderer::OnAdjustCubeAxes ( )

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

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

◆ OnAdjustTrihedron()

void SVTK_Renderer::OnAdjustTrihedron ( )

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

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

◆ onAntiClockWiseView()

void SVTK_Renderer::onAntiClockWiseView ( )

To rotate view 90 degrees counterclockwise.

To rotate view 90 degrees counterclockwise

◆ OnBackView()

void SVTK_Renderer::OnBackView ( )

To reset direction of the camera to back view.

To reset direction of the camera to back view

◆ OnBottomView()

void SVTK_Renderer::OnBottomView ( )

To reset direction of the camera to bottom view.

To reset direction of the camera to bottom view

◆ onClockWiseView()

void SVTK_Renderer::onClockWiseView ( )

To rotate view 90 degrees clockwise.

To rotate view 90 degrees clockwise

◆ OnFitAll()

void SVTK_Renderer::OnFitAll ( )

Fit all presentation in the scene into the window.

Fit all presentation in the scene into the window

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

◆ OnFitIObjects()

void SVTK_Renderer::OnFitIObjects ( const SALOME_ListIO objects)

Fit given presentations in the scene.

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

◆ onFitSelection()

void SVTK_Renderer::onFitSelection ( )

Fit all selected presentation in the scene.

Fit all selected presentation in the scene

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

◆ OnFrontView()

void SVTK_Renderer::OnFrontView ( )

To reset direction of the camera to front view.

To reset direction of the camera to front view

◆ OnLeftView()

void SVTK_Renderer::OnLeftView ( )

To reset direction of the camera to left view.

To reset direction of the camera to left view

◆ OnResetClippingRange()

void SVTK_Renderer::OnResetClippingRange ( )

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

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

References ResetCameraClippingRange().

◆ OnResetView()

void SVTK_Renderer::OnResetView ( )

Set camera into predefined state.

Sets camera into predefined state

References VTKViewer_Trihedron::eOnlyLineOn, and ResetCamera().

◆ OnRightView()

void SVTK_Renderer::OnRightView ( )

To reset direction of the camera to right view.

To reset direction of the camera to right view

◆ OnTopView()

void SVTK_Renderer::OnTopView ( )

To reset direction of the camera to top view.

To reset direction of the camera to top view

◆ OnViewCubeAxes()

void SVTK_Renderer::OnViewCubeAxes ( )

Toggle graduated rules visibility.

Toggle graduated rules visibility

◆ OnViewTrihedron()

void SVTK_Renderer::OnViewTrihedron ( )

Toggle trihedron visibility.

Toggle trihedron visibility

◆ ProcessEvents()

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

Main process event method

References OnResetView().

◆ RemoveActor()

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

Removes pointed actor from the renderer.

Removes pointed actor from the renderer

◆ SetPreselectionProp()

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.

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

◆ SetScale()

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

Allows to apply a scale on the whole scene.

Allows to apply a scale on the whole scene

References VTK::ActorCollectionCopy::GetActors(), and theScale.

◆ SetSelectionProp()

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.

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

◆ SetSelectionTolerance()

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.

Setup requested tolerance for the picking

◆ SetTrihedronSize()

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

Set size of the trihedron in percents from bounding box of the scene.

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

◆ SetTrihedronVisibility()

void SVTK_Renderer::SetTrihedronVisibility ( const bool  show)

Set Toggle trihedron visibility.

Set trihedron visibility

◆ vtkTypeMacro()

SVTK_Renderer::vtkTypeMacro ( SVTK_Renderer  ,
vtkObject   
)

Member Data Documentation

◆ myBndBox

double SVTK_Renderer::myBndBox[6]
protected

◆ myCellAreaPicker

vtkSmartPointer<SVTK_AreaPicker> SVTK_Renderer::myCellAreaPicker
protected

◆ myCellPicker

vtkSmartPointer<vtkCellPicker> SVTK_Renderer::myCellPicker
protected

◆ myCubeAxes

vtkSmartPointer<SVTK_CubeAxesActor2D> SVTK_Renderer::myCubeAxes
protected

◆ myDevice

vtkSmartPointer<vtkRenderer> SVTK_Renderer::myDevice
protected

◆ myEventCallbackCommand

vtkSmartPointer<vtkCallbackCommand> SVTK_Renderer::myEventCallbackCommand
protected

◆ myHighlightProperty

vtkSmartPointer<vtkProperty> SVTK_Renderer::myHighlightProperty
protected

◆ myInteractor

vtkRenderWindowInteractor* SVTK_Renderer::myInteractor
protected

◆ myIsTrihedronRelative

bool SVTK_Renderer::myIsTrihedronRelative
protected

◆ myPointAreaPicker

vtkSmartPointer<SVTK_AreaPicker> SVTK_Renderer::myPointAreaPicker
protected

◆ myPointPicker

vtkSmartPointer<vtkPointPicker> SVTK_Renderer::myPointPicker
protected

◆ myPreHighlightProperty

vtkSmartPointer<vtkProperty> SVTK_Renderer::myPreHighlightProperty
protected

◆ myPriority

double SVTK_Renderer::myPriority
protected

◆ mySelector

vtkSmartPointer<SVTK_Selector> SVTK_Renderer::mySelector
protected

◆ myTransform

vtkSmartPointer<VTKViewer_Transform> SVTK_Renderer::myTransform
protected

◆ myTrihedron

vtkSmartPointer<VTKViewer_Trihedron> SVTK_Renderer::myTrihedron
protected

◆ myTrihedronSize

double SVTK_Renderer::myTrihedronSize
protected

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