Image Component Library (ICL)
|
Extended ICLDrawWidget, able to draw 2D and 3D primitives using OpenGL. More...
#include <DrawWidget3D.h>
Classes | |
class | GLCallback |
internally used callback class type More... | |
Public Member Functions | |
ICLDrawWidget3D (QWidget *parent) | |
creates a new ICLDrawWidget embedded into the parent component More... | |
virtual void | customPaintEvent (PaintEngine *e) |
overwrites the parent's method More... | |
void | link (GLCallback *cb) |
add a single 3D callback, that is rendered (here, no queue swapping is neccessary) More... | |
Public Member Functions inherited from icl::qt::ICLDrawWidget | |
ICLDrawWidget (QWidget *parent=0) | |
creates a new ICLDrawWidget embedded into the parent component More... | |
~ICLDrawWidget () | |
destructor2 More... | |
void | setAutoResetQueue (bool on) |
sets whether the draw commands are accumulative (default is on=true) More... | |
void | resetQueue () |
clears the current draw queue More... | |
void | abs () |
sets up the state machine to treat coordinates in the image pixel coordinate system More... | |
void | rel () |
sets up the state machine to receive relative coordinates in range [0,1] More... | |
void | image (core::ImgBase *image, float x, float y, float w, float h) |
draws an image into the given rectangle More... | |
void | image (core::ImgBase *image, const utils::Rect &r) |
convenience function for image using an image rect More... | |
void | image (const core::ImgBase *image, const float a[2], const float b[2], const float c[2], const float d[2]) |
draws an image into given quadrangle More... | |
void | text (std::string text, float x, float y, float w, float h, float fontsize=10) |
draws a string into the given rect More... | |
void | text (const std::string &text, float x, float y, float fontsize=10) |
draws text at given x, y location with given fontsize More... | |
void | text (const std::string &text, const utils::Point32f &p, float fontsize=10) |
draws the text at given position p More... | |
void | point (float x, float y) |
draws a point at the given location More... | |
void | point (const utils::Point &p) |
convenience wrapper for utils::Point types More... | |
void | point (const utils::Point32f &p) |
convenience wrapper for utils::Point32f types More... | |
template<class VectorType > | |
void | point (const VectorType &p) |
convenience wrapper for arbitrary types, that provide an index operator [int] More... | |
void | points (const std::vector< utils::Point > &pts, int xfac=1, int yfac=1) |
draws a set of points More... | |
void | points (const std::vector< utils::Point32f > &pts) |
draws a set of points More... | |
template<class VectorType > | |
void | point (const std::vector< VectorType > &points) |
convenience wrapper for arbitrary types, that provide an index operator [int] More... | |
void | linestrip (const std::vector< utils::Point > &pts, bool closeLoop=true, int xfac=1, int yfac=1) |
draws a set of connected points More... | |
void | linestrip (const std::vector< utils::Point32f > &pts, bool closeLoop=true) |
draws a set of connected points More... | |
void | line (float x1, float y1, float x2, float y2) |
draws a line from point (x1,y1) to point (x2,y2) More... | |
void | line (const utils::Point32f &a, const utils::Point32f &b) |
convenience function for drawing lines between two points More... | |
template<class VectorTypeA , class VectorTypeB > | |
void | line (const VectorTypeA &a, const VectorTypeB &b) |
convenience wrapper for arbitrary types, that provide an index operator [int] More... | |
void | arrow (float ax, float ay, float bx, float by, float capsize=10) |
draws an arrow from a to b (arrow cap is at b) More... | |
void | arrow (const utils::Point32f &a, const utils::Point32f &b, float capsize=10) |
draws an arrow from a to b (arrow cap is at b) More... | |
void | rect (float x, float y, float w, float h) |
draws a rect with given parameters More... | |
void | rect (const utils::Rect32f &r) |
convenience function for drawing float rects More... | |
void | rect (const utils::Rect &r) |
draws a rect from a icl utils::Rect structure More... | |
void | triangle (float x1, float y1, float x2, float y2, float x3, float y3) |
draws a triangle defined by 3 points More... | |
void | triangle (const utils::Point32f &a, const utils::Point32f &b, const utils::Point32f &c) |
draws a triangle defined by 3 points More... | |
void | quad (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) |
draws a quad with given 4 points More... | |
void | quad (const utils::Point32f &a, const utils::Point32f &b, const utils::Point32f &c, const utils::Point32f &d) |
draws a quad with given 4 points More... | |
void | ellipse (float x, float y, float w, float h) |
draws an ellipse with given parameters (w==H --> circle) More... | |
void | ellipse (const utils::Rect &r) |
draws an ellipse into given rectangle More... | |
void | ellipse (const utils::Rect32f &r) |
draws an ellipse into given rectangle More... | |
void | circle (float cx, float cy, float r) |
draws a circle with given center and radius More... | |
void | circle (const utils::Point32f ¢er, float radius) |
draws a circle with given center and radius More... | |
void | polygon (const std::vector< utils::Point32f > &ps) |
draws a convex polygon More... | |
void | polygon (const std::vector< utils::Point > &ps) |
draws a convex polygon (int-points) More... | |
void | grid (const utils::Point32f *points, int nx, int ny, bool rowMajor=true) |
draws a regular grid between given points More... | |
void | sym (float x, float y, Sym s) |
draws a predefined symbol at the given location More... | |
void | sym (const utils::Point32f &p, Sym s) |
convenience wrapper for sym(float,float,Sym) More... | |
void | sym (float x, float y, char sym) |
this is a convenience function for sym(float,float,Sym) More... | |
void | sym (const utils::Point32f &p, char sym) |
convenicence wrapper for sym(float,flota,char) More... | |
void | symsize (float w, float h=-1) |
sets the size for following "sym" draw commands More... | |
void | linewidth (float w) |
sets current linewidth (default is 1); More... | |
void | pointsize (float s) |
sets current pointsize (default is 1) More... | |
void | textangle (float angleDeg) |
sets an angle for text that is rendered More... | |
void | fontsize (float size) |
sets the internal default font size More... | |
void | color (float r, float g, float b, float alpha=255) |
sets the draw state machines "edge"-color buffer to a given value More... | |
void | fill (float r, float g, float b, float alpha=255) |
set the draw state machines "fill"-color buffer to a given value More... | |
template<class T , unsigned int COLS> | |
void | color (const math::FixedMatrix< T, COLS, 3/COLS > &v) |
utility template method that allows to pass 3D vectors as colors More... | |
template<class T , unsigned int COLS> | |
void | color (const math::FixedMatrix< T, COLS, 4/COLS > &v) |
utility template method that allows to pass 4D vectors as colors More... | |
template<class T , unsigned int COLS> | |
void | fill (const math::FixedMatrix< T, COLS, 3/COLS > &v) |
utility template method that allows to pass 3D vectors as fill color More... | |
template<class T , unsigned int COLS> | |
void | fill (const math::FixedMatrix< T, COLS, 4/COLS > &v) |
utility template method that allows to pass 4D vectors as fill color More... | |
void | nocolor () |
disables drawing edges More... | |
void | nofill () |
disables filling primitives More... | |
void | draw (const utils::VisualizationDescription &d) |
draws a VisualizationDescription instance More... | |
virtual void | initializeCustomPaintEvent (PaintEngine *e) |
this function can be reimplemented perform some custom initialization before the actual draw call More... | |
virtual void | finishCustomPaintEvent (PaintEngine *e) |
this function can be reimplemented perform some custom initialization after the actual draw call More... | |
Public Member Functions inherited from icl::qt::ICLWidget | |
ICLWidget (QWidget *parent=0) | |
creates a new ICLWidget within the parent widget More... | |
virtual | ~ICLWidget () |
destructor More... | |
virtual void | initializeGL () |
GLContext initialization. More... | |
virtual void | resizeGL (int w, int h) |
called by resizeEvent to adapt the current GL-Viewport More... | |
virtual void | paintGL () |
draw function More... | |
virtual void | paintEvent (QPaintEvent *e) |
drawing function for NO-GL fallback More... | |
virtual void | setVisible (bool visible) |
void | setFitMode (fitmode fm) |
sets the current fitmode More... | |
void | setRangeMode (rangemode rm) |
sets the current rangemode More... | |
void | setBCI (int brightness, int contrast, int intensity) |
set up current brightness, contrast and intensity adaption values More... | |
utils::Size | getSize () |
returns the widgets size as icl::Size More... | |
utils::Size | getImageSize (bool fromGUIThread=false) |
returns the current images size More... | |
utils::Rect | getImageRect (bool fromGUIThread=false) |
returns the rect, that is currently used to draw the image into More... | |
fitmode | getFitMode () |
returns current fit-mode More... | |
rangemode | getRangeMode () |
returns current range mode More... | |
std::vector< std::string > | getImageInfo () |
returns a list of image specification string (used by the OSD) More... | |
void | install (MouseHandler *h) |
adds a new mouse handler via signal-slot connection More... | |
void | uninstall (MouseHandler *h) |
deletes mouse handler connection More... | |
void | registerCallback (const GUI::Callback &cb, const std::string &eventList="drag,press") |
registers a simple callback More... | |
void | removeCallbacks () |
removes all callbacks registered using registerCallback More... | |
void | render () |
re-renders the widget (thread-safe) More... | |
virtual bool | event (QEvent *event) |
overloaded event function processing special thread save update events More... | |
const ImageStatistics & | getImageStatistics () |
returns current ImageStatistics struct (used by OSD) More... | |
void | setMenuEnabled (bool enabled) |
if the menu is disabled, there will be no menu button at the top left of the widget More... | |
void | setImageInfoIndicatorEnabled (bool enabled) |
This can be used in order to hide to label at the lower right image rect. More... | |
void | setShowNoImageWarnings (bool showWarnings) |
sets wheather to notify, that no image was set More... | |
void | setViewPort (const utils::Size &size) |
Sets a viewport size that is used if no image was set. More... | |
void | setFullScreenMode (bool on, int screen=-1) |
show the widget on fullscreen on the (or returns to the original embedded state) More... | |
void | addSpecialToggleButton (const std::string &id, const core::ImgBase *untoggledIcon=0, const core::ImgBase *toggledIcon=0, bool initiallyToggled=0, const utils::Function< void, bool > &cb=(utils::FunctionImpl< void, bool > *) 0, const std::string &toolTipText="") |
Adds a new toggle-button to the OSD-button bar on the upper widget edge. More... | |
void | addSpecialButton (const std::string &id, const core::ImgBase *icon=0, const utils::Function< void > &cb=(utils::FunctionImpl< void > *) 0, const std::string &toolTipText="") |
Adds a new toggle-button to the OSD-button bar on the upper widget edge. More... | |
void | setInfoText (const std::string &text) |
sets an info text, is shown as a dialog when pressing an extra info button More... | |
void | removeSpecialButton (const std::string &id) |
removes special button with given ID More... | |
void | setAutoRenderOnSetImage (bool on) |
sets whether the widget will automatically call render when setImage is called More... | |
void | setBackgroundColorSource (BGColorSource src) |
can be used to replace the default OSD-GUI based background color source More... | |
void | startRecording (const std::string &outputDevice, const std::string &outputInfo, bool framebuffer=true, int frameskip=0, bool setParamsOnlyButDoNotStartRecording=false) |
sets up the capturing GUI and immediately initialized the internal capturer More... | |
void | registerRecordingCallback (utils::Function< void, const core::ImgBase * > cb, const std::string &handle="default") |
adds a callback function that is executed each time an image is recorded! More... | |
void | unregisterRecordingCallback (const std::string &handle="default") |
removes a recording callback function More... | |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | enterEvent (QEvent *e) |
virtual void | leaveEvent (QEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | hideEvent (QHideEvent *e) |
virtual void | keyPressEvent (QKeyEvent *event) |
listens for F11 which enables the fullscreen mode More... | |
Protected Attributes | |
GLCallback * | m_linkedCallback |
special single callback linked to the 3D visualisation More... | |
utils::Mutex | m_linkMutex |
internal mutex More... | |
Protected Attributes inherited from icl::qt::ICLDrawWidget | |
std::vector< DrawCommand * > * | m_queues [2] |
two lists of draw commands More... | |
State * | m_poState |
Data of the "State Machine". More... | |
QMutex | m_oCommandMutex |
utils::Mutex for a thread save event queue More... | |
bool | m_autoResetQueue |
internal flag More... | |
Additional Inherited Members | |
Public Types inherited from icl::qt::ICLDrawWidget | |
enum | Sym { symRect, symCross, symPlus, symTriangle, symCircle } |
enum used for specification of predefined symbols More... | |
Public Types inherited from icl::qt::ICLWidget | |
enum | fitmode { fmNoScale =0, fmHoldAR =1, fmFit =2, fmZoom =3 } |
determines how the image is fit into the widget geometry More... | |
enum | rangemode { rmOn = 1, rmOff = 2, rmAuto } |
determines intensity adaption mode More... | |
typedef utils::Function< core::Color > | BGColorSource |
generic background color creator plugin More... | |
Public Slots inherited from icl::qt::ICLWidget | |
void | setImage (const core::ImgBase *image) |
sets up the current image More... | |
void | showHideMenu () |
void | setMenuEmbedded (bool embedded) |
void | bciModeChanged (int modeIdx) |
void | brightnessChanged (int val) |
void | contrastChanged (int val) |
void | intensityChanged (int val) |
void | scaleModeChanged (int modeIdx) |
void | currentChannelChanged (int modeIdx) |
void | captureCurrentImage () |
void | captureCurrentFrameBuffer () |
void | recordButtonToggled (bool checked) |
void | pauseButtonToggled (bool checked) |
void | stopButtonClicked () |
void | skipFramesChanged (int frameSkip) |
void | menuTabChanged (int index) |
void | histoPanelParamChanged () |
void | setEmbeddedZoomModeEnabled (bool enabled) |
void | setLinInterpolationEnabled (bool enabled) |
void | setShowPixelGridEnabled (bool enabled) |
void | setRangeModeNormalOrScaled (bool enabled) |
void | showBackgroundColorDialog () |
void | showGridColorDialog () |
void | setGridAlpha (int alpha) |
void | setBackgroundBlack () |
void | setBackgroundWhite () |
void | setBackgroundGray () |
void | setGridBlack () |
void | setGridWhite () |
void | setGridGray () |
Signals inherited from icl::qt::ICLWidget | |
void | mouseEvent (const MouseEvent &event) |
invoked when any mouse interaction was performed More... | |
void | specialButtonClicked (const std::string &id) |
synchronizes special button clicks with GUI thread More... | |
void | specialButtonToggled (const std::string &id, bool down) |
synchronizes special toggle button clicks with GUI thread More... | |
Protected Member Functions inherited from icl::qt::ICLDrawWidget | |
virtual void | swapQueues () |
swaps the draw queues More... | |
Protected Member Functions inherited from icl::qt::ICLWidget | |
void | showInfoDialog () |
shows a help dialog More... | |
Extended ICLDrawWidget, able to draw 2D and 3D primitives using OpenGL.
Even though, it is possible to use the ICLDrawWidget3D for rendering 3D stuff on top of an image directly, it is strongly recommended to use an instance of ICLGeom::Scene to manage camera, scene objects and lights. A scene instance provides a single ICLDrawWidget3D::GLCallback* that can easily be linked to the DrawWidget3D by using the ICLDrawWidget3D::link method.
Most older methods got the deprecated status. They will be removed soon, since it turned out, that using ICLGeom's Scene class is much easier and less error-prone.
icl::qt::ICLDrawWidget3D::ICLDrawWidget3D | ( | QWidget * | parent | ) |
creates a new ICLDrawWidget embedded into the parent component
|
virtual |
overwrites the parent's method
Reimplemented from icl::qt::ICLDrawWidget.
void icl::qt::ICLDrawWidget3D::link | ( | GLCallback * | cb | ) |
add a single 3D callback, that is rendered (here, no queue swapping is neccessary)
the linked callback can be removed by calling link(0). The ownership of the linked callback is never passed.
|
protected |
special single callback linked to the 3D visualisation
|
protected |
internal mutex