From 593e7a367d639922d014a3cbdf7fc484e308a101 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 27 Oct 2005 11:27:38 +0000 Subject: [PATCH] To document the sources --- doc/salome/tui/SUIT/doxyfile | 4 +- src/SVTK/SVTK_Functor.h | 4 +- src/SVTK/SVTK_GenericRenderWindowInteractor.h | 2 +- src/SVTK/SVTK_View.cxx | 123 ++++++++++-------- src/SalomeApp/SalomeApp_VTKSelector.cxx | 3 +- 5 files changed, 75 insertions(+), 61 deletions(-) diff --git a/doc/salome/tui/SUIT/doxyfile b/doc/salome/tui/SUIT/doxyfile index c79d1dcf3..15f59d894 100755 --- a/doc/salome/tui/SUIT/doxyfile +++ b/doc/salome/tui/SUIT/doxyfile @@ -10,9 +10,9 @@ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO +REPEAT_BRIEF = YES ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = YES +ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = diff --git a/src/SVTK/SVTK_Functor.h b/src/SVTK/SVTK_Functor.h index adef12408..162d563b9 100644 --- a/src/SVTK/SVTK_Functor.h +++ b/src/SVTK/SVTK_Functor.h @@ -15,8 +15,10 @@ Combination with algorithms it gives powerful, flexible and simple to extend way to introduce new type of operation. */ -namespace VTK +namespace SVTK { + using namespace VTK; + //! This functor check, if the actor have pointed entry template struct TIsSameEntry diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.h b/src/SVTK/SVTK_GenericRenderWindowInteractor.h index 67c3b846a..d15fdc557 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.h +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.h @@ -43,7 +43,7 @@ class SVTK_Renderer; //============================================================================ -//! Implemementation of the class is intended to implement Qt based CreateTimer and DestroyTimer functionality. +//! Introduction of the class is intended to implement Qt based #CreateTimer and #DestroyTimer functionality. /*! The class intendes to implement platform indepenedant subclass of vtkRenderWindowInteractor. This is done by usage of Qt library. diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index ba634b16e..6d5ac831c 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -115,21 +115,24 @@ SVTK_SignalHandler } //---------------------------------------------------------------- -struct THighlightAction +namespace SVTK { - bool myIsHighlight; - THighlightAction( bool theIsHighlight ): - myIsHighlight( theIsHighlight ) - {} - - void - operator()( SALOME_Actor* theActor) + struct THighlightAction { - if(theActor->GetMapper() && theActor->hasIO()){ - theActor->Highlight( myIsHighlight ); + bool myIsHighlight; + THighlightAction( bool theIsHighlight ): + myIsHighlight( theIsHighlight ) + {} + + void + operator()( SALOME_Actor* theActor) + { + if(theActor->GetMapper() && theActor->hasIO()){ + theActor->Highlight( myIsHighlight ); + } } - } -}; + }; +} void SVTK_SignalHandler @@ -137,7 +140,7 @@ SVTK_SignalHandler { vtkActorCollection* anActors = myMainWindow->getRenderer()->GetActors(); - using namespace VTK; + using namespace SVTK; ForEach(anActors, THighlightAction( false )); SVTK_Selector* aSelector = myMainWindow->GetSelector(); @@ -173,7 +176,7 @@ void SVTK_View ::unHighlightAll() { - using namespace VTK; + using namespace SVTK; ForEach(getRenderer()->GetActors(), THighlightAction( false )); Repaint(); @@ -186,7 +189,7 @@ SVTK_View bool theIsHighlight, bool theIsUpdate ) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject( theIO ), THighlightAction(theIsHighlight)); @@ -229,7 +232,7 @@ bool SVTK_View ::isInViewer(const Handle(SALOME_InteractiveObject)& theIObject) { - using namespace VTK; + using namespace SVTK; SALOME_Actor* anActor = Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); @@ -241,7 +244,7 @@ bool SVTK_View ::isVisible(const Handle(SALOME_InteractiveObject)& theIObject) { - using namespace VTK; + using namespace SVTK; SALOME_Actor* anActor = Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); @@ -254,7 +257,7 @@ SVTK_View ::rename(const Handle(SALOME_InteractiveObject)& theIObject, const QString& theName) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TSetFunction @@ -285,7 +288,7 @@ SVTK_View ::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject, int theMode) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TSetFunction @@ -312,7 +315,7 @@ void SVTK_View ::ChangeRepresentationToWireframe(vtkActorCollection* theCollection) { - using namespace VTK; + using namespace SVTK; ForEach(theCollection, TSetFunction (&SALOME_Actor::setDisplayMode,0)); @@ -323,7 +326,7 @@ void SVTK_View ::ChangeRepresentationToSurface(vtkActorCollection* theCollection) { - using namespace VTK; + using namespace SVTK; ForEach(theCollection, TSetFunction (&SALOME_Actor::setDisplayMode,1)); @@ -331,27 +334,32 @@ SVTK_View } //---------------------------------------------------------------------------- -struct TErase -{ - VTK::TSetFunction mySetFunction; - TErase(): - mySetFunction(&vtkActor::SetVisibility,false) - {} - void operator()(SALOME_Actor* theActor){ - theActor->SetVisibility(false); - // Erase dependent actors - vtkActorCollection* aCollection = vtkActorCollection::New(); - theActor->GetChildActors(aCollection); - VTK::ForEach(aCollection,mySetFunction); - aCollection->Delete(); - } -}; +namespace SVTK +{ + struct TErase + { + VTK::TSetFunction mySetFunction; + TErase(): + mySetFunction(&vtkActor::SetVisibility,false) + {} + void + operator()(SALOME_Actor* theActor) + { + theActor->SetVisibility(false); + // Erase dependent actors + vtkActorCollection* aCollection = vtkActorCollection::New(); + theActor->GetChildActors(aCollection); + VTK::ForEach(aCollection,mySetFunction); + aCollection->Delete(); + } + }; +} void SVTK_View ::EraseAll() { - using namespace VTK; + using namespace SVTK; ForEach(getRenderer()->GetActors(), TErase()); Repaint(); @@ -361,7 +369,7 @@ void SVTK_View ::DisplayAll() { - using namespace VTK; + using namespace SVTK; ForEach(getRenderer()->GetActors(), TSetVisibility(true)); Repaint(); @@ -385,7 +393,7 @@ SVTK_View ::Erase(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TErase()); @@ -411,7 +419,7 @@ SVTK_View ::Display(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TSetVisibility(true)); @@ -430,25 +438,28 @@ SVTK_View //---------------------------------------------------------------------------- -struct TRemoveAction -{ - SVTK_Renderer* myRenderer; - TRemoveAction(SVTK_Renderer* theRenderer): - myRenderer(theRenderer) - {} - void - operator()(SALOME_Actor* theActor) +namespace SVTK +{ + struct TRemoveAction { - myRenderer->RemoveActor(theActor); - } -}; + SVTK_Renderer* myRenderer; + TRemoveAction(SVTK_Renderer* theRenderer): + myRenderer(theRenderer) + {} + void + operator()(SALOME_Actor* theActor) + { + myRenderer->RemoveActor(theActor); + } + }; +} void SVTK_View ::Remove(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TRemoveAction(GetRenderer())); @@ -490,7 +501,7 @@ float SVTK_View ::GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject) { - using namespace VTK; + using namespace SVTK; SALOME_Actor* anActor = Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); @@ -506,7 +517,7 @@ SVTK_View float theTrans) { float anOpacity = 1.0 - theTrans; - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TSetFunction @@ -521,7 +532,7 @@ SVTK_View { float aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; - using namespace VTK; + using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), TSetFunction @@ -533,7 +544,7 @@ QColor SVTK_View ::GetColor(const Handle(SALOME_InteractiveObject)& theIObject) { - using namespace VTK; + using namespace SVTK; SALOME_Actor* anActor = Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); diff --git a/src/SalomeApp/SalomeApp_VTKSelector.cxx b/src/SalomeApp/SalomeApp_VTKSelector.cxx index 00e55ec47..7f19aa1ee 100644 --- a/src/SalomeApp/SalomeApp_VTKSelector.cxx +++ b/src/SalomeApp/SalomeApp_VTKSelector.cxx @@ -112,6 +112,7 @@ void SalomeApp_VTKSelector ::getSelection( SUIT_DataOwnerPtrList& aList ) const { + using namespace SVTK; if(myViewer){ if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){ if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ @@ -126,7 +127,7 @@ SalomeApp_VTKSelector aSelector->GetIndex(anIO,anIds); SALOME_Actor* anActor = aSelector->GetActor(anIO); if( !anActor ) - anActor = VTK::Find(aView->getRenderer()->GetActors(),VTK::TIsSameIObject(anIO)); + anActor = Find(aView->getRenderer()->GetActors(),TIsSameIObject(anIO)); aList.append(new SalomeApp_SVTKDataOwner(anIO,anIds,aMode,anActor)); if(MYDEBUG) MESSAGE("VTKSelector::getSelection - "<getEntry()); -- 2.39.2