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

#include <polyline.h>

+ Inheritance diagram for Heed::spquadr:

Public Member Functions

point Gpiv (void) const
 
vec Gdir1 (void) const
 
vec Gdir2 (void) const
 
vfloat Gawidth (void) const
 
vfloat apos (const point &fpt) const
 
vfloat apos (const straight &fsl, vfloat prec) const
 
vfloat perpos (const point &fpt) const
 
vfloat perpos (const straight &fsl, vfloat prec) const
 
point pt_angle_rad (vfloat rad, vfloat angle)
 
 spquadr (void)
 
 spquadr (spquadr &sq)
 
 spquadr (const spquadr &sq)
 
 spquadr (const point &fpiv, const straight &sl1, const straight &sl2, const vec &fdir1, const vec &fdir2, vfloat prec)
 
- Public Member Functions inherited from Heed::polygon
int check_point_in (const point &fpt, vfloat prec) const
 
point cross (const straight &fsl, vfloat prec) const
 
int range (const point &fpt, const vec &dir, vfloat &rng, point &fptenr, vfloat prec) const
 
polygonoperator= (const polygon &fpl)
 
 polygon (void)
 
 polygon (const polygon &plg)
 
 polygon (const polyline_pl &fpl, int fs_convex)
 
 polygon (const straight *fsl, int fqsl, vfloat prec)
 
- Public Member Functions inherited from Heed::polyline_pl
plane Gpn (void) const
 
 polyline_pl (void)
 
 polyline_pl (const polyline_pl &pl)
 
 polyline_pl (const plane &fpn, const point *fpt, int fqpt)
 
 polyline_pl (polyline &pl)
 
 polyline_pl (const polyline &pl)
 
polyline_ploperator= (const polyline_pl &fpl)
 
- Public Member Functions inherited from Heed::polyline
int Gqpt (void) const
 
point Gpt (int n) const
 
int Gqsl (void) const
 
straight Gsl (int n) const
 
int check_point_in (const point &fpt, vfloat prec) const
 
int cross (const straight &fsl, point *pc, int &qpc, polyline *pl, int &qpl, vfloat prec) const
 
vfloat dist_two_inter (polyline &pl, vfloat prec) const
 
vfloat distance (const point &fpt) const
 
vfloat distance (const point &fpt, point &cpt) const
 
 polyline (void)
 
 polyline (polyline &pl)
 
 polyline (const polyline &pl)
 
 polyline (const point *fpt, int fqpt)
 
 polyline (const point &fpt1, const point &fpt2)
 
polylineoperator= (const polyline &fpl)
 
 ~polyline (void)
 
- Public Member Functions inherited from absref
virtual ~absref ()
 
virtual void down (const abssyscoor *fasc)
 
virtual void up (const abssyscoor *fasc)
 
virtual void turn (const vec &dir, vfloat angle)
 
virtual void shift (const vec &dir)
 

Protected Member Functions

virtual void get_components (ActivePtr< absref_transmit > &aref_tran)
 
virtual void get_components (ActivePtr< absref_transmit > &aref_tran)
 
- Protected Member Functions inherited from Heed::polyline
virtual void get_components (ActivePtr< absref_transmit > &aref_tran)
 
void polyline_init (const point *fpt, int fqpt)
 
void polyline_del (void)
 

Protected Attributes

point piv
 
vec dir1
 
vec dir2
 
vfloat awidth
 
- Protected Attributes inherited from Heed::polyline_pl
plane pn
 
- Protected Attributes inherited from Heed::polyline
int qpt
 
pointpt
 
int qsl
 
straightsl
 
absref ** aref
 

Static Protected Attributes

static absrefabsref::*[4] aref_sp
 
- Static Protected Attributes inherited from Heed::polyline_pl
static absrefabsref::* aref_pl = (absref absref::*)&polyline_pl::pn
 

Friends

std::ostream & operator<< (std::ostream &file, const spquadr &p)
 

Additional Inherited Members

- Public Attributes inherited from Heed::polygon
int s_convex
 

Detailed Description

Definition at line 211 of file polyline.h.

Constructor & Destructor Documentation

◆ spquadr() [1/4]

Heed::spquadr::spquadr ( void  )
inline

Definition at line 251 of file polyline.h.

251: polygon(), piv(), dir1(), dir2(), awidth(0) { ; }
polygon(void)
Definition: polyline.h:169
vfloat awidth
Definition: polyline.h:215

Referenced by spquadr().

◆ spquadr() [2/4]

Heed::spquadr::spquadr ( spquadr sq)

Definition at line 505 of file polyline.cpp.

506 : polygon(sq),
507 piv(sq.piv),
508 dir1(sq.dir1),
509 dir2(sq.dir2),
510 awidth(sq.awidth) {
511 ;
512}

◆ spquadr() [3/4]

Heed::spquadr::spquadr ( const spquadr sq)

Definition at line 513 of file polyline.cpp.

514 : polygon(sq),
515 piv(sq.piv),
516 dir1(sq.dir1),
517 dir2(sq.dir2),
518 awidth(sq.awidth) {
519 ;
520}

◆ spquadr() [4/4]

Heed::spquadr::spquadr ( const point fpiv,
const straight sl1,
const straight sl2,
const vec fdir1,
const vec fdir2,
vfloat  prec 
)

Definition at line 522 of file polyline.cpp.

524 : polygon(), piv(fpiv), dir1(unit_vec(fdir1)), dir2(unit_vec(fdir2)) {
525 straight slh[4];
526 slh[0] = sl1;
527 slh[1] = straight(piv, dir1);
528 slh[2] = sl2;
529 slh[3] = straight(piv, dir2);
530 polygon plgn = polygon(slh, 4, prec);
531 *this = spquadr(fpiv, sl1, sl2, fdir1, fdir2, plgn);
532}
spquadr(void)
Definition: polyline.h:251

Member Function Documentation

◆ apos() [1/2]

vfloat Heed::spquadr::apos ( const point fpt) const
inline

Definition at line 227 of file polyline.h.

228 {
229 // it is assumed that the point is inside
230 //mcout<<"dir1="<<dir1<<"vec(fpt-piv)="<<vec(fpt-piv);
231 return acos(cos2vec(dir1, vec(fpt - piv)));
232 }
DoubleAc acos(const DoubleAc &f)
Definition: DoubleAc.cpp:488
Definition: vec.h:248
vfloat cos2vec(const vec &r1, const vec &r2)
Definition: vec.cpp:142

Referenced by apos().

◆ apos() [2/2]

vfloat Heed::spquadr::apos ( const straight fsl,
vfloat  prec 
) const
inline

Definition at line 233 of file polyline.h.

233 {
234 point pth = cross(fsl, prec);
235 if (vecerror != 0) return 0.0;
236 return apos(pth);
237 }
friend int plane::cross(const polyline &pll, point *crpt, int &qcrpt, polyline *crpll, int &qcrpll, vfloat prec) const
vfloat apos(const point &fpt) const
Definition: polyline.h:227
Definition: vec.h:477
int vecerror
Definition: vec.cpp:31

◆ Gawidth()

vfloat Heed::spquadr::Gawidth ( void  ) const
inline

Definition at line 220 of file polyline.h.

220{ return awidth; }

◆ Gdir1()

vec Heed::spquadr::Gdir1 ( void  ) const
inline

Definition at line 218 of file polyline.h.

218{ return dir1; }

◆ Gdir2()

vec Heed::spquadr::Gdir2 ( void  ) const
inline

Definition at line 219 of file polyline.h.

219{ return dir2; }

◆ get_components()

void Heed::spquadr::get_components ( ActivePtr< absref_transmit > &  aref_tran)
protectedvirtual

Reimplemented from Heed::polyline_pl.

Definition at line 492 of file polyline.cpp.

492 {
493 aref_tran.pass(new absref_transmit(4, aref_sp, qpt + qsl, aref));
494}
absref ** aref
Definition: polyline.h:55
static absrefabsref::*[4] aref_sp
Definition: polyline.h:223

◆ Gpiv()

point Heed::spquadr::Gpiv ( void  ) const
inline

Definition at line 217 of file polyline.h.

217{ return piv; }

◆ perpos() [1/2]

vfloat Heed::spquadr::perpos ( const point fpt) const
inline

Definition at line 238 of file polyline.h.

240 { // it is assumed that the point is inside
241 vfloat r = sl[0].distance(fpt);
242 return r;
243 }
straight * sl
Definition: polyline.h:31
vfloat distance(const straight &sl, int &type_of_cross, point pt[2]) const
Definition: straight.cpp:137
double vfloat
Definition: vfloat.h:15

Referenced by perpos().

◆ perpos() [2/2]

vfloat Heed::spquadr::perpos ( const straight fsl,
vfloat  prec 
) const
inline

Definition at line 244 of file polyline.h.

244 {
245 point pth = cross(fsl, prec);
246 if (vecerror != 0) return 0.0;
247 return perpos(pth);
248 }
vfloat perpos(const point &fpt) const
Definition: polyline.h:238

◆ pt_angle_rad()

point Heed::spquadr::pt_angle_rad ( vfloat  rad,
vfloat  angle 
)

Definition at line 496 of file polyline.cpp.

496 {
497 vec axis = unit_vec(dir1 || dir2);
498 vec rv = dir1;
499 rv.turn(axis, angle);
500 rv = rv * rad;
501 point rpt = piv + rv;
502 return rpt;
503}
void turn(const vec &dir, vfloat angle)
Definition: vec.cpp:298

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  file,
const spquadr p 
)
friend

Definition at line 534 of file polyline.cpp.

534 {
535 Ifile << "spquadr:\n";
536 indn.n += 2;
537 Ifile << "piv:";
538 file << p.piv;
539 Ifile << "dir1:\n";
540 file << p.dir1;
541 Ifile << "dir2:\n";
542 file << p.dir2;
543 Ifile << " awidth=" << p.awidth << '\n';
544 file << statcast(const polygon&, p);
545 indn.n -= 2;
546 return file;
547}
#define statcast(type, name)
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207

Member Data Documentation

◆ aref_sp

absref absref::* Heed::spquadr::aref_sp
staticprotected
Initial value:

Definition at line 223 of file polyline.h.

Referenced by get_components().

◆ awidth

vfloat Heed::spquadr::awidth
protected

Definition at line 215 of file polyline.h.

Referenced by Gawidth().

◆ dir1

vec Heed::spquadr::dir1
protected

Definition at line 214 of file polyline.h.

Referenced by apos(), Gdir1(), pt_angle_rad(), and spquadr().

◆ dir2

vec Heed::spquadr::dir2
protected

Definition at line 214 of file polyline.h.

Referenced by Gdir2(), pt_angle_rad(), and spquadr().

◆ piv

point Heed::spquadr::piv
protected

Definition at line 213 of file polyline.h.

Referenced by apos(), Gpiv(), pt_angle_rad(), and spquadr().


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