Garfield++ v2r0
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 () const
 
vec Gdir1 () const
 
vec Gdir2 () const
 
vfloat Gawidth () const
 
vfloat apos (const point &fpt) const
 Position in units of radians.
 
vfloat apos (const straight &fsl, vfloat prec) const
 
vfloat perpos (const point &fpt) const
 Perpendicular position. Distance from basis sl[0].
 
vfloat perpos (const straight &fsl, vfloat prec) const
 
point pt_angle_rad (vfloat rad, vfloat angle)
 
 spquadr ()
 
 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 ()
 
 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)
 

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

Protected Attributes

point piv
 
vec dir1
 
vec dir2
 
vfloat awidth
 Width of total plane in units of radians.
 
- 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

Special quadrangle (for cathode strip shamber). Two lines are going from a point of origin.

Definition at line 203 of file polyline.h.

Constructor & Destructor Documentation

◆ spquadr() [1/4]

Heed::spquadr::spquadr ( )
inline

Definition at line 244 of file polyline.h.

244: polygon(), piv(), dir1(), dir2(), awidth(0) {}
vfloat awidth
Width of total plane in units of radians.
Definition: polyline.h:208

Referenced by spquadr().

◆ spquadr() [2/4]

Heed::spquadr::spquadr ( spquadr sq)

Definition at line 500 of file polyline.cpp.

501 : polygon(sq),
502 piv(sq.piv),
503 dir1(sq.dir1),
504 dir2(sq.dir2),
505 awidth(sq.awidth) {
506 ;
507}

◆ spquadr() [3/4]

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

Definition at line 508 of file polyline.cpp.

509 : polygon(sq),
510 piv(sq.piv),
511 dir1(sq.dir1),
512 dir2(sq.dir2),
513 awidth(sq.awidth) {
514 ;
515}

◆ 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 517 of file polyline.cpp.

519 : polygon(), piv(fpiv), dir1(unit_vec(fdir1)), dir2(unit_vec(fdir2)) {
520 straight slh[4];
521 slh[0] = sl1;
522 slh[1] = straight(piv, dir1);
523 slh[2] = sl2;
524 slh[3] = straight(piv, dir2);
525 polygon plgn = polygon(slh, 4, prec);
526 *this = spquadr(fpiv, sl1, sl2, fdir1, fdir2, plgn);
527}

Member Function Documentation

◆ apos() [1/2]

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

Position in units of radians.

Definition at line 222 of file polyline.h.

222 {
223 // it is assumed that the point is inside
224 return acos(cos2vec(dir1, vec(fpt - piv)));
225 }
DoubleAc acos(const DoubleAc &f)
Definition: DoubleAc.cpp:490
vfloat cos2vec(const vec &r1, const vec &r2)
Definition: vec.cpp:66

Referenced by apos().

◆ apos() [2/2]

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

Definition at line 226 of file polyline.h.

226 {
227 point pth = cross(fsl, prec);
228 if (vecerror != 0) return 0.0;
229 return apos(pth);
230 }
friend int plane::cross(const polyline &pll, point *crpt, int &qcrpt, polyline *crpll, int &qcrpll, vfloat prec) const
vfloat apos(const point &fpt) const
Position in units of radians.
Definition: polyline.h:222
int vecerror
Definition: vec.cpp:29

◆ Gawidth()

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

Definition at line 214 of file polyline.h.

214{ return awidth; }

◆ Gdir1()

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

Definition at line 212 of file polyline.h.

212{ return dir1; }

◆ Gdir2()

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

Definition at line 213 of file polyline.h.

213{ return dir2; }

◆ get_components()

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

Reimplemented from Heed::polyline_pl.

Definition at line 487 of file polyline.cpp.

487 {
488 aref_tran.pass(new absref_transmit(4, aref_sp, qpt + qsl, aref));
489}
absref ** aref
Definition: polyline.h:51
static absrefabsref::*[4] aref_sp
Definition: polyline.h:217

◆ Gpiv()

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

Definition at line 211 of file polyline.h.

211{ return piv; }

◆ perpos() [1/2]

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

Perpendicular position. Distance from basis sl[0].

Definition at line 232 of file polyline.h.

232 {
233 // it is assumed that the point is inside
234 vfloat r = sl[0].distance(fpt);
235 return r;
236 }
straight * sl
Definition: polyline.h:28
vfloat distance(const straight &sl, int &type_of_cross, point pt[2]) const
Definition: straight.cpp:137
double vfloat
Definition: vfloat.h:16

Referenced by perpos().

◆ perpos() [2/2]

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

Definition at line 237 of file polyline.h.

237 {
238 point pth = cross(fsl, prec);
239 if (vecerror != 0) return 0.0;
240 return perpos(pth);
241 }
vfloat perpos(const point &fpt) const
Perpendicular position. Distance from basis sl[0].
Definition: polyline.h:232

◆ pt_angle_rad()

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

Definition at line 491 of file polyline.cpp.

491 {
492 vec axis = unit_vec(dir1 || dir2);
493 vec rv = dir1;
494 rv.turn(axis, angle);
495 rv = rv * rad;
496 point rpt = piv + rv;
497 return rpt;
498}
void turn(const vec &dir, vfloat angle)
Turn this vector.
Definition: vec.cpp:216

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 529 of file polyline.cpp.

529 {
530 Ifile << "spquadr:\n";
531 indn.n += 2;
532 Ifile << "piv:";
533 file << p.piv;
534 Ifile << "dir1:\n";
535 file << p.dir1;
536 Ifile << "dir2:\n";
537 file << p.dir2;
538 Ifile << " awidth=" << p.awidth << '\n';
539 file << static_cast<const polygon&>(p);
540 indn.n -= 2;
541 return file;
542}
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:196

Member Data Documentation

◆ aref_sp

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

Definition at line 217 of file polyline.h.

Referenced by get_components().

◆ awidth

vfloat Heed::spquadr::awidth
protected

Width of total plane in units of radians.

Definition at line 208 of file polyline.h.

Referenced by Gawidth().

◆ dir1

vec Heed::spquadr::dir1
protected

Definition at line 206 of file polyline.h.

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

◆ dir2

vec Heed::spquadr::dir2
protected

Definition at line 206 of file polyline.h.

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

◆ piv

point Heed::spquadr::piv
protected

Definition at line 205 of file polyline.h.

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


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