From 20502b7ba2914c197f7eae5c4fca77c91aafc03d Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Sun, 29 Jan 2012 06:45:35 -0500 Subject: [PATCH] Remove whitespace [WhitespaceBot] --- example/testApp.cpp | 32 ++++++++++----------- example/testApp.h | 4 +-- libs/AntTweakBar/include/AntTweakBar.h | 10 +++---- src/ofxTwBar.cpp | 30 +++++++++---------- src/ofxTwBar.h | 40 +++++++++++++------------- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/example/testApp.cpp b/example/testApp.cpp index f6e9ae8..daff898 100755 --- a/example/testApp.cpp +++ b/example/testApp.cpp @@ -1,8 +1,8 @@ /* Example for ofxTwBar. -Bridge to AntTweakBar - "a light and intuitive graphical user interface" +Bridge to AntTweakBar - "a light and intuitive graphical user interface" - + A simple example using AntTweakBar with OpenGL and GLUT . Example from */ @@ -27,11 +27,11 @@ ofVec3f g_LightDirection; //-------------------------------------------------------------- void testApp::setup(){ - + g_Rotation = ofQuaternion(0.0f, 0.0f, 0.0f, 1.0f); g_RotateStart = ofQuaternion(0.0f, 0.0f, 0.0f, 1.0f); g_LightDirection.set(-0.57735f, -0.57735f, -0.57735f); - + // Create some 3D objects (stored in display lists) glNewList(SHAPE_TEAPOT, GL_COMPILE); glutSolidTeapot(1.0); @@ -42,21 +42,21 @@ void testApp::setup(){ glNewList(SHAPE_CONE, GL_COMPILE); glutSolidCone(1.0, 1.5, 64, 4); glEndList(); - - + + float axis[] = { 0.7f, 0.7f, 0.0f }; // initial model rotation float angle = 0.8f; // Init rotation SetQuaternionFromAxisAngle(axis, angle, g_Rotation); SetQuaternionFromAxisAngle(axis, angle, g_RotateStart); - + //TWEAK BAR bar.init("TweakBar", 200, 400, 200, 200, 200, 100); bar.enable(); - + bar.addParam("Zoom", &g_Zoom, " min=0.01 max=500.0 step=1.0 keyIncr=z keyDecr=Z help='Scale the object (1=original size).' ", false); - bar.addParam("ObjRotation", &g_Rotation, " label='Object rotation' open help='Change the object orientation.' ", false); + bar.addParam("ObjRotation", &g_Rotation, " label='Object rotation' open help='Change the object orientation.' ", false); bar.addParam("Multiplier", &g_LightMultiplier, " label='Light booster' min=0.1 max=4 step=0.02 keyIncr='+' keyDecr='-' help='Increase/decrease the light power.' ", false); bar.addParam("LightDir", &g_LightDirection, " label='Light direction' open help='Change the light direction.' ", false); bar.addSeparator("separator"); @@ -72,15 +72,15 @@ void testApp::update(){ void testApp::draw(){ float v[4]; // will be used to set light paramters float mat[4*4]; // rotation matrix - + // Clear frame buffer glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - + glEnable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glEnable(GL_NORMALIZE); - + // Set light glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); @@ -90,11 +90,11 @@ void testApp::draw(){ glLightfv(GL_LIGHT0, GL_DIFFUSE, v); v[0] = -g_LightDirection.x; v[1] = -g_LightDirection.y; v[2] = -g_LightDirection.z; v[3] = 0.0f; glLightfv(GL_LIGHT0, GL_POSITION, v); - + // Set material glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, g_MatAmbient); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, g_MatDiffuse); - + // Rotate and draw shape glPushMatrix(); //glTranslatef(0.5f, -0.3f, 0.0f); @@ -104,7 +104,7 @@ void testApp::draw(){ glScalef(g_Zoom, g_Zoom, g_Zoom); glCallList(g_CurrentShape); glPopMatrix(); - + //TWEAK BAR bar.draw(); } @@ -120,7 +120,7 @@ void testApp::SetQuaternionFromAxisAngle(const float *axis, float angle, ofQuate quat._v[1] = sina2 * axis[1] / norm; quat._v[2] = sina2 * axis[2] / norm; quat._v[3] = (float)cos(0.5f * angle); - + } diff --git a/example/testApp.h b/example/testApp.h index ca5e213..c56a63c 100755 --- a/example/testApp.h +++ b/example/testApp.h @@ -22,9 +22,9 @@ class testApp : public ofBaseApp{ void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); - + ofxTwBar bar; - + void SetQuaternionFromAxisAngle(const float *axis, float angle, ofQuaternion quat); void ConvertQuaternionToMatrix(const ofQuaternion quat, float *mat); void MultiplyQuaternions(const ofQuaternion q1, const ofQuaternion q2, ofQuaternion qout); diff --git a/libs/AntTweakBar/include/AntTweakBar.h b/libs/AntTweakBar/include/AntTweakBar.h index 1e56e0e..47dd8b4 100755 --- a/libs/AntTweakBar/include/AntTweakBar.h +++ b/libs/AntTweakBar/include/AntTweakBar.h @@ -2,8 +2,8 @@ // // @file AntTweakBar.h // -// @brief AntTweakBar is a light and intuitive graphical user interface -// that can be readily integrated into OpenGL and DirectX +// @brief AntTweakBar is a light and intuitive graphical user interface +// that can be readily integrated into OpenGL and DirectX // applications in order to interactively tweak them. // // @author Philippe Decaudin - http://www.antisphere.com @@ -241,7 +241,7 @@ TW_API int TW_CALL TwKeyPressed(int key, int modifiers); typedef enum ETwMouseAction { TW_MOUSE_RELEASED, - TW_MOUSE_PRESSED + TW_MOUSE_PRESSED } TwMouseAction; typedef enum ETwMouseButtonID { @@ -275,7 +275,7 @@ TW_API int TW_CALL TwEventWin(void *wnd, unsigned int msg, unsigned int _W6 // For libSDL event loop TW_API int TW_CALL TwEventSDL(const void *sdlEvent); - + // For GLFW event callbacks TW_API int TW_CALL TwEventMouseButtonGLFW(int glfwButton, int glfwAction); TW_API int TW_CALL TwEventKeyGLFW(int glfwKey, int glfwAction); @@ -299,7 +299,7 @@ typedef void (TW_GLUT_CALL *GLUTmousemotionfun)(int mouseX, int mouseY); typedef void (TW_GLUT_CALL *GLUTkeyboardfun)(unsigned char glutKey, int mouseX, int mouseY); typedef void (TW_GLUT_CALL *GLUTspecialfun)(int glutKey, int mouseX, int mouseY); - + // ---------------------------------------------------------------------------- // Make sure the types have the right sizes // ---------------------------------------------------------------------------- diff --git a/src/ofxTwBar.cpp b/src/ofxTwBar.cpp index 8c2ee9c..2454602 100644 --- a/src/ofxTwBar.cpp +++ b/src/ofxTwBar.cpp @@ -1,19 +1,19 @@ /* Copyright (c) 2010, Hugues Bruyère - All rights reserved. - + Bridge to AntTweakBar - "a light and intuitive graphical user interface" - Based on code from Cinder Lib. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR @@ -45,13 +45,13 @@ void ofxTwBar::init( const std::string &title, const int w, const int h, const i cout << "AntTweakBar initialization failed: " << TwGetLastError() << endl; } mBar = TwNewBar(title.c_str());//, TwDeleteBar); - + char optionsStr[1024]; sprintf( optionsStr, "%s size='%i %i' color='%i %i %i' alpha=%i", title.c_str(), w, h, r, g, b, a); TwDefine( optionsStr ); - + TwGLUTModifiersFunc(glutGetModifiers); - + mouseLocked = false; } @@ -74,7 +74,7 @@ void ofxTwBar::enable(bool enableMousePressed) { // ofAddListener(ofEvents.update, this, &ofxTwBar::update); // ofAddListener(ofEvents.draw, this, &ofxTwBar::draw); ofAddListener(ofEvents.windowResized, this, &ofxTwBar::resize); - + ofAddListener(ofEvents.keyPressed, this, &ofxTwBar::keyPressed); ofAddListener(ofEvents.mouseDragged, this, &ofxTwBar::mouseDragged); ofAddListener(ofEvents.mouseMoved, this, &ofxTwBar::mouseMoved); @@ -88,7 +88,7 @@ void ofxTwBar::disable() { // ofRemoveListener(ofEvents.update, this, &ofxTwBar::update); // ofRemoveListener(ofEvents.draw, this, &ofxTwBar::draw); ofRemoveListener(ofEvents.windowResized, this, &ofxTwBar::resize); - + ofRemoveListener(ofEvents.keyPressed, this, &ofxTwBar::keyPressed); ofRemoveListener(ofEvents.mouseDragged, this, &ofxTwBar::mouseDragged); ofRemoveListener(ofEvents.mouseMoved, this, &ofxTwBar::mouseMoved); @@ -107,23 +107,23 @@ void ofxTwBar::implAddParam( const std::string &name, void *param, int type, con //-------------------------------------------------------------- void ofxTwBar::addParam( const std::string &name, bool *param, const std::string &optionsStr, bool readOnly ) { implAddParam( name, param, TW_TYPE_BOOLCPP, optionsStr, readOnly ); -} +} //-------------------------------------------------------------- void ofxTwBar::addParam( const std::string &name, float *param, const std::string &optionsStr, bool readOnly, int type ) { implAddParam( name, param, type, optionsStr, readOnly ); -} +} //-------------------------------------------------------------- void ofxTwBar::addParam( const std::string &name, int *param, const std::string &optionsStr, bool readOnly ) { implAddParam( name, param, TW_TYPE_INT32, optionsStr, readOnly ); -} +} //-------------------------------------------------------------- void ofxTwBar::addParam( const std::string &name, ofVec3f *param, const std::string &optionsStr, bool readOnly ) { implAddParam( name, param, TW_TYPE_DIR3F, optionsStr, readOnly ); -} +} // //-------------------------------------------------------------- void ofxTwBar::addParam( const std::string &name, ofQuaternion *param, const std::string &optionsStr, bool readOnly ) { @@ -162,12 +162,12 @@ void ofxTwBar::keyPressed(ofKeyEventArgs & args){ cout << "SHIFT pressed."; kmod |= TW_KMOD_SHIFT; } - + if( ofKeyControl() ) { cout << "CONTROL pressed."; kmod |= TW_KMOD_CTRL; } - + if( args.key == 9 ) { cout << "ALT pressed."; kmod |= TW_KMOD_ALT; diff --git a/src/ofxTwBar.h b/src/ofxTwBar.h index 40858ff..3b6c3b2 100644 --- a/src/ofxTwBar.h +++ b/src/ofxTwBar.h @@ -1,19 +1,19 @@ /* Copyright (c) 2010, Hugues Bruyère - All rights reserved. - + Bridge to AntTweakBar - "a light and intuitive graphical user interface" - - + Based on code from Cinder Lib. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR @@ -32,29 +32,29 @@ #include "AntTweakBar.h" #include #include - + class ofxTwBar { public: ofxTwBar(); ~ofxTwBar(); - + bool mouseLocked; - + void init( const std::string &title, const int w, const int h, const int r, const int g, const int b, const int a ); void update(); void resize(ofResizeEventArgs & args); void draw(); - + void enable(bool enableMousePressed = true); void disable(); - + void keyPressed(ofKeyEventArgs & args); void mouseMoved(ofMouseEventArgs & args); void mouseDragged(ofMouseEventArgs & args); void mousePressed(ofMouseEventArgs & args); void mousePressed(int x, int y, int button); void mouseReleased(ofMouseEventArgs & args); - + void addParam( const std::string &name, bool *boolParam, const std::string &optionsStr = "", bool readOnly = false ); void addParam( const std::string &name, float *quatParam, const std::string &optionsStr = "", bool readOnly = false, int type = TW_TYPE_FLOAT ); void addParam( const std::string &name, int *intParam, const std::string &optionsStr = "", bool readOnly = false ); @@ -63,21 +63,21 @@ class ofxTwBar { void addParam( const std::string &name, std::string *strParam, const std::string &optionsStr = "", bool readOnly = false ); void addSeparator( const std::string &name = "", const std::string &optionsStr = "" ); void addButton( const std::string &name = "", const std::string &optionsStr = "" ); - + void removeParam(const std::string &name); - + void addGroupToGroup(const std::string &optionsStr = ""); - - - + + + protected: - void implAddParam( const std::string &name, void *param, int type, const string &optionsStr, bool readOnly ); - + void implAddParam( const std::string &name, void *param, int type, const string &optionsStr, bool readOnly ); + TwBar *mBar; int mouseX, mouseY; bool ofKeyAlt(); bool ofKeyShift(); bool ofKeyControl(); - + }; - +