Changeset 111 in Sophya for trunk/SophyaPI/PI/pipixmapgen.cc


Ignore:
Timestamp:
Jun 18, 1998, 7:46:10 PM (27 years ago)
Author:
ansari
Message:

Modifs pour les drawers - Utilisation des Drawers ds PIImage,
Introduction des fichiers pour le dessin 3D Reza 18/06/98

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pipixmapgen.cc

    r71 r111  
    2121mPpos[0] = mPpos[0] = 0;
    2222cmap = new PIColorMap(CMAP_GREY32);
    23 mEn = 0;
    2423ActivateButton(1);
    2524}
     
    7069
    7170
    72 /* --Methode-- */
    73 int PIPixmapGen::ElAdd(int typ, int x, int y, int dx, int dy, char* s)
    74 {
    75 DrwEl dre;
    76 mEn++;
    77 dre.eid = mEn;  dre.etyp = typ;
    78 dre.ex = x;   dre.ey = y;
    79 dre.edx = dx;  dre.edy = dy;
    80 if (s)  dre.es = s;
    81 mElist.push_back(dre);
    82 return(mEn);
    83 }
    84 
    85 /* --Methode-- */
    86 void  PIPixmapGen::ElDel(int id)
    87 {
    88 DrwElList::iterator it;
    89 for (it = mElist.begin(); it != mElist.end(); it++)
    90   if ( (*it).eid == id) { mElist.erase(it);   break; }
    91 return;
    92 }
    93 
    94 /* --Methode-- */
    95 void  PIPixmapGen::ElDelAll()
    96 {
    97 mElist.erase(mElist.begin(), mElist.end());
    98 return;
    99 }
    100 
    101 /* --Methode-- */
    102 void  PIPixmapGen::DrawElements(PIGraphicGen* g)
    103 {
    104 char* txt;
    105 DrwElList::iterator it;
    106 for (it = mElist.begin(); it != mElist.end(); it++)
    107   {
    108   switch ( (*it).etyp )
    109     {
    110     case PIDEL_Line :
    111       g->DrawLine((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    112       break;
    113     case PIDEL_Text :
    114       txt = (char*) ((*it).es.c_str());
    115       g->DrawString((*it).ex, (*it).ey, txt );
    116       break;
    117     case PIDEL_Rect :
    118       g->DrawBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    119       break;
    120     case PIDEL_FRect :
    121       g->DrawFBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    122       break;
    123     case PIDEL_Circ :
    124       g->DrawCircle((*it).ex, (*it).ey, (*it).edx );
    125       break;
    126     case PIDEL_FCirc :
    127       g->DrawFCircle((*it).ex, (*it).ey, (*it).edx );
    128       break;
    129     default :
    130       break;
    131     }
    132   }
    133 return;
    134 }
    135 
    13671
    13772// Fin des methodes de la classe
Note: See TracChangeset for help on using the changeset viewer.