void threadCercle::slReussit() { QByteArray baEnvoyer; baEnvoyer.append((char)1); sockClient.write(baEnvoyer); emit(siPoint()); }
cll12_ultimateClick_client::cll12_ultimateClick_client(QWidget *parent) : QMainWindow(parent), ui(new Ui::cll12_ultimateClick_client) { ui->setupUi(this); m_threadCercle = new threadCercle(); m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(m_timer_tick())); m_timer->setInterval(1000); connect(m_threadCercle, SIGNAL(siNouvCercle(int, int, int)), this, SLOT(slNouvCercle(int, int, int))); connect(this, SIGNAL(siReussit()),m_threadCercle,SLOT(slReussit())); connect(m_threadCercle, SIGNAL(siConnecte(QString)), this, SLOT(slConnecte(QString))); connect(m_threadCercle, SIGNAL(siPoint()),this,SLOT(slPoint())); PosX = 0; PosY = 0; Rayon = 0; Commence=false; ui->lblMessage->setText("Utilisez le bouton droit de la souris."); Temps = 0; bPremier = true; Fin = ""; }
bool lmSpherePlaneIntersection(const lmVectorND<T,N> &SphereCenter,const T SphereRadius,const lmVectorND<T,N> &PlanePoint,const lmVectorND<T,N> &PlaneNormal,T *iDist = nullptr,lmVectorND<T,N> *iPoint = nullptr) { T siDist = 0; lmVectorND<T,N> siPoint(lmVectorND<T,N>::NO_INIT); if(lmRayPlaneIntersection(SphereCenter,-1*PlaneNormal,PlanePoint,PlaneNormal,&siDist,&siPoint) && (abs(siDist) <= SphereRadius)) { if(iDist != nullptr) {*iDist = siDist;} if(iPoint != nullptr) {*iPoint = siPoint;} return true; } if(iDist != nullptr) {*iDist = 0;} if(iPoint != nullptr) {*iPoint = lmVectorND<T,N>(lmVectorND<T,N>::NO_INIT);} return false; }