LayerData.py 1.1 KB

12345678910111213141516171819202122232425262728
  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 LayerData(MeshData):
  5. """Class to holds the layer mesh and information about the layers.
  6. Immutable, use :py:class:`cura.LayerDataBuilder.LayerDataBuilder` to create one of these.
  7. """
  8. def __init__(self, vertices = None, normals = None, indices = None, colors = None, uvs = None, file_name = None,
  9. center_position = None, layers=None, element_counts=None, attributes=None):
  10. super().__init__(vertices=vertices, normals=normals, indices=indices, colors=colors, uvs=uvs,
  11. file_name=file_name, center_position=center_position, attributes=attributes)
  12. self._layers = layers
  13. self._element_counts = element_counts
  14. def getLayer(self, layer):
  15. if layer in self._layers:
  16. return self._layers[layer]
  17. return None
  18. def getLayers(self):
  19. return self._layers
  20. def getElementCounts(self):
  21. return self._element_counts