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

#include <G4GMocrenIO.hh>

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::GMocrenDetector ( )

Definition at line 300 of file G4GMocrenIO.cc.

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

◆ ~GMocrenDetector()

GMocrenDetector::~GMocrenDetector ( )
inline

Definition at line 140 of file G4GMocrenIO.hh.

140{;}

Member Function Documentation

◆ addEdge()

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

Definition at line 305 of file G4GMocrenIO.cc.

306 {
307 struct Edge edge;
308 edge.startPoint[0] = _startx;
309 edge.startPoint[1] = _starty;
310 edge.startPoint[2] = _startz;
311 edge.endPoint[0] = _endx;
312 edge.endPoint[1] = _endy;
313 edge.endPoint[2] = _endz;
314 kDetector.push_back(edge);
315}

◆ getColor()

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 }

◆ getEdge()

void GMocrenDetector::getEdge ( float &  _startx,
float &  _starty,
float &  _startz,
float &  _endx,
float &  _endy,
float &  _endz,
int  _num 
)

Definition at line 316 of file G4GMocrenIO.cc.

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

◆ getName()

std::string GMocrenDetector::getName ( )
inline

Definition at line 157 of file G4GMocrenIO.hh.

157{return kName;}
std::string kName
Definition: G4GMocrenIO.hh:136

◆ getNumberOfEdges()

int GMocrenDetector::getNumberOfEdges ( )
inline

Definition at line 143 of file G4GMocrenIO.hh.

143{return (int)kDetector.size();}

◆ setColor()

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 }

Referenced by G4GMocrenIO::addDetector().

◆ setDetector()

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

Definition at line 149 of file G4GMocrenIO.hh.

149{kDetector = _aDetector;}

Referenced by G4GMocrenIO::addDetector().

◆ setName()

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

Definition at line 156 of file G4GMocrenIO.hh.

156{ kName = _name;}

Referenced by G4GMocrenIO::addDetector().

◆ translate()

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

Definition at line 333 of file G4GMocrenIO.cc.

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

Member Data Documentation

◆ kColor

unsigned char GMocrenDetector::kColor[3]
protected

Definition at line 135 of file G4GMocrenIO.hh.

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

◆ kDetector

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

◆ kName

std::string GMocrenDetector::kName
protected

Definition at line 136 of file G4GMocrenIO.hh.

Referenced by getName(), and setName().


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