[vtkusers] VTk and STL-Containers from C++

David Doria daviddoria+vtk at gmail.com
Thu Jul 2 08:28:49 EDT 2009


On Thu, Jul 2, 2009 at 8:06 AM, ClaudeG <claude.gangolf at gmail.com> wrote:

>
>  /// map containing mappers
>  std::map<unsigned long, vtkPolyDataMapper *, std::less<unsigned long> >
> mapper;
>  /// iterator for mapper
>  std::map<unsigned long, vtkPolyDataMapper *, std::less<unsigned long>
> >::iterator mapper_pos;
>
>
> //function to setup the mapper and the actors, with the fin, i read a file
> to get all the properties of the cylinder which are stored in a file
> steup(vtkRenderer *renderer, std::ifstream &fin)
> {
>   /// map containing actors
>    std::map<unsigned long, vtkActor *, std::less<unsigned long> > actors;
>   /// iterator for actors
>    std::map<unsigned long, vtkActor *, std::less<unsigned long> >::iterator
> actors_pos;
>
>
>   // mapper responsible for pushing the geometry into the graphics library
>   mapper[particle_counter] = vtkPolyDataMapper::New();
>
>
> mapper[particle_counter]->SetInputConnection(CylinderSource->GetOutputPort());
>
>   // The actor is a grouping mechanism: besides the geometry (mapper), it
>   // also has a property, transformation matrix, and/or texture map.
>  actors[particle_counter] = vtkActor::New();
>  actors[particle_counter]->SetMapper(mapper[particle_counter]);
>
>  // Add the actors to the renderer
>  renderer->AddActor(actors[particle_counter]);
>
>  // increment particle count
>  particle_counter++;
> }
>
> //function to manipulate the actors
> manipulate(vtkRenderer *renderer, std::ifstream &fin)
> {
>   actors[particle_counter]->SetPosition(3,4,2);
> }
>
> It is a simplification of my code but when i start the program i see the
> cylinder (to talk in the example-term) but no manipulation has been done to
> him
>

I understand that it's a simplification, but it doesn't show that you are
even calling manipulate(), so I can't look into why it is not being
manipulated! haha

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090702/60fb35a7/attachment.htm>


More information about the vtkusers mailing list