(parent, texture, textureId, context, depth)
| 580 | |
| 581 | |
| 582 | def 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 | # ----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected