Basis.
More...
#include <vec.h>
|
vec | Gex () const |
|
vec | Gey () const |
|
vec | Gez () const |
|
basis | switch_xyz () const |
| Change ex=ez; ey=ex; ez=ey.
|
|
| basis () |
| Nominal basis.
|
|
| basis (const std::string &pname) |
| Nominal basis.
|
|
| basis (const vec &p, const std::string &fname) |
|
| basis (const vec &p, const vec &c, const std::string &pname) |
|
| basis (const basis &pb, const std::string &pname) |
| Same basis with other name, useful for later turning.
|
|
| basis (const vec &pex, const vec &pey, const vec &pez, const std::string &pname) |
| Direct definitions of basis by three perpendicular unit-length vectors.
|
|
virtual basis * | copy () const |
|
virtual void | print (std::ostream &file, int l) const |
|
virtual | ~basis () |
|
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) |
|
Basis.
Definition at line 313 of file vec.h.
◆ basis() [1/6]
◆ basis() [2/6]
Heed::basis::basis |
( |
const std::string & |
pname | ) |
|
Nominal basis.
Definition at line 285 of file vec.cpp.
285 :
ex(1, 0, 0),
ey(0, 1, 0),
ez(0, 0, 1) {
287}
◆ basis() [3/6]
Heed::basis::basis |
( |
const vec & |
p, |
|
|
const std::string & |
fname |
|
) |
| |
Longitudinal basis. z-axis is parallel to p. y-axis is vector product of z_new and z_old x-axis is vector product of y_new and z_new If p is parallel to z_old, the copy of old basis is created. If p is anti-parallel to z_old, the inverted copy of old basis is created.
Definition at line 289 of file vec.cpp.
289 {
292
293
294
295 if (p.length() == 0) {
300 }
302 if (ca == 1) {
306 } else if (ca == -1) {
310 } else {
314 }
315}
vfloat cos2vec(const vec &r1, const vec &r2)
#define pvecerror(string)
◆ basis() [4/6]
Heed::basis::basis |
( |
const vec & |
p, |
|
|
const vec & |
c, |
|
|
const std::string & |
pname |
|
) |
| |
More sophisticated basis. ez is parallel to p, ez=unit_vec(p) ey is perpendicular to plane which have p and c, ey=unit_vec(ez||c) ex is vector product of y and z, ex=ey||ez If p is parallel to c, or p is anti-parallel to c, vecerror=1 if(length(p)==0||length(c)==0)) vecerror=1;
Definition at line 317 of file vec.cpp.
317 {
318 pvecerror(
"basis::basis(vec &p, vec &c, char pname[12])");
320
321 if (p.length() == 0 || c.length() == 0) {
326 }
328 if (ca == 1) {
333 } else if (ca == -1) {
338 } else {
340 ey = unit_vec(
ez || c);
342 }
343}
◆ basis() [5/6]
Heed::basis::basis |
( |
const basis & |
pb, |
|
|
const std::string & |
pname |
|
) |
| |
Same basis with other name, useful for later turning.
Definition at line 346 of file vec.cpp.
347 :
ex(pb.ex),
ey(pb.ey),
ez(pb.ez) {
349}
◆ basis() [6/6]
Heed::basis::basis |
( |
const vec & |
pex, |
|
|
const vec & |
pey, |
|
|
const vec & |
pez, |
|
|
const std::string & |
pname |
|
) |
| |
Direct definitions of basis by three perpendicular unit-length vectors.
Definition at line 351 of file vec.cpp.
352 {
353 pvecerror(
"basis::basis(vec &pex, vec &pey, vec &pez, char pname[12])");
356 mcerr <<
"ERROR in basis::basis(vec &pex, vec &pey, vec &pez) : \n"
357 << "the vectors are not perpendicular\n";
358 mcerr <<
" pex,pey,pez:\n";
359 mcerr << pex << pey << pez;
360 mcerr <<
"name=" << pname <<
'\n';
362 }
366 mcerr <<
"ERROR in basis::basis(vec &pex, vec &pey, vec &pez) : \n"
367 << "the vectors are not of unit length\n";
368 mcerr <<
" pex,pey,pez:\n";
369 mcerr << pex << pey << pez;
370 mcerr <<
"name=" << pname <<
'\n';
372 }
374 mcerr <<
"ERROR in basis::basis(vec &pex, vec &pey, vec &pez) : \n";
375 mcerr <<
"wrong direction of pez\n";
376 mcerr <<
" pex,pey,pez:\n";
377 mcerr << pex << pey << pez;
378 mcerr <<
"name=" << pname <<
'\n';
380 }
385}
bool apeq(const circumf &f1, const circumf &f2, vfloat prec)
◆ ~basis()
virtual Heed::basis::~basis |
( |
| ) |
|
|
inlinevirtual |
◆ copy()
virtual basis * Heed::basis::copy |
( |
| ) |
const |
|
inlinevirtual |
Definition at line 360 of file vec.h.
360{
return new basis(*
this); }
◆ get_components()
Reimplemented from Heed::absref.
Definition at line 272 of file vec.cpp.
272 {
273 return absref_transmit(3,
aref);
274}
static absref absref::* aref[3]
◆ Gex()
vec Heed::basis::Gex |
( |
| ) |
const |
|
inline |
◆ Gey()
vec Heed::basis::Gey |
( |
| ) |
const |
|
inline |
◆ Gez()
vec Heed::basis::Gez |
( |
| ) |
const |
|
inline |
◆ print()
void Heed::basis::print |
( |
std::ostream & |
file, |
|
|
int |
l |
|
) |
| const |
|
virtual |
◆ switch_xyz()
basis Heed::basis::switch_xyz |
( |
| ) |
const |
Change ex=ez; ey=ex; ez=ey.
Definition at line 276 of file vec.cpp.
276 {
277 pvecerror(
"basis basis::switch_xyz(void)");
279}
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
file, |
|
|
const basis & |
b |
|
) |
| |
|
friend |
Definition at line 389 of file vec.cpp.
389 {
390 Ifile <<
"basis: name=" << b.name <<
'\n';
392 int indnsave =
indn.
n;
395 file << b.ex;
399 file << b.ey;
403 file << b.ez;
406 return file;
407}
◆ aref
absref absref::* Heed::basis::aref |
|
staticprotected |
Initial value:= {
reinterpret_cast<absref absref::*
>(
static_cast<vec absref::*
>(&
basis::ex)),
reinterpret_cast<absref absref::*
>(
static_cast<vec absref::*
>(&
basis::ey)),
reinterpret_cast<absref absref::*
>(
static_cast<vec absref::*
>(&
basis::ez))}
Definition at line 321 of file vec.h.
Referenced by get_components().
◆ ex
Unit vectors giving directions of Cartesian axes. Supposed to be perpendicular, therefore not public.
Definition at line 317 of file vec.h.
Referenced by basis(), Gex(), and switch_xyz().
◆ ey
◆ ez
◆ name
std::string Heed::basis::name |
The documentation for this class was generated from the following files: