root / src / modules / ccxDebugGestureModule.cpp

View | Annotate | Download (1.4 KB)

1
/////////////////////////////////////////////////////////////////////////////
2
// Name:        modules/ccxDebugGestureModule.cpp
3
// Purpose:     Generate debug gestures
4
// Author:      Scott Halstvedt
5
// Copyright:   (c) 2011 NUI Group
6
/////////////////////////////////////////////////////////////////////////////
7
8
9
#include "ccxDebugGestureModule.h"
10
11
MODULE_DECLARE(DebugGesture, "native", "Passes through vector<unimodalLeaf> onto the stream for tactile GUI events");
12
13
ccxDebugGestureModule::ccxDebugGestureModule() : ccxModule(CCX_MODULE_INPUT || CCX_MODULE_OUTPUT) {
14
    MODULE_INIT();
15
    
16
    this->output = new ccxDataStream("vector<unimodalLeaf>");
17
        this->declareOutput(0, &this->output, new ccxDataStreamInfo(
18
                        "tactiles", "vector<unimodalLeaf>", "Vector of tactile GUI events"));
19
    this->input = new ccxDataStream("vector<unimodalLeaf");
20
    this->declareInput(0, &this->input, new ccxDataStreamInfo("debugtactiles", "vector<unimodalLeaf>", "Vector of tactile GUI events"));
21
    
22
}
23
24
ccxDebugGestureModule::~ccxDebugGestureModule() {
25
}
26
27
void ccxDebugGestureModule::update() {
28
    LOG(CCX_DEBUG, "passing through");
29
    std::vector<client::unimodalLeafNode> *gestureTree = NULL;
30
    if(this->input != NULL) gestureTree = (std::vector<client::unimodalLeafNode> *)this->input->getData();
31
    if(gestureTree != NULL) this->output->push(gestureTree);
32
    else this->output->clear();
33
}
34
35
void ccxDebugGestureModule::start() {
36
    ccxModule::start();
37
}