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

#include <polyline.h>

+ Inheritance diagram for Heed::rectangle:

Public Member Functions

 rectangle (void)
 
 rectangle (const point &fpiv, vec fdir[2], vfloat fdim[2], 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)
 

Public Attributes

point piv
 
vec dir1
 
vec dir2
 
vfloat dim [2]
 
- Public Attributes inherited from Heed::polygon
int s_convex
 

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)
 

Static Protected Attributes

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

Additional Inherited Members

- Protected Attributes inherited from Heed::polyline_pl
plane pn
 
- Protected Attributes inherited from Heed::polyline
int qpt
 
pointpt
 
int qsl
 
straightsl
 
absref ** aref
 

Detailed Description

Definition at line 192 of file polyline.h.

Constructor & Destructor Documentation

◆ rectangle() [1/2]

Heed::rectangle::rectangle ( void  )
inline

Definition at line 198 of file polyline.h.

198: polygon() { ; }
polygon(void)
Definition: polyline.h:169

◆ rectangle() [2/2]

Heed::rectangle::rectangle ( const point fpiv,
vec  fdir[2],
vfloat  fdim[2],
vfloat  prec 
)

Definition at line 437 of file polyline.cpp.

438 {
439 pvecerror("rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2], "
440 "vfloat prec)");
441 if (check_perp(fdir[0], fdir[1], prec) != 1) {
442 mcerr << "rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2]):\n"
443 << " error: sides are not perpendicular\n";
444 // There is stil no reason found in applications for sides to be
445 // necessary perpendicular. The only reason in name of this class
446 // choosen occasionly. To my knowledge it denotes a figure with
447 // perpendicular sides.
448 mcerr << "fdir[2](directions of sides):\n" << fdir[0] << fdir[1];
449 spexit(mcerr);
450 }
451 if (fdim[0] <= 0 || fdim[1] <= 0) {
452 mcerr << "rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2]):\n"
453 << " error: fdim[0] <=0 || fdim[1] <=0\n";
454 mcerr << "fdim (dimensions):" << fdim[0] << ' ' << fdim[1] << '\n';
455 mcerr << "fdir[2](directions of sides):\n" << fdir[0] << fdir[1];
456 spexit(mcerr);
457 }
458 piv = fpiv;
459 dir1 = unit_vec(fdir[0]);
460 dir2 = unit_vec(fdir[1]);
461 dim[0] = fdim[0];
462 dim[1] = fdim[1];
463 //mcout<<"piv:\n"<<piv;
464 //mcout<<"dir[2](directions of sides):\n"<<dir[0]<<dir[1];
465 //mcout<<"dim (dimensions):"<<dim[0]<<' '<<dim[1]<<'\n';
466 straight slh[4];
467 slh[0] = straight(piv + dir1 * dim[0] / 2.0, dir2);
468 slh[1] = straight(piv + dir2 * dim[1] / 2.0, -dir1);
469 slh[2] = straight(piv - dir1 * dim[0] / 2.0, -dir2);
470 slh[3] = straight(piv - dir2 * dim[1] / 2.0, dir1);
471 polygon::operator=(polygon(slh, 4, prec));
472}
#define spexit(stream)
Definition: FunNameStack.h:536
polygon & operator=(const polygon &fpl)
Definition: polyline.cpp:336
vfloat dim[2]
Definition: polyline.h:197
#define mcerr
Definition: prstream.h:135
#define pvecerror(string)
Definition: vec.h:52

Member Function Documentation

◆ get_components()

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

Reimplemented from Heed::polyline_pl.

Definition at line 433 of file polyline.cpp.

433 {
434 aref_tran.pass(new absref_transmit(4, aref_rct, qpt + qsl, aref));
435}
absref ** aref
Definition: polyline.h:55
static absrefabsref::*[4] aref_rct
Definition: polyline.h:203

Member Data Documentation

◆ aref_rct

absref absref::* Heed::rectangle::aref_rct
staticprotected
Initial value:

Definition at line 203 of file polyline.h.

Referenced by get_components().

◆ dim

vfloat Heed::rectangle::dim[2]

Definition at line 197 of file polyline.h.

Referenced by Heed::operator<<(), and rectangle().

◆ dir1

vec Heed::rectangle::dir1

Definition at line 195 of file polyline.h.

Referenced by Heed::operator<<(), and rectangle().

◆ dir2

vec Heed::rectangle::dir2

Definition at line 196 of file polyline.h.

Referenced by Heed::operator<<(), and rectangle().

◆ piv

point Heed::rectangle::piv

Definition at line 194 of file polyline.h.

Referenced by Heed::operator<<(), and rectangle().


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