[vtkusers] how to create a new mapper from vtkMapper2D

Rakesh Patil rakeshthp at in.com
Fri Feb 5 01:56:06 EST 2010


Hello friends,First of all, I want to know, whether there is any class which works exactly same as that of vtkLabeledDataMapper,but instead of displaying Text/Label at each point of the dataset, i need a shape (sphere, cone, arrow etc, to be displayed.)The thing I want to emphasize here is that the pixel or size of the lebel/text when we zoom in and out remains constant whenwe use vtkLabeledDataMapper. I want to implement similar functionality but replacing texts/labels with any shape. I tried my best to search for any such class, but i couldn't find any. So, I planned to write a new one. So I made of copy of vtkLabeledDataMapper,named as myShapeMapper2D and did few changes.In header file I replace vtkTextMapper with vtkPolyDataMapper2DIn source file, the following changes were done, in BuildLabelsInternal() functionLines from 284 to 458 and 474 to 537 were commented.And just before the for loop starts, i wrote this code,vtkSphereSource *sphere = vtkSphereSource::New();and in
  side loop, this>textMapper[i+this>NumberOfLabel]>SetInput(sphere>GetOutput());also in AllocateLabels() function, I replaced, vtkTextMapper with vtkPolyDataMapper2D.The code compiles without any problem. But no output is produced. Can anyone sketch out what may be the problem? Please help me to solve this problem.Thanks in advanceDear vtkusers ! Get Yourself a cool, short @in.com Email ID now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100205/01ff28c6/attachment.htm>


More information about the vtkusers mailing list