Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GMocrenTrack Class Reference

#include <G4GMocrenIO.hh>

Classes

struct  Step
 

Public Member Functions

 GMocrenTrack ()
 
 ~GMocrenTrack ()
 
int getNumberOfSteps ()
 
void addStep (float _startx, float _starty, float _startz, float _endx, float _endy, float _endz)
 
void getStep (float &_startx, float &_starty, float &_startz, float &_endx, float &_endy, float &_endz, int _num)
 
void setTrack (std::vector< struct Step > &_aTrack)
 
void setColor (unsigned char _color[3])
 
void getColor (unsigned char _color[3])
 
void translate (std::vector< float > &_tranlate)
 

Protected Attributes

std::vector< struct StepkTrack
 
unsigned char kColor [3]
 

Detailed Description

Definition at line 91 of file G4GMocrenIO.hh.

Constructor & Destructor Documentation

◆ GMocrenTrack()

GMocrenTrack::GMocrenTrack ( )

Definition at line 249 of file G4GMocrenIO.cc.

249 {
250 kTrack.clear();
251 for(int i = 0; i < 3; i++) kColor[i] = 0;
252}
unsigned char kColor[3]
Definition: G4GMocrenIO.hh:99
std::vector< struct Step > kTrack
Definition: G4GMocrenIO.hh:98

◆ ~GMocrenTrack()

GMocrenTrack::~GMocrenTrack ( )
inline

Definition at line 103 of file G4GMocrenIO.hh.

103{;}

Member Function Documentation

◆ addStep()

void GMocrenTrack::addStep ( float  _startx,
float  _starty,
float  _startz,
float  _endx,
float  _endy,
float  _endz 
)

Definition at line 254 of file G4GMocrenIO.cc.

255 {
256 struct Step step;
257 step.startPoint[0] = _startx;
258 step.startPoint[1] = _starty;
259 step.startPoint[2] = _startz;
260 step.endPoint[0] = _endx;
261 step.endPoint[1] = _endy;
262 step.endPoint[2] = _endz;
263 kTrack.push_back(step);
264}

◆ getColor()

void GMocrenTrack::getColor ( unsigned char  _color[3])
inline

Definition at line 116 of file G4GMocrenIO.hh.

116 {
117 for(int i = 0; i < 3; i++) _color[i] = kColor[i];
118 }

◆ getNumberOfSteps()

int GMocrenTrack::getNumberOfSteps ( )
inline

Definition at line 106 of file G4GMocrenIO.hh.

106{return (int)kTrack.size();}

◆ getStep()

void GMocrenTrack::getStep ( float &  _startx,
float &  _starty,
float &  _startz,
float &  _endx,
float &  _endy,
float &  _endz,
int  _num 
)

Definition at line 265 of file G4GMocrenIO.cc.

267 {
268 if(_num >= (int)kTrack.size()) {
270 G4cout << "GMocrenTrack::getStep(...) Error: "
271 << "invalid step # : " << _num << G4endl;
272 return;
273 }
274
275 _startx = kTrack[_num].startPoint[0];
276 _starty = kTrack[_num].startPoint[1];
277 _startz = kTrack[_num].startPoint[2];
278 _endx = kTrack[_num].endPoint[0];
279 _endy = kTrack[_num].endPoint[1];
280 _endz = kTrack[_num].endPoint[2];
281}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static Verbosity GetVerbosity()

◆ setColor()

void GMocrenTrack::setColor ( unsigned char  _color[3])
inline

Definition at line 113 of file G4GMocrenIO.hh.

113 {
114 for(int i = 0; i < 3; i++) kColor[i] = _color[i];
115 }

Referenced by G4GMocrenIO::addTrack().

◆ setTrack()

void GMocrenTrack::setTrack ( std::vector< struct Step > &  _aTrack)
inline

Definition at line 112 of file G4GMocrenIO.hh.

112{kTrack = _aTrack;}

Referenced by G4GMocrenIO::addTrack().

◆ translate()

void GMocrenTrack::translate ( std::vector< float > &  _tranlate)

Definition at line 282 of file G4GMocrenIO.cc.

282 {
283 std::vector<struct Step>::iterator itr = kTrack.begin();
284 for(; itr != kTrack.end(); itr++) {
285 for(int i = 0; i < 3; i++ ) {
286 itr->startPoint[i] += _translate[i];
287 itr->endPoint[i] += _translate[i];
288 }
289 }
290}

Member Data Documentation

◆ kColor

unsigned char GMocrenTrack::kColor[3]
protected

Definition at line 99 of file G4GMocrenIO.hh.

Referenced by getColor(), GMocrenTrack(), and setColor().

◆ kTrack

std::vector<struct Step> GMocrenTrack::kTrack
protected

Definition at line 98 of file G4GMocrenIO.hh.

Referenced by addStep(), getNumberOfSteps(), getStep(), GMocrenTrack(), setTrack(), and translate().


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