35 if (vecerror != 0) { \
36 cerr << "vecerror is not zero(put any key)\n"; \
44 if (vecerror != 0) { \
45 cerr << "vecerror is not zero(put any key)\n"; \
52#define pvecerror(string) \
54 if (vecerror != 0) { \
55 mcerr << "vecerror is not zero, program is terminated\n" \
56 << " function detected error is " << string << '\n'; \
59#define pvecerrorp(string) \
61 if (vecerror != 0) { \
62 mcerr << "vecerror is not zero, program is terminated\n" \
63 << " function detected error is " << string << '\n'; \
109class absref_transmit;
147 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
188 : qaref(fqaref), aref(faref), qaref_pointer(0), qaref_other(0) {
193 qaref_pointer(fqaref_pointer),
194 aref_pointer(faref_pointer),
202 qaref_pointer(fqaref_pointer),
203 aref_pointer(faref_pointer),
210 virtual void print(std::ostream& file,
int l)
const;
220#define ApplyAnyFunctionToVecElements(func) \
222 ActivePtr<absref_transmit> aref_tran_cont; \
223 get_components(aref_tran_cont); \
224 absref_transmit* aref_tran = aref_tran_cont.get(); \
225 if(aref_tran != NULL) { \
227 int q = aref_tran->qaref; \
228 for(n = 0; n < q; n++)(this->*(aref_tran->aref[n])).func; \
229 q = aref_tran->qaref_pointer; \
230 for(n = 0; n < q; n++) aref_tran->aref_pointer[n]->func; \
231 q = aref_tran->qaref_other; \
232 for(n = 0; n < q; n++) { \
233 absref* ar = aref_tran->get_other(n); \
234 if(ar == NULL) break; \
253 return vec(v.
x * p, v.
y * p, v.
z * p);
260 return vec(v.
x * p, v.
y * p, v.
z * p);
268 return vec(r1.
x + r2.
x, r1.
y + r2.
y, r1.
z + r2.
z);
275 return vec(r1.
x - r2.
x, r1.
y - r2.
y, r1.
z - r2.
z);
283 return r1.
x * r2.
x + r1.
y * r2.
y + r1.
z * r2.
z;
287 return vec(r1.
y * r2.
z - r1.
z * r2.
y, r1.
z * r2.
x - r1.
x * r2.
z,
288 r1.
x * r2.
y - r1.
y * r2.
x);
300 return sqrt(v.
x * v.
x + v.
y * v.
y + v.
z * v.
z);
303 return (v.
x * v.
x + v.
y * v.
y + v.
z * v.
z);
353 void up(
const basis* fabas_new);
393#include "wcpplib/geometry/vec.ic"
402 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
457 virtual void print(std::ostream& file,
int l)
const;
468 :
basis(p, c, pname) {}
470 :
basis(pex, pey, pez, pname) {}
485 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
519 return p1.
v == p2.
v ? 1 : 0;
522 return p1.
v != p2.
v ? 1 : 0;
525 return apeq(p1.
v, p2.
v, prec);
532 virtual void print(std::ostream& file,
int l)
const;
543 :
point(fex, fey, fez) {}
559#define vec_syscoor_index 0
571 virtual void print(std::ostream& file,
int l)
const;
601 piv((fapiv != NULL) ? (*fapiv) :
point()),
602 bas((fabas != NULL) ? (*fabas) :
basis()) {
611 virtual void print(std::ostream& file,
int l)
const;
616 virtual void get_components(ActivePtr<absref_transmit>& aref_tran);
#define virt_common_base_pcomma
DoubleAc sqrt(const DoubleAc &f)
virtual void turn(const vec &dir, vfloat angle)
virtual void shift(const vec &dir)
virtual void up(const abssyscoor *fasc)
virtual void down(const abssyscoor *fasc)
abssyscoor(const String &fname)
virtual void print(std::ostream &file, int l) const
virtual const basis * Gabas(void) const =0
virtual const point * Gapiv(void) const =0
basisReg(const String &pname)
basisReg(const vec &p, const vec &c, const String &pname)
basisReg(const vec &pex, const vec &pey, const vec &pez, const String &pname)
AnyType_copy(basisReg, basis)
basisReg(const vec &p, const String &fname)
virtual void print(std::ostream &file, int l) const
AnyType_copy(basis, basis)
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
friend std::ostream & operator<<(std::ostream &file, const basis &b)
static absref absref::* aref[3]
basis switch_xyz(void) const
void Ppiv(const point &fpiv)
static absrefabsref::*[2] aref
fixsyscoor(const String &fname)
fixsyscoor(const abssyscoor &f)
fixsyscoor(const point &fpiv, const basis &fbas, const String &fname)
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
macro_copy_total(fixsyscoor)
virtual void print(std::ostream &file, int l) const
virtual const basis * Gabas(void) const
fixsyscoor(const point *const fapiv, const basis *const fabas, const String &fname)
void Pbas(const basis &fbas)
virtual const point * Gapiv(void) const
AnyType_copy(pointReg, point)
pointReg(const vfloat &fex, const vfloat &fey, const vfloat &fez)
friend int not_apeq(const point &p1, const point &p2, vfloat prec)
friend int apeq(const point &p1, const point &p2, vfloat prec)
vec operator-(const point &pp) const
friend int operator!=(const point &p1, const point &p2)
friend int operator==(const point &p1, const point &p2)
virtual void print(std::ostream &file, int l) const
point & operator=(const point &fp)
point operator+(const vec &fv) const
virtual void up(const abssyscoor *fasc)
friend std::ostream & operator<<(std::ostream &file, const point &p)
AnyType_copy(point, point)
virtual void shift(const vec &dir)
point(const vfloat &fex, const vfloat &fey, const vfloat &fez)
virtual void down(const abssyscoor *fasc)
vecReg(vfloat xx, vfloat yy, vfloat zz)
vec operator/(vfloat p) const
void random_conic_vec(double theta)
friend wl_inline int apeq(const vec &r1, const vec &r2, vfloat prec)
void shift(const vec &dir)
friend vfloat length(const vec &v)
friend vec operator*(const vec &v, vfloat p)
void down(const basis *fabas)
friend vec operator+(const vec &r1, const vec &r2)
friend vfloat ang2vec(const vec &r1, const vec &r2)
friend vfloat length2(const vec &v)
friend vec operator-(const vec &r1, const vec &r2)
friend wl_inline int operator!=(const vec &r1, const vec &r2)
friend vfloat operator*(const vec &r1, const vec &r2)
friend vec operator/=(vec &v, vfloat p)
friend vec operator||(const vec &r1, const vec &r2)
void random_round_vec(void)
friend wl_inline int operator==(const vec &r1, const vec &r2)
friend wl_inline int check_par(const vec &r1, const vec &r2, vfloat prec)
friend vec operator-=(vec &r1, const vec &r2)
vec up_new(const basis *fabas_new)
friend vec & operator+=(vec &r1, const vec &r2)
friend vec operator-(const vec &r)
friend vec operator*=(vec &v, vfloat p)
friend vec operator*(vfloat p, const vec &v)
friend wl_inline vec switch_xyz(const vec &)
void random_sfer_vec(void)
friend wl_inline int not_apeq(const vec &r1, const vec &r2, vfloat prec)
vec(vfloat xx, vfloat yy, vfloat zz)
void up(const basis *fabas_new)
friend vec project_to_plane(const vec &r, const vec &normal)
friend vfloat cos2vec(const vec &r1, const vec &r2)
friend wl_inline int check_perp(const vec &r1, const vec &r2, vfloat prec)
vec down_new(const basis *fabas)
friend vfloat ang2projvec(const vec &r1, const vec &r2, const vec &normal)
friend vfloat sin2vec(const vec &r1, const vec &r2)
friend wl_inline vec unit_vec(const vec &v)
void turn(const vec &dir, vfloat angle)
vec turn_new(const vec &dir, vfloat angle)
virtual void print(std::ostream &file, int l) const
virtual absref * get_other(int n)
absref_transmit(int fqaref, absref absref::**faref, int fqaref_pointer, absref **faref_pointer)
absref_transmit(int fqaref_pointer, absref **faref_pointer)
macro_copy_header(absref_transmit)
absref_transmit(const absref_transmit &f)
virtual ~absref_transmit()
absref_transmit(int fqaref, absref absref::**faref)
std::ostream & operator<<(std::ostream &file, const vec &v)