MantisBT - VTK
View Issue Details
0011164VTK(No Category)public2010-08-24 08:312016-08-12 09:55
Sebastian Barth 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0011164: vtkAssembly does not implement the vtkProp::RenderOverlay(vtkViewport * ren) method
The vtkAssembly of 5.6.0 does not have the recursive method:
    int vtkPropAssembly::RenderOverlay(vtkViewport * ren);

Hybrid 2D/3D actors like vtkAxesActor do implement this method to get their 2D data rendered. The vtkAssembly does need this method, too. Not only because of the existence of these classes but rather because of their base class vtkProp3D which only defines the abilities to get positioned and oriented in 3D space and NOT that they are restricted to only render 3D graphics.

E.g. if you don't add this method to vtkAssembly, the vtkAxesActor cannot display its caption labels when it has been added to the a vtkAssembly.
Here is the code of the method I've added to vtkAssembly.cxx:

// Render this assembly and all its parts. The rendering process is recursive.
int vtkAssembly::RenderOverlay(vtkViewport *ren) {
  vtkProp3D *prop3D;
  vtkAssemblyPath *path;
  double fraction;
  int renderedSomething=0;

  // Make sure the paths are up-to-date
  this->UpdatePaths();
  
  // for allocating render time between components
  // simple equal allocation
  fraction = this->AllocatedRenderTime
    / static_cast<double>(this->Paths->GetNumberOfItems());
  
  vtkCollectionSimpleIterator sit;
  for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
    {
    prop3D = static_cast<vtkProp3D *>(path->GetLastNode()->GetViewProp());
    if ( prop3D->GetVisibility() )
      {
      prop3D->SetAllocatedRenderTime(fraction, ren);
      prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
      renderedSomething += prop3D->RenderOverlay(ren);
      prop3D->PokeMatrix(NULL);
      }
    }

  renderedSomething = (renderedSomething > 0)?(1):(0);

  return renderedSomething;
}
No tags attached.
cxx vtkAssembly.cxx (13,903) 2010-08-27 08:28
https://www.vtk.org/Bug/file/8344/vtkAssembly.cxx
? vtkAssembly.h (6,725) 2010-08-27 08:28
https://www.vtk.org/Bug/file/8345/vtkAssembly.h
Issue History
2010-08-24 08:31Sebastian BarthNew Issue
2010-08-27 08:28Sebastian BarthFile Added: vtkAssembly.cxx
2010-08-27 08:28Sebastian BarthFile Added: vtkAssembly.h
2010-08-27 08:29Sebastian BarthNote Added: 0021988
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037196
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0021988)
Sebastian Barth   
2010-08-27 08:29   
I've patched the files by my own and uploaded them. They are based on VTK 5.6.0.
(0037196)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.