From: apo Date: Tue, 25 Oct 2005 08:18:16 +0000 (+0000) Subject: Documentation of the sources X-Git-Tag: TG-D5-38-2003_D2005-29-12~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6dfdc8c52534ea75a93d9d6478648a1ad96206b3;p=modules%2Fgui.git Documentation of the sources --- diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index 23e8939b0..d0cb21cbf 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -131,7 +131,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget Implements such features as support of selection, run-time interactor style management, - one render window per one renderer collaboration, + one render window per one renderer collaboration and SUIT_ViewWindow events invocation. */ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteractor diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index bdc7119d8..8fa7197b5 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -52,7 +52,13 @@ class VTKViewer_Actor; 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: @@ -60,96 +66,133 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject 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: diff --git a/src/SVTK/SVTK_Selection.h b/src/SVTK/SVTK_Selection.h index de27e1582..3307565c2 100644 --- a/src/SVTK/SVTK_Selection.h +++ b/src/SVTK/SVTK_Selection.h @@ -30,7 +30,8 @@ #define SVTK_SELECTION_H -typedef int Selection_Mode; +//! It is possible to introduce new type of selection +typedef int Selection_Mode; const Selection_Mode NodeSelection = 0; const Selection_Mode CellSelection = 1; diff --git a/src/SVTK/SVTK_SelectionEvent.h b/src/SVTK/SVTK_SelectionEvent.h index 5843597cb..cfa753f97 100644 --- a/src/SVTK/SVTK_SelectionEvent.h +++ b/src/SVTK/SVTK_SelectionEvent.h @@ -31,18 +31,25 @@ #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