------------------------------------------------------------------------------
| 241 | |
| 242 | //------------------------------------------------------------------------------ |
| 243 | void 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 | //------------------------------------------------------------------------------ |
| 278 | void vtkVtkJSSceneGraphSerializer::Add(Json::Value* self, vtkAlgorithm* algorithm) |
no test coverage detected