- Timestamp:
- May 15, 2002, 5:24:19 PM (23 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Makefile
r1904 r2003 89 89 piwdggen.h pimsghandler.h picolist.h 90 90 $(OBJ)pidrawer.o: pidrawer.cc $(INC)machdefs.h \ 91 pidrawer.h pibwdggen.h pisysdep.h piwdgx.h piwdggen.h pimsghandler.h \ 92 picolist.h picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h \ 93 pifontx.h pifontgen.h pigraphuc.h pievthandler.h psfile.h pigratt.h \ 94 pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h pioptmenugen.h \ 95 pimenux.h pimenugen.h piwindowx.h piwindowgen.h picontainerx.h \ 96 picontainergen.h piapplx.h piapplgen.h pimenubarx.h pimenubargen.h \ 97 picons.h pibwdgx.h pigraphps.h 91 $(INC)utilgeom.h pidrawer.h pibwdggen.h \ 92 pisysdep.h piwdgx.h piwdggen.h pimsghandler.h picolist.h picmap.h \ 93 picmapx.h picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h \ 94 pigraphuc.h pievthandler.h psfile.h pigratt.h pidrwtools.h \ 95 pistdwdgx.h pistdwdggen.h pioptmenux.h pioptmenugen.h pimenux.h \ 96 pimenugen.h piwindowx.h piwindowgen.h picontainerx.h picontainergen.h \ 97 piapplx.h piapplgen.h pimenubarx.h pimenubargen.h picons.h pibwdgx.h \ 98 pigraphps.h ucckprot.h 98 99 $(OBJ)pidrawwin.o: pidrawwin.cc pidrawwin.h pisysdep.h \ 99 100 $(INC)machdefs.h piwindowx.h piwindowgen.h \ … … 154 155 pigraphuc.h pisysdep.h pigraphgen.h piwdgx.h piwdggen.h \ 155 156 pimsghandler.h picolist.h picmap.h picmapx.h picmapgen.h pifontx.h \ 156 pifontgen.h 157 pifontgen.h ucckprot.h 157 158 $(OBJ)pigraphx.o: pigraphx.cc pigraphx.h pisysdep.h \ 158 159 $(INC)machdefs.h pigraphgen.h piwdgx.h \ -
trunk/SophyaPI/PI/pidrawer.cc
r1974 r2003 12 12 #include "pidrwtools.h" 13 13 14 #include <math.h> 15 // Pour la declaration de finite() isnan() ... 16 #if defined(SunOS) 17 #include <ieeefp.h> 18 #endif 14 #include "ucckprot.h" 19 15 20 16 //++ … … 128 124 // return; 129 125 // } 130 #if defined(OSF1) || defined(SunOS) || (defined(Linux) && !defined(__KCC__) ) 131 if (! finite(xmin) || !finite(xmax) || !finite(ymin) || !finite(ymax)) {126 127 if (!UC_CheckFinite(xmin, xmax) || !UC_CheckFinite(ymin, ymax)) { 132 128 cerr << "PIDrawer::SetLimits() Error - Non finite value for x/ymin-max ! " << endl; 133 129 return; 134 130 } 135 #endif 131 136 132 if (axrl == kAxeDirLtoR) aXdir = false; 137 133 else if (axrl == kAxeDirRtoL) aXdir = true; 138 134 if (ayud == kAxeDirDownUp) aYdir = false; 139 135 else if (ayud == kAxeDirUpDown) aYdir = true; 136 // cerr << " DBG-SetLimits xmax-xmin= " << xmax-xmin << " xmin,max=" 137 // << xmin << "," << xmax << endl; 138 UC_CheckMinMaxDiff(xmin, xmax); 139 //cerr << " DBG-SetLimits ymax-ymin= " << ymax-ymin << " ymin,max=" 140 // << ymin << "," << ymax << endl; 141 UC_CheckMinMaxDiff(ymin, ymax); 140 142 xMin = xmin; 141 143 xMax = xmax; … … 545 547 PIDrawer::DrawHLabels(PIGraphicUC* g, double y, double xBeg, double xStep, unsigned long just) 546 548 { 547 double fsz = xMajTickLen* 4.;549 double fsz = xMajTickLen*3.5; 548 550 if(axesAFSz) g->SelFontSz(fsz); 549 551 … … 584 586 PIDrawer::DrawVLabels(PIGraphicUC* g, double x, double yBeg, double yStep, unsigned long just) 585 587 { 586 double fsz = xMajTickLen* 4.;588 double fsz = xMajTickLen*3.5; 587 589 if(axesAFSz) g->SelFontSz(fsz); 588 590 -
trunk/SophyaPI/PI/pigraphuc.cc
r2001 r2003 7 7 #include "pigraphuc.h" 8 8 9 #include <math.h> 10 // Pour la declaration de finite() isnan() ... 11 #if defined(SunOS) 12 #include <ieeefp.h> 13 #endif 14 15 //define PETIT_DBLE 1.e-39 16 //define PREC_DBLE 1.e-5 17 //define PROT_DBLE 1.e-19 18 #define PETIT_DBLE 1.e-100 19 // qque probleme sur le trace - J'augmente les marges - Reza 14/5/2002 20 // #define PREC_DBLE 1.e-16 21 #define PREC_DBLE 1.e-14 22 #define PROT_DBLE 1.e-40 9 #include "ucckprot.h" 10 23 11 24 12 //++ … … 178 166 } 179 167 180 double xym; 181 //DBG-REZA cerr << " DBG-SetUCS() xmax-xmin = " << xmax-xmin << " xmin,max=" << xmin << "," << xmax << endl; 182 if ((xmax-xmin) < PREC_DBLE*fabs(xmax+xmin)) { 183 xym = fabs(xmax); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 184 xmax += PREC_DBLE/2.*xym; 185 xmin -= PREC_DBLE/2.*xym; 186 //DBG-REZA cerr << " PIGraphicUC::SetUCS() xmin,max=" << xmin << "," << xmax << " xym=" << xym << endl; 187 } 188 //DBG-REZAcerr << " DBG-SetUCS() ymax-ymin = " << ymax-ymin << " ymin,max=" << ymin << "," << ymax << endl; 189 if ((ymax-ymin) < PREC_DBLE*fabs(ymax+ymin)) { 190 xym = fabs(ymax); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 191 ymax += PREC_DBLE/2.*xym; 192 ymin -= PREC_DBLE/2.*xym; 193 //DBG-REZAcerr << " PIGraphicUC::SetUCS() ymin,max=" << ymin << "," << ymax << " xym=" << xym << endl; 194 } 195 // xym = fabs(xmax+xmin); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 196 // if ((xmax-xmin)/xym < PREC_DBLE) {xmin=xmin-PREC_DBLE/2.*xym; xmax=xmin+PREC_DBLE*xym;} 197 // xym = fabs(ymax+ymin); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 198 // if ((ymax-ymin)/xym < PREC_DBLE) {ymin=ymin-PREC_DBLE/2.*xym; ymax=ymin+PREC_DBLE*xym;} 168 UC_CheckMinMaxDiff(xmin, xmax); 169 UC_CheckMinMaxDiff(ymin, ymax); 170 171 // xym = fabs(xmax+xmin); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 172 // if ((xmax-xmin)/xym < PREC_DBLE) {xmin=xmin-PREC_DBLE/2.*xym; xmax=xmin+PREC_DBLE*xym;} 173 // xym = fabs(ymax+ymin); xym = (xym > PETIT_DBLE) ? xym : PETIT_DBLE; 174 // if ((ymax-ymin)/xym < PREC_DBLE) {ymin=ymin-PREC_DBLE/2.*xym; ymax=ymin+PREC_DBLE*xym;} 199 175 // if (xmax <= xmin || ymax <= ymin) { 200 176 // cerr << "PIGraphicUC::SetUCS() Error - xmax <= xmin || ymax <= ymin ! " << endl; 201 177 // return; 202 178 // } 203 #if defined(OSF1) || defined(SunOS) || (defined(Linux) && !defined(__KCC__) ) 204 if (! finite(xmin) || !finite(xmax) || !finite(ymin) || !finite(ymax)) {179 180 if (!UC_CheckFinite(xmin, xmax) || !UC_CheckFinite(ymin, ymax)) { 205 181 cerr << "PIGraphicUC::SetUCS() Error - Non finite value for x/ymin-max ! " << endl; 206 182 return; 207 183 } 208 #endif 184 209 185 if (axrl == kAxeDirLtoR) aXdir = false; 210 186 else if (axrl == kAxeDirRtoL) aXdir = true; … … 216 192 yMax = ymax; 217 193 218 xScale = xWd/(xMax-xMin); 219 if (xScale < PROT_DBLE) xScale = PROT_DBLE; // Protection 194 xScale = UC_LimitProtectDouble(xWd/(xMax-xMin)); // Protection 220 195 if (aXdir) { 221 196 xScale = -xScale; … … 225 200 xOrg += xW0; 226 201 227 yScale = yWd/(yMax-yMin); 228 if (yScale < PROT_DBLE) yScale = PROT_DBLE; // Protection 202 yScale = UC_LimitProtectDouble(yWd/(yMax-yMin)); // Protection 229 203 if (!aYdir) { 230 204 yScale = -yScale; … … 259 233 xMinLog = (xMin > PETIT_DBLE) ? xMin : ( (1. < xMax/10.) ? 1. : xMax/10.); 260 234 xScaleLog = xWd*(xMax-xMinLog)/(xMax-xMin) / (log10(xMax)-log10(xMinLog)); 261 if (xScaleLog < PROT_DBLE) xScaleLog = PROT_DBLE;// Protection235 xScaleLog = UC_LimitProtectDouble(xScaleLog); // Protection 262 236 if (aXdir) { 263 237 xScaleLog = -xScaleLog; … … 276 250 yMinLog = (yMin > PETIT_DBLE) ? yMin : ( (1. < yMax/10.) ? 1. : yMax/10.); 277 251 yScaleLog = yWd*(yMax-yMinLog)/(yMax-yMin) / (log10(yMax)-log10(yMinLog)); 278 if (yScaleLog < PROT_DBLE) yScaleLog = PROT_DBLE;// Protection252 yScaleLog = UC_LimitProtectDouble(yScaleLog); // Protection 279 253 if (!aYdir) { 280 254 yScaleLog = -yScaleLog; -
trunk/SophyaPI/PI/piscdrawwdg.cc
r1970 r2003 91 91 mBDrw->SetName("AxesDrw"); 92 92 SetLimits(-1.,1.,-1.,1.,kAxeDirLtoR,kAxeDirDownUp); 93 // SetDefaultDrawRectangle(0.12, 0.12, 0.88, 0.88, true); fait par SetAxesFlags() - Reza Mai 2002 93 94 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 94 95 FreeLimits(); 95 96 xEndDrag = yEndDrag = xBegDrag = yBegDrag = 0; 96 SetDefaultDrawRectangle(0.12, 0.12, 0.88, 0.88, true);97 // SetDefaultDrawRectangle(0.12, 0.08, 0.88, 0.92, true);98 97 AddDrawer(mBDrw, true, false, false); 99 98 … … 205 204 } 206 205 206 void 207 PIScDrawWdg::SetAxesFlags(unsigned int flags) 208 { 209 mBDrw->SetAxesFlags(flags); 210 if ((flags & kBoxAxes) == kBoxAxes) 211 SetDefaultDrawRectangle(0.13, 0.09, 0.93, 0.89, true); 212 else 213 SetDefaultDrawRectangle(0.06, 0.06, 0.94, 0.94, true); 214 } 215 207 216 int 208 217 PIScDrawWdg::DecodeOptionString(vector<string> & opt, bool rmdecopt) 209 218 { 210 219 if (opt.size() == 0) return(0); 220 unsigned int aflg = BaseDrawer()->GetAxesFlags(); 211 221 int ndec1 = BaseDrawer()->DecodeOptionString(opt, rmdecopt); 222 if (aflg != BaseDrawer()->GetAxesFlags()) 223 SetAxesFlags(BaseDrawer()->GetAxesFlags()); 212 224 vector<string> udopt; 213 225 unsigned int k = 0; -
trunk/SophyaPI/PI/piscdrawwdg.h
r1914 r2003 36 36 virtual void UpdateLimits(); // Calcule et change les limites a partir de Drawer-No-1 37 37 38 inline void SetAxesFlags(unsigned int flags=kBoxAxes | kExtTicks | kLabels)39 { mBDrw->SetAxesFlags(flags); } 38 virtual void SetAxesFlags(unsigned int flags=kBoxAxes | kExtTicks | kLabels); 39 40 40 inline void SetTitles(const char* tt=NULL, const char* tb=NULL) 41 41 { mBDrw->SetTitles(tt, tb); }
Note:
See TracChangeset
for help on using the changeset viewer.