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

ClaudeG claude.gangolf at gmail.com
Thu Jul 2 08:06:45 EDT 2009


  /// 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
-- 
View this message in context: http://www.nabble.com/VTk-and-STL-Containers-from-C%2B%2B-tp24305314p24305593.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list