[vtkusers] how to create a new mapper from vtkMapper2D
Rakesh Patil
rakeshthp at in.com
Fri Feb 5 07:59:11 EST 2010
If i use vtkGlyph3D, the size of the shape will vary as we zoom in and out.. i want the size to be same of the shape. As shown in vtkLabeledDataMapper test examplethanks Original message From:David Doria< daviddoria+vtk at gmail.com >Date: 05 Feb 10 18:19:00Subject:Re: [vtkusers] how to create a new mapper from vtkMapper2DTo: rakeshthp at in.comOn Fri, Feb 5, 2010 at 1:56 AM, Rakesh Patilwrote: 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. S
o I made of copy of vtkLabeledDataMapper,named as myShapeMapper2D and did few changes.In header file I replace vtkTextMapper with vtkPolyDataMapper2D In 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 advance I think you may be simply looking for a glyph filter?http://www.vtk.org/Wiki/VTK/Examples/vtkGlyph3DThanks, DavidGet 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/8a26fce6/attachment.htm>
More information about the vtkusers
mailing list