Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::manip_absvol Class Referenceabstract

Abstract base classs for volume "manipulators". More...

#include <volume.h>

+ Inheritance diagram for Heed::manip_absvol:

Public Member Functions

virtual absvolGavol () const =0
 Get the volume.
 
virtual const abssyscoorGasc () const
 Get the coordinate system.
 
virtual int m_check_point_inside (const point &fpt, const vec &dir) const
 
virtual int m_find_embed_vol (const point &fpt, const vec &fdir, manip_absvol_treeid *atid) const
 
virtual int m_range (trajestep &fts, int s_ext, int &sb, manip_absvol *&faeid) const
 
virtual int m_range_ext (trajestep &fts, int s_ext) const
 
void down_absref (absref *f) const
 
void up_absref (absref *f) const
 
void m_chname (char *nm) const
 
virtual void m_print (std::ostream &file, int l) const
 
manip_absvolcopy () const
 
virtual ~manip_absvol ()
 
- Public Member Functions inherited from Heed::absref
virtual ~absref ()
 Destructor.
 
virtual void down (const abssyscoor *fasc)
 Convert numbering representation of object to basical system of fasc.
 
virtual void up (const abssyscoor *fasc)
 Convert numbering representation of objects to new system.
 
virtual void turn (const vec &dir, vfloat angle)
 Turn around axis doing via center of coordinate system along dir.
 
virtual void shift (const vec &dir)
 

Detailed Description

Abstract base classs for volume "manipulators".

Definition at line 128 of file volume.h.

Constructor & Destructor Documentation

◆ ~manip_absvol()

virtual Heed::manip_absvol::~manip_absvol ( )
inlinevirtual

Definition at line 162 of file volume.h.

162{}

Member Function Documentation

◆ copy()

manip_absvol * Heed::manip_absvol::copy ( ) const

Definition at line 251 of file volume.cpp.

251 {
252 mcerr << "manip_absvol_copy() not defined\n";
253 spexit(mcerr);
254 return NULL;
255}
#define spexit(stream)
Definition: FunNameStack.h:256
#define mcerr
Definition: prstream.h:128

◆ down_absref()

void Heed::manip_absvol::down_absref ( absref f) const
inline

Definition at line 151 of file volume.h.

151 {
152 const abssyscoor* asc = Gasc();
153 if (asc) f->down(asc);
154 }
virtual const abssyscoor * Gasc() const
Get the coordinate system.
Definition: volume.h:133

Referenced by m_range(), and m_range_ext().

◆ Gasc()

virtual const abssyscoor * Heed::manip_absvol::Gasc ( ) const
inlinevirtual

Get the coordinate system.

Reimplemented in Heed::sh_manip_absvol.

Definition at line 133 of file volume.h.

133 {
134 // Return NULL if it is the same system
135 return NULL;
136 }

Referenced by down_absref(), m_check_point_inside(), m_print(), and up_absref().

◆ Gavol()

◆ m_check_point_inside()

int Heed::manip_absvol::m_check_point_inside ( const point fpt,
const vec dir 
) const
virtual

Definition at line 154 of file volume.cpp.

155 {
156 const abssyscoor* asc = Gasc();
157 const absvol* avol = Gavol();
158 if (asc) {
159 point pt = fpt;
160 vec dir = fdir;
161 pt.up(asc);
162 dir.up(asc);
163 return avol->check_point_inside(pt, dir);
164 }
165 return avol->check_point_inside(fpt, fdir);
166}
virtual absvol * Gavol() const =0
Get the volume.

◆ m_chname()

void Heed::manip_absvol::m_chname ( char *  nm) const

Definition at line 223 of file volume.cpp.

223 {
224 strcpy(nm, "mvol->");
225 Gavol()->chname(&nm[6]);
226}
virtual void chname(char *nm) const
Definition: volume.h:121

Referenced by m_print(), and Heed::stvpoint::print().

◆ m_find_embed_vol()

int Heed::manip_absvol::m_find_embed_vol ( const point fpt,
const vec fdir,
manip_absvol_treeid atid 
) const
virtual

Definition at line 168 of file volume.cpp.

169 {
170 mfunname("int manip_absvol::m_find_embed_vol(...)");
171 absvol* avol = Gavol();
172 point pt = fpt;
173 up_absref(&pt);
174 vec dir = fdir;
175 up_absref(&dir);
176 // TODO!
177 atid->eid.resize(atid->eid.size() + 1);
178 atid->eid.back() = (manip_absvol*)this;
179 unsigned int s = atid->eid.size();
180 int iret = avol->find_embed_vol(pt, dir, atid);
181 if (iret == 0) {
182 if (atid->eid.size() < s) {
183 mcerr << "manip_absvol::m_find_embed_vol: should never happen\n";
184 exit(1);
185 }
186 atid->eid.pop_back();
187 return 0;
188 } else {
189 if (atid->eid.size() < s) {
190 mcerr << "manip_absvol::m_find_embed_vol: should never happen\n";
191 exit(1);
192 }
193 return 1;
194 }
195}
#define mfunname(string)
Definition: FunNameStack.h:45
void up_absref(absref *f) const
Definition: volume.h:155

Referenced by Heed::gparticle::gparticle().

◆ m_print()

void Heed::manip_absvol::m_print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented in Heed::sh_manip_absvol.

Definition at line 228 of file volume.cpp.

228 {
229 if (l <= 0) return;
230 char s[1000];
231 m_chname(s);
232 Ifile << "manip_absvol::m_print(l=" << l << "): " << s << '\n';
233 --l;
234 if (l > 0) {
235 indn.n += 2;
236 const abssyscoor* asys = Gasc();
237 if (asys)
238 asys->print(file, l - 1);
239 else
240 mcout << "manip_absvol::m_print: system==NULL\n";
241 absvol* avol = Gavol();
242 if (avol)
243 avol->print(file, l - 1);
244 else
245 mcout << "manip_absvol::m_print: avol==NULL\n";
246 indn.n -= 2;
247 }
248 file.flush();
249}
void m_chname(char *nm) const
Definition: volume.cpp:223
indentation indn
Definition: prstream.cpp:15
#define mcout
Definition: prstream.h:126
#define Ifile
Definition: prstream.h:196

◆ m_range()

int Heed::manip_absvol::m_range ( trajestep fts,
int  s_ext,
int &  sb,
manip_absvol *&  faeid 
) const
virtual

Definition at line 197 of file volume.cpp.

198 {
199 trajestep ts(fts);
200 up_absref(&ts);
201 absvol* avol = Gavol();
202
203 const int s = avol->range(ts, s_ext, sb, faeid);
204 if (s == 1) {
205 down_absref(&ts);
206 fts = ts;
207 }
208 return s;
209}
void down_absref(absref *f) const
Definition: volume.h:151

◆ m_range_ext()

int Heed::manip_absvol::m_range_ext ( trajestep fts,
int  s_ext 
) const
virtual

Definition at line 211 of file volume.cpp.

211 {
212 trajestep ts(fts);
213 up_absref(&ts);
214 absvol* avol = Gavol();
215 int s = avol->range_ext(ts, s_ext);
216 if (s == 1) {
217 down_absref(&ts);
218 fts = ts;
219 }
220 return s;
221}

◆ up_absref()

void Heed::manip_absvol::up_absref ( absref f) const
inline

Definition at line 155 of file volume.h.

155 {
156 const abssyscoor* asc = Gasc();
157 if (asc) f->up(asc);
158 }

Referenced by m_find_embed_vol(), m_range(), and m_range_ext().


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