Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisModelManager< Model > Class Template Reference

#include <G4VisModelManager.hh>

Public Types

typedef G4VisListManager< Model > List
 
typedef G4VModelFactory< Model > Factory
 

Public Member Functions

 G4VisModelManager (const G4String &)
 
virtual ~G4VisModelManager ()
 
void Register (Model *)
 
void Register (Factory *)
 
void SetCurrent (const G4String &)
 
const Model * Current () const
 
G4String Placement () const
 
void Print (std::ostream &ostr, const G4String &name="") const
 
const ListListManager () const
 
const std::vector< Factory * > & FactoryList () const
 

Detailed Description

template<typename Model>
class G4VisModelManager< Model >

Definition at line 42 of file G4VisModelManager.hh.

Member Typedef Documentation

◆ Factory

template<typename Model >
typedef G4VModelFactory<Model> G4VisModelManager< Model >::Factory

Definition at line 48 of file G4VisModelManager.hh.

◆ List

template<typename Model >
typedef G4VisListManager<Model> G4VisModelManager< Model >::List

Definition at line 47 of file G4VisModelManager.hh.

Constructor & Destructor Documentation

◆ G4VisModelManager()

template<typename Model >
G4VisModelManager< Model >::G4VisModelManager ( const G4String placement)

Definition at line 87 of file G4VisModelManager.hh.

88 :fPlacement(placement)
89 ,fpModelList(new List)
90{}
G4VisListManager< Model > List

◆ ~G4VisModelManager()

template<typename Model >
G4VisModelManager< Model >::~G4VisModelManager
virtual

Definition at line 93 of file G4VisModelManager.hh.

94{
95 // Cleanup
96 std::vector<G4UImessenger*>::iterator iterMsgr = fMessengerList.begin();
97
98 while (iterMsgr != fMessengerList.end()) {
99 delete *iterMsgr;
100 iterMsgr++;
101 }
102
103 typename std::vector<Factory*>::iterator iterFactory = fFactoryList.begin();
104
105 while (iterFactory != fFactoryList.end()) {
106 delete *iterFactory;
107 iterFactory++;
108 }
109
110 delete fpModelList;
111}

Member Function Documentation

◆ Current()

template<typename Model >
const Model * G4VisModelManager< Model >::Current

Definition at line 140 of file G4VisModelManager.hh.

141{
142 return fpModelList->Current();
143}
const T * Current() const

Referenced by G4VisManager::CurrentTrajDrawModel().

◆ FactoryList()

template<typename Model >
const std::vector< G4VModelFactory< Model > * > & G4VisModelManager< Model >::FactoryList

Definition at line 182 of file G4VisModelManager.hh.

183{
184 return fFactoryList;
185}

◆ ListManager()

template<typename Model >
const G4VisListManager< Model > * G4VisModelManager< Model >::ListManager

Definition at line 175 of file G4VisModelManager.hh.

176{
177 return fpModelList;
178}

◆ Placement()

template<typename Model >
G4String G4VisModelManager< Model >::Placement

Definition at line 147 of file G4VisModelManager.hh.

148{
149 return fPlacement;
150}

Referenced by G4VisManager::RegisterMessengers().

◆ Print()

template<typename Model >
void G4VisModelManager< Model >::Print ( std::ostream &  ostr,
const G4String name = "" 
) const

Definition at line 154 of file G4VisModelManager.hh.

155{
156 ostr<<"Registered model factories:"<<std::endl;
157
158 typename std::vector<Factory*>::const_iterator iter = fFactoryList.begin();
159
160 while (iter != fFactoryList.end()) {
161 (*iter)->Print(ostr);
162 iter++;
163 }
164
165 if (0 == fFactoryList.size()) ostr<<" None"<<std::endl;
166
167 ostr<<std::endl;
168 ostr<<"Registered models: "<<std::endl;
169
170 fpModelList->Print(ostr, name);
171}
void Print(std::ostream &ostr, const G4String &name="") const

◆ Register() [1/2]

template<typename Model >
void G4VisModelManager< Model >::Register ( Factory factory)

Definition at line 122 of file G4VisModelManager.hh.

123{
124 // Assume ownership
125 fFactoryList.push_back(factory);
126
127 // Generate "create" command for this factory
128 fMessengerList.push_back(new G4VisCommandModelCreate<Factory>(factory, fPlacement));
129}

◆ Register() [2/2]

template<typename Model >
void G4VisModelManager< Model >::Register ( Model *  model)

Definition at line 115 of file G4VisModelManager.hh.

116{
117 fpModelList->Register(model);
118}
void Register(T *ptr)

Referenced by G4VisManager::CurrentTrajDrawModel(), G4VisManager::RegisterModel(), and G4VisManager::RegisterModelFactory().

◆ SetCurrent()

template<typename Model >
void G4VisModelManager< Model >::SetCurrent ( const G4String model)

Definition at line 133 of file G4VisModelManager.hh.

134{
135 fpModelList->SetCurrent(model);
136}
void SetCurrent(const G4String &name)

Referenced by G4VisManager::SelectTrajectoryModel().


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