Changeset 2166 in Sophya
- Timestamp:
- Aug 8, 2002, 1:32:38 PM (23 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piaxes.cc
r2164 r2166 103 103 g->DrawLine(xMin, (yMin+yMax)/2., xMax, (yMin+yMax)/2.); 104 104 g->DrawLine((xMin+xMax)/2., yMin, (xMin+xMax)/2., yMax); 105 105 PIArrowMarker amk = g->GetArrowMarker(); 106 if (amk == PI_NotDefArrowMarker) amk = PI_FArrowShapedArrowMarker; 107 g->SelArrowMarkerSz(xMajTickLen*2., amk); 108 // g->SelArrowMarker(5, g->GetArrowMarker()); 109 double xm2 = g->DeltaUCX(xMax, yMajTickLen*3.); 110 g->DrawArrowMarker(xMax, (yMin+yMax)/2., xm2, (yMin+yMax)/2., true); 111 double ym2 = g->DeltaUCY(yMax, xMajTickLen*3.); 112 g->DrawArrowMarker((xMin+xMax)/2., yMax, (xMin+xMax)/2., ym2, true); 106 113 // La grille en pointilles 107 114 … … 216 223 if (fcol != PI_NotDefColor) g->SelForeground(fcol); 217 224 218 double fy, fh; 219 fh = 0.090*(yMax-yMin); 225 double fx,fy,fh; 220 226 if (flags&kBoxAxes) { 227 fh = -0.090*(yMax-yMin); 221 228 if (g->isAxeYDirUpDown()) fy = yMax; 222 229 else fy = yMin; 223 230 } 224 225 else fy = 0.5*(yMin+yMax); 226 if (g->isAxeYDirUpDown()) fy += fh; 227 else fy -= fh; 228 g->DrawString(xMax-(xMax-xMin)*0.30, fy, xLabel.c_str(), 231 else { 232 fh = 0.04*(yMax-yMin); 233 fy = 0.5*(yMin+yMax); 234 } 235 if (g->isAxeYDirUpDown()) fh = -fh; 236 fy = g->DeltaUCY(fy, fh); 237 fx = g->DeltaUCX(xMax, -(xMax-xMin)*0.25); 238 g->DrawString(fx, fy, xLabel.c_str(), 229 239 PI_HorizontalCenter | PI_VerticalCenter); 230 240 } … … 245 255 if (fcol != PI_NotDefColor) g->SelForeground(fcol); 246 256 247 double fx, fh; 248 fh = 0.125*(xMax-xMin); 249 if (yLabel.length() > 0) { 250 if (flags&kBoxAxes) { 251 if (g->isAxeXDirRtoL()) fx = xMax; 252 else fx = xMin; 253 } 254 else fx = 0.5*(xMin+xMax); 255 if (g->isAxeXDirRtoL()) fx += fh; 256 else fx -= fh; 257 unsigned long txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalUp; 258 if (g->isAxeYDirUpDown()) 259 txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalDown; 260 g->DrawString(fx, yMax-(yMax-yMin)*0.30, yLabel.c_str(), txtflg); 261 } 257 double fx,fy,fh; 258 if (flags&kBoxAxes) { 259 fh = -0.125*(xMax-xMin); 260 if (g->isAxeXDirRtoL()) fx = xMax; 261 else fx = xMin; 262 } 263 else { 264 fh = 0.04*(xMax-xMin); 265 fx = 0.5*(xMin+xMax); 266 } 267 if (g->isAxeXDirRtoL()) fh = -fh; 268 fx = g->DeltaUCX(fx, fh); 269 fy = g->DeltaUCY(yMax,-(yMax-yMin)*0.25); 270 unsigned long txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalUp; 271 if (g->isAxeYDirUpDown()) 272 txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalDown; 273 g->DrawString(fx, fy, yLabel.c_str(), txtflg); 274 262 275 } 263 276 -
trunk/SophyaPI/PI/piaxestools.cc
r2103 r2166 87 87 88 88 int wszx = 6*spx+3.5*bsx; 89 int wszy = 7*bsy+9*spy;89 int wszy = 8*bsy+10*spy; 90 90 SetSize(wszx, wszy); 91 91 … … 125 125 mCkb[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 126 126 mCkb[4]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 127 128 cpx = spx+0.25*bsx; 129 cpy += spy+bsy; 130 mCkb[5] = new PICheckBox(this,"Centerd-Axes", 2005, 1.5*bsx, bsy, cpx, cpy); 131 cpx += 3*spx+1.5*bsx; 132 mCkb[6] = new PICheckBox(this,"Minor-Ticks", 2006, 1.5*bsx, bsy, cpx, cpy); 133 mCkb[5]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 134 mCkb[6]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 135 127 136 128 137 cpy += spy+bsy; … … 176 185 for(i=0;i<2;i++) delete mText[i]; 177 186 for(i=0;i<8;i++) delete mBut[i]; 178 for(i=0;i< 5;i++) delete mCkb[i];187 for(i=0;i<7;i++) delete mCkb[i]; 179 188 delete mOpt; 180 189 } … … 206 215 scd->GetAxesConfig(xa, ya); 207 216 if (xa & kAxeDirRtoL) mCkb[0]->SetState(true); 217 else mCkb[0]->SetState(false); 208 218 if (ya & kAxeDirUpDown) mCkb[1]->SetState(true); 219 else mCkb[1]->SetState(false); 209 220 if (scd->GetAxesFlags() & kGridOn) mCkb[2]->SetState(true); 221 else mCkb[2]->SetState(false); 222 if (scd->GetAxesFlags() & kStdAxes) mCkb[5]->SetState(true); 223 else mCkb[5]->SetState(false); 224 if (scd->GetAxesFlags() & kMinTicks) mCkb[6]->SetState(true); 225 else mCkb[6]->SetState(false); 210 226 mCkb[3]->SetState(scd->isLogScaleX()); 211 227 mCkb[4]->SetState(scd->isLogScaleY()); … … 270 286 scd->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 271 287 unsigned int flags = scd->GetAxesFlags(); 272 if (mCkb[2]->GetState()) scd->SetAxesFlags(flags | kGridOn); 273 else scd->SetAxesFlags(flags & ~kGridOn); 288 289 if (mCkb[2]->GetState()) flags |= kGridOn; 290 else flags &= ~kGridOn; 291 if (mCkb[5]->GetState()) { flags |= kStdAxes; flags &= ~kBoxAxes; } 292 else { flags &= ~kStdAxes; flags |= kBoxAxes; } 293 if (mCkb[6]->GetState()) flags |= kMinTicks; 294 else flags &= ~kMinTicks; 295 296 scd->SetAxesFlags(flags); 297 274 298 scd->SetLogScale(mCkb[3]->GetState(), mCkb[4]->GetState() ); 275 299 -
trunk/SophyaPI/PI/piaxestools.h
r1910 r2166 40 40 PIButton* mBut[8]; 41 41 PIText* mText[2]; 42 PICheckBox* mCkb[ 5];42 PICheckBox* mCkb[7]; 43 43 PIOptMenu * mOpt; 44 44 unsigned short mTypAction; -
trunk/SophyaPI/PI/pieldrw.cc
r2164 r2166 341 341 } 342 342 g->Clip(); 343 g->RestoreGraphicAtt(); 343 344 } 344 345 … … 346 347 void PIElDrawer::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 347 348 { 348 SelGraAtt(g); // DrawAxes change certains attributs graphiques349 SelGraAtt(g); 349 350 DrawAxes(g); // Trace des axes 350 g->SelFont(PI_NormalSizeFont);351 SelGraAtt(g); // DrawAxes change certains attributs graphiques 351 // g->SelFont(PI_NormalSizeFont); 352 352 353 353 354 // Trace des titres … … 360 361 aYdir = false; // Vrai si Axe Y de Haut vers Bas 361 362 double fx, fy, fh; 363 fx = g->DeltaUCX(XMin(), 0.5*(XMax()-XMin())); 364 362 365 // fh = g->GetFontHeightUC(gas, gds); 363 366 fh = 0.075*(YMax()-YMin()); 364 367 if ( titleT.length() > 0) { 365 366 367 g->DrawString((XMax()+XMin())*0.5, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalCenter);368 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh);369 368 if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh); 369 else fy = g->DeltaUCY(YMax(), fh); 370 g->DrawString(fx, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalCenter); 371 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh); 372 } 370 373 if ( titleB.length() > 0) { 371 372 373 374 375 376 g->DrawString((XMax()+XMin())*0.5, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalCenter);377 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh);378 379 SetGraphicAtt(grs); 380 381 374 fx = g->CalcStringWidth(titleB.c_str()); 375 if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.); 376 else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.); 377 if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMax(), fh*1.5); 378 else fy = g->DeltaUCY(YMin(), -fh*1.5); 379 g->DrawString(fx, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalCenter); 380 // printf(" PIElDrawer::Draw()/DBG (%g , %g) %s - %g \n", fx, fy, titleT.c_str(), fh); 381 } 382 SetGraphicAtt(grs); 383 } 384 g->RestoreGraphicAtt(); 382 385 SelGraAtt(g); 383 // Trace des elements386 // Trace des elements 384 387 ElDrwMgr().DrawElements(g, xmin, ymin, xmax, ymax); 385 388 -
trunk/SophyaPI/PI/pigraphuc.cc
r2092 r2166 837 837 double fx, fy; 838 838 DUC2GrC((double)arrsz, (double)arrsz, fx, fy); 839 int asz = int(0.5*(fx+fy+1)); 839 int asz = int(fy+0.5); 840 if (asz < 3) asz = 3; 841 if (asz > 127) asz = 127; 840 842 mGrC->SelArrowMarker(asz, arrmrk); 841 843 }
Note:
See TracChangeset
for help on using the changeset viewer.