void phtog(int flag = 1) { // This is an auxiliary macro giving functions to the very // small buttons in phgeom. If flag = 1, toggle between black // and white screen; if flag = 2, toggle default (filling 3d // view) vs. undistorted (same x, y, z scale) views; if flag // = 3, toggle normal view vs. 2x scale (enlarges rotator box too). // The toggles bw, fv and x2 are defined in the calling program // so they will not be reinitialized. Several variables are // defined in the calling macro (scoped inward). DMcL 1/Sep/97 // // These procedural subroutines are brought into CINT via // .L and are separately coded because of the error message // "Limitation: Can not define body of function in temp file..." // one gets from CINT if an in-line C routine or C++ class is // attempted. There seems to be little documentation on this. c1->cd(); // Screen color toggle if (flag == 1) { if (bw == 0) c1->SetFillColor(1); if (bw == 1) c1->SetFillColor(10); if (bw == 2) c1->SetFillColor(132); if (++bw >= 3) bw = 0; } // View undistorted toggle if (flag == 2) // min[3], mins[3], max[3], maxs[3] defined in caller { Float_t rmin = 0.0; Float_t rmax = 0.0; int i; TView *view = c1->GetTView(); if (fv) { fv = 0; view->SetRange(mins,maxs); } else { fv = 1; view->GetRange(min,max); for (i = 0; i < 3; i++) { mins[i] = min[i]; maxs[i] = max[i]; if (rmin > min[i]) rmin = min[i]; if (rmax < max[i]) rmax = max[i]; }; for (i = 0; i < 3; i++) { min[i] = rmin; max[i] = rmax; }; view->SetRange(min,max); } } // Double view size toggle if (flag == 3) { if (x2) { x2 = 0; c1->Range(-1.0,-1.0,1.0,1.0); } else { x2 = 1; c1->Range(-0.5,-0.5,0.5,0.5); } } c1->Draw(); c1->Update(); }