[Insight-users] Question re itkVTKPolyDataToMesh.hxx

Andriy Fedorov fedorov at bwh.harvard.edu
Wed Jul 10 22:55:24 EDT 2013


Hi,

I have a question about the following lines in
rapping/ExternalProjects/ItkVtkGlue/src/itkVTKPolyDataToMesh.hxx

100:   m_ItkMesh->SetPoint( p, typename TriangleMeshType::PointType( apoint ));
101:
102:    // Need to convert the point to PoinType
103:    typename TriangleMeshType::PointType pt;
104:    for(unsigned int i=0;i<3; i++)
105:      {
106:       pt[i] = apoint[i];
107:       }
108:     m_ItkMesh->SetPoint( p, pt);

I was incorporating this code into a Slicer module, and line 100 kept
giving me compile error:

error: no matching conversion for functional-style cast from
'vtkFloatingPointType *' (aka 'double *') to 'typename
TriangleMeshType::PointType'
      (aka 'Point<CoordRepType, 3U>')
    m_ItkMesh->SetPoint( p, typename TriangleMeshType::PointType( apoint ));

Getting rid of line 100 fixes the compile error.

Looking at the code, lines 104-107 duplicate what #100 does. Am I
missing something?

AF


More information about the Insight-users mailing list