Geant4-11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
G4OpenGLSceneHandler Class Reference

#include <G4OpenGLSceneHandler.hh>

Inheritance diagram for G4OpenGLSceneHandler:
G4VSceneHandler G4VGraphicsScene G4OpenGLImmediateSceneHandler G4OpenGLStoredSceneHandler G4OpenGLStoredQtSceneHandler

Public Types

enum  FlushAction {
  endOfEvent , endOfRun , eachPrimitive , NthPrimitive ,
  NthEvent , never
}
 
enum  MarkerSizeType { world , screen }
 

Public Member Functions

void AddCompound (const G4Mesh &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
void AddCompound (const G4THitsMap< G4StatDouble > &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VTrajectory &)
 
void AddPrimitive (const G4Circle &)
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Plotter &)
 
void AddPrimitive (const G4Polyhedron &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
void AddPrimitive (const G4Polyline &)
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Square &)
 
virtual void AddPrimitive (const G4Square &)=0
 
void AddPrimitive (const G4Text &)
 
virtual void AddPrimitive (const G4Text &)=0
 
void AddPrimitivesCircle (const std::vector< G4VMarker > &)
 
void AddPrimitivesSquare (const std::vector< G4VMarker > &)
 
void AddSolid (const G4Box &)
 
void AddSolid (const G4Cons &)
 
void AddSolid (const G4Ellipsoid &)
 
void AddSolid (const G4Orb &)
 
void AddSolid (const G4Para &)
 
void AddSolid (const G4Polycone &)
 
void AddSolid (const G4Polyhedra &)
 
void AddSolid (const G4Sphere &)
 
void AddSolid (const G4TessellatedSolid &)
 
void AddSolid (const G4Torus &)
 
void AddSolid (const G4Trap &)
 
void AddSolid (const G4Trd &)
 
void AddSolid (const G4Tubs &)
 
void AddSolid (const G4VSolid &)
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
void AddViewerToList (G4VViewer *pView)
 
virtual void BeginModeling ()
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
virtual void ClearStore ()
 
virtual void ClearTransientStore ()
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEndOfRunModels ()
 
void DrawEvent (const G4Event *)
 
virtual void EndModeling ()
 
virtual void EndPrimitives ()
 
virtual void EndPrimitives2D ()
 
G4bool GetAuxEdgeVisible (const G4VisAttributes *)
 
const G4ColourGetColor ()
 
const G4ColourGetColor (const G4Visible &)
 
const G4ColourGetColour ()
 
const G4ColourGetColour (const G4Visible &)
 
G4VViewerGetCurrentViewer () const
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
virtual const G4VisExtentGetExtent () const
 
G4VGraphicsSystemGetGraphicsSystem () const
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4double GetMarkerDiameter (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerRadius (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerSize (const G4VMarker &, MarkerSizeType &)
 
G4bool GetMarkForClearingTransientStore () const
 
G4VModelGetModel () const
 
const G4StringGetName () const
 
G4int GetNoOfSides (const G4VisAttributes *)
 
G4int GetNumberOfCloudPoints (const G4VisAttributes *) const
 
const G4Transform3DGetObjectTransformation () const
 
G4SceneGetScene () const
 
G4int GetSceneHandlerId () const
 
const G4ColourGetTextColor (const G4Text &)
 
const G4ColourGetTextColour (const G4Text &)
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
G4int GetViewCount () const
 
const G4ViewerListGetViewerList () const
 
G4int IncrementViewCount ()
 
G4bool IsReadyForTransients () const
 
virtual void PostAddSolid ()
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void RemoveViewerFromList (G4VViewer *pView)
 
void SetCurrentViewer (G4VViewer *)
 
void SetMarkForClearingTransientStore (G4bool)
 
void SetModel (G4VModel *)
 
void SetName (const G4String &)
 
void SetObjectTransformation (const G4Transform3D &)
 
virtual void SetScene (G4Scene *)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetTransientsDrawnThisRun (G4bool)
 
G4ViewerListSetViewerList ()
 

Static Public Member Functions

static G4int GetEntitiesFlushInterval ()
 
static FlushAction GetFlushAction ()
 
static void SetEntitiesFlushInterval (G4int interval)
 
static void SetFlushAction (FlushAction action)
 

Protected Member Functions

void ClearAndDestroyAtts ()
 
G4DisplacedSolidCreateCutawaySolid ()
 
G4DisplacedSolidCreateSectionSolid ()
 
 G4OpenGLSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
void ScaledFlush ()
 
virtual ~G4OpenGLSceneHandler ()
 

Protected Attributes

bool fEdgeFlag
 
const G4Transform3D fIdentityTransformation
 
G4bool fMarkForClearingTransientStore
 
G4String fName
 
G4int fNestingDepth
 
G4Transform3D fObjectTransformation
 
std::map< GLuint, G4AttHolder * > fPickMap
 
GLuint fPickName
 
G4VModelfpModel
 
G4bool fProcessing2D
 
G4bool fProcessingSolid
 
G4ScenefpScene
 
G4VViewerfpViewer
 
const G4VisAttributesfpVisAttribs
 
G4bool fReadyForTransients
 
const G4int fSceneHandlerId
 
G4bool fSecondPassForTransparency
 
G4bool fSecondPassForTransparencyRequested
 
G4VGraphicsSystemfSystem
 
G4bool fThirdPassForNonHiddenMarkers
 
G4bool fThirdPassForNonHiddenMarkersRequested
 
G4bool fThreePassCapable
 
G4bool fTransientsDrawnThisEvent
 
G4bool fTransientsDrawnThisRun
 
G4int fViewCount
 
G4ViewerList fViewerList
 

Static Protected Attributes

static G4int fEntitiesFlushInterval = 100
 
static FlushAction fFlushAction = G4OpenGLSceneHandler::NthEvent
 
static const GLubyte fStippleMaskHashed [128]
 

Friends

class G4OpenGLViewer
 

Detailed Description

Definition at line 46 of file G4OpenGLSceneHandler.hh.

Member Enumeration Documentation

◆ FlushAction

Enumerator
endOfEvent 
endOfRun 
eachPrimitive 
NthPrimitive 
NthEvent 
never 

Definition at line 89 of file G4OpenGLSceneHandler.hh.

◆ MarkerSizeType

Enumerator
world 
screen 

Definition at line 58 of file G4VSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4OpenGLSceneHandler()

G4OpenGLSceneHandler::G4OpenGLSceneHandler ( G4VGraphicsSystem system,
G4int  id,
const G4String name = "" 
)
protected

Definition at line 83 of file G4OpenGLSceneHandler.cc.

85 :
86G4VSceneHandler (system, id, name),
87#ifdef G4OPENGL_VERSION_2
88fEmulate_GL_QUADS(false),
89#endif
90fPickName(0),
96fEdgeFlag(true)
97{
98}
G4VSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
const char * name(G4int ptype)

◆ ~G4OpenGLSceneHandler()

G4OpenGLSceneHandler::~G4OpenGLSceneHandler ( )
protectedvirtual

Definition at line 100 of file G4OpenGLSceneHandler.cc.

101{
102 ClearStore ();
103}
virtual void ClearStore()

References G4VSceneHandler::ClearStore().

Member Function Documentation

◆ AddCompound() [1/6]

void G4OpenGLSceneHandler::AddCompound ( const G4Mesh mesh)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1026 of file G4OpenGLSceneHandler.cc.

1027{
1028 // Special mesh rendering for OpenGL drivers
1029 // Limited to rectangular 3-deep meshes
1030 if (mesh.GetMeshType() != G4Mesh::rectangle ||
1031 mesh.GetMeshDepth() != 3) {
1033 }
1034
1035 auto container = mesh.GetContainerVolume();
1036
1037 static G4bool firstPrint = true;
1039 G4bool print = firstPrint && verbosity >= G4VisManager::confirmations;
1040
1041 if (print) {
1042 G4cout
1043 << "Special case drawing of G4VNestedParameterisation in G4OpenGLSceneHandler"
1044 << '\n' << mesh
1045 << G4endl;
1046 }
1047
1048 // Instantiate a temporary G4PhysicalVolumeModel
1050 tmpMP.SetCulling(true); // This avoids drawing transparent...
1051 tmpMP.SetCullingInvisible(true); // ... or invisble volumes.
1052 const G4bool useFullExtent = true; // To avoid calculating the extent
1053 G4PhysicalVolumeModel tmpPVModel
1054 (container,
1056 G4Transform3D(),
1057 &tmpMP,
1058 useFullExtent);
1059
1060 // Instantiate a pseudo scene so that we can make a "private" descent
1061 // into the nested parameterisation and fill a multimap...
1062 std::multimap<const G4Colour,G4ThreeVector> positionByColour;
1063 G4double halfX = 0., halfY = 0., halfZ = 0.;
1064 struct PseudoScene: public G4PseudoScene {
1065 PseudoScene
1066 (G4PhysicalVolumeModel* pvModel // input...the following are outputs
1067 , std::multimap<const G4Colour,G4ThreeVector>& positionByColour
1068 , G4double& halfX, G4double& halfY, G4double& halfZ)
1069 : fpPVModel(pvModel)
1070 , fPositionByColour(positionByColour)
1071 , fHalfX(halfX), fHalfY(halfY), fHalfZ(halfZ)
1072 {}
1073 using G4PseudoScene::AddSolid; // except for...
1074 void AddSolid(const G4Box& box) {
1075 const G4Colour& colour = fpPVModel->GetCurrentLV()->GetVisAttributes()->GetColour();
1076 const G4ThreeVector& position = fpCurrentObjectTransformation->getTranslation();
1077 fPositionByColour.insert(std::make_pair(colour,position));
1078 fHalfX = box.GetXHalfLength();
1079 fHalfY = box.GetYHalfLength();
1080 fHalfZ = box.GetZHalfLength();
1081 }
1082 G4PhysicalVolumeModel* fpPVModel;
1083 std::multimap<const G4Colour,G4ThreeVector>& fPositionByColour;
1084 G4double &fHalfX, &fHalfY, &fHalfZ;
1085 }
1086 pseudoScene(&tmpPVModel,positionByColour,halfX,halfY,halfZ);
1087
1088 // Make private descent into the nested parameterisation
1089 tmpPVModel.DescribeYourselfTo(pseudoScene);
1090
1091 // Make list of found colours
1092 std::set<G4Colour> setOfColours;
1093 for (const auto& entry: positionByColour) {
1094 setOfColours.insert(entry.first);
1095 }
1096
1097 if (print) {
1098 for (const auto& colour: setOfColours) {
1099 G4cout << "setOfColours: " << colour << G4endl;
1100 }
1101 }
1102
1103 // Draw as dots
1105 G4int nDotsTotal = 0;
1106 for (const auto& colour: setOfColours) {
1107 G4int nDots = 0;
1108 G4Polymarker dots;
1109 dots.SetVisAttributes(G4Colour(colour));
1111 dots.SetSize(G4VMarker::screen,1.);
1112 dots.SetInfo(container->GetName());
1113 const auto range = positionByColour.equal_range(colour);
1114 for (auto posByCol = range.first; posByCol != range.second; ++posByCol) {
1115 const G4double x = posByCol->second.getX() + (2.*G4UniformRand()-1.)*halfX;
1116 const G4double y = posByCol->second.getY() + (2.*G4UniformRand()-1.)*halfY;
1117 const G4double z = posByCol->second.getZ() + (2.*G4UniformRand()-1.)*halfZ;
1118 dots.push_back(G4ThreeVector(x,y,z));
1119 ++nDots;
1120 }
1121 AddPrimitive(dots);
1122 if (print) {
1123 G4cout
1124 << "Number of dots for colour " << colour
1125 << ": " << nDots << G4endl;
1126 }
1127 nDotsTotal += nDots;
1128 }
1129 if (print) {
1130 G4cout << "Total number of dots: " << nDotsTotal << G4endl;
1131 }
1132 EndPrimitives ();
1133
1134 firstPrint = false;
1135
1136 return;
1137}
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Transform3D G4Transform3D
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void print(G4double elem)
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
Definition: G4Box.hh:56
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
static G4bool GetColour(const G4String &key, G4Colour &result)
Definition: G4Colour.cc:161
MeshType GetMeshType() const
Definition: G4Mesh.hh:62
G4VPhysicalVolume * GetContainerVolume() const
Definition: G4Mesh.hh:61
const G4Transform3D & GetTransform() const
Definition: G4Mesh.hh:64
@ rectangle
Definition: G4Mesh.hh:52
G4int GetMeshDepth() const
Definition: G4Mesh.hh:63
void SetCulling(G4bool)
void SetCullingInvisible(G4bool)
void AddPrimitive(const G4Polyline &)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation)
void AddSolid(const G4Box &)
void SetMarkerType(MarkerType)
void AddSolid(const G4Box &solid)
virtual void SetInfo(const G4String &info)
void SetSize(SizeType, G4double)
Definition: G4VMarker.cc:94
virtual void AddCompound(const G4VTrajectory &)
static Verbosity GetVerbosity()
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:96

References G4VSceneHandler::AddCompound(), AddPrimitive(), AddSolid(), G4PseudoScene::AddSolid(), BeginPrimitives(), G4VisManager::confirmations, G4PhysicalVolumeModel::DescribeYourselfTo(), G4Polymarker::dots, EndPrimitives(), G4cout, G4endl, G4UniformRand, G4Colour::GetColour(), G4Mesh::GetContainerVolume(), G4Mesh::GetMeshDepth(), G4Mesh::GetMeshType(), G4Mesh::GetTransform(), G4VisManager::GetVerbosity(), G4Box::GetXHalfLength(), G4Box::GetYHalfLength(), G4Box::GetZHalfLength(), print(), G4Mesh::rectangle, G4VMarker::screen, G4ModelingParameters::SetCulling(), G4ModelingParameters::SetCullingInvisible(), G4VMarker::SetInfo(), G4Polymarker::SetMarkerType(), G4VMarker::SetSize(), G4Visible::SetVisAttributes(), and G4PhysicalVolumeModel::UNLIMITED.

◆ AddCompound() [2/6]

void G4OpenGLSceneHandler::AddCompound ( const G4THitsMap< G4double > &  hits)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1018 of file G4OpenGLSceneHandler.cc.

1018 {
1019 G4VSceneHandler::AddCompound(hits); // For now.
1020}

References G4VSceneHandler::AddCompound().

◆ AddCompound() [3/6]

void G4OpenGLSceneHandler::AddCompound ( const G4THitsMap< G4StatDouble > &  hits)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1022 of file G4OpenGLSceneHandler.cc.

1022 {
1023 G4VSceneHandler::AddCompound(hits); // For now.
1024}

References G4VSceneHandler::AddCompound().

◆ AddCompound() [4/6]

void G4OpenGLSceneHandler::AddCompound ( const G4VDigi digi)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1014 of file G4OpenGLSceneHandler.cc.

1014 {
1015 G4VSceneHandler::AddCompound(digi); // For now.
1016}

References G4VSceneHandler::AddCompound().

◆ AddCompound() [5/6]

void G4OpenGLSceneHandler::AddCompound ( const G4VHit hit)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1010 of file G4OpenGLSceneHandler.cc.

1010 {
1011 G4VSceneHandler::AddCompound(hit); // For now.
1012}

References G4VSceneHandler::AddCompound().

◆ AddCompound() [6/6]

void G4OpenGLSceneHandler::AddCompound ( const G4VTrajectory traj)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 1006 of file G4OpenGLSceneHandler.cc.

1006 {
1007 G4VSceneHandler::AddCompound(traj); // For now.
1008}

References G4VSceneHandler::AddCompound().

◆ AddPrimitive() [1/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Circle circle)
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler, G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 554 of file G4OpenGLSceneHandler.cc.

554 {
555 G4Polymarker oneCircle(circle);
556 oneCircle.push_back(circle.GetPosition());
557 oneCircle.SetMarkerType(G4Polymarker::circles);
558 // Call this AddPrimitive to avoid re-doing sub-class code.
560}
G4Point3D GetPosition() const

References AddPrimitive(), G4Polymarker::circles, G4VMarker::GetPosition(), and G4Polymarker::SetMarkerType().

◆ AddPrimitive() [2/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Circle )
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

◆ AddPrimitive() [3/13]

void G4VSceneHandler::AddPrimitive ( const G4Plotter )
virtual

Reimplemented from G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

Definition at line 192 of file G4VSceneHandler.cc.

501 {
502 G4cerr << "WARNING: Plotter not implemented for " << fSystem.GetName() << G4endl;
503 G4cerr << " Open a plotter-aware graphics system or remove plotter with" << G4endl;
504 G4cerr << " /vis/scene/removeModel Plotter" << G4endl;
505}
G4GLOB_DLL std::ostream G4cerr
const G4String & GetName() const
G4VGraphicsSystem & fSystem

◆ AddPrimitive() [4/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Polyhedron polyhedron)
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler, G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 571 of file G4OpenGLSceneHandler.cc.

571 {
572
573 // Assume all facets are planar convex quadrilaterals.
574 // Draw each facet individually
575
576 if (polyhedron.GetNoFacets() == 0) return;
577
578 // Need access to data in G4OpenGLViewer. static_cast doesn't work
579 // with a virtual base class, so use dynamic_cast.
580 G4OpenGLViewer* pGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
581 if (!pGLViewer) return;
582
583 // Get view parameters that the user can force through the vis
584 // attributes, thereby over-riding the current view parameter.
586
587 // Note that in stored mode, because this call gets embedded in a display
588 // list, it is the colour _at the time of_ creation of the display list, so
589 // even if the colour is changed, for example, by interaction with a Qt
590 // window, current_colour does not change.
591 GLfloat* painting_colour;
592 GLfloat clear_colour[4];
593 GLfloat current_colour[4];
594 glGetFloatv (GL_CURRENT_COLOR, current_colour);
595
596 G4bool isTransparent = false;
597 if (current_colour[3] < 1.) { // This object is transparent
598 isTransparent = true;
599 }
600
601 if (drawing_style == G4ViewParameters::hlr) {
602 // This is the colour used to paint surfaces in hlr mode.
603 glGetFloatv (GL_COLOR_CLEAR_VALUE, clear_colour);
604 painting_colour = clear_colour;
605 } else { // drawing_style == G4ViewParameters::hlhsr
606 painting_colour = current_colour;
607 }
608
610 pGLViewer->ChangeLineWidth(lineWidth);
611
612 G4bool isAuxEdgeVisible = GetAuxEdgeVisible (fpVisAttribs);
613
614 G4bool clipping = pGLViewer->fVP.IsSection() || pGLViewer->fVP.IsCutaway();
615
616 // Lighting disabled unless otherwise requested
617#ifndef G4OPENGL_VERSION_2
618 glDisable (GL_LIGHTING);
619#endif
620
621 switch (drawing_style) {
623 // Set up as for hidden line removal but paint polygon faces later...
625 glEnable (GL_STENCIL_TEST);
626 // The stencil buffer is cleared in G4OpenGLViewer::ClearView.
627 // The procedure below leaves it clear.
628 glStencilFunc (GL_ALWAYS, 0, 1);
629 glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT);
630 glEnable (GL_DEPTH_TEST);
631 glDepthFunc (GL_LEQUAL);
632 if (isTransparent) {
633 // Transparent...
634 glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
635 glEnable(GL_COLOR_MATERIAL);
636 //glDisable (GL_CULL_FACE);
637 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
638 } else {
639 // Opaque...
640 if (clipping) {
641 glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
642 glEnable(GL_COLOR_MATERIAL);
643 //glDisable (GL_CULL_FACE);
644 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
645 } else {
646 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
647 glEnable(GL_COLOR_MATERIAL);
648 //glEnable (GL_CULL_FACE);
649 //glCullFace (GL_BACK);
650 glPolygonMode (GL_FRONT, GL_LINE);
651 }
652 }
653 break;
655 glEnable (GL_DEPTH_TEST);
656 glDepthFunc (GL_LEQUAL);
657 if (isTransparent) {
658 // Transparent...
659 glDepthMask (GL_FALSE); // Make depth buffer read-only.
660 glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
661#ifndef G4OPENGL_VERSION_2
662 glEnable(GL_COLOR_MATERIAL);
663#endif
664 //glDisable (GL_CULL_FACE);
665 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
666 } else {
667 // Opaque...
668 glDepthMask (GL_TRUE); // Make depth buffer writable (default).
669 if (clipping) {
670 glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
671 glEnable(GL_COLOR_MATERIAL);
672 //glDisable (GL_CULL_FACE);
673 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
674 } else {
675 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
676#ifndef G4OPENGL_VERSION_2
677 glEnable(GL_COLOR_MATERIAL);
678#endif
679 //glEnable (GL_CULL_FACE);
680 //glCullFace (GL_BACK);
681 glPolygonMode (GL_FRONT, GL_FILL);
682 }
683 }
684#ifndef G4OPENGL_VERSION_2
685 if (!fProcessing2D) glEnable (GL_LIGHTING);
686#endif
687 break;
689 default:
690 glEnable (GL_DEPTH_TEST);
691 glDepthFunc (GL_LEQUAL); //??? was GL_ALWAYS
692 //glDisable (GL_CULL_FACE);
693 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
694 break;
695 }
696
697 //Loop through all the facets...
698 fEdgeFlag = true;
699#ifndef G4OPENGL_VERSION_2
700 glBegin (GL_QUADS);
701 glEdgeFlag (GL_TRUE);
702#else
703 fEmulate_GL_QUADS = true;
704 glBeginVBO(GL_TRIANGLE_STRIP);
705#endif
706 G4bool notLastFace;
707 do {
708
709 //First, find vertices, edgeflags and normals and note "not last facet"...
710 G4Point3D vertex[4];
711 G4int edgeFlag[4];
712 G4Normal3D normals[4];
713 G4int nEdges;
714 notLastFace = polyhedron.GetNextFacet(nEdges, vertex, edgeFlag, normals);
715
716 //Loop through the four edges of each G4Facet...
717 for(G4int edgeCount = 0; edgeCount < nEdges; ++edgeCount) {
718 // Check to see if edge is visible or not...
719 if (isAuxEdgeVisible) {
720 edgeFlag[edgeCount] = 1;
721 }
722#ifndef G4OPENGL_VERSION_2
723 if (edgeFlag[edgeCount] > 0) {
724 if (fEdgeFlag != true) {
725 glEdgeFlag (GL_TRUE);
726 fEdgeFlag = true;
727 }
728 } else {
729 if (fEdgeFlag != false) {
730 glEdgeFlag (GL_FALSE);
731 fEdgeFlag = false;
732 }
733 }
734 glNormal3d (normals[edgeCount].x(),
735 normals[edgeCount].y(),
736 normals[edgeCount].z());
737 glVertex3d (vertex[edgeCount].x(),
738 vertex[edgeCount].y(),
739 vertex[edgeCount].z());
740#else
741
742 fOglVertex.push_back(vertex[edgeCount].x());
743 fOglVertex.push_back(vertex[edgeCount].y());
744 fOglVertex.push_back(vertex[edgeCount].z());
745
746 fOglVertex.push_back(normals[edgeCount].x());
747 fOglVertex.push_back(normals[edgeCount].y());
748 fOglVertex.push_back(normals[edgeCount].z());
749
750#endif
751
752 }
753
754 // HepPolyhedron produces triangles too; in that case add an extra
755 // vertex identical to first...
756 if (nEdges == 3) {
757 G4int edgeCount = 3;
758 normals[edgeCount] = normals[0];
759 vertex[edgeCount] = vertex[0];
760#ifndef G4OPENGL_VERSION_2
761 edgeFlag[edgeCount] = -1;
762 if (fEdgeFlag != false) {
763 glEdgeFlag (GL_FALSE);
764 fEdgeFlag = false;
765 }
766
767 glNormal3d (normals[edgeCount].x(),
768 normals[edgeCount].y(),
769 normals[edgeCount].z());
770 glVertex3d (vertex[edgeCount].x(),
771 vertex[edgeCount].y(),
772 vertex[edgeCount].z());
773#else
774 fOglVertex.push_back(vertex[edgeCount].x());
775 fOglVertex.push_back(vertex[edgeCount].y());
776 fOglVertex.push_back(vertex[edgeCount].z());
777
778 fOglVertex.push_back(normals[edgeCount].x());
779 fOglVertex.push_back(normals[edgeCount].y());
780 fOglVertex.push_back(normals[edgeCount].z());
781
782#endif
783 }
784 // Trap situation where number of edges is > 4...
785 if (nEdges > 4) {
786 G4cerr <<
787 "G4OpenGLSceneHandler::AddPrimitive(G4Polyhedron): WARNING"
788 "\n G4Polyhedron facet with " << nEdges << " edges" << G4endl;
789 }
790
791
792 // Do it all over again (twice) for hlr...
793 if (drawing_style == G4ViewParameters::hlr ||
794 drawing_style == G4ViewParameters::hlhsr) {
795
796#ifndef G4OPENGL_VERSION_2
797 glDisable(GL_COLOR_MATERIAL); // Revert to glMaterial for hlr/sr.
798#endif
799
800#ifndef G4OPENGL_VERSION_2
801 glEnd (); // Placed here to balance glBegin above, allowing GL
802#else
803 glEndVBO();
804#endif
805 // state changes below, then glBegin again. Avoids
806 // having glBegin/End pairs *inside* loop in the more
807 // usual case of no hidden line removal.
808
809 // Lighting disabled unless otherwise requested
810 glDisable (GL_LIGHTING);
811
812 // Draw through stencil...
813 glStencilFunc (GL_EQUAL, 0, 1);
814 glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
815 if (drawing_style == G4ViewParameters::hlhsr) {
816 if (!fProcessing2D) glEnable (GL_LIGHTING);
817 }
818 glEnable (GL_DEPTH_TEST);
819 glDepthFunc (GL_LEQUAL);
820 if (isTransparent) {
821 // Transparent...
822 glDepthMask (GL_FALSE); // Make depth buffer read-only.
823 //glDisable (GL_CULL_FACE);
824 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
825 } else {
826 // Opaque...
827 glDepthMask (GL_TRUE); // Make depth buffer writable (default).
828 if (clipping) {
829 //glDisable (GL_CULL_FACE);
830 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
831 } else {
832 //glEnable (GL_CULL_FACE);
833 //glCullFace (GL_BACK);
834 glPolygonMode (GL_FRONT, GL_FILL);
835 }
836 }
837 if (drawing_style == G4ViewParameters::hlr) {
838 if (isTransparent) {
839 // Transparent - don't paint...
840 goto end_of_drawing_through_stencil;
841 }
842 }
843 if (isTransparent) {
844 // Transparent...
845 glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, painting_colour);
846 } else {
847 // Opaque...
848 glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, painting_colour);
849 }
850 glColor4fv (painting_colour);
851#ifndef G4OPENGL_VERSION_2
852 glBegin (GL_QUADS);
853 glEdgeFlag (GL_TRUE);
854 fEdgeFlag = true;
855#else
856 fEmulate_GL_QUADS = true;
857 glBeginVBO(GL_TRIANGLE_STRIP);
858#endif
859
860 for (int edgeCount = 0; edgeCount < 4; ++edgeCount) {
861#ifndef G4OPENGL_VERSION_2
862 if (edgeFlag[edgeCount] > 0) {
863 if (fEdgeFlag != true) {
864 glEdgeFlag (GL_TRUE);
865 fEdgeFlag = true;
866 }
867 } else {
868 if (fEdgeFlag != false) {
869 glEdgeFlag (GL_FALSE);
870 fEdgeFlag = false;
871 }
872 }
873 glNormal3d (normals[edgeCount].x(),
874 normals[edgeCount].y(),
875 normals[edgeCount].z());
876 glVertex3d (vertex[edgeCount].x(),
877 vertex[edgeCount].y(),
878 vertex[edgeCount].z());
879#else
880 fOglVertex.push_back(vertex[edgeCount].x());
881 fOglVertex.push_back(vertex[edgeCount].y());
882 fOglVertex.push_back(vertex[edgeCount].z());
883
884 fOglVertex.push_back(normals[edgeCount].x());
885 fOglVertex.push_back(normals[edgeCount].y());
886 fOglVertex.push_back(normals[edgeCount].z());
887
888#endif
889 }
890#ifndef G4OPENGL_VERSION_2
891 glEnd ();
892#else
893 glEndVBO();
894#endif
895 end_of_drawing_through_stencil:
896
897 // and once more to reset the stencil bits...
898 glStencilFunc (GL_ALWAYS, 0, 1);
899 glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT);
900 glDepthFunc (GL_LEQUAL); // to make sure line gets drawn.
901 if (isTransparent) {
902 // Transparent...
903 //glDisable (GL_CULL_FACE);
904 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
905 } else {
906 // Opaque...
907 if (clipping) {
908 //glDisable (GL_CULL_FACE);
909 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
910 } else {
911 //glEnable (GL_CULL_FACE);
912 //glCullFace (GL_BACK);
913 glPolygonMode (GL_FRONT, GL_LINE);
914 }
915 }
916 glDisable (GL_LIGHTING);
917 glColor4fv (current_colour);
918 fEdgeFlag = true;
919#ifndef G4OPENGL_VERSION_2
920 glBegin (GL_QUADS);
921 glEdgeFlag (GL_TRUE);
922 fEdgeFlag = true;
923#else
924 fEmulate_GL_QUADS = true;
925 glBeginVBO(GL_TRIANGLE_STRIP);
926#endif
927 for (int edgeCount = 0; edgeCount < 4; ++edgeCount) {
928#ifndef G4OPENGL_VERSION_2
929 if (edgeFlag[edgeCount] > 0) {
930 if (fEdgeFlag != true) {
931 glEdgeFlag (GL_TRUE);
932 fEdgeFlag = true;
933 }
934 } else {
935 if (fEdgeFlag != false) {
936 glEdgeFlag (GL_FALSE);
937 fEdgeFlag = false;
938 }
939 }
940 glNormal3d (normals[edgeCount].x(),
941 normals[edgeCount].y(),
942 normals[edgeCount].z());
943 glVertex3d (vertex[edgeCount].x(),
944 vertex[edgeCount].y(),
945 vertex[edgeCount].z());
946#else
947 fOglVertex.push_back(vertex[edgeCount].x());
948 fOglVertex.push_back(vertex[edgeCount].y());
949 fOglVertex.push_back(vertex[edgeCount].z());
950
951 fOglVertex.push_back(normals[edgeCount].x());
952 fOglVertex.push_back(normals[edgeCount].y());
953 fOglVertex.push_back(normals[edgeCount].z());
954
955#endif
956 }
957#ifndef G4OPENGL_VERSION_2
958 glEnd ();
959#else
960 glEndVBO();
961#endif
962
963 glDepthFunc (GL_LEQUAL); // Revert for next facet.
964 fEdgeFlag = true;
965#ifndef G4OPENGL_VERSION_2
966 glBegin (GL_QUADS); // Ready for next facet. GL
967 glEdgeFlag (GL_TRUE);
968 fEdgeFlag = true;
969 // says it ignores incomplete
970 // quadrilaterals, so final empty
971 // glBegin/End sequence should be OK.
972#else
973 fEmulate_GL_QUADS = true;
974 glBeginVBO(GL_TRIANGLE_STRIP);
975#endif
976 }
977 } while (notLastFace);
978
979#ifndef G4OPENGL_VERSION_2
980 glEnd ();
981#else
982
983// FIXME: du grand n'importe quoi en test
984// Cube optimization
985
986 // store old DrawType because in case of optimization it could be changed
987 GLenum oldDrawArrayType = fDrawArrayType;
988
989 if (dynamic_cast<const G4PolyhedronTrd2*>(&polyhedron)) {
990// OptimizeVBOForTrd();
991 } else if (dynamic_cast<const G4PolyhedronCons*>(&polyhedron)) {
992// OptimizeVBOForCons((polyhedron.GetNoVertices()-2)/2 ); // top + bottom + all faces
993 }
994
995 glEndVBO();
996 fDrawArrayType = oldDrawArrayType;
997#endif
998
999 glDisable (GL_STENCIL_TEST); // Revert to default for next primitive.
1000 glDepthMask (GL_TRUE); // Revert to default for next primitive.
1001#ifndef G4OPENGL_VERSION_2
1002 glDisable (GL_LIGHTING); // Revert to default for next primitive.
1003#endif
1004}
void ChangeLineWidth(G4double width)
G4VViewer * fpViewer
const G4VisAttributes * fpVisAttribs
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)
G4double GetLineWidth(const G4VisAttributes *)
G4bool GetAuxEdgeVisible(const G4VisAttributes *)
G4ViewParameters fVP
Definition: G4VViewer.hh:219
G4bool IsCutaway() const
G4bool IsSection() const
G4int GetNoFacets() const
G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=0, G4Normal3D *normals=0) const

References G4OpenGLViewer::ChangeLineWidth(), fEdgeFlag, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VViewer::fVP, G4cerr, G4endl, G4VSceneHandler::GetAuxEdgeVisible(), G4VSceneHandler::GetDrawingStyle(), G4VSceneHandler::GetLineWidth(), HepPolyhedron::GetNextFacet(), HepPolyhedron::GetNoFacets(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4ViewParameters::IsCutaway(), G4ViewParameters::IsSection(), and G4ViewParameters::wireframe.

◆ AddPrimitive() [5/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

◆ AddPrimitive() [6/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Polyline line)
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler, G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 345 of file G4OpenGLSceneHandler.cc.

346{
347 G4int nPoints = line.size ();
348 if (nPoints <= 0) return;
349
350 // Note: colour and depth test treated in sub-class.
351
352#ifndef G4OPENGL_VERSION_2
353 glDisable (GL_LIGHTING);
354#endif
355
357 // Need access to method in G4OpenGLViewer. static_cast doesn't
358 // work with a virtual base class, so use dynamic_cast. No need to
359 // test the outcome since viewer is guaranteed to be a
360 // G4OpenGLViewer, but test it anyway to keep Coverity happy.
361 G4OpenGLViewer* pGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
362 if (pGLViewer) pGLViewer->ChangeLineWidth(lineWidth);
363
364 fEdgeFlag = true;
365#ifndef G4OPENGL_VERSION_2
366 glBegin (GL_LINE_STRIP);
367 // No ned glEdgeFlag for lines :
368 // Boundary and nonboundary edge flags on vertices are significant only if GL_POLYGON_MODE is set to GL_POINT or GL_LINE. See glPolygonMode.
369
370 // glEdgeFlag (GL_TRUE);
371 for (G4int iPoint = 0; iPoint < nPoints; iPoint++) {
372 G4double x, y, z;
373 x = line[iPoint].x();
374 y = line[iPoint].y();
375 z = line[iPoint].z();
376 glVertex3d (x, y, z);
377 }
378 glEnd ();
379#else
380 glBeginVBO(GL_LINE_STRIP);
381
382 for (G4int iPoint = 0; iPoint < nPoints; iPoint++) {
383 fOglVertex.push_back(line[iPoint].x());
384 fOglVertex.push_back(line[iPoint].y());
385 fOglVertex.push_back(line[iPoint].z());
386 // normal
387 fOglVertex.push_back(0);
388 fOglVertex.push_back(0);
389 fOglVertex.push_back(1);
390 }
391
392 glEndVBO();
393#endif
394}

References G4OpenGLViewer::ChangeLineWidth(), fEdgeFlag, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, and G4VSceneHandler::GetLineWidth().

Referenced by AddCompound(), AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitive(), and G4OpenGLStoredSceneHandler::AddPrimitive().

◆ AddPrimitive() [7/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

◆ AddPrimitive() [8/13]

void G4VSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

Definition at line 190 of file G4VSceneHandler.cc.

458 {
459 switch (polymarker.GetMarkerType()) {
460 default:
462 {
463 G4Circle dot (polymarker);
464 dot.SetWorldSize (0.);
465 dot.SetScreenSize (0.1); // Very small circle.
466 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
467 dot.SetPosition (polymarker[iPoint]);
468 AddPrimitive (dot);
469 }
470 }
471 break;
473 {
474 G4Circle circle (polymarker); // Default circle
475 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
476 circle.SetPosition (polymarker[iPoint]);
477 AddPrimitive (circle);
478 }
479 }
480 break;
482 {
483 G4Square square (polymarker); // Default square
484 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
485 square.SetPosition (polymarker[iPoint]);
486 AddPrimitive (square);
487 }
488 }
489 break;
490 }
491}
MarkerType GetMarkerType() const

◆ AddPrimitive() [9/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4VSceneHandler.

Reimplemented in G4OpenGLImmediateSceneHandler, G4OpenGLStoredSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 396 of file G4OpenGLSceneHandler.cc.

397{
398 if (polymarker.size() == 0) {
399 return;
400 }
401
402 // Note: colour and depth test treated in sub-class.
403
404#ifndef G4OPENGL_VERSION_2
405 glDisable (GL_LIGHTING);
406#endif
407
408 MarkerSizeType sizeType;
409 G4double size = GetMarkerSize(polymarker, sizeType);
410
411 // Need access to method in G4OpenGLViewer. static_cast doesn't
412 // work with a virtual base class, so use dynamic_cast. No need to
413 // test the outcome since viewer is guaranteed to be a
414 // G4OpenGLViewer, but test it anyway to keep Coverity happy.
415 G4OpenGLViewer* pGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
416 if (!pGLViewer) return;
417
418 if (sizeType == world) { // Size specified in world coordinates.
420 pGLViewer->ChangeLineWidth(lineWidth);
421
422 G4VMarker::FillStyle style = polymarker.GetFillStyle();
423
424 // G4bool filled = false; Not actually used - comment out to prevent compiler warnings (JA).
425 static G4bool hashedWarned = false;
426
427 switch (style) {
429 glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
430 glEdgeFlag (GL_TRUE);
431 //filled = false;
432 break;
434 if (!hashedWarned) {
435 G4cout << "Hashed fill style in G4OpenGLSceneHandler."
436 << "\n Not implemented. Using G4VMarker::filled."
437 << G4endl;
438 hashedWarned = true;
439 }
440 // Maybe use
441 //glPolygonStipple (fStippleMaskHashed);
442 [[fallthrough]]; // Drop through to filled...
444 glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
445 //filled = true;
446 break;
447 }
448 }
449
450 // Draw...
451 if (sizeType == world) { // Size specified in world coordinates.
452
453 G4int nSides;
454 G4double startPhi;
455 switch (polymarker.GetMarkerType()) {
456 default:
458 size = 1.;
459 [[fallthrough]]; // Fall through to circles
461 nSides = GetNoOfSides(fpVisAttribs);
462 startPhi = 0.;
463 break;
465 nSides = 4;
466 startPhi = -pi / 4.;
467 break;
468 }
469
470 const G4Vector3D& viewpointDirection =
471 fpViewer -> GetViewParameters().GetViewpointDirection();
473 const G4double dPhi = twopi / nSides;
474 const G4double radius = size / 2.;
475 G4Vector3D start = radius * (up.cross(viewpointDirection)).unit();
476 G4double phi;
477 G4int i;
478 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
479 fEdgeFlag = true;
480#ifndef G4OPENGL_VERSION_2
481 glBegin (GL_POLYGON);
482 for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
483 G4Vector3D r = start; r.rotate(phi, viewpointDirection);
484 G4Vector3D p = polymarker[iPoint] + r;
485 glVertex3d (p.x(), p.y(), p.z());
486 }
487 glEnd ();
488#else
489 glBeginVBO (GL_TRIANGLE_STRIP);
490 for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
491 G4Vector3D r = start; r.rotate(phi, viewpointDirection);
492 G4Vector3D p = polymarker[iPoint] + r;
493
494 fOglVertex.push_back(p.x());
495 fOglVertex.push_back(p.y());
496 fOglVertex.push_back(p.z());
497 // normal
498 fOglVertex.push_back(0);
499 fOglVertex.push_back(0);
500 fOglVertex.push_back(1);
501 }
502 glEndVBO ();
503#endif
504 }
505
506 } else { // Size specified in screen (window) coordinates.
507
508 pGLViewer->ChangePointSize(size);
509
510 //Antialiasing only for circles
511#ifndef G4OPENGL_VERSION_2
512 switch (polymarker.GetMarkerType()) {
513 default:
516 glEnable (GL_POINT_SMOOTH); break;
518 glDisable (GL_POINT_SMOOTH); break;
519 }
520#endif
521#ifndef G4OPENGL_VERSION_2
522 glBegin (GL_POINTS);
523 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
524 G4Point3D centre = polymarker[iPoint];
525 glVertex3d(centre.x(),centre.y(),centre.z());
526 }
527 glEnd();
528#else
529 glBeginVBO(GL_POINTS);
530
531 for (size_t iPoint = 0; iPoint < polymarker.size (); iPoint++) {
532 fOglVertex.push_back(polymarker[iPoint].x());
533 fOglVertex.push_back(polymarker[iPoint].y());
534 fOglVertex.push_back(polymarker[iPoint].z());
535 fOglVertex.push_back(0);
536 fOglVertex.push_back(0);
537 fOglVertex.push_back(1);
538 }
539 glEndVBO();
540#endif
541 }
542}
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double pi
Definition: G4SIunits.hh:55
void ChangePointSize(G4double size)
FillStyle GetFillStyle() const
G4int GetNoOfSides(const G4VisAttributes *)
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)
const G4ViewParameters & GetViewParameters() const
const G4Vector3D & GetUpVector() const
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
BasicVector3D< T > & rotate(T a, const BasicVector3D< T > &v)

References G4OpenGLViewer::ChangeLineWidth(), G4OpenGLViewer::ChangePointSize(), G4Polymarker::circles, HepGeom::BasicVector3D< T >::cross(), G4Polymarker::dots, fEdgeFlag, G4VMarker::filled, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4cout, G4endl, G4VMarker::GetFillStyle(), G4VSceneHandler::GetLineWidth(), G4VSceneHandler::GetMarkerSize(), G4Polymarker::GetMarkerType(), G4VSceneHandler::GetNoOfSides(), G4ViewParameters::GetUpVector(), G4VViewer::GetViewParameters(), G4VMarker::hashed, G4VMarker::noFill, pi, HepGeom::BasicVector3D< T >::rotate(), G4Polymarker::squares, twopi, G4VSceneHandler::world, HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

◆ AddPrimitive() [10/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Square square)
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler, G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 562 of file G4OpenGLSceneHandler.cc.

562 {
563 G4Polymarker oneSquare(square);
564 oneSquare.push_back(square.GetPosition());
565 oneSquare.SetMarkerType(G4Polymarker::squares);
566 // Call this AddPrimitive to avoid re-doing sub-class code.
568}

References AddPrimitive(), G4VMarker::GetPosition(), G4Polymarker::SetMarkerType(), and G4Polymarker::squares.

◆ AddPrimitive() [11/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Square )
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

◆ AddPrimitive() [12/13]

void G4OpenGLSceneHandler::AddPrimitive ( const G4Text text)
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler, G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 544 of file G4OpenGLSceneHandler.cc.

544 {
545 // Pass to specific viewer via virtual function DrawText.
546 // FIXME : Not ready for OPENGL2 for the moment
547#ifdef G4OPENGL_VERSION_2
548 return;
549#endif
550 G4OpenGLViewer* pGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
551 if (pGLViewer) pGLViewer->DrawText(text);
552}
virtual void DrawText(const G4Text &)

References G4OpenGLViewer::DrawText(), and G4VSceneHandler::fpViewer.

◆ AddPrimitive() [13/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Text )
virtual

Implements G4VSceneHandler.

Reimplemented in G4OpenGLStoredSceneHandler.

◆ AddPrimitivesCircle()

void G4OpenGLSceneHandler::AddPrimitivesCircle ( const std::vector< G4VMarker > &  )

◆ AddPrimitivesSquare()

void G4OpenGLSceneHandler::AddPrimitivesSquare ( const std::vector< G4VMarker > &  )

◆ AddSolid() [1/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Box )
virtual

Reimplemented from G4VSceneHandler.

Referenced by AddCompound().

◆ AddSolid() [2/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Cons )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [3/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Ellipsoid )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [4/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Orb )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [5/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Para )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [6/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Polycone )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [7/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Polyhedra )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [8/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Sphere )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [9/14]

void G4OpenGLSceneHandler::AddSolid ( const G4TessellatedSolid )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [10/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Torus )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [11/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Trap )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [12/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Trd )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [13/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Tubs )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolid() [14/14]

void G4OpenGLSceneHandler::AddSolid ( const G4VSolid )
virtual

Reimplemented from G4VSceneHandler.

◆ AddSolidT()

template<class T >
void G4VSceneHandler::AddSolidT ( const T &  solid)
inherited

Definition at line 220 of file G4VSceneHandler.cc.

222{
223 // Get and check applicable vis attributes.
225 RequestPrimitives (solid);
226}
virtual void RequestPrimitives(const G4VSolid &solid)
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const

References G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VViewer::GetApplicableVisAttributes(), and G4VSceneHandler::RequestPrimitives().

Referenced by G4VSceneHandler::AddSolid().

◆ AddSolidWithAuxiliaryEdges()

template<class T >
void G4VSceneHandler::AddSolidWithAuxiliaryEdges ( const T &  solid)
inherited

Definition at line 228 of file G4VSceneHandler.cc.

230{
231 // Get and check applicable vis attributes.
233 // Draw with auxiliary edges unless otherwise specified.
235 // Create a vis atts object for the modified vis atts.
236 // It is static so that we may return a reliable pointer to it.
237 static G4VisAttributes visAttsWithAuxEdges;
238 // Initialise it with the current vis atts and reset the pointer.
239 visAttsWithAuxEdges = *fpVisAttribs;
240 // Force auxiliary edges visible.
241 visAttsWithAuxEdges.SetForceAuxEdgeVisible();
242 fpVisAttribs = &visAttsWithAuxEdges;
243 }
244 RequestPrimitives (solid);
245}
void SetForceAuxEdgeVisible(G4bool=true)
G4bool IsForceAuxEdgeVisible() const

References G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VViewer::GetApplicableVisAttributes(), G4VisAttributes::IsForceAuxEdgeVisible(), G4VSceneHandler::RequestPrimitives(), and G4VisAttributes::SetForceAuxEdgeVisible().

Referenced by G4VSceneHandler::AddSolid().

◆ AddViewerToList()

void G4VSceneHandler::AddViewerToList ( G4VViewer pView)
inherited

Definition at line 454 of file G4VSceneHandler.cc.

454 {
455 fViewerList.push_back (pViewer);
456}
G4ViewerList fViewerList

References G4VSceneHandler::fViewerList.

◆ BeginModeling()

void G4VSceneHandler::BeginModeling ( )
virtualinherited

◆ BeginPrimitives()

void G4OpenGLSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Reimplemented in G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 305 of file G4OpenGLSceneHandler.cc.

307{
308 G4VSceneHandler::BeginPrimitives (objectTransformation);
309}
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())

References G4VSceneHandler::BeginPrimitives().

Referenced by AddCompound(), G4OpenGLImmediateSceneHandler::BeginPrimitives(), and G4OpenGLStoredSceneHandler::BeginPrimitives().

◆ BeginPrimitives2D()

void G4OpenGLSceneHandler::BeginPrimitives2D ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Reimplemented in G4OpenGLImmediateSceneHandler, and G4OpenGLStoredSceneHandler.

Definition at line 316 of file G4OpenGLSceneHandler.cc.

318{
319 G4VSceneHandler::BeginPrimitives2D (objectTransformation);
320}
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation=G4Transform3D())

References G4VSceneHandler::BeginPrimitives2D().

Referenced by G4OpenGLImmediateSceneHandler::BeginPrimitives2D(), and G4OpenGLStoredSceneHandler::BeginPrimitives2D().

◆ ClearAndDestroyAtts()

void G4OpenGLSceneHandler::ClearAndDestroyAtts ( )
protected

Definition at line 105 of file G4OpenGLSceneHandler.cc.

106{
107 std::map<GLuint, G4AttHolder*>::iterator i;
108 for (i = fPickMap.begin(); i != fPickMap.end(); ++i) delete i->second;
109 fPickMap.clear();
110}
std::map< GLuint, G4AttHolder * > fPickMap

References fPickMap.

Referenced by G4OpenGLStoredSceneHandler::ClearStore().

◆ ClearStore()

void G4VSceneHandler::ClearStore ( )
virtualinherited

◆ ClearTransientStore()

void G4VSceneHandler::ClearTransientStore ( )
virtualinherited

◆ CreateCutawaySolid()

G4DisplacedSolid * G4OpenGLSceneHandler::CreateCutawaySolid ( )
protectedvirtual

Reimplemented from G4VSceneHandler.

Definition at line 336 of file G4OpenGLSceneHandler.cc.

337{
338 // return G4VSceneHandler::CreateCutawaySolid();
339 // If cutaway done in G4OpenGLViewer::SetView.
340 return 0;
341 // Note: if you change this, you must also change
342 // G4OpenGLStoredViewer::CompareForKernelVisit
343}

◆ CreateModelingParameters()

G4ModelingParameters * G4VSceneHandler::CreateModelingParameters ( )
inherited

Definition at line 798 of file G4VSceneHandler.cc.

799{
800 // Create modeling parameters from View Parameters...
801 if (!fpViewer) return NULL;
802
803 const G4ViewParameters& vp = fpViewer -> GetViewParameters ();
804
805 // Convert drawing styles...
806 G4ModelingParameters::DrawingStyle modelDrawingStyle =
808 switch (vp.GetDrawingStyle ()) {
809 default:
811 modelDrawingStyle = G4ModelingParameters::wf;
812 break;
814 modelDrawingStyle = G4ModelingParameters::hlr;
815 break;
817 modelDrawingStyle = G4ModelingParameters::hsr;
818 break;
820 modelDrawingStyle = G4ModelingParameters::hlhsr;
821 break;
823 modelDrawingStyle = G4ModelingParameters::cloud;
824 break;
825 }
826
827 // Decide if covered daughters are really to be culled...
828 G4bool reallyCullCovered =
829 vp.IsCullingCovered() // Culling daughters depends also on...
830 && !vp.IsSection () // Sections (DCUT) not requested.
831 && !vp.IsCutaway () // Cutaways not requested.
832 ;
833
834 G4ModelingParameters* pModelingParams = new G4ModelingParameters
836 modelDrawingStyle,
837 vp.IsCulling (),
838 vp.IsCullingInvisible (),
839 vp.IsDensityCulling (),
840 vp.GetVisibleDensity (),
841 reallyCullCovered,
842 vp.GetNoOfSides ()
843 );
844
845 pModelingParams->SetNumberOfCloudPoints(vp.GetNumberOfCloudPoints());
846 pModelingParams->SetWarning
848
849 pModelingParams->SetCBDAlgorithmNumber(vp.GetCBDAlgorithmNumber());
850 pModelingParams->SetCBDParameters(vp.GetCBDParameters());
851
852 pModelingParams->SetExplodeFactor(vp.GetExplodeFactor());
853 pModelingParams->SetExplodeCentre(vp.GetExplodeCentre());
854
855 pModelingParams->SetSectionSolid(CreateSectionSolid());
856 pModelingParams->SetCutawaySolid(CreateCutawaySolid());
857 // The polyhedron objects are deleted in the modeling parameters destructor.
858
860
861 pModelingParams->SetSpecialMeshRendering(vp.IsSpecialMeshRendering());
862 pModelingParams->SetSpecialMeshVolumes(vp.GetSpecialMeshVolumes());
863
864 return pModelingParams;
865}
void SetCBDParameters(const std::vector< G4double > &)
void SetWarning(G4bool)
void SetNumberOfCloudPoints(G4int)
void SetCBDAlgorithmNumber(G4int)
void SetExplodeFactor(G4double explodeFactor)
void SetVisAttributesModifiers(const std::vector< VisAttributesModifier > &)
void SetExplodeCentre(const G4Point3D &explodeCentre)
void SetCutawaySolid(G4DisplacedSolid *pCutawaySolid)
void SetSectionSolid(G4DisplacedSolid *pSectionSolid)
void SetSpecialMeshVolumes(const std::vector< PVNameCopyNo > &)
void SetSpecialMeshRendering(G4bool)
virtual G4DisplacedSolid * CreateSectionSolid()
virtual G4DisplacedSolid * CreateCutawaySolid()
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsCulling() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
G4bool IsDensityCulling() const
G4double GetVisibleDensity() const
const G4Point3D & GetExplodeCentre() const
G4bool IsCullingCovered() const
DrawingStyle GetDrawingStyle() const

References G4ViewParameters::cloud, G4ModelingParameters::cloud, G4VSceneHandler::CreateCutawaySolid(), G4VSceneHandler::CreateSectionSolid(), G4VSceneHandler::fpViewer, G4ViewParameters::GetCBDAlgorithmNumber(), G4ViewParameters::GetCBDParameters(), G4ViewParameters::GetDefaultVisAttributes(), G4ViewParameters::GetDrawingStyle(), G4ViewParameters::GetExplodeCentre(), G4ViewParameters::GetExplodeFactor(), G4ViewParameters::GetNoOfSides(), G4ViewParameters::GetNumberOfCloudPoints(), G4ViewParameters::GetSpecialMeshVolumes(), G4VisManager::GetVerbosity(), G4ViewParameters::GetVisAttributesModifiers(), G4ViewParameters::GetVisibleDensity(), G4ViewParameters::hlhsr, G4ModelingParameters::hlhsr, G4ViewParameters::hlr, G4ModelingParameters::hlr, G4ViewParameters::hsr, G4ModelingParameters::hsr, G4ViewParameters::IsCulling(), G4ViewParameters::IsCullingCovered(), G4ViewParameters::IsCullingInvisible(), G4ViewParameters::IsCutaway(), G4ViewParameters::IsDensityCulling(), G4ViewParameters::IsSection(), G4ViewParameters::IsSpecialMeshRendering(), G4ModelingParameters::SetCBDAlgorithmNumber(), G4ModelingParameters::SetCBDParameters(), G4ModelingParameters::SetCutawaySolid(), G4ModelingParameters::SetExplodeCentre(), G4ModelingParameters::SetExplodeFactor(), G4ModelingParameters::SetNumberOfCloudPoints(), G4ModelingParameters::SetSectionSolid(), G4ModelingParameters::SetSpecialMeshRendering(), G4ModelingParameters::SetSpecialMeshVolumes(), G4ModelingParameters::SetVisAttributesModifiers(), G4ModelingParameters::SetWarning(), G4VisManager::warnings, G4ModelingParameters::wf, and G4ViewParameters::wireframe.

Referenced by G4VSceneHandler::DrawEndOfRunModels(), G4VSceneHandler::DrawEvent(), and G4VSceneHandler::ProcessScene().

◆ CreateSectionSolid()

G4DisplacedSolid * G4OpenGLSceneHandler::CreateSectionSolid ( )
protectedvirtual

Reimplemented from G4VSceneHandler.

Definition at line 327 of file G4OpenGLSceneHandler.cc.

328{
330 // If clipping done in G4OpenGLViewer::SetView
331 // return 0;
332 // Note: if you change this, you must also change
333 // G4OpenGLStoredViewer::CompareForKernelVisit
334}

References G4VSceneHandler::CreateSectionSolid().

◆ DrawEndOfRunModels()

void G4VSceneHandler::DrawEndOfRunModels ( )
inherited

Definition at line 777 of file G4VSceneHandler.cc.

778{
779 const std::vector<G4Scene::Model>& EORModelList =
780 fpScene -> GetEndOfRunModelList ();
781 size_t nModels = EORModelList.size();
782 if (nModels) {
784 pMP->SetEvent(0);
785 for (size_t i = 0; i < nModels; i++) {
786 if (EORModelList[i].fActive) {
787 fpModel = EORModelList[i].fpModel;
788 fpModel -> SetModelingParameters(pMP);
789 fpModel -> DescribeYourselfTo (*this);
790 fpModel -> SetModelingParameters(0);
791 }
792 }
793 fpModel = 0;
794 delete pMP;
795 }
796}
void SetEvent(const G4Event *pEvent)
G4ModelingParameters * CreateModelingParameters()

References G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, and G4ModelingParameters::SetEvent().

Referenced by G4VisManager::EndOfRun(), and G4VSceneHandler::ProcessScene().

◆ DrawEvent()

void G4VSceneHandler::DrawEvent ( const G4Event event)
inherited

Definition at line 756 of file G4VSceneHandler.cc.

757{
758 const std::vector<G4Scene::Model>& EOEModelList =
759 fpScene -> GetEndOfEventModelList ();
760 size_t nModels = EOEModelList.size();
761 if (nModels) {
763 pMP->SetEvent(event);
764 for (size_t i = 0; i < nModels; i++) {
765 if (EOEModelList[i].fActive) {
766 fpModel = EOEModelList[i].fpModel;
767 fpModel -> SetModelingParameters(pMP);
768 fpModel -> DescribeYourselfTo (*this);
769 fpModel -> SetModelingParameters(0);
770 }
771 }
772 fpModel = 0;
773 delete pMP;
774 }
775}

References G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, and G4ModelingParameters::SetEvent().

Referenced by G4VisManager::EndOfEvent(), and G4VSceneHandler::ProcessScene().

◆ EndModeling()

void G4VSceneHandler::EndModeling ( )
virtualinherited

◆ EndPrimitives()

void G4OpenGLSceneHandler::EndPrimitives ( )
virtual

◆ EndPrimitives2D()

void G4OpenGLSceneHandler::EndPrimitives2D ( )
virtual

◆ GetAuxEdgeVisible()

G4bool G4VSceneHandler::GetAuxEdgeVisible ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1081 of file G4VSceneHandler.cc.

1081 {
1082 G4bool isAuxEdgeVisible = fpViewer->GetViewParameters().IsAuxEdgeVisible ();
1083 if (pVisAttribs -> IsForceAuxEdgeVisible()) {
1084 isAuxEdgeVisible = pVisAttribs->IsForcedAuxEdgeVisible();
1085 }
1086 return isAuxEdgeVisible;
1087}
G4bool IsAuxEdgeVisible() const
G4bool IsForcedAuxEdgeVisible() const

References G4VSceneHandler::fpViewer, G4VViewer::GetViewParameters(), G4ViewParameters::IsAuxEdgeVisible(), and G4VisAttributes::IsForcedAuxEdgeVisible().

Referenced by AddPrimitive(), and G4OpenInventorSceneHandler::AddProperties().

◆ GetColor() [1/2]

const G4Colour & G4VSceneHandler::GetColor ( )
inherited

◆ GetColor() [2/2]

const G4Colour & G4VSceneHandler::GetColor ( const G4Visible )
inherited

◆ GetColour() [1/2]

const G4Colour & G4VSceneHandler::GetColour ( )
inherited

◆ GetColour() [2/2]

const G4Colour & G4VSceneHandler::GetColour ( const G4Visible visible)
inherited

Definition at line 1000 of file G4VSceneHandler.cc.

1000 {
1001 auto pVA = visible.GetVisAttributes();
1003 return pVA->GetColour();
1004}
const G4Colour & GetColour() const
const G4VisAttributes * GetVisAttributes() const

References G4VSceneHandler::fpViewer, G4VisAttributes::GetColour(), G4ViewParameters::GetDefaultVisAttributes(), G4VViewer::GetViewParameters(), and G4Visible::GetVisAttributes().

◆ GetCurrentViewer()

G4VViewer * G4VSceneHandler::GetCurrentViewer ( ) const
inherited

◆ GetDrawingStyle()

G4ViewParameters::DrawingStyle G4VSceneHandler::GetDrawingStyle ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1021 of file G4VSceneHandler.cc.

1022 {
1023 // Drawing style is normally determined by the view parameters, but
1024 // it can be overriddden by the ForceDrawingStyle flag in the vis
1025 // attributes.
1027 const G4ViewParameters::DrawingStyle viewerStyle = vp.GetDrawingStyle();
1028 G4ViewParameters::DrawingStyle resultantStyle = viewerStyle;
1029 if (pVisAttribs -> IsForceDrawingStyle ()) {
1031 pVisAttribs -> GetForcedDrawingStyle ();
1032 // This is complicated because if hidden line and surface removal
1033 // has been requested we wish to preserve this sometimes.
1034 switch (forcedStyle) {
1036 switch (viewerStyle) {
1037 case (G4ViewParameters::hlr):
1038 resultantStyle = G4ViewParameters::hlhsr;
1039 break;
1041 resultantStyle = G4ViewParameters::hsr;
1042 break;
1044 resultantStyle = G4ViewParameters::hsr;
1045 break;
1047 case (G4ViewParameters::hsr):
1048 break;
1049 }
1050 break;
1052 resultantStyle = G4ViewParameters::cloud;
1053 break;
1055 default:
1056 // But if forced style is wireframe, do it, because one of its
1057 // main uses is in displaying the consituent solids of a Boolean
1058 // solid and their surfaces overlap with the resulting Booean
1059 // solid, making a mess if hlr is specified.
1060 resultantStyle = G4ViewParameters::wireframe;
1061 break;
1062 }
1063 }
1064 return resultantStyle;
1065}

References G4VisAttributes::cloud, G4ViewParameters::cloud, G4VSceneHandler::fpViewer, G4ViewParameters::GetDrawingStyle(), G4VViewer::GetViewParameters(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4VisAttributes::solid, G4VisAttributes::wireframe, and G4ViewParameters::wireframe.

Referenced by AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), G4OpenInventorSceneHandler::AddProperties(), G4OpenInventorSceneHandler::GeneratePrerequisites(), and G4VSceneHandler::RequestPrimitives().

◆ GetEntitiesFlushInterval()

static G4int G4OpenGLSceneHandler::GetEntitiesFlushInterval ( )
inlinestatic

Definition at line 97 of file G4OpenGLSceneHandler.hh.

References fEntitiesFlushInterval.

◆ GetExtent()

const G4VisExtent & G4VSceneHandler::GetExtent ( ) const
virtualinherited

Reimplemented from G4VGraphicsScene.

Definition at line 134 of file G4VSceneHandler.cc.

135{
136 if (fpScene) {
137 return fpScene->GetExtent();
138 } else {
139 static const G4VisExtent defaultExtent = G4VisExtent();
140 return defaultExtent;
141 }
142}
const G4VisExtent & GetExtent() const

References G4VSceneHandler::fpScene, and G4Scene::GetExtent().

Referenced by G4VtkViewer::SetView().

◆ GetFlushAction()

static FlushAction G4OpenGLSceneHandler::GetFlushAction ( )
inlinestatic

Definition at line 99 of file G4OpenGLSceneHandler.hh.

100 {return fFlushAction;}
static FlushAction fFlushAction

References fFlushAction.

Referenced by G4OpenGLViewer::printGl2PS().

◆ GetGraphicsSystem()

G4VGraphicsSystem * G4VSceneHandler::GetGraphicsSystem ( ) const
inherited

◆ GetLineWidth()

G4double G4VSceneHandler::GetLineWidth ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1012 of file G4VSceneHandler.cc.

1013{
1014 G4double lineWidth = pVisAttribs->GetLineWidth();
1015 if (lineWidth < 1.) lineWidth = 1.;
1016 lineWidth *= fpViewer -> GetViewParameters().GetGlobalLineWidthScale();
1017 if (lineWidth < 1.) lineWidth = 1.;
1018 return lineWidth;
1019}
G4double GetLineWidth() const

References G4VSceneHandler::fpViewer, and G4VisAttributes::GetLineWidth().

Referenced by AddPrimitive().

◆ GetMarkerDiameter()

G4double G4VSceneHandler::GetMarkerDiameter ( const G4VMarker ,
MarkerSizeType  
)
inherited

◆ GetMarkerRadius()

G4double G4VSceneHandler::GetMarkerRadius ( const G4VMarker ,
MarkerSizeType  
)
inherited

◆ GetMarkerSize()

G4double G4VSceneHandler::GetMarkerSize ( const G4VMarker marker,
G4VSceneHandler::MarkerSizeType markerSizeType 
)
inherited

Definition at line 1089 of file G4VSceneHandler.cc.

1092{
1093 G4bool userSpecified = marker.GetWorldSize() || marker.GetScreenSize();
1094 const G4VMarker& defaultMarker =
1095 fpViewer -> GetViewParameters().GetDefaultMarker();
1096 G4double size = userSpecified ?
1097 marker.GetWorldSize() : defaultMarker.GetWorldSize();
1098 if (size) {
1099 // Draw in world coordinates.
1100 markerSizeType = world;
1101 }
1102 else {
1103 size = userSpecified ?
1104 marker.GetScreenSize() : defaultMarker.GetScreenSize();
1105 // Draw in screen coordinates.
1106 markerSizeType = screen;
1107 }
1108 size *= fpViewer -> GetViewParameters().GetGlobalMarkerScale();
1109 if (markerSizeType == screen && size < 1.) size = 1.;
1110 return size;
1111}
G4double GetScreenSize() const
G4double GetWorldSize() const

References G4VSceneHandler::fpViewer, G4VMarker::GetScreenSize(), G4VMarker::GetWorldSize(), G4VSceneHandler::screen, and G4VSceneHandler::world.

Referenced by G4OpenInventorSceneHandler::AddCircleSquare(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4HepRepFileSceneHandler::AddPrimitive(), AddPrimitive(), G4OpenInventorSceneHandler::AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4OpenGLQtViewer::DrawText(), G4OpenGLViewer::DrawText(), and G4OpenGLXViewer::DrawText().

◆ GetMarkForClearingTransientStore()

G4bool G4VSceneHandler::GetMarkForClearingTransientStore ( ) const
inherited

◆ GetModel()

G4VModel * G4VSceneHandler::GetModel ( ) const
inherited

◆ GetName()

const G4String & G4VSceneHandler::GetName ( ) const
inherited

◆ GetNoOfSides()

G4int G4VSceneHandler::GetNoOfSides ( const G4VisAttributes pVisAttribs)
inherited

Definition at line 1113 of file G4VSceneHandler.cc.

1114{
1115 // No. of sides (lines segments per circle) is normally determined
1116 // by the view parameters, but it can be overriddden by the
1117 // ForceLineSegmentsPerCircle in the vis attributes.
1118 G4int lineSegmentsPerCircle = fpViewer->GetViewParameters().GetNoOfSides();
1119 if (pVisAttribs) {
1120 if (pVisAttribs->IsForceLineSegmentsPerCircle())
1121 lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
1122 if (lineSegmentsPerCircle < pVisAttribs->GetMinLineSegmentsPerCircle()) {
1123 lineSegmentsPerCircle = pVisAttribs->GetMinLineSegmentsPerCircle();
1124 G4cout <<
1125 "G4VSceneHandler::GetNoOfSides: attempt to set the"
1126 "\nnumber of line segments per circle < " << lineSegmentsPerCircle
1127 << "; forced to " << pVisAttribs->GetMinLineSegmentsPerCircle() << G4endl;
1128 }
1129 }
1130 return lineSegmentsPerCircle;
1131}
G4bool IsForceLineSegmentsPerCircle() const
G4int GetForcedLineSegmentsPerCircle() const
static G4int GetMinLineSegmentsPerCircle()

References G4VSceneHandler::fpViewer, G4cout, G4endl, G4VisAttributes::GetForcedLineSegmentsPerCircle(), G4VisAttributes::GetMinLineSegmentsPerCircle(), G4ViewParameters::GetNoOfSides(), G4VViewer::GetViewParameters(), and G4VisAttributes::IsForceLineSegmentsPerCircle().

Referenced by AddPrimitive(), and G4VSceneHandler::RequestPrimitives().

◆ GetNumberOfCloudPoints()

G4int G4VSceneHandler::GetNumberOfCloudPoints ( const G4VisAttributes pVisAttribs) const
inherited

Definition at line 1067 of file G4VSceneHandler.cc.

1068 {
1069 // Returns no of cloud points from current view parameters, unless the user
1070 // has forced through the vis attributes, thereby over-riding the
1071 // current view parameter.
1072 G4int numberOfCloudPoints = fpViewer->GetViewParameters().GetNumberOfCloudPoints();
1073 if (pVisAttribs -> IsForceDrawingStyle() &&
1074 pVisAttribs -> GetForcedDrawingStyle() == G4VisAttributes::cloud &&
1075 pVisAttribs -> GetForcedNumberOfCloudPoints() > 0) {
1076 numberOfCloudPoints = pVisAttribs -> GetForcedNumberOfCloudPoints();
1077 }
1078 return numberOfCloudPoints;
1079}

References G4VisAttributes::cloud, G4VSceneHandler::fpViewer, G4ViewParameters::GetNumberOfCloudPoints(), and G4VViewer::GetViewParameters().

Referenced by G4VSceneHandler::RequestPrimitives().

◆ GetObjectTransformation()

const G4Transform3D & G4VSceneHandler::GetObjectTransformation ( ) const
inherited

◆ GetScene()

G4Scene * G4VSceneHandler::GetScene ( ) const
inherited

◆ GetSceneHandlerId()

G4int G4VSceneHandler::GetSceneHandlerId ( ) const
inherited

◆ GetTextColor()

const G4Colour & G4VSceneHandler::GetTextColor ( const G4Text )
inherited

◆ GetTextColour()

const G4Colour & G4VSceneHandler::GetTextColour ( const G4Text text)
inherited

◆ GetTransientsDrawnThisEvent()

G4bool G4VSceneHandler::GetTransientsDrawnThisEvent ( ) const
inherited

◆ GetTransientsDrawnThisRun()

G4bool G4VSceneHandler::GetTransientsDrawnThisRun ( ) const
inherited

◆ GetViewCount()

G4int G4VSceneHandler::GetViewCount ( ) const
inherited

◆ GetViewerList()

const G4ViewerList & G4VSceneHandler::GetViewerList ( ) const
inherited

◆ IncrementViewCount()

G4int G4VSceneHandler::IncrementViewCount ( )
inherited

◆ IsReadyForTransients()

G4bool G4VSceneHandler::IsReadyForTransients ( ) const
inherited

◆ LoadAtts()

void G4VSceneHandler::LoadAtts ( const G4Visible visible,
G4AttHolder holder 
)
protectedinherited

Definition at line 934 of file G4VSceneHandler.cc.

935{
936 // Load G4Atts from G4VisAttributes, if any...
937 const G4VisAttributes* va = visible.GetVisAttributes();
938 if (va) {
939 const std::map<G4String,G4AttDef>* vaDefs =
940 va->GetAttDefs();
941 if (vaDefs) {
942 holder->AddAtts(visible.GetVisAttributes()->CreateAttValues(), vaDefs);
943 }
944 }
945
946 G4PhysicalVolumeModel* pPVModel =
947 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
948 if (pPVModel) {
949 // Load G4Atts from G4PhysicalVolumeModel...
950 const std::map<G4String,G4AttDef>* pvDefs = pPVModel->GetAttDefs();
951 if (pvDefs) {
952 holder->AddAtts(pPVModel->CreateCurrentAttValues(), pvDefs);
953 }
954 }
955
956 G4TrajectoriesModel* trajModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
957 if (trajModel) {
958 // Load G4Atts from trajectory model...
959 const std::map<G4String,G4AttDef>* trajModelDefs = trajModel->GetAttDefs();
960 if (trajModelDefs) {
961 holder->AddAtts(trajModel->CreateCurrentAttValues(), trajModelDefs);
962 }
963 // Load G4Atts from trajectory...
964 const G4VTrajectory* traj = trajModel->GetCurrentTrajectory();
965 if (traj) {
966 const std::map<G4String,G4AttDef>* trajDefs = traj->GetAttDefs();
967 if (trajDefs) {
968 holder->AddAtts(traj->CreateAttValues(), trajDefs);
969 }
970 G4int nPoints = traj->GetPointEntries();
971 for (G4int i = 0; i < nPoints; ++i) {
972 G4VTrajectoryPoint* trajPoint = traj->GetPoint(i);
973 if (trajPoint) {
974 const std::map<G4String,G4AttDef>* pointDefs = trajPoint->GetAttDefs();
975 if (pointDefs) {
976 holder->AddAtts(trajPoint->CreateAttValues(), pointDefs);
977 }
978 }
979 }
980 }
981 }
982
983 G4HitsModel* hitsModel = dynamic_cast<G4HitsModel*>(fpModel);
984 if (hitsModel) {
985 // Load G4Atts from hit...
986 const G4VHit* hit = hitsModel->GetCurrentHit();
987 const std::map<G4String,G4AttDef>* hitsDefs = hit->GetAttDefs();
988 if (hitsDefs) {
989 holder->AddAtts(hit->CreateAttValues(), hitsDefs);
990 }
991 }
992}
void AddAtts(const std::vector< G4AttValue > *values, const std::map< G4String, G4AttDef > *defs)
Definition: G4AttHolder.hh:64
const G4VHit * GetCurrentHit() const
Definition: G4HitsModel.hh:57
std::vector< G4AttValue > * CreateCurrentAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
const G4VTrajectory * GetCurrentTrajectory() const
std::vector< G4AttValue > * CreateCurrentAttValues() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
Definition: G4VHit.hh:48
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition: G4VHit.hh:64
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
Definition: G4VHit.hh:58
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual G4VTrajectoryPoint * GetPoint(G4int i) const =0
virtual G4int GetPointEntries() const =0
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::vector< G4AttValue > * CreateAttValues() const

References G4AttHolder::AddAtts(), G4VHit::CreateAttValues(), G4VisAttributes::CreateAttValues(), G4VTrajectory::CreateAttValues(), G4VTrajectoryPoint::CreateAttValues(), G4PhysicalVolumeModel::CreateCurrentAttValues(), G4TrajectoriesModel::CreateCurrentAttValues(), G4VSceneHandler::fpModel, G4VHit::GetAttDefs(), G4VisAttributes::GetAttDefs(), G4VTrajectory::GetAttDefs(), G4VTrajectoryPoint::GetAttDefs(), G4PhysicalVolumeModel::GetAttDefs(), G4TrajectoriesModel::GetAttDefs(), G4HitsModel::GetCurrentHit(), G4TrajectoriesModel::GetCurrentTrajectory(), G4VTrajectory::GetPoint(), G4VTrajectory::GetPointEntries(), and G4Visible::GetVisAttributes().

Referenced by G4OpenInventorSceneHandler::AddCircleSquare(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), and G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal().

◆ PostAddSolid()

void G4VSceneHandler::PostAddSolid ( )
virtualinherited

◆ PreAddSolid()

void G4OpenGLSceneHandler::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes visAttribs 
)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 298 of file G4OpenGLSceneHandler.cc.

301{
302 G4VSceneHandler::PreAddSolid (objectTransformation, visAttribs);
303}
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)

References G4VSceneHandler::PreAddSolid().

◆ ProcessScene()

void G4OpenGLSceneHandler::ProcessScene ( )
protectedvirtual

◆ RemoveViewerFromList()

void G4VSceneHandler::RemoveViewerFromList ( G4VViewer pView)
inherited

Definition at line 493 of file G4VSceneHandler.cc.

493 {
494 fViewerList.remove(pViewer); // Does nothing if already removed
495 // And reset current viewer
496 auto visManager = G4VisManager::GetInstance();
497 visManager->SetCurrentViewer(nullptr);
498}
void remove(G4VViewer *)
Definition: G4ViewerList.cc:30
static G4VisManager * GetInstance()

References G4VSceneHandler::fViewerList, G4VisManager::GetInstance(), and G4ViewerList::remove().

Referenced by G4VViewer::~G4VViewer().

◆ RequestPrimitives()

void G4VSceneHandler::RequestPrimitives ( const G4VSolid solid)
protectedvirtualinherited

Reimplemented in G4ASCIITreeSceneHandler, and G4RayTracerSceneHandler.

Definition at line 516 of file G4VSceneHandler.cc.

517{
520
521 switch (style) {
522 default:
527 {
528 // Use polyhedral representation
530 G4Polyhedron* pPolyhedron = solid.GetPolyhedron ();
532 if (pPolyhedron) {
533 pPolyhedron -> SetVisAttributes (fpVisAttribs);
535 AddPrimitive (*pPolyhedron);
536 EndPrimitives ();
537 break;
538 } else { // Print warnings and drop through to cloud
540 static std::set<const G4VSolid*> problematicSolids;
541 if (verbosity >= G4VisManager::errors &&
542 problematicSolids.find(&solid) == problematicSolids.end()) {
543 problematicSolids.insert(&solid);
544 G4cerr <<
545 "ERROR: G4VSceneHandler::RequestPrimitives"
546 "\n Polyhedron not available for " << solid.GetName ();
547 G4PhysicalVolumeModel* pPVModel = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
548 if (pPVModel) {
549 G4cerr << "\n Touchable path: " << pPVModel->GetFullPVPath();
550 }
551 static G4bool explanation = false;
552 if (!explanation) {
553 explanation = true;
554 G4cerr <<
555 "\n This means it cannot be visualized in the usual way on most systems."
556 "\n 1) The solid may not have implemented the CreatePolyhedron method."
557 "\n 2) For Boolean solids, the BooleanProcessor, which attempts to create"
558 "\n the resultant polyhedron, may have failed."
559 "\n Try RayTracer. It uses Geant4's tracking algorithms instead.";
560 }
561 G4cerr << "\n Drawing solid with cloud of points.";
562 G4cerr << G4endl;
563 }
564 }
565 }
566 [[fallthrough]];
567
569 {
570 // Form solid out of cloud of dots on surface of solid
571 G4Polymarker dots;
572 // Note: OpenGL has a fast implementation of polymarker so it's better
573 // to build a polymarker rather than add a succession of circles.
574 // And anyway, in Qt, in the latter case each circle would be a scene-tree
575 // entry, something we would want to avoid.
578 dots.SetSize(G4VMarker::screen,1.);
579 G4int numberOfCloudPoints = GetNumberOfCloudPoints(fpVisAttribs);
580 if (numberOfCloudPoints <= 0) numberOfCloudPoints = vp.GetNumberOfCloudPoints();
581 for (G4int i = 0; i < numberOfCloudPoints; ++i) {
583 dots.push_back(p);
584 }
586 AddPrimitive(dots);
587 EndPrimitives ();
588 break;
589 }
590 }
591}
const std::vector< G4PhysicalVolumeNodeID > & GetFullPVPath() const
G4int GetNumberOfCloudPoints(const G4VisAttributes *) const
G4Transform3D fObjectTransformation
virtual void AddPrimitive(const G4Polyline &)=0
G4String GetName() const
virtual G4ThreeVector GetPointOnSurface() const
Definition: G4VSolid.cc:152
virtual G4Polyhedron * GetPolyhedron() const
Definition: G4VSolid.cc:705
static void SetNumberOfRotationSteps(G4int n)
static void ResetNumberOfRotationSteps()

References G4VSceneHandler::AddPrimitive(), G4VSceneHandler::BeginPrimitives(), G4ViewParameters::cloud, G4Polymarker::dots, G4VSceneHandler::EndPrimitives(), G4VisManager::errors, G4VSceneHandler::fObjectTransformation, G4VSceneHandler::fpModel, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4cerr, G4endl, G4VSceneHandler::GetDrawingStyle(), G4PhysicalVolumeModel::GetFullPVPath(), G4VSolid::GetName(), G4VSceneHandler::GetNoOfSides(), G4ViewParameters::GetNumberOfCloudPoints(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSolid::GetPointOnSurface(), G4VSolid::GetPolyhedron(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, HepPolyhedron::ResetNumberOfRotationSteps(), G4VMarker::screen, G4Polymarker::SetMarkerType(), HepPolyhedron::SetNumberOfRotationSteps(), G4VMarker::SetSize(), G4Visible::SetVisAttributes(), and G4ViewParameters::wireframe.

Referenced by G4VSceneHandler::AddSolidT(), and G4VSceneHandler::AddSolidWithAuxiliaryEdges().

◆ ScaledFlush()

void G4OpenGLSceneHandler::ScaledFlush ( )
protected

Definition at line 116 of file G4OpenGLSceneHandler.cc.

117{
119
120 // Drawing transients, e.g., trajectories.
121
122 if (!fpScene) {
123 // No scene - shouldn't happen
124 glFlush();
125 return;
126 }
127 // Get event from modeling parameters
128 if (!fpModel) {
129 // No model - shouldn't happen
130 glFlush();
131 return;
132 }
133 const G4ModelingParameters* modelingParameters =
135 if (!modelingParameters) {
136 // No modeling parameters - shouldn't happen
137 glFlush();
138 return;
139 }
140 const G4Event* thisEvent = modelingParameters->GetEvent();
141 if (!thisEvent) {
142 // No event, so not in event loop.
143 if (fFlushAction == endOfEvent) {
145 } else if (fFlushAction == NthEvent) {
147 }
148 }
150 if (!runMan) {
151 // No run manager - shouldn't happen
152 glFlush();
153 return;
154 }
155 const G4Run* thisRun = runMan->GetCurrentRun();
156 if (!thisRun) {
157 // No run, so not in event loop.
158 if (fFlushAction == endOfRun) {
160 } else if (fFlushAction == NthEvent) {
162 }
163 }
164
165 switch (fFlushAction) {
166 case endOfEvent:
167 // If "/vis/scene/endOfEventAction refresh", primitives are flushed at
168 // end of run anyway, so only scale if false.
170 // But if "/vis/scene/endOfEventAction accumulate", ShowView is not
171 // called until end of run, so we have to watch for a new event.
172 // Get event from modeling parameters
173 G4int thisEventID = thisEvent->GetEventID();
174 static G4int lastEventID = 0;
175 if (thisEventID != lastEventID) {
176 glFlush();
177 lastEventID = thisEventID;
178 }
179 }
180 break;
181 case endOfRun:
182 // If "/vis/scene/endOfRunAction refresh", primitives are flushed at
183 // end of run anyway, so only scale if false.
185 // If "/vis/scene/endOfRunAction accumulate", ShowView is never called
186 // so we have to watch for a new run.
187 G4int thisRunID = thisRun->GetRunID();
188 static G4int lastRunID = 0;
189 if (thisRunID != lastRunID) {
190 glFlush();
191 lastRunID = thisRunID;
192 }
193 }
194 break;
195 case eachPrimitive:
196 // This is equivalent to numeric with fEntitiesFlushInterval == 1.
198 [[fallthrough]]; // Fall through to NthPrimitive.
199 case NthPrimitive:
200 { // Encapsulate in scope {} brackets to satisfy Windows.
201 static G4int primitivesWaitingToBeFlushed = 0;
202 primitivesWaitingToBeFlushed++;
203 if (primitivesWaitingToBeFlushed < fEntitiesFlushInterval) return;
204 glFlush();
205 primitivesWaitingToBeFlushed = 0;
206 break;
207 }
208 case NthEvent:
209 // If "/vis/scene/endOfEventAction refresh", primitives are flushed at
210 // end of event anyway, so only scale if false.
212 G4int thisEventID = thisEvent->GetEventID();
213 static G4int lastEventID = 0;
214 if (thisEventID != lastEventID) {
215 static G4int eventsWaitingToBeFlushed = 0;
216 eventsWaitingToBeFlushed++;
217 if (eventsWaitingToBeFlushed < fEntitiesFlushInterval) return;
218 glFlush();
219 eventsWaitingToBeFlushed = 0;
220 lastEventID = thisEventID;
221 }
222 }
223 break;
224 case never:
225 break;
226 default:
227 break;
228 }
229
230 }
231
232 else
233
234 {
235
236 // For run duration model drawing (detector drawing):
237 // Immediate mode: a huge speed up is obtained if flushes are scaled.
238 // Stored mode: no discernable difference since drawing is done to the
239 // back buffer and then swapped.
240 // So eachPrimitive and NthPrimitive make sense. But endOfEvent and
241 // endOfRun are treated as "no action", i.e., a flush will only be issued,
242 // as happens anyway, when drawing is complete.
243
244 switch (fFlushAction) {
245 case endOfEvent:
246 break;
247 case endOfRun:
248 break;
249 case eachPrimitive:
250 // This is equivalent to NthPrimitive with fEntitiesFlushInterval == 1.
252 [[fallthrough]]; // Fall through to NthPrimitive.
253 case NthPrimitive:
254 { // Encapsulate in scope {} brackets to satisfy Windows.
255 static G4int primitivesWaitingToBeFlushed = 0;
256 primitivesWaitingToBeFlushed++;
257 if (primitivesWaitingToBeFlushed < fEntitiesFlushInterval) return;
258 glFlush();
259 primitivesWaitingToBeFlushed = 0;
260 break;
261 }
262 case NthEvent:
263 break;
264 case never:
265 break;
266 default:
267 break;
268 }
269
270 }
271}
G4int GetEventID() const
Definition: G4Event.hh:118
const G4Event * GetEvent() const
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
Definition: G4Run.hh:49
G4int GetRunID() const
Definition: G4Run.hh:78
G4bool GetRefreshAtEndOfEvent() const
G4bool GetRefreshAtEndOfRun() const
const G4ModelingParameters * GetModelingParameters() const

References eachPrimitive, endOfEvent, endOfRun, fEntitiesFlushInterval, fFlushAction, G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, G4VSceneHandler::fReadyForTransients, G4RunManager::GetCurrentRun(), G4ModelingParameters::GetEvent(), G4Event::GetEventID(), G4RunManagerFactory::GetMasterRunManager(), G4VModel::GetModelingParameters(), G4Scene::GetRefreshAtEndOfEvent(), G4Scene::GetRefreshAtEndOfRun(), G4Run::GetRunID(), never, NthEvent, and NthPrimitive.

Referenced by G4OpenGLImmediateSceneHandler::EndPrimitives(), G4OpenGLStoredSceneHandler::EndPrimitives(), G4OpenGLImmediateSceneHandler::EndPrimitives2D(), and G4OpenGLStoredSceneHandler::EndPrimitives2D().

◆ SetCurrentViewer()

void G4VSceneHandler::SetCurrentViewer ( G4VViewer )
inherited

◆ SetEntitiesFlushInterval()

static void G4OpenGLSceneHandler::SetEntitiesFlushInterval ( G4int  interval)
inlinestatic

Definition at line 101 of file G4OpenGLSceneHandler.hh.

102 {fEntitiesFlushInterval = interval;}

References fEntitiesFlushInterval.

Referenced by G4OpenGLViewerMessenger::SetNewValue().

◆ SetFlushAction()

static void G4OpenGLSceneHandler::SetFlushAction ( FlushAction  action)
inlinestatic

◆ SetMarkForClearingTransientStore()

void G4VSceneHandler::SetMarkForClearingTransientStore ( G4bool  )
inherited

◆ SetModel()

void G4VSceneHandler::SetModel ( G4VModel )
inherited

◆ SetName()

void G4VSceneHandler::SetName ( const G4String )
inherited

◆ SetObjectTransformation()

void G4VSceneHandler::SetObjectTransformation ( const G4Transform3D )
inherited

◆ SetScene()

void G4VSceneHandler::SetScene ( G4Scene pScene)
virtualinherited

Reimplemented in G4OpenGLStoredQtSceneHandler.

Definition at line 507 of file G4VSceneHandler.cc.

507 {
508 fpScene = pScene;
509 // Notify all viewers that a kernel visit is required.
511 for (i = fViewerList.begin(); i != fViewerList.end(); i++) {
512 (*i) -> SetNeedKernelVisit (true);
513 }
514}
std::vector< G4VViewer * >::iterator G4ViewerListIterator
Definition: G4ViewerList.hh:42

References G4VSceneHandler::fpScene, and G4VSceneHandler::fViewerList.

Referenced by G4OpenGLStoredQtSceneHandler::SetScene().

◆ SetTransientsDrawnThisEvent()

void G4VSceneHandler::SetTransientsDrawnThisEvent ( G4bool  )
inherited

◆ SetTransientsDrawnThisRun()

void G4VSceneHandler::SetTransientsDrawnThisRun ( G4bool  )
inherited

◆ SetViewerList()

G4ViewerList & G4VSceneHandler::SetViewerList ( )
inherited

Friends And Related Function Documentation

◆ G4OpenGLViewer

friend class G4OpenGLViewer
friend

Definition at line 48 of file G4OpenGLSceneHandler.hh.

Field Documentation

◆ fEdgeFlag

bool G4OpenGLSceneHandler::fEdgeFlag
protected

Definition at line 177 of file G4OpenGLSceneHandler.hh.

Referenced by AddPrimitive().

◆ fEntitiesFlushInterval

G4int G4OpenGLSceneHandler::fEntitiesFlushInterval = 100
staticprotected

◆ fFlushAction

G4OpenGLSceneHandler::FlushAction G4OpenGLSceneHandler::fFlushAction = G4OpenGLSceneHandler::NthEvent
staticprotected

Definition at line 163 of file G4OpenGLSceneHandler.hh.

Referenced by GetFlushAction(), ScaledFlush(), and SetFlushAction().

◆ fIdentityTransformation

const G4Transform3D G4VSceneHandler::fIdentityTransformation
protectedinherited

Definition at line 364 of file G4VSceneHandler.hh.

◆ fMarkForClearingTransientStore

G4bool G4VSceneHandler::fMarkForClearingTransientStore
protectedinherited

Definition at line 352 of file G4VSceneHandler.hh.

Referenced by G4VSceneHandler::ProcessScene().

◆ fName

G4String G4VSceneHandler::fName
protectedinherited

Definition at line 347 of file G4VSceneHandler.hh.

◆ fNestingDepth

G4int G4VSceneHandler::fNestingDepth
protectedinherited

◆ fObjectTransformation

G4Transform3D G4VSceneHandler::fObjectTransformation
protectedinherited

◆ fPickMap

std::map<GLuint, G4AttHolder*> G4OpenGLSceneHandler::fPickMap
protected

◆ fPickName

GLuint G4OpenGLSceneHandler::fPickName
protected

◆ fpModel

G4VModel* G4VSceneHandler::fpModel
protectedinherited

◆ fProcessing2D

G4bool G4VSceneHandler::fProcessing2D
protectedinherited

◆ fProcessingSolid

G4bool G4VSceneHandler::fProcessingSolid
protectedinherited

◆ fpScene

G4Scene* G4VSceneHandler::fpScene
protectedinherited

◆ fpViewer

G4VViewer* G4VSceneHandler::fpViewer
protectedinherited

Definition at line 350 of file G4VSceneHandler.hh.

Referenced by G4OpenInventorSceneHandler::AddCircleSquare(), G4VtkSceneHandler::AddCompound(), G4HepRepFileSceneHandler::AddHepRepInstance(), G4ToolsSGSceneHandler::AddPrimitive(), AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), G4OpenInventorSceneHandler::AddProperties(), G4HepRepFileSceneHandler::AddSolid(), G4VSceneHandler::AddSolidT(), G4VSceneHandler::AddSolidWithAuxiliaryEdges(), G4OpenInventorSceneHandler::AddTransform(), G4OpenGLImmediateSceneHandler::BeginPrimitives2D(), G4OpenGLStoredQtSceneHandler::ClearStore(), G4GMocrenFileSceneHandler::ClearTransientStore(), G4HepRepFileSceneHandler::ClearTransientStore(), G4OpenGLImmediateSceneHandler::ClearTransientStore(), G4OpenGLStoredQtSceneHandler::ClearTransientStore(), G4OpenGLStoredSceneHandler::ClearTransientStore(), G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::CreateSectionSolid(), G4OpenGLStoredSceneHandler::EndModeling(), G4OpenGLStoredQtSceneHandler::ExtraPOProcessing(), G4OpenInventorSceneHandler::GeneratePrerequisites(), G4VSceneHandler::GetAuxEdgeVisible(), G4VSceneHandler::GetColour(), G4VSceneHandler::GetDrawingStyle(), G4VSceneHandler::GetLineWidth(), G4VSceneHandler::GetMarkerSize(), G4VSceneHandler::GetNoOfSides(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSceneHandler::GetTextColour(), G4GMocrenFileSceneHandler::IsVisible(), G4VSceneHandler::RequestPrimitives(), and G4OpenGLStoredQtSceneHandler::SetScene().

◆ fpVisAttribs

const G4VisAttributes* G4VSceneHandler::fpVisAttribs
protectedinherited

◆ fReadyForTransients

G4bool G4VSceneHandler::fReadyForTransients
protectedinherited

◆ fSceneHandlerId

const G4int G4VSceneHandler::fSceneHandlerId
protectedinherited

Definition at line 346 of file G4VSceneHandler.hh.

◆ fSecondPassForTransparency

G4bool G4OpenGLSceneHandler::fSecondPassForTransparency
protected

◆ fSecondPassForTransparencyRequested

G4bool G4OpenGLSceneHandler::fSecondPassForTransparencyRequested
protected

◆ fStippleMaskHashed

const GLubyte G4OpenGLSceneHandler::fStippleMaskHashed
staticprotected
Initial value:
= {
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55
}

Definition at line 176 of file G4OpenGLSceneHandler.hh.

◆ fSystem

G4VGraphicsSystem& G4VSceneHandler::fSystem
protectedinherited

Definition at line 345 of file G4VSceneHandler.hh.

Referenced by G4VSceneHandler::AddPrimitive().

◆ fThirdPassForNonHiddenMarkers

G4bool G4OpenGLSceneHandler::fThirdPassForNonHiddenMarkers
protected

◆ fThirdPassForNonHiddenMarkersRequested

G4bool G4OpenGLSceneHandler::fThirdPassForNonHiddenMarkersRequested
protected

◆ fThreePassCapable

G4bool G4OpenGLSceneHandler::fThreePassCapable
protected

◆ fTransientsDrawnThisEvent

G4bool G4VSceneHandler::fTransientsDrawnThisEvent
protectedinherited

◆ fTransientsDrawnThisRun

G4bool G4VSceneHandler::fTransientsDrawnThisRun
protectedinherited

◆ fViewCount

G4int G4VSceneHandler::fViewCount
protectedinherited

Definition at line 348 of file G4VSceneHandler.hh.

◆ fViewerList

G4ViewerList G4VSceneHandler::fViewerList
protectedinherited

The documentation for this class was generated from the following files: