Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VViewer Class Referenceabstract

#include <G4VViewer.hh>

+ Inheritance diagram for G4VViewer:

Public Member Functions

 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void Initialise ()
 
virtual void ResetView ()
 
virtual void SetView ()=0
 
virtual void ClearView ()=0
 
virtual void DrawView ()=0
 
void RefreshView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Protected Attributes

G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4bool fNeedKernelVisit
 

Friends

std::ostream & operator<< (std::ostream &os, const G4VViewer &v)
 

Detailed Description

Definition at line 45 of file G4VViewer.hh.

Constructor & Destructor Documentation

◆ G4VViewer()

G4VViewer::G4VViewer ( G4VSceneHandler sceneHandler,
G4int  id,
const G4String name = "" 
)

Definition at line 45 of file G4VViewer.cc.

46 :
47fSceneHandler (sceneHandler),
48fViewId (id),
49//fModified (true),
51{
52 if (name == "") {
53 std::ostringstream ost;
54 ost << fSceneHandler.GetName () << '-' << fViewId;
55 fName = ost.str();
56 }
57 else {
58 fName = name;
59 }
60 fShortName = fName (0, fName.find (' '));
62
63 fVP = G4VisManager::GetInstance()->GetDefaultViewParameters();
65}
G4String strip(G4int strip_Type=trailing, char c=' ')
const G4String & GetName() const
G4bool fNeedKernelVisit
Definition: G4VViewer.hh:142
G4VSceneHandler & fSceneHandler
Definition: G4VViewer.hh:133
G4String fShortName
Definition: G4VViewer.hh:136
G4String fName
Definition: G4VViewer.hh:135
G4ViewParameters fDefaultVP
Definition: G4VViewer.hh:138
G4int fViewId
Definition: G4VViewer.hh:134
G4ViewParameters fVP
Definition: G4VViewer.hh:137
const G4ViewParameters & GetDefaultViewParameters() const

◆ ~G4VViewer()

G4VViewer::~G4VViewer ( )
virtual

Definition at line 67 of file G4VViewer.cc.

67 {
69}
void RemoveViewerFromList(G4VViewer *pView)

Member Function Documentation

◆ ClearView()

◆ DrawView()

◆ FinishView()

◆ GetApplicableVisAttributes()

const G4VisAttributes * G4VViewer::GetApplicableVisAttributes ( const G4VisAttributes pVisAttribs) const

Definition at line 77 of file G4VViewer.cc.

78 {
79 // If pVisAttribs is zero, pick up the default vis attributes from
80 // the view parameters.
81 if (!pVisAttribs)
83 return pVisAttribs;
84}
const G4ViewParameters & GetViewParameters() const
const G4VisAttributes * GetDefaultVisAttributes() const

Referenced by G4RayTrajectory::AppendStep(), and G4RTSteppingAction::UserSteppingAction().

◆ GetDefaultViewParameters()

const G4ViewParameters & G4VViewer::GetDefaultViewParameters ( ) const

◆ GetName()

◆ GetSceneHandler()

◆ GetShortName()

const G4String & G4VViewer::GetShortName ( ) const

◆ GetViewId()

◆ GetViewParameters()

◆ Initialise()

virtual void G4VViewer::Initialise ( )
virtual

◆ NeedKernelVisit()

void G4VViewer::NeedKernelVisit ( )

Definition at line 86 of file G4VViewer.cc.

86 {
87
88 fNeedKernelVisit = true;
89
90 // At one time I thought we'd better notify all viewers. But I guess
91 // each viewer can take care of itself, so the following code is
92 // redundant (but keep it commented out for now). (John Allison)
93 // Notify all viewers that a kernel visit is required.
94 // const G4ViewerList& viewerList = fSceneHandler.GetViewerList ();
95 // G4ViewerListConstIterator i;
96 // for (i = viewerList.begin(); i != viewerList.end(); i++) {
97 // (*i) -> SetNeedKernelVisit ();
98 // }
99 // ??...but, there's a problem in OpenGL Stored which seems to
100 // require *all* viewers to revisit the kernel, so...
101 /*
102 const G4ViewerList& viewerList = fSceneHandler.GetViewerList ();
103 G4ViewerListConstIterator i;
104 for (i = viewerList.begin(); i != viewerList.end(); i++) {
105 (*i) -> SetNeedKernelVisit (true);
106 }
107 */
108 // Feb 2005 - commented out. Let's fix OpenGL if necessary.
109}

Referenced by G4DAWNFILEViewer::DrawView(), G4GMocrenFileViewer::DrawView(), G4HepRepFileViewer::DrawView(), G4HepRepViewer::DrawView(), G4VTreeViewer::DrawView(), G4VRML1FileViewer::DrawView(), G4VRML2FileViewer::DrawView(), G4XXXFileViewer::DrawView(), G4XXXViewer::DrawView(), G4XXXSGViewer::KernelVisitDecision(), G4XXXStoredViewer::KernelVisitDecision(), and G4VisCommandViewerRebuild::SetNewValue().

◆ ProcessView()

void G4VViewer::ProcessView ( )

Definition at line 115 of file G4VViewer.cc.

116{
117 // If the scene has changed, or if the concrete viewer has decided
118 // that it necessary to visit the kernel, perhaps because the view
119 // parameters have changed significantly (this should be done in the
120 // concrete viewer's DrawView)...
121 if (fNeedKernelVisit) {
122 // Reset flag. This must be done before ProcessScene to prevent
123 // recursive calls when recomputing transients...
124 fNeedKernelVisit = false;
127 }
128}
virtual void ProcessScene()
virtual void ClearStore()

Referenced by G4DAWNFILEViewer::DrawView(), G4GMocrenFileViewer::DrawView(), G4HepRepFileViewer::DrawView(), G4HepRepViewer::DrawView(), G4VTreeViewer::DrawView(), G4VRML1FileViewer::DrawView(), G4VRML2FileViewer::DrawView(), G4XXXFileViewer::DrawView(), G4XXXSGViewer::DrawView(), G4XXXStoredViewer::DrawView(), and G4XXXViewer::DrawView().

◆ RefreshView()

void G4VViewer::RefreshView ( )

◆ ResetView()

virtual void G4VViewer::ResetView ( )
virtual

◆ SetDefaultViewParameters()

void G4VViewer::SetDefaultViewParameters ( const G4ViewParameters vp)

◆ SetName()

void G4VViewer::SetName ( const G4String name)

Definition at line 71 of file G4VViewer.cc.

71 {
72 fName = name;
73 fShortName = fName (0, fName.find (' '));
75}

◆ SetNeedKernelVisit()

void G4VViewer::SetNeedKernelVisit ( G4bool  need)

◆ SetView()

◆ SetViewParameters()

void G4VViewer::SetViewParameters ( const G4ViewParameters vp)

◆ ShowView()

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4VViewer v 
)
friend

Definition at line 134 of file G4VViewer.cc.

134 {
135 os << "View " << v.fName << ":\n";
136 os << v.fVP;
137 return os;
138}

Member Data Documentation

◆ fDefaultVP

◆ fName

G4String G4VViewer::fName
protected

◆ fNeedKernelVisit

G4bool G4VViewer::fNeedKernelVisit
protected

◆ fSceneHandler

◆ fShortName

G4String G4VViewer::fShortName
protected

Definition at line 136 of file G4VViewer.hh.

Referenced by G4RayTracerViewer::DrawView(), G4VViewer(), and SetName().

◆ fViewId

G4int G4VViewer::fViewId
protected

Definition at line 134 of file G4VViewer.hh.

Referenced by G4VViewer().

◆ fVP


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