(parent, propObj, propObjId, context, depth)
| 832 | |
| 833 | |
| 834 | def 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 | |
| 870 | def volumePropertySerializer(parent, propObj, propObjId, context, depth): |
| 871 | calls = [] |
nothing calls this directly
no test coverage detected