Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisManager.hh,v 1.76 2010-11-13 10:54:55 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
@@ -95,6 +94,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
class G4Scene;
|
||||
class G4UIcommand;
|
||||
@@ -102,19 +102,17 @@ class G4UImessenger;
|
||||
class G4VisStateDependent;
|
||||
class G4VTrajectoryModel;
|
||||
class G4VUserVisAction;
|
||||
template <typename T> class G4VFilter;
|
||||
template <typename T> class G4VisFilterManager;
|
||||
template <typename T> class G4VisModelManager;
|
||||
template <typename T> class G4VModelFactory;
|
||||
template <typename> class G4VFilter;
|
||||
template <typename> class G4VisFilterManager;
|
||||
template <typename> class G4VisModelManager;
|
||||
template <typename> class G4VModelFactory;
|
||||
class G4Event;
|
||||
|
||||
namespace {
|
||||
// Useful typedef's
|
||||
typedef G4VModelFactory<G4VTrajectoryModel> G4TrajDrawModelFactory;
|
||||
typedef G4VModelFactory< G4VFilter<G4VTrajectory> > G4TrajFilterFactory;
|
||||
typedef G4VModelFactory< G4VFilter<G4VHit> > G4HitFilterFactory;
|
||||
typedef G4VModelFactory< G4VFilter<G4VDigi> > G4DigiFilterFactory;
|
||||
}
|
||||
// Useful typedef's
|
||||
typedef G4VModelFactory<G4VTrajectoryModel> G4TrajDrawModelFactory;
|
||||
typedef G4VModelFactory<G4VFilter<G4VTrajectory> > G4TrajFilterFactory;
|
||||
typedef G4VModelFactory<G4VFilter<G4VHit> > G4HitFilterFactory;
|
||||
typedef G4VModelFactory<G4VFilter<G4VDigi> > G4DigiFilterFactory;
|
||||
|
||||
class G4VisManager: public G4VVisManager {
|
||||
|
||||
@@ -186,6 +184,18 @@ public: // With description
|
||||
void Initialise ();
|
||||
void Initialize (); // Alias Initialise ().
|
||||
|
||||
// Optional registration of user vis actions. Added to scene with
|
||||
// /vis/scene/add/userAction.
|
||||
void RegisterRunDurationUserVisAction
|
||||
(const G4String& name, G4VUserVisAction*,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent);
|
||||
void RegisterEndOfEventUserVisAction
|
||||
(const G4String& name, G4VUserVisAction*,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent);
|
||||
void RegisterEndOfRunUserVisAction
|
||||
(const G4String& name, G4VUserVisAction*,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent);
|
||||
|
||||
G4bool RegisterGraphicsSystem (G4VGraphicsSystem*);
|
||||
// Register an individual graphics system. Normally this is done in
|
||||
// a sub-class implementation of the protected virtual function,
|
||||
@@ -250,25 +260,25 @@ public: // With description
|
||||
void Draw (const G4Text&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Circle&,
|
||||
void Draw2D (const G4Circle&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4NURBS&,
|
||||
void Draw2D (const G4NURBS&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Polyhedron&,
|
||||
void Draw2D (const G4Polyhedron&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Polyline&,
|
||||
void Draw2D (const G4Polyline&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Polymarker&,
|
||||
void Draw2D (const G4Polymarker&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Square&,
|
||||
void Draw2D (const G4Square&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
virtual void Draw2D (const G4Text&,
|
||||
void Draw2D (const G4Text&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@@ -297,6 +307,23 @@ public: // With description
|
||||
void Draw (const G4VSolid&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Optional methods that you may use to bracket a series of Draw
|
||||
// messages that have identical objectTransformation to improve
|
||||
// drawing speed. Use Begin/EndDraw for a series of Draw messages,
|
||||
// Begin/EndDraw2D for a series of Draw2D messages. Do not mix Draw
|
||||
// and Draw2D messages.
|
||||
|
||||
void BeginDraw
|
||||
(const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void EndDraw ();
|
||||
|
||||
void BeginDraw2D
|
||||
(const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void EndDraw2D ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Now other pure virtual functions of G4VVisManager...
|
||||
|
||||
@@ -349,8 +376,16 @@ public: // With description
|
||||
|
||||
const G4VTrajectoryModel* CurrentTrajDrawModel() const;
|
||||
|
||||
G4VUserVisAction* GetUserAction () const;
|
||||
G4VisExtent GetUserActionExtent () const;
|
||||
struct UserVisAction {
|
||||
UserVisAction(const G4String& name, G4VUserVisAction* pUserVisAction)
|
||||
:fName(name), fpUserVisAction(pUserVisAction) {}
|
||||
G4String fName;
|
||||
G4VUserVisAction* fpUserVisAction;
|
||||
};
|
||||
const std::vector<UserVisAction>& GetRunDurationUserVisActions () const;
|
||||
const std::vector<UserVisAction>& GetEndOfEventUserVisActions () const;
|
||||
const std::vector<UserVisAction>& GetEndOfRunUserVisActions () const;
|
||||
const std::map<G4VUserVisAction*,G4VisExtent>& GetUserVisActionExtents () const;
|
||||
G4VGraphicsSystem* GetCurrentGraphicsSystem () const;
|
||||
G4Scene* GetCurrentScene () const;
|
||||
G4VSceneHandler* GetCurrentSceneHandler () const;
|
||||
@@ -368,9 +403,10 @@ public: // With description
|
||||
G4bool GetAbortReviewKeptEvents () const;
|
||||
const G4ViewParameters& GetDefaultViewParameters () const;
|
||||
|
||||
void SetUserAction (G4VUserVisAction* pVisAction,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent);
|
||||
void SetUserActionExtent (const G4VisExtent&);
|
||||
void SetUserAction
|
||||
(G4VUserVisAction* pVisAction,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent); // Register run-duration.
|
||||
void SetUserActionExtent (const G4VisExtent&); //Legacy: deprecated.
|
||||
void SetCurrentGraphicsSystem (G4VGraphicsSystem*);
|
||||
void SetCurrentScene (G4Scene*);
|
||||
void SetCurrentSceneHandler (G4VSceneHandler*);
|
||||
@@ -432,8 +468,16 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
// Function templates to implement the Draw methods (to avoid source
|
||||
// code duplication).
|
||||
template <class T> void DrawT
|
||||
(const T& graphics_primitive, const G4Transform3D& objectTransform);
|
||||
template <class T> void DrawT2D
|
||||
(const T& graphics_primitive, const G4Transform3D& objectTransform);
|
||||
|
||||
void PrintAvailableModels (Verbosity) const;
|
||||
void PrintAvailableColours (Verbosity) const;
|
||||
void PrintAvailableUserVisActions (Verbosity) const;
|
||||
void PrintInvalidPointers () const;
|
||||
G4bool IsValidView ();
|
||||
// True if view is valid. Prints messages and sanitises various data.
|
||||
@@ -443,8 +487,10 @@ private:
|
||||
|
||||
static G4VisManager* fpInstance; // Pointer to single instance.
|
||||
G4bool fInitialised;
|
||||
G4VUserVisAction* fpUserVisAction; // User vis action callback.
|
||||
G4VisExtent fUserVisActionExtent;
|
||||
std::vector<UserVisAction> fRunDurationUserVisActions;
|
||||
std::vector<UserVisAction> fEndOfEventUserVisActions;
|
||||
std::vector<UserVisAction> fEndOfRunUserVisActions;
|
||||
std::map<G4VUserVisAction*,G4VisExtent> fUserVisActionExtents;
|
||||
G4VGraphicsSystem* fpGraphicsSystem; // Current graphics system.
|
||||
G4Scene* fpScene; // Current scene.
|
||||
G4VSceneHandler* fpSceneHandler; // Current scene handler.
|
||||
@@ -465,6 +511,8 @@ private:
|
||||
const G4Event* fpRequestedEvent; // If non-zero, scene handler uses.
|
||||
G4bool fAbortReviewKeptEvents;
|
||||
G4ViewParameters fDefaultViewParameters;
|
||||
G4bool fIsDrawGroup;
|
||||
G4int fDrawGroupNestingDepth;
|
||||
|
||||
// Trajectory draw model manager
|
||||
G4VisModelManager<G4VTrajectoryModel>* fpTrajDrawModelMgr;
|
||||
|
||||
Reference in New Issue
Block a user