GMocrenTrack Class Reference

#include <G4GMocrenIO.hh>


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]

Data Structures

struct  Step


Detailed Description

Definition at line 91 of file G4GMocrenIO.hh.


Constructor & Destructor Documentation

GMocrenTrack::GMocrenTrack (  ) 

Definition at line 249 of file G4GMocrenIO.cc.

References kColor, and kTrack.

00249                            {
00250     kTrack.clear();
00251     for(int i = 0; i < 3; i++) kColor[i] = 0;
00252 }

GMocrenTrack::~GMocrenTrack (  )  [inline]

Definition at line 103 of file G4GMocrenIO.hh.

00103 {;}


Member Function Documentation

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

Definition at line 254 of file G4GMocrenIO.cc.

References GMocrenTrack::Step::endPoint, kTrack, and GMocrenTrack::Step::startPoint.

00255                                                                   {
00256   struct Step step;
00257   step.startPoint[0] = _startx;
00258   step.startPoint[1] = _starty;
00259   step.startPoint[2] = _startz;
00260   step.endPoint[0] = _endx;
00261   step.endPoint[1] = _endy;
00262   step.endPoint[2] = _endz;
00263   kTrack.push_back(step);
00264 }

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

Definition at line 116 of file G4GMocrenIO.hh.

References kColor.

00116                                          {
00117     for(int i = 0; i < 3; i++) _color[i] = kColor[i];
00118   }

int GMocrenTrack::getNumberOfSteps (  )  [inline]

Definition at line 106 of file G4GMocrenIO.hh.

References kTrack.

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

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.

References G4VisManager::errors, G4cout, G4endl, G4VisManager::GetVerbosity(), and kTrack.

00267                                      {
00268   if(_num >= (int)kTrack.size()) {
00269     if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
00270       G4cout << "GMocrenTrack::getStep(...) Error: "
00271              << "invalid step # : " << _num << G4endl;
00272     return;
00273   }
00274 
00275   _startx = kTrack[_num].startPoint[0];
00276   _starty = kTrack[_num].startPoint[1];
00277   _startz = kTrack[_num].startPoint[2];
00278   _endx = kTrack[_num].endPoint[0];
00279   _endy = kTrack[_num].endPoint[1];
00280   _endz = kTrack[_num].endPoint[2];
00281 }

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

Definition at line 113 of file G4GMocrenIO.hh.

References kColor.

Referenced by G4GMocrenIO::addTrack().

00113                                          {
00114     for(int i = 0; i < 3; i++) kColor[i] = _color[i];
00115   }

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

Definition at line 112 of file G4GMocrenIO.hh.

References kTrack.

Referenced by G4GMocrenIO::addTrack().

00112 {kTrack = _aTrack;}

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

Definition at line 282 of file G4GMocrenIO.cc.

References kTrack.

00282                                                           {
00283   std::vector<struct Step>::iterator itr = kTrack.begin();
00284   for(; itr != kTrack.end(); itr++) {
00285     for(int i = 0; i < 3; i++ ) {
00286       itr->startPoint[i] += _translate[i];
00287       itr->endPoint[i] += _translate[i];
00288     }
00289   } 
00290 }


Field Documentation

unsigned char GMocrenTrack::kColor[3] [protected]

Definition at line 99 of file G4GMocrenIO.hh.

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

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:
Generated on Mon May 27 17:54:02 2013 for Geant4 by  doxygen 1.4.7