MantisBT - VTK
View Issue Details
0010979VTK(No Category)public2010-07-12 04:052016-08-12 09:55
Sebastian Barth 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0010979: vtkAssemblys visiblity is ignored if it is added to another assembly
If you have two vtkAssembly where one is added to the other one and the added assembly contains e.g. an vtkActor the visiblity of this added assembly is ignored. Instead, the visibility of the vtkActor is only set by its visibility flag and the toppest assembly visibility flag.

The attached code shows the problem: The actor line2 should not be visible, since its assembly line2Assembly is set to invisible, but it is visible!
    vtkLineSource * source = vtkLineSource::New();
    source->SetPoint1(0, 0, 0);
    source->SetPoint2(20, 0, 0);

    vtkPolyDataMapper * mapper = vtkPolyDataMapper::New();
    mapper->SetInputConnection(source->GetOutputPort());

    vtkActor * line1 = vtkActor::New();
    line1->SetMapper(mapper);
    line1->GetProperty()->SetColor(1,0,0);

    vtkActor * line2 = vtkActor::New();
    line2->SetMapper(mapper);
    line2->GetProperty()->SetColor(0,1,0);
    line2->SetPosition(0, 2, 0);

    vtkAssembly * line2Assembly = vtkAssembly::New();
    line2Assembly->AddPart(line2);

    
    vtkAssembly * motherAssembly = vtkAssembly::New();
    motherAssembly->AddPart(line1);
    motherAssembly->AddPart(line2Assembly);

    // Following visiblity settings should set only actor line1 to be visible.
    // Instead, the line2 actor is visible, too;
    // line2Assemblys visibility is ignored -> Bug!
    line1->SetVisibility(true);
    line2->SetVisibility(true);
    line2Assembly->SetVisibility(false);
    motherAssembly->SetVisibility(true);


    vtkRenderer * ren = vtkRenderer::New();
    vtkRenderWindow * renWin = vtkRenderWindow::New();
    renWin->AddRenderer(ren);
    vtkRenderWindowInteractor * iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);

    ren->AddActor(motherAssembly);
    ren->ResetCamera();
    renWin->Render();
    iren->Start();
Visibility, vtkAssembly
Issue History
2010-07-12 04:05Sebastian BarthNew Issue
2010-07-12 08:33Sebastian BarthTag Attached: Visibility
2010-07-12 08:33Sebastian BarthTag Attached: vtkAssembly
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037184
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0037184)
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.