Skip to content

Commit ea73eff

Browse files
author
Charles PIGNEROL
committed
Version 5.13.1. Porting VTK 9.2.5/9.5.2. Removed VTK 5 code.
1 parent 217aa9b commit ea73eff

File tree

10 files changed

+47
-82
lines changed

10 files changed

+47
-82
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set (VTK_CONTRIB_MAJOR_VERSION "5")
66
set (VTK_CONTRIB_MINOR_VERSION "13")
7-
set (VTK_CONTRIB_RELEASE_VERSION "0")
7+
set (VTK_CONTRIB_RELEASE_VERSION "1")
88
set (VTK_CONTRIB_VERSION ${VTK_CONTRIB_MAJOR_VERSION}.${VTK_CONTRIB_MINOR_VERSION}.${VTK_CONTRIB_RELEASE_VERSION})
99

1010

src/VtkContrib/public/VtkContrib/vtk2dAxiDihedron.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @date 18/09/2019
55
*/
66

7-
#ifndef VTK_5
8-
97
#ifndef VTK_2DAXI_DIHEDRON_H
108
#define VTK_2DAXI_DIHEDRON_H
119

@@ -83,6 +81,5 @@ class vtk2dAxiDihedron : public vtkTrihedron
8381
vtkConeSource* m_zTipCurveSource;
8482
}; // class vtk2dAxiDihedron
8583

86-
#endif // VTK_5
8784

8885
#endif // VTK_2DAXI_DIHEDRON_H

src/VtkContrib/vtk2dAxiDihedron.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @date 18/09/2019
55
*/
66

7-
#ifndef VTK_5
8-
97
#include "VtkContrib/vtk2dAxiDihedron.h"
108

119
#include <vtkPolyDataMapper.h>
@@ -45,11 +43,7 @@ vtk2dAxiDihedron::vtk2dAxiDihedron ( )
4543
GetZAxisArrowSource ( ).InvertOn ( );
4644
if (0 != GetZAxisLabelActor ( ))
4745
GetZAxisLabelActor ( )->AddPosition (1., -radius, -2.1);
48-
#ifndef VTK_5
4946
zShaftCurveMapper->SetInputConnection (m_zShaftCurveSource->GetOutputPort ( ));
50-
#else // VTK_5
51-
zShaftCurveMapper->SetInput (m_zShaftCurveSource->GetOutput ( ));
52-
#endif // VTK_5
5347
zShaftCurveMapper->ScalarVisibilityOff ( );
5448
m_zShaftActor->SetMapper (zShaftCurveMapper);
5549
AddPart (m_zShaftActor);
@@ -64,11 +58,7 @@ vtk2dAxiDihedron::vtk2dAxiDihedron ( )
6458
1., -radius, -GetZAxisArrowSource ( ).GetTipLength ( ) / 2.);
6559
vtkPolyDataMapper* zTipConeMapper = vtkPolyDataMapper::New ( );
6660
zTipConeMapper->ScalarVisibilityOff ( );
67-
#ifndef VTK_5
6861
zTipConeMapper->SetInputConnection (m_zTipCurveSource->GetOutputPort ( ));
69-
#else // VTK_5
70-
zTipConeMapper->SetInput (m_zTipCurveSource->GetOutput ( ));
71-
#endif // VTK_5
7262
m_zTipActor = vtkActor::New ( );
7363
m_zTipActor->SetMapper (zTipConeMapper);
7464
m_zTipActor->GetProperty ( )->SetColor (vtkTrihedron::zColor);
@@ -168,4 +158,3 @@ void vtk2dAxiDihedron::SetElevationColor (double r, double g, double b)
168158
m_zTipActor->GetProperty ( )->SetColor (r, g, b);
169159
} // vtk2dAxiDihedron::SetElevationColor
170160

171-
#endif // VTK_5

src/VtkContrib/vtkECMAxesActor.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,21 @@ vtkECMAxesActor::vtkECMAxesActor ( )
3636
// Création de l'axe X
3737
_xAxis->SetPoint1 (-1., 0., 0.);
3838
_xAxis->SetPoint2 (1., 0., 0.);
39-
#ifndef VTK_5
4039
xAxisMapper->SetInputConnection (_xAxis->GetOutputPort ( ));
41-
#else // VTK_5
42-
xAxisMapper->SetInput (_xAxis->GetOutput ( ));
43-
#endif // VTK_5
4440
xAxisMapper->ScalarVisibilityOff ( );
4541
_xAxisActor->SetMapper (xAxisMapper);
4642

4743
// Création de l'axe Y
4844
_yAxis->SetPoint1 (0., -1., 0.);
4945
_yAxis->SetPoint2 (0., 1., 0.);
50-
#ifndef VTK_5
5146
yAxisMapper->SetInputConnection (_yAxis->GetOutputPort ( ));
52-
#else // VTK_5
53-
yAxisMapper->SetInput (_yAxis->GetOutput ( ));
54-
#endif // VTK_5
5547
yAxisMapper->ScalarVisibilityOff ( );
5648
_yAxisActor->SetMapper (yAxisMapper);
5749

5850
// Création de l'axe Z
5951
_zAxis->SetPoint1 (0., 0., -1.);
6052
_zAxis->SetPoint2 (0., 0., 1.);
61-
#ifndef VTK_5
6253
zAxisMapper->SetInputConnection (_zAxis->GetOutputPort ( ));
63-
#else // VTK_5
64-
zAxisMapper->SetInput (_zAxis->GetOutput ( ));
65-
#endif // VTK_5
6654
zAxisMapper->ScalarVisibilityOff ();
6755
_zAxisActor->SetMapper (zAxisMapper);
6856

src/VtkContrib/vtkFrustumWidget.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void vtkFrustumWidget::vtkInternalPlaneWidget::SetInteractorEnabled (bool enable
224224
} // if (true == enabled)
225225
} // if (0 != this->Picker)
226226
else
227-
vtkErrorMacro ("vtkFrustumWidget::SetInteractorEnabled : null picker.")
227+
vtkErrorMacro ("vtkFrustumWidget::SetInteractorEnabled : null picker.");
228228
} // vtkInternalPlaneWidget::SetInteractorEnabled
229229

230230

@@ -393,7 +393,7 @@ void vtkFrustumWidget::SetPlane (SIDE p, double origin [3], double normal [3])
393393
Update (planeWidget);
394394
} // if (0 != planeWidget)
395395
else
396-
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p)
396+
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p);
397397
} // vtkFrustumWidget::SetPlane
398398

399399

@@ -406,7 +406,7 @@ void vtkFrustumWidget::GetPlane (SIDE p, double origin [3], double normal [3])
406406
planeWidget->GetNormal (normal);
407407
} // if (0 != planeWidget)
408408
else
409-
vtkErrorMacro ("vtkFrustumWidget::GetPlane : 0 <= p <= 5 is not verified. p =" << p)
409+
vtkErrorMacro ("vtkFrustumWidget::GetPlane : 0 <= p <= 5 is not verified. p =" << p);
410410
} // vtkFrustumWidget::GetPlane
411411

412412

@@ -419,7 +419,7 @@ void vtkFrustumWidget::SetPlaneOrigin (SIDE p, double origin [3])
419419
Update (planeWidget);
420420
} // if (0 != planeWidget)
421421
else
422-
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p)
422+
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p);
423423
} // vtkFrustumWidget::SetPlaneOrigin
424424

425425

@@ -429,7 +429,7 @@ void vtkFrustumWidget::GetPlaneOrigin (SIDE p, double origin [3])
429429
if (0 != planeWidget)
430430
planeWidget->GetOrigin (origin);
431431
else
432-
vtkErrorMacro ("vtkFrustumWidget::GetPlaneOrigin : 0 <= p <= 5 is not verified. p =" << p)
432+
vtkErrorMacro ("vtkFrustumWidget::GetPlaneOrigin : 0 <= p <= 5 is not verified. p =" << p);
433433
} // vtkFrustumWidget::GetPlaneOrigin
434434

435435

@@ -442,7 +442,7 @@ void vtkFrustumWidget::SetPlaneNormal (SIDE p, double normal [3])
442442
Update (planeWidget);
443443
} // if (0 != planeWidget)
444444
else
445-
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p)
445+
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= p <= 5 is not verified. p =" << p);
446446
} // vtkFrustumWidget::SetPlaneNormal
447447

448448

@@ -452,7 +452,7 @@ void vtkFrustumWidget::GetPlaneNormal (SIDE p, double normal [3])
452452
if (0 != planeWidget)
453453
planeWidget->GetNormal (normal);
454454
else
455-
vtkErrorMacro ("vtkFrustumWidget::GetPlaneNormal : 0 <= p <= 5 is not verified. p =" << p)
455+
vtkErrorMacro ("vtkFrustumWidget::GetPlaneNormal : 0 <= p <= 5 is not verified. p =" << p);
456456
} // vtkFrustumWidget::GetPlaneNormal
457457

458458

@@ -467,7 +467,7 @@ void vtkFrustumWidget::SetInteractorColor (SIDE axis, double rgb [3])
467467
{
468468
if ((axis >= _planeWidgets.size ( )) || (0 == _planeWidgets [axis]))
469469
{
470-
vtkErrorMacro ("vtkFrustumWidget::SetInteractorColor : 0 <= axis <= " << _planeWidgets.size ( ) << " is not verified. axis =" << axis)
470+
vtkErrorMacro ("vtkFrustumWidget::SetInteractorColor : 0 <= axis <= " << _planeWidgets.size ( ) << " is not verified. axis =" << axis);
471471
return;
472472
} // if ((axis >= _planeWidgets.size ( )) || (0 == _planeWidgets [axis]))
473473

@@ -496,7 +496,7 @@ void vtkFrustumWidget::SetInteractorEnabled (SIDE p, bool enabled)
496496
if (0 != planeWidget)
497497
planeWidget->SetInteractorEnabled (enabled);
498498
else
499-
vtkErrorMacro ("vtkFrustumWidget::SetInteractorEnabled : 0 <= p <= 5 is not verified. p =" << p)
499+
vtkErrorMacro ("vtkFrustumWidget::SetInteractorEnabled : 0 <= p <= 5 is not verified. p =" << p);
500500
} // vtkFrustumWidget::SetInteractorEnabled
501501

502502

@@ -505,7 +505,9 @@ void vtkFrustumWidget::GetBounds (double bounds [6])
505505
vtkPolyData* frustum = 0 == _frustum ? 0 : _frustum->GetOutput ( );
506506

507507
if (0 == frustum)
508-
vtkErrorMacro ("vtkFrustumWidget::GetBounds : null frustum.")
508+
{
509+
vtkErrorMacro ("vtkFrustumWidget::GetBounds : null frustum.");
510+
}
509511
else
510512
{
511513
// frustum->GetBounds (bounds);
@@ -575,7 +577,9 @@ void vtkFrustumWidget::SetPlanes (vtkPlanes& planes)
575577
Update (0);
576578
}
577579
else
578-
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= planes.GetNumberOfPlanes ( ) <= 5 is not verified. p =" << planes.GetNumberOfPlanes ( ))
580+
{
581+
vtkErrorMacro ("vtkFrustumWidget::SetPlane : 0 <= planes.GetNumberOfPlanes ( ) <= 5 is not verified. p =" << planes.GetNumberOfPlanes ( ));
582+
}
579583
} // vtkFrustumWidget::SetPlanes
580584

581585

@@ -601,7 +605,7 @@ void vtkFrustumWidget::AddParallelPlanes (SIDE p)
601605
case TOP : AddParallelPlanes (BOTTOM, TOP); break;
602606
case FRONT :
603607
case BACK : AddParallelPlanes (FRONT, BACK); break;
604-
default : vtkErrorMacro ("vtkFrustumWidget::AddParallelPlanes : 0 <= p <= 5 is not verified. p =" << p)
608+
default : vtkErrorMacro ("vtkFrustumWidget::AddParallelPlanes : 0 <= p <= 5 is not verified. p =" << p);
605609
} // switch (p)
606610
} // vtkFrustumWidget::AddParallelPlanes
607611

@@ -616,7 +620,7 @@ void vtkFrustumWidget::RemoveParallelPlanes (SIDE p)
616620
case TOP : RemoveParallelPlanes (BOTTOM, TOP); break;
617621
case FRONT :
618622
case BACK : RemoveParallelPlanes (FRONT, BACK); break;
619-
default : vtkErrorMacro ("vtkFrustumWidget::RemoveParallelPlanes : 0 <= p <= 5 is not verified. p =" << p)
623+
default : vtkErrorMacro ("vtkFrustumWidget::RemoveParallelPlanes : 0 <= p <= 5 is not verified. p =" << p);
620624
} // switch (p)
621625
} // vtkFrustumWidget::RemoveParallelPlanes
622626

src/VtkContrib/vtkKatAxisActor.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ vtkKatAxisActor::vtkKatAxisActor()
113113

114114
this->TitleVector = vtkVectorText::New();
115115
this->TitleMapper = vtkPolyDataMapper::New();
116-
#ifndef VTK_5
117116
this->TitleMapper->SetInputConnection (this->TitleVector->GetOutputPort());
118-
#else // VTK_5
119-
this->TitleMapper->SetInput(this->TitleVector->GetOutput());
120-
#endif // VTK_5
121117
this->TitleActor = vtkFollower::New();
122118
this->TitleActor->SetMapper(this->TitleMapper);
123119

@@ -129,11 +125,7 @@ vtkKatAxisActor::vtkKatAxisActor()
129125

130126
this->Axis = vtkPolyData::New();
131127
this->AxisMapper = vtkPolyDataMapper::New();
132-
#ifndef VTK_5
133128
this->AxisMapper->SetInputData(this->Axis);
134-
#else // VTK_5
135-
this->AxisMapper->SetInput(this->Axis);
136-
#endif // VTK_5
137129
this->AxisActor = vtkActor::New();
138130
this->AxisActor->SetMapper(this->AxisMapper);
139131

@@ -1203,11 +1195,7 @@ vtkKatAxisActor::SetNumberOfLabels(const int numLabels)
12031195
{
12041196
this->LabelVectors[i] = vtkVectorText::New();
12051197
this->LabelMappers[i] = vtkPolyDataMapper::New();
1206-
#ifndef VTK_5
12071198
this->LabelMappers[i]->SetInputConnection(this->LabelVectors[i]->GetOutputPort());
1208-
#else // VTK_5
1209-
this->LabelMappers[i]->SetInput(this->LabelVectors[i]->GetOutput());
1210-
#endif // VTK_5
12111199
this->LabelActors[i] = vtkFollower::New();
12121200
this->LabelActors[i]->SetMapper(this->LabelMappers[i]);
12131201
}

src/VtkContrib/vtkPolygonFilter.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include <vtkDataSet.h>
44
#include <vtkCellData.h>
55
#include <vtkPointData.h>
6+
#include <vtkCellArray.h>
7+
#if VTK_MAJOR_VERSION >= 9
8+
#include <vtkCellArrayIterator.h>
9+
#endif // VTK_MAJOR_VERSION >= 9
610
#include <assert.h>
711

812
#include <algorithm>
@@ -68,9 +72,23 @@ int vtkPolygonFilter::RequestData (vtkInformation* request, vtkInformationVector
6872
output->Reset ( );
6973

7074
const size_t cellNum = cells->GetNumberOfCells ( );
71-
vtkIdType* cellsPtr = cells->GetPointer ( );
7275
output->SetPoints (pointSet);
7376
output->Allocate (cellNum, cellNum);
77+
#ifdef VTK_CELL_ARRAY_V2 // defined in vtkCellArray.h CP v 5.13.1 Portage VTK 9.3.0
78+
vtkSmartPointer<vtkCellArrayIterator> cellIterator = vtk::TakeSmartPointer (cells->NewIterator ( ));
79+
for (cellIterator->GoToFirstCell ( ); !cellIterator->IsDoneWithTraversal ( ); cellIterator->GoToNextCell ( ))
80+
{
81+
vtkIdType nodeCount = 0;
82+
const vtkIdType* ids = 0;
83+
cellIterator->GetCurrentCell (nodeCount, ids);
84+
switch (nodeCount)
85+
{
86+
case 3 : output->InsertNextCell (VTK_TRIANGLE, nodeCount, ids); break;
87+
case 4 : output->InsertNextCell (VTK_QUAD, nodeCount, ids); break;
88+
} // switch (nodeCount)
89+
} // for (cellIterator->GoToFirstCell ( ); !cellIterator->IsDoneWithTraversal ( ); cellIterator->GoToNextCell ( ))
90+
#else // VTK_CELL_ARRAY_V2
91+
vtkIdType* cellsPtr = cells->GetPointer ( );
7492
for (int i = 0; i < cellNum; i++)
7593
{
7694
const vtkIdType nodeCount = *cellsPtr;
@@ -82,6 +100,7 @@ int vtkPolygonFilter::RequestData (vtkInformation* request, vtkInformationVector
82100
} // switch (nodeCount)
83101
cellsPtr += nodeCount;
84102
} // for (i = 0; i < cellNum; i++)
103+
#endif // VTK_CELL_ARRAY_V2
85104

86105
output->GetCellData ( )->PassData (input->GetCellData ( ));
87106
output->Squeeze ( );

src/VtkContrib/vtkTrihedron.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,11 @@ vtkTrihedron::vtkTrihedron ( )
7171
// Création de l'axe X
7272
m_xAxisArrowSource->SetShaftResolution(ArrowResolution);
7373
m_xAxisArrowSource->SetTipResolution(TipResolution);
74-
#ifndef VTK_5
7574
xAxisMapper->SetInputConnection (m_xAxisArrowSource->GetOutputPort ( ));
76-
#else // VTK_5
77-
xAxisMapper->SetInput (m_xAxisArrowSource->GetOutput ( ));
78-
#endif // VTK_5
7975
xAxisMapper->ScalarVisibilityOff();
8076
m_xAxisActor->SetMapper(xAxisMapper);
8177
m_xVectorText->SetText("x");
82-
#ifndef VTK_5
8378
xLabelMapper->SetInputConnection(m_xVectorText->GetOutputPort());
84-
#else // VTK_5
85-
xLabelMapper->SetInput(m_xVectorText->GetOutput());
86-
#endif // VTK_5
8779
m_xLabelActor->SetMapper(xLabelMapper);
8880
m_xLabelActor->SetScale(0.4,0.4,0.4);
8981
m_xLabelActor->AddPosition(1.1,0.0,0.0);
@@ -102,20 +94,12 @@ vtkTrihedron::vtkTrihedron ( )
10294
// Création de l'axe Y
10395
m_yAxisArrowSource->SetShaftResolution(ArrowResolution);
10496
m_yAxisArrowSource->SetTipResolution(TipResolution);
105-
#ifndef VTK_5
10697
yAxisMapper->SetInputConnection (m_yAxisArrowSource->GetOutputPort ( ));
107-
#else // VTK_5
108-
yAxisMapper->SetInput(m_yAxisArrowSource->GetOutput());
109-
#endif // VTK_5
11098
yAxisMapper->ScalarVisibilityOff();
11199
m_yAxisActor->SetMapper(yAxisMapper);
112100
m_yAxisActor->RotateZ(90);
113101
m_yVectorText->SetText("y");
114-
#ifndef VTK_5
115102
yLabelMapper->SetInputConnection(m_yVectorText->GetOutputPort());
116-
#else // VTK_5
117-
yLabelMapper->SetInput(m_yVectorText->GetOutput());
118-
#endif // VTK_5
119103
m_yLabelActor->SetMapper(yLabelMapper);
120104
m_yLabelActor->SetScale(0.4,0.4,0.4);
121105
m_yLabelActor->AddPosition(0.0,1.1,0.0);
@@ -134,20 +118,12 @@ vtkTrihedron::vtkTrihedron ( )
134118
// Création de l'axe Z
135119
m_zAxisArrowSource->SetShaftResolution(ArrowResolution);
136120
m_zAxisArrowSource->SetTipResolution(TipResolution);
137-
#ifndef VTK_5
138121
zAxisMapper->SetInputConnection (m_zAxisArrowSource->GetOutputPort ( ));
139-
#else // VTK_5
140-
zAxisMapper->SetInput(m_zAxisArrowSource->GetOutput());
141-
#endif // VTK_5
142122
zAxisMapper->ScalarVisibilityOff();
143123
m_zAxisActor->SetMapper(zAxisMapper);
144124
m_zAxisActor->RotateY(-90);
145125
m_zVectorText->SetText("z");
146-
#ifndef VTK_5
147126
zLabelMapper->SetInputConnection(m_zVectorText->GetOutputPort());
148-
#else // VTK_5
149-
zLabelMapper->SetInput(m_zVectorText->GetOutput());
150-
#endif // VTK_5
151127
m_zLabelActor->SetMapper(zLabelMapper);
152128
m_zLabelActor->SetScale(0.4,0.4,0.4);
153129
m_zLabelActor->AddPosition(0.0,0.0,1.1);

src/tests/point_widget.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,9 @@ int main ( int argc, char *argv[] )
105105

106106
vtkUnstructuredGrid* grid = vtkUnstructuredGrid::New ( );
107107
vtkDataSetMapper* mapper = vtkDataSetMapper::New ( );
108-
#ifndef VTK_5
109108
mapper->SetInputData (grid);
110-
#else // VTK_5
111-
mapper->SetInput (grid);
112-
#endif // VTK_5
113109
mapper->ScalarVisibilityOff ( );
114-
#if defined(VTK5) || defined(VTK_7)
110+
#ifdef VTK_7
115111
mapper->SetImmediateModeRendering (false);
116112
#endif
117113
vtkActor* actor = vtkActor::New ( );

versions.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 5.13.1 : 24/10/25
2+
================
3+
4+
Portage VTK 9.2.5/9.5.2.
5+
6+
Suppression du code VTK 5.
7+
8+
19
Version 5.13.0 : 21/10/25
210
================
311

0 commit comments

Comments
 (0)