docs/html/classglWidget.html
| | Jetson Inference
DNN Vision Library |
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
glWidget Class Reference Utilities Library (jetson-utils) » OpenGL
OpenGL graphics widget for rendering moveable/resizable shapes. More...
#include <glWidget.h>
|
| | struct | eventHandler | | |
|
|
| enum | Shape { Rect, Line, Ellipse } |
| | Shape enum. More...
|
| |
| typedef bool(* | glWidgetEventHandler) (glWidget *widget, uint16_t event, int a, int b, void *user) |
| | Event message handler callback for recieving UI messages from widgets. More...
|
| |
|
|
| | glWidget (Shape shape=Rect) |
| | Constructor. More...
|
| |
| | glWidget (float x, float y, float width, float height, Shape shape=Rect) |
| | Constructor. More...
|
| |
| virtual | ~glWidget () |
| | Destructor. More...
|
| |
| bool | Contains (float x, float y) const |
| | Test if the point is inside the widget. More...
|
| |
| void | Move (float x, float y) |
| | Move the widget's position by the specified offset. More...
|
| |
| float | X () const |
| | Get the widget's X coordinate. More...
|
| |
| float | Y () const |
| | Get the widget's Y coordinate. More...
|
| |
| void | SetX (float x) |
| | Set the widget's X coordinate. More...
|
| |
| void | SetY (float y) |
| | Set the widget's Y coordinate. More...
|
| |
| float | Width () const |
| | Get the widget's width. More...
|
| |
| float | Height () const |
| | Get the widget's height. More...
|
| |
| void | SetWidth (float width) |
| | Set the widget's width. More...
|
| |
| void | SetHeight (float height) |
| | Set the widget's height. More...
|
| |
| void | GetPosition (float *x, float *y) const |
| | Get position of widget in global window coordinates. More...
|
| |
| void | SetPosition (float x, float y) |
| | Set position of widget in global window coordinates. More...
|
| |
| void | GetCoords (float *x1, float *y1, float *x2, float *y2) const |
| | Get the bounding coordinates of the widget. More...
|
| |
| void | SetCoords (float x1, float y1, float x2, float y2) |
| | Set the bounding coordinates of the widget. More...
|
| |
| void | GetSize (float *width, float *height) const |
| | Get the widget's size. More...
|
| |
| void | SetSize (float width, float height) |
| | Set the widget's size. More...
|
| |
| Shape | GetShape () const |
| | Get the shape. More...
|
| |
| void | SetShape (Shape shape) |
| | Set the shape. More...
|
| |
| void | SetFillAlpha (float a) |
| | Set fill alpha. More...
|
| |
| void | SetLineAlpha (float a) |
| | Set outline alpha. More...
|
| |
| void | SetLineWidth (float width) |
| | Set outline width. More...
|
| |
| void | SetFillColor (float r, float g, float b, float a=1.0f) |
| | Set fill color. More...
|
| |
| void | SetLineColor (float r, float g, float b, float a=1.0f) |
| | Set outline color. More...
|
| |
| void | SetSelectedFillColor (float r, float g, float b, float a=1.0f) |
| | Set selected fill color. More...
|
| |
| void | SetSelectedLineColor (float r, float g, float b, float a=1.0f) |
| | Set selected outline color. More...
|
| |
| bool | IsMoveable () const |
| | Is the widget moveable/draggable by the user? More...
|
| |
| void | SetMoveable (bool moveable) |
| | Toggle if the user can move/drag the widget. More...
|
| |
| bool | IsResizeable () const |
| | Is the widget resizeable by the user? More...
|
| |
| void | SetResizeable (bool resizeable) |
| | Toggle if the user can resize the widget. More...
|
| |
| bool | IsSelected () const |
| | Is the widget selected? More...
|
| |
| void | SetSelected (bool selected) |
| | Select/de-select the widget. More...
|
| |
| bool | IsVisible () const |
| | Is the widget visible. More...
|
| |
| void | SetVisible (bool visible) |
| | Show/hide the widget. More...
|
| |
| void * | GetUserData () const |
| | Retrieve user data. More...
|
| |
| void | SetUserData (void *user) |
| | Set user-defined data. More...
|
| |
| glDisplay * | GetDisplay () const |
| | Get the root window of the widget. More...
|
| |
| int | GetIndex () const |
| | Get the index of the widget in the window (or -1 if none) More...
|
| |
| void | Render () |
| | Render (automatically called by parent) More...
|
| |
| void | GlobalToLocal (float x, float y, float *x_out, float *y_out) const |
| | Convert from global window coordinates to local widget offset. More...
|
| |
| void | LocalToGlobal (float x, float y, float *x_out, float *y_out) const |
| | Convert from local widget offset to global window coordinates. More...
|
| |
| void | AddEventHandler (glWidgetEventHandler callback, void *user=NULL) |
| | Register an event message handler the widget will send events to. More...
|
| |
| void | RemoveEventHandler (glWidgetEventHandler callback, void *user=NULL) |
| | Remove an event message handler from being called by the widget. More...
|
| |
| bool | OnEvent (uint16_t event, int a, int b, void *user) |
| |
|
|
| enum | DragState {
DragNone, DragMove, DragResizeN, DragResizeNW,
DragResizeNE, DragResizeS, DragResizeSW, DragResizeSE,
DragResizeW, DragResizeE
} |
| |
|
| | void | initDefaults () | | | | void | setCursor (DragState cursor) | | | | void | setDisplay (glDisplay *display) | | | | void | dispatchEvent (uint16_t msg, int a, int b) | | | | DragState | coordToBorder (float x, float y, float max_distance=10.0f) | | |
|
| | float | mX | | | | float | mY | | | | float | mWidth | | | | float | mHeight | | | | float | mSelectedFillColor [4] | | | | float | mSelectedLineColor [4] | | | | float | mFillColor [4] | | | | float | mLineColor [4] | | | | float | mLineWidth | | | | bool | mMoveable | | | | bool | mResizeable | | | | bool | mSelected | | | | bool | mVisible | | | | Shape | mShape | | | | void * | mUserData | | | | glDisplay * | mDisplay | | | | DragState | mDragState | | | | std::vector< eventHandler > | mEventHandlers | | |
|
| | class | glDisplay | | |
OpenGL graphics widget for rendering moveable/resizable shapes.
| typedef bool(* glWidget::glWidgetEventHandler) (glWidget *widget, uint16_t event, int a, int b, void *user) |
Event message handler callback for recieving UI messages from widgets.
Recieves 4 parameters - the widget that sent the event, the event type, a & b message values (
See alsoglEventType from glEvents.h), and a user-specified pointer from registration.
Event message handlers should return true if the message was handled, or false if the message was skipped or not handled.
See alsoAddEventHandler RemoveEventHandler
|
| enum glWidget::DragState |
| protected |
| Enumerator |
|---|
| DragNone |
| DragMove |
| DragResizeN |
| DragResizeNW |
| DragResizeNE |
| DragResizeS |
| DragResizeSW |
| DragResizeSE |
| DragResizeW |
| DragResizeE |
| enum glWidget::Shape |
Shape enum.
| Enumerator |
|---|
| Rect |
| Line |
| Ellipse |
| glWidget::glWidget | ( | Shape | shape = Rect | ) | |
Constructor.
| glWidget::glWidget | ( | float | x, |
| | | float | y, |
| | | float | width, |
| | | float | height, |
| | | Shape | shape = Rect |
| | ) | | |
Constructor.
|
| virtual glWidget::~glWidget | ( | | ) | |
| virtual |
Destructor.
| void glWidget::AddEventHandler | ( | glWidgetEventHandler | callback, |
| | | void * | user = NULL |
| | ) | | |
Register an event message handler the widget will send events to.
Parameters
| callback | function pointer to the event message handler callback | | user | optional user-specified pointer that will be passed to all invocations of this event handler (typically an object) |
| bool glWidget::Contains | ( | float | x, | | | | float | y | | | ) | | const |
Test if the point is inside the widget.
|
| DragState glWidget::coordToBorder | ( | float | x, |
| | | float | y, |
| | | float | max_distance = 10.0f |
| | ) | | |
| protected |
|
| void glWidget::dispatchEvent | ( | uint16_t | msg, | | | | int | a, | | | | int | b | | | ) | | |
| protected |
|
| void glWidget::GetCoords | ( | float * | x1, | | | | float * | y1, | | | | float * | x2, | | | | float * | y2 | | | ) | | const |
| inline |
Get the bounding coordinates of the widget.
|
| glDisplay* glWidget::GetDisplay | ( | | ) | const |
| inline |
Get the root window of the widget.
| int glWidget::GetIndex | ( | | ) | const |
Get the index of the widget in the window (or -1 if none)
|
| void glWidget::GetPosition | ( | float * | x, | | | | float * | y | | | ) | | const |
| inline |
Get position of widget in global window coordinates.
|
| Shape glWidget::GetShape | ( | | ) | const |
| inline |
Get the shape.
|
| void glWidget::GetSize | ( | float * | width, | | | | float * | height | | | ) | | const |
| inline |
Get the widget's size.
|
| void* glWidget::GetUserData | ( | | ) | const |
| inline |
Retrieve user data.
| void glWidget::GlobalToLocal | ( | float | x, | | | | float | y, | | | | float * | x_out, | | | | float * | y_out | | | ) | | const |
Convert from global window coordinates to local widget offset.
|
| float glWidget::Height | ( | | ) | const |
| inline |
Get the widget's height.
|
| void glWidget::initDefaults | ( | | ) | |
| protected |
|
| bool glWidget::IsMoveable | ( | | ) | const |
| inline |
Is the widget moveable/draggable by the user?
|
| bool glWidget::IsResizeable | ( | | ) | const |
| inline |
Is the widget resizeable by the user?
|
| bool glWidget::IsSelected | ( | | ) | const |
| inline |
Is the widget selected?
|
| bool glWidget::IsVisible | ( | | ) | const |
| inline |
Is the widget visible.
| void glWidget::LocalToGlobal | ( | float | x, | | | | float | y, | | | | float * | x_out, | | | | float * | y_out | | | ) | | const |
Convert from local widget offset to global window coordinates.
|
| void glWidget::Move | ( | float | x, | | | | float | y | | | ) | | |
| inline |
Move the widget's position by the specified offset.
| bool glWidget::OnEvent | ( | uint16_t | event, | | | | int | a, | | | | int | b, | | | | void * | user | | | ) | | |
| void glWidget::RemoveEventHandler | ( | glWidgetEventHandler | callback, |
| | | void * | user = NULL |
| | ) | | |
Remove an event message handler from being called by the widget.
RemoveEventHandler() will search for previously registered event handlers that have the same function pointer and/or user pointer, and remove them for being called again in the future.
| void glWidget::Render | ( | | ) | |
Render (automatically called by parent)
|
| void glWidget::SetCoords | ( | float | x1, | | | | float | y1, | | | | float | x2, | | | | float | y2 | | | ) | | |
| inline |
Set the bounding coordinates of the widget.
|
| void glWidget::setCursor | ( | DragState | cursor | ) | |
| protected |
|
| void glWidget::setDisplay | ( | glDisplay * | display | ) | |
| protected |
|
| void glWidget::SetFillAlpha | ( | float | a | ) | |
| inline |
Set fill alpha.
|
| void glWidget::SetFillColor | ( | float | r, |
| | | float | g, |
| | | float | b, |
| | | float | a = 1.0f |
| | ) | | |
| inline |
Set fill color.
|
| void glWidget::SetHeight | ( | float | height | ) | |
| inline |
Set the widget's height.
|
| void glWidget::SetLineAlpha | ( | float | a | ) | |
| inline |
Set outline alpha.
|
| void glWidget::SetLineColor | ( | float | r, |
| | | float | g, |
| | | float | b, |
| | | float | a = 1.0f |
| | ) | | |
| inline |
Set outline color.
|
| void glWidget::SetLineWidth | ( | float | width | ) | |
| inline |
Set outline width.
|
| void glWidget::SetMoveable | ( | bool | moveable | ) | |
| inline |
Toggle if the user can move/drag the widget.
|
| void glWidget::SetPosition | ( | float | x, | | | | float | y | | | ) | | |
| inline |
Set position of widget in global window coordinates.
|
| void glWidget::SetResizeable | ( | bool | resizeable | ) | |
| inline |
Toggle if the user can resize the widget.
|
| void glWidget::SetSelected | ( | bool | selected | ) | |
| inline |
Select/de-select the widget.
|
| void glWidget::SetSelectedFillColor | ( | float | r, |
| | | float | g, |
| | | float | b, |
| | | float | a = 1.0f |
| | ) | | |
| inline |
Set selected fill color.
|
| void glWidget::SetSelectedLineColor | ( | float | r, |
| | | float | g, |
| | | float | b, |
| | | float | a = 1.0f |
| | ) | | |
| inline |
Set selected outline color.
|
| void glWidget::SetShape | ( | Shape | shape | ) | |
| inline |
Set the shape.
|
| void glWidget::SetSize | ( | float | width, | | | | float | height | | | ) | | |
| inline |
Set the widget's size.
|
| void glWidget::SetUserData | ( | void * | user | ) | |
| inline |
Set user-defined data.
|
| void glWidget::SetVisible | ( | bool | visible | ) | |
| inline |
Show/hide the widget.
|
| void glWidget::SetWidth | ( | float | width | ) | |
| inline |
Set the widget's width.
|
| void glWidget::SetX | ( | float | x | ) | |
| inline |
Set the widget's X coordinate.
|
| void glWidget::SetY | ( | float | y | ) | |
| inline |
Set the widget's Y coordinate.
|
| float glWidget::Width | ( | | ) | const |
| inline |
Get the widget's width.
|
| float glWidget::X | ( | | ) | const |
| inline |
Get the widget's X coordinate.
|
| float glWidget::Y | ( | | ) | const |
| inline |
Get the widget's Y coordinate.
|
| friend class glDisplay |
| friend |
|
| glDisplay* glWidget::mDisplay |
| protected |
|
| DragState glWidget::mDragState |
| protected |
|
| std::vector<eventHandler> glWidget::mEventHandlers |
| protected |
|
| float glWidget::mFillColor[4] |
| protected |
|
| float glWidget::mHeight |
| protected |
|
| float glWidget::mLineColor[4] |
| protected |
|
| float glWidget::mLineWidth |
| protected |
|
| bool glWidget::mMoveable |
| protected |
|
| bool glWidget::mResizeable |
| protected |
|
| bool glWidget::mSelected |
| protected |
|
| float glWidget::mSelectedFillColor[4] |
| protected |
|
| float glWidget::mSelectedLineColor[4] |
| protected |
|
| Shape glWidget::mShape |
| protected |
|
| void* glWidget::mUserData |
| protected |
|
| bool glWidget::mVisible |
| protected |
|
| float glWidget::mWidth |
| protected |
|
| float glWidget::mX |
| protected |
|
| float glWidget::mY |
| protected |
The documentation for this class was generated from the following file:
jetson-utils/glWidget.h
Generated on Fri Mar 17 2023 14:29:30 for Jetson Inference by 1.8.17