Exemplo n.º 1
0
void CmdTestProgress4::activated(int iMsg)
{
    try
    {
        QMutex mutex;
        mutex.lock();
        unsigned long steps = 50;
        Base::SequencerLauncher* seq = new Base::SequencerLauncher("Starting progress bar", steps);

        for (unsigned long i=0; i<steps;i++)
        {
            QWaitCondition().wait(&mutex, 5);
            if (i == 45) {
                delete seq;
                seq = 0;
            }
            if (seq) {
                seq->next(false);
            }
            Base::SequencerLauncher seq2("Starting second progress bar", steps);
            for (unsigned long j=0; j<steps;j++)
            {
                QWaitCondition().wait(&mutex, (seq ? 5 : 50));
                seq2.next(true);
            }
        }
    }
    catch (...)
    {
    }
}
Exemplo n.º 2
0
void BSplineParameterCorrection::CalcSecondSmoothMatrix(Base::SequencerLauncher& seq)
{
  unsigned long m=0;
  for (unsigned long k=0; k<_usUCtrlpoints; k++)
  {
    for (unsigned long l=0; l<_usVCtrlpoints; l++)
    {
      unsigned long n=0;

      for (unsigned short i=0; i<_usUCtrlpoints; i++)
      {
        for (unsigned short j=0; j<_usVCtrlpoints; j++)
        {
          _clSecondMatrix(m,n) =  _clUSpline.GetIntegralOfProductOfBSplines(i,k,2,2) *
                                  _clVSpline.GetIntegralOfProductOfBSplines(j,l,0,0) +
                                2*_clUSpline.GetIntegralOfProductOfBSplines(i,k,1,1) *
                                  _clVSpline.GetIntegralOfProductOfBSplines(j,l,1,1) +
                                  _clUSpline.GetIntegralOfProductOfBSplines(i,k,0,0) *
                                  _clVSpline.GetIntegralOfProductOfBSplines(j,l,2,2);
          seq.next();
          n++;
        }
      }
      m++;
    }
  }
}