[vtkusers] know the pixels on the line

Pankaj Gupta stn.gupta.pankaj at gmail.com
Tue Nov 28 01:21:46 EST 2017


Hi,

 I am new to vtk. I am using Activiz. I created multiple lines using
vtkLine and display them using vtkActor. Now i want to draw line on 2D
points calculated from the 3D Line Points. I want to know all the pixels of
3D lines from where my lines is passed. Below is my code.

vtkPoints points = vtkPoints.New();
for (int i = 0; i < point.Count; i++)
points.InsertNextPoint(x, y, z);

vtkCellArray lines = vtkCellArray.New();
for (int i = 0; i < point.Count-1; i++)
{
  vtkLine line = vtkLine.New();
  line.GetPointIds().SetId(0, i);
  line.GetPointIds().SetId(1, i + 1);
  lines.InsertNextCell(line);
}

vtkPolyData linesPolyData = vtkPolyData.New();
linesPolyData.SetPoints(points);
linesPolyData.SetLines(lines);
linesPolyData.Update();

vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
mapper.SetInput(linesPolyData);
mapper.Update();

vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
actor.GetProperty().SetLineWidth(10);
actor.GetProperty().SetColor(255, 255, 0);
renderer.AddActor(actor);


Now i want to know the pixels on the lines. Please help me. Thanks in
advance. :) :)


Thanks,

Pankaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171128/c1fc0752/attachment.html>


More information about the vtkusers mailing list