MCPcopy Create free account
hub / github.com/Kitware/VTK / Synchronize

Method Synchronize

Rendering/ANARI/vtkAnariCompositePolyDataMapperNode.cxx:37–99  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

35
36//------------------------------------------------------------------------------
37void 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();

Callers

nothing calls this directly

Calls 14

SynchronizeBlockMethod · 0.95
vtkColor3dClass · 0.85
GetVtkActorMethod · 0.80
ClearSurfacesMethod · 0.80
SetActorNodeNameMethod · 0.80
GetMaterialNameMethod · 0.80
GetInputDataObjectMethod · 0.80
popMethod · 0.80
stringClass · 0.50
GetMTimeMethod · 0.45
GetVisibilityMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected