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 | List of all members
gaze::pipeline::FallbackStep Class Referencefinal

This pipeline step is used whenever something goes wrong. More...

#include "gaze/pipeline_steps/fallback_step.h"

Inheritance diagram for gaze::pipeline::FallbackStep:
gaze::PipelineStep gaze::gui::Visualizeable< widget_type > gaze::gui::VisualizeableBase

Public Member Functions

 FallbackStep ()
 
void process (util::Data &) override
 
void visualize (util::Data &) override
 
- Public Member Functions inherited from gaze::PipelineStep
 PipelineStep ()
 
std::string get_name ()
 
virtual ~PipelineStep ()=default
 
- Public Member Functions inherited from gaze::gui::Visualizeable< widget_type >
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
 

Additional Inherited Members

- Protected Attributes inherited from gaze::PipelineStep
int number
 
std::string name
 
- Protected Attributes inherited from gaze::gui::Visualizeable< widget_type >
std::shared_ptr< widget_type > widget
 

Detailed Description

This pipeline step is used whenever something goes wrong.

Definition at line 19 of file fallback_step.h.

Constructor & Destructor Documentation

gaze::pipeline::FallbackStep::FallbackStep ( )

Initializes the FallbackStep. Reads all configuration for this step, in case something went wrong.

Definition at line 15 of file fallback_step.cpp.

References basic_string< char >::c_str(), gaze::util::get_config(), gaze::PipelineStep::name, and gaze::PipelineStep::number.

15  {
16  YAML::Node config = util::get_config(this->number);
17  this->name = config["name"] ?
18  config["name"].as<std::string>() : "Fallback Step";
19  YAML::Emitter emitter;
20  emitter << config;
21  this->config = emitter.c_str();
22 }
const char * c_str() const noexcept
std::string name
Definition: pipeline_step.h:31
YAML::Node get_config()
Definition: config.in.cpp:12

Member Function Documentation

void gaze::pipeline::FallbackStep::process ( util::Data )
overridevirtual

Does nothing.

Implements gaze::PipelineStep.

Definition at line 24 of file fallback_step.cpp.

24  {
25 }
void gaze::pipeline::FallbackStep::visualize ( util::Data )
overridevirtual

Shows instructions on how to implement a custom pipeline step and register it successfully. Shows all information from gaze.yaml for this step (even if its the wrong step).

Implements gaze::gui::VisualizeableBase.

Definition at line 27 of file fallback_step.cpp.

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

27  {
28  std::string text(""
29  "This is a fallback in case something goes wrong.\n"
30  "If you see this, then either your configuration is wrong (see below)\n"
31  "or you forgot to implement one place where pipeline steps have to go.\n"
32  "\nThis is your configuration:\n\n"
33  + this->config +
34  "\n\nAnd here is a checklist of what to do to develop a new step:\n"
35  "- Create include/gaze/pipeline_steps/....h\n"
36  "- Create src/gaze/pipeline_steps/....cpp\n"
37  "- Add an #include to include/gaze/pipeline_steps.h\n"
38  "- Add the *.cpp file to src/gaze/CMakeLists.txt\n"
39  "- Add a case to init_pipeline in src/gaze/gaze_tracker.cpp\n"
40  "- If you use a new widget, add traits to "
41  "include/gaze/gui/visualizeable.h");
42  this->widget->set_text(text);
43 }
std::shared_ptr< widget_type > widget

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