Geant4-11
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Friends
G4OpenGLStoredSceneHandler Class Reference

#include <G4OpenGLStoredSceneHandler.hh>

Inheritance diagram for G4OpenGLStoredSceneHandler:
G4OpenGLSceneHandler G4VSceneHandler G4VGraphicsScene G4OpenGLStoredQtSceneHandler

Data Structures

struct  G4TextPlus
 
struct  PO
 
struct  TO
 

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)
 
void BeginModeling ()
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
void ClearStore ()
 
void ClearTransientStore ()
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEndOfRunModels ()
 
void DrawEvent (const G4Event *)
 
void EndModeling ()
 
void EndPrimitives ()
 
void EndPrimitives2D ()
 
 G4OpenGLStoredSceneHandler (G4VGraphicsSystem &system, const G4String &name="")
 
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 ()
 
virtual ~G4OpenGLStoredSceneHandler ()
 

Static Public Member Functions

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

Protected Member Functions

void AddPrimitivePostamble ()
 
G4bool AddPrimitivePreamble (const G4Polyhedron &visible)
 
G4bool AddPrimitivePreamble (const G4Polyline &visible)
 
G4bool AddPrimitivePreamble (const G4VMarker &visible)
 
void ClearAndDestroyAtts ()
 
G4DisplacedSolidCreateCutawaySolid ()
 
G4DisplacedSolidCreateSectionSolid ()
 
virtual G4bool ExtraPOProcessing (const G4Visible &, size_t)
 
virtual G4bool ExtraTOProcessing (const G4Visible &, size_t)
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
void ScaledFlush ()
 

Protected Attributes

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

Static Protected Attributes

static G4int fDisplayListId = 0
 
static G4int fDisplayListLimit = 1e7
 
static G4int fEntitiesFlushInterval = 100
 
static FlushAction fFlushAction = G4OpenGLSceneHandler::NthEvent
 
static G4bool fMemoryForDisplayLists = true
 
static G4int fSceneIdCount = 0
 
static const GLubyte fStippleMaskHashed [128]
 

Private Member Functions

bool AddPrimitivePreambleInternal (const G4Visible &visible, bool isMarker, bool isPolyline)
 

Friends

class G4OpenGLStoredViewer
 

Detailed Description

Definition at line 43 of file G4OpenGLStoredSceneHandler.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

◆ G4OpenGLStoredSceneHandler()

G4OpenGLStoredSceneHandler::G4OpenGLStoredSceneHandler ( G4VGraphicsSystem system,
const G4String name = "" 
)

Definition at line 149 of file G4OpenGLStoredSceneHandler.cc.

151 :
153fTopPODL (0)
154{}
G4OpenGLSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
const char * name(G4int ptype)

◆ ~G4OpenGLStoredSceneHandler()

G4OpenGLStoredSceneHandler::~G4OpenGLStoredSceneHandler ( )
virtual

Definition at line 156 of file G4OpenGLStoredSceneHandler.cc.

157{}

Member Function Documentation

◆ AddCompound() [1/6]

void G4OpenGLSceneHandler::AddCompound ( const G4Mesh mesh)
virtualinherited

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(), G4OpenGLSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddSolid(), G4PseudoScene::AddSolid(), G4OpenGLSceneHandler::BeginPrimitives(), G4VisManager::confirmations, G4PhysicalVolumeModel::DescribeYourselfTo(), G4Polymarker::dots, G4OpenGLSceneHandler::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)
virtualinherited

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)
virtualinherited

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)
virtualinherited

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)
virtualinherited

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)
virtualinherited

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 G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Circle circle)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 518 of file G4OpenGLStoredSceneHandler.cc.

519{
520 G4bool furtherprocessing = AddPrimitivePreamble(circle);
521 if (furtherprocessing) {
524 }
525}
G4bool AddPrimitivePreamble(const G4VMarker &visible)

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [2/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Circle )
virtual

Reimplemented from G4OpenGLSceneHandler.

◆ AddPrimitive() [3/13]

void G4VSceneHandler::AddPrimitive ( const G4Plotter )
virtual

Reimplemented from G4OpenGLSceneHandler.

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 G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Polyhedron polyhedron)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 536 of file G4OpenGLStoredSceneHandler.cc.

537{
538 // Note: colour is still handled in
539 // G4OpenGLSceneHandler::AddPrimitive(const G4Polyhedron&), so it still
540 // gets into the display list
541 G4bool furtherprocessing = AddPrimitivePreamble(polyhedron);
542 if (furtherprocessing) {
545 }
546}

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [5/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Reimplemented from G4OpenGLSceneHandler.

◆ AddPrimitive() [6/13]

void G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Polyline polyline)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 488 of file G4OpenGLStoredSceneHandler.cc.

489{
490 G4bool furtherprocessing = AddPrimitivePreamble(polyline);
491 if (furtherprocessing) {
494 }
495}

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [7/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Reimplemented from G4OpenGLSceneHandler.

◆ AddPrimitive() [8/13]

void G4VSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4OpenGLSceneHandler.

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}
void AddPrimitive(const G4Polyline &)
MarkerType GetMarkerType() const

◆ AddPrimitive() [9/13]

void G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 497 of file G4OpenGLStoredSceneHandler.cc.

498{
499 G4bool furtherprocessing = AddPrimitivePreamble(polymarker);
500 if (furtherprocessing) {
503 }
504}

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [10/13]

void G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Square square)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 527 of file G4OpenGLStoredSceneHandler.cc.

528{
529 G4bool furtherprocessing = AddPrimitivePreamble(square);
530 if (furtherprocessing) {
533 }
534}

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [11/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Square )
virtual

Reimplemented from G4OpenGLSceneHandler.

◆ AddPrimitive() [12/13]

void G4OpenGLStoredSceneHandler::AddPrimitive ( const G4Text text)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 506 of file G4OpenGLStoredSceneHandler.cc.

507{
508 // Note: colour is still handled in
509 // G4OpenGLSceneHandler::AddPrimitive(const G4Text&), so it still
510 // gets into the display list
511 G4bool furtherprocessing = AddPrimitivePreamble(text);
512 if (furtherprocessing) {
515 }
516}

References G4OpenGLSceneHandler::AddPrimitive(), AddPrimitivePostamble(), and AddPrimitivePreamble().

◆ AddPrimitive() [13/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Text )
virtual

Reimplemented from G4OpenGLSceneHandler.

◆ AddPrimitivePostamble()

void G4OpenGLStoredSceneHandler::AddPrimitivePostamble ( )
protected

Definition at line 457 of file G4OpenGLStoredSceneHandler.cc.

458{
459 if (fProcessing2D) {
460 // Pop current 3D world matrices back again...
461 glMatrixMode (GL_PROJECTION);
462 glPopMatrix();
463 glMatrixMode (GL_MODELVIEW);
464 glPopMatrix();
465 }
466
467 // if ((glGetError() == GL_TABLE_TOO_LARGE) || (glGetError() == GL_OUT_OF_MEMORY)) { // Could close?
468 if (glGetError() == GL_OUT_OF_MEMORY) { // Could close?
469 G4cerr <<
470 "ERROR: G4OpenGLStoredSceneHandler::AddPrimitivePostamble: Failure"
471 " to allocate display List for fTopPODL - try OpenGL Immediated mode."
472 << G4endl;
473 }
475 glEndList();
476 if (glGetError() == GL_OUT_OF_MEMORY) { // Could close?
477 G4cerr <<
478 "ERROR: G4OpenGLStoredSceneHandler::AddPrimitivePostamble: Failure"
479 " to allocate display List for fTopPODL - try OpenGL Immediated mode."
480 << G4endl;
481 }
482 }
484 glPopMatrix();
485 }
486}

References fMemoryForDisplayLists, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fReadyForTransients, G4cerr, and G4endl.

Referenced by AddPrimitive().

◆ AddPrimitivePreamble() [1/3]

G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble ( const G4Polyhedron visible)
protected

Definition at line 198 of file G4OpenGLStoredSceneHandler.cc.

199{
200 return AddPrimitivePreambleInternal(visible, false, false);
201}
bool AddPrimitivePreambleInternal(const G4Visible &visible, bool isMarker, bool isPolyline)

References AddPrimitivePreambleInternal().

◆ AddPrimitivePreamble() [2/3]

G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble ( const G4Polyline visible)
protected

Definition at line 194 of file G4OpenGLStoredSceneHandler.cc.

195{
196 return AddPrimitivePreambleInternal(visible, false, true);
197}

References AddPrimitivePreambleInternal().

◆ AddPrimitivePreamble() [3/3]

G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreamble ( const G4VMarker visible)
protected

Definition at line 190 of file G4OpenGLStoredSceneHandler.cc.

191{
192 return AddPrimitivePreambleInternal(visible, true, false);
193}

References AddPrimitivePreambleInternal().

Referenced by AddPrimitive().

◆ AddPrimitivePreambleInternal()

G4bool G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal ( const G4Visible visible,
bool  isMarker,
bool  isPolyline 
)
private

Definition at line 203 of file G4OpenGLStoredSceneHandler.cc.

205{
206// Get applicable vis attributes for all primitives.
208 const G4Colour& c = GetColour ();
209 G4double opacity = c.GetAlpha ();
210
211 G4bool transparency_enabled = true;
212 G4bool isMarkerNotHidden = true;
213 G4OpenGLViewer* pOGLViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
214 if (pOGLViewer) {
215 transparency_enabled = pOGLViewer->transparency_enabled;
216 isMarkerNotHidden = pOGLViewer->fVP.IsMarkerNotHidden();
217 }
218
219 G4bool isTransparent = opacity < 1.;
220 G4bool isMarkerOrPolyline = isMarker || isPolyline;
221 G4bool treatAsTransparent = transparency_enabled && isTransparent;
222 G4bool treatAsNotHidden = isMarkerNotHidden && isMarkerOrPolyline;
223
224 if (fProcessing2D) glDisable (GL_DEPTH_TEST);
225 else {
226 if (isMarkerOrPolyline && isMarkerNotHidden)
227 glDisable (GL_DEPTH_TEST);
228 else {glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LEQUAL);}
229 }
230
231 if (fThreePassCapable) {
232
233 // Ensure transparent objects are drawn opaque ones and before
234 // non-hidden markers. The problem of blending/transparency/alpha
235 // is quite a tricky one - see History of opengl-V07-01-01/2/3.
237 // First pass...
238 if (treatAsTransparent) { // Request pass for transparent objects...
240 }
241 if (treatAsNotHidden) { // Request pass for non-hidden markers...
243 }
244 // On first pass, transparent objects and non-hidden markers are not drawn...
245 if (treatAsTransparent || treatAsNotHidden) {
246 return false; // No further processing.
247 }
248 }
249
250 // On second pass, only transparent objects are drawn...
252 if (!treatAsTransparent) {
253 return false; // No further processing.
254 }
255 }
256
257 // On third pass, only non-hidden markers are drawn...
259 if (!treatAsNotHidden) {
260 return false; // No further processing.
261 }
262 }
263 } // fThreePassCapable
264
265 // Loads G4Atts for picking...
266 G4bool isPicking = false;
268 isPicking = true;
269 glLoadName(++fPickName);
270 G4AttHolder* holder = new G4AttHolder;
271 LoadAtts(visible, holder);
272 fPickMap[fPickName] = holder;
273 }
274
275 const G4VSolid* pSolid = 0;
276
277 // Can we re-use a display list?
278 if (isMarker)
279 // It is a marker, which may have its own position relative to fObjectTransformation
280 goto end_of_display_list_reuse_test;
282 // Touchables have been modified - don't risk re-using display list.
283 goto end_of_display_list_reuse_test;
284 { // It is a viable candidate for display list re-use
285 G4PhysicalVolumeModel* pPVModel = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
286 if (pPVModel) {
287 // Check that it isn't a G4LogicalVolumeModel (which is a sub-class of
288 // G4PhysicalVolumeModel).
289 G4LogicalVolumeModel* pLVModel =
290 dynamic_cast<G4LogicalVolumeModel*>(pPVModel);
291 if (pLVModel)
292 // Logical volume model - don't re-use.
293 goto end_of_display_list_reuse_test;
294 // If part of the geometry hierarchy, i.e., from a
295 // G4PhysicalVolumeModel, check if a display list already exists for
296 // this solid, re-use it if possible. We could be smarter, and
297 // recognise repeated branches of the geometry hierarchy, for
298 // example. But this algorithm should be secure, I think...
299 G4VPhysicalVolume* pPV = pPVModel->GetCurrentPV();
300 if (!pPV)
301 // It's probably a dummy model, e.g., for a user-drawn hit?
302 goto end_of_display_list_reuse_test;
303 G4LogicalVolume* pLV = pPV->GetLogicalVolume();
304 if (!pLV)
305 // Dummy model again?
306 goto end_of_display_list_reuse_test;
307 pSolid = pLV->GetSolid();
308 EAxis axis = kRho;
309 G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
310 if (pCurrentPV -> IsReplicated ()) {
311 G4int nReplicas;
312 G4double width;
313 G4double offset;
314 G4bool consuming;
315 pCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming);
316 }
317 // Provided it is not parametrised (because if so, the
318 // solid's parameters might have been changed)...
319 if (!(pCurrentPV -> IsParameterised ()) &&
320 // Provided it is not replicated radially (because if so, the
321 // solid's parameters will have been changed)...
322 !(pCurrentPV -> IsReplicated () && axis == kRho) &&
323 // ...and if the solid has already been rendered...
324 (fSolidMap.find (pSolid) != fSolidMap.end ())) {
325 fDisplayListId = fSolidMap [pSolid];
327 if (isPicking) po.fPickName = fPickName;
328 po.fColour = c;
329 po.fMarkerOrPolyline = isMarkerOrPolyline;
330 fPOList.push_back(po);
331 // No need to test if gl commands are used (result of
332 // ExtraPOProcessing) because we have already decided they will
333 // not, at least not here. Also, pass a dummy G4Visible since
334 // not relevant for G4PhysicalVolumeModel.
335 (void) ExtraPOProcessing(G4Visible(), fPOList.size() - 1);
336 return false; // No further processing.
337 }
338 }
339 }
340end_of_display_list_reuse_test:
341
342 // Because of our need to control colour of transients (display by
343 // time fading), display lists may only cover a single primitive.
344 // So display list setup is here.
345
347 fDisplayListId = glGenLists (1);
348 if (glGetError() == GL_OUT_OF_MEMORY ||
350 G4cout <<
351 "********************* WARNING! ********************"
352 "\n* Display list limit reached in OpenGL."
353 "\n* Continuing drawing WITHOUT STORING. Scene only partially refreshable."
354 "\n* Current limit: " << fDisplayListLimit << " primitives"
355 ". Change with \"/vis/ogl/set/displayListLimit\"."
356 "\n***************************************************"
357 << G4endl;
359 }
360 }
361
362 if (pSolid) fSolidMap [pSolid] = fDisplayListId;
363
367 if (isPicking) to.fPickName = fPickName;
368 to.fColour = c;
369 to.fStartTime = fpVisAttribs->GetStartTime();
370 to.fEndTime = fpVisAttribs->GetEndTime();
371 to.fMarkerOrPolyline = isMarkerOrPolyline;
372 fTOList.push_back(to);
373 // For transient objects, colour, transformation, are kept in
374 // the TO, so should *not* be in the display list. As mentioned
375 // above, in some cases (display-by-time fading) we need to have
376 // independent control of colour. But for now transform and set
377 // colour for immediate display.
378 glPushMatrix();
380 glMultMatrixd (oglt.GetGLMatrix ());
381 if (transparency_enabled) {
382 glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha());
383 } else {
384 glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue());
385 }
386 (void) ExtraTOProcessing(visible, fTOList.size() - 1);
387 // Ignore return value of the above. If this visible does not use
388 // gl commands, a display list is created that is empty and not
389 // used.
390 glNewList (fDisplayListId, GL_COMPILE_AND_EXECUTE);
391 } else {
393 if (isPicking) po.fPickName = fPickName;
394 po.fColour = c;
395 po.fMarkerOrPolyline = isMarkerOrPolyline;
396 fPOList.push_back(po);
397 // For permanent objects, colour is kept in the PO, so should
398 // *not* be in the display list. This is so that sub-classes
399 // may implement colour modifications according to their own
400 // criteria, e.g., scene tree slider in Qt. But for now set
401 // colour for immediate display.
402 if (transparency_enabled) {
403 glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha());
404 } else {
405 glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue());
406 }
407 G4bool usesGLCommands = ExtraPOProcessing(visible, fPOList.size() - 1);
408 // Transients are displayed as they come (GL_COMPILE_AND_EXECUTE
409 // above) but persistents are compiled into display lists
410 // (GL_COMPILE only) and then drawn from the display lists with
411 // their fObjectTransformation as stored in fPOList. Thus,
412 // there is no need to do glMultMatrixd here. If
413 // ExtraPOProcessing says the visible object does not use gl
414 // commands, simply return and abandon further processing. It
415 // is assumed that all relevant information is kept in the
416 // POList.
417 if (!usesGLCommands) return false;
418 glNewList (fDisplayListId, GL_COMPILE);
419 }
420 } else { // Out of memory (or being used when display lists not required).
421 glPushMatrix();
423 glMultMatrixd (oglt.GetGLMatrix ());
424 if (transparency_enabled) {
425 glColor4d(c.GetRed(),c.GetGreen(),c.GetBlue(),c.GetAlpha());
426 } else {
427 glColor3d(c.GetRed(),c.GetGreen(),c.GetBlue());
428 }
429 }
430
431 if (fProcessing2D) {
432 // Push current 3D world matrices and load identity to define screen
433 // coordinates...
434 glMatrixMode (GL_PROJECTION);
435 glPushMatrix();
436 glLoadIdentity();
437 if (pOGLViewer) {
438 pOGLViewer->g4GlOrtho (-1., 1., -1., 1., -G4OPENGL_FLT_BIG, G4OPENGL_FLT_BIG);
439 }
440 glMatrixMode (GL_MODELVIEW);
441 glPushMatrix();
442 glLoadIdentity();
444 glMultMatrixd (oglt.GetGLMatrix ());
445 glDisable (GL_LIGHTING);
446 } else {
447 if (isMarker) {
448 glDisable (GL_LIGHTING);
449 } else {
450 glEnable (GL_LIGHTING);
451 }
452 }
453
454 return true;
455}
#define G4OPENGL_FLT_BIG
Definition: G4OpenGL.hh:89
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetAlpha() const
Definition: G4Colour.hh:155
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153
G4VSolid * GetSolid() const
std::map< GLuint, G4AttHolder * > fPickMap
virtual G4bool ExtraPOProcessing(const G4Visible &, size_t)
std::map< const G4VSolid *, G4int, std::less< const G4VSolid * > > fSolidMap
virtual G4bool ExtraTOProcessing(const G4Visible &, size_t)
G4bool transparency_enabled
void g4GlOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
G4VPhysicalVolume * GetCurrentPV() const
G4LogicalVolume * GetLogicalVolume() const
virtual void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
void LoadAtts(const G4Visible &, G4AttHolder *)
const G4Colour & GetColour()
G4Transform3D fObjectTransformation
G4VViewer * fpViewer
const G4VisAttributes * fpVisAttribs
const G4VisAttributes * GetApplicableVisAttributes(const G4VisAttributes *) const
const G4ViewParameters & GetViewParameters() const
G4ViewParameters fVP
Definition: G4VViewer.hh:219
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
G4bool IsMarkerNotHidden() const
G4bool IsPicking() const
G4double GetStartTime() const
G4double GetEndTime() const
const G4VisAttributes * GetVisAttributes() const
EAxis
Definition: geomdefs.hh:54
@ kRho
Definition: geomdefs.hh:58

References ExtraPOProcessing(), ExtraTOProcessing(), G4OpenGLStoredSceneHandler::PO::fColour, G4OpenGLStoredSceneHandler::TO::fColour, fDisplayListId, fDisplayListLimit, G4OpenGLStoredSceneHandler::TO::fEndTime, G4OpenGLStoredSceneHandler::PO::fMarkerOrPolyline, G4OpenGLStoredSceneHandler::TO::fMarkerOrPolyline, fMemoryForDisplayLists, G4VSceneHandler::fObjectTransformation, G4OpenGLSceneHandler::fPickMap, G4OpenGLSceneHandler::fPickName, G4OpenGLStoredSceneHandler::PO::fPickName, G4OpenGLStoredSceneHandler::TO::fPickName, G4VSceneHandler::fpModel, fPOList, G4VSceneHandler::fProcessing2D, G4VSceneHandler::fpViewer, G4VSceneHandler::fpVisAttribs, G4VSceneHandler::fReadyForTransients, G4OpenGLSceneHandler::fSecondPassForTransparency, G4OpenGLSceneHandler::fSecondPassForTransparencyRequested, fSolidMap, G4OpenGLStoredSceneHandler::TO::fStartTime, G4OpenGLSceneHandler::fThirdPassForNonHiddenMarkers, G4OpenGLSceneHandler::fThirdPassForNonHiddenMarkersRequested, G4OpenGLSceneHandler::fThreePassCapable, fTOList, G4VViewer::fVP, G4cout, G4endl, G4OpenGLViewer::g4GlOrtho(), G4OPENGL_FLT_BIG, G4Colour::GetAlpha(), G4VViewer::GetApplicableVisAttributes(), G4Colour::GetBlue(), G4VSceneHandler::GetColour(), G4PhysicalVolumeModel::GetCurrentPV(), G4VisAttributes::GetEndTime(), G4OpenGLTransform3D::GetGLMatrix(), G4Colour::GetGreen(), G4VPhysicalVolume::GetLogicalVolume(), G4Colour::GetRed(), G4VPhysicalVolume::GetReplicationData(), G4LogicalVolume::GetSolid(), G4VisAttributes::GetStartTime(), G4VViewer::GetViewParameters(), G4Visible::GetVisAttributes(), G4ViewParameters::GetVisAttributesModifiers(), G4ViewParameters::IsMarkerNotHidden(), G4ViewParameters::IsPicking(), kRho, G4VSceneHandler::LoadAtts(), and G4OpenGLViewer::transparency_enabled.

Referenced by AddPrimitivePreamble().

◆ AddPrimitivesCircle()

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

◆ AddPrimitivesSquare()

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

◆ AddSolid() [1/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Box )
virtualinherited

Reimplemented from G4VSceneHandler.

Referenced by G4OpenGLSceneHandler::AddCompound().

◆ AddSolid() [2/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Cons )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [3/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Ellipsoid )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [4/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Orb )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [5/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Para )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [6/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Polycone )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [7/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Polyhedra )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [8/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Sphere )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [9/14]

void G4OpenGLSceneHandler::AddSolid ( const G4TessellatedSolid )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [10/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Torus )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [11/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Trap )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [12/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Trd )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [13/14]

void G4OpenGLSceneHandler::AddSolid ( const G4Tubs )
virtualinherited

Reimplemented from G4VSceneHandler.

◆ AddSolid() [14/14]

void G4OpenGLSceneHandler::AddSolid ( const G4VSolid )
virtualinherited

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)

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 G4OpenGLStoredSceneHandler::BeginModeling ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 548 of file G4OpenGLStoredSceneHandler.cc.

548 {
550 /* Debug...
551 fDisplayListId = glGenLists (1);
552 G4cout << "OGL::fDisplayListId (start): " << fDisplayListId << G4endl;
553 */
554}
virtual void BeginModeling()

References G4VSceneHandler::BeginModeling().

◆ BeginPrimitives()

void G4OpenGLStoredSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 159 of file G4OpenGLStoredSceneHandler.cc.

161{
162 G4OpenGLSceneHandler::BeginPrimitives (objectTransformation);
163 if (fReadyForTransients) glDrawBuffer (GL_FRONT);
164 // Display list setup moved to AddPrimitivePreamble. See notes there.
165}

References G4OpenGLSceneHandler::BeginPrimitives(), and G4VSceneHandler::fReadyForTransients.

◆ BeginPrimitives2D()

void G4OpenGLStoredSceneHandler::BeginPrimitives2D ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 175 of file G4OpenGLStoredSceneHandler.cc.

177{
178 G4OpenGLSceneHandler::BeginPrimitives2D(objectTransformation);
179 if (fReadyForTransients) glDrawBuffer (GL_FRONT);
180}
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation)

References G4OpenGLSceneHandler::BeginPrimitives2D(), and G4VSceneHandler::fReadyForTransients.

◆ ClearAndDestroyAtts()

void G4OpenGLSceneHandler::ClearAndDestroyAtts ( )
protectedinherited

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}

References G4OpenGLSceneHandler::fPickMap.

Referenced by ClearStore().

◆ ClearStore()

void G4OpenGLStoredSceneHandler::ClearStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 590 of file G4OpenGLStoredSceneHandler.cc.

590 {
591
592 //G4cout << "G4OpenGLStoredSceneHandler::ClearStore" << G4endl;
593
594 G4VSceneHandler::ClearStore (); // Sets need kernel visit, etc.
595
596 // Delete OpenGL permanent display lists.
597 for (size_t i = 0; i < fPOList.size (); i++)
598 glDeleteLists (fPOList[i].fDisplayListId, 1);
599 if (fTopPODL) glDeleteLists (fTopPODL, 1);
600 fTopPODL = 0;
601
602 // Clear other lists, dictionary, etc.
603 fPOList.clear ();
604 fSolidMap.clear ();
606
607 // ...and clear transient store...
608 for (size_t i = 0; i < fTOList.size (); i++)
609 glDeleteLists(fTOList[i].fDisplayListId, 1);
610 fTOList.clear ();
611
613}
virtual void ClearStore()

References G4OpenGLSceneHandler::ClearAndDestroyAtts(), G4VSceneHandler::ClearStore(), fDisplayListId, fMemoryForDisplayLists, fPOList, fSolidMap, fTOList, and fTopPODL.

Referenced by G4OpenGLStoredQtSceneHandler::ClearStore().

◆ ClearTransientStore()

void G4OpenGLStoredSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 615 of file G4OpenGLStoredSceneHandler.cc.

616{
617 //G4cout << "G4OpenGLStoredSceneHandler::ClearTransientStore" << G4endl;
618
619 // Delete OpenGL transient display lists and Transient Objects themselves.
620 for (size_t i = 0; i < fTOList.size (); i++)
621 glDeleteLists(fTOList[i].fDisplayListId, 1);
622 fTOList.clear ();
623
625
626 // Redraw the scene ready for the next event.
627 if (fpViewer) {
628 fpViewer -> SetView ();
629 fpViewer -> ClearView ();
630 fpViewer -> DrawView ();
631 }
632}

References fDisplayListId, fMemoryForDisplayLists, G4VSceneHandler::fpViewer, and fTOList.

Referenced by G4OpenGLStoredQtSceneHandler::ClearTransientStore().

◆ CreateCutawaySolid()

G4DisplacedSolid * G4OpenGLSceneHandler::CreateCutawaySolid ( )
protectedvirtualinherited

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()
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsCutaway() const
G4bool IsSection() 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 ( )
protectedvirtualinherited

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 G4OpenGLStoredSceneHandler::EndModeling ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 556 of file G4OpenGLStoredSceneHandler.cc.

556 {
557 // Make a List which calls the other lists.
558 fTopPODL = glGenLists (1);
559 if (glGetError() == GL_OUT_OF_MEMORY) { // Could pre-allocate?
560 G4cerr <<
561 "ERROR: G4OpenGLStoredSceneHandler::EndModeling: Failure to allocate"
562 " display List for fTopPODL - try OpenGL Immediated mode."
563 << G4endl;
564 } else {
565
566 glNewList (fTopPODL, GL_COMPILE); {
567 for (size_t i = 0; i < fPOList.size (); i++) {
568 glPushMatrix();
569 G4OpenGLTransform3D oglt (fPOList[i].fTransform);
570 glMultMatrixd (oglt.GetGLMatrix ());
572 glLoadName(fPOList[i].fPickName);
573 glCallList (fPOList[i].fDisplayListId);
574 glPopMatrix();
575 }
576 }
577 glEndList ();
578
579 if (glGetError() == GL_OUT_OF_MEMORY) { // Could close?
580 G4cerr <<
581 "ERROR: G4OpenGLStoredSceneHandler::EndModeling: Failure to allocate"
582 " display List for fTopPODL - try OpenGL Immediated mode."
583 << G4endl;
584 }
585 }
586
588}
virtual void EndModeling()

References G4VSceneHandler::EndModeling(), fDisplayListId, G4OpenGLSceneHandler::fPickName, fPOList, G4VSceneHandler::fpViewer, fTopPODL, G4cerr, G4endl, G4OpenGLTransform3D::GetGLMatrix(), G4VViewer::GetViewParameters(), and G4ViewParameters::IsPicking().

◆ EndPrimitives()

void G4OpenGLStoredSceneHandler::EndPrimitives ( )
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 167 of file G4OpenGLStoredSceneHandler.cc.

168{
169 // See all primitives immediately... At least soon...
170 ScaledFlush();
171 glDrawBuffer (GL_BACK);
173}

References G4OpenGLSceneHandler::EndPrimitives(), and G4OpenGLSceneHandler::ScaledFlush().

◆ EndPrimitives2D()

void G4OpenGLStoredSceneHandler::EndPrimitives2D ( )
virtual

Reimplemented from G4OpenGLSceneHandler.

Definition at line 182 of file G4OpenGLStoredSceneHandler.cc.

183{
184 // See all primitives immediately... At least soon...
185 ScaledFlush();
186 glDrawBuffer (GL_BACK);
188}

References G4OpenGLSceneHandler::EndPrimitives2D(), and G4OpenGLSceneHandler::ScaledFlush().

◆ ExtraPOProcessing()

virtual G4bool G4OpenGLStoredSceneHandler::ExtraPOProcessing ( const G4Visible ,
size_t   
)
inlineprotectedvirtual

Reimplemented in G4OpenGLStoredQtSceneHandler.

Definition at line 85 of file G4OpenGLStoredSceneHandler.hh.

86{return true;}

Referenced by AddPrimitivePreambleInternal().

◆ ExtraTOProcessing()

virtual G4bool G4OpenGLStoredSceneHandler::ExtraTOProcessing ( const G4Visible ,
size_t   
)
inlineprotectedvirtual

Reimplemented in G4OpenGLStoredQtSceneHandler.

Definition at line 87 of file G4OpenGLStoredSceneHandler.hh.

88{return true;}

Referenced by AddPrimitivePreambleInternal().

◆ 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 G4OpenGLSceneHandler::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

◆ GetCurrentViewer()

G4VViewer * G4VSceneHandler::GetCurrentViewer ( ) const
inherited

◆ GetDisplayListLimit()

static G4int G4OpenGLStoredSceneHandler::GetDisplayListLimit ( )
inlinestatic

Definition at line 67 of file G4OpenGLStoredSceneHandler.hh.

67{return fDisplayListLimit;}

References fDisplayListLimit.

◆ 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 G4OpenGLSceneHandler::AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitiveTensorGlyph(), G4OpenInventorSceneHandler::AddProperties(), G4OpenInventorSceneHandler::GeneratePrerequisites(), and G4VSceneHandler::RequestPrimitives().

◆ GetEntitiesFlushInterval()

static G4int G4OpenGLSceneHandler::GetEntitiesFlushInterval ( )
inlinestaticinherited

◆ 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 ( )
inlinestaticinherited

Definition at line 99 of file G4OpenGLSceneHandler.hh.

100 {return fFlushAction;}
static FlushAction fFlushAction

References G4OpenGLSceneHandler::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 G4OpenGLSceneHandler::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(), G4OpenGLSceneHandler::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 G4OpenGLSceneHandler::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 AddPrimitivePreambleInternal().

◆ PostAddSolid()

void G4VSceneHandler::PostAddSolid ( )
virtualinherited

◆ PreAddSolid()

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

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 ( )
protectedvirtualinherited

◆ 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
G4int GetNoOfSides(const G4VisAttributes *)
virtual void EndPrimitives()
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())
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 ( )
protectedinherited

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 G4OpenGLSceneHandler::eachPrimitive, G4OpenGLSceneHandler::endOfEvent, G4OpenGLSceneHandler::endOfRun, G4OpenGLSceneHandler::fEntitiesFlushInterval, G4OpenGLSceneHandler::fFlushAction, G4VSceneHandler::fpModel, G4VSceneHandler::fpScene, G4VSceneHandler::fReadyForTransients, G4RunManager::GetCurrentRun(), G4ModelingParameters::GetEvent(), G4Event::GetEventID(), G4RunManagerFactory::GetMasterRunManager(), G4VModel::GetModelingParameters(), G4Scene::GetRefreshAtEndOfEvent(), G4Scene::GetRefreshAtEndOfRun(), G4Run::GetRunID(), G4OpenGLSceneHandler::never, G4OpenGLSceneHandler::NthEvent, and G4OpenGLSceneHandler::NthPrimitive.

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

◆ SetCurrentViewer()

void G4VSceneHandler::SetCurrentViewer ( G4VViewer )
inherited

◆ SetDisplayListLimit()

static void G4OpenGLStoredSceneHandler::SetDisplayListLimit ( G4int  lim)
inlinestatic

Definition at line 68 of file G4OpenGLStoredSceneHandler.hh.

68{fDisplayListLimit = lim;}

References fDisplayListLimit.

Referenced by G4OpenGLViewerMessenger::SetNewValue().

◆ SetEntitiesFlushInterval()

static void G4OpenGLSceneHandler::SetEntitiesFlushInterval ( G4int  interval)
inlinestaticinherited

◆ SetFlushAction()

static void G4OpenGLSceneHandler::SetFlushAction ( FlushAction  action)
inlinestaticinherited

◆ 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

◆ G4OpenGLStoredViewer

friend class G4OpenGLStoredViewer
friend

Definition at line 45 of file G4OpenGLStoredSceneHandler.hh.

Field Documentation

◆ fDisplayListId

G4int G4OpenGLStoredSceneHandler::fDisplayListId = 0
staticprotected

◆ fDisplayListLimit

G4int G4OpenGLStoredSceneHandler::fDisplayListLimit = 1e7
staticprotected

◆ fEdgeFlag

bool G4OpenGLSceneHandler::fEdgeFlag
protectedinherited

Definition at line 177 of file G4OpenGLSceneHandler.hh.

Referenced by G4OpenGLSceneHandler::AddPrimitive().

◆ fEntitiesFlushInterval

G4int G4OpenGLSceneHandler::fEntitiesFlushInterval = 100
staticprotectedinherited

◆ fFlushAction

G4OpenGLSceneHandler::FlushAction G4OpenGLSceneHandler::fFlushAction = G4OpenGLSceneHandler::NthEvent
staticprotectedinherited

◆ 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().

◆ fMemoryForDisplayLists

G4bool G4OpenGLStoredSceneHandler::fMemoryForDisplayLists = true
staticprotected

◆ 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
protectedinherited

◆ fPickName

GLuint G4OpenGLSceneHandler::fPickName
protectedinherited

◆ fpModel

G4VModel* G4VSceneHandler::fpModel
protectedinherited

◆ fPOList

std::vector<PO> G4OpenGLStoredSceneHandler::fPOList
protected

◆ 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(), G4OpenGLSceneHandler::AddPrimitive(), G4Qt3DSceneHandler::AddPrimitive(), G4VtkSceneHandler::AddPrimitive(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), 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(), ClearTransientStore(), G4VSceneHandler::CreateModelingParameters(), G4VSceneHandler::CreateSectionSolid(), 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.

◆ fSceneIdCount

G4int G4OpenGLStoredSceneHandler::fSceneIdCount = 0
staticprotected

Definition at line 90 of file G4OpenGLStoredSceneHandler.hh.

◆ fSecondPassForTransparency

G4bool G4OpenGLSceneHandler::fSecondPassForTransparency
protectedinherited

◆ fSecondPassForTransparencyRequested

G4bool G4OpenGLSceneHandler::fSecondPassForTransparencyRequested
protectedinherited

◆ fSolidMap

std::map<const G4VSolid*, G4int, std::less <const G4VSolid*> > G4OpenGLStoredSceneHandler::fSolidMap
protected

Definition at line 144 of file G4OpenGLStoredSceneHandler.hh.

Referenced by AddPrimitivePreambleInternal(), and ClearStore().

◆ fStippleMaskHashed

const GLubyte G4OpenGLSceneHandler::fStippleMaskHashed
staticprotectedinherited
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
protectedinherited

◆ fThirdPassForNonHiddenMarkersRequested

G4bool G4OpenGLSceneHandler::fThirdPassForNonHiddenMarkersRequested
protectedinherited

◆ fThreePassCapable

G4bool G4OpenGLSceneHandler::fThreePassCapable
protectedinherited

◆ fTOList

std::vector<TO> G4OpenGLStoredSceneHandler::fTOList
protected

◆ fTopPODL

GLint G4OpenGLStoredSceneHandler::fTopPODL
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: