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

Method Add

Rendering/VtkJS/vtkVtkJSSceneGraphSerializer.cxx:243–275  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

241
242//------------------------------------------------------------------------------
243void vtkVtkJSSceneGraphSerializer::Add(vtkViewNode* node, vtkActor* actor)
244{
245 // Skip actors that are connected to composite mappers (they are dealt with
246 // when the mapper is traversed).
247 //
248 // TODO: this is an awkward consequence of an external scene graph traversal
249 // mechanism where we cannot abort the traversal of subordinate nodes
250 // and an imperfect parity between VTK and vtk-js (namely the lack of
251 // support in vtk-js for composite data structures). This logic should
252 // be removed when vtk-js support for composite data structures is in
253 // place.
254 {
255 auto const& children = node->GetChildren();
256 for (auto child : children)
257 {
258 if (vtkCompositePolyDataMapper::SafeDownCast(child->GetRenderable()))
259 {
260 return;
261 }
262 }
263 }
264
265 Json::Value* parent = this->Internals->entry(node->GetParent()->GetRenderable());
266 Json::Value val = this->ToJson(*parent, actor);
267 (*parent)["dependencies"].append(val);
268
269 Json::Value v = Json::arrayValue;
270 v.append("addViewProp");
271 Json::Value w = Json::arrayValue;
272 w.append("instance:${" + vtk::to_string(this->UniqueId(node->GetRenderable())) + "}");
273 v.append(w);
274 (*parent)["calls"].append(v);
275}
276
277//------------------------------------------------------------------------------
278void vtkVtkJSSceneGraphSerializer::Add(Json::Value* self, vtkAlgorithm* algorithm)

Callers 2

ToJsonMethod · 0.95
SynchronizeMethod · 0.45

Calls 15

ToJsonMethod · 0.95
UniqueIdMethod · 0.95
SetColorAndOpacityFunction · 0.85
ToJsonFunction · 0.85
GetInputDataObjectMethod · 0.80
asStringMethod · 0.80
to_stringFunction · 0.50
GetChildrenMethod · 0.45
entryMethod · 0.45
GetParentMethod · 0.45
appendMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected