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

Function genericActorSerializer

Web/Python/vtkmodules/web/render_window_serializer.py:432–511  ·  view source on GitHub ↗
(parent, actor, actorId, context, depth)

Source from the content-addressed store, hash-verified

430
431
432def genericActorSerializer(parent, actor, actorId, context, depth):
433 # This kind of actor has two "children" of interest, a property and a
434 # mapper
435 actorVisibility = actor.GetVisibility()
436 mapperInstance = None
437 propertyInstance = None
438 calls = []
439 dependencies = []
440
441 if actorVisibility:
442 mapper = None
443 if not hasattr(actor, "GetMapper"):
444 logger.debug("This actor does not have a GetMapper method")
445 else:
446 mapper = actor.GetMapper()
447
448 if mapper:
449 mapperId = getReferenceId(mapper)
450 mapperInstance = serializeInstance(
451 actor, mapper, mapperId, context, depth + 1
452 )
453 if mapperInstance:
454 dependencies.append(mapperInstance)
455 calls.append(["setMapper", [wrapId(mapperId)]])
456
457 prop = None
458 if hasattr(actor, "GetProperty"):
459 prop = actor.GetProperty()
460 else:
461 logger.debug("This actor does not have a GetProperty method")
462
463 if prop:
464 propId = getReferenceId(prop)
465 propertyInstance = serializeInstance(
466 actor, prop, propId, context, depth + 1
467 )
468 if propertyInstance:
469 dependencies.append(propertyInstance)
470 calls.append(["setProperty", [wrapId(propId)]])
471
472 # Handle texture if any
473 texture = None
474 if hasattr(actor, "GetTexture"):
475 texture = actor.GetTexture()
476 else:
477 logger.debug("This actor does not have a GetTexture method")
478
479 if texture:
480 textureId = getReferenceId(texture)
481 textureInstance = serializeInstance(
482 actor, texture, textureId, context, depth + 1
483 )
484 if textureInstance:
485 dependencies.append(textureInstance)
486 calls.append(["addTexture", [wrapId(textureId)]])
487
488 if actorVisibility == 0 or (mapperInstance and propertyInstance):
489 return {

Callers

nothing calls this directly

Calls 15

getReferenceIdFunction · 0.90
serializeInstanceFunction · 0.85
wrapIdFunction · 0.85
class_nameFunction · 0.85
GetMapperMethod · 0.80
GetVisibilityMethod · 0.45
debugMethod · 0.45
appendMethod · 0.45
GetPropertyMethod · 0.45
GetTextureMethod · 0.45
GetOriginMethod · 0.45
GetPositionMethod · 0.45

Tested by

no test coverage detected