From: apo Date: Mon, 3 Oct 2005 06:27:39 +0000 (+0000) Subject: To show FPS for both main and segmented views X-Git-Tag: BR-D5-38-2003_D2005-12-10~94 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f3b072e9efe914e385ec08e364c0a9161c8c9e9;p=modules%2Fvisu.git To show FPS for both main and segmented views --- diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index 6b075ff5..0cad2ffc 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -126,14 +126,48 @@ VISU_FPSActor return 1; } +//---------------------------------------------------------------------------- +vtkStandardNewMacro(VVTK_Renderer); + +//---------------------------------------------------------------------------- +VVTK_Renderer +::VVTK_Renderer(): + myFPSActor(VISU_FPSActor::New()) +{ + if(MYDEBUG) INFOS("VVTK_Renderer() - "<Delete(); + + vtkTextMapper* aTextMapper = vtkTextMapper::New(); + vtkTextProperty *aTextProperty = aTextMapper->GetTextProperty(); + aTextProperty->SetJustificationToRight(); + aTextProperty->SetVerticalJustificationToTop(); + aTextProperty->SetFontSize(10); + + myFPSActor->SetPickable(false); + myFPSActor->ScaledTextOff(); + myFPSActor->SetAlignmentPoint(8); + myFPSActor->SetPosition2 (1., 1.); + myFPSActor->SetMapper(aTextMapper); + aTextMapper->Delete(); + + GetDevice()->AddActor2D(myFPSActor.GetPointer()); +} + +VVTK_Renderer +::~VVTK_Renderer() +{ + if(MYDEBUG) INFOS("~VVTK_Renderer() - "<SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5); myImplicitFunctionWidget->Delete(); - myTextActor->Delete(); - - vtkTextMapper* aTextMapper = vtkTextMapper::New(); - vtkTextProperty *aTextProperty = aTextMapper->GetTextProperty(); - aTextProperty->SetJustificationToRight(); - aTextProperty->SetVerticalJustificationToTop(); - aTextProperty->SetFontSize(10); - - myTextActor->SetPickable(false); - myTextActor->ScaledTextOff(); - myTextActor->SetAlignmentPoint(8); - myTextActor->SetPosition2 (1., 1.); - myTextActor->SetMapper(aTextMapper); - aTextMapper->Delete(); - - GetDevice()->AddActor2D(myTextActor.GetPointer()); } VVTK_Renderer1 @@ -285,6 +303,7 @@ void VVTK_Renderer2 ::OnEndInteractionEvent() { + AdjustActors(); myInteractor->Render(); } diff --git a/src/VVTK/VVTK_Renderer.h b/src/VVTK/VVTK_Renderer.h index 5b0bce8c..28eff415 100644 --- a/src/VVTK/VVTK_Renderer.h +++ b/src/VVTK/VVTK_Renderer.h @@ -39,7 +39,22 @@ class VISU_FPSActor; class vtkImplicitFunction; //---------------------------------------------------------------------------- -class VVTK_EXPORT VVTK_Renderer1 : public SVTK_Renderer +class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer +{ + public: + vtkTypeMacro(VVTK_Renderer,SVTK_Renderer); + static VVTK_Renderer* New(); + + protected: + VVTK_Renderer(); + ~VVTK_Renderer(); + + vtkSmartPointer myFPSActor; +}; + + +//---------------------------------------------------------------------------- +class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer { public: vtkTypeMacro(VVTK_Renderer1,SVTK_Renderer); @@ -74,7 +89,7 @@ class VVTK_EXPORT VVTK_Renderer1 : public SVTK_Renderer //---------------------------------------------------------------------------- -class VVTK_EXPORT VVTK_Renderer2 : public SVTK_Renderer +class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer { public: vtkTypeMacro(VVTK_Renderer2,SVTK_Renderer);