View | Details | Raw Unified | Return to problem 2083
Collapse All | Expand All

(-)a/source/analysis/management/include/G4PlotManager.hh (-4 / +4 lines)
Lines 65-71 class G4PlotManager Link Here
65
    G4bool WritePage();
65
    G4bool WritePage();
66
66
67
    // static data members
67
    // static data members
68
    static G4PlotParameters fgPlotParameters;
68
    static G4PlotParameters& fgPlotParameters();
69
69
70
    // data members
70
    // data members
71
    const G4AnalysisManagerState& fState;
71
    const G4AnalysisManagerState& fState;
Lines 77-83 class G4PlotManager Link Here
77
77
78
//_____________________________________________________________________________
78
//_____________________________________________________________________________
79
inline G4int  G4PlotManager::GetNofPlotsPerPage() const
79
inline G4int  G4PlotManager::GetNofPlotsPerPage() const
80
{ return fgPlotParameters.GetColumns()*fgPlotParameters.GetRows(); }
80
{ return fgPlotParameters().GetColumns()*fgPlotParameters().GetRows(); }
81
81
82
82
83
//_____________________________________________________________________________
83
//_____________________________________________________________________________
Lines 89-95 inline G4bool G4PlotManager::PlotAndWrite(const std::vector<T*>& htVector, Link Here
89
89
90
  fViewer->plots().init_sg(); 
90
  fViewer->plots().init_sg(); 
91
    //it will recreate the sg::plotters and then reset the styles on new ones.
91
    //it will recreate the sg::plotters and then reset the styles on new ones.
92
  fViewer->set_cols_rows(fgPlotParameters.GetColumns(), fgPlotParameters.GetRows());
92
  fViewer->set_cols_rows(fgPlotParameters().GetColumns(), fgPlotParameters().GetRows());
93
  fViewer->plots().set_current_plotter(0);
93
  fViewer->plots().set_current_plotter(0);
94
94
95
  G4bool finalResult = true;
95
  G4bool finalResult = true;
Lines 109-115 inline G4bool G4PlotManager::PlotAndWrite(const std::vector<T*>& htVector, Link Here
109
109
110
    // plot this object
110
    // plot this object
111
    fViewer->plot(*ht);
111
    fViewer->plot(*ht);
112
    fViewer->set_current_plotter_style(fgPlotParameters.GetStyle());
112
    fViewer->set_current_plotter_style(fgPlotParameters().GetStyle());
113
113
114
    // set color (only blue for the time being)
114
    // set color (only blue for the time being)
115
    tools::sg::plotter& plotter = fViewer->plots().current_plotter();
115
    tools::sg::plotter& plotter = fViewer->plots().current_plotter();
(-)a/source/analysis/management/src/G4PlotManager.cc (-10 / +14 lines)
Lines 146-152 bool load_embeded_styles(tools::xml::styles& a_styles) { Link Here
146
//
146
//
147
147
148
//_____________________________________________________________________________
148
//_____________________________________________________________________________
149
G4PlotParameters G4PlotManager::fgPlotParameters;
149
G4PlotParameters& G4PlotManager::fgPlotParameters()
150
{
151
    static G4PlotParameters instance;
152
    return instance;
153
}
150
154
151
//
155
//
152
// ctors, dtor
156
// ctors, dtor
Lines 172-181 G4PlotManager::G4PlotManager(const G4AnalysisManagerState& state) Link Here
172
  // unsigned int wh = (unsigned int)(float(ww)*A4*0.80);
176
  // unsigned int wh = (unsigned int)(float(ww)*A4*0.80);
173
  static tools::sg::text_freetype ttf;
177
  static tools::sg::text_freetype ttf;
174
  fViewer.reset(new tools::viewplot(G4cout, ttf,
178
  fViewer.reset(new tools::viewplot(G4cout, ttf,
175
                                    fgPlotParameters.GetColumns(),
179
                                    fgPlotParameters().GetColumns(),
176
                                    fgPlotParameters.GetRows(), 
180
                                    fgPlotParameters().GetRows(), 
177
                                    fgPlotParameters.GetWidth(), 
181
                                    fgPlotParameters().GetWidth(), 
178
                                    fgPlotParameters.GetHeight()));
182
                                    fgPlotParameters().GetHeight()));
179
  fViewer->plots().view_border = false;
183
  fViewer->plots().view_border = false;
180
  load_embeded_styles(fViewer->styles());
184
  load_embeded_styles(fViewer->styles());
181
  fViewer->styles().add_colormap("default",tools::sg::style_default_colormap());
185
  fViewer->styles().add_colormap("default",tools::sg::style_default_colormap());
Lines 187-196 G4PlotManager::G4PlotManager(const G4AnalysisManagerState& state) Link Here
187
    G4cout << "... using low resolution with Hershey fonts" << G4endl;
191
    G4cout << "... using low resolution with Hershey fonts" << G4endl;
188
#endif
192
#endif
189
  fViewer.reset(new tools::viewplot(G4cout, 
193
  fViewer.reset(new tools::viewplot(G4cout, 
190
                                    fgPlotParameters.GetColumns(), 
194
                                    fgPlotParameters().GetColumns(), 
191
                                    fgPlotParameters.GetRows(), 
195
                                    fgPlotParameters().GetRows(), 
192
                                    fgPlotParameters.GetWidth(), 
196
                                    fgPlotParameters().GetWidth(), 
193
                                    fgPlotParameters.GetHeight()));
197
                                    fgPlotParameters().GetHeight()));
194
  fViewer->plots().view_border = false;
198
  fViewer->plots().view_border = false;
195
#endif
199
#endif
196
}
200
}
Lines 213-219 G4bool G4PlotManager::WritePage() Link Here
213
217
214
#if defined(TOOLS_USE_FREETYPE)
218
#if defined(TOOLS_USE_FREETYPE)
215
  HD_style(fViewer->plots(), 5);
219
  HD_style(fViewer->plots(), 5);
216
  regions_style(fViewer->plots(), fgPlotParameters.GetScale());
220
  regions_style(fViewer->plots(), fgPlotParameters().GetScale());
217
#endif
221
#endif
218
222
219
  G4bool result = fViewer->write_page();
223
  G4bool result = fViewer->write_page();
(-)a/source/processes/hadronic/models/particle_hp/include/G4ParticleHPManager.hh (-2 / +1 lines)
Lines 54-59 class G4ParticleHPManager Link Here
54
{
54
{
55
   public:
55
   public:
56
      static G4ParticleHPManager* GetInstance() {
56
      static G4ParticleHPManager* GetInstance() {
57
         static G4ParticleHPManager* instance = new G4ParticleHPManager();
57
         if ( instance == NULL) instance = new G4ParticleHPManager();
58
         if ( instance == NULL) instance = new G4ParticleHPManager();
58
         return instance;
59
         return instance;
59
      };
60
      };
Lines 62-69 class G4ParticleHPManager Link Here
62
      G4ParticleHPManager();
63
      G4ParticleHPManager();
63
      G4ParticleHPManager( const G4ParticleHPManager& ){};
64
      G4ParticleHPManager( const G4ParticleHPManager& ){};
64
      ~G4ParticleHPManager();
65
      ~G4ParticleHPManager();
65
      //static G4ThreadLocal G4ParticleHPManager* instance;
66
      static G4ParticleHPManager* instance;
67
66
68
   public:
67
   public:
69
      G4ParticleHPReactionWhiteBoard* GetReactionWhiteBoard();
68
      G4ParticleHPReactionWhiteBoard* GetReactionWhiteBoard();
(-)a/source/processes/hadronic/models/particle_hp/src/G4ParticleHPManager.cc (-1 lines)
Lines 35-41 Link Here
35
#include "G4HadronicException.hh"
35
#include "G4HadronicException.hh"
36
36
37
//G4ThreadLocal G4ParticleHPManager* G4ParticleHPManager::instance = NULL;
37
//G4ThreadLocal G4ParticleHPManager* G4ParticleHPManager::instance = NULL;
38
G4ParticleHPManager* G4ParticleHPManager::instance = G4ParticleHPManager::GetInstance();
39
38
40
G4ParticleHPManager::G4ParticleHPManager()
39
G4ParticleHPManager::G4ParticleHPManager()
41
:/*RWB(NULL),*/
40
:/*RWB(NULL),*/

Return to problem 2083