6 #include "GmshConfig.h"
11 #if defined(HAVE_OPENGL)
41 #if defined(HAVE_OPENGL)
47 ctx->
drawString(
"(X0, Y0, Z0)", p[0], p[1], p[2]);
50 ctx->
drawString(
"(X1, Y1, Z1)", p[0], p[1], p[2]);
54 ctx->
drawString(
"(X2, Y2, Z2)", p[0], p[1], p[2]);
58 ctx->
drawString(
"(X3, Y3, Z3)", p[0], p[1], p[2]);
64 for(
int i = 0; i <
getNbU(); ++i) {
66 glVertex3d(p[0], p[1], p[2]);
68 glVertex3d(p[0], p[1], p[2]);
71 glVertex3d(p[0], p[1], p[2]);
73 glVertex3d(p[0], p[1], p[2]);
75 for(
int i = 0; i <
getNbV(); ++i) {
77 glVertex3d(p[0], p[1], p[2]);
79 glVertex3d(p[0], p[1], p[2]);
82 glVertex3d(p[0], p[1], p[2]);
84 glVertex3d(p[0], p[1], p[2]);
87 for(
int i = 0; i <
getNbU(); ++i) {
89 glVertex3d(p[0], p[1], p[2]);
91 glVertex3d(p[0], p[1], p[2]);
94 glVertex3d(p[0], p[1], p[2]);
96 glVertex3d(p[0], p[1], p[2]);
98 for(
int i = 0; i <
getNbW(); ++i) {
100 glVertex3d(p[0], p[1], p[2]);
102 glVertex3d(p[0], p[1], p[2]);
105 glVertex3d(p[0], p[1], p[2]);
107 glVertex3d(p[0], p[1], p[2]);
110 for(
int i = 0; i <
getNbV(); ++i) {
112 glVertex3d(p[0], p[1], p[2]);
114 glVertex3d(p[0], p[1], p[2]);
117 glVertex3d(p[0], p[1], p[2]);
119 glVertex3d(p[0], p[1], p[2]);
121 for(
int i = 0; i <
getNbW(); ++i) {
123 glVertex3d(p[0], p[1], p[2]);
125 glVertex3d(p[0], p[1], p[2]);
128 glVertex3d(p[0], p[1], p[2]);
130 glVertex3d(p[0], p[1], p[2]);
136 for(
int i = 0; i <
getNbU(); ++i) {
137 for(
int j = 0; j <
getNbV(); ++j) {
144 for(
int i = 0; i <
getNbU(); ++i) {
145 for(
int j = 0; j <
getNbW(); ++j) {
152 for(
int i = 0; i <
getNbV(); ++i) {
153 for(
int j = 0; j <
getNbW(); ++j) {
165 double *opt,
double step,
double min,
290 return "Plugin(CutBox) cuts the view `View' with a "
291 "rectangular box defined by the 4 points "
292 "(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U), "
293 "(`X2',`Y2',`Z2') (axis of V) and (`X3',`Y3',`Z3') (axis of W).\n\n"
294 "The number of points along U, V, W is set with the "
295 "options `NumPointsU', `NumPointsV' and `NumPointsW'.\n\n"
296 "If `ConnectPoints' is zero, the plugin creates points; "
297 "otherwise, the plugin generates hexahedra, quadrangles, lines or "
298 "points depending on the values of `NumPointsU', "
299 "`NumPointsV' and `NumPointsW'.\n\n"
300 "If `Boundary' is zero, the plugin interpolates the view inside "
301 "the box; otherwise the plugin interpolates the view at its "
303 "If `View' < 0, the plugin is run on the current view.\n\n"
304 "Plugin(CutBox) creates one new list-based view.";
325 double u =
getNbU() > 1 ? (double)iU / (
double)(
getNbU() - 1.) : 0.;
326 double v =
getNbV() > 1 ? (double)iV / (
double)(
getNbV() - 1.) : 0.;
327 double w =
getNbW() > 1 ? (double)iW / (
double)(
getNbW() - 1.) : 0.;
344 int nbcomp,
double ****pnts,
double ****vals,
345 std::vector<double> &P,
int *nP,
346 std::vector<double> &L,
int *nL,
347 std::vector<double> &Q,
int *nQ,
348 std::vector<double> &H,
int *nH)
353 for(
int i = 0; i <
getNbU(); ++i) {
354 for(
int j = 0; j <
getNbV(); ++j) {
355 for(
int m = 0; m <
getNbW(); ++m) {
356 P.push_back(pnts[i][j][m][0]);
357 P.push_back(pnts[i][j][m][1]);
358 P.push_back(pnts[i][j][m][2]);
360 for(
int k = 0; k < numsteps; ++k) {
361 for(
int l = 0; l < nbcomp; ++l)
362 P.push_back(vals[i][j][m][nbcomp * k + l]);
368 for(
int i = 0; i <
getNbU(); ++i) {
369 for(
int j = 0; j <
getNbV(); ++j) {
370 P.push_back(pnts[i][j][0][0]);
371 P.push_back(pnts[i][j][0][1]);
372 P.push_back(pnts[i][j][0][2]);
374 for(
int k = 0; k < numsteps; ++k) {
375 for(
int l = 0; l < nbcomp; ++l)
376 P.push_back(vals[i][j][0][nbcomp * k + l]);
378 P.push_back(pnts[i][j][
getNbW() - 1][0]);
379 P.push_back(pnts[i][j][
getNbW() - 1][1]);
380 P.push_back(pnts[i][j][
getNbW() - 1][2]);
382 for(
int k = 0; k < numsteps; ++k) {
383 for(
int l = 0; l < nbcomp; ++l)
384 P.push_back(vals[i][j][
getNbW() - 1][nbcomp * k + l]);
388 for(
int i = 0; i <
getNbU(); ++i) {
389 for(
int j = 0; j <
getNbW(); ++j) {
390 P.push_back(pnts[i][0][j][0]);
391 P.push_back(pnts[i][0][j][1]);
392 P.push_back(pnts[i][0][j][2]);
394 for(
int k = 0; k < numsteps; ++k) {
395 for(
int l = 0; l < nbcomp; ++l)
396 P.push_back(vals[i][0][j][nbcomp * k + l]);
398 P.push_back(pnts[i][
getNbV() - 1][j][0]);
399 P.push_back(pnts[i][
getNbV() - 1][j][1]);
400 P.push_back(pnts[i][
getNbV() - 1][j][2]);
402 for(
int k = 0; k < numsteps; ++k) {
403 for(
int l = 0; l < nbcomp; ++l)
404 P.push_back(vals[i][
getNbV() - 1][j][nbcomp * k + l]);
408 for(
int i = 0; i <
getNbV(); ++i) {
409 for(
int j = 0; j <
getNbW(); ++j) {
410 P.push_back(pnts[0][i][j][0]);
411 P.push_back(pnts[0][i][j][1]);
412 P.push_back(pnts[0][i][j][2]);
414 for(
int k = 0; k < numsteps; ++k) {
415 for(
int l = 0; l < nbcomp; ++l)
416 P.push_back(vals[0][i][j][nbcomp * k + l]);
418 P.push_back(pnts[
getNbU() - 1][i][j][0]);
419 P.push_back(pnts[
getNbU() - 1][i][j][1]);
420 P.push_back(pnts[
getNbU() - 1][i][j][2]);
422 for(
int k = 0; k < numsteps; ++k) {
423 for(
int l = 0; l < nbcomp; ++l)
424 P.push_back(vals[
getNbU() - 1][i][j][nbcomp * k + l]);
433 for(
int i = 0; i <
getNbW() - 1; ++i) {
434 L.push_back(pnts[0][0][i][0]);
435 L.push_back(pnts[0][0][i + 1][0]);
436 L.push_back(pnts[0][0][i][1]);
437 L.push_back(pnts[0][0][i + 1][1]);
438 L.push_back(pnts[0][0][i][2]);
439 L.push_back(pnts[0][0][i + 1][2]);
441 for(
int k = 0; k < numsteps; ++k) {
442 for(
int l = 0; l < nbcomp; ++l)
443 L.push_back(vals[0][0][i][nbcomp * k + l]);
444 for(
int l = 0; l < nbcomp; ++l)
445 L.push_back(vals[0][0][i + 1][nbcomp * k + l]);
449 P.push_back(pnts[0][0][0][0]);
450 P.push_back(pnts[0][0][0][1]);
451 P.push_back(pnts[0][0][0][2]);
453 for(
int k = 0; k < numsteps; ++k) {
454 for(
int l = 0; l < nbcomp; ++l)
455 P.push_back(vals[0][0][0][nbcomp * k + l]);
457 P.push_back(pnts[0][0][
getNbW() - 1][0]);
458 P.push_back(pnts[0][0][
getNbW() - 1][1]);
459 P.push_back(pnts[0][0][
getNbW() - 1][2]);
461 for(
int k = 0; k < numsteps; ++k) {
462 for(
int l = 0; l < nbcomp; ++l)
463 P.push_back(vals[0][0][
getNbW() - 1][nbcomp * k + l]);
469 for(
int i = 0; i <
getNbV() - 1; ++i) {
470 L.push_back(pnts[0][i][0][0]);
471 L.push_back(pnts[0][i + 1][0][0]);
472 L.push_back(pnts[0][i][0][1]);
473 L.push_back(pnts[0][i + 1][0][1]);
474 L.push_back(pnts[0][i][0][2]);
475 L.push_back(pnts[0][i + 1][0][2]);
477 for(
int k = 0; k < numsteps; ++k) {
478 for(
int l = 0; l < nbcomp; ++l)
479 L.push_back(vals[0][i][0][nbcomp * k + l]);
480 for(
int l = 0; l < nbcomp; ++l)
481 L.push_back(vals[0][i + 1][0][nbcomp * k + l]);
485 P.push_back(pnts[0][0][0][0]);
486 P.push_back(pnts[0][0][0][1]);
487 P.push_back(pnts[0][0][0][2]);
489 for(
int k = 0; k < numsteps; ++k) {
490 for(
int l = 0; l < nbcomp; ++l)
491 P.push_back(vals[0][0][0][nbcomp * k + l]);
493 P.push_back(pnts[0][
getNbV() - 1][0][0]);
494 P.push_back(pnts[0][
getNbV() - 1][0][1]);
495 P.push_back(pnts[0][
getNbV() - 1][0][2]);
497 for(
int k = 0; k < numsteps; ++k) {
498 for(
int l = 0; l < nbcomp; ++l)
499 P.push_back(vals[0][
getNbV() - 1][0][nbcomp * k + l]);
505 for(
int i = 0; i <
getNbU() - 1; ++i) {
506 L.push_back(pnts[i][0][0][0]);
507 L.push_back(pnts[i + 1][0][0][0]);
508 L.push_back(pnts[i][0][0][1]);
509 L.push_back(pnts[i + 1][0][0][1]);
510 L.push_back(pnts[i][0][0][2]);
511 L.push_back(pnts[i + 1][0][0][2]);
513 for(
int k = 0; k < numsteps; ++k) {
514 for(
int l = 0; l < nbcomp; ++l)
515 L.push_back(vals[i][0][0][nbcomp * k + l]);
516 for(
int l = 0; l < nbcomp; ++l)
517 L.push_back(vals[i + 1][0][0][nbcomp * k + l]);
521 P.push_back(pnts[0][0][0][0]);
522 P.push_back(pnts[0][0][0][1]);
523 P.push_back(pnts[0][0][0][2]);
525 for(
int k = 0; k < numsteps; ++k) {
526 for(
int l = 0; l < nbcomp; ++l)
527 P.push_back(vals[0][0][0][nbcomp * k + l]);
529 P.push_back(pnts[
getNbU() - 1][0][0][0]);
530 P.push_back(pnts[
getNbU() - 1][0][0][1]);
531 P.push_back(pnts[
getNbU() - 1][0][0][2]);
533 for(
int k = 0; k < numsteps; ++k) {
534 for(
int l = 0; l < nbcomp; ++l)
535 P.push_back(vals[
getNbU() - 1][0][0][nbcomp * k + l]);
541 for(
int i = 0; i <
getNbV() - 1; ++i) {
542 for(
int j = 0; j <
getNbW() - 1; ++j) {
543 Q.push_back(pnts[0][i][j][0]);
544 Q.push_back(pnts[0][i + 1][j][0]);
545 Q.push_back(pnts[0][i + 1][j + 1][0]);
546 Q.push_back(pnts[0][i][j + 1][0]);
547 Q.push_back(pnts[0][i][j][1]);
548 Q.push_back(pnts[0][i + 1][j][1]);
549 Q.push_back(pnts[0][i + 1][j + 1][1]);
550 Q.push_back(pnts[0][i][j + 1][1]);
551 Q.push_back(pnts[0][i][j][2]);
552 Q.push_back(pnts[0][i + 1][j][2]);
553 Q.push_back(pnts[0][i + 1][j + 1][2]);
554 Q.push_back(pnts[0][i][j + 1][2]);
556 for(
int k = 0; k < numsteps; ++k) {
557 for(
int l = 0; l < nbcomp; ++l)
558 Q.push_back(vals[0][i][j][nbcomp * k + l]);
559 for(
int l = 0; l < nbcomp; ++l)
560 Q.push_back(vals[0][i + 1][j][nbcomp * k + l]);
561 for(
int l = 0; l < nbcomp; ++l)
562 Q.push_back(vals[0][i + 1][j + 1][nbcomp * k + l]);
563 for(
int l = 0; l < nbcomp; ++l)
564 Q.push_back(vals[0][i][j + 1][nbcomp * k + l]);
569 for(
int i = 0; i <
getNbV() - 1; ++i) {
570 L.push_back(pnts[0][i][0][0]);
571 L.push_back(pnts[0][i + 1][0][0]);
572 L.push_back(pnts[0][i][0][1]);
573 L.push_back(pnts[0][i + 1][0][1]);
574 L.push_back(pnts[0][i][0][2]);
575 L.push_back(pnts[0][i + 1][0][2]);
577 for(
int k = 0; k < numsteps; ++k) {
578 for(
int l = 0; l < nbcomp; ++l)
579 L.push_back(vals[0][i][0][nbcomp * k + l]);
580 for(
int l = 0; l < nbcomp; ++l)
581 L.push_back(vals[0][i + 1][0][nbcomp * k + l]);
583 L.push_back(pnts[0][i][
getNbW() - 1][0]);
584 L.push_back(pnts[0][i + 1][
getNbW() - 1][0]);
585 L.push_back(pnts[0][i][
getNbW() - 1][1]);
586 L.push_back(pnts[0][i + 1][
getNbW() - 1][1]);
587 L.push_back(pnts[0][i][
getNbW() - 1][2]);
588 L.push_back(pnts[0][i + 1][
getNbW() - 1][2]);
590 for(
int k = 0; k < numsteps; ++k) {
591 for(
int l = 0; l < nbcomp; ++l)
592 L.push_back(vals[0][i][
getNbW()][nbcomp * k + l]);
593 for(
int l = 0; l < nbcomp; ++l)
594 L.push_back(vals[0][i + 1][
getNbW()][nbcomp * k + l]);
597 for(
int i = 0; i <
getNbW() - 1; ++i) {
598 L.push_back(pnts[0][0][i][0]);
599 L.push_back(pnts[0][0][i + 1][0]);
600 L.push_back(pnts[0][0][i][1]);
601 L.push_back(pnts[0][0][i + 1][1]);
602 L.push_back(pnts[0][0][i][2]);
603 L.push_back(pnts[0][0][i + 1][2]);
605 for(
int k = 0; k < numsteps; ++k) {
606 for(
int l = 0; l < nbcomp; ++l)
607 L.push_back(vals[0][0][i][nbcomp * k + l]);
608 for(
int l = 0; l < nbcomp; ++l)
609 L.push_back(vals[0][0][i + 1][nbcomp * k + l]);
611 L.push_back(pnts[0][
getNbV() - 1][i][0]);
612 L.push_back(pnts[0][
getNbV() - 1][i + 1][0]);
613 L.push_back(pnts[0][
getNbV() - 1][i][1]);
614 L.push_back(pnts[0][
getNbV() - 1][i + 1][1]);
615 L.push_back(pnts[0][
getNbV() - 1][i][2]);
616 L.push_back(pnts[0][
getNbV() - 1][i + 1][2]);
618 for(
int k = 0; k < numsteps; ++k) {
619 for(
int l = 0; l < nbcomp; ++l)
620 L.push_back(vals[0][
getNbV() - 1][i][nbcomp * k + l]);
621 for(
int l = 0; l < nbcomp; ++l)
622 L.push_back(vals[0][
getNbV() - 1][i + 1][nbcomp * k + l]);
629 for(
int i = 0; i <
getNbU() - 1; ++i) {
630 for(
int j = 0; j <
getNbW() - 1; ++j) {
631 Q.push_back(pnts[i][0][j][0]);
632 Q.push_back(pnts[i + 1][0][j][0]);
633 Q.push_back(pnts[i + 1][0][j + 1][0]);
634 Q.push_back(pnts[i][0][j + 1][0]);
635 Q.push_back(pnts[i][0][j][1]);
636 Q.push_back(pnts[i + 1][0][j][1]);
637 Q.push_back(pnts[i + 1][0][j + 1][1]);
638 Q.push_back(pnts[i][0][j + 1][1]);
639 Q.push_back(pnts[i][0][j][2]);
640 Q.push_back(pnts[i + 1][0][j][2]);
641 Q.push_back(pnts[i + 1][0][j + 1][2]);
642 Q.push_back(pnts[i][0][j + 1][2]);
644 for(
int k = 0; k < numsteps; ++k) {
645 for(
int l = 0; l < nbcomp; ++l)
646 Q.push_back(vals[i][0][j][nbcomp * k + l]);
647 for(
int l = 0; l < nbcomp; ++l)
648 Q.push_back(vals[i + 1][0][j][nbcomp * k + l]);
649 for(
int l = 0; l < nbcomp; ++l)
650 Q.push_back(vals[i + 1][0][j + 1][nbcomp * k + l]);
651 for(
int l = 0; l < nbcomp; ++l)
652 Q.push_back(vals[i][0][j + 1][nbcomp * k + l]);
657 for(
int i = 0; i <
getNbU() - 1; ++i) {
658 L.push_back(pnts[i][0][0][0]);
659 L.push_back(pnts[i + 1][0][0][0]);
660 L.push_back(pnts[i][0][0][1]);
661 L.push_back(pnts[i + 1][0][0][1]);
662 L.push_back(pnts[i][0][0][2]);
663 L.push_back(pnts[i + 1][0][0][2]);
665 for(
int k = 0; k < numsteps; ++k) {
666 for(
int l = 0; l < nbcomp; ++l)
667 L.push_back(vals[i][0][0][nbcomp * k + l]);
668 for(
int l = 0; l < nbcomp; ++l)
669 L.push_back(vals[i + 1][0][0][nbcomp * k + l]);
671 L.push_back(pnts[i][0][
getNbW() - 1][0]);
672 L.push_back(pnts[i + 1][0][
getNbW() - 1][0]);
673 L.push_back(pnts[i][0][
getNbW() - 1][1]);
674 L.push_back(pnts[i + 1][0][
getNbW() - 1][1]);
675 L.push_back(pnts[i][0][
getNbW() - 1][2]);
676 L.push_back(pnts[i + 1][0][
getNbW() - 1][2]);
678 for(
int k = 0; k < numsteps; ++k) {
679 for(
int l = 0; l < nbcomp; ++l)
680 L.push_back(vals[i][0][
getNbW() - 1][nbcomp * k + l]);
681 for(
int l = 0; l < nbcomp; ++l)
682 L.push_back(vals[i + 1][0][
getNbW() - 1][nbcomp * k + l]);
685 for(
int i = 0; i <
getNbW() - 1; ++i) {
686 L.push_back(pnts[0][0][i][0]);
687 L.push_back(pnts[0][0][i + 1][0]);
688 L.push_back(pnts[0][0][i][1]);
689 L.push_back(pnts[0][0][i + 1][1]);
690 L.push_back(pnts[0][0][i][2]);
691 L.push_back(pnts[0][0][i + 1][2]);
693 for(
int k = 0; k < numsteps; ++k) {
694 for(
int l = 0; l < nbcomp; ++l)
695 L.push_back(vals[0][0][i][nbcomp * k + l]);
696 for(
int l = 0; l < nbcomp; ++l)
697 L.push_back(vals[0][0][i + 1][nbcomp * k + l]);
699 L.push_back(pnts[
getNbU() - 1][0][i][0]);
700 L.push_back(pnts[
getNbU() - 1][0][i + 1][0]);
701 L.push_back(pnts[
getNbU() - 1][0][i][1]);
702 L.push_back(pnts[
getNbU() - 1][0][i + 1][1]);
703 L.push_back(pnts[
getNbU() - 1][0][i][2]);
704 L.push_back(pnts[
getNbU() - 1][0][i + 1][2]);
706 for(
int k = 0; k < numsteps; ++k) {
707 for(
int l = 0; l < nbcomp; ++l)
708 L.push_back(vals[
getNbU() - 1][0][i][nbcomp * k + l]);
709 for(
int l = 0; l < nbcomp; ++l)
710 L.push_back(vals[
getNbU() - 1][0][i + 1][nbcomp * k + l]);
717 for(
int i = 0; i <
getNbU() - 1; ++i) {
718 for(
int j = 0; j <
getNbV() - 1; ++j) {
719 Q.push_back(pnts[i][j][0][0]);
720 Q.push_back(pnts[i + 1][j][0][0]);
721 Q.push_back(pnts[i + 1][j + 1][0][0]);
722 Q.push_back(pnts[i][j + 1][0][0]);
723 Q.push_back(pnts[i][j][0][1]);
724 Q.push_back(pnts[i + 1][j][0][1]);
725 Q.push_back(pnts[i + 1][j + 1][0][1]);
726 Q.push_back(pnts[i][j + 1][0][1]);
727 Q.push_back(pnts[i][j][0][2]);
728 Q.push_back(pnts[i + 1][j][0][2]);
729 Q.push_back(pnts[i + 1][j + 1][0][2]);
730 Q.push_back(pnts[i][j + 1][0][2]);
732 for(
int k = 0; k < numsteps; ++k) {
733 for(
int l = 0; l < nbcomp; ++l)
734 Q.push_back(vals[i][j][0][nbcomp * k + l]);
735 for(
int l = 0; l < nbcomp; ++l)
736 Q.push_back(vals[i + 1][j][0][nbcomp * k + l]);
737 for(
int l = 0; l < nbcomp; ++l)
738 Q.push_back(vals[i + 1][j + 1][0][nbcomp * k + l]);
739 for(
int l = 0; l < nbcomp; ++l)
740 Q.push_back(vals[i][j + 1][0][nbcomp * k + l]);
745 for(
int i = 0; i <
getNbU() - 1; ++i) {
746 L.push_back(pnts[i][0][0][0]);
747 L.push_back(pnts[i + 1][0][0][0]);
748 L.push_back(pnts[i][0][0][1]);
749 L.push_back(pnts[i + 1][0][0][1]);
750 L.push_back(pnts[i][0][0][2]);
751 L.push_back(pnts[i + 1][0][0][2]);
753 for(
int k = 0; k < numsteps; ++k) {
754 for(
int l = 0; l < nbcomp; ++l)
755 L.push_back(vals[i][0][0][nbcomp * k + l]);
756 for(
int l = 0; l < nbcomp; ++l)
757 L.push_back(vals[i + 1][0][0][nbcomp * k + l]);
759 L.push_back(pnts[i][
getNbV() - 1][0][0]);
760 L.push_back(pnts[i + 1][
getNbV() - 1][0][0]);
761 L.push_back(pnts[i][
getNbV() - 1][0][1]);
762 L.push_back(pnts[i + 1][
getNbV() - 1][0][1]);
763 L.push_back(pnts[i][
getNbV() - 1][0][2]);
764 L.push_back(pnts[i + 1][
getNbV() - 1][0][2]);
766 for(
int k = 0; k < numsteps; ++k) {
767 for(
int l = 0; l < nbcomp; ++l)
768 L.push_back(vals[i][
getNbV() - 1][0][nbcomp * k + l]);
769 for(
int l = 0; l < nbcomp; ++l)
770 L.push_back(vals[i + 1][
getNbV() - 1][0][nbcomp * k + l]);
773 for(
int i = 0; i <
getNbV() - 1; ++i) {
774 L.push_back(pnts[0][i][0][0]);
775 L.push_back(pnts[0][i + 1][0][0]);
776 L.push_back(pnts[0][i][0][1]);
777 L.push_back(pnts[0][i + 1][0][1]);
778 L.push_back(pnts[0][i][0][2]);
779 L.push_back(pnts[0][i + 1][0][2]);
781 for(
int k = 0; k < numsteps; ++k) {
782 for(
int l = 0; l < nbcomp; ++l)
783 L.push_back(vals[0][i][0][nbcomp * k + l]);
784 for(
int l = 0; l < nbcomp; ++l)
785 L.push_back(vals[0][i + 1][0][nbcomp * k + l]);
787 L.push_back(pnts[
getNbU() - 1][i][0][0]);
788 L.push_back(pnts[
getNbU() - 1][i + 1][0][0]);
789 L.push_back(pnts[
getNbU() - 1][i][0][1]);
790 L.push_back(pnts[
getNbU() - 1][i + 1][0][1]);
791 L.push_back(pnts[
getNbU() - 1][i][0][2]);
792 L.push_back(pnts[
getNbU() - 1][i + 1][0][2]);
794 for(
int k = 0; k < numsteps; ++k) {
795 for(
int l = 0; l < nbcomp; ++l)
796 L.push_back(vals[
getNbU() - 1][i][0][nbcomp * k + l]);
797 for(
int l = 0; l < nbcomp; ++l)
798 L.push_back(vals[
getNbU() - 1][i + 1][0][nbcomp * k + l]);
806 for(
int i = 0; i <
getNbU() - 1; ++i) {
807 for(
int j = 0; j <
getNbV() - 1; ++j) {
808 for(
int m = 0; m <
getNbW() - 1; ++m) {
809 H.push_back(pnts[i][j][m][0]);
810 H.push_back(pnts[i + 1][j][m][0]);
811 H.push_back(pnts[i + 1][j + 1][m][0]);
812 H.push_back(pnts[i][j + 1][m][0]);
813 H.push_back(pnts[i][j][m + 1][0]);
814 H.push_back(pnts[i + 1][j][m + 1][0]);
815 H.push_back(pnts[i + 1][j + 1][m + 1][0]);
816 H.push_back(pnts[i][j + 1][m + 1][0]);
818 H.push_back(pnts[i][j][m][1]);
819 H.push_back(pnts[i + 1][j][m][1]);
820 H.push_back(pnts[i + 1][j + 1][m][1]);
821 H.push_back(pnts[i][j + 1][m][1]);
822 H.push_back(pnts[i][j][m + 1][1]);
823 H.push_back(pnts[i + 1][j][m + 1][1]);
824 H.push_back(pnts[i + 1][j + 1][m + 1][1]);
825 H.push_back(pnts[i][j + 1][m + 1][1]);
827 H.push_back(pnts[i][j][m][2]);
828 H.push_back(pnts[i + 1][j][m][2]);
829 H.push_back(pnts[i + 1][j + 1][m][2]);
830 H.push_back(pnts[i][j + 1][m][2]);
831 H.push_back(pnts[i][j][m + 1][2]);
832 H.push_back(pnts[i + 1][j][m + 1][2]);
833 H.push_back(pnts[i + 1][j + 1][m + 1][2]);
834 H.push_back(pnts[i][j + 1][m + 1][2]);
837 for(
int k = 0; k < numsteps; ++k) {
838 for(
int l = 0; l < nbcomp; ++l)
839 H.push_back(vals[i][j][m][nbcomp * k + l]);
840 for(
int l = 0; l < nbcomp; ++l)
841 H.push_back(vals[i + 1][j][m][nbcomp * k + l]);
842 for(
int l = 0; l < nbcomp; ++l)
843 H.push_back(vals[i + 1][j + 1][m][nbcomp * k + l]);
844 for(
int l = 0; l < nbcomp; ++l)
845 H.push_back(vals[i][j + 1][m][nbcomp * k + l]);
846 for(
int l = 0; l < nbcomp; ++l)
847 H.push_back(vals[i][j][m + 1][nbcomp * k + l]);
848 for(
int l = 0; l < nbcomp; ++l)
849 H.push_back(vals[i + 1][j][m + 1][nbcomp * k + l]);
850 for(
int l = 0; l < nbcomp; ++l)
851 H.push_back(vals[i + 1][j + 1][m + 1][nbcomp * k + l]);
852 for(
int l = 0; l < nbcomp; ++l)
853 H.push_back(vals[i][j + 1][m + 1][nbcomp * k + l]);
860 for(
int i = 0; i <
getNbU() - 1; ++i) {
861 for(
int j = 0; j <
getNbV() - 1; ++j) {
862 Q.push_back(pnts[i][j][0][0]);
863 Q.push_back(pnts[i][j + 1][0][0]);
864 Q.push_back(pnts[i + 1][j + 1][0][0]);
865 Q.push_back(pnts[i + 1][j][0][0]);
866 Q.push_back(pnts[i][j][0][1]);
867 Q.push_back(pnts[i][j + 1][0][1]);
868 Q.push_back(pnts[i + 1][j + 1][0][1]);
869 Q.push_back(pnts[i + 1][j][0][1]);
870 Q.push_back(pnts[i][j][0][2]);
871 Q.push_back(pnts[i][j + 1][0][2]);
872 Q.push_back(pnts[i + 1][j + 1][0][2]);
873 Q.push_back(pnts[i + 1][j][0][2]);
875 for(
int k = 0; k < numsteps; ++k) {
876 for(
int l = 0; l < nbcomp; ++l)
877 Q.push_back(vals[i][j][0][nbcomp * k + l]);
878 for(
int l = 0; l < nbcomp; ++l)
879 Q.push_back(vals[i][j + 1][0][nbcomp * k + l]);
880 for(
int l = 0; l < nbcomp; ++l)
881 Q.push_back(vals[i + 1][j + 1][0][nbcomp * k + l]);
882 for(
int l = 0; l < nbcomp; ++l)
883 Q.push_back(vals[i + 1][j][0][nbcomp * k + l]);
885 Q.push_back(pnts[i][j][
getNbW() - 1][0]);
886 Q.push_back(pnts[i + 1][j][
getNbW() - 1][0]);
887 Q.push_back(pnts[i + 1][j + 1][
getNbW() - 1][0]);
888 Q.push_back(pnts[i][j + 1][
getNbW() - 1][0]);
889 Q.push_back(pnts[i][j][
getNbW() - 1][1]);
890 Q.push_back(pnts[i + 1][j][
getNbW() - 1][1]);
891 Q.push_back(pnts[i + 1][j + 1][
getNbW() - 1][1]);
892 Q.push_back(pnts[i][j + 1][
getNbW() - 1][1]);
893 Q.push_back(pnts[i][j][
getNbW() - 1][2]);
894 Q.push_back(pnts[i + 1][j][
getNbW() - 1][2]);
895 Q.push_back(pnts[i + 1][j + 1][
getNbW() - 1][2]);
896 Q.push_back(pnts[i][j + 1][
getNbW() - 1][2]);
898 for(
int k = 0; k < numsteps; ++k) {
899 for(
int l = 0; l < nbcomp; ++l)
900 Q.push_back(vals[i][j][
getNbW() - 1][nbcomp * k + l]);
901 for(
int l = 0; l < nbcomp; ++l)
902 Q.push_back(vals[i + 1][j][
getNbW() - 1][nbcomp * k + l]);
903 for(
int l = 0; l < nbcomp; ++l)
904 Q.push_back(vals[i + 1][j + 1][
getNbW() - 1][nbcomp * k + l]);
905 for(
int l = 0; l < nbcomp; ++l)
906 Q.push_back(vals[i][j + 1][
getNbW() - 1][nbcomp * k + l]);
910 for(
int i = 0; i <
getNbU() - 1; ++i) {
911 for(
int j = 0; j <
getNbW() - 1; ++j) {
912 Q.push_back(pnts[i][0][j][0]);
913 Q.push_back(pnts[i + 1][0][j][0]);
914 Q.push_back(pnts[i + 1][0][j + 1][0]);
915 Q.push_back(pnts[i][0][j + 1][0]);
916 Q.push_back(pnts[i][0][j][1]);
917 Q.push_back(pnts[i + 1][0][j][1]);
918 Q.push_back(pnts[i + 1][0][j + 1][1]);
919 Q.push_back(pnts[i][0][j + 1][1]);
920 Q.push_back(pnts[i][0][j][2]);
921 Q.push_back(pnts[i + 1][0][j][2]);
922 Q.push_back(pnts[i + 1][0][j + 1][2]);
923 Q.push_back(pnts[i][0][j + 1][2]);
925 for(
int k = 0; k < numsteps; ++k) {
926 for(
int l = 0; l < nbcomp; ++l)
927 Q.push_back(vals[i][0][j][nbcomp * k + l]);
928 for(
int l = 0; l < nbcomp; ++l)
929 Q.push_back(vals[i + 1][0][j][nbcomp * k + l]);
930 for(
int l = 0; l < nbcomp; ++l)
931 Q.push_back(vals[i + 1][0][j + 1][nbcomp * k + l]);
932 for(
int l = 0; l < nbcomp; ++l)
933 Q.push_back(vals[i][0][j + 1][nbcomp * k + l]);
935 Q.push_back(pnts[i][
getNbV() - 1][j][0]);
936 Q.push_back(pnts[i][
getNbV() - 1][j + 1][0]);
937 Q.push_back(pnts[i + 1][
getNbV() - 1][j + 1][0]);
938 Q.push_back(pnts[i + 1][
getNbV() - 1][j][0]);
939 Q.push_back(pnts[i][
getNbV() - 1][j][1]);
940 Q.push_back(pnts[i][
getNbV() - 1][j + 1][1]);
941 Q.push_back(pnts[i + 1][
getNbV() - 1][j + 1][1]);
942 Q.push_back(pnts[i + 1][
getNbV() - 1][j][1]);
943 Q.push_back(pnts[i][
getNbV() - 1][j][2]);
944 Q.push_back(pnts[i][
getNbV() - 1][j + 1][2]);
945 Q.push_back(pnts[i + 1][
getNbV() - 1][j + 1][2]);
946 Q.push_back(pnts[i + 1][
getNbV() - 1][j][2]);
948 for(
int k = 0; k < numsteps; ++k) {
949 for(
int l = 0; l < nbcomp; ++l)
950 Q.push_back(vals[i][
getNbV() - 1][j][nbcomp * k + l]);
951 for(
int l = 0; l < nbcomp; ++l)
952 Q.push_back(vals[i][
getNbV() - 1][j + 1][nbcomp * k + l]);
953 for(
int l = 0; l < nbcomp; ++l)
954 Q.push_back(vals[i + 1][
getNbV() - 1][j + 1][nbcomp * k + l]);
955 for(
int l = 0; l < nbcomp; ++l)
956 Q.push_back(vals[i + 1][
getNbV() - 1][j][nbcomp * k + l]);
961 for(
int i = 0; i <
getNbV() - 1; ++i) {
962 for(
int j = 0; j <
getNbW() - 1; ++j) {
963 Q.push_back(pnts[0][i][j][0]);
964 Q.push_back(pnts[0][i][j + 1][0]);
965 Q.push_back(pnts[0][i + 1][j + 1][0]);
966 Q.push_back(pnts[0][i + 1][j][0]);
967 Q.push_back(pnts[0][i][j][1]);
968 Q.push_back(pnts[0][i][j + 1][1]);
969 Q.push_back(pnts[0][i + 1][j + 1][1]);
970 Q.push_back(pnts[0][i + 1][j][1]);
971 Q.push_back(pnts[0][i][j][2]);
972 Q.push_back(pnts[0][i][j + 1][2]);
973 Q.push_back(pnts[0][i + 1][j + 1][2]);
974 Q.push_back(pnts[0][i + 1][j][2]);
976 for(
int k = 0; k < numsteps; ++k) {
977 for(
int l = 0; l < nbcomp; ++l)
978 Q.push_back(vals[0][i][j][nbcomp * k + l]);
979 for(
int l = 0; l < nbcomp; ++l)
980 Q.push_back(vals[0][i][j + 1][nbcomp * k + l]);
981 for(
int l = 0; l < nbcomp; ++l)
982 Q.push_back(vals[0][i + 1][j + 1][nbcomp * k + l]);
983 for(
int l = 0; l < nbcomp; ++l)
984 Q.push_back(vals[0][i + 1][j][nbcomp * k + l]);
986 Q.push_back(pnts[
getNbU() - 1][i][j][0]);
987 Q.push_back(pnts[
getNbU() - 1][i + 1][j][0]);
988 Q.push_back(pnts[
getNbU() - 1][i + 1][j + 1][0]);
989 Q.push_back(pnts[
getNbU() - 1][i][j + 1][0]);
990 Q.push_back(pnts[
getNbU() - 1][i][j][1]);
991 Q.push_back(pnts[
getNbU() - 1][i + 1][j][1]);
992 Q.push_back(pnts[
getNbU() - 1][i + 1][j + 1][1]);
993 Q.push_back(pnts[
getNbU() - 1][i][j + 1][1]);
994 Q.push_back(pnts[
getNbU() - 1][i][j][2]);
995 Q.push_back(pnts[
getNbU() - 1][i + 1][j][2]);
996 Q.push_back(pnts[
getNbU() - 1][i + 1][j + 1][2]);
997 Q.push_back(pnts[
getNbU() - 1][i][j + 1][2]);
999 for(
int k = 0; k < numsteps; ++k) {
1000 for(
int l = 0; l < nbcomp; ++l)
1001 Q.push_back(vals[
getNbU() - 1][i][j][nbcomp * k + l]);
1002 for(
int l = 0; l < nbcomp; ++l)
1003 Q.push_back(vals[
getNbU() - 1][i + 1][j][nbcomp * k + l]);
1004 for(
int l = 0; l < nbcomp; ++l)
1005 Q.push_back(vals[
getNbU() - 1][i + 1][j + 1][nbcomp * k + l]);
1006 for(
int l = 0; l < nbcomp; ++l)
1007 Q.push_back(vals[
getNbU() - 1][i][j + 1][nbcomp * k + l]);
1030 int maxcomp = nbt ? 9 : (nbv ? 3 : 1);
1033 double ****pnts =
new double ***[
getNbU()];
1034 double ****vals =
new double ***[
getNbU()];
1035 for(
int i = 0; i <
getNbU(); i++) {
1036 pnts[i] =
new double **[
getNbV()];
1037 vals[i] =
new double **[
getNbV()];
1038 for(
int j = 0; j <
getNbV(); j++) {
1039 pnts[i][j] =
new double *[
getNbW()];
1040 vals[i][j] =
new double *[
getNbW()];
1041 for(
int k = 0; k <
getNbW(); k++) {
1042 pnts[i][j][k] =
new double[3];
1043 vals[i][j][k] =
new double[maxcomp * numsteps];
1050 for(
int i = 0; i <
getNbU(); i++)
1051 for(
int j = 0; j <
getNbV(); j++)
1052 for(
int k = 0; k <
getNbW(); k++)
1053 o.
searchScalar(pnts[i][j][k][0], pnts[i][j][k][1], pnts[i][j][k][2],
1055 addInView(connect, boundary, numsteps, 1, pnts, vals, data2->
SP,
1057 data2->
SH, &data2->
NbSH);
1061 for(
int i = 0; i <
getNbU(); i++)
1062 for(
int j = 0; j <
getNbV(); j++)
1063 for(
int k = 0; k <
getNbW(); k++)
1064 o.
searchVector(pnts[i][j][k][0], pnts[i][j][k][1], pnts[i][j][k][2],
1066 addInView(connect, boundary, numsteps, 3, pnts, vals, data2->
VP,
1068 data2->
VH, &data2->
NbVH);
1072 for(
int i = 0; i <
getNbU(); i++)
1073 for(
int j = 0; j <
getNbV(); j++)
1074 for(
int k = 0; k <
getNbW(); k++)
1075 o.
searchTensor(pnts[i][j][k][0], pnts[i][j][k][1], pnts[i][j][k][2],
1077 addInView(connect, boundary, numsteps, 9, pnts, vals, data2->
TP,
1079 data2->
TH, &data2->
NbTH);
1082 for(
int i = 0; i <
getNbU(); i++) {
1083 for(
int j = 0; j <
getNbV(); j++) {
1084 for(
int k = 0; k <
getNbW(); k++) {
1085 delete[] pnts[i][j][k];
1086 delete[] vals[i][j][k];
1088 delete[] pnts[i][j];
1089 delete[] vals[i][j];