[vtkusers] PolyData with single point is invisible

Deelip Menezes deelip at fpsols.com
Thu Aug 25 02:35:48 EDT 2005


I am using VTK 4.2 and am facing a peculiar problem. I am displaying a set
of points using vtkOpenGLPolyDataMapper. This is my code to do that.

vtkPoints* pPoints = vtkPoints::New();
for(int i = 0; i < m_Points.Count(); i++)
	pPoints->InsertNextPoint(m_Points[i].x, m_Points[i].y,
m_Points[i].z);

vtkPolyData* pPolyData = vtkPolyData::New();
pPolyData->Allocate();
pPolyData->SetPoints(pPoints);
int iIndex[1];
for(i = 0; i < m_Points.Count(); i++)
{
	iIndex[0] = i;
	pPolyData->InsertNextCell(VTK_VERTEX, 1, iIndex);
}

m_pPointsMapper->SetInput(pPolyData);
m_pPointsMapper->Update();

The above works perfectly. However, when the point list contains just one
point nothing is shown. Nothing is shown even if there are more than one
points but all are coincident (same x,y,z coordinates).

Can anyone shed some light on this? I have spent quite some time on this
issue but just cannot get it to work.

Regards,

Deelip Menezes





More information about the vtkusers mailing list