Changeset 2755 in Sophya for trunk/SophyaPI/PIext/pintuple.cc


Ignore:
Timestamp:
May 23, 2005, 6:33:02 PM (20 years ago)
Author:
ansari
Message:

1/ Correction bug trace des lignes ds PINTuple
2/ Ajout methode IsThreadable() (declaration conformite thread separe pour certaines commandes) ds baseexecut.h .cc (plot2d plot3d ...) , ds pawexecut.cc (n/plot ...) et ds cxxexecutor.h .cc (c++exec c++execfrf ...)
3/ Ajout de ZMutex (et ZSync) pour la gestion des commandes threadable - ds les
executeurs et ds servnobjm.h .cc
4/ bug d'execution en thread identifie et corrige ds nobjmgr.h .cc (ajout des
methodes GetObj_P() GetObjAdapter_P() et ReadObj_P()
5/ Ajout de l'appel a ZSync::NOp() pour eviter les warnings 'unused variable zs ...'

Reza 23 Mai 2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pintuple.cc

    r2690 r2755  
    198198npolyg = 0;
    199199NptDraw = 0;
     200
     201// Mai 2005: Correction bug trace des lignes avec le pts en dehors de la zone (Reza)
     202// flags pour la gestion des points/lignes a tracer
     203bool fgokcurpt = true;  // Point courant dans la zone a tracer
     204bool fgoklastpt = true;   // Le dernier point etait dans la zone a tracer
    200205for (long i=0; i<(long)mNT->NbLines(); i++) {
    201   xl = xp;  yl = yp;
     206  xl = xp;  yl = yp; fgoklastpt = fgokcurpt;
     207
    202208  xp = mNT->GetCell(i, xK);
    203209  yp = mNT->GetCell(i, yK);
    204   if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) )  continue;
    205   nok++;
    206   if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
    207 
    208   NptDraw++;
     210
     211  // Comptage du nombre de pts dans la zone graphique du widget
     212  if ( !((xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2)) )  nok++;
     213  // Gestion des limites a tracer
     214  fgokcurpt = true;
     215  if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) fgokcurpt = false;
     216  else NptDraw++;
     217
    209218// Taille - couleur de marker en fonction du poids
    210   if (wK >= 0) wp = mNT->GetCell(i, wK);
    211   if (mrkSzScale && (wK >= 0)) {  // Changement de taille
     219  if ( fgokcurpt &&(wK >= 0) ) wp = mNT->GetCell(i, wK);
     220  if ( fgokcurpt && mrkSzScale && (wK >= 0) ) {  // Changement de taille
    212221    sz = (int)((wp-wMin)/dw);
    213222    if (sz < 0) sz = 0;
     
    218227  }
    219228// Couleur du marker en fonction du poids
    220   if( colorScale && (wK >= 0) && cmap ) {
     229  if( fgokcurpt && colorScale && (wK >= 0) && cmap ) {
    221230    int cid = (int)((wp-wMin)/dwc);
    222231    if (cid < 0) cid = 0;
     
    227236  // Trace d'une ligne reliant les points
    228237  if( connectPts ) {
    229     if((npolyg==0) && (i>0)) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;}
    230     if(npolyg<NMXMULTP_LOCAL)
     238    // On initialise le polygone avec le dernier point, si ce dernier ok
     239    if((npolyg==0) && (i>0) && fgokcurpt) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;}
     240    // On ajoute le point courant au polygone - sauf si celui-ci est vide
     241    if((npolyg<NMXMULTP_LOCAL) && (npolyg>0))
    231242      {xpolyg[npolyg]=xp; ypolyg[npolyg]=yp; npolyg++;}
    232     if(npolyg==NMXMULTP_LOCAL)
     243    // On trace le polygone s'il est plein - ou le point courant en dehors
     244    // (point courant en dehors -> discontinuite de la ligne
     245    if( !fgokcurpt || (npolyg==NMXMULTP_LOCAL) )
    233246      {g->DrawPolygon(xpolyg,ypolyg,npolyg,false); npolyg=0;}
    234247  }
    235248
     249  // Plus rien a faire si point en dehors -- on s'en va
     250  if (!fgokcurpt)  continue;
     251
    236252  // Trace des erreurs selon X et Y
    237   if ( xebK >= 0 ) {
     253  if (xebK >= 0) {
    238254    xer = mNT->GetCell(i, xebK);
    239255    if(xer>0.) g->DrawLine(xp-xer, yp, xp+xer, yp);
    240256  }
    241   if ( yebK >= 0 ) {
     257  if (yebK >= 0) {
    242258    yer = mNT->GetCell(i, yebK);
    243259    if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer);
Note: See TracChangeset for help on using the changeset viewer.