Converted comments in dir Cura/cura to rst style

Converted doxygen style comments to reStructuredText style in the files found in Cura/cura directory using the script dox_2_rst.py (provided in the Uranium repo). Comments were manually checked and changed if needed.
This commit is contained in:
Jelle Spijker 2020-04-21 16:58:45 +02:00 committed by Jelle Spijker
parent fb4aec96a8
commit 6aedab78dc
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
15 changed files with 371 additions and 208 deletions

View file

@ -1,7 +1,7 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, TYPE_CHECKING, cast
from typing import Optional, TYPE_CHECKING, cast, List
from UM.Application import Application
@ -20,9 +20,14 @@ if TYPE_CHECKING:
from UM.Scene.Camera import Camera
# Make color brighter by normalizing it (maximum factor 2.5 brighter)
# color_list is a list of 4 elements: [r, g, b, a], each element is a float 0..1
def prettier_color(color_list):
def prettier_color(color_list: List[float]) -> List[float]:
"""Make color brighter by normalizing
maximum factor 2.5 brighter
:param color_list: a list of 4 elements: [r, g, b, a], each element is a float 0..1
:return: a normalized list of 4 elements: [r, g, b, a], each element is a float 0..1
"""
maximum = max(color_list[:3])
if maximum > 0:
factor = min(1 / maximum, 2.5)
@ -31,11 +36,14 @@ def prettier_color(color_list):
return [min(i * factor, 1.0) for i in color_list]
## A render pass subclass that renders slicable objects with default parameters.
# It uses the active camera by default, but it can be overridden to use a different camera.
#
# This is useful to get a preview image of a scene taken from a different location as the active camera.
class PreviewPass(RenderPass):
"""A :py:class:`Uranium.UM.View.RenderPass` subclass that renders slicable objects with default parameters.
It uses the active camera by default, but it can be overridden to use a different camera.
This is useful to get a preview image of a scene taken from a different location as the active camera.
"""
def __init__(self, width: int, height: int) -> None:
super().__init__("preview", width, height, 0)