40 static void setBBoxPars(
const float& sphi,
const float& dphi,
const float& rmin,
const float& rmax,
41 const float& zmin,
const float& zmax, SbBox3f &box, SbVec3f ¢er ) {
44 if (dphi>(2.0*
M_PI*0.99)) {
45 SbVec3f vmin(-rmax,-rmax,zmin),
46 vmax( rmax, rmax, zmax);
47 center.setValue(0,0,0);
48 box.setBounds(vmin,vmax);
51 float anglestart = sphi;
52 while (anglestart < 0.0) anglestart += 2*
M_PI;
53 while (anglestart > 2*
M_PI) anglestart -= 2*
M_PI;
54 if (anglestart<0.0) anglestart = 0.0;
55 float angleend = anglestart + dphi;
58 double cosanglestart(cos(anglestart));
59 double cosangleend(cos(angleend));
60 double sinanglestart(sin(anglestart));
61 double sinangleend(sin(angleend));
63 float ymax = rmax * ( (0.5*
M_PI>=anglestart&&0.5*
M_PI<=angleend) ? 1.0 : std::max(sinanglestart,sinangleend) );
64 float ymin = rmax * ( (1.5*
M_PI>=anglestart&&1.5*
M_PI<=angleend) ? -1.0 : std::min(sinanglestart,sinangleend) );
65 float xmax = rmax * ( (anglestart <= 0.0 || angleend >= 2*
M_PI) ? 1.0 : std::max(cosanglestart,cosangleend) );
66 float xmin = rmax * ( (
M_PI>=anglestart&&
M_PI<=angleend) ? -1.0 : std::min(cosanglestart,cosangleend) );
69 if (dphi >= 0.5*
M_PI || rmin==0.0f ) {
77 double x1 = rmin*cosanglestart;
78 double y1 = rmin*sinanglestart;
79 double x2 = rmin*cosangleend;
80 double y2 = rmin*sinangleend;
92 box.setBounds(vmin,vmax);