154#define CONVENIENT_DOUBLE_ALIAS(q) const G4double& f##q = fVP.Get##q();
155#define CONVENIENT_BOOL_ALIAS(q) const G4bool& f##q = fVP.Is##q();
178 const size_t nCutaways = cutawayUnion? cutaways.size(): 1;
180 G4bool secondPassForTransparencyRequested =
false;
181 G4bool thirdPassForNonHiddenMarkersRequested =
false;
183 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
185 for (
size_t iCutaway = 0; iCutaway < nCutaways; ++iCutaway) {
189 a[0] = cutaways[iCutaway].a();
190 a[1] = cutaways[iCutaway].b();
191 a[2] = cutaways[iCutaway].c();
192 a[3] = cutaways[iCutaway].d();
193 glClipPlane (GL_CLIP_PLANE2, a);
194 glEnable (GL_CLIP_PLANE2);
209 secondPassForTransparencyRequested =
true;
213 thirdPassForNonHiddenMarkersRequested =
true;
216 }
else if (iPass == 2) {
217 if (!isTransparent) {
233 glDisable (GL_DEPTH_TEST);
238 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
244 glMatrixMode (GL_PROJECTION);
248 glMatrixMode (GL_MODELVIEW);
265 glMatrixMode (GL_PROJECTION);
267 glMatrixMode (GL_MODELVIEW);
292 secondPassForTransparencyRequested =
true;
296 thirdPassForNonHiddenMarkersRequested =
true;
299 }
else if (iPass == 2) {
300 if (!isTransparent) {
310 glDisable (GL_DEPTH_TEST);
315 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
323 glMatrixMode (GL_PROJECTION);
327 glMatrixMode (GL_MODELVIEW);
336 glMatrixMode (GL_PROJECTION);
338 glMatrixMode (GL_MODELVIEW);
352 if (fFadeFactor > 0. && to.
fEndTime < fEndTime) {
355 ((fEndTime - to.
fEndTime) / (fEndTime - fStartTime));
359 (bsf * cc.
GetRed() + (1. - bsf) * bg.GetRed(),
360 bsf * cc.
GetGreen() + (1. - bsf) * bg.GetGreen(),
361 bsf * cc.
GetBlue() + (1. - bsf) * bg.GetBlue(),
362 bsf * cc.
GetAlpha() + (1. - bsf) * bg.GetAlpha());
365 (bsf * cc.
GetRed() + (1. - bsf) * bg.GetRed(),
366 bsf * cc.
GetGreen() + (1. - bsf) * bg.GetGreen(),
367 bsf * cc.
GetBlue() + (1. - bsf) * bg.GetBlue());
388 if (cutawayUnion) glDisable (GL_CLIP_PLANE2);
391 if (iPass == 2) secondPassForTransparencyRequested =
false;
392 if (iPass == 3) thirdPassForNonHiddenMarkersRequested =
false;
394 if (secondPassForTransparencyRequested) iPass = 2;
395 else if (thirdPassForNonHiddenMarkersRequested) iPass = 3;
402 glMatrixMode (GL_PROJECTION);
406 glMatrixMode (GL_MODELVIEW);
410 G4Point3D(fDisplayHeadTimeX, fDisplayHeadTimeY, 0.));
413 (fDisplayHeadTimeRed,
414 fDisplayHeadTimeGreen,
415 fDisplayHeadTimeBlue));
418 glMatrixMode (GL_PROJECTION);
420 glMatrixMode (GL_MODELVIEW);
426 G4double lightFrontRadius = (fEndTime - fDisplayLightFrontT) * c_light;
427 if (lightFrontRadius > 0.) {
428 G4Point3D lightFrontCentre(fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ);
429 G4Point3D circleCentre = lightFrontCentre;
430 G4double circleRadius = lightFrontRadius;
436 if(sceneRadius <= 0.) sceneRadius = 1.;
439 G4Vector3D lightFrontToCameraDirection = cameraPosition - lightFrontCentre;
440 G4double lightFrontCentreDistance = lightFrontToCameraDirection.
mag();
449 if (lightFrontToCameraDirection *
fVP.
GetViewpointDirection() > 0. && lightFrontRadius < lightFrontCentreDistance) {
451 G4double sineHorizonAngle = lightFrontRadius / lightFrontCentreDistance;
452 circleCentre = lightFrontCentre + (lightFrontRadius * sineHorizonAngle) * lightFrontToCameraDirection.
unit();
453 circleRadius = lightFrontRadius * std::sqrt(1. - std::pow(sineHorizonAngle, 2));
464 if (circleRadius > 0.) {
468 (fDisplayLightFrontRed,
469 fDisplayLightFrontGreen,
470 fDisplayLightFrontBlue));