Integrate patch from G.David (for vtk 5.2 and newer)

This commit is contained in:
vsr 2009-12-11 16:29:49 +00:00
parent f1bc3e4413
commit bf9d590cda
2 changed files with 8 additions and 6 deletions

View File

@ -404,9 +404,7 @@ SMESH_ActorDef::SMESH_ActorDef()
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
#if (VTK_XVERSION >= 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%d");
#else
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
@ -449,9 +447,7 @@ SMESH_ActorDef::SMESH_ActorDef()
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
#if (VTK_XVERSION >= 0x050200)
myClsLabeledDataMapper->SetLabelFormat("%d");
#else
#if (VTK_XVERSION < 0x050200)
myClsLabeledDataMapper->SetLabelFormat("%g");
#endif
myClsLabeledDataMapper->SetLabelModeToLabelScalars();

View File

@ -73,6 +73,10 @@
#include <vtkIntArray.h>
#include <vtkProperty2D.h>
#include <vtkPointData.h>
#include <vtkConfigure.h>
#if !defined(VTK_XVERSION)
#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
#endif
// Qt includes
#include <QApplication>
@ -145,7 +149,9 @@ namespace SMESH
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New();