sas.qtgui.GL package¶
Submodules¶
sas.qtgui.GL.color module¶
- class sas.qtgui.GL.color.ColorMap(colormap_name='rainbow', min_value=0.0, max_value=1.0)¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'sas.qtgui.GL.color', '_default_colormap': 'rainbow', '__init__': <function ColorMap.__init__>, 'vertex_coloring': <function ColorMap.vertex_coloring>, '__dict__': <attribute '__dict__' of 'ColorMap' objects>, '__weakref__': <attribute '__weakref__' of 'ColorMap' objects>, '__doc__': None, '__annotations__': {}})¶
- __doc__ = None¶
- __init__(colormap_name='rainbow', min_value=0.0, max_value=1.0)¶
Utility class for colormaps, principally used for mapping data in Surface
- __module__ = 'sas.qtgui.GL.color'¶
- __weakref__¶
list of weak references to the object
- _default_colormap = 'rainbow'¶
- vertex_coloring(values: ndarray)¶
Evaluate the color map and return a ColorSpecification object
- class sas.qtgui.GL.color.ColorSpecification(method: ColorSpecificationMethod, data: ndarray)¶
Bases:
object
Specification of how to colour an object, and the data needed to do so
- __annotations__ = {'data': <class 'numpy.ndarray'>, 'method': <enum 'ColorSpecificationMethod'>}¶
- __dataclass_fields__ = {'data': Field(name='data',type=<class 'numpy.ndarray'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'method': Field(name='method',type=<enum 'ColorSpecificationMethod'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}¶
- __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)¶
- __dict__ = mappingproxy({'__module__': 'sas.qtgui.GL.color', '__annotations__': {'method': <enum 'ColorSpecificationMethod'>, 'data': <class 'numpy.ndarray'>}, '__doc__': ' Specification of how to colour an object, and the data needed to do so', '__dict__': <attribute '__dict__' of 'ColorSpecification' objects>, '__weakref__': <attribute '__weakref__' of 'ColorSpecification' objects>, '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False), '__dataclass_fields__': {'method': Field(name='method',type=<enum 'ColorSpecificationMethod'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'data': Field(name='data',type=<class 'numpy.ndarray'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__init__': <function ColorSpecification.__init__>, '__repr__': <function ColorSpecification.__repr__>, '__eq__': <function ColorSpecification.__eq__>, '__hash__': None, '__match_args__': ('method', 'data')})¶
- __doc__ = ' Specification of how to colour an object, and the data needed to do so'¶
- __eq__(other)¶
Return self==value.
- __hash__ = None¶
- __init__(method: ColorSpecificationMethod, data: ndarray) None ¶
- __match_args__ = ('method', 'data')¶
- __module__ = 'sas.qtgui.GL.color'¶
- __repr__()¶
Return repr(self).
- __weakref__¶
list of weak references to the object
- data: ndarray¶
- method: ColorSpecificationMethod¶
- class sas.qtgui.GL.color.ColorSpecificationMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Specifies how to colour an object
- BY_COMPONENT = 2¶
- BY_VERTEX = 3¶
- UNIFORM = 1¶
- __doc__ = ' Specifies how to colour an object'¶
- __module__ = 'sas.qtgui.GL.color'¶
- sas.qtgui.GL.color._component_coloring(data: Sequence[Sequence[float] | ndarray]) ColorSpecification ¶
Create a ColorSpecification for colouring each mesh/edge within an object a single colour
- sas.qtgui.GL.color.edge_coloring(data: Sequence[Sequence[float] | ndarray]) ColorSpecification ¶
Create a ColorSpecification for colouring each edge within an object a single colour
- sas.qtgui.GL.color.mesh_coloring(data: Sequence[Sequence[float] | ndarray]) ColorSpecification ¶
Create a ColorSpecification for colouring each mesh within an object a single colour
- sas.qtgui.GL.color.uniform_coloring(r, g, b, alpha=1.0)¶
Create a ColorSpecification for colouring with a single colour
- sas.qtgui.GL.color.vertex_coloring(data: ndarray) ColorSpecification ¶
Create a ColorSpecification for using vertex colouring
sas.qtgui.GL.cone module¶
- class sas.qtgui.GL.cone.Cone(n: int = 20, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
Bases:
FullModel
Graphics primitive: Radius 1, Height 2 cone “centred” at (0,0,0)
- __abstractmethods__ = frozenset({})¶
- __doc__ = ' Graphics primitive: Radius 1, Height 2 cone "centred" at (0,0,0)'¶
- __init__(n: int = 20, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.cone'¶
- _abc_impl = <_abc._abc_data object>¶
- static cone_base_triangles(n) List[Tuple[int, int, int]] ¶
Helper function: Triangles in base the cone primitive
- static cone_edges(n)¶
Helper function: Edges of the cone primitive
- static cone_tip_triangles(n) List[Tuple[int, int, int]] ¶
Helper function: Triangles in tip of the cone primitive
- static cone_triangles(n) List[List[Tuple[int, int, int]]] ¶
Helper function: The two separate meshes for triangles of the cone primitive
- static cone_vertices(n) List[Tuple[float, float, float]] ¶
Helper function: Vertices of the cone primitive
sas.qtgui.GL.cube module¶
- class sas.qtgui.GL.cube.Cube(colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
Bases:
FullModel
Unit cube centred at 0,0,0
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Unit cube centred at 0,0,0'¶
- __init__(colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.cube'¶
- _abc_impl = <_abc._abc_data object>¶
- cube_edges = [(0, 1), (1, 5), (5, 4), (4, 0), (2, 3), (3, 7), (7, 6), (6, 2), (1, 3), (5, 7), (4, 6), (0, 2)]¶
- cube_triangles = [[(1, 2, 3), (1, 0, 2)], [(0, 6, 2), (0, 4, 6)], [(4, 7, 6), (4, 5, 7)], [(5, 3, 7), (5, 1, 3)], [(2, 7, 3), (2, 6, 7)], [(1, 4, 0), (1, 5, 4)]]¶
- cube_vertices = [(-0.5, -0.5, -0.5), (-0.5, -0.5, 0.5), (-0.5, 0.5, -0.5), (-0.5, 0.5, 0.5), (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5)]¶
sas.qtgui.GL.cylinder module¶
- class sas.qtgui.GL.cylinder.Cylinder(n: int = 20, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
Bases:
FullModel
Graphics primitive: Radius 1, Height 2 cone “centred” at (0,0,0)
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Graphics primitive: Radius 1, Height 2 cone "centred" at (0,0,0)'¶
- __init__(n: int = 20, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.cylinder'¶
- _abc_impl = <_abc._abc_data object>¶
- static cylinder_edges(n)¶
Helper function: Edges of the cylinder primitive
- static cylinder_face_triangles(n, offset) List[Tuple[int, int, int]] ¶
Helper function: Faces of the ends of cylinder primitive
- static cylinder_side_triangles(n) List[Tuple[int, int, int]] ¶
Helper function: Faces of the sides of the cylinder primitive
- static cylinder_triangles(n) List[List[Tuple[int, int, int]]] ¶
Helper function: All faces of the cylinder primitive
- static cylinder_vertices(n) List[Tuple[float, float, float]] ¶
Helper function: Vertices of the cylinder primitive
sas.qtgui.GL.icosahedron module¶
- class sas.qtgui.GL.icosahedron.Icosahedron(colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
Bases:
FullModel
Icosahedron centred at 0,0,0
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Icosahedron centred at 0,0,0'¶
- __init__(colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.icosahedron'¶
- _abc_impl = <_abc._abc_data object>¶
- ico_edges = [(0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (1, 2), (2, 3), (3, 4), (4, 5), (5, 1), (1, 6), (2, 7), (3, 8), (4, 9), (5, 10), (1, 10), (2, 6), (3, 7), (4, 8), (5, 9), (6, 7), (7, 8), (8, 9), (9, 10), (10, 6), (6, 11), (7, 11), (8, 11), (9, 11), (10, 11)]¶
- ico_triangles = [[(0, 1, 2), (0, 2, 3), (0, 3, 4), (0, 4, 5), (0, 5, 1), (2, 1, 6), (3, 2, 7), (4, 3, 8), (5, 4, 9), (1, 5, 10), (6, 10, 1), (7, 6, 2), (8, 7, 3), (9, 8, 4), (10, 9, 5), (6, 7, 11), (7, 8, 11), (8, 9, 11), (9, 10, 11), (10, 6, 11)]]¶
- ico_vertices = [(0.0, 0.0, 1.0), (0.8944271909999159, 0.0, 0.4472135954999579), (0.27639320225002106, 0.8506508083520399, 0.4472135954999579), (-0.7236067977499788, 0.5257311121191337, 0.4472135954999579), (-0.7236067977499789, -0.5257311121191335, 0.4472135954999579), (0.27639320225002084, -0.85065080835204, 0.4472135954999579), (0.7236067977499789, 0.5257311121191336, -0.4472135954999579), (-0.27639320225002095, 0.85065080835204, -0.4472135954999579), (-0.8944271909999159, 1.0953573965284052e-16, -0.4472135954999579), (-0.2763932022500211, -0.8506508083520399, -0.4472135954999579), (0.7236067977499788, -0.5257311121191338, -0.4472135954999579), (0.0, 0.0, -1.0)]¶
sas.qtgui.GL.models module¶
3D Model classes
- class sas.qtgui.GL.models.FullModel(vertices: Sequence[Tuple[float, float, float]] | ndarray, edges: Sequence[Tuple[int, int]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray], edge_colors: ColorSpecification | None, colors: ColorSpecification | None)¶
Bases:
SolidVertexModel
,WireModel
Model that has both wireframe and solid, vertex coloured rendering enabled,
See SolidVertexModel and WireModel
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Model that has both wireframe and solid, vertex coloured rendering enabled,\n\n See SolidVertexModel and WireModel\n '¶
- __init__(vertices: Sequence[Tuple[float, float, float]] | ndarray, edges: Sequence[Tuple[int, int]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray], edge_colors: ColorSpecification | None, colors: ColorSpecification | None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.models'¶
- _abc_impl = <_abc._abc_data object>¶
- class sas.qtgui.GL.models.ModelBase(vertices: Sequence[Tuple[float, float, float]] | ndarray)¶
Bases:
Renderable
Base class for all models
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Base class for all models'¶
- __init__(vertices: Sequence[Tuple[float, float, float]] | ndarray)¶
- __module__ = 'sas.qtgui.GL.models'¶
- _abc_impl = <_abc._abc_data object>¶
- property vertices¶
- class sas.qtgui.GL.models.SolidModel(vertices: Sequence[Tuple[float, float, float]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray])¶
Bases:
ModelBase
Base class for the solid models
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = ' Base class for the solid models'¶
- __init__(vertices: Sequence[Tuple[float, float, float]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray])¶
- __module__ = 'sas.qtgui.GL.models'¶
- _abc_impl = <_abc._abc_data object>¶
- property triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray]¶
- class sas.qtgui.GL.models.SolidVertexModel(vertices: Sequence[Tuple[float, float, float]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray], colors: ColorSpecification | None)¶
Bases:
SolidModel
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = None¶
- __init__(vertices: Sequence[Tuple[float, float, float]] | ndarray, triangle_meshes: Sequence[Sequence[Tuple[int, int, int]] | ndarray], colors: ColorSpecification | None)¶
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Triangle_meshes:
Sequence[Sequence[Tuple[int, int, int]]], sequence of triangle meshes indices making up the shape
- Colors:
Optional[Union[Sequence[Color], Color]], single color for shape, or array with a colour for each mesh or vertex (color_by_mesh selects which of these it is)
- Color_by_mesh:
bool = False, Colour in each mesh with a colour specified by colours
- __module__ = 'sas.qtgui.GL.models'¶
- _abc_impl = <_abc._abc_data object>¶
- render_solid()¶
- class sas.qtgui.GL.models.WireModel(vertices: Sequence[Tuple[float, float, float]] | ndarray, edges: Sequence[Tuple[int, int]] | ndarray, edge_colors: ColorSpecification | None)¶
Bases:
ModelBase
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = None¶
- __init__(vertices: Sequence[Tuple[float, float, float]] | ndarray, edges: Sequence[Tuple[int, int]] | ndarray, edge_colors: ColorSpecification | None)¶
Wireframe Model
- Vertices:
Sequence[Tuple[float, float, float]], vertices of the model
- Edges:
Sequence[Tuple[int, int]], indices of the points making up the edges
- Edge_colors:
Optional[Union[Sequence[Color], Color]], color of the individual edges or a single color for them all
- __module__ = 'sas.qtgui.GL.models'¶
- _abc_impl = <_abc._abc_data object>¶
- render_wireframe()¶
sas.qtgui.GL.renderable module¶
- class sas.qtgui.GL.renderable.Renderable¶
Bases:
ABC
Interface for everything that can be rendered with the OpenGL widget
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __dict__ = mappingproxy({'__module__': 'sas.qtgui.GL.renderable', '__doc__': ' Interface for everything that can be rendered with the OpenGL widget', 'render_wireframe': <function Renderable.render_wireframe>, 'render_solid': <function Renderable.render_solid>, '__dict__': <attribute '__dict__' of 'Renderable' objects>, '__weakref__': <attribute '__weakref__' of 'Renderable' objects>, '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})¶
- __doc__ = ' Interface for everything that can be rendered with the OpenGL widget'¶
- __module__ = 'sas.qtgui.GL.renderable'¶
- __weakref__¶
list of weak references to the object
- _abc_impl = <_abc._abc_data object>¶
- render_solid()¶
- render_wireframe()¶
sas.qtgui.GL.scene module¶
- class sas.qtgui.GL.scene.Scene(parent=None, on_key: ~typing.Callable[[int], None] = <function Scene.<lambda>>)¶
Bases:
QOpenGLWidget
- __annotations__ = {}¶
- __doc__ = None¶
- __init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None ¶
Initialize self. See help(type(self)) for accurate signature.
- __module__ = 'sas.qtgui.GL.scene'¶
- add(item: Renderable)¶
- default_viewport()¶
- initializeGL(self) None ¶
- keyPressEvent(self, event: PySide6.QtGui.QKeyEvent) None ¶
- mouseMoveEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- mousePressEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- mouseReleaseEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- paintGL()¶
Paint the GL viewport
- projection_matrix()¶
- set_model_view()¶
- set_projection()¶
- staticMetaObject = PySide6.QtCore.QMetaObject("Scene" inherits "QOpenGLWidget": )¶
- wheelEvent(self, event: PySide6.QtGui.QWheelEvent) None ¶
- sas.qtgui.GL.scene.main()¶
Show a demo of the opengl.rst window
sas.qtgui.GL.sphere module¶
- class sas.qtgui.GL.sphere.Sphere(n_horizontal: int = 21, n_segments: int = 28, grid_gap: int = 1, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
Bases:
FullModel
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = None¶
- __init__(n_horizontal: int = 21, n_segments: int = 28, grid_gap: int = 1, colors: ColorSpecification | None = None, edge_colors: ColorSpecification | None = None)¶
UV Sphere Primitive
- Parameters:
n_horizontal – Number of horizontal bands
n_segments – Number of segments (angular)
grid_gap – Coarse grain the wireframe by skipping every ‘grid_gap’ coordinates
colors – List of colours for each vertex, or a single color for all
edge_colors – List of colours for each edge, or a single color for all
Note: For aesthetically pleasing results with grid_gap, n_segments should be a multiple of grid_gap, and n_horizontal - 1 should be too.
Default parameters should work with a grid gap of 2 or 4.
- __module__ = 'sas.qtgui.GL.sphere'¶
- _abc_impl = <_abc._abc_data object>¶
- static sphere_edges(n_horizontal, n_segments, grid_gap)¶
Helper function: Edges of the UV sphere primitive
- static sphere_triangles(n_horizontal, n_segments)¶
Helper function: Triangles of the UV sphere primitive
- static sphere_vertices(n_horizontal, n_segments)¶
Helper function: Vertices of the UV sphere primitive
sas.qtgui.GL.surface module¶
- class sas.qtgui.GL.surface.Surface(x_values: ndarray, y_values: ndarray, z_data: ndarray, colormap: str = 'rainbow', c_range: Tuple[float, float] = (0, 1), edge_skip: int = 1)¶
Bases:
FullModel
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __doc__ = None¶
- __init__(x_values: ndarray, y_values: ndarray, z_data: ndarray, colormap: str = 'rainbow', c_range: Tuple[float, float] = (0, 1), edge_skip: int = 1)¶
Surface plot
- Parameters:
x_values – 1D array of x values
y_values – 1D array of y values
z_data – 2D array of z values
colormap – name of a matplotlib colour map
c_range – min and max values for the color map to span
edge_skip – skip every edge_skip index when drawing wireframe
- __module__ = 'sas.qtgui.GL.surface'¶
- _abc_impl = <_abc._abc_data object>¶
- static calculate_edge_indices(nx, ny, gap=1)¶
Helper function to calculate the indices of the edges
- static calculate_triangles(nx, ny)¶
Helper function to calculate the indices of the triangles in the mesh
- property colormap: str¶
Name of the colormap
- set_z_data(z_data)¶
Set the z data on this surface plot
sas.qtgui.GL.transforms module¶
- class sas.qtgui.GL.transforms.MatrixTransform(matrix: ndarray, *children: Renderable)¶
Bases:
SceneGraphNode
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'children': 'List[Renderable]'}¶
- __doc__ = None¶
- __init__(matrix: ndarray, *children: Renderable)¶
Apply a 4x4 transformation matrix to the children of this node
- Parameters:
matrix – a 4x4 transformation matrix
- __module__ = 'sas.qtgui.GL.transforms'¶
- _abc_impl = <_abc._abc_data object>¶
- apply()¶
GL operations needed to apply any transformations associated with this node
- class sas.qtgui.GL.transforms.Rotation(angle, x, y, z, *children: Renderable)¶
Bases:
SceneGraphNode
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'children': 'List[Renderable]'}¶
- __doc__ = None¶
- __init__(angle, x, y, z, *children: Renderable)¶
Rotate the children of this node
- Parameters:
angle – angle of rotation in degrees
axis – axis for rotation
- __module__ = 'sas.qtgui.GL.transforms'¶
- _abc_impl = <_abc._abc_data object>¶
- apply()¶
GL operations needed to apply any transformations associated with this node
- class sas.qtgui.GL.transforms.Scaling(x: float, y: float, z: float, *children: Renderable)¶
Bases:
SceneGraphNode
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'children': 'List[Renderable]'}¶
- __doc__ = None¶
- __init__(x: float, y: float, z: float, *children: Renderable)¶
Scale the children of this node
- Parameters:
x – x scale
y – y scale
z – z scale
- __module__ = 'sas.qtgui.GL.transforms'¶
- _abc_impl = <_abc._abc_data object>¶
- apply()¶
GL operations needed to apply any transformations associated with this node
- class sas.qtgui.GL.transforms.SceneGraphNode(*children: Renderable)¶
Bases:
Renderable
General transform - also doubles as a scene graph node
For the sake of speed, the transformation matrix shape is not checked. It should be a 4x4 transformation matrix
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'children': 'List[Renderable]'}¶
- __doc__ = '\n General transform - also doubles as a scene graph node\n\n For the sake of speed, the transformation matrix shape is not checked.\n It should be a 4x4 transformation matrix\n '¶
- __init__(*children: Renderable)¶
- __module__ = 'sas.qtgui.GL.transforms'¶
- _abc_impl = <_abc._abc_data object>¶
- add_child(child: Renderable)¶
Add a renderable object to this scene graph node
- apply()¶
GL operations needed to apply any transformations associated with this node
- render_solid()¶
- render_wireframe()¶
- class sas.qtgui.GL.transforms.Translation(x: float, y: float, z: float, *children: Renderable)¶
Bases:
SceneGraphNode
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'children': 'List[Renderable]'}¶
- __doc__ = None¶
- __init__(x: float, y: float, z: float, *children: Renderable)¶
Translate the children of this node
- Parameters:
x – x translation
y – y translation
z – z translation
- __module__ = 'sas.qtgui.GL.transforms'¶
- _abc_impl = <_abc._abc_data object>¶
- apply()¶
GL operations needed to apply any transformations associated with this node