#include "VTKViewer_Algorithm.h"
// VTK Includes
+#include <vtkConfigure.h>
#include <vtkMath.h>
#include <vtkMapper.h>
#include <vtkDataSet.h>
#include <vtkLineSource.h>
#include <vtkConeSource.h>
#include <vtkPolyDataMapper.h>
+#include <vtkPolyDataMapper2D.h>
#include <vtkVectorText.h>
#include <vtkTextActor.h>
#include <vtkTextMapper.h>
// QT includes
#include <QtGlobal>
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
vtkStandardNewMacro(VTKViewer_UnScaledActor);
/*!Constructor*/
myTextMapper = vtkTextMapper::New();
myLabelActor = vtkTextActor::New();
+#if (VTK_XVERSION > 0x050000)
+ myLabelActor->SetMapper(vtkPolyDataMapper2D::SafeDownCast(myTextMapper));
+#else
myLabelActor->SetMapper(myTextMapper);
+#endif
myLabelActor->ScaledTextOff();
myLabelActor->PickableOff();
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++;
}
//int aCount = theRenderer->VisibleActorCount();
//SetVisibility(aVis);
+ }
}
return aCount;
}