gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
gaze::gui::Visualizeable< widget_type > Class Template Reference

Implements VisualizeableBase for several widget types. More...

#include "gaze/gui/visualizeable.h"

Inheritance diagram for gaze::gui::Visualizeable< widget_type >:
gaze::gui::VisualizeableBase gaze::pipeline::EyeLike gaze::pipeline::FaceLandmarks gaze::pipeline::FallbackStep gaze::pipeline::GazeCapture gaze::pipeline::GazePointCalculation gaze::pipeline::HeadPoseEstimation gaze::pipeline::PupilLocalization gaze::pipeline::SourceCapture

Public Member Functions

std::shared_ptr< dlib::drawable > init (dlib::drawable_window &parent, int width, int height, std::string text="No visualization.") final
 
void remove_widget () override
 
- Public Member Functions inherited from gaze::gui::VisualizeableBase
virtual ~VisualizeableBase ()=default
 
virtual void visualize (util::Data &data)=0
 

Protected Attributes

std::shared_ptr< widget_type > widget
 

Detailed Description

template<typename widget_type = dlib::label>
class gaze::gui::Visualizeable< widget_type >

Implements VisualizeableBase for several widget types.

This is a generic implementation for visualizeables using different widget types.

Template Parameters
widget_typea dlib widget type.

Definition at line 223 of file visualizeable.h.

Member Function Documentation

template<typename widget_type = dlib::label>
std::shared_ptr<dlib::drawable> gaze::gui::Visualizeable< widget_type >::init ( dlib::drawable_window &  parent,
int  width,
int  height,
std::string  text = "No visualization." 
)
inlinefinalvirtual

Initializes the widget by creating a widget and adjusting it.

Note
Some widgets do not support all adjustments (width/height/text). Please refer to the widget documentations for details.
Parameters
parentThe parent window.
widthThe widget width
heightThe widget height
textThe widget text
Returns
A pointer to the newly initialized widget.

Implements gaze::gui::VisualizeableBase.

Definition at line 233 of file visualizeable.h.

References gaze::gui::Visualizeable< widget_type >::widget.

236  {
237  widget = create_widget<widget_type>(parent);
238  adjust_widget<widget_type>(widget, width, height, text);
239  return widget;
240  }
std::shared_ptr< widget_type > widget
template<typename widget_type = dlib::label>
void gaze::gui::Visualizeable< widget_type >::remove_widget ( )
inlineoverridevirtual

Disables and removes the widget.

Reimplemented from gaze::gui::VisualizeableBase.

Definition at line 245 of file visualizeable.h.

245  {
246  if (this->widget && this->widget.get()) {
247  this->widget->disable();
248  }
249  this->widget = std::shared_ptr<widget_type>(nullptr);
250  }
std::shared_ptr< widget_type > widget

Member Data Documentation

template<typename widget_type = dlib::label>
std::shared_ptr<widget_type> gaze::gui::Visualizeable< widget_type >::widget
protected

The documentation for this class was generated from the following file: