Пример #1
0
void ARController::Initialize(Engine * engine)
{
    if (isInitialized)
        return;
    LOGD(LOGTAG_ARCONTROLLER,"Initializing ARController");

    initializeUI(engine);

    engine->sensorCollector->EnableSensors(false,true,false);

    //Initialize stateful objects
    worldLoader = new WorldLoader();
    qrFinder = new QRFinder(debugUI);
    qrDecoder = new QRDecoder(debugUI);
    positionSelector = new PositionSelector(debugUI);

    //Initialize textured quad to render camera image
    quadBackground = new QuadBackground(engine->ImageSize());
    deletableObjects.push_back(quadBackground);

    engine->inputHandler->AddGlobalButtonDelegate(ButtonEventDelegate::from_method<ARController,&ARController::HandleButtonPress>(this));

    isInitialized = true;
    drawingLevel = 3;
    LOGD(LOGTAG_ARCONTROLLER,"Initialization complete");
}
Пример #2
0
EnrollDialog::EnrollDialog(QWidget *parent, QSettings *settings, WorkerSensorMulti *workerSensor) :
  QDialog(parent)
{
  DEBUG("EnrollDialog Constructor Called");
  this->settings = settings;
  this->rutNumber = "";
  this->screen = 1;

  soapHandlerPersona = new SoapHandler(this->settings);
  connect(soapHandlerPersona, SIGNAL(finished(QString)), this, SLOT(verificaPersonaFinished(QString)));
  connect(soapHandlerPersona, SIGNAL(error(QString)), this, SLOT(verificaPersonaError(QString)));

  soapHandlerEnroll = new SoapHandler(this->settings);
  connect(soapHandlerEnroll, SIGNAL(finished(QString)), this, SLOT(enrollFinished(QString)));
  connect(soapHandlerEnroll, SIGNAL(error(QString)), this, SLOT(enrollError(QString)));

  this->workerSensor = workerSensor;
  connect(workerSensor, SIGNAL(enrollWorkDone(uchar *, uchar *, int, int)), this, SLOT(enrollWorkDone(uchar *, uchar *, int, int)));

  this->setWindowOpacity(1.0);
  this->setWindowState(Qt::WindowFullScreen);
  this->resize(240, 320);

  initializeUI();

  closeTimer = new QTimer(this);
  closeTimer->setInterval(settings->value("timerCloseEnrollDialog", 60000).toInt());
  connect(closeTimer, SIGNAL(timeout()), this, SLOT(timerCloseDialog()));
  closeTimer->start();
}
Пример #3
0
BOOL CImp_DrawDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog. The framework does this automatically
	// when the application's main window is not a dialog box.
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
    
    //
    // Display the Logon dialog box.
    //
    CString	csDefaultQueueName = GetUserName();
	m_csLogin = LoginPrompt(csDefaultQueueName);	
    while (m_csLogin == "")
    {
	    m_csLogin = LoginPrompt(csDefaultQueueName);
    }
    SetWindowText(m_csLogin);
    
    //
    // First, we have to initialize COM.
    //
	if (!AfxOleInit())
	{
		MessageBox("Failed to initialize COM.");
		exit(1);
	}


    //
    // Establish whether the local computer is enabled to access the directory
	// service (DS) and set the UI accordingly.
    //
    m_fDsEnabledLocaly = IsDsEnabledLocaly();

    if(!m_fDsEnabledLocaly)
    {
        //
        // The computer is DS-disabled. This is the right place to open the receiving queue
        // because it is a local private queue. This operation is not time-consuming.
        //
        //
	    // Open the receiving queue and receive incoming messages.
	    //
        if (!OpenPrivateReceiveQueue())
        {
            //
            // The attempt to open the receiving queue failed.
            //
            MessageBox("The receiving queue cannot be opened.");

        }
    }
    initializeUI(m_fDsEnabledLocaly);
	
	
    return TRUE;  // Return TRUE unless you set the focus to a control.
}
void 
HippoAbstractWindow::setUI(HippoUI *ui)
{
    if (created_)
        return;

    ui_ = ui;
    if (ui_)
        initializeUI();
}
Пример #5
0
void CScenePlay::initializeScene()
{
	// シーケンスを関数ポインタで管理
	Sequence[SEQ_BEGIN] = &CScenePlay::SequenceBegin;
	Sequence[SEQ_MAIN] = &CScenePlay::SequenceMain;
	Sequence[SEQ_PAUSE] = &CScenePlay::SequencePause;
	Sequence[SEQ_END] = &CScenePlay::SequenceEnd;
	
	// 最初のシーケンス
	SequenceState = SEQ_BEGIN;

	// 各パラメーター初期化
	initializeObjects();
	
	// ユーザーインターフェース初期化
	initializeUI();
}
Пример #6
0
int main(int argc, char** argv){
  //Initialize globals
  //srand(time(NULL));
  camera.setPosition(0.0, 10.0, 10.0);
  camera.setVector(0.0, 0.0, 0.0);
  newCam = camera;
  u.setVector(-1.0, 0.0, 0.0);
  v.setVector(0.0, 1.0, 0.0);
  w.setVector(0.0, 0.0, -1.0);
  p1.setOpponent(&(opponent.player));
  p1.setPosition(P1_POSX, P1_POSY, P1_POSZ);
  opponent.player.setPosition(OPP_POSX2, OPP_POSY2, OPP_POSZ2);

  cam.setListenerPos();
  sound.toggleMusic();

  tlx = 0;
  tly = 0;
  ulx = 0;   
  uly = 0;
  //Initialize window
  GW = 800;
  GH = 600;
  
    /* initialize buttons */
  GLfloat col[] = {1.0,1.0,1.0};
  for (int i = 0; i < 18; i++) {
	Button * newBtn = new Button(i, col, NULL);
    buttons.push_back(newBtn);
  }
  
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
  glutInitWindowSize(GW, GH);
  glutInitWindowPosition(100, 100);
  glutCreateWindow("Crash & Burn");
  glClearColor(1.0, 1.0, 1.0, 1.0);

  //Register GLUT callbacks
  glutDisplayFunc(display);
  glutReshapeFunc(reshape);
  glutKeyboardFunc(keyboard);
  glutKeyboardUpFunc(keyboardUp);
  glutSpecialFunc(specKeys);
  glutMouseFunc(mouseClick);
  glutPassiveMotionFunc(mouseMotion);

  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHTING);
  init_lighting();
  composeDisplayLists();
  glutTimerFunc(1000/60, update, 0);

  initializeParticleTextures();
  buttons.at(17)->setObject(new BasicTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(16)->setObject(new FreezeTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(15)->setObject(new FastTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(14)->setObject(new SlowTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(13)->setObject(new TrapTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));
  buttons.at(12)->setObject(new WallTower(float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0.25, 
     float(-0.5)*GRID_SIZE*2.0 + GRID_SIZE, 0, 0));

  initializeUI();
  winTexture = LoadHQTexture("Win.bmp");
  startTexture = LoadHQTexture("title.bmp");

  p1.pGrid.initialize(false);
  opponent.player.pGrid.initialize(true);
  scene.initialize();

  glutMainLoop();
}
Пример #7
0
void SettingsWindow::showEvent(QShowEvent *event)
{
  initializeUI();
  initializeElements();
  event->accept();
}