Widget Classes
See the Qt Widgets guide for an introduction and usage examples.
Vec2Widget
Bases: QFrame
A widget for displaying and editing a Vec3 object.
Source code in ncca/ngl/widgets/vec2widget.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
__init__(parent=None, name='', value=Vec2(0.0, 0.0))
Initialize the widget.
Args: name: The name of the widget. value: The initial value of the widget. parent: The parent widget.
Source code in ncca/ngl/widgets/vec2widget.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
get_name()
Get the value described below.
Returns: The name of the widget.
Source code in ncca/ngl/widgets/vec2widget.py
96 97 98 99 100 101 102 | |
get_value()
Get the value described below.
Returns: The current value of the widget.
Source code in ncca/ngl/widgets/vec2widget.py
60 61 62 63 64 65 66 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
141 142 143 144 145 146 147 148 | |
set_range(min_val, max_val)
Sets the range for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
104 105 106 107 108 109 110 111 112 | |
set_single_step(step)
Sets the single step for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
132 133 134 135 136 137 138 139 | |
set_value(value)
Sets the value of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
84 85 86 87 88 89 90 91 92 93 94 | |
set_x_range(min_val, max_val)
Sets the range for the x spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
114 115 116 117 118 119 120 121 | |
set_y_range(min_val, max_val)
Sets the range for the y spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec2widget.py
123 124 125 126 127 128 129 130 | |
Vec3Widget
Bases: QFrame
A widget for displaying and editing a Vec3 object.
Source code in ncca/ngl/widgets/vec3widget.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
__init__(parent=None, name='', value=Vec3(0.0, 0.0, 0.0))
Initialize the widget.
Args: name: The name of the widget. value: The initial value of the widget. parent: The parent widget.
Source code in ncca/ngl/widgets/vec3widget.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
get_name()
Get the value described below.
Returns: The name of the widget.
Source code in ncca/ngl/widgets/vec3widget.py
108 109 110 111 112 113 114 | |
get_value()
Get the value described below.
Returns: The current value of the widget.
Source code in ncca/ngl/widgets/vec3widget.py
64 65 66 67 68 69 70 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
162 163 164 165 166 167 168 169 | |
set_range(min_val, max_val)
Sets the range for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
116 117 118 119 120 121 122 123 124 | |
set_single_step(step)
Sets the single step for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
153 154 155 156 157 158 159 160 | |
set_value(value)
Sets the value of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
set_x_range(min_val, max_val)
Sets the range for the x spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
126 127 128 129 130 131 132 133 | |
set_y_range(min_val, max_val)
Sets the range for the y spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
135 136 137 138 139 140 141 142 | |
set_z_range(min_val, max_val)
Sets the range for the z spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec3widget.py
144 145 146 147 148 149 150 151 | |
Vec4Widget
Bases: QFrame
A widget for displaying and editing a Vec4 object.
Source code in ncca/ngl/widgets/vec4widget.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
__init__(parent=None, name='', value=Vec4(0.0, 0.0, 0.0, 1.0))
Initialize the widget.
Args: name: The name of the widget. value: The initial value of the widget. parent: The parent widget.
Source code in ncca/ngl/widgets/vec4widget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
get_name()
Get the value described below.
Returns: The name of the widget.
Source code in ncca/ngl/widgets/vec4widget.py
115 116 117 118 119 120 121 | |
get_value()
Get the value described below.
Returns: The current value of the widget.
Source code in ncca/ngl/widgets/vec4widget.py
66 67 68 69 70 71 72 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
178 179 180 181 182 183 184 185 | |
set_range(min_val, max_val)
Sets the range for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
123 124 125 126 127 128 129 130 131 | |
set_single_step(step)
Sets the single step for all spinboxes.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
169 170 171 172 173 174 175 176 | |
set_value(value)
Sets the value of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
set_w_range(min_val, max_val)
Sets the range for the w spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
160 161 162 163 164 165 166 167 | |
set_x_range(min_val, max_val)
Sets the range for the x spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
133 134 135 136 137 138 139 140 | |
set_y_range(min_val, max_val)
Sets the range for the y spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
142 143 144 145 146 147 148 149 | |
set_z_range(min_val, max_val)
Sets the range for the z spinbox.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/vec4widget.py
151 152 153 154 155 156 157 158 | |
TransformWidget
Bases: QFrame
A widget for displaying and editing a Transform object, with foldable sections.
Source code in ncca/ngl/widgets/transformwidget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
name = Property(str, name, set_name)
class-attribute
instance-attribute
Get the value described below.
Returns: The name of the widget.
__init__(parent=None, name='')
Initialize the widget.
Args: name: The name of the widget. parent: The parent widget.
Source code in ncca/ngl/widgets/transformwidget.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/transformwidget.py
107 108 109 110 111 112 113 114 | |
toggle_collapsed(checked)
Toggles the visibility of the content widget.
Source code in ncca/ngl/widgets/transformwidget.py
76 77 78 79 80 81 82 83 | |
LookAtWidget
Bases: QFrame
A widget for displaying and editing a Transform object, with foldable sections.
Source code in ncca/ngl/widgets/lookatwidget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
__init__(parent=None, name='', eye=Vec3(2, 2, 2), look=Vec3(0, 0, 0))
Initialize the widget.
Args: name: The name of the widget. parent: The parent widget. eye: Initial eye position. look: Initial look-at position.
Source code in ncca/ngl/widgets/lookatwidget.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
get_eye()
Return the eye position.
Source code in ncca/ngl/widgets/lookatwidget.py
99 100 101 | |
get_look()
Return the look-at position.
Source code in ncca/ngl/widgets/lookatwidget.py
103 104 105 | |
get_name()
Return the widget name.
Source code in ncca/ngl/widgets/lookatwidget.py
95 96 97 | |
get_up()
Return the currently selected up vector.
Source code in ncca/ngl/widgets/lookatwidget.py
107 108 109 | |
set_eye(eye)
Set the eye position.
Source code in ncca/ngl/widgets/lookatwidget.py
78 79 80 | |
set_look(look)
Set the look-at position.
Source code in ncca/ngl/widgets/lookatwidget.py
82 83 84 | |
set_name(name)
Set the widget name shown on the toggle button.
Source code in ncca/ngl/widgets/lookatwidget.py
90 91 92 93 | |
set_up(up)
Set the up vector by world_up index.
Source code in ncca/ngl/widgets/lookatwidget.py
86 87 88 | |
toggle_collapsed(checked)
Toggles the visibility of the content widget.
Source code in ncca/ngl/widgets/lookatwidget.py
111 112 113 114 115 116 117 118 | |
view()
Returns the current view matrix.
Source code in ncca/ngl/widgets/lookatwidget.py
130 131 132 | |
PerspectiveWidget
Bases: QFrame
A widget for editing fov/aspect/near/far and viewing the resulting perspective Mat4.
Source code in ncca/ngl/widgets/perspectivewidget.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
__init__(parent=None, name='', fov=45.0, aspect=1.333, near=0.1, far=100.0, show_mode=False)
Initialize the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/perspectivewidget.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
get_aspect()
Return the aspect ratio.
Source code in ncca/ngl/widgets/perspectivewidget.py
188 189 190 | |
get_far()
Return the far clipping plane distance.
Source code in ncca/ngl/widgets/perspectivewidget.py
204 205 206 | |
get_fov()
Return the field of view in degrees.
Source code in ncca/ngl/widgets/perspectivewidget.py
180 181 182 | |
get_mode()
Return the current clip-space convention.
Source code in ncca/ngl/widgets/perspectivewidget.py
212 213 214 | |
get_name()
Return the widget name shown on the toggle button.
Source code in ncca/ngl/widgets/perspectivewidget.py
231 232 233 | |
get_near()
Return the near clipping plane distance.
Source code in ncca/ngl/widgets/perspectivewidget.py
196 197 198 | |
matrix()
Return the current perspective matrix.
| Returns: |
|
|---|
Source code in ncca/ngl/widgets/perspectivewidget.py
159 160 161 162 163 164 165 | |
set_aspect(aspect)
Set the aspect ratio.
Source code in ncca/ngl/widgets/perspectivewidget.py
192 193 194 | |
set_far(far)
Set the far clipping plane distance.
Source code in ncca/ngl/widgets/perspectivewidget.py
208 209 210 | |
set_fov(fov)
Set the field of view in degrees.
Source code in ncca/ngl/widgets/perspectivewidget.py
184 185 186 | |
set_mode(mode)
Set the clip-space convention.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/perspectivewidget.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
set_name(name)
Set the widget name shown on the toggle button.
Source code in ncca/ngl/widgets/perspectivewidget.py
235 236 237 238 | |
set_near(near)
Set the near clipping plane distance.
Source code in ncca/ngl/widgets/perspectivewidget.py
200 201 202 | |
toggle_collapsed(checked)
Toggle the visibility of the content widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/perspectivewidget.py
167 168 169 170 171 172 173 174 175 176 177 178 | |
RGBColourWidget
Bases: QFrame
A widget for displaying and editing a Vec3 object.
Source code in ncca/ngl/widgets/rgbcolourwidget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
name = Property(str, name, set_name)
class-attribute
instance-attribute
Get the value described below.
Returns: The name of the widget.
__init__(parent=None, name='', r=1.0, g=1.0, b=1.0)
Initialize the widget.
Args: name: The name of the widget. r: The initial red component of the colour. g: The initial green component of the colour. b: The initial blue component of the colour. parent: The parent widget.
Source code in ncca/ngl/widgets/rgbcolourwidget.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
colour()
Get the value described below.
Returns: The current value of the widget.
Source code in ncca/ngl/widgets/rgbcolourwidget.py
82 83 84 85 86 87 88 | |
set_colour(value)
Sets the value of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/rgbcolourwidget.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/rgbcolourwidget.py
149 150 151 152 153 154 155 156 | |
RGBAColourWidget
Bases: QFrame
A widget for displaying and editing a Vec4 object.
Source code in ncca/ngl/widgets/rgbacolourwidget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
name = Property(str, name, set_name)
class-attribute
instance-attribute
Get the value described below.
Returns: The name of the widget.
__init__(parent=None, name='', r=1.0, g=1.0, b=1.0, a=1.0)
Initialize the widget.
Args: name: The name of the widget. r: The initial red component of the colour. g: The initial green component of the colour. b: The initial blue component of the colour. a: The initial alpha component of the colour. parent: The parent widget.
Source code in ncca/ngl/widgets/rgbacolourwidget.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
colour()
Get the value described below.
Returns: The current value of the widget.
Source code in ncca/ngl/widgets/rgbacolourwidget.py
86 87 88 89 90 91 92 | |
set_colour(value)
Sets the value of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/rgbacolourwidget.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
set_name(name)
Sets the name of the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/rgbacolourwidget.py
171 172 173 174 175 176 177 178 | |
Mat2Widget
Bases: _MatGridWidget
A widget for displaying and editing a Mat2 object as an editable grid.
Source code in ncca/ngl/widgets/mat2widget.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
__init__(parent=None, name='', read_only=False)
Initialize the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/mat2widget.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Mat3Widget
Bases: _MatGridWidget
A widget for displaying and editing a Mat3 object as an editable grid.
Source code in ncca/ngl/widgets/mat3widget.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
__init__(parent=None, name='', read_only=False)
Initialize the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/mat3widget.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
Mat4Widget
Bases: _MatGridWidget
A widget for displaying and editing a Mat4 object as an editable grid.
Source code in ncca/ngl/widgets/mat4widget.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
__init__(parent=None, name='', read_only=False)
Initialize the widget.
| Parameters: |
|
|---|
Source code in ncca/ngl/widgets/mat4widget.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |