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

Function propertySerializer

Web/Python/vtkmodules/web/render_window_serializer.py:834–868  ·  view source on GitHub ↗
(parent, propObj, propObjId, context, depth)

Source from the content-addressed store, hash-verified

832
833
834def propertySerializer(parent, propObj, propObjId, context, depth):
835 representation = (
836 propObj.GetRepresentation() if hasattr(propObj, "GetRepresentation") else 2
837 )
838 colorToUse = (
839 propObj.GetDiffuseColor() if hasattr(propObj, "GetDiffuseColor") else [1, 1, 1]
840 )
841 if representation == 1 and hasattr(propObj, "GetColor"):
842 colorToUse = propObj.GetColor()
843
844 return {
845 "parent": getReferenceId(parent),
846 "id": propObjId,
847 "type": class_name(propObj),
848 "properties": {
849 "representation": representation,
850 "diffuseColor": colorToUse,
851 "color": propObj.GetColor(),
852 "ambientColor": propObj.GetAmbientColor(),
853 "specularColor": propObj.GetSpecularColor(),
854 "edgeColor": propObj.GetEdgeColor(),
855 "ambient": propObj.GetAmbient(),
856 "diffuse": propObj.GetDiffuse(),
857 "specular": propObj.GetSpecular(),
858 "specularPower": propObj.GetSpecularPower(),
859 "opacity": propObj.GetOpacity(),
860 "interpolation": propObj.GetInterpolation(),
861 "edgeVisibility": 1 if propObj.GetEdgeVisibility() else 0,
862 "backfaceCulling": 1 if propObj.GetBackfaceCulling() else 0,
863 "frontfaceCulling": 1 if propObj.GetFrontfaceCulling() else 0,
864 "pointSize": propObj.GetPointSize(),
865 "lineWidth": propObj.GetLineWidth(),
866 "lighting": 1 if propObj.GetLighting() else 0,
867 },
868 }
869
870def volumePropertySerializer(parent, propObj, propObjId, context, depth):
871 calls = []

Callers

nothing calls this directly

Calls 11

getReferenceIdFunction · 0.90
class_nameFunction · 0.85
GetRepresentationMethod · 0.80
GetSpecularPowerMethod · 0.80
GetColorMethod · 0.45
GetAmbientMethod · 0.45
GetDiffuseMethod · 0.45
GetSpecularMethod · 0.45
GetOpacityMethod · 0.45
GetInterpolationMethod · 0.45
GetEdgeVisibilityMethod · 0.45

Tested by

no test coverage detected