Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GMocrenDetector Class Reference

#include <G4GMocrenIO.hh>

Collaboration diagram for GMocrenDetector:

Classes

struct  Edge
 

Public Member Functions

 GMocrenDetector ()
 
 ~GMocrenDetector ()
 
int getNumberOfEdges ()
 
void addEdge (float _startx, float _starty, float _startz, float _endx, float _endy, float _endz)
 
void getEdge (float &_startx, float &_starty, float &_startz, float &_endx, float &_endy, float &_endz, int _num)
 
void setDetector (std::vector< struct Edge > &_aDetector)
 
void setColor (unsigned char _color[3])
 
void getColor (unsigned char _color[3])
 
void setName (std::string &_name)
 
std::string getName ()
 
void translate (std::vector< float > &_tranlate)
 

Protected Attributes

std::vector< struct EdgekDetector
 
unsigned char kColor [3]
 
std::string kName
 

Detailed Description

Definition at line 127 of file G4GMocrenIO.hh.

Constructor & Destructor Documentation

GMocrenDetector::GMocrenDetector ( )

Definition at line 301 of file G4GMocrenIO.cc.

301  {
302  kDetector.clear();
303  for(int i = 0; i < 3; i++) kColor[i] = 0;
304 }
unsigned char kColor[3]
Definition: G4GMocrenIO.hh:135
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134
GMocrenDetector::~GMocrenDetector ( )
inline

Definition at line 140 of file G4GMocrenIO.hh.

140 {;}

Member Function Documentation

void GMocrenDetector::addEdge ( float  _startx,
float  _starty,
float  _startz,
float  _endx,
float  _endy,
float  _endz 
)

Definition at line 306 of file G4GMocrenIO.cc.

307  {
308  struct Edge edge;
309  edge.startPoint[0] = _startx;
310  edge.startPoint[1] = _starty;
311  edge.startPoint[2] = _startz;
312  edge.endPoint[0] = _endx;
313  edge.endPoint[1] = _endy;
314  edge.endPoint[2] = _endz;
315  kDetector.push_back(edge);
316 }
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134
void GMocrenDetector::getColor ( unsigned char  _color[3])
inline

Definition at line 153 of file G4GMocrenIO.hh.

153  {
154  for(int i = 0; i < 3; i++) _color[i] = kColor[i];
155  }
unsigned char kColor[3]
Definition: G4GMocrenIO.hh:135
void GMocrenDetector::getEdge ( float &  _startx,
float &  _starty,
float &  _startz,
float &  _endx,
float &  _endy,
float &  _endz,
int  _num 
)

Definition at line 317 of file G4GMocrenIO.cc.

319  {
320  if(_num >= (int)kDetector.size()) {
322  G4cout << "GMocrenDetector::getEdge(...) Error: "
323  << "invalid edge # : " << _num << G4endl;
324  return;
325  }
326 
327  _startx = kDetector[_num].startPoint[0];
328  _starty = kDetector[_num].startPoint[1];
329  _startz = kDetector[_num].startPoint[2];
330  _endx = kDetector[_num].endPoint[0];
331  _endy = kDetector[_num].endPoint[1];
332  _endz = kDetector[_num].endPoint[2];
333 }
G4GLOB_DLL std::ostream G4cout
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

std::string GMocrenDetector::getName ( void  )
inline

Definition at line 157 of file G4GMocrenIO.hh.

157 {return kName;}
std::string kName
Definition: G4GMocrenIO.hh:136
int GMocrenDetector::getNumberOfEdges ( )
inline

Definition at line 143 of file G4GMocrenIO.hh.

143 {return (int)kDetector.size();}
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134
void GMocrenDetector::setColor ( unsigned char  _color[3])
inline

Definition at line 150 of file G4GMocrenIO.hh.

150  {
151  for(int i = 0; i < 3; i++) kColor[i] = _color[i];
152  }
unsigned char kColor[3]
Definition: G4GMocrenIO.hh:135

Here is the caller graph for this function:

void GMocrenDetector::setDetector ( std::vector< struct Edge > &  _aDetector)
inline

Definition at line 149 of file G4GMocrenIO.hh.

149 {kDetector = _aDetector;}
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134

Here is the caller graph for this function:

void GMocrenDetector::setName ( std::string &  _name)
inline

Definition at line 156 of file G4GMocrenIO.hh.

156 { kName = _name;}
std::string kName
Definition: G4GMocrenIO.hh:136

Here is the caller graph for this function:

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

Definition at line 334 of file G4GMocrenIO.cc.

334  {
335  std::vector<struct Edge>::iterator itr = kDetector.begin();
336  for(; itr != kDetector.end(); itr++) {
337  for(int i = 0; i < 3; i++) {
338  itr->startPoint[i] += _translate[i];
339  itr->endPoint[i] += _translate[i];
340  }
341  }
342 }
std::vector< struct Edge > kDetector
Definition: G4GMocrenIO.hh:134

Member Data Documentation

unsigned char GMocrenDetector::kColor[3]
protected

Definition at line 135 of file G4GMocrenIO.hh.

std::vector<struct Edge> GMocrenDetector::kDetector
protected

Definition at line 134 of file G4GMocrenIO.hh.

std::string GMocrenDetector::kName
protected

Definition at line 136 of file G4GMocrenIO.hh.


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