Changeset 1933 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Mar 13, 2002, 11:28:09 PM (24 years ago)
Author:
cmv
Message:

pd de compilation cmv 13/3/2002

Location:
trunk/SophyaPI/PI/Tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Tests/midasitt.cc

    r1128 r1933  
    2525
    2626#include "pisurfdr.h"
     27#include "piyfxdrw.h"
    2728
    2829//  ---------- classe PITApp -----------------------
     
    9899PIColor col;  //  Les couleurs PI sont des entiers de 0 a 65535 (16 bits)
    99100for(int kc=0; kc<rgb_ncol; kc++) {
    100   col.red = rgb_r[kc]*65535;
    101   col.green = rgb_g[kc]*65535;
    102   col.blue = rgb_b[kc]*65535;
     101  col.red   = (short unsigned)(rgb_r[kc]*65535);
     102  col.green = (short unsigned)(rgb_g[kc]*65535);
     103  col.blue  = (short unsigned)(rgb_b[kc]*65535);
    103104  midas_cmap.AllocColor(col, kc);
    104105  }
     
    186187
    187188      PIFuncDrawer* mfd = new PIFuncDrawer(fsinc);
    188       mfd->SetColAtt(PI_Gold);
    189       mfd->SetLineAtt(PI_NormalLine);
     189      mfd->GetGraphicAtt().SetColAtt(PI_Gold);
     190      mfd->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    190191      nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin);
    191192      PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  300, 300, 150, 150);
     
    214215      PIYfXDrawer* mxyd = new   PIYfXDrawer( new P1DAdapter<float>(vpx, 30, true),
    215216                                            new P1DAdapter<float>(vpy, 30, true), true);
    216       mxyd->SetColAtt(PI_Red);
    217       mxyd->SetMarkerAtt(7, PI_FTriangleMarker);
     217      mxyd->GetGraphicAtt().SetColAtt(PI_Red);
     218      mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FTriangleMarker);
    218219
    219220      nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin);
     
    241242                                             new P1DAdapter<float>(vpy, 30, true), true);
    242243
    243       mxyd->SetColAtt(PI_Magenta);
    244       mxyd->SetMarkerAtt(7, PI_FBoxMarker);
     244      mxyd->GetGraphicAtt().SetColAtt(PI_Magenta);
     245      mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FBoxMarker);
    245246
    246247      PIFuncDrawer* mfd = new PIFuncDrawer(fsinc);
    247       mfd->SetColAtt(PI_Blue);
    248       mfd->SetLineAtt(PI_NormalLine);
     248      mfd->GetGraphicAtt().SetColAtt(PI_Blue);
     249      mfd->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    249250
    250251      nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin);
     
    404405      PIWindow* awp = new PIWindow(this, strg, PIWK_normal, 500, 500, 200, 200);
    405406      PISurfaceDrawer* sd = new PISurfaceDrawer(new P2DAdapter<float>(tf, 50, 50, true), true, true, true);
    406       if (fgswcol%3 == 0) sd->SetColMapId(CMAP_COLRJ32);
    407       else if (fgswcol%3 == 1) sd->SetColMapId(CMAP_COLBR32);
    408       else sd->SetColMapId(CMAP_COLRV32);
     407      if (fgswcol%3 == 0) sd->GetGraphicAtt().SetColMapId(CMAP_COLRJ32);
     408      else if (fgswcol%3 == 1) sd->GetGraphicAtt().SetColMapId(CMAP_COLBR32);
     409      else sd->GetGraphicAtt().SetColMapId(CMAP_COLRV32);
    409410      fgswcol++;
    410411      PIDraw3DWdg* drw3 = new PIDraw3DWdg(awp, "ex3ddrw", 600, 600, 0, 0);
  • trunk/SophyaPI/PI/Tests/pit1.cc

    r1563 r1933  
    1515#include "parradapter.h"
    1616
     17#include "piyfxdrw.h"
    1718
    1819/*  Exemple d'utilisation PIBaseWdg - Creation d'une nouvelle composante graphique  */
     
    261262// Creation et ajout d'un drawer de fonctions
    262263PIFuncDrawer* mfd = new PIFuncDrawer(fpol);
    263 mfd->SetColAtt(PI_Blue);
    264 mfd->SetLineAtt(PI_NormalLine);
     264mfd->GetGraphicAtt().SetColAtt(PI_Blue);
     265mfd->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    265266AddScDrawer(mfd,true);
    266267
     
    268269PIYfXDrawer* mxyd = new PIYfXDrawer(new P1DAdapter<float>(xpts, 10, false),
    269270                                    new P1DAdapter<float>(ypts, 10, false), true);
    270 mxyd->SetColAtt(PI_Magenta);
    271 mxyd->SetMarkerAtt(7, PI_FBoxMarker);
     271mxyd->GetGraphicAtt().SetColAtt(PI_Magenta);
     272mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FBoxMarker);
    272273AddScDrawer(mxyd, true);
    273274
    274275// Ajout de texte
    275 BaseDrawer()->SetFontAtt(PI_NormalSizeFont, PI_BoldFont);
     276BaseDrawer()->GetGraphicAtt().SetFontAtt(PI_NormalSizeFont, PI_BoldFont);
    276277BaseDrawer()->ElAddText(-2.8, 12., "---- ScSample ----", PI_Red);
    277278BaseDrawer()->ElAddText(-2.8, 10.,  "f(x)=0.3*x^3-x^2+7.", PI_Red);
  • trunk/SophyaPI/PI/Tests/xp3.cc

    r714 r1933  
    2424
    2525#include "pisurfdr.h"
     26#include "piyfxdrw.h"
    2627
    2728
     
    144145                                  new P1DAdapter<float>(vpy, 30, true), true);
    145146    // Changing graphic attributes for the drawer
    146     mxyd->SetColAtt(PI_Magenta);
    147     mxyd->SetMarkerAtt(7, PI_FBoxMarker);
     147    mxyd->GetGraphicAtt().SetColAtt(PI_Magenta);
     148    mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FBoxMarker);
    148149
    149150    // Using PIFuncDrawer and changing its attributes
    150151    PIFuncDrawer* mfd = new PIFuncDrawer(fsinc);
    151     mfd->SetColAtt(PI_Blue);
    152     mfd->SetLineAtt(PI_NormalLine);
     152    mfd->GetGraphicAtt().SetColAtt(PI_Blue);
     153    mfd->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    153154
    154155    nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin);
     
    178179                  new P2DAdapter<float>(tf, 50, 50, true), true, true, true);
    179180    // Selecting color map
    180     if (fgswcol%3 == 0) sd->SetColMapId(CMAP_COLRJ32);
    181     else if (fgswcol%3 == 1) sd->SetColMapId(CMAP_COLBR32);
    182     else sd->SetColMapId(CMAP_GREY32);
     181    if (fgswcol%3 == 0) sd->GetGraphicAtt().SetColMapId(CMAP_COLRJ32);
     182    else if (fgswcol%3 == 1) sd->GetGraphicAtt().SetColMapId(CMAP_COLBR32);
     183    else sd->GetGraphicAtt().SetColMapId(CMAP_GREY32);
    183184    fgswcol++;
    184185    // Creating a 3D Widget (managing 3D-Drawers, rotation , ... )
Note: See TracChangeset for help on using the changeset viewer.