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

View File

@ -73,6 +73,10 @@
#include <vtkIntArray.h> #include <vtkIntArray.h>
#include <vtkProperty2D.h> #include <vtkProperty2D.h>
#include <vtkPointData.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 // Qt includes
#include <QApplication> #include <QApplication>
@ -145,7 +149,9 @@ namespace SMESH
myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput()); myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g"); myPtsLabeledDataMapper->SetLabelFormat("%g");
#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New(); vtkTextProperty* aPtsTextProp = vtkTextProperty::New();