LayerData.py 1.0 KB

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2015 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from UM.Mesh.MeshData import MeshData
  4. ## Class to holds the layer mesh and information about the layers.
  5. # Immutable, use LayerDataBuilder to create one of these.
  6. class LayerData(MeshData):
  7. def __init__(self, vertices = None, normals = None, indices = None, colors = None, uvs = None, file_name = None,
  8. center_position = None, layers=None, element_counts=None, attributes=None):
  9. super().__init__(vertices=vertices, normals=normals, indices=indices, colors=colors, uvs=uvs,
  10. file_name=file_name, center_position=center_position, attributes=attributes)
  11. self._layers = layers
  12. self._element_counts = element_counts
  13. def getLayer(self, layer):
  14. if layer in self._layers:
  15. return self._layers[layer]
  16. else:
  17. return None
  18. def getLayers(self):
  19. return self._layers
  20. def getElementCounts(self):
  21. return self._element_counts