From b987303a1f3adf6b1c0730ac46f6edb618d4d326 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 17 Nov 2009 14:35:34 +0000 Subject: [PATCH] Integrate patch from N.Geimer (vtk 5.2 compatibility) --- src/VTKViewer/VTKViewer_Trihedron.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index 8f224fe95..722d8ab58 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -24,6 +24,7 @@ #include "VTKViewer_Algorithm.h" // VTK Includes +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +46,10 @@ // QT includes #include +#if !defined(VTK_XVERSION) +#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION) +#endif + vtkStandardNewMacro(VTKViewer_UnScaledActor); /*!Constructor*/ @@ -165,7 +171,11 @@ VTKViewer_Axis::VTKViewer_Axis() myTextMapper = vtkTextMapper::New(); myLabelActor = vtkTextActor::New(); +#if (VTK_XVERSION > 0x050000) + myLabelActor->SetMapper(vtkPolyDataMapper2D::SafeDownCast(myTextMapper)); +#else myLabelActor->SetMapper(myTextMapper); +#endif myLabelActor->ScaledTextOff(); myLabelActor->PickableOff(); @@ -511,7 +521,7 @@ int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer) aCollection->InitTraversal(); int aCount = 0; while(vtkActor* prop = aCollection->GetNextActor()) { - if( prop->GetVisibility()) + if( prop->GetVisibility()) { if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(prop)) { if(!anActor->IsInfinitive()) aCount++; @@ -521,6 +531,7 @@ int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer) } //int aCount = theRenderer->VisibleActorCount(); //SetVisibility(aVis); + } } return aCount; } -- 2.39.2