遍历vtkRenderer中的vtkActor

    xiaoxiao2021-12-14  18

    这篇博客 主要 想让大家知道如何遍历Render中的Actor,对Actor进行修改。

    vtkActorCollection* actorCollection = render->GetActors();

    int num = actorCollection->GetNumberOfItems();

    // Description:

     // Initialize the traversal of the collection. This means the data pointer  // is set at the beginning of the list.

    //这个函数比较重要,否则getNextActor将没法得到正确的actor

    actorCollection->InitTraversal();

    for (int i=0;i<num;++i) { vtkActor* actor = actorCollection->GetNextActor(); 然后对每个actor进行修改

    }

    转载请注明原文地址: https://ju.6miu.com/read-963584.html

    最新回复(0)