diff options
author | Norbert Preining <norbert@preining.info> | 2021-12-28 03:01:00 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-12-28 03:01:00 +0000 |
commit | ecdf859b6ce481abfd530425dcf6f0f764bd0001 (patch) | |
tree | 13bc161dc046876ac6c92fce5f9f5034ba9aa573 /graphics/asymptote/settings.cc | |
parent | 790995b7e79697514364450bf9c04f1b8d500838 (diff) |
CTAN sync 202112280300
Diffstat (limited to 'graphics/asymptote/settings.cc')
-rw-r--r-- | graphics/asymptote/settings.cc | 71 |
1 files changed, 60 insertions, 11 deletions
diff --git a/graphics/asymptote/settings.cc b/graphics/asymptote/settings.cc index d3f8958470..ce5a5f8f47 100644 --- a/graphics/asymptote/settings.cc +++ b/graphics/asymptote/settings.cc @@ -224,6 +224,7 @@ char *argv0; // The verbosity setting, a global variable. Int verbose; +bool quiet=false; // Conserve memory at the expense of speed. bool compact; @@ -945,10 +946,12 @@ struct versionOption : public option { bool glm=false; bool gl=false; + bool ssbo=false; bool gsl=false; bool fftw3=false; bool xdr=false; bool curl=false; + bool lsp=false; bool readline=false; bool editline=false; bool sigsegv=false; @@ -962,6 +965,10 @@ struct versionOption : public option { gl=true; #endif +#ifdef HAVE_SSBO + ssbo=true; +#endif + #ifdef HAVE_LIBGSL gsl=true; #endif @@ -978,6 +985,10 @@ struct versionOption : public option { curl=true; #endif +#ifdef HAVE_LSP + lsp=true; +#endif + #ifdef HAVE_LIBCURSES #ifdef HAVE_LIBREADLINE readline=true; @@ -1002,10 +1013,12 @@ struct versionOption : public option { #else feature("OpenGL 3D OpenGL rendering",gl); #endif + feature("SSBO GLSL shader storage buffer objects",ssbo); feature("GSL GNU Scientific Library (special functions)",gsl); feature("FFTW3 Fast Fourier transforms",fftw3); - feature("XDR external data representation (portable binary file format)",xdr); + feature("XDR external data representation (portable binary file format for V3D)",xdr); feature("CURL URL support",curl); + feature("lsp language server protocol",lsp); feature("Readline interactive history and editing",readline); if(!readline) feature("Editline interactive editing (if Readline is unavailable)",editline); @@ -1202,15 +1215,16 @@ void initSettings() { addOption(new boolSetting("svgemulation", 0, "Emulate unimplemented SVG shading", true)); addOption(new boolSetting("prc", 0, - "Embed 3D PRC graphics in PDF output", true)); + "Embed 3D PRC graphics in PDF output", false)); addOption(new boolSetting("toolbar", 0, "Show 3D toolbar in PDF output", true)); addOption(new boolSetting("axes3", 0, "Show 3D axes in PDF output", true)); - addOption(new boolSetting("envmap", 0, - "Enable environment map image-based lighting (Experimental)", false)); - - + addOption(new boolSetting("ibl", 0, + "Enable environment map image-based lighting", false)); + addOption(new stringSetting("image", 0,"string","Environment image name","snowyField")); + addOption(new stringSetting("imageDir", 0,"string","Environment image library directory","ibl")); + addOption(new stringSetting("imageURL", 0,"string","Environment image library URL","https://vectorgraphics.gitlab.io/asymptote/ibl")); addOption(new realSetting("render", 0, "n", "Render 3D graphics using n pixels per bp (-1=auto)", havegl ? -1.0 : 0.0)); @@ -1222,6 +1236,9 @@ void initSettings() { addOption(new boolSetting("twosided", 0, "Use two-sided 3D lighting model for rendering", true)); + addOption(new boolSetting("GPUindexing", 0, + "Compute indexing partial sums on GPU", true)); + addOption(new pairSetting("position", 0, "pair", "Initial 3D rendering screen position")); addOption(new pairSetting("maxviewport", 0, "pair", @@ -1229,6 +1246,8 @@ void initSettings() { addOption(new pairSetting("viewportmargin", 0, "pair", "Horizontal and vertical 3D viewport margin", pair(0.5,0.5))); + addOption(new boolSetting("webgl2", 0, + "Use webgl2 if available", false)); addOption(new boolSetting("absolute", 0, "Use absolute WebGL dimensions", false)); addOption(new pairSetting("maxtile", 0, "pair", @@ -1293,6 +1312,10 @@ void initSettings() { "Show translated virtual machine code")); addOption(new boolSetting("tabcompletion", 0, "Interactive prompt auto-completion", true)); + addOption(new realSetting("prerender", 0, "resolution", + "Prerender V3D objects (0 implies vector output)", 0)); + addOption(new boolSetting("lossy", 0, + "Use single precision for V3D reals", false)); addOption(new boolSetting("listvariables", 'l', "List available global functions and variables")); addOption(new boolSetting("where", 0, @@ -1342,6 +1365,10 @@ void initSettings() { "Input code over multiple lines at the prompt")); addOption(new boolSetting("xasy", 0, "Special interactive mode for xasy")); + addOption(new boolSetting("lsp", 0, "Special interactive mode for lsp-rpc")); + addOption(new boolSetting("wsl", 0, "Set to WSL mode when running asy inside WSL.")); + addOption(new envSetting("lspport", "")); + addOption(new envSetting("lsphost", "127.0.0.1")); addOption(new boolSetting("wait", 0, "Wait for child processes to finish before exiting")); @@ -1412,6 +1439,8 @@ void initSettings() { addOption(new stringSetting("dvipsOptions", 0, "string", "")); addOption(new stringSetting("dvisvgmOptions", 0, "string", "")); + addOption(new boolSetting("dvisvgmMultipleFiles", 0, + "dvisvgm supports multiple files", false)); addOption(new stringSetting("convertOptions", 0, "string", "")); addOption(new stringSetting("gsOptions", 0, "string", "")); addOption(new stringSetting("htmlviewerOptions", 0, "string", "")); @@ -1456,9 +1485,15 @@ char *getArg(int n) { return argList[n]; } void setInteractive() { + bool xasy=getSetting<bool>("xasy"); + if(xasy && getSetting<Int>("outpipe") < 0) { + cerr << "Missing outpipe." << endl; + exit(-1); + } + if(numArgs() == 0 && !getSetting<bool>("listvariables") && getSetting<string>("command").empty() && - (isatty(STDIN_FILENO) || getSetting<Int>("xasy"))) + (isatty(STDIN_FILENO) || xasy || getSetting<Int>("lsp"))) interact::interactive=true; if(getSetting<bool>("localhistory")) @@ -1468,7 +1503,7 @@ void setInteractive() cerr << "failed to create directory "+initdir+"." << endl; historyname=initdir+"/history"; } - if(verbose > 1) + if(!quiet && verbose > 1) cerr << "Using history " << historyname << endl; } @@ -1543,7 +1578,7 @@ void initDir() { umask(mask); #endif if(access(initdir.c_str(),F_OK) == 0) { - if(verbose > 1) + if(!quiet && verbose > 1) cerr << "Using configuration directory " << initdir << endl; } } @@ -1683,6 +1718,17 @@ const char *endpicture(const string& texengine) return "\\endpicture%"; } +// TeX macro to begin new page. +const char *newpage(const string& texengine) +{ + if(latex(texengine)) + return "\\newpage"; + else if(context(texengine)) + return "}\\page\\hbox{%"; + else + return "\\eject"; +} + // Begin TeX special command. const char *beginspecial(const string& texengine) { @@ -1756,9 +1802,12 @@ void setOptions(int argc, char *argv[]) // Build settings module. initSettings(); - // Read command-line options initially to obtain config, dir, sysdir, verbose. + // Read command-line options initially to obtain config, dir, sysdir, + // verbose, and quiet. getOptions(argc,argv); + quiet=getSetting<bool>("quiet"); + // Make configuration and history directory initDir(); @@ -1773,7 +1822,7 @@ void setOptions(int argc, char *argv[]) if(!filename.empty()) { string file=locateFile(filename); if(!file.empty()) { - if(Verbose > 1) + if(!quiet && Verbose > 1) cerr << "Loading " << filename << " from " << file << endl; doConfig(file); } |