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

Method WritePropCollection

IO/Export/vtkJSONSceneExporter.cxx:601–625  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

599
600//------------------------------------------------------------------------------
601void vtkJSONSceneExporter::WritePropCollection(
602 vtkPropCollection* props, std::ostream& sceneComponents)
603{
604 vtkIdType nbProps = props->GetNumberOfItems();
605 for (vtkIdType rpIdx = 0; rpIdx < nbProps; rpIdx++)
606 {
607 vtkProp* prop = vtkProp::SafeDownCast(props->GetItemAsObject(rpIdx));
608 // Skip non-visible actors
609 if (!prop || !prop->GetVisibility())
610 {
611 continue;
612 }
613
614 // Skip actors with no geometry
615 vtkActor* actor = vtkActor::SafeDownCast(prop);
616 if (actor)
617 {
618 vtkMapper* mapper = actor->GetMapper();
619
620 vtkDataObject* dataObject = mapper->GetInputDataObject(0, 0);
621 this->WriteDataObject(sceneComponents, dataObject, actor, nullptr, nullptr);
622 this->WriteLookupTable(mapper->GetArrayName(), mapper->GetLookupTable());
623 }
624 }
625}
626
627//------------------------------------------------------------------------------
628void vtkJSONSceneExporter::WriteVolumeCollection(

Callers 1

WriteDataMethod · 0.95

Calls 9

WriteDataObjectMethod · 0.95
WriteLookupTableMethod · 0.95
GetItemAsObjectMethod · 0.80
GetMapperMethod · 0.80
GetInputDataObjectMethod · 0.80
GetNumberOfItemsMethod · 0.45
GetVisibilityMethod · 0.45
GetArrayNameMethod · 0.45
GetLookupTableMethod · 0.45

Tested by

no test coverage detected