Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLSceneHandler.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//
28//
29// Andrew Walkden 27th March 1996
30// OpenGL scene handler - base for immediate mode and stored mode classes to
31// inherit from.
32
33#ifndef G4OPENGLSCENEHANDLER_HH
34#define G4OPENGLSCENEHANDLER_HH
35
36#include "globals.hh"
37
38#include "G4VSceneHandler.hh"
39#include "G4OpenGL.hh"
40
41#include <map>
42
43class G4AttHolder;
44
45// Base class for various OpenGLSceneHandler classes.
47
48 friend class G4OpenGLViewer;
49
50public:
51 virtual void BeginPrimitives (const G4Transform3D& objectTransformation);
52 virtual void EndPrimitives ();
53 virtual void BeginPrimitives2D (const G4Transform3D& objectTransformation);
54 virtual void EndPrimitives2D ();
56 void AddPrimitive (const G4Polyline&);
57 void AddPrimitive (const G4Polymarker&);
58 void AddPrimitive (const G4Text&);
59 void AddPrimitive (const G4Circle&);
60 void AddPrimitive (const G4Square&);
61 void AddPrimitivesCircle (const std::vector <G4VMarker>&);
62 void AddPrimitivesSquare (const std::vector <G4VMarker>&);
63 void AddPrimitive (const G4Polyhedron&);
65 void PreAddSolid (const G4Transform3D& objectTransformation,
66 const G4VisAttributes&);
67 void AddSolid (const G4Box&);
68 void AddSolid (const G4Cons&);
69 void AddSolid (const G4Tubs&);
70 void AddSolid (const G4Trd&);
71 void AddSolid (const G4Trap&);
72 void AddSolid (const G4Sphere&);
73 void AddSolid (const G4Para&);
74 void AddSolid (const G4Torus&);
75 void AddSolid (const G4Polycone&);
76 void AddSolid (const G4Polyhedra&);
77 void AddSolid (const G4Orb&);
78 void AddSolid (const G4Ellipsoid&);
80 void AddSolid (const G4VSolid&);
81 void AddCompound (const G4VTrajectory&);
82 void AddCompound (const G4VHit&);
83 void AddCompound (const G4VDigi&);
86 void AddCompound (const G4Mesh&);
87
88 // enum for /vis/ogl/flushAt.
100 {return fFlushAction;}
101 static void SetEntitiesFlushInterval(G4int interval)
102 {fEntitiesFlushInterval = interval;}
103 static void SetFlushAction(FlushAction action)
104 {fFlushAction = action;}
105
106protected:
107
109 G4int id,
110 const G4String& name = "");
111 virtual ~G4OpenGLSceneHandler ();
112
113 void ProcessScene();
116
117 void ClearAndDestroyAtts(); // Destroys att holders and clears pick map.
118
119 GLuint fPickName;
120 std::map<GLuint, G4AttHolder*> fPickMap; // For picking.
121
122 // Shared code to wait until we make a single glFlush
123 void ScaledFlush () ;
124 // Static so that they apply to all OGL scene handlers...
126 // Number of entities between flushes
128
129 // True if caller of primitives is capable of processing three passes.
131
134
137
138 static const GLubyte fStippleMaskHashed [128];
140};
141
142#include "G4OpenGLSceneHandler.icc"
143
144#endif // G4OPENGLSCENEHANDLER_HH
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
Definition G4Box.hh:56
G4DisplacedSolid * CreateCutawaySolid()
void AddSolid(const G4Trd &)
void AddSolid(const G4Torus &)
void AddPrimitivesSquare(const std::vector< G4VMarker > &)
void AddSolid(const G4Ellipsoid &)
static void SetFlushAction(FlushAction action)
void AddSolid(const G4Polycone &)
virtual void BeginPrimitives2D(const G4Transform3D &objectTransformation)
static G4int GetEntitiesFlushInterval()
static FlushAction fFlushAction
void AddSolid(const G4Orb &)
void AddSolid(const G4TessellatedSolid &)
void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
void AddSolid(const G4VSolid &)
static void SetEntitiesFlushInterval(G4int interval)
void AddSolid(const G4Sphere &)
void AddPrimitive(const G4Polyline &)
void AddCompound(const G4VTrajectory &)
void AddSolid(const G4Para &)
void AddPrimitivesCircle(const std::vector< G4VMarker > &)
void AddSolid(const G4Polyhedra &)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation)
void AddSolid(const G4Trap &)
static const GLubyte fStippleMaskHashed[128]
void AddSolid(const G4Tubs &)
void AddSolid(const G4Box &)
G4DisplacedSolid * CreateSectionSolid()
G4OpenGLSceneHandler(G4VGraphicsSystem &system, G4int id, const G4String &name="")
void AddSolid(const G4Cons &)
static FlushAction GetFlushAction()
std::map< GLuint, G4AttHolder * > fPickMap
Definition G4Orb.hh:56
Definition G4Trd.hh:63
virtual void AddPrimitive(const G4Polyline &)=0