[vtkusers] Parts not disappearing as expected inside assemblies.

Day, Michael A AMRDEC/UAH mike.a.day at us.army.mil
Tue Aug 23 14:03:02 EDT 2005


Howdy
 
It seems to me that the following code should produce 3 cubes, the
middle of which is invisible.  However, I only can get the middle cube
to go invisible if I uncomment the "anotherCube->VisibilityOff();" line.
Shouldn't the vtkAssembly be able to make its children invisible,
without having to explicitly call VisibilityOff on each individual
child?  Am I missing something here?
 
<snip>
 
 vtkAssembly* topAssem = vtkAssembly::New();
 
 double i = 0;
 for(i = 0; i < 15; i+=5) {
  vtkAssembly* nextAssem = vtkAssembly::New();
  anotherCube = makeCubeActor();  //this function makes a 1x1x1 cube
  anotherCube->SetPosition(i,i,i);
  
  nextAssem->AddPart(anotherCube);
 
  if(i == 5) {
   nextAssem->VisibilityOff();
   //anotherCube->VisibilityOff(); //shouldn't need this line, in my
opinion
  }
 
  topAssem->AddPart(nextAssem);
 }
 
//add the Assembly to Renderer, the Renderer to a RenderWindow etc.
 
<snap>
 
Thanks,
 
Mike Day
Virtual Targets Center
https://modelexchange.army.mil/
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050823/39cafa3a/attachment.htm>


More information about the vtkusers mailing list