diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index e09293dd34748d6f128f88b1bc0e9b94b7e67812..88463526d3642ca21de9b8a35081512feccead00 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -168,8 +168,8 @@ void Get_Options(int argc, char *argv[]) #if !defined(HAVE_NO_PARSER) // Parse session and option files - ParseFile((CTX::instance()->home_dir + CTX::instance()->session_filename).c_str(), true); - ParseFile((CTX::instance()->home_dir + CTX::instance()->options_filename).c_str(), true); + ParseFile((CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str(), true); + ParseFile((CTX::instance()->homeDir + CTX::instance()->optionsFileName).c_str(), true); #endif // Get command line options @@ -181,7 +181,7 @@ void Get_Options(int argc, char *argv[]) if(!strcmp(argv[i] + 1, "socket")) { i++; if(argv[i]) - CTX::instance()->solver.socket_name = argv[i++]; + CTX::instance()->solver.socketName = argv[i++]; else Msg::Fatal("Missing string"); CTX::instance()->batch = -3; @@ -217,7 +217,7 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "part")) { i++; if(argv[i]){ - CTX::instance()->batch_after_mesh = 1; + CTX::instance()->batchAfterMesh = 1; opt_mesh_partition_num(0, GMSH_SET, atoi(argv[i++])); } else @@ -233,27 +233,27 @@ void Get_Options(int argc, char *argv[]) i++; } else if(!strcmp(argv[i] + 1, "a")) { - CTX::instance()->initial_context = 0; + CTX::instance()->initialContext = 0; i++; } else if(!strcmp(argv[i] + 1, "g")) { - CTX::instance()->initial_context = 1; + CTX::instance()->initialContext = 1; i++; } else if(!strcmp(argv[i] + 1, "m")) { - CTX::instance()->initial_context = 2; + CTX::instance()->initialContext = 2; i++; } else if(!strcmp(argv[i] + 1, "s")) { - CTX::instance()->initial_context = 3; + CTX::instance()->initialContext = 3; i++; } else if(!strcmp(argv[i] + 1, "p")) { - CTX::instance()->initial_context = 4; + CTX::instance()->initialContext = 4; i++; } else if(!strcmp(argv[i] + 1, "saveall")) { - CTX::instance()->mesh.save_all = 1; + CTX::instance()->mesh.saveAll = 1; i++; } else if(!strcmp(argv[i] + 1, "optimize")) { @@ -261,11 +261,11 @@ void Get_Options(int argc, char *argv[]) i++; } else if(!strcmp(argv[i] + 1, "optimize_netgen")) { - CTX::instance()->mesh.optimize_netgen = 1; + CTX::instance()->mesh.optimizeNetgen = 1; i++; } else if(!strcmp(argv[i] + 1, "nopopup")) { - CTX::instance()->nopopup = 1; + CTX::instance()->noPopup = 1; i++; } else if(!strcmp(argv[i] + 1, "string")) { @@ -285,28 +285,28 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "o")) { i++; if(argv[i]) - CTX::instance()->output_filename = argv[i++]; + CTX::instance()->outputFileName = argv[i++]; else Msg::Fatal("Missing file name"); } else if(!strcmp(argv[i] + 1, "bgm")) { i++; if(argv[i]) - CTX::instance()->bgm_filename = argv[i++]; + CTX::instance()->bgmFileName = argv[i++]; else Msg::Fatal("Missing file name"); } else if(!strcmp(argv[i] + 1, "nw")) { i++; if(argv[i]) - CTX::instance()->num_windows = atoi(argv[i++]); + CTX::instance()->numWindows = atoi(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "nt")) { i++; if(argv[i]) - CTX::instance()->num_tiles = atoi(argv[i++]); + CTX::instance()->numTiles = atoi(argv[i++]); else Msg::Fatal("Missing number"); } @@ -326,7 +326,7 @@ void Get_Options(int argc, char *argv[]) #endif // convert mesh to latest binary format if(GModel::current()->getMeshStatus() > 0){ - CTX::instance()->mesh.msh_file_version = 2.0; + CTX::instance()->mesh.mshFileVersion = 2.0; CTX::instance()->mesh.binary = 1; CreateOutputFile(fileName, FORMAT_MSH); } @@ -344,29 +344,29 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "scale")) { i++; if(argv[i]) - CTX::instance()->geom.scaling_factor = atof(argv[i++]); + CTX::instance()->geom.scalingFactor = atof(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "meshscale")) { i++; if(argv[i]) - CTX::instance()->mesh.scaling_factor = atof(argv[i++]); + CTX::instance()->mesh.scalingFactor = atof(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "rand")) { i++; if(argv[i]) - CTX::instance()->mesh.rand_factor = atof(argv[i++]); + CTX::instance()->mesh.randFactor = atof(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "clscale")) { i++; if(argv[i]) { - CTX::instance()->mesh.lc_factor = atof(argv[i++]); - if(CTX::instance()->mesh.lc_factor <= 0.0) + CTX::instance()->mesh.lcFactor = atof(argv[i++]); + if(CTX::instance()->mesh.lcFactor <= 0.0) Msg::Fatal("Characteristic length factor must be > 0"); } else @@ -375,8 +375,8 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "clmin")) { i++; if(argv[i]) { - CTX::instance()->mesh.lc_min = atof(argv[i++]); - if(CTX::instance()->mesh.lc_min <= 0.0) + CTX::instance()->mesh.lcMin = atof(argv[i++]); + if(CTX::instance()->mesh.lcMin <= 0.0) Msg::Fatal("Minimum length size must be > 0"); } else @@ -385,8 +385,8 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "clmax")) { i++; if(argv[i]) { - CTX::instance()->mesh.lc_max = atof(argv[i++]); - if(CTX::instance()->mesh.lc_max <= 0.0) + CTX::instance()->mesh.lcMax = atof(argv[i++]); + if(CTX::instance()->mesh.lcMax <= 0.0) Msg::Fatal("Maximum length size must be > 0"); } else @@ -395,10 +395,10 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "edgelmin")) { i++; if(argv[i]) { - CTX::instance()->mesh.tolerance_edge_length = atof(argv[i++]); - if(CTX::instance()->mesh.tolerance_edge_length <= 0.0) + CTX::instance()->mesh.toleranceEdgeLength = atof(argv[i++]); + if(CTX::instance()->mesh.toleranceEdgeLength <= 0.0) Msg::Fatal("Tolerance for model edge length must be > 0 (here %g)", - CTX::instance()->mesh.tolerance_edge_length); + CTX::instance()->mesh.toleranceEdgeLength); } else Msg::Fatal("Missing number"); @@ -406,8 +406,8 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "epslc1d")) { i++; if(argv[i]) { - CTX::instance()->mesh.lc_integration_precision = atof(argv[i++]); - if(CTX::instance()->mesh.lc_integration_precision <= 0.0) + CTX::instance()->mesh.lcIntegrationPrecision = atof(argv[i++]); + if(CTX::instance()->mesh.lcIntegrationPrecision <= 0.0) Msg::Fatal("Integration accuracy must be > 0"); } else @@ -416,21 +416,21 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "swapangle")) { i++; if(argv[i]) { - CTX::instance()->mesh.allow_swap_edge_angle = atof(argv[i++]); - if(CTX::instance()->mesh.allow_swap_edge_angle <= 0.0) + CTX::instance()->mesh.allowSwapEdgeAngle = atof(argv[i++]); + if(CTX::instance()->mesh.allowSwapEdgeAngle <= 0.0) Msg::Fatal("Treshold angle for edge swap must be > 0"); } else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "clcurv")) { - CTX::instance()->mesh.lc_from_curvature = 1; + CTX::instance()->mesh.lcFromCurvature = 1; i++; } else if(!strcmp(argv[i] + 1, "smooth")) { i++; if(argv[i]) - CTX::instance()->mesh.nb_smoothing = atoi(argv[i++]); + CTX::instance()->mesh.nbSmoothing = atoi(argv[i++]); else Msg::Fatal("Missing number"); } @@ -448,23 +448,19 @@ void Get_Options(int argc, char *argv[]) else Msg::Fatal("Missing number"); } - else if(!strcmp(argv[i] + 1, "c1")) { - i++; - opt_mesh_c1(0, GMSH_SET, 1); - } else if(!strcmp(argv[i] + 1, "statreport")) { i++; - CTX::instance()->create_append_statreport = 1; + CTX::instance()->createAppendMeshStatReport = 1; if(argv[i]) - CTX::instance()->statreport = argv[i++]; + CTX::instance()->meshStatReportFileName = argv[i++]; else Msg::Fatal("Missing argument"); } else if(!strcmp(argv[i] + 1, "append_statreport")) { i++; - CTX::instance()->create_append_statreport = 2; + CTX::instance()->createAppendMeshStatReport = 2; if(argv[i]) - CTX::instance()->statreport = argv[i++]; + CTX::instance()->meshStatReportFileName = argv[i++]; else Msg::Fatal("Missing argument"); } @@ -477,11 +473,11 @@ void Get_Options(int argc, char *argv[]) if(argv[i]) { if(!strcmp(argv[i], "msh1")){ CTX::instance()->mesh.format = FORMAT_MSH; - CTX::instance()->mesh.msh_file_version = 1.0; + CTX::instance()->mesh.mshFileVersion = 1.0; } else if(!strcmp(argv[i], "msh2")){ CTX::instance()->mesh.format = FORMAT_MSH; - CTX::instance()->mesh.msh_file_version = 2.0; + CTX::instance()->mesh.mshFileVersion = 2.0; } else if(!strcmp(argv[i], "msh")) CTX::instance()->mesh.format = FORMAT_MSH; @@ -516,7 +512,7 @@ void Get_Options(int argc, char *argv[]) } else if(!strcmp(argv[i] + 1, "parametric")) { i++; - CTX::instance()->mesh.save_parametric = 1; + CTX::instance()->mesh.saveParametric = 1; } else if(!strcmp(argv[i] + 1, "algo")) { i++; @@ -608,7 +604,7 @@ void Get_Options(int argc, char *argv[]) i++; } else if(!strcmp(argv[i] + 1, "combine")) { - CTX::instance()->post.combine_time = 1; + CTX::instance()->post.combineTime = 1; i++; } else if(!strcmp(argv[i] + 1, "nodb")) { @@ -618,21 +614,21 @@ void Get_Options(int argc, char *argv[]) else if(!strcmp(argv[i] + 1, "fontsize")) { i++; if(argv[i]) - CTX::instance()->fontsize = atoi(argv[i++]); + CTX::instance()->fontSize = atoi(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "deltafontsize")) { i++; if(argv[i]) - CTX::instance()->deltafontsize = atoi(argv[i++]); + CTX::instance()->deltaFontSize = atoi(argv[i++]); else Msg::Fatal("Missing number"); } else if(!strcmp(argv[i] + 1, "theme") || !strcmp(argv[i] + 1, "scheme")) { i++; if(argv[i]) - CTX::instance()->gui_theme = argv[i++]; + CTX::instance()->guiTheme = argv[i++]; else Msg::Fatal("Missing argument"); } @@ -666,8 +662,8 @@ void Get_Options(int argc, char *argv[]) } if(CTX::instance()->files.empty()){ - std::string base = (getenv("PWD") ? "" : CTX::instance()->home_dir); - GModel::current()->setFileName((base + CTX::instance()->default_filename).c_str()); + std::string base = (getenv("PWD") ? "" : CTX::instance()->homeDir); + GModel::current()->setFileName((base + CTX::instance()->defaultFileName).c_str()); } else GModel::current()->setFileName(CTX::instance()->files[0]); diff --git a/Common/Context.cpp b/Common/Context.cpp index e77109ca692cd5c0c36dae0f3e1046b04e50dd21..91e86aa378d7844f372667582f6f582c13a2b689 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -3,43 +3,82 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. +#include <stdlib.h> +#include <string.h> +#include "GmshConfig.h" #include "Context.h" #if defined(HAVE_FLTK) #include <FL/Fl.H> #endif +static const char *getEnvironmentVariable(const char *var) +{ +#if !defined(WIN32) + return getenv(var); +#else + const char *tmp = getenv(var); + // Don't accept top dir or anything partially expanded like + // c:\Documents and Settings\%USERPROFILE%, etc. + if(!tmp || !strcmp(tmp, "/") || strstr(tmp, "%") || strstr(tmp, "$")) + return 0; + else + return tmp; +#endif +} + CTX::CTX() { - // These options have no default values in DefaultOptions.h (i.e., - // cannot be set by the user) - batch = batch_after_mesh = 0; - output_filename = ""; - bgm_filename = ""; + // Initialize everything that has no default value in + // DefaultOptions.h + + short int word = 0x0001; + char *byte = (char*)&word; + bigEndian = (byte[0] ? 0 : 1); + + const char *tmp; + if((tmp = getEnvironmentVariable("GMSH_HOME"))) + homeDir = tmp; + else if((tmp = getEnvironmentVariable("HOME"))) + homeDir = tmp; + else if((tmp = getEnvironmentVariable("TMP"))) + homeDir = tmp; + else if((tmp = getEnvironmentVariable("TEMP"))) + homeDir = tmp; + else + homeDir = ""; + int len = homeDir.size(); + if(len && homeDir[len - 1] != '/') + homeDir += "/"; + + batch = batchAfterMesh = 0; + outputFileName = ""; + bgmFileName = ""; + createAppendMeshStatReport = 0; lc = 1.; min[0] = min[1] = min[2] = max[2] = 0.; max[0] = max[1] = 1.; // for nice view when adding point in new model cg[0] = cg[1] = cg[2] = 0.; - polygon_offset = 0; + polygonOffset = 0; printing = 0; - mesh_timer[0] = mesh_timer[1] = mesh_timer[2] = 0.; - draw_rotation_center = 0; - pick_elements = 0; + meshTimer[0] = meshTimer[1] = meshTimer[2] = 0.; + drawRotationCenter = 0; + pickElements = 0; geom.draw = 1; mesh.draw = 1; post.draw = 1; - threads_lock = 0; // very primitive locking + lock = 0; // very primitive locking mesh.changed = 0; - post.combine_time = 0; // try to combine_time views at startup - post.plugin_draw_function = 0; + post.combineTime = 0; // try to combineTime views at startup + post.pluginDrawFunction = 0; #if defined(HAVE_FLTK) - gl_font_enum = FL_HELVETICA; + glFontEnum = FL_HELVETICA; #else - gl_font_enum = -1; + glFontEnum = -1; #endif - forced_bbox = 0; - hide_unselected = 0; - num_windows = num_tiles = 1; - deltafontsize = 0; + forcedBBox = 0; + hideUnselected = 0; + numWindows = numTiles = 1; + deltaFontSize = 0; } CTX *CTX::_instance = 0; @@ -50,41 +89,41 @@ CTX *CTX::instance() return _instance; } -unsigned int CTX::pack_color(int R, int G, int B, int A) +unsigned int CTX::packColor(int R, int G, int B, int A) { - if(big_endian) + if(bigEndian) return ( (unsigned int)((R)<<24 | (G)<<16 | (B)<<8 | (A)) ); else return ( (unsigned int)((A)<<24 | (B)<<16 | (G)<<8 | (R)) ); } -int CTX::unpack_red(unsigned int X) +int CTX::unpackRed(unsigned int X) { - if(big_endian) + if(bigEndian) return ( ( (X) >> 24 ) & 0xff ); else return ( (X) & 0xff ); } -int CTX::unpack_green(unsigned int X) +int CTX::unpackGreen(unsigned int X) { - if(big_endian) + if(bigEndian) return ( ( (X) >> 16 ) & 0xff ); else return ( ( (X) >> 8 ) & 0xff ); } -int CTX::unpack_blue(unsigned int X) +int CTX::unpackBlue(unsigned int X) { - if(big_endian) + if(bigEndian) return ( ( (X) >> 8 ) & 0xff ); else return ( ( (X) >> 16 ) & 0xff ); } -int CTX::unpack_alpha(unsigned int X) +int CTX::unpackAlpha(unsigned int X) { - if(big_endian) + if(bigEndian) return ( (X) & 0xff ); else return ( ( (X) >> 24 ) & 0xff ); diff --git a/Common/Context.h b/Common/Context.h index 86623f9303be9de48288698acf889e0eadeb3154..017f4f8f37661ad9f667ff33b3edb1b90b7074d0 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -20,219 +20,214 @@ class CTX { CTX(); ~CTX(){} static CTX *instance(); - // general options - std::vector<std::string> files; // all the files on the command line - std::string bgm_filename; // background mesh - std::string output_filename; // output file specified with command line option '-o' - std::string default_filename; - std::string tmp_filename; - std::string session_filename; - std::string options_filename; - std::string error_filename; - std::string statreport; // mesh stat output file - int create_append_statreport; // do nothing 0 create 1 append 2 - int session_save, options_save; // save session/option file on exit - int confirm_overwrite; // confirm overwrite when file->save as - std::string display; // forced display host:0.0 under X11 - int terminal; // show we print to the terminal console? - int num_windows, num_tiles; // number of graphical windows/tiles to create - std::string editor; // text editor command (with included '%s') - std::string web_browser; // web browser command (with included '%s') - std::string home_dir; // the home directory - std::string gui_theme; // FLTK GUI theme - int tooltips; // show tootips in GUI? - int position[2]; // position of the menu window on the screen - int gl_position[2]; // position of the graphic window on the screen - int gl_size[2]; // size of the graphic window on the screen - int msg_position[2]; // position of the message window on the screen - int msg_size[2]; // size of the message window on the screen - int msg_auto_scroll; // scroll automatically to last message - int opt_position[2]; // position of the option window on the screen - int vis_position[2]; // position of the visibility window on the screen - int clip_position[2]; // position of the clipping planes window on the screen - int manip_position[2]; // position of the manipulator window on the screen - int stat_position[2]; // position of the statistics window on the screen - int ctx_position[2]; // position of the geo/mesh context windows on the screen - int solver_position[2]; // position of the solver windows on the screen - int plugin_position[2]; // position of the plugin window on the screen - int plugin_size[2]; // size of the plugin window on the screen - int field_position[2]; // position of the field window on the screen - int field_size[2]; // size of the field window on the screen - int file_chooser_position[2]; // position of the file chooser window on the screen - int system_menu_bar; // use the system menu bar on MacOS? - int batch; // -3=server daemon; -2=check coherence; -1=write geo; 0=full gfx; - // 1=1D mesh; 2=2D mesh; 3=3D mesh; 4=adapt mesh; 5=refine mesh; - int batch_after_mesh; // 1=partition mesh - int initial_context; // 0=automatic; 1=geom; 2=mesh; 3=solver; 4=post - int nopopup; // never popup dialogs in scripts (use default values instead) - int non_modal_windows; // make all windows "non modal" - double clip_factor; // clipping plane distance factor - int useTrackball; // do or do not use the trackball for rotations - double rotation_center[3]; // point around which to rotate the scene - int rotation_center_cg; // rotate around the center of mass instead of rotation_center[] - double min[3], max[3]; // "overall" x, y and z min used for drawing and lc computation - double cg[3]; // "center of mass" of the current geometry, used for graphics only - double lc; // characteristic length for the whole problem (never - // used in mesh generation ->only for geo/post) - int db, antialiasing; // double buffer? antialiasing? - int ortho; // orthogonal projection? - int draw_bbox, draw_rotation_center; // draw the bounding boxes and the rot center? - int fast_redraw; // draw simplified model during user interaction - int small_axes, small_axes_size, small_axes_pos[2]; // small axes - int axes, axes_auto_position, axes_tics[3],axes_mikado; // large axes - double axes_position[6]; - std::string axes_label[3], axes_format[3]; - int threads, threads_lock; // threads?, lock (should be a mutex...) - int alpha; // enable alpha blending - double zoom_factor; // mouse2 zoom coefficient - int bg_gradient; // draw background gradient? - int fontsize, deltafontsize; // fltk font size (and delta for palettes) - std::string gl_font; // font for opengl graphics - int gl_font_enum; // font for opengl graphics (fltk enum value) - int gl_fontsize; // font size for opengl graphics - double point_size, line_width; // point/line widths - int light[6]; // status of lights - double light_position[6][4]; // light sources positions - double shine, shine_exponent; // material specular reflection parameters - double clip_plane[6][4]; // clipping planes - int clip_whole_elements, clip_only_draw_intersecting_volume; // clipping options - int clip_only_volume; - int polygon_offset, polygon_offset_always; // polygon offset control - double polygon_offset_factor, polygon_offset_units; // params for glPolygonOffset - int color_scheme; // general color scheme - int quadric_subdivisions; // nb of subdivisions for gluQuadrics (spheres/cylinders) - int vector_type; // default vector display type (for normals, etc.) - double arrow_rel_head_radius; // relative radius of arrow head - double arrow_rel_stem_radius; // relative radius of arrow stem - double arrow_rel_stem_length; // relative length of arrow stem - double mesh_timer[3]; // records cpu times for 1-D, 2-D and 3-D mesh generation - int forced_bbox; // dynamic variable tracking if the bbox is currently imposed - int mouse_selection; // enable selection using the mouse - int mouse_hover_meshes; // enable mouse hover on meshes - int pick_elements; // allow individual element picking - int expert_mode; // to disable some warnings for beginners - int printing; // dynamic: equal to 1 while gmsh is printing - int hide_unselected; // hide all unselected entities - - // these are used as temp vars until the GUI is ready - double tmp_r[3]; // current Euler angles (in degrees!) - double tmp_t[3], tmp_s[3]; // current translation and scale - double tmp_quaternion[4]; // current quaternion used for "trackball" rotation - + public: + // files on the command line and various file names + std::vector<std::string> files; + std::string bgmFileName, outputFileName, defaultFileName, tmpFileName; + std::string sessionFileName, optionsFileName, errorFileName; + std::string meshStatReportFileName; + // the home directory + std::string homeDir; + // create mesh statistics report (0: do nothing, 1: create, 2: append) + int createAppendMeshStatReport; + // save session/option file on exit? + int sessionSave, optionsSave; + // ask confirmation when overwriting files? + int confirmOverwrite; + // forced display host:0.0 under X11 + std::string display; + // FLTK theme + std::string guiTheme; + // print messages on to the terminal? + int terminal; + // number of graphical windows/tiles + int numWindows, numTiles; + // text editor and web browser command (with included '%s') + std::string editor, webBrowser; + // show tootips in the GUI? + int tooltips; + // scroll automatically to last message in the message window? + int msgAutoScroll; + // position and size of various windows in the GUI + int menuPosition[2], glPosition[2], glSize[2], msgPosition[2], msgSize[2]; + int optPosition[2], visPosition[2], clipPosition[2], manipPosition[2]; + int statPosition[2], ctxPosition[2], solverPosition[2]; + int pluginPosition[2], pluginSize[2], fieldPosition[2], fieldSize[2]; + int fileChooserPosition[2]; + // use the system menu bar on Mac OS X? + int systemMenuBar; + // batch mode (-3: server daemon, -2: check coherence, -1: write + // geo, 0: full gfx, 1: 1D mesh, 2: 2D mesh, 3: 3D mesh, 4: adapt + // mesh, 5: refine mesh) + int batch; + // batch operations to appy after meshing (1: partition mesh) + int batchAfterMesh; + // initial menu (0: automatic, 1: geom, 2: mesh, 3: solver, 4: post) + int initialContext; + // never popup dialogs in scripts (use default values instead)? + int noPopup; + // make all windows "non modal"? + int nonModalWindows; + // clipping plane distance factor + double clipFactor; + // do or do not use the trackball for rotations + int useTrackball; + // point around which to rotate the scene + double rotationCenter[3]; + // rotate around the center of mass instead of rotationCenter[] + int rotationCenterCg; + // "overall" x, y and z min used for drawing and lc computation + double min[3], max[3]; + // "center of mass" of the current geometry, used for graphics only + double cg[3]; + // characteristic length for the whole problem (never used in mesh + // generation ->only for geo/post) + double lc; + // double buffer/antialias graphics? + int db, antialiasing; + // orthogonal projection? + int ortho; + // draw the bounding boxes and the rot center? + int drawBBox, drawRotationCenter; + // draw simplified model during user interaction? + int fastRedraw; + // small axes options + int smallAxes, smallAxesSize, smallAxesPos[2]; + // large axes options + int axes, axesAutoPosition, axesTics[3], axesMikado; + double axesPosition[6]; + std::string axesLabel[3], axesFormat[3]; + // simple dynamic lock (should be a mutex) + int lock; + // enable alpha blending? + int alpha; + // mouse2 zoom coefficient + double zoomFactor; + // draw background gradient? + int bgGradient; + // fltk font size (and delta for palette windows) + int fontSize, deltaFontSize; + // font name, FLTK enum and size for opengl graphics + std::string glFont; + int glFontEnum, glFontSize; + // point/line widths + double pointSize, lineWidth; + // light options + int light[6]; + double lightPosition[6][4], shine, shineExponent; + // clipping plane options + double clipPlane[6][4]; + int clipWholeElements, clipOnlyDrawIntersectingVolume, clipOnlyVolume; + // polygon offset options + int polygonOffset, polygonOffsetAlways; + double polygonOffsetFactor, polygonOffsetUnits; + // color scheme + int colorScheme; + // number of subdivisions for gluQuadrics + int quadricSubdivisions; + // vector display type and options (for normals, etc.) + int vectorType; + double arrowRelHeadRadius, arrowRelStemRadius, arrowRelStemLength; + // records cpu times for 1-D, 2-D and 3-D mesh generation + double meshTimer[3]; + // dynamic variable tracking if the bbox is currently imposed + int forcedBBox; + // enable selection/hover/picking using the mouse + int mouseSelection, mouseHoverMeshes, pickElements; + // disable some warnings for expert users? + int expertMode; + // dynamic: equal to 1 while gmsh is printing + int printing; + // hide all unselected entities? + int hideUnselected; + // temporary storage of rotation, translation, scale (until the GUI + // is ready) + double tmpRotation[3], tmpTranslation[3], tmpScale[3], tmpQuaternion[4]; // geometry options struct{ - int points, lines, surfaces, volumes; - int points_num, lines_num, surfaces_num, volumes_num; - double point_size, line_width, point_sel_size, line_sel_width; - int point_type, line_type, surface_type; - int draw, light, light_two_side; - int old_circle, num_sub_edges; - int extrude_spline_points, extrude_return_lateral, old_newreg; - double normals, tangents; - double scaling_factor; - int auto_coherence, highlight_orphans; - double tolerance; - double snap[3]; - int occ_fix_small_edges, occ_fix_small_faces, occ_sew_faces; - int clip; // status of clip planes (bit array) - int use_transform; // transform display coordinates? (0=no, 1=scale, 2=...) - double transform[3][3], offset[3]; // transformation matrix for geo/mesh drawing + int draw, light, lightTwoSide, points, lines, surfaces, volumes; + int pointsNum, linesNum, surfacesNum, volumesNum; + double pointSize, lineWidth, selectedPointSize, selectedLineWidth; + int pointType, lineType, surfaceType, numSubEdges; + int oldCircle, extrudeSplinePoints, extrudeReturnLateral, oldNewreg; + double normals, tangents, scalingFactor; + int autoCoherence, highlightOrphans, clip, useTransform; + double tolerance, snap[3], transform[3][3], offset[3]; + int occFixSmallEdges, occFixSmallFaces, occSewFaces; } geom; - // mesh options struct { - double msh_file_version; - int changed, draw; + int draw, changed, light, lightTwoSide, lightLines, pointType; int points, lines, triangles, quadrangles, tetrahedra, hexahedra, prisms, pyramids; - int surfaces_edges, surfaces_faces, volumes_edges, volumes_faces; - int points_num, lines_num, surfaces_num, volumes_num; - int num_sub_edges; - double label_frequency; - int point_type; // flat or 3D - double point_size, line_width; - int optimize, optimize_netgen, refine_steps; - int quality_type, label_type; - double quality_inf, quality_sup, radius_inf, radius_sup; - double scaling_factor, lc_factor, rand_factor, lc_integration_precision; - double lc_min, lc_max, tolerance_edge_length; - int lc_from_points, lc_from_curvature, lc_extend_from_boundary; - int dual, voronoi, draw_skin_only; - int light, light_two_side, light_lines; - int format, nb_smoothing, algo2d, algo3d, algo_subdivide; - int order, second_order_linear, second_order_incomplete; - int second_order_experimental, mesh_only_visible; - int smooth_internal_edges, c1_continuity; - int min_circ_points, min_curv_points; - double normals, tangents, explode; - int color_carousel; - int save_all, save_groups_of_nodes, binary, bdf_field_format, save_parametric; - int smooth_normals, reverse_all_normals; - double angle_smooth_normals; - double allow_swap_edge_angle; - int zone_definition; - int clip; // status of clip planes (bit array) + int surfacesEdges, surfacesFaces, volumesEdges, volumesFaces, numSubEdges; + int pointsNum, linesNum, surfacesNum, volumesNum; + int optimize, optimizeNetgen, refineSteps, qualityType, labelType; + double normals, tangents, explode, angleSmoothNormals, allowSwapEdgeAngle; + double mshFileVersion, labelFrequency, pointSize, lineWidth; + double qualityInf, qualitySup, radiusInf, radiusSup; + double scalingFactor, lcFactor, randFactor, lcIntegrationPrecision; + double lcMin, lcMax, toleranceEdgeLength; + int lcFromPoints, lcFromCurvature, lcExtendFromBoundary; + int dual, voronoi, drawSkinOnly, colorCarousel; + int format, nbSmoothing, algo2d, algo3d, algoSubdivide; + int order, secondOrderLinear, secondOrderIncomplete; + int secondOrderExperimental, meshOnlyVisible; + int smoothInternalEdges, minCircPoints, minCurvPoints; + int saveAll, saveGroupsOfNodes, binary, bdfFieldFormat, saveParametric; + int smoothNormals, reverseAllNormals, zoneDefinition, clip; } mesh; - // FIXME: putting these in the mesh struct (where they belong) causes - // an LNK1179 error ("duplicate COMDAT") with MSVC. I have no idea why. - meshPartitionOptions partition_options; - CGNSOptions cgns_options; - + // an LNK1179 error ("duplicate COMDAT") with MSVC... + meshPartitionOptions partitionOptions; + CGNSOptions cgnsOptions; // post processing options struct{ - int draw, link, horizontal_scales; - int smooth, anim_cycle, combine_time, combine_remove_orig; - int file_format, plugins; - double anim_delay; - void (*plugin_draw_function)(void *context); + int draw, link, horizontalScales; + int smooth, animCycle, combineTime, combineRemoveOrig; + int fileFormat, plugins; + double animDelay; + void (*pluginDrawFunction)(void*); }post; - // solver options struct{ - int max_delay, plugins, listen; - std::string socket_name; + int plugins, listen; + std::string socketName; }solver; - // print options struct{ - int format; - int eps_quality, eps_background, eps_compress, eps_ps3shading; - int eps_occlusion_culling, eps_best_root; - double eps_line_width_factor, eps_point_size_factor; - int jpeg_quality, jpeg_smoothing; - int gif_dither, gif_sort, gif_interlace, gif_transparent; - int geo_labels; - int pos_elementary, pos_element, pos_gamma, pos_eta, pos_rho,pos_disto; - int text, tex_as_equation; + int format, epsQuality, epsBackground, epsCompress, epsPS3Shading; + int epsOcclusionCulling, epsBestRoot; + double epsLineWidthFactor, epsPointSizeFactor; + int jpegQuality, jpegSmoothing, geoLabels, text, texAsEquation; + int gifDither, gifSort, gifInterlace, gifTransparent; + int posElementary, posElement, posGamma, posEta, posRho, posDisto; } print; - // color options struct{ - unsigned int bg, bg_grad, fg, text, axes, small_axes; - unsigned int ambient_light[6], diffuse_light[6], specular_light[6]; + unsigned int bg, bgGrad, fg, text, axes, smallAxes; + unsigned int ambientLight[6], diffuseLight[6], specularLight[6]; struct{ unsigned int point, line, surface, volume; unsigned int selection, highlight[3], projection; unsigned int tangents, normals; } geom; struct{ - unsigned int vertex, vertex_sup, line, triangle, quadrangle; + unsigned int vertex, vertexSup, line, triangle, quadrangle; unsigned int tetrahedron, hexahedron, prism, pyramid; unsigned int carousel[20]; unsigned int tangents, normals; } mesh; } color; - - int big_endian; // is the machine big-endian? - + // is the machine big-endian? + int bigEndian; // how RGBA values are packed and unpacked into/from an unsigned // integer to be fed to glColor4ubv (depends on machine byte // ordering!): - unsigned int pack_color(int R, int G, int B, int A); - int unpack_red(unsigned int X); - int unpack_green(unsigned int X); - int unpack_blue(unsigned int X); - int unpack_alpha(unsigned int X); + unsigned int packColor(int R, int G, int B, int A); + int unpackRed(unsigned int X); + int unpackGreen(unsigned int X); + int unpackBlue(unsigned int X); + int unpackAlpha(unsigned int X); }; #endif diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp index caac6877e1ceea0b634eabe131c9966ba37385fc..221715b8bc4542163ca2069dc4d4c052bb325caf 100644 --- a/Common/CreateFile.cpp +++ b/Common/CreateFile.cpp @@ -139,79 +139,79 @@ void CreateOutputFile(std::string fileName, int format) case FORMAT_MSH: GModel::current()->writeMSH - (fileName, CTX::instance()->mesh.msh_file_version, - CTX::instance()->mesh.binary, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.save_parametric, CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.mshFileVersion, + CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.saveParametric, CTX::instance()->mesh.scalingFactor); break; case FORMAT_STL: GModel::current()->writeSTL - (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_VRML: GModel::current()->writeVRML - (fileName, CTX::instance()->mesh.save_all, CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor); break; case FORMAT_UNV: GModel::current()->writeUNV - (fileName, CTX::instance()->mesh.save_all, CTX::instance()->mesh.save_groups_of_nodes, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.saveGroupsOfNodes, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_VTK: GModel::current()->writeVTK - (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.scaling_factor, - CTX::instance()->big_endian); + (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.scalingFactor, + CTX::instance()->bigEndian); break; case FORMAT_MESH: GModel::current()->writeMESH - (fileName, CTX::instance()->mesh.save_all, CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor); break; case FORMAT_BDF: GModel::current()->writeBDF - (fileName, CTX::instance()->mesh.bdf_field_format, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.bdfFieldFormat, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_DIFF: GModel::current()->writeDIFF - (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_P3D: GModel::current()->writeP3D - (fileName, CTX::instance()->mesh.save_all, CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor); break; case FORMAT_CGNS: GModel::current()->writeCGNS - (fileName, CTX::instance()->mesh.zone_definition, CTX::instance()->cgns_options, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.zoneDefinition, CTX::instance()->cgnsOptions, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_MED: GModel::current()->writeMED - (fileName, CTX::instance()->mesh.save_all, CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor); break; case FORMAT_POS: GModel::current()->writePOS - (fileName, CTX::instance()->print.pos_elementary, - CTX::instance()->print.pos_element, CTX::instance()->print.pos_gamma, - CTX::instance()->print.pos_eta, CTX::instance()->print.pos_rho, - CTX::instance()->print.pos_disto, CTX::instance()->mesh.save_all, - CTX::instance()->mesh.scaling_factor); + (fileName, CTX::instance()->print.posElementary, + CTX::instance()->print.posElement, CTX::instance()->print.posGamma, + CTX::instance()->print.posEta, CTX::instance()->print.posRho, + CTX::instance()->print.posDisto, CTX::instance()->mesh.saveAll, + CTX::instance()->mesh.scalingFactor); break; case FORMAT_GEO: - GModel::current()->writeGEO(fileName, CTX::instance()->print.geo_labels); + GModel::current()->writeGEO(fileName, CTX::instance()->print.geoLabels); break; #if defined(HAVE_FLTK) @@ -229,11 +229,11 @@ void CreateOutputFile(std::string fileName, int format) PixelBuffer buffer(width, height, GL_RGB, GL_UNSIGNED_BYTE); - int old_bg_gradient = CTX::instance()->bg_gradient; - if(format == FORMAT_GIF && CTX::instance()->print.gif_transparent) - CTX::instance()->bg_gradient = 0; + int old_gradient = CTX::instance()->bgGradient; + if(format == FORMAT_GIF && CTX::instance()->print.gifTransparent) + CTX::instance()->bgGradient = 0; buffer.Fill(CTX::instance()->batch); - CTX::instance()->bg_gradient = old_bg_gradient; + CTX::instance()->bgGradient = old_gradient; if(format == FORMAT_PPM){ create_ppm(fp, &buffer); @@ -243,17 +243,17 @@ void CreateOutputFile(std::string fileName, int format) } else if(format == FORMAT_GIF){ create_gif(fp, &buffer, - CTX::instance()->print.gif_dither, - CTX::instance()->print.gif_sort, - CTX::instance()->print.gif_interlace, - CTX::instance()->print.gif_transparent, - CTX::instance()->unpack_red(CTX::instance()->color.bg), - CTX::instance()->unpack_green(CTX::instance()->color.bg), - CTX::instance()->unpack_blue(CTX::instance()->color.bg)); + CTX::instance()->print.gifDither, + CTX::instance()->print.gifSort, + CTX::instance()->print.gifInterlace, + CTX::instance()->print.gifTransparent, + CTX::instance()->unpackRed(CTX::instance()->color.bg), + CTX::instance()->unpackGreen(CTX::instance()->color.bg), + CTX::instance()->unpackBlue(CTX::instance()->color.bg)); } else if(format == FORMAT_JPEG){ - create_jpeg(fp, &buffer, CTX::instance()->print.jpeg_quality, - CTX::instance()->print.jpeg_smoothing); + create_jpeg(fp, &buffer, CTX::instance()->print.jpegQuality, + CTX::instance()->print.jpegSmoothing); } else{ create_png(fp, &buffer, 100); @@ -289,25 +289,25 @@ void CreateOutputFile(std::string fileName, int format) break; } - int old_bg_gradient = CTX::instance()->bg_gradient; - if(!CTX::instance()->print.eps_background) CTX::instance()->bg_gradient = 0; + int old_gradient = CTX::instance()->bgGradient; + if(!CTX::instance()->print.epsBackground) CTX::instance()->bgGradient = 0; PixelBuffer buffer(width, height, GL_RGB, GL_FLOAT); - if(CTX::instance()->print.eps_quality == 0) + if(CTX::instance()->print.epsQuality == 0) buffer.Fill(CTX::instance()->batch); int pssort = - (CTX::instance()->print.eps_quality == 3) ? GL2PS_NO_SORT : - (CTX::instance()->print.eps_quality == 2) ? GL2PS_BSP_SORT : + (CTX::instance()->print.epsQuality == 3) ? GL2PS_NO_SORT : + (CTX::instance()->print.epsQuality == 2) ? GL2PS_BSP_SORT : GL2PS_SIMPLE_SORT; int psoptions = GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT | - (CTX::instance()->print.eps_occlusion_culling ? GL2PS_OCCLUSION_CULL : 0) | - (CTX::instance()->print.eps_best_root ? GL2PS_BEST_ROOT : 0) | - (CTX::instance()->print.eps_background ? GL2PS_DRAW_BACKGROUND : 0) | - (CTX::instance()->print.eps_compress ? GL2PS_COMPRESS : 0) | - (CTX::instance()->print.eps_ps3shading ? 0 : GL2PS_NO_PS3_SHADING); + (CTX::instance()->print.epsOcclusionCulling ? GL2PS_OCCLUSION_CULL : 0) | + (CTX::instance()->print.epsBestRoot ? GL2PS_BEST_ROOT : 0) | + (CTX::instance()->print.epsBackground ? GL2PS_DRAW_BACKGROUND : 0) | + (CTX::instance()->print.epsCompress ? GL2PS_COMPRESS : 0) | + (CTX::instance()->print.epsPS3Shading ? 0 : GL2PS_NO_PS3_SHADING); GLint buffsize = 0; int res = GL2PS_OVERFLOW; @@ -316,7 +316,7 @@ void CreateOutputFile(std::string fileName, int format) gl2psBeginPage(base, "Gmsh", viewport, psformat, pssort, psoptions, GL_RGBA, 0, NULL, 15, 20, 10, buffsize, fp, base); - if(CTX::instance()->print.eps_quality == 0){ + if(CTX::instance()->print.epsQuality == 0){ double modelview[16], projection[16]; glGetDoublev(GL_PROJECTION_MATRIX, projection); glGetDoublev(GL_MODELVIEW_MATRIX, modelview); @@ -339,7 +339,7 @@ void CreateOutputFile(std::string fileName, int format) res = gl2psEndPage(); } - CTX::instance()->bg_gradient = old_bg_gradient; + CTX::instance()->bgGradient = old_gradient; fclose(fp); } break; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 0bb295aba5a9e7a27c57e424ae45b1699f2e5c46..9aefa3c8188f0eb431fba0d8f3f1868f4541bbfd 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -919,8 +919,6 @@ StringXNumber MeshOptions_Number[] = { { F|O, "Binary" , opt_mesh_binary , 0. , "Write mesh files in binary format (if possible)" }, - { F|O, "C1Continuity" , opt_mesh_c1 , 0. , - "Impose C1 continuity to high order meshes (only valid in 2D plane and ElemenOrder = 2)" }, { F|O, "ChacoArchitecture" , opt_mesh_partition_chaco_architecture, 1. , "(Adv. Chaco): Parallel architecture topology (0=hypercube, 1-3=mesh dimensions)" }, { F|O, "ChacoEigensolver" , opt_mesh_partition_chaco_eigensolver, 1. , @@ -1151,8 +1149,6 @@ StringXNumber SolverOptions_Number[] = { { F|O, "ClientServer4" , opt_solver_client_server4 , 0. , "Connect solver 4 to the Gmsh server" }, - { F|O, "MaximumDelay" , opt_solver_max_delay , 4.0 , - "Maximum delay (in seconds) allowed for solver response" }, { F|O, "MergeViews0" , opt_solver_merge_views0 , 1. , "Automatically merge any post-processing view created by solver 0" }, { F|O, "MergeViews1" , opt_solver_merge_views1 , 1. , diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 340393a3a875ef8eff94440cd39f9e1155cbd451..4f68ad5668079d17f44a910f8210432be4ca00a6 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -99,8 +99,8 @@ int GmshBatch() } #if !defined(HAVE_NO_POST) - if(!CTX::instance()->bgm_filename.empty()) { - MergeFile(CTX::instance()->bgm_filename); + if(!CTX::instance()->bgmFileName.empty()) { + MergeFile(CTX::instance()->bgmFileName); if(PView::list.size()) GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); else @@ -109,13 +109,13 @@ int GmshBatch() #endif if(CTX::instance()->batch == -3){ - GmshDaemon(CTX::instance()->solver.socket_name); + GmshDaemon(CTX::instance()->solver.socketName); } else if(CTX::instance()->batch == -2){ GModel::current()->checkMeshCoherence(CTX::instance()->geom.tolerance); } else if(CTX::instance()->batch == -1){ - CreateOutputFile(CTX::instance()->output_filename, FORMAT_GEO); + CreateOutputFile(CTX::instance()->outputFileName, FORMAT_GEO); } else if(CTX::instance()->batch > 0){ if(CTX::instance()->batch < 4) @@ -123,12 +123,12 @@ int GmshBatch() else if(CTX::instance()->batch == 4) AdaptMesh(GModel::current()); else if(CTX::instance()->batch == 5) - RefineMesh(GModel::current(), CTX::instance()->mesh.second_order_linear); + RefineMesh(GModel::current(), CTX::instance()->mesh.secondOrderLinear); #if defined(HAVE_CHACO) || defined(HAVE_METIS) - if(CTX::instance()->batch_after_mesh == 1) - PartitionMesh(GModel::current(), CTX::instance()->partition_options); + if(CTX::instance()->batchAfterMesh == 1) + PartitionMesh(GModel::current(), CTX::instance()->partitionOptions); #endif - CreateOutputFile(CTX::instance()->output_filename, CTX::instance()->mesh.format); + CreateOutputFile(CTX::instance()->outputFileName, CTX::instance()->mesh.format); } time_t now; diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index 122c485715ee057e458242608a8e9078f30d2a14..526e88e1a7565c22dc23e63da9666640530ad08c 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -75,7 +75,7 @@ void Msg::Init(int argc, char **argv) void Msg::Exit(int level) { // delete the temp file - if(!_commRank) UnlinkFile(CTX::instance()->home_dir + CTX::instance()->tmp_filename); + if(!_commRank) UnlinkFile(CTX::instance()->homeDir + CTX::instance()->tmpFileName); // exit directly on abnormal program termination (level != 0). We // used to call abort() to flush open streams, but on modern OSes @@ -92,12 +92,12 @@ void Msg::Exit(int level) // if we exit cleanly (level==0) and we are in full GUI mode, save // the persistent info to disk if(GUI::available() && !_commRank) { - if(CTX::instance()->session_save) + if(CTX::instance()->sessionSave) Print_Options(0, GMSH_SESSIONRC, 0, 0, - (CTX::instance()->home_dir + CTX::instance()->session_filename).c_str()); - if(CTX::instance()->options_save) + (CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str()); + if(CTX::instance()->optionsSave) Print_Options(0, GMSH_OPTIONSRC, 1, 0, - (CTX::instance()->home_dir + CTX::instance()->options_filename).c_str()); + (CTX::instance()->homeDir + CTX::instance()->optionsFileName).c_str()); } #endif @@ -126,10 +126,10 @@ void Msg::Fatal(const char *fmt, ...) GUI::instance()->messages->add(tmp.c_str()); GUI::instance()->messages->show(); GUI::instance()->messages->save - ((CTX::instance()->home_dir + CTX::instance()->error_filename).c_str()); + ((CTX::instance()->homeDir + CTX::instance()->errorFileName).c_str()); fl_alert("A fatal error has occurred which will force Gmsh to abort.\n" "The error messages have been saved in the following file:\n\n%s", - (CTX::instance()->home_dir + CTX::instance()->error_filename).c_str()); + (CTX::instance()->homeDir + CTX::instance()->errorFileName).c_str()); } #endif @@ -442,7 +442,7 @@ double Msg::GetValue(const char *text, double defaultval) { // if a callback is given let's assume we don't want to be bothered // with interactive stuff - if(CTX::instance()->nopopup || _callback) return defaultval; + if(CTX::instance()->noPopup || _callback) return defaultval; #if defined(HAVE_FLTK) if(GUI::available()){ @@ -470,7 +470,7 @@ bool Msg::GetBinaryAnswer(const char *question, const char *yes, { // if a callback is given let's assume we don't want to be bothered // with interactive stuff - if(CTX::instance()->nopopup || _callback) return defaultval; + if(CTX::instance()->noPopup || _callback) return defaultval; #if defined(HAVE_FLTK) if(GUI::available()){ diff --git a/Common/Main.cpp b/Common/Main.cpp index 482b6b1c987a5cac6523bf3fecb26e4b88d7806e..9ecfdacd88f77bf1014b107aefaf0d71d1f4f69b 100644 --- a/Common/Main.cpp +++ b/Common/Main.cpp @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) new GModel(); GmshInitialize(argc, argv); - CTX::instance()->terminal = CTX::instance()->nopopup = 1; + CTX::instance()->terminal = CTX::instance()->noPopup = 1; GmshBatch(); GmshFinalize(); diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 98e9ab191d98ce5f7b1a408f89cd7484a3f84ea8..64cf58a92e2259abefa0c5e9bad78c8489028c58 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -85,7 +85,7 @@ void SetBoundingBox(double xmin, double xmax, void SetBoundingBox() { - if(CTX::instance()->forced_bbox) return; + if(CTX::instance()->forcedBBox) return; SBoundingBox3d bb = GModel::current()->bounds(); @@ -199,12 +199,12 @@ void ParseString(std::string str) { if(str.empty()) return; FILE *fp; - if((fp = fopen((CTX::instance()->home_dir + - CTX::instance()->tmp_filename).c_str(), "w"))) { + if((fp = fopen((CTX::instance()->homeDir + + CTX::instance()->tmpFileName).c_str(), "w"))) { fprintf(fp, str.c_str()); fprintf(fp, "\n"); fclose(fp); - ParseFile((CTX::instance()->home_dir + CTX::instance()->tmp_filename).c_str(), true); + ParseFile((CTX::instance()->homeDir + CTX::instance()->tmpFileName).c_str(), true); GModel::current()->importGEOInternals(); } } @@ -288,7 +288,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) status = GModel::current()->readUNV(fileName); } else if(!strcmp(ext, ".vtk") || !strcmp(ext, ".VTK")){ - status = GModel::current()->readVTK(fileName, CTX::instance()->big_endian); + status = GModel::current()->readVTK(fileName, CTX::instance()->bigEndian); } else if(!strcmp(ext, ".wrl") || !strcmp(ext, ".WRL") || !strcmp(ext, ".vrml") || !strcmp(ext, ".VRML") || @@ -386,7 +386,7 @@ void ClearProject() for(int i = GModel::list.size() - 1; i >= 0; i--) delete GModel::list[i]; new GModel(); - SetProjectName(CTX::instance()->default_filename); + SetProjectName(CTX::instance()->defaultFileName); #if defined(HAVE_FLTK) if(GUI::available()){ GUI::instance()->setGraphicTitle(GModel::current()->getFileName()); @@ -400,11 +400,11 @@ void ClearProject() void OpenProject(std::string fileName) { - if(CTX::instance()->threads_lock) { + if(CTX::instance()->lock) { Msg::Info("I'm busy! Ask me that later..."); return; } - CTX::instance()->threads_lock = 1; + CTX::instance()->lock = 1; if(GModel::current()->empty()){ // if the current model is empty, make sure it's reaaally @@ -437,7 +437,7 @@ void OpenProject(std::string fileName) if(!StatFile(fileName + ".opt")) MergeFile(fileName + ".opt"); - CTX::instance()->threads_lock = 0; + CTX::instance()->lock = 0; #if defined(HAVE_FLTK) if(GUI::available()){ diff --git a/Common/Options.cpp b/Common/Options.cpp index 73e8a2b42a441441da82f901509f2d8f5031c2f5..1cb11ae16467a3a21e930228836a53c32df2a327 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -289,10 +289,10 @@ int Get_ColorForString(StringX4Int SX4I[], int alpha, i++; *FlagError = !SX4I[i].str ? 1 : 0; if(alpha > 0) - return CTX::instance()->pack_color + return CTX::instance()->packColor (SX4I[i].int1, SX4I[i].int2, SX4I[i].int3, alpha); else - return CTX::instance()->pack_color + return CTX::instance()->packColor (SX4I[i].int1, SX4I[i].int2, SX4I[i].int3, SX4I[i].int4); } @@ -300,24 +300,24 @@ static void Set_DefaultColorOptions(int num, StringXColor s[]) { int i = 0; // Warning: this assumes that CTX::instance()->color_scheme is set... - switch (CTX::instance()->color_scheme) { + switch (CTX::instance()->colorScheme) { case 1: while(s[i].str) { - s[i].function(num, GMSH_SET, CTX::instance()->pack_color + s[i].function(num, GMSH_SET, CTX::instance()->packColor (s[i].def2[0], s[i].def2[1], s[i].def2[2], s[i].def2[3])); i++; } break; case 2: while(s[i].str) { - s[i].function(num, GMSH_SET, CTX::instance()->pack_color + s[i].function(num, GMSH_SET, CTX::instance()->packColor (s[i].def3[0], s[i].def3[1], s[i].def3[2], s[i].def3[3])); i++; } break; default: while(s[i].str) { - s[i].function(num, GMSH_SET, CTX::instance()->pack_color + s[i].function(num, GMSH_SET, CTX::instance()->packColor (s[i].def1[0], s[i].def1[1], s[i].def1[2], s[i].def1[3])); i++; } @@ -342,26 +342,26 @@ static void Print_ColorOptions(int num, int level, int diff, int help, while(s[i].str) { if(s[i].level & level) { unsigned int def; - switch (CTX::instance()->color_scheme) { + switch (CTX::instance()->colorScheme) { case 1: - def = CTX::instance()->pack_color + def = CTX::instance()->packColor (s[i].def2[0], s[i].def2[1], s[i].def2[2], s[i].def2[3]); break; case 2: - def = CTX::instance()->pack_color + def = CTX::instance()->packColor (s[i].def3[0], s[i].def3[1], s[i].def3[2], s[i].def3[3]); break; default: - def = CTX::instance()->pack_color + def = CTX::instance()->packColor (s[i].def1[0], s[i].def1[1], s[i].def1[2], s[i].def1[3]); break; } if(!diff || (s[i].function(num, GMSH_GET, 0) != def)){ sprintf(tmp, "%sColor.%s = {%d,%d,%d};%s%s", prefix, s[i].str, - CTX::instance()->unpack_red(s[i].function(num, GMSH_GET, 0)), - CTX::instance()->unpack_green(s[i].function(num, GMSH_GET, 0)), - CTX::instance()->unpack_blue(s[i].function(num, GMSH_GET, 0)), + CTX::instance()->unpackRed(s[i].function(num, GMSH_GET, 0)), + CTX::instance()->unpackGreen(s[i].function(num, GMSH_GET, 0)), + CTX::instance()->unpackBlue(s[i].function(num, GMSH_GET, 0)), help ? " // " : "", help ? s[i].help : ""); if(file) fprintf(file, "%s\n", tmp); @@ -380,9 +380,9 @@ static void Print_ColorOptionsDoc(StringXColor s[], const char *prefix, FILE * f fprintf(file, "@item %sColor.%s\n", prefix, s[i].str); fprintf(file, "%s@*\n", s[i].help); fprintf(file, "Default value: @code{@{%d,%d,%d@}}@*\n", - CTX::instance()->unpack_red(s[i].function(0, GMSH_GET, 0)), - CTX::instance()->unpack_green(s[i].function(0, GMSH_GET, 0)), - CTX::instance()->unpack_blue(s[i].function(0, GMSH_GET, 0))); + CTX::instance()->unpackRed(s[i].function(0, GMSH_GET, 0)), + CTX::instance()->unpackGreen(s[i].function(0, GMSH_GET, 0)), + CTX::instance()->unpackBlue(s[i].function(0, GMSH_GET, 0))); fprintf(file, "Saved in: @code{%s}\n\n", Get_OptionSaveLevel(s[i].level)); i++; } @@ -390,7 +390,7 @@ static void Print_ColorOptionsDoc(StringXColor s[], const char *prefix, FILE * f // General routines -void Init_Options_Safe(int num) +void Init_Options(int num) { // Default string options Set_DefaultStringOptions(num, GeneralOptions_String); @@ -420,58 +420,13 @@ void Init_Options_Safe(int num) Set_DefaultColorOptions(num, PrintOptions_Color); } -static const char *gmsh_getenv(const char *var) -{ -#if !defined(WIN32) - return getenv(var); -#else - const char *tmp = getenv(var); - // Don't accept top dir or anything partially expanded like - // c:\Documents and Settings\%USERPROFILE%, etc. - if(!tmp || !strcmp(tmp, "/") || strstr(tmp, "%") || strstr(tmp, "$")) - return 0; - else - return tmp; -#endif -} - -void Init_Options(int num) -{ - // Is machine big- or little-endian? - short int word = 0x0001; - char *byte = (char *) &word; - CTX::instance()->big_endian = (byte[0] ? 0 : 1); - - // Home directory - const char *tmp; - if((tmp = gmsh_getenv("GMSH_HOME"))) - CTX::instance()->home_dir = tmp; - else if((tmp = gmsh_getenv("HOME"))) - CTX::instance()->home_dir = tmp; - else if((tmp = gmsh_getenv("TMP"))) - CTX::instance()->home_dir = tmp; - else if((tmp = gmsh_getenv("TEMP"))) - CTX::instance()->home_dir = tmp; - else - CTX::instance()->home_dir = ""; - - // By defaults, no stat report - CTX::instance()->create_append_statreport = 0; - - int len = CTX::instance()->home_dir.size(); - if(len && CTX::instance()->home_dir[len - 1] != '/') - CTX::instance()->home_dir += "/"; - - Init_Options_Safe(num); -} - void ReInit_Options(int num) { // horrible trick so that opt_view_XXX will act on the reference view #if !defined(HAVE_NO_POST) std::vector<PView*> tmp = PView::list; PView::list.clear(); - Init_Options_Safe(num); + Init_Options(num); PView::list = tmp; for(unsigned int i = 0; i < PView::list.size(); i++) PView::list[i]->setOptions(); @@ -530,7 +485,7 @@ GmshColorTable *Get_ColorTable(int num) // assume that if we access the colortable we will change it PView::list[num]->setChanged(true); } - return &opt->CT; + return &opt->colorTable; #else return 0; #endif @@ -549,13 +504,13 @@ static void Print_ColorTable(int num, int diff, const char *prefix, FILE *file) // compare the current colormap with a vanilla colormap having the // parameters GmshColorTable ref; - ColorTable_InitParam(opt->CT.ipar[COLORTABLE_NUMBER], &ref); + ColorTable_InitParam(opt->colorTable.ipar[COLORTABLE_NUMBER], &ref); for(int i = 0; i < COLORTABLE_NBMAX_PARAM; i++){ - ref.ipar[i] = opt->CT.ipar[i]; - ref.dpar[i] = opt->CT.dpar[i]; + ref.ipar[i] = opt->colorTable.ipar[i]; + ref.dpar[i] = opt->colorTable.dpar[i]; } ColorTable_Recompute(&ref); - if(!ColorTable_Diff(&ref, &opt->CT)) + if(!ColorTable_Diff(&ref, &opt->colorTable)) return; } @@ -565,7 +520,7 @@ static void Print_ColorTable(int num, int diff, const char *prefix, FILE *file) fprintf(file, "%s\n", tmp); else Msg::Direct(tmp); - ColorTable_Print(&opt->CT, file); + ColorTable_Print(&opt->colorTable, file); sprintf(tmp, "};"); if(file) fprintf(file, "%s\n", tmp); @@ -900,73 +855,73 @@ void Print_OptionsDoc() std::string opt_general_axes_label0(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_label[0] = val; + CTX::instance()->axesLabel[0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[6]->value - (CTX::instance()->axes_label[0].c_str()); + (CTX::instance()->axesLabel[0].c_str()); #endif - return CTX::instance()->axes_label[0]; + return CTX::instance()->axesLabel[0]; } std::string opt_general_axes_label1(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_label[1] = val; + CTX::instance()->axesLabel[1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[7]->value - (CTX::instance()->axes_label[1].c_str()); + (CTX::instance()->axesLabel[1].c_str()); #endif - return CTX::instance()->axes_label[1]; + return CTX::instance()->axesLabel[1]; } std::string opt_general_axes_label2(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_label[2] = val; + CTX::instance()->axesLabel[2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[8]->value - (CTX::instance()->axes_label[2].c_str()); + (CTX::instance()->axesLabel[2].c_str()); #endif - return CTX::instance()->axes_label[2]; + return CTX::instance()->axesLabel[2]; } std::string opt_general_axes_format0(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_format[0] = val; + CTX::instance()->axesFormat[0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[3]->value - (CTX::instance()->axes_format[0].c_str()); + (CTX::instance()->axesFormat[0].c_str()); #endif - return CTX::instance()->axes_format[0]; + return CTX::instance()->axesFormat[0]; } std::string opt_general_axes_format1(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_format[1] = val; + CTX::instance()->axesFormat[1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[4]->value - (CTX::instance()->axes_format[1].c_str()); + (CTX::instance()->axesFormat[1].c_str()); #endif - return CTX::instance()->axes_format[1]; + return CTX::instance()->axesFormat[1]; } std::string opt_general_axes_format2(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->axes_format[2] = val; + CTX::instance()->axesFormat[2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[5]->value - (CTX::instance()->axes_format[2].c_str()); + (CTX::instance()->axesFormat[2].c_str()); #endif - return CTX::instance()->axes_format[2]; + return CTX::instance()->axesFormat[2]; } std::string opt_general_display(OPT_ARGS_STR) @@ -984,41 +939,41 @@ std::string opt_general_filename(OPT_ARGS_STR) std::string opt_general_default_filename(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->default_filename = val; + CTX::instance()->defaultFileName = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[0]->value - (CTX::instance()->default_filename.c_str()); + (CTX::instance()->defaultFileName.c_str()); #endif - return CTX::instance()->default_filename; + return CTX::instance()->defaultFileName; } std::string opt_general_tmp_filename(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->tmp_filename = val; - return CTX::instance()->tmp_filename; + CTX::instance()->tmpFileName = val; + return CTX::instance()->tmpFileName; } std::string opt_general_error_filename(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->error_filename = val; - return CTX::instance()->error_filename; + CTX::instance()->errorFileName = val; + return CTX::instance()->errorFileName; } std::string opt_general_session_filename(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->session_filename = val; - return CTX::instance()->session_filename; + CTX::instance()->sessionFileName = val; + return CTX::instance()->sessionFileName; } std::string opt_general_options_filename(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->options_filename = val; - return CTX::instance()->options_filename; + CTX::instance()->optionsFileName = val; + return CTX::instance()->optionsFileName; } std::string opt_general_editor(OPT_ARGS_STR) @@ -1036,49 +991,49 @@ std::string opt_general_editor(OPT_ARGS_STR) std::string opt_general_web_browser(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->web_browser = val; + CTX::instance()->webBrowser = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.input[2]->value - (CTX::instance()->web_browser.c_str()); + (CTX::instance()->webBrowser.c_str()); #endif - return CTX::instance()->web_browser; + return CTX::instance()->webBrowser; } std::string opt_general_gui_theme(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->gui_theme = val; - return CTX::instance()->gui_theme; + CTX::instance()->guiTheme = val; + return CTX::instance()->guiTheme; } std::string opt_general_graphics_font(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->gl_font = val; + CTX::instance()->glFont = val; #if defined(HAVE_FLTK) - int index = GetFontIndex(CTX::instance()->gl_font.c_str()); + int index = GetFontIndex(CTX::instance()->glFont.c_str()); if(action & GMSH_SET){ - CTX::instance()->gl_font = GetFontName(index); - CTX::instance()->gl_font_enum = GetFontEnum(index); + CTX::instance()->glFont = GetFontName(index); + CTX::instance()->glFontEnum = GetFontEnum(index); } if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.choice[1]->value(index); } #endif - return CTX::instance()->gl_font; + return CTX::instance()->glFont; } std::string opt_solver_socket_name(OPT_ARGS_STR) { if(action & GMSH_SET) - CTX::instance()->solver.socket_name = val; + CTX::instance()->solver.socketName = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->solver.input[0]->value - (CTX::instance()->solver.socket_name.c_str()); + (CTX::instance()->solver.socketName.c_str()); #endif - return CTX::instance()->solver.socket_name; + return CTX::instance()->solver.socketName; } std::string opt_solver_name(OPT_ARGS_STR) @@ -1992,13 +1947,13 @@ std::string opt_view_format(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->Format = val; + opt->format = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[1]->value(opt->Format.c_str()); + GUI::instance()->options->view.input[1]->value(opt->format.c_str()); #endif - return opt->Format; + return opt->format; #else return ""; #endif @@ -2020,13 +1975,13 @@ std::string opt_view_axes_label0(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesLabel[0] = val; + opt->axesLabel[0] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[10]->value(opt->AxesLabel[0].c_str()); + GUI::instance()->options->view.input[10]->value(opt->axesLabel[0].c_str()); #endif - return opt->AxesLabel[0]; + return opt->axesLabel[0]; #else return ""; #endif @@ -2037,13 +1992,13 @@ std::string opt_view_axes_label1(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesLabel[1] = val; + opt->axesLabel[1] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[11]->value(opt->AxesLabel[1].c_str()); + GUI::instance()->options->view.input[11]->value(opt->axesLabel[1].c_str()); #endif - return opt->AxesLabel[1]; + return opt->axesLabel[1]; #else return ""; #endif @@ -2054,13 +2009,13 @@ std::string opt_view_axes_label2(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesLabel[2] = val; + opt->axesLabel[2] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[12]->value(opt->AxesLabel[2].c_str()); + GUI::instance()->options->view.input[12]->value(opt->axesLabel[2].c_str()); #endif - return opt->AxesLabel[2]; + return opt->axesLabel[2]; #else return ""; #endif @@ -2071,13 +2026,13 @@ std::string opt_view_axes_format0(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesFormat[0] = val; + opt->axesFormat[0] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[7]->value(opt->AxesFormat[0].c_str()); + GUI::instance()->options->view.input[7]->value(opt->axesFormat[0].c_str()); #endif - return opt->AxesFormat[0]; + return opt->axesFormat[0]; #else return ""; #endif @@ -2088,13 +2043,13 @@ std::string opt_view_axes_format1(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesFormat[1] = val; + opt->axesFormat[1] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[8]->value(opt->AxesFormat[1].c_str()); + GUI::instance()->options->view.input[8]->value(opt->axesFormat[1].c_str()); #endif - return opt->AxesFormat[1]; + return opt->axesFormat[1]; #else return ""; #endif @@ -2105,13 +2060,13 @@ std::string opt_view_axes_format2(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->AxesFormat[2] = val; + opt->axesFormat[2] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[9]->value(opt->AxesFormat[2].c_str()); + GUI::instance()->options->view.input[9]->value(opt->axesFormat[2].c_str()); #endif - return opt->AxesFormat[2]; + return opt->axesFormat[2]; #else return ""; #endif @@ -2122,14 +2077,14 @@ std::string opt_view_gen_raise0(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->GenRaiseX = val; + opt->genRaiseX = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[4]->value(opt->GenRaiseX.c_str()); + GUI::instance()->options->view.input[4]->value(opt->genRaiseX.c_str()); #endif - return opt->GenRaiseX; + return opt->genRaiseX; #else return ""; #endif @@ -2140,14 +2095,14 @@ std::string opt_view_gen_raise1(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->GenRaiseY = val; + opt->genRaiseY = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[5]->value(opt->GenRaiseY.c_str()); + GUI::instance()->options->view.input[5]->value(opt->genRaiseY.c_str()); #endif - return opt->GenRaiseY; + return opt->genRaiseY; #else return ""; #endif @@ -2158,14 +2113,14 @@ std::string opt_view_gen_raise2(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->GenRaiseZ = val; + opt->genRaiseZ = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.input[6]->value(opt->GenRaiseZ.c_str()); + GUI::instance()->options->view.input[6]->value(opt->genRaiseZ.c_str()); #endif - return opt->GenRaiseZ; + return opt->genRaiseZ; #else return ""; #endif @@ -2212,10 +2167,10 @@ std::string opt_view_stipple0(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[0] = val; - _string2stipple(opt->StippleString[0], opt->Stipple[0][0], opt->Stipple[0][1]); + opt->stippleString[0] = val; + _string2stipple(opt->stippleString[0], opt->stipple[0][0], opt->stipple[0][1]); } - return opt->StippleString[0]; + return opt->stippleString[0]; #else return ""; #endif @@ -2226,10 +2181,10 @@ std::string opt_view_stipple1(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[1] = val; - _string2stipple(opt->StippleString[1], opt->Stipple[1][0], opt->Stipple[1][1]); + opt->stippleString[1] = val; + _string2stipple(opt->stippleString[1], opt->stipple[1][0], opt->stipple[1][1]); } - return opt->StippleString[1]; + return opt->stippleString[1]; #else return ""; #endif @@ -2240,10 +2195,10 @@ std::string opt_view_stipple2(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[2] = val; - _string2stipple(opt->StippleString[2], opt->Stipple[2][0], opt->Stipple[2][1]); + opt->stippleString[2] = val; + _string2stipple(opt->stippleString[2], opt->stipple[2][0], opt->stipple[2][1]); } - return opt->StippleString[2]; + return opt->stippleString[2]; #else return ""; #endif @@ -2254,10 +2209,10 @@ std::string opt_view_stipple3(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[3] = val; - _string2stipple(opt->StippleString[3], opt->Stipple[3][0], opt->Stipple[3][1]); + opt->stippleString[3] = val; + _string2stipple(opt->stippleString[3], opt->stipple[3][0], opt->stipple[3][1]); } - return opt->StippleString[3]; + return opt->stippleString[3]; #else return ""; #endif @@ -2268,10 +2223,10 @@ std::string opt_view_stipple4(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[4] = val; - _string2stipple(opt->StippleString[4], opt->Stipple[4][0], opt->Stipple[4][1]); + opt->stippleString[4] = val; + _string2stipple(opt->stippleString[4], opt->stipple[4][0], opt->stipple[4][1]); } - return opt->StippleString[4]; + return opt->stippleString[4]; #else return ""; #endif @@ -2282,10 +2237,10 @@ std::string opt_view_stipple5(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[5] = val; - _string2stipple(opt->StippleString[5], opt->Stipple[5][0], opt->Stipple[5][1]); + opt->stippleString[5] = val; + _string2stipple(opt->stippleString[5], opt->stipple[5][0], opt->stipple[5][1]); } - return opt->StippleString[5]; + return opt->stippleString[5]; #else return ""; #endif @@ -2296,10 +2251,10 @@ std::string opt_view_stipple6(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[6] = val; - _string2stipple(opt->StippleString[6], opt->Stipple[6][0], opt->Stipple[6][1]); + opt->stippleString[6] = val; + _string2stipple(opt->stippleString[6], opt->stipple[6][0], opt->stipple[6][1]); } - return opt->StippleString[6]; + return opt->stippleString[6]; #else return ""; #endif @@ -2310,10 +2265,10 @@ std::string opt_view_stipple7(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[7] = val; - _string2stipple(opt->StippleString[7], opt->Stipple[7][0], opt->Stipple[7][1]); + opt->stippleString[7] = val; + _string2stipple(opt->stippleString[7], opt->stipple[7][0], opt->stipple[7][1]); } - return opt->StippleString[7]; + return opt->stippleString[7]; #else return ""; #endif @@ -2324,10 +2279,10 @@ std::string opt_view_stipple8(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[8] = val; - _string2stipple(opt->StippleString[8], opt->Stipple[8][0], opt->Stipple[8][1]); + opt->stippleString[8] = val; + _string2stipple(opt->stippleString[8], opt->stipple[8][0], opt->stipple[8][1]); } - return opt->StippleString[8]; + return opt->stippleString[8]; #else return ""; #endif @@ -2338,10 +2293,10 @@ std::string opt_view_stipple9(OPT_ARGS_STR) #if !defined(HAVE_NO_POST) GET_VIEW(""); if(action & GMSH_SET) { - opt->StippleString[9] = val; - _string2stipple(opt->StippleString[9], opt->Stipple[9][0], opt->Stipple[9][1]); + opt->stippleString[9] = val; + _string2stipple(opt->stippleString[9], opt->stipple[9][0], opt->stipple[9][1]); } - return opt->StippleString[9]; + return opt->stippleString[9]; #else return ""; #endif @@ -2352,377 +2307,377 @@ std::string opt_view_stipple9(OPT_ARGS_STR) double opt_general_initial_context(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->initial_context = (int)val; - return CTX::instance()->initial_context; + CTX::instance()->initialContext = (int)val; + return CTX::instance()->initialContext; } double opt_general_fontsize(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->fontsize = (int)val; - return CTX::instance()->fontsize; + CTX::instance()->fontSize = (int)val; + return CTX::instance()->fontSize; } double opt_general_graphics_fontsize(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->gl_fontsize = (int)val; + CTX::instance()->glFontSize = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[12]->value - (CTX::instance()->gl_fontsize); + (CTX::instance()->glFontSize); #endif - return CTX::instance()->gl_fontsize; + return CTX::instance()->glFontSize; } double opt_general_polygon_offset_always(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->polygon_offset_always = (int)val; + CTX::instance()->polygonOffsetAlways = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[4]->value - (CTX::instance()->polygon_offset_always); + (CTX::instance()->polygonOffsetAlways); #endif - return CTX::instance()->polygon_offset_always; + return CTX::instance()->polygonOffsetAlways; } double opt_general_polygon_offset_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->polygon_offset_factor = val; + CTX::instance()->polygonOffsetFactor = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[15]->value - (CTX::instance()->polygon_offset_factor); + (CTX::instance()->polygonOffsetFactor); #endif - return CTX::instance()->polygon_offset_factor; + return CTX::instance()->polygonOffsetFactor; } double opt_general_polygon_offset_units(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->polygon_offset_units = val; + CTX::instance()->polygonOffsetUnits = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[16]->value - (CTX::instance()->polygon_offset_units); + (CTX::instance()->polygonOffsetUnits); #endif - return CTX::instance()->polygon_offset_units; + return CTX::instance()->polygonOffsetUnits; } double opt_general_graphics_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->gl_position[0] = (int)val; - return CTX::instance()->gl_position[0]; + CTX::instance()->glPosition[0] = (int)val; + return CTX::instance()->glPosition[0]; } double opt_general_graphics_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->gl_position[1] = (int)val; - return CTX::instance()->gl_position[1]; + CTX::instance()->glPosition[1] = (int)val; + return CTX::instance()->glPosition[1]; } double opt_general_graphics_size0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->gl_size[0] = (int)val; + CTX::instance()->glSize[0] = (int)val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) GUI::instance()->graph[0]->win->size - (CTX::instance()->gl_size[0], GUI::instance()->graph[0]->bottom->h() + - CTX::instance()->gl_size[1]); + (CTX::instance()->glSize[0], GUI::instance()->graph[0]->bottom->h() + + CTX::instance()->glSize[1]); } #endif - return CTX::instance()->gl_size[0]; + return CTX::instance()->glSize[0]; } double opt_general_graphics_size1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->gl_size[1] = (int)val; + CTX::instance()->glSize[1] = (int)val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) GUI::instance()->graph[0]->win->size - (CTX::instance()->gl_size[0], GUI::instance()->graph[0]->bottom->h() + - CTX::instance()->gl_size[1]); + (CTX::instance()->glSize[0], GUI::instance()->graph[0]->bottom->h() + + CTX::instance()->glSize[1]); } #endif - return CTX::instance()->gl_size[1]; + return CTX::instance()->glSize[1]; } double opt_general_menu_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->position[0] = (int)val; - return CTX::instance()->position[0]; + CTX::instance()->menuPosition[0] = (int)val; + return CTX::instance()->menuPosition[0]; } double opt_general_menu_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->position[1] = (int)val; - return CTX::instance()->position[1]; + CTX::instance()->menuPosition[1] = (int)val; + return CTX::instance()->menuPosition[1]; } double opt_general_solver_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->solver_position[0] = (int)val; - return CTX::instance()->solver_position[0]; + CTX::instance()->solverPosition[0] = (int)val; + return CTX::instance()->solverPosition[0]; } double opt_general_solver_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->solver_position[1] = (int)val; - return CTX::instance()->solver_position[1]; + CTX::instance()->solverPosition[1] = (int)val; + return CTX::instance()->solverPosition[1]; } double opt_general_context_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->ctx_position[0] = (int)val; - return CTX::instance()->ctx_position[0]; + CTX::instance()->ctxPosition[0] = (int)val; + return CTX::instance()->ctxPosition[0]; } double opt_general_context_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->ctx_position[1] = (int)val; - return CTX::instance()->ctx_position[1]; + CTX::instance()->ctxPosition[1] = (int)val; + return CTX::instance()->ctxPosition[1]; } double opt_general_file_chooser_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->file_chooser_position[0] = (int)val; - return CTX::instance()->file_chooser_position[0]; + CTX::instance()->fileChooserPosition[0] = (int)val; + return CTX::instance()->fileChooserPosition[0]; } double opt_general_file_chooser_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->file_chooser_position[1] = (int)val; - return CTX::instance()->file_chooser_position[1]; + CTX::instance()->fileChooserPosition[1] = (int)val; + return CTX::instance()->fileChooserPosition[1]; } double opt_general_system_menu_bar(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->system_menu_bar = (int)val; - return CTX::instance()->system_menu_bar; + CTX::instance()->systemMenuBar = (int)val; + return CTX::instance()->systemMenuBar; } double opt_general_message_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->msg_position[0] = (int)val; - return CTX::instance()->msg_position[0]; + CTX::instance()->msgPosition[0] = (int)val; + return CTX::instance()->msgPosition[0]; } double opt_general_message_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->msg_position[1] = (int)val; - return CTX::instance()->msg_position[1]; + CTX::instance()->msgPosition[1] = (int)val; + return CTX::instance()->msgPosition[1]; } double opt_general_message_size0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->msg_size[0] = (int)val; - return CTX::instance()->msg_size[0]; + CTX::instance()->msgSize[0] = (int)val; + return CTX::instance()->msgSize[0]; } double opt_general_message_size1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->msg_size[1] = (int)val; - return CTX::instance()->msg_size[1]; + CTX::instance()->msgSize[1] = (int)val; + return CTX::instance()->msgSize[1]; } double opt_general_message_auto_scroll(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->msg_auto_scroll = (int)val; + CTX::instance()->msgAutoScroll = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) - GUI::instance()->messages->butt->value(CTX::instance()->msg_auto_scroll); + GUI::instance()->messages->butt->value(CTX::instance()->msgAutoScroll); #endif - return CTX::instance()->msg_auto_scroll; + return CTX::instance()->msgAutoScroll; } double opt_general_option_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->opt_position[0] = (int)val; - return CTX::instance()->opt_position[0]; + CTX::instance()->optPosition[0] = (int)val; + return CTX::instance()->optPosition[0]; } double opt_general_option_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->opt_position[1] = (int)val; - return CTX::instance()->opt_position[1]; + CTX::instance()->optPosition[1] = (int)val; + return CTX::instance()->optPosition[1]; } double opt_general_plugin_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->plugin_position[0] = (int)val; - return CTX::instance()->plugin_position[0]; + CTX::instance()->pluginPosition[0] = (int)val; + return CTX::instance()->pluginPosition[0]; } double opt_general_plugin_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->plugin_position[1] = (int)val; - return CTX::instance()->plugin_position[1]; + CTX::instance()->pluginPosition[1] = (int)val; + return CTX::instance()->pluginPosition[1]; } double opt_general_plugin_size0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->plugin_size[0] = (int)val; - return CTX::instance()->plugin_size[0]; + CTX::instance()->pluginSize[0] = (int)val; + return CTX::instance()->pluginSize[0]; } double opt_general_plugin_size1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->plugin_size[1] = (int)val; - return CTX::instance()->plugin_size[1]; + CTX::instance()->pluginSize[1] = (int)val; + return CTX::instance()->pluginSize[1]; } double opt_general_field_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->field_position[0] = (int)val; - return CTX::instance()->field_position[0]; + CTX::instance()->fieldPosition[0] = (int)val; + return CTX::instance()->fieldPosition[0]; } double opt_general_field_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->field_position[1] = (int)val; - return CTX::instance()->field_position[1]; + CTX::instance()->fieldPosition[1] = (int)val; + return CTX::instance()->fieldPosition[1]; } double opt_general_field_size0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->field_size[0] = (int)val; - return CTX::instance()->field_size[0]; + CTX::instance()->fieldSize[0] = (int)val; + return CTX::instance()->fieldSize[0]; } double opt_general_field_size1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->field_size[1] = (int)val; - return CTX::instance()->field_size[1]; + CTX::instance()->fieldSize[1] = (int)val; + return CTX::instance()->fieldSize[1]; } double opt_general_statistics_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->stat_position[0] = (int)val; - return CTX::instance()->stat_position[0]; + CTX::instance()->statPosition[0] = (int)val; + return CTX::instance()->statPosition[0]; } double opt_general_statistics_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->stat_position[1] = (int)val; - return CTX::instance()->stat_position[1]; + CTX::instance()->statPosition[1] = (int)val; + return CTX::instance()->statPosition[1]; } double opt_general_visibility_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->vis_position[0] = (int)val; - return CTX::instance()->vis_position[0]; + CTX::instance()->visPosition[0] = (int)val; + return CTX::instance()->visPosition[0]; } double opt_general_visibility_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->vis_position[1] = (int)val; - return CTX::instance()->vis_position[1]; + CTX::instance()->visPosition[1] = (int)val; + return CTX::instance()->visPosition[1]; } double opt_general_clip_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_position[0] = (int)val; - return CTX::instance()->clip_position[0]; + CTX::instance()->clipPosition[0] = (int)val; + return CTX::instance()->clipPosition[0]; } double opt_general_clip_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_position[1] = (int)val; - return CTX::instance()->clip_position[1]; + CTX::instance()->clipPosition[1] = (int)val; + return CTX::instance()->clipPosition[1]; } double opt_general_manip_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->manip_position[0] = (int)val; - return CTX::instance()->manip_position[0]; + CTX::instance()->manipPosition[0] = (int)val; + return CTX::instance()->manipPosition[0]; } double opt_general_manip_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->manip_position[1] = (int)val; - return CTX::instance()->manip_position[1]; + CTX::instance()->manipPosition[1] = (int)val; + return CTX::instance()->manipPosition[1]; } double opt_general_session_save(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->session_save = (int)val; + CTX::instance()->sessionSave = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[8]->value - (CTX::instance()->session_save); + (CTX::instance()->sessionSave); #endif - return CTX::instance()->session_save; + return CTX::instance()->sessionSave; } double opt_general_options_save(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->options_save = (int)val; + CTX::instance()->optionsSave = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[9]->value - (CTX::instance()->options_save); + (CTX::instance()->optionsSave); #endif - return CTX::instance()->options_save; + return CTX::instance()->optionsSave; } double opt_general_confirm_overwrite(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->confirm_overwrite = (int)val; + CTX::instance()->confirmOverwrite = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[14]->value - (CTX::instance()->confirm_overwrite); + (CTX::instance()->confirmOverwrite); #endif - return CTX::instance()->confirm_overwrite; + return CTX::instance()->confirmOverwrite; } double opt_general_rotation0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_r[0] = val; + CTX::instance()->tmpRotation[0] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2730,13 +2685,13 @@ double opt_general_rotation0(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->r[0]; } #endif - return CTX::instance()->tmp_r[0]; + return CTX::instance()->tmpRotation[0]; } double opt_general_rotation1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_r[1] = val; + CTX::instance()->tmpRotation[1] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2744,13 +2699,13 @@ double opt_general_rotation1(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->r[1]; } #endif - return CTX::instance()->tmp_r[1]; + return CTX::instance()->tmpRotation[1]; } double opt_general_rotation2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_r[2] = val; + CTX::instance()->tmpRotation[2] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2758,49 +2713,49 @@ double opt_general_rotation2(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->r[2]; } #endif - return CTX::instance()->tmp_r[2]; + return CTX::instance()->tmpRotation[2]; } double opt_general_rotation_center0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->rotation_center[0] = val; + CTX::instance()->rotationCenter[0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[8]->value - (CTX::instance()->rotation_center[0]); + (CTX::instance()->rotationCenter[0]); #endif - return CTX::instance()->rotation_center[0]; + return CTX::instance()->rotationCenter[0]; } double opt_general_rotation_center1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->rotation_center[1] = val; + CTX::instance()->rotationCenter[1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[9]->value - (CTX::instance()->rotation_center[1]); + (CTX::instance()->rotationCenter[1]); #endif - return CTX::instance()->rotation_center[1]; + return CTX::instance()->rotationCenter[1]; } double opt_general_rotation_center2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->rotation_center[2] = val; + CTX::instance()->rotationCenter[2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[10]->value - (CTX::instance()->rotation_center[2]); + (CTX::instance()->rotationCenter[2]); #endif - return CTX::instance()->rotation_center[2]; + return CTX::instance()->rotationCenter[2]; } double opt_general_quaternion0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_quaternion[0] = val; + CTX::instance()->tmpQuaternion[0] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2810,13 +2765,13 @@ double opt_general_quaternion0(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->quaternion[0]; } #endif - return CTX::instance()->tmp_quaternion[0]; + return CTX::instance()->tmpQuaternion[0]; } double opt_general_quaternion1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_quaternion[1] = val; + CTX::instance()->tmpQuaternion[1] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2826,13 +2781,13 @@ double opt_general_quaternion1(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->quaternion[1]; } #endif - return CTX::instance()->tmp_quaternion[1]; + return CTX::instance()->tmpQuaternion[1]; } double opt_general_quaternion2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_quaternion[2] = val; + CTX::instance()->tmpQuaternion[2] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2842,13 +2797,13 @@ double opt_general_quaternion2(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->quaternion[2]; } #endif - return CTX::instance()->tmp_quaternion[2]; + return CTX::instance()->tmpQuaternion[2]; } double opt_general_quaternion3(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_quaternion[3] = val; + CTX::instance()->tmpQuaternion[3] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2858,13 +2813,13 @@ double opt_general_quaternion3(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->quaternion[3]; } #endif - return CTX::instance()->tmp_quaternion[3]; + return CTX::instance()->tmpQuaternion[3]; } double opt_general_translation0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_t[0] = val; + CTX::instance()->tmpTranslation[0] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2874,13 +2829,13 @@ double opt_general_translation0(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->t[0]; } #endif - return CTX::instance()->tmp_t[0]; + return CTX::instance()->tmpTranslation[0]; } double opt_general_translation1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_t[1] = val; + CTX::instance()->tmpTranslation[1] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2890,13 +2845,13 @@ double opt_general_translation1(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->t[1]; } #endif - return CTX::instance()->tmp_t[1]; + return CTX::instance()->tmpTranslation[1]; } double opt_general_translation2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_t[2] = val; + CTX::instance()->tmpTranslation[2] = val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2906,13 +2861,13 @@ double opt_general_translation2(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->t[2]; } #endif - return CTX::instance()->tmp_t[2]; + return CTX::instance()->tmpTranslation[2]; } double opt_general_scale0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_s[0] = val ? val : 1.0; + CTX::instance()->tmpScale[0] = val ? val : 1.0; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2922,13 +2877,13 @@ double opt_general_scale0(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->s[0]; } #endif - return CTX::instance()->tmp_s[0]; + return CTX::instance()->tmpScale[0]; } double opt_general_scale1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_s[1] = val ? val : 1.0; + CTX::instance()->tmpScale[1] = val ? val : 1.0; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2938,13 +2893,13 @@ double opt_general_scale1(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->s[1]; } #endif - return CTX::instance()->tmp_s[1]; + return CTX::instance()->tmpScale[1]; } double opt_general_scale2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->tmp_s[2] = val ? val : 1.0; + CTX::instance()->tmpScale[2] = val ? val : 1.0; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_SET) @@ -2954,7 +2909,7 @@ double opt_general_scale2(OPT_ARGS_NUM) return GUI::instance()->graph[0]->gl[0]->getDrawContext()->s[2]; } #endif - return CTX::instance()->tmp_s[2]; + return CTX::instance()->tmpScale[2]; } double opt_general_clip_factor(OPT_ARGS_NUM) @@ -2962,40 +2917,40 @@ double opt_general_clip_factor(OPT_ARGS_NUM) if(action & GMSH_SET){ // should NEVER be zero (or negative) if(val < 0.01) - CTX::instance()->clip_factor = 0.01; + CTX::instance()->clipFactor = 0.01; else - CTX::instance()->clip_factor = val; + CTX::instance()->clipFactor = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[14]->value - (CTX::instance()->clip_factor); + (CTX::instance()->clipFactor); #endif - return CTX::instance()->clip_factor; + return CTX::instance()->clipFactor; } double opt_general_point_size(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->point_size = val; + CTX::instance()->pointSize = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[6]->value - (CTX::instance()->point_size); + (CTX::instance()->pointSize); #endif - return CTX::instance()->point_size; + return CTX::instance()->pointSize; } double opt_general_line_width(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->line_width = val; + CTX::instance()->lineWidth = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[7]->value - (CTX::instance()->line_width); + (CTX::instance()->lineWidth); #endif - return CTX::instance()->line_width; + return CTX::instance()->lineWidth; } double opt_general_shine(OPT_ARGS_NUM) @@ -3013,13 +2968,13 @@ double opt_general_shine(OPT_ARGS_NUM) double opt_general_shine_exponent(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->shine_exponent = val; + CTX::instance()->shineExponent = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[0]->value - (CTX::instance()->shine_exponent); + (CTX::instance()->shineExponent); #endif - return CTX::instance()->shine_exponent; + return CTX::instance()->shineExponent; } double opt_general_verbosity(OPT_ARGS_NUM) @@ -3038,15 +2993,15 @@ double opt_general_verbosity(OPT_ARGS_NUM) double opt_general_nopopup(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->nopopup = (int)val; - return CTX::instance()->nopopup; + CTX::instance()->noPopup = (int)val; + return CTX::instance()->noPopup; } double opt_general_non_modal_windows(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->non_modal_windows = (int)val; - return CTX::instance()->non_modal_windows; + CTX::instance()->nonModalWindows = (int)val; + return CTX::instance()->nonModalWindows; } double opt_general_terminal(OPT_ARGS_NUM) @@ -3104,10 +3059,10 @@ double opt_general_orthographic(OPT_ARGS_NUM) double opt_general_mouse_selection(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mouse_selection = (int)val; + CTX::instance()->mouseSelection = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { - if(CTX::instance()->mouse_selection){ + if(CTX::instance()->mouseSelection){ if(GUI::available()) Msg::StatusBar(2, false, "Mouse selection ON"); for(unsigned int i = 0; i < GUI::instance()->graph.size(); i++) @@ -3123,45 +3078,45 @@ double opt_general_mouse_selection(OPT_ARGS_NUM) GUI::instance()->graph[i]->butt[9]->redraw(); } #endif - return CTX::instance()->mouse_selection; + return CTX::instance()->mouseSelection; } double opt_general_mouse_hover_meshes(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mouse_hover_meshes = (int)val; + CTX::instance()->mouseHoverMeshes = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[11]->value - (CTX::instance()->mouse_hover_meshes); + (CTX::instance()->mouseHoverMeshes); #endif - return CTX::instance()->mouse_hover_meshes; + return CTX::instance()->mouseHoverMeshes; } double opt_general_fast_redraw(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->fast_redraw = (int)val; + CTX::instance()->fastRedraw = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.butt[2]->value - (CTX::instance()->fast_redraw); + (CTX::instance()->fastRedraw); GUI::instance()->options->activate("fast_redraw"); } #endif - return CTX::instance()->fast_redraw; + return CTX::instance()->fastRedraw; } double opt_general_draw_bounding_box(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->draw_bbox = (int)val; + CTX::instance()->drawBBox = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[6]->value - (CTX::instance()->draw_bbox); + (CTX::instance()->drawBBox); #endif - return CTX::instance()->draw_bbox; + return CTX::instance()->drawBBox; } double opt_general_xmin(OPT_ARGS_NUM) @@ -3220,195 +3175,195 @@ double opt_general_axes(OPT_ARGS_NUM) double opt_general_axes_mikado(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->axes_mikado = (int)val; + CTX::instance()->axesMikado = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[16]->value - (CTX::instance()->axes_mikado); + (CTX::instance()->axesMikado); #endif - return CTX::instance()->axes_mikado; + return CTX::instance()->axesMikado; } double opt_general_axes_auto_position(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_auto_position = (int)val; + CTX::instance()->axesAutoPosition = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.butt[0]->value - (CTX::instance()->axes_auto_position); + (CTX::instance()->axesAutoPosition); GUI::instance()->options->activate("general_axes_auto"); } #endif - return CTX::instance()->axes_auto_position; + return CTX::instance()->axesAutoPosition; } double opt_general_axes_tics0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_tics[0] = (int)val; + CTX::instance()->axesTics[0] = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[17]->value - (CTX::instance()->axes_tics[0]); + (CTX::instance()->axesTics[0]); #endif - return CTX::instance()->axes_tics[0]; + return CTX::instance()->axesTics[0]; } double opt_general_axes_tics1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_tics[1] = (int)val; + CTX::instance()->axesTics[1] = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[18]->value - (CTX::instance()->axes_tics[1]); + (CTX::instance()->axesTics[1]); #endif - return CTX::instance()->axes_tics[1]; + return CTX::instance()->axesTics[1]; } double opt_general_axes_tics2(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_tics[2] = (int)val; + CTX::instance()->axesTics[2] = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[19]->value - (CTX::instance()->axes_tics[2]); + (CTX::instance()->axesTics[2]); #endif - return CTX::instance()->axes_tics[2]; + return CTX::instance()->axesTics[2]; } double opt_general_axes_xmin(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[0] = val; + CTX::instance()->axesPosition[0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[20]->value - (CTX::instance()->axes_position[0]); + (CTX::instance()->axesPosition[0]); #endif - return CTX::instance()->axes_position[0]; + return CTX::instance()->axesPosition[0]; } double opt_general_axes_xmax(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[1] = val; + CTX::instance()->axesPosition[1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[23]->value - (CTX::instance()->axes_position[1]); + (CTX::instance()->axesPosition[1]); #endif - return CTX::instance()->axes_position[1]; + return CTX::instance()->axesPosition[1]; } double opt_general_axes_ymin(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[2] = val; + CTX::instance()->axesPosition[2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[21]->value - (CTX::instance()->axes_position[2]); + (CTX::instance()->axesPosition[2]); #endif - return CTX::instance()->axes_position[2]; + return CTX::instance()->axesPosition[2]; } double opt_general_axes_ymax(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[3] = val; + CTX::instance()->axesPosition[3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[24]->value - (CTX::instance()->axes_position[3]); + (CTX::instance()->axesPosition[3]); #endif - return CTX::instance()->axes_position[3]; + return CTX::instance()->axesPosition[3]; } double opt_general_axes_zmin(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[4] = val; + CTX::instance()->axesPosition[4] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[22]->value - (CTX::instance()->axes_position[4]); + (CTX::instance()->axesPosition[4]); #endif - return CTX::instance()->axes_position[4]; + return CTX::instance()->axesPosition[4]; } double opt_general_axes_zmax(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->axes_position[5] = val; + CTX::instance()->axesPosition[5] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[25]->value - (CTX::instance()->axes_position[5]); + (CTX::instance()->axesPosition[5]); #endif - return CTX::instance()->axes_position[5]; + return CTX::instance()->axesPosition[5]; } double opt_general_small_axes(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->small_axes = (int)val; + CTX::instance()->smallAxes = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.butt[1]->value - (CTX::instance()->small_axes); + (CTX::instance()->smallAxes); GUI::instance()->options->activate("general_small_axes"); } #endif - return CTX::instance()->small_axes; + return CTX::instance()->smallAxes; } double opt_general_small_axes_position0(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->small_axes_pos[0] = (int)val; + CTX::instance()->smallAxesPos[0] = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[26]->value - (CTX::instance()->small_axes_pos[0]); + (CTX::instance()->smallAxesPos[0]); #endif - return CTX::instance()->small_axes_pos[0]; + return CTX::instance()->smallAxesPos[0]; } double opt_general_small_axes_position1(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->small_axes_pos[1] = (int)val; + CTX::instance()->smallAxesPos[1] = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[27]->value - (CTX::instance()->small_axes_pos[1]); + (CTX::instance()->smallAxesPos[1]); #endif - return CTX::instance()->small_axes_pos[1]; + return CTX::instance()->smallAxesPos[1]; } double opt_general_small_axes_size(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->small_axes_size = (int)val; - return CTX::instance()->small_axes_size; + CTX::instance()->smallAxesSize = (int)val; + return CTX::instance()->smallAxesSize; } double opt_general_quadric_subdivisions(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->quadric_subdivisions = (int)val; + CTX::instance()->quadricSubdivisions = (int)val; #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_GUI) GUI::instance()->options->general.value[11]->value - (CTX::instance()->quadric_subdivisions); + (CTX::instance()->quadricSubdivisions); } #endif - return CTX::instance()->quadric_subdivisions; + return CTX::instance()->quadricSubdivisions; } double opt_general_double_buffer(OPT_ARGS_NUM) @@ -3465,17 +3420,17 @@ double opt_general_alpha_blending(OPT_ARGS_NUM) double opt_general_vector_type(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->vector_type = (int)val; - if(CTX::instance()->vector_type < 1 || CTX::instance()->vector_type > 4) - CTX::instance()->vector_type = 1; + CTX::instance()->vectorType = (int)val; + if(CTX::instance()->vectorType < 1 || CTX::instance()->vectorType > 4) + CTX::instance()->vectorType = 1; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.choice[0]->value - (CTX::instance()->vector_type - 1); + (CTX::instance()->vectorType - 1); } #endif - return CTX::instance()->vector_type; + return CTX::instance()->vectorType; } double opt_general_arrow_head_radius(OPT_ARGS_NUM) @@ -3483,9 +3438,9 @@ double opt_general_arrow_head_radius(OPT_ARGS_NUM) if(action & GMSH_SET){ if(val < 0.) val = 0.; if(val > 1.) val = 1.; - CTX::instance()->arrow_rel_head_radius = val; + CTX::instance()->arrowRelHeadRadius = val; } - return CTX::instance()->arrow_rel_head_radius; + return CTX::instance()->arrowRelHeadRadius; } double opt_general_arrow_stem_length(OPT_ARGS_NUM) @@ -3493,9 +3448,9 @@ double opt_general_arrow_stem_length(OPT_ARGS_NUM) if(action & GMSH_SET){ if(val < 0.) val = 0.; if(val > 1.) val = 1.; - CTX::instance()->arrow_rel_stem_length = val; + CTX::instance()->arrowRelStemLength = val; } - return CTX::instance()->arrow_rel_stem_length; + return CTX::instance()->arrowRelStemLength; } double opt_general_arrow_stem_radius(OPT_ARGS_NUM) @@ -3503,17 +3458,17 @@ double opt_general_arrow_stem_radius(OPT_ARGS_NUM) if(action & GMSH_SET){ if(val < 0.) val = 0.; if(val > 1.) val = 1.; - CTX::instance()->arrow_rel_stem_radius = val; + CTX::instance()->arrowRelStemRadius = val; } - return CTX::instance()->arrow_rel_stem_radius; + return CTX::instance()->arrowRelStemRadius; } double opt_general_color_scheme(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->color_scheme = (int)val; - if(CTX::instance()->color_scheme > 2) - CTX::instance()->color_scheme = 0; + CTX::instance()->colorScheme = (int)val; + if(CTX::instance()->colorScheme > 2) + CTX::instance()->colorScheme = 0; Set_DefaultColorOptions(0, GeneralOptions_Color); Set_DefaultColorOptions(0, GeometryOptions_Color); Set_DefaultColorOptions(0, MeshOptions_Color); @@ -3547,24 +3502,24 @@ double opt_general_color_scheme(OPT_ARGS_NUM) #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.choice[3]->value - (CTX::instance()->color_scheme); + (CTX::instance()->colorScheme); #endif - return CTX::instance()->color_scheme; + return CTX::instance()->colorScheme; } double opt_general_background_gradient(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->bg_gradient = (int)val; - if(CTX::instance()->bg_gradient < 0 || CTX::instance()->bg_gradient > 3) - CTX::instance()->bg_gradient = 0; + CTX::instance()->bgGradient = (int)val; + if(CTX::instance()->bgGradient < 0 || CTX::instance()->bgGradient > 3) + CTX::instance()->bgGradient = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.choice[5]->value - (CTX::instance()->bg_gradient); + (CTX::instance()->bgGradient); #endif - return CTX::instance()->bg_gradient; + return CTX::instance()->bgGradient; } double opt_general_trackball(OPT_ARGS_NUM) @@ -3582,336 +3537,336 @@ double opt_general_trackball(OPT_ARGS_NUM) double opt_general_rotation_center_cg(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->rotation_center_cg = (int)val; + CTX::instance()->rotationCenterCg = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.butt[15]->value - (CTX::instance()->rotation_center_cg); + (CTX::instance()->rotationCenterCg); GUI::instance()->options->activate("rotation_center"); } #endif - return CTX::instance()->rotation_center_cg; + return CTX::instance()->rotationCenterCg; } double opt_general_zoom_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->zoom_factor = val; - return CTX::instance()->zoom_factor; + CTX::instance()->zoomFactor = val; + return CTX::instance()->zoomFactor; } double opt_general_expert_mode(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->expert_mode = (int)val; + CTX::instance()->expertMode = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.butt[10]->value - (CTX::instance()->expert_mode); + (CTX::instance()->expertMode); #endif - return CTX::instance()->expert_mode; + return CTX::instance()->expertMode; } double opt_general_clip0a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[0][0] = val; + CTX::instance()->clipPlane[0][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[0][0]; + return CTX::instance()->clipPlane[0][0]; } double opt_general_clip0b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[0][1] = val; + CTX::instance()->clipPlane[0][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[0][1]; + return CTX::instance()->clipPlane[0][1]; } double opt_general_clip0c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[0][2] = val; + CTX::instance()->clipPlane[0][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[0][2]; + return CTX::instance()->clipPlane[0][2]; } double opt_general_clip0d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[0][3] = val; + CTX::instance()->clipPlane[0][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[0][3]; + return CTX::instance()->clipPlane[0][3]; } double opt_general_clip1a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[1][0] = val; + CTX::instance()->clipPlane[1][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[1][0]; + return CTX::instance()->clipPlane[1][0]; } double opt_general_clip1b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[1][1] = val; + CTX::instance()->clipPlane[1][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[1][1]; + return CTX::instance()->clipPlane[1][1]; } double opt_general_clip1c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[1][2] = val; + CTX::instance()->clipPlane[1][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[1][2]; + return CTX::instance()->clipPlane[1][2]; } double opt_general_clip1d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[1][3] = val; + CTX::instance()->clipPlane[1][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[1][3]; + return CTX::instance()->clipPlane[1][3]; } double opt_general_clip2a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[2][0] = val; + CTX::instance()->clipPlane[2][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[2][0]; + return CTX::instance()->clipPlane[2][0]; } double opt_general_clip2b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[2][1] = val; + CTX::instance()->clipPlane[2][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[2][1]; + return CTX::instance()->clipPlane[2][1]; } double opt_general_clip2c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[2][2] = val; + CTX::instance()->clipPlane[2][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[2][2]; + return CTX::instance()->clipPlane[2][2]; } double opt_general_clip2d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[2][3] = val; + CTX::instance()->clipPlane[2][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[2][3]; + return CTX::instance()->clipPlane[2][3]; } double opt_general_clip3a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[3][0] = val; + CTX::instance()->clipPlane[3][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[3][0]; + return CTX::instance()->clipPlane[3][0]; } double opt_general_clip3b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[3][1] = val; + CTX::instance()->clipPlane[3][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[3][1]; + return CTX::instance()->clipPlane[3][1]; } double opt_general_clip3c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[3][2] = val; + CTX::instance()->clipPlane[3][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[3][2]; + return CTX::instance()->clipPlane[3][2]; } double opt_general_clip3d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[3][3] = val; + CTX::instance()->clipPlane[3][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[3][3]; + return CTX::instance()->clipPlane[3][3]; } double opt_general_clip4a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[4][0] = val; + CTX::instance()->clipPlane[4][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[4][0]; + return CTX::instance()->clipPlane[4][0]; } double opt_general_clip4b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[4][1] = val; + CTX::instance()->clipPlane[4][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[4][1]; + return CTX::instance()->clipPlane[4][1]; } double opt_general_clip4c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[4][2] = val; + CTX::instance()->clipPlane[4][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[4][2]; + return CTX::instance()->clipPlane[4][2]; } double opt_general_clip4d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[4][3] = val; + CTX::instance()->clipPlane[4][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[4][3]; + return CTX::instance()->clipPlane[4][3]; } double opt_general_clip5a(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[5][0] = val; + CTX::instance()->clipPlane[5][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[5][0]; + return CTX::instance()->clipPlane[5][0]; } double opt_general_clip5b(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[5][1] = val; + CTX::instance()->clipPlane[5][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[5][1]; + return CTX::instance()->clipPlane[5][1]; } double opt_general_clip5c(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[5][2] = val; + CTX::instance()->clipPlane[5][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[5][2]; + return CTX::instance()->clipPlane[5][2]; } double opt_general_clip5d(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_plane[5][3] = val; + CTX::instance()->clipPlane[5][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->resetBrowser(); #endif - return CTX::instance()->clip_plane[5][3]; + return CTX::instance()->clipPlane[5][3]; } double opt_general_clip_whole_elements(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_whole_elements = (int)val; + CTX::instance()->clipWholeElements = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->clipping->butt[0]->value - (CTX::instance()->clip_whole_elements); + (CTX::instance()->clipWholeElements); GUI::instance()->options->activate("clip_whole_elements"); } #endif - return CTX::instance()->clip_whole_elements; + return CTX::instance()->clipWholeElements; } double opt_general_clip_only_draw_intersecting_volume(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_only_draw_intersecting_volume = (int)val; + CTX::instance()->clipOnlyDrawIntersectingVolume = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->butt[1]->value - (CTX::instance()->clip_only_draw_intersecting_volume); + (CTX::instance()->clipOnlyDrawIntersectingVolume); #endif - return CTX::instance()->clip_only_draw_intersecting_volume; + return CTX::instance()->clipOnlyDrawIntersectingVolume; } double opt_general_clip_only_volume(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->clip_only_volume = (int)val; + CTX::instance()->clipOnlyVolume = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->clipping->butt[2]->value - (CTX::instance()->clip_only_volume); + (CTX::instance()->clipOnlyVolume); #endif - return CTX::instance()->clip_only_volume; + return CTX::instance()->clipOnlyVolume; } double opt_general_light0(OPT_ARGS_NUM) @@ -3924,64 +3879,64 @@ double opt_general_light0(OPT_ARGS_NUM) double opt_general_light00(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[0][0] = val; + CTX::instance()->lightPosition[0][0] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.value[2]->value - (CTX::instance()->light_position[0][0]); + (CTX::instance()->lightPosition[0][0]); GUI::instance()->options->general.sphere->setValue - (CTX::instance()->light_position[0][0], - CTX::instance()->light_position[0][1], - CTX::instance()->light_position[0][2]); + (CTX::instance()->lightPosition[0][0], + CTX::instance()->lightPosition[0][1], + CTX::instance()->lightPosition[0][2]); } #endif - return CTX::instance()->light_position[0][0]; + return CTX::instance()->lightPosition[0][0]; } double opt_general_light01(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[0][1] = val; + CTX::instance()->lightPosition[0][1] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.value[3]->value - (CTX::instance()->light_position[0][1]); + (CTX::instance()->lightPosition[0][1]); GUI::instance()->options->general.sphere->setValue - (CTX::instance()->light_position[0][0], - CTX::instance()->light_position[0][1], - CTX::instance()->light_position[0][2]); + (CTX::instance()->lightPosition[0][0], + CTX::instance()->lightPosition[0][1], + CTX::instance()->lightPosition[0][2]); } #endif - return CTX::instance()->light_position[0][1]; + return CTX::instance()->lightPosition[0][1]; } double opt_general_light02(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[0][2] = val; + CTX::instance()->lightPosition[0][2] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->general.value[4]->value - (CTX::instance()->light_position[0][2]); + (CTX::instance()->lightPosition[0][2]); GUI::instance()->options->general.sphere->setValue - (CTX::instance()->light_position[0][0], - CTX::instance()->light_position[0][1], - CTX::instance()->light_position[0][2]); + (CTX::instance()->lightPosition[0][0], + CTX::instance()->lightPosition[0][1], + CTX::instance()->lightPosition[0][2]); } #endif - return CTX::instance()->light_position[0][2]; + return CTX::instance()->lightPosition[0][2]; } double opt_general_light03(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[0][3] = val; + CTX::instance()->lightPosition[0][3] = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->general.value[13]->value - (CTX::instance()->light_position[0][3]); + (CTX::instance()->lightPosition[0][3]); #endif - return CTX::instance()->light_position[0][3]; + return CTX::instance()->lightPosition[0][3]; } double opt_general_light1(OPT_ARGS_NUM) @@ -3994,29 +3949,29 @@ double opt_general_light1(OPT_ARGS_NUM) double opt_general_light10(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[1][0] = val; - return CTX::instance()->light_position[1][0]; + CTX::instance()->lightPosition[1][0] = val; + return CTX::instance()->lightPosition[1][0]; } double opt_general_light11(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[1][1] = val; - return CTX::instance()->light_position[1][1]; + CTX::instance()->lightPosition[1][1] = val; + return CTX::instance()->lightPosition[1][1]; } double opt_general_light12(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[1][2] = val; - return CTX::instance()->light_position[1][2]; + CTX::instance()->lightPosition[1][2] = val; + return CTX::instance()->lightPosition[1][2]; } double opt_general_light13(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[1][3] = val; - return CTX::instance()->light_position[1][3]; + CTX::instance()->lightPosition[1][3] = val; + return CTX::instance()->lightPosition[1][3]; } double opt_general_light2(OPT_ARGS_NUM) @@ -4029,29 +3984,29 @@ double opt_general_light2(OPT_ARGS_NUM) double opt_general_light20(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[2][0] = val; - return CTX::instance()->light_position[2][0]; + CTX::instance()->lightPosition[2][0] = val; + return CTX::instance()->lightPosition[2][0]; } double opt_general_light21(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[2][1] = val; - return CTX::instance()->light_position[2][1]; + CTX::instance()->lightPosition[2][1] = val; + return CTX::instance()->lightPosition[2][1]; } double opt_general_light22(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[2][2] = val; - return CTX::instance()->light_position[2][2]; + CTX::instance()->lightPosition[2][2] = val; + return CTX::instance()->lightPosition[2][2]; } double opt_general_light23(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[2][3] = val; - return CTX::instance()->light_position[2][3]; + CTX::instance()->lightPosition[2][3] = val; + return CTX::instance()->lightPosition[2][3]; } double opt_general_light3(OPT_ARGS_NUM) @@ -4064,29 +4019,29 @@ double opt_general_light3(OPT_ARGS_NUM) double opt_general_light30(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[3][0] = val; - return CTX::instance()->light_position[3][0]; + CTX::instance()->lightPosition[3][0] = val; + return CTX::instance()->lightPosition[3][0]; } double opt_general_light31(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[3][1] = val; - return CTX::instance()->light_position[3][1]; + CTX::instance()->lightPosition[3][1] = val; + return CTX::instance()->lightPosition[3][1]; } double opt_general_light32(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[3][2] = val; - return CTX::instance()->light_position[3][2]; + CTX::instance()->lightPosition[3][2] = val; + return CTX::instance()->lightPosition[3][2]; } double opt_general_light33(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[3][3] = val; - return CTX::instance()->light_position[3][3]; + CTX::instance()->lightPosition[3][3] = val; + return CTX::instance()->lightPosition[3][3]; } double opt_general_light4(OPT_ARGS_NUM) @@ -4099,29 +4054,29 @@ double opt_general_light4(OPT_ARGS_NUM) double opt_general_light40(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[4][0] = val; - return CTX::instance()->light_position[4][0]; + CTX::instance()->lightPosition[4][0] = val; + return CTX::instance()->lightPosition[4][0]; } double opt_general_light41(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[4][1] = val; - return CTX::instance()->light_position[4][1]; + CTX::instance()->lightPosition[4][1] = val; + return CTX::instance()->lightPosition[4][1]; } double opt_general_light42(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[4][2] = val; - return CTX::instance()->light_position[4][2]; + CTX::instance()->lightPosition[4][2] = val; + return CTX::instance()->lightPosition[4][2]; } double opt_general_light43(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[4][3] = val; - return CTX::instance()->light_position[4][3]; + CTX::instance()->lightPosition[4][3] = val; + return CTX::instance()->lightPosition[4][3]; } double opt_general_light5(OPT_ARGS_NUM) @@ -4134,46 +4089,46 @@ double opt_general_light5(OPT_ARGS_NUM) double opt_general_light50(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[5][0] = val; - return CTX::instance()->light_position[5][0]; + CTX::instance()->lightPosition[5][0] = val; + return CTX::instance()->lightPosition[5][0]; } double opt_general_light51(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[5][1] = val; - return CTX::instance()->light_position[5][1]; + CTX::instance()->lightPosition[5][1] = val; + return CTX::instance()->lightPosition[5][1]; } double opt_general_light52(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[5][2] = val; - return CTX::instance()->light_position[5][2]; + CTX::instance()->lightPosition[5][2] = val; + return CTX::instance()->lightPosition[5][2]; } double opt_general_light53(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->light_position[5][3] = val; - return CTX::instance()->light_position[5][3]; + CTX::instance()->lightPosition[5][3] = val; + return CTX::instance()->lightPosition[5][3]; } double opt_geometry_transform(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->geom.use_transform = (int)val; - if(CTX::instance()->geom.use_transform < 0 || - CTX::instance()->geom.use_transform > 1) - CTX::instance()->geom.use_transform = 0; + CTX::instance()->geom.useTransform = (int)val; + if(CTX::instance()->geom.useTransform < 0 || + CTX::instance()->geom.useTransform > 1) + CTX::instance()->geom.useTransform = 0; } #if defined(HAVE_FLTK) if(GUI::available()){ if(action & GMSH_GUI) GUI::instance()->options->geo.choice[3]->value - (CTX::instance()->geom.use_transform); + (CTX::instance()->geom.useTransform); if(action & GMSH_SET){ - if(CTX::instance()->geom.use_transform == 1){ + if(CTX::instance()->geom.useTransform == 1){ drawTransform *tr = new drawTransformScaled (CTX::instance()->geom.transform, CTX::instance()->geom.offset); GUI::instance()->graph[0]->gl[0]->getDrawContext()->setTransform(tr); @@ -4188,7 +4143,7 @@ double opt_geometry_transform(OPT_ARGS_NUM) GUI::instance()->options->activate("geo_transform"); } #endif - return CTX::instance()->geom.use_transform; + return CTX::instance()->geom.useTransform; } static double _opt_geometry_transform(OPT_ARGS_NUM, int ii, int jj, int nn) @@ -4294,25 +4249,25 @@ double opt_geometry_offset2(OPT_ARGS_NUM) double opt_geometry_auto_coherence(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.auto_coherence = (int)val; + CTX::instance()->geom.autoCoherence = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[8]->value - (CTX::instance()->geom.auto_coherence); + (CTX::instance()->geom.autoCoherence); #endif - return CTX::instance()->geom.auto_coherence; + return CTX::instance()->geom.autoCoherence; } double opt_geometry_highlight_orphans(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.highlight_orphans = (int)val; + CTX::instance()->geom.highlightOrphans = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[10]->value - (CTX::instance()->geom.highlight_orphans); + (CTX::instance()->geom.highlightOrphans); #endif - return CTX::instance()->geom.highlight_orphans; + return CTX::instance()->geom.highlightOrphans; } double opt_geometry_tolerance(OPT_ARGS_NUM) @@ -4402,142 +4357,142 @@ double opt_geometry_volumes(OPT_ARGS_NUM) double opt_geometry_points_num(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.points_num = (int)val; + CTX::instance()->geom.pointsNum = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[4]->value - (CTX::instance()->geom.points_num); + (CTX::instance()->geom.pointsNum); #endif - return CTX::instance()->geom.points_num; + return CTX::instance()->geom.pointsNum; } double opt_geometry_lines_num(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.lines_num = (int)val; + CTX::instance()->geom.linesNum = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[5]->value - (CTX::instance()->geom.lines_num); + (CTX::instance()->geom.linesNum); #endif - return CTX::instance()->geom.lines_num; + return CTX::instance()->geom.linesNum; } double opt_geometry_surfaces_num(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.surfaces_num = (int)val; + CTX::instance()->geom.surfacesNum = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[6]->value - (CTX::instance()->geom.surfaces_num); + (CTX::instance()->geom.surfacesNum); #endif - return CTX::instance()->geom.surfaces_num; + return CTX::instance()->geom.surfacesNum; } double opt_geometry_volumes_num(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.volumes_num = (int)val; + CTX::instance()->geom.volumesNum = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[7]->value - (CTX::instance()->geom.volumes_num); + (CTX::instance()->geom.volumesNum); #endif - return CTX::instance()->geom.volumes_num; + return CTX::instance()->geom.volumesNum; } double opt_geometry_point_size(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.point_size = val; + CTX::instance()->geom.pointSize = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.value[3]->value - (CTX::instance()->geom.point_size); + (CTX::instance()->geom.pointSize); #endif - return CTX::instance()->geom.point_size; + return CTX::instance()->geom.pointSize; } double opt_geometry_point_sel_size(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.point_sel_size = val; + CTX::instance()->geom.selectedPointSize = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.value[5]->value - (CTX::instance()->geom.point_sel_size); + (CTX::instance()->geom.selectedPointSize); #endif - return CTX::instance()->geom.point_sel_size; + return CTX::instance()->geom.selectedPointSize; } double opt_geometry_point_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->geom.point_type = (int)val; + CTX::instance()->geom.pointType = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.choice[0]->value - (CTX::instance()->geom.point_type); + (CTX::instance()->geom.pointType); } #endif - return CTX::instance()->geom.point_type; + return CTX::instance()->geom.pointType; } double opt_geometry_line_width(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.line_width = val; + CTX::instance()->geom.lineWidth = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.value[4]->value - (CTX::instance()->geom.line_width); + (CTX::instance()->geom.lineWidth); #endif - return CTX::instance()->geom.line_width; + return CTX::instance()->geom.lineWidth; } double opt_geometry_line_sel_width(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.line_sel_width = val; + CTX::instance()->geom.selectedLineWidth = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.value[6]->value - (CTX::instance()->geom.line_sel_width); + (CTX::instance()->geom.selectedLineWidth); #endif - return CTX::instance()->geom.line_sel_width; + return CTX::instance()->geom.selectedLineWidth; } double opt_geometry_line_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->geom.line_type = (int)val; + CTX::instance()->geom.lineType = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.choice[1]->value - (CTX::instance()->geom.line_type); + (CTX::instance()->geom.lineType); } #endif - return CTX::instance()->geom.line_type; + return CTX::instance()->geom.lineType; } double opt_geometry_surface_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->geom.surface_type = (int)val; - if(CTX::instance()->geom.surface_type < 0 || - CTX::instance()->geom.surface_type > 2) - CTX::instance()->geom.surface_type = 0; + CTX::instance()->geom.surfaceType = (int)val; + if(CTX::instance()->geom.surfaceType < 0 || + CTX::instance()->geom.surfaceType > 2) + CTX::instance()->geom.surfaceType = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.choice[2]->value - (CTX::instance()->geom.surface_type); + (CTX::instance()->geom.surfaceType); } #endif - return CTX::instance()->geom.surface_type; + return CTX::instance()->geom.surfaceType; } double opt_geometry_light(OPT_ARGS_NUM) @@ -4556,94 +4511,94 @@ double opt_geometry_light(OPT_ARGS_NUM) double opt_geometry_light_two_side(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.light_two_side = (int)val; + CTX::instance()->geom.lightTwoSide = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->geo.butt[14]->value - (CTX::instance()->geom.light_two_side); + (CTX::instance()->geom.lightTwoSide); #endif - return CTX::instance()->geom.light_two_side; + return CTX::instance()->geom.lightTwoSide; } double opt_geometry_occ_fix_small_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.occ_fix_small_edges = val ? 1 : 0; + CTX::instance()->geom.occFixSmallEdges = val ? 1 : 0; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.butt[11]->value - (CTX::instance()->geom.occ_fix_small_edges); + (CTX::instance()->geom.occFixSmallEdges); } #endif - return CTX::instance()->geom.occ_fix_small_edges; + return CTX::instance()->geom.occFixSmallEdges; } double opt_geometry_occ_fix_small_faces(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.occ_fix_small_faces = val ? 1 : 0; + CTX::instance()->geom.occFixSmallFaces = val ? 1 : 0; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.butt[12]->value - (CTX::instance()->geom.occ_fix_small_faces); + (CTX::instance()->geom.occFixSmallFaces); } #endif - return CTX::instance()->geom.occ_fix_small_faces; + return CTX::instance()->geom.occFixSmallFaces; } double opt_geometry_occ_sew_faces(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.occ_sew_faces = val ? 1 : 0; + CTX::instance()->geom.occSewFaces = val ? 1 : 0; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->geo.butt[13]->value - (CTX::instance()->geom.occ_sew_faces); + (CTX::instance()->geom.occSewFaces); } #endif - return CTX::instance()->geom.occ_sew_faces; + return CTX::instance()->geom.occSewFaces; } double opt_geometry_old_circle(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.old_circle = (int)val; - return CTX::instance()->geom.old_circle; + CTX::instance()->geom.oldCircle = (int)val; + return CTX::instance()->geom.oldCircle; } double opt_geometry_old_newreg(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.old_newreg = (int)val; - return CTX::instance()->geom.old_newreg; + CTX::instance()->geom.oldNewreg = (int)val; + return CTX::instance()->geom.oldNewreg; } double opt_geometry_num_sub_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.num_sub_edges = (int)val; - return CTX::instance()->geom.num_sub_edges; + CTX::instance()->geom.numSubEdges = (int)val; + return CTX::instance()->geom.numSubEdges; } double opt_geometry_extrude_spline_points(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.extrude_spline_points = (int)val; - return CTX::instance()->geom.extrude_spline_points; + CTX::instance()->geom.extrudeSplinePoints = (int)val; + return CTX::instance()->geom.extrudeSplinePoints; } double opt_geometry_extrude_return_lateral(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.extrude_return_lateral = (int)val; - return CTX::instance()->geom.extrude_return_lateral; + CTX::instance()->geom.extrudeReturnLateral = (int)val; + return CTX::instance()->geom.extrudeReturnLateral; } double opt_geometry_scaling_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->geom.scaling_factor = (int)val; - return CTX::instance()->geom.scaling_factor; + CTX::instance()->geom.scalingFactor = (int)val; + return CTX::instance()->geom.scalingFactor; } double opt_geometry_snap0(OPT_ARGS_NUM) @@ -4708,20 +4663,20 @@ double opt_mesh_optimize(OPT_ARGS_NUM) double opt_mesh_optimize_netgen(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.optimize_netgen = (int)val; + CTX::instance()->mesh.optimizeNetgen = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[24]->value - (CTX::instance()->mesh.optimize_netgen); + (CTX::instance()->mesh.optimizeNetgen); #endif - return CTX::instance()->mesh.optimize_netgen; + return CTX::instance()->mesh.optimizeNetgen; } double opt_mesh_refine_steps(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.refine_steps =(int) val; - return CTX::instance()->mesh.refine_steps; + CTX::instance()->mesh.refineSteps =(int) val; + return CTX::instance()->mesh.refineSteps; } double opt_mesh_normals(OPT_ARGS_NUM) @@ -4740,8 +4695,8 @@ double opt_mesh_normals(OPT_ARGS_NUM) double opt_mesh_num_sub_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.num_sub_edges =(int) val; - return CTX::instance()->mesh.num_sub_edges; + CTX::instance()->mesh.numSubEdges =(int) val; + return CTX::instance()->mesh.numSubEdges; } double opt_mesh_tangents(OPT_ARGS_NUM) @@ -4775,198 +4730,197 @@ double opt_mesh_explode(OPT_ARGS_NUM) double opt_mesh_scaling_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.scaling_factor = val; - return CTX::instance()->mesh.scaling_factor; + CTX::instance()->mesh.scalingFactor = val; + return CTX::instance()->mesh.scalingFactor; } double opt_mesh_lc_factor(OPT_ARGS_NUM) { if(action & GMSH_SET){ if(val > 0) - CTX::instance()->mesh.lc_factor = val; + CTX::instance()->mesh.lcFactor = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[2]->value - (CTX::instance()->mesh.lc_factor); + (CTX::instance()->mesh.lcFactor); #endif - return CTX::instance()->mesh.lc_factor; + return CTX::instance()->mesh.lcFactor; } double opt_mesh_lc_min(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_min = val; + CTX::instance()->mesh.lcMin = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[25]->value - (CTX::instance()->mesh.lc_min); + (CTX::instance()->mesh.lcMin); #endif - return CTX::instance()->mesh.lc_min; + return CTX::instance()->mesh.lcMin; } double opt_mesh_lc_max(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_max = val; + CTX::instance()->mesh.lcMax = val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[26]->value - (CTX::instance()->mesh.lc_max); + (CTX::instance()->mesh.lcMax); #endif - return CTX::instance()->mesh.lc_max; + return CTX::instance()->mesh.lcMax; } double opt_mesh_tolerance_edge_length(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.tolerance_edge_length = val; - return CTX::instance()->mesh.tolerance_edge_length; + CTX::instance()->mesh.toleranceEdgeLength = val; + return CTX::instance()->mesh.toleranceEdgeLength; } - double opt_mesh_lc_from_curvature(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_from_curvature = (int)val; + CTX::instance()->mesh.lcFromCurvature = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[1]->value - (CTX::instance()->mesh.lc_from_curvature ? 1 : 0); + (CTX::instance()->mesh.lcFromCurvature ? 1 : 0); #endif - return CTX::instance()->mesh.lc_from_curvature; + return CTX::instance()->mesh.lcFromCurvature; } double opt_mesh_lc_from_points(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_from_points = (int)val; + CTX::instance()->mesh.lcFromPoints = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[5]->value - (CTX::instance()->mesh.lc_from_points ? 1 : 0); + (CTX::instance()->mesh.lcFromPoints ? 1 : 0); #endif - return CTX::instance()->mesh.lc_from_points; + return CTX::instance()->mesh.lcFromPoints; } double opt_mesh_lc_extend_from_boundary(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_extend_from_boundary = (int)val; + CTX::instance()->mesh.lcExtendFromBoundary = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[16]->value - (CTX::instance()->mesh.lc_extend_from_boundary ? 1 : 0); + (CTX::instance()->mesh.lcExtendFromBoundary ? 1 : 0); #endif - return CTX::instance()->mesh.lc_extend_from_boundary; + return CTX::instance()->mesh.lcExtendFromBoundary; } double opt_mesh_lc_integration_precision(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.lc_integration_precision = val; - return CTX::instance()->mesh.lc_integration_precision; + CTX::instance()->mesh.lcIntegrationPrecision = val; + return CTX::instance()->mesh.lcIntegrationPrecision; } double opt_mesh_rand_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.rand_factor = val; - return CTX::instance()->mesh.rand_factor; + CTX::instance()->mesh.randFactor = val; + return CTX::instance()->mesh.randFactor; } double opt_mesh_quality_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.quality_type != val) + if(CTX::instance()->mesh.qualityType != val) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.quality_type = (int)val; - if(CTX::instance()->mesh.quality_type < 0 || CTX::instance()->mesh.quality_type > 3) - CTX::instance()->mesh.quality_type = 0; + CTX::instance()->mesh.qualityType = (int)val; + if(CTX::instance()->mesh.qualityType < 0 || CTX::instance()->mesh.qualityType > 3) + CTX::instance()->mesh.qualityType = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->mesh.choice[6]->value - (CTX::instance()->mesh.quality_type); + (CTX::instance()->mesh.qualityType); } #endif - return CTX::instance()->mesh.quality_type; + return CTX::instance()->mesh.qualityType; } double opt_mesh_quality_inf(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.quality_inf != val) + if(CTX::instance()->mesh.qualityInf != val) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.quality_inf = val; + CTX::instance()->mesh.qualityInf = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[4]->value - (CTX::instance()->mesh.quality_inf); + (CTX::instance()->mesh.qualityInf); #endif - return CTX::instance()->mesh.quality_inf; + return CTX::instance()->mesh.qualityInf; } double opt_mesh_quality_sup(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.quality_sup != val) + if(CTX::instance()->mesh.qualitySup != val) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.quality_sup = val; + CTX::instance()->mesh.qualitySup = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[5]->value - (CTX::instance()->mesh.quality_sup); + (CTX::instance()->mesh.qualitySup); #endif - return CTX::instance()->mesh.quality_sup; + return CTX::instance()->mesh.qualitySup; } double opt_mesh_radius_inf(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.radius_inf != val) + if(CTX::instance()->mesh.radiusInf != val) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.radius_inf = val; + CTX::instance()->mesh.radiusInf = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[6]->value - (CTX::instance()->mesh.radius_inf); + (CTX::instance()->mesh.radiusInf); #endif - return CTX::instance()->mesh.radius_inf; + return CTX::instance()->mesh.radiusInf; } double opt_mesh_radius_sup(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.radius_sup != val) + if(CTX::instance()->mesh.radiusSup != val) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.radius_sup = val; + CTX::instance()->mesh.radiusSup = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[7]->value - (CTX::instance()->mesh.radius_sup); + (CTX::instance()->mesh.radiusSup); #endif - return CTX::instance()->mesh.radius_sup; + return CTX::instance()->mesh.radiusSup; } double opt_mesh_label_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.label_type = (int)val; - if(CTX::instance()->mesh.label_type < 0 || CTX::instance()->mesh.label_type > 4) - CTX::instance()->mesh.label_type = 0; + CTX::instance()->mesh.labelType = (int)val; + if(CTX::instance()->mesh.labelType < 0 || CTX::instance()->mesh.labelType > 4) + CTX::instance()->mesh.labelType = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->mesh.choice[7]->value - (CTX::instance()->mesh.label_type); + (CTX::instance()->mesh.labelType); } #endif - return CTX::instance()->mesh.label_type; + return CTX::instance()->mesh.labelType; } double opt_mesh_points(OPT_ARGS_NUM) @@ -5108,211 +5062,211 @@ double opt_mesh_pyramids(OPT_ARGS_NUM) double opt_mesh_surfaces_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.surfaces_edges != val) + if(CTX::instance()->mesh.surfacesEdges != val) CTX::instance()->mesh.changed |= ENT_SURFACE; - CTX::instance()->mesh.surfaces_edges = (int)val; + CTX::instance()->mesh.surfacesEdges = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[8]->value - (CTX::instance()->mesh.surfaces_edges); + (CTX::instance()->mesh.surfacesEdges); #endif - return CTX::instance()->mesh.surfaces_edges; + return CTX::instance()->mesh.surfacesEdges; } double opt_mesh_surfaces_faces(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.surfaces_faces != val) + if(CTX::instance()->mesh.surfacesFaces != val) CTX::instance()->mesh.changed |= ENT_SURFACE; - CTX::instance()->mesh.surfaces_faces = (int)val; + CTX::instance()->mesh.surfacesFaces = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[9]->value - (CTX::instance()->mesh.surfaces_faces); + (CTX::instance()->mesh.surfacesFaces); #endif - return CTX::instance()->mesh.surfaces_faces; + return CTX::instance()->mesh.surfacesFaces; } double opt_mesh_volumes_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.volumes_edges != val) + if(CTX::instance()->mesh.volumesEdges != val) CTX::instance()->mesh.changed |= ENT_VOLUME; - CTX::instance()->mesh.volumes_edges = (int)val; + CTX::instance()->mesh.volumesEdges = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[10]->value - (CTX::instance()->mesh.volumes_edges); + (CTX::instance()->mesh.volumesEdges); #endif - return CTX::instance()->mesh.volumes_edges; + return CTX::instance()->mesh.volumesEdges; } double opt_mesh_volumes_faces(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.volumes_faces != val) + if(CTX::instance()->mesh.volumesFaces != val) CTX::instance()->mesh.changed |= ENT_VOLUME; - CTX::instance()->mesh.volumes_faces = (int)val; + CTX::instance()->mesh.volumesFaces = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[11]->value - (CTX::instance()->mesh.volumes_faces); + (CTX::instance()->mesh.volumesFaces); #endif - return CTX::instance()->mesh.volumes_faces; + return CTX::instance()->mesh.volumesFaces; } double opt_mesh_points_num(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.points_num = (int)val; + CTX::instance()->mesh.pointsNum = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[12]->value - (CTX::instance()->mesh.points_num); + (CTX::instance()->mesh.pointsNum); #endif - return CTX::instance()->mesh.points_num; + return CTX::instance()->mesh.pointsNum; } double opt_mesh_lines_num(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.lines_num = (int)val; + CTX::instance()->mesh.linesNum = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[13]->value - (CTX::instance()->mesh.lines_num); + (CTX::instance()->mesh.linesNum); #endif - return CTX::instance()->mesh.lines_num; + return CTX::instance()->mesh.linesNum; } double opt_mesh_surfaces_num(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.surfaces_num = (int)val; + CTX::instance()->mesh.surfacesNum = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[14]->value - (CTX::instance()->mesh.surfaces_num); + (CTX::instance()->mesh.surfacesNum); #endif - return CTX::instance()->mesh.surfaces_num; + return CTX::instance()->mesh.surfacesNum; } double opt_mesh_volumes_num(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.volumes_num = (int)val; + CTX::instance()->mesh.volumesNum = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[15]->value - (CTX::instance()->mesh.volumes_num); + (CTX::instance()->mesh.volumesNum); #endif - return CTX::instance()->mesh.volumes_num; + return CTX::instance()->mesh.volumesNum; } double opt_mesh_point_size(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.point_size = val; + CTX::instance()->mesh.pointSize = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[10]->value - (CTX::instance()->mesh.point_size); + (CTX::instance()->mesh.pointSize); #endif - return CTX::instance()->mesh.point_size; + return CTX::instance()->mesh.pointSize; } double opt_mesh_point_type(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.point_type = (int)val; + CTX::instance()->mesh.pointType = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->mesh.choice[0]->value - (CTX::instance()->mesh.point_type ? 1 : 0); + (CTX::instance()->mesh.pointType ? 1 : 0); } #endif - return CTX::instance()->mesh.point_type; + return CTX::instance()->mesh.pointType; } double opt_mesh_line_width(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.line_width = val; + CTX::instance()->mesh.lineWidth = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[11]->value - (CTX::instance()->mesh.line_width); + (CTX::instance()->mesh.lineWidth); #endif - return CTX::instance()->mesh.line_width; + return CTX::instance()->mesh.lineWidth; } double opt_mesh_label_frequency(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.label_frequency = val; + CTX::instance()->mesh.labelFrequency = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[12]->value - (CTX::instance()->mesh.label_frequency); + (CTX::instance()->mesh.labelFrequency); #endif - return CTX::instance()->mesh.label_frequency; + return CTX::instance()->mesh.labelFrequency; } double opt_mesh_reverse_all_normals(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.reverse_all_normals != val) + if(CTX::instance()->mesh.reverseAllNormals != val) CTX::instance()->mesh.changed |= (ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.reverse_all_normals = (int)val; + CTX::instance()->mesh.reverseAllNormals = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[0]->value - (CTX::instance()->mesh.reverse_all_normals); + (CTX::instance()->mesh.reverseAllNormals); #endif - return CTX::instance()->mesh.reverse_all_normals; + return CTX::instance()->mesh.reverseAllNormals; } double opt_mesh_smooth_normals(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.smooth_normals != val) + if(CTX::instance()->mesh.smoothNormals != val) CTX::instance()->mesh.changed |= ENT_SURFACE; - CTX::instance()->mesh.smooth_normals = (int)val; + CTX::instance()->mesh.smoothNormals = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[19]->value - (CTX::instance()->mesh.smooth_normals); + (CTX::instance()->mesh.smoothNormals); #endif - return CTX::instance()->mesh.smooth_normals; + return CTX::instance()->mesh.smoothNormals; } double opt_mesh_angle_smooth_normals(OPT_ARGS_NUM) { if(action & GMSH_SET) { - if(CTX::instance()->mesh.angle_smooth_normals != val) + if(CTX::instance()->mesh.angleSmoothNormals != val) CTX::instance()->mesh.changed |= ENT_SURFACE; - CTX::instance()->mesh.angle_smooth_normals = val; + CTX::instance()->mesh.angleSmoothNormals = val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[18]->value - (CTX::instance()->mesh.angle_smooth_normals); + (CTX::instance()->mesh.angleSmoothNormals); #endif - return CTX::instance()->mesh.angle_smooth_normals; + return CTX::instance()->mesh.angleSmoothNormals; } double opt_mesh_light(OPT_ARGS_NUM) @@ -5332,25 +5286,25 @@ double opt_mesh_light(OPT_ARGS_NUM) double opt_mesh_light_lines(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.light_lines = (int)val; + CTX::instance()->mesh.lightLines = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[20]->value - (CTX::instance()->mesh.light_lines); + (CTX::instance()->mesh.lightLines); #endif - return CTX::instance()->mesh.light_lines; + return CTX::instance()->mesh.lightLines; } double opt_mesh_light_two_side(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.light_two_side = (int)val; + CTX::instance()->mesh.lightTwoSide = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[18]->value - (CTX::instance()->mesh.light_two_side); + (CTX::instance()->mesh.lightTwoSide); #endif - return CTX::instance()->mesh.light_two_side; + return CTX::instance()->mesh.lightTwoSide; } double opt_mesh_format(OPT_ARGS_NUM) @@ -5363,8 +5317,8 @@ double opt_mesh_format(OPT_ARGS_NUM) double opt_mesh_msh_file_version(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.msh_file_version = val; - return CTX::instance()->mesh.msh_file_version; + CTX::instance()->mesh.mshFileVersion = val; + return CTX::instance()->mesh.mshFileVersion; } double opt_mesh_binary(OPT_ARGS_NUM) @@ -5377,24 +5331,24 @@ double opt_mesh_binary(OPT_ARGS_NUM) double opt_mesh_bdf_field_format(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->mesh.bdf_field_format = (int)val; - if(CTX::instance()->mesh.bdf_field_format < 0 || - CTX::instance()->mesh.bdf_field_format > 2) - CTX::instance()->mesh.bdf_field_format = 1; + CTX::instance()->mesh.bdfFieldFormat = (int)val; + if(CTX::instance()->mesh.bdfFieldFormat < 0 || + CTX::instance()->mesh.bdfFieldFormat > 2) + CTX::instance()->mesh.bdfFieldFormat = 1; } - return CTX::instance()->mesh.bdf_field_format; + return CTX::instance()->mesh.bdfFieldFormat; } double opt_mesh_nb_smoothing(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.nb_smoothing = (int)val; + CTX::instance()->mesh.nbSmoothing = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.value[0]->value - (CTX::instance()->mesh.nb_smoothing); + (CTX::instance()->mesh.nbSmoothing); #endif - return CTX::instance()->mesh.nb_smoothing; + return CTX::instance()->mesh.nbSmoothing; } double opt_mesh_algo2d(OPT_ARGS_NUM) @@ -5425,18 +5379,18 @@ double opt_mesh_algo2d(OPT_ARGS_NUM) double opt_mesh_algo_subdivide(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->mesh.algo_subdivide = (int)val; - if(CTX::instance()->mesh.algo_subdivide < 0 && - CTX::instance()->mesh.algo_subdivide > 2) - CTX::instance()->mesh.algo_subdivide = 0; + CTX::instance()->mesh.algoSubdivide = (int)val; + if(CTX::instance()->mesh.algoSubdivide < 0 && + CTX::instance()->mesh.algoSubdivide > 2) + CTX::instance()->mesh.algoSubdivide = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) { GUI::instance()->options->mesh.choice[5]->value - (CTX::instance()->mesh.algo_subdivide); + (CTX::instance()->mesh.algoSubdivide); } #endif - return CTX::instance()->mesh.algo_subdivide; + return CTX::instance()->mesh.algoSubdivide; } double opt_mesh_algo3d(OPT_ARGS_NUM) @@ -5464,29 +5418,29 @@ double opt_mesh_algo3d(OPT_ARGS_NUM) double opt_mesh_mesh_only_visible(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.mesh_only_visible = (int)val; - return CTX::instance()->mesh.mesh_only_visible; + CTX::instance()->mesh.meshOnlyVisible = (int)val; + return CTX::instance()->mesh.meshOnlyVisible; } double opt_mesh_min_circ_points(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.min_circ_points = (int)val; - return CTX::instance()->mesh.min_circ_points; + CTX::instance()->mesh.minCircPoints = (int)val; + return CTX::instance()->mesh.minCircPoints; } double opt_mesh_allow_swap_edge_angle(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.allow_swap_edge_angle = val; - return CTX::instance()->mesh.allow_swap_edge_angle; + CTX::instance()->mesh.allowSwapEdgeAngle = val; + return CTX::instance()->mesh.allowSwapEdgeAngle; } double opt_mesh_min_curv_points(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.min_curv_points = (int)val; - return CTX::instance()->mesh.min_curv_points; + CTX::instance()->mesh.minCurvPoints = (int)val; + return CTX::instance()->mesh.minCurvPoints; } double opt_mesh_order(OPT_ARGS_NUM) @@ -5501,54 +5455,42 @@ double opt_mesh_order(OPT_ARGS_NUM) return CTX::instance()->mesh.order; } -double opt_mesh_c1(OPT_ARGS_NUM) -{ - if(action & GMSH_SET) - CTX::instance()->mesh.c1_continuity = (int)val; -#if defined(HAVE_FLTK) - if(GUI::available() && (action & GMSH_GUI)) - GUI::instance()->options->mesh.butt[21]->value - (CTX::instance()->mesh.c1_continuity); -#endif - return CTX::instance()->mesh.c1_continuity; -} - double opt_mesh_smooth_internal_edges(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.smooth_internal_edges = (int)val; + CTX::instance()->mesh.smoothInternalEdges = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[3]->value - (CTX::instance()->mesh.smooth_internal_edges); + (CTX::instance()->mesh.smoothInternalEdges); #endif - return CTX::instance()->mesh.smooth_internal_edges; + return CTX::instance()->mesh.smoothInternalEdges; } double opt_mesh_second_order_experimental(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.second_order_experimental = (int)val; - return CTX::instance()->mesh.second_order_experimental; + CTX::instance()->mesh.secondOrderExperimental = (int)val; + return CTX::instance()->mesh.secondOrderExperimental; } double opt_mesh_second_order_linear(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.second_order_linear = (int)val; - return CTX::instance()->mesh.second_order_linear; + CTX::instance()->mesh.secondOrderLinear = (int)val; + return CTX::instance()->mesh.secondOrderLinear; } double opt_mesh_second_order_incomplete(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.second_order_incomplete = (int)val; + CTX::instance()->mesh.secondOrderIncomplete = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->mesh.butt[4]->value - (CTX::instance()->mesh.second_order_incomplete); + (CTX::instance()->mesh.secondOrderIncomplete); #endif - return CTX::instance()->mesh.second_order_incomplete; + return CTX::instance()->mesh.secondOrderIncomplete; } double opt_mesh_dual(OPT_ARGS_NUM) @@ -5570,31 +5512,31 @@ double opt_mesh_voronoi(OPT_ARGS_NUM) double opt_mesh_draw_skin_only(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->mesh.draw_skin_only = (int)val; + CTX::instance()->mesh.drawSkinOnly = (int)val; } - return CTX::instance()->mesh.draw_skin_only; + return CTX::instance()->mesh.drawSkinOnly; } double opt_mesh_save_all(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.save_all = val ? 1 : 0; - return CTX::instance()->mesh.save_all; + CTX::instance()->mesh.saveAll = val ? 1 : 0; + return CTX::instance()->mesh.saveAll; } double opt_mesh_save_parametric(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.save_parametric = val ? 1 : 0; - return CTX::instance()->mesh.save_parametric; + CTX::instance()->mesh.saveParametric = val ? 1 : 0; + return CTX::instance()->mesh.saveParametric; } double opt_mesh_save_groups_of_nodes(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->mesh.save_groups_of_nodes = val ? 1 : 0; - return CTX::instance()->mesh.save_groups_of_nodes; + CTX::instance()->mesh.saveGroupsOfNodes = val ? 1 : 0; + return CTX::instance()->mesh.saveGroupsOfNodes; } double opt_mesh_color_carousel(OPT_ARGS_NUM) @@ -5602,35 +5544,35 @@ double opt_mesh_color_carousel(OPT_ARGS_NUM) if(action & GMSH_SET) { // vertex arrays need to be regenerated only when we color by // element type or by partition - if(CTX::instance()->mesh.color_carousel != (int)val && - ((val == 0. || val == 3.) || CTX::instance()->pick_elements)) + if(CTX::instance()->mesh.colorCarousel != (int)val && + ((val == 0. || val == 3.) || CTX::instance()->pickElements)) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); - CTX::instance()->mesh.color_carousel = (int)val; - if(CTX::instance()->mesh.color_carousel < 0 || - CTX::instance()->mesh.color_carousel > 3) - CTX::instance()->mesh.color_carousel = 0; + CTX::instance()->mesh.colorCarousel = (int)val; + if(CTX::instance()->mesh.colorCarousel < 0 || + CTX::instance()->mesh.colorCarousel > 3) + CTX::instance()->mesh.colorCarousel = 0; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)){ GUI::instance()->options->mesh.choice[4]->value - (CTX::instance()->mesh.color_carousel); + (CTX::instance()->mesh.colorCarousel); } #endif - return CTX::instance()->mesh.color_carousel; + return CTX::instance()->mesh.colorCarousel; } double opt_mesh_zone_definition(OPT_ARGS_NUM) { if(action & GMSH_SET){ - CTX::instance()->mesh.zone_definition = (int)val; - if( (CTX::instance()->mesh.zone_definition < 0 || - CTX::instance()->mesh.zone_definition > 2) || - (CTX::instance()->mesh.zone_definition == 1 && + CTX::instance()->mesh.zoneDefinition = (int)val; + if( (CTX::instance()->mesh.zoneDefinition < 0 || + CTX::instance()->mesh.zoneDefinition > 2) || + (CTX::instance()->mesh.zoneDefinition == 1 && GModel::current()->getMinPartitionSize() + GModel::current()->getMaxPartitionSize() == 0) ) - CTX::instance()->mesh.zone_definition = 0; + CTX::instance()->mesh.zoneDefinition = 0; } - return CTX::instance()->mesh.zone_definition; + return CTX::instance()->mesh.zoneDefinition; } double opt_mesh_nb_nodes(OPT_ARGS_NUM) @@ -5693,186 +5635,186 @@ double opt_mesh_partition_partitioner(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.partitioner = + CTX::instance()->partitionOptions.partitioner = (ival < 1 || ival > 2) ? 1 : ival; } - return CTX::instance()->partition_options.partitioner; + return CTX::instance()->partitionOptions.partitioner; } double opt_mesh_partition_num(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = std::max(1, (int)val); - CTX::instance()->partition_options.num_partitions = ival; + CTX::instance()->partitionOptions.num_partitions = ival; unsigned hcdim = 0; // log2 to get hypercube dimensions unsigned jval = ival; while(jval >>= 1) ++hcdim; - CTX::instance()->partition_options.ndims_tot = hcdim; - CTX::instance()->partition_options.mesh_dims[0] = ival; - CTX::instance()->partition_options.mesh_dims[1] = 1; - CTX::instance()->partition_options.mesh_dims[2] = 1; - if(CTX::instance()->partition_options.partitioner == 2) // METIS - CTX::instance()->partition_options.algorithm = (ival <= 8) ? 1 : 2; + CTX::instance()->partitionOptions.ndims_tot = hcdim; + CTX::instance()->partitionOptions.mesh_dims[0] = ival; + CTX::instance()->partitionOptions.mesh_dims[1] = 1; + CTX::instance()->partitionOptions.mesh_dims[2] = 1; + if(CTX::instance()->partitionOptions.partitioner == 2) // METIS + CTX::instance()->partitionOptions.algorithm = (ival <= 8) ? 1 : 2; } - return CTX::instance()->partition_options.num_partitions; + return CTX::instance()->partitionOptions.num_partitions; } double opt_mesh_partition_chaco_global_method(OPT_ARGS_NUM) { if(action & GMSH_SET) { int ival = (int)val; - CTX::instance()->partition_options.global_method = + CTX::instance()->partitionOptions.global_method = (ival < 1 || ival > 6 || ival == 3) ? 1 : ival; } - return CTX::instance()->partition_options.global_method; + return CTX::instance()->partitionOptions.global_method; } double opt_mesh_partition_chaco_architecture(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.architecture = + CTX::instance()->partitionOptions.architecture = (ival < 0 || ival > 3) ? 1 : ival; } - return CTX::instance()->partition_options.architecture; + return CTX::instance()->partitionOptions.architecture; } double opt_mesh_partition_chaco_ndims_tot(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = std::max(1, (int)val); - CTX::instance()->partition_options.ndims_tot = ival; - CTX::instance()->partition_options.num_partitions = 1 << ival; + CTX::instance()->partitionOptions.ndims_tot = ival; + CTX::instance()->partitionOptions.num_partitions = 1 << ival; } - return CTX::instance()->partition_options.ndims_tot; + return CTX::instance()->partitionOptions.ndims_tot; } double opt_mesh_partition_chaco_mesh_dims1(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = std::max(1, (int)val); - CTX::instance()->partition_options.mesh_dims[0] = ival; - CTX::instance()->partition_options.num_partitions = ival; - if(CTX::instance()->partition_options.architecture >= 2) - CTX::instance()->partition_options.num_partitions *= - CTX::instance()->partition_options.mesh_dims[1]; - if(CTX::instance()->partition_options.architecture == 3) - CTX::instance()->partition_options.num_partitions *= - CTX::instance()->partition_options.mesh_dims[2]; + CTX::instance()->partitionOptions.mesh_dims[0] = ival; + CTX::instance()->partitionOptions.num_partitions = ival; + if(CTX::instance()->partitionOptions.architecture >= 2) + CTX::instance()->partitionOptions.num_partitions *= + CTX::instance()->partitionOptions.mesh_dims[1]; + if(CTX::instance()->partitionOptions.architecture == 3) + CTX::instance()->partitionOptions.num_partitions *= + CTX::instance()->partitionOptions.mesh_dims[2]; } - return CTX::instance()->partition_options.mesh_dims[0]; + return CTX::instance()->partitionOptions.mesh_dims[0]; } double opt_mesh_partition_chaco_mesh_dims2(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = std::max(1, (int)val); - CTX::instance()->partition_options.mesh_dims[1] = ival; - CTX::instance()->partition_options.num_partitions = - CTX::instance()->partition_options.mesh_dims[0]*ival; - if(CTX::instance()->partition_options.architecture == 3) - CTX::instance()->partition_options.num_partitions *= - CTX::instance()->partition_options.mesh_dims[2]; + CTX::instance()->partitionOptions.mesh_dims[1] = ival; + CTX::instance()->partitionOptions.num_partitions = + CTX::instance()->partitionOptions.mesh_dims[0]*ival; + if(CTX::instance()->partitionOptions.architecture == 3) + CTX::instance()->partitionOptions.num_partitions *= + CTX::instance()->partitionOptions.mesh_dims[2]; } - return CTX::instance()->partition_options.mesh_dims[1]; + return CTX::instance()->partitionOptions.mesh_dims[1]; } double opt_mesh_partition_chaco_mesh_dims3(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = std::max(1, (int)val); - CTX::instance()->partition_options.mesh_dims[2] = ival; - CTX::instance()->partition_options.num_partitions = - CTX::instance()->partition_options.mesh_dims[0]* - CTX::instance()->partition_options.mesh_dims[1]*ival; + CTX::instance()->partitionOptions.mesh_dims[2] = ival; + CTX::instance()->partitionOptions.num_partitions = + CTX::instance()->partitionOptions.mesh_dims[0]* + CTX::instance()->partitionOptions.mesh_dims[1]*ival; } - return CTX::instance()->partition_options.mesh_dims[2]; + return CTX::instance()->partitionOptions.mesh_dims[2]; } double opt_mesh_partition_chaco_local_method(OPT_ARGS_NUM) { if(action & GMSH_SET) { int ival = (int)val; - if(CTX::instance()->partition_options.algorithm == 1) ival = 1; - CTX::instance()->partition_options.local_method = (ival < 0 || ival > 1) ? 1 : ival; + if(CTX::instance()->partitionOptions.algorithm == 1) ival = 1; + CTX::instance()->partitionOptions.local_method = (ival < 0 || ival > 1) ? 1 : ival; } - return CTX::instance()->partition_options.local_method; + return CTX::instance()->partitionOptions.local_method; } double opt_mesh_partition_chaco_eigensolver(OPT_ARGS_NUM) { if(action & GMSH_SET) { int ival = val ? 1 : 0; - CTX::instance()->partition_options.rqi_flag = ival; + CTX::instance()->partitionOptions.rqi_flag = ival; } - return CTX::instance()->partition_options.rqi_flag; + return CTX::instance()->partitionOptions.rqi_flag; } double opt_mesh_partition_chaco_vmax(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.vmax = (ival < 1) ? 1 : ival; + CTX::instance()->partitionOptions.vmax = (ival < 1) ? 1 : ival; } - return CTX::instance()->partition_options.vmax; + return CTX::instance()->partitionOptions.vmax; } double opt_mesh_partition_chaco_nsection(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.ndims = (ival < 1 || ival > 3) ? 1 : ival; - if(CTX::instance()->partition_options.ndims > 1 && - CTX::instance()->partition_options.algorithm == 2) - CTX::instance()->partition_options.terminal_propogation = false; + CTX::instance()->partitionOptions.ndims = (ival < 1 || ival > 3) ? 1 : ival; + if(CTX::instance()->partitionOptions.ndims > 1 && + CTX::instance()->partitionOptions.algorithm == 2) + CTX::instance()->partitionOptions.terminal_propogation = false; } - return CTX::instance()->partition_options.ndims; + return CTX::instance()->partitionOptions.ndims; } double opt_mesh_partition_chaco_eigtol(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->partition_options.eigtol = (val <= 0.) ? 1.E-3 : val; - return CTX::instance()->partition_options.eigtol; + CTX::instance()->partitionOptions.eigtol = (val <= 0.) ? 1.E-3 : val; + return CTX::instance()->partitionOptions.eigtol; } double opt_mesh_partition_chaco_seed(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->partition_options.seed = (long)val; - return CTX::instance()->partition_options.seed; + CTX::instance()->partitionOptions.seed = (long)val; + return CTX::instance()->partitionOptions.seed; } double opt_mesh_partition_chaco_refine_partition(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->partition_options.refine_partition = val ? 1 : 0; - return CTX::instance()->partition_options.refine_partition; + CTX::instance()->partitionOptions.refine_partition = val ? 1 : 0; + return CTX::instance()->partitionOptions.refine_partition; } double opt_mesh_partition_chaco_internal_vertices(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->partition_options.internal_vertices = val ? 1 : 0; - return CTX::instance()->partition_options.internal_vertices; + CTX::instance()->partitionOptions.internal_vertices = val ? 1 : 0; + return CTX::instance()->partitionOptions.internal_vertices; } double opt_mesh_partition_chaco_refine_map(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->partition_options.refine_map = val ? 1 : 0; - return CTX::instance()->partition_options.refine_map; + CTX::instance()->partitionOptions.refine_map = val ? 1 : 0; + return CTX::instance()->partitionOptions.refine_map; } double opt_mesh_partition_chaco_terminal_propogation(OPT_ARGS_NUM) { if(action & GMSH_SET) { - CTX::instance()->partition_options.terminal_propogation = val ? 1 : 0; - if(CTX::instance()->partition_options.terminal_propogation && - CTX::instance()->partition_options.algorithm == 2) - CTX::instance()->partition_options.ndims = 1; + CTX::instance()->partitionOptions.terminal_propogation = val ? 1 : 0; + if(CTX::instance()->partitionOptions.terminal_propogation && + CTX::instance()->partitionOptions.algorithm == 2) + CTX::instance()->partitionOptions.ndims = 1; } - return CTX::instance()->partition_options.terminal_propogation; + return CTX::instance()->partitionOptions.terminal_propogation; } double opt_mesh_partition_metis_algorithm(OPT_ARGS_NUM) @@ -5880,30 +5822,30 @@ double opt_mesh_partition_metis_algorithm(OPT_ARGS_NUM) if(action & GMSH_SET) { int ival = (int)val; if(ival < 1 || ival > 2) - ival = (CTX::instance()->partition_options.num_partitions <= 8) ? 1 : 2; - CTX::instance()->partition_options.algorithm = ival; + ival = (CTX::instance()->partitionOptions.num_partitions <= 8) ? 1 : 2; + CTX::instance()->partitionOptions.algorithm = ival; } - return CTX::instance()->partition_options.algorithm; + return CTX::instance()->partitionOptions.algorithm; } double opt_mesh_partition_metis_edge_matching(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.edge_matching = + CTX::instance()->partitionOptions.edge_matching = (ival < 1 || ival > 3) ? 3 : ival; } - return CTX::instance()->partition_options.edge_matching; + return CTX::instance()->partitionOptions.edge_matching; } double opt_mesh_partition_metis_refine_algorithm(OPT_ARGS_NUM) { if(action & GMSH_SET) { const int ival = (int)val; - CTX::instance()->partition_options.refine_algorithm = + CTX::instance()->partitionOptions.refine_algorithm = (ival < 1 || ival > 3) ? 3 : ival; } - return CTX::instance()->partition_options.refine_algorithm; + return CTX::instance()->partitionOptions.refine_algorithm; } double opt_mesh_clip(OPT_ARGS_NUM) @@ -5917,18 +5859,6 @@ double opt_mesh_clip(OPT_ARGS_NUM) return CTX::instance()->mesh.clip; } -double opt_solver_max_delay(OPT_ARGS_NUM) -{ - if(action & GMSH_SET) - CTX::instance()->solver.max_delay = (val >= 0) ? (int)val : 0; -#if defined(HAVE_FLTK) - if(GUI::available() && (action & GMSH_GUI)) - GUI::instance()->options->solver.value[0]->value - (CTX::instance()->solver.max_delay); -#endif - return CTX::instance()->solver.max_delay; -} - double opt_solver_listen(OPT_ARGS_NUM) { if(action & GMSH_SET) @@ -6065,13 +5995,13 @@ double opt_solver_merge_views4(OPT_ARGS_NUM) double opt_post_horizontal_scales(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->post.horizontal_scales = (int)val; + CTX::instance()->post.horizontalScales = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->post.butt[2]->value - (CTX::instance()->post.horizontal_scales); + (CTX::instance()->post.horizontalScales); #endif - return CTX::instance()->post.horizontal_scales; + return CTX::instance()->post.horizontalScales; } double opt_post_link(OPT_ARGS_NUM) @@ -6100,40 +6030,40 @@ double opt_post_smooth(OPT_ARGS_NUM) double opt_post_anim_delay(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->post.anim_delay = (val >= 0.) ? val : 0.; + CTX::instance()->post.animDelay = (val >= 0.) ? val : 0.; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->post.value[0]->value - (CTX::instance()->post.anim_delay); + (CTX::instance()->post.animDelay); #endif - return CTX::instance()->post.anim_delay; + return CTX::instance()->post.animDelay; } double opt_post_anim_cycle(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->post.anim_cycle = (int)val; + CTX::instance()->post.animCycle = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->post.butt[0]->value - (CTX::instance()->post.anim_cycle); + (CTX::instance()->post.animCycle); if(GUI::available()) for(unsigned int i = 0; i < GUI::instance()->graph.size(); i++) GUI::instance()->graph[i]->checkAnimButtons(); #endif - return CTX::instance()->post.anim_cycle; + return CTX::instance()->post.animCycle; } double opt_post_combine_remove_orig(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->post.combine_remove_orig = (int)val; + CTX::instance()->post.combineRemoveOrig = (int)val; #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI)) GUI::instance()->options->post.butt[1]->value - (CTX::instance()->post.combine_remove_orig); + (CTX::instance()->post.combineRemoveOrig); #endif - return CTX::instance()->post.combine_remove_orig; + return CTX::instance()->post.combineRemoveOrig; } double opt_post_plugins(OPT_ARGS_NUM) @@ -6155,8 +6085,8 @@ double opt_post_nb_views(OPT_ARGS_NUM) double opt_post_file_format(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->post.file_format = (int)val; - return CTX::instance()->post.file_format; + CTX::instance()->post.fileFormat = (int)val; + return CTX::instance()->post.fileFormat; } double opt_view_nb_timestep(OPT_ARGS_NUM) @@ -6183,21 +6113,21 @@ double opt_view_timestep(OPT_ARGS_NUM) GET_VIEW(0.); if(!data) return 0; if(action & GMSH_SET) { - opt->TimeStep = (int)val; - if(opt->TimeStep > data->getNumTimeSteps() - 1) - opt->TimeStep = 0; - else if(opt->TimeStep < 0) - opt->TimeStep = data->getNumTimeSteps() - 1; + opt->timeStep = (int)val; + if(opt->timeStep > data->getNumTimeSteps() - 1) + opt->timeStep = 0; + else if(opt->timeStep < 0) + opt->timeStep = data->getNumTimeSteps() - 1; if(data->isAdaptive()) data->getAdaptiveData()->changeResolution - (opt->TimeStep, opt->MaxRecursionLevel, opt->TargetError); + (opt->timeStep, opt->maxRecursionLevel, opt->targetError); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[50]->value(opt->TimeStep); + GUI::instance()->options->view.value[50]->value(opt->timeStep); #endif - return opt->TimeStep; + return opt->timeStep; #else return 0.; #endif @@ -6232,15 +6162,15 @@ double opt_view_custom_min(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CustomMin = val; + opt->customMin = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[31]->value(opt->CustomMin); + GUI::instance()->options->view.value[31]->value(opt->customMin); } #endif - return opt->CustomMin; + return opt->customMin; #else return 0.; #endif @@ -6251,14 +6181,14 @@ double opt_view_custom_max(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CustomMax = val; + opt->customMax = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[32]->value(opt->CustomMax); + GUI::instance()->options->view.value[32]->value(opt->customMax); #endif - return opt->CustomMax; + return opt->customMax; #else return 0.; #endif @@ -6335,14 +6265,14 @@ double opt_view_offset0(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Offset[0] = val; + opt->offset[0] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[40]->value(opt->Offset[0]); + GUI::instance()->options->view.value[40]->value(opt->offset[0]); #endif - return opt->Offset[0]; + return opt->offset[0]; #else return 0.; #endif @@ -6353,14 +6283,14 @@ double opt_view_offset1(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Offset[1] = val; + opt->offset[1] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[41]->value(opt->Offset[1]); + GUI::instance()->options->view.value[41]->value(opt->offset[1]); #endif - return opt->Offset[1]; + return opt->offset[1]; #else return 0.; #endif @@ -6371,14 +6301,14 @@ double opt_view_offset2(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Offset[2] = val; + opt->offset[2] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[42]->value(opt->Offset[2]); + GUI::instance()->options->view.value[42]->value(opt->offset[2]); #endif - return opt->Offset[2]; + return opt->offset[2]; #else return 0.; #endif @@ -6389,14 +6319,14 @@ double opt_view_raise0(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Raise[0] = val; + opt->raise[0] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[43]->value(opt->Raise[0]); + GUI::instance()->options->view.value[43]->value(opt->raise[0]); #endif - return opt->Raise[0]; + return opt->raise[0]; #else return 0.; #endif @@ -6407,14 +6337,14 @@ double opt_view_raise1(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Raise[1] = val; + opt->raise[1] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[44]->value(opt->Raise[1]); + GUI::instance()->options->view.value[44]->value(opt->raise[1]); #endif - return opt->Raise[1]; + return opt->raise[1]; #else return 0.; #endif @@ -6425,14 +6355,14 @@ double opt_view_raise2(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Raise[2] = val; + opt->raise[2] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[45]->value(opt->Raise[2]); + GUI::instance()->options->view.value[45]->value(opt->raise[2]); #endif - return opt->Raise[2]; + return opt->raise[2]; #else return 0.; #endif @@ -6443,14 +6373,14 @@ double opt_view_normal_raise(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->NormalRaise = val; + opt->normalRaise = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[46]->value(opt->NormalRaise); + GUI::instance()->options->view.value[46]->value(opt->normalRaise); #endif - return opt->NormalRaise; + return opt->normalRaise; #else return 0.; #endif @@ -6461,14 +6391,14 @@ double opt_view_transform00(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[0][0] = val; + opt->transform[0][0] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[51]->value(opt->Transform[0][0]); + GUI::instance()->options->view.value[51]->value(opt->transform[0][0]); #endif - return opt->Transform[0][0]; + return opt->transform[0][0]; #else return 0.; #endif @@ -6479,14 +6409,14 @@ double opt_view_transform01(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[0][1] = val; + opt->transform[0][1] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[52]->value(opt->Transform[0][1]); + GUI::instance()->options->view.value[52]->value(opt->transform[0][1]); #endif - return opt->Transform[0][1]; + return opt->transform[0][1]; #else return 0.; #endif @@ -6497,14 +6427,14 @@ double opt_view_transform02(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[0][2] = val; + opt->transform[0][2] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[53]->value(opt->Transform[0][2]); + GUI::instance()->options->view.value[53]->value(opt->transform[0][2]); #endif - return opt->Transform[0][2]; + return opt->transform[0][2]; #else return 0.; #endif @@ -6515,14 +6445,14 @@ double opt_view_transform10(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[1][0] = val; + opt->transform[1][0] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[54]->value(opt->Transform[1][0]); + GUI::instance()->options->view.value[54]->value(opt->transform[1][0]); #endif - return opt->Transform[1][0]; + return opt->transform[1][0]; #else return 0.; #endif @@ -6533,14 +6463,14 @@ double opt_view_transform11(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[1][1] = val; + opt->transform[1][1] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[55]->value(opt->Transform[1][1]); + GUI::instance()->options->view.value[55]->value(opt->transform[1][1]); #endif - return opt->Transform[1][1]; + return opt->transform[1][1]; #else return 0.; #endif @@ -6551,14 +6481,14 @@ double opt_view_transform12(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[1][2] = val; + opt->transform[1][2] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[56]->value(opt->Transform[1][2]); + GUI::instance()->options->view.value[56]->value(opt->transform[1][2]); #endif - return opt->Transform[1][2]; + return opt->transform[1][2]; #else return 0.; #endif @@ -6569,14 +6499,14 @@ double opt_view_transform20(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[2][0] = val; + opt->transform[2][0] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[57]->value(opt->Transform[2][0]); + GUI::instance()->options->view.value[57]->value(opt->transform[2][0]); #endif - return opt->Transform[2][0]; + return opt->transform[2][0]; #else return 0.; #endif @@ -6587,14 +6517,14 @@ double opt_view_transform21(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[2][1] = val; + opt->transform[2][1] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[58]->value(opt->Transform[2][1]); + GUI::instance()->options->view.value[58]->value(opt->transform[2][1]); #endif - return opt->Transform[2][1]; + return opt->transform[2][1]; #else return 0.; #endif @@ -6605,14 +6535,14 @@ double opt_view_transform22(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Transform[2][2] = val; + opt->transform[2][2] = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[59]->value(opt->Transform[2][2]); + GUI::instance()->options->view.value[59]->value(opt->transform[2][2]); #endif - return opt->Transform[2][2]; + return opt->transform[2][2]; #else return 0.; #endif @@ -6623,13 +6553,13 @@ double opt_view_arrow_size_min(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ArrowSizeMin = val; + opt->arrowSizeMin = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[64]->value(opt->ArrowSizeMin); + GUI::instance()->options->view.value[64]->value(opt->arrowSizeMin); #endif - return opt->ArrowSizeMin; + return opt->arrowSizeMin; #else return 0.; #endif @@ -6640,13 +6570,13 @@ double opt_view_arrow_size_max(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ArrowSizeMax = val; + opt->arrowSizeMax = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[60]->value(opt->ArrowSizeMax); + GUI::instance()->options->view.value[60]->value(opt->arrowSizeMax); #endif - return opt->ArrowSizeMax; + return opt->arrowSizeMax; #else return 0.; #endif @@ -6657,13 +6587,13 @@ double opt_view_normals(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Normals = val; + opt->normals = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[0]->value(opt->Normals); + GUI::instance()->options->view.value[0]->value(opt->normals); #endif - return opt->Normals; + return opt->normals; #else return 0.; #endif @@ -6674,13 +6604,13 @@ double opt_view_tangents(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Tangents = val; + opt->tangents = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[1]->value(opt->Tangents); + GUI::instance()->options->view.value[1]->value(opt->tangents); #endif - return opt->Tangents; + return opt->tangents; #else return 0.; #endif @@ -6691,14 +6621,14 @@ double opt_view_displacement_factor(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DisplacementFactor = val; + opt->displacementFactor = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[63]->value(opt->DisplacementFactor); + GUI::instance()->options->view.value[63]->value(opt->displacementFactor); #endif - return opt->DisplacementFactor; + return opt->displacementFactor; #else return 0.; #endif @@ -6709,14 +6639,14 @@ double opt_view_fake_transparency(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->FakeTransparency = (int)val; + opt->fakeTransparency = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[24]->value(opt->FakeTransparency); + GUI::instance()->options->view.butt[24]->value(opt->fakeTransparency); #endif - return opt->FakeTransparency; + return opt->fakeTransparency; #else return 0.; #endif @@ -6727,14 +6657,14 @@ double opt_view_explode(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Explode = val; + opt->explode = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[12]->value(opt->Explode); + GUI::instance()->options->view.value[12]->value(opt->explode); #endif - return opt->Explode; + return opt->explode; #else return 0.; #endif @@ -6745,14 +6675,14 @@ double opt_view_visible(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Visible = (int)val; + opt->visible = (int)val; } #if defined(HAVE_FLTK) if(GUI::available() && (action & GMSH_GUI) && num >= 0 && num < (int)GUI::instance()->menu->toggle.size()) - GUI::instance()->menu->toggle[num]->value(opt->Visible); + GUI::instance()->menu->toggle[num]->value(opt->visible); #endif - return opt->Visible; + return opt->visible; #else return 0.; #endif @@ -6763,17 +6693,17 @@ double opt_view_intervals_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->IntervalsType = (int)val; - if(opt->IntervalsType < 1 || opt->IntervalsType > 4) - opt->IntervalsType = 1; + opt->intervalsType = (int)val; + if(opt->intervalsType < 1 || opt->intervalsType > 4) + opt->intervalsType = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[0]->value(opt->IntervalsType - 1); + GUI::instance()->options->view.choice[0]->value(opt->intervalsType - 1); } #endif - return opt->IntervalsType; + return opt->intervalsType; #else return 0.; #endif @@ -6784,15 +6714,15 @@ double opt_view_saturate_values(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->SaturateValues = (int)val; + opt->saturateValues = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[38]->value(opt->SaturateValues); + GUI::instance()->options->view.butt[38]->value(opt->saturateValues); } #endif - return opt->SaturateValues; + return opt->saturateValues; #else return 0.; #endif @@ -6803,11 +6733,11 @@ double opt_view_adapt_visualization_grid(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AdaptVisualizationGrid = (int)val; + opt->adaptVisualizationGrid = (int)val; if(data){ - if(opt->AdaptVisualizationGrid) + if(opt->adaptVisualizationGrid) data->initAdaptiveData - (opt->TimeStep, opt->MaxRecursionLevel, opt->TargetError); + (opt->timeStep, opt->maxRecursionLevel, opt->targetError); else data->destroyAdaptiveData(); view->setChanged(true); @@ -6815,11 +6745,11 @@ double opt_view_adapt_visualization_grid(OPT_ARGS_NUM) } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[0]->value(opt->AdaptVisualizationGrid); + GUI::instance()->options->view.butt[0]->value(opt->adaptVisualizationGrid); GUI::instance()->options->activate("view_adaptive"); } #endif - return opt->AdaptVisualizationGrid; + return opt->adaptVisualizationGrid; #else return 0.; #endif @@ -6830,19 +6760,19 @@ double opt_view_max_recursion_level(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->MaxRecursionLevel = (int)val; + opt->maxRecursionLevel = (int)val; if(data && data->isAdaptive()){ data->getAdaptiveData()->changeResolution - (opt->TimeStep, opt->MaxRecursionLevel, opt->TargetError); + (opt->timeStep, opt->maxRecursionLevel, opt->targetError); view->setChanged(true); } } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[33]->value(opt->MaxRecursionLevel); + GUI::instance()->options->view.value[33]->value(opt->maxRecursionLevel); } #endif - return opt->MaxRecursionLevel; + return opt->maxRecursionLevel; #else return 0.; #endif @@ -6853,19 +6783,19 @@ double opt_view_target_error(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->TargetError = val; + opt->targetError = val; if(data && data->isAdaptive()){ data->getAdaptiveData()->changeResolution - (opt->TimeStep, opt->MaxRecursionLevel, opt->TargetError); + (opt->timeStep, opt->maxRecursionLevel, opt->targetError); view->setChanged(true); } } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[34]->value(opt->TargetError); + GUI::instance()->options->view.value[34]->value(opt->targetError); } #endif - return opt->TargetError; + return opt->targetError; #else return 0.; #endif @@ -6876,17 +6806,17 @@ double opt_view_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Type = (int)val; - if(opt->Type < 1 || opt->Type > 3) - opt->Type = 1; + opt->type = (int)val; + if(opt->type < 1 || opt->type > 3) + opt->type = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[13]->value(opt->Type - 1); + GUI::instance()->options->view.choice[13]->value(opt->type - 1); } #endif - return opt->Type; + return opt->type; #else return 0.; #endif @@ -6897,15 +6827,15 @@ double opt_view_auto_position(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AutoPosition = (int)val; + opt->autoPosition = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[7]->value(opt->AutoPosition); + GUI::instance()->options->view.butt[7]->value(opt->autoPosition); GUI::instance()->options->activate("view_axes_auto_2d"); } #endif - return opt->AutoPosition; + return opt->autoPosition; #else return 0.; #endif @@ -6916,13 +6846,13 @@ double opt_view_position0(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Position[0] = (int)val; + opt->position[0] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[20]->value(opt->Position[0]); + GUI::instance()->options->view.value[20]->value(opt->position[0]); #endif - return opt->Position[0]; + return opt->position[0]; #else return 0.; #endif @@ -6933,13 +6863,13 @@ double opt_view_position1(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Position[1] = (int)val; + opt->position[1] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[21]->value(opt->Position[1]); + GUI::instance()->options->view.value[21]->value(opt->position[1]); #endif - return opt->Position[1]; + return opt->position[1]; #else return 0.; #endif @@ -6950,13 +6880,13 @@ double opt_view_size0(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Size[0] = (int)val; + opt->size[0] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[22]->value(opt->Size[0]); + GUI::instance()->options->view.value[22]->value(opt->size[0]); #endif - return opt->Size[0]; + return opt->size[0]; #else return 0.; #endif @@ -6967,13 +6897,13 @@ double opt_view_size1(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Size[1] = (int)val; + opt->size[1] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[23]->value(opt->Size[1]); + GUI::instance()->options->view.value[23]->value(opt->size[1]); #endif - return opt->Size[1]; + return opt->size[1]; #else return 0.; #endif @@ -6984,34 +6914,35 @@ double opt_view_axes(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Axes = (int)val; - if(opt->Axes < 0 || opt->Axes > 5) - opt->Axes = 0; + opt->axes = (int)val; + if(opt->axes < 0 || opt->axes > 5) + opt->axes = 0; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[8]->value(opt->Axes); + GUI::instance()->options->view.choice[8]->value(opt->axes); GUI::instance()->options->activate("view_axes"); } #endif - return opt->Axes; + return opt->axes; #else return 0.; #endif } -double opt_view_axes_mikado(OPT_ARGS_NUM){ +double opt_view_axes_mikado(OPT_ARGS_NUM) +{ #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesMikado = (int)val; + opt->axesMikado = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[3]->value(opt->AxesMikado); + GUI::instance()->options->view.butt[3]->value(opt->axesMikado); } #endif - return opt->AxesMikado; + return opt->axesMikado; #else return 0.; #endif @@ -7022,15 +6953,15 @@ double opt_view_axes_auto_position(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesAutoPosition = (int)val; + opt->axesAutoPosition = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[25]->value(opt->AxesAutoPosition); + GUI::instance()->options->view.butt[25]->value(opt->axesAutoPosition); GUI::instance()->options->activate("view_axes_auto_3d"); } #endif - return opt->AxesAutoPosition; + return opt->axesAutoPosition; #else return 0.; #endif @@ -7041,14 +6972,14 @@ double opt_view_axes_xmin(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[0] = val; + opt->axesPosition[0] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[13]->value(opt->AxesPosition[0]); + GUI::instance()->options->view.value[13]->value(opt->axesPosition[0]); } #endif - return opt->AxesPosition[0]; + return opt->axesPosition[0]; #else return 0.; #endif @@ -7059,14 +6990,14 @@ double opt_view_axes_xmax(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[1] = val; + opt->axesPosition[1] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[16]->value(opt->AxesPosition[1]); + GUI::instance()->options->view.value[16]->value(opt->axesPosition[1]); } #endif - return opt->AxesPosition[1]; + return opt->axesPosition[1]; #else return 0.; #endif @@ -7077,14 +7008,14 @@ double opt_view_axes_ymin(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[2] = val; + opt->axesPosition[2] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[14]->value(opt->AxesPosition[2]); + GUI::instance()->options->view.value[14]->value(opt->axesPosition[2]); } #endif - return opt->AxesPosition[2]; + return opt->axesPosition[2]; #else return 0.; #endif @@ -7095,14 +7026,14 @@ double opt_view_axes_ymax(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[3] = val; + opt->axesPosition[3] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[17]->value(opt->AxesPosition[3]); + GUI::instance()->options->view.value[17]->value(opt->axesPosition[3]); } #endif - return opt->AxesPosition[3]; + return opt->axesPosition[3]; #else return 0.; #endif @@ -7113,14 +7044,14 @@ double opt_view_axes_zmin(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[4] = val; + opt->axesPosition[4] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[15]->value(opt->AxesPosition[4]); + GUI::instance()->options->view.value[15]->value(opt->axesPosition[4]); } #endif - return opt->AxesPosition[4]; + return opt->axesPosition[4]; #else return 0.; #endif @@ -7131,14 +7062,14 @@ double opt_view_axes_zmax(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesPosition[5] = val; + opt->axesPosition[5] = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[18]->value(opt->AxesPosition[5]); + GUI::instance()->options->view.value[18]->value(opt->axesPosition[5]); } #endif - return opt->AxesPosition[5]; + return opt->axesPosition[5]; #else return 0.; #endif @@ -7149,14 +7080,14 @@ double opt_view_axes_tics0(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesTics[0] = (int)val; + opt->axesTics[0] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[3]->value(opt->AxesTics[0]); + GUI::instance()->options->view.value[3]->value(opt->axesTics[0]); } #endif - return opt->AxesTics[0]; + return opt->axesTics[0]; #else return 0.; #endif @@ -7167,14 +7098,14 @@ double opt_view_axes_tics1(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesTics[1] = (int)val; + opt->axesTics[1] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[4]->value(opt->AxesTics[1]); + GUI::instance()->options->view.value[4]->value(opt->axesTics[1]); } #endif - return opt->AxesTics[1]; + return opt->axesTics[1]; #else return 0.; #endif @@ -7185,14 +7116,14 @@ double opt_view_axes_tics2(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AxesTics[2] = (int)val; + opt->axesTics[2] = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.value[5]->value(opt->AxesTics[2]); + GUI::instance()->options->view.value[5]->value(opt->axesTics[2]); } #endif - return opt->AxesTics[2]; + return opt->axesTics[2]; #else return 0.; #endif @@ -7203,14 +7134,14 @@ double opt_view_nb_iso(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->NbIso = (int)val; + opt->nbIso = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[30]->value(opt->NbIso); + GUI::instance()->options->view.value[30]->value(opt->nbIso); #endif - return opt->NbIso; + return opt->nbIso; #else return 0.; #endif @@ -7221,17 +7152,17 @@ double opt_view_boundary(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Boundary = (int)val; - if(opt->Boundary < 0 || opt->Boundary > 3) - opt->Boundary = 0; + opt->boundary = (int)val; + if(opt->boundary < 0 || opt->boundary > 3) + opt->boundary = 0; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[9]->value(opt->Boundary); + GUI::instance()->options->view.choice[9]->value(opt->boundary); } #endif - return opt->Boundary; + return opt->boundary; #else return 0.; #endif @@ -7242,16 +7173,16 @@ double opt_view_light(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Light = (int)val; + opt->light = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - GUI::instance()->options->view.butt[11]->value(opt->Light); + GUI::instance()->options->view.butt[11]->value(opt->light); GUI::instance()->options->activate("view_light"); } #endif - return opt->Light; + return opt->light; #else return 0.; #endif @@ -7262,13 +7193,13 @@ double opt_view_light_two_side(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->LightTwoSide = (int)val; + opt->lightTwoSide = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[9]->value(opt->LightTwoSide); + GUI::instance()->options->view.butt[9]->value(opt->lightTwoSide); #endif - return opt->LightTwoSide; + return opt->lightTwoSide; #else return 0.; #endif @@ -7279,13 +7210,13 @@ double opt_view_light_lines(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->LightLines = (int)val; + opt->lightLines = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[8]->value(opt->LightLines); + GUI::instance()->options->view.butt[8]->value(opt->lightLines); #endif - return opt->LightLines; + return opt->lightLines; #else return 0.; #endif @@ -7296,14 +7227,14 @@ double opt_view_smooth_normals(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->SmoothNormals = (int)val; + opt->smoothNormals = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[12]->value(opt->SmoothNormals); + GUI::instance()->options->view.butt[12]->value(opt->smoothNormals); #endif - return opt->SmoothNormals; + return opt->smoothNormals; #else return 0.; #endif @@ -7314,14 +7245,14 @@ double opt_view_angle_smooth_normals(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->AngleSmoothNormals = val; + opt->angleSmoothNormals = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[10]->value(opt->AngleSmoothNormals); + GUI::instance()->options->view.value[10]->value(opt->angleSmoothNormals); #endif - return opt->AngleSmoothNormals; + return opt->angleSmoothNormals; #else return 0.; #endif @@ -7332,14 +7263,14 @@ double opt_view_show_element(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ShowElement = (int)val; + opt->showElement = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[10]->value(opt->ShowElement); + GUI::instance()->options->view.butt[10]->value(opt->showElement); #endif - return opt->ShowElement; + return opt->showElement; #else return 0.; #endif @@ -7350,15 +7281,15 @@ double opt_view_show_time(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ShowTime = (int)val; - if(opt->ShowTime < 0 || opt->ShowTime > 4) - opt->ShowTime = 0; + opt->showTime = (int)val; + if(opt->showTime < 0 || opt->showTime > 4) + opt->showTime = 0; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.choice[12]->value(opt->ShowTime); + GUI::instance()->options->view.choice[12]->value(opt->showTime); #endif - return opt->ShowTime; + return opt->showTime; #else return 0.; #endif @@ -7369,13 +7300,13 @@ double opt_view_show_scale(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ShowScale = (int)val; + opt->showScale = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[4]->value(opt->ShowScale); + GUI::instance()->options->view.butt[4]->value(opt->showScale); #endif - return opt->ShowScale; + return opt->showScale; #else return 0.; #endif @@ -7386,13 +7317,13 @@ double opt_view_draw_strings(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawStrings = (int)val; + opt->drawStrings = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[5]->value(opt->DrawStrings); + GUI::instance()->options->view.butt[5]->value(opt->drawStrings); #endif - return opt->DrawStrings; + return opt->drawStrings; #else return 0.; #endif @@ -7403,18 +7334,18 @@ double opt_view_draw_points(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawPoints = (int)val; + opt->drawPoints = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawPoints) + if(opt->drawPoints) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[0].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[0].clear(); } #endif - return opt->DrawPoints; + return opt->drawPoints; #else return 0.; #endif @@ -7425,18 +7356,18 @@ double opt_view_draw_lines(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawLines = (int)val; + opt->drawLines = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawLines) + if(opt->drawLines) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[1].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[1].clear(); } #endif - return opt->DrawLines; + return opt->drawLines; #else return 0.; #endif @@ -7447,18 +7378,18 @@ double opt_view_draw_triangles(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawTriangles = (int)val; + opt->drawTriangles = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawTriangles) + if(opt->drawTriangles) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[2].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[2].clear(); } #endif - return opt->DrawTriangles; + return opt->drawTriangles; #else return 0.; #endif @@ -7469,18 +7400,18 @@ double opt_view_draw_quadrangles(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawQuadrangles = (int)val; + opt->drawQuadrangles = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawQuadrangles) + if(opt->drawQuadrangles) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[3].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[3].clear(); } #endif - return opt->DrawQuadrangles; + return opt->drawQuadrangles; #else return 0.; #endif @@ -7491,18 +7422,18 @@ double opt_view_draw_tetrahedra(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawTetrahedra = (int)val; + opt->drawTetrahedra = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawTetrahedra) + if(opt->drawTetrahedra) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[4].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[4].clear(); } #endif - return opt->DrawTetrahedra; + return opt->drawTetrahedra; #else return 0.; #endif @@ -7513,18 +7444,18 @@ double opt_view_draw_hexahedra(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawHexahedra = (int)val; + opt->drawHexahedra = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawHexahedra) + if(opt->drawHexahedra) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[5].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[5].clear(); } #endif - return opt->DrawHexahedra; + return opt->drawHexahedra; #else return 0.; #endif @@ -7535,18 +7466,18 @@ double opt_view_draw_prisms(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawPrisms = (int)val; + opt->drawPrisms = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawPrisms) + if(opt->drawPrisms) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[6].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[6].clear(); } #endif - return opt->DrawPrisms; + return opt->drawPrisms; #else return 0.; #endif @@ -7557,18 +7488,18 @@ double opt_view_draw_pyramids(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawPyramids = (int)val; + opt->drawPyramids = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawPyramids) + if(opt->drawPyramids) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[7].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[1]->menu())[7].clear(); } #endif - return opt->DrawPyramids; + return opt->drawPyramids; #else return 0.; #endif @@ -7579,18 +7510,18 @@ double opt_view_draw_scalars(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawScalars = (int)val; + opt->drawScalars = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawScalars) + if(opt->drawScalars) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[0].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[0].clear(); } #endif - return opt->DrawScalars; + return opt->drawScalars; #else return 0.; #endif @@ -7601,18 +7532,18 @@ double opt_view_draw_vectors(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawVectors = (int)val; + opt->drawVectors = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawVectors) + if(opt->drawVectors) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[1].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[1].clear(); } #endif - return opt->DrawVectors; + return opt->drawVectors; #else return 0.; #endif @@ -7623,18 +7554,18 @@ double opt_view_draw_tensors(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawTensors = (int)val; + opt->drawTensors = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - if(opt->DrawTensors) + if(opt->drawTensors) ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[2].set(); else ((Fl_Menu_Item*)GUI::instance()->options->view.menu[0]->menu())[2].clear(); } #endif - return opt->DrawTensors; + return opt->drawTensors; #else return 0.; #endif @@ -7645,14 +7576,14 @@ double opt_view_draw_skin_only(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->DrawSkinOnly = (int)val; + opt->drawSkinOnly = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.butt[2]->value(opt->DrawSkinOnly); + GUI::instance()->options->view.butt[2]->value(opt->drawSkinOnly); #endif - return opt->DrawSkinOnly; + return opt->drawSkinOnly; #else return 0.; #endif @@ -7663,17 +7594,17 @@ double opt_view_scale_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ScaleType = (int)val; - if(opt->ScaleType < 1 || opt->ScaleType > 3) - opt->ScaleType = 1; + opt->scaleType = (int)val; + if(opt->scaleType < 1 || opt->scaleType > 3) + opt->scaleType = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[1]->value(opt->ScaleType - 1); + GUI::instance()->options->view.choice[1]->value(opt->scaleType - 1); } #endif - return opt->ScaleType; + return opt->scaleType; #else return 0.; #endif @@ -7684,18 +7615,18 @@ double opt_view_range_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->RangeType = (int)val; - if(opt->RangeType < 1 || opt->RangeType > 3) - opt->RangeType = 1; + opt->rangeType = (int)val; + if(opt->rangeType < 1 || opt->rangeType > 3) + opt->rangeType = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - GUI::instance()->options->view.choice[7]->value(opt->RangeType - 1); + GUI::instance()->options->view.choice[7]->value(opt->rangeType - 1); GUI::instance()->options->activate("custom_range"); } #endif - return opt->RangeType; + return opt->rangeType; #else return 0.; #endif @@ -7706,17 +7637,17 @@ double opt_view_tensor_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->TensorType = (int)val; - if(opt->TensorType != 1) - opt->TensorType = 1; + opt->tensorType = (int)val; + if(opt->tensorType != 1) + opt->tensorType = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[4]->value(opt->TensorType - 1); + GUI::instance()->options->view.choice[4]->value(opt->tensorType - 1); } #endif - return opt->TensorType; + return opt->tensorType; #else return 0.; #endif @@ -7727,17 +7658,17 @@ double opt_view_vector_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->VectorType = (int)val; - if(opt->VectorType < 1 || opt->VectorType > 6) - opt->VectorType = 1; + opt->vectorType = (int)val; + if(opt->vectorType < 1 || opt->vectorType > 6) + opt->vectorType = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[2]->value(opt->VectorType - 1); + GUI::instance()->options->view.choice[2]->value(opt->vectorType - 1); } #endif - return opt->VectorType; + return opt->vectorType; #else return 0.; #endif @@ -7748,17 +7679,17 @@ double opt_view_glyph_location(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->GlyphLocation = (int)val; - if(opt->GlyphLocation < 1 || opt->GlyphLocation > 2) - opt->GlyphLocation = 1; + opt->glyphLocation = (int)val; + if(opt->glyphLocation < 1 || opt->glyphLocation > 2) + opt->glyphLocation = 1; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[3]->value(opt->GlyphLocation - 1); + GUI::instance()->options->view.choice[3]->value(opt->glyphLocation - 1); } #endif - return opt->GlyphLocation; + return opt->glyphLocation; #else return 0.; #endif @@ -7769,15 +7700,15 @@ double opt_view_center_glyphs(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CenterGlyphs = val ? 1 : 0; + opt->centerGlyphs = val ? 1 : 0; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.butt[1]->value(opt->CenterGlyphs); + GUI::instance()->options->view.butt[1]->value(opt->centerGlyphs); } #endif - return opt->CenterGlyphs; + return opt->centerGlyphs; #else return 0.; #endif @@ -7788,13 +7719,13 @@ double opt_view_point_size(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->PointSize = val; + opt->pointSize = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[61]->value(opt->PointSize); + GUI::instance()->options->view.value[61]->value(opt->pointSize); #endif - return opt->PointSize; + return opt->pointSize; #else return 0.; #endif @@ -7805,13 +7736,13 @@ double opt_view_line_width(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->LineWidth = val; + opt->lineWidth = val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[62]->value(opt->LineWidth); + GUI::instance()->options->view.value[62]->value(opt->lineWidth); #endif - return opt->LineWidth; + return opt->lineWidth; #else return 0.; #endif @@ -7822,17 +7753,17 @@ double opt_view_point_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->PointType = (int)val; - if(opt->PointType < 0 || opt->PointType > 3) - opt->PointType = 0; + opt->pointType = (int)val; + if(opt->pointType < 0 || opt->pointType > 3) + opt->pointType = 0; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[5]->value(opt->PointType); + GUI::instance()->options->view.choice[5]->value(opt->pointType); } #endif - return opt->PointType; + return opt->pointType; #else return 0.; #endif @@ -7843,17 +7774,17 @@ double opt_view_line_type(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->LineType = (int)val; - if(opt->LineType < 0 || opt->LineType > 2) - opt->LineType = 0; + opt->lineType = (int)val; + if(opt->lineType < 0 || opt->lineType > 2) + opt->lineType = 0; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) { - GUI::instance()->options->view.choice[6]->value(opt->LineType); + GUI::instance()->options->view.choice[6]->value(opt->lineType); } #endif - return opt->LineType; + return opt->lineType; #else return 0.; #endif @@ -7864,8 +7795,8 @@ double opt_view_colormap_alpha(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.dpar[COLORTABLE_ALPHA] = val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.dpar[COLORTABLE_ALPHA] = val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7873,7 +7804,7 @@ double opt_view_colormap_alpha(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.dpar[COLORTABLE_ALPHA]; + return opt->colorTable.dpar[COLORTABLE_ALPHA]; #else return 0.; #endif @@ -7884,8 +7815,8 @@ double opt_view_colormap_alpha_power(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.dpar[COLORTABLE_ALPHAPOW] = val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.dpar[COLORTABLE_ALPHAPOW] = val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7893,7 +7824,7 @@ double opt_view_colormap_alpha_power(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.dpar[COLORTABLE_ALPHAPOW]; + return opt->colorTable.dpar[COLORTABLE_ALPHAPOW]; #else return 0.; #endif @@ -7904,8 +7835,8 @@ double opt_view_colormap_beta(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.dpar[COLORTABLE_BETA] = val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.dpar[COLORTABLE_BETA] = val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7913,7 +7844,7 @@ double opt_view_colormap_beta(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.dpar[COLORTABLE_BETA]; + return opt->colorTable.dpar[COLORTABLE_BETA]; #else return 0.; #endif @@ -7924,8 +7855,8 @@ double opt_view_colormap_bias(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.dpar[COLORTABLE_BIAS] = val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.dpar[COLORTABLE_BIAS] = val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7933,7 +7864,7 @@ double opt_view_colormap_bias(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.dpar[COLORTABLE_BIAS]; + return opt->colorTable.dpar[COLORTABLE_BIAS]; #else return 0.; #endif @@ -7944,8 +7875,8 @@ double opt_view_colormap_curvature(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.dpar[COLORTABLE_CURVATURE] = val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.dpar[COLORTABLE_CURVATURE] = val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7953,7 +7884,7 @@ double opt_view_colormap_curvature(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.dpar[COLORTABLE_CURVATURE]; + return opt->colorTable.dpar[COLORTABLE_CURVATURE]; #else return 0.; #endif @@ -7964,8 +7895,8 @@ double opt_view_colormap_invert(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.ipar[COLORTABLE_INVERT] = (int)val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.ipar[COLORTABLE_INVERT] = (int)val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7973,7 +7904,7 @@ double opt_view_colormap_invert(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.ipar[COLORTABLE_INVERT]; + return opt->colorTable.ipar[COLORTABLE_INVERT]; #else return 0.; #endif @@ -7984,8 +7915,8 @@ double opt_view_colormap_number(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.ipar[COLORTABLE_NUMBER] = (int)val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.ipar[COLORTABLE_NUMBER] = (int)val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -7993,7 +7924,7 @@ double opt_view_colormap_number(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.ipar[COLORTABLE_NUMBER]; + return opt->colorTable.ipar[COLORTABLE_NUMBER]; #else return 0.; #endif @@ -8004,8 +7935,8 @@ double opt_view_colormap_rotation(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.ipar[COLORTABLE_ROTATION] = (int)val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.ipar[COLORTABLE_ROTATION] = (int)val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -8013,7 +7944,7 @@ double opt_view_colormap_rotation(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.ipar[COLORTABLE_ROTATION]; + return opt->colorTable.ipar[COLORTABLE_ROTATION]; #else return 0.; #endif @@ -8024,8 +7955,8 @@ double opt_view_colormap_swap(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->CT.ipar[COLORTABLE_SWAP] = (int)val; - ColorTable_Recompute(&opt->CT); + opt->colorTable.ipar[COLORTABLE_SWAP] = (int)val; + ColorTable_Recompute(&opt->colorTable); if(view) view->setChanged(true); } #if defined(HAVE_FLTK) @@ -8033,7 +7964,7 @@ double opt_view_colormap_swap(OPT_ARGS_NUM) GUI::instance()->options->view.colorbar->redraw(); } #endif - return opt->CT.ipar[COLORTABLE_SWAP]; + return opt->colorTable.ipar[COLORTABLE_SWAP]; #else return 0.; #endif @@ -8044,20 +7975,20 @@ double opt_view_external_view(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ExternalViewIndex = (int)val; + opt->externalViewIndex = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ // warning: Fl_Choice::size() returns number of items+1 - int item = opt->ExternalViewIndex + 1; + int item = opt->externalViewIndex + 1; if(item > -1 && item < GUI::instance()->options->view.choice[10]->size()-1) GUI::instance()->options->view.choice[10]->value(item); else GUI::instance()->options->view.choice[10]->value(0); } #endif - return opt->ExternalViewIndex; + return opt->externalViewIndex; #else return 0.; #endif @@ -8068,20 +7999,20 @@ double opt_view_gen_raise_view(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->ViewIndexForGenRaise = (int)val; + opt->viewIndexForGenRaise = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ // warning: Fl_Choice::size() returns number of items+1 - int item = opt->ViewIndexForGenRaise + 1; + int item = opt->viewIndexForGenRaise + 1; if(item > -1 && item < GUI::instance()->options->view.choice[11]->size()-1) GUI::instance()->options->view.choice[11]->value(item); else GUI::instance()->options->view.choice[11]->value(0); } #endif - return opt->ViewIndexForGenRaise; + return opt->viewIndexForGenRaise; #else return 0.; #endif @@ -8092,14 +8023,14 @@ double opt_view_gen_raise_factor(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->GenRaiseFactor = val; + opt->genRaiseFactor = val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)) - GUI::instance()->options->view.value[2]->value(opt->GenRaiseFactor); + GUI::instance()->options->view.value[2]->value(opt->genRaiseFactor); #endif - return opt->GenRaiseFactor; + return opt->genRaiseFactor; #else return 0.; #endif @@ -8110,16 +8041,16 @@ double opt_view_use_gen_raise(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->UseGenRaise = (int)val; + opt->useGenRaise = (int)val; if(view) view->setChanged(true); } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - GUI::instance()->options->view.butt[6]->value(opt->UseGenRaise); + GUI::instance()->options->view.butt[6]->value(opt->useGenRaise); GUI::instance()->options->activate("view_general_transform"); } #endif - return opt->UseGenRaise; + return opt->useGenRaise; #else return 0.; #endif @@ -8130,14 +8061,14 @@ double opt_view_use_stipple(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->UseStipple = (int)val; + opt->useStipple = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ - GUI::instance()->options->view.butt[26]->value(opt->UseStipple); + GUI::instance()->options->view.butt[26]->value(opt->useStipple); } #endif - return opt->UseStipple; + return opt->useStipple; #else return 0.; #endif @@ -8148,14 +8079,14 @@ double opt_view_clip(OPT_ARGS_NUM) #if !defined(HAVE_NO_POST) GET_VIEW(0.); if(action & GMSH_SET) { - opt->Clip = (int)val; + opt->clip = (int)val; } #if defined(HAVE_FLTK) if(_gui_action_valid(action, num)){ GUI::instance()->clipping->resetBrowser(); } #endif - return opt->Clip; + return opt->clip; #else return 0.; #endif @@ -8171,148 +8102,148 @@ double opt_print_format(OPT_ARGS_NUM) double opt_print_eps_compress(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_compress = (int)val; - return CTX::instance()->print.eps_compress; + CTX::instance()->print.epsCompress = (int)val; + return CTX::instance()->print.epsCompress; } double opt_print_eps_ps3shading(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_ps3shading = (int)val; - return CTX::instance()->print.eps_ps3shading; + CTX::instance()->print.epsPS3Shading = (int)val; + return CTX::instance()->print.epsPS3Shading; } double opt_print_eps_quality(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_quality = (int)val; - return CTX::instance()->print.eps_quality; + CTX::instance()->print.epsQuality = (int)val; + return CTX::instance()->print.epsQuality; } double opt_print_eps_occlusion_culling(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_occlusion_culling = (int)val; - return CTX::instance()->print.eps_occlusion_culling; + CTX::instance()->print.epsOcclusionCulling = (int)val; + return CTX::instance()->print.epsOcclusionCulling; } double opt_print_eps_best_root(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_best_root = (int)val; - return CTX::instance()->print.eps_best_root; + CTX::instance()->print.epsBestRoot = (int)val; + return CTX::instance()->print.epsBestRoot; } double opt_print_eps_background(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_background = (int)val; - return CTX::instance()->print.eps_background; + CTX::instance()->print.epsBackground = (int)val; + return CTX::instance()->print.epsBackground; } double opt_print_eps_line_width_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_line_width_factor = val; - return CTX::instance()->print.eps_line_width_factor; + CTX::instance()->print.epsLineWidthFactor = val; + return CTX::instance()->print.epsLineWidthFactor; } double opt_print_eps_point_size_factor(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.eps_point_size_factor = val; - return CTX::instance()->print.eps_point_size_factor; + CTX::instance()->print.epsPointSizeFactor = val; + return CTX::instance()->print.epsPointSizeFactor; } double opt_print_jpeg_quality(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.jpeg_quality = (int)val; - return CTX::instance()->print.jpeg_quality; + CTX::instance()->print.jpegQuality = (int)val; + return CTX::instance()->print.jpegQuality; } double opt_print_jpeg_smoothing(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.jpeg_smoothing = (int)val; - return CTX::instance()->print.jpeg_smoothing; + CTX::instance()->print.jpegSmoothing = (int)val; + return CTX::instance()->print.jpegSmoothing; } double opt_print_geo_labels(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.geo_labels = (int)val; - return CTX::instance()->print.geo_labels; + CTX::instance()->print.geoLabels = (int)val; + return CTX::instance()->print.geoLabels; } double opt_print_pos_elementary(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_elementary = (int)val; - return CTX::instance()->print.pos_elementary; + CTX::instance()->print.posElementary = (int)val; + return CTX::instance()->print.posElementary; } double opt_print_pos_element(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_element = (int)val; - return CTX::instance()->print.pos_element; + CTX::instance()->print.posElement = (int)val; + return CTX::instance()->print.posElement; } double opt_print_pos_gamma(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_gamma = (int)val; - return CTX::instance()->print.pos_gamma; + CTX::instance()->print.posGamma = (int)val; + return CTX::instance()->print.posGamma; } double opt_print_pos_eta(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_eta = (int)val; - return CTX::instance()->print.pos_eta; + CTX::instance()->print.posEta = (int)val; + return CTX::instance()->print.posEta; } double opt_print_pos_rho(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_rho = (int)val; - return CTX::instance()->print.pos_rho; + CTX::instance()->print.posRho = (int)val; + return CTX::instance()->print.posRho; } double opt_print_pos_disto(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.pos_disto = (int)val; - return CTX::instance()->print.pos_disto; + CTX::instance()->print.posDisto = (int)val; + return CTX::instance()->print.posDisto; } double opt_print_gif_dither(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.gif_dither = (int)val; - return CTX::instance()->print.gif_dither; + CTX::instance()->print.gifDither = (int)val; + return CTX::instance()->print.gifDither; } double opt_print_gif_sort(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.gif_sort = (int)val; - return CTX::instance()->print.gif_sort; + CTX::instance()->print.gifSort = (int)val; + return CTX::instance()->print.gifSort; } double opt_print_gif_interlace(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.gif_interlace = (int)val; - return CTX::instance()->print.gif_interlace; + CTX::instance()->print.gifInterlace = (int)val; + return CTX::instance()->print.gifInterlace; } double opt_print_gif_transparent(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.gif_transparent = (int)val; - return CTX::instance()->print.gif_transparent; + CTX::instance()->print.gifTransparent = (int)val; + return CTX::instance()->print.gifTransparent; } double opt_print_text(OPT_ARGS_NUM) @@ -8325,8 +8256,8 @@ double opt_print_text(OPT_ARGS_NUM) double opt_print_tex_as_equation(OPT_ARGS_NUM) { if(action & GMSH_SET) - CTX::instance()->print.tex_as_equation = (int)val; - return CTX::instance()->print.tex_as_equation; + CTX::instance()->print.texAsEquation = (int)val; + return CTX::instance()->print.texAsEquation; } // Color option routines @@ -8335,9 +8266,9 @@ double opt_print_tex_as_equation(OPT_ARGS_NUM) #define CCC(col,but) \ if(GUI::available() && (action & GMSH_GUI)){ \ - Fl_Color c = fl_color_cube(CTX::instance()->unpack_red(col)*FL_NUM_RED/256, \ - CTX::instance()->unpack_green(col)*FL_NUM_GREEN/256, \ - CTX::instance()->unpack_blue(col)*FL_NUM_BLUE/256); \ + Fl_Color c = fl_color_cube(CTX::instance()->unpackRed(col)*FL_NUM_RED/256, \ + CTX::instance()->unpackGreen(col)*FL_NUM_GREEN/256, \ + CTX::instance()->unpackBlue(col)*FL_NUM_BLUE/256); \ (but)->color(c); \ (but)->labelcolor(fl_contrast(FL_BLACK,c)); \ (but)->redraw(); \ @@ -8363,11 +8294,11 @@ unsigned int opt_general_color_background(OPT_ARGS_COL) unsigned int opt_general_color_background_gradient(OPT_ARGS_COL) { if(action & GMSH_SET) - CTX::instance()->color.bg_grad = val; + CTX::instance()->color.bgGrad = val; #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.bg_grad, GUI::instance()->options->general.color[1]); + CCC(CTX::instance()->color.bgGrad, GUI::instance()->options->general.color[1]); #endif - return CTX::instance()->color.bg_grad; + return CTX::instance()->color.bgGrad; } unsigned int opt_general_color_foreground(OPT_ARGS_COL) @@ -8403,44 +8334,44 @@ unsigned int opt_general_color_axes(OPT_ARGS_COL) unsigned int opt_general_color_small_axes(OPT_ARGS_COL) { if(action & GMSH_SET) - CTX::instance()->color.small_axes = val; + CTX::instance()->color.smallAxes = val; #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.small_axes, GUI::instance()->options->general.color[5]); + CCC(CTX::instance()->color.smallAxes, GUI::instance()->options->general.color[5]); #endif - return CTX::instance()->color.small_axes; + return CTX::instance()->color.smallAxes; } unsigned int opt_general_color_ambient_light(OPT_ARGS_COL) { if(action & GMSH_SET) for(int i = 0; i < 6; i++) - CTX::instance()->color.ambient_light[i] = val; + CTX::instance()->color.ambientLight[i] = val; #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.ambient_light[0], GUI::instance()->options->general.color[6]); + CCC(CTX::instance()->color.ambientLight[0], GUI::instance()->options->general.color[6]); #endif - return CTX::instance()->color.ambient_light[0]; + return CTX::instance()->color.ambientLight[0]; } unsigned int opt_general_color_diffuse_light(OPT_ARGS_COL) { if(action & GMSH_SET) for(int i = 0; i < 6; i++) - CTX::instance()->color.diffuse_light[i] = val; + CTX::instance()->color.diffuseLight[i] = val; #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.diffuse_light[0], GUI::instance()->options->general.color[7]); + CCC(CTX::instance()->color.diffuseLight[0], GUI::instance()->options->general.color[7]); #endif - return CTX::instance()->color.diffuse_light[0]; + return CTX::instance()->color.diffuseLight[0]; } unsigned int opt_general_color_specular_light(OPT_ARGS_COL) { if(action & GMSH_SET) for(int i = 0; i < 6; i++) - CTX::instance()->color.specular_light[i] = val; + CTX::instance()->color.specularLight[i] = val; #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.specular_light[0], GUI::instance()->options->general.color[8]); + CCC(CTX::instance()->color.specularLight[0], GUI::instance()->options->general.color[8]); #endif - return CTX::instance()->color.specular_light[0]; + return CTX::instance()->color.specularLight[0]; } unsigned int opt_geometry_color_points(OPT_ARGS_COL) @@ -8570,12 +8501,12 @@ unsigned int opt_mesh_color_points(OPT_ARGS_COL) unsigned int opt_mesh_color_points_sup(OPT_ARGS_COL) { if(action & GMSH_SET) { - CTX::instance()->color.mesh.vertex_sup = val; + CTX::instance()->color.mesh.vertexSup = val; } #if defined(HAVE_FLTK) - CCC(CTX::instance()->color.mesh.vertex_sup, GUI::instance()->options->mesh.color[1]); + CCC(CTX::instance()->color.mesh.vertexSup, GUI::instance()->options->mesh.color[1]); #endif - return CTX::instance()->color.mesh.vertex_sup; + return CTX::instance()->color.mesh.vertexSup; } unsigned int opt_mesh_color_lines(OPT_ARGS_COL) @@ -8584,7 +8515,7 @@ unsigned int opt_mesh_color_lines(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.line != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); CTX::instance()->color.mesh.line = val; } @@ -8600,7 +8531,7 @@ unsigned int opt_mesh_color_triangles(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.triangle != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_SURFACE; CTX::instance()->color.mesh.triangle = val; } @@ -8616,7 +8547,7 @@ unsigned int opt_mesh_color_quadrangles(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.quadrangle != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_SURFACE; CTX::instance()->color.mesh.quadrangle = val; } @@ -8632,7 +8563,7 @@ unsigned int opt_mesh_color_tetrahedra(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.tetrahedron != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_VOLUME; CTX::instance()->color.mesh.tetrahedron = val; } @@ -8648,7 +8579,7 @@ unsigned int opt_mesh_color_hexahedra(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.hexahedron != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_VOLUME; CTX::instance()->color.mesh.hexahedron = val; } @@ -8665,7 +8596,7 @@ unsigned int opt_mesh_color_prisms(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.prism != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_VOLUME; CTX::instance()->color.mesh.prism = val; } @@ -8681,7 +8612,7 @@ unsigned int opt_mesh_color_pyramid(OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // element type if(CTX::instance()->color.mesh.pyramid != val && - CTX::instance()->mesh.color_carousel == 0) + CTX::instance()->mesh.colorCarousel == 0) CTX::instance()->mesh.changed |= ENT_VOLUME; CTX::instance()->color.mesh.pyramid = val; } @@ -8719,7 +8650,7 @@ unsigned int opt_mesh_color_(int i, OPT_ARGS_COL) // vertex arrays need to be regenerated only when we color by // partition if(CTX::instance()->color.mesh.carousel[i] != val && - CTX::instance()->mesh.color_carousel == 3) + CTX::instance()->mesh.colorCarousel == 3) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); CTX::instance()->color.mesh.carousel[i] = val; } diff --git a/Common/Options.h b/Common/Options.h index 0dfcdceac468b8f45560b1b236145243313e34ab..0866394d24e5efb48701f8c89faba07ecd842989 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -491,7 +491,6 @@ double opt_mesh_min_circ_points(OPT_ARGS_NUM); double opt_mesh_allow_swap_edge_angle(OPT_ARGS_NUM); double opt_mesh_min_curv_points(OPT_ARGS_NUM); double opt_mesh_order(OPT_ARGS_NUM); -double opt_mesh_c1(OPT_ARGS_NUM); double opt_mesh_smooth_internal_edges(OPT_ARGS_NUM); double opt_mesh_second_order_experimental(OPT_ARGS_NUM); double opt_mesh_second_order_linear(OPT_ARGS_NUM); @@ -534,7 +533,6 @@ double opt_mesh_partition_metis_algorithm(OPT_ARGS_NUM); double opt_mesh_partition_metis_edge_matching(OPT_ARGS_NUM); double opt_mesh_partition_metis_refine_algorithm(OPT_ARGS_NUM); double opt_mesh_clip(OPT_ARGS_NUM); -double opt_solver_max_delay(OPT_ARGS_NUM); double opt_solver_listen(OPT_ARGS_NUM); double opt_solver_plugins(OPT_ARGS_NUM); double opt_solver_client_server(OPT_ARGS_NUM); diff --git a/Common/VertexArray.cpp b/Common/VertexArray.cpp index 6d1d93b16ab1e6e52ff3522c0e45ff40cd2938ed..d02a2df8a760dc052051f985633615f1d56b76c6 100644 --- a/Common/VertexArray.cpp +++ b/Common/VertexArray.cpp @@ -50,7 +50,7 @@ void VertexArray::_addColor(unsigned char r, unsigned char g, unsigned char b, void VertexArray::_addElement(MElement *ele) { - if(ele && CTX::instance()->pick_elements) _elements.push_back(ele); + if(ele && CTX::instance()->pickElements) _elements.push_back(ele); } void VertexArray::add(double *x, double *y, double *z, SVector3 *n, @@ -60,10 +60,10 @@ void VertexArray::add(double *x, double *y, double *z, SVector3 *n, unsigned char r[100], g[100], b[100], a[100]; int npe = getNumVerticesPerElement(); for(int i = 0; i < npe; i++){ - r[i] = CTX::instance()->unpack_red(col[i]); - g[i] = CTX::instance()->unpack_green(col[i]); - b[i] = CTX::instance()->unpack_blue(col[i]); - a[i] = CTX::instance()->unpack_alpha(col[i]); + r[i] = CTX::instance()->unpackRed(col[i]); + g[i] = CTX::instance()->unpackGreen(col[i]); + b[i] = CTX::instance()->unpackBlue(col[i]); + a[i] = CTX::instance()->unpackAlpha(col[i]); } add(x, y, z, n, r, g, b, a, ele, unique, boundary); } diff --git a/Fltk/Draw.cpp b/Fltk/Draw.cpp index 64e1b44fcce737f6047b326cdd78de6c1c136f9c..6107cb186d46fc6aab9e462f111ceae278dc469a 100644 --- a/Fltk/Draw.cpp +++ b/Fltk/Draw.cpp @@ -28,17 +28,17 @@ void Draw() void DrawPlugin(void (*draw)(void *context)) { - CTX::instance()->post.plugin_draw_function = draw; - int old = CTX::instance()->draw_bbox; - CTX::instance()->draw_bbox = 1; - if(CTX::instance()->fast_redraw){ + CTX::instance()->post.pluginDrawFunction = draw; + int old = CTX::instance()->drawBBox; + CTX::instance()->drawBBox = 1; + if(CTX::instance()->fastRedraw){ CTX::instance()->post.draw = 0; CTX::instance()->mesh.draw = 0; } Draw(); // this is reset in each plugin run/cancel callback: - // CTX::instance()->post.plugin_draw_function = NULL; - CTX::instance()->draw_bbox = old; + // CTX::instance()->post.pluginDrawFunction = NULL; + CTX::instance()->drawBBox = old; CTX::instance()->post.draw = 1; CTX::instance()->mesh.draw = 1; } @@ -48,9 +48,9 @@ void DrawCurrentOpenglWindow(bool make_current) if(!GUI::available()) return; openglWindow *gl = GUI::instance()->getCurrentOpenglWindow(); if(make_current) gl->make_current(); - glClearColor(CTX::instance()->unpack_red(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_green(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_blue(CTX::instance()->color.bg) / 255., 0.); + glClearColor(CTX::instance()->unpackRed(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackGreen(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackBlue(CTX::instance()->color.bg) / 255., 0.); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); gl->getDrawContext()->draw3d(); gl->getDrawContext()->draw2d(); @@ -133,8 +133,8 @@ int GetFontAlign(const char *alignstr) int GetFontSize() { - if(CTX::instance()->fontsize > 0){ - return CTX::instance()->fontsize; + if(CTX::instance()->fontSize > 0){ + return CTX::instance()->fontSize; } else{ int w = Fl::w(); diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index e4710720c9a3df1800fbc017a26ff82137c4f1f4..eccb8e6f4828fb0c6b47a08a4a63ebebfa7b6c54 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -59,8 +59,8 @@ GUI::GUI(int argc, char **argv) FL_NORMAL_SIZE = GetFontSize(); // handle themes and tooltip font size - if(CTX::instance()->gui_theme.size()) - Fl::scheme(CTX::instance()->gui_theme.c_str()); + if(CTX::instance()->guiTheme.size()) + Fl::scheme(CTX::instance()->guiTheme.c_str()); Fl_Tooltip::size(FL_NORMAL_SIZE); // register image formats not in core fltk library (jpeg/png) @@ -78,7 +78,7 @@ GUI::GUI(int argc, char **argv) // since the shortcuts should be valid even for hidden windows, and // we don't want to test for widget existence every time menu = new menuWindow(); - graph.push_back(new graphicWindow(true, CTX::instance()->num_tiles)); + graph.push_back(new graphicWindow(true, CTX::instance()->numTiles)); #if defined(WIN32) graph[0]->win->icon @@ -118,27 +118,27 @@ GUI::GUI(int argc, char **argv) graph[0]->gl[0]->take_focus(); // create additional graphic windows - for(int i = 1; i < CTX::instance()->num_windows; i++){ - graphicWindow *g = new graphicWindow(false, CTX::instance()->num_tiles); + for(int i = 1; i < CTX::instance()->numWindows; i++){ + graphicWindow *g = new graphicWindow(false, CTX::instance()->numTiles); g->win->resize(graph.back()->win->x() + 10, graph.back()->win->y() + 10, graph.back()->win->w(), graph.back()->win->h()); g->win->show(); graph.push_back(g); } - options = new optionWindow(CTX::instance()->deltafontsize); - fields = new fieldWindow(CTX::instance()->deltafontsize); - plugins = new pluginWindow(CTX::instance()->deltafontsize); - stats = new statisticsWindow(CTX::instance()->deltafontsize); - visibility = new visibilityWindow(CTX::instance()->deltafontsize); - clipping = new clippingWindow(CTX::instance()->deltafontsize); - messages = new messageWindow(CTX::instance()->deltafontsize); - manip = new manipWindow(CTX::instance()->deltafontsize); - geoContext = new geometryContextWindow(CTX::instance()->deltafontsize); - meshContext = new meshContextWindow(CTX::instance()->deltafontsize); + options = new optionWindow(CTX::instance()->deltaFontSize); + fields = new fieldWindow(CTX::instance()->deltaFontSize); + plugins = new pluginWindow(CTX::instance()->deltaFontSize); + stats = new statisticsWindow(CTX::instance()->deltaFontSize); + visibility = new visibilityWindow(CTX::instance()->deltaFontSize); + clipping = new clippingWindow(CTX::instance()->deltaFontSize); + messages = new messageWindow(CTX::instance()->deltaFontSize); + manip = new manipWindow(CTX::instance()->deltaFontSize); + geoContext = new geometryContextWindow(CTX::instance()->deltaFontSize); + meshContext = new meshContextWindow(CTX::instance()->deltaFontSize); about = new aboutWindow(); for(int i = 0; i < MAX_NUM_SOLVERS; i++) - solver.push_back(new solverWindow(i, CTX::instance()->deltafontsize)); + solver.push_back(new solverWindow(i, CTX::instance()->deltaFontSize)); // init solver plugin stuff callForSolverPlugin(-1); @@ -609,40 +609,40 @@ void GUI::setStatus(const char *msg, int num) void GUI::storeCurrentWindowsInfo() { - CTX::instance()->position[0] = menu->win->x(); - CTX::instance()->position[1] = menu->win->y(); - CTX::instance()->gl_position[0] = graph[0]->win->x(); - CTX::instance()->gl_position[1] = graph[0]->win->y(); - CTX::instance()->gl_size[0] = graph[0]->win->w(); - CTX::instance()->gl_size[1] = (graph[0]->win->h() - graph[0]->bottom->h()); - CTX::instance()->msg_position[0] = messages->win->x(); - CTX::instance()->msg_position[1] = messages->win->y(); - CTX::instance()->msg_size[0] = messages->win->w(); - CTX::instance()->msg_size[1] = messages->win->h(); - CTX::instance()->opt_position[0] = options->win->x(); - CTX::instance()->opt_position[1] = options->win->y(); - CTX::instance()->plugin_position[0] = plugins->win->x(); - CTX::instance()->plugin_position[1] = plugins->win->y(); - CTX::instance()->plugin_size[0] = plugins->win->w(); - CTX::instance()->plugin_size[1] = plugins->win->h(); - CTX::instance()->field_position[0] = fields->win->x(); - CTX::instance()->field_position[1] = fields->win->y(); - CTX::instance()->field_size[0] = fields->win->w(); - CTX::instance()->field_size[1] = fields->win->h(); - CTX::instance()->stat_position[0] = stats->win->x(); - CTX::instance()->stat_position[1] = stats->win->y(); - CTX::instance()->vis_position[0] = visibility->win->x(); - CTX::instance()->vis_position[1] = visibility->win->y(); - CTX::instance()->clip_position[0] = clipping->win->x(); - CTX::instance()->clip_position[1] = clipping->win->y(); - CTX::instance()->manip_position[0] = manip->win->x(); - CTX::instance()->manip_position[1] = manip->win->y(); - CTX::instance()->ctx_position[0] = geoContext->win->x(); - CTX::instance()->ctx_position[1] = meshContext->win->y(); - CTX::instance()->solver_position[0] = solver[0]->win->x(); - CTX::instance()->solver_position[1] = solver[0]->win->y(); - file_chooser_get_position(&CTX::instance()->file_chooser_position[0], - &CTX::instance()->file_chooser_position[1]); + CTX::instance()->menuPosition[0] = menu->win->x(); + CTX::instance()->menuPosition[1] = menu->win->y(); + CTX::instance()->glPosition[0] = graph[0]->win->x(); + CTX::instance()->glPosition[1] = graph[0]->win->y(); + CTX::instance()->glSize[0] = graph[0]->win->w(); + CTX::instance()->glSize[1] = (graph[0]->win->h() - graph[0]->bottom->h()); + CTX::instance()->msgPosition[0] = messages->win->x(); + CTX::instance()->msgPosition[1] = messages->win->y(); + CTX::instance()->msgSize[0] = messages->win->w(); + CTX::instance()->msgSize[1] = messages->win->h(); + CTX::instance()->optPosition[0] = options->win->x(); + CTX::instance()->optPosition[1] = options->win->y(); + CTX::instance()->pluginPosition[0] = plugins->win->x(); + CTX::instance()->pluginPosition[1] = plugins->win->y(); + CTX::instance()->pluginSize[0] = plugins->win->w(); + CTX::instance()->pluginSize[1] = plugins->win->h(); + CTX::instance()->fieldPosition[0] = fields->win->x(); + CTX::instance()->fieldPosition[1] = fields->win->y(); + CTX::instance()->fieldSize[0] = fields->win->w(); + CTX::instance()->fieldSize[1] = fields->win->h(); + CTX::instance()->statPosition[0] = stats->win->x(); + CTX::instance()->statPosition[1] = stats->win->y(); + CTX::instance()->visPosition[0] = visibility->win->x(); + CTX::instance()->visPosition[1] = visibility->win->y(); + CTX::instance()->clipPosition[0] = clipping->win->x(); + CTX::instance()->clipPosition[1] = clipping->win->y(); + CTX::instance()->manipPosition[0] = manip->win->x(); + CTX::instance()->manipPosition[1] = manip->win->y(); + CTX::instance()->ctxPosition[0] = geoContext->win->x(); + CTX::instance()->ctxPosition[1] = meshContext->win->y(); + CTX::instance()->solverPosition[0] = solver[0]->win->x(); + CTX::instance()->solverPosition[1] = solver[0]->win->y(); + file_chooser_get_position(&CTX::instance()->fileChooserPosition[0], + &CTX::instance()->fileChooserPosition[1]); } void GUI::callForSolverPlugin(int dim) diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index 8fdbea82f8f07df5f283229c6fdbefcc49a8a44d..fc287a20c3be726a121375a15b9e2ea02581d250 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) Msg::Info("Build date : %s", Get_GmshBuildDate()); Msg::Info("Build host : %s", Get_GmshBuildHost()); Msg::Info("Packager : %s", Get_GmshPackager()); - Msg::Info("Home directory : %s", CTX::instance()->home_dir.c_str()); + Msg::Info("Home directory : %s", CTX::instance()->homeDir.c_str()); Msg::Info("Launch date : %s", Msg::GetLaunchDate().c_str()); Msg::Info("Command line : %s", Msg::GetCommandLine().c_str()); Msg::Info("-------------------------------------------------------"); @@ -83,13 +83,13 @@ int main(int argc, char *argv[]) MergeFile(CTX::instance()->files[i]); } - if(CTX::instance()->post.combine_time){ - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + if(CTX::instance()->post.combineTime){ + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); } // Init first context - switch (CTX::instance()->initial_context) { + switch (CTX::instance()->initialContext) { case 1: GUI::instance()->menu->setContext(menu_geometry, 0); break; case 2: GUI::instance()->menu->setContext(menu_mesh, 0); break; case 3: GUI::instance()->menu->setContext(menu_solver, 0); break; @@ -103,8 +103,8 @@ int main(int argc, char *argv[]) } // Read background mesh if any - if(!CTX::instance()->bgm_filename.empty()) { - MergeFile(CTX::instance()->bgm_filename); + if(!CTX::instance()->bgmFileName.empty()) { + MergeFile(CTX::instance()->bgmFileName); if(PView::list.size()) GModel::current()->getFields()->set_background_mesh(PView::list.size() - 1); else diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp index 02e108817fe7502caab14c3e4c61baa15e8d4710..50e83968250c023838131491443c1f8899c04879 100644 --- a/Fltk/Solvers.cpp +++ b/Fltk/Solvers.cpp @@ -82,7 +82,7 @@ int Solver(int num, const char *args) #if !defined(WIN32) command += " &"; #endif - server->StartClient(command.c_str(), 0, CTX::instance()->solver.max_delay); + server->StartClient(command.c_str(), 0, 4.0); return 1; } } @@ -95,21 +95,21 @@ int Solver(int num, const char *args) prog = command = ""; } - if(!strstr(CTX::instance()->solver.socket_name.c_str(), ":")){ + if(!strstr(CTX::instance()->solver.socketName.c_str(), ":")){ // Unix socket char tmp[1024]; if(num >= 0) - sprintf(tmp, "%s%s-%d", CTX::instance()->home_dir.c_str(), - CTX::instance()->solver.socket_name.c_str(), + sprintf(tmp, "%s%s-%d", CTX::instance()->homeDir.c_str(), + CTX::instance()->solver.socketName.c_str(), num); else - sprintf(tmp, "%s%s", CTX::instance()->home_dir.c_str(), - CTX::instance()->solver.socket_name.c_str()); + sprintf(tmp, "%s%s", CTX::instance()->homeDir.c_str(), + CTX::instance()->solver.socketName.c_str()); sockname = FixWindowsPath(tmp); } else{ // TCP/IP socket - sockname = CTX::instance()->solver.socket_name; + sockname = CTX::instance()->solver.socketName; // if only the port is given, prepend the host name if(sockname.size() && sockname[0] == ':') sockname = GetHostName() + sockname; @@ -125,8 +125,7 @@ int Solver(int num, const char *args) #endif } - int sock = server->StartClient(command.c_str(), sockname.c_str(), - CTX::instance()->solver.max_delay); + int sock = server->StartClient(command.c_str(), sockname.c_str(), 4.0); if(sock < 0) { switch (sock) { diff --git a/Fltk/aboutWindow.cpp b/Fltk/aboutWindow.cpp index a99ce24b7f777e80cd30276aea17f9bdd48ef08c..0ccda22976f90be434023c7a586adeb0b837e722 100644 --- a/Fltk/aboutWindow.cpp +++ b/Fltk/aboutWindow.cpp @@ -16,7 +16,7 @@ static void help_license_cb(Fl_Widget *w, void *data) { - std::string prog = FixWindowsPath(CTX::instance()->web_browser.c_str()); + std::string prog = FixWindowsPath(CTX::instance()->webBrowser.c_str()); char cmd[1024]; ReplaceMultiFormat(prog.c_str(), "http://geuz.org/gmsh/doc/LICENSE.txt", cmd); SystemCall(cmd); @@ -24,7 +24,7 @@ static void help_license_cb(Fl_Widget *w, void *data) static void help_credits_cb(Fl_Widget *w, void *data) { - std::string prog = FixWindowsPath(CTX::instance()->web_browser.c_str()); + std::string prog = FixWindowsPath(CTX::instance()->webBrowser.c_str()); char cmd[1024]; ReplaceMultiFormat(prog.c_str(), "http://geuz.org/gmsh/doc/CREDITS.txt", cmd); SystemCall(cmd); @@ -42,7 +42,7 @@ aboutWindow::aboutWindow() int height = 15 * BH + BH/2; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "About Gmsh"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh"); win->box(GMSH_WINDOW_BOX); { diff --git a/Fltk/classificationEditor.cpp b/Fltk/classificationEditor.cpp index 62f98de41cd24696624da65fd76c2ab11d51c703..29f220b6eb5e428c3cff71f781109c51bad80d2b 100644 --- a/Fltk/classificationEditor.cpp +++ b/Fltk/classificationEditor.cpp @@ -89,7 +89,7 @@ static void class_deleteedge_cb(Fl_Widget *w, void *data) classificationEditor *e = (classificationEditor*)data; std::vector<MLine*> ele; - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; while(1) { CTX::instance()->mesh.changed = ENT_ALL; @@ -100,7 +100,7 @@ static void class_deleteedge_cb(Fl_Widget *w, void *data) char ib = GUI::instance()->selectEntity(ENT_ALL); if(ib == 'l') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++){ MElement *me = GUI::instance()->selectedElements[i]; if(me->getNumEdges() == 1 && me->getVisibility() != 2){ @@ -140,7 +140,7 @@ static void class_deleteedge_cb(Fl_Widget *w, void *data) } CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; Draw(); Msg::StatusBar(3, false, ""); } @@ -156,7 +156,7 @@ static void class_save_cb(Fl_Widget *w, void *data) e->edges_detected.clear(); CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; NoElementsSelectedMode(e); Draw(); Msg::StatusBar(3, false, ""); @@ -172,7 +172,7 @@ static void class_clear_cb(Fl_Widget *w, void *data) e->temporary->lines.clear(); CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; NoElementsSelectedMode(e); Draw(); Msg::StatusBar(3, false, ""); @@ -410,7 +410,7 @@ static void updateedges_cb(Fl_Widget* w, void* data) static void class_hide_cb(Fl_Widget *w, void *data) { - CTX::instance()->hide_unselected = !CTX::instance()->hide_unselected; + CTX::instance()->hideUnselected = !CTX::instance()->hideUnselected; CTX::instance()->mesh.changed = ENT_ALL; Draw(); } @@ -437,7 +437,7 @@ static void class_select_cb(Fl_Widget *w, void *data) classificationEditor *e = (classificationEditor*)data; std::vector<MTriangle*> &ele(e->getElements()); - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; while(1) { CTX::instance()->mesh.changed = ENT_ALL; @@ -448,7 +448,7 @@ static void class_select_cb(Fl_Widget *w, void *data) char ib = GUI::instance()->selectEntity(ENT_ALL); if(ib == 'l') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++){ MElement *me = GUI::instance()->selectedElements[i]; if(me->getNumEdges() == 3 && me->getVisibility() != 2){ @@ -481,7 +481,7 @@ static void class_select_cb(Fl_Widget *w, void *data) updateedges_cb(0, data); CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; Draw(); Msg::StatusBar(3, false, ""); } @@ -540,7 +540,7 @@ classificationEditor::classificationEditor() const int width = (int)(3.5 * BBB), height = 10 * BH; _window = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Classify"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Classify"); new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB); { diff --git a/Fltk/clippingWindow.cpp b/Fltk/clippingWindow.cpp index 2cc3cbd61df4545196c7ca02957a7f20f5e9df6e..99f7678a906b2881983540ce8967442bfe3d4abe 100644 --- a/Fltk/clippingWindow.cpp +++ b/Fltk/clippingWindow.cpp @@ -31,7 +31,7 @@ static void clip_update_cb(Fl_Widget *w, void *data) CTX::instance()->geom.clip &= ~(1 << idx); CTX::instance()->mesh.clip &= ~(1 << idx); for(unsigned int i = 0; i < PView::list.size(); i++) - PView::list[i]->getOptions()->Clip &= ~(1 << idx); + PView::list[i]->getOptions()->clip &= ~(1 << idx); for(int i = 0; i < GUI::instance()->clipping->browser->size(); i++){ if(GUI::instance()->clipping->browser->selected(i + 1)){ if(i == 0) @@ -39,17 +39,17 @@ static void clip_update_cb(Fl_Widget *w, void *data) else if(i == 1) CTX::instance()->mesh.clip |= (1 << idx); else if(i - 2 < (int)PView::list.size()) - PView::list[i - 2]->getOptions()->Clip |= (1 << idx); + PView::list[i - 2]->getOptions()->clip |= (1 << idx); } } for(int i = 0; i < 4; i++) - CTX::instance()->clip_plane[idx][i] = GUI::instance()->clipping->value[i]->value(); + CTX::instance()->clipPlane[idx][i] = GUI::instance()->clipping->value[i]->value(); } else{ // clipping box CTX::instance()->geom.clip = 0; CTX::instance()->mesh.clip = 0; for(unsigned int i = 0; i < PView::list.size(); i++) - PView::list[i]->getOptions()->Clip = 0; + PView::list[i]->getOptions()->clip = 0; for(int i = 0; i < GUI::instance()->clipping->browser->size(); i++){ if(GUI::instance()->clipping->browser->selected(i + 1)){ for(int idx = 0; idx < 6; idx++){ @@ -58,7 +58,7 @@ static void clip_update_cb(Fl_Widget *w, void *data) else if(i == 1) CTX::instance()->mesh.clip |= (1 << idx); else if(i - 2 < (int)PView::list.size()) - PView::list[i - 2]->getOptions()->Clip |= (1 << idx); + PView::list[i - 2]->getOptions()->clip |= (1 << idx); } } } @@ -69,62 +69,62 @@ static void clip_update_cb(Fl_Widget *w, void *data) GUI::instance()->clipping->value[8]->value(), GUI::instance()->clipping->value[9]->value()}; // left - CTX::instance()->clip_plane[0][0] = 1.; - CTX::instance()->clip_plane[0][1] = 0.; - CTX::instance()->clip_plane[0][2] = 0.; - CTX::instance()->clip_plane[0][3] = -(c[0] - d[0] / 2.); + CTX::instance()->clipPlane[0][0] = 1.; + CTX::instance()->clipPlane[0][1] = 0.; + CTX::instance()->clipPlane[0][2] = 0.; + CTX::instance()->clipPlane[0][3] = -(c[0] - d[0] / 2.); // right - CTX::instance()->clip_plane[1][0] = -1.; - CTX::instance()->clip_plane[1][1] = 0.; - CTX::instance()->clip_plane[1][2] = 0.; - CTX::instance()->clip_plane[1][3] = (c[0] + d[0] / 2.); + CTX::instance()->clipPlane[1][0] = -1.; + CTX::instance()->clipPlane[1][1] = 0.; + CTX::instance()->clipPlane[1][2] = 0.; + CTX::instance()->clipPlane[1][3] = (c[0] + d[0] / 2.); // top - CTX::instance()->clip_plane[2][0] = 0.; - CTX::instance()->clip_plane[2][1] = 1.; - CTX::instance()->clip_plane[2][2] = 0.; - CTX::instance()->clip_plane[2][3] = -(c[1] - d[1] / 2.); + CTX::instance()->clipPlane[2][0] = 0.; + CTX::instance()->clipPlane[2][1] = 1.; + CTX::instance()->clipPlane[2][2] = 0.; + CTX::instance()->clipPlane[2][3] = -(c[1] - d[1] / 2.); // bottom - CTX::instance()->clip_plane[3][0] = 0.; - CTX::instance()->clip_plane[3][1] = -1.; - CTX::instance()->clip_plane[3][2] = 0.; - CTX::instance()->clip_plane[3][3] = (c[1] + d[1] / 2.); + CTX::instance()->clipPlane[3][0] = 0.; + CTX::instance()->clipPlane[3][1] = -1.; + CTX::instance()->clipPlane[3][2] = 0.; + CTX::instance()->clipPlane[3][3] = (c[1] + d[1] / 2.); // near - CTX::instance()->clip_plane[4][0] = 0.; - CTX::instance()->clip_plane[4][1] = 0.; - CTX::instance()->clip_plane[4][2] = 1.; - CTX::instance()->clip_plane[4][3] = -(c[2] - d[2] / 2.); + CTX::instance()->clipPlane[4][0] = 0.; + CTX::instance()->clipPlane[4][1] = 0.; + CTX::instance()->clipPlane[4][2] = 1.; + CTX::instance()->clipPlane[4][3] = -(c[2] - d[2] / 2.); // far - CTX::instance()->clip_plane[5][0] = 0.; - CTX::instance()->clip_plane[5][1] = 0.; - CTX::instance()->clip_plane[5][2] = -1.; - CTX::instance()->clip_plane[5][3] = (c[2] + d[2] / 2.); + CTX::instance()->clipPlane[5][0] = 0.; + CTX::instance()->clipPlane[5][1] = 0.; + CTX::instance()->clipPlane[5][2] = -1.; + CTX::instance()->clipPlane[5][3] = (c[2] + d[2] / 2.); } - if(CTX::instance()->clip_whole_elements || - CTX::instance()->clip_whole_elements != + if(CTX::instance()->clipWholeElements || + CTX::instance()->clipWholeElements != GUI::instance()->clipping->butt[0]->value()){ for(int clip = 0; clip < 6; clip++){ if(CTX::instance()->mesh.clip) CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); for(unsigned int index = 0; index < PView::list.size(); index++) - if(PView::list[index]->getOptions()->Clip) + if(PView::list[index]->getOptions()->clip) PView::list[index]->setChanged(true); } } - CTX::instance()->clip_whole_elements = + CTX::instance()->clipWholeElements = GUI::instance()->clipping->butt[0]->value(); - CTX::instance()->clip_only_draw_intersecting_volume = + CTX::instance()->clipOnlyDrawIntersectingVolume = GUI::instance()->clipping->butt[1]->value(); - CTX::instance()->clip_only_volume = + CTX::instance()->clipOnlyVolume = GUI::instance()->clipping->butt[2]->value(); - int old = CTX::instance()->draw_bbox; - CTX::instance()->draw_bbox = 1; - if(CTX::instance()->fast_redraw) + int old = CTX::instance()->drawBBox; + CTX::instance()->drawBBox = 1; + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); - CTX::instance()->draw_bbox = old; + CTX::instance()->drawBBox = old; CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; } @@ -141,15 +141,15 @@ static void clip_reset_cb(Fl_Widget *w, void *data) CTX::instance()->geom.clip = 0; CTX::instance()->mesh.clip = 0; for(unsigned int index = 0; index < PView::list.size(); index++) - PView::list[index]->getOptions()->Clip = 0; + PView::list[index]->getOptions()->clip = 0; for(int i = 0; i < 6; i++){ - CTX::instance()->clip_plane[i][0] = 1.; + CTX::instance()->clipPlane[i][0] = 1.; for(int j = 1; j < 4; j++) - CTX::instance()->clip_plane[i][j] = 0.; + CTX::instance()->clipPlane[i][j] = 0.; } - if(CTX::instance()->clip_whole_elements){ + if(CTX::instance()->clipWholeElements){ CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); for(unsigned int index = 0; index < PView::list.size(); index++) PView::list[index]->setChanged(true); @@ -178,7 +178,7 @@ clippingWindow::clippingWindow(int deltaFontSize) int L = 7 * FL_NORMAL_SIZE; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Clipping"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Clipping"); win->box(GMSH_WINDOW_BOX); browser = new Fl_Multi_Browser(WB, WB, L - WB, height - BH - 3 * WB); @@ -263,7 +263,7 @@ clippingWindow::clippingWindow(int deltaFontSize) o->callback(clip_reset_cb); } - win->position(CTX::instance()->clip_position[0], CTX::instance()->clip_position[1]); + win->position(CTX::instance()->clipPosition[0], CTX::instance()->clipPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; @@ -285,11 +285,11 @@ void clippingWindow::resetBrowser() if((i == 0 && CTX::instance()->geom.clip & (1 << idx)) || (i == 1 && CTX::instance()->mesh.clip & (1 << idx)) || (i > 1 && i - 2 < (int)PView::list.size() && - PView::list[i - 2]->getOptions()->Clip & (1 << idx))) + PView::list[i - 2]->getOptions()->clip & (1 << idx))) browser->select(i + 1); } for(int i = 0; i < 4; i++) - value[i]->value(CTX::instance()->clip_plane[idx][i]); + value[i]->value(CTX::instance()->clipPlane[idx][i]); for(int i = 4; i < 7; i++) value[i]->value(0.); for(int i = 7; i < 10; i++) diff --git a/Fltk/colorbarWindow.cpp b/Fltk/colorbarWindow.cpp index db3bb8eff214f04a96114d196c592bcacbc4a214..715e2221ae0d5d6c98fc2c53f0d1d6536f40d6dd 100644 --- a/Fltk/colorbarWindow.cpp +++ b/Fltk/colorbarWindow.cpp @@ -120,11 +120,11 @@ void colorbarWindow::redraw_range(int a, int b) for(i = a; i <= b; i++) { x = index_to_x(i); if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_RGB) - intensity = CTX::instance()->unpack_red(ct->table[i]); + intensity = CTX::instance()->unpackRed(ct->table[i]); else if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_HSV) { - RGB_to_HSV(CTX::instance()->unpack_red(ct->table[i]) / 255., - CTX::instance()->unpack_green(ct->table[i]) / 255., - CTX::instance()->unpack_blue(ct->table[i]) / 255., &H, &S, &V); + RGB_to_HSV(CTX::instance()->unpackRed(ct->table[i]) / 255., + CTX::instance()->unpackGreen(ct->table[i]) / 255., + CTX::instance()->unpackBlue(ct->table[i]) / 255., &H, &S, &V); intensity = (int)(H / 6. * 255. + EPS); } y = intensity_to_y(intensity); @@ -140,11 +140,11 @@ void colorbarWindow::redraw_range(int a, int b) for(i = a; i <= b; i++) { x = index_to_x(i); if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_RGB) - intensity = CTX::instance()->unpack_green(ct->table[i]); + intensity = CTX::instance()->unpackGreen(ct->table[i]); else if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_HSV) { - RGB_to_HSV(CTX::instance()->unpack_red(ct->table[i]) / 255., - CTX::instance()->unpack_green(ct->table[i]) / 255., - CTX::instance()->unpack_blue(ct->table[i]) / 255., &H, &S, &V); + RGB_to_HSV(CTX::instance()->unpackRed(ct->table[i]) / 255., + CTX::instance()->unpackGreen(ct->table[i]) / 255., + CTX::instance()->unpackBlue(ct->table[i]) / 255., &H, &S, &V); intensity = (int)(S * 255.); } y = intensity_to_y(intensity); @@ -160,11 +160,11 @@ void colorbarWindow::redraw_range(int a, int b) for(i = a; i <= b; i++) { x = index_to_x(i); if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_RGB) - intensity = CTX::instance()->unpack_blue(ct->table[i]); + intensity = CTX::instance()->unpackBlue(ct->table[i]); else if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_HSV) { - RGB_to_HSV(CTX::instance()->unpack_red(ct->table[i]) / 255., - CTX::instance()->unpack_green(ct->table[i]) / 255., - CTX::instance()->unpack_blue(ct->table[i]) / 255., &H, &S, &V); + RGB_to_HSV(CTX::instance()->unpackRed(ct->table[i]) / 255., + CTX::instance()->unpackGreen(ct->table[i]) / 255., + CTX::instance()->unpackBlue(ct->table[i]) / 255., &H, &S, &V); intensity = (int)(V * 255.); } y = intensity_to_y(intensity); @@ -179,7 +179,7 @@ void colorbarWindow::redraw_range(int a, int b) // draw alpha levels for(i = a; i <= b; i++) { x = index_to_x(i); - y = intensity_to_y(CTX::instance()->unpack_alpha(ct->table[i])); + y = intensity_to_y(CTX::instance()->unpackAlpha(ct->table[i])); if(i != a) { fl_color(fl_contrast(FL_BLACK, color_bg)); fl_line(px, py, x, y); @@ -194,9 +194,9 @@ void colorbarWindow::redraw_range(int a, int b) unsigned int color; i = x_to_index(x); color = ct->table[i]; - r = CTX::instance()->unpack_red(color); - g = CTX::instance()->unpack_green(color); - b = CTX::instance()->unpack_blue(color); + r = CTX::instance()->unpackRed(color); + g = CTX::instance()->unpackGreen(color); + b = CTX::instance()->unpackBlue(color); fl_color(r, g, b); fl_line(x, wedge_y, x, wedge_y + wedge_height - 1); } @@ -300,11 +300,11 @@ void colorbarWindow::draw() label_y = h() - 5; marker_y = label_y - marker_height - font_height; wedge_y = marker_y - wedge_height; - color_bg = fl_color_cube(CTX::instance()->unpack_red(CTX::instance()->color.bg) * + color_bg = fl_color_cube(CTX::instance()->unpackRed(CTX::instance()->color.bg) * FL_NUM_RED / 256, - CTX::instance()->unpack_green(CTX::instance()->color.bg) * + CTX::instance()->unpackGreen(CTX::instance()->color.bg) * FL_NUM_GREEN / 256, - CTX::instance()->unpack_blue(CTX::instance()->color.bg) * + CTX::instance()->unpackBlue(CTX::instance()->color.bg) * FL_NUM_BLUE / 256); redraw_range(0, ct->size - 1); redraw_marker(); @@ -613,10 +613,10 @@ int colorbarWindow::handle(int event) for(i = a; i <= b; i++) { int red, green, blue, alpha; double R, G, B, H, S, V; - red = CTX::instance()->unpack_red(ct->table[i]); - green = CTX::instance()->unpack_green(ct->table[i]); - blue = CTX::instance()->unpack_blue(ct->table[i]); - alpha = CTX::instance()->unpack_alpha(ct->table[i]); + red = CTX::instance()->unpackRed(ct->table[i]); + green = CTX::instance()->unpackGreen(ct->table[i]); + blue = CTX::instance()->unpackBlue(ct->table[i]); + alpha = CTX::instance()->unpackAlpha(ct->table[i]); if(ct->ipar[COLORTABLE_MODE] == COLORTABLE_RGB) { if(p1) red = value; if(p2) green = value; @@ -635,7 +635,7 @@ int colorbarWindow::handle(int event) green = (int)(255 * G); blue = (int)(255 * B); } - ct->table[i] = CTX::instance()->pack_color(red, green, blue, alpha); + ct->table[i] = CTX::instance()->packColor(red, green, blue, alpha); } // redraw the color curves if(pentry < entry) diff --git a/Fltk/contextWindow.cpp b/Fltk/contextWindow.cpp index a87dbec1d163d5377c5be2f26ade1ae7e3a57899..c0a335cc1a4cacf6c8d66568c4683b6931d82bc5 100644 --- a/Fltk/contextWindow.cpp +++ b/Fltk/contextWindow.cpp @@ -49,7 +49,7 @@ geometryContextWindow::geometryContextWindow(int deltaFontSize) int width = 31 * FL_NORMAL_SIZE; int height = 4 * WB + 8 * BH; - win = new paletteWindow(width, height, CTX::instance()->non_modal_windows ? true : false, + win = new paletteWindow(width, height, CTX::instance()->nonModalWindows ? true : false, "Contextual Geometry Definitions"); win->box(GMSH_WINDOW_BOX); { @@ -188,7 +188,7 @@ geometryContextWindow::geometryContextWindow(int deltaFontSize) o->end(); } - win->position(CTX::instance()->ctx_position[0], CTX::instance()->ctx_position[1]); + win->position(CTX::instance()->ctxPosition[0], CTX::instance()->ctxPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; @@ -217,7 +217,7 @@ meshContextWindow::meshContextWindow(int deltaFontSize) int height = 4 * WB + 4 * BH; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows, "Contextual Mesh Definitions"); + (width, height, CTX::instance()->nonModalWindows, "Contextual Mesh Definitions"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB); @@ -267,7 +267,7 @@ meshContextWindow::meshContextWindow(int deltaFontSize) o->end(); } - win->position(CTX::instance()->ctx_position[0], CTX::instance()->ctx_position[1]); + win->position(CTX::instance()->ctxPosition[0], CTX::instance()->ctxPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/extraDialogs.cpp b/Fltk/extraDialogs.cpp index f264ea384791bbdfde812741ef2b12ca74ebbd5e..56af633bd0f9bbfcab988981053ce87c55d84964 100644 --- a/Fltk/extraDialogs.cpp +++ b/Fltk/extraDialogs.cpp @@ -40,7 +40,7 @@ int arrow_editor(const char *title, double &a, double &b, double &c) if(!editor){ editor = new _editor; editor->window = new paletteWindow - (2 * BB + 3 * WB, 4 * BH + 3 * WB, CTX::instance()->non_modal_windows ? true : false); + (2 * BB + 3 * WB, 4 * BH + 3 * WB, CTX::instance()->nonModalWindows ? true : false); editor->sa = new Fl_Value_Slider(WB, WB, BB, BH, "Head radius"); editor->sa->type(FL_HOR_SLIDER); editor->sa->align(FL_ALIGN_RIGHT); @@ -117,7 +117,7 @@ int perspective_editor() if(!editor){ editor = new _editor; editor->window = new Fl_Menu_Window(20, 100); - if(CTX::instance()->non_modal_windows) editor->window->set_non_modal(); + if(CTX::instance()->nonModalWindows) editor->window->set_non_modal(); editor->sa = new Release_Slider(0, 0, 20, 100); editor->sa->type(FL_VERT_NICE_SLIDER); editor->sa->minimum(12); @@ -128,7 +128,7 @@ int perspective_editor() } editor->window->hotspot(editor->window); - editor->sa->value(CTX::instance()->clip_factor); + editor->sa->value(CTX::instance()->clipFactor); if(editor->window->non_modal() && !editor->window->shown()) editor->window->show(); // fix ordering @@ -169,7 +169,7 @@ int model_chooser() if(!menu){ menu = new _menu; menu->window = new Fl_Menu_Window(WW, 6 * BH); - if(CTX::instance()->non_modal_windows) menu->window->set_non_modal(); + if(CTX::instance()->nonModalWindows) menu->window->set_non_modal(); menu->window->border(0); Fl_Box *l = new Fl_Box(0, 0, WW, BH, "Select active model:"); l->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); diff --git a/Fltk/fieldWindow.cpp b/Fltk/fieldWindow.cpp index 378d9934c4057e50ec90e20a88038aeac890c67d..cfbf705c8b9ab2a7a7148aa176ec0f743c4522e5 100644 --- a/Fltk/fieldWindow.cpp +++ b/Fltk/fieldWindow.cpp @@ -92,13 +92,13 @@ fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize) int width0 = 34 * FL_NORMAL_SIZE + WB; int height0 = 12 * BH + 4 * WB; - int width = (CTX::instance()->field_size[0] < width0) ? width0 : - CTX::instance()->field_size[0]; - int height = (CTX::instance()->field_size[1] < height0) ? height0 : - CTX::instance()->field_size[1]; + int width = (CTX::instance()->fieldSize[0] < width0) ? width0 : + CTX::instance()->fieldSize[0]; + int height = (CTX::instance()->fieldSize[1] < height0) ? height0 : + CTX::instance()->fieldSize[1]; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Fields"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Fields"); win->box(GMSH_WINDOW_BOX); int x = WB, y = WB, w = (int)(1.5 * BB), h = height - 2 * WB - 3 * BH; @@ -175,7 +175,7 @@ fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize) width - 9 * WB - 5 * BB, height - 3 * BH - 5 * WB)); win->size_range(width0, height0); - win->position(CTX::instance()->field_position[0], CTX::instance()->field_position[1]); + win->position(CTX::instance()->fieldPosition[0], CTX::instance()->fieldPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/fileDialogs.cpp b/Fltk/fileDialogs.cpp index f091d06f2b3b43240757b2b67526916808e93acb..64c2f4c191ea7e03e49f2ad2021a984f2626b568 100644 --- a/Fltk/fileDialogs.cpp +++ b/Fltk/fileDialogs.cpp @@ -77,10 +77,10 @@ int file_chooser(int multi, int create, const char *message, Fl_File_Chooser::show_label = "Format:"; Fl_File_Chooser::all_files_label = "All files (*)"; if(!fc) { - fc = new fileChooser(getenv("PWD") ? "." : CTX::instance()->home_dir.c_str(), + fc = new fileChooser(getenv("PWD") ? "." : CTX::instance()->homeDir.c_str(), thefilter, Fl_File_Chooser::SINGLE, message); - fc->position(CTX::instance()->file_chooser_position[0], - CTX::instance()->file_chooser_position[1]); + fc->position(CTX::instance()->fileChooserPosition[0], + CTX::instance()->fileChooserPosition[1]); } if(multi) fc->type(Fl_File_Chooser::MULTI); @@ -203,7 +203,7 @@ int latex_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->b->value(CTX::instance()->print.tex_as_equation); + dialog->b->value(CTX::instance()->print.texAsEquation); dialog->window->show(); while(dialog->window->shown()){ @@ -265,8 +265,8 @@ int jpeg_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->s[0]->value(CTX::instance()->print.jpeg_quality); - dialog->s[1]->value(CTX::instance()->print.jpeg_smoothing); + dialog->s[0]->value(CTX::instance()->print.jpegQuality); + dialog->s[1]->value(CTX::instance()->print.jpegSmoothing); dialog->b->value(CTX::instance()->print.text); dialog->window->show(); @@ -328,10 +328,10 @@ int gif_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->b[0]->value(CTX::instance()->print.gif_dither); - dialog->b[1]->value(CTX::instance()->print.gif_interlace); - dialog->b[2]->value(CTX::instance()->print.gif_sort); - dialog->b[3]->value(CTX::instance()->print.gif_transparent); + dialog->b[0]->value(CTX::instance()->print.gifDither); + dialog->b[1]->value(CTX::instance()->print.gifInterlace); + dialog->b[2]->value(CTX::instance()->print.gifSort); + dialog->b[3]->value(CTX::instance()->print.gifTransparent); dialog->b[4]->value(CTX::instance()->print.text); dialog->window->show(); @@ -446,15 +446,15 @@ int gl2ps_dialog(const char *name, const char *title, int format) } dialog->window->label(title); - dialog->c->value(CTX::instance()->print.eps_quality); - dialog->b[0]->value(CTX::instance()->print.eps_compress); - dialog->b[1]->value(CTX::instance()->print.eps_background); - dialog->b[2]->value(CTX::instance()->print.eps_occlusion_culling); - dialog->b[3]->value(CTX::instance()->print.eps_best_root); - dialog->b[4]->value(CTX::instance()->print.eps_ps3shading); + dialog->c->value(CTX::instance()->print.epsQuality); + dialog->b[0]->value(CTX::instance()->print.epsCompress); + dialog->b[1]->value(CTX::instance()->print.epsBackground); + dialog->b[2]->value(CTX::instance()->print.epsOcclusionCulling); + dialog->b[3]->value(CTX::instance()->print.epsBestRoot); + dialog->b[4]->value(CTX::instance()->print.epsPS3Shading); dialog->b[5]->value(CTX::instance()->print.text); - activate_gl2ps_choices(format, CTX::instance()->print.eps_quality, dialog->b); + activate_gl2ps_choices(format, CTX::instance()->print.epsQuality, dialog->b); dialog->window->show(); @@ -568,7 +568,7 @@ int geo_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->b->value(CTX::instance()->print.geo_labels ? 1 : 0); + dialog->b->value(CTX::instance()->print.geoLabels ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -630,12 +630,12 @@ int pos_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->b[0]->value(CTX::instance()->mesh.save_all ? 1 : 0); - dialog->b[1]->value(CTX::instance()->print.pos_elementary ? 1 : 0); - dialog->b[2]->value(CTX::instance()->print.pos_element ? 1 : 0); - dialog->b[3]->value(CTX::instance()->print.pos_gamma ? 1 : 0); - dialog->b[4]->value(CTX::instance()->print.pos_eta ? 1 : 0); - dialog->b[5]->value(CTX::instance()->print.pos_rho ? 1 : 0); + dialog->b[0]->value(CTX::instance()->mesh.saveAll ? 1 : 0); + dialog->b[1]->value(CTX::instance()->print.posElementary ? 1 : 0); + dialog->b[2]->value(CTX::instance()->print.posElement ? 1 : 0); + dialog->b[3]->value(CTX::instance()->print.posGamma ? 1 : 0); + dialog->b[4]->value(CTX::instance()->print.posEta ? 1 : 0); + dialog->b[5]->value(CTX::instance()->print.posRho ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -707,10 +707,10 @@ int msh_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->c->value((CTX::instance()->mesh.msh_file_version == 1.0) ? 0 : + dialog->c->value((CTX::instance()->mesh.mshFileVersion == 1.0) ? 0 : CTX::instance()->mesh.binary ? 2 : 1); - dialog->b->value(CTX::instance()->mesh.save_all ? 1 : 0); - dialog->p->value(CTX::instance()->mesh.save_parametric ? 1 : 0); + dialog->b->value(CTX::instance()->mesh.saveAll ? 1 : 0); + dialog->p->value(CTX::instance()->mesh.saveParametric ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -768,8 +768,8 @@ int unv_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->b[0]->value(CTX::instance()->mesh.save_all ? 1 : 0); - dialog->b[1]->value(CTX::instance()->mesh.save_groups_of_nodes ? 1 : 0); + dialog->b[0]->value(CTX::instance()->mesh.saveAll ? 1 : 0); + dialog->b[1]->value(CTX::instance()->mesh.saveGroupsOfNodes ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -833,8 +833,8 @@ int bdf_dialog(const char *name) dialog->window->hotspot(dialog->window); } - dialog->c->value(CTX::instance()->mesh.bdf_field_format); - dialog->b->value(CTX::instance()->mesh.save_all ? 1 : 0); + dialog->c->value(CTX::instance()->mesh.bdfFieldFormat); + dialog->b->value(CTX::instance()->mesh.saveAll ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -903,7 +903,7 @@ int generic_mesh_dialog(const char *name, const char *title, int format, dialog->c->activate(); else dialog->c->deactivate(); - dialog->b->value(CTX::instance()->mesh.save_all ? 1 : 0); + dialog->b->value(CTX::instance()->mesh.saveAll ? 1 : 0); dialog->window->show(); while(dialog->window->shown()){ @@ -960,42 +960,42 @@ struct CGNSWriteDialog void write_all_options() { opt_mesh_zone_definition(0, GMSH_SET | GMSH_GUI, choiceZoneDef->value()); - CTX::instance()->cgns_options.baseName = inputBaseName->value(); - CTX::instance()->cgns_options.zoneName = inputZoneName->value(); - CTX::instance()->cgns_options.interfaceName = inputInterfaceName->value(); - CTX::instance()->cgns_options.patchName = inputPatchName->value(); - CTX::instance()->cgns_options.gridConnectivityLocation = + CTX::instance()->cgnsOptions.baseName = inputBaseName->value(); + CTX::instance()->cgnsOptions.zoneName = inputZoneName->value(); + CTX::instance()->cgnsOptions.interfaceName = inputInterfaceName->value(); + CTX::instance()->cgnsOptions.patchName = inputPatchName->value(); + CTX::instance()->cgnsOptions.gridConnectivityLocation = roundButton1GCatFace->value(); - CTX::instance()->cgns_options.writeBC = checkButtonWriteBC->value(); - CTX::instance()->cgns_options.bocoLocation = roundButton1BCatFace->value(); - CTX::instance()->cgns_options.normalSource = (checkButtonWriteNormals->value()) ? + CTX::instance()->cgnsOptions.writeBC = checkButtonWriteBC->value(); + CTX::instance()->cgnsOptions.bocoLocation = roundButton1BCatFace->value(); + CTX::instance()->cgnsOptions.normalSource = (checkButtonWriteNormals->value()) ? roundButton1NormalElem->value() + 1 : 0; - CTX::instance()->cgns_options.vectorDim = choiceVecDim->value() + 2; - CTX::instance()->cgns_options.writeUserDef = checkButtonUnknownUserDef->value(); + CTX::instance()->cgnsOptions.vectorDim = choiceVecDim->value() + 2; + CTX::instance()->cgnsOptions.writeUserDef = checkButtonUnknownUserDef->value(); } void read_all_options() { - choiceZoneDef->value(CTX::instance()->mesh.zone_definition); - inputBaseName->value(CTX::instance()->cgns_options.baseName.c_str()); - inputZoneName->value(CTX::instance()->cgns_options.zoneName.c_str()); - inputInterfaceName->value(CTX::instance()->cgns_options.interfaceName.c_str()); - inputPatchName->value(CTX::instance()->cgns_options.patchName.c_str()); - checkButtonWriteBC->value(CTX::instance()->cgns_options.writeBC); - checkButtonWriteNormals->value(CTX::instance()->cgns_options.normalSource); - choiceVecDim->value(CTX::instance()->cgns_options.vectorDim - 2); - checkButtonUnknownUserDef->value(CTX::instance()->cgns_options.writeUserDef); + choiceZoneDef->value(CTX::instance()->mesh.zoneDefinition); + inputBaseName->value(CTX::instance()->cgnsOptions.baseName.c_str()); + inputZoneName->value(CTX::instance()->cgnsOptions.zoneName.c_str()); + inputInterfaceName->value(CTX::instance()->cgnsOptions.interfaceName.c_str()); + inputPatchName->value(CTX::instance()->cgnsOptions.patchName.c_str()); + checkButtonWriteBC->value(CTX::instance()->cgnsOptions.writeBC); + checkButtonWriteNormals->value(CTX::instance()->cgnsOptions.normalSource); + choiceVecDim->value(CTX::instance()->cgnsOptions.vectorDim - 2); + checkButtonUnknownUserDef->value(CTX::instance()->cgnsOptions.writeUserDef); // Call all callbacks to ensure consistent options cgnsw_gc_location_cb - ((CTX::instance()->cgns_options.gridConnectivityLocation) ? + ((CTX::instance()->cgnsOptions.gridConnectivityLocation) ? roundButton1GCatFace : roundButton0GCatVertex, this); // The order of the next 4 is important cgnsw_normal_source_cb - ((CTX::instance()->cgns_options.normalSource == 2) ? + ((CTX::instance()->cgnsOptions.normalSource == 2) ? roundButton1NormalElem : roundButton0NormalGeo, this); cgnsw_write_normals_cb(checkButtonWriteNormals, this); cgnsw_bc_location_cb - ((CTX::instance()->cgns_options.bocoLocation) ? + ((CTX::instance()->cgnsOptions.bocoLocation) ? roundButton1BCatFace : roundButton0BCatVertex, this); cgnsw_write_dummy_bc_cb(checkButtonWriteBC, this); } @@ -1084,7 +1084,7 @@ void cgnsw_normal_source_cb(Fl_Widget *widget, void *data) void cgnsw_defaults_cb(Fl_Widget *widget, void *data) { CGNSWriteDialog *dlg = static_cast<CGNSWriteDialog*>(data); - CTX::instance()->cgns_options.setDefaults(); + CTX::instance()->cgnsOptions.setDefaults(); dlg->read_all_options(); } diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 362e16250bdbe81c3f50a2e72eda2ba98c542fce..40e2bcf146658ba6fefefd55b6bb1f142d979779 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -181,7 +181,7 @@ void status_options_cb(Fl_Widget *w, void *data) Draw(); } else if(!strcmp(str, "S")){ // mouse selection - if(CTX::instance()->mouse_selection){ + if(CTX::instance()->mouseSelection){ opt_general_mouse_selection(0, GMSH_SET | GMSH_GUI, 0); for(unsigned int i = 0; i < GUI::instance()->graph.size(); i++) for(unsigned int j = 0; j < GUI::instance()->graph[i]->gl.size(); j++) @@ -237,9 +237,9 @@ static void status_play_cb(Fl_Widget *w, void *data) while(1) { if(stop_anim) break; - if(GetTimeInSeconds() - anim_time > CTX::instance()->post.anim_delay) { + if(GetTimeInSeconds() - anim_time > CTX::instance()->post.animDelay) { anim_time = GetTimeInSeconds(); - status_play_manual(!CTX::instance()->post.anim_cycle, 1); + status_play_manual(!CTX::instance()->post.animCycle, 1); } GUI::instance()->check(); } @@ -253,7 +253,7 @@ static void status_pause_cb(Fl_Widget *w, void *data) static void status_rewind_cb(Fl_Widget *w, void *data) { - if(!CTX::instance()->post.anim_cycle) { + if(!CTX::instance()->post.animCycle) { for(unsigned int i = 0; i < PView::list.size(); i++) opt_view_timestep(i, GMSH_SET | GMSH_GUI, 0); } @@ -267,12 +267,12 @@ static void status_rewind_cb(Fl_Widget *w, void *data) static void status_stepbackward_cb(Fl_Widget *w, void *data) { - status_play_manual(!CTX::instance()->post.anim_cycle, -1); + status_play_manual(!CTX::instance()->post.animCycle, -1); } static void status_stepforward_cb(Fl_Widget *w, void *data) { - status_play_manual(!CTX::instance()->post.anim_cycle, 1); + status_play_manual(!CTX::instance()->post.animCycle, 1); } static void remove_graphic_window_cb(Fl_Widget *w, void *data) @@ -320,8 +320,8 @@ graphicWindow::graphicWindow(bool main, int numTiles) int sh = 2 * FL_NORMAL_SIZE - 4; // status bar height int sw = FL_NORMAL_SIZE + 3; // status button width - int width = CTX::instance()->gl_size[0]; - int glheight = CTX::instance()->gl_size[1]; + int width = CTX::instance()->glSize[0]; + int glheight = CTX::instance()->glSize[1]; int height = glheight + sh; // the graphic window should be a "normal" window (neither modal nor @@ -461,7 +461,7 @@ graphicWindow::graphicWindow(bool main, int numTiles) tile->end(); - win->position(CTX::instance()->gl_position[0], CTX::instance()->gl_position[1]); + win->position(CTX::instance()->glPosition[0], CTX::instance()->glPosition[1]); win->end(); } @@ -536,7 +536,7 @@ void graphicWindow::setAnimButtons(int mode) void graphicWindow::checkAnimButtons() { bool play = false; - if(CTX::instance()->post.anim_cycle){ + if(CTX::instance()->post.animCycle){ play = true; } else{ diff --git a/Fltk/manipWindow.cpp b/Fltk/manipWindow.cpp index 1992fb97e77364089b593a405fbc92ef39d0cf3d..684e1491be7a9d725d02f5821f28b4a5b01859a9 100644 --- a/Fltk/manipWindow.cpp +++ b/Fltk/manipWindow.cpp @@ -42,7 +42,7 @@ manipWindow::manipWindow(int deltaFontSize) int height = 5 * BH + 3 * WB; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Manipulator"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Manipulator"); win->box(GMSH_WINDOW_BOX); Fl_Box *top[3], *left[3]; @@ -88,7 +88,7 @@ manipWindow::manipWindow(int deltaFontSize) o->callback(status_xyz1p_cb, (void *)"reset"); } - win->position(CTX::instance()->manip_position[0], CTX::instance()->manip_position[1]); + win->position(CTX::instance()->manipPosition[0], CTX::instance()->manipPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp index 6d8183b33c86fae43bbd6b53339c147360f43fa4..71546f26b2a0a18b7de3f8d929ea9841ae1dcb8f 100644 --- a/Fltk/menuWindow.cpp +++ b/Fltk/menuWindow.cpp @@ -151,7 +151,7 @@ static void file_window_cb(Fl_Widget *w, void *data) std::string str((const char*)data); if(str == "new"){ graphicWindow *g1 = GUI::instance()->graph.back(); - graphicWindow *g2 = new graphicWindow(false, CTX::instance()->num_tiles); + graphicWindow *g2 = new graphicWindow(false, CTX::instance()->numTiles); GUI::instance()->graph.push_back(g2); GUI::instance()->setGraphicTitle(GModel::current()->getFileName()); g2->win->resize(g1->win->x() + 10, g1->win->y() + 10, @@ -297,7 +297,7 @@ static void file_save_as_cb(Fl_Widget *w, void *data) test: if(file_chooser(0, 1, "Save As", pat)) { std::string name = file_chooser_get_name(1); - if(CTX::instance()->confirm_overwrite) { + if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?", "Cancel", "Replace", 0, name.c_str())) @@ -329,7 +329,7 @@ static void file_rename_cb(Fl_Widget *w, void *data) test: if(file_chooser(0, 1, "Rename", "*", GModel::current()->getFileName().c_str())) { std::string name = file_chooser_get_name(1); - if(CTX::instance()->confirm_overwrite) { + if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?", "Cancel", "Replace", 0, name.c_str())) @@ -481,7 +481,7 @@ static void help_command_line_cb(Fl_Widget *w, void *data) static void help_online_cb(Fl_Widget *w, void *data) { - std::string prog = FixWindowsPath(CTX::instance()->web_browser.c_str()); + std::string prog = FixWindowsPath(CTX::instance()->webBrowser.c_str()); char cmd[1024]; ReplaceMultiFormat(prog.c_str(), "http://geuz.org/gmsh/doc/texinfo/", cmd); SystemCall(cmd); @@ -1445,9 +1445,9 @@ static void geometry_physical_add_cb(Fl_Widget *w, void *data) static void mesh_save_cb(Fl_Widget *w, void *data) { - std::string name = CTX::instance()->output_filename; + std::string name = CTX::instance()->outputFileName; if(name.empty()) name = GetDefaultFileName(CTX::instance()->mesh.format); - if(CTX::instance()->confirm_overwrite) { + if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?", "Cancel", "Replace", 0, name.c_str())) @@ -1493,19 +1493,19 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) int what; if(!strcmp(str, "elements")){ - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; what = ENT_ALL; } else if(!strcmp(str, "lines")){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_LINE; } else if(!strcmp(str, "surfaces")){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_SURFACE; } else if(!strcmp(str, "volumes")){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_VOLUME; } else @@ -1528,7 +1528,7 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) char ib = GUI::instance()->selectEntity(what); if(ib == 'l') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++){ if(GUI::instance()->selectedElements[i]->getVisibility() != 2){ GUI::instance()->selectedElements[i]->setVisibility(2); @@ -1558,7 +1558,7 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) } } if(ib == 'r') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++) GUI::instance()->selectedElements[i]->setVisibility(1); } @@ -1572,7 +1572,7 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) } } if(ib == 'u') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ if(ele.size()){ ele[ele.size() - 1]->setVisibility(1); ele.pop_back(); @@ -1586,7 +1586,7 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) } } if(ib == 'e') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < ele.size(); i++) if(ele[i]->getVisibility() == 2) ele[i]->setVisibility(0); } @@ -1605,14 +1605,14 @@ static void mesh_delete_parts_cb(Fl_Widget *w, void *data) } CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; Draw(); Msg::StatusBar(3, false, ""); } static void mesh_inspect_cb(Fl_Widget *w, void *data) { - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; CTX::instance()->mesh.changed = ENT_ALL; Draw(); @@ -1656,7 +1656,7 @@ static void mesh_inspect_cb(Fl_Widget *w, void *data) } } - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; CTX::instance()->mesh.changed = ENT_ALL; Draw(); Msg::StatusBar(3, false, ""); @@ -1665,8 +1665,8 @@ static void mesh_inspect_cb(Fl_Widget *w, void *data) static void mesh_degree_cb(Fl_Widget *w, void *data) { if((long)data == 2) - SetOrderN(GModel::current(), 2, CTX::instance()->mesh.second_order_linear, - CTX::instance()->mesh.second_order_incomplete); + SetOrderN(GModel::current(), 2, CTX::instance()->mesh.secondOrderLinear, + CTX::instance()->mesh.secondOrderIncomplete); else SetOrder1(GModel::current()); CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); @@ -1676,13 +1676,13 @@ static void mesh_degree_cb(Fl_Widget *w, void *data) static void mesh_optimize_cb(Fl_Widget *w, void *data) { - if(CTX::instance()->threads_lock) { + if(CTX::instance()->lock) { Msg::Info("I'm busy! Ask me that later..."); return; } - CTX::instance()->threads_lock = 1; + CTX::instance()->lock = 1; OptimizeMesh(GModel::current()); - CTX::instance()->threads_lock = 0; + CTX::instance()->lock = 0; CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); Draw(); Msg::StatusBar(2, false, " "); @@ -1690,7 +1690,7 @@ static void mesh_optimize_cb(Fl_Widget *w, void *data) static void mesh_refine_cb(Fl_Widget *w, void *data) { - RefineMesh(GModel::current(), CTX::instance()->mesh.second_order_linear); + RefineMesh(GModel::current(), CTX::instance()->mesh.secondOrderLinear); CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); Draw(); Msg::StatusBar(2, false, " "); @@ -1698,13 +1698,13 @@ static void mesh_refine_cb(Fl_Widget *w, void *data) static void mesh_optimize_netgen_cb(Fl_Widget *w, void *data) { - if(CTX::instance()->threads_lock) { + if(CTX::instance()->lock) { Msg::Info("I'm busy! Ask me that later..."); return; } - CTX::instance()->threads_lock = 1; + CTX::instance()->lock = 1; OptimizeMeshNetgen(GModel::current()); - CTX::instance()->threads_lock = 0; + CTX::instance()->lock = 0; CTX::instance()->mesh.changed |= (ENT_LINE | ENT_SURFACE | ENT_VOLUME); Draw(); Msg::StatusBar(2, false, " "); @@ -1929,8 +1929,8 @@ static void view_reload(int index) // delete new view delete PView::list.back(); // in case the reloaded view has a different number of time steps - if(p->getOptions()->TimeStep > p->getData()->getNumTimeSteps() - 1) - p->getOptions()->TimeStep = 0; + if(p->getOptions()->timeStep > p->getData()->getNumTimeSteps() - 1) + p->getOptions()->timeStep = 0; p->setChanged(true); GUI::instance()->updateViews(); } @@ -2016,7 +2016,7 @@ static void view_save_as(int index, const char *title, int format) test: if(file_chooser(0, 1, title, "*", view->getData()->getFileName().c_str())){ std::string name = file_chooser_get_name(1); - if(CTX::instance()->confirm_overwrite) { + if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?", "Cancel", "Replace", 0, name.c_str())) @@ -2077,42 +2077,42 @@ static void view_alias_with_options_cb(Fl_Widget *w, void *data) static void view_combine_space_all_cb(Fl_Widget *w, void *data) { - PView::combine(false, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } static void view_combine_space_visible_cb(Fl_Widget *w, void *data) { - PView::combine(false, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 0, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } static void view_combine_space_by_name_cb(Fl_Widget *w, void *data) { - PView::combine(false, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 2, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } static void view_combine_time_all_cb(Fl_Widget *w, void *data) { - PView::combine(true, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 1, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } static void view_combine_time_visible_cb(Fl_Widget *w, void *data) { - PView::combine(true, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 0, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } static void view_combine_time_by_name_cb(Fl_Widget *w, void *data) { - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); GUI::instance()->updateViews(); Draw(); } @@ -2459,7 +2459,7 @@ menuWindow::menuWindow() // this is the initial height: no dynamic button is shown #if defined(__APPLE__) - if(CTX::instance()->system_menu_bar){ + if(CTX::instance()->systemMenuBar){ _MH = BH + 6; // the menu bar is not in the application } else{ @@ -2470,13 +2470,14 @@ menuWindow::menuWindow() #endif win = new mainWindow - (width, _MH + NB_BUTT_SCROLL * BH, CTX::instance()->non_modal_windows ? true : false, "Gmsh"); + (width, _MH + NB_BUTT_SCROLL * BH, CTX::instance()->nonModalWindows ? + true : false, "Gmsh"); win->box(GMSH_WINDOW_BOX); win->callback(file_quit_cb); int y; #if defined(__APPLE__) - if(CTX::instance()->system_menu_bar){ + if(CTX::instance()->systemMenuBar){ // the system menubar is kind of a hack in fltk < 1.1.7: it still // creates a real (invisible) menubar. To avoid spurious mouse // click events we make it a 1x1 pixel rectangle, 1 pixel off the @@ -2531,7 +2532,8 @@ menuWindow::menuWindow() scroll->end(); win->size(width, _MH); - win->position(CTX::instance()->position[0], CTX::instance()->position[1]); + win->position(CTX::instance()->menuPosition[0], + CTX::instance()->menuPosition[1]); win->end(); } @@ -2651,7 +2653,7 @@ void menuWindow::setContext(contextItem *menu_asked, int flag) Fl_Light_Button *b1 = new Fl_Light_Button(0, _MH + nb * BH, width - popw, BH); b1->callback(view_toggle_cb, (void *)nb); b1->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); - b1->value(opt->Visible); + b1->value(opt->visible); b1->copy_label(data->getName().c_str()); b1->tooltip(data->getFileName().c_str()); diff --git a/Fltk/messageWindow.cpp b/Fltk/messageWindow.cpp index c6483ec54f26a53e7cdac934594f5be6f99c3773..be276bbf315f57161fadb570f129535b434afafd 100644 --- a/Fltk/messageWindow.cpp +++ b/Fltk/messageWindow.cpp @@ -22,7 +22,7 @@ void message_cb(Fl_Widget *w, void *data) static void message_auto_scroll_cb(Fl_Widget *w, void *data) { - CTX::instance()->msg_auto_scroll = GUI::instance()->messages->butt->value(); + CTX::instance()->msgAutoScroll = GUI::instance()->messages->butt->value(); } static void message_copy_cb(Fl_Widget *w, void *data) @@ -53,7 +53,7 @@ static void message_save_cb(Fl_Widget *w, void *data) test: if(file_chooser(0, 1, "Save", "*")) { std::string name = file_chooser_get_name(1); - if(CTX::instance()->confirm_overwrite) { + if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) if(!fl_choice("File '%s' already exists.\n\nDo you want to replace it?", "Cancel", "Replace", NULL, name.c_str())) @@ -67,11 +67,11 @@ messageWindow::messageWindow(int deltaFontSize) { FL_NORMAL_SIZE -= deltaFontSize; - int width = CTX::instance()->msg_size[0]; - int height = CTX::instance()->msg_size[1]; + int width = CTX::instance()->msgSize[0]; + int height = CTX::instance()->msgSize[1]; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Message Console"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Message Console"); win->box(GMSH_WINDOW_BOX); browser = new Fl_Browser(0, 0, width, height - 2 * WB - BH); @@ -101,7 +101,7 @@ messageWindow::messageWindow(int deltaFontSize) win->resizable(new Fl_Box(1, 1, 4, 4)); win->size_range(WB + 100 + 2 * BB + 3 * WB, 100); - win->position(CTX::instance()->msg_position[0], CTX::instance()->msg_position[1]); + win->position(CTX::instance()->msgPosition[0], CTX::instance()->msgPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; @@ -110,7 +110,7 @@ messageWindow::messageWindow(int deltaFontSize) void messageWindow::add(const char *msg) { browser->add(msg, 0); - if(CTX::instance()->msg_auto_scroll) + if(CTX::instance()->msgAutoScroll) browser->bottomline(browser->size()); } diff --git a/Fltk/openglWindow.cpp b/Fltk/openglWindow.cpp index a1872e0caa3f6786b3450418be6d0a3007750314..81e72e610d246a89bbc73d8ec9c8779d61ed2bff 100644 --- a/Fltk/openglWindow.cpp +++ b/Fltk/openglWindow.cpp @@ -92,7 +92,7 @@ void openglWindow::drawScreenMessage() return; glColor4ubv((GLubyte *) & CTX::instance()->color.text); - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); double h = gl_height(); if(screenMessage[0].size()){ @@ -167,7 +167,7 @@ void openglWindow::draw() glLoadIdentity(); glColor3d(1., 1., 1.); glDisable(GL_DEPTH_TEST); - if(selectionMode && CTX::instance()->mouse_selection){ + if(selectionMode && CTX::instance()->mouseSelection){ glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x0F0F); } @@ -195,17 +195,17 @@ void openglWindow::draw() } else if(addPointMode) { // draw the whole scene and the point to add - if(CTX::instance()->fast_redraw) { + if(CTX::instance()->fastRedraw) { CTX::instance()->mesh.draw = 0; CTX::instance()->post.draw = 0; } - glClearColor(CTX::instance()->unpack_red(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_green(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_blue(CTX::instance()->color.bg) / 255., 0.); + glClearColor(CTX::instance()->unpackRed(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackGreen(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackBlue(CTX::instance()->color.bg) / 255., 0.); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); _ctx->draw3d(); glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glPointSize(CTX::instance()->geom.point_size); + glPointSize(CTX::instance()->geom.pointSize); glBegin(GL_POINTS); glVertex3d(_point[0], _point[1], _point[2]); glEnd(); @@ -217,9 +217,9 @@ void openglWindow::draw() } else{ // draw the whole scene - glClearColor(CTX::instance()->unpack_green(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_green(CTX::instance()->color.bg) / 255., - CTX::instance()->unpack_blue(CTX::instance()->color.bg) / 255., 0.); + glClearColor(CTX::instance()->unpackRed(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackGreen(CTX::instance()->color.bg) / 255., + CTX::instance()->unpackBlue(CTX::instance()->color.bg) / 255., 0.); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); _ctx->draw3d(); _ctx->draw2d(); @@ -272,7 +272,7 @@ int openglWindow::handle(int event) } else if(lassoMode) { lassoMode = false; - if(selectionMode && CTX::instance()->mouse_selection){ + if(selectionMode && CTX::instance()->mouseSelection){ // will try to select multiple entities _trySelection = 2; _trySelectionXYWH[0] = (int)(_click.win[0] + _curr.win[0]) / 2; @@ -284,7 +284,7 @@ int openglWindow::handle(int event) lassoZoom(_ctx, _click, _curr); } } - else if(CTX::instance()->mouse_selection){ + else if(CTX::instance()->mouseSelection){ // will try to select clicked entity _trySelection = 1; _trySelectionXYWH[0] = (int)_curr.win[0]; @@ -303,7 +303,7 @@ int openglWindow::handle(int event) } else if(lassoMode) { lassoMode = false; - if(selectionMode && CTX::instance()->mouse_selection){ + if(selectionMode && CTX::instance()->mouseSelection){ // will try to unselect multiple entities _trySelection = -2; _trySelectionXYWH[0] = (int)(_click.win[0] + _curr.win[0]) / 2; @@ -315,7 +315,7 @@ int openglWindow::handle(int event) lassoZoom(_ctx, _click, _curr); } } - else if(CTX::instance()->mouse_selection){ + else if(CTX::instance()->mouseSelection){ // will try to unselect clicked entity _trySelection = -1; _trySelectionXYWH[0] = (int)_curr.win[0]; @@ -345,7 +345,7 @@ int openglWindow::handle(int event) case FL_RELEASE: _curr.set(_ctx); - CTX::instance()->draw_rotation_center = 0; + CTX::instance()->drawRotationCenter = 0; if(!lassoMode) { CTX::instance()->mesh.draw = 1; CTX::instance()->post.draw = 1; @@ -357,7 +357,7 @@ int openglWindow::handle(int event) case FL_MOUSEWHEEL: { double dy = Fl::event_dy(); - double fact = (5. * CTX::instance()->zoom_factor * fabs(dy) + h()) / (double)h(); + double fact = (5. * CTX::instance()->zoomFactor * fabs(dy) + h()) / (double)h(); _ctx->s[0] *= ((dy > 0) ? fact : 1./fact); _ctx->s[1] = _ctx->s[0]; _ctx->s[2] = _ctx->s[0]; @@ -399,7 +399,7 @@ int openglWindow::handle(int event) else if(Fl::event_button() == 2 || (Fl::event_button() == 1 && Fl::event_state(FL_SHIFT))) { if(fabs(dy) > fabs(dx)) { - double fact = (CTX::instance()->zoom_factor * fabs(dy) + h()) / (double)h(); + double fact = (CTX::instance()->zoomFactor * fabs(dy) + h()) / (double)h(); _ctx->s[0] *= ((dy > 0) ? fact : 1./fact); _ctx->s[1] = _ctx->s[0]; _ctx->s[2] = _ctx->s[0]; @@ -413,8 +413,8 @@ int openglWindow::handle(int event) _ctx->t[1] += (_curr.wnr[1] - _click.wnr[1]); _ctx->t[2] = 0.; } - CTX::instance()->draw_rotation_center = 1; - if(CTX::instance()->fast_redraw) { + CTX::instance()->drawRotationCenter = 1; + if(CTX::instance()->fastRedraw) { CTX::instance()->mesh.draw = 0; CTX::instance()->post.draw = 0; } @@ -466,7 +466,7 @@ int openglWindow::handle(int event) std::vector<GRegion*> regions; std::vector<MElement*> elements; bool res = processSelectionBuffer(_selection, false, - CTX::instance()->mouse_hover_meshes, + CTX::instance()->mouseHoverMeshes, (int)_curr.win[0], (int)_curr.win[1], 5, 5, vertices, edges, faces, regions, elements); if((_selection == ENT_ALL && res) || @@ -545,7 +545,7 @@ bool openglWindow::processSelectionBuffer(int type, bool multipleSelection, // In our case the selection buffer size is equal to between 5 and 7 // times the maximum number of possible hits GModel *m = GModel::current(); - int eles = (meshSelection && CTX::instance()->pick_elements) ? + int eles = (meshSelection && CTX::instance()->pickElements) ? 4 * m->getNumMeshElements() : 0; int size = 7 * (m->getNumVertices() + m->getNumEdges() + m->getNumFaces() + m->getNumRegions() + eles) + 1000 ; diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index a84ead4011486985e9cba3228ae53ff8146c8ba9..a876df7d788fe22fb56b5f0a9466a9067d5527fb 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -108,11 +108,11 @@ static void color_cb(Fl_Widget *w, void *data) { unsigned int (*fct) (int, int, unsigned int); fct = (unsigned int (*)(int, int, unsigned int))data; - uchar r = CTX::instance()->unpack_red(fct(0, GMSH_GET, 0)); - uchar g = CTX::instance()->unpack_green(fct(0, GMSH_GET, 0)); - uchar b = CTX::instance()->unpack_blue(fct(0, GMSH_GET, 0)); + uchar r = CTX::instance()->unpackRed(fct(0, GMSH_GET, 0)); + uchar g = CTX::instance()->unpackGreen(fct(0, GMSH_GET, 0)); + uchar b = CTX::instance()->unpackBlue(fct(0, GMSH_GET, 0)); if(fl_color_chooser("Color Chooser", r, g, b)) - fct(0, GMSH_SET | GMSH_GUI, CTX::instance()->pack_color(r, g, b, 255)); + fct(0, GMSH_SET | GMSH_GUI, CTX::instance()->packColor(r, g, b, 255)); Draw(); } @@ -120,15 +120,15 @@ static void view_color_cb(Fl_Widget *w, void *data) { unsigned int (*fct) (int, int, unsigned int); fct = (unsigned int (*)(int, int, unsigned int))data; - uchar r = CTX::instance()->unpack_red + uchar r = CTX::instance()->unpackRed (fct(GUI::instance()->options->view.index, GMSH_GET, 0)); - uchar g = CTX::instance()->unpack_green + uchar g = CTX::instance()->unpackGreen (fct(GUI::instance()->options->view.index, GMSH_GET, 0)); - uchar b = CTX::instance()->unpack_blue + uchar b = CTX::instance()->unpackBlue (fct(GUI::instance()->options->view.index, GMSH_GET, 0)); if(fl_color_chooser("Color Chooser", r, g, b)) fct(GUI::instance()->options->view.index, - GMSH_SET | GMSH_GUI, CTX::instance()->pack_color(r, g, b, 255)); + GMSH_SET | GMSH_GUI, CTX::instance()->packColor(r, g, b, 255)); Draw(); } @@ -144,7 +144,7 @@ static void options_browser_cb(Fl_Widget *w, void *data) void options_save_cb(Fl_Widget *w, void *data) { - std::string fileName = CTX::instance()->home_dir + CTX::instance()->options_filename; + std::string fileName = CTX::instance()->homeDir + CTX::instance()->optionsFileName; Msg::StatusBar(2, true, "Writing '%s'", fileName.c_str()); Print_Options(0, GMSH_OPTIONSRC, 1, 1, fileName.c_str()); Msg::StatusBar(2, true, "Wrote '%s'", fileName.c_str()); @@ -153,8 +153,8 @@ void options_save_cb(Fl_Widget *w, void *data) static void options_restore_defaults_cb(Fl_Widget *w, void *data) { // not sure if we have to remove the file... - UnlinkFile(CTX::instance()->home_dir + CTX::instance()->session_filename); - UnlinkFile(CTX::instance()->home_dir + CTX::instance()->options_filename); + UnlinkFile(CTX::instance()->homeDir + CTX::instance()->sessionFileName); + UnlinkFile(CTX::instance()->homeDir + CTX::instance()->optionsFileName); ReInit_Options(0); Init_Options_GUI(0); if(GUI::instance()->menu->module->value() == 3) // hack to refresh the buttons @@ -219,7 +219,7 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) if(data){ const char *name = (const char*)data; if(!strcmp(name, "rotation_center_coord")){ - CTX::instance()->draw_rotation_center = 1; + CTX::instance()->drawRotationCenter = 1; } else if(!strcmp(name, "light_value")){ double x, y, z; @@ -251,7 +251,7 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_session_save(0, GMSH_SET, o->general.butt[8]->value()); if(sessionrc && !opt_general_session_save(0, GMSH_GET, 0)) Print_Options(0, GMSH_SESSIONRC, 1, 1, - (CTX::instance()->home_dir + CTX::instance()->session_filename).c_str()); + (CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str()); opt_general_options_save(0, GMSH_SET, o->general.butt[9]->value()); opt_general_expert_mode(0, GMSH_SET, o->general.butt[10]->value()); opt_general_tooltips(0, GMSH_SET, o->general.butt[13]->value()); @@ -306,11 +306,11 @@ static void general_options_ok_cb(Fl_Widget *w, void *data) opt_general_axes(0, GMSH_SET, o->general.choice[4]->value()); opt_general_background_gradient(0, GMSH_SET, o->general.choice[5]->value()); - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; - CTX::instance()->draw_rotation_center = 0; + CTX::instance()->drawRotationCenter = 0; } static void general_arrow_param_cb(Fl_Widget *w, void *data) @@ -377,7 +377,7 @@ static void geometry_options_ok_cb(Fl_Widget *w, void *data) opt_geometry_surface_type(0, GMSH_SET, o->geo.choice[2]->value()); opt_geometry_transform(0, GMSH_SET, o->geo.choice[3]->value()); - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; @@ -402,7 +402,6 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data) opt_mesh_order(0, GMSH_SET, o->mesh.value[3]->value()); opt_mesh_smooth_internal_edges(0, GMSH_SET, o->mesh.butt[3]->value()); opt_mesh_second_order_incomplete(0, GMSH_SET, o->mesh.butt[4]->value()); - opt_mesh_c1(0, GMSH_SET, o->mesh.butt[21]->value()); opt_mesh_points(0, GMSH_SET, o->mesh.butt[6]->value()); opt_mesh_lines(0, GMSH_SET, o->mesh.butt[7]->value()); opt_mesh_triangles(0, GMSH_SET, o->mesh.menu->menu()[0].value() ? 1 : 0); @@ -452,7 +451,7 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data) opt_mesh_quality_type(0, GMSH_SET, o->mesh.choice[6]->value()); opt_mesh_label_type(0, GMSH_SET, o->mesh.choice[7]->value()); - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; @@ -473,11 +472,9 @@ static void solver_options_ok_cb(Fl_Widget *w, void *data) if(!old_listen && o->solver.butt[0]->value()) Solver(-1, 0); - opt_solver_max_delay(0, GMSH_SET, o->solver.value[0]->value()); - opt_solver_socket_name(0, GMSH_SET, o->solver.input[0]->value()); - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; @@ -501,7 +498,7 @@ static void post_options_ok_cb(Fl_Widget *w, void *data) opt_post_link(0, GMSH_SET, o->post.choice[0]->value()); - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; @@ -1104,14 +1101,14 @@ static void view_options_ok_cb(Fl_Widget *w, void *data) // colorbar window if(force || (i != current)) { - ColorTable_Copy(&PView::list[current]->getOptions()->CT); - ColorTable_Paste(&PView::list[i]->getOptions()->CT); + ColorTable_Copy(&PView::list[current]->getOptions()->colorTable); + ColorTable_Paste(&PView::list[i]->getOptions()->colorTable); PView::list[i]->setChanged(true); } } } - if(CTX::instance()->fast_redraw) + if(CTX::instance()->fastRedraw) CTX::instance()->post.draw = CTX::instance()->mesh.draw = 0; Draw(); CTX::instance()->post.draw = CTX::instance()->mesh.draw = 1; @@ -1137,7 +1134,7 @@ optionWindow::optionWindow(int deltaFontSize) int L = 7 * FL_NORMAL_SIZE; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false); + (width, height, CTX::instance()->nonModalWindows ? true : false); win->box(GMSH_WINDOW_BOX); win->label("Options - General"); @@ -1983,11 +1980,6 @@ optionWindow::optionWindow(int deltaFontSize) mesh.butt[3]->type(FL_TOGGLE_BUTTON); mesh.butt[3]->callback(mesh_options_ok_cb); - mesh.butt[21] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 7 * BH, BW, BH, "Impose C1 continuity (2D-plane only)"); - mesh.butt[21]->type(FL_TOGGLE_BUTTON); - mesh.butt[21]->callback(mesh_options_ok_cb); - o->end(); } @@ -2271,21 +2263,13 @@ optionWindow::optionWindow(int deltaFontSize) Fl_Group *o = new Fl_Group (L + WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "General"); - solver.value[0] = new Fl_Value_Input - (L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Maximum solver delay"); - solver.value[0]->minimum(0); - solver.value[0]->maximum(10); - solver.value[0]->step(1); - solver.value[0]->align(FL_ALIGN_RIGHT); - solver.value[0]->callback(solver_options_ok_cb); - solver.input[0] = new Fl_Input - (L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Socket name"); + (L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Socket name"); solver.input[0]->align(FL_ALIGN_RIGHT); solver.input[0]->callback(solver_options_ok_cb); solver.butt[0] = new Fl_Check_Button - (L + 2 * WB, 2 * WB + 3 * BH, BW, BH, + (L + 2 * WB, 2 * WB + 2 * BH, BW, BH, "Always listen to incoming connection requests"); solver.butt[0]->type(FL_TOGGLE_BUTTON); solver.butt[0]->callback(solver_options_ok_cb); @@ -3038,7 +3022,7 @@ optionWindow::optionWindow(int deltaFontSize) } view.group->end(); - win->position(CTX::instance()->opt_position[0], CTX::instance()->opt_position[1]); + win->position(CTX::instance()->optPosition[0], CTX::instance()->optPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; @@ -3304,7 +3288,7 @@ void optionWindow::updateViewGroup(int index) opt_view_color_axes(index, GMSH_GUI, 0); view.colorbar->update(data->getName().c_str(), data->getMin(), - data->getMax(), &opt->CT, &v->getChanged()); + data->getMax(), &opt->colorTable, &v->getChanged()); } void optionWindow::activate(const char *what) diff --git a/Fltk/partitionDialog.cpp b/Fltk/partitionDialog.cpp index 6b7ac7d5e3d51cbf7427f3b7f073c5b90dd3f9e4..988b9715bc24867e05c0bdacbdaa1e001ce74d67 100644 --- a/Fltk/partitionDialog.cpp +++ b/Fltk/partitionDialog.cpp @@ -72,88 +72,88 @@ struct PartitionDialog void write_all_options() { // Group 0 - CTX::instance()->partition_options.partitioner = choicePartitioner->value() + 1; - CTX::instance()->partition_options.num_partitions = + CTX::instance()->partitionOptions.partitioner = choicePartitioner->value() + 1; + CTX::instance()->partitionOptions.num_partitions = static_cast<int>(inputNumPartition->value()); // Group 1 - CTX::instance()->partition_options.global_method = choiceChacoAlg->value() + 1; + CTX::instance()->partitionOptions.global_method = choiceChacoAlg->value() + 1; // Group 2 - CTX::instance()->partition_options.architecture = choiceArchitecture->value(); - switch(CTX::instance()->partition_options.architecture) { + CTX::instance()->partitionOptions.architecture = choiceArchitecture->value(); + switch(CTX::instance()->partitionOptions.architecture) { case 0: - CTX::instance()->partition_options.ndims_tot = + CTX::instance()->partitionOptions.ndims_tot = static_cast<int>(inputNumPartition1->value()); break; case 3: - CTX::instance()->partition_options.mesh_dims[2] = + CTX::instance()->partitionOptions.mesh_dims[2] = static_cast<int>(inputNumPartition3->value()); case 2: - CTX::instance()->partition_options.mesh_dims[1] = + CTX::instance()->partitionOptions.mesh_dims[1] = static_cast<int>(inputNumPartition2->value()); case 1: - CTX::instance()->partition_options.mesh_dims[0] = + CTX::instance()->partitionOptions.mesh_dims[0] = static_cast<int>(inputNumPartition1->value()); break; } - CTX::instance()->partition_options.ndims = choiceDivisions->value() + 1; - CTX::instance()->partition_options.vmax = static_cast<int>(inputVMax->value()); - CTX::instance()->partition_options.rqi_flag = choiceEigensolver->value(); - CTX::instance()->partition_options.eigtol = inputEigtol->value(); - CTX::instance()->partition_options.local_method = choiceLocalAlgorithm->value() + 1; - CTX::instance()->partition_options.seed = static_cast<long>(inputSeed->value()); - CTX::instance()->partition_options.refine_partition = checkButtonRefPart->value(); - CTX::instance()->partition_options.internal_vertices = checkButtonIntVert->value(); - CTX::instance()->partition_options.refine_map = checkButtonRefMap->value(); - CTX::instance()->partition_options.terminal_propogation = + CTX::instance()->partitionOptions.ndims = choiceDivisions->value() + 1; + CTX::instance()->partitionOptions.vmax = static_cast<int>(inputVMax->value()); + CTX::instance()->partitionOptions.rqi_flag = choiceEigensolver->value(); + CTX::instance()->partitionOptions.eigtol = inputEigtol->value(); + CTX::instance()->partitionOptions.local_method = choiceLocalAlgorithm->value() + 1; + CTX::instance()->partitionOptions.seed = static_cast<long>(inputSeed->value()); + CTX::instance()->partitionOptions.refine_partition = checkButtonRefPart->value(); + CTX::instance()->partitionOptions.internal_vertices = checkButtonIntVert->value(); + CTX::instance()->partitionOptions.refine_map = checkButtonRefMap->value(); + CTX::instance()->partitionOptions.terminal_propogation = checkButtonTermProp->value(); // Group 3 - CTX::instance()->partition_options.algorithm = choiceMetisAlg->value() + 1; + CTX::instance()->partitionOptions.algorithm = choiceMetisAlg->value() + 1; // Group 4 - CTX::instance()->partition_options.edge_matching = choiceEdgeMatch->value() + 1; - CTX::instance()->partition_options.refine_algorithm = choiceRefineAlg->value() + 1; + CTX::instance()->partitionOptions.edge_matching = choiceEdgeMatch->value() + 1; + CTX::instance()->partitionOptions.refine_algorithm = choiceRefineAlg->value() + 1; } void read_all_options() { // Group 0 - choicePartitioner->value(CTX::instance()->partition_options.partitioner - 1); - inputNumPartition->value(CTX::instance()->partition_options.num_partitions); + choicePartitioner->value(CTX::instance()->partitionOptions.partitioner - 1); + inputNumPartition->value(CTX::instance()->partitionOptions.num_partitions); // Group 1 - choiceChacoAlg->value(CTX::instance()->partition_options.global_method - 1); + choiceChacoAlg->value(CTX::instance()->partitionOptions.global_method - 1); // Group 2 - choiceArchitecture->value(CTX::instance()->partition_options.architecture); - switch(CTX::instance()->partition_options.architecture) { + choiceArchitecture->value(CTX::instance()->partitionOptions.architecture); + switch(CTX::instance()->partitionOptions.architecture) { case 0: - inputNumPartition1->value(CTX::instance()->partition_options.ndims_tot); + inputNumPartition1->value(CTX::instance()->partitionOptions.ndims_tot); break; case 1: - inputNumPartition1->value(CTX::instance()->partition_options.mesh_dims[0]); + inputNumPartition1->value(CTX::instance()->partitionOptions.mesh_dims[0]); break; } - inputNumPartition2->value(CTX::instance()->partition_options.mesh_dims[1]); - inputNumPartition3->value(CTX::instance()->partition_options.mesh_dims[2]); - choiceDivisions->value(CTX::instance()->partition_options.ndims - 1); - inputVMax->value(CTX::instance()->partition_options.vmax); - choiceEigensolver->value(CTX::instance()->partition_options.rqi_flag); - inputEigtol->value(CTX::instance()->partition_options.eigtol); - choiceLocalAlgorithm->value(CTX::instance()->partition_options.local_method - 1); - inputSeed->value(CTX::instance()->partition_options.seed); - checkButtonRefPart->value(CTX::instance()->partition_options.refine_partition); - checkButtonIntVert->value(CTX::instance()->partition_options.internal_vertices); - checkButtonRefMap->value(CTX::instance()->partition_options.refine_map); - checkButtonTermProp->value(CTX::instance()->partition_options.terminal_propogation); + inputNumPartition2->value(CTX::instance()->partitionOptions.mesh_dims[1]); + inputNumPartition3->value(CTX::instance()->partitionOptions.mesh_dims[2]); + choiceDivisions->value(CTX::instance()->partitionOptions.ndims - 1); + inputVMax->value(CTX::instance()->partitionOptions.vmax); + choiceEigensolver->value(CTX::instance()->partitionOptions.rqi_flag); + inputEigtol->value(CTX::instance()->partitionOptions.eigtol); + choiceLocalAlgorithm->value(CTX::instance()->partitionOptions.local_method - 1); + inputSeed->value(CTX::instance()->partitionOptions.seed); + checkButtonRefPart->value(CTX::instance()->partitionOptions.refine_partition); + checkButtonIntVert->value(CTX::instance()->partitionOptions.internal_vertices); + checkButtonRefMap->value(CTX::instance()->partitionOptions.refine_map); + checkButtonTermProp->value(CTX::instance()->partitionOptions.terminal_propogation); // Group 3 - choiceMetisAlg->value(CTX::instance()->partition_options.algorithm - 1); + choiceMetisAlg->value(CTX::instance()->partitionOptions.algorithm - 1); // Group 4 - choiceEdgeMatch->value(CTX::instance()->partition_options.edge_matching - 1); - choiceRefineAlg->value(CTX::instance()->partition_options.refine_algorithm - 1); + choiceEdgeMatch->value(CTX::instance()->partitionOptions.edge_matching - 1); + choiceRefineAlg->value(CTX::instance()->partitionOptions.refine_algorithm - 1); // Call all callbacks to ensure consistent options partition_opt_chaco_globalalg_cb(choiceChacoAlg, this); @@ -303,7 +303,7 @@ void partition_opt_spectralcheck_cb(Fl_Widget *widget, void *data) void partition_defaults_cb(Fl_Widget *widget, void *data) { PartitionDialog *dlg = static_cast<PartitionDialog*>(data); - CTX::instance()->partition_options.setDefaults(); + CTX::instance()->partitionOptions.setDefaults(); dlg->read_all_options(); partition_select_groups_cb(dlg->choicePartitioner, data); } @@ -316,7 +316,7 @@ void partition_partition_cb(Fl_Widget *widget, void *data) dlg->write_all_options(); // Partition the mesh - int ier = PartitionMesh(GModel::current(), CTX::instance()->partition_options); + int ier = PartitionMesh(GModel::current(), CTX::instance()->partitionOptions); // Update the screen if(!ier) { @@ -467,7 +467,7 @@ void partition_dialog() int y = 0; dlg.window = new paletteWindow - (w, h, CTX::instance()->non_modal_windows ? true : false, "Partitioner Options"); + (w, h, CTX::instance()->nonModalWindows ? true : false, "Partitioner Options"); dlg.window->box(GMSH_WINDOW_BOX); dlg.window->callback((Fl_Callback *)partition_cancel_cb, &dlg); diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp index 963a6cc84b0bf708b67caa6bed8b57ece0501d08..65c80b318977eaf72cb2c167f9e9b3abd33c6965 100644 --- a/Fltk/pluginWindow.cpp +++ b/Fltk/pluginWindow.cpp @@ -139,14 +139,14 @@ static void plugin_run_cb(Fl_Widget *w, void *data) if(no_view_selected) p->execute(0); GUI::instance()->updateViews(); - CTX::instance()->post.plugin_draw_function = NULL; + CTX::instance()->post.pluginDrawFunction = NULL; Draw(); } static void plugin_cancel_cb(Fl_Widget *w, void *data) { GUI::instance()->plugins->win->hide(); - CTX::instance()->post.plugin_draw_function = NULL; + CTX::instance()->post.pluginDrawFunction = NULL; Draw(); } @@ -234,13 +234,13 @@ pluginWindow::pluginWindow(int deltaFontSize) int width0 = 34 * FL_NORMAL_SIZE + WB; int height0 = 12 * BH + 4 * WB; - int width = (CTX::instance()->plugin_size[0] < width0) ? width0 : - CTX::instance()->plugin_size[0]; - int height = (CTX::instance()->plugin_size[1] < height0) ? height0 : - CTX::instance()->plugin_size[1]; + int width = (CTX::instance()->pluginSize[0] < width0) ? width0 : + CTX::instance()->pluginSize[0]; + int height = (CTX::instance()->pluginSize[1] < height0) ? height0 : + CTX::instance()->pluginSize[1]; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Plugins"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Plugins"); win->box(GMSH_WINDOW_BOX); int L1 = (int)(0.3 * width), L2 = (int)(0.6 * L1); @@ -272,7 +272,7 @@ pluginWindow::pluginWindow(int deltaFontSize) win->resizable(resize_box); win->size_range(width0, height0); - win->position(CTX::instance()->plugin_position[0], CTX::instance()->plugin_position[1]); + win->position(CTX::instance()->pluginPosition[0], CTX::instance()->pluginPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/projectionEditor.cpp b/Fltk/projectionEditor.cpp index a3c02c59938a8ff5dd57b162936ba1f31540475a..1057172454b5835412957041f6d23cb5528fe667 100644 --- a/Fltk/projectionEditor.cpp +++ b/Fltk/projectionEditor.cpp @@ -267,9 +267,9 @@ static void select_cb(Fl_Widget *w, void *data) const char *str; switch(what){ - case ENT_ALL: CTX::instance()->pick_elements = 1; str = "Elements"; break; - case ENT_POINT: CTX::instance()->pick_elements = 0; str = "Points"; break; - case ENT_SURFACE: CTX::instance()->pick_elements = 0; str = "Surfaces"; break; + case ENT_ALL: CTX::instance()->pickElements = 1; str = "Elements"; break; + case ENT_POINT: CTX::instance()->pickElements = 0; str = "Points"; break; + case ENT_SURFACE: CTX::instance()->pickElements = 0; str = "Surfaces"; break; default: return; } @@ -289,7 +289,7 @@ static void select_cb(Fl_Widget *w, void *data) char ib = GUI::instance()->selectEntity(what); if(ib == 'l') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++){ if(GUI::instance()->selectedElements[i]->getVisibility() != 2){ GUI::instance()->selectedElements[i]->setVisibility(2); @@ -313,7 +313,7 @@ static void select_cb(Fl_Widget *w, void *data) } } if(ib == 'r') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < GUI::instance()->selectedElements.size(); i++) GUI::instance()->selectedElements[i]->setVisibility(1); } @@ -325,7 +325,7 @@ static void select_cb(Fl_Widget *w, void *data) } } if(ib == 'u') { - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ if(ele.size()){ ele[ele.size() - 1]->setVisibility(1); ele.pop_back(); } @@ -351,7 +351,7 @@ static void select_cb(Fl_Widget *w, void *data) } CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; Draw(); Msg::StatusBar(3, false, ""); } @@ -409,7 +409,7 @@ static void filter_cb(Fl_Widget *w, void *data) static void proj_hide_cb(Fl_Widget *w, void *data) { - CTX::instance()->hide_unselected = !CTX::instance()->hide_unselected; + CTX::instance()->hideUnselected = !CTX::instance()->hideUnselected; CTX::instance()->mesh.changed = ENT_ALL; Draw(); } @@ -742,9 +742,9 @@ void uvPlot::color(double d) else index = (int)((d - _dmin) * (_colorTable.size - 1) / (_dmax - _dmin)); unsigned int color = _colorTable.table[index]; - int r = CTX::instance()->unpack_red(color); - int g = CTX::instance()->unpack_green(color); - int b = CTX::instance()->unpack_blue(color); + int r = CTX::instance()->unpackRed(color); + int g = CTX::instance()->unpackGreen(color); + int b = CTX::instance()->unpackBlue(color); fl_color(r, g, b); } @@ -769,9 +769,9 @@ void uvPlot::draw() for(int i = 0; i < w(); i++){ int index = (int)(i * (_colorTable.size - 1) / w()); unsigned int color = _colorTable.table[index]; - int r = CTX::instance()->unpack_red(color); - int g = CTX::instance()->unpack_green(color); - int b = CTX::instance()->unpack_blue(color); + int r = CTX::instance()->unpackRed(color); + int g = CTX::instance()->unpackGreen(color); + int b = CTX::instance()->unpackBlue(color); fl_color(r, g, b); fl_line(i, ph, i, ph + 10); } @@ -896,7 +896,7 @@ projectionEditor::projectionEditor() // create all widgets (we construct this once, we never deallocate!) _window = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Reparameterize"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Reparameterize"); new Fl_Box(WB, WB + BH / 2, BB / 2, BH, "Select:"); diff --git a/Fltk/solverWindow.cpp b/Fltk/solverWindow.cpp index 04e260dd72fce60fbbd3c9be90c6779b3594eba7..ec2cbf6548fe6ad63e6ab6a44fe4432d256399cf 100644 --- a/Fltk/solverWindow.cpp +++ b/Fltk/solverWindow.cpp @@ -202,7 +202,7 @@ solverWindow::solverWindow(int solverIndex, int deltaFontSize) int BBS = (width - 8 * WB) / 5; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Solver"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Solver"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs @@ -298,7 +298,7 @@ solverWindow::solverWindow(int solverIndex, int deltaFontSize) o->end(); } - win->position(CTX::instance()->solver_position[0], CTX::instance()->solver_position[1]); + win->position(CTX::instance()->solverPosition[0], CTX::instance()->solverPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/statisticsWindow.cpp b/Fltk/statisticsWindow.cpp index 0e3c918d7f8e8028660f5aa7027f8ce8c03c80c1..ab62172ae43aab13fb6651acab79e6361fc98f26 100644 --- a/Fltk/statisticsWindow.cpp +++ b/Fltk/statisticsWindow.cpp @@ -83,7 +83,7 @@ statisticsWindow::statisticsWindow(int deltaFontSize) int height = 5 * WB + 18 * BH; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Statistics"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Statistics"); win->box(GMSH_WINDOW_BOX); { Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 3 * WB - BH); @@ -172,7 +172,7 @@ statisticsWindow::statisticsWindow(int deltaFontSize) o->callback(statistics_update_cb); } - win->position(CTX::instance()->stat_position[0], CTX::instance()->stat_position[1]); + win->position(CTX::instance()->statPosition[0], CTX::instance()->statPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp index c7f43662949f70090d523e56688e3a26fa2a4ec1..f1e38573b35bad246b94893dfb06f6620b3bd017 100644 --- a/Fltk/visibilityWindow.cpp +++ b/Fltk/visibilityWindow.cpp @@ -848,7 +848,7 @@ static void _apply_visibility(char mode, bool physical, bool recursive = GUI::instance()->visibility->butt[0]->value() ? true : false; if(mode == 1){ // when showing a single entity, first hide everything - if(CTX::instance()->pick_elements) + if(CTX::instance()->pickElements) _set_visibility_by_number(1, -1, 0, false); else for(int i = 2; i <= 5; i++) @@ -857,7 +857,7 @@ static void _apply_visibility(char mode, bool physical, if(mode == 2) mode = 1; - if(CTX::instance()->pick_elements){ + if(CTX::instance()->pickElements){ for(unsigned int i = 0; i < elements.size(); i++) elements[i]->setVisibility(mode); } @@ -934,62 +934,62 @@ static void visibility_interactive_cb(Fl_Widget *w, void *data) bool physical = (str.find("physical") != std::string::npos); if(str == "elements to hide"){ - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; what = ENT_ALL; mode = 0; } else if(str == "points to hide" || str == "physical points to hide"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_POINT; mode = 0; opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "lines to hide" || str == "physical lines to hide"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_LINE; mode = 0; opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "surfaces to hide" || str == "physical surfaces to hide"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_SURFACE; mode = 0; if(GModel::current()->getMeshStatus() < 2) opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "volumes to hide" || str == "physical volumes to hide"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_VOLUME; mode = 0; if(GModel::current()->getMeshStatus() < 3) opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "elements to show"){ - CTX::instance()->pick_elements = 1; + CTX::instance()->pickElements = 1; what = ENT_ALL; mode = 1; } else if(str == "points to show" || str == "physical points to show"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_POINT; mode = 1; opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "lines to show" || str == "physical lines to show"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_LINE; mode = 1; opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "surfaces to show" || str == "physical surfaces to show"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_SURFACE; mode = 1; if(GModel::current()->getMeshStatus() < 2) opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); } else if(str == "volumes to show" || str == "physical volumes to show"){ - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; what = ENT_VOLUME; mode = 1; if(GModel::current()->getMeshStatus() < 3) @@ -1037,7 +1037,7 @@ static void visibility_interactive_cb(Fl_Widget *w, void *data) } CTX::instance()->mesh.changed = ENT_ALL; - CTX::instance()->pick_elements = 0; + CTX::instance()->pickElements = 0; Draw(); Msg::StatusBar(3, false, ""); } @@ -1083,7 +1083,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize) int brw = width - 4 * WB; win = new paletteWindow - (width, height, CTX::instance()->non_modal_windows ? true : false, "Visibility"); + (width, height, CTX::instance()->nonModalWindows ? true : false, "Visibility"); win->box(GMSH_WINDOW_BOX); Fl_Tabs *o = new Fl_Tabs @@ -1363,7 +1363,7 @@ visibilityWindow::visibilityWindow(int deltaFontSize) o1->callback(visibility_save_cb); } - win->position(CTX::instance()->vis_position[0], CTX::instance()->vis_position[1]); + win->position(CTX::instance()->visPosition[0], CTX::instance()->visPosition[1]); win->end(); FL_NORMAL_SIZE += deltaFontSize; diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp index 255a08f93ae476926d0cb1a8ae95d67e6b561b0a..80970a60f98a997133b1e54d7754be00fa205160 100644 --- a/Geo/GEntity.cpp +++ b/Geo/GEntity.cpp @@ -19,7 +19,7 @@ GEntity::GEntity(GModel *m, int t) : _model(m), _tag(t), _visible(1), _selection(0), _allElementsVisible(1), va_lines(0), va_triangles(0) { - _color = CTX::instance()->pack_color(0, 0, 255, 0); + _color = CTX::instance()->packColor(0, 0, 255, 0); } GEntity::~GEntity() @@ -35,7 +35,7 @@ void GEntity::deleteVertexArrays() char GEntity::getVisibility() { - if(CTX::instance()->hide_unselected && !CTX::instance()->pick_elements && + if(CTX::instance()->hideUnselected && !CTX::instance()->pickElements && !getSelection() && geomType() != ProjectionFace) return false; return _visible; @@ -43,10 +43,10 @@ char GEntity::getVisibility() bool GEntity::useColor() { - int r = CTX::instance()->unpack_red(_color); - int g = CTX::instance()->unpack_green(_color); - int b = CTX::instance()->unpack_blue(_color); - int a = CTX::instance()->unpack_alpha(_color); + int r = CTX::instance()->unpackRed(_color); + int g = CTX::instance()->unpackGreen(_color); + int b = CTX::instance()->unpackBlue(_color); + int a = CTX::instance()->unpackAlpha(_color); if(r == 0 && g == 0 && b == 255 && a == 0) return false; return true; diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index 165f9172586c7e71a9c7165fa0a59fcbe90c37bc..4a44b0c977b613a030d136b2dc2b883f36e433f6 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -705,7 +705,7 @@ bool GFace::buildSTLTriangulation() // by default we assume that straight lines are geodesics SPoint2 GFace::geodesic(const SPoint2 &pt1 , const SPoint2 &pt2 , double t) { - if(CTX::instance()->mesh.second_order_experimental && geomType() != GEntity::Plane ){ + if(CTX::instance()->mesh.secondOrderExperimental && geomType() != GEntity::Plane ){ // FIXME: this is buggy -- remove the CTX option once we do it in // a robust manner GPoint gp1 = point(pt1.x(), pt1.y()); diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index 0dcd57bf17d9c0515ec094469a16676a31020c87..71133a89f2951ef5d11c68a9f845a5c860446872 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -347,9 +347,9 @@ void OCC_Internals::loadBREP(const char *fn) BRepTools::Read(shape, (char*)fn, aBuilder); BRepTools::Clean(shape); healGeometry(CTX::instance()->geom.tolerance, - CTX::instance()->geom.occ_fix_small_edges, - CTX::instance()->geom.occ_fix_small_faces, - CTX::instance()->geom.occ_sew_faces); + CTX::instance()->geom.occFixSmallEdges, + CTX::instance()->geom.occFixSmallFaces, + CTX::instance()->geom.occSewFaces); BRepTools::Clean(shape); buildLists(); } @@ -363,9 +363,9 @@ void OCC_Internals::loadSTEP(const char *fn) shape = reader.OneShape(); BRepTools::Clean(shape); healGeometry(CTX::instance()->geom.tolerance, - CTX::instance()->geom.occ_fix_small_edges, - CTX::instance()->geom.occ_fix_small_faces, - CTX::instance()->geom.occ_sew_faces); + CTX::instance()->geom.occFixSmallEdges, + CTX::instance()->geom.occFixSmallFaces, + CTX::instance()->geom.occSewFaces); BRepTools::Clean(shape); buildLists(); } @@ -379,9 +379,9 @@ void OCC_Internals::loadIGES(const char *fn) shape = reader.OneShape(); BRepTools::Clean(shape); healGeometry(CTX::instance()->geom.tolerance, - CTX::instance()->geom.occ_fix_small_edges, - CTX::instance()->geom.occ_fix_small_faces, - CTX::instance()->geom.occ_sew_faces); + CTX::instance()->geom.occFixSmallEdges, + CTX::instance()->geom.occFixSmallFaces, + CTX::instance()->geom.occSewFaces); BRepTools::Clean(shape); buildLists(); } diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 4d8a2c7d5ca9733d94b66d10ec1cae1bde412e12..c5ed333f75c6fe76bc4872668551fd0f612a306d 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -329,7 +329,7 @@ void End_Curve(Curve *c) mat[0][2] = c->Circle.invmat[2][0] = dir12[2]; // assume circle in z=0 plane - if(CTX::instance()->geom.old_circle) { + if(CTX::instance()->geom.oldCircle) { if(n[0] == 0.0 && n[1] == 0.0) { mat[2][0] = c->Circle.invmat[0][2] = 0; mat[2][1] = c->Circle.invmat[1][2] = 0; @@ -423,7 +423,7 @@ void End_Curve(Curve *c) for(int i = 0; i < 4; i++) c->Circle.v[i] = v[i]; - if(!CTX::instance()->expert_mode && c->Num > 0 && A3 - A1 > 1.01 * M_PI){ + if(!CTX::instance()->expertMode && c->Num > 0 && A3 - A1 > 1.01 * M_PI){ Msg::Error("Circle or ellipse arc %d greater than Pi (angle=%g)", c->Num, A3-A1); Msg::Error("(If you understand what this implies, you can disable this error"); Msg::Error("message by selecting `Enable expert mode' in the option dialog."); @@ -656,7 +656,7 @@ int NEWPOINT(void) int NEWLINE(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxLineNum + 1); @@ -664,7 +664,7 @@ int NEWLINE(void) int NEWLINELOOP(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxLineLoopNum + 1); @@ -672,7 +672,7 @@ int NEWLINELOOP(void) int NEWSURFACE(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxSurfaceNum + 1); @@ -680,7 +680,7 @@ int NEWSURFACE(void) int NEWSURFACELOOP(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxSurfaceLoopNum + 1); @@ -688,7 +688,7 @@ int NEWSURFACELOOP(void) int NEWVOLUME(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxVolumeNum + 1); @@ -701,7 +701,7 @@ int NEWFIELD(void) int NEWPHYSICAL(void) { - if(CTX::instance()->geom.old_newreg) + if(CTX::instance()->geom.oldNewreg) return NEWREG(); else return (GModel::current()->getGEOInternals()->MaxPhysicalNum + 1); @@ -1601,7 +1601,7 @@ static void ApplyTransformationToPoint(double matrix[4][4], Vertex *v, // OK if the guy who builds the geometry knowns what he's // doing). Instead of adding one more option, let's just bypass all // the checks if auto_coherence==0... - if(CTX::instance()->geom.auto_coherence && end_curve_surface){ + if(CTX::instance()->geom.autoCoherence && end_curve_surface){ List_T *All = Tree2List(GModel::current()->getGEOInternals()->Curves); for(int i = 0; i < List_Nbr(All); i++) { Curve *c; @@ -1728,7 +1728,7 @@ void TranslateShapes(double X, double Y, double Z, List_T *shapes) SetTranslationMatrix(matrix, T); ApplicationOnShapes(matrix, shapes); - if(CTX::instance()->geom.auto_coherence) + if(CTX::instance()->geom.autoCoherence) ReplaceAllDuplicates(); } @@ -1742,7 +1742,7 @@ void DilatShapes(double X, double Y, double Z, double A, List_T *shapes) SetDilatationMatrix(matrix, T, A); ApplicationOnShapes(matrix, shapes); - if(CTX::instance()->geom.auto_coherence) + if(CTX::instance()->geom.autoCoherence) ReplaceAllDuplicates(); } @@ -1770,7 +1770,7 @@ void RotateShapes(double Ax, double Ay, double Az, SetTranslationMatrix(matrix, T); ApplicationOnShapes(matrix, shapes); - if(CTX::instance()->geom.auto_coherence) + if(CTX::instance()->geom.autoCoherence) ReplaceAllDuplicates(); } @@ -1781,7 +1781,7 @@ void SymmetryShapes(double A, double B, double C, double D, List_T *shapes) SetSymmetryMatrix(matrix, A, B, C, D); ApplicationOnShapes(matrix, shapes); - if(CTX::instance()->geom.auto_coherence) + if(CTX::instance()->geom.autoCoherence) ReplaceAllDuplicates(); } @@ -2007,18 +2007,18 @@ static int Extrude_ProtudePoint(int type, int ip, c->end = chapeau; break; case TRANSLATE_ROTATE: - d = CTX::instance()->geom.extrude_spline_points; + d = CTX::instance()->geom.extrudeSplinePoints; d = d ? d : 1; c = Create_Curve(NEWLINE(), MSH_SEGM_SPLN, 1, NULL, NULL, -1, -1, 0., 1.); c->Control_Points = - List_Create(CTX::instance()->geom.extrude_spline_points + 1, 1, sizeof(Vertex *)); + List_Create(CTX::instance()->geom.extrudeSplinePoints + 1, 1, sizeof(Vertex *)); c->Extrude = new ExtrudeParams; c->Extrude->fill(type, T0, T1, T2, A0, A1, A2, X0, X1, X2, alpha); if(e) c->Extrude->mesh = e->mesh; List_Add(c->Control_Points, &pv); c->beg = pv; - for(i = 0; i < CTX::instance()->geom.extrude_spline_points; i++) { + for(i = 0; i < CTX::instance()->geom.extrudeSplinePoints; i++) { if(i) chapeau = DuplicateVertex(chapeau); T[0] = -X0; @@ -2062,7 +2062,7 @@ static int Extrude_ProtudePoint(int type, int ip, List_Reset(ListOfTransformedPoints); - if(CTX::instance()->geom.auto_coherence && final) + if(CTX::instance()->geom.autoCoherence && final) ReplaceAllDuplicates(); return chapeau->Num; @@ -2222,7 +2222,7 @@ static int Extrude_ProtudeCurve(int type, int ic, *ps = s; - if(CTX::instance()->geom.auto_coherence && final) + if(CTX::instance()->geom.autoCoherence && final) ReplaceAllDuplicates(); return chapeau->Num; @@ -2277,16 +2277,16 @@ static int Extrude_ProtudeSurface(int type, int is, // FIXME: this is a really ugly hack for backward compatibility, so // that we don't screw up the old .geo files too much. (Before // version 1.54, we didn't always create new volumes during "Extrude - // Surface". Now we do, but with "CTX::instance()->geom.old_newreg==1", this + // Surface". Now we do, but with "CTX::instance()->geom.oldNewreg==1", this // bumps the NEWREG() counter, and thus changes the whole automatic - // numbering sequence.) So we locally force old_newreg to 0: in most + // numbering sequence.) So we locally force oldNewreg to 0: in most // cases, since we define points, curves, etc., before defining // volumes, the NEWVOLUME() call below will return a fairly low // number, that will not interfere with the other numbers... - int tmp = CTX::instance()->geom.old_newreg; - CTX::instance()->geom.old_newreg = 0; + int tmp = CTX::instance()->geom.oldNewreg; + CTX::instance()->geom.oldNewreg = 0; Volume *v = Create_Volume(NEWVOLUME(), MSH_VOLUME); - CTX::instance()->geom.old_newreg = tmp; + CTX::instance()->geom.oldNewreg = tmp; v->Extrude = new ExtrudeParams; v->Extrude->fill(type, T0, T1, T2, A0, A1, A2, X0, X1, X2, alpha); @@ -2396,7 +2396,7 @@ static int Extrude_ProtudeSurface(int type, int is, *pv = v; - if(CTX::instance()->geom.auto_coherence) + if(CTX::instance()->geom.autoCoherence) ReplaceAllDuplicates(); List_Reset(ListOfTransformedPoints); @@ -2477,7 +2477,7 @@ void ExtrudeShapes(int type, List_T *list_in, body.Num = ps->Num; body.Type = ps->Typ; List_Add(list_out, &body); - if(CTX::instance()->geom.extrude_return_lateral){ + if(CTX::instance()->geom.extrudeReturnLateral){ for(int j = 0; j < List_Nbr(ps->Generatrices); j++){ Curve *c; List_Read(ps->Generatrices, j, &c); @@ -2510,7 +2510,7 @@ void ExtrudeShapes(int type, List_T *list_in, body.Num = pv->Num; body.Type = pv->Typ; List_Add(list_out, &body); - if(CTX::instance()->geom.extrude_return_lateral){ + if(CTX::instance()->geom.extrudeReturnLateral){ for(int j = 0; j < List_Nbr(pv->Surfaces); j++){ Surface *s; List_Read(pv->Surfaces, j, &s); @@ -2672,7 +2672,7 @@ static void ReplaceDuplicatePoints() Msg::Debug("Removed %d duplicate points", start - end); - if(CTX::instance()->geom.old_newreg) { + if(CTX::instance()->geom.oldNewreg) { GModel::current()->getGEOInternals()->MaxPointNum = 0; Tree_Action(GModel::current()->getGEOInternals()->Points, MaxNumPoint); } @@ -2783,7 +2783,7 @@ static void ReplaceDuplicateCurves() Msg::Debug("Removed %d duplicate curves", start - end); - if(CTX::instance()->geom.old_newreg) { + if(CTX::instance()->geom.oldNewreg) { GModel::current()->getGEOInternals()->MaxLineNum = 0; Tree_Action(GModel::current()->getGEOInternals()->Curves, MaxNumCurve); } @@ -2845,7 +2845,7 @@ static void ReplaceDuplicateSurfaces() Msg::Debug("Removed %d duplicate surfaces", start - end); - if(CTX::instance()->geom.old_newreg) { + if(CTX::instance()->geom.oldNewreg) { GModel::current()->getGEOInternals()->MaxSurfaceNum = 0; Tree_Action(GModel::current()->getGEOInternals()->Surfaces, MaxNumSurface); } diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index e69708ba8ab31dffbb39997376b3306eaae29c4e..a96a5d973a48bd5bcea0320ee11d86f909b4dfd3 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -26,18 +26,18 @@ double evaluate_scalarfunction(std::string var, double val, std::string funct) return 0.; #else FILE *tempf = gmsh_yyin; - if(!(gmsh_yyin = fopen((CTX::instance()->home_dir + - CTX::instance()->tmp_filename).c_str(), "w"))) { + if(!(gmsh_yyin = fopen((CTX::instance()->homeDir + + CTX::instance()->tmpFileName).c_str(), "w"))) { Msg::Error("Unable to open temporary file '%s'", - (CTX::instance()->home_dir + CTX::instance()->tmp_filename).c_str()); + (CTX::instance()->homeDir + CTX::instance()->tmpFileName).c_str()); return 0.; } // pose "variable = function" and evaluate function fprintf(gmsh_yyin, "%s = %.16g ;\n", var.c_str(), val); fprintf(gmsh_yyin, "ValeurTemporaire__ = %s ;\n", funct.c_str()); fclose(gmsh_yyin); - gmsh_yyin = fopen((CTX::instance()->home_dir + - CTX::instance()->tmp_filename).c_str(), "r"); + gmsh_yyin = fopen((CTX::instance()->homeDir + + CTX::instance()->tmpFileName).c_str(), "r"); while(!feof(gmsh_yyin)) { gmsh_yyparse(); } @@ -55,18 +55,18 @@ void add_infile(std::string text, std::string filename, bool deleted_something) #if defined(HAVE_NO_PARSER) Msg::Error("GEO file creation not available without Gmsh parser"); #else - if(!(gmsh_yyin = fopen((CTX::instance()->home_dir + - CTX::instance()->tmp_filename).c_str(), "w"))) { + if(!(gmsh_yyin = fopen((CTX::instance()->homeDir + + CTX::instance()->tmpFileName).c_str(), "w"))) { Msg::Error("Unable to open temporary file '%s'", - (CTX::instance()->home_dir + CTX::instance()->tmp_filename).c_str()); + (CTX::instance()->homeDir + CTX::instance()->tmpFileName).c_str()); return; } fprintf(gmsh_yyin, "%s\n", text.c_str()); Msg::StatusBar(2, true, "%s", text.c_str()); fclose(gmsh_yyin); - gmsh_yyin = fopen((CTX::instance()->home_dir + - CTX::instance()->tmp_filename).c_str(), "r"); + gmsh_yyin = fopen((CTX::instance()->homeDir + + CTX::instance()->tmpFileName).c_str(), "r"); while(!feof(gmsh_yyin)) { gmsh_yyparse(); } @@ -86,7 +86,7 @@ void add_infile(std::string text, std::string filename, bool deleted_something) return; } - if(!CTX::instance()->expert_mode) { + if(!CTX::instance()->expertMode) { char no_ext[256], ext[256], base[256]; SplitFileName(filename.c_str(), no_ext, ext, base); if(strlen(ext) && strcmp(ext, ".geo") && strcmp(ext, ".GEO")){ diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp index 144ecd086dbcca3f906337f2fdfc6a89fc4ed563..c0aa06b51c4e9ba0815c7af406329b3069a1e4fd 100644 --- a/Geo/MElement.cpp +++ b/Geo/MElement.cpp @@ -59,7 +59,7 @@ void MElement::_getFaceRep(MVertex *v0, MVertex *v1, MVertex *v2, char MElement::getVisibility() { - if(CTX::instance()->hide_unselected && _visible < 2) return false; + if(CTX::instance()->hideUnselected && _visible < 2) return false; return _visible; } @@ -815,8 +815,8 @@ const gmshFunctionSpace* MTriangle::getFunctionSpace(int o) const return 0; } -int MTriangleN::getNumEdgesRep(){ return 3 * CTX::instance()->mesh.num_sub_edges; } -int MTriangle6::getNumEdgesRep(){ return 3 * CTX::instance()->mesh.num_sub_edges; } +int MTriangleN::getNumEdgesRep(){ return 3 * CTX::instance()->mesh.numSubEdges; } +int MTriangle6::getNumEdgesRep(){ return 3 * CTX::instance()->mesh.numSubEdges; } static void _myGetEdgeRep(MTriangle *t, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges) @@ -855,16 +855,16 @@ static void _myGetEdgeRep(MTriangle *t, int num, double *x, double *y, double *z void MTriangleN::getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTriangle6::getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } -int MTriangle6::getNumFacesRep(){ return SQU(CTX::instance()->mesh.num_sub_edges); } -int MTriangleN::getNumFacesRep(){ return SQU(CTX::instance()->mesh.num_sub_edges); } +int MTriangle6::getNumFacesRep(){ return SQU(CTX::instance()->mesh.numSubEdges); } +int MTriangleN::getNumFacesRep(){ return SQU(CTX::instance()->mesh.numSubEdges); } static void _myGetFaceRep(MTriangle *t, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges) @@ -931,11 +931,11 @@ static void _myGetFaceRep(MTriangle *t, int num, double *x, double *y, double *z void MTriangleN::getFaceRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTriangle6::getFaceRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTriangle::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const @@ -1052,8 +1052,8 @@ const gmshFunctionSpace* MTetrahedron::getFunctionSpace(int o) const return 0; } -int MTetrahedron10::getNumEdgesRep(){ return 6 * CTX::instance()->mesh.num_sub_edges; } -int MTetrahedronN::getNumEdgesRep(){ return 6 * CTX::instance()->mesh.num_sub_edges; } +int MTetrahedron10::getNumEdgesRep(){ return 6 * CTX::instance()->mesh.numSubEdges; } +int MTetrahedronN::getNumEdgesRep(){ return 6 * CTX::instance()->mesh.numSubEdges; } static void _myGetEdgeRep(MTetrahedron *tet, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges) @@ -1089,16 +1089,16 @@ static void _myGetEdgeRep(MTetrahedron *tet, int num, double *x, double *y, doub void MTetrahedron10::getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTetrahedronN::getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetEdgeRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } -int MTetrahedronN::getNumFacesRep(){ return 4 * SQU(CTX::instance()->mesh.num_sub_edges); } -int MTetrahedron10::getNumFacesRep(){ return 4 * SQU(CTX::instance()->mesh.num_sub_edges); } +int MTetrahedronN::getNumFacesRep(){ return 4 * SQU(CTX::instance()->mesh.numSubEdges); } +int MTetrahedron10::getNumFacesRep(){ return 4 * SQU(CTX::instance()->mesh.numSubEdges); } static void _myGetFaceRep(MTetrahedron *tet, int num, double *x, double *y, double *z, SVector3 *n, int numSubEdges) @@ -1182,12 +1182,12 @@ static void _myGetFaceRep(MTetrahedron *tet, int num, double *x, double *y, doub void MTetrahedronN::getFaceRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTetrahedron10::getFaceRep(int num, double *x, double *y, double *z, SVector3 *n) { - _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.num_sub_edges); + _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); } void MTetrahedron::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const diff --git a/Geo/MFace.cpp b/Geo/MFace.cpp index 0234ec18085416e6911fd7bc28c1a69e080f312d..07c852b572d3273c8a5c4a9dc8bc36c454af6387 100644 --- a/Geo/MFace.cpp +++ b/Geo/MFace.cpp @@ -23,7 +23,7 @@ MFace::MFace() MFace::MFace(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3) { - if(CTX::instance()->mesh.reverse_all_normals){ + if(CTX::instance()->mesh.reverseAllNormals){ // Note that we cannot simply change the normal computation, // since OpenGL wants the normal to a polygon to be coherent // with the ordering of its vertices diff --git a/Geo/OCCEdge.cpp b/Geo/OCCEdge.cpp index 5e7edd6f58d46ea0ea3ba1e0c8b6dba921657a8d..4a0988d0daa8bd2897f9686ef78d1cd75dfc5087 100644 --- a/Geo/OCCEdge.cpp +++ b/Geo/OCCEdge.cpp @@ -202,7 +202,7 @@ int OCCEdge::minimumMeshSegments() const if(geomType() == Line) np = GEdge::minimumMeshSegments(); else - np = CTX::instance()->mesh.min_curv_points - 1; + np = CTX::instance()->mesh.minCurvPoints - 1; // if the edge is closed, ensure that at least 3 points are // generated in the 1D mesh (4 segments, one of which is @@ -217,7 +217,7 @@ int OCCEdge::minimumDrawSegments() const if(geomType() == Line) return GEdge::minimumDrawSegments(); else - return CTX::instance()->geom.num_sub_edges * GEdge::minimumDrawSegments(); + return CTX::instance()->geom.numSubEdges * GEdge::minimumDrawSegments(); } double OCCEdge::curvature(double par) const diff --git a/Geo/fourierEdge.cpp b/Geo/fourierEdge.cpp index b7cc878727b2443afe2a1dff1314b39436f2f1b6..697c987d01127655a840e7c5f4557f77187745a9 100644 --- a/Geo/fourierEdge.cpp +++ b/Geo/fourierEdge.cpp @@ -49,7 +49,7 @@ int fourierEdge::minimumDrawSegments() const if(geomType() == Line) return n; else - return CTX::instance()->geom.num_sub_edges * n; + return CTX::instance()->geom.numSubEdges * n; } #endif diff --git a/Geo/gmshEdge.cpp b/Geo/gmshEdge.cpp index 26a70a3564e557bf95f34044a853038b5df70103..a476b89d88b3352abf85993daac1ed3d710bb7bf 100644 --- a/Geo/gmshEdge.cpp +++ b/Geo/gmshEdge.cpp @@ -70,9 +70,9 @@ int gmshEdge::minimumMeshSegments () const np = GEdge::minimumMeshSegments(); else if(geomType() == Circle || geomType() == Ellipse) np = (int)(fabs(c->Circle.t1 - c->Circle.t2) * - (double)CTX::instance()->mesh.min_circ_points / M_PI) - 1; + (double)CTX::instance()->mesh.minCircPoints / M_PI) - 1; else - np = CTX::instance()->mesh.min_curv_points - 1; + np = CTX::instance()->mesh.minCurvPoints - 1; return std::max(np, meshAttributes.minimumMeshSegments); } @@ -84,7 +84,7 @@ int gmshEdge::minimumDrawSegments () const if(geomType() == Line && !c->geometry) return n; else - return CTX::instance()->geom.num_sub_edges * n; + return CTX::instance()->geom.numSubEdges * n; } SPoint2 gmshEdge::reparamOnFace(const GFace *face, double epar,int dir) const diff --git a/Graphics/drawAxes.cpp b/Graphics/drawAxes.cpp index 7fd7ccb6b32250a3d53e4f607b19900d1fc5cb33..992a1838a0985ccabb7782e0b97067c643770c42 100644 --- a/Graphics/drawAxes.cpp +++ b/Graphics/drawAxes.cpp @@ -42,7 +42,7 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, } } - double tmp = 2. * CTX::instance()->gl_fontsize * pixelfact; + double tmp = 2. * CTX::instance()->glFontSize * pixelfact; if(n * tmp > l) n = 3; if(n * tmp > l) n = 2; @@ -87,7 +87,7 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, double winp[3], winr[3]; ctx->world2Viewport(p, winp); ctx->world2Viewport(r, winr); - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); if(fabs(winr[0] - winp[0]) < 2.) // center align winr[0] -= gl_width(str) / 2.; else if(winr[0] < winp[0]) // right align @@ -276,10 +276,10 @@ void drawContext::drawAxes() } } - if(geometryExists && (CTX::instance()->draw_bbox || !CTX::instance()->mesh.draw)) { + if(geometryExists && (CTX::instance()->drawBBox || !CTX::instance()->mesh.draw)) { glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * CTX::instance()->print.epsLineWidthFactor); drawBox(CTX::instance()->min[0], CTX::instance()->min[1], CTX::instance()->min[2], CTX::instance()->max[0], CTX::instance()->max[1], CTX::instance()->max[2]); glColor3d(1.,0.,0.); @@ -288,39 +288,39 @@ void drawContext::drawAxes() drawPlaneInBoundingBox (CTX::instance()->min[0], CTX::instance()->min[1], CTX::instance()->min[2], CTX::instance()->max[0], CTX::instance()->max[1], CTX::instance()->max[2], - CTX::instance()->clip_plane[j][0], CTX::instance()->clip_plane[j][1], - CTX::instance()->clip_plane[j][2], CTX::instance()->clip_plane[j][3]); + CTX::instance()->clipPlane[j][0], CTX::instance()->clipPlane[j][1], + CTX::instance()->clipPlane[j][2], CTX::instance()->clipPlane[j][3]); } if(CTX::instance()->axes){ glColor4ubv((GLubyte *) & CTX::instance()->color.axes); - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); - if(!CTX::instance()->axes_auto_position){ - drawAxes(CTX::instance()->axes, CTX::instance()->axes_tics, - CTX::instance()->axes_format, CTX::instance()->axes_label, - CTX::instance()->axes_position, CTX::instance()->axes_mikado); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); + if(!CTX::instance()->axesAutoPosition){ + drawAxes(CTX::instance()->axes, CTX::instance()->axesTics, + CTX::instance()->axesFormat, CTX::instance()->axesLabel, + CTX::instance()->axesPosition, CTX::instance()->axesMikado); } else if(geometryExists){ double bb[6] = {CTX::instance()->min[0], CTX::instance()->max[0], CTX::instance()->min[1], CTX::instance()->max[1], CTX::instance()->min[2], CTX::instance()->max[2]}; - drawAxes(CTX::instance()->axes, CTX::instance()->axes_tics, - CTX::instance()->axes_format, CTX::instance()->axes_label, - bb, CTX::instance()->axes_mikado); + drawAxes(CTX::instance()->axes, CTX::instance()->axesTics, + CTX::instance()->axesFormat, CTX::instance()->axesLabel, + bb, CTX::instance()->axesMikado); } } - if(CTX::instance()->draw_rotation_center){ + if(CTX::instance()->drawRotationCenter){ glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - if(CTX::instance()->rotation_center_cg) - drawSphere(CTX::instance()->point_size, CTX::instance()->cg[0], + if(CTX::instance()->rotationCenterCg) + drawSphere(CTX::instance()->pointSize, CTX::instance()->cg[0], CTX::instance()->cg[1], CTX::instance()->cg[2], CTX::instance()->geom.light); else - drawSphere(CTX::instance()->point_size, CTX::instance()->rotation_center[0], - CTX::instance()->rotation_center[1], CTX::instance()->rotation_center[2], + drawSphere(CTX::instance()->pointSize, CTX::instance()->rotationCenter[0], + CTX::instance()->rotationCenter[1], CTX::instance()->rotationCenter[2], CTX::instance()->geom.light); } @@ -328,11 +328,11 @@ void drawContext::drawAxes() void drawContext::drawSmallAxes() { - double l = CTX::instance()->small_axes_size; - double o = CTX::instance()->gl_fontsize / 5; + double l = CTX::instance()->smallAxesSize; + double o = CTX::instance()->glFontSize / 5; - double cx = CTX::instance()->small_axes_pos[0]; - double cy = CTX::instance()->small_axes_pos[1]; + double cx = CTX::instance()->smallAxesPos[0]; + double cy = CTX::instance()->smallAxesPos[1]; fix2dCoordinates(&cx, &cy); double xx = l * rot[0]; @@ -342,9 +342,10 @@ void drawContext::drawSmallAxes() double zx = l * rot[8]; double zy = l * rot[9]; - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * CTX::instance()->print.eps_line_width_factor); - glColor4ubv((GLubyte *) & CTX::instance()->color.small_axes); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); + glColor4ubv((GLubyte *) & CTX::instance()->color.smallAxes); glBegin(GL_LINES); glVertex2d(cx, cy); diff --git a/Graphics/drawContext.cpp b/Graphics/drawContext.cpp index 4ad90e3910380fa74deacec85bcf01d0b5b3b871..834d94b890abafc721ed851cfe2878fb9c7f1826 100644 --- a/Graphics/drawContext.cpp +++ b/Graphics/drawContext.cpp @@ -18,16 +18,16 @@ drawContext::drawContext(drawTransform *transform) { // initialize from temp values in global context for(int i = 0; i < 3; i++){ - r[i] = CTX::instance()->tmp_r[i]; - t[i] = CTX::instance()->tmp_t[i]; - s[i] = CTX::instance()->tmp_s[i]; + r[i] = CTX::instance()->tmpRotation[i]; + t[i] = CTX::instance()->tmpTranslation[i]; + s[i] = CTX::instance()->tmpScale[i]; } for(int i = 0; i < 4; i++){ - quaternion[i] = CTX::instance()->tmp_quaternion[i]; + quaternion[i] = CTX::instance()->tmpQuaternion[i]; } viewport[0] = viewport[1] = 0; - viewport[2] = CTX::instance()->gl_size[0]; - viewport[3] = CTX::instance()->gl_size[1]; + viewport[2] = CTX::instance()->glSize[0]; + viewport[3] = CTX::instance()->glSize[1]; render_mode = GMSH_RENDER; vxmin = vymin = vxmax = vymax = 0.; @@ -60,35 +60,35 @@ void drawContext::createQuadricsAndDisplayLists() // display list 0 (sphere) glNewList(_displayLists + 0, GL_COMPILE); gluSphere(_quadric, 1., - CTX::instance()->quadric_subdivisions, - CTX::instance()->quadric_subdivisions); + CTX::instance()->quadricSubdivisions, + CTX::instance()->quadricSubdivisions); glEndList(); // display list 1 (arrow) glNewList(_displayLists + 1, GL_COMPILE); - glTranslated(0., 0., CTX::instance()->arrow_rel_stem_length); - if(CTX::instance()->arrow_rel_head_radius > 0 && - CTX::instance()->arrow_rel_stem_length < 1) - gluCylinder(_quadric, CTX::instance()->arrow_rel_head_radius, 0., - (1. - CTX::instance()->arrow_rel_stem_length), - CTX::instance()->quadric_subdivisions, 1); - if(CTX::instance()->arrow_rel_head_radius > CTX::instance()->arrow_rel_stem_radius) - gluDisk(_quadric, CTX::instance()->arrow_rel_stem_radius, - CTX::instance()->arrow_rel_head_radius, - CTX::instance()->quadric_subdivisions, 1); + glTranslated(0., 0., CTX::instance()->arrowRelStemLength); + if(CTX::instance()->arrowRelHeadRadius > 0 && + CTX::instance()->arrowRelStemLength < 1) + gluCylinder(_quadric, CTX::instance()->arrowRelHeadRadius, 0., + (1. - CTX::instance()->arrowRelStemLength), + CTX::instance()->quadricSubdivisions, 1); + if(CTX::instance()->arrowRelHeadRadius > CTX::instance()->arrowRelStemRadius) + gluDisk(_quadric, CTX::instance()->arrowRelStemRadius, + CTX::instance()->arrowRelHeadRadius, + CTX::instance()->quadricSubdivisions, 1); else - gluDisk(_quadric, CTX::instance()->arrow_rel_head_radius, - CTX::instance()->arrow_rel_stem_radius, - CTX::instance()->quadric_subdivisions, 1); - glTranslated(0., 0., -CTX::instance()->arrow_rel_stem_length); - if(CTX::instance()->arrow_rel_stem_radius > 0 && - CTX::instance()->arrow_rel_stem_length > 0){ - gluCylinder(_quadric, CTX::instance()->arrow_rel_stem_radius, - CTX::instance()->arrow_rel_stem_radius, - CTX::instance()->arrow_rel_stem_length, - CTX::instance()->quadric_subdivisions, 1); - gluDisk(_quadric, 0, CTX::instance()->arrow_rel_stem_radius, - CTX::instance()->quadric_subdivisions, 1); + gluDisk(_quadric, CTX::instance()->arrowRelHeadRadius, + CTX::instance()->arrowRelStemRadius, + CTX::instance()->quadricSubdivisions, 1); + glTranslated(0., 0., -CTX::instance()->arrowRelStemLength); + if(CTX::instance()->arrowRelStemRadius > 0 && + CTX::instance()->arrowRelStemLength > 0){ + gluCylinder(_quadric, CTX::instance()->arrowRelStemRadius, + CTX::instance()->arrowRelStemRadius, + CTX::instance()->arrowRelStemLength, + CTX::instance()->quadricSubdivisions, 1); + gluDisk(_quadric, 0, CTX::instance()->arrowRelStemRadius, + CTX::instance()->quadricSubdivisions, 1); } glEndList(); } @@ -187,15 +187,15 @@ static int needPolygonOffset() { GModel *m = GModel::current(); if(m->getMeshStatus() == 2 && - (CTX::instance()->mesh.surfaces_edges || CTX::instance()->geom.lines || + (CTX::instance()->mesh.surfacesEdges || CTX::instance()->geom.lines || CTX::instance()->geom.surfaces)) return 1; if(m->getMeshStatus() == 3 && - (CTX::instance()->mesh.surfaces_edges || CTX::instance()->mesh.volumes_edges)) + (CTX::instance()->mesh.surfacesEdges || CTX::instance()->mesh.volumesEdges)) return 1; for(unsigned int i = 0; i < PView::list.size(); i++){ PViewOptions *opt = PView::list[i]->getOptions(); - if(opt->Visible && opt->ShowElement) return 1; + if(opt->visible && opt->showElement) return 1; } return 0; } @@ -218,13 +218,13 @@ void drawContext::draw3d() // measurement of the change in depth relative to the screen area of // the polygon, and r is the smallest value that is guaranteed to // produce a resolvable offset for a given implementation. - glPolygonOffset(CTX::instance()->polygon_offset_factor, - CTX::instance()->polygon_offset_units); - if(CTX::instance()->polygon_offset_factor || CTX::instance()->polygon_offset_units) - CTX::instance()->polygon_offset = CTX::instance()->polygon_offset_always ? 1 : + glPolygonOffset(CTX::instance()->polygonOffsetFactor, + CTX::instance()->polygonOffsetUnits); + if(CTX::instance()->polygonOffsetFactor || CTX::instance()->polygonOffsetUnits) + CTX::instance()->polygonOffset = CTX::instance()->polygonOffsetAlways ? 1 : needPolygonOffset(); else - CTX::instance()->polygon_offset = 0; + CTX::instance()->polygonOffset = 0; glDepthFunc(GL_LESS); glEnable(GL_DEPTH_TEST); @@ -248,8 +248,8 @@ void drawContext::draw2d() glOrtho((double)viewport[0], (double)viewport[2], (double)viewport[1], (double)viewport[3], -1., 1.); // hack to make the 2D primitives appear "in front" in GL2PS - glTranslated(0., 0., CTX::instance()->clip_factor > 1. ? - 1. / CTX::instance()->clip_factor : CTX::instance()->clip_factor); + glTranslated(0., 0., CTX::instance()->clipFactor > 1. ? + 1. / CTX::instance()->clipFactor : CTX::instance()->clipFactor); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -257,7 +257,7 @@ void drawContext::draw2d() drawText2d(); if(CTX::instance()->post.draw) drawScales(); - if(CTX::instance()->small_axes) + if(CTX::instance()->smallAxes) drawSmallAxes(); } @@ -316,7 +316,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) // large enough to manipulate the model and zoom, but not too big // (the z-buffer resolution, e.g., on software Mesa can become // insufficient) - double clip = zmax * s[2] * CTX::instance()->clip_factor; + double clip = zmax * s[2] * CTX::instance()->clipFactor; glOrtho(vxmin, vxmax, vymin, vymax, -clip, clip); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -324,8 +324,8 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) grad_xy = 1.; } else { - double clip_near = 0.75 * CTX::instance()->clip_factor * zmax; - double clip_far = 75. * CTX::instance()->clip_factor * zmax; + double clip_near = 0.75 * CTX::instance()->clipFactor * zmax; + double clip_far = 75. * CTX::instance()->clipFactor * zmax; double coef = (75./0.75) / 3.; // recenter the model such that the perspective is always at the // center of gravity (we should maybe add an option to choose @@ -346,26 +346,26 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) } // draw background gradient - if(render_mode != GMSH_SELECT && CTX::instance()->bg_gradient){ + if(render_mode != GMSH_SELECT && CTX::instance()->bgGradient){ glPushMatrix(); glLoadIdentity(); glTranslated(0., 0., -grad_z); - if(CTX::instance()->bg_gradient == 1){ // vertical + if(CTX::instance()->bgGradient == 1){ // vertical glBegin(GL_QUADS); glColor4ubv((GLubyte *) & CTX::instance()->color.bg); glVertex3d(grad_xy * vxmin, grad_xy * vymin, 0.); glVertex3d(grad_xy * vxmax, grad_xy * vymin, 0.); - glColor4ubv((GLubyte *) & CTX::instance()->color.bg_grad); + glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad); glVertex3d(grad_xy * vxmax, grad_xy * vymax, 0.); glVertex3d(grad_xy * vxmin, grad_xy * vymax, 0.); glEnd(); } - else if(CTX::instance()->bg_gradient == 2){ // horizontal + else if(CTX::instance()->bgGradient == 2){ // horizontal glBegin(GL_QUADS); glColor4ubv((GLubyte *) & CTX::instance()->color.bg); glVertex3d(grad_xy * vxmax, grad_xy * vymin, 0.); glVertex3d(grad_xy * vxmax, grad_xy * vymax, 0.); - glColor4ubv((GLubyte *) & CTX::instance()->color.bg_grad); + glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad); glVertex3d(grad_xy * vxmin, grad_xy * vymax, 0.); glVertex3d(grad_xy * vxmin, grad_xy * vymin, 0.); glEnd(); @@ -375,7 +375,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) double cy = grad_xy * (vymin + vymax) / 2.; double r = grad_xy * std::max(vxmax - vxmin, vymax - vymin) / 2.; glBegin(GL_TRIANGLE_FAN); - glColor4ubv((GLubyte *) & CTX::instance()->color.bg_grad); + glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad); glVertex3d(cx, cy, 0.); glColor4ubv((GLubyte *) & CTX::instance()->color.bg); glVertex3d(cx + r, cy, 0.); @@ -399,27 +399,27 @@ void drawContext::initRenderModel() for(int i = 0; i < 6; i++) { if(CTX::instance()->light[i]) { - GLfloat position[4] = {(GLfloat)CTX::instance()->light_position[i][0], - (GLfloat)CTX::instance()->light_position[i][1], - (GLfloat)CTX::instance()->light_position[i][2], - (GLfloat)CTX::instance()->light_position[i][3]}; + GLfloat position[4] = {(GLfloat)CTX::instance()->lightPosition[i][0], + (GLfloat)CTX::instance()->lightPosition[i][1], + (GLfloat)CTX::instance()->lightPosition[i][2], + (GLfloat)CTX::instance()->lightPosition[i][3]}; glLightfv((GLenum)(GL_LIGHT0 + i), GL_POSITION, position); - GLfloat r = CTX::instance()->unpack_red(CTX::instance()->color.ambient_light[i])/255.; - GLfloat g = CTX::instance()->unpack_green(CTX::instance()->color.ambient_light[i])/255.; - GLfloat b = CTX::instance()->unpack_blue(CTX::instance()->color.ambient_light[i])/255.; + GLfloat r = CTX::instance()->unpackRed(CTX::instance()->color.ambientLight[i])/255.; + GLfloat g = CTX::instance()->unpackGreen(CTX::instance()->color.ambientLight[i])/255.; + GLfloat b = CTX::instance()->unpackBlue(CTX::instance()->color.ambientLight[i])/255.; GLfloat ambient[4] = {r, g, b, 1.0}; glLightfv((GLenum)(GL_LIGHT0 + i), GL_AMBIENT, ambient); - r = CTX::instance()->unpack_red(CTX::instance()->color.diffuse_light[i])/255.; - g = CTX::instance()->unpack_green(CTX::instance()->color.diffuse_light[i])/255.; - b = CTX::instance()->unpack_blue(CTX::instance()->color.diffuse_light[i])/255.; + r = CTX::instance()->unpackRed(CTX::instance()->color.diffuseLight[i])/255.; + g = CTX::instance()->unpackGreen(CTX::instance()->color.diffuseLight[i])/255.; + b = CTX::instance()->unpackBlue(CTX::instance()->color.diffuseLight[i])/255.; GLfloat diffuse[4] = {r, g, b, 1.0}; glLightfv((GLenum)(GL_LIGHT0 + i), GL_DIFFUSE, diffuse); - r = CTX::instance()->unpack_red(CTX::instance()->color.specular_light[i])/255.; - g = CTX::instance()->unpack_green(CTX::instance()->color.specular_light[i])/255.; - b = CTX::instance()->unpack_blue(CTX::instance()->color.specular_light[i])/255.; + r = CTX::instance()->unpackRed(CTX::instance()->color.specularLight[i])/255.; + g = CTX::instance()->unpackGreen(CTX::instance()->color.specularLight[i])/255.; + b = CTX::instance()->unpackBlue(CTX::instance()->color.specularLight[i])/255.; GLfloat specular[4] = {r, g, b, 1.0}; glLightfv((GLenum)(GL_LIGHT0 + i), GL_SPECULAR, specular); @@ -441,7 +441,7 @@ void drawContext::initRenderModel() glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec); // specular exponent in [0,128] (larger means more "focused" // reflection) - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, CTX::instance()->shine_exponent); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, CTX::instance()->shineExponent); glShadeModel(GL_SMOOTH); @@ -462,26 +462,26 @@ void drawContext::initPosition() glScaled(s[0], s[1], s[2]); glTranslated(t[0], t[1], t[2]); - if(CTX::instance()->rotation_center_cg) + if(CTX::instance()->rotationCenterCg) glTranslated(CTX::instance()->cg[0], CTX::instance()->cg[1], CTX::instance()->cg[2]); else - glTranslated(CTX::instance()->rotation_center[0], - CTX::instance()->rotation_center[1], - CTX::instance()->rotation_center[2]); + glTranslated(CTX::instance()->rotationCenter[0], + CTX::instance()->rotationCenter[1], + CTX::instance()->rotationCenter[2]); buildRotationMatrix(); glMultMatrixd(rot); - if(CTX::instance()->rotation_center_cg) + if(CTX::instance()->rotationCenterCg) glTranslated(-CTX::instance()->cg[0], -CTX::instance()->cg[1], -CTX::instance()->cg[2]); else - glTranslated(-CTX::instance()->rotation_center[0], - -CTX::instance()->rotation_center[1], - -CTX::instance()->rotation_center[2]); + glTranslated(-CTX::instance()->rotationCenter[0], + -CTX::instance()->rotationCenter[1], + -CTX::instance()->rotationCenter[2]); // store the projection and modelview matrices at this precise // moment (so that we can use them at any later time, even if the @@ -490,7 +490,7 @@ void drawContext::initPosition() glGetDoublev(GL_MODELVIEW_MATRIX, model); for(int i = 0; i < 6; i++) - glClipPlane((GLenum)(GL_CLIP_PLANE0 + i), CTX::instance()->clip_plane[i]); + glClipPlane((GLenum)(GL_CLIP_PLANE0 + i), CTX::instance()->clipPlane[i]); } // Takes a cursor position in window coordinates and returns the line diff --git a/Graphics/drawGeom.cpp b/Graphics/drawGeom.cpp index 5fe1766843da89ac1b67f71e36886a17a19388f0..ceca4292b6a0c0aa7dc54eec9cad26560d5fafb2 100644 --- a/Graphics/drawGeom.cpp +++ b/Graphics/drawGeom.cpp @@ -29,19 +29,19 @@ class drawGVertex { } if(v->getSelection()) { - glPointSize(CTX::instance()->geom.point_sel_size); - gl2psPointSize(CTX::instance()->geom.point_sel_size * - CTX::instance()->print.eps_point_size_factor); + glPointSize(CTX::instance()->geom.selectedPointSize); + gl2psPointSize(CTX::instance()->geom.selectedPointSize * + CTX::instance()->print.epsPointSizeFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.selection); } else { - glPointSize(CTX::instance()->geom.point_size); - gl2psPointSize(CTX::instance()->geom.point_size * - CTX::instance()->print.eps_point_size_factor); + glPointSize(CTX::instance()->geom.pointSize); + gl2psPointSize(CTX::instance()->geom.pointSize * + CTX::instance()->print.epsPointSizeFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.point); } - if(CTX::instance()->geom.highlight_orphans){ + if(CTX::instance()->geom.highlightOrphans){ std::list<GEdge*> edges = v->edges(); if(edges.size() == 0) glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[0]); @@ -53,12 +53,12 @@ class drawGVertex { _ctx->transform(x, y, z); if(CTX::instance()->geom.points) { - if(CTX::instance()->geom.point_type > 0) { + if(CTX::instance()->geom.pointType > 0) { if(v->getSelection()) - _ctx->drawSphere(CTX::instance()->geom.point_sel_size, x, y, z, + _ctx->drawSphere(CTX::instance()->geom.selectedPointSize, x, y, z, CTX::instance()->geom.light); else - _ctx->drawSphere(CTX::instance()->geom.point_size, x, y, z, + _ctx->drawSphere(CTX::instance()->geom.pointSize, x, y, z, CTX::instance()->geom.light); } else { @@ -68,12 +68,11 @@ class drawGVertex { } } - if(CTX::instance()->geom.points_num) { + if(CTX::instance()->geom.pointsNum) { char Num[100]; sprintf(Num, "%d", v->tag()); - double offset = (0.5 * CTX::instance()->geom.point_size + - 0.3 * CTX::instance()->gl_fontsize) * - _ctx->pixel_equiv_x; + double offset = (0.5 * CTX::instance()->geom.pointSize + + 0.3 * CTX::instance()->glFontSize) * _ctx->pixel_equiv_x; glRasterPos3d(x + offset / _ctx->s[0], y + offset / _ctx->s[1], z + offset / _ctx->s[2]); @@ -106,19 +105,19 @@ class drawGEdge { } if(e->getSelection()) { - glLineWidth(CTX::instance()->geom.line_sel_width); - gl2psLineWidth(CTX::instance()->geom.line_sel_width * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->geom.selectedLineWidth); + gl2psLineWidth(CTX::instance()->geom.selectedLineWidth * + CTX::instance()->print.epsLineWidthFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.selection); } else { - glLineWidth(CTX::instance()->geom.line_width); - gl2psLineWidth(CTX::instance()->geom.line_width * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->geom.lineWidth); + gl2psLineWidth(CTX::instance()->geom.lineWidth * + CTX::instance()->print.epsLineWidthFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.line); } - if(CTX::instance()->geom.highlight_orphans){ + if(CTX::instance()->geom.highlightOrphans){ std::list<GFace*> faces = e->faces(); if(faces.size() == 0) glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[0]); @@ -132,7 +131,7 @@ class drawGEdge { if(CTX::instance()->geom.lines) { int N = e->minimumDrawSegments() + 1; - if(CTX::instance()->geom.line_type > 0) { + if(CTX::instance()->geom.lineType > 0) { for(int i = 0; i < N - 1; i++) { double t1 = t_min + (double)i / (double)(N - 1) * (t_max - t_min); GPoint p1 = e->point(t1); @@ -143,8 +142,8 @@ class drawGEdge { double z[2] = {p1.z(), p2.z()}; _ctx->transform(x[0], y[0], z[0]); _ctx->transform(x[1], y[1], z[1]); - _ctx->drawCylinder(e->getSelection() ? CTX::instance()->geom.line_sel_width : - CTX::instance()->geom.line_width, x, y, z, + _ctx->drawCylinder(e->getSelection() ? CTX::instance()->geom.selectedLineWidth : + CTX::instance()->geom.lineWidth, x, y, z, CTX::instance()->geom.light); } } @@ -161,13 +160,12 @@ class drawGEdge { } } - if(CTX::instance()->geom.lines_num) { + if(CTX::instance()->geom.linesNum) { GPoint p = e->point(t_min + 0.5 * (t_max - t_min)); char Num[100]; sprintf(Num, "%d", e->tag()); - double offset = (0.5 * CTX::instance()->geom.line_width + - 0.3 * CTX::instance()->gl_fontsize) * - _ctx->pixel_equiv_x; + double offset = (0.5 * CTX::instance()->geom.lineWidth + + 0.3 * CTX::instance()->glFontSize) * _ctx->pixel_equiv_x; double x = p.x(), y = p.y(), z = p.z(); _ctx->transform(x, y, z); glRasterPos3d(x + offset / _ctx->s[0], @@ -187,7 +185,7 @@ class drawGEdge { double x = p.x(), y = p.y(), z = p.z(); _ctx->transform(x, y, z); _ctx->transformOneForm(der[0], der[1], der[2]); - _ctx->drawVector(CTX::instance()->vector_type, 0, x, y, z, der[0], der[1], der[2], + _ctx->drawVector(CTX::instance()->vectorType, 0, x, y, z, der[0], der[1], der[2], CTX::instance()->geom.light); } @@ -222,8 +220,8 @@ class drawGFace { glColorPointer(4, GL_UNSIGNED_BYTE, 0, va->getColorArray()); glEnableClientState(GL_COLOR_ARRAY); } - if(CTX::instance()->polygon_offset) glEnable(GL_POLYGON_OFFSET_FILL); - if(CTX::instance()->geom.surface_type > 1) + if(CTX::instance()->polygonOffset) glEnable(GL_POLYGON_OFFSET_FILL); + if(CTX::instance()->geom.surfaceType > 1) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); else glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); @@ -244,7 +242,7 @@ class drawGFace { const double vav = 0.5 * (vbounds.high() + vbounds.low()); if(CTX::instance()->geom.surfaces){ - if(CTX::instance()->geom.surface_type > 0 && f->va_geom_triangles){ + if(CTX::instance()->geom.surfaceType > 0 && f->va_geom_triangles){ _drawVertexArray (f->va_geom_triangles, CTX::instance()->geom.light, (f->geomType() == GEntity::ProjectionFace) ? true : f->getSelection(), @@ -280,11 +278,11 @@ class drawGFace { } } - if(CTX::instance()->geom.surfaces_num) { + if(CTX::instance()->geom.surfacesNum) { GPoint p = f->point(uav, vav); char Num[100]; sprintf(Num, "%d", f->tag()); - double offset = 0.3 * CTX::instance()->gl_fontsize * _ctx->pixel_equiv_x; + double offset = 0.3 * CTX::instance()->glFontSize * _ctx->pixel_equiv_x; double x = p.x(), y = p.y(), z = p.z(); _ctx->transform(x, y, z); glRasterPos3d(x + offset / _ctx->s[0], @@ -302,14 +300,14 @@ class drawGFace { double x = p.x(), y = p.y(), z = p.z(); _ctx->transform(x, y, z); _ctx->transformTwoForm(n[0], n[1], n[2]); - _ctx->drawVector(CTX::instance()->vector_type, 0, x, y, z, n[0], n[1], n[2], + _ctx->drawVector(CTX::instance()->vectorType, 0, x, y, z, n[0], n[1], n[2], CTX::instance()->geom.light); } } void _drawPlaneGFace(GFace *f) { - if(!CTX::instance()->geom.surface_type || !f->va_geom_triangles || - CTX::instance()->geom.surfaces_num || CTX::instance()->geom.normals){ + if(!CTX::instance()->geom.surfaceType || !f->va_geom_triangles || + CTX::instance()->geom.surfacesNum || CTX::instance()->geom.normals){ // We create data here and the routine is not designed to be // reentrant, so we must lock it to avoid race conditions when // redraw events are fired in rapid succession @@ -323,7 +321,7 @@ class drawGFace { //FIXME: cleanup buildGraphicsRep if(CTX::instance()->geom.surfaces) { - if(CTX::instance()->geom.surface_type > 0 && f->va_geom_triangles){ + if(CTX::instance()->geom.surfaceType > 0 && f->va_geom_triangles){ _drawVertexArray(f->va_geom_triangles, CTX::instance()->geom.light, f->getSelection(), CTX::instance()->color.geom.selection); } @@ -345,10 +343,10 @@ class drawGFace { if(f->cross.size() < 2) return; - if(CTX::instance()->geom.surfaces_num) { + if(CTX::instance()->geom.surfacesNum) { char Num[100]; sprintf(Num, "%d", f->tag()); - double offset = 0.3 * CTX::instance()->gl_fontsize * _ctx->pixel_equiv_x; + double offset = 0.3 * CTX::instance()->glFontSize * _ctx->pixel_equiv_x; double x = 0.5 * (f->cross[0].x() + f->cross[1].x()); double y = 0.5 * (f->cross[0].y() + f->cross[1].y()); double z = 0.5 * (f->cross[0].z() + f->cross[1].z()); @@ -371,7 +369,7 @@ class drawGFace { double x = p.x(), y = p.y(), z = p.z(); _ctx->transform(x, y, z); _ctx->transformTwoForm(n[0], n[1], n[2]); - _ctx->drawVector(CTX::instance()->vector_type, 0, x, y, z, n[0], n[1], n[2], + _ctx->drawVector(CTX::instance()->vectorType, 0, x, y, z, n[0], n[1], n[2], CTX::instance()->geom.light); } } @@ -392,15 +390,15 @@ class drawGFace { } if(f->getSelection()) { - glLineWidth(CTX::instance()->geom.line_sel_width / 2.); - gl2psLineWidth(CTX::instance()->geom.line_sel_width / 2. * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->geom.selectedLineWidth / 2.); + gl2psLineWidth(CTX::instance()->geom.selectedLineWidth / 2. * + CTX::instance()->print.epsLineWidthFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.selection); } else { - glLineWidth(CTX::instance()->geom.line_width / 2.); - gl2psLineWidth(CTX::instance()->geom.line_width / 2. * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->geom.lineWidth / 2.); + gl2psLineWidth(CTX::instance()->geom.lineWidth / 2. * + CTX::instance()->print.epsLineWidthFactor); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.surface); } @@ -447,10 +445,10 @@ class drawGRegion { if(CTX::instance()->geom.volumes) _ctx->drawSphere(size, x, y, z, CTX::instance()->geom.light); - if(CTX::instance()->geom.volumes_num){ + if(CTX::instance()->geom.volumesNum){ char Num[100]; sprintf(Num, "%d", r->tag()); - double offset = (0.5 * size + 0.3 * CTX::instance()->gl_fontsize) * + double offset = (0.5 * size + 0.3 * CTX::instance()->glFontSize) * _ctx->pixel_equiv_x; glRasterPos3d(x + offset / _ctx->s[0], y + offset / _ctx->s[1], @@ -469,7 +467,7 @@ void drawContext::drawGeom() { if(!CTX::instance()->geom.draw) return; - if(CTX::instance()->geom.light_two_side) + if(CTX::instance()->geom.lightTwoSide) glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); @@ -483,15 +481,15 @@ void drawContext::drawGeom() for(unsigned int i = 0; i < GModel::list.size(); i++){ GModel *m = GModel::list[i]; if(m->getVisibility() && isVisible(m)){ - if(CTX::instance()->geom.points || CTX::instance()->geom.points_num) + if(CTX::instance()->geom.points || CTX::instance()->geom.pointsNum) std::for_each(m->firstVertex(), m->lastVertex(), drawGVertex(this)); - if(CTX::instance()->geom.lines || CTX::instance()->geom.lines_num || + if(CTX::instance()->geom.lines || CTX::instance()->geom.linesNum || CTX::instance()->geom.tangents) std::for_each(m->firstEdge(), m->lastEdge(), drawGEdge(this)); - if(CTX::instance()->geom.surfaces || CTX::instance()->geom.surfaces_num || + if(CTX::instance()->geom.surfaces || CTX::instance()->geom.surfacesNum || CTX::instance()->geom.normals) std::for_each(m->firstFace(), m->lastFace(), drawGFace(this)); - if(CTX::instance()->geom.volumes || CTX::instance()->geom.volumes_num) + if(CTX::instance()->geom.volumes || CTX::instance()->geom.volumesNum) std::for_each(m->firstRegion(), m->lastRegion(), drawGRegion(this)); } } diff --git a/Graphics/drawGlyph.cpp b/Graphics/drawGlyph.cpp index c3a8416f78c34283ead80834f7b170224995248e..7ae4313d68944e5dde8f9059e8b4c6c94bfdf853 100644 --- a/Graphics/drawGlyph.cpp +++ b/Graphics/drawGlyph.cpp @@ -52,7 +52,8 @@ void drawContext::drawString(std::string s, std::string &font_name, int font_enu } else{ if(CTX::instance()->print.format == FORMAT_TEX){ - std::string tmp = SanitizeTeXString(s.c_str(), CTX::instance()->print.tex_as_equation); + std::string tmp = SanitizeTeXString + (s.c_str(), CTX::instance()->print.texAsEquation); int opt; switch(align){ case 1: opt = GL2PS_TEXT_B; break; // bottom center @@ -67,7 +68,7 @@ void drawContext::drawString(std::string s, std::string &font_name, int font_enu } gl2psTextOpt(tmp.c_str(), font_name.c_str(), font_size, opt, 0.); } - else if(CTX::instance()->print.eps_quality && + else if(CTX::instance()->print.epsQuality && (CTX::instance()->print.format == FORMAT_PS || CTX::instance()->print.format == FORMAT_EPS || CTX::instance()->print.format == FORMAT_PDF || @@ -83,19 +84,20 @@ void drawContext::drawString(std::string s, std::string &font_name, int font_enu void drawContext::drawString(std::string s) { - drawString(s, CTX::instance()->gl_font, CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize, 0); + drawString(s, CTX::instance()->glFont, CTX::instance()->glFontEnum, + CTX::instance()->glFontSize, 0); } void drawContext::drawStringCenter(std::string s) { - drawString(s, CTX::instance()->gl_font, CTX::instance()->gl_font_enum, - CTX::instance()->gl_fontsize, 1); + drawString(s, CTX::instance()->glFont, CTX::instance()->glFontEnum, + CTX::instance()->glFontSize, 1); } void drawContext::drawStringRight(std::string s) { - drawString(s, CTX::instance()->gl_font, CTX::instance()->gl_font_enum, - CTX::instance()->gl_fontsize, 2); + drawString(s, CTX::instance()->glFont, CTX::instance()->glFontEnum, + CTX::instance()->glFontSize, 2); } void drawContext::drawString(std::string s, double style) @@ -111,7 +113,7 @@ void drawContext::drawString(std::string s, double style) int align = (bits>>16 & 0xff); int font_enum = GetFontEnum(font); std::string font_name = GetFontName(font); - if(!size) size = CTX::instance()->gl_fontsize; + if(!size) size = CTX::instance()->glFontSize; drawString(s, font_name, font_enum, size, align); } } @@ -168,7 +170,7 @@ void drawContext::drawTaperedCylinder(double width, double val1, double val2, glPushMatrix(); glTranslated(x[0], y[0], z[0]); glRotated(phi, axis[0], axis[1], axis[2]); - gluCylinder(_quadric, radius1, radius2, length, CTX::instance()->quadric_subdivisions, 1); + gluCylinder(_quadric, radius1, radius2, length, CTX::instance()->quadricSubdivisions, 1); glPopMatrix(); glDisable(GL_LIGHTING); @@ -198,7 +200,7 @@ void drawContext::drawCylinder(double width, double *x, double *y, double *z, in glPushMatrix(); glTranslated(x[0], y[0], z[0]); glRotated(phi, axis[0], axis[1], axis[2]); - gluCylinder(_quadric, radius, radius, length, CTX::instance()->quadric_subdivisions, 1); + gluCylinder(_quadric, radius, radius, length, CTX::instance()->quadricSubdivisions, 1); glPopMatrix(); glDisable(GL_LIGHTING); @@ -241,11 +243,11 @@ static void drawSimpleVector(int arrow, int fill, u[1] /= l; u[2] /= l; - double b = CTX::instance()->arrow_rel_head_radius * d; + double b = CTX::instance()->arrowRelHeadRadius * d; if(arrow){ - double f1 = CTX::instance()->arrow_rel_stem_length; - double f2 = (1 - 2. * CTX::instance()->arrow_rel_stem_radius) * f1; // hack :-) + double f1 = CTX::instance()->arrowRelStemLength; + double f2 = (1 - 2. * CTX::instance()->arrowRelStemRadius) * f1; // hack :-) if(fill) { glBegin(GL_LINES); @@ -414,7 +416,7 @@ void drawContext::drawVector(int Type, int Fill, double x, double y, double z, glEnd(); break; case 6: - if(CTX::instance()->arrow_rel_head_radius){ + if(CTX::instance()->arrowRelHeadRadius){ glBegin(GL_POINTS); glVertex3d(x + dx, y + dy, z + dz); glEnd(); @@ -507,7 +509,7 @@ void drawContext::drawBox(double xmin, double ymin, double zmin, glEnd(); if(labels){ char label[256]; - double offset = 0.3 * CTX::instance()->gl_fontsize * pixel_equiv_x; + double offset = 0.3 * CTX::instance()->glFontSize * pixel_equiv_x; glRasterPos3d(xmin + offset / s[0], ymin + offset / s[1], zmin + offset / s[2]); @@ -557,8 +559,8 @@ void drawContext::drawPlaneInBoundingBox(double xmin, double ymin, double zmin, double n[3] = {a,b,c}, ll = 50; norme(n); - if(CTX::instance()->arrow_rel_stem_radius) - ll = CTX::instance()->line_width / CTX::instance()->arrow_rel_stem_radius; + if(CTX::instance()->arrowRelStemRadius) + ll = CTX::instance()->lineWidth / CTX::instance()->arrowRelStemRadius; n[0] *= ll * pixel_equiv_x / s[0]; n[1] *= ll * pixel_equiv_x / s[1]; n[2] *= ll * pixel_equiv_x / s[2]; @@ -579,7 +581,7 @@ void drawContext::drawPlaneInBoundingBox(double xmin, double ymin, double zmin, double xx[2] = {p[j].x, p[j-1].x}; double yy[2] = {p[j].y, p[j-1].y}; double zz[2] = {p[j].z, p[j-1].z}; - drawCylinder(CTX::instance()->line_width, xx, yy, zz, 1); + drawCylinder(CTX::instance()->lineWidth, xx, yy, zz, 1); } for(int j = 0; j < nb; j++){ drawArrow3d(p[j].x, p[j].y, p[j].z, n[0], n[1], n[2], length, 1); diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index ba65a4c9769180a8101066a949b3268aca1b2a40..6f2d6aaf6501641b726a66e9209c0c741438a95e 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -35,12 +35,12 @@ void drawContext::drawText2d() for(unsigned int i = 0; i < PView::list.size(); i++){ PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); - if(opt->Visible && opt->DrawStrings && isVisible(PView::list[i])){ + if(opt->visible && opt->drawStrings && isVisible(PView::list[i])){ glColor4ubv((GLubyte *) & opt->color.text2d); for(int j = 0; j < data->getNumStrings2D(); j++){ double x, y, style; std::string str; - data->getString2D(j, opt->TimeStep, str, x, y, style); + data->getString2D(j, opt->timeStep, str, x, y, style); fix2dCoordinates(&x, &y); glRasterPos2d(x, y); drawString(str, style); @@ -58,10 +58,10 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin, if(data->hasMultipleMeshes()) return false; // cannot handle multi-mesh int numy = 0; - if(opt->Type == PViewOptions::Plot2DSpace){ + if(opt->type == PViewOptions::Plot2DSpace){ numy = 1; } - else if(opt->Type == PViewOptions::Plot2DTime){ + else if(opt->type == PViewOptions::Plot2DTime){ numy = 0; for(int ent = 0; ent < data->getNumEntities(0); ent++) for(int i = 0; i < data->getNumElements(0, ent); i++) @@ -71,7 +71,7 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin, if(!numy) return false; y.resize(numy); - bool space = (opt->Type == PViewOptions::Plot2DSpace); + bool space = (opt->type == PViewOptions::Plot2DSpace); SPoint3 p0(0., 0., 0.); @@ -81,7 +81,7 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin, int dim = data->getDimension(0, ent, i); if(dim < 2){ int numNodes = data->getNumNodes(0, ent, i); - for(int ts = space ? opt->TimeStep : 0; ts < opt->TimeStep + 1; ts++){ + for(int ts = space ? opt->timeStep : 0; ts < opt->timeStep + 1; ts++){ int numComp = data->getNumComponents(ts, ent, i); for(int j = 0; j < numNodes; j++){ double val[9], xyz[3]; @@ -147,7 +147,7 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, PViewData *data = p->getData(); PViewOptions *opt = p->getOptions(); - if(!opt->Axes) return; + if(!opt->axes) return; char label[1024]; float font_h = gl_height() ? gl_height() : 1; // total font height @@ -155,13 +155,13 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, const double tic = 5.; - glPointSize(CTX::instance()->point_size); - gl2psPointSize(CTX::instance()->point_size * - CTX::instance()->print.eps_point_size_factor); + glPointSize(CTX::instance()->pointSize); + gl2psPointSize(CTX::instance()->pointSize * + CTX::instance()->print.epsPointSizeFactor); - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); glColor4ubv((GLubyte *) & opt->color.axes); @@ -170,22 +170,22 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, glVertex2d(xleft, ytop); glVertex2d(xleft, ytop - height); glVertex2d(xleft + width, ytop - height); - if(opt->Axes > 1){ + if(opt->axes > 1){ glVertex2d(xleft + width, ytop); glVertex2d(xleft, ytop); } glEnd(); // y label - if(opt->Type == PViewOptions::Plot2DSpace){ + if(opt->type == PViewOptions::Plot2DSpace){ int nt = data->getNumTimeSteps(); - if((opt->ShowTime == 1 && nt > 1) || opt->ShowTime == 2){ + if((opt->showTime == 1 && nt > 1) || opt->showTime == 2){ char tmp[256]; - sprintf(tmp, opt->Format.c_str(), data->getTime(opt->TimeStep)); + sprintf(tmp, opt->format.c_str(), data->getTime(opt->timeStep)); sprintf(label, "%s (%s)", data->getName().c_str(), tmp); } - else if((opt->ShowTime == 3 && nt > 1) || opt->ShowTime == 4){ - sprintf(label, "%s (%d)", data->getName().c_str(), opt->TimeStep); + else if((opt->showTime == 3 && nt > 1) || opt->showTime == 4){ + sprintf(label, "%s (%d)", data->getName().c_str(), opt->timeStep); } else sprintf(label, "%s", data->getName().c_str()); @@ -196,45 +196,45 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, ctx->drawStringCenter(label); // x label - sprintf(label, "%s", opt->AxesLabel[0].c_str()); + sprintf(label, "%s", opt->axesLabel[0].c_str()); glRasterPos2d(xleft + width / 2, ytop - height - 2 * font_h - 2 * tic); ctx->drawStringCenter(label); // y tics and horizontal grid - if(opt->NbIso > 0){ - int nb = opt->NbIso; - if(opt->ShowScale && (opt->NbIso * font_h > height)) + if(opt->nbIso > 0){ + int nb = opt->nbIso; + if(opt->showScale && (opt->nbIso * font_h > height)) nb = (int)floor(height / font_h); double dy = height / (double)nb; - double dv = (opt->TmpMax - opt->TmpMin) / (double)nb; + double dv = (opt->tmpMax - opt->tmpMin) / (double)nb; for(int i = 0; i < nb + 1; i++){ - if(opt->Axes > 0){ + if(opt->axes > 0){ glBegin(GL_LINES); glVertex2d(xleft, ytop - i * dy); glVertex2d(xleft + tic, ytop - i * dy); - if(opt->Axes > 1){ + if(opt->axes > 1){ glVertex2d(xleft + width - tic, ytop - i * dy); glVertex2d(xleft + width, ytop - i * dy); } glEnd(); - if(opt->Axes > 2 && i != 0 && i != nb){ + if(opt->axes > 2 && i != 0 && i != nb){ glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x1111); gl2psEnable(GL2PS_LINE_STIPPLE); - gl2psLineWidth(1. * CTX::instance()->print.eps_line_width_factor); + gl2psLineWidth(1. * CTX::instance()->print.epsLineWidthFactor); glBegin(GL_LINES); glVertex2d(xleft, ytop - i * dy); glVertex2d(xleft + width, ytop - i * dy); glEnd(); glDisable(GL_LINE_STIPPLE); gl2psDisable(GL2PS_LINE_STIPPLE); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); } } - if(opt->ShowScale){ - sprintf(label, opt->Format.c_str(), (i == nb) ? opt->TmpMin : - (opt->TmpMax - i * dv)); + if(opt->showScale){ + sprintf(label, opt->format.c_str(), (i == nb) ? opt->tmpMin : + (opt->tmpMax - i * dv)); glRasterPos2d(xleft - 2 * tic, ytop - i * dy - font_a / 3.); ctx->drawStringRight(label); } @@ -242,10 +242,10 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, } // x tics and vertical grid - if(opt->AxesTics[0] > 0){ - int nb = opt->AxesTics[0]; - if(opt->Axes){ - sprintf(label, opt->AxesFormat[0].c_str(), - M_PI * 1.e-4); + if(opt->axesTics[0] > 0){ + int nb = opt->axesTics[0]; + if(opt->axes){ + sprintf(label, opt->axesFormat[0].c_str(), - M_PI * 1.e-4); if((nb - 1) * gl_width(label) > width) nb = (int)(width / gl_width(label)) + 1; } @@ -255,34 +255,34 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, double ybot = ytop - height; for(int i = 0; i < nb; i++){ - if(opt->Axes){ + if(opt->axes){ glBegin(GL_LINES); glVertex2d(xleft + i * dx, ybot); glVertex2d(xleft + i * dx, ybot + tic); - if(opt->Axes > 1){ + if(opt->axes > 1){ glVertex2d(xleft + i * dx, ytop); glVertex2d(xleft + i * dx, ytop - tic); } glEnd(); - if(opt->Axes > 2 && i != 0 && i != nb - 1){ + if(opt->axes > 2 && i != 0 && i != nb - 1){ glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x1111); gl2psEnable(GL2PS_LINE_STIPPLE); - gl2psLineWidth(1. * CTX::instance()->print.eps_line_width_factor); + gl2psLineWidth(1. * CTX::instance()->print.epsLineWidthFactor); glBegin(GL_LINES); glVertex2d(xleft + i * dx, ytop); glVertex2d(xleft + i * dx, ybot); glEnd(); glDisable(GL_LINE_STIPPLE); gl2psDisable(GL2PS_LINE_STIPPLE); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); } if(nb == 1) - sprintf(label, opt->AxesFormat[0].c_str(), xmin); + sprintf(label, opt->axesFormat[0].c_str(), xmin); else - sprintf(label, opt->AxesFormat[0].c_str(), + sprintf(label, opt->axesFormat[0].c_str(), xmin + i * (xmax - xmin) / (double)(nb - 1)); glRasterPos2d(xleft + i * dx, ybot - font_h - tic); ctx->drawStringCenter(label); @@ -302,7 +302,7 @@ static void addGraphPoint(drawContext *ctx, PView *p, double xleft, double ytop, double px = xleft; if(xmin != xmax) px += (x - xmin) / (xmax - xmin) * width; - if(opt->SaturateValues){ + if(opt->saturateValues){ if(y > ymax) y = ymax; else if(y < ymin) @@ -319,7 +319,7 @@ static void addGraphPoint(drawContext *ctx, PView *p, double xleft, double ytop, if(numeric){ glRasterPos2d(px + 3, py + 3); char label[256]; - sprintf(label, opt->Format.c_str(), y); + sprintf(label, opt->format.c_str(), y); ctx->drawString(label); } else @@ -334,44 +334,44 @@ static void drawGraphCurves(drawContext *ctx, PView *p, double xleft, double yto { PViewOptions *opt = p->getOptions(); - glPointSize(opt->PointSize); - gl2psPointSize(opt->PointSize * CTX::instance()->print.eps_point_size_factor); + glPointSize(opt->pointSize); + gl2psPointSize(opt->pointSize * CTX::instance()->print.epsPointSizeFactor); - glLineWidth(opt->LineWidth); - gl2psLineWidth(opt->LineWidth * CTX::instance()->print.eps_line_width_factor); + glLineWidth(opt->lineWidth); + gl2psLineWidth(opt->lineWidth * CTX::instance()->print.epsLineWidthFactor); - if(opt->IntervalsType == PViewOptions::Numeric){ + if(opt->intervalsType == PViewOptions::Numeric){ for(unsigned int i = 0; i < y.size(); i++) for(unsigned int j = 0; j < x.size(); j++) addGraphPoint(ctx, p, xleft, ytop, width, height, x[j], y[i][j], - xmin, xmax, opt->TmpMin, opt->TmpMax, true); + xmin, xmax, opt->tmpMin, opt->tmpMax, true); } - if(opt->IntervalsType == PViewOptions::Iso || - opt->IntervalsType == PViewOptions::Discrete || - opt->IntervalsType == PViewOptions::Numeric){ + if(opt->intervalsType == PViewOptions::Iso || + opt->intervalsType == PViewOptions::Discrete || + opt->intervalsType == PViewOptions::Numeric){ glBegin(GL_POINTS); for(unsigned int i = 0; i < y.size(); i++) for(unsigned int j = 0; j < x.size(); j++) addGraphPoint(ctx, p, xleft, ytop, width, height, x[j], y[i][j], - xmin, xmax, opt->TmpMin, opt->TmpMax, false); + xmin, xmax, opt->tmpMin, opt->tmpMax, false); glEnd(); } - if(opt->IntervalsType == PViewOptions::Discrete || - opt->IntervalsType == PViewOptions::Continuous){ + if(opt->intervalsType == PViewOptions::Discrete || + opt->intervalsType == PViewOptions::Continuous){ for(unsigned int i = 0; i < y.size(); i++){ - if(opt->UseStipple){ + if(opt->useStipple){ glEnable(GL_LINE_STIPPLE); - glLineStipple(opt->Stipple[i % 10][0], opt->Stipple[i % 10][1]); + glLineStipple(opt->stipple[i % 10][0], opt->stipple[i % 10][1]); gl2psEnable(GL2PS_LINE_STIPPLE); } glBegin(GL_LINE_STRIP); for(unsigned int j = 0; j < x.size(); j++) addGraphPoint(ctx, p, xleft, ytop, width, height, x[j], y[i][j], - xmin, xmax, opt->TmpMin, opt->TmpMax, false); + xmin, xmax, opt->tmpMin, opt->tmpMax, false); glEnd(); - if(opt->UseStipple){ + if(opt->useStipple){ glDisable(GL_LINE_STIPPLE); gl2psDisable(GL2PS_LINE_STIPPLE); } @@ -385,17 +385,17 @@ static void drawGraph(drawContext *ctx, PView *p, double xleft, double ytop, PViewData *data = p->getData(); PViewOptions *opt = p->getOptions(); - if(opt->RangeType == PViewOptions::Custom){ - opt->TmpMin = opt->CustomMin; - opt->TmpMax = opt->CustomMax; + if(opt->rangeType == PViewOptions::Custom){ + opt->tmpMin = opt->customMin; + opt->tmpMax = opt->customMax; } - else if(opt->RangeType == PViewOptions::PerTimeStep){ - opt->TmpMin = data->getMin(opt->TimeStep); - opt->TmpMax = data->getMax(opt->TimeStep); + else if(opt->rangeType == PViewOptions::PerTimeStep){ + opt->tmpMin = data->getMin(opt->timeStep); + opt->tmpMax = data->getMax(opt->timeStep); } else{ - opt->TmpMin = data->getMin(); - opt->TmpMax = data->getMax(); + opt->tmpMin = data->getMin(); + opt->tmpMax = data->getMax(); } std::vector<double> x; @@ -412,30 +412,30 @@ void drawContext::drawGraph2d() for(unsigned int i = 0; i < PView::list.size(); i++){ PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); - if(!data->getDirty() && opt->Visible && opt->Type != PViewOptions::Plot3D && + if(!data->getDirty() && opt->visible && opt->type != PViewOptions::Plot3D && isVisible(PView::list[i])) graphs.push_back(PView::list[i]); } if(graphs.empty()) return; - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); double xsep = 0., ysep = 5 * gl_height(); char label[1024]; for(unsigned int i = 0; i < graphs.size(); i++){ PViewOptions *opt = graphs[i]->getOptions(); - sprintf(label, opt->Format.c_str(), -M_PI * 1.e-4); + sprintf(label, opt->format.c_str(), -M_PI * 1.e-4); xsep = std::max(xsep, gl_width(label)); } for(unsigned int i = 0; i < graphs.size(); i++){ PView *p = graphs[i]; PViewOptions *opt = graphs[i]->getOptions(); - if(!opt->AutoPosition){ - double x = opt->Position[0], y = opt->Position[1]; + if(!opt->autoPosition){ + double x = opt->position[0], y = opt->position[1]; int center = fix2dCoordinates(&x, &y); - drawGraph(this, p, x - (center & 1 ? opt->Size[0] / 2. : 0), - y + (center & 2 ? opt->Size[1] / 2. : 0), - opt->Size[0], opt->Size[1]); + drawGraph(this, p, x - (center & 1 ? opt->size[0] / 2. : 0), + y + (center & 2 ? opt->size[1] / 2. : 0), + opt->size[0], opt->size[1]); } else{ double winw = viewport[2] - viewport[0]; diff --git a/Graphics/drawMesh.cpp b/Graphics/drawMesh.cpp index 5f4043e19793c5ac0a1cd9acf3ce9ce907849b5d..8b5fdba6115706b47b11ffa0471d4430abb5a36e 100644 --- a/Graphics/drawMesh.cpp +++ b/Graphics/drawMesh.cpp @@ -28,10 +28,10 @@ static unsigned int getColorByEntity(GEntity *e) else if(e->useColor()){ // forced from a script return e->getColor(); } - else if(CTX::instance()->mesh.color_carousel == 1){ // by elementary entity + else if(CTX::instance()->mesh.colorCarousel == 1){ // by elementary entity return CTX::instance()->color.mesh.carousel[abs(e->tag() % 20)]; } - else if(CTX::instance()->mesh.color_carousel == 2){ // by physical entity + else if(CTX::instance()->mesh.colorCarousel == 2){ // by physical entity int np = e->physicals.size(); int p = np ? e->physicals[np - 1] : 0; return CTX::instance()->color.mesh.carousel[abs(p % 20)]; @@ -46,7 +46,7 @@ static unsigned int getColorByElement(MElement *ele) if(ele->getVisibility() > 1){ // selection return CTX::instance()->color.geom.selection; } - else if(CTX::instance()->mesh.color_carousel == 0){ // by element type + else if(CTX::instance()->mesh.colorCarousel == 0){ // by element type switch(ele->getNumEdges()){ case 1: return CTX::instance()->color.mesh.line; case 3: return CTX::instance()->color.mesh.triangle; @@ -58,7 +58,7 @@ static unsigned int getColorByElement(MElement *ele) default: return CTX::instance()->color.mesh.vertex; } } - else if(CTX::instance()->mesh.color_carousel == 3){ // by partition + else if(CTX::instance()->mesh.colorCarousel == 3){ // by partition return CTX::instance()->color.mesh.carousel[abs(ele->getPartition() % 20)]; } else{ @@ -77,10 +77,10 @@ static unsigned int getColorByElement(MElement *ele) static double evalClipPlane(int clip, double x, double y, double z) { - return CTX::instance()->clip_plane[clip][0] * x + - CTX::instance()->clip_plane[clip][1] * y + - CTX::instance()->clip_plane[clip][2] * z + - CTX::instance()->clip_plane[clip][3]; + return CTX::instance()->clipPlane[clip][0] * x + + CTX::instance()->clipPlane[clip][1] * y + + CTX::instance()->clipPlane[clip][2] * z + + CTX::instance()->clipPlane[clip][3]; } static double intersectClipPlane(int clip, MElement *ele) @@ -98,34 +98,34 @@ static double intersectClipPlane(int clip, MElement *ele) static bool isElementVisible(MElement *ele) { if(!ele->getVisibility()) return false; - if(CTX::instance()->mesh.quality_sup) { + if(CTX::instance()->mesh.qualitySup) { double q; - if(CTX::instance()->mesh.quality_type == 3) + if(CTX::instance()->mesh.qualityType == 3) q = ele->distoShapeMeasure(); - else if(CTX::instance()->mesh.quality_type == 2) + else if(CTX::instance()->mesh.qualityType == 2) q = ele->rhoShapeMeasure(); - else if(CTX::instance()->mesh.quality_type == 1) + else if(CTX::instance()->mesh.qualityType == 1) q = ele->etaShapeMeasure(); else q = ele->gammaShapeMeasure(); - if(q < CTX::instance()->mesh.quality_inf || - q > CTX::instance()->mesh.quality_sup) return false; + if(q < CTX::instance()->mesh.qualityInf || + q > CTX::instance()->mesh.qualitySup) return false; } - if(CTX::instance()->mesh.radius_sup) { + if(CTX::instance()->mesh.radiusSup) { double r = ele->maxEdge(); - if(r < CTX::instance()->mesh.radius_inf || - r > CTX::instance()->mesh.radius_sup) return false; + if(r < CTX::instance()->mesh.radiusInf || + r > CTX::instance()->mesh.radiusSup) return false; } - if(CTX::instance()->clip_whole_elements){ + if(CTX::instance()->clipWholeElements){ bool hidden = false; for(int clip = 0; clip < 6; clip++){ if(CTX::instance()->mesh.clip & (1 << clip)){ - if(ele->getDim() < 3 && CTX::instance()->clip_only_volume){ + if(ele->getDim() < 3 && CTX::instance()->clipOnlyVolume){ } else{ double d = intersectClipPlane(clip, ele); if(ele->getDim() == 3 && - CTX::instance()->clip_only_draw_intersecting_volume && d){ + CTX::instance()->clipOnlyDrawIntersectingVolume && d){ hidden = true; break; } @@ -160,10 +160,10 @@ static bool areSomeElementsCurved(std::vector<T*> &elements) static int getLabelStep(int total) { int step; - if(CTX::instance()->mesh.label_frequency == 0.0) + if(CTX::instance()->mesh.labelFrequency == 0.0) step = total; else - step = (int)(100.0 / CTX::instance()->mesh.label_frequency); + step = (int)(100.0 / CTX::instance()->mesh.labelFrequency); return (step > total) ? total : step; } @@ -183,16 +183,16 @@ static void drawElementLabels(drawContext *ctx, GEntity *e, if(i % labelStep == 0) { SPoint3 pc = ele->barycenter(); char str[256]; - if(CTX::instance()->mesh.label_type == 4) + if(CTX::instance()->mesh.labelType == 4) sprintf(str, "(%g,%g,%g)", pc.x(), pc.y(), pc.z()); - else if(CTX::instance()->mesh.label_type == 3) + else if(CTX::instance()->mesh.labelType == 3) sprintf(str, "%d", ele->getPartition()); - else if(CTX::instance()->mesh.label_type == 2){ + else if(CTX::instance()->mesh.labelType == 2){ int np = e->physicals.size(); int p = np ? e->physicals[np - 1] : 0; sprintf(str, "%d", p); } - else if(CTX::instance()->mesh.label_type == 1) + else if(CTX::instance()->mesh.labelType == 1) sprintf(str, "%d", e->tag()); else sprintf(str, "%d", ele->getNum()); @@ -213,7 +213,7 @@ static void drawNormals(drawContext *ctx, std::vector<T*> &elements) for(int j = 0; j < 3; j++) n[j] *= CTX::instance()->mesh.normals * ctx->pixel_equiv_x / ctx->s[j]; SPoint3 pc = ele->barycenter(); - ctx->drawVector(CTX::instance()->vector_type, 0, pc.x(), pc.y(), pc.z(), + ctx->drawVector(CTX::instance()->vectorType, 0, pc.x(), pc.y(), pc.z(), n[0], n[1], n[2], CTX::instance()->mesh.light); } } @@ -229,7 +229,7 @@ static void drawTangents(drawContext *ctx, std::vector<T*> &elements) for(int j = 0; j < 3; j++) t[j] *= CTX::instance()->mesh.tangents * ctx->pixel_equiv_x / ctx->s[j]; SPoint3 pc = ele->barycenter(); - ctx->drawVector(CTX::instance()->vector_type, 0, pc.x(), pc.y(), pc.z(), + ctx->drawVector(CTX::instance()->vectorType, 0, pc.x(), pc.y(), pc.z(), t[0], t[1], t[2], CTX::instance()->mesh.light); } } @@ -242,23 +242,23 @@ static void drawVertexLabel(drawContext *ctx, GEntity *e, MVertex *v, int np = e->physicals.size(); int physical = np ? e->physicals[np - 1] : 0; char str[256]; - if(CTX::instance()->mesh.label_type == 4) + if(CTX::instance()->mesh.labelType == 4) sprintf(str, "(%.16g,%.16g,%.16g)", v->x(), v->y(), v->z()); - else if(CTX::instance()->mesh.label_type == 3){ + else if(CTX::instance()->mesh.labelType == 3){ if(partition < 0) sprintf(str, "NA"); else sprintf(str, "%d", partition); } - else if(CTX::instance()->mesh.label_type == 2) + else if(CTX::instance()->mesh.labelType == 2) sprintf(str, "%d", physical); - else if(CTX::instance()->mesh.label_type == 1) + else if(CTX::instance()->mesh.labelType == 1) sprintf(str, "%d", e->tag()); else sprintf(str, "%d", v->getNum()); if(v->getPolynomialOrder() > 1) - glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex_sup); + glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertexSup); else glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex); glRasterPos3d(v->x(), v->y(), v->z()); @@ -268,15 +268,15 @@ static void drawVertexLabel(drawContext *ctx, GEntity *e, MVertex *v, static void drawVerticesPerEntity(drawContext *ctx, GEntity *e) { if(CTX::instance()->mesh.points) { - if(CTX::instance()->mesh.point_type) { + if(CTX::instance()->mesh.pointType) { for(unsigned int i = 0; i < e->mesh_vertices.size(); i++){ MVertex *v = e->mesh_vertices[i]; if(!v->getVisibility()) continue; if(v->getPolynomialOrder() > 1) - glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex_sup); + glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertexSup); else glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex); - ctx->drawSphere(CTX::instance()->mesh.point_size, v->x(), v->y(), v->z(), + ctx->drawSphere(CTX::instance()->mesh.pointSize, v->x(), v->y(), v->z(), CTX::instance()->mesh.light); } } @@ -286,7 +286,7 @@ static void drawVerticesPerEntity(drawContext *ctx, GEntity *e) MVertex *v = e->mesh_vertices[i]; if(!v->getVisibility()) continue; if(v->getPolynomialOrder() > 1) - glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex_sup); + glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertexSup); else glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex); glVertex3d(v->x(), v->y(), v->z()); @@ -294,7 +294,7 @@ static void drawVerticesPerEntity(drawContext *ctx, GEntity *e) glEnd(); } } - if(CTX::instance()->mesh.points_num) { + if(CTX::instance()->mesh.pointsNum) { int labelStep = getLabelStep(e->mesh_vertices.size()); for(unsigned int i = 0; i < e->mesh_vertices.size(); i++) if(i % labelStep == 0) drawVertexLabel(ctx, e, e->mesh_vertices[i]); @@ -312,11 +312,11 @@ static void drawVerticesPerElement(drawContext *ctx, GEntity *e, if(isElementVisible(ele) && v->getVisibility()){ if(CTX::instance()->mesh.points) { if(v->getPolynomialOrder() > 1) - glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex_sup); + glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertexSup); else glColor4ubv((GLubyte *) & CTX::instance()->color.mesh.vertex); - if(CTX::instance()->mesh.point_type) - ctx->drawSphere(CTX::instance()->mesh.point_size, v->x(), v->y(), v->z(), + if(CTX::instance()->mesh.pointType) + ctx->drawSphere(CTX::instance()->mesh.pointSize, v->x(), v->y(), v->z(), CTX::instance()->mesh.light); else{ glBegin(GL_POINTS); @@ -324,7 +324,7 @@ static void drawVerticesPerElement(drawContext *ctx, GEntity *e, glEnd(); } } - if(CTX::instance()->mesh.points_num) + if(CTX::instance()->mesh.pointsNum) drawVertexLabel(ctx, e, v); } } @@ -465,7 +465,7 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, if(CTX::instance()->mesh.explode != 1.) pc = ele->barycenter(); if(edges){ - bool unique = e->dim() > 1 && !CTX::instance()->pick_elements; + bool unique = e->dim() > 1 && !CTX::instance()->pickElements; for(int j = 0; j < ele->getNumEdgesRep(); j++){ double x[2], y[2], z[2]; SVector3 n[2]; @@ -477,7 +477,7 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, z[k] = pc[2] + CTX::instance()->mesh.explode * (z[k] - pc[2]); } } - if(e->dim() == 2 && CTX::instance()->mesh.smooth_normals) + if(e->dim() == 2 && CTX::instance()->mesh.smoothNormals) for(int k = 0; k < 2; k++) e->model()->normals->get(x[k], y[k], z[k], n[k][0], n[k][1], n[k][2]); e->va_lines->add(x, y, z, n, col, ele, unique); @@ -485,8 +485,8 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, } if(faces){ - bool unique = e->dim() > 2 && !CTX::instance()->pick_elements; - bool skin = e->dim() > 2 && CTX::instance()->mesh.draw_skin_only; + bool unique = e->dim() > 2 && !CTX::instance()->pickElements; + bool skin = e->dim() > 2 && CTX::instance()->mesh.drawSkinOnly; for(int j = 0; j < ele->getNumFacesRep(); j++){ double x[3], y[3], z[3]; SVector3 n[3]; @@ -498,7 +498,7 @@ static void addElementsInArrays(GEntity *e, std::vector<T*> &elements, z[k] = pc[2] + CTX::instance()->mesh.explode * (z[k] - pc[2]); } } - if(e->dim() == 2 && CTX::instance()->mesh.smooth_normals) + if(e->dim() == 2 && CTX::instance()->mesh.smoothNormals) for(int k = 0; k < 3; k++) e->model()->normals->get(x[k], y[k], z[k], n[k][0], n[k][1], n[k][2]); e->va_triangles->add(x, y, z, n, col, ele, unique, skin); @@ -515,7 +515,7 @@ static void drawArrays(drawContext *ctx, GEntity *e, VertexArray *va, GLint type // If we want to be enable picking of individual elements we need to // draw each one separately bool select = (ctx->render_mode == drawContext::GMSH_SELECT && - CTX::instance()->pick_elements && e->model() == GModel::current()); + CTX::instance()->pickElements && e->model() == GModel::current()); if(select) { if(va->getNumElementPointers() == va->getNumVertices()){ for(int i = 0; i < va->getNumVertices(); i += va->getNumVerticesPerElement()){ @@ -547,9 +547,9 @@ static void drawArrays(drawContext *ctx, GEntity *e, VertexArray *va, GLint type glDisableClientState(GL_COLOR_ARRAY); glColor4ubv((GLubyte *) & color); } - else if(CTX::instance()->pick_elements || - (!e->getSelection() && (CTX::instance()->mesh.color_carousel == 0 || - CTX::instance()->mesh.color_carousel == 3))){ + else if(CTX::instance()->pickElements || + (!e->getSelection() && (CTX::instance()->mesh.colorCarousel == 0 || + CTX::instance()->mesh.colorCarousel == 3))){ glColorPointer(4, GL_UNSIGNED_BYTE, 0, va->getColorArray()); glEnableClientState(GL_COLOR_ARRAY); } @@ -559,7 +559,7 @@ static void drawArrays(drawContext *ctx, GEntity *e, VertexArray *va, GLint type glColor4ubv((GLubyte *) & color); } - if(va->getNumVerticesPerElement() > 2 && CTX::instance()->polygon_offset) + if(va->getNumVerticesPerElement() > 2 && CTX::instance()->polygonOffset) glEnable(GL_POLYGON_OFFSET_FILL); glDrawArrays(type, 0, va->getNumVertices()); @@ -590,7 +590,7 @@ class drawMeshGVertex { glPushName(v->tag()); } - if(CTX::instance()->mesh.points || CTX::instance()->mesh.points_num) + if(CTX::instance()->mesh.points || CTX::instance()->mesh.pointsNum) drawVerticesPerEntity(_ctx, v); if(select) { @@ -649,10 +649,10 @@ class drawMeshGEdge { if(CTX::instance()->mesh.lines) drawArrays(_ctx, e, e->va_lines, GL_LINES, false); - if(CTX::instance()->mesh.lines_num) + if(CTX::instance()->mesh.linesNum) drawElementLabels(_ctx, e, e->lines); - if(CTX::instance()->mesh.points || CTX::instance()->mesh.points_num){ + if(CTX::instance()->mesh.points || CTX::instance()->mesh.pointsNum){ if(e->getAllElementsVisible()) drawVerticesPerEntity(_ctx, e); else @@ -686,7 +686,7 @@ class initMeshGFace { int _estimateNumLines(GFace *f) { int num = 0; - if(CTX::instance()->mesh.surfaces_edges){ + if(CTX::instance()->mesh.surfacesEdges){ num += (3 * f->triangles.size() + 4 * f->quadrangles.size()) / 2; if(CTX::instance()->mesh.explode != 1.) num *= 2; if(_curved) num *= 2; @@ -696,7 +696,7 @@ class initMeshGFace { int _estimateNumTriangles(GFace *f) { int num = 0; - if(CTX::instance()->mesh.surfaces_faces){ + if(CTX::instance()->mesh.surfacesFaces){ num += (f->triangles.size() + 2 * f->quadrangles.size()); if(_curved) num *= 4; } @@ -712,8 +712,8 @@ class initMeshGFace { (CTX::instance()->mesh.triangles && areAllElementsVisible(f->triangles) && CTX::instance()->mesh.quadrangles && areAllElementsVisible(f->quadrangles)); - bool edg = CTX::instance()->mesh.surfaces_edges; - bool fac = CTX::instance()->mesh.surfaces_faces; + bool edg = CTX::instance()->mesh.surfacesEdges; + bool fac = CTX::instance()->mesh.surfacesFaces; if(edg || fac){ _curved = (areSomeElementsCurved(f->triangles) || areSomeElementsCurved(f->quadrangles)); @@ -744,20 +744,20 @@ class drawMeshGFace { } drawArrays(_ctx, f, f->va_lines, GL_LINES, - CTX::instance()->mesh.light && CTX::instance()->mesh.light_lines, - CTX::instance()->mesh.surfaces_faces, CTX::instance()->color.mesh.line); + CTX::instance()->mesh.light && CTX::instance()->mesh.lightLines, + CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); drawArrays(_ctx, f, f->va_triangles, GL_TRIANGLES, CTX::instance()->mesh.light); - if(CTX::instance()->mesh.surfaces_num) { + if(CTX::instance()->mesh.surfacesNum) { if(CTX::instance()->mesh.triangles) - drawElementLabels(_ctx, f, f->triangles, CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, f, f->triangles, CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); if(CTX::instance()->mesh.quadrangles) - drawElementLabels(_ctx, f, f->quadrangles, CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, f, f->quadrangles, CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); } - if(CTX::instance()->mesh.points || CTX::instance()->mesh.points_num){ + if(CTX::instance()->mesh.points || CTX::instance()->mesh.pointsNum){ if(f->getAllElementsVisible()) drawVerticesPerEntity(_ctx, f); else{ @@ -795,8 +795,8 @@ class initMeshGRegion { bool _curved; int _estimateIfClipped(int num) { - if(CTX::instance()->clip_whole_elements && - CTX::instance()->clip_only_draw_intersecting_volume){ + if(CTX::instance()->clipWholeElements && + CTX::instance()->clipOnlyDrawIntersectingVolume){ for(int clip = 0; clip < 6; clip++){ if(CTX::instance()->mesh.clip & (1 << clip)) return (int)sqrt((double)num); @@ -807,7 +807,7 @@ class initMeshGRegion { int _estimateNumLines(GRegion *r) { int num = 0; - if(CTX::instance()->mesh.volumes_edges){ + if(CTX::instance()->mesh.volumesEdges){ // suppose edge shared by 4 elements on averge (pessmistic) num += (12 * r->tetrahedra.size() + 24 * r->hexahedra.size() + 18 * r->prisms.size() + 16 * r->pyramids.size()) / 4; @@ -820,7 +820,7 @@ class initMeshGRegion { int _estimateNumTriangles(GRegion *r) { int num = 0; - if(CTX::instance()->mesh.volumes_faces){ + if(CTX::instance()->mesh.volumesFaces){ num += (4 * r->tetrahedra.size() + 12 * r->hexahedra.size() + 8 * r->prisms.size() + 6 * r->pyramids.size()) / 2; num = _estimateIfClipped(num); @@ -841,8 +841,8 @@ class initMeshGRegion { CTX::instance()->mesh.prisms && areAllElementsVisible(r->prisms) && CTX::instance()->mesh.pyramids && areAllElementsVisible(r->pyramids)); - bool edg = CTX::instance()->mesh.volumes_edges; - bool fac = CTX::instance()->mesh.volumes_faces; + bool edg = CTX::instance()->mesh.volumesEdges; + bool fac = CTX::instance()->mesh.volumesFaces; if(edg || fac){ _curved = (areSomeElementsCurved(r->tetrahedra) || areSomeElementsCurved(r->hexahedra) || @@ -877,30 +877,30 @@ class drawMeshGRegion { } drawArrays(_ctx, r, r->va_lines, GL_LINES, CTX::instance()->mesh.light && - CTX::instance()->mesh.light_lines, CTX::instance()->mesh.volumes_faces, + CTX::instance()->mesh.lightLines, CTX::instance()->mesh.volumesFaces, CTX::instance()->color.mesh.line); drawArrays(_ctx, r, r->va_triangles, GL_TRIANGLES, CTX::instance()->mesh.light); - if(CTX::instance()->mesh.volumes_num) { + if(CTX::instance()->mesh.volumesNum) { if(CTX::instance()->mesh.tetrahedra) - drawElementLabels(_ctx, r, r->tetrahedra, CTX::instance()->mesh.volumes_faces || - CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, r, r->tetrahedra, CTX::instance()->mesh.volumesFaces || + CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); if(CTX::instance()->mesh.hexahedra) - drawElementLabels(_ctx, r, r->hexahedra, CTX::instance()->mesh.volumes_faces || - CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, r, r->hexahedra, CTX::instance()->mesh.volumesFaces || + CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); if(CTX::instance()->mesh.prisms) - drawElementLabels(_ctx, r, r->prisms, CTX::instance()->mesh.volumes_faces || - CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, r, r->prisms, CTX::instance()->mesh.volumesFaces || + CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); if(CTX::instance()->mesh.pyramids) - drawElementLabels(_ctx, r, r->pyramids, CTX::instance()->mesh.volumes_faces || - CTX::instance()->mesh.surfaces_faces, + drawElementLabels(_ctx, r, r->pyramids, CTX::instance()->mesh.volumesFaces || + CTX::instance()->mesh.surfacesFaces, CTX::instance()->color.mesh.line); } - if(CTX::instance()->mesh.points || CTX::instance()->mesh.points_num){ + if(CTX::instance()->mesh.points || CTX::instance()->mesh.pointsNum){ if(r->getAllElementsVisible()) drawVerticesPerEntity(_ctx, r); else{ @@ -942,20 +942,20 @@ void drawContext::drawMesh() PView::list[j]->setChanged(true); } - glPointSize(CTX::instance()->mesh.point_size); - gl2psPointSize(CTX::instance()->mesh.point_size * - CTX::instance()->print.eps_point_size_factor); + glPointSize(CTX::instance()->mesh.pointSize); + gl2psPointSize(CTX::instance()->mesh.pointSize * + CTX::instance()->print.epsPointSizeFactor); - glLineWidth(CTX::instance()->mesh.line_width); - gl2psLineWidth(CTX::instance()->mesh.line_width * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->mesh.lineWidth); + gl2psLineWidth(CTX::instance()->mesh.lineWidth * + CTX::instance()->print.epsLineWidthFactor); - if(CTX::instance()->mesh.light_two_side) + if(CTX::instance()->mesh.lightTwoSide) glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); - if(!CTX::instance()->clip_whole_elements){ + if(!CTX::instance()->clipWholeElements){ for(int i = 0; i < 6; i++) if(CTX::instance()->mesh.clip & (1 << i)) glEnable((GLenum)(GL_CLIP_PLANE0 + i)); @@ -978,8 +978,8 @@ void drawContext::drawMesh() std::for_each(m->firstEdge(), m->lastEdge(), initMeshGEdge()); if(status >= 2 && CTX::instance()->mesh.changed & ENT_SURFACE){ if(m->normals) delete m->normals; - m->normals = new smooth_normals(CTX::instance()->mesh.angle_smooth_normals); - if(CTX::instance()->mesh.smooth_normals) + m->normals = new smooth_normals(CTX::instance()->mesh.angleSmoothNormals); + if(CTX::instance()->mesh.smoothNormals) std::for_each(m->firstFace(), m->lastFace(), initSmoothNormalsGFace()); std::for_each(m->firstFace(), m->lastFace(), initMeshGFace()); } diff --git a/Graphics/drawPost.cpp b/Graphics/drawPost.cpp index 7edb579d0913c98a57a8556630c377ceeb275a1b..fc0904026d4539a5ce8e1a6c54a2e94f941d5427 100644 --- a/Graphics/drawPost.cpp +++ b/Graphics/drawPost.cpp @@ -53,12 +53,12 @@ static SVector3 getPointNormal(PView *p, double v) { PViewOptions *opt = p->getOptions(); SVector3 n(0., 0., 0.); - if(opt->PointType > 0){ + if(opt->pointType > 0){ // when we draw spheres, we use the normalized value (between 0 // and 1) stored in the first component of the normal to modulate // the radius - double d = opt->TmpMax - opt->TmpMin; - n[0] = (v - opt->TmpMin) / (d ? d : 1.); + double d = opt->tmpMax - opt->tmpMin; + n[0] = (v - opt->tmpMin) / (d ? d : 1.); } return n; } @@ -68,14 +68,14 @@ static void getLineNormal(PView *p, double x[2], double y[2], double z[2], { PViewOptions *opt = p->getOptions(); - if(opt->LineType > 0){ + if(opt->lineType > 0){ if(v){ // when we draw tapered cylinders, we use the normalized values // (between 0 and 1) stored in the first component of the // normals to modulate the width - double d = opt->TmpMax - opt->TmpMin; - n[0][0] = (v[0] - opt->TmpMin) / (d ? d : 1.); - n[1][0] = (v[1] - opt->TmpMin) / (d ? d : 1.); + double d = opt->tmpMax - opt->tmpMin; + n[0][0] = (v[0] - opt->tmpMin) / (d ? d : 1.); + n[1][0] = (v[1] - opt->tmpMin) / (d ? d : 1.); } else{ // when we don't have values we use maximum width cylinders @@ -118,32 +118,32 @@ static bool getExternalValues(PView *p, int index, int ient, int iele, for(int i = 0; i < numNodes; i++) for(int j = 0; j < numComp; j++) val2[i][j] = val[i][j]; - opt->ExternalMin = opt->TmpMin; - opt->ExternalMax = opt->TmpMax; + opt->externalMin = opt->tmpMin; + opt->externalMax = opt->tmpMax; if(index < 0 || index >= (int)PView::list.size()) return false; PView *p2 = PView::list[index]; PViewData *data2 = p2->getData(); - if(opt->TimeStep < data2->getNumTimeSteps() && - iele < data2->getNumElements(opt->TimeStep, ient)){ - if(data2->getNumNodes(opt->TimeStep, ient, iele) == numNodes){ - numComp2 = data2->getNumComponents(opt->TimeStep, ient, iele); + if(opt->timeStep < data2->getNumTimeSteps() && + iele < data2->getNumElements(opt->timeStep, ient)){ + if(data2->getNumNodes(opt->timeStep, ient, iele) == numNodes){ + numComp2 = data2->getNumComponents(opt->timeStep, ient, iele); for(int i = 0; i < numNodes; i++) for(int j = 0; j < numComp2; j++) - data2->getValue(opt->TimeStep, ient, iele, i, j, val2[i][j]); - if(opt->RangeType == PViewOptions::Custom){ - opt->ExternalMin = opt->CustomMin; - opt->ExternalMax = opt->CustomMax; + data2->getValue(opt->timeStep, ient, iele, i, j, val2[i][j]); + if(opt->rangeType == PViewOptions::Custom){ + opt->externalMin = opt->customMin; + opt->externalMax = opt->customMax; } - else if(opt->RangeType == PViewOptions::PerTimeStep){ - opt->ExternalMin = data2->getMin(opt->TimeStep); - opt->ExternalMax = data2->getMax(opt->TimeStep); + else if(opt->rangeType == PViewOptions::PerTimeStep){ + opt->externalMin = data2->getMin(opt->timeStep); + opt->externalMax = data2->getMax(opt->timeStep); } else{ - opt->ExternalMin = data2->getMin(); - opt->ExternalMax = data2->getMax(); + opt->externalMin = data2->getMin(); + opt->externalMax = data2->getMax(); } return true; } @@ -165,15 +165,15 @@ static void applyGeneralRaise(PView *p, int numNodes, int numComp, double values[] = { d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], xyz[k][0], xyz[k][1], xyz[k][2] }; for(int i = 0; i < 3; i++) { - if(opt->GenRaise_f[i]) - xyz[k][i] += opt->GenRaiseFactor * evaluator_evaluate - (opt->GenRaise_f[i], sizeof(names) / sizeof(names[0]), names, values); + if(opt->genRaiseFunction[i]) + xyz[k][i] += opt->genRaiseFactor * evaluator_evaluate + (opt->genRaiseFunction[i], sizeof(names) / sizeof(names[0]), names, values); } #else for(int i = 0; i < 3; i++){ - int comp = (int)opt->GenRaise_f[i]; + int comp = (int)opt->genRaiseFunction[i]; if(comp >= 0) - xyz[k][i] += opt->GenRaiseFactor * d[comp]; + xyz[k][i] += opt->genRaiseFactor * d[comp]; } #endif } @@ -185,7 +185,7 @@ static void changeCoordinates(PView *p, int ient, int iele, { PViewOptions *opt = p->getOptions(); - if(opt->Explode != 1.) { + if(opt->explode != 1.) { double barycenter[3] = {0., 0., 0.}; for(int i = 0; i < numNodes; i++) for(int j = 0; j < 3; j++) @@ -194,39 +194,39 @@ static void changeCoordinates(PView *p, int ient, int iele, barycenter[j] /= (double)numNodes; for(int i = 0; i < numNodes; i++) for(int j = 0; j < 3; j++) - xyz[i][j] = barycenter[j] + opt->Explode * (xyz[i][j] - barycenter[j]); + xyz[i][j] = barycenter[j] + opt->explode * (xyz[i][j] - barycenter[j]); } - if(opt->Transform[0][0] != 1. || opt->Transform[0][1] != 0. || - opt->Transform[0][2] != 0. || opt->Transform[1][0] != 0. || - opt->Transform[1][1] != 1. || opt->Transform[1][2] != 0. || - opt->Transform[2][0] != 0. || opt->Transform[2][1] != 0. || - opt->Transform[2][2] != 1.){ + if(opt->transform[0][0] != 1. || opt->transform[0][1] != 0. || + opt->transform[0][2] != 0. || opt->transform[1][0] != 0. || + opt->transform[1][1] != 1. || opt->transform[1][2] != 0. || + opt->transform[2][0] != 0. || opt->transform[2][1] != 0. || + opt->transform[2][2] != 1.){ for(int i = 0; i < numNodes; i++) { double old[3] = {xyz[i][0], xyz[i][1], xyz[i][2]}; for(int j = 0; j < 3; j++){ xyz[i][j] = 0.; for(int k = 0; k < 3; k++) - xyz[i][j] += opt->Transform[j][k] * old[k]; + xyz[i][j] += opt->transform[j][k] * old[k]; } } } - if(opt->Offset[0] || opt->Offset[1] || opt->Offset[2]){ + if(opt->offset[0] || opt->offset[1] || opt->offset[2]){ for(int i = 0; i < numNodes; i++) for(int j = 0; j < 3; j++) - xyz[i][j] += opt->Offset[j]; + xyz[i][j] += opt->offset[j]; } - if(opt->Raise[0] || opt->Raise[1] || opt->Raise[2]){ + if(opt->raise[0] || opt->raise[1] || opt->raise[2]){ for(int i = 0; i < numNodes; i++){ double v = ComputeScalarRep(numComp, val[i]); for(int j = 0; j < 3; j++) - xyz[i][j] += opt->Raise[j] * v; + xyz[i][j] += opt->raise[j] * v; } } - if(opt->NormalRaise && numEdges >= 1 && numEdges <= 4){ + if(opt->normalRaise && numEdges >= 1 && numEdges <= 4){ SVector3 n; if(numEdges == 1){ // assumes lines in z=const plane, and raises in that plane @@ -243,21 +243,21 @@ static void changeCoordinates(PView *p, int ient, int iele, for(int i = 0; i < numNodes; i++){ double v = ComputeScalarRep(numComp, val[i]); for(int j = 0; j < 3; j++) - xyz[i][j] += n[j] * opt->NormalRaise * v; + xyz[i][j] += n[j] * opt->normalRaise * v; } } - if(numComp == 3 && opt->VectorType == PViewOptions::Displacement){ + if(numComp == 3 && opt->vectorType == PViewOptions::Displacement){ for(int i = 0; i < numNodes; i++){ for(int j = 0; j < 3; j++) - xyz[i][j] += opt->DisplacementFactor * val[i][j]; + xyz[i][j] += opt->displacementFactor * val[i][j]; } } - if(opt->UseGenRaise){ + if(opt->useGenRaise){ int numComp2; double val2[NMAX][9]; - getExternalValues(p, opt->ViewIndexForGenRaise, ient, iele, numNodes, + getExternalValues(p, opt->viewIndexForGenRaise, ient, iele, numNodes, numComp, val, numComp2, val2); applyGeneralRaise(p, numNodes, numComp2, val2, xyz); } @@ -265,10 +265,10 @@ static void changeCoordinates(PView *p, int ient, int iele, static double evalClipPlane(int clip, double x, double y, double z) { - return CTX::instance()->clip_plane[clip][0] * x + - CTX::instance()->clip_plane[clip][1] * y + - CTX::instance()->clip_plane[clip][2] * z + - CTX::instance()->clip_plane[clip][3]; + return CTX::instance()->clipPlane[clip][0] * x + + CTX::instance()->clipPlane[clip][1] * y + + CTX::instance()->clipPlane[clip][2] * z + + CTX::instance()->clipPlane[clip][3]; } static double intersectClipPlane(int clip, int numNodes, double xyz[NMAX][3]) @@ -284,15 +284,15 @@ static double intersectClipPlane(int clip, int numNodes, double xyz[NMAX][3]) static bool isElementVisible(PViewOptions *opt, int dim, int numNodes, double xyz[NMAX][3]) { - if(!CTX::instance()->clip_whole_elements) return true; + if(!CTX::instance()->clipWholeElements) return true; bool hidden = false; for(int clip = 0; clip < 6; clip++){ - if(opt->Clip & (1 << clip)){ - if(dim < 3 && CTX::instance()->clip_only_volume){ + if(opt->clip & (1 << clip)){ + if(dim < 3 && CTX::instance()->clipOnlyVolume){ } else{ double d = intersectClipPlane(clip, numNodes, xyz); - if(dim == 3 && CTX::instance()->clip_only_draw_intersecting_volume && d){ + if(dim == 3 && CTX::instance()->clipOnlyDrawIntersectingVolume && d){ hidden = true; break; } @@ -321,13 +321,13 @@ static void addScalarPoint(PView *p, double xyz[NMAX][3], double val[NMAX][9], PViewOptions *opt = p->getOptions(); - double vmin = opt->TmpMin, vmax = opt->TmpMax; - if(opt->SaturateValues) saturate(1, val, vmin, vmax, i0); + double vmin = opt->tmpMin, vmax = opt->tmpMax; + if(opt->saturateValues) saturate(1, val, vmin, vmax, i0); if(val[i0][0] >= vmin && val[i0][0] <= vmax){ unsigned int col = opt->getColor(val[i0][0], vmin, vmax, false, - (opt->IntervalsType == PViewOptions::Discrete) ? - opt->NbIso : -1); + (opt->intervalsType == PViewOptions::Discrete) ? + opt->nbIso : -1); SVector3 n = getPointNormal(p, val[i0][0]); p->va_points->add(&xyz[i0][0], &xyz[i0][1], &xyz[i0][2], &n, &col, 0, unique); } @@ -357,23 +357,23 @@ static void addScalarLine(PView *p, double xyz[NMAX][3], double val[NMAX][9], PViewOptions *opt = p->getOptions(); - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; addScalarPoint(p, xyz, val, pre, i0, true); addScalarPoint(p, xyz, val, pre, i1, true); - opt->Boundary++; + opt->boundary++; return; } - double vmin = opt->TmpMin, vmax = opt->TmpMax; - if(opt->SaturateValues) saturate(2, val, vmin, vmax, i0, i1); + double vmin = opt->tmpMin, vmax = opt->tmpMax; + if(opt->saturateValues) saturate(2, val, vmin, vmax, i0, i1); double x[2] = {xyz[i0][0], xyz[i1][0]}; double y[2] = {xyz[i0][1], xyz[i1][1]}; double z[2] = {xyz[i0][2], xyz[i1][2]}; double v[2] = {val[i0][0], val[i1][0]}; - if(opt->IntervalsType == PViewOptions::Continuous){ + if(opt->intervalsType == PViewOptions::Continuous){ SVector3 n[2]; getLineNormal(p, x, y, z, v, n, true); if(val[i0][0] >= vmin && val[i0][0] <= vmax && @@ -395,15 +395,15 @@ static void addScalarLine(PView *p, double xyz[NMAX][3], double val[NMAX][9], } } - if(opt->IntervalsType == PViewOptions::Discrete){ - for(int k = 0; k < opt->NbIso; k++){ - if(vmin == vmax) k = opt->NbIso / 2; - double min = opt->getScaleValue(k, opt->NbIso + 1, vmin, vmax); - double max = opt->getScaleValue(k + 1, opt->NbIso + 1, vmin, vmax); + if(opt->intervalsType == PViewOptions::Discrete){ + for(int k = 0; k < opt->nbIso; k++){ + if(vmin == vmax) k = opt->nbIso / 2; + double min = opt->getScaleValue(k, opt->nbIso + 1, vmin, vmax); + double max = opt->getScaleValue(k + 1, opt->nbIso + 1, vmin, vmax); double x2[2], y2[2], z2[2], v2[2]; int nb = CutLine(x, y, z, v, min, max, x2, y2, z2, v2); if(nb == 2){ - unsigned int color = opt->getColor(k, opt->NbIso); + unsigned int color = opt->getColor(k, opt->nbIso); unsigned int col[2] = {color, color}; SVector3 n[2]; getLineNormal(p, x2, y2, z2, v2, n, true); @@ -413,14 +413,14 @@ static void addScalarLine(PView *p, double xyz[NMAX][3], double val[NMAX][9], } } - if(opt->IntervalsType == PViewOptions::Iso){ - for(int k = 0; k < opt->NbIso; k++) { - if(vmin == vmax) k = opt->NbIso / 2; - double iso = opt->getScaleValue(k, opt->NbIso, vmin, vmax); + if(opt->intervalsType == PViewOptions::Iso){ + for(int k = 0; k < opt->nbIso; k++) { + if(vmin == vmax) k = opt->nbIso / 2; + double iso = opt->getScaleValue(k, opt->nbIso, vmin, vmax); double x2[1], y2[1], z2[1]; int nb = IsoLine(x, y, z, v, iso, x2, y2, z2); if(nb == 1){ - unsigned int color = opt->getColor(k, opt->NbIso); + unsigned int color = opt->getColor(k, opt->nbIso); SVector3 n = getPointNormal(p, iso); p->va_points->add(x2, y2, z2, &n, &color, 0, unique); } @@ -444,7 +444,7 @@ static void addOutlineTriangle(PView *p, double xyz[NMAX][3], unsigned int color double z[2] = {xyz[il[i][0]][2], xyz[il[i][1]][2]}; SVector3 n[2] = {nfac, nfac}; unsigned int col[2] = {color, color}; - if(opt->SmoothNormals){ + if(opt->smoothNormals){ for(int j = 0; j < 2; j++){ if(pre) p->normals->add(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]); else p->normals->get(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]); @@ -463,16 +463,16 @@ static void addScalarTriangle(PView *p, double xyz[NMAX][3], double val[NMAX][9] const int il[3][2] = {{i0, i1}, {i1, i2}, {i2, i0}}; - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; for(int i = 0; i < 3; i++) addScalarLine(p, xyz, val, pre, il[i][0], il[i][1], true); - opt->Boundary++; + opt->boundary++; return; } - double vmin = opt->TmpMin, vmax = opt->TmpMax; - if(opt->SaturateValues) saturate(3, val, vmin, vmax, i0, i1, i2); + double vmin = opt->tmpMin, vmax = opt->tmpMax; + if(opt->saturateValues) saturate(3, val, vmin, vmax, i0, i1, i2); double x[3] = {xyz[i0][0], xyz[i1][0], xyz[i2][0]}; double y[3] = {xyz[i0][1], xyz[i1][1], xyz[i2][1]}; @@ -481,14 +481,14 @@ static void addScalarTriangle(PView *p, double xyz[NMAX][3], double val[NMAX][9] SVector3 nfac = normal3(xyz, i0, i1, i2); - if(opt->IntervalsType == PViewOptions::Continuous){ + if(opt->intervalsType == PViewOptions::Continuous){ if(val[i0][0] >= vmin && val[i0][0] <= vmax && val[i1][0] >= vmin && val[i1][0] <= vmax && val[i2][0] >= vmin && val[i2][0] <= vmax){ SVector3 n[3] = {nfac, nfac, nfac}; unsigned int col[3]; for(int i = 0; i < 3; i++){ - if(opt->SmoothNormals){ + if(opt->smoothNormals){ if(pre) p->normals->add(x[i], y[i], z[i], n[i][0], n[i][1], n[i][2]); else p->normals->get(x[i], y[i], z[i], n[i][0], n[i][1], n[i][2]); } @@ -508,7 +508,7 @@ static void addScalarTriangle(PView *p, double xyz[NMAX][3], double val[NMAX][9] SVector3 n[3] = {nfac, nfac, nfac}; unsigned int col[3]; for(int i = 0; i < 3; i++){ - if(opt->SmoothNormals){ + if(opt->smoothNormals){ if(pre) p->normals->add(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); else p->normals->get(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); } @@ -520,22 +520,22 @@ static void addScalarTriangle(PView *p, double xyz[NMAX][3], double val[NMAX][9] } } - if(opt->IntervalsType == PViewOptions::Discrete){ - for(int k = 0; k < opt->NbIso; k++){ - if(vmin == vmax) k = opt->NbIso / 2; - double min = opt->getScaleValue(k, opt->NbIso + 1, vmin, vmax); - double max = opt->getScaleValue(k + 1, opt->NbIso + 1, vmin, vmax); + if(opt->intervalsType == PViewOptions::Discrete){ + for(int k = 0; k < opt->nbIso; k++){ + if(vmin == vmax) k = opt->nbIso / 2; + double min = opt->getScaleValue(k, opt->nbIso + 1, vmin, vmax); + double max = opt->getScaleValue(k + 1, opt->nbIso + 1, vmin, vmax); double x2[10], y2[10], z2[10], v2[10]; int nb = CutTriangle(x, y, z, v, min, max, x2, y2, z2, v2); if(nb >= 3){ - unsigned int color = opt->getColor(k, opt->NbIso); + unsigned int color = opt->getColor(k, opt->nbIso); unsigned int col[3] = {color, color, color}; for(int j = 2; j < nb; j++){ double x3[3] = {x2[0], x2[j - 1], x2[j]}; double y3[3] = {y2[0], y2[j - 1], y2[j]}; double z3[3] = {z2[0], z2[j - 1], z2[j]}; SVector3 n[3] = {nfac, nfac, nfac}; - if(opt->SmoothNormals){ + if(opt->smoothNormals){ for(int i = 0; i < 3; i++){ if(pre) p->normals->add(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); else p->normals->get(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); @@ -548,17 +548,17 @@ static void addScalarTriangle(PView *p, double xyz[NMAX][3], double val[NMAX][9] } } - if(opt->IntervalsType == PViewOptions::Iso){ - for(int k = 0; k < opt->NbIso; k++) { - if(vmin == vmax) k = opt->NbIso / 2; - double iso = opt->getScaleValue(k, opt->NbIso, vmin, vmax); + if(opt->intervalsType == PViewOptions::Iso){ + for(int k = 0; k < opt->nbIso; k++) { + if(vmin == vmax) k = opt->nbIso / 2; + double iso = opt->getScaleValue(k, opt->nbIso, vmin, vmax); double x2[3], y2[3], z2[3]; int nb = IsoTriangle(x, y, z, v, iso, x2, y2, z2); if(nb == 2){ - unsigned int color = opt->getColor(k, opt->NbIso); + unsigned int color = opt->getColor(k, opt->nbIso); unsigned int col[2] = {color, color}; SVector3 n[2] = {nfac, nfac}; - if(opt->SmoothNormals){ + if(opt->smoothNormals){ for(int i = 0; i < 2; i++){ if(pre) p->normals->add(x2[i], y2[i], z2[i], n[i][0], n[i][1], n[i][2]); else p->normals->get(x2[i], y2[i], z2[i], n[i][0], n[i][1], n[i][2]); @@ -588,7 +588,7 @@ static void addOutlineQuadrangle(PView *p, double xyz[NMAX][3], unsigned int col double z[2] = {xyz[il[i][0]][2], xyz[il[i][1]][2]}; SVector3 n[2] = {nfac, nfac}; unsigned int col[2] = {color, color}; - if(opt->SmoothNormals){ + if(opt->smoothNormals){ for(int j = 0; j < 2; j++){ if(pre) p->normals->add(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]); else p->normals->get(x[j], y[j], z[j], n[j][0], n[j][1], n[j][2]); @@ -608,11 +608,11 @@ static void addScalarQuadrangle(PView *p, double xyz[NMAX][3], double val[NMAX][ const int il[4][2] = {{i0, i1}, {i1, i2}, {i2, i3}, {i3, i0}}; const int it[2][3] = {{i0, i1, i2}, {i0, i2, i3}}; - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; for(int i = 0; i < 4; i++) addScalarLine(p, xyz, val, pre, il[i][0], il[i][1], true); - opt->Boundary++; + opt->boundary++; return; } @@ -635,33 +635,33 @@ static void addScalarTetrahedron(PView *p, double xyz[NMAX][3], double val[NMAX] const int it[4][3] = {{i0, i2, i1}, {i0, i1, i3}, {i0, i3, i2}, {i3, i1, i2}}; - if(opt->Boundary > 0 || - opt->IntervalsType == PViewOptions::Continuous || - opt->IntervalsType == PViewOptions::Discrete){ - bool skin = (opt->Boundary > 0) ? false : opt->DrawSkinOnly; - opt->Boundary--; + if(opt->boundary > 0 || + opt->intervalsType == PViewOptions::Continuous || + opt->intervalsType == PViewOptions::Discrete){ + bool skin = (opt->boundary > 0) ? false : opt->drawSkinOnly; + opt->boundary--; for(int i = 0; i < 4; i++) addScalarTriangle(p, xyz, val, pre, it[i][0], it[i][1], it[i][2], true, skin); - opt->Boundary++; + opt->boundary++; return; } - double vmin = opt->TmpMin, vmax = opt->TmpMax; - if(opt->SaturateValues) saturate(4, val, vmin, vmax, i0, i1, i2, i3); + double vmin = opt->tmpMin, vmax = opt->tmpMax; + if(opt->saturateValues) saturate(4, val, vmin, vmax, i0, i1, i2, i3); double x[4] = {xyz[i0][0], xyz[i1][0], xyz[i2][0], xyz[i3][0]}; double y[4] = {xyz[i0][1], xyz[i1][1], xyz[i2][1], xyz[i3][1]}; double z[4] = {xyz[i0][2], xyz[i1][2], xyz[i2][2], xyz[i3][2]}; double v[4] = {val[i0][0], val[i1][0], val[i2][0], val[i3][0]}; - if(opt->IntervalsType == PViewOptions::Iso){ - for(int k = 0; k < opt->NbIso; k++) { - if(vmin == vmax) k = opt->NbIso / 2; - double iso = opt->getScaleValue(k, opt->NbIso, vmin, vmax); + if(opt->intervalsType == PViewOptions::Iso){ + for(int k = 0; k < opt->nbIso; k++) { + if(vmin == vmax) k = opt->nbIso / 2; + double iso = opt->getScaleValue(k, opt->nbIso, vmin, vmax); double x2[NMAX], y2[NMAX], z2[NMAX], nn[3]; int nb = IsoSimplex(x, y, z, v, iso, x2, y2, z2, nn); if(nb >= 3){ - unsigned int color = opt->getColor(k, opt->NbIso); + unsigned int color = opt->getColor(k, opt->nbIso); unsigned int col[3] = {color, color, color}; for(int j = 2; j < nb; j++){ double x3[3] = {x2[0], x2[j - 1], x2[j]}; @@ -670,7 +670,7 @@ static void addScalarTetrahedron(PView *p, double xyz[NMAX][3], double val[NMAX] SVector3 n[3]; for(int i = 0; i < 3; i++){ n[i][0] = nn[0]; n[i][1] = nn[1]; n[i][2] = nn[2]; - if(opt->SmoothNormals){ + if(opt->smoothNormals){ if(pre) p->normals->add(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); else p->normals->get(x3[i], y3[i], z3[i], n[i][0], n[i][1], n[i][2]); } @@ -704,11 +704,11 @@ static void addScalarHexahedron(PView *p, double xyz[NMAX][3], double val[NMAX][ const int is[6][4] = {{0, 1, 3, 7}, {0, 4, 1, 7}, {1, 4, 5, 7}, {1, 2, 3, 7}, {1, 6, 2, 7}, {1, 5, 6, 7}}; - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; for(int i = 0; i < 6; i++) addScalarQuadrangle(p, xyz, val, pre, iq[i][0], iq[i][1], iq[i][2], iq[i][3], true); - opt->Boundary++; + opt->boundary++; return; } @@ -737,13 +737,13 @@ static void addScalarPrism(PView *p, double xyz[NMAX][3], double val[NMAX][9], const int it[2][3] = {{0, 2, 1}, {3, 4, 5}}; const int is[3][4] = {{0, 1, 2, 3}, {3, 4, 5, 2}, {1, 2, 4, 3}}; - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; for(int i = 0; i < 3; i++) addScalarQuadrangle(p, xyz, val, pre, iq[i][0], iq[i][1], iq[i][2], iq[i][3], true); for(int i = 0; i < 2; i++) addScalarTriangle(p, xyz, val, pre, it[i][0], it[i][1], it[i][2], true); - opt->Boundary++; + opt->boundary++; return; } @@ -769,12 +769,12 @@ static void addScalarPyramid(PView *p, double xyz[NMAX][3], double val[NMAX][9], const int it[4][3] = {{0, 1, 4}, {3, 0, 4}, {1, 2, 4}, {2, 3, 4}}; const int is[2][4] = {{0, 1, 2, 4}, {2, 3, 0, 4}}; - if(opt->Boundary > 0){ - opt->Boundary--; + if(opt->boundary > 0){ + opt->boundary--; addScalarQuadrangle(p, xyz, val, pre, 0, 3, 2, 1, true); for(int i = 0; i < 4; i++) addScalarTriangle(p, xyz, val, pre, it[i][0], it[i][1], it[i][2], true); - opt->Boundary++; + opt->boundary++; return; } @@ -822,24 +822,24 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes, int numComp2; double val2[NMAX][9]; - getExternalValues(p, opt->ExternalViewIndex, ient, iele, numNodes, + getExternalValues(p, opt->externalViewIndex, ient, iele, numNodes, 3, val, numComp2, val2); - if(opt->VectorType == PViewOptions::Displacement){ + if(opt->vectorType == PViewOptions::Displacement){ for(int i = 0; i < numNodes; i++) val2[i][0] = ComputeScalarRep(numComp2, val2[i]); // add scalar element with correct min/max - double min = opt->TmpMin, max = opt->TmpMax; - opt->TmpMin = opt->ExternalMin; - opt->TmpMax = opt->ExternalMax; + double min = opt->tmpMin, max = opt->tmpMax; + opt->tmpMin = opt->externalMin; + opt->tmpMax = opt->externalMax; addScalarElement(p, numEdges, xyz, val2, pre); - opt->TmpMin = min; - opt->TmpMax = max; + opt->tmpMin = min; + opt->tmpMax = max; // add point trajectories - if(!pre && numNodes == 1 && opt->TimeStep > 0 && opt->LineWidth){ - for(int ts = 0; ts < opt->TimeStep; ts++){ + if(!pre && numNodes == 1 && opt->timeStep > 0 && opt->lineWidth){ + for(int ts = 0; ts < opt->timeStep; ts++){ double xyz0[3], dxyz[3][2]; for(int j = 0; j < 3; j++){ data->getNode(ts, ient, iele, 0, xyz0[0], xyz0[1], xyz0[2]); @@ -852,11 +852,11 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes, norm[i] = sqrt(dxyz[0][i] * dxyz[0][i] + dxyz[1][i] * dxyz[1][i] + dxyz[2][i] * dxyz[2][i]); - col[i] = opt->getColor(norm[i], opt->TmpMin, opt->TmpMax); + col[i] = opt->getColor(norm[i], opt->tmpMin, opt->tmpMax); } for(int j = 0; j < 3; j++){ - dxyz[j][0] = xyz0[j] + dxyz[j][0] * opt->DisplacementFactor; - dxyz[j][1] = xyz0[j] + dxyz[j][1] * opt->DisplacementFactor; + dxyz[j][0] = xyz0[j] + dxyz[j][0] * opt->displacementFactor; + dxyz[j][1] = xyz0[j] + dxyz[j][1] * opt->displacementFactor; } SVector3 n[2]; getLineNormal(p, dxyz[0], dxyz[1], dxyz[2], norm, n, true); @@ -868,13 +868,13 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes, if(pre) return; - if(opt->GlyphLocation == PViewOptions::Vertex){ + if(opt->glyphLocation == PViewOptions::Vertex){ for(int i = 0; i < numNodes; i++){ double v2 = ComputeScalarRep(numComp2, val2[i]); - if(v2 >= opt->ExternalMin && v2 <= opt->ExternalMax){ - unsigned int color = opt->getColor(v2, opt->ExternalMin, opt->ExternalMax, false, - (opt->IntervalsType == PViewOptions::Discrete) ? - opt->NbIso : -1); + if(v2 >= opt->externalMin && v2 <= opt->externalMax){ + unsigned int color = opt->getColor(v2, opt->externalMin, opt->externalMax, false, + (opt->intervalsType == PViewOptions::Discrete) ? + opt->nbIso : -1); unsigned int col[2] = {color, color}; double dxyz[3][2]; for(int j = 0; j < 3; j++){ @@ -886,7 +886,7 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes, } } - if(opt->GlyphLocation == PViewOptions::COG){ + if(opt->glyphLocation == PViewOptions::COG){ SPoint3 pc(0., 0., 0.); double d[3] = {0., 0., 0.}; double d2[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.}; @@ -903,11 +903,11 @@ static void addVectorElement(PView *p, int ient, int iele, int numNodes, // need tolerance since we compare computed results (the average) // instead of the raw data used to compute bounds double v2 = ComputeScalarRep(numComp2, d2); - if(v2 >= opt->ExternalMin * (1. - 1.e-15) && - v2 <= opt->ExternalMax * (1. + 1.e-15)){ - unsigned int color = opt->getColor(v2, opt->ExternalMin, opt->ExternalMax, false, - (opt->IntervalsType == PViewOptions::Discrete) ? - opt->NbIso : -1); + if(v2 >= opt->externalMin * (1. - 1.e-15) && + v2 <= opt->externalMax * (1. + 1.e-15)){ + unsigned int color = opt->getColor(v2, opt->externalMin, opt->externalMax, false, + (opt->intervalsType == PViewOptions::Discrete) ? + opt->nbIso : -1); unsigned int col[2] = {color, color}; double dxyz[3][2]; for(int i = 0; i < 3; i++){ @@ -924,7 +924,7 @@ static void addTensorElement(PView *p, int numNodes, int numEdges, { PViewOptions *opt = p->getOptions(); - if(opt->TensorType == PViewOptions::VonMises){ + if(opt->tensorType == PViewOptions::VonMises){ for(int i = 0; i < numNodes; i++) val[i][0] = ComputeVonMises(val[i]); addScalarElement(p, numEdges, xyz, val, pre); @@ -937,33 +937,33 @@ static void addElementsInArrays(PView *p, bool preprocessNormalsOnly) PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - opt->TmpBBox.reset(); + opt->tmpBBox.reset(); double xyz[NMAX][3], val[NMAX][9]; - for(int ent = 0; ent < data->getNumEntities(opt->TimeStep); ent++){ - if(data->skipEntity(opt->TimeStep, ent)) continue; - for(int i = 0; i < data->getNumElements(opt->TimeStep, ent); i++){ - if(data->skipElement(opt->TimeStep, ent, i, true)) continue; - int numEdges = data->getNumEdges(opt->TimeStep, ent, i); + for(int ent = 0; ent < data->getNumEntities(opt->timeStep); ent++){ + if(data->skipEntity(opt->timeStep, ent)) continue; + for(int i = 0; i < data->getNumElements(opt->timeStep, ent); i++){ + if(data->skipElement(opt->timeStep, ent, i, true)) continue; + int numEdges = data->getNumEdges(opt->timeStep, ent, i); if(opt->skipElement(numEdges)) continue; - int numComp = data->getNumComponents(opt->TimeStep, ent, i); - int numNodes = data->getNumNodes(opt->TimeStep, ent, i); + int numComp = data->getNumComponents(opt->timeStep, ent, i); + int numNodes = data->getNumNodes(opt->timeStep, ent, i); for(int j = 0; j < numNodes; j++){ - data->getNode(opt->TimeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]); + data->getNode(opt->timeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]); for(int k = 0; k < numComp; k++) - data->getValue(opt->TimeStep, ent, i, j, k, val[j][k]); + data->getValue(opt->timeStep, ent, i, j, k, val[j][k]); } changeCoordinates(p, ent, i, numNodes, numEdges, numComp, xyz, val); - int dim = data->getDimension(opt->TimeStep, ent, i); + int dim = data->getDimension(opt->timeStep, ent, i); if(!isElementVisible(opt, dim, numNodes, xyz)) continue; for(int j = 0; j < numNodes; j++) - opt->TmpBBox += SPoint3(xyz[j][0], xyz[j][1], xyz[j][2]); + opt->tmpBBox += SPoint3(xyz[j][0], xyz[j][1], xyz[j][2]); - if(opt->ShowElement && !data->useGaussPoints()) + if(opt->showElement && !data->useGaussPoints()) addOutlineElement(p, numEdges, xyz, preprocessNormalsOnly); - if(opt->IntervalsType != PViewOptions::Numeric){ + if(opt->intervalsType != PViewOptions::Numeric){ if(data->useGaussPoints()){ for(int j = 0; j < numNodes; j++){ double xyz2[NMAX][3], val2[NMAX][9]; @@ -972,19 +972,19 @@ static void addElementsInArrays(PView *p, bool preprocessNormalsOnly) xyz2[0][2] = xyz[j][2]; for(int k = 0; k < numComp; k++) val2[0][k] = val[j][k]; - if(numComp == 1 && opt->DrawScalars) + if(numComp == 1 && opt->drawScalars) addScalarElement(p, 0, xyz2, val2, preprocessNormalsOnly); - else if(numComp == 3 && opt->DrawVectors) + else if(numComp == 3 && opt->drawVectors) addVectorElement(p, ent, i, 1, 0, xyz2, val2, preprocessNormalsOnly); - else if(numComp == 9 && opt->DrawTensors) + else if(numComp == 9 && opt->drawTensors) addTensorElement(p, 1, 0, xyz2, val2, preprocessNormalsOnly); } } - else if(numComp == 1 && opt->DrawScalars) + else if(numComp == 1 && opt->drawScalars) addScalarElement(p, numEdges, xyz, val, preprocessNormalsOnly); - else if(numComp == 3 && opt->DrawVectors) + else if(numComp == 3 && opt->drawVectors) addVectorElement(p, ent, i, numNodes, numEdges, xyz, val, preprocessNormalsOnly); - else if(numComp == 9 && opt->DrawTensors) + else if(numComp == 9 && opt->drawTensors) addTensorElement(p, numNodes, numEdges, xyz, val, preprocessNormalsOnly); } } @@ -998,46 +998,46 @@ static void drawArrays(drawContext *ctx, PView *p, VertexArray *va, GLint type, PViewOptions *opt = p->getOptions(); - if(CTX::instance()->polygon_offset || opt->ShowElement) + if(CTX::instance()->polygonOffset || opt->showElement) glEnable(GL_POLYGON_OFFSET_FILL); - if(type == GL_POINTS && opt->PointType > 0){ + if(type == GL_POINTS && opt->pointType > 0){ for(int i = 0; i < va->getNumVertices(); i++){ float *p = va->getVertexArray(3 * i); glColor4ubv((GLubyte *)va->getColorArray(4 * i)); double f = 1.; - if(opt->PointType > 1){ + if(opt->pointType > 1){ char *n = va->getNormalArray(3 * i); f = char2float(*n); } - if(opt->PointType == 2){ - int s = (int)(opt->PointSize * f); + if(opt->pointType == 2){ + int s = (int)(opt->pointSize * f); if(s){ glPointSize(s); - gl2psPointSize(s * CTX::instance()->print.eps_point_size_factor); + gl2psPointSize(s * CTX::instance()->print.epsPointSizeFactor); glBegin(GL_POINTS); glVertex3d(p[0], p[1], p[2]); glEnd(); } } else - ctx->drawSphere(opt->PointSize * f, p[0], p[1], p[2], opt->Light); + ctx->drawSphere(opt->pointSize * f, p[0], p[1], p[2], opt->light); } } - else if(type == GL_LINES && opt->LineType > 0){ + else if(type == GL_LINES && opt->lineType > 0){ for(int i = 0; i < va->getNumVertices(); i += 2){ float *p0 = va->getVertexArray(3 * i); float *p1 = va->getVertexArray(3 * (i + 1)); double x[2] = {p0[0], p1[0]}, y[2] = {p0[1], p1[1]}, z[2] = {p0[2], p1[2]}; glColor4ubv((GLubyte *)va->getColorArray(4 * i)); - if(opt->LineType == 2){ + if(opt->lineType == 2){ char *n0 = va->getNormalArray(3 * i); char *n1 = va->getNormalArray(3 * (i + 1)); double v0 = char2float(*n0), v1 = char2float(*n1); - ctx->drawTaperedCylinder(opt->LineWidth, v0, v1, 0., 1., x, y, z, opt->Light); + ctx->drawTaperedCylinder(opt->lineWidth, v0, v1, 0., 1., x, y, z, opt->light); } else - ctx->drawCylinder(opt->LineWidth, x, y, z, opt->Light); + ctx->drawCylinder(opt->lineWidth, x, y, z, opt->light); } } else{ @@ -1073,32 +1073,32 @@ static void drawVectorArray(drawContext *ctx, PView *p, VertexArray *va) float *v = va->getVertexArray(3 * (i + 1)); glColor4ubv((GLubyte *)va->getColorArray(4 * i)); double l = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - double lmax = opt->TmpMax; - if((l || opt->VectorType == 6) && lmax){ - double scale = (opt->ArrowSizeMax - opt->ArrowSizeMin) / lmax; + double lmax = opt->tmpMax; + if((l || opt->vectorType == 6) && lmax){ + double scale = (opt->arrowSizeMax - opt->arrowSizeMin) / lmax; // log scaling - if(opt->ScaleType == PViewOptions::Logarithmic && - opt->TmpMin > 0 && opt->TmpMax > opt->TmpMin && l != opt->TmpMin){ - scale = (opt->ArrowSizeMax - opt->ArrowSizeMin) / l * - log10(l / opt->TmpMin) / log10(opt->TmpMax / opt->TmpMin); + if(opt->scaleType == PViewOptions::Logarithmic && + opt->tmpMin > 0 && opt->tmpMax > opt->tmpMin && l != opt->tmpMin){ + scale = (opt->arrowSizeMax - opt->arrowSizeMin) / l * + log10(l / opt->tmpMin) / log10(opt->tmpMax / opt->tmpMin); } - if(opt->ArrowSizeMin && l) scale += opt->ArrowSizeMin / l; + if(opt->arrowSizeMin && l) scale += opt->arrowSizeMin / l; double px = scale * v[0]; double py = scale * v[1]; double pz = scale * v[2]; // only draw vectors larger than 1 pixel on screen, except when // drawing "comet" glyphs - if(opt->VectorType == 6 || fabs(px) > 1. || fabs(py) > 1. || fabs(pz) > 1.){ + if(opt->vectorType == 6 || fabs(px) > 1. || fabs(py) > 1. || fabs(pz) > 1.){ double d = ctx->pixel_equiv_x / ctx->s[0]; double dx = px * d, dy = py * d, dz = pz * d; double x = s[0], y = s[1], z = s[2]; - if(opt->CenterGlyphs){ + if(opt->centerGlyphs){ x -= 0.5 * dx; y -= 0.5 * dy; z -= 0.5 * dz; } - ctx->drawVector(opt->VectorType, opt->IntervalsType != PViewOptions::Iso, - x, y, z, dx, dy, dz, opt->Light); + ctx->drawVector(opt->vectorType, opt->intervalsType != PViewOptions::Iso, + x, y, z, dx, dy, dz, opt->light); } } } @@ -1128,9 +1128,9 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo PViewOptions *opt = p->getOptions(); double d[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.}; - double vmin = opt->TmpMin, vmax = opt->TmpMax; + double vmin = opt->tmpMin, vmax = opt->tmpMax; - if(opt->GlyphLocation == PViewOptions::COG){ + if(opt->glyphLocation == PViewOptions::COG){ SPoint3 pc(0., 0., 0.); for(int i = 0; i < numNodes; i++){ pc += SPoint3(xyz[i][0], xyz[i][1], xyz[i][2]); @@ -1140,26 +1140,26 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo for(int j = 0; j < numComp; j++) d[j] /= (double)numNodes; double v = ComputeScalarRep(numComp, d); if(v >= vmin && v <= vmax){ - unsigned int col = opt->getColor(v, vmin, vmax, false, opt->NbIso); + unsigned int col = opt->getColor(v, vmin, vmax, false, opt->nbIso); glColor4ubv((GLubyte *) & col); glRasterPos3d(pc.x(), pc.y(), pc.z()); - if(opt->CenterGlyphs) - ctx->drawStringCenter(stringValue(numComp, d, v, opt->Format.c_str())); + if(opt->centerGlyphs) + ctx->drawStringCenter(stringValue(numComp, d, v, opt->format.c_str())); else - ctx->drawString(stringValue(numComp, d, v, opt->Format.c_str())); + ctx->drawString(stringValue(numComp, d, v, opt->format.c_str())); } } - else if(opt->GlyphLocation == PViewOptions::Vertex){ + else if(opt->glyphLocation == PViewOptions::Vertex){ for(int i = 0; i < numNodes; i++){ double v = ComputeScalarRep(numComp, val[i]); if(v >= vmin && v <= vmax){ - unsigned int col = opt->getColor(v, vmin, vmax, false, opt->NbIso); + unsigned int col = opt->getColor(v, vmin, vmax, false, opt->nbIso); glColor4ubv((GLubyte *) & col); glRasterPos3d(xyz[i][0], xyz[i][1], xyz[i][2]); - if(opt->CenterGlyphs) - ctx->drawStringCenter(stringValue(numComp, val[i], v, opt->Format.c_str())); + if(opt->centerGlyphs) + ctx->drawStringCenter(stringValue(numComp, val[i], v, opt->format.c_str())); else - ctx->drawString(stringValue(numComp, val[i], v, opt->Format.c_str())); + ctx->drawString(stringValue(numComp, val[i], v, opt->format.c_str())); } } } @@ -1178,10 +1178,10 @@ static void drawNormalVectorGlyphs(drawContext *ctx, PView *p, int numNodes, SVector3 n = normal3(xyz); n.normalize(); for(int i = 0; i < 3; i++) - n[i] *= opt->Normals * ctx->pixel_equiv_x / ctx->s[i]; + n[i] *= opt->normals * ctx->pixel_equiv_x / ctx->s[i]; glColor4ubv((GLubyte *) & opt->color.normals); - ctx->drawVector(CTX::instance()->vector_type, 0, pc[0], pc[1], pc[2], n[0], n[1], n[2], - opt->Light); + ctx->drawVector(CTX::instance()->vectorType, 0, pc[0], pc[1], pc[2], n[0], n[1], n[2], + opt->light); } static void drawTangentVectorGlyphs(drawContext *ctx, PView *p, int numNodes, @@ -1195,10 +1195,10 @@ static void drawTangentVectorGlyphs(drawContext *ctx, PView *p, int numNodes, SVector3 t(p0, p1); t.normalize(); for(int i = 0; i < 3; i++) - t[i] *= opt->Tangents * ctx->pixel_equiv_x / ctx->s[i]; + t[i] *= opt->tangents * ctx->pixel_equiv_x / ctx->s[i]; glColor4ubv((GLubyte *) & opt->color.tangents); - ctx->drawVector(CTX::instance()->vector_type, 0, pc[0], pc[1], pc[2], t[0], t[1], t[2], - opt->Light); + ctx->drawVector(CTX::instance()->vectorType, 0, pc[0], pc[1], pc[2], t[0], t[1], t[2], + opt->light); } static void drawGlyphs(drawContext *ctx, PView *p) @@ -1207,32 +1207,32 @@ static void drawGlyphs(drawContext *ctx, PView *p) PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - if(!opt->Normals && !opt->Tangents && opt->IntervalsType != PViewOptions::Numeric) + if(!opt->normals && !opt->tangents && opt->intervalsType != PViewOptions::Numeric) return; Msg::Debug("drawing extra glyphs (this is slow...)"); double xyz[NMAX][3], val[NMAX][9]; - for(int ent = 0; ent < data->getNumEntities(opt->TimeStep); ent++){ - if(data->skipEntity(opt->TimeStep, ent)) continue; - for(int i = 0; i < data->getNumElements(opt->TimeStep, ent); i++){ - if(data->skipElement(opt->TimeStep, ent, i, true)) continue; - int numEdges = data->getNumEdges(opt->TimeStep, ent, i); + for(int ent = 0; ent < data->getNumEntities(opt->timeStep); ent++){ + if(data->skipEntity(opt->timeStep, ent)) continue; + for(int i = 0; i < data->getNumElements(opt->timeStep, ent); i++){ + if(data->skipElement(opt->timeStep, ent, i, true)) continue; + int numEdges = data->getNumEdges(opt->timeStep, ent, i); if(opt->skipElement(numEdges)) continue; - int dim = data->getDimension(opt->TimeStep, ent, i); - int numComp = data->getNumComponents(opt->TimeStep, ent, i); - int numNodes = data->getNumNodes(opt->TimeStep, ent, i); + int dim = data->getDimension(opt->timeStep, ent, i); + int numComp = data->getNumComponents(opt->timeStep, ent, i); + int numNodes = data->getNumNodes(opt->timeStep, ent, i); for(int j = 0; j < numNodes; j++){ - data->getNode(opt->TimeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]); + data->getNode(opt->timeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]); for(int k = 0; k < numComp; k++) - data->getValue(opt->TimeStep, ent, i, j, k, val[j][k]); + data->getValue(opt->timeStep, ent, i, j, k, val[j][k]); } changeCoordinates(p, ent, i, numNodes, numEdges, numComp, xyz, val); - if(opt->IntervalsType == PViewOptions::Numeric) + if(opt->intervalsType == PViewOptions::Numeric) drawNumberGlyphs(ctx, p, numNodes, numComp, xyz, val); - if(dim == 2 && opt->Normals) + if(dim == 2 && opt->normals) drawNormalVectorGlyphs(ctx, p, numNodes, xyz, val); - else if(dim == 1 && opt->Tangents) + else if(dim == 1 && opt->tangents) drawTangentVectorGlyphs(ctx, p, numNodes, xyz, val); } } @@ -1245,11 +1245,11 @@ class initPView { // on Windows/Cygwin int _estimateIfClipped(PView *p, int num) { - if(CTX::instance()->clip_whole_elements && - CTX::instance()->clip_only_draw_intersecting_volume){ + if(CTX::instance()->clipWholeElements && + CTX::instance()->clipOnlyDrawIntersectingVolume){ PViewOptions *opt = p->getOptions(); for(int clip = 0; clip < 6; clip++){ - if(opt->Clip & (1 << clip)) + if(opt->clip & (1 << clip)) return (int)sqrt((double)num); } } @@ -1259,33 +1259,33 @@ class initPView { { PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - int heuristic = data->getNumPoints(opt->TimeStep); + int heuristic = data->getNumPoints(opt->timeStep); return heuristic + 10000; } int _estimateNumLines(PView *p) { PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - int heuristic = data->getNumLines(opt->TimeStep); + int heuristic = data->getNumLines(opt->timeStep); return heuristic + 10000; } int _estimateNumTriangles(PView *p) { PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - int tris = data->getNumTriangles(opt->TimeStep); - int quads = data->getNumQuadrangles(opt->TimeStep); - int tets = data->getNumTetrahedra(opt->TimeStep); - int prisms = data->getNumPrisms(opt->TimeStep); - int pyrs = data->getNumPyramids(opt->TimeStep); - int hexas = data->getNumHexahedra(opt->TimeStep); + int tris = data->getNumTriangles(opt->timeStep); + int quads = data->getNumQuadrangles(opt->timeStep); + int tets = data->getNumTetrahedra(opt->timeStep); + int prisms = data->getNumPrisms(opt->timeStep); + int pyrs = data->getNumPyramids(opt->timeStep); + int hexas = data->getNumHexahedra(opt->timeStep); int heuristic = 0; - if(opt->IntervalsType == PViewOptions::Iso) + if(opt->intervalsType == PViewOptions::Iso) heuristic = (tets + prisms + pyrs + hexas) / 10; - else if(opt->IntervalsType == PViewOptions::Continuous) + else if(opt->intervalsType == PViewOptions::Continuous) heuristic = (tris + 2 * quads + 6 * tets + 8 * prisms + 6 * pyrs + 12 * hexas); - else if(opt->IntervalsType == PViewOptions::Discrete) + else if(opt->intervalsType == PViewOptions::Discrete) heuristic = (tris + 2 * quads + 6 * tets + 8 * prisms + 6 * pyrs + 12 * hexas) * 2; heuristic = _estimateIfClipped(p, heuristic); @@ -1295,7 +1295,7 @@ class initPView { { PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - int heuristic = data->getNumVectors(opt->TimeStep); + int heuristic = data->getNumVectors(opt->timeStep); heuristic = _estimateIfClipped(p, heuristic); return heuristic + 1000; } @@ -1307,23 +1307,23 @@ class initPView { PViewOptions *opt = p->getOptions(); if(data->getDirty() || !data->getNumTimeSteps() || !p->getChanged()) return; - if(!opt->Visible || opt->Type != PViewOptions::Plot3D) return; + if(!opt->visible || opt->type != PViewOptions::Plot3D) return; - if(opt->UseGenRaise) opt->createGeneralRaise(); + if(opt->useGenRaise) opt->createGeneralRaise(); - if(opt->RangeType == PViewOptions::Custom){ - opt->TmpMin = opt->CustomMin; - opt->TmpMax = opt->CustomMax; + if(opt->rangeType == PViewOptions::Custom){ + opt->tmpMin = opt->customMin; + opt->tmpMax = opt->customMax; } - else if(opt->RangeType == PViewOptions::PerTimeStep){ - opt->TmpMin = data->getMin(opt->TimeStep); - opt->TmpMax = data->getMax(opt->TimeStep); + else if(opt->rangeType == PViewOptions::PerTimeStep){ + opt->tmpMin = data->getMin(opt->timeStep); + opt->tmpMax = data->getMax(opt->timeStep); } else{ // FIXME: this is not perfect for multi-step adaptive views, as // we don't have the correct min/max info for the other steps - opt->TmpMin = data->getMin(); - opt->TmpMax = data->getMax(); + opt->tmpMin = data->getMin(); + opt->tmpMax = data->getMax(); } p->deleteVertexArrays(); @@ -1333,9 +1333,9 @@ class initPView { p->va_vectors = new VertexArray(2, _estimateNumVectors(p)); if(p->normals) delete p->normals; - p->normals = new smooth_normals(opt->AngleSmoothNormals); + p->normals = new smooth_normals(opt->angleSmoothNormals); - if(opt->SmoothNormals) addElementsInArrays(p, true); + if(opt->smoothNormals) addElementsInArrays(p, true); addElementsInArrays(p, false); p->va_points->finalize(); @@ -1374,30 +1374,30 @@ class drawPView { PViewOptions *opt = p->getOptions(); if(data->getDirty() || !data->getNumTimeSteps()) return; - if(!opt->Visible || opt->Type != PViewOptions::Plot3D) return; + if(!opt->visible || opt->type != PViewOptions::Plot3D) return; if(!_ctx->isVisible(p)) return; - glPointSize(opt->PointSize); - gl2psPointSize(opt->PointSize * CTX::instance()->print.eps_point_size_factor); + glPointSize(opt->pointSize); + gl2psPointSize(opt->pointSize * CTX::instance()->print.epsPointSizeFactor); - glLineWidth(opt->LineWidth); - gl2psLineWidth(opt->LineWidth * CTX::instance()->print.eps_line_width_factor); + glLineWidth(opt->lineWidth); + gl2psLineWidth(opt->lineWidth * CTX::instance()->print.epsLineWidthFactor); - if(opt->LightTwoSide) + if(opt->lightTwoSide) glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); - if(!CTX::instance()->clip_whole_elements){ + if(!CTX::instance()->clipWholeElements){ for(int i = 0; i < 6; i++) - if(opt->Clip & (1 << i)) + if(opt->clip & (1 << i)) glEnable((GLenum)(GL_CLIP_PLANE0 + i)); else glDisable((GLenum)(GL_CLIP_PLANE0 + i)); } - if(CTX::instance()->alpha && ColorTable_IsAlpha(&opt->CT)){ - if(opt->FakeTransparency){ + if(CTX::instance()->alpha && ColorTable_IsAlpha(&opt->colorTable)){ + if(opt->fakeTransparency){ // simple additive blending "a la xpost": glBlendFunc(GL_SRC_ALPHA, GL_ONE); // glBlendEquation(GL_FUNC_ADD); // maximum intensity projection "a la volsuite": @@ -1417,25 +1417,25 @@ class drawPView { } } - if(opt->RangeType == PViewOptions::Custom){ - opt->TmpMin = opt->CustomMin; - opt->TmpMax = opt->CustomMax; + if(opt->rangeType == PViewOptions::Custom){ + opt->tmpMin = opt->customMin; + opt->tmpMax = opt->customMax; } - else if(opt->RangeType == PViewOptions::PerTimeStep){ - opt->TmpMin = data->getMin(opt->TimeStep); - opt->TmpMax = data->getMax(opt->TimeStep); + else if(opt->rangeType == PViewOptions::PerTimeStep){ + opt->tmpMin = data->getMin(opt->timeStep); + opt->tmpMax = data->getMax(opt->timeStep); } else{ // FIXME: this is not perfect for multi-step adaptive views, as // we don't have the correct min/max info for the other steps - opt->TmpMin = data->getMin(); - opt->TmpMax = data->getMax(); + opt->tmpMin = data->getMin(); + opt->tmpMax = data->getMax(); } // draw all the vertex arrays drawArrays(_ctx, p, p->va_points, GL_POINTS, false); - drawArrays(_ctx, p, p->va_lines, GL_LINES, opt->Light && opt->LightLines); - drawArrays(_ctx, p, p->va_triangles, GL_TRIANGLES, opt->Light); + drawArrays(_ctx, p, p->va_lines, GL_LINES, opt->light && opt->lightLines); + drawArrays(_ctx, p, p->va_triangles, GL_TRIANGLES, opt->light); // draw the "pseudo" vertex arrays for vectors drawVectorArray(_ctx, p, p->va_vectors); @@ -1445,12 +1445,12 @@ class drawPView { drawGlyphs(_ctx, p); // draw the 3D strings - if(opt->DrawStrings){ + if(opt->drawStrings){ glColor4ubv((GLubyte *) & opt->color.text3d); for(int i = 0; i < data->getNumStrings3D(); i++){ double x, y, z, style; std::string str; - data->getString3D(i, opt->TimeStep, str, x, y, z, style); + data->getString3D(i, opt->timeStep, str, x, y, z, style); glRasterPos3d(x, y, z); _ctx->drawString(str, style); } @@ -1464,17 +1464,17 @@ class drawPView { for(int i = 0; i < 6; i++) glDisable((GLenum)(GL_CLIP_PLANE0 + i)); - if(opt->Axes && opt->Type == PViewOptions::Plot3D){ + if(opt->axes && opt->type == PViewOptions::Plot3D){ glColor4ubv((GLubyte *) & opt->color.axes); - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); - if(!opt->AxesAutoPosition) - _ctx->drawAxes(opt->Axes, opt->AxesTics, opt->AxesFormat, opt->AxesLabel, - opt->AxesPosition, opt->AxesMikado); - else if(!opt->TmpBBox.empty()) - _ctx->drawAxes(opt->Axes, opt->AxesTics, opt->AxesFormat, opt->AxesLabel, - opt->TmpBBox, opt->AxesMikado); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); + if(!opt->axesAutoPosition) + _ctx->drawAxes(opt->axes, opt->axesTics, opt->axesFormat, opt->axesLabel, + opt->axesPosition, opt->axesMikado); + else if(!opt->tmpBBox.empty()) + _ctx->drawAxes(opt->axes, opt->axesTics, opt->axesFormat, opt->axesLabel, + opt->tmpBBox, opt->axesMikado); } } @@ -1490,39 +1490,39 @@ class drawPViewBoundingBox { PViewData *data = p->getData(); PViewOptions *opt = p->getOptions(); - if(!opt->Visible || opt->Type != PViewOptions::Plot3D) return; + if(!opt->visible || opt->type != PViewOptions::Plot3D) return; - SBoundingBox3d bb = data->getBoundingBox(opt->TimeStep); + SBoundingBox3d bb = data->getBoundingBox(opt->timeStep); if(bb.empty()) return; glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glLineWidth(CTX::instance()->line_width); - gl2psLineWidth(CTX::instance()->line_width * - CTX::instance()->print.eps_line_width_factor); + glLineWidth(CTX::instance()->lineWidth); + gl2psLineWidth(CTX::instance()->lineWidth * + CTX::instance()->print.epsLineWidthFactor); _ctx->drawBox(bb.min().x(), bb.min().y(), bb.min().z(), bb.max().x(), bb.max().y(), bb.max().z()); glColor3d(1., 0., 0.); for(int i = 0; i < 6; i++) - if(opt->Clip & (1 << i)) + if(opt->clip & (1 << i)) _ctx->drawPlaneInBoundingBox(bb.min().x(), bb.min().y(), bb.min().z(), bb.max().x(), bb.max().y(), bb.max().z(), - CTX::instance()->clip_plane[i][0], - CTX::instance()->clip_plane[i][1], - CTX::instance()->clip_plane[i][2], - CTX::instance()->clip_plane[i][3]); + CTX::instance()->clipPlane[i][0], + CTX::instance()->clipPlane[i][1], + CTX::instance()->clipPlane[i][2], + CTX::instance()->clipPlane[i][3]); } }; void drawContext::drawPost() { // draw any plugin-specific stuff - if(CTX::instance()->post.plugin_draw_function) - (*CTX::instance()->post.plugin_draw_function)(this); + if(CTX::instance()->post.pluginDrawFunction) + (*CTX::instance()->post.pluginDrawFunction)(this); if(PView::list.empty()) return; - if(CTX::instance()->draw_bbox || !CTX::instance()->post.draw) + if(CTX::instance()->drawBBox || !CTX::instance()->post.draw) std::for_each(PView::list.begin(), PView::list.end(), drawPViewBoundingBox(this)); if(!CTX::instance()->post.draw) return; diff --git a/Graphics/drawScales.cpp b/Graphics/drawScales.cpp index 66190d4e390aacab5fb835c23d5d46eec2d8cf2b..7c11b5bcb2afdbbb5b1fa5ac0b8bd6fa6fa3fe58 100644 --- a/Graphics/drawScales.cpp +++ b/Graphics/drawScales.cpp @@ -16,12 +16,12 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width, { PViewOptions *opt = p->getOptions(); - double box = (horizontal ? width : height) / (opt->NbIso ? opt->NbIso : 1); + double box = (horizontal ? width : height) / (opt->nbIso ? opt->nbIso : 1); - for(int i = 0; i < opt->NbIso; i++) { - if(opt->IntervalsType == PViewOptions::Discrete || - opt->IntervalsType == PViewOptions::Numeric){ - unsigned int col = opt->getColor(i, opt->NbIso); + for(int i = 0; i < opt->nbIso; i++) { + if(opt->intervalsType == PViewOptions::Discrete || + opt->intervalsType == PViewOptions::Numeric){ + unsigned int col = opt->getColor(i, opt->nbIso); glColor4ubv((GLubyte *) &col); glBegin(GL_QUADS); if(horizontal){ @@ -38,11 +38,11 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width, } glEnd(); } - else if(opt->IntervalsType == PViewOptions::Continuous){ + else if(opt->intervalsType == PViewOptions::Continuous){ glBegin(GL_QUADS); - double dv = (opt->TmpMax - opt->TmpMin) / (opt->NbIso ? opt->NbIso : 1); - double v1 = opt->TmpMin + i * dv; - unsigned int col1 = opt->getColor(v1, opt->TmpMin, opt->TmpMax, true); + double dv = (opt->tmpMax - opt->tmpMin) / (opt->nbIso ? opt->nbIso : 1); + double v1 = opt->tmpMin + i * dv; + unsigned int col1 = opt->getColor(v1, opt->tmpMin, opt->tmpMax, true); glColor4ubv((GLubyte *) &col1); if(horizontal){ glVertex2d(xmin + i * box, ymin + height); @@ -52,8 +52,8 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width, glVertex2d(xmin, ymin + i * box); glVertex2d(xmin + width, ymin + i * box); } - double v2 = opt->TmpMin + (i + 1) * dv; - unsigned int col2 = opt->getColor(v2, opt->TmpMin, opt->TmpMax, true); + double v2 = opt->tmpMin + (i + 1) * dv; + unsigned int col2 = opt->getColor(v2, opt->tmpMin, opt->tmpMax, true); glColor4ubv((GLubyte *) &col2); if(horizontal){ glVertex2d(xmin + (i + 1) * box, ymin); @@ -66,7 +66,7 @@ static void drawScaleBar(PView *p, double xmin, double ymin, double width, glEnd(); } else{ - unsigned int col = opt->getColor(i, opt->NbIso); + unsigned int col = opt->getColor(i, opt->nbIso); glColor4ubv((GLubyte *) &col); glBegin(GL_LINES); if(horizontal){ @@ -87,20 +87,20 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin { PViewOptions *opt = p->getOptions(); - if(!opt->NbIso) return; + if(!opt->nbIso) return; - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); double font_h = gl_height(); // total font height double font_a = gl_height() - gl_descent(); // height above ref pt char label[1024]; - sprintf(label, opt->Format.c_str(), -M_PI * 1.e-4); + sprintf(label, opt->format.c_str(), -M_PI * 1.e-4); double maxw = gl_width(label); - int nbv = opt->NbIso; - double f = (opt->IntervalsType == PViewOptions::Discrete || - opt->IntervalsType == PViewOptions::Numeric || - opt->IntervalsType == PViewOptions::Continuous) ? 2 : 2.5; + int nbv = opt->nbIso; + double f = (opt->intervalsType == PViewOptions::Discrete || + opt->intervalsType == PViewOptions::Numeric || + opt->intervalsType == PViewOptions::Continuous) ? 2 : 2.5; if(horizontal && width < nbv * maxw){ if(width < f * maxw) nbv = 1; @@ -111,17 +111,17 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin else nbv = 2; } - double box = (horizontal ? width : height) / opt->NbIso; + double box = (horizontal ? width : height) / opt->nbIso; double vbox = (horizontal ? width : height) / nbv; glColor4ubv((GLubyte *) & CTX::instance()->color.text); - if(opt->IntervalsType == PViewOptions::Discrete || - opt->IntervalsType == PViewOptions::Numeric || - opt->IntervalsType == PViewOptions::Continuous){ + if(opt->intervalsType == PViewOptions::Discrete || + opt->intervalsType == PViewOptions::Numeric || + opt->intervalsType == PViewOptions::Continuous){ for(int i = 0; i < nbv + 1; i++) { - double v = opt->getScaleValue(i, nbv + 1, opt->TmpMin, opt->TmpMax); - sprintf(label, opt->Format.c_str(), v); + double v = opt->getScaleValue(i, nbv + 1, opt->tmpMin, opt->tmpMax); + sprintf(label, opt->format.c_str(), v); if(horizontal){ glRasterPos2d(xmin + i * vbox, ymin + height + tic); ctx->drawStringCenter(label); @@ -133,13 +133,13 @@ static void drawScaleValues(drawContext *ctx, PView *p, double xmin, double ymin } } else{ - if(opt->NbIso > 2 && (nbv == 1 || nbv == 2)){ + if(opt->nbIso > 2 && (nbv == 1 || nbv == 2)){ vbox = (vbox * nbv - box) / nbv; nbv++; } for(int i = 0; i < nbv; i++) { - double v = opt->getScaleValue(i, nbv, opt->TmpMin, opt->TmpMax); - sprintf(label, opt->Format.c_str(), v); + double v = opt->getScaleValue(i, nbv, opt->tmpMin, opt->tmpMax); + sprintf(label, opt->format.c_str(), v); if(horizontal){ glRasterPos2d(xmin + box / 2. + i * vbox, ymin + height + tic); ctx->drawStringCenter(label); @@ -158,19 +158,19 @@ static void drawScaleLabel(drawContext *ctx, PView *p, double xmin, double ymin, PViewData *data = p->getData(); PViewOptions *opt = p->getOptions(); - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); double font_h = gl_height(); char label[1024]; int nt = data->getNumTimeSteps(); - if((opt->ShowTime == 1 && nt > 1) || opt->ShowTime == 2){ + if((opt->showTime == 1 && nt > 1) || opt->showTime == 2){ char tmp[256]; - sprintf(tmp, opt->Format.c_str(), data->getTime(opt->TimeStep)); + sprintf(tmp, opt->format.c_str(), data->getTime(opt->timeStep)); sprintf(label, "%s (%s)", data->getName().c_str(), tmp); } - else if((opt->ShowTime == 3 && nt > 1) || opt->ShowTime == 4){ - sprintf(label, "%s (%d)", data->getName().c_str(), opt->TimeStep); + else if((opt->showTime == 3 && nt > 1) || opt->showTime == 4){ + sprintf(label, "%s (%d)", data->getName().c_str(), opt->timeStep); } else sprintf(label, "%s", data->getName().c_str()); @@ -192,21 +192,21 @@ static void drawScale(drawContext *ctx, PView *p, double xmin, double ymin, PViewData *data = p->getData(true); PViewOptions *opt = p->getOptions(); - if(opt->ExternalViewIndex >= 0){ - opt->TmpMin = opt->ExternalMin; - opt->TmpMax = opt->ExternalMax; + if(opt->externalViewIndex >= 0){ + opt->tmpMin = opt->externalMin; + opt->tmpMax = opt->externalMax; } - else if(opt->RangeType == PViewOptions::Custom){ - opt->TmpMin = opt->CustomMin; - opt->TmpMax = opt->CustomMax; + else if(opt->rangeType == PViewOptions::Custom){ + opt->tmpMin = opt->customMin; + opt->tmpMax = opt->customMax; } - else if(opt->RangeType == PViewOptions::PerTimeStep){ - opt->TmpMin = data->getMin(opt->TimeStep); - opt->TmpMax = data->getMax(opt->TimeStep); + else if(opt->rangeType == PViewOptions::PerTimeStep){ + opt->tmpMin = data->getMin(opt->timeStep); + opt->tmpMax = data->getMax(opt->timeStep); } else{ - opt->TmpMin = data->getMin(); - opt->TmpMax = data->getMax(); + opt->tmpMin = data->getMin(); + opt->tmpMax = data->getMax(); } drawScaleBar(p, xmin, ymin, width, height, tic, horizontal); @@ -220,19 +220,19 @@ void drawContext::drawScales() for(unsigned int i = 0; i < PView::list.size(); i++){ PViewData *data = PView::list[i]->getData(); PViewOptions *opt = PView::list[i]->getOptions(); - if(!data->getDirty() && opt->Visible && opt->ShowScale && - opt->Type == PViewOptions::Plot3D && data->getNumElements() && + if(!data->getDirty() && opt->visible && opt->showScale && + opt->type == PViewOptions::Plot3D && data->getNumElements() && isVisible(PView::list[i])) scales.push_back(PView::list[i]); } if(scales.empty()) return; - gl_font(CTX::instance()->gl_font_enum, CTX::instance()->gl_fontsize); + gl_font(CTX::instance()->glFontEnum, CTX::instance()->glFontSize); char label[1024]; double maxw = 0.; for(unsigned int i = 0; i < scales.size(); i++) { PViewOptions *opt = scales[i]->getOptions(); - sprintf(label, opt->Format.c_str(), -M_PI * 1.e-4); + sprintf(label, opt->format.c_str(), -M_PI * 1.e-4); maxw = std::max(maxw, gl_width(label)); } @@ -244,15 +244,15 @@ void drawContext::drawScales() PViewData *data = p->getData(); PViewOptions *opt = p->getOptions(); - if(!opt->AutoPosition) { - double w = opt->Size[0], h = opt->Size[1]; - double x = opt->Position[0], y = opt->Position[1] - h; + if(!opt->autoPosition) { + double w = opt->size[0], h = opt->size[1]; + double x = opt->position[0], y = opt->position[1] - h; int c = fix2dCoordinates(&x, &y); if(c & 1) x -= w / 2.; if(c & 2) y += h / 2.; - drawScale(this, p, x, y, w, h, tic, CTX::instance()->post.horizontal_scales); + drawScale(this, p, x, y, w, h, tic, CTX::instance()->post.horizontalScales); } - else if(CTX::instance()->post.horizontal_scales){ + else if(CTX::instance()->post.horizontalScales){ double ysep = 20.; double xc = (viewport[2] - viewport[0]) / 2.; if(scales.size() == 1){ @@ -290,11 +290,11 @@ void drawContext::drawScales() } // compute width width_prev = width; - sprintf(label, opt->Format.c_str(), -M_PI * 1.e-4); + sprintf(label, opt->format.c_str(), -M_PI * 1.e-4); width = bar_size + tic + gl_width(label); - if(opt->ShowTime){ + if(opt->showTime){ char tmp[256]; - sprintf(tmp, opt->Format.c_str(), data->getTime(opt->TimeStep)); + sprintf(tmp, opt->format.c_str(), data->getTime(opt->timeStep)); sprintf(label, "%s (%s)", data->getName().c_str(), tmp); } else diff --git a/Makefile b/Makefile index 5c6bc60583f9ab80d31831a07fc545cb9b9fc131..d4bba67ea30ea657c46a84f96d1dc33c6feee670 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ include variables GMSH_MAJOR_VERSION = 2 GMSH_MINOR_VERSION = 3 -GMSH_PATCH_VERSION = 0 +GMSH_PATCH_VERSION = 1 GMSH_EXTRA_VERSION = GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} @@ -235,8 +235,7 @@ tags: htags etags: - etags `find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h"\ - -o -name "*.y" -o -name "*.l" \)` + etags `find . \( -name "*.cpp" -o -name "*.h" -o -name "*.y" -o -name "*.l" \)` # Rules to package the sources diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp index f872514ddbe8feff1832ea45262a557ece675b7e..37f0230340f46e2bac13c2cbf42d86e2fe8037e4 100644 --- a/Mesh/BackgroundMesh.cpp +++ b/Mesh/BackgroundMesh.cpp @@ -15,7 +15,7 @@ // computes the characteristic length of the mesh at a vertex in order // to have the geometry captured with accuracy. A parameter called -// CTX::instance()->mesh.min_circ_points tells the minimum number of points per +// CTX::instance()->mesh.minCircPoints tells the minimum number of points per // radius of curvature static double max_edge_curvature(const GVertex *gv) @@ -95,7 +95,7 @@ static double LC_MVertex_CURV(GEntity *ge, double U, double V) break; } - double lc = Crv > 0 ? 2 * M_PI / Crv / CTX::instance()->mesh.min_circ_points : MAX_LC; + double lc = Crv > 0 ? 2 * M_PI / Crv / CTX::instance()->mesh.minCircPoints : MAX_LC; return lc; } @@ -142,12 +142,12 @@ double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double // lc from points double l2 = MAX_LC; - if(CTX::instance()->mesh.lc_from_points && ge->dim() < 2) + if(CTX::instance()->mesh.lcFromPoints && ge->dim() < 2) l2 = LC_MVertex_PNTS(ge, U, V); // lc from curvature double l3 = MAX_LC; - if(CTX::instance()->mesh.lc_from_curvature && ge->dim() < 3) + if(CTX::instance()->mesh.lcFromCurvature && ge->dim() < 3) l3 = LC_MVertex_CURV(ge, U, V); // lc from fields @@ -158,26 +158,26 @@ double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double if(f) l4 = (*f)(X, Y, Z, ge); } - // take the minimum, then contrain by lc_min and lc_max + // take the minimum, then contrain by lcMin and lcMax double lc = std::min(std::min(std::min(l1, l2), l3), l4); - lc = std::max(lc, CTX::instance()->mesh.lc_min); - lc = std::min(lc, CTX::instance()->mesh.lc_max); + lc = std::max(lc, CTX::instance()->mesh.lcMin); + lc = std::min(lc, CTX::instance()->mesh.lcMax); if(lc <= 0.){ Msg::Error("Wrong characteristic length lc = %g (lcmin = %g, lcmax = %g)", - lc, CTX::instance()->mesh.lc_min, CTX::instance()->mesh.lc_max); + lc, CTX::instance()->mesh.lcMin, CTX::instance()->mesh.lcMax); lc = l1; } - return lc * CTX::instance()->mesh.lc_factor; + return lc * CTX::instance()->mesh.lcFactor; } bool Extend1dMeshIn2dSurfaces() { - return CTX::instance()->mesh.lc_extend_from_boundary ? true : false; + return CTX::instance()->mesh.lcExtendFromBoundary ? true : false; } bool Extend2dMeshIn3dVolumes() { - return CTX::instance()->mesh.lc_extend_from_boundary ? true : false; + return CTX::instance()->mesh.lcExtendFromBoundary ? true : false; } diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 5b81d954f02eebba948adb9b330b6964200421fb..c54768843a4c75c423331a3019787d7f9ce64aac 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -196,9 +196,9 @@ void GetStatistics(double stat[50], double quality[4][100]) stat[12] += (*it)->pyramids.size(); } - stat[13] = CTX::instance()->mesh_timer[0]; - stat[14] = CTX::instance()->mesh_timer[1]; - stat[15] = CTX::instance()->mesh_timer[2]; + stat[13] = CTX::instance()->meshTimer[0]; + stat[14] = CTX::instance()->meshTimer[1]; + stat[15] = CTX::instance()->meshTimer[2]; if(quality){ for(int i = 0; i < 3; i++) @@ -268,14 +268,14 @@ void GetStatistics(double stat[50], double quality[4][100]) static bool TooManyElements(GModel *m, int dim) { - if(CTX::instance()->expert_mode || !m->getNumVertices()) return false; + if(CTX::instance()->expertMode || !m->getNumVertices()) return false; // try to detect obvious mistakes in characteristic lenghts (one of // the most common cause for erroneous bug reports on the mailing // list) double sumAllLc = 0.; for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); ++it) - sumAllLc += (*it)->prescribedMeshSizeAtVertex() * CTX::instance()->mesh.lc_factor; + sumAllLc += (*it)->prescribedMeshSizeAtVertex() * CTX::instance()->mesh.lcFactor; sumAllLc /= (double)m->getNumVertices(); if(!sumAllLc || pow(CTX::instance()->lc / sumAllLc, dim) > 1.e10) return !Msg::GetBinaryAnswer @@ -289,7 +289,7 @@ static bool TooManyElements(GModel *m, int dim) static bool CancelDelaunayHybrid(GModel *m) { - if(CTX::instance()->expert_mode) return false; + if(CTX::instance()->expertMode) return false; int n = 0; for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it) n += (*it)->getNumMeshElements(); @@ -314,18 +314,18 @@ static void Mesh1D(GModel *m) std::for_each(m->firstEdge(), m->lastEdge(), meshGEdge()); double t2 = Cpu(); - CTX::instance()->mesh_timer[0] = t2 - t1; - Msg::Info("Mesh 1D complete (%g s)", CTX::instance()->mesh_timer[0]); + CTX::instance()->meshTimer[0] = t2 - t1; + Msg::Info("Mesh 1D complete (%g s)", CTX::instance()->meshTimer[0]); Msg::StatusBar(1, false, "Mesh"); } static void PrintMesh2dStatistics(GModel *m) { FILE *statreport = 0; - if(CTX::instance()->create_append_statreport == 1) - statreport = fopen(CTX::instance()->statreport.c_str(), "w"); - else if(CTX::instance()->create_append_statreport == 2) - statreport = fopen(CTX::instance()->statreport.c_str(), "a"); + if(CTX::instance()->createAppendMeshStatReport == 1) + statreport = fopen(CTX::instance()->meshStatReportFileName.c_str(), "w"); + else if(CTX::instance()->createAppendMeshStatReport == 2) + statreport = fopen(CTX::instance()->meshStatReportFileName.c_str(), "a"); else return; double worst = 1, best = 0, avg = 0; @@ -350,7 +350,7 @@ static void PrintMesh2dStatistics(GModel *m) numFaces++; } - if(CTX::instance()->create_append_statreport == 1){ + if(CTX::instance()->createAppendMeshStatReport == 1){ fprintf(statreport, "2D stats\tname\t\t#faces\t\t#fail\t\t" "#t\t\tQavg\t\tQbest\t\tQworst\t\t#Q>90\t\t#Q>90/#t\t" "#e\t\ttau\t\t#Egood\t\t#Egood/#e\tCPU\n"); @@ -362,7 +362,7 @@ static void PrintMesh2dStatistics(GModel *m) (double)nTotGoodQuality / nTotT); fprintf(statreport,"%d\t\t%8.7f\t%d\t\t%8.7f\t%8.1f\n", nTotE, exp(e_avg / (double)nTotE), nTotGoodLength, - (double)nTotGoodLength / nTotE, CTX::instance()->mesh_timer[1]); + (double)nTotGoodLength / nTotE, CTX::instance()->meshTimer[1]); fclose(statreport); } @@ -370,8 +370,8 @@ static void Mesh2D(GModel *m) { if(TooManyElements(m, 2)) return; - if(!CTX::instance()->expert_mode && (CTX::instance()->mesh.algo2d == ALGO_2D_DELAUNAY || - CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL)){ + if(!CTX::instance()->expertMode && (CTX::instance()->mesh.algo2d == ALGO_2D_DELAUNAY || + CTX::instance()->mesh.algo2d == ALGO_2D_FRONTAL)){ if(!Msg::GetBinaryAnswer ("The 2D Delaunay and Frontal algorithms are still experimental\n" "and produce triangles with random orientations. Do you really\n" @@ -410,8 +410,8 @@ static void Mesh2D(GModel *m) // gmshCollapseSmallEdges (*m); double t2 = Cpu(); - CTX::instance()->mesh_timer[1] = t2 - t1; - Msg::Info("Mesh 2D complete (%g s)", CTX::instance()->mesh_timer[1]); + CTX::instance()->meshTimer[1] = t2 - t1; + Msg::Info("Mesh 2D complete (%g s)", CTX::instance()->meshTimer[1]); Msg::StatusBar(1, false, "Mesh"); PrintMesh2dStatistics(m); @@ -453,8 +453,8 @@ static void Mesh3D(GModel *m) MeshDelaunayVolume(connected[i]); double t2 = Cpu(); - CTX::instance()->mesh_timer[2] = t2 - t1; - Msg::Info("Mesh 3D complete (%g s)", CTX::instance()->mesh_timer[2]); + CTX::instance()->meshTimer[2] = t2 - t1; + Msg::Info("Mesh 3D complete (%g s)", CTX::instance()->meshTimer[2]); Msg::StatusBar(1, false, "Mesh"); } @@ -487,12 +487,12 @@ void AdaptMesh(GModel *m) Msg::StatusBar(1, true, "Adapting 3D Mesh..."); double t1 = Cpu(); - if(CTX::instance()->threads_lock) { + if(CTX::instance()->lock) { Msg::Info("I'm busy! Ask me that later..."); return; } - CTX::instance()->threads_lock = 1; + CTX::instance()->lock = 1; std::for_each(m->firstRegion(), m->lastRegion(), adaptMeshGRegion()); std::for_each(m->firstRegion(), m->lastRegion(), adaptMeshGRegion()); @@ -512,11 +512,11 @@ void AdaptMesh(GModel *m) void GenerateMesh(GModel *m, int ask) { - if(CTX::instance()->threads_lock) { + if(CTX::instance()->lock) { Msg::Info("I'm busy! Ask me that later..."); return; } - CTX::instance()->threads_lock = 1; + CTX::instance()->lock = 1; Msg::ResetErrorCounter(); @@ -552,28 +552,29 @@ void GenerateMesh(GModel *m, int ask) // Optimize quality of 3D tet mesh if(m->getMeshStatus() == 3){ - for(int i = 0; i < std::max(CTX::instance()->mesh.optimize, CTX::instance()->mesh.optimize_netgen); i++){ + for(int i = 0; i < std::max(CTX::instance()->mesh.optimize, + CTX::instance()->mesh.optimizeNetgen); i++){ if(CTX::instance()->mesh.optimize > i) OptimizeMesh(m); - if(CTX::instance()->mesh.optimize_netgen > i) OptimizeMeshNetgen(m); + if(CTX::instance()->mesh.optimizeNetgen > i) OptimizeMeshNetgen(m); } } // Subdivide into quads or hexas - if(m->getMeshStatus() == 2 && CTX::instance()->mesh.algo_subdivide == 1) - RefineMesh(m, CTX::instance()->mesh.second_order_linear, true); - else if(m->getMeshStatus() == 3 && CTX::instance()->mesh.algo_subdivide == 2) - RefineMesh(m, CTX::instance()->mesh.second_order_linear, false, true); + if(m->getMeshStatus() == 2 && CTX::instance()->mesh.algoSubdivide == 1) + RefineMesh(m, CTX::instance()->mesh.secondOrderLinear, true); + else if(m->getMeshStatus() == 3 && CTX::instance()->mesh.algoSubdivide == 2) + RefineMesh(m, CTX::instance()->mesh.secondOrderLinear, false, true); // Create high order elements if(m->getMeshStatus() && CTX::instance()->mesh.order > 1) - SetOrderN(m, CTX::instance()->mesh.order, CTX::instance()->mesh.second_order_linear, - CTX::instance()->mesh.second_order_incomplete); + SetOrderN(m, CTX::instance()->mesh.order, CTX::instance()->mesh.secondOrderLinear, + CTX::instance()->mesh.secondOrderIncomplete); Msg::Info("%d vertices %d elements", m->getNumMeshVertices(), m->getNumMeshElements()); Msg::PrintErrorCounter("Mesh generation error summary"); - CTX::instance()->threads_lock = 0; + CTX::instance()->lock = 0; CTX::instance()->mesh.changed = ENT_ALL; } diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp index 418f7667f71ddf371661d58b5f034b2ba57dd562..be7f91e87e1250d147d42a1ed59c9514f3850fde 100644 --- a/Mesh/HighOrder.cpp +++ b/Mesh/HighOrder.cpp @@ -1011,7 +1011,7 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete) gmshHighOrderSmoother *displ2D = 0; gmshHighOrderSmoother *displ3D = 0; - if(CTX::instance()->mesh.smooth_internal_edges){ + if(CTX::instance()->mesh.smoothInternalEdges){ displ2D = new gmshHighOrderSmoother(2); displ3D = new gmshHighOrderSmoother(3); } diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 1d6e8f79eb4c5982fdc19261cecec68caf5322ce..d996c05bb79f345216ba188d3da9edcf38978760 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -262,7 +262,7 @@ void meshGEdge::operator() (GEdge *ge) if(ge->geomType() == GEntity::DiscreteCurve) return; if(ge->geomType() == GEntity::BoundaryLayerCurve) return; if(ge->meshAttributes.Method == MESH_NONE) return; - if(CTX::instance()->mesh.mesh_only_visible && !ge->getVisibility()) return; + if(CTX::instance()->mesh.meshOnlyVisible && !ge->getVisibility()) return; deMeshGEdge dem; dem(ge); @@ -286,7 +286,7 @@ void meshGEdge::operator() (GEdge *ge) Msg::Debug("Curve %d has a zero length", ge->tag()); // TEST - if (length < CTX::instance()->mesh.tolerance_edge_length) ge->setTooSmall(true); + if (length < CTX::instance()->mesh.toleranceEdgeLength) ge->setTooSmall(true); // Integrate detJ/lc du double a; @@ -300,10 +300,10 @@ void meshGEdge::operator() (GEdge *ge) N = ge->meshAttributes.nbPointsTransfinite; } else{ - if(CTX::instance()->mesh.lc_integration_precision > 1.e-8){ + if(CTX::instance()->mesh.lcIntegrationPrecision > 1.e-8){ std::vector<IntPoint> lcPoints; Integration(ge, t_begin, t_end, F_Lc_usingInterpLcBis, lcPoints, - CTX::instance()->mesh.lc_integration_precision); + CTX::instance()->mesh.lcIntegrationPrecision); buildInterpLc(lcPoints); // printInterpLc("toto1.dat"); // smoothInterpLc(20); @@ -312,7 +312,7 @@ void meshGEdge::operator() (GEdge *ge) } else{ a = Integration(ge, t_begin, t_end, F_Lc, Points, - CTX::instance()->mesh.lc_integration_precision); + CTX::instance()->mesh.lcIntegrationPrecision); } N = std::max(ge->minimumMeshSegments() + 1, (int)(a + 1.)); } diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index fbd8eb05646223778cf36cf1d0ab5df4182d66ab..ababe01f6c214aa89b8736efd83a75d86960bca1 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -460,8 +460,8 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, bool debug = true) int j = 0; while(itv != all_vertices.end()){ MVertex *here = *itv; - double XX = CTX::instance()->mesh.rand_factor * LC2D * (double)rand() / (double)RAND_MAX; - double YY = CTX::instance()->mesh.rand_factor * LC2D * (double)rand() / (double)RAND_MAX; + double XX = CTX::instance()->mesh.randFactor * LC2D * (double)rand() / (double)RAND_MAX; + double YY = CTX::instance()->mesh.randFactor * LC2D * (double)rand() / (double)RAND_MAX; doc.points[j].where.h = U_[j] + XX; doc.points[j].where.v = V_[j] + YY; doc.points[j].adjacent = NULL; @@ -695,9 +695,9 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, bool debug = true) // start mesh generation if(!AlgoDelaunay2D(gf)){ - gmshRefineMeshBDS (gf,*m, CTX::instance()->mesh.refine_steps, true); + gmshRefineMeshBDS (gf,*m, CTX::instance()->mesh.refineSteps, true); gmshOptimizeMeshBDS(gf, *m, 2); - gmshRefineMeshBDS (gf,*m, CTX::instance()->mesh.refine_steps, false); + gmshRefineMeshBDS (gf,*m, CTX::instance()->mesh.refineSteps, false); gmshOptimizeMeshBDS(gf, *m, 2); } @@ -750,7 +750,7 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, bool debug = true) gmshBowyerWatsonFrontal(gf); else gmshBowyerWatson(gf); - for (int i = 0; i < CTX::instance()->mesh.nb_smoothing; i++) + for (int i = 0; i < CTX::instance()->mesh.nbSmoothing; i++) laplaceSmoothing(gf); } else if (debug){ @@ -1083,9 +1083,9 @@ static bool gmsh2DMeshGeneratorPeriodic(GFace *gf, bool debug = true) BDS_Point *pp = edgeLoop_BDS[j]; const double U = pp->u; const double V = pp->v; - double XX = CTX::instance()->mesh.rand_factor * LC2D * + double XX = CTX::instance()->mesh.randFactor * LC2D * (double)rand() / (double)RAND_MAX; - double YY = CTX::instance()->mesh.rand_factor * LC2D * + double YY = CTX::instance()->mesh.randFactor * LC2D * (double)rand() / (double)RAND_MAX; doc.points[count].where.h = U + XX; doc.points[count].where.v = V + YY; @@ -1231,9 +1231,9 @@ static bool gmsh2DMeshGeneratorPeriodic(GFace *gf, bool debug = true) // start mesh generation if (!AlgoDelaunay2D(gf)){ - gmshRefineMeshBDS(gf, *m, CTX::instance()->mesh.refine_steps, true); + gmshRefineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, true); gmshOptimizeMeshBDS(gf, *m, 2); - gmshRefineMeshBDS (gf, *m, -CTX::instance()->mesh.refine_steps, false); + gmshRefineMeshBDS (gf, *m, -CTX::instance()->mesh.refineSteps, false); gmshOptimizeMeshBDS(gf, *m, 2, &recover_map); // compute mesh statistics computeMeshSizeFieldAccuracy(gf, *m, gf->meshStatistics.efficiency_index, @@ -1297,7 +1297,7 @@ static bool gmsh2DMeshGeneratorPeriodic(GFace *gf, bool debug = true) gmshBowyerWatsonFrontal(gf); else gmshBowyerWatson(gf); - for (int i = 0; i < CTX::instance()->mesh.nb_smoothing; i++) + for (int i = 0; i < CTX::instance()->mesh.nbSmoothing; i++) laplaceSmoothing(gf); } @@ -1343,7 +1343,7 @@ void meshGFace::operator() (GFace *gf) if(gf->geomType() == GEntity::BoundaryLayerSurface) return; if(gf->geomType() == GEntity::ProjectionFace) return; if(gf->meshAttributes.Method == MESH_NONE) return; - if(CTX::instance()->mesh.mesh_only_visible && !gf->getVisibility()) return; + if(CTX::instance()->mesh.meshOnlyVisible && !gf->getVisibility()) return; // destroy the mesh if it exists deMeshGFace dem; diff --git a/Mesh/meshGFaceBDS.cpp b/Mesh/meshGFaceBDS.cpp index 6fe151eaa102d5a2fcd0ed3244ec0dc368035994..ef3a02be2555f208587730f63cf4a098d2a42f53 100644 --- a/Mesh/meshGFaceBDS.cpp +++ b/Mesh/meshGFaceBDS.cpp @@ -325,7 +325,7 @@ int edgeSwapTestQuality(BDS_Edge *e, double fact=1.1, bool force=false) e->oppositeof (op); if (!force) - if (!edgeSwapTestAngle(e, cos(CTX::instance()->mesh.allow_swap_edge_angle * M_PI / 180.))) + if (!edgeSwapTestAngle(e, cos(CTX::instance()->mesh.allowSwapEdgeAngle * M_PI / 180.))) return -1; double qa1 = qmTriangle(e->p1, e->p2, op[0], QMTRI_RHO); @@ -563,7 +563,7 @@ void gmshRefineMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT, } if ((*itp)->g && (*itp)->g->classif_tag > 0){ if (!ne) L = MAX_LC; - if(CTX::instance()->mesh.lc_from_points) + if(CTX::instance()->mesh.lcFromPoints) (*itp)->lc() = L; (*itp)->lcBGM() = L; } diff --git a/Mesh/meshGFaceTransfinite.cpp b/Mesh/meshGFaceTransfinite.cpp index 8ae37e2ebe6db6d4aff4a1273fd6cebbfd4e7c06..30547dc1501032c3e073fe9b37610f6b33d763f2 100644 --- a/Mesh/meshGFaceTransfinite.cpp +++ b/Mesh/meshGFaceTransfinite.cpp @@ -297,8 +297,8 @@ int MeshTransfiniteSurface(GFace *gf) // should we apply the elliptic smoother? int numSmooth = 0; - if(gf->meshAttributes.transfiniteSmoothing < 0 && CTX::instance()->mesh.nb_smoothing > 1) - numSmooth = CTX::instance()->mesh.nb_smoothing; + if(gf->meshAttributes.transfiniteSmoothing < 0 && CTX::instance()->mesh.nbSmoothing > 1) + numSmooth = CTX::instance()->mesh.nbSmoothing; else if(gf->meshAttributes.transfiniteSmoothing > 0) numSmooth = gf->meshAttributes.transfiniteSmoothing; diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp index 3f4217167e882256ad9603190f0bfef347c61adc..ce45e0900b4085e3f73ac45a3b9adbafbb6275ce 100644 --- a/Mesh/meshGRegion.cpp +++ b/Mesh/meshGRegion.cpp @@ -191,7 +191,7 @@ void TransferTetgenMesh(GRegion *gr, tetgenio &in, tetgenio &out, v[j])); MVertex *v1b; if (CTX::instance()->mesh.order > 1 && - CTX::instance()->mesh.second_order_experimental){ + CTX::instance()->mesh.secondOrderExperimental){ // PARAMETRIC COORDINATES SHOULD BE SET for the vertex !!!!!!!!!!!!! // This is not 100 % safe yet, so we reserve that operation for high order // meshes. @@ -559,7 +559,7 @@ void meshGRegion::operator() (GRegion *gr) if(gr->geomType() == GEntity::DiscreteVolume) return; if(gr->meshAttributes.Method == MESH_NONE) return; - if(CTX::instance()->mesh.mesh_only_visible && !gr->getVisibility()) return; + if(CTX::instance()->mesh.meshOnlyVisible && !gr->getVisibility()) return; ExtrudeParams *ep = gr->meshAttributes.extrude; diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 7cef7466f06ff3b1e67c8b396e90643192543576..658eab604e133e06f2171748b2977931266b53ed 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -4696,10 +4696,10 @@ yyreduce: yymsg(0, "Point %d already exists", num); } else{ - double x = CTX::instance()->geom.scaling_factor * (yyvsp[(6) - (7)].v)[0]; - double y = CTX::instance()->geom.scaling_factor * (yyvsp[(6) - (7)].v)[1]; - double z = CTX::instance()->geom.scaling_factor * (yyvsp[(6) - (7)].v)[2]; - double lc = CTX::instance()->geom.scaling_factor * (yyvsp[(6) - (7)].v)[3]; + double x = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[0]; + double y = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[1]; + double z = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[2]; + double lc = CTX::instance()->geom.scalingFactor * (yyvsp[(6) - (7)].v)[3]; if(lc == 0.) lc = MAX_LC; // no mesh size given at the point Vertex *v; if(!myGmshSurface) @@ -5669,7 +5669,7 @@ yyreduce: if(index >= 0 && index < (int)PView::list.size()){ char tmpstring[1024]; FixRelativePath((yyvsp[(6) - (7)].c), tmpstring); - PView::list[index]->write(tmpstring, CTX::instance()->post.file_format); + PView::list[index]->write(tmpstring, CTX::instance()->post.fileFormat); } else yymsg(0, "Unknown view %d", index); @@ -5709,11 +5709,11 @@ yyreduce: yymsg(0, "Surface remeshing must be reinterfaced"); } else if(!strcmp((yyvsp[(1) - (3)].c), "Mesh")){ - int lock = CTX::instance()->threads_lock; - CTX::instance()->threads_lock = 0; + int lock = CTX::instance()->lock; + CTX::instance()->lock = 0; GModel::current()->importGEOInternals(); GModel::current()->mesh((int)(yyvsp[(2) - (3)].d)); - CTX::instance()->threads_lock = lock; + CTX::instance()->lock = lock; } else yymsg(0, "Unknown command '%s'", (yyvsp[(1) - (3)].c)); @@ -5741,21 +5741,21 @@ yyreduce: { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromAllViews")) - PView::combine(false, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromVisibleViews")) - PView::combine(false, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 0, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "ElementsByViewName")) - PView::combine(false, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 2, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "TimeStepsFromAllViews")) - PView::combine(true, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "TimeStepsFromVisibleViews")) - PView::combine(true, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 0, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "TimeStepsByViewName")) - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "Views")) - PView::combine(false, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "TimeSteps")) - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); else yymsg(0, "Unknown 'Combine' command"); #endif @@ -5773,7 +5773,7 @@ yyreduce: case 150: #line 1978 "Gmsh.y" { - CTX::instance()->forced_bbox = 0; + CTX::instance()->forcedBBox = 0; SetBoundingBox(); ;} break; @@ -5781,7 +5781,7 @@ yyreduce: case 151: #line 1983 "Gmsh.y" { - CTX::instance()->forced_bbox = 1; + CTX::instance()->forcedBBox = 1; SetBoundingBox((yyvsp[(3) - (15)].d), (yyvsp[(5) - (15)].d), (yyvsp[(7) - (15)].d), (yyvsp[(9) - (15)].d), (yyvsp[(11) - (15)].d), (yyvsp[(13) - (15)].d)); ;} break; @@ -7638,14 +7638,14 @@ yyreduce: case 340: #line 3297 "Gmsh.y" { - (yyval.u) = CTX::instance()->pack_color((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d)); + (yyval.u) = CTX::instance()->packColor((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d)); ;} break; case 341: #line 3301 "Gmsh.y" { - (yyval.u) = CTX::instance()->pack_color((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255); + (yyval.u) = CTX::instance()->packColor((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255); ;} break; diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index da50d170c57422276184bad7721cef2222f4f68c..6105e4ee8ff400e33d0b39d26207310087e82ffa 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1033,10 +1033,10 @@ Shape : yymsg(0, "Point %d already exists", num); } else{ - double x = CTX::instance()->geom.scaling_factor * $6[0]; - double y = CTX::instance()->geom.scaling_factor * $6[1]; - double z = CTX::instance()->geom.scaling_factor * $6[2]; - double lc = CTX::instance()->geom.scaling_factor * $6[3]; + double x = CTX::instance()->geom.scalingFactor * $6[0]; + double y = CTX::instance()->geom.scalingFactor * $6[1]; + double z = CTX::instance()->geom.scalingFactor * $6[2]; + double lc = CTX::instance()->geom.scalingFactor * $6[3]; if(lc == 0.) lc = MAX_LC; // no mesh size given at the point Vertex *v; if(!myGmshSurface) @@ -1890,7 +1890,7 @@ Command : if(index >= 0 && index < (int)PView::list.size()){ char tmpstring[1024]; FixRelativePath($6, tmpstring); - PView::list[index]->write(tmpstring, CTX::instance()->post.file_format); + PView::list[index]->write(tmpstring, CTX::instance()->post.fileFormat); } else yymsg(0, "Unknown view %d", index); @@ -1924,11 +1924,11 @@ Command : yymsg(0, "Surface remeshing must be reinterfaced"); } else if(!strcmp($1, "Mesh")){ - int lock = CTX::instance()->threads_lock; - CTX::instance()->threads_lock = 0; + int lock = CTX::instance()->lock; + CTX::instance()->lock = 0; GModel::current()->importGEOInternals(); GModel::current()->mesh((int)$2); - CTX::instance()->threads_lock = lock; + CTX::instance()->lock = lock; } else yymsg(0, "Unknown command '%s'", $1); @@ -1950,21 +1950,21 @@ Command : { #if !defined(HAVE_NO_POST) if(!strcmp($2, "ElementsFromAllViews")) - PView::combine(false, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "ElementsFromVisibleViews")) - PView::combine(false, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 0, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "ElementsByViewName")) - PView::combine(false, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 2, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "TimeStepsFromAllViews")) - PView::combine(true, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "TimeStepsFromVisibleViews")) - PView::combine(true, 0, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 0, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "TimeStepsByViewName")) - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "Views")) - PView::combine(false, 1, CTX::instance()->post.combine_remove_orig); + PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "TimeSteps")) - PView::combine(true, 2, CTX::instance()->post.combine_remove_orig); + PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig); else yymsg(0, "Unknown 'Combine' command"); #endif @@ -1976,12 +1976,12 @@ Command : } | tBoundingBox tEND { - CTX::instance()->forced_bbox = 0; + CTX::instance()->forcedBBox = 0; SetBoundingBox(); } | tBoundingBox '{' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr ',' FExpr '}' tEND { - CTX::instance()->forced_bbox = 1; + CTX::instance()->forcedBBox = 1; SetBoundingBox($3, $5, $7, $9, $11, $13); } | tDraw tEND @@ -3295,11 +3295,11 @@ RecursiveListOfDouble : ColorExpr : '{' FExpr ',' FExpr ',' FExpr ',' FExpr '}' { - $$ = CTX::instance()->pack_color((int)$2, (int)$4, (int)$6, (int)$8); + $$ = CTX::instance()->packColor((int)$2, (int)$4, (int)$6, (int)$8); } | '{' FExpr ',' FExpr ',' FExpr '}' { - $$ = CTX::instance()->pack_color((int)$2, (int)$4, (int)$6, 255); + $$ = CTX::instance()->packColor((int)$2, (int)$4, (int)$6, 255); } /* shift/reduce conflict | '{' tSTRING ',' FExpr '}' diff --git a/Plugin/CutGrid.cpp b/Plugin/CutGrid.cpp index 8bfd619b7e633deb7b8c795c2ef8f7ffd0807f74..5001eab3cdb34d573f1050a040af6b0fdd030996 100644 --- a/Plugin/CutGrid.cpp +++ b/Plugin/CutGrid.cpp @@ -65,7 +65,7 @@ void GMSH_CutGridPlugin::draw(void *context) for(int i = 0; i < getNbU(); ++i){ for(int j = 0; j < getNbV(); ++j){ getPoint(i, j, p); - ctx->drawSphere(CTX::instance()->point_size, p[0], p[1], p[2], 1); + ctx->drawSphere(CTX::instance()->pointSize, p[0], p[1], p[2], 1); } } } diff --git a/Plugin/CutParametric.cpp b/Plugin/CutParametric.cpp index b9cff25afb67e9d98bcde81dedd41b3dbabee2fc..acd41058f239f9cf7f03beee3d9fa4674c07825b 100644 --- a/Plugin/CutParametric.cpp +++ b/Plugin/CutParametric.cpp @@ -120,7 +120,7 @@ void GMSH_CutParametricPlugin::draw(void *context) else{ drawContext *ctx = (drawContext*)context; for(unsigned int i = 0; i < x.size(); ++i) - ctx->drawSphere(CTX::instance()->point_size, x[i], y[i], z[i], 1); + ctx->drawSphere(CTX::instance()->pointSize, x[i], y[i], z[i], 1); } #endif } diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp index 9998874b00da1380e9b20aa2bbb347fbaa7a700d..4aac591555ccbfe661424bd45a51fb140d62e2d6 100644 --- a/Plugin/CutPlane.cpp +++ b/Plugin/CutPlane.cpp @@ -46,7 +46,7 @@ void GMSH_CutPlanePlugin::draw(void *context) if(num < 0) num = iview; if(num >= 0 && num < (int)PView::list.size()){ glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glLineWidth(CTX::instance()->line_width); + glLineWidth(CTX::instance()->lineWidth); SBoundingBox3d bb = PView::list[num]->getData()->getBoundingBox(); ctx->drawPlaneInBoundingBox(bb.min().x(), bb.min().y(), bb.min().z(), bb.max().x(), bb.max().y(), bb.max().z(), diff --git a/Plugin/CutSphere.cpp b/Plugin/CutSphere.cpp index 265573418c2d00841cf1f4f9074a5f06e9add75e..04438863b82189e9a6c96e99152ed39addc95b65 100644 --- a/Plugin/CutSphere.cpp +++ b/Plugin/CutSphere.cpp @@ -38,7 +38,7 @@ void GMSH_CutSpherePlugin::draw(void *context) glGetIntegerv(GL_POLYGON_MODE, mode); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glLineWidth(CTX::instance()->line_width); + glLineWidth(CTX::instance()->lineWidth); drawContext *ctx = (drawContext*)context; ctx->drawSphere(CutSphereOptions_Number[3].def, CutSphereOptions_Number[0].def, diff --git a/Plugin/Integrate.cpp b/Plugin/Integrate.cpp index 2c136442ec8b873e35f68df7ebeee0608fad007a..4e1607d253b42095f8451372f3dfb52e70f86fec 100644 --- a/Plugin/Integrate.cpp +++ b/Plugin/Integrate.cpp @@ -111,7 +111,7 @@ PView *GMSH_IntegratePlugin::execute(PView * v) List_Add(data2->SP, &res); } data2->NbSP = 1; - v2->getOptions()->IntervalsType = PViewOptions::Numeric; + v2->getOptions()->intervalsType = PViewOptions::Numeric; for(int i = 0; i < data1->getNumTimeSteps(); i++){ double time = data1->getTime(i); diff --git a/Plugin/Probe.cpp b/Plugin/Probe.cpp index d7c2f168b7b3de5df6099724b069119df4dc7a1b..a6d617f5d855dbffeff7bdab37b5a4c80dc89a9c 100644 --- a/Plugin/Probe.cpp +++ b/Plugin/Probe.cpp @@ -47,7 +47,7 @@ void GMSH_ProbePlugin::draw(void *context) double z = ProbeOptions_Number[2].def; drawContext *ctx = (drawContext*)context; glColor4ubv((GLubyte *) & CTX::instance()->color.fg); - glLineWidth(CTX::instance()->line_width); + glLineWidth(CTX::instance()->lineWidth); SBoundingBox3d bb = PView::list[num]->getData()->getBoundingBox(); if(x >= bb.min().x() && x <= bb.max().x() && y >= bb.min().y() && y <= bb.max().y() && @@ -68,7 +68,7 @@ void GMSH_ProbePlugin::draw(void *context) glVertex3d(x, y, z - d); glVertex3d(x, y, z + d); glEnd(); } - ctx->drawSphere(CTX::instance()->point_size, x, y, z, 1); + ctx->drawSphere(CTX::instance()->pointSize, x, y, z, 1); } #endif } diff --git a/Plugin/StreamLines.cpp b/Plugin/StreamLines.cpp index 5233d76e7733d66e4576975bf4810029058c495b..42f28db45874cf7136e3e57c5e962e9c5f24412a 100644 --- a/Plugin/StreamLines.cpp +++ b/Plugin/StreamLines.cpp @@ -52,7 +52,7 @@ void GMSH_StreamLinesPlugin::draw(void *context) for(int i = 0; i < getNbU(); ++i){ for(int j = 0; j < getNbV(); ++j){ getPoint(i, j, p); - ctx->drawSphere(CTX::instance()->point_size, p[0], p[1], p[2], 1); + ctx->drawSphere(CTX::instance()->pointSize, p[0], p[1], p[2], 1); } } #endif @@ -334,7 +334,7 @@ PView *GMSH_StreamLinesPlugin::execute(PView *v) delete o2; } else{ - v3->getOptions()->VectorType = PViewOptions::Displacement; + v3->getOptions()->vectorType = PViewOptions::Displacement; } data3->setName(data1->getName() + "_StreamLines"); diff --git a/Plugin/Triangulate.cpp b/Plugin/Triangulate.cpp index 2244e2a593cb3e3a44cae4ae97bb59a8e884f88f..9997c3127b5056f1700bcab28f6b0e3ccc8f14cf 100644 --- a/Plugin/Triangulate.cpp +++ b/Plugin/Triangulate.cpp @@ -96,8 +96,8 @@ static void Triangulate(int nbIn, List_T *inList, int *nbOut, List_T *outList, // build a point record structure for the divide and conquer algorithm DocRecord doc(points.size()); for(unsigned int i = 0; i < points.size(); i++){ - double XX = CTX::instance()->mesh.rand_factor * lc * (double)rand() / (double)RAND_MAX; - double YY = CTX::instance()->mesh.rand_factor * lc * (double)rand() / (double)RAND_MAX; + double XX = CTX::instance()->mesh.randFactor * lc * (double)rand() / (double)RAND_MAX; + double YY = CTX::instance()->mesh.randFactor * lc * (double)rand() / (double)RAND_MAX; doc.points[i].where.h = points[i]->x() + XX; doc.points[i].where.v = points[i]->y() + YY; doc.points[i].adjacent = NULL; diff --git a/Post/ColorTable.cpp b/Post/ColorTable.cpp index 2cc408e3fb1dd27a42e4442dd3bd244387a70a17..a89e37fece7b630746bbbb4fa9aa576cc96ead5c 100644 --- a/Post/ColorTable.cpp +++ b/Post/ColorTable.cpp @@ -334,7 +334,7 @@ void ColorTable_Recompute(GmshColorTable * ct) b = b < 0 ? 0 : (b > 255 ? 255 : b); a = a < 0 ? 0 : (a > 255 ? 255 : a); - ct->table[i] = CTX::instance()->pack_color(r, g, b, a); + ct->table[i] = CTX::instance()->packColor(r, g, b, a); } } @@ -372,10 +372,10 @@ void ColorTable_Print(GmshColorTable * ct, FILE * fp) strcpy(tmp1, ""); for(i = 0; i < ct->size; i++) { - r = CTX::instance()->unpack_red(ct->table[i]); - g = CTX::instance()->unpack_green(ct->table[i]); - b = CTX::instance()->unpack_blue(ct->table[i]); - a = CTX::instance()->unpack_alpha(ct->table[i]); + r = CTX::instance()->unpackRed(ct->table[i]); + g = CTX::instance()->unpackGreen(ct->table[i]); + b = CTX::instance()->unpackBlue(ct->table[i]); + a = CTX::instance()->unpackAlpha(ct->table[i]); if(i && !(i % 4)) { if(fp) fprintf(fp, "%s\n", tmp1); @@ -398,7 +398,7 @@ int ColorTable_IsAlpha(GmshColorTable * ct) { int i, a; for(i = 0; i < ct->size; i++) { - a = CTX::instance()->unpack_alpha(ct->table[i]); + a = CTX::instance()->unpackAlpha(ct->table[i]); if(a < 255) return 1; } diff --git a/Post/PView.cpp b/Post/PView.cpp index c995774715de4a4c1aa4530d20d6edc6190b6b65..ed95d4e4da8ad4043afb012ed9b7723257421841 100644 --- a/Post/PView.cpp +++ b/Post/PView.cpp @@ -34,9 +34,9 @@ PView::PView(bool allocate, int numalloc) _init(); _data = new PViewDataList(allocate, numalloc); _options = new PViewOptions(PViewOptions::reference); - if(_options->AdaptVisualizationGrid) - _data->initAdaptiveData(_options->TimeStep, _options->MaxRecursionLevel, - _options->TargetError); + if(_options->adaptVisualizationGrid) + _data->initAdaptiveData(_options->timeStep, _options->maxRecursionLevel, + _options->targetError); } PView::PView(PViewData *data) @@ -44,9 +44,9 @@ PView::PView(PViewData *data) _init(); _data = data; _options = new PViewOptions(PViewOptions::reference); - if(_options->AdaptVisualizationGrid) - _data->initAdaptiveData(_options->TimeStep, _options->MaxRecursionLevel, - _options->TargetError); + if(_options->adaptVisualizationGrid) + _data->initAdaptiveData(_options->timeStep, _options->maxRecursionLevel, + _options->targetError); } PView::PView(PView *ref, bool copyOptions) @@ -58,9 +58,9 @@ PView::PView(PView *ref, bool copyOptions) _options = new PViewOptions(*ref->getOptions()); else _options = new PViewOptions(PViewOptions::reference); - if(_options->AdaptVisualizationGrid) - _data->initAdaptiveData(_options->TimeStep, _options->MaxRecursionLevel, - _options->TargetError); + if(_options->adaptVisualizationGrid) + _data->initAdaptiveData(_options->timeStep, _options->maxRecursionLevel, + _options->targetError); } PView::PView(std::string xname, std::string yname, @@ -88,9 +88,9 @@ PView::PView(std::string xname, std::string yname, data->finalize(); _data = data; _options = new PViewOptions(PViewOptions::reference); - _options->Type = PViewOptions::Plot2DSpace; - _options->Axes = 2; - _options->AxesLabel[0] = xname; + _options->type = PViewOptions::Plot2DSpace; + _options->axes = 2; + _options->axesLabel[0] = xname; } PView::PView(std::string name, std::string type, @@ -105,9 +105,9 @@ PView::PView(std::string name, std::string type, d->setFileName(name + ".msh"); _data = d; _options = new PViewOptions(PViewOptions::reference); - if(_options->AdaptVisualizationGrid) - _data->initAdaptiveData(_options->TimeStep, _options->MaxRecursionLevel, - _options->TargetError); + if(_options->adaptVisualizationGrid) + _data->initAdaptiveData(_options->timeStep, _options->maxRecursionLevel, + _options->targetError); } void PView::addStep(GModel *model, std::map<int, std::vector<double> > &data, @@ -189,7 +189,7 @@ void PView::combine(bool time, int how, bool remove) for(unsigned int i = 0; i < list.size(); i++) { PView *p = list[i]; PViewData *data = p->getData(); - if(how || p->getOptions()->Visible) { + if(how || p->getOptions()->visible) { nameData nd; // this will lead to weird results if there are views named // "__all__" or "__vis__" :-) diff --git a/Post/PViewOptions.cpp b/Post/PViewOptions.cpp index f42412efb302b219bfa4e1ea2d8ca0c949496bcc..2760a01cb13fdc082d1f4d080b525b9b3530225b 100644 --- a/Post/PViewOptions.cpp +++ b/Post/PViewOptions.cpp @@ -16,9 +16,9 @@ PViewOptions PViewOptions::reference; PViewOptions::PViewOptions() { - for(int i = 0; i < 3; i++) GenRaise_f[i] = 0; - ColorTable_InitParam(2, &CT); - ColorTable_Recompute(&CT); + for(int i = 0; i < 3; i++) genRaiseFunction[i] = 0; + ColorTable_InitParam(2, &colorTable); + ColorTable_Recompute(&colorTable); } PViewOptions::~PViewOptions() @@ -30,15 +30,15 @@ double PViewOptions::getScaleValue(int iso, int numIso, double min, double max) { if(numIso == 1) return (min + max) / 2.; - if(ScaleType == Linear){ + if(scaleType == Linear){ return min + iso * (max - min) / (numIso - 1.); } - else if(ScaleType == Logarithmic){ + else if(scaleType == Logarithmic){ // should translate scale instead, with smallest val an option! if(min <= 0.) return 0; return pow(10., log10(min) + iso * (log10(max) - log10(min)) / (numIso - 1.)); } - else if(ScaleType == DoubleLogarithmic){ + else if(scaleType == DoubleLogarithmic){ if(min <= 0.) return 0; double iso2 = iso / 2.; double numIso2 = numIso / 2.; @@ -52,14 +52,14 @@ int PViewOptions::getScaleIndex(double val, int numIso, double min, double max, { if(min == max) return numIso / 2; - if(forceLinear || ScaleType == Linear){ + if(forceLinear || scaleType == Linear){ return (int)((val - min) * (numIso - 1) / (max - min)); } - else if(ScaleType == Logarithmic){ + else if(scaleType == Logarithmic){ if(min <= 0.) return 0; return (int)((log10(val) - log10(min)) * (numIso - 1) / (log10(max) - log10(min))); } - else if(ScaleType == DoubleLogarithmic){ + else if(scaleType == DoubleLogarithmic){ // FIXME if(min <= 0.) return 0; return (int)((log10(val) - log10(min)) * (numIso - 1) / (log10(max) - log10(min))); @@ -70,13 +70,13 @@ int PViewOptions::getScaleIndex(double val, int numIso, double min, double max, unsigned int PViewOptions::getColor(double val, double min, double max, bool forceLinear, int numColors) { - if(CT.size == 1) return CT.table[0]; + if(colorTable.size == 1) return colorTable.table[0]; if(numColors <= 0){ // use full colormap - int index = getScaleIndex(val, CT.size, min, max, forceLinear); + int index = getScaleIndex(val, colorTable.size, min, max, forceLinear); if(index < 0) index = 0; - else if(index > CT.size - 1) index = CT.size - 1; - return CT.table[index]; + else if(index > colorTable.size - 1) index = colorTable.size - 1; + return colorTable.table[index]; } else{ // the maximum should belong to the last interval: so use @@ -89,22 +89,22 @@ unsigned int PViewOptions::getColor(double val, double min, double max, unsigned int PViewOptions::getColor(int i, int nb) { - int index = (nb == 1) ? CT.size / 2 : - (int)(i / (double)(nb - 1) * (CT.size - 1) + 0.5); + int index = (nb == 1) ? colorTable.size / 2 : + (int)(i / (double)(nb - 1) * (colorTable.size - 1) + 0.5); if(index < 0) index = 0; - else if(index > CT.size - 1) index = CT.size - 1; - return CT.table[index]; + else if(index > colorTable.size - 1) index = colorTable.size - 1; + return colorTable.table[index]; } void PViewOptions::destroyGeneralRaise() { for(int i = 0; i < 3; i++){ #if defined(HAVE_MATH_EVAL) - if(GenRaise_f[i]) - evaluator_destroy(GenRaise_f[i]); - GenRaise_f[i] = 0; + if(genRaiseFunction[i]) + evaluator_destroy(genRaiseFunction[i]); + genRaiseFunction[i] = 0; #else - GenRaise_f[i] = (void*)-1; + genRaiseFunction[i] = (void*)-1; #endif } } @@ -113,25 +113,25 @@ void PViewOptions::createGeneralRaise() { destroyGeneralRaise(); - const char *expr[3] = {GenRaiseX.c_str(), GenRaiseY.c_str(), GenRaiseZ.c_str()}; + const char *expr[3] = {genRaiseX.c_str(), genRaiseY.c_str(), genRaiseZ.c_str()}; #if defined(HAVE_MATH_EVAL) for(int i = 0; i < 3; i++) { if(strlen(expr[i])) { - if(!(GenRaise_f[i] = evaluator_create((char*)expr[i]))) + if(!(genRaiseFunction[i] = evaluator_create((char*)expr[i]))) Msg::Error("Invalid expression '%s'", expr[i]); } } #else for(int i = 0; i < 3; i++) { - if(!strcmp(expr[i], "v0")) GenRaise_f[i] = (void*)0; - else if(!strcmp(expr[i], "v1")) GenRaise_f[i] = (void*)1; - else if(!strcmp(expr[i], "v2")) GenRaise_f[i] = (void*)2; - else if(!strcmp(expr[i], "v3")) GenRaise_f[i] = (void*)3; - else if(!strcmp(expr[i], "v4")) GenRaise_f[i] = (void*)4; - else if(!strcmp(expr[i], "v5")) GenRaise_f[i] = (void*)5; - else if(!strcmp(expr[i], "v6")) GenRaise_f[i] = (void*)6; - else if(!strcmp(expr[i], "v7")) GenRaise_f[i] = (void*)7; - else if(!strcmp(expr[i], "v8")) GenRaise_f[i] = (void*)8; + if(!strcmp(expr[i], "v0")) genRaiseFunction[i] = (void*)0; + else if(!strcmp(expr[i], "v1")) genRaiseFunction[i] = (void*)1; + else if(!strcmp(expr[i], "v2")) genRaiseFunction[i] = (void*)2; + else if(!strcmp(expr[i], "v3")) genRaiseFunction[i] = (void*)3; + else if(!strcmp(expr[i], "v4")) genRaiseFunction[i] = (void*)4; + else if(!strcmp(expr[i], "v5")) genRaiseFunction[i] = (void*)5; + else if(!strcmp(expr[i], "v6")) genRaiseFunction[i] = (void*)6; + else if(!strcmp(expr[i], "v7")) genRaiseFunction[i] = (void*)7; + else if(!strcmp(expr[i], "v8")) genRaiseFunction[i] = (void*)8; else if(strlen(expr[i])) { Msg::Error("Invalid expression '%s'", expr[i]); return; @@ -143,14 +143,14 @@ void PViewOptions::createGeneralRaise() bool PViewOptions::skipElement(int numEdges) { switch(numEdges){ - case 0: return !DrawPoints; - case 1: return !DrawLines; - case 3: return !DrawTriangles; - case 4: return !DrawQuadrangles; - case 6: return !DrawTetrahedra; - case 12: return !DrawHexahedra; - case 9: return !DrawPrisms; - case 8: return !DrawPyramids; + case 0: return !drawPoints; + case 1: return !drawLines; + case 3: return !drawTriangles; + case 4: return !drawQuadrangles; + case 6: return !drawTetrahedra; + case 12: return !drawHexahedra; + case 9: return !drawPrisms; + case 8: return !drawPyramids; default: return true; } } diff --git a/Post/PViewOptions.h b/Post/PViewOptions.h index 7332cfe572bd4cf2fa10a5d393226022be86b760..a68e5b1a67089a4aff87e7d545ae2c5bd8b8f275 100644 --- a/Post/PViewOptions.h +++ b/Post/PViewOptions.h @@ -49,43 +49,43 @@ class PViewOptions { DoubleLogarithmic = 3 }; - int Type; - int Position[2], Size[2], AutoPosition; - std::string Format; - int Axes, AxesAutoPosition, AxesMikado, AxesTics[3]; - std::string AxesFormat[3], AxesLabel[3]; - double AxesPosition[6]; - double CustomMin, CustomMax, TmpMin, TmpMax, ExternalMin, ExternalMax; - SBoundingBox3d TmpBBox; - double Offset[3], Raise[3], Transform[3][3], DisplacementFactor, NormalRaise; - double Explode; - double ArrowSizeMin, ArrowSizeMax; - double Normals, Tangents; - int Visible, IntervalsType, NbIso; - int Light, LightTwoSide, LightLines, SmoothNormals; - double AngleSmoothNormals; - int SaturateValues, FakeTransparency; - int ShowElement, ShowTime, ShowScale; - int ScaleType, RangeType; - int VectorType, TensorType, GlyphLocation, CenterGlyphs; - int TimeStep; - int DrawStrings; - int DrawPoints, DrawLines, DrawTriangles, DrawQuadrangles; - int DrawTetrahedra, DrawHexahedra, DrawPrisms, DrawPyramids; - int DrawScalars, DrawVectors, DrawTensors; - int Boundary, PointType, LineType, DrawSkinOnly; - double PointSize, LineWidth; - GmshColorTable CT; - int UseStipple, Stipple[10][2]; - std::string StippleString[10]; - int ExternalViewIndex, ViewIndexForGenRaise; - int UseGenRaise; - double GenRaiseFactor; - std::string GenRaiseX, GenRaiseY, GenRaiseZ; - void *GenRaise_f[3]; - int AdaptVisualizationGrid, MaxRecursionLevel; - double TargetError; - int Clip; // status of clip planes (bit array) + int type; + int position[2], size[2], autoPosition; + std::string format; + int axes, axesAutoPosition, axesMikado, axesTics[3]; + std::string axesFormat[3], axesLabel[3]; + double axesPosition[6]; + double customMin, customMax, tmpMin, tmpMax, externalMin, externalMax; + SBoundingBox3d tmpBBox; + double offset[3], raise[3], transform[3][3], displacementFactor, normalRaise; + double explode; + double arrowSizeMin, arrowSizeMax; + double normals, tangents; + int visible, intervalsType, nbIso; + int light, lightTwoSide, lightLines, smoothNormals; + double angleSmoothNormals; + int saturateValues, fakeTransparency; + int showElement, showTime, showScale; + int scaleType, rangeType; + int vectorType, tensorType, glyphLocation, centerGlyphs; + int timeStep; + int drawStrings; + int drawPoints, drawLines, drawTriangles, drawQuadrangles; + int drawTetrahedra, drawHexahedra, drawPrisms, drawPyramids; + int drawScalars, drawVectors, drawTensors; + int boundary, pointType, lineType, drawSkinOnly; + double pointSize, lineWidth; + GmshColorTable colorTable; + int useStipple, stipple[10][2]; + std::string stippleString[10]; + int externalViewIndex, viewIndexForGenRaise; + int useGenRaise; + double genRaiseFactor; + std::string genRaiseX, genRaiseY, genRaiseZ; + void *genRaiseFunction[3]; + int adaptVisualizationGrid, maxRecursionLevel; + double targetError; + int clip; // status of clip planes (bit array) struct{ unsigned int point, line, triangle, quadrangle; unsigned int tetrahedron, hexahedron, prism, pyramid; diff --git a/utils/embed/GmshEmbedded.h b/utils/embed/GmshEmbedded.h index 18726b0364fa8252466d92fc91b4adce98e57af3..865f3af5a420b6e4acd7ac7180f8ebb2379a04a4 100644 --- a/utils/embed/GmshEmbedded.h +++ b/utils/embed/GmshEmbedded.h @@ -13,27 +13,27 @@ public: Context_T() { lc = 1.; - hide_unselected = 0; + pickElements = 0; + hideUnselected = 0; geom.tolerance = 1.e-6; - mesh.reverse_all_normals = 1; - mesh.second_order_experimental = 0; - pick_elements = 0; + mesh.reverseAllNormals = 1; + mesh.secondOrderExperimental = 0; } double lc; - int hide_unselected; - int pick_elements; + int pickElements; + int hideUnselected; struct{ double tolerance; } geom; struct{ - int reverse_all_normals; - int second_order_experimental; + int reverseAllNormals; + int secondOrderExperimental; } mesh; - unsigned int PACK_COLOR(int,int,int,int){ return 0; } - int UNPACK_RED(unsigned int){ return 0; } - int UNPACK_GREEN(unsigned int){ return 0; } - int UNPACK_BLUE(unsigned int){ return 0; } - int UNPACK_ALPHA(unsigned int){ return 0; } + unsigned int packColor(int,int,int,int){ return 0; } + int unpackRed(unsigned int){ return 0; } + int unpackGreen(unsigned int){ return 0; } + int unpackBlue(unsigned int){ return 0; } + int unpackAlpha(unsigned int){ return 0; } }; class smooth_normals{