Beispiel #1
0
VectorEnumerator& VectorEnumerator::operator++( )
{
  int cur;
  
  if( seqLimit( ) ) {
    curLength--;
    if( curLength>=0 ) {
      stepBack( curVector[curLength] );
      cur = next( curVector[curLength] );
    }
  }
  else
    cur = start( );
  
  while( curLength>=0 ) {
    
    if( !finish( cur ) ) {
      
      if( curLength>=curVector.capacity( ) )
	curVector.resize( curLength+5 );
      
      curVector[curLength] = cur;
      ++curLength;
      
      if( seqOK( ) ) {
	stepTo( );
	if( seqComplete( ) ) {
	  return *this;
	}
	else {
	  if( seqLimit( ) ) {
	    curLength--;
	    stepBack( curVector[curLength] );
	    cur = next( curVector[curLength] );
	  }
	  else {
	    cur = start( );
	  }
	}
      }
      else {
	cur = next( curVector[--curLength] );
      }
    } // if( !finish( cur ) ) {
    else{
      --curLength;
      if( curLength>=0 ) {
	stepBack( curVector[curLength] );
	cur = curVector[curLength];
      }
      cur = next( cur );
    } // if( !finish( cur ) ) { } else {
    
  } // while( curLength>=0 ) {
  
  return *this;
}
VideoControls::VideoControls(QWidget *parent) : QFrame (parent) {
    setEnabled(false);
    m_isTracking = false;
    m_isPlaying = false;
    m_autoHide = false;

    m_hbox = new QHBoxLayout(this);
    m_hbox->setSizeConstraint(QLayout::SetMinimumSize);
    m_hbox->setContentsMargins(0,0,0,0);
    m_hbox->setSpacing(4);
    
    m_prevButton = new QToolButton(this);
    m_hbox->addWidget(m_prevButton);
    m_prevButton->setFixedSize(24, 24);
    m_prevButton->setAutoRaise(true);
    m_prevButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekBackward));
	m_prevButton->setAutoRepeat(true);
	m_prevButton->setAutoRepeatInterval(1000/50); 

    m_playButton = new QToolButton(this);;
    m_hbox->addWidget(m_playButton);
    m_playButton->setFixedSize(24, 24);
    m_playButton->setAutoRaise(true);
    m_playButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaPlay));

    m_nextButton = new QToolButton(this);;
    m_hbox->addWidget(m_nextButton);
    m_nextButton->setFixedSize(24, 24);
    m_nextButton->setAutoRaise(true);
    m_nextButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_MediaSeekForward));
	m_nextButton->setAutoRepeat(true);
	m_nextButton->setAutoRepeatInterval(1000/50); 

    m_frameSlider = new QSlider(this);
    m_hbox->addWidget(m_frameSlider);
    m_frameSlider->setMinimumHeight(24);
    m_frameSlider->setRange(0,0);
    m_frameSlider->setFocusPolicy(Qt::NoFocus);
    m_frameSlider->setOrientation(Qt::Horizontal);
    m_frameSlider->setTracking(false);

    m_frameEdit = new QSpinBox(this);
    m_hbox->addWidget(m_frameEdit);
    m_frameEdit->setMinimumHeight(24);
    m_frameEdit->setRange(0,0);
    m_frameEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
    m_frameEdit->setAlignment(Qt::AlignCenter);
    m_frameEdit->setKeyboardTracking(false);

    connect(m_prevButton, SIGNAL(clicked()), this, SIGNAL(stepBack()));
    connect(m_playButton, SIGNAL(clicked()), this, SLOT(toogle()));
    connect(m_nextButton, SIGNAL(clicked()), this, SIGNAL(stepForward()));

    connect(m_frameSlider, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
    connect(m_frameSlider, SIGNAL(sliderMoved(int)), this, SIGNAL(currentFrameTracked(int)));
    connect(m_frameSlider, SIGNAL(sliderPressed()), this, SLOT(handleSliderPressed()));
    connect(m_frameSlider, SIGNAL(sliderReleased()), this, SLOT(handleSliderReleased()));

    connect(m_frameEdit, SIGNAL(valueChanged(int)), this, SIGNAL(currentFrameChanged(int)));
}
Beispiel #3
0
//
// Bresenham's line algorithm
//
//void draw2d(int x0, int y0, int x1, int y1)
void draw2d(s16 gotoX, s16 gotoY)
{
    s16 xNow = posX;
    s16 yNow = posY;
    int dx = abs(gotoX - xNow), sx = xNow < gotoX ? 1 : -1;
    int dy = abs(gotoY - yNow), sy = yNow < gotoY ? 1 : -1; 
    int err = (dx>dy ? dx : -dy)/2, e2;


    //int limit;
    //for(limit = 0; limit < 20; limit++)
    for(;;)
    {
        //STEPSTRING(StrNow);
        //uart_send_u16(xNow);
        //uart_send_buffered(':');
        //uart_send_u16(yNow);
        //uart_send_buffered(' ');

        //STEPSTRING(StrGoto);
        //uart_send_u16(gotoX);
        //uart_send_buffered(':');
        //uart_send_u16(gotoY);
        //uart_send_buffered(' ');

        //stepReportAxes();
        while (xNow > posX)
        {
            stepRight();
        }

        while (xNow < posX)
        {
            stepLeft();
        }

        while (yNow > posY)
        {
            stepForward();
        }
        
        while (yNow < posY)
        {
            stepBack();
        }

        if (posX == gotoX && posY == gotoY)
        {
            break;
        }


        e2 = err;
        if (e2 >-dx) { err -= dy; xNow += sx; }
        if (e2 < dy) { err += dx; yNow += sy; }
    }
}
SWizard::SWizard(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SWizard)
{
    ui->setupUi(this);
    connect(ui->buttonNext, SIGNAL(clicked()),
            this, SLOT(stepNext()));
    connect(ui->buttonBack, SIGNAL(clicked()),
            this, SLOT(stepBack()));
}
Beispiel #5
0
ClientInfo::ClientInfo( QWidget *parent, const char *name ) :
    ClientInfoBase( parent, name ), socket( 0 )
{
    edHost->setText( "localhost" );
    edPort->setText( QString::number( (uint)infoPort ) );

    connect( infoList, SIGNAL(selected(const QString&)), SLOT(selectItem(const QString&)) );
    connect( btnConnect, SIGNAL(clicked()), SLOT(connectToServer()) );
    connect( btnBack, SIGNAL(clicked()), SLOT(stepBack()) );
    connect( btnQuit, SIGNAL(clicked()), qApp, SLOT(quit()) );
}
Beispiel #6
0
JNIEXPORT void JNICALL Java_com_bullet_DemoLib_stepBack(JNIEnv * env, jobject obj, jint width, jint height)
{
	stepBack(width, height);
}
void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
{
	(void)x;
	(void)y;

	m_lastKey = 0;

#ifndef BT_NO_PROFILE
	if (key >= 0x31 && key <= 0x39)
	{
		int child = key-0x31;
		m_profileIterator->Enter_Child(child);
	}
	if (key==0x30)
	{
		m_profileIterator->Enter_Parent();
	}
#endif //BT_NO_PROFILE

	switch (key) 
	{
	case 'q' : 
#ifdef BT_USE_FREEGLUT
		//return from glutMainLoop(), detect memory leaks etc.
		glutLeaveMainLoop();
#else
		exit(0);
#endif
		break;

	case 'l' : stepLeft(); break;
	case 'r' : stepRight(); break;
	case 'f' : stepFront(); break;
	case 'b' : stepBack(); break;
	case 'z' : zoomIn(); break;
	case 'x' : zoomOut(); break;
	case 'i' : toggleIdle(); break;
	case 'g' : m_enableshadows=!m_enableshadows;break;
	case 'u' : m_shapeDrawer->enableTexture(!m_shapeDrawer->enableTexture(false));break;
	case 'h':
		if (m_debugMode & btIDebugDraw::DBG_NoHelpText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoHelpText);
		else
			m_debugMode |= btIDebugDraw::DBG_NoHelpText;
		break;

	case 'w':
		if (m_debugMode & btIDebugDraw::DBG_DrawWireframe)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawWireframe);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawWireframe;
		break;

	case 'p':
		if (m_debugMode & btIDebugDraw::DBG_ProfileTimings)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_ProfileTimings);
		else
			m_debugMode |= btIDebugDraw::DBG_ProfileTimings;
		break;

	case '=':
		{
			int maxSerializeBufferSize = 1024*1024*5;
			btDefaultSerializer*	serializer = new btDefaultSerializer(maxSerializeBufferSize);
			//serializer->setSerializationFlags(BT_SERIALIZE_NO_DUPLICATE_ASSERT);
			m_dynamicsWorld->serialize(serializer);
			FILE* f2 = fopen("testFile.bullet","wb");
			fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1,f2);
			fclose(f2);
			delete serializer;
			break;

		}

	case 'm':
		if (m_debugMode & btIDebugDraw::DBG_EnableSatComparison)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableSatComparison);
		else
			m_debugMode |= btIDebugDraw::DBG_EnableSatComparison;
		break;

	case 'n':
		if (m_debugMode & btIDebugDraw::DBG_DisableBulletLCP)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DisableBulletLCP);
		else
			m_debugMode |= btIDebugDraw::DBG_DisableBulletLCP;
		break;

	case 't' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawText);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawText;
		break;
	case 'y':		
		if (m_debugMode & btIDebugDraw::DBG_DrawFeaturesText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawFeaturesText);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawFeaturesText;
		break;
	case 'a':	
		if (m_debugMode & btIDebugDraw::DBG_DrawAabb)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawAabb);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawAabb;
		break;
	case 'c' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawContactPoints);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawContactPoints;
		break;
	case 'C' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawConstraints)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawConstraints);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawConstraints;
		break;
	case 'L' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawConstraintLimits)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawConstraintLimits);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawConstraintLimits;
		break;

	case 'd' : 
		if (m_debugMode & btIDebugDraw::DBG_NoDeactivation)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoDeactivation);
		else
			m_debugMode |= btIDebugDraw::DBG_NoDeactivation;
		if (m_debugMode & btIDebugDraw::DBG_NoDeactivation)
		{
			gDisableDeactivation = true;
		} else
		{
			gDisableDeactivation = false;
		}
		break;




	case 'o' :
		{
			m_ortho = !m_ortho;//m_stepping = !m_stepping;
			break;
		}
	case 's' : clientMoveAndDisplay(); break;
		//    case ' ' : newRandom(); break;
	case ' ':
		clientResetScene();
		break;
	case '1':
		{
			if (m_debugMode & btIDebugDraw::DBG_EnableCCD)
				m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableCCD);
			else
				m_debugMode |= btIDebugDraw::DBG_EnableCCD;
			break;
		}

	case '.':
		{
			shootBox(getRayTo(x,y));//getCameraTargetPosition());
			break;
		}

	case '+':
		{
			m_ShootBoxInitialSpeed += 10.f;
			break;
		}
	case '-':
		{
			m_ShootBoxInitialSpeed -= 10.f;
			break;
		}

	default:
		//        std::cout << "unused key : " << key << std::endl;
		break;
	}

	if (getDynamicsWorld() && getDynamicsWorld()->getDebugDrawer())
		getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode);

	

}
/*!

*/
void
LogPlayerToolBar::createControls( LogPlayer * log_player,
                                  QMainWindow * main_win )
{
    // visible actions
    {
        QAction * act
            = new QAction( QIcon( QPixmap( rew_xpm ) ),
                           tr( "Rewind" ), this );
#ifdef Q_WS_MAC
        act->setShortcut( Qt::META + Qt::Key_Down );
#else
        act->setShortcut( Qt::CTRL + Qt::Key_Down );
#endif
        act->setStatusTip( tr( "Rewind the log player.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( accelerateBack() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( rev_xpm ) ),
                           tr( "Play Backward" ), this );
        act->setShortcut( Qt::Key_Down );
        act->setStatusTip( tr( "Play backward the log player.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( playBack() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( minus_xpm ) ),
                           tr( "Step Back" ), this );
        act->setShortcut( Qt::Key_Left );
        act->setStatusTip( tr( "One step back the log player.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( stepBack() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( stop_xpm ) ),
                           tr( "Play/Stop" ), this );
        act->setShortcut( Qt::Key_Space );
        act->setStatusTip( tr( "Play/Stop the log player. (" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( playOrStop() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( plus_xpm ) ),
                           tr( "Step Forward" ), this );
        act->setShortcut( Qt::Key_Right );
        act->setStatusTip( tr( "One step forward the log player. (" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( stepForward() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( play_xpm ) ),
                           tr( "Play Forward" ), this );
        act->setShortcut( Qt::Key_Up );
        act->setStatusTip( tr( "Play forward the log player.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( playForward() ) );
        this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( QIcon( QPixmap( ff_xpm ) ),
                           tr( "Fast Forward" ), this );
#ifdef Q_WS_MAC
        act->setShortcut( Qt::META + Qt::Key_Up );
#else
        act->setShortcut( Qt::CTRL + Qt::Key_Up );
#endif
        act->setStatusTip( tr( "Fast forward the log player.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( accelerateForward() ) );
        this->addAction( act );
        main_win->addAction( act );
    }

    this->addSeparator();


    // invisible actions
    {
        QAction * act
            = new QAction( //QIcon( QPixmap( go_first_xpm ) ),
                           tr( "Go first" ), this );
        act->setShortcut( Qt::Key_Home );
        act->setStatusTip( tr( "Go to the first.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( goToFirst() ) );
        //this->addAction( act );
        main_win->addAction( act );
    }
    {
        QAction * act
            = new QAction( //QIcon( QPixmap( go_last_xpm ) ),
                           tr( "Go last" ), this );
        act->setShortcut( Qt::Key_End );
        act->setStatusTip( tr( "Go to the last.(" )
                           + act->shortcut().toString() + tr( ")" ) );
        connect( act, SIGNAL( triggered() ),
                 log_player, SLOT( goToLast() ) );
        //this->addAction( act );
        main_win->addAction( act );
    }
}
Beispiel #9
0
MainWindow::MainWindow() {
    setupUi(this);
    m_dirty = false;

    m_logWindow->setVisible(false);
    m_imageView->setFocus();
    m_imageView->setHandler(this);

    ParamGroup *g, *gg;

    new ParamChoice(this, "output", "edges", "edges|fill|fill+edges", &output);
    new ParamChoice(this, "input_gamma", "linear-rgb", "srgb|linear-rgb", &input_gamma);

    g = new ParamGroup(this, "structure_tensor");
    new ParamChoice(g, "st_type", "scharr-lab", "central-diff|sobel-rgb|sobel-lab|sobel-L|scharr-rgb|scharr-lab|gaussian-deriv|etf-full|etf-xy", &st_type);
    new ParamDouble(g, "sigma_c", 2.28, 0, 20, 0.1, &sigma_c);
    new ParamDouble(g, "precision_sigma_c", sqrt(-2*log(0.05)), 1, 10, 1, &precision_sigma_c);
    new ParamInt   (g, "etf_N", 3, 0, 10, 1, &etf_N);

    g = new ParamGroup(this, "bilateral_filter", false, &enable_bf);
    new ParamChoice(g, "type", "xy", "oa|xy|fbl|full", &filter_type);
    new ParamInt   (g, "n_e",     1, 0, 20, 1, &n_e);
    new ParamInt   (g, "n_a",     4, 0, 20, 1, &n_a);
    new ParamDouble(g, "sigma_dg", 3, 0, 20, 0.05, &sigma_dg);
    new ParamDouble(g, "sigma_dt", 3, 0, 20, 0.05, &sigma_dt);
    new ParamDouble(g, "sigma_rg", 4.25, 0, 100, 0.05, &sigma_rg);
    new ParamDouble(g, "sigma_rt", 4.25, 0, 100, 0.05, &sigma_rt);
    new ParamDouble(g, "bf_alpha", 0, 0, 10000, 1, &bf_alpha);
    new ParamDouble(g, "precision_g", 2, 1, 10, 1, &precision_g);
    new ParamDouble(g, "precision_t", 2, 1, 10, 1, &precision_t);

    g = new ParamGroup(this, "dog");
    ParamGroup* dog_group = g;
    connect(g, SIGNAL(dirty()), SLOT(dogChanged()));

    new ParamChoice(g, "type", "flow-based", "isotropic|flow-based", &dog_type);
    new ParamDouble(g, "sigma_e", 1.4, 0, 20, 0.005, &sigma_e);
    new ParamDouble(g, "dog_k", 1.6, 1, 10, 0.01, &dog_k);
    new ParamDouble(g, "precision_e", 3, 1, 5, 0.1, &precision_e);
    new ParamDouble(g, "sigma_m", 4.4, 0, 20, 1, &sigma_m);
    new ParamDouble(g, "precision_m", 2, 1, 5, 0.1, &precision_m);
    new ParamDouble(g, "step_m", 1, 0.01, 2, 0.1, &step_m);

    new ParamChoice(g, "adj_func", "smoothstep", "smoothstep|tanh", &dog_adj_func);
    new ParamBool  (g, "dog_reparam", true, &dog_reparam);
    gg = new ParamGroup(g, "", true);
    dog_tau_g = gg;
    dog_eps_ptr = new ParamDouble(gg, "epsilon", 3.50220, -100, 100, 0.005, &dog_eps);
    dog_tau_ptr = new ParamDouble(gg, "tau", 0.95595, 0, 2, 0.005, &dog_tau);
    dog_phi_ptr = new ParamDouble(gg, "phi", 0.3859, 0, 1e32, 0.1, &dog_phi);

    gg = new ParamGroup(g, "", false);
    dog_p_g = gg;
    dog_p_ptr     = new ParamDouble(gg, "p", 21.7, 0, 1e6, 1, &dog_p);
    dog_eps_p_ptr = new ParamDouble(gg, "epsilon_p", 79.5, -1e32, 1e32, 0.5, &dog_eps_p);
    dog_phi_p_ptr = new ParamDouble(gg, "phi_p", 0.017, -1e32, 1e32, 0.05, &dog_phi_p);

    new ParamChoice(g, "dog_fgauss", "euler", "euler|rk2-nn|rk2|rk4", &dog_fgauss);

    g = new ParamGroup(this, "quantization", false, &quantization);
    new ParamChoice(g, "quant_type", "adaptive", "fixed|adaptive", &quant_type);
    new ParamInt   (g, "nbins", 8, 1, 255, 1, &nbins);
    new ParamDouble(g, "phi_q", 2, 0, 100, 0.025, &phi_q);
    new ParamDouble(g, "lambda_delta", 0, 0, 100, 1, &lambda_delta);
    new ParamDouble(g, "omega_delta", 2, 0, 100, 1, &omega_delta);
    new ParamDouble(g, "lambda_phi", 0.9, 0, 100, 1, &lambda_phi);
    new ParamDouble(g, "omega_phi", 1.6, 0, 100, 1, &omega_phi);

    g = new ParamGroup(this, "warp_sharp", false, &warp_sharp);
    new ParamDouble(g, "sigma_w", 1.5, 0, 20, 1, &sigma_w);
    new ParamDouble(g, "precision_w", 2, 1, 5, 0.1, &precision_w);
    new ParamDouble(g, "phi_w", 2.7, 0, 100, 0.025, &phi_w);

    g = new ParamGroup(this, "final_smooth", true, &final_smooth);
    new ParamChoice(g, "type", "flow-nearest", "3x3|5x5|flow-nearest|flow-linear", &final_type);
    new ParamDouble(g, "sigma_a", 1.0, 0, 10, 1, &sigma_a);

    QScrollArea *sa = new QScrollArea(this);
    QWidget *parea = new QWidget(sa);
    sa->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
    sa->setFixedWidth(300);
    sa->setWidget(parea);
    sa->setFrameStyle(QFrame::NoFrame);
    sa->setFocusPolicy(Qt::NoFocus);
    sa->setWidgetResizable(true);
    sa->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    m_vbox1->addWidget(sa);

    m_paramui = new ParamUI(parea, this);
    QVBoxLayout *pbox = new QVBoxLayout(parea);
    pbox->setContentsMargins(4,4,4,4);
    pbox->addWidget(m_paramui);
    pbox->addStretch(0);

    connect(m_select, SIGNAL(currentIndexChanged(int)), this, SLOT(onIndexChanged(int)));

    m_player = new VideoPlayer(this, ":/test.png");
    connect(m_player, SIGNAL(videoChanged(int)), this, SLOT(onVideoChanged(int)));
    connect(m_player, SIGNAL(currentFrameChanged(int)), this, SLOT(setDirty()));
    connect(m_player, SIGNAL(outputChanged(const QImage&)), m_imageView, SLOT(setImage(const QImage&)));
    connect(this, SIGNAL(imageChanged(const QImage&)), m_player, SLOT(setOutput(const QImage&)));

    m_videoControls->setFrameStyle(QFrame::NoFrame);
    m_videoControls->setAutoHide(true);
    connect(m_videoControls, SIGNAL(stepForward()), m_player, SLOT(stepForward()));
    connect(m_videoControls, SIGNAL(stepBack()), m_player, SLOT(stepBack()));
    connect(m_videoControls, SIGNAL(currentFrameTracked(int)), m_player, SLOT(setCurrentFrame(int)));
    connect(m_videoControls, SIGNAL(playbackChanged(bool)), m_player, SLOT(setPlayback(bool)));
    connect(m_videoControls, SIGNAL(trackingChanged(bool)), this, SLOT(setDirty()));

    connect(m_player, SIGNAL(videoChanged(int)), m_videoControls, SLOT(setFrameCount(int)));
    connect(m_player, SIGNAL(playbackChanged(bool)), m_videoControls, SLOT(setPlayback(bool)));
    connect(m_player, SIGNAL(currentFrameChanged(int)), m_videoControls, SLOT(setCurrentFrame(int)));
}
Beispiel #10
0
void OpenGL2Renderer::keyboardCallback(unsigned char key)
{


	switch (key) 
	{

	case 'l' : stepLeft(); break;
	case 'r' : stepRight(); break;
	case 'f' : stepFront(); break;
	case 'b' : stepBack(); break;
	case 'z' : zoomIn(); break;
	case 'x' : zoomOut(); break;

	case 'g' : m_enableshadows=!m_enableshadows;break;
	case 'u' : m_shapeDrawer->enableTexture(!m_shapeDrawer->enableTexture(false));break;

	case 'h':
		if (m_debugMode & btIDebugDraw::DBG_NoHelpText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoHelpText);
		else
			m_debugMode |= btIDebugDraw::DBG_NoHelpText;
		break;

	case 'w':
		if (m_debugMode & btIDebugDraw::DBG_DrawWireframe)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawWireframe);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawWireframe;
		break;


	

	case 'm':
		if (m_debugMode & btIDebugDraw::DBG_EnableSatComparison)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_EnableSatComparison);
		else
			m_debugMode |= btIDebugDraw::DBG_EnableSatComparison;
		break;

	case 'n':
		if (m_debugMode & btIDebugDraw::DBG_DisableBulletLCP)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DisableBulletLCP);
		else
			m_debugMode |= btIDebugDraw::DBG_DisableBulletLCP;
		break;
    case 'N':
		if (m_debugMode & btIDebugDraw::DBG_DrawNormals)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawNormals);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawNormals;
		break;

	case 't' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawText);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawText;
		break;
	case 'y':		
		if (m_debugMode & btIDebugDraw::DBG_DrawFeaturesText)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawFeaturesText);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawFeaturesText;
		break;
	case 'a':	
		if (m_debugMode & btIDebugDraw::DBG_DrawAabb)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawAabb);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawAabb;
		break;
	case 'c' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawContactPoints)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawContactPoints);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawContactPoints;
		break;
	case 'C' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawConstraints)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawConstraints);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawConstraints;
		break;
	case 'L' : 
		if (m_debugMode & btIDebugDraw::DBG_DrawConstraintLimits)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_DrawConstraintLimits);
		else
			m_debugMode |= btIDebugDraw::DBG_DrawConstraintLimits;
		break;

	case 'd' : 
		if (m_debugMode & btIDebugDraw::DBG_NoDeactivation)
			m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoDeactivation);
		else
			m_debugMode |= btIDebugDraw::DBG_NoDeactivation;
		if (m_debugMode & btIDebugDraw::DBG_NoDeactivation)
		{
			gDisableDeactivation = true;
		} else
		{
			gDisableDeactivation = false;
		}
		break;



	case 'o' :
		{
			m_ortho = !m_ortho;//m_stepping = !m_stepping;
			break;
		}

	default:
		//        std::cout << "unused key : " << key << std::endl;
		break;
	}
	

}