Geant4 9.6.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 43 of file G4VisModelManager.hh.

Member Typedef Documentation

◆ Factory

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

Definition at line 49 of file G4VisModelManager.hh.

◆ List

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

Definition at line 48 of file G4VisModelManager.hh.

Constructor & Destructor Documentation

◆ G4VisModelManager()

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

Definition at line 88 of file G4VisModelManager.hh.

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

◆ ~G4VisModelManager()

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

Definition at line 94 of file G4VisModelManager.hh.

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

Member Function Documentation

◆ Current()

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

Definition at line 141 of file G4VisModelManager.hh.

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

Referenced by G4VisManager::CurrentTrajDrawModel().

◆ FactoryList()

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

Definition at line 183 of file G4VisModelManager.hh.

184{
185 return fFactoryList;
186}

◆ ListManager()

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

Definition at line 176 of file G4VisModelManager.hh.

177{
178 return fpModelList;
179}

◆ Placement()

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

Definition at line 148 of file G4VisModelManager.hh.

149{
150 return fPlacement;
151}

Referenced by G4VisManager::RegisterMessengers().

◆ Print()

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

Definition at line 155 of file G4VisModelManager.hh.

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

◆ Register() [1/2]

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

Definition at line 123 of file G4VisModelManager.hh.

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

◆ Register() [2/2]

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

Definition at line 116 of file G4VisModelManager.hh.

117{
118 fpModelList->Register(model);
119}
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 134 of file G4VisModelManager.hh.

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

Referenced by G4VisManager::SelectTrajectoryModel().


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