------------------------------------------------------------------------------
| 35 | |
| 36 | //------------------------------------------------------------------------------ |
| 37 | void vtkAnariCompositePolyDataMapperNode::Synchronize(bool prepass) |
| 38 | { |
| 39 | vtkAnariProfiling startProfiling( |
| 40 | "vtkAnariCompositePolyDataMapperNode::Render", vtkAnariProfiling::BROWN); |
| 41 | |
| 42 | if (!prepass || !ActorWasModified()) |
| 43 | { |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | this->RenderTime = this->GetVtkActor()->GetMTime(); |
| 48 | this->ClearSurfaces(); |
| 49 | |
| 50 | vtkActor* act = this->GetVtkActor(); |
| 51 | if (!act->GetVisibility()) |
| 52 | { |
| 53 | return; |
| 54 | } |
| 55 | |
| 56 | this->SetActorNodeName(); |
| 57 | |
| 58 | vtkProperty* prop = act->GetProperty(); |
| 59 | |
| 60 | // Push base-values on the state stack. |
| 61 | this->BlockState.Visibility.push(true); |
| 62 | this->BlockState.Opacity.push(prop->GetOpacity()); |
| 63 | this->BlockState.AmbientColor.push(vtkColor3d(prop->GetAmbientColor())); |
| 64 | this->BlockState.DiffuseColor.push(vtkColor3d(prop->GetDiffuseColor())); |
| 65 | this->BlockState.SpecularColor.push(vtkColor3d(prop->GetSpecularColor())); |
| 66 | |
| 67 | const char* materialName = prop->GetMaterialName(); |
| 68 | |
| 69 | if (materialName != nullptr) |
| 70 | { |
| 71 | this->BlockState.Material.push(std::string(materialName)); |
| 72 | } |
| 73 | else |
| 74 | { |
| 75 | this->BlockState.Material.push(std::string("matte")); |
| 76 | } |
| 77 | |
| 78 | // render using the composite data attributes |
| 79 | unsigned int flat_index = 0; |
| 80 | vtkMapper* baseMapper = vtkMapper::SafeDownCast(this->GetRenderable()); |
| 81 | vtkDataObject* dobj = nullptr; |
| 82 | |
| 83 | if (baseMapper) |
| 84 | { |
| 85 | dobj = baseMapper->GetInputDataObject(0, 0); |
| 86 | |
| 87 | if (dobj) |
| 88 | { |
| 89 | this->SynchronizeBlock(baseMapper, act, dobj, flat_index); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | this->BlockState.Visibility.pop(); |
| 94 | this->BlockState.Opacity.pop(); |
nothing calls this directly
no test coverage detected