Changeset 2243 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc


Ignore:
Timestamp:
Nov 3, 2002, 10:52:49 PM (23 years ago)
Author:
ansari
Message:

Ajout commande addarc, addarrow, ... , Reza 3/11/2002

File:
1 edited

Legend:

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

    r2231 r2243  
    811811ParseDisplayOption(sop, opts);
    812812PIGraphicAtt gratt(opts);
    813 elmgr->ElAddText(xp,yp,txt.c_str(), gratt);
     813unsigned long tpd = 0;
     814gratt.DecodeTextPosDirAtt(opts, tpd, false);
     815elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd);
    814816eld->Refresh();
    815817}
    816818
    817819/* --Methode-- */
    818 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, string const& sop)
     820void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2,
     821                          string const& sop, bool fgarrow)
    819822{
    820823PIDrawer *eld=CurrentElDrawer();
     
    831834ParseDisplayOption(sop, opts);
    832835PIGraphicAtt gratt(opts);
    833 elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt);
     836if (fgarrow)
     837  elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt);
     838else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt);
    834839eld->Refresh();
    835840}
     
    887892ParseDisplayOption(sop, opts);
    888893PIGraphicAtt gratt(opts);
    889 
    890 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt);
    891 else elmgr->ElAddCirc(xc, yc, r, gratt);
     894if (r < -0.5)
     895  elmgr->ElAddMarker(xc, yc, gratt);
     896else {
     897  if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt);
     898  else elmgr->ElAddCirc(xc, yc, r, gratt);
     899}
     900eld->Refresh();
     901}
     902
     903/* --Methode-- */
     904void PIStdImgApp::AddArc(double x1, double y1, double x2, double y2,
     905                         double x3, double y3, string const& sop, bool fgfill)
     906{
     907PIDrawer *eld=CurrentElDrawer();
     908if (eld == NULL) return;
     909PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
     910PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
     911if ((eld2 == NULL) && (eld3 == NULL)) return;
     912PIElDrwMgr* elmgr = NULL;
     913if (eld2) elmgr = &(eld2->ElDrwMgr());
     914else if (eld3) elmgr = &(eld3->ElDrwMgr());
     915if (elmgr == NULL) return;
     916
     917vector<string> opts;
     918ParseDisplayOption(sop, opts);
     919PIGraphicAtt gratt(opts);
     920if (fgfill)
     921  elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt);
     922else  elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt);
    892923eld->Refresh();
    893924}
Note: See TracChangeset for help on using the changeset viewer.