<commit_before>from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources

class LayerView(View):
    def __init__(self):
        super().__init__()
        self._material = None
        self._num_layers = 
        self._layer_percentage = 0 #what percentage of layers need to be shown (SLider gives value between 0 - 100)

    def beginRendering(self):
        scene = self.getController().getScene()
        renderer = self.getRenderer()
        renderer.setRenderSelection(False)
        self._num_layers = 0

        if not self._material:
            self._material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, 'basic.vert'), Resources.getPath(Resources.ShadersLocation, 'vertexcolor.frag'))

            self._material.setUniformValue("u_color", [1.0, 0.0, 0.0, 1.0])

        for node in DepthFirstIterator(scene.getRoot()):
            if not node.render(renderer):
                if node.getMeshData() and node.isVisible():
                    try:
                        layer_data = node.getMeshData().layerData
                        if self._num_layers < len(layer_data.getLayers()):
                            self._num_layers = len(layer_data.getLayers())
                            
                    except AttributeError:
                        continue

                    renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines)<commit_msg>More documentation<commit_after>from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources

## View used to display g-code paths.
class LayerView(View):
    def __init__(self):
        super().__init__()
        self._material = None
        self._num_layers = 
        self._layer_percentage = 0 # what percentage of layers need to be shown (SLider gives value between 0 - 100)

    def beginRendering(self):
        scene = self.getController().getScene()
        renderer = self.getRenderer()
        renderer.setRenderSelection(False)
        self._num_layers = 0

        if not self._material:
            self._material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, 'basic.vert'), Resources.getPath(Resources.ShadersLocation, 'vertexcolor.frag'))
            self._material.setUniformValue("u_color", [1.0, 0.0, 0.0, 1.0])

        for node in DepthFirstIterator(scene.getRoot()):
            if not node.render(renderer):
                if node.getMeshData() and node.isVisible():
                    try:
                        layer_data = node.getMeshData().layerData
                        if self._num_layers < len(layer_data.getLayers()): 
                            self._num_layers = len(layer_data.getLayers())
                            
                    except AttributeError:
                        continue

                    renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines)
{'fraction_non_alphanumeric': 0.09096692111959287, 'fraction_numerical': 0.008905852417302799, 'mean_word_length': 2.196138211382114, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4315540', 'n_tokens_mistral': 853, 'n_tokens_neox': 797, 'n_words': 188}