From fb6eaa76359688f441a606987c380768ecf52387 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 26 Oct 2005 11:21:58 +0000 Subject: [PATCH] Documents the sources --- src/SVTK/SVTK_View.cxx | 7 ----- src/SVTK/SVTK_View.h | 56 ++++++++++++++++++++++++++++++++------ src/SVTK/SVTK_ViewWindow.h | 18 ++++++------ 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 38e03833a..ba634b16e 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -92,13 +92,6 @@ SVTK_SignalHandler //---------------------------------------------------------------- -void -SVTK_SignalHandler -::Repaint() -{ - myMainWindow->Repaint(); -} - void SVTK_SignalHandler ::Repaint(bool theUpdateTrihedron) diff --git a/src/SVTK/SVTK_View.h b/src/SVTK/SVTK_View.h index f0d32bacf..edd6ec1f7 100644 --- a/src/SVTK/SVTK_View.h +++ b/src/SVTK/SVTK_View.h @@ -19,6 +19,14 @@ class SVTK_Renderer; class SALOME_Actor; //---------------------------------------------------------------------------- +//! Main purpose of the class is to provide a way to customize #SVTK_MainWindow. +/*! + This class is initialized by #SVTK_MainWindow and just pass Qt signals from + corresponding #SVTK_RenderWindowInteractor of the #SVTK_MainWindow. + Its main purpose is to provide a simple and flexible way to customize the #SVTK_MainWindow. + So, in your own viewer it is possible to derive new #SVTK_MainWindow and + use existing functionality without any modifications. + */ class SVTK_EXPORT SVTK_SignalHandler : public QObject { Q_OBJECT; @@ -29,20 +37,21 @@ public: virtual ~SVTK_SignalHandler(); + //! Get reference to its #SVTK_MainWindow SVTK_MainWindow* GetMainWindow(); //---------------------------------------------------------------------------- - void - Repaint(); - + //! Redirect the request to #SVTK_MainWindow::Repaint (just for flexibility) void Repaint(bool theUpdateTrihedron); //---------------------------------------------------------------------------- + //! Redirect the request to #SVTK_MainWindow::GetRenderer (just for flexibility) SVTK_Renderer* GetRenderer(); + //! Redirect the request to #SVTK_MainWindow::getRenderer (just for flexibility) vtkRenderer* getRenderer(); @@ -70,6 +79,12 @@ public: //---------------------------------------------------------------------------- +//! This class is introduced just for compatibility with old code. +/*! + This class contains frequantly used functionality in old code. + Now, you are supposed to extend existing functionality through + writing corresponding functors (see SVTK_Functor.h for example). + */ class SVTK_EXPORT SVTK_View : public SVTK_SignalHandler { Q_OBJECT; @@ -81,10 +96,13 @@ public: ~SVTK_View(); /* interactive object management */ + //! To highlight a VTK presentation with the same #SALOME_InteractiveObject void highlight(const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool immediatly = true); + + //! To unhighlight all VTK presentations void unHighlightAll(); @@ -92,9 +110,11 @@ public: Handle(SALOME_InteractiveObject) FindIObject(const char* Entry); + //! Check, if the viewer contains a presentatin with defined #SALOME_InteractiveObject bool isInViewer(const Handle(SALOME_InteractiveObject)& IObject); + //! Check, if a presentatin with defined #SALOME_InteractiveObject is visible bool isVisible(const Handle(SALOME_InteractiveObject)& IObject); @@ -104,56 +124,68 @@ public: //---------------------------------------------------------------------------- // Displaymode management + //! Get current display mode (obsolete) int GetDisplayMode(); + //! Set current display mode void SetDisplayMode(int); - // Switch representation wireframe/shading + //! Switch representation wireframe/shading void SetDisplayMode(const Handle(SALOME_InteractiveObject)& IObject, int theMode); - // Change all actors to wireframe or surface + //! Change all actors to wireframe void ChangeRepresentationToWireframe(); + //! Change all actors to surface void ChangeRepresentationToSurface(); - // Change to wireframe or surface a list of vtkactor + //! Change to wireframe a list of vtkactor void ChangeRepresentationToWireframe(vtkActorCollection* theListofActors); + + //! Change to surface a list of vtkactor void ChangeRepresentationToSurface(vtkActorCollection* theListofActors); - // Transparency + //! Change transparency void SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, float trans); + + //! Get current transparency float GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject); - // Color + //! Change color void SetColor(const Handle(SALOME_InteractiveObject)& theIObject, const QColor& theColor); + //! Get current color QColor GetColor(const Handle(SALOME_InteractiveObject)& theIObject); //---------------------------------------------------------------------------- // Erase Display functions + //! To erase all existing VTK presentations void EraseAll(); + //! To display all existing VTK presentations void DisplayAll(); + //! To remove from the view all existing VTK presentations void RemoveAll( const bool immediatly ); + //! To erase VTK presentation with defined #SALOME_InteractiveObject void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true); @@ -161,38 +193,46 @@ public: Remove(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true); + //! To display VTK presentation with defined #SALOME_InteractiveObject void Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true); + //! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject); + //! To display the VTK presentation void Display(SALOME_Actor* SActor, bool immediatly = true); + //! To erase the VTK presentation void Erase(SALOME_Actor* SActor, bool immediatly = true); + //! To remove the VTK presentation void Remove(SALOME_Actor* SActor, bool updateViewer = true); //---------------------------------------------------------------------------- + //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetSelectionProp(const double& theRed = 1, const double& theGreen = 1, const double& theBlue = 0, const int& theWidth = 5); + //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetPreselectionProp(const double& theRed = 0, const double& theGreen = 1, const double& theBlue = 1, const int& theWidth = 5); + //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001); diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index 198574209..2aa64c5fa 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -98,23 +98,23 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow isCubeAxesDisplayed(); /* interactive object management */ - //! To highlight a VTK presentation with the same #SALOME_InteractiveObject + //! Redirect the request to #SVTK_View::highlight (to support old code) virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO, bool theIsHighlight = true, bool theIsUpdate = true); - //! To unhighlight all VTK presentations + //! Redirect the request to #SVTK_View::unHighlightAll (to support old code) virtual void unHighlightAll(); - //! Check, if the viewer contains a presentatin with defined #SALOME_InteractiveObject + //! Redirect the request to #SVTK_View::isInViewer (to support old code) bool isInViewer(const Handle(SALOME_InteractiveObject)& theIObject); - //! Check, if a presentatin with defined #SALOME_InteractiveObject is visible + //! Redirect the request to #SVTK_View::isVisible (to support old code) bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject); @@ -125,29 +125,29 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow /* display */ //---------------------------------------------------------------------------- - //! To display VTK presentation with defined #SALOME_InteractiveObject + //! Redirect the request to #SVTK_View::Display (to support old code) virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject, bool theImmediatly = true); - //! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers + //! Redirect the request to #SVTK_View::DisplayOnly (to support old code) virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject); - //! To erase VTK presentation with defined #SALOME_InteractiveObject + //! Redirect the request to #SVTK_View::Erase (to support old code) virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject, bool theImmediatly = true); - //! To display all existing VTK presentations + //! Redirect the request to #SVTK_View::DisplayAll (to support old code) virtual void DisplayAll(); - //! To erase all existing VTK presentations + //! Redirect the request to #SVTK_View::EraseAll (to support old code) virtual void EraseAll(); -- 2.39.2