23 aref_tran.pass(
new absref_transmit(2,
aref_splane));
28 mfunname(
"int splane::check_point_inside(const point& fpt, const vec& dir, "
32 if (fpt ==
pn.
Gpiv())
return 1;
51 if (s_ext == 1)
return 0;
103 if (q == 0)
return 0;
137 vcr[0] = pt[0] - cf.
Gpiv();
138 vcr[1] = pt[1] - cf.
Gpiv();
142 if (angle[0] > angle[1]) {
151 rng = cf.
Grad() * angle[0];
166 rng = cf.
Grad() * angle[1];
170 s_ext[1] = (ins == 0 ? 1 : 0);
182 Ifile <<
"splane:\n";
197 mfunname(
"ulsvolume::check_point_inside(...)");
199 for (
int n = 0; n <
qsurf; n++) {
204#ifdef TRACE_find_embed_vol
206 Imcout <<
"ulsvolume::check_point_inside: the point is in volume\n";
207 Imcout <<
"point:" << fpt;
215 mfunnamep(
"int ulsvolume::range_ext(trajestep& fts, int s_ext) const");
217#ifdef DEBUG_ulsvolume_range_ext
218 mcout <<
"ulsvolume::range_ext, START, s_ext=" << s_ext <<
" qsurf=" <<
qsurf
228 for (n = 0; n <
qsurf; n++) {
229 int qc =
surf[n].get()->range(fts, crange, cpt, fs_ext);
230 for (m = 0; m < qc; m++) {
231 if (fs_ext[m] == 1) {
237 }
else if (fs_ext[m] == 0) {
241 mcerr <<
"\nshould never happen\n"
242 <<
"It may happen if you call this function with s_ext==1\n"
243 <<
"for point outside the volume\n";
246 }
else if (fs_ext[m] == 2)
257 for (n = 0; n <
qsurf; n++) {
258#ifdef DEBUG_ulsvolume_range_ext
261 int qc =
surf[n].get()->range(fts, crange, cpt, fs_ext);
262#ifdef DEBUG_ulsvolume_range_ext
263 mcout <<
"ulsvolume::range_ext: qc=" << qc <<
"\n";
266 for (nc = 0; nc < qc; nc++)
268#ifdef DEBUG_ulsvolume_range_ext
269 mcout <<
"nc=" << nc <<
" fs_ext[nc]=" << fs_ext[nc] <<
'\n';
274 for (m = 0; m <
qsurf; m++)
277 if (
surf[m].get()->check_point_inside1(cpt[nc], fs_ext[nc],
279#ifdef DEBUG_ulsvolume_range_ext
280 mcout <<
"m=" << m <<
'\n';
281 mcout <<
"Since the point is outside of the other surface, "
282 <<
"it can not be border of volume\n";
289#ifdef DEBUG_ulsvolume_range_ext
293#ifdef DEBUG_ulsvolume_range_ext
294 mcout <<
"The crossing point is inside all other surfaces, \n"
295 <<
"so it is good crossing point\n";
309#ifdef DEBUG_ulsvolume_range_ext
310 mcout <<
"ulsvolume::range_ext: at the end\n";
312 mcout <<
"ss=" << ss <<
'\n';
344 for (
int n = 0; n <
qsurf; ++n)
348 for (
int n = 0; n <
qsurf; ++n) {
349 surf[n].put(fsurf[n]);
355 : qsurf(fqsurf), name(fname) {
356 mfunname(
"ulsvolume::ulsvolume(...)");
359 for (
int n = 0; n <
qsurf; ++n)
360 surf[n].put(fsurf[n]);
365 mfunname(
"ulsvolume::ulsvolume(...)");
368 for (
int n = 0; n <
qsurf; ++n)
374 mfunname(
"ulsvolume::ulsvolume(...)");
377 for (
int n = 0; n <
qsurf; ++n)
386 Ifile <<
"ulsvolume::print(l=" << l <<
"): " << s <<
'\n';
390 for (
int n = 0; n <
qsurf; ++n) {
391 Ifile <<
" nsurf=" << n <<
'\n';
392 surf[n].get()->print(file, l);
410 Ifile <<
"manip_ulsvolume::print(l=" << l <<
"): " << s <<
'\n';
#define macro_copy_body(type)
#define check_econd11(a, signb, stream)
#define mfunnamep(string)
#define check_econd12(a, sign, b, stream)
int cross(const plane &pn, point pt[2], vfloat prec) const
virtual void print(std::ostream &file, int l) const
manip_ulsvolume(void)
Constructors.
virtual void chname(char *nm) const
point cross(const straight &sl) const
int check_point_in(const point &fp, vfloat prec) const
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
int range(const trajestep &fts, vfloat *crange, point *cpt, int *s_ext) const
int check_point_inside1(const point &fpt, int s_ext, vfloat fprec) const
virtual void print(std::ostream &file, int l) const
static absrefabsref::*[2] aref_splane
int check_point_inside(const point &fpt, const vec &dir, vfloat fprec) const
void ulsvolume_init(surface *fsurf[pqqsurf], int fqsurf, const String &fname, vfloat fprec)
surface * adrsurf[pqqsurf]
virtual void print(std::ostream &file, int l) const
virtual void chname(char *nm) const
ulsvolume(void)
Constructors.
int check_point_inside(const point &fpt, const vec &dir) const
int range_ext(trajestep &fts, int s_ext) const
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
ActivePtr< surface > surf[pqqsurf]
virtual void print(std::ostream &file, int l) const
void turn(const vec &dir, vfloat angle)
std::ostream & noindent(std::ostream &f)
#define Iprintn(file, name)
vfloat cos2vec(const vec &r1, const vec &r2)
vfloat ang2projvec(const vec &r1, const vec &r2, const vec &normal)