Changeset 1933 in Sophya
- Timestamp:
- Mar 13, 2002, 11:28:09 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI/Tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Tests/midasitt.cc
r1128 r1933 25 25 26 26 #include "pisurfdr.h" 27 #include "piyfxdrw.h" 27 28 28 29 // ---------- classe PITApp ----------------------- … … 98 99 PIColor col; // Les couleurs PI sont des entiers de 0 a 65535 (16 bits) 99 100 for(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); 103 104 midas_cmap.AllocColor(col, kc); 104 105 } … … 186 187 187 188 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); 190 191 nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin); 191 192 PIWindow* wp = new PIWindow(this, strg, PIWK_normal, 300, 300, 150, 150); … … 214 215 PIYfXDrawer* mxyd = new PIYfXDrawer( new P1DAdapter<float>(vpx, 30, true), 215 216 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); 218 219 219 220 nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin); … … 241 242 new P1DAdapter<float>(vpy, 30, true), true); 242 243 243 mxyd-> SetColAtt(PI_Magenta);244 mxyd-> SetMarkerAtt(7, PI_FBoxMarker);244 mxyd->GetGraphicAtt().SetColAtt(PI_Magenta); 245 mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FBoxMarker); 245 246 246 247 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); 249 250 250 251 nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin); … … 404 405 PIWindow* awp = new PIWindow(this, strg, PIWK_normal, 500, 500, 200, 200); 405 406 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); 409 410 fgswcol++; 410 411 PIDraw3DWdg* drw3 = new PIDraw3DWdg(awp, "ex3ddrw", 600, 600, 0, 0); -
trunk/SophyaPI/PI/Tests/pit1.cc
r1563 r1933 15 15 #include "parradapter.h" 16 16 17 #include "piyfxdrw.h" 17 18 18 19 /* Exemple d'utilisation PIBaseWdg - Creation d'une nouvelle composante graphique */ … … 261 262 // Creation et ajout d'un drawer de fonctions 262 263 PIFuncDrawer* mfd = new PIFuncDrawer(fpol); 263 mfd-> SetColAtt(PI_Blue);264 mfd-> SetLineAtt(PI_NormalLine);264 mfd->GetGraphicAtt().SetColAtt(PI_Blue); 265 mfd->GetGraphicAtt().SetLineAtt(PI_NormalLine); 265 266 AddScDrawer(mfd,true); 266 267 … … 268 269 PIYfXDrawer* mxyd = new PIYfXDrawer(new P1DAdapter<float>(xpts, 10, false), 269 270 new P1DAdapter<float>(ypts, 10, false), true); 270 mxyd-> SetColAtt(PI_Magenta);271 mxyd-> SetMarkerAtt(7, PI_FBoxMarker);271 mxyd->GetGraphicAtt().SetColAtt(PI_Magenta); 272 mxyd->GetGraphicAtt().SetMarkerAtt(7, PI_FBoxMarker); 272 273 AddScDrawer(mxyd, true); 273 274 274 275 // Ajout de texte 275 BaseDrawer()-> SetFontAtt(PI_NormalSizeFont, PI_BoldFont);276 BaseDrawer()->GetGraphicAtt().SetFontAtt(PI_NormalSizeFont, PI_BoldFont); 276 277 BaseDrawer()->ElAddText(-2.8, 12., "---- ScSample ----", PI_Red); 277 278 BaseDrawer()->ElAddText(-2.8, 10., "f(x)=0.3*x^3-x^2+7.", PI_Red); -
trunk/SophyaPI/PI/Tests/xp3.cc
r714 r1933 24 24 25 25 #include "pisurfdr.h" 26 #include "piyfxdrw.h" 26 27 27 28 … … 144 145 new P1DAdapter<float>(vpy, 30, true), true); 145 146 // 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); 148 149 149 150 // Using PIFuncDrawer and changing its attributes 150 151 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); 153 154 154 155 nbwin++; sprintf(strg,"2D Graphics (PI W %d)", nbwin); … … 178 179 new P2DAdapter<float>(tf, 50, 50, true), true, true, true); 179 180 // 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); 183 184 fgswcol++; 184 185 // Creating a 3D Widget (managing 3D-Drawers, rotation , ... )
Note:
See TracChangeset
for help on using the changeset viewer.