//-------------------------------------------------------------- void testApp::setup(){ ofSetFrameRate(60); setupControls(); //grafIo.loadTag("gml/hell-001.gml",&tag); bUseSmoothing = false; //int which = gmlLister->selection; currentTagName = gmlLister->lister->getName( 0 ); loadTag( currentTagName); ofBackground(80,80,80); GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f }; GLfloat LightDiffuse[]= { 1.0f, 1.0f, 1.0f, 1.0f }; GLfloat LightPosition[]= { 0.0f, 0.0f, 0.0f, 1.0f }; glShadeModel(GL_SMOOTH); glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient); glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse); glLightfv(GL_LIGHT1, GL_POSITION,LightPosition); glEnable(GL_LIGHT1); }
luAnimDlg::luAnimDlg(wxWindow* parent) : wxDialog(parent, wxID_ANY, "Object Animations", wxDefaultPosition, wxSize( 703,346 ), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLIP_CHILDREN), m_scene(NULL), m_obj(NULL), m_playAnim(false), m_animProp(NULL), m_animList(NULL), m_timeSlider(NULL), m_playBtn(NULL), m_lengthEdit(NULL), m_curPosEdit(NULL), m_incPosBtn(NULL), m_decPosBtn(NULL), m_posStepEdit(NULL), m_curAnimLength(0), m_curAnimPlayer(NULL), m_posStep("0.1"), m_curPos("0"), m_length("0") { m_animProp = new wxPropertyGrid(this,ID_ANIM_PROPS,wxDefaultPosition,wxSize(-1,-1), wxPG_SPLITTER_AUTO_CENTER | wxPG_BOLD_MODIFIED ); setupControls(); //wxbuild m_timeSlider->SetTickFreq(10,0); Show(); }
PositioningMethodSerialPortOptions::PositioningMethodSerialPortOptions(PositioningMethodSerialPort *ASerialPort, QWidget *AParent) : QWidget(AParent), ui(new Ui::PositioningMethodSerialPortOptions), FSerialPort(ASerialPort) { ui->setupUi(this); setupControls(); connect(ui->cmbPortName,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->cmbBaudRate,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->cmbDataBits,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->cmbStopBits,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->cmbParity,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->cmbFlowControl,SIGNAL(currentIndexChanged(int)),SIGNAL(modified())); connect(ui->spbBufferSize,SIGNAL(valueChanged(int)),SIGNAL(modified())); connect(ui->spbTimeout,SIGNAL(valueChanged(int)),SIGNAL(modified())); connect(ui->spbTimeTreshold,SIGNAL(valueChanged(int)),SIGNAL(modified())); connect(ui->spbDistanceTreshold,SIGNAL(valueChanged(int)),SIGNAL(modified())); connect(FSerialPort, SIGNAL(newSatelliteDataAvailable(SatelliteDataMap)), ui->ssSignalQuality, SLOT(setSatelliteData(SatelliteDataMap))); connect(FSerialPort, SIGNAL(newSatelliteDataAvailable(SatelliteDataMap)), ui->ssPosition, SLOT(setSatelliteData(SatelliteDataMap))); ui->pbTest->setDisabled(FSerialPort->isActive()); reset(); }
void DialogPlayerConfig::show( bool visible ) { if ( visible ) { setupControls(); _p_playerConfigDialog->show(); } else { _p_playerConfigDialog->hide(); } }
// Just override the mandatory create scene method void OgreSample::setupContent(void) { mTrayMgr->hideLogo(); //m_pSim = new VTFWSimulation(mSceneMgr, mCamera, mWindow, mViewport); Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, mInfo["Title"]); Ogre::Camera* cam = mgr->createCamera(mInfo["Title"] + "Camera"); mWindow->removeAllViewports(); mWindow->addViewport(cam); m_pSim = new StableFluids(mgr, cam); //m_pSim = new WaterSimulation(mSceneMgr, mCamera); m_pSim->init(); setupControls(); setDragLook(true); }
/****************************************************************************** * The setup function is run once to perform initializations in the application *****************************************************************************/ void ofxNCoreVision::_setup(ofEventArgs &e) { //set the title ofSetWindowTitle(" Community Core Vision v 1.4"); //create filter if(filter == NULL) filter = new ProcessFilters(); if ( filter_fiducial == NULL ){filter_fiducial = new ProcessFilters();} //Load Settings from config.xml file loadXMLSettings(); if(debugMode) { printf("DEBUG MODE : Printing to File\n"); /***************************************************************************************************** * LOGGING ******************************************************************************************************/ /* alright first we need to get time and date so our logs can be ordered */ time ( &rawtime ); timeinfo = localtime ( &rawtime ); strftime (fileName,80,"../logs/log_%B_%d_%y_%H_%M_%S.txt",timeinfo); FILE *stream ; sprintf(fileName, ofToDataPath(fileName).c_str()); if((stream = freopen(fileName, "w", stdout)) == NULL){} /******************************************************************************************************/ } cameraInited = false; //Setup Window Properties ofSetWindowShape(winWidth,winHeight); ofSetVerticalSync(false); //Set vertical sync to false for better performance? //printf("Application Loaded...\n?"); //load camera/video initDevice(); printf("Camera(s)/Video Initialised...\n"); //set framerate ofSetFrameRate(camRate * 1.3); //This will be based on camera fps in the future /***************************************************************************************************** * Allocate images (needed for drawing/processing images) ******************************************************************************************************/ processedImg.allocate(camWidth, camHeight); //main Image that'll be processed. processedImg.setUseTexture(false); //We don't need to draw this so don't create a texture sourceImg.allocate(camWidth, camHeight); //Source Image sourceImg.setUseTexture(false); //We don't need to draw this so don't create a texture //Fiducial Images processedImg_fiducial.allocate(camWidth, camHeight); //main Image that'll be processed. processedImg_fiducial.setUseTexture(false); //We don't need to draw this so don't create a texture undistortedImg.allocate(camWidth, camHeight); /******************************************************************************************************/ //Fonts - Is there a way to dynamically change font size? verdana.loadFont("verdana.ttf", 8, true, true); //Font used for small images //Static Images background.loadImage("images/background.jpg"); //Main (Temp?) Background //GUI Controls controls = ofxGui::Instance(this); setupControls(); //printf("Controls Loaded...\n"); //Setup Calibration calib.setup(camWidth, camHeight, &tracker); //Allocate Filters filter->allocate( camWidth, camHeight ); filter_fiducial->allocate( camWidth, camHeight ); //Fiducial Initialisation // factor for Fiducial Drawing. The ImageSize is hardcoded 320x240 Pixel!(Look at ProcessFilters.h at the draw() Method fiducialDrawFactor_Width = 320 / static_cast<float>(filter->camWidth);//camWidth; fiducialDrawFactor_Height = 240 / static_cast<float>(filter->camHeight);//camHeight; /***************************************************************************************************** * Startup Modes ******************************************************************************************************/ //If Standalone Mode (not an addon) if (bStandaloneMode) { printf("Starting in standalone mode...\n\n"); showConfiguration = true; } if (bMiniMode) { showConfiguration = true; bShowInterface = false; printf("Starting in Mini Mode...\n\n"); ofSetWindowShape(190, 200); //minimized size filter->bMiniMode = bMiniMode; } else{ bShowInterface = true; printf("Starting in full mode...\n\n"); } //If Object tracking activated if(contourFinder.bTrackObjects) { templates.loadTemplateXml(); } contourFinder.setTemplateUtils(&templates); tracker.passInFiducialInfo(&fidfinder); #ifdef TARGET_WIN32 //get rid of the console window FreeConsole(); #endif printf("Community Core Vision is setup!\n\n"); }
/****************************************************************************** * The setup function is run once to perform initializations in the application *****************************************************************************/ void ofxKCoreVision::_setup(ofEventArgs &e){ threshold = 80; nearThreshold = 550; farThreshold = 650; //set the title ofSetWindowTitle("Kinect Vision based on CCV v2"); //create filter if(filter == NULL) filter = new ProcessFilters(); //Load Settings from config.xml file loadXMLSettings(); if(debugMode){ printf("DEBUG MODE : Printing to File\n"); /***************************************************************************************************** * LOGGING ******************************************************************************************************/ /* alright first we need to get time and date so our logs can be ordered */ time ( &rawtime ); timeinfo = localtime ( &rawtime ); strftime (fileName,80,"../logs/log_%B_%d_%y_%H_%M_%S.txt",timeinfo); FILE *stream; sprintf(fileName, ofToDataPath(fileName).c_str()); if((stream = freopen(fileName, "w", stdout)) == NULL){} /******************************************************************************************************/ } cameraInited = false; //Setup Window Properties ofSetWindowShape(winWidth,winHeight); ofSetVerticalSync(false); //Set vertical sync to false for better performance? //load camera/video initDevice(); printf("Kinect Initialised...\n"); //set framerate ofSetFrameRate(camRate * 1.3); //This will be based on camera fps in the future /***************************************************************************************************** * Allocate images (needed for drawing/processing images) ******************************************************************************************************/ processedImg.allocate(camWidth, camHeight); //main Image that'll be processed. processedImg.setUseTexture(false); //We don't need to draw this so don't create a texture sourceImg.allocate(camWidth, camHeight); //Source Image sourceImg.setUseTexture(false); //We don't need to draw this so don't create a texture //Fiducial Images undistortedImg.allocate(camWidth, camHeight); // ES NECESARIO??? /******************************************************************************************************/ //Fonts - Is there a way to dynamically change font size? verdana.loadFont("verdana.ttf", 8, true, true); //Font used for small images //Static Images background.loadImage("images/background.jpg"); //Main (Temp?) Background //GUI Controls controls = ofxGui::Instance(this); setupControls(); //printf("Controls Loaded...\n"); //Setup Calibration calib.setup(camWidth, camHeight, &tracker); //Allocate Filters filter->allocate( camWidth, camHeight ); /***************************************************************************************************** * Startup Modes ******************************************************************************************************/ //If Standalone Mode (not an addon) if (bStandaloneMode) { printf("Starting in standalone mode...\n\n"); showConfiguration = true; } if (bMiniMode) { showConfiguration = true; bShowInterface = false; printf("Starting in Mini Mode...\n\n"); ofSetWindowShape(190, 200); //minimized size filter->bMiniMode = bMiniMode; } else{ bShowInterface = true; printf("Starting in full mode...\n\n"); } //If Object tracking activated if(contourFinder.bTrackObjects) { templates.loadTemplateXml(); } contourFinder.setTemplateUtils(&templates); printf("Community Core Vision is setup!\n\n"); }
/****************************************************************************** * The setup function is run once to perform initializations in the application *****************************************************************************/ void ofxNCoreAudio::_setup(ofEventArgs &e) { // set the title ofSetWindowTitle(" Community Core Audio "); // Load Settings from config.xml file loadXMLSettings(); // Setup Window Properties ofSetWindowShape(winWidth,winHeight); ofSetVerticalSync(false); // Fonts verdana.loadFont("verdana.ttf", 8, true, true); // Font used for small images bigvideo.loadFont("verdana.ttf", 13, true, true); // Font used for big images. // Static Images background.loadImage("images/background.jpg"); // Main Background // GUI Controls controls = ofxGui::Instance(this); setupControls(); // ASR Engine: commandpicking asrEngine_1 = new ofxSphinxASR; ofAsrEngineArgs *engineArgs = new ofAsrEngineArgs; engineArgs->sphinxmodel_am = sphinxmodel_am; engineArgs->sphinxmodel_lm = sphinxmodel_lm; engineArgs->sphinxmodel_dict = sphinxmodel_dict; engineArgs->sphinxmodel_fdict = sphinxmodel_fdict; engineArgs->sphinx_mode = 2; engineArgs->samplerate = model_sampleRate; FILE *fp_list = fopen(commandList.c_str(), "rt"); if (fp_list==NULL) { printf("Error: Can not find command list file %s.", commandList.c_str()); } char *sentence = new char[maxSentenceLength]; while (fgets(sentence, maxSentenceLength, fp_list)) { engineArgs->sphinx_candidate_sentences.push_back(sentence); } if (asrEngine_1->engineInit(engineArgs) != OFXASR_SUCCESS) { printf("Initial ASR Engine Failed!"); } delete []sentence; curAsrEngine = asrEngine_1; // ASR Engine: freespeaking asrEngine_2 = new ofxSphinxASR; engineArgs->sphinx_mode = 4; if (asrEngine_2->engineInit(engineArgs) != OFXASR_SUCCESS) { printf("Initial ASR Engine Failed!"); } delete engineArgs; // Display ofColor outBgColor; outBgColor.r = outBgColor.g = outBgColor.b = 0x33; ofColor outFgColor; outFgColor.r = 0; outFgColor.g = 255; outFgColor.b = 0; ofRectangle outRect; int outRectBorder = 20; outRect.x = 386 + outRectBorder/2; outRect.y = 41 + outRectBorder; outRect.height = 229 - 2 * outRectBorder; outRect.width = 320 - 2 * outRectBorder/2; rectPrint.init(outRect, outBgColor, outFgColor, "verdana.ttf", 8); rectPrint.setLineHeight(15); // Resample resample_factor = (float)model_sampleRate / SampleRate; resample_handle = resample_open(1, resample_factor, resample_factor); tcpServer.setup(tcpPort); /***************************************************************************************************** * Startup Modes ******************************************************************************************************/ showConfiguration = true; if (bMiniMode) { bShowInterface = false; printf("Starting in Mini Mode...\n\n"); ofSetWindowShape(190, 200); // minimized size } else{ bShowInterface = true; printf("Starting in full mode...\n\n"); } #ifdef TARGET_WIN32 #ifndef _DEBUG FreeConsole(); #endif #endif printf("Community Core Audio is setup!\n\n"); }
luReplaceDlg::luReplaceDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { setupControls(); }