78 fVP.GetCBDAlgorithmNumber()) ||
94 fVP.GetDefaultVisAttributes()->GetColour()) ||
96 fVP.GetDefaultTextVisAttributes()->GetColour()) ||
100 fVP.GetVisAttributesModifiers()) ||
102 fVP.IsSpecialMeshRendering()) ||
104 fVP.GetSpecialMeshRenderingOption()) ||
161#define CONVENIENT_DOUBLE_ALIAS(q) const G4double& f##q = fVP.GetTimeParameters().f##q;
162#define CONVENIENT_BOOL_ALIAS(q) const G4bool& f##q = fVP.GetTimeParameters().f##q;
185 const size_t nCutaways = cutawayUnion? cutaways.size(): 1;
187 G4bool secondPassForTransparencyRequested =
false;
188 G4bool thirdPassForNonHiddenMarkersRequested =
false;
190 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
192 for (
size_t iCutaway = 0; iCutaway < nCutaways; ++iCutaway) {
196 a[0] = cutaways[iCutaway].a();
197 a[1] = cutaways[iCutaway].b();
198 a[2] = cutaways[iCutaway].c();
199 a[3] = cutaways[iCutaway].d();
200 glClipPlane (GL_CLIP_PLANE2, a);
201 glEnable (GL_CLIP_PLANE2);
216 secondPassForTransparencyRequested =
true;
220 thirdPassForNonHiddenMarkersRequested =
true;
223 }
else if (iPass == 2) {
224 if (!isTransparent) {
240 glDisable (GL_DEPTH_TEST);
245 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
251 glMatrixMode (GL_PROJECTION);
255 glMatrixMode (GL_MODELVIEW);
272 glMatrixMode (GL_PROJECTION);
274 glMatrixMode (GL_MODELVIEW);
299 secondPassForTransparencyRequested =
true;
303 thirdPassForNonHiddenMarkersRequested =
true;
306 }
else if (iPass == 2) {
307 if (!isTransparent) {
317 glDisable (GL_DEPTH_TEST);
322 glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);
330 glMatrixMode (GL_PROJECTION);
334 glMatrixMode (GL_MODELVIEW);
343 glMatrixMode (GL_PROJECTION);
345 glMatrixMode (GL_MODELVIEW);
359 if (fFadeFactor > 0. && to.
fEndTime < fEndTime) {
362 ((fEndTime - to.
fEndTime) / (fEndTime - fStartTime));
366 (bsf * cc.
GetRed() + (1. - bsf) * bg.GetRed(),
367 bsf * cc.
GetGreen() + (1. - bsf) * bg.GetGreen(),
368 bsf * cc.
GetBlue() + (1. - bsf) * bg.GetBlue(),
369 bsf * cc.
GetAlpha() + (1. - bsf) * bg.GetAlpha());
372 (bsf * cc.
GetRed() + (1. - bsf) * bg.GetRed(),
373 bsf * cc.
GetGreen() + (1. - bsf) * bg.GetGreen(),
374 bsf * cc.
GetBlue() + (1. - bsf) * bg.GetBlue());
395 if (cutawayUnion) glDisable (GL_CLIP_PLANE2);
398 if (iPass == 2) secondPassForTransparencyRequested =
false;
399 if (iPass == 3) thirdPassForNonHiddenMarkersRequested =
false;
401 if (secondPassForTransparencyRequested) iPass = 2;
402 else if (thirdPassForNonHiddenMarkersRequested) iPass = 3;
409 glMatrixMode (GL_PROJECTION);
413 glMatrixMode (GL_MODELVIEW);
417 G4Point3D(fDisplayHeadTimeX, fDisplayHeadTimeY, 0.));
420 (fDisplayHeadTimeRed,
421 fDisplayHeadTimeGreen,
422 fDisplayHeadTimeBlue));
425 glMatrixMode (GL_PROJECTION);
427 glMatrixMode (GL_MODELVIEW);
433 G4double lightFrontRadius = (fEndTime - fDisplayLightFrontT) * c_light;
434 if (lightFrontRadius > 0.) {
435 G4Point3D lightFrontCentre(fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ);
436 G4Point3D circleCentre = lightFrontCentre;
437 G4double circleRadius = lightFrontRadius;
438 if (
fVP.GetFieldHalfAngle() > 0.) {
441 fVP.GetCurrentTargetPoint();
443 if(sceneRadius <= 0.) sceneRadius = 1.;
444 G4double cameraDistance =
fVP.GetCameraDistance(sceneRadius);
445 G4Point3D cameraPosition = targetPoint + cameraDistance *
fVP.GetViewpointDirection().unit();
446 G4Vector3D lightFrontToCameraDirection = cameraPosition - lightFrontCentre;
447 G4double lightFrontCentreDistance = lightFrontToCameraDirection.
mag();
456 if (lightFrontToCameraDirection *
fVP.GetViewpointDirection() > 0. && lightFrontRadius < lightFrontCentreDistance) {
458 G4double sineHorizonAngle = lightFrontRadius / lightFrontCentreDistance;
459 circleCentre = lightFrontCentre + (lightFrontRadius * sineHorizonAngle) * lightFrontToCameraDirection.
unit();
460 circleRadius = lightFrontRadius * std::sqrt(1. - std::pow(sineHorizonAngle, 2));
471 if (circleRadius > 0.) {
475 (fDisplayLightFrontRed,
476 fDisplayLightFrontGreen,
477 fDisplayLightFrontBlue));