class SVTK_Selector;
-//----------------------------------------------------------------------------
+//! 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.
+ */
+//============================================================================
class SVTK_EXPORT SVTK_Renderer : public vtkObject
{
public:
static SVTK_Renderer* New();
//----------------------------------------------------------------------------
+ //! Get its device
vtkRenderer*
GetDevice();
+ //! Initialize the class
virtual
void
Initialize(vtkRenderWindowInteractor* theInteractor,
SVTK_Selector* theSelector);
//----------------------------------------------------------------------------
+ //! This method publishes pointed actor into the renderer
virtual
void
AddActor(VTKViewer_Actor* theActor);
+ //! This method removes pointed actor from the renderer
virtual
void
RemoveActor(VTKViewer_Actor* theActor);
+ //! Get special container that keeps scaling of the scene
VTKViewer_Transform*
GetTransform();
+ //! This method allow to apply a scale on the whole scene
virtual
void
SetScale( double theScale[3] );
+ //! This method allow to get a scale that is applied on the whole scene
void
GetScale( double theScale[3] );
//----------------------------------------------------------------------------
+ //! Applies color and size (PointSize and LineWidth) of primitives in selection mode
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 preselection mode
void
SetPreselectionProp(const double& theRed = 0,
const double& theGreen = 1,
const double& theBlue = 1,
const int& theWidth = 5);
+ //! Setup requested tollerance for the picking
void
SetSelectionTolerance(const double& theTolNodes = 0.025,
const double& theTolCell = 0.001);
//----------------------------------------------------------------------------
+ //! Adjust all intenal actors (trihedron and graduated rules) to the scene
void
AdjustActors();
+ //! Set size of the trihedron in percent from bounding box of the scene
void
SetTrihedronSize(int theSize);
+ //! Get size of the trihedron in percent from bounding box of the scene
int
GetTrihedronSize() const;
//----------------------------------------------------------------------------
+ //! Get trihedron control
VTKViewer_Trihedron*
GetTrihedron();
+ //! Is trihedron displayed
bool
IsTrihedronDisplayed();
+ //! Toggle trihedron visibility
void
OnViewTrihedron();
+ //! Adjust size of the trihedron to the bounding box of the scene
void
OnAdjustTrihedron();
//----------------------------------------------------------------------------
+ //! Get graduated rules control
SVTK_CubeAxesActor2D*
GetCubeAxes();
+ //! Is graduated rules displayed
bool
IsCubeAxesDisplayed();
+ //! Toggle graduated rules visibility
void
OnViewCubeAxes();
+ //! Adjust size of the graduated rules to the bounding box of the scene
void
OnAdjustCubeAxes();
//----------------------------------------------------------------------------
- void OnFitAll();
- void OnResetView();
- void OnResetClippingRange();
+ //! Fit all presentation in the scene into the window
+ void OnFitAll();
+
+ //! Set camera into predefined state
+ void OnResetView();
+
+ //! Reset camera clipping range to adjust the range to the bounding box of the scene
+ void OnResetClippingRange();
+ //! To reset direction of the camera to front view
void OnFrontView();
+
+ //! To reset direction of the camera to back view
void OnBackView();
+
+ //! To reset direction of the camera to top view
void OnTopView();
+
+ //! To reset direction of the camera to bottom view
void OnBottomView();
+
+ //! To reset direction of the camera to right view
void OnRightView();
+
+ //! To reset direction of the camera to left view
void OnLeftView();
protected:
#include "SVTK_Selection.h"
+//! The structure is used for passing all infromation necessary for claculation of the selection.
+/*!
+ The SVTK_SelectionEvent is generated by #SVTK_InteractorStyle.
+ In its turn the #SVTK_InteractorStyle uses for it generation #vtkRenderWindowInteractor and
+ #SVTK_Selector instances.
+ */
struct SVTK_SelectionEvent
{
- Selection_Mode mySelectionMode;
- int myX;
- int myY;
- int myLastX;
- int myLastY;
- bool myIsRectangle;
- bool myIsCtrl;
- bool myIsShift;
- int myKeyCode;
- int myRepeatCount;
+ //! Through usage of the parameter any new type of selection can be introduced
+ Selection_Mode mySelectionMode;
+ int myX; //!< Current X position of the mouse
+ int myY; //!< Current Y position of the mouse
+ int myLastX; //!< Last X position of the mouse before starting any complex operation (like rectangle selection)
+ int myLastY; //!< Last Y position of the mouse before starting any complex operation
+ bool myIsRectangle; //!< A flag to define is it necessary provide rectangle selection for current #Selection_Mode
+ bool myIsCtrl; //!< Is Ctrl key are pressed
+ bool myIsShift; //!< Is Shift key are pressed
+ int myKeyCode; //!< Code of the pressed key
+ int myRepeatCount; //!< Number of repetion of the key pressing
};
#endif