Ejemplo n.º 1
0
void Tab::DragLogic::mouseMove(QPoint point)
{

	//if we're not the root card, don't do anything when dragging about inside tab. probably a quicker way of doing this..
	if ( (point.x() > 0)  && (point.x() < _card->width()) && (point.y() > 0) &&
			(point.y() < _card->height()) && _card->inDeck() && !_card->isRootCard())
	{
	return;
	}

	if (!tracking())
	{
		if (abs(_mouseDown.x() - point.x()) > KGlobalSettings::dndEventDelay() ||
				abs(_mouseDown.y() - point.y()) > KGlobalSettings::dndEventDelay())
		{
			_tracking = true;
			if (_card->inDeck() && !_card->isRootCard())
			{
				_card->leaveDeck(false);
				if (_card->isOpen())
				{
					_card->shut();
					_cardWasShutOnDrag = true;
				}

				QPoint p(QCursor::pos());
				ScreenEdge newEdge = _card->edge();
				double position;
				int distanceFromEdge;
				positionForMouse(p, _card->edge(), position, newEdge, distanceFromEdge);

				_card->createDeck(position, newEdge, distanceFromEdge);
			}

		}
	}

	if (tracking())
	{
			QPoint p(QCursor::pos());
			ScreenEdge newEdge = _card->edge();
			double position;
			int distanceFromEdge;
			positionForMouse(p, _card->edge(), position, newEdge, distanceFromEdge);

			_card->setPosition(position, newEdge, distanceFromEdge);
	}
}
Ejemplo n.º 2
0
//int seq_track_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char** argv)
int seq_track_proc_c( int argc, const char** argv)
{
  int step, i, k;

  /*Alloc space*/
  for (i=0; i<4; i++)
    mega[i]=(P *) calloc(sizeof(P),M);

  for (i=0; i<4; i++)
    c4[i]=(corres *) calloc(sizeof(corres),M);

  for (i=0; i<4; i++)
    for (k=0; k<n_img; k++)
      t4[i][k]=(target *) calloc(sizeof (target),M);

  readseqtrackcrit ();
  /*load again first data sets*/
  step = seq_first;
  read_ascii_data(step);
  rotate_dataset();
  read_ascii_data(step+1);
  rotate_dataset();
  read_ascii_data(step+2);

  for(step = (seq_first+2); step < seq_last; step++)
    {
      tracking(/*clientData, interp,*/ argc, argv);
      rotate_dataset();
      write_ascii_data(step-2);
      read_ascii_data(step+1);
    }

  /*write last data_sets*/

  tracking(/*clientData, interp,*/ argc, argv);
  rotate_dataset();
  write_ascii_data(step-2);
  rotate_dataset();
  write_ascii_data(step-1);


  for (i=0; i<4; i++)
    { free (mega[i]);free (c4[i]);
    for (k=0; k<n_img; k++) free (t4[i][k]);
    }

  return 0;
}
Ejemplo n.º 3
0
void view_nested_view()
{
  Kokkos::View<int*,Space> tracking("tracking",1);

  typename Kokkos::View<int*,Space>::HostMirror
     host_tracking = Kokkos::create_mirror( tracking );

  {
    Kokkos::View< NestedView<Space> * , Space > a("a_nested_view",2);

    Kokkos::parallel_for( Kokkos::RangePolicy<Space>(0,2) , NestedViewFunctor<Space>( a , tracking ) );
    Kokkos::deep_copy( host_tracking , tracking );
    ASSERT_EQ( 2 , host_tracking(0) );

    Kokkos::View< NestedView<Space> * , Space > b("b_nested_view",2);
    Kokkos::parallel_for( Kokkos::RangePolicy<Space>(0,2) , NestedViewFunctor<Space>( b , tracking ) );
    Kokkos::deep_copy( host_tracking , tracking );
    ASSERT_EQ( 4 , host_tracking(0) );

  }
  Kokkos::deep_copy( host_tracking , tracking );

#if defined( KOKKOS_USING_EXPERIMENTAL_VIEW )
  ASSERT_EQ( 0 , host_tracking(0) );
#endif

}
Ejemplo n.º 4
0
    boost::asynchronous::any_interruptible interruptible_post_callback(F1&& func,F2&& cb_func, std::string const& task_name="",
                                                                    std::size_t post_prio=0, std::size_t cb_prio=0)
#endif
    {
        typedef decltype(func()) f1_result_type;
        unsigned long connect_id = m_next_helper_id;
        boost::weak_ptr<boost::asynchronous::detail::qt_track> tracking (m_tracking);

        boost::shared_ptr<F2> cbptr(boost::make_shared<F2>(std::forward<F2>(cb_func)));
        boost::shared_ptr<boost::asynchronous::detail::connect_functor_helper> c =
                boost::make_shared<boost::asynchronous::detail::connect_functor_helper>
                (m_next_helper_id,
                 [this,connect_id,cbptr,tracking](QEvent* e)
                 {
                    detail::qt_async_custom_event<boost::asynchronous::expected<f1_result_type> >* ce =
                            static_cast<detail::qt_async_custom_event<boost::asynchronous::expected<f1_result_type> >* >(e);
                    (*cbptr)(std::move(ce->m_future));
                    if (!tracking.expired())
                    {
                        this->m_waiting_callbacks.erase(this->m_waiting_callbacks.find(connect_id));
                    }
                 }
                );
        m_waiting_callbacks[m_next_helper_id] = c;
        ++m_next_helper_id;
        return boost::asynchronous::interruptible_post_callback(
                                        m_worker,
                                        std::forward<F1>(func),
                                        boost::asynchronous::detail::dymmy_weak_qt_scheduler(),
                                        boost::asynchronous::detail::qt_post_helper(c.get()),
                                        task_name,
                                        post_prio,
                                        cb_prio);
    }
Ejemplo n.º 5
0
void QSlider::moveSlider( int pos )
{
    int  a = available();
    int newPos = QMIN( a, QMAX( 0, pos ) );
    int newVal = valueFromPosition( newPos );
    if ( sliderVal != newVal ) {
	sliderVal = newVal;
	emit sliderMoved( sliderVal );
    }
    if ( tracking() && sliderVal != value() ) {
	setValue( sliderVal );
	// ### Why do we emit the valueChanged signal here?  It will get emitted in 
	// valueChange() anyway...
	//emit valueChanged( sliderVal );
    }

    switch ( (GUIStyle)style() ) {
    case WindowsStyle:
	newPos = positionFromValue( newVal );
	break;
    default:
    case MotifStyle:
	break;
    }

    if ( sliderPos != newPos )
	reallyMoveSlider( newPos );
}
void main(){
	
  string name[1]={
  	"Position"
  };
  for(int i=0;i<1;i++) tracking(name[i]);
  
}
int main(){
	
  string name[1]={
  	"Position_Cluster_run017_HVScan_4150V_32GeV_20131017_1254pm_all"
  };
  //for(int i=0;i<1;i++)
  for(int iterNbX=0;iterNbX<=50;iterNbX++)
    for(int iterNbY=0;iterNbY<101;iterNbY++)
    {
     tracking(name[0],iterNbX, iterNbY);
    }
  return 0;
}
Ejemplo n.º 8
0
int Q3Header::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 10)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 10;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 1: *reinterpret_cast< bool*>(_v) = tracking(); break;
        case 2: *reinterpret_cast< int*>(_v) = count(); break;
        case 3: *reinterpret_cast< int*>(_v) = offset(); break;
        case 4: *reinterpret_cast< bool*>(_v) = isMovingEnabled(); break;
        case 5: *reinterpret_cast< bool*>(_v) = isStretchEnabled(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 1: setTracking(*reinterpret_cast< bool*>(_v)); break;
        case 3: setOffset(*reinterpret_cast< int*>(_v)); break;
        case 4: setMovingEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 5: setStretchEnabled(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 9
0
void KstTopLevelView::updateFocus(const QPoint& pos) {
  if (_activeHandler) {
    _activeHandler->updateFocus(this, pos);
    return;  
  }

  if (_mode == DisplayMode || _mode == Unknown || tracking()) {
    return;
  }
  
  //TODO: make this work better with click-select mode
  
  KstViewObjectPtr p = findDeepestChild(pos, false);
  if (p) {
    KstViewObjectPtr p2 = p;
    while (p2->_parent && p2->_parent->_container) {
      p2 = p2->_parent;
    }
    if (p2->_parent && !p2->_parent->_container) {
      p = p2->_parent;
    }
  }
  if (p) {
    if (p->focused()) {
      setCursorFor(pos, p);
      _focusOn = true; // just in case - seems to be false on occasion
      return;
    }
    p->setFocus(true);
    if (_focusOn) { // something else has the focus, clear it
      clearFocus();
    }
    setCursorFor(pos, p);
    KstPainter painter;
    painter.begin(_w);
    painter.setRasterOp(Qt::NotROP);
    painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
    painter.setBrush(Qt::NoBrush);
    p->drawFocusRect(painter);
    painter.end();
    _focusOn = true;
    _hoverFocus = p;
  } else {
    clearFocus();
  }
}
Ejemplo n.º 10
0
/**
 * @brief QKinect::run : fonction executer par QThread
 */
void QKinect::run()
{
    try
    {
        // Initialisation de la Kinect
        qDebug() << "initialization...";
        init();

        // Boucle de capture des données
        qDebug() << "tracking...";
        tracking();
    }
    catch(std::exception& e)
    {
        qDebug() << "Exception: " << e.what();
    }
}
Ejemplo n.º 11
0
	void OperatorControl(void)
	{
		myRobot->SetSafetyEnabled(false);
		
		LEDLights (true); //turn camera lights on
		
		shooterspeedTask->Start((UINT32)this); //start counting shooter speed
		
		kickerTask->Start((UINT32)this); //turns on the kicker task
		
		kicker_in_motion = false;
				
		while (IsOperatorControl() && !IsDisabled())
		{
			
			if (ControllBox->GetDigital(3)) //turn tracking on with switch 3 on controll box
			{ 
				tracking(ControllBox->GetDigital(7));
			}
			else 
			{
				myRobot->TankDrive(leftstick, rightstick); //if tracking is off, enable human drivers
				Wait(0.005);	// wait for a motor update time
			}

			Shooter_onoff=ControllBox->GetDigital(4); //shoot if switch 4 is on
		
			ballgatherer(ControllBox->GetDigital(5), rightstick->GetRawButton(10));
			 
			kicker_onoff=lonelystick->GetRawButton(1);
			
			bridgeboot(ControllBox->GetDigital(6));
			
			kicker_cancel=lonelystick->GetRawButton(2);
			
			//kicker_down=rightstick->GetRawButton(11));
			
		}
		
		
		LEDLights (false);
		shooterspeedTask->Stop();
		kickerTask->Stop();
		ballgatherer(false, false);
		kickermotor->Set(Relay::kOff);
	}
Ejemplo n.º 12
0
void IMFT<Ptr>::setFrame(VecPtr ptrs)
{
    cnt++;
    if(m_isDebug)
        std::cout << "||CNT : " << cnt << " || # of objects : " << ptrs.size() << " || # of tracks : " << m_tracks.size() << " ||" <<std::endl;
    if(cnt > m_nWindow) movingWindow();
    addToDGraph(ptrs);
    tracking();
    if(cnt == m_nWindow) {
        backtracking();
        makeTracks();
    }
    else if(cnt > m_nWindow){
        trackUpdate();
//        setCurrentFrame(cnt);
    }

    setCurrentFrame(cnt);
    confirmDGraph();
}
Ejemplo n.º 13
0
    void post_callback(F1&& func,F2&& cb_func, std::string const& task_name="", std::size_t post_prio=0, std::size_t cb_prio=0)
#endif
    {
        typedef typename ::boost::mpl::eval_if<
            typename boost::asynchronous::detail::has_is_continuation_task<decltype(func())>::type,
            get_continuation_return<decltype(func())>,
            ::boost::mpl::identity<decltype(func())>
        >::type f1_result_type;

        unsigned long connect_id = m_next_helper_id;
        boost::shared_ptr<F2> cbptr(boost::make_shared<F2>(std::forward<F2>(cb_func)));
        boost::weak_ptr<boost::asynchronous::detail::qt_track> tracking (m_tracking);

        boost::shared_ptr<boost::asynchronous::detail::connect_functor_helper> c =
                boost::make_shared<boost::asynchronous::detail::connect_functor_helper>
                (m_next_helper_id,
                 [this,connect_id,cbptr,tracking](QEvent* e)
                 {
                    detail::qt_async_custom_event<boost::asynchronous::expected<f1_result_type> >* ce =
                            static_cast<detail::qt_async_custom_event<boost::asynchronous::expected<f1_result_type> >* >(e);
                    (*cbptr)(std::move(ce->m_future));
                    if (!tracking.expired())
                    {
                        this->m_waiting_callbacks.erase(this->m_waiting_callbacks.find(connect_id));
                    }
                 }
               );

        m_waiting_callbacks[m_next_helper_id] = c;
        ++m_next_helper_id;
        // we want to log if possible
        boost::asynchronous::post_callback(m_worker,
                                        std::forward<F1>(func),
                                        boost::asynchronous::detail::dymmy_weak_qt_scheduler(),
                                        boost::asynchronous::detail::qt_post_helper(c.get()),
                                        task_name,
                                        post_prio,
                                        cb_prio);
    }
Ejemplo n.º 14
0
int main(int argc, char ** argv){
    Tracking tracking(argv[1]);        
    tracking.begin();
}