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

Function textureSerializer

Web/Python/vtkmodules/web/render_window_serializer.py:582–618  ·  view source on GitHub ↗
(parent, texture, textureId, context, depth)

Source from the content-addressed store, hash-verified

580
581
582def textureSerializer(parent, texture, textureId, context, depth):
583 # This kind of mapper requires us to get 2 items: input data and lookup
584 # table
585 dataObject = None
586 dataObjectInstance = None
587 calls = []
588 dependencies = []
589
590 if hasattr(texture, "GetInput"):
591 dataObject = texture.GetInput()
592 else:
593 logger.debug("This texture does not have GetInput method")
594
595 if dataObject:
596 dataObjectId = "%s-texture" % textureId
597 dataObjectInstance = serializeInstance(
598 texture, dataObject, dataObjectId, context, depth + 1
599 )
600 if dataObjectInstance:
601 dependencies.append(dataObjectInstance)
602 calls.append(["setInputData", [wrapId(dataObjectId)]])
603
604 if dataObjectInstance:
605 return {
606 "parent": getReferenceId(parent),
607 "id": textureId,
608 "type": "vtkTexture",
609 "properties": {
610 "interpolate": texture.GetInterpolate(),
611 "repeat": texture.GetRepeat(),
612 "edgeClamp": texture.GetEdgeClamp(),
613 },
614 "calls": calls,
615 "dependencies": dependencies,
616 }
617
618 return None
619
620
621# -----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

getReferenceIdFunction · 0.90
serializeInstanceFunction · 0.85
wrapIdFunction · 0.85
GetInterpolateMethod · 0.80
GetInputMethod · 0.45
debugMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected