这篇博客 主要 想让大家知道如何遍历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进行修改
}