534 string use_proj_approx,
537 const Float& scale_value,
538 const std::pair<Float,Float>& u_range,
540 reuse_proj_form_type reuse)
542 if (extract_id != numeric_limits<size_type>::max()) {
543 extract (in, out, do_proj, do_lumped_mass, use_proj_approx, extract_id, scale_value, reuse);
548 if (u_range.first != std::numeric_limits<Float>::max() ||
549 u_range.second != -std::numeric_limits<Float>::max()) {
552 in >>
event.header();
553 if (reuse.size() == 0) reuse.resize(event.size());
555 in.
is() >> noverbose;
556 out << setprecision(numeric_limits<Float>::digits10)
557 <<
"# i " <<
event.parameter_name() << endl;
560 out << n <<
" " << param << endl;
566 while (in >> event) {
567 for (
size_t i = 0; i <
event.size(); i++) {
568 uh =
event[i].second;
575 if (uh.
get_geo().map_dimension() == 3) {
577 if (!def_plane_cut_opt) dout.os() << cut;
579 if (!def_fill_opt) dout.os() << nofill;
582 if (!def_plane_cut_opt) dout.os() << nocut;
584 if (!def_fill_opt) dout.os() << fill;
586 out <<
event.header();
589 uh =
proj (i, uh, do_lumped_mass, use_proj_approx, reuse);
591 if (scale_value !=
Float(1)) {
594 event[i].second = uh;
599 out <<
event.finalize();
613 if (argc <= 1)
usage();
615 dout.os() << noelevation;
616 bool on_stdin =
false;
617 bool do_proj =
false;
618 string use_proj_approx =
"";
619 bool do_lumped_mass =
false;
620 reuse_proj_form_type reuse;
622 bool def_fill_opt =
false;
623 int digits10 = numeric_limits<Float>::digits10;
625 size_type extract_id = numeric_limits<size_type>::max();
626 Float scale_value = 1;
627 string file_name, name, input_format =
"branch";
628 std::pair<Float,Float> u_range;
629 u_range.first = std::numeric_limits<Float>::max();
630 u_range.second = -std::numeric_limits<Float>::max();
631 dout.os() << showlabel;
633 cout << setnormal(
point(-0.015940197423022637, -0.9771157601293953, -0.21211011624358989));
634 cout << setorigin(
point(std::numeric_limits<Float>::max()));
636 for (
int i = 1; i < argc; i++) {
638 if (strcmp (argv[i],
"-ndigit") == 0) { digits10 = atoi(argv[++i]); }
639 else if (strcmp (argv[i],
"-toc") == 0) { render =
toc_render; }
640 else if (strcmp (argv[i],
"-index") == 0 || strcmp (argv[i],
"-extract") == 0)
641 { extract_id = atoi(argv[++i]); render =
text_render; dout.os() <<
rheo; }
642 else if (strcmp (argv[i],
"-branch") == 0) { render =
text_render; dout.os() <<
rheo; }
643 else if (strcmp (argv[i],
"-vtk") == 0) { render =
vtk_render; dout.os() <<
vtk; }
646 else if (strcmp (argv[i],
"-skipvtk") == 0) { dout.os() << skipvtk; }
647 else if (strcmp (argv[i],
"-proj") == 0) { do_proj =
true;
648 if (i+1 < argc && argv[i+1][0] !=
'-') {
649 use_proj_approx = argv[++i];
652 else if (strcmp (argv[i],
"-lumped-proj") == 0){ do_proj = do_lumped_mass =
true; use_proj_approx =
"P1"; }
653 else if (strcmp (argv[i],
"-elevation") == 0) { dout.os() << elevation; }
654 else if (strcmp (argv[i],
"-noelevation") == 0) { dout.os() << noelevation; }
655 else if (strcmp (argv[i],
"-color") == 0) { dout.os() << color; }
656 else if (strcmp (argv[i],
"-gray") == 0) { dout.os() <<
gray; }
657 else if (strcmp (argv[i],
"-black-and-white") == 0) { dout.os() << black_and_white; }
658 else if (strcmp (argv[i],
"-bw") == 0) { dout.os() << black_and_white; }
659 else if (strcmp (argv[i],
"-showlabel") == 0) { dout.os() << showlabel; }
660 else if (strcmp (argv[i],
"-noshowlabel") == 0) { dout.os() << noshowlabel; }
661 else if (strcmp (argv[i],
"-fill") == 0) { dout.os() << fill; def_fill_opt =
true; }
662 else if (strcmp (argv[i],
"-nofill") == 0) { dout.os() << nofill; def_fill_opt =
true; }
663 else if (strcmp (argv[i],
"-stereo") == 0) { dout.os() << stereo;
669 else if (strcmp (argv[i],
"-nostereo") == 0) { dout.os() << nostereo; }
670 else if (strcmp (argv[i],
"-volume") == 0) { dout.os() <<
paraview << volume;
672 else if (strcmp (argv[i],
"-novolume") == 0) { dout.os() << novolume; }
673 else if (strcmp (argv[i],
"-cut") == 0) { do_cut =
true; }
674 else if (strcmp (argv[i],
"-nocut") == 0) { do_cut =
false; }
675 else if (strcmp (argv[i],
"-umin") == 0) {
677 u_range.first =
to_float (argv[++i]);
678 }
else if (strcmp (argv[i],
"-umax") == 0) {
680 u_range.second =
to_float (argv[++i]);
681 }
else if (strcmp (argv[i],
"-scale") == 0) {
684 dout.os() << setvectorscale (scale_value);
685 }
else if (strcmp (argv[i],
"-noisovalue") == 0) {
687 }
else if (strcmp (argv[i],
"-isovalue") == 0 || strcmp (argv[i],
"-iso") == 0) {
690 if (i+1 < argc &&
is_float(argv[i+1])) {
692 dout.os() << setisovalue(iso_value);
694 }
else if (strcmp (argv[i],
"-n-iso") == 0) {
696 if (i+1 == argc || !isdigit(argv[i+1][0]))
usage();
697 size_t idx = atoi (argv[++i]);
698 dout.os() << setn_isovalue(idx);
700 }
else if (strcmp (argv[i],
"-n-iso-negative") == 0) {
702 if (i+1 == argc || !isdigit(argv[i+1][0]))
usage();
703 size_t idx = atoi (argv[++i]);
704 dout.os() << setn_isovalue_negative(idx);
706 }
else if (strcmp (argv[i],
"-subdivide") == 0) {
707 if (i == argc-1) { cerr <<
"branch -subdivide: option argument missing" << endl;
usage(); }
708 size_t nsub = atoi(argv[++i]);
709 dout.os() << setsubdivide (nsub);
710 }
else if (strcmp (argv[i],
"-topography") == 0) {
712 if (i+1 == argc)
usage();
716 dout.os() << settopography(z);
718 else if (strcmp (argv[i],
"-I") == 0) {
719 if (i+1 == argc) { cerr <<
"geo -I: option argument missing" << endl;
usage(); }
723 else if (strcmp (argv[i],
"-noclean") == 0) clog << noclean;
724 else if (strcmp (argv[i],
"-clean") == 0) clog << clean;
725 else if (strcmp (argv[i],
"-noexecute") == 0) clog << noexecute;
726 else if (strcmp (argv[i],
"-execute") == 0) clog << execute;
727 else if (strcmp (argv[i],
"-verbose") == 0) clog << verbose;
728 else if (strcmp (argv[i],
"-noverbose") == 0) clog << noverbose;
729 else if ((strcmp(argv[i],
"-origin") == 0) || (strcmp (argv[i],
"-normal") == 0)) {
733 if (i+1 == argc || !
is_float(argv[i+1])) {
738 if (i+1 < argc &&
is_float(argv[i+1])) {
740 if (i+1 < argc &&
is_float(argv[i+1])) {
744 if (strcmp (argv[io],
"-origin") == 0) {
745 cout << setorigin(x);
747 cout << setnormal(x);
749 }
else if (strcmp (argv[i],
"-image-format") == 0) {
751 cerr <<
"field -image-format: option argument missing" << endl;
754 string format = argv[++i];
755 dout.os() << setimage_format(format);
757 else if (strcmp (argv[i],
"-resolution") == 0) {
758 if (i == argc-1 || !isdigit(argv[i+1][0])) { std::cerr <<
"geo -resolution: option argument missing" << std::endl;
usage(); }
759 size_t nx = atoi(argv[++i]);
760 size_t ny = (i < argc-1 && isdigit(argv[i+1][0])) ? atoi(argv[++i]) : nx;
763 else if (argv [i][0] ==
'-' && argv [i][1] ==
'I') {
767 else if (strcmp (argv[i],
"-name") == 0) {
768 if (i+1 == argc) { std::cerr <<
"field -name: option argument missing" << std::endl;
usage(); }
771 else if (strcmp (argv[i],
"-label") == 0) {
772 if (i+1 == argc) { std::cerr <<
"field -label: option argument missing" << std::endl;
usage(); }
773 string label = argv[++i];
774 dout.os() << setlabel(label);
776 else if (strcmp (argv[i],
"-catchmark") == 0 || strcmp (argv[i],
"-mark") == 0) {
777 if (i+1 == argc) { std::cerr <<
"field -mark: option argument missing" << std::endl;
usage(); }
778 string mark = argv[++i];
779 dout.os() << setmark(mark);
781 else if (strcmp (argv[i],
"-if") == 0 ||
782 strcmp (argv[i],
"-input-format") == 0) {
783 if (i == argc-1) { std::cerr <<
"branch "<<argv[i]<<
": option argument missing" << std::endl;
usage(); }
784 input_format = argv[++i];
786 else if (strcmp (argv [i],
"-") == 0) {
789 dout.os() << setbasename(
"output") << reader_on_stdin;
790 file_name =
"output";
792 else if (argv [i][0] ==
'-') {
793 cerr <<
"branch: invalid option `" << argv[i] <<
"'" << endl;
804 if (!on_stdin && file_name ==
"") {
805 cerr <<
"branch: no input specified" << endl;
808 string basename = (name !=
"") ? name : file_name;
809 dout.os() << setbasename(basename)
810 << setprecision(digits10);
814 put(din,dout, do_proj, do_lumped_mass, use_proj_approx, def_fill_opt, extract_id, scale_value, u_range, render, reuse);
817 check_macro(in.
good(),
"\"" << file_name <<
"[.branch[.gz]]\" not found.");
819 put(in, dout, do_proj, do_lumped_mass, use_proj_approx, def_fill_opt, extract_id, scale_value, u_range, render, reuse);