48fG4OpenGLStoredSceneHandler (sceneHandler),
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));
#define CONVENIENT_BOOL_ALIAS(q)
#define CONVENIENT_DOUBLE_ALIAS(q)
HepGeom::Point3D< G4double > G4Point3D
std::vector< G4Plane3D > G4Planes
G4double GetAlpha() const
G4double GetGreen() const
std::vector< PO > fPOList
G4bool fDoNotUseDisplayList
std::vector< TO > fTOList
virtual G4bool CompareForKernelVisit(G4ViewParameters &)
virtual G4bool TOSelected(size_t)
G4OpenGLStoredViewer(G4OpenGLStoredSceneHandler &scene)
virtual G4bool POSelected(size_t)
virtual ~G4OpenGLStoredViewer()
void KernelVisitDecision()
virtual void DisplayTimePOColourModification(G4Colour &, size_t)
void AddPrimitiveForASingleFrame(const G4Text &text)
G4OpenGLStoredSceneHandler & fG4OpenGLStoredSceneHandler
G4bool transparency_enabled
void g4GlOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
const G4VisExtent & GetExtent() const
const G4Point3D & GetStandardTargetPoint() const
void SetWorldRadius(G4double)
void SetScreenSize(G4double)
G4Scene * GetScene() const
G4VSceneHandler & fSceneHandler
G4ViewParameters fDefaultVP
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
CutawayMode GetCutawayMode() const
G4double GetCameraDistance(G4double radius) const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsMarkerNotHidden() const
G4double GetGlobalLineWidthScale() const
const G4Colour & GetBackgroundColour() const
const G4Vector3D & GetViewpointDirection() const
const G4Point3D & GetCurrentTargetPoint() const
G4double GetFieldHalfAngle() const
const G4VisAttributes * GetDefaultTextVisAttributes() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4double GetGlobalMarkerScale() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
const G4Planes & GetCutawayPlanes() const
G4bool IsDensityCulling() const
G4double GetVisibleDensity() const
SMROption GetSpecialMeshRenderingOption() const
G4bool IsCullingCovered() const
const G4Plane3D & GetSectionPlane() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
const G4Colour & GetColour() const
static constexpr G4double fVeryLongTime
G4double GetExtentRadius() const
void SetVisAttributes(const G4VisAttributes *)
BasicVector3D< T > unit() const
G4TextPlus * fpG4TextPlus
G4TextPlus * fpG4TextPlus