[vtkusers] Wiki examples fail to build due to no InsertNextTypedTuple

Elvis Stansvik elvis.stansvik at orexplore.com
Thu May 26 05:27:14 EDT 2016


I got some other errors as well. I'm attaching a diff of how I had to
change the examples in order for them all to compile with 7.0.0.

Unfortunately don't have time right now to go through the wiki pages and
edit them.

Regards,
Elvis

2016-05-26 10:51 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:

> In several of the wiki examples, I get
>
> /home/estan/orexplore/VTKWikiExamples/Cxx/GeometricObjects/ColoredLines.cxx:72:13:
> error: ‘class vtkUnsignedCharArray’ has no member named
> ‘InsertNextTypedTuple’
>      colors->InsertNextTypedTuple(red);
>
> I can't find the InsertNextTypedTuple function in VTK 7.
>
> The change was made here:
>
>
> http://www.vtk.org/Wiki/index.php?title=VTK%2FExamples%2FCxx%2FGeometricObjects%2FColoredLines&diff=59278&oldid=59243
>
> Where is InsertNextTypedTuple coming from?
>
> Elvis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160526/31869116/attachment.html>
-------------- next part --------------
diff --git a/Cxx/GeometricObjects/ColoredLines.cxx b/Cxx/GeometricObjects/ColoredLines.cxx
index 689e0d8..3948d99 100644
--- a/Cxx/GeometricObjects/ColoredLines.cxx
+++ b/Cxx/GeometricObjects/ColoredLines.cxx
@@ -65,13 +65,8 @@ int main(int, char *[])
   vtkSmartPointer<vtkUnsignedCharArray> colors =
     vtkSmartPointer<vtkUnsignedCharArray>::New();
   colors->SetNumberOfComponents(3);
-#if VTK_MAJOR_VERSION < 7
     colors->InsertNextTupleValue(red);
     colors->InsertNextTupleValue(green);
-#else
-    colors->InsertNextTypedTuple(red);
-    colors->InsertNextTypedTuple(green);
-#endif
   
   // Color the lines.
   // SetScalars() automatically associates the values in the data array passed as parameter
diff --git a/Cxx/Graphs/AdjacentVertexIterator.cxx b/Cxx/Graphs/AdjacentVertexIterator.cxx
index b537c5d..00e27cf 100644
--- a/Cxx/Graphs/AdjacentVertexIterator.cxx
+++ b/Cxx/Graphs/AdjacentVertexIterator.cxx
@@ -39,7 +39,7 @@ int main(int, char *[])
   
   for(unsigned int i = 0; i < 4; i++)
     {
-    vertexColors->InsertNextTypedTuple(blue);//not connected vertices
+    vertexColors->InsertNextTuple(blue);//not connected vertices
     }
    
  
diff --git a/Cxx/Math/VectorDot.cxx b/Cxx/Math/VectorDot.cxx
index ffba206..2940589 100644
--- a/Cxx/Math/VectorDot.cxx
+++ b/Cxx/Math/VectorDot.cxx
@@ -33,9 +33,9 @@ int main(int, char *[])
   normals->InsertNextTupleValue(n1);
   normals->InsertNextTupleValue(n2);
 #else
-  normals->InsertNextTypedTuple(n0);
-  normals->InsertNextTypedTuple(n1);
-  normals->InsertNextTypedTuple(n2);
+  normals->InsertNextTuple(n0);
+  normals->InsertNextTuple(n1);
+  normals->InsertNextTuple(n2);
 #endif
   polydata->GetPointData()->SetNormals(normals);
 
@@ -53,9 +53,9 @@ int main(int, char *[])
   vectors->InsertNextTupleValue(v1);
   vectors->InsertNextTupleValue(v2);
 #else
-  vectors->InsertNextTypedTuple(v0);
-  vectors->InsertNextTypedTuple(v1);
-  vectors->InsertNextTypedTuple(v2);
+  vectors->InsertNextTuple(v0);
+  vectors->InsertNextTuple(v1);
+  vectors->InsertNextTuple(v2);
 #endif
   polydata->GetPointData()->SetVectors(vectors);
 
diff --git a/Cxx/Math/VectorNorm.cxx b/Cxx/Math/VectorNorm.cxx
index 6b19c36..d97049a 100644
--- a/Cxx/Math/VectorNorm.cxx
+++ b/Cxx/Math/VectorNorm.cxx
@@ -28,8 +28,8 @@ int main(int, char *[])
   distances->InsertNextTupleValue(v1);
   distances->InsertNextTupleValue(v2);
 #else
-  distances->InsertNextTypedTuple(v1);
-  distances->InsertNextTypedTuple(v2);
+  distances->InsertNextTuple(v1);
+  distances->InsertNextTuple(v2);
 #endif  
   polydata->GetPointData()->SetVectors(distances);
   
diff --git a/Cxx/Meshes/ColoredElevationMap.cxx b/Cxx/Meshes/ColoredElevationMap.cxx
index 0f3d603..e1ead41 100644
--- a/Cxx/Meshes/ColoredElevationMap.cxx
+++ b/Cxx/Meshes/ColoredElevationMap.cxx
@@ -97,11 +97,7 @@ int main(int, char *[])
               << (int)color[1] << " "
               << (int)color[2] << std::endl;
  
-#if VTK_MAJOR_VERSION < 7
     colors->InsertNextTupleValue(color);
-#else
-    colors->InsertNextTypedTuple(color);
-#endif
     }
  
   outputPolyData->GetPointData()->SetScalars(colors);
diff --git a/Cxx/Meshes/ElevationFilter.cxx b/Cxx/Meshes/ElevationFilter.cxx
index 76ba0a5..8a87767 100644
--- a/Cxx/Meshes/ElevationFilter.cxx
+++ b/Cxx/Meshes/ElevationFilter.cxx
@@ -87,11 +87,7 @@ int main(int, char *[])
       }
     std::cout << "color: " << (int)color[0] << " " << (int)color[1] << " " << (int)color[2] << std::endl;
     
-#if VTK_MAJOR_VERSION < 7
     colors->InsertNextTupleValue(color);
-#else
-    colors->InsertNextTypedTuple(color);
-#endif
     }
   
   output->GetPointData()->AddArray(colors);
diff --git a/Cxx/Meshes/SimpleElevationFilter.cxx b/Cxx/Meshes/SimpleElevationFilter.cxx
index 94f9435..2bd1585 100644
--- a/Cxx/Meshes/SimpleElevationFilter.cxx
+++ b/Cxx/Meshes/SimpleElevationFilter.cxx
@@ -86,11 +86,7 @@ int main(int, char *[])
       }
     std::cout << "color: " << (int)color[0] << " " << (int)color[1] << " " << (int)color[2] << std::endl;
     
-#if VTK_MAJOR_VERSION < 7
     colors->InsertNextTupleValue(color);
-#else
-    colors->InsertNextTypedTuple(color);
-#endif
     }
   
   output->GetPointData()->AddArray(colors);
diff --git a/Cxx/PolyData/ColoredPoints.cxx b/Cxx/PolyData/ColoredPoints.cxx
index 3970f9c..cf8a255 100644
--- a/Cxx/PolyData/ColoredPoints.cxx
+++ b/Cxx/PolyData/ColoredPoints.cxx
@@ -48,15 +48,9 @@ int main(int, char *[])
     vtkSmartPointer<vtkUnsignedCharArray>::New();
   colors->SetNumberOfComponents(3);
   colors->SetName ("Colors");
-#if VTK_MAJOR_VERSION < 7
   colors->InsertNextTupleValue(red);
   colors->InsertNextTupleValue(green);
   colors->InsertNextTupleValue(blue);
-#else
-  colors->InsertNextTypedTuple(red);
-  colors->InsertNextTypedTuple(green);
-  colors->InsertNextTypedTuple(blue);
-#endif
   polydata->GetPointData()->SetScalars(colors);
 
   // Visualization
diff --git a/Cxx/PolyData/TriangleColoredPoints.cxx b/Cxx/PolyData/TriangleColoredPoints.cxx
index 861e3ae..01348b9 100644
--- a/Cxx/PolyData/TriangleColoredPoints.cxx
+++ b/Cxx/PolyData/TriangleColoredPoints.cxx
@@ -33,15 +33,9 @@ int main(int, char *[])
   colors->SetName("Colors");
 
   // Add the three colors we have created to the array
-#if VTK_MAJOR_VERSION < 7
   colors->InsertNextTupleValue(red);
   colors->InsertNextTupleValue(green);
   colors->InsertNextTupleValue(blue);
-#else
-  colors->InsertNextTypedTuple(red);
-  colors->InsertNextTypedTuple(green);
-  colors->InsertNextTypedTuple(blue);
-#endif
   // Create a triangle
   vtkSmartPointer<vtkCellArray> triangles =
     vtkSmartPointer<vtkCellArray>::New();
diff --git a/Cxx/PolyData/TriangleSolidColor.cxx b/Cxx/PolyData/TriangleSolidColor.cxx
index badb852..cb18adf 100644
--- a/Cxx/PolyData/TriangleSolidColor.cxx
+++ b/Cxx/PolyData/TriangleSolidColor.cxx
@@ -31,11 +31,7 @@ int main(int, char *[])
     vtkSmartPointer<vtkUnsignedCharArray>::New();
   colors->SetNumberOfComponents(3);
   colors->SetName("Colors");
-#if VTK_MAJOR_VERSION < 7
   colors->InsertNextTupleValue(red);
-#else
-  colors->InsertNextTypedTuple(red);
-#endif
  
   vtkSmartPointer<vtkCellArray> triangles =
     vtkSmartPointer<vtkCellArray>::New();
diff --git a/Cxx/Utilities/ShepardMethod.cxx b/Cxx/Utilities/ShepardMethod.cxx
index c6ceeae..dd411a8 100644
--- a/Cxx/Utilities/ShepardMethod.cxx
+++ b/Cxx/Utilities/ShepardMethod.cxx
@@ -31,13 +31,8 @@ int main(int, char *[])
     vtkSmartPointer<vtkUnsignedCharArray>::New();
   vertexColors->SetNumberOfComponents(3);
   vertexColors->SetName("Colors");
-#if VTK_MAJOR_VERSION < 7
   vertexColors->InsertNextTupleValue(black);
   vertexColors->InsertNextTupleValue(white);
-#else
-  vertexColors->InsertNextTypedTuple(black);
-  vertexColors->InsertNextTypedTuple(white);
-#endif
 
   // Create a scalar array for the pointdata, each value represents the distance
   // of the vertices from the first vertex
diff --git a/Cxx/Visualization/BackgroundTexture.cxx b/Cxx/Visualization/BackgroundTexture.cxx
index dcc9e0f..d3830cf 100644
--- a/Cxx/Visualization/BackgroundTexture.cxx
+++ b/Cxx/Visualization/BackgroundTexture.cxx
@@ -31,13 +31,8 @@ int main(int, char *[])
     vtkSmartPointer<vtkUnsignedCharArray>::New();
   vertexColors->SetNumberOfComponents(3);
   vertexColors->SetName("Colors");
-#if VTK_MAJOR_VERSION < 7
   vertexColors->InsertNextTupleValue(black);
   vertexColors->InsertNextTupleValue(white);
-#else
-  vertexColors->InsertNextTypedTuple(black);
-  vertexColors->InsertNextTypedTuple(white);
-#endif
   // Create a scalar array for the pointdata, each value represents the distance
   // of the vertices from the first vertex
   vtkSmartPointer<vtkFloatArray> values = 
diff --git a/Cxx/Visualization/ColorGlyphs.cxx b/Cxx/Visualization/ColorGlyphs.cxx
index 0f6e072..048e949 100644
--- a/Cxx/Visualization/ColorGlyphs.cxx
+++ b/Cxx/Visualization/ColorGlyphs.cxx
@@ -31,15 +31,9 @@ int main(int, char *[])
   unsigned char r[3] = {255,0,0};
   unsigned char g[3] = {0,255,0};
   unsigned char b[3] = {0,0,255};
-#if VTK_MAJOR_VERSION < 7
   colors->InsertNextTupleValue(r);
   colors->InsertNextTupleValue(g);
   colors->InsertNextTupleValue(b);
-#else
-  colors->InsertNextTypedTuple(r);
-  colors->InsertNextTypedTuple(g);
-  colors->InsertNextTypedTuple(b);
-#endif
     
   // Combine into a polydata
   vtkSmartPointer<vtkPolyData> polydata = 
diff --git a/Cxx/Visualization/CubeAxesActor.cxx b/Cxx/Visualization/CubeAxesActor.cxx
index cd4c010..f4e81cc 100644
--- a/Cxx/Visualization/CubeAxesActor.cxx
+++ b/Cxx/Visualization/CubeAxesActor.cxx
@@ -47,13 +47,7 @@ int main(int, char *[])
   cubeAxesActor->DrawXGridlinesOn();
   cubeAxesActor->DrawYGridlinesOn();
   cubeAxesActor->DrawZGridlinesOn();
-#if VTK_MAJOR_VERSION == 6
   cubeAxesActor->SetGridLineLocation(VTK_GRID_LINES_FURTHEST);
-#endif
-#if VTK_MAJOR_VERSION > 6
-  cubeAxesActor->SetGridLineLocation(
-    cubeAxesActor->VTK_GRID_LINES_FURTHEST);
-#endif
   
   cubeAxesActor->XAxisMinorTickVisibilityOff();
   cubeAxesActor->YAxisMinorTickVisibilityOff();


More information about the vtkusers mailing list