本文整理汇总了C++中Controller::addListener方法的典型用法代码示例。如果您正苦于以下问题:C++ Controller::addListener方法的具体用法?C++ Controller::addListener怎么用?C++ Controller::addListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller::addListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gluiMainWindow
void gluiMainWindow (int control){
switch(control){
case 0:
subGlui->hide();
bt3->enable();
break;
case 1:
//inicializar LeapMotion y FMod
controller.addListener(leap);
sonido.init();
simulator=1;
luces();
bt1->disable();
break;
case 3:
enable=1;
bt3->disable();
break;
case -3:
bt4->disable();
controller.removeListener(leap);
exit(0);
break;
}
glutPostRedisplay();
}
示例2: main
/* ----------------------------------------------------------------------------------------- */
int main(int argc, char ** argv)
{
int infile = 0, outfile = 0;
double filter = 0;
parse_argv(argc, argv, &infile, &outfile, &filter);
if(infile != 0) {
play(infile);
return 0;
}
// Create a sample listener and controller
CListener listener;
Controller controller;
if(outfile != 0)
listener.set_robot_output(outfile);
listener.set_filter(filter);
// Have the sample listener receive events from the controller
controller.addListener(listener);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例3: main
int main()
{
// Create a sample listener and controller
SampleListener listener;
Controller controller;
listener.Mouse = new MouseManager();
listener.mystate = 0;
listener.clickcount = 0;
listener.pressstate = 0;
listener.side = 0;
listener.pressedDelay = 0;
listener.rclick = 0;
listener.sensibility = 8;
listener.active = false;
listener.lastFrameID = -1;
listener.lastToggle = 0;
listener.lastEvent = time(0);
std::cout << "width: " << listener.Mouse->w_width << std::endl;
std::cout << "height: " << listener.Mouse->w_height << std::endl;
// Have the sample listener receive events from the controller
controller.addListener(listener);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例4: main
int main(int argc, const char *argv[]){
screen_width = (unsigned int)CGDisplayPixelsWide(kCGDirectMainDisplay);
screen_height = (unsigned int)CGDisplayPixelsHigh(kCGDirectMainDisplay);
CGPoint current_point = CGEventGetLocation(CGEventCreate(nil));
screen = controller.calibratedScreens()[0];
if(!screen.isValid()){
cout << "This screen has not been calibrated." << endl;
return 0;
}
// Create a sample listener and controller
SampleListener listener;
// Have the sample listener receive events from the controller
controller.addListener(listener);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例5: main
int main(int argc, char** argv) {
ros::init(argc, argv, "leap_motion");
ros::NodeHandle nh("leap_motion");
bool setup_params[7];
// Read parameters from the defined in listener_params.yaml
nh.getParam("/enable_controller_info", setup_params[0] );
nh.getParam("/enable_frame_info", setup_params[1] );
nh.getParam("/enable_hand_info", setup_params[2] );
nh.getParam("/enable_gesture_circle", setup_params[3] );
nh.getParam("/enable_gesture_swipe", setup_params[4] );
nh.getParam("/enable_gesture_screen_tap", setup_params[5] );
nh.getParam("/enable_gesture_key_tap", setup_params[6] );
LeapListener listener(setup_params);
// Add a publisher to the leapListener object
listener.ros_publisher = nh.advertise<leap_motion::Human>("leap_device", 1);
Controller controller;
controller.addListener(listener);
// Keep doing ROS spin until shutdown() or Ctrl+C
ros::spin();
controller.removeListener(listener);
return 0;
}
示例6: main
int main(int argc , char ** argv) {
screen = controller.calibratedScreens()[0];
if(!screen.isValid()){
cout << "This screen has not been calibrated." << endl;
return 0;
}
srand((unsigned int)time(NULL));
// Have the sample listener receive events from the controller
controller.addListener(listener);
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA);
glutInitWindowSize(screen_width, screen_height);
glutInitWindowPosition(0, 0);
window = glutCreateWindow("LEAP intersection Test");
glutDisplayFunc(&DrawGLScene);
glutIdleFunc(&Idle);
glutReshapeFunc(&ReSizeGLScene);
glutKeyboardFunc(&NormalKeyPressed);
glutSpecialFunc(&SpecialKeyPressed);
glDisable(GL_DEPTH_TEST); // Disables Depth Testing
glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading
glutMainLoop();
return 0;
}
示例7: main
int main(int argc, char** argv) {
controller.addListener(listener);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例8: main
int main(int argc, char** argv) {
// Create a sample listener and controller
SampleListener listener;
Controller controller;
// Have the sample listener receive events from the controller
controller.addListener(listener);
if(argc > 1 && strcmp(argv[1], "--bg") == 0)
controller.setPolicy(Leap::Controller::POLICY_BACKGROUND_FRAMES);
getchar();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例9: setup
void LeapCinderVectorFieldApp::setup()
{
m_LeapController.addListener( m_LeapListener );
/** timing data */
m_fLastTime = getElapsedSeconds();
m_fFrameTime = 0;
/** background image */
//m_BGImage = gl::Texture( loadImage( loadAsset( "testBg.jpg" ) ) );
/** vector field */
m_VectorField = new VectorFieldController();
}
示例10: main
int main() {
// Create a sample listener and controller
myFingers listener;
Controller controller;
// Have the sample listener receive events from the controller
controller.addListener(listener);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例11: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MangoListener listener;
Controller controller;
controller.addListener(listener);
std::cout << "Mango started, press enter to quit..." << std::endl;
app.exec();
std::cin.get();
controller.removeListener(listener);
return 0;
}
示例12: main
int main(int argc, char **argv, char **envp) {
if (argc == 1) {
cerr << "Usage: " << argv[0] << " <basenote>" << endl
<< "\tThe basenote can be any number starting from 0 (lowest C)" << endl
<< "\tRemember that the scale is divided in 12 half-tones" << endl;
return 1;
}
const int basenote = atoi(argv[1]);
SoundClient soundClient;
LeapListener listener(basenote, soundClient);
Controller controller;
controller.addListener(listener);
cout << "Press Enter to quit..." << endl;
cin.get();
controller.removeListener(listener);
return 0;
}
示例13: main
int main(int argc, char** argv) {
// Create a sample listener and controller
SampleListener listener;
Controller controller;
// Have the sample listener receive events from the controller
controller.addListener(listener);
if (argc > 1 && strcmp(argv[1], "--bg") == 0)
controller.setPolicy(Leap::Controller::POLICY_BACKGROUND_FRAMES);
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
return 0;
}
示例14: main
int main(int argc , char ** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
glutInitWindowPosition(0, 0);
window = glutCreateWindow("LEAP Axis Test");
glutDisplayFunc(&DrawGLScene);
glutIdleFunc(&Idle);
glutReshapeFunc(&ReSizeGLScene);
glutKeyboardFunc(&NormalKeyPressed);
glutSpecialFunc(&SpecialKeyPressed);
InitGL(DEFAULT_WIDTH, DEFAULT_HEIGHT);
// Have the sample listener receive events from the controller
controller.addListener(listener);
glutMainLoop();
return 0;
}
示例15: main
int main() {
// Create a sample listener and controller
SampleListener listener;
Controller controller;
// Have the sample listener receive events from the controller
controller.addListener(listener);
file = fopen("/dev/tty.usbmodemfd1311", "w"); //Opening device file
// Keep this process running until Enter is pressed
std::cout << "Press Enter to quit..." << std::endl;
std::cin.get();
// Remove the sample listener when done
controller.removeListener(listener);
fclose(file);
return 0;
}