Changeset 2264 in Sophya for trunk/SophyaPI/PI/pieldrw.h


Ignore:
Timestamp:
Nov 15, 2002, 12:54:16 AM (23 years ago)
Author:
ansari
Message:

Ajout gestion trace d'arc specifie avec angle ds PIElDrawer - Reza 14/11/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pieldrw.h

    r2262 r2264  
    88#include "pidrawer.h"
    99
    10 //  Classe avec gestion d une liste d elements a tracer
     10/*  ------------------- Classe PIElDrwMgr ------------------------  */
     11//  Classe avec gerant d une liste d elements a tracer
    1112
    1213class PIElDrwMgr
     
    1718         PIDEL_Circ = 5, PIDEL_FCirc = 6,
    1819         PIDEL_Arc = 7,  PIDEL_FArc = 8,
    19          PIDEL_Poly = 9, PIDEL_FPoly = 10,
    20          PIDEL_Mark = 11, PIDEL_Arrow = 12,
    21          PIDEL_CText = 13  } ;
     20         PIDEL_Arc3P = 9,  PIDEL_FArc3P = 10,
     21         PIDEL_Poly = 11, PIDEL_FPoly = 12,
     22         PIDEL_Mark = 13, PIDEL_Arrow = 14,
     23         PIDEL_CText = 15  } ;
    2224
    2325                PIElDrwMgr();
     
    8890  // ---- Ajout de cercles
    8991  inline int    ElAddCirc(double x, double y, double r, bool fgsc=false)
    90     { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); } 
     92    { PIGraphicAtt gatt;
     93      return( ElAdd(PIDEL_Circ, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 
    9194  inline int    ElAddCirc(double x, double y, double r,
    9295                          PIGraphicAtt const & gatt, bool fgsc=false)
    93     { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); } 
     96    { return( ElAdd(PIDEL_Circ, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 
    9497
    9598  inline int    ElAddFCirc(double x, double y, double r, bool fgsc=false)
    96     { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); } 
     99    { PIGraphicAtt gatt;
     100      return( ElAdd(PIDEL_FCirc, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 
    97101  inline int    ElAddFCirc(double x, double y, double r,
    98102                           PIGraphicAtt const & gatt, bool fgsc=false)
    99     { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); } 
    100 
    101   // ---- Ajout d' arcs
     103    { return( ElAdd(PIDEL_FCirc, x, y, 0., 360., NULL, gatt, 0, fgsc, r) ); } 
     104
     105  // ---- Ajout d' arcs specifies par deux angles
     106  inline int    ElAddArc(double x, double y, double r,
     107                         double a, double da, bool fgsc=false)
     108    { PIGraphicAtt gatt;
     109      return( ElAdd(PIDEL_Arc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 
     110  inline int    ElAddArc(double x, double y, double r, double a, double da,
     111                         PIGraphicAtt const & gatt, bool fgsc=false)
     112    { return( ElAdd(PIDEL_Arc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 
     113
     114  inline int    ElAddFArc(double x, double y, double r,
     115                          double a, double da, bool fgsc=false)
     116    { PIGraphicAtt gatt;
     117      return( ElAdd(PIDEL_FArc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 
     118  inline int    ElAddFArc(double x, double y, double r, double a, double da,
     119                          PIGraphicAtt const & gatt, bool fgsc=false)
     120    { return( ElAdd(PIDEL_FArc, x, y, a, da, NULL, gatt, 0, fgsc, r) ); } 
     121
     122  // ---- Ajout d' arcs specifies par 3 points
    102123  inline int    ElAddArc(double x1, double y1, double x2, double y2,
    103124                         double x3, double y3, bool fgsc=false)
     
    105126      x[0] = x1; x[1] = x2; x[2] = x3;
    106127      y[0] = y1; y[1] = y2; y[2] = y3;
    107       return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); } 
     128      return( ElAdd(PIDEL_Arc3P, x, y, 3, gatt, fgsc) ); } 
    108129
    109130  inline int    ElAddArc(double x1, double y1, double x2, double y2,
     
    112133      x[0] = x1; x[1] = x2; x[2] = x3;
    113134      y[0] = y1; y[1] = y2; y[2] = y3;
    114       return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); } 
     135      return( ElAdd(PIDEL_Arc3P, x, y, 3, gatt, fgsc) ); } 
    115136
    116137  inline int    ElAddFArc(double x1, double y1, double x2, double y2,
     
    119140      x[0] = x1; x[1] = x2; x[2] = x3;
    120141      y[0] = y1; y[1] = y2; y[2] = y3;
    121       return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); } 
     142      return( ElAdd(PIDEL_FArc3P, x, y, 3, gatt, fgsc) ); } 
    122143
    123144  inline int    ElAddFArc(double x1, double y1, double x2, double y2,
     
    126147      x[0] = x1; x[1] = x2; x[2] = x3;
    127148      y[0] = y1; y[1] = y2; y[2] = y3;
    128       return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); } 
     149      return( ElAdd(PIDEL_FArc3P, x, y, 3, gatt, fgsc) ); } 
    129150
    130151  // ---- Ajout de polygones
     
    149170  int                ElAdd(int typ, double x, double y, double dx, double dy,
    150171                           const char* s, PIGraphicAtt const & att,
    151                            unsigned long txtposdir, bool fgsc);
     172                           unsigned long txtposdir, bool fgsc, double r=0.);
    152173  int                ElAdd(double x, double y, const char* s, PIGraphicAtt const & att,
    153174                           const char* s_up, const char* s_dn, PIGraphicAtt const * gass,
     
    169190  struct DrwEl{
    170191    int eid, etyp;
    171     double ex,ey;
     192    double ex,ey,er;
    172193    double edx,edy;
    173194    PIGraphicAtt gatt;
     
    176197    PIGrCoord* ypol;
    177198    int npol;
    178     bool scc;  // true -> scale coordinate (user-coord : 0..1 1
     199    bool scc;  // true -> normalized coordinates ( 0..1 )
    179200  };
    180201
     
    184205 
    185206};
     207
     208/*  ------------------- Classe PIElDrawer ------------------------  */
     209// Classe de Drawer capable de gerer une liste d'elements a tracer
    186210
    187211class PIElDrawer : public PIDrawer
Note: See TracChangeset for help on using the changeset viewer.