Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4GraphicsSystemList.hh,v 1.8 2003/06/16 17:14:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 2nd April 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scene.hh,v 1.14 2003/11/27 11:48:03 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// Scene John Allison 19th July 1996.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Scene.icc,v 1.11 2003/11/27 11:48:06 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// Scene data John Allison 19th July 1996.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneHandlerList.hh,v 1.7 2003/06/16 17:14:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison May 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SceneList.hh,v 1.9 2003/06/16 17:14:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 9th August 1998
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VGraphicsSystem.hh,v 1.10 2003/06/16 17:14:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VGraphicsSystem.icc,v 1.6 2001/07/11 10:09:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.hh,v 1.24 2005/01/27 20:06:07 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VSceneHandler.hh,v 1.25 2005/09/02 12:58:18 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996.
|
||||
@@ -279,6 +279,8 @@ protected:
|
||||
G4VViewer* fpViewer; // Current viewer.
|
||||
G4Scene* fpScene; // Scene for this scene handler.
|
||||
G4bool fMarkForClearingTransientStore;
|
||||
G4bool fSecondPassRequested;
|
||||
G4bool fSecondPass; // ...in process.
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Workspace...
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.icc,v 1.12 2001/08/09 20:13:40 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserVisAction.hh,v 1.4 2005/03/16 17:18:04 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VUserVisAction.hh,v 1.5 2005/11/22 16:53:27 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -50,7 +50,7 @@ public: // With description
|
||||
G4VUserVisAction() {}
|
||||
virtual ~G4VUserVisAction() {}
|
||||
virtual void Draw() = 0;
|
||||
void operator()(const G4Transform3D& = G4Transform3D::Identity) {
|
||||
void operator()(const G4Transform3D& = G4Transform3D()) {
|
||||
Draw();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.hh,v 1.16 2005/06/02 17:43:47 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.icc,v 1.10 2005/02/23 11:24:52 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th December 1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisCommand.hh,v 1.17 2005/03/09 23:48:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// Base class for visualization commands - John Allison 9th August 1998
|
||||
// It is really a messenger - we have one command per messenger.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VVisCommand.icc,v 1.4 2001/07/11 10:09:14 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// Base class for visualization commands - John Allison 9th August 1998
|
||||
// It is really a messenger - we have one command per messenger.
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewParameters.hh,v 1.17 2005/05/31 16:54:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4ViewParameters.hh,v 1.20 2005/11/13 15:26:18 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
@@ -130,6 +130,7 @@ public: // With description
|
||||
const G4Vector3D& GetUpVector () const;
|
||||
G4double GetFieldHalfAngle () const;
|
||||
G4double GetZoomFactor () const;
|
||||
const G4Vector3D& GetScaleFactor () const;
|
||||
const G4Point3D& GetCurrentTargetPoint () const;
|
||||
G4double GetDolly () const;
|
||||
G4bool GetLightsMoveWithCamera () const;
|
||||
@@ -146,7 +147,11 @@ public: // With description
|
||||
G4bool IsMarkerNotHidden () const;
|
||||
G4int GetWindowSizeHintX () const;
|
||||
G4int GetWindowSizeHintY () const;
|
||||
const G4String& GetXGeometryString () const;
|
||||
// If non-null, can be interpreted with XParseGeometry (see man
|
||||
// pages). Supercedes GetWindowSizeHintX/Y.
|
||||
G4bool IsAutoRefresh () const;
|
||||
const G4Colour& GetBackgroundColour () const;
|
||||
|
||||
// Here Follow functions to evaluate the above algorithms as a
|
||||
// function of the radius of the Bounding Sphere of the object being
|
||||
@@ -184,6 +189,8 @@ public: // With description
|
||||
void SetFieldHalfAngle (G4double fieldHalfAngle);
|
||||
void SetZoomFactor (G4double zoomFactor);
|
||||
void MultiplyZoomFactor (G4double zoomFactorMultiplier);
|
||||
void SetScaleFactor (const G4Vector3D& scaleFactor);
|
||||
void MultiplyScaleFactor (const G4Vector3D& scaleFactorMultiplier);
|
||||
void SetCurrentTargetPoint (const G4Point3D& currentTargetPoint);
|
||||
void SetDolly (G4double dolly);
|
||||
void IncrementDolly (G4double dollyIncrement);
|
||||
@@ -204,7 +211,9 @@ public: // With description
|
||||
void SetMarkerHidden ();
|
||||
void SetMarkerNotHidden ();
|
||||
void SetWindowSizeHint (G4int xHint, G4int yHint);
|
||||
void SetXGeometryString (const G4String&);
|
||||
void SetAutoRefresh (G4bool);
|
||||
void SetBackgroundColour (const G4Colour&);
|
||||
|
||||
void PrintDifferences (const G4ViewParameters& v) const;
|
||||
|
||||
@@ -230,6 +239,7 @@ private:
|
||||
// to fViewpointDirection!)
|
||||
G4double fFieldHalfAngle; // Radius / camara distance, 0 for parallel.
|
||||
G4double fZoomFactor; // Magnification relative to Standard View.
|
||||
G4Vector3D fScaleFactor; // (Non-uniform) scale/magnification factor.
|
||||
G4Point3D fCurrentTargetPoint; // Relative to standard target point.
|
||||
G4double fDolly; // Distance towards current target point.
|
||||
G4bool fLightsMoveWithCamera;
|
||||
@@ -250,7 +260,9 @@ private:
|
||||
// removed.
|
||||
G4int fWindowSizeHintX; // Size hints for pixel-based window systems.
|
||||
G4int fWindowSizeHintY;
|
||||
G4String fXGeometryString; // If non-null, geometry string for X Windows.
|
||||
G4bool fAutoRefresh; // ...after change of view parameters.
|
||||
G4Colour fBackgroundColour;
|
||||
};
|
||||
|
||||
#include "G4ViewParameters.icc"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewParameters.icc,v 1.7 2005/05/31 16:54:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4ViewParameters.icc,v 1.10 2005/11/13 15:26:18 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
@@ -105,6 +105,10 @@ inline G4double G4ViewParameters::GetZoomFactor () const {
|
||||
return fZoomFactor;
|
||||
}
|
||||
|
||||
inline const G4Vector3D& G4ViewParameters::GetScaleFactor () const {
|
||||
return fScaleFactor;
|
||||
}
|
||||
|
||||
inline const G4Point3D& G4ViewParameters::GetCurrentTargetPoint () const {
|
||||
return fCurrentTargetPoint;
|
||||
}
|
||||
@@ -163,10 +167,18 @@ inline G4int G4ViewParameters::GetWindowSizeHintY () const {
|
||||
return fWindowSizeHintY;
|
||||
}
|
||||
|
||||
inline const G4String& G4ViewParameters::GetXGeometryString () const {
|
||||
return fXGeometryString;
|
||||
}
|
||||
|
||||
inline G4bool G4ViewParameters::IsAutoRefresh () const {
|
||||
return fAutoRefresh;
|
||||
}
|
||||
|
||||
inline const G4Colour& G4ViewParameters::GetBackgroundColour () const {
|
||||
return fBackgroundColour;
|
||||
}
|
||||
|
||||
inline void
|
||||
G4ViewParameters::SetDrawingStyle (G4ViewParameters::DrawingStyle style) {
|
||||
fDrawingStyle = style;
|
||||
@@ -237,6 +249,10 @@ G4ViewParameters::MultiplyZoomFactor (G4double zoomFactorMultiplier) {
|
||||
fZoomFactor *= zoomFactorMultiplier;
|
||||
}
|
||||
|
||||
inline void G4ViewParameters::SetScaleFactor (const G4Vector3D& scaleFactor) {
|
||||
fScaleFactor = scaleFactor;
|
||||
}
|
||||
|
||||
inline void
|
||||
G4ViewParameters::SetCurrentTargetPoint (const G4Point3D& currentTargetPoint) {
|
||||
fCurrentTargetPoint = currentTargetPoint;
|
||||
@@ -311,6 +327,14 @@ inline void G4ViewParameters::SetWindowSizeHint (G4int xHint, G4int yHint) {
|
||||
fWindowSizeHintY = yHint;
|
||||
}
|
||||
|
||||
inline void G4ViewParameters::SetXGeometryString (const G4String& geomString) {
|
||||
fXGeometryString = geomString;
|
||||
}
|
||||
|
||||
inline void G4ViewParameters::SetAutoRefresh (G4bool state) {
|
||||
fAutoRefresh = state;
|
||||
}
|
||||
|
||||
inline void G4ViewParameters::SetBackgroundColour (const G4Colour& colour) {
|
||||
fBackgroundColour = colour;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ViewerList.hh,v 1.7 2003/06/16 17:14:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison May 1996
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisCommandModelCreate.hh,v 1.2 2005/11/23 20:25:21 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
// Class Description:
|
||||
// Templated create command for model factories. Factory generates new models
|
||||
// and associated messengers.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef G4VISCOMMANDSMODELCREATE_HH
|
||||
#define G4VISCOMMANDSMODELCREATE_HH
|
||||
|
||||
#include "G4VVisCommand.hh"
|
||||
#include "G4String.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include <vector>
|
||||
|
||||
template <typename Factory>
|
||||
class G4VisCommandModelCreate : public G4VVisCommand {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4VisCommandModelCreate(Factory*, const G4String& placement);
|
||||
// Input factory and command placement
|
||||
|
||||
virtual ~G4VisCommandModelCreate();
|
||||
|
||||
G4String GetCurrentValue(G4UIcommand*);
|
||||
void SetNewValue (G4UIcommand* command, G4String newValue);
|
||||
|
||||
G4String Placement() const;
|
||||
|
||||
private:
|
||||
|
||||
G4String NextName();
|
||||
|
||||
// Data members
|
||||
Factory* fpFactory;
|
||||
G4String fPlacement;
|
||||
G4int fId;
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
std::vector<G4UIcommand*> fDirectoryList;
|
||||
|
||||
};
|
||||
|
||||
template <typename Factory>
|
||||
G4VisCommandModelCreate<Factory>::G4VisCommandModelCreate(Factory* factory, const G4String& placement)
|
||||
:fpFactory(factory)
|
||||
,fPlacement(placement)
|
||||
,fId(0)
|
||||
{
|
||||
G4String factoryName = factory->Name();
|
||||
|
||||
G4String command = Placement()+"/create/"+factoryName;
|
||||
G4String guidance = "Create a "+factoryName+" model and associated messengers.";
|
||||
|
||||
fpCommand = new G4UIcmdWithAString(command, this);
|
||||
fpCommand->SetGuidance(guidance);
|
||||
fpCommand->SetGuidance("Generated model becomes current.");
|
||||
fpCommand->SetParameterName("model-name", true);
|
||||
}
|
||||
|
||||
template <typename Factory>
|
||||
G4VisCommandModelCreate<Factory>::~G4VisCommandModelCreate()
|
||||
{
|
||||
delete fpCommand;
|
||||
|
||||
unsigned i(0);
|
||||
for (i=0; i<fDirectoryList.size(); ++i) {
|
||||
delete fDirectoryList[i];
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Factory>
|
||||
G4String
|
||||
G4VisCommandModelCreate<Factory>::Placement() const
|
||||
{
|
||||
return fPlacement;
|
||||
}
|
||||
|
||||
template <typename Factory>
|
||||
G4String
|
||||
G4VisCommandModelCreate<Factory>::NextName()
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss <<fpFactory->Name()<<"-" << fId++;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
template <typename Factory>
|
||||
G4String
|
||||
G4VisCommandModelCreate<Factory>::GetCurrentValue(G4UIcommand*)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
template <typename Factory>
|
||||
void G4VisCommandModelCreate<Factory>::SetNewValue(G4UIcommand*, G4String newName)
|
||||
{
|
||||
if (newName.isNull()) newName = NextName();
|
||||
|
||||
assert (0 != fpFactory);
|
||||
|
||||
// Create directory for new model commands
|
||||
G4String title = Placement()+"/"+newName+"/";
|
||||
G4String guidance = "Commands for "+newName+" model.";
|
||||
|
||||
G4UIcommand* directory = new G4UIdirectory(title);
|
||||
directory->SetGuidance(guidance);
|
||||
fDirectoryList.push_back(directory);
|
||||
|
||||
// Create the model.
|
||||
typename Factory::ModelAndMessengers creation = fpFactory->Create(Placement(), newName);
|
||||
|
||||
// Register model with vis manager
|
||||
fpVisManager->RegisterModel(creation.first);
|
||||
|
||||
// Register associated messengers with vis manager
|
||||
typename Factory::Messengers::iterator iter = creation.second.begin();
|
||||
|
||||
while (iter != creation.second.end()) {
|
||||
fpVisManager->RegisterMessenger(*iter);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.hh,v 1.3 2001/08/05 02:29:02 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/ top level commands - John Allison 5th February 2001
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsCompound.hh,v 1.8 2005/02/15 14:50:52 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// Compound /vis/ commands - John Allison 15th May 2000
|
||||
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisCommandsListManager.hh,v 1.1 2005/11/21 05:45:42 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
// Class Description:
|
||||
// Templated list manager commands which control list manager listing and
|
||||
// selection.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef G4VISCOMMANDLISTMANAGER_HH
|
||||
#define G4VISCOMMANDLISTMANAGER_HH
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "G4String.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
|
||||
template <typename Manager>
|
||||
class G4VisCommandListManagerList : public G4UImessenger {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4VisCommandListManagerList(Manager*, const G4String& placement);
|
||||
// Input list manager and command placement
|
||||
|
||||
virtual ~G4VisCommandListManagerList();
|
||||
|
||||
G4String GetCurrentValue(G4UIcommand*);
|
||||
void SetNewValue(G4UIcommand* command, G4String newValue);
|
||||
|
||||
G4String Placement() const;
|
||||
|
||||
private:
|
||||
|
||||
// Data members
|
||||
Manager* fpManager;
|
||||
G4String fPlacement;
|
||||
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
|
||||
};
|
||||
|
||||
// List command
|
||||
template <typename Manager>
|
||||
G4VisCommandListManagerList<Manager>::G4VisCommandListManagerList(Manager* manager, const G4String& placement)
|
||||
:fpManager(manager)
|
||||
,fPlacement(placement)
|
||||
{
|
||||
G4String command = Placement()+"/list";
|
||||
|
||||
fpCommand = new G4UIcmdWithAString(command, this);
|
||||
fpCommand->SetGuidance("List objects registered with list manager");
|
||||
fpCommand->SetParameterName("name", true);
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
G4VisCommandListManagerList<Manager>::~G4VisCommandListManagerList()
|
||||
{
|
||||
delete fpCommand;
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
G4String
|
||||
G4VisCommandListManagerList<Manager>::Placement() const
|
||||
{
|
||||
return fPlacement;
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
G4String
|
||||
G4VisCommandListManagerList<Manager>::GetCurrentValue(G4UIcommand*)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
void G4VisCommandListManagerList<Manager>::SetNewValue(G4UIcommand*, G4String name)
|
||||
{
|
||||
G4cout<<"Listing models available in "<<Placement()<<G4endl;
|
||||
|
||||
assert (0 != fpManager);
|
||||
fpManager->Print(G4cout, name);
|
||||
}
|
||||
|
||||
//Select command
|
||||
template <typename Manager>
|
||||
class G4VisCommandListManagerSelect : public G4UImessenger {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4VisCommandListManagerSelect(Manager*, const G4String& placement);
|
||||
// Input list manager and command placement
|
||||
|
||||
virtual ~G4VisCommandListManagerSelect();
|
||||
|
||||
G4String GetCurrentValue(G4UIcommand*);
|
||||
void SetNewValue (G4UIcommand* command, G4String newValue);
|
||||
|
||||
private:
|
||||
|
||||
Manager* fpManager;
|
||||
G4String fPlacement;
|
||||
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
|
||||
};
|
||||
|
||||
template <typename Manager>
|
||||
G4VisCommandListManagerSelect<Manager>::G4VisCommandListManagerSelect(Manager* manager, const G4String& placement)
|
||||
:fpManager(manager)
|
||||
,fPlacement(placement)
|
||||
{
|
||||
G4String command = placement+"/select";
|
||||
G4String guidance = "Select created object";
|
||||
|
||||
fpCommand = new G4UIcmdWithAString(command, this);
|
||||
fpCommand->SetGuidance(guidance);
|
||||
fpCommand->SetParameterName("name", false);
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
G4VisCommandListManagerSelect<Manager>::~G4VisCommandListManagerSelect()
|
||||
{
|
||||
delete fpCommand;
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
G4String
|
||||
G4VisCommandListManagerSelect<Manager>::GetCurrentValue(G4UIcommand*)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
template <typename Manager>
|
||||
void G4VisCommandListManagerSelect<Manager>::SetNewValue(G4UIcommand*, G4String name)
|
||||
{
|
||||
assert (0 != fpManager);
|
||||
fpManager->SetCurrent(name);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsScene.hh,v 1.15 2005/03/09 23:48:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/scene commands - John Allison 9th August 1998
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneAdd.hh,v 1.14 2005/04/10 21:04:39 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/scene commands - John Allison 9th August 1998
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsSceneHandler.hh,v 1.7 2005/03/09 23:48:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/sceneHandler commands - John Allison 10th October 1998
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewer.hh,v 1.17 2005/03/09 23:48:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisCommandsViewer.hh,v 1.19 2005/11/22 17:00:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/viewer commands - John Allison 25th October 1998
|
||||
|
||||
@@ -37,6 +37,7 @@ class G4UIcommand;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithADouble;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWith3Vector;
|
||||
|
||||
class G4VVisCommandViewer: public G4VVisCommand {
|
||||
public:
|
||||
@@ -129,6 +130,18 @@ private:
|
||||
G4double fPanToRight, fPanToUp;
|
||||
};
|
||||
|
||||
class G4VisCommandViewerReset: public G4VVisCommandViewer {
|
||||
public:
|
||||
G4VisCommandViewerReset ();
|
||||
virtual ~G4VisCommandViewerReset ();
|
||||
G4String GetCurrentValue (G4UIcommand* command);
|
||||
void SetNewValue (G4UIcommand* command, G4String newValue);
|
||||
private:
|
||||
G4VisCommandViewerReset (const G4VisCommandViewerReset&);
|
||||
G4VisCommandViewerReset& operator = (const G4VisCommandViewerReset&);
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
};
|
||||
|
||||
class G4VisCommandViewerRefresh: public G4VVisCommandViewer {
|
||||
public:
|
||||
G4VisCommandViewerRefresh ();
|
||||
@@ -141,18 +154,33 @@ private:
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
};
|
||||
|
||||
class G4VisCommandViewerReset: public G4VVisCommandViewer {
|
||||
class G4VisCommandViewerRebuild: public G4VVisCommandViewer {
|
||||
public:
|
||||
G4VisCommandViewerReset ();
|
||||
virtual ~G4VisCommandViewerReset ();
|
||||
G4VisCommandViewerRebuild ();
|
||||
virtual ~G4VisCommandViewerRebuild ();
|
||||
G4String GetCurrentValue (G4UIcommand* command);
|
||||
void SetNewValue (G4UIcommand* command, G4String newValue);
|
||||
private:
|
||||
G4VisCommandViewerReset (const G4VisCommandViewerReset&);
|
||||
G4VisCommandViewerReset& operator = (const G4VisCommandViewerReset&);
|
||||
G4VisCommandViewerRebuild (const G4VisCommandViewerRebuild&);
|
||||
G4VisCommandViewerRebuild& operator = (const G4VisCommandViewerRebuild&);
|
||||
G4UIcmdWithAString* fpCommand;
|
||||
};
|
||||
|
||||
class G4VisCommandViewerScale: public G4VVisCommandViewer {
|
||||
public:
|
||||
G4VisCommandViewerScale ();
|
||||
virtual ~G4VisCommandViewerScale ();
|
||||
G4String GetCurrentValue (G4UIcommand* command);
|
||||
void SetNewValue (G4UIcommand* command, G4String newValue);
|
||||
private:
|
||||
G4VisCommandViewerScale (const G4VisCommandViewerScale&);
|
||||
G4VisCommandViewerScale& operator = (const G4VisCommandViewerScale&);
|
||||
G4UIcmdWith3Vector* fpCommandScale;
|
||||
G4UIcmdWith3Vector* fpCommandScaleTo;
|
||||
G4Vector3D fScaleMultiplier;
|
||||
G4Vector3D fScaleTo;
|
||||
};
|
||||
|
||||
class G4VisCommandViewerSelect: public G4VVisCommandViewer {
|
||||
public:
|
||||
G4VisCommandViewerSelect ();
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewerSet.hh,v 1.13 2004/07/23 15:24:15 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisCommandsViewerSet.hh,v 1.15 2005/10/13 18:10:29 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
|
||||
// /vis/viewer/set commands - John Allison 16th May 2000
|
||||
|
||||
@@ -70,6 +70,7 @@ private:
|
||||
G4UIcommand* fpCommandViewpointThetaPhi;
|
||||
G4UIcommand* fpCommandViewpointVector;
|
||||
G4ThreeVector fViewpointVector;
|
||||
G4UIcommand* fpCommandBackground;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,26 +21,26 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExecutive.hh,v 1.1 2005/02/04 16:42:37 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisExecutive.hh,v 1.5 2005/11/22 16:57:16 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 2nd February 2005 (based on MyVisManager, 24th January 1998).
|
||||
//
|
||||
// Class description
|
||||
//
|
||||
// Concrete Visualization Manager that implements the virtual function
|
||||
// RegisterGraphicsSystems. This is executed when you Initialise()
|
||||
// or Initialize() the vis manager. It exploits C-pre-processor
|
||||
// variables G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles
|
||||
// if environment variables of the same name are set.
|
||||
// Concrete Visualization Manager that implements the virtual
|
||||
// functions RegisterGraphicsSystems and RegisterModelFactories. This
|
||||
// is executed when you Initialise() or Initialize() the vis manager.
|
||||
// It exploits C-pre-processor variables G4VIS_USE_DAWN, etc., which
|
||||
// are set by the GNUmakefiles if environment variables of the same
|
||||
// name are set.
|
||||
//
|
||||
// Include this file and write code to instantiate G4VisExecutive just
|
||||
// once as beginning of operations. Before you compile, set
|
||||
// appropriate environment variables. If you change your
|
||||
// environment you must force recompilation (the make files will not
|
||||
// detect the need to do this). Typically, your main program file
|
||||
// will contain:
|
||||
// once as beginning of operations. Before you compile, set
|
||||
// appropriate environment variables. If you change your environment
|
||||
// you must force recompilation (the make files will not detect the
|
||||
// need to do this). Typically, your main program file will contain:
|
||||
//
|
||||
// #ifdef G4VIS_USE
|
||||
// #include "G4VisExecutive.hh"
|
||||
@@ -94,11 +94,11 @@ public: // With description
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
void RegisterGraphicsSystems();
|
||||
void RegisterModelFactories();
|
||||
|
||||
};
|
||||
|
||||
#include "G4VisExecutive.icc"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisExecutive.icc,v 1.2 2005/05/06 08:42:47 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisExecutive.icc,v 1.7 2005/11/23 05:20:02 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "G4HepRep.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4TrajectoryModelFactories.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
@@ -68,12 +69,15 @@
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_RAYTRACERX
|
||||
#include "G4RayTracerX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
|
||||
G4VisExecutive::G4VisExecutive () {}
|
||||
|
||||
void G4VisExecutive::RegisterGraphicsSystems () {
|
||||
@@ -117,15 +121,20 @@ void G4VisExecutive::RegisterGraphicsSystems () {
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_RAYTRACERX
|
||||
RegisterGraphicsSystem (new G4RayTracerX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< G4endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4VisExecutive::RegisterModelFactories()
|
||||
{
|
||||
RegisterModelFactory(new G4TrajectoryDrawByChargeFactory());
|
||||
RegisterModelFactory(new G4TrajectoryDrawByParticleIDFactory());
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisFeaturesOfDAWNFILE.hh,v 1.4 2001/07/11 10:09:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
#ifndef G4VISFEATURESOFDAWNFILE_HH
|
||||
#define G4VISFEATURESOFDAWNFILE_HH
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisFeaturesOfFukuiRenderer.hh,v 1.4 2001/07/11 10:09:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisFeaturesOfOpenGL.hh,v 1.4 2001/07/11 10:09:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisFeaturesOfOpenInventor.hh,v 1.4 2001/07/11 10:09:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisListManager.hh,v 1.3 2005/11/23 20:25:22 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Jane Tinslay, John Allison, Joseph Perl October 2005
|
||||
//
|
||||
// Class Description:
|
||||
// Templated class to manage a set of objects, with one named
|
||||
// as current. Owns registered objects.
|
||||
// Class Description - End:
|
||||
|
||||
#ifndef G4VISLISTMANAGER_HH
|
||||
#define G4VISLISTMANAGER_HH
|
||||
|
||||
#include "G4String.hh"
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
|
||||
template <typename T>
|
||||
class G4VisListManager {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4VisListManager();
|
||||
|
||||
virtual ~G4VisListManager();
|
||||
|
||||
void Register(T* ptr);
|
||||
// Register ptr. Manager assumes ownership and
|
||||
// ptr becomes current
|
||||
|
||||
void SetCurrent(const G4String& name);
|
||||
const T* Current() const {return fpCurrent;}
|
||||
|
||||
void Print(std::ostream& ostr, const G4String& name) const;
|
||||
|
||||
private:
|
||||
|
||||
// Data members
|
||||
std::map<G4String, T*> fMap;
|
||||
T* fpCurrent;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
G4VisListManager<T>::G4VisListManager()
|
||||
:fpCurrent(0)
|
||||
{}
|
||||
|
||||
template <typename T>
|
||||
G4VisListManager<T>::~G4VisListManager()
|
||||
{
|
||||
typename std::map<G4String, T*>::iterator iter = fMap.begin();
|
||||
|
||||
while (iter != fMap.end()) {
|
||||
delete iter->second;
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
G4VisListManager<T>::Register(T* ptr)
|
||||
{
|
||||
assert (0 != ptr);
|
||||
|
||||
typename std::map<G4String, T*>::const_iterator iter = fMap.find(ptr->Name());
|
||||
|
||||
if (iter == fMap.end()) {
|
||||
fMap[ptr->Name()] = ptr;
|
||||
fpCurrent = ptr;
|
||||
}
|
||||
else {
|
||||
std::ostringstream o;
|
||||
o << "Key "<<ptr->Name()<<" already registered";
|
||||
G4Exception
|
||||
("G4VisListManager<T>::Register(T* ptr) ",
|
||||
"KeyExists", FatalErrorInArgument, o.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
G4VisListManager<T>::SetCurrent(const G4String& name)
|
||||
{
|
||||
typename std::map<G4String, T*>::const_iterator iter = fMap.find(name);
|
||||
|
||||
if (iter != fMap.end()) fpCurrent = fMap[name];
|
||||
else {
|
||||
std::ostringstream o;
|
||||
o << "Key "<<name<<" has not been registered";
|
||||
G4Exception
|
||||
("G4VisListManager<T>::SetCurrent(T* ptr) ",
|
||||
"NonExistentName", FatalErrorInArgument, o.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
G4VisListManager<T>::Print(std::ostream& ostr, const G4String& name) const
|
||||
{
|
||||
ostr<<"Current: "<<fpCurrent->Name()<<std::endl;
|
||||
|
||||
if (!name.isNull()) {
|
||||
// Print out specified object
|
||||
typename std::map<G4String, T*>::const_iterator iter = fMap.find(name);
|
||||
|
||||
if (iter != fMap.end()) {
|
||||
iter->second->Print(ostr);
|
||||
}
|
||||
else {
|
||||
ostr<<name<<" not found "<<std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
typename std::map<G4String, T*>::const_iterator iter = fMap.begin();
|
||||
while (iter != fMap.end()) {
|
||||
iter->second->Print(ostr);
|
||||
ostr<<G4endl;
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisManager.hh,v 1.38 2005/03/09 23:48:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisManager.hh,v 1.45 2005/11/29 22:23:01 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
// class from G4VisManager, implement the pure virtual function
|
||||
// RegisterGraphicsSystems, and instantiate an object of the derived
|
||||
// class - for an example see
|
||||
// visualization/include/MyVisManager.hh/cc.
|
||||
// visualization/include/G4VisExecutive.hh/icc.
|
||||
//
|
||||
// The recommended way for users to obtain a pointer to the vis
|
||||
// manager is with G4VVisManager::GetConcreteInstance (), being always
|
||||
@@ -50,15 +50,16 @@
|
||||
// pure virtual function RegisterGraphicsSystems called from
|
||||
// Initialise (). You can also use the public function
|
||||
// RegisterGraphicsSystem (new MyGraphicsSystem) if you have your own
|
||||
// graphics system.
|
||||
// graphics system. A graphics system is, in effect, a factory for
|
||||
// scene handlers and viewers.
|
||||
//
|
||||
// The VisManager creates graphics systems, scenes, scene handlers and
|
||||
// viewers and manages them. You can have any number. It has the
|
||||
// concept of a "current viewer", and the "current scene handler", the
|
||||
// "current scene" and the "current graphics system" which go with it.
|
||||
// You can select the current viewer. Most of the the operations of
|
||||
// the VisManager take place with the current viewer, in particular,
|
||||
// the Draw operations.
|
||||
// The VisManager creates and manages graphics systems, scenes, scene
|
||||
// handlers, viewers and some models and model makers. You can have
|
||||
// any number. It has the concept of a "current viewer", and the
|
||||
// "current scene handler", the "current scene" and the "current
|
||||
// graphics system" which go with it. You can select the current
|
||||
// viewer. Most of the the operations of the VisManager take place
|
||||
// with the current viewer, in particular, the Draw operations.
|
||||
//
|
||||
// Each scene comprises drawable objects such as detector components
|
||||
// and hits when appropriate. A scene handler translates a scene into
|
||||
@@ -80,12 +81,13 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4GraphicsSystemList.hh"
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4NullModel.hh"
|
||||
#include "G4SceneHandlerList.hh"
|
||||
#include "G4SceneList.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4NullModel.hh"
|
||||
#include "G4TrajectoriesModel.hh"
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
@@ -94,7 +96,16 @@ class G4Scene;
|
||||
class G4UIcommand;
|
||||
class G4UImessenger;
|
||||
class G4VisStateDependent;
|
||||
class G4VTrajectoryModel;
|
||||
class G4VUserVisAction;
|
||||
template <typename T> class G4VisListManager;
|
||||
template <typename T> class G4VModelFactory;
|
||||
|
||||
namespace {
|
||||
// Typedef's for trajectory drawing
|
||||
typedef G4VModelFactory<G4VTrajectoryModel> G4TrajectoryModelFactory;
|
||||
typedef G4VisListManager<G4VTrajectoryModel> G4TrajectoryModelManager;
|
||||
}
|
||||
|
||||
class G4VisManager: public G4VVisManager {
|
||||
|
||||
@@ -162,7 +173,23 @@ public: // With description
|
||||
|
||||
void Initialise ();
|
||||
void Initialize (); // Alias Initialise ().
|
||||
G4bool RegisterGraphicsSystem (G4VGraphicsSystem* pSystem);
|
||||
|
||||
G4bool RegisterGraphicsSystem (G4VGraphicsSystem*);
|
||||
// Register an individual graphics system. Normally this is done in
|
||||
// a sub-class implementation of the protected virtual function,
|
||||
// RegisterGraphicsSystems. See, e.g., G4VisExecutive.icc.
|
||||
|
||||
void RegisterModelFactory(G4TrajectoryModelFactory* factory);
|
||||
// Register trajectory model factory. Assumes ownership of factory.
|
||||
|
||||
void RegisterModel(G4VTrajectoryModel* model);
|
||||
// Register trajectory model. Assumes ownership of model.
|
||||
|
||||
void SelectTrajectoryModel(const G4String& model);
|
||||
// Set default trajectory model. Useful for use in compiled code
|
||||
|
||||
void RegisterMessenger(G4UImessenger* messenger);
|
||||
// Register messenger. Assumes ownership of messenger.
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Now functions that implement the pure virtual functions of
|
||||
@@ -170,28 +197,28 @@ public: // With description
|
||||
// for representing hits, digis, etc.
|
||||
|
||||
void Draw (const G4Circle&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4NURBS&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Polyhedron&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Polyline&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Polymarker&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Scale&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Square&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4Text&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Now functions that implement the pure virtual functions of
|
||||
@@ -209,13 +236,13 @@ public: // With description
|
||||
// i_mode defaults to 0 by inheritance from G4VVisManager.
|
||||
|
||||
void Draw (const G4LogicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4VPhysicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
void Draw (const G4VSolid&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity);
|
||||
const G4Transform3D& objectTransformation = G4Transform3D());
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Now other pure virtual functions of G4VVisManager...
|
||||
@@ -223,6 +250,9 @@ public: // With description
|
||||
void GeometryHasChanged ();
|
||||
// Used by run manager to notify change.
|
||||
|
||||
void DispatchToModel(const G4VTrajectory&, G4int i_mode);
|
||||
// Draw the trajectory.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Administration routines.
|
||||
|
||||
@@ -269,6 +299,14 @@ public: // With description
|
||||
Verbosity GetVerbosity () const;
|
||||
void GetWindowSizeHint (G4int& xHint, G4int& yHint) const;
|
||||
// Note: GetWindowSizeHint information is returned via the G4int& arguments.
|
||||
const G4String& GetXGeometryString () const;
|
||||
// GetXGeometryString is intended to be parsed by XParseGeometry.
|
||||
// It contains the size information, as in GetWindowSizeHint, but
|
||||
// may also contain the window position, e.g., "600x600-0+200. The
|
||||
// viewer should use this in preference to GetWindowSizeHint, since
|
||||
// it contains more information. (The size information in
|
||||
// GetXGeometryString and GetWindowSizeHint is guaranteed to be
|
||||
// identical.)
|
||||
|
||||
void SetUserAction (G4VUserVisAction* pVisAction,
|
||||
const G4VisExtent& = G4VisExtent::NullExtent);
|
||||
@@ -283,6 +321,7 @@ public: // With description
|
||||
void SetVerboseLevel (const G4String&);
|
||||
void SetVerboseLevel (Verbosity);
|
||||
void SetWindowSizeHint (G4int xHint, G4int yHint);
|
||||
void SetXGeometryString (const G4String&);
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@@ -312,6 +351,12 @@ public: // With description
|
||||
protected:
|
||||
|
||||
virtual void RegisterGraphicsSystems () = 0;
|
||||
// The sub-class must implement and make successive calls to
|
||||
// RegisterGraphicsSystem.
|
||||
|
||||
virtual void RegisterModelFactories();
|
||||
// Sub-class must register desired models
|
||||
|
||||
void RegisterMessengers (); // Command messengers.
|
||||
void PrintAvailableGraphicsSystems () const;
|
||||
void PrintInvalidPointers () const;
|
||||
@@ -343,11 +388,19 @@ protected:
|
||||
std::vector<G4UImessenger*> fMessengerList;
|
||||
std::vector<G4UIcommand*> fDirectoryList;
|
||||
G4VisStateDependent* fpStateDependent; // Friend state dependent class.
|
||||
G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer construction.
|
||||
G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer...
|
||||
G4String fXGeometryString; // ...construction.
|
||||
G4NullModel fVisManagerNullModel; // As a default.
|
||||
G4TrajectoriesModel dummyTrajectoriesModel; // For passing drawing mode.
|
||||
G4ModelingParameters fVisManagerModelingParameters; // Useful memory.
|
||||
|
||||
private:
|
||||
|
||||
// Trajectory model related data members
|
||||
G4String fTrajectoryPlacement; // Placement for trajectory model commands
|
||||
G4TrajectoryModelManager* fpTrajectoryModelMgr; // Trajectory model manager
|
||||
std::vector<G4TrajectoryModelFactory*> fTrajectoryModelFactoryList; // Trajectory model factories
|
||||
|
||||
};
|
||||
|
||||
#include "G4VisManager.icc"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisManager.icc,v 1.9 2005/02/19 22:07:21 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VisManager.icc,v 1.11 2005/11/21 05:45:42 tinslay Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
|
||||
@@ -74,6 +74,10 @@ inline void G4VisManager::GetWindowSizeHint
|
||||
xHint = fWindowSizeHintX; yHint = fWindowSizeHintY;
|
||||
}
|
||||
|
||||
inline const G4String& G4VisManager::GetXGeometryString () const {
|
||||
return fXGeometryString;
|
||||
}
|
||||
|
||||
inline void G4VisManager::SetUserActionExtent (const G4VisExtent& extent) {
|
||||
fUserVisActionExtent = extent;
|
||||
}
|
||||
@@ -97,3 +101,13 @@ inline void G4VisManager::SetVerboseLevel (G4VisManager::Verbosity verbosity) {
|
||||
inline void G4VisManager::SetWindowSizeHint (G4int xHint, G4int yHint) {
|
||||
fWindowSizeHintX = xHint; fWindowSizeHintY = yHint;
|
||||
}
|
||||
|
||||
inline void G4VisManager::SetXGeometryString (const G4String& geomString) {
|
||||
fXGeometryString = geomString;
|
||||
}
|
||||
|
||||
inline void G4VisManager::RegisterMessenger(G4UImessenger* msgr)
|
||||
{
|
||||
fMessengerList.push_back(msgr);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VisStateDependent.hh,v 1.4 2001/07/11 10:09:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// A "state dependent" service class for G4VisManager.
|
||||
// John Allison 29th November 1999
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: MyVisManager.cc,v 1.20 2005/02/04 16:42:41 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "MyVisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
// Not needing external packages or libraries...
|
||||
#include "G4ASCIITree.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4GAGTree.hh"
|
||||
#include "G4HepRep.hh"
|
||||
#include "G4HepRepFile.hh"
|
||||
#include "G4RayTracer.hh"
|
||||
#include "G4VRML1File.hh"
|
||||
#include "G4VRML2File.hh"
|
||||
|
||||
// Needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
#include "G4OpenGLImmediateX.hh"
|
||||
#include "G4OpenGLStoredX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
#include "G4OpenGLImmediateWin32.hh"
|
||||
#include "G4OpenGLStoredWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
#include "G4OpenGLImmediateXm.hh"
|
||||
#include "G4OpenGLStoredXm.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
#include "G4OpenInventorX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
#include "G4OpenInventorWin32.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
#include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
|
||||
MyVisManager::MyVisManager () {
|
||||
G4cout <<
|
||||
"\n*********************************************************************\n"
|
||||
"MyVisManager: WARNING: Deprecated class - use G4VisExecutive instead."
|
||||
"\n*********************************************************************\n"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
void MyVisManager::RegisterGraphicsSystems () {
|
||||
|
||||
// Graphics Systems not needing external packages or libraries...
|
||||
RegisterGraphicsSystem (new G4ASCIITree);
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
RegisterGraphicsSystem (new G4GAGTree);
|
||||
RegisterGraphicsSystem (new G4HepRep);
|
||||
RegisterGraphicsSystem (new G4HepRepFile);
|
||||
RegisterGraphicsSystem (new G4RayTracer);
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
RegisterGraphicsSystem (new G4VRML2File);
|
||||
|
||||
// Graphics systems needing external packages or libraries...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLX
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateX);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLWIN32
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OPENGLXM
|
||||
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
|
||||
RegisterGraphicsSystem (new G4OpenGLStoredXm);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIX
|
||||
RegisterGraphicsSystem (new G4OpenInventorX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_OIWIN32
|
||||
RegisterGraphicsSystem (new G4OpenInventorWin32);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: MyVisManager.hh,v 1.5 2001/07/11 10:09:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
//
|
||||
// Class description
|
||||
//
|
||||
// Example Visualization Manager implementing virtual function
|
||||
// RegisterGraphicsSystems. Exploits C-pre-processor variables
|
||||
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
|
||||
// environment variables of the same name are set.
|
||||
//
|
||||
// So all you have to do is set environment variables and compile and
|
||||
// instantiate this in your main().
|
||||
//
|
||||
// Alternatively, you can implement an empty function here and just
|
||||
// register the systems you want in your main(), e.g.:
|
||||
// G4VisManager* myVisManager = new MyVisManager;
|
||||
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
|
||||
//
|
||||
// See class description of G4VisManager for more details.
|
||||
|
||||
#ifndef MYEXAMPLEVISMANAGER_HH
|
||||
#define MYEXAMPLEVISMANAGER_HH
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
class MyVisManager: public G4VisManager {
|
||||
|
||||
public: // With description
|
||||
|
||||
MyVisManager ();
|
||||
|
||||
private:
|
||||
|
||||
void RegisterGraphicsSystems ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user