Garfield++ v2r0
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

Rectangle. More...

#include <polyline.h>

+ Inheritance diagram for Heed::rectangle:

Public Member Functions

 rectangle ()
 
 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 ()
 
 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 () const
 
 polyline_pl ()
 
 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 () const
 
point Gpt (int n) const
 
int Gqsl () 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
 Distance between two intervals.
 
vfloat distance (const point &fpt) const
 
vfloat distance (const point &fpt, point &cpt) const
 Distance between two points.
 
 polyline ()
 
 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 ()
 
- 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)
 

Public Attributes

point piv
 Central point.
 
vec dir1
 Directions of sides, unit length.
 
vec dir2
 Directions of sides, unit length.
 
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 ()
 

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

Rectangle.

Definition at line 180 of file polyline.h.

Constructor & Destructor Documentation

◆ rectangle() [1/2]

Heed::rectangle::rectangle ( )
inline

Definition at line 190 of file polyline.h.

190: polygon() {}

◆ rectangle() [2/2]

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

Definition at line 432 of file polyline.cpp.

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

Member Function Documentation

◆ get_components()

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

Reimplemented from Heed::polyline_pl.

Definition at line 428 of file polyline.cpp.

428 {
429 aref_tran.pass(new absref_transmit(4, aref_rct, qpt + qsl, aref));
430}
absref ** aref
Definition: polyline.h:51
static absrefabsref::*[4] aref_rct
Definition: polyline.h:195

Member Data Documentation

◆ aref_rct

absref absref::* Heed::rectangle::aref_rct
staticprotected
Initial value:
= {
(absref absref::*)&rectangle::pn, (absref absref::*)&rectangle::piv,
(absref absref::*)&rectangle::dir1, (absref absref::*)&rectangle::dir2}

Definition at line 195 of file polyline.h.

Referenced by get_components().

◆ dim

vfloat Heed::rectangle::dim[2]

Definition at line 189 of file polyline.h.

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

◆ dir1

vec Heed::rectangle::dir1

Directions of sides, unit length.

Definition at line 185 of file polyline.h.

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

◆ dir2

vec Heed::rectangle::dir2

Directions of sides, unit length.

Definition at line 187 of file polyline.h.

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

◆ piv

point Heed::rectangle::piv

Central point.

Definition at line 183 of file polyline.h.

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


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