From 5e69079940c031c11a7d7c4f60e0e93173423896 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 9 Dec 2012 08:43:38 +0000 Subject: [PATCH] tweaks --- Common/DefaultOptions.h | 4 ++-- Common/OS.cpp | 8 ++++---- Common/OS.h | 2 +- Fltk/onelabGroup.cpp | 2 +- Fltk/statisticsWindow.cpp | 2 +- Graphics/drawGraph2d.cpp | 8 ++++++-- Post/PViewDataGModelIO.cpp | 7 ++++--- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index afc144724c..39c21206aa 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -407,9 +407,9 @@ StringXNumber GeneralOptions_Number[] = { { F|O, "FontSize" , opt_general_fontsize , -1. , "Size of the font in the user interface (-1=automatic)" }, - { F|O, "GraphicsFontSize" , opt_general_graphics_fontsize , 17. , + { F|O, "GraphicsFontSize" , opt_general_graphics_fontsize , 15. , "Size of the font in the graphic window" }, - { F|O, "GraphicsFontSizeTitle" , opt_general_graphics_fontsize_title , 19. , + { F|O, "GraphicsFontSizeTitle" , opt_general_graphics_fontsize_title , 18. , "Size of the font in the graphic window for titles" }, { F|S, "GraphicsHeight" , opt_general_graphics_size1 , 600. , "Height (in pixels) of the graphic window" }, diff --git a/Common/OS.cpp b/Common/OS.cpp index 9fc0467854..21feb19139 100644 --- a/Common/OS.cpp +++ b/Common/OS.cpp @@ -233,7 +233,7 @@ int SystemCall(const std::string &command, bool blocking) #endif } -std::string getCurrentWorkdir() +std::string GetCurrentWorkdir() { char path[1024]; #if defined(WIN32) @@ -242,7 +242,7 @@ std::string getCurrentWorkdir() if(!getcwd(path, sizeof(path))) return ""; #endif std::string str(path); - // match the convention of SplitFileName that delivers directory path + // match the convention of SplitFileName that delivers directory path // ending with a directory separator #if defined(WIN32) str.append("\\"); @@ -256,7 +256,7 @@ void RedirectIOToConsole() { #if defined(WIN32) && !defined(__CYGWIN__) // Win32 GUI apps do not write to the DOS console; make it work again by - // attaching to parent console, which allows to use the DOS shell to work + // attaching to parent console, which allows to use the DOS shell to work // with Gmsh on the command line (without this hack, you need to either use // a better shell (e.g. bash), or compile a /subsystem:console version if(!AttachConsole(ATTACH_PARENT_PROCESS)) return; @@ -276,7 +276,7 @@ void RedirectIOToConsole() fp = _fdopen(hConHandle, "w"); *stderr = *fp; setvbuf(stderr, NULL, _IONBF, 0); - // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog point to + // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog point to // console as well std::ios::sync_with_stdio(); #endif diff --git a/Common/OS.h b/Common/OS.h index 397a804990..b3f1ca696c 100644 --- a/Common/OS.h +++ b/Common/OS.h @@ -21,7 +21,7 @@ int StatFile(const std::string &fileName); int KillProcess(int pid); int CreateDirectory(const std::string &dirName); int SystemCall(const std::string &command, bool blocking=false); -std::string getCurrentWorkdir(); +std::string GetCurrentWorkdir(); void RedirectIOToConsole(); #endif diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index 4cd91f78bf..641dfb3375 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -1648,7 +1648,7 @@ int metamodel_cb(const std::string &name, const std::string &action) onelab::server::instance()->set(n); std::vector<std::string> split = SplitFileName(name); onelab::string s1("Arguments/WorkingDir", - split[0].size()?split[0]:getCurrentWorkdir()); + split[0].size() ? split[0] : GetCurrentWorkdir()); s1.setVisible(false); onelab::server::instance()->set(s1); onelab::string s2("Arguments/FileName", split[1]); diff --git a/Fltk/statisticsWindow.cpp b/Fltk/statisticsWindow.cpp index e7506606ad..3a51010b72 100644 --- a/Fltk/statisticsWindow.cpp +++ b/Fltk/statisticsWindow.cpp @@ -201,7 +201,7 @@ void statisticsWindow::compute(bool elementQuality) { #if 0 { - // MINIMUM MAXIMUM ANGLES + // MINIMUM MAXIMUM ANGLES double minAngle = 1.0; //M_PI; double meanAngle = 0.0; int count = 0; diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index b31e5ab17c..17e073d06f 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -276,13 +276,17 @@ static void drawGraphAxes(drawContext *ctx, PView *p, double xleft, double ytop, if(opt->scaleType == PViewOptions::Logarithmic) label = "Log10 " + label; glRasterPos2d(xleft + (overlay ? width : 0), ytop + font_h + tic); - ctx->drawStringCenter(label); + ctx->drawString(label,CTX::instance()->glFontTitle, + CTX::instance()->glFontEnumTitle, + CTX::instance()->glFontSizeTitle, 1); // x label label = opt->axesLabel[0]; glRasterPos2d(xleft + width / 2, ytop - height - 2 * font_h - 2 * tic - overlay * (font_h + tic)); - ctx->drawStringCenter(label); + ctx->drawString(label,CTX::instance()->glFontTitle, + CTX::instance()->glFontEnumTitle, + CTX::instance()->glFontSizeTitle, 1); // y tics and horizontal grid if(opt->nbIso > 0){ diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp index 2976d81144..5c4c4784f9 100644 --- a/Post/PViewDataGModelIO.cpp +++ b/Post/PViewDataGModelIO.cpp @@ -133,8 +133,8 @@ bool PViewDataGModel::readMSH(const std::string &viewName, const std::string &fi return true; } -bool PViewDataGModel::writeMSH(const std::string &fileName, double version, bool binary, bool savemesh, - bool multipleView) +bool PViewDataGModel::writeMSH(const std::string &fileName, double version, bool binary, + bool savemesh, bool multipleView) { if(_steps.empty()) return true; @@ -148,7 +148,8 @@ bool PViewDataGModel::writeMSH(const std::string &fileName, double version, bool bool writeNodesAndElements = savemesh; FILE *fp; if(writeNodesAndElements){ - if(!model->writeMSH(fileName, version, binary,false,false,1.0,0,0,multipleView)) return false; + if(!model->writeMSH(fileName, version, binary, false, false, 1.0, 0, + 0, multipleView)) return false; // append data fp = fopen(fileName.c_str(), binary ? "ab" : "a"); if(!fp){ -- GitLab