diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 58d77223db2e3c30d9741ef2016c43b2f49eebed..4859dfb65cdef2e1d746425013196393743e9014 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -1,4 +1,4 @@ -// $Id: CommandLine.cpp,v 1.130 2008-06-05 11:52:49 samtech Exp $ +// $Id: CommandLine.cpp,v 1.131 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -185,9 +185,11 @@ void Get_Options(int argc, char *argv[]) // the parser, and so we can load files for -convert GModel *dummy = new GModel(); +#if !defined(HAVE_NO_PARSER) // Parse session and option files ParseFile(CTX.session_filename_fullpath, 1); ParseFile(CTX.options_filename_fullpath, 1); +#endif // Get command line options int i = 1; diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index a13fffa82a29233ff13a450a0e87ddbcbe86968e..e6bdc49c1bc15c3eb5cc57006a8a7cb98f836f4a 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -1,4 +1,4 @@ -// $Id: Gmsh.cpp,v 1.7 2008-07-03 17:06:01 geuzaine Exp $ +// $Id: Gmsh.cpp,v 1.8 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -23,7 +23,6 @@ #include "GmshDefines.h" #include "GModel.h" #include "Message.h" -#include "Parser.h" #include "OpenFile.h" #include "CreateFile.h" #include "Options.h" @@ -34,6 +33,10 @@ #include "Field.h" #include "Context.h" +#if !defined(HAVE_NO_PARSER) +#include "Parser.h" +#endif + #if !defined(HAVE_NO_POST) #include "PluginManager.h" #endif @@ -45,9 +48,11 @@ int GmshInitialize(int argc, char **argv) // Initialize messages (parallel stuff, etc.) Msg::Init(argc, argv); +#if !defined(HAVE_NO_POST) // Initialize the symbol tree that will hold variable names in the // parser InitSymbols(); +#endif // Load default options Init_Options(0); diff --git a/Common/Makefile b/Common/Makefile index 8b56ae3892218a2cd006c3a9d5420f2a5a7a56b3..db1abee2aa2459354e9e549c897c83b680e94a59 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.180 2008-07-03 17:06:01 geuzaine Exp $ +# $Id: Makefile,v 1.181 2008-07-04 14:58:30 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -36,6 +36,8 @@ SRC = Context.cpp\ CommandLine.cpp\ Gmsh.cpp\ OS.cpp\ + OpenFile.cpp\ + CreateFile.cpp\ Message.cpp\ Visibility.cpp\ Trackball.cpp\ @@ -96,7 +98,7 @@ Options.o: Options.cpp GmshUI.h GmshDefines.h Message.h \ ../Common/ListUtils.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ ../Common/SmoothData.h CommandLine.o: CommandLine.cpp GmshUI.h GmshDefines.h GmshVersion.h \ - Message.h ../Parser/OpenFile.h CommandLine.h Context.h Options.h \ + Message.h OpenFile.h CommandLine.h Context.h Options.h \ ../Post/ColorTable.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \ ../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ @@ -104,7 +106,7 @@ CommandLine.o: CommandLine.cpp GmshUI.h GmshDefines.h GmshVersion.h \ ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h \ ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h \ ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h \ - ../Geo/SBoundingBox3d.h ../Parser/CreateFile.h OS.h ../Post/PView.h + ../Geo/SBoundingBox3d.h CreateFile.h OS.h ../Post/PView.h Gmsh.o: Gmsh.cpp GmshDefines.h ../Geo/GModel.h ../Geo/GVertex.h \ ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ @@ -113,19 +115,53 @@ Gmsh.o: Gmsh.cpp GmshDefines.h ../Geo/GModel.h ../Geo/GVertex.h \ ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Message.h \ - ../Parser/Parser.h ../Common/ListUtils.h ../Common/TreeUtils.h \ - ../Common/avl.h ../Common/ListUtils.h ../Parser/OpenFile.h \ - ../Parser/CreateFile.h Options.h ../Post/ColorTable.h CommandLine.h \ + OpenFile.h CreateFile.h Options.h ../Post/ColorTable.h CommandLine.h \ OS.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ ../Mesh/Generator.h ../Mesh/Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \ - ../Common/SmoothData.h ../Post/PView.h Context.h \ - ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Common/Options.h \ - ../Common/Message.h ../Post/PViewDataList.h ../Post/PViewData.h \ - ../Common/GmshMatrix.h + ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ + ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ + ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h Context.h \ + ../Parser/Parser.h ../Plugin/PluginManager.h ../Plugin/Plugin.h \ + ../Common/Options.h ../Common/Message.h ../Post/PViewDataList.h \ + ../Post/PViewData.h ../Common/GmshMatrix.h OS.o: OS.cpp Message.h +OpenFile.o: OpenFile.cpp Message.h ../Geo/Geo.h ../Common/GmshDefines.h \ + ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ + ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Numeric/Numeric.h \ + ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ + ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ + ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ + ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ + ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ + ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ + ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ + ../Geo/GEntity.h ../Geo/SBoundingBox3d.h Context.h OpenFile.h \ + CommandLine.h ../Graphics/ReadImg.h OS.h StringUtils.h \ + ../Parser/Parser.h ../Post/PView.h ../Post/PViewData.h GmshUI.h \ + ../Graphics/Draw.h ../Graphics/SelectBuffer.h ../Fltk/GUI.h \ + ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h ../Common/GmshUI.h \ + ../Post/ColorTable.h ../Fltk/Popup_Button.h \ + ../Fltk/SpherePosition_Widget.h ../Mesh/Field.h +CreateFile.o: CreateFile.cpp Message.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ + ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ + ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ + ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ + ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ + ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h GmshDefines.h \ + StringUtils.h Context.h Options.h ../Post/ColorTable.h GmshUI.h \ + ../Graphics/gl2ps.h ../Graphics/gl2gif.h ../Graphics/PixelBuffer.h \ + ../Common/GmshUI.h ../Common/Message.h ../Common/MallocUtils.h \ + ../Graphics/Draw.h ../Graphics/gl2jpeg.h ../Graphics/PixelBuffer.h \ + ../Graphics/gl2png.h ../Graphics/PixelBuffer.h ../Graphics/gl2ppm.h \ + ../Graphics/PixelBuffer.h ../Graphics/gl2yuv.h \ + ../Graphics/PixelBuffer.h Message.o: Message.cpp Message.h Gmsh.h Options.h ../Post/ColorTable.h \ Context.h OS.h ../Fltk/GUI.h ../Fltk/Opengl_Window.h \ ../Fltk/Colorbar_Window.h ../Common/GmshUI.h ../Fltk/Popup_Button.h \ diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp index 971b4c33defcdfd8f6a15f6d960c1fd153580f40..3067be56daf785753b51df70e5b5702479a0f69d 100644 --- a/Common/StringUtils.cpp +++ b/Common/StringUtils.cpp @@ -1,4 +1,4 @@ -// $Id: StringUtils.cpp,v 1.3 2008-03-21 18:08:52 geuzaine Exp $ +// $Id: StringUtils.cpp,v 1.4 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -19,6 +19,10 @@ // // Please report all bugs and problems to <gmsh@geuz.org>. +#if defined(__CYGWIN__) +#include <sys/cygwin.h> +#endif + #include "StringUtils.h" void swapBytes(char *array, int size, int n) @@ -71,3 +75,32 @@ std::string sanitizeTeXString(const char *in, int equation) if(equation) out.push_back('$'); return out; } + +void fixWindowsPath(const char *in, char *out) +{ +#if defined(__CYGWIN__) + cygwin_conv_to_win32_path(in, out); +#else + strcpy(out, in); +#endif +} + +void splitFileName(const char *name, char *no_ext, char *ext, char *base) +{ + strcpy(no_ext, name); + strcpy(ext, ""); + for(int i = strlen(name) - 1; i >= 0; i--){ + if(name[i] == '.'){ + strcpy(ext, &name[i]); + no_ext[i] = '\0'; + break; + } + } + strcpy(base, no_ext); + for(int i = strlen(no_ext) - 1; i >= 0; i--){ + if(no_ext[i] == '/' || no_ext[i] == '\\'){ + strcpy(base, &no_ext[i + 1]); + break; + } + } +} diff --git a/Common/StringUtils.h b/Common/StringUtils.h index 74f6cdded2099b5d3cd0386d3ffb186d3b56a177..b1de98651def7a6432b5ae74f8293dc7aa1c9bde 100644 --- a/Common/StringUtils.h +++ b/Common/StringUtils.h @@ -26,5 +26,7 @@ void swapBytes(char *array, int size, int n); std::string extractDoubleQuotedString(const char *str, int len); std::string sanitizeTeXString(const char *in, int equation); +void fixWindowsPath(const char *in, char *out); +void splitFileName(const char *name, char *no_ext, char *ext, char *base); #endif diff --git a/Common/Visibility.cpp b/Common/Visibility.cpp index c9055bede2061c82b6e5c30f8e8a14d5123ebcfb..2e598b05f6ec904a9f7f12dc03047cac62d409d3 100644 --- a/Common/Visibility.cpp +++ b/Common/Visibility.cpp @@ -1,4 +1,4 @@ -// $Id: Visibility.cpp,v 1.33 2008-04-16 22:10:52 geuzaine Exp $ +// $Id: Visibility.cpp,v 1.34 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -23,7 +23,10 @@ #include "Visibility.h" #include "GModel.h" #include "MElement.h" -#include "Parser.h" // for Symbol_T + +#if !defined(HAVE_NO_PARSER) +#include "Parser.h" +#endif VisibilityManager *VisibilityManager::manager = 0; @@ -48,6 +51,7 @@ class VisLessThan{ } }; +#if !defined(HAVE_NO_POST) static void setLabels(void *a, void *b) { Symbol *s = (Symbol *)a; @@ -57,6 +61,7 @@ static void setLabels(void *a, void *b) VisibilityManager::instance()->setLabel((int)tag, std::string(s->Name), 0); } } +#endif void VisibilityManager::update(int type) { @@ -67,8 +72,10 @@ void VisibilityManager::update(int type) GModel *m = GModel::current(); +#if !defined(HAVE_NO_POST) // get old labels from parser if(Tree_Nbr(Symbol_T)) Tree_Action(Symbol_T, setLabels); +#endif if(type == 0){ // elementary entities for(GModel::piter it = m->firstElementaryName(); it != m->lastElementaryName(); ++it) diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 533769170814b688ccd627f142118c6c46560b19..e8864b761781d68792a1e5dfe5b80d389fc560de 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.586 2008-06-28 17:06:54 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.587 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -30,6 +30,7 @@ #include "Message.h" #include "MallocUtils.h" #include "ListUtils.h" +#include "StringUtils.h" #include "GModel.h" #include "MElement.h" #include "GeoStringInterface.h" @@ -2601,7 +2602,7 @@ void _replace_multi_format(const char *in, const char *val, char *out) void help_online_cb(CALLBACK_ARGS) { char prog[1024], cmd[1024]; - FixWindowsPath(CTX.web_browser, prog); + fixWindowsPath(CTX.web_browser, prog); _replace_multi_format(prog, "http://www.geuz.org/gmsh/doc/texinfo/", cmd); SystemCall(cmd); } @@ -2609,7 +2610,7 @@ void help_online_cb(CALLBACK_ARGS) void help_credits_cb(CALLBACK_ARGS) { char prog[1024], cmd[1024]; - FixWindowsPath(CTX.web_browser, prog); + fixWindowsPath(CTX.web_browser, prog); _replace_multi_format(prog, "http://www.geuz.org/gmsh/doc/CREDITS", cmd); SystemCall(cmd); } @@ -2661,8 +2662,8 @@ void geometry_physical_cb(CALLBACK_ARGS) void geometry_edit_cb(CALLBACK_ARGS) { char prog[1024], file[1024], cmd[1024]; - FixWindowsPath(CTX.editor, prog); - FixWindowsPath(CTX.filename, file); + fixWindowsPath(CTX.editor, prog); + fixWindowsPath(CTX.filename, file); _replace_multi_format(prog, file, cmd); SystemCall(cmd); } @@ -3978,7 +3979,7 @@ void solver_cb(CALLBACK_ARGS) } if(SINFO[num].nboptions) { char file[256], tmp[256]; - FixWindowsPath(WID->solver[num].input[0]->value(), file); + fixWindowsPath(WID->solver[num].input[0]->value(), file); sprintf(tmp, "\"%s\"", file); sprintf(file, SINFO[num].name_command, tmp); sprintf(tmp, "%s %s", SINFO[num].option_command, file); @@ -3999,7 +4000,7 @@ void solver_file_open_cb(CALLBACK_ARGS) WID->solver[num].input[0]->value(file_chooser_get_name(1).c_str()); if(SINFO[num].nboptions) { char file[1024]; - FixWindowsPath(file_chooser_get_name(1).c_str(), file); + fixWindowsPath(file_chooser_get_name(1).c_str(), file); sprintf(tmp, "\"%s\"", file); sprintf(file, SINFO[num].name_command, tmp); sprintf(tmp, "%s %s", SINFO[num].option_command, file); @@ -4012,8 +4013,8 @@ void solver_file_edit_cb(CALLBACK_ARGS) { char prog[1024], file[1024], cmd[1024]; int num = (int)(long)data; - FixWindowsPath(CTX.editor, prog); - FixWindowsPath(WID->solver[num].input[0]->value(), file); + fixWindowsPath(CTX.editor, prog); + fixWindowsPath(WID->solver[num].input[0]->value(), file); _replace_multi_format(prog, file, cmd); SystemCall(cmd); } @@ -4048,7 +4049,7 @@ void solver_command_cb(CALLBACK_ARGS) WID->create_message_window(true); if(strlen(WID->solver[num].input[1]->value())) { - FixWindowsPath(WID->solver[num].input[1]->value(), mesh); + fixWindowsPath(WID->solver[num].input[1]->value(), mesh); sprintf(tmp, "\"%s\"", mesh); sprintf(mesh, SINFO[num].mesh_command, tmp); } @@ -4070,7 +4071,7 @@ void solver_command_cb(CALLBACK_ARGS) strcpy(command, SINFO[num].button_command[idx]); } - FixWindowsPath(WID->solver[num].input[0]->value(), tmp); + fixWindowsPath(WID->solver[num].input[0]->value(), tmp); sprintf(arg, "\"%s\"", tmp); sprintf(tmp, SINFO[num].name_command, arg); sprintf(arg, "%s %s %s", tmp, mesh, command); diff --git a/Fltk/GUI_Projection.cpp b/Fltk/GUI_Projection.cpp index 5228c966add60a2331ea6446a6bf423e0e814f2a..e91890de8df317ba3a1fef391e4b3a35d0f7a803 100644 --- a/Fltk/GUI_Projection.cpp +++ b/Fltk/GUI_Projection.cpp @@ -3,7 +3,7 @@ #include "Draw.h" #include "Options.h" #include "Context.h" -#include "OpenFile.h" +#include "StringUtils.h" #include "SelectBuffer.h" #include "GUI_Projection.h" #include "GUI_Extras.h" @@ -902,7 +902,7 @@ void save_projection_cb(Fl_Widget *w, void *data) return; } char no_ext[256], ext[256], base[256]; - SplitFileName(name.c_str(), no_ext, ext, base); + splitFileName(name.c_str(), no_ext, ext, base); fprintf(fp, "1\n%s\n%s\n", base, ps->GetName().c_str()); for(unsigned int i = 0; i < p->parameters.size(); i++) fprintf(fp, "%.16g\n", p->parameters[i]->value()); diff --git a/Fltk/Makefile b/Fltk/Makefile index 0ca2092b250e7a8c4e586fb6695c7650212dbfa3..5c653e3b51b6a3921a2a9b287a0d2408e1e5a71c 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.189 2008-06-12 11:52:00 geuzaine Exp $ +# $Id: Makefile,v 1.190 2008-07-04 14:58:30 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -81,7 +81,7 @@ Main.o: Main.cpp GUI.h Opengl_Window.h Colorbar_Window.h \ ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ ../Post/PView.h ../Common/Gmsh.h ../Common/Message.h ../Graphics/Draw.h \ ../Common/Context.h ../Common/Options.h ../Parser/Parser.h \ - ../Parser/OpenFile.h ../Common/CommandLine.h Solvers.h \ + ../Common/OpenFile.h ../Common/CommandLine.h Solvers.h \ ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Post/PViewDataList.h \ ../Post/PViewData.h ../Common/GmshMatrix.h ../Geo/GModel.h \ ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ @@ -102,7 +102,7 @@ GUI.o: GUI.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ ../Geo/SBoundingBox3d.h ../Common/ListUtils.h ../Common/TreeUtils.h \ ../Common/avl.h ../Common/ListUtils.h ../Geo/SPoint2.h \ ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Post/PView.h \ - Callbacks.h Win32Icon.h ../Parser/OpenFile.h ../Common/CommandLine.h \ + Callbacks.h Win32Icon.h ../Common/OpenFile.h ../Common/CommandLine.h \ ../Mesh/Generator.h Solvers.h ../Plugin/PluginManager.h \ ../Plugin/Plugin.h ../Post/PViewDataList.h ../Post/PViewData.h \ ../Common/GmshMatrix.h Shortcut_Window.h ../Post/PViewOptions.h \ @@ -114,7 +114,7 @@ GUI.o: GUI.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ ../Geo/GEntity.h ../Geo/SBoundingBox3d.h ../Geo/GeoStringInterface.h GUI_Extras.o: GUI_Extras.cpp ../Common/GmshUI.h ../Common/GmshDefines.h \ - ../Parser/CreateFile.h ../Common/Options.h ../Post/ColorTable.h \ + ../Common/CreateFile.h ../Common/Options.h ../Post/ColorTable.h \ ../Common/Context.h ../Graphics/Draw.h ../Geo/SBoundingBox3d.h \ ../Geo/SPoint3.h GUI.h Opengl_Window.h Colorbar_Window.h Popup_Button.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ @@ -144,7 +144,7 @@ GUI_Projection.o: GUI_Projection.cpp ../Geo/GModelIO_Fourier.h \ ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h \ ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h ../Graphics/Draw.h \ ../Common/Options.h ../Post/ColorTable.h ../Common/Context.h \ - ../Parser/OpenFile.h ../Graphics/SelectBuffer.h GUI_Projection.h \ + ../Common/StringUtils.h ../Graphics/SelectBuffer.h GUI_Projection.h \ ../Common/GmshUI.h ../Geo/fourierProjectionFace.h ../Geo/GModel.h \ ../Geo/Range.h GUI.h Opengl_Window.h Colorbar_Window.h Popup_Button.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ @@ -184,21 +184,21 @@ GUI_Classifier.o: GUI_Classifier.cpp GUI_Classifier.h ../Common/GmshUI.h \ ../Geo/GModel.h ../Geo/GEdge.h ../Geo/discreteFace.h ../Geo/GModel.h \ ../Geo/GFace.h Callbacks.o: Callbacks.cpp ../Common/GmshUI.h ../Common/Message.h \ - ../Common/MallocUtils.h ../Common/ListUtils.h ../Geo/GModel.h \ - ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ - ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ - ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ - ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ + ../Common/MallocUtils.h ../Common/ListUtils.h ../Common/StringUtils.h \ + ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ + ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ + ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h \ + ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h \ + ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h \ + ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h \ + ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ ../Geo/MElement.h ../Common/GmshDefines.h ../Geo/MVertex.h \ ../Geo/SPoint3.h ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h \ ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ ../Geo/GeoStringInterface.h ../Geo/findLinks.h ../Mesh/Generator.h \ ../Mesh/HighOrder.h ../Graphics/Draw.h ../Graphics/SelectBuffer.h \ ../Post/PView.h ../Post/PViewOptions.h ../Post/ColorTable.h \ - ../Post/PViewData.h ../Parser/CreateFile.h ../Parser/OpenFile.h \ + ../Post/PViewData.h ../Common/CreateFile.h ../Common/OpenFile.h \ ../Common/CommandLine.h ../Common/Context.h ../Common/Options.h GUI.h \ Opengl_Window.h Colorbar_Window.h Popup_Button.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ @@ -257,9 +257,9 @@ Colorbar_Window.o: Colorbar_Window.cpp ../Common/GmshUI.h GUI.h \ ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ ../Post/PView.h ../Common/Context.h -Solvers.o: Solvers.cpp ../Common/Message.h Solvers.h GmshServer.h \ - ../Parser/OpenFile.h ../Common/GmshUI.h GUI.h Opengl_Window.h \ - Colorbar_Window.h ../Post/ColorTable.h Popup_Button.h \ +Solvers.o: Solvers.cpp ../Common/Message.h ../Common/StringUtils.h \ + Solvers.h GmshServer.h ../Common/OpenFile.h ../Common/GmshUI.h GUI.h \ + Opengl_Window.h Colorbar_Window.h ../Post/ColorTable.h Popup_Button.h \ SpherePosition_Widget.h ../Mesh/Field.h ../Geo/Geo.h \ ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ diff --git a/Fltk/Solvers.cpp b/Fltk/Solvers.cpp index 79cf855eb68b589f1faa6f2f7ea2c07314b2e0fc..57cae93f11471a842e40c34358db9c4f1e9705ab 100644 --- a/Fltk/Solvers.cpp +++ b/Fltk/Solvers.cpp @@ -1,4 +1,4 @@ -// $Id: Solvers.cpp,v 1.64 2008-05-06 21:11:47 geuzaine Exp $ +// $Id: Solvers.cpp,v 1.65 2008-07-04 14:58:30 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -21,6 +21,7 @@ #include <string.h> #include "Message.h" +#include "StringUtils.h" #include "Solvers.h" #include "GmshServer.h" #include "OpenFile.h" @@ -86,7 +87,7 @@ int Solver(int num, const char *args) GmshServer server(CTX.solver.max_delay); if(num >= 0){ - FixWindowsPath(SINFO[num].executable_name, prog); + fixWindowsPath(SINFO[num].executable_name, prog); if(!SINFO[num].client_server) { sprintf(command, "%s %s", prog, args); #if !defined(WIN32) @@ -112,7 +113,7 @@ int Solver(int num, const char *args) sprintf(tmp, "%s%s-%d", CTX.home_dir, CTX.solver.socket_name, num); else sprintf(tmp, "%s%s", CTX.home_dir, CTX.solver.socket_name); - FixWindowsPath(tmp, sockname); + fixWindowsPath(tmp, sockname); } else{ // TCP/IP socket diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index a0f4238f0e41309d7c037726d03703124e15b4fb..34ba64c633c0b4881b204348e3e7401270fe62ae 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_Geo.cpp,v 1.25 2008-06-12 09:31:36 geuzaine Exp $ +// $Id: GModelIO_Geo.cpp,v 1.26 2008-07-04 14:58:31 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -30,9 +30,12 @@ #include "gmshFace.h" #include "gmshEdge.h" #include "gmshRegion.h" -#include "Parser.h" // for Symbol_T #include "Field.h" +#if !defined(HAVE_NO_PARSER) +#include "Parser.h" +#endif + void GModel::_createGEOInternals() { _geo_internals = new GEO_Internals; @@ -419,8 +422,9 @@ int GModel::writeGEO(const std::string &name, bool printLabels) std::for_each(firstFace(), lastFace(), writeGFaceGEO(fp)); std::for_each(firstRegion(), lastRegion(), writeGRegionGEO(fp)); - // get "old-style" labels from parser std::map<int, std::string> labels; +#if !defined(HAVE_NO_PARSER) + // get "old-style" labels from parser List_T *old = Tree2List(Symbol_T); for(int i = 0; i < List_Nbr(old); i++) { Symbol *s = (Symbol *)List_Pointer(old, i); @@ -431,6 +435,7 @@ int GModel::writeGEO(const std::string &name, bool printLabels) } } List_Delete(old); +#endif std::map<int, std::vector<GEntity*> > groups[4]; getPhysicalGroups(groups); diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index 53cd8a6562d01f01e63b71203e2cb6317fcf091b..e5ac39702daadcec1f38e4d4b5c37f2abf579a97 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -1,4 +1,4 @@ -// $Id: GModelIO_OCC.cpp,v 1.40 2008-07-03 17:06:01 geuzaine Exp $ +// $Id: GModelIO_OCC.cpp,v 1.41 2008-07-04 14:58:31 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -27,6 +27,7 @@ #include "OCCFace.h" #include "OCCRegion.h" #include "MElement.h" +#include "OpenFile.h" #if defined(HAVE_OCC_MESH_CONSTRAINTS) #include "MeshGmsh_Constrain.hxx" @@ -645,7 +646,6 @@ int GModel::importOCCShape(const void *shape, const void *meshConstraints) _occ_internals->loadShape((TopoDS_Shape*)shape); _occ_internals->buildGModel(this); snapVertices(); - extern void SetBoundingBox(); SetBoundingBox(); if(meshConstraints) applyOCCMeshConstraints(this, meshConstraints); return 1; diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index 4fd02a56719a121e192d836103d6dc3cf727c147..40a16d32300de0a0d623a20dbc72f605f225d563 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -1,4 +1,4 @@ -// $Id: Geo.cpp,v 1.120 2008-07-02 17:40:56 geuzaine Exp $ +// $Id: Geo.cpp,v 1.121 2008-07-04 14:58:31 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -26,7 +26,6 @@ #include "Geo.h" #include "GModel.h" #include "GeoInterpolation.h" -#include "Parser.h" #include "Field.h" #include "Context.h" diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index 8d00b8a43d3618f800c7a96e4b328c5ccd65e297..1a4646c52895692026a37e5f912af4cc9c750f79 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -1,4 +1,4 @@ -// $Id: GeoStringInterface.cpp,v 1.25 2008-06-27 18:00:52 geuzaine Exp $ +// $Id: GeoStringInterface.cpp,v 1.26 2008-07-04 14:58:31 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -24,13 +24,17 @@ #include "Message.h" #include "Numeric.h" #include "MallocUtils.h" +#include "StringUtils.h" #include "Geo.h" #include "GeoStringInterface.h" -#include "Parser.h" #include "OpenFile.h" #include "Context.h" #include "GModel.h" +#if !defined(HAVE_NO_PARSER) +#include "Parser.h" +#endif + extern Context_T CTX; #define BUFFSIZE 128000 @@ -50,6 +54,10 @@ static int snprintf(char *str, size_t size, const char* fmt, ...) double evaluate_scalarfunction(const char *var, double val, const char *funct) { +#if defined(HAVE_NO_PARSER) + Msg::Error("Scalar function evaluation not available without Gmsh parser"); + return 0.; +#else FILE *tempf; tempf = gmsh_yyin; @@ -79,10 +87,14 @@ double evaluate_scalarfunction(const char *var, double val, const char *funct) } Free(TheSymbol.Name); return *(double *)List_Pointer(TheSymbol_P->val, 0); +#endif } void add_infile(const char *text, const char *fich, bool deleted_something) { +#if defined(HAVE_NO_PARSER) + Msg::Error("GEO file creation not available without Gmsh parser"); +#else if(!(gmsh_yyin = fopen(CTX.tmp_filename_fullpath, "w"))) { Msg::Error("Unable to open temporary file '%s'", CTX.tmp_filename_fullpath); return; @@ -113,7 +125,7 @@ void add_infile(const char *text, const char *fich, bool deleted_something) if(!CTX.expert_mode) { char no_ext[256], ext[256], base[256]; - SplitFileName(fich, no_ext, ext, base); + splitFileName(fich, no_ext, ext, base); if(strlen(ext) && strcmp(ext, ".geo") && strcmp(ext, ".GEO")){ char question[1024]; sprintf(question, @@ -132,6 +144,7 @@ void add_infile(const char *text, const char *fich, bool deleted_something) fprintf(file, "%s\n", text); fclose(file); +#endif } void coherence(const char *fich) diff --git a/Geo/Makefile b/Geo/Makefile index bca6d43259ed27153bb2f72c05acfd6fd0d0d19a..6cc9d82c5778b7f457fbd593c8a40c2a6a8fb154 100644 --- a/Geo/Makefile +++ b/Geo/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.216 2008-07-03 17:06:02 geuzaine Exp $ +# $Id: Makefile,v 1.217 2008-07-04 14:58:31 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -206,9 +206,9 @@ GModelIO_Geo.o: GModelIO_Geo.cpp GModel.h GVertex.h GEntity.h Range.h \ gmshSurface.h ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ - ../Parser/OpenFile.h ../Common/Message.h gmshVertex.h MVertex.h \ - gmshFace.h gmshEdge.h gmshRegion.h ../Parser/Parser.h ../Mesh/Field.h \ - ../Geo/Geo.h ../Post/PView.h ../Geo/SPoint3.h + ../Common/OpenFile.h ../Common/Message.h gmshVertex.h MVertex.h \ + gmshFace.h gmshEdge.h gmshRegion.h ../Mesh/Field.h ../Geo/Geo.h \ + ../Post/PView.h ../Geo/SPoint3.h ../Parser/Parser.h GModelIO_Mesh.o: GModelIO_Mesh.cpp GModel.h GVertex.h GEntity.h Range.h \ SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h SVector3.h \ GFace.h GEdgeLoop.h Pair.h GRegion.h ../Common/GmshDefines.h MElement.h \ @@ -220,7 +220,7 @@ GModelIO_OCC.o: GModelIO_OCC.cpp GModelIO_OCC.h GModel.h GVertex.h \ SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h OCCIncludes.h \ ../Common/Message.h ../Common/Context.h OCCVertex.h MVertex.h OCCEdge.h \ OCCFace.h OCCRegion.h MElement.h ../Common/GmshDefines.h MEdge.h \ - MFace.h + MFace.h ../Common/OpenFile.h GModelIO_Fourier.o: GModelIO_Fourier.cpp GModel.h GVertex.h GEntity.h \ Range.h SPoint3.h SBoundingBox3d.h GPoint.h SPoint2.h GEdge.h \ SVector3.h GFace.h GEdgeLoop.h Pair.h GRegion.h ../Common/Message.h \ @@ -247,17 +247,17 @@ Geo.o: Geo.cpp ../Common/Message.h ../Numeric/Numeric.h \ ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ ExtrudeParams.h ../Common/SmoothData.h GModel.h GVertex.h GEntity.h \ GPoint.h GEdge.h GFace.h GEdgeLoop.h GRegion.h GeoInterpolation.h \ - ../Parser/Parser.h ../Mesh/Field.h ../Geo/Geo.h ../Post/PView.h \ - ../Geo/SPoint3.h ../Common/Context.h + ../Mesh/Field.h ../Geo/Geo.h ../Post/PView.h ../Geo/SPoint3.h \ + ../Common/Context.h GeoStringInterface.o: GeoStringInterface.cpp ../Common/Message.h \ ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h \ - ../Common/MallocUtils.h Geo.h ../Common/GmshDefines.h gmshSurface.h \ - Pair.h Range.h SPoint2.h SPoint3.h SVector3.h SBoundingBox3d.h \ - ../Common/ListUtils.h ../Common/TreeUtils.h ../Common/avl.h \ - ../Common/ListUtils.h ExtrudeParams.h ../Common/SmoothData.h \ - GeoStringInterface.h ../Parser/Parser.h ../Parser/OpenFile.h \ - ../Common/Context.h GModel.h GVertex.h GEntity.h GPoint.h GEdge.h \ - GFace.h GEdgeLoop.h GRegion.h + ../Common/MallocUtils.h ../Common/StringUtils.h Geo.h \ + ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ + SPoint3.h SVector3.h SBoundingBox3d.h ../Common/ListUtils.h \ + ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ + ExtrudeParams.h ../Common/SmoothData.h GeoStringInterface.h \ + ../Common/OpenFile.h ../Common/Context.h GModel.h GVertex.h GEntity.h \ + GPoint.h GEdge.h GFace.h GEdgeLoop.h GRegion.h ../Parser/Parser.h GeoInterpolation.o: GeoInterpolation.cpp ../Common/Message.h Geo.h \ ../Common/GmshDefines.h gmshSurface.h Pair.h Range.h SPoint2.h \ SPoint3.h SVector3.h SBoundingBox3d.h ../Numeric/Numeric.h \ diff --git a/Graphics/Makefile b/Graphics/Makefile index e083debc1692d7af4862ec63200ed03422b72f55..03c9c99d64c2250d91f161dc9390ed4419a3a943 100644 --- a/Graphics/Makefile +++ b/Graphics/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.156 2008-06-12 11:52:00 geuzaine Exp $ +# $Id: Makefile,v 1.157 2008-07-04 14:58:31 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -25,8 +25,8 @@ LIB = ../lib/libGmshGraphics${LIBEXT} INC = ${DASH}I../Common ${DASH}I../Geo ${DASH}I../Mesh\ ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Fltk ${DASH}I../Numeric\ - ${DASH}I../Parser ${DASH}I../Plugin ${DASH}I../contrib/MathEval\ - ${DASH}I../contrib/ANN/include + ${DASH}I../Plugin\ + ${DASH}I../contrib/MathEval ${DASH}I../contrib/ANN/include CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} diff --git a/Mesh/Makefile b/Mesh/Makefile index b3ced4eb27ef8591fea6c6c8901302e0ea106e81..2285569510482ca9e7577796410faac97d3f0834 100644 --- a/Mesh/Makefile +++ b/Mesh/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.227 2008-07-03 17:06:03 geuzaine Exp $ +# $Id: Makefile,v 1.228 2008-07-04 14:58:31 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -24,7 +24,7 @@ include ../variables LIB = ../lib/libGmshMesh${LIBEXT} INC = ${DASH}I../Numeric ${DASH}I../Common ${DASH}I../Geo\ - ${DASH}I../Mesh ${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Parser\ + ${DASH}I../Mesh ${DASH}I../Post ${DASH}I../Graphics\ ${DASH}I../Fltk ${DASH}I../contrib/NR ${DASH}I../contrib/Triangle\ ${DASH}I../contrib/Tetgen ${DASH}I../contrib/Netgen\ ${DASH}I../contrib/Netgen/libsrc/include\ diff --git a/Parser/CreateFile.cpp b/Parser/CreateFile.cpp deleted file mode 100644 index 9901b9da01b795cdcc3b41cc982b7c53fa9319fa..0000000000000000000000000000000000000000 --- a/Parser/CreateFile.cpp +++ /dev/null @@ -1,378 +0,0 @@ -// $Id: CreateFile.cpp,v 1.30 2008-05-06 21:11:48 geuzaine Exp $ -// -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#include <string.h> -#include "Message.h" -#include "GModel.h" -#include "GmshDefines.h" -#include "OpenFile.h" -#include "Context.h" -#include "Options.h" - -#if defined(HAVE_FLTK) -#include "GmshUI.h" -#include "gl2ps.h" -#include "gl2gif.h" -#include "gl2jpeg.h" -#include "gl2png.h" -#include "gl2ppm.h" -#include "gl2yuv.h" -#endif - -extern Context_T CTX; - -int GuessFileFormatFromFileName(const char *name) -{ - int len; - char ext[256]; - - for(len = strlen(name) - 1; len >= 0; len--) { - if(name[len] == '.') { - strcpy(ext, &name[len]); - break; - } - } - if(len <= 0) - strcpy(ext, ""); - - if (!strcmp(ext, ".geo")) return FORMAT_GEO; - else if(!strcmp(ext, ".msh")) return FORMAT_MSH; - else if(!strcmp(ext, ".pos")) return FORMAT_POS; - else if(!strcmp(ext, ".opt")) return FORMAT_OPT; - else if(!strcmp(ext, ".unv")) return FORMAT_UNV; - else if(!strcmp(ext, ".vtk")) return FORMAT_VTK; - else if(!strcmp(ext, ".stl")) return FORMAT_STL; - else if(!strcmp(ext, ".cgns")) return FORMAT_CGNS; - else if(!strcmp(ext, ".med")) return FORMAT_MED; - else if(!strcmp(ext, ".mesh")) return FORMAT_MESH; - else if(!strcmp(ext, ".bdf")) return FORMAT_BDF; - else if(!strcmp(ext, ".nas")) return FORMAT_BDF; - else if(!strcmp(ext, ".p3d")) return FORMAT_P3D; - else if(!strcmp(ext, ".wrl")) return FORMAT_VRML; - else if(!strcmp(ext, ".vrml")) return FORMAT_VRML; - else if(!strcmp(ext, ".gif")) return FORMAT_GIF; - else if(!strcmp(ext, ".jpg")) return FORMAT_JPEG; - else if(!strcmp(ext, ".jpeg")) return FORMAT_JPEG; - else if(!strcmp(ext, ".png")) return FORMAT_PNG; - else if(!strcmp(ext, ".ps")) return FORMAT_PS; - else if(!strcmp(ext, ".eps")) return FORMAT_EPS; - else if(!strcmp(ext, ".pdf")) return FORMAT_PDF; - else if(!strcmp(ext, ".tex")) return FORMAT_TEX; - else if(!strcmp(ext, ".svg")) return FORMAT_SVG; - else if(!strcmp(ext, ".ppm")) return FORMAT_PPM; - else if(!strcmp(ext, ".yuv")) return FORMAT_YUV; - else return -1; -} - -void GetDefaultFileName(int format, char *name) -{ - char ext[32] = ""; - strcpy(name, CTX.no_ext_filename); - switch(format){ - case FORMAT_GEO: strcpy(ext, ".geo_unrolled"); break; - case FORMAT_MSH: strcpy(ext, ".msh"); break; - case FORMAT_POS: strcpy(ext, ".pos"); break; - case FORMAT_OPT: strcpy(ext, ".opt"); break; - case FORMAT_UNV: strcpy(ext, ".unv"); break; - case FORMAT_VTK: strcpy(ext, ".vtk"); break; - case FORMAT_STL: strcpy(ext, ".stl"); break; - case FORMAT_CGNS: strcpy(ext, ".cgns"); break; - case FORMAT_MED: strcpy(ext, ".med"); break; - case FORMAT_MESH: strcpy(ext, ".mesh"); break; - case FORMAT_BDF: strcpy(ext, ".bdf"); break; - case FORMAT_P3D: strcpy(ext, ".p3d"); break; - case FORMAT_VRML: strcpy(ext, ".wrl"); break; - case FORMAT_GIF: strcpy(ext, ".gif"); break; - case FORMAT_JPEG: strcpy(ext, ".jpg"); break; - case FORMAT_PNG: strcpy(ext, ".png"); break; - case FORMAT_PS: strcpy(ext, ".ps"); break; - case FORMAT_EPS: strcpy(ext, ".eps"); break; - case FORMAT_PDF: strcpy(ext, ".pdf"); break; - case FORMAT_TEX: strcpy(ext, ".tex"); break; - case FORMAT_SVG: strcpy(ext, ".svg"); break; - case FORMAT_PPM: strcpy(ext, ".ppm"); break; - case FORMAT_YUV: strcpy(ext, ".yuv"); break; - default: break; - } - strcat(name, ext); -} - -void CreateOutputFile(const char *filename, int format) -{ - char name[256], no_ext[256], ext[256], base[256]; - - if(!filename || !strlen(filename)) - GetDefaultFileName(format, name); - else - strcpy(name, filename); - - SplitFileName(name, no_ext, ext, base); - - int oldformat = CTX.print.format; - CTX.print.format = format; - CTX.printing = 1; - -#if defined(HAVE_FLTK) - GLint viewport[4]; - for(int i = 0; i < 4; i++) viewport[i] = CTX.viewport[i]; - GLint width = viewport[2] - viewport[0]; - GLint height = viewport[3] - viewport[1]; -#endif - - bool printEndMessage = true; - if(format != FORMAT_AUTO) Msg::StatusBar(2, true, "Writing '%s'", name); - - switch (format) { - - case FORMAT_AUTO: - CreateOutputFile(name, GuessFileFormatFromFileName(name)); - printEndMessage = false; - break; - - case FORMAT_OPT: - Print_Options(0, GMSH_FULLRC, 1, 1, name); - break; - - case FORMAT_MSH: - GModel::current()->writeMSH(name, CTX.mesh.msh_file_version, CTX.mesh.msh_binary, - CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_STL: - GModel::current()->writeSTL(name, CTX.mesh.stl_binary, - CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_VRML: - GModel::current()->writeVRML(name, CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_UNV: - GModel::current()->writeUNV(name, CTX.mesh.save_all, CTX.mesh.save_groups_of_nodes, - CTX.mesh.scaling_factor); - break; - - case FORMAT_VTK: - GModel::current()->writeVTK(name, CTX.mesh.msh_binary, CTX.mesh.save_all, - CTX.mesh.scaling_factor); - break; - - case FORMAT_MESH: - GModel::current()->writeMESH(name, CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_BDF: - GModel::current()->writeBDF(name, CTX.mesh.bdf_field_format, - CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_P3D: - GModel::current()->writeP3D(name, CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_CGNS: - GModel::current()->writeCGNS(name, CTX.mesh.scaling_factor); - break; - - case FORMAT_MED: - GModel::current()->writeMED(name, CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_POS: - GModel::current()->writePOS(name, CTX.print.pos_elementary, CTX.print.pos_element, - CTX.print.pos_gamma, CTX.print.pos_eta, CTX.print.pos_rho, - CTX.mesh.save_all, CTX.mesh.scaling_factor); - break; - - case FORMAT_GEO: - GModel::current()->writeGEO(name, CTX.print.geo_labels); - break; - -#if defined(HAVE_FLTK) - case FORMAT_PPM: - case FORMAT_YUV: - case FORMAT_GIF: - case FORMAT_JPEG: - case FORMAT_PNG: - { - FILE *fp; - if(!(fp = fopen(name, "wb"))) { - Msg::Error("Unable to open file '%s'", name); - break; - } - - PixelBuffer buffer(width, height, GL_RGB, GL_UNSIGNED_BYTE); - - int old_bg_gradient = CTX.bg_gradient; - if(format == FORMAT_GIF && CTX.print.gif_transparent) - CTX.bg_gradient = 0; - buffer.Fill(CTX.batch); - CTX.bg_gradient = old_bg_gradient; - - if(format == FORMAT_PPM){ - create_ppm(fp, &buffer); - } - else if(format == FORMAT_YUV){ - create_yuv(fp, &buffer); - } - else if(format == FORMAT_GIF){ - create_gif(fp, &buffer, - CTX.print.gif_dither, - CTX.print.gif_sort, - CTX.print.gif_interlace, - CTX.print.gif_transparent, - CTX.UNPACK_RED(CTX.color.bg), - CTX.UNPACK_GREEN(CTX.color.bg), - CTX.UNPACK_BLUE(CTX.color.bg)); - } - else if(format == FORMAT_JPEG){ - create_jpeg(fp, &buffer, CTX.print.jpeg_quality, CTX.print.jpeg_smoothing); - } - else{ - create_png(fp, &buffer, 100); - } - fclose(fp); - } - break; - - case FORMAT_PS: - case FORMAT_EPS: - case FORMAT_PDF: - case FORMAT_SVG: - { - FILE *fp; - if(!(fp = fopen(name, "wb"))) { - Msg::Error("Unable to open file '%s'", name); - break; - } - - int psformat; - switch(format){ - case FORMAT_PDF: - psformat = GL2PS_PDF; - break; - case FORMAT_PS: - psformat = GL2PS_PS; - break; - case FORMAT_SVG: - psformat = GL2PS_SVG; - break; - default: - psformat = GL2PS_EPS; - break; - } - - int old_bg_gradient = CTX.bg_gradient; - if(!CTX.print.eps_background) CTX.bg_gradient = 0; - - PixelBuffer buffer(width, height, GL_RGB, GL_FLOAT); - - if(CTX.print.eps_quality == 0) - buffer.Fill(CTX.batch); - - int pssort = - (CTX.print.eps_quality == 3) ? GL2PS_NO_SORT : - (CTX.print.eps_quality == 2) ? GL2PS_BSP_SORT : - GL2PS_SIMPLE_SORT; - int psoptions = - GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT | - (CTX.print.eps_occlusion_culling ? GL2PS_OCCLUSION_CULL : 0) | - (CTX.print.eps_best_root ? GL2PS_BEST_ROOT : 0) | - (CTX.print.eps_background ? GL2PS_DRAW_BACKGROUND : 0) | - (CTX.print.eps_compress ? GL2PS_COMPRESS : 0) | - (CTX.print.eps_ps3shading ? 0 : GL2PS_NO_PS3_SHADING); - - GLint buffsize = 0; - int res = GL2PS_OVERFLOW; - while(res == GL2PS_OVERFLOW) { - buffsize += 2048 * 2048; - gl2psBeginPage(CTX.base_filename, "Gmsh", viewport, - psformat, pssort, psoptions, GL_RGBA, 0, NULL, - 15, 20, 10, buffsize, fp, base); - if(CTX.print.eps_quality == 0){ - double modelview[16], projection[16]; - glGetDoublev(GL_PROJECTION_MATRIX, projection); - glGetDoublev(GL_MODELVIEW_MATRIX, modelview); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho((double)CTX.viewport[0], (double)CTX.viewport[2], - (double)CTX.viewport[1], (double)CTX.viewport[3], -1., 1.); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glRasterPos2d(0, 0); - gl2psDrawPixels(width, height, 0, 0, GL_RGB, GL_FLOAT, buffer.GetPixels()); - glMatrixMode(GL_PROJECTION); - glLoadMatrixd(projection); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixd(modelview); - } - else{ - buffer.Fill(CTX.batch); - } - res = gl2psEndPage(); - } - - CTX.bg_gradient = old_bg_gradient; - fclose(fp); - } - break; - - case FORMAT_TEX: - { - FILE *fp; - if(!(fp = fopen(name, "w"))) { - Msg::Error("Unable to open file '%s'", name); - break; - } - GLint buffsize = 0; - int res = GL2PS_OVERFLOW; - while(res == GL2PS_OVERFLOW) { - buffsize += 2048 * 2048; - gl2psBeginPage(CTX.base_filename, "Gmsh", viewport, - GL2PS_TEX, GL2PS_NO_SORT, GL2PS_NONE, GL_RGBA, 0, NULL, - 0, 0, 0, buffsize, fp, base); - PixelBuffer buffer(width, height, GL_RGB, GL_UNSIGNED_BYTE); - int oldtext = CTX.print.text; - CTX.print.text = 1; - buffer.Fill(CTX.batch); - CTX.print.text = oldtext; - res = gl2psEndPage(); - } - fclose(fp); - } - break; -#endif - - default: - Msg::Error("Unknown output file format"); - printEndMessage = false; - break; - } - - if(printEndMessage) Msg::StatusBar(2, true, "Wrote '%s'", name); - - CTX.print.format = oldformat; - CTX.printing = 0; - -#if defined(HAVE_FLTK) - Draw(); -#endif -} diff --git a/Parser/CreateFile.h b/Parser/CreateFile.h deleted file mode 100644 index c7cc7f791aa3679d7c848a3c2c51dc9d340da7c8..0000000000000000000000000000000000000000 --- a/Parser/CreateFile.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _CREATE_FILE_H_ -#define _CREATE_FILE_H_ - -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -int GuessFileFormatFromFileName(const char *name); -void GetDefaultFileName(int format, char *name); -void CreateOutputFile(const char *name, int format); - -#endif diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 69c1d1fa88b128e148b1aef5aaf445bebd1782a4..c1e6e3a1f1a44090e113bbd3bdf96108950a7fb9 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -324,7 +324,7 @@ /* Copy the first part of user declarations. */ #line 1 "Gmsh.y" -// $Id: Gmsh.tab.cpp,v 1.371 2008-07-01 14:24:07 geuzaine Exp $ +// $Id: Gmsh.tab.cpp,v 1.372 2008-07-04 14:58:32 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -402,6 +402,7 @@ void yyerror(char *s); void yymsg(int level, const char *fmt, ...); void skip_until(const char *skip, const char *until); int PrintListOfDouble(char *format, List_T *list, char *buffer); +void FixRelativePath(const char *in, char *out); /* Enabling traces. */ @@ -424,7 +425,7 @@ int PrintListOfDouble(char *format, List_T *list, char *buffer); #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 82 "Gmsh.y" +#line 83 "Gmsh.y" { char *c; int i; @@ -435,7 +436,7 @@ typedef union YYSTYPE List_T *l; } /* Line 193 of yacc.c. */ -#line 439 "Gmsh.tab.cpp" +#line 440 "Gmsh.tab.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -448,7 +449,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 452 "Gmsh.tab.cpp" +#line 453 "Gmsh.tab.cpp" #ifdef short # undef short @@ -983,42 +984,42 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 148, 148, 149, 154, 156, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 177, 181, 188, 193, 208, 221, 250, 264, 275, 290, - 295, 296, 297, 298, 299, 303, 305, 310, 312, 318, - 464, 317, 482, 489, 500, 499, 518, 525, 536, 535, - 553, 568, 588, 587, 601, 602, 603, 604, 605, 609, - 610, 617, 648, 687, 741, 758, 776, 787, 804, 811, - 826, 844, 870, 897, 911, 928, 943, 961, 981, 1004, - 1013, 1019, 1039, 1060, 1086, 1098, 1115, 1119, 1129, 1132, - 1150, 1172, 1188, 1210, 1228, 1246, 1264, 1290, 1308, 1334, - 1354, 1372, 1390, 1416, 1433, 1452, 1470, 1509, 1515, 1521, - 1528, 1553, 1578, 1594, 1614, 1632, 1649, 1670, 1675, 1680, - 1685, 1690, 1701, 1707, 1716, 1717, 1722, 1725, 1729, 1752, - 1775, 1798, 1826, 1835, 1839, 1854, 1868, 1885, 1899, 1905, - 1911, 1920, 1934, 1982, 2000, 2015, 2037, 2049, 2073, 2077, - 2082, 2087, 2099, 2116, 2133, 2160, 2187, 2218, 2226, 2232, - 2239, 2243, 2252, 2260, 2268, 2277, 2276, 2289, 2288, 2301, - 2300, 2313, 2312, 2324, 2323, 2339, 2346, 2353, 2360, 2367, - 2374, 2381, 2388, 2395, 2403, 2402, 2414, 2413, 2425, 2424, - 2436, 2435, 2447, 2446, 2458, 2457, 2469, 2468, 2480, 2479, - 2491, 2490, 2505, 2508, 2514, 2523, 2543, 2566, 2570, 2594, - 2612, 2630, 2648, 2677, 2712, 2717, 2744, 2758, 2771, 2788, - 2794, 2800, 2803, 2812, 2822, 2823, 2824, 2825, 2826, 2827, - 2828, 2829, 2830, 2837, 2838, 2839, 2840, 2841, 2842, 2843, - 2844, 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, - 2854, 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, - 2864, 2865, 2866, 2867, 2868, 2870, 2871, 2872, 2873, 2874, - 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, - 2885, 2886, 2887, 2888, 2889, 2890, 2899, 2900, 2901, 2902, - 2903, 2904, 2905, 2909, 2925, 2940, 2960, 2973, 2986, 3009, - 3027, 3045, 3063, 3081, 3089, 3093, 3097, 3101, 3105, 3112, - 3116, 3120, 3124, 3131, 3136, 3144, 3149, 3153, 3158, 3162, - 3170, 3181, 3189, 3197, 3203, 3214, 3234, 3244, 3254, 3271, - 3298, 3303, 3307, 3311, 3324, 3328, 3340, 3347, 3368, 3372, - 3387, 3392, 3399, 3403, 3410, 3414, 3422, 3430, 3444, 3458, - 3462, 3481, 3504 + 0, 149, 149, 150, 155, 157, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 178, 182, 189, 194, 209, 222, 251, 265, 276, 291, + 296, 297, 298, 299, 300, 304, 306, 311, 313, 319, + 465, 318, 483, 490, 501, 500, 519, 526, 537, 536, + 554, 569, 589, 588, 602, 603, 604, 605, 606, 610, + 611, 618, 649, 688, 742, 759, 777, 788, 805, 812, + 827, 845, 871, 898, 912, 929, 944, 962, 982, 1005, + 1014, 1020, 1040, 1061, 1087, 1099, 1116, 1120, 1130, 1133, + 1151, 1173, 1189, 1211, 1229, 1247, 1265, 1291, 1309, 1335, + 1355, 1373, 1391, 1417, 1434, 1453, 1471, 1510, 1516, 1522, + 1529, 1554, 1579, 1595, 1615, 1633, 1650, 1671, 1676, 1681, + 1686, 1691, 1702, 1708, 1717, 1718, 1723, 1726, 1730, 1753, + 1776, 1799, 1827, 1836, 1840, 1855, 1869, 1886, 1900, 1906, + 1912, 1921, 1935, 1983, 2001, 2016, 2038, 2050, 2074, 2078, + 2083, 2088, 2100, 2117, 2134, 2161, 2188, 2219, 2227, 2233, + 2240, 2244, 2253, 2261, 2269, 2278, 2277, 2290, 2289, 2302, + 2301, 2314, 2313, 2325, 2324, 2340, 2347, 2354, 2361, 2368, + 2375, 2382, 2389, 2396, 2404, 2403, 2415, 2414, 2426, 2425, + 2437, 2436, 2448, 2447, 2459, 2458, 2470, 2469, 2481, 2480, + 2492, 2491, 2506, 2509, 2515, 2524, 2544, 2567, 2571, 2595, + 2613, 2631, 2649, 2678, 2713, 2718, 2745, 2759, 2772, 2789, + 2795, 2801, 2804, 2813, 2823, 2824, 2825, 2826, 2827, 2828, + 2829, 2830, 2831, 2838, 2839, 2840, 2841, 2842, 2843, 2844, + 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2852, 2853, 2854, + 2855, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, + 2865, 2866, 2867, 2868, 2869, 2871, 2872, 2873, 2874, 2875, + 2876, 2877, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, + 2886, 2887, 2888, 2889, 2890, 2891, 2900, 2901, 2902, 2903, + 2904, 2905, 2906, 2910, 2926, 2941, 2961, 2974, 2987, 3010, + 3028, 3046, 3064, 3082, 3090, 3094, 3098, 3102, 3106, 3113, + 3117, 3121, 3125, 3132, 3137, 3145, 3150, 3154, 3159, 3163, + 3171, 3182, 3190, 3198, 3204, 3215, 3235, 3245, 3255, 3272, + 3299, 3304, 3308, 3312, 3325, 3329, 3341, 3348, 3369, 3373, + 3388, 3393, 3400, 3404, 3411, 3415, 3423, 3431, 3445, 3459, + 3463, 3482, 3505 }; #endif @@ -3659,96 +3660,96 @@ yyreduce: switch (yyn) { case 3: -#line 149 "Gmsh.y" +#line 150 "Gmsh.y" { yyerrok; return 1; ;} break; case 6: -#line 160 "Gmsh.y" +#line 161 "Gmsh.y" { return 1; ;} break; case 7: -#line 161 "Gmsh.y" +#line 162 "Gmsh.y" { return 1; ;} break; case 8: -#line 162 "Gmsh.y" +#line 163 "Gmsh.y" { return 1; ;} break; case 9: -#line 163 "Gmsh.y" +#line 164 "Gmsh.y" { return 1; ;} break; case 10: -#line 164 "Gmsh.y" +#line 165 "Gmsh.y" { List_Delete((yyvsp[(1) - (1)].l)); return 1; ;} break; case 11: -#line 165 "Gmsh.y" +#line 166 "Gmsh.y" { return 1; ;} break; case 12: -#line 166 "Gmsh.y" +#line 167 "Gmsh.y" { return 1; ;} break; case 13: -#line 167 "Gmsh.y" +#line 168 "Gmsh.y" { return 1; ;} break; case 14: -#line 168 "Gmsh.y" +#line 169 "Gmsh.y" { List_Delete((yyvsp[(1) - (1)].l)); return 1; ;} break; case 15: -#line 169 "Gmsh.y" +#line 170 "Gmsh.y" { return 1; ;} break; case 16: -#line 170 "Gmsh.y" +#line 171 "Gmsh.y" { return 1; ;} break; case 17: -#line 171 "Gmsh.y" +#line 172 "Gmsh.y" { return 1; ;} break; case 18: -#line 172 "Gmsh.y" +#line 173 "Gmsh.y" { return 1; ;} break; case 19: -#line 173 "Gmsh.y" +#line 174 "Gmsh.y" { return 1; ;} break; case 20: -#line 178 "Gmsh.y" +#line 179 "Gmsh.y" { (yyval.c) = (char*)"w"; ;} break; case 21: -#line 182 "Gmsh.y" +#line 183 "Gmsh.y" { (yyval.c) = (char*)"a"; ;} break; case 22: -#line 189 "Gmsh.y" +#line 190 "Gmsh.y" { Msg::Direct((yyvsp[(3) - (5)].c)); Free((yyvsp[(3) - (5)].c)); @@ -3756,7 +3757,7 @@ yyreduce: break; case 23: -#line 194 "Gmsh.y" +#line 195 "Gmsh.y" { char tmpstring[1024]; FixRelativePath((yyvsp[(6) - (7)].c), tmpstring); @@ -3774,7 +3775,7 @@ yyreduce: break; case 24: -#line 209 "Gmsh.y" +#line 210 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (7)].c), (yyvsp[(5) - (7)].l), tmpstring); @@ -3790,7 +3791,7 @@ yyreduce: break; case 25: -#line 222 "Gmsh.y" +#line 223 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (9)].c), (yyvsp[(5) - (9)].l), tmpstring); @@ -3817,7 +3818,7 @@ yyreduce: break; case 26: -#line 251 "Gmsh.y" +#line 252 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (6)].c), "View") && ViewData->finalize()){ @@ -3834,7 +3835,7 @@ yyreduce: break; case 27: -#line 265 "Gmsh.y" +#line 266 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -3848,7 +3849,7 @@ yyreduce: break; case 28: -#line 276 "Gmsh.y" +#line 277 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -3862,7 +3863,7 @@ yyreduce: break; case 29: -#line 290 "Gmsh.y" +#line 291 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData = new PViewDataList(true); @@ -3871,27 +3872,27 @@ yyreduce: break; case 35: -#line 304 "Gmsh.y" +#line 305 "Gmsh.y" { ViewCoord[ViewCoordIdx++] = (yyvsp[(1) - (1)].d); ;} break; case 36: -#line 306 "Gmsh.y" +#line 307 "Gmsh.y" { ViewCoord[ViewCoordIdx++] = (yyvsp[(3) - (3)].d); ;} break; case 37: -#line 311 "Gmsh.y" +#line 312 "Gmsh.y" { if(ViewValueList) List_Add(ViewValueList, &(yyvsp[(1) - (1)].d)); ;} break; case 38: -#line 313 "Gmsh.y" +#line 314 "Gmsh.y" { if(ViewValueList) List_Add(ViewValueList, &(yyvsp[(3) - (3)].d)); ;} break; case 39: -#line 318 "Gmsh.y" +#line 319 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (1)].c), "SP")){ @@ -4040,7 +4041,7 @@ yyreduce: break; case 40: -#line 464 "Gmsh.y" +#line 465 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(ViewValueList){ @@ -4053,7 +4054,7 @@ yyreduce: break; case 41: -#line 474 "Gmsh.y" +#line 475 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(ViewValueList) (*ViewNumList)++; @@ -4062,7 +4063,7 @@ yyreduce: break; case 42: -#line 483 "Gmsh.y" +#line 484 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(1) - (1)].c)[i]); @@ -4072,7 +4073,7 @@ yyreduce: break; case 43: -#line 490 "Gmsh.y" +#line 491 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T2C, &(yyvsp[(3) - (3)].c)[i]); @@ -4082,7 +4083,7 @@ yyreduce: break; case 44: -#line 500 "Gmsh.y" +#line 501 "Gmsh.y" { #if !defined(HAVE_NO_POST) List_Add(ViewData->T2D, &(yyvsp[(3) - (8)].d)); @@ -4095,7 +4096,7 @@ yyreduce: break; case 45: -#line 510 "Gmsh.y" +#line 511 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData->NbT2++; @@ -4104,7 +4105,7 @@ yyreduce: break; case 46: -#line 519 "Gmsh.y" +#line 520 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(1) - (1)].c)[i]); @@ -4114,7 +4115,7 @@ yyreduce: break; case 47: -#line 526 "Gmsh.y" +#line 527 "Gmsh.y" { #if !defined(HAVE_NO_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c))+1; i++) List_Add(ViewData->T3C, &(yyvsp[(3) - (3)].c)[i]); @@ -4124,7 +4125,7 @@ yyreduce: break; case 48: -#line 536 "Gmsh.y" +#line 537 "Gmsh.y" { #if !defined(HAVE_NO_POST) List_Add(ViewData->T3D, &(yyvsp[(3) - (10)].d)); List_Add(ViewData->T3D, &(yyvsp[(5) - (10)].d)); @@ -4136,7 +4137,7 @@ yyreduce: break; case 49: -#line 545 "Gmsh.y" +#line 546 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewData->NbT3++; @@ -4145,7 +4146,7 @@ yyreduce: break; case 50: -#line 555 "Gmsh.y" +#line 556 "Gmsh.y" { #if !defined(HAVE_NO_POST) int type = @@ -4162,7 +4163,7 @@ yyreduce: break; case 51: -#line 572 "Gmsh.y" +#line 573 "Gmsh.y" { #if !defined(HAVE_NO_POST) int type = @@ -4178,7 +4179,7 @@ yyreduce: break; case 52: -#line 588 "Gmsh.y" +#line 589 "Gmsh.y" { #if !defined(HAVE_NO_POST) ViewValueList = ViewData->Time; @@ -4187,48 +4188,48 @@ yyreduce: break; case 53: -#line 594 "Gmsh.y" +#line 595 "Gmsh.y" { ;} break; case 54: -#line 601 "Gmsh.y" +#line 602 "Gmsh.y" { (yyval.i) = 0; ;} break; case 55: -#line 602 "Gmsh.y" +#line 603 "Gmsh.y" { (yyval.i) = 1; ;} break; case 56: -#line 603 "Gmsh.y" +#line 604 "Gmsh.y" { (yyval.i) = 2; ;} break; case 57: -#line 604 "Gmsh.y" +#line 605 "Gmsh.y" { (yyval.i) = 3; ;} break; case 58: -#line 605 "Gmsh.y" +#line 606 "Gmsh.y" { (yyval.i) = 4; ;} break; case 59: -#line 609 "Gmsh.y" +#line 610 "Gmsh.y" { (yyval.i) = 1; ;} break; case 60: -#line 610 "Gmsh.y" +#line 611 "Gmsh.y" { (yyval.i) = -1; ;} break; case 61: -#line 618 "Gmsh.y" +#line 619 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (4)].c); @@ -4262,7 +4263,7 @@ yyreduce: break; case 62: -#line 649 "Gmsh.y" +#line 650 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (7)].c); @@ -4304,7 +4305,7 @@ yyreduce: break; case 63: -#line 688 "Gmsh.y" +#line 689 "Gmsh.y" { if(List_Nbr((yyvsp[(4) - (9)].l)) != List_Nbr((yyvsp[(8) - (9)].l))){ yymsg(0, "Incompatible array dimensions in affectation"); @@ -4361,7 +4362,7 @@ yyreduce: break; case 64: -#line 742 "Gmsh.y" +#line 743 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (6)].c); @@ -4381,7 +4382,7 @@ yyreduce: break; case 65: -#line 759 "Gmsh.y" +#line 760 "Gmsh.y" { // appends to the list Symbol TheSymbol; @@ -4402,7 +4403,7 @@ yyreduce: break; case 66: -#line 777 "Gmsh.y" +#line 778 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (3)].c); @@ -4416,7 +4417,7 @@ yyreduce: break; case 67: -#line 788 "Gmsh.y" +#line 789 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (6)].c); @@ -4435,14 +4436,14 @@ yyreduce: break; case 68: -#line 805 "Gmsh.y" +#line 806 "Gmsh.y" { Msg::Warning("Named string expressions not implemented yet"); ;} break; case 69: -#line 812 "Gmsh.y" +#line 813 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -4460,7 +4461,7 @@ yyreduce: break; case 70: -#line 827 "Gmsh.y" +#line 828 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -4478,7 +4479,7 @@ yyreduce: break; case 71: -#line 845 "Gmsh.y" +#line 846 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4507,7 +4508,7 @@ yyreduce: break; case 72: -#line 871 "Gmsh.y" +#line 872 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4537,7 +4538,7 @@ yyreduce: break; case 73: -#line 898 "Gmsh.y" +#line 899 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4554,7 +4555,7 @@ yyreduce: break; case 74: -#line 912 "Gmsh.y" +#line 913 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -4571,7 +4572,7 @@ yyreduce: break; case 75: -#line 929 "Gmsh.y" +#line 930 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -4589,7 +4590,7 @@ yyreduce: break; case 76: -#line 944 "Gmsh.y" +#line 945 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -4607,7 +4608,7 @@ yyreduce: break; case 77: -#line 962 "Gmsh.y" +#line 963 "Gmsh.y" { GmshColorTable *ct = Get_ColorTable(0); if(!ct) @@ -4630,7 +4631,7 @@ yyreduce: break; case 78: -#line 982 "Gmsh.y" +#line 983 "Gmsh.y" { GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (9)].d)); if(!ct) @@ -4653,7 +4654,7 @@ yyreduce: break; case 79: -#line 1005 "Gmsh.y" +#line 1006 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (5)].c),"Background")){ GModel::current()->getFields()->background_field = (int)(yyvsp[(4) - (5)].d); @@ -4665,7 +4666,7 @@ yyreduce: break; case 80: -#line 1014 "Gmsh.y" +#line 1015 "Gmsh.y" { if(!GModel::current()->getFields()->new_field((int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c))) yymsg(0, "Cannot create field %i of type '%s'", (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c)); @@ -4674,7 +4675,7 @@ yyreduce: break; case 81: -#line 1020 "Gmsh.y" +#line 1021 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ @@ -4697,7 +4698,7 @@ yyreduce: break; case 82: -#line 1040 "Gmsh.y" +#line 1041 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ @@ -4721,7 +4722,7 @@ yyreduce: break; case 83: -#line 1061 "Gmsh.y" +#line 1062 "Gmsh.y" { Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (11)].d)); if(field){ @@ -4747,7 +4748,7 @@ yyreduce: break; case 84: -#line 1087 "Gmsh.y" +#line 1088 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -4762,7 +4763,7 @@ yyreduce: break; case 85: -#line 1099 "Gmsh.y" +#line 1100 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -4777,14 +4778,14 @@ yyreduce: break; case 86: -#line 1116 "Gmsh.y" +#line 1117 "Gmsh.y" { (yyval.i) = (int)(yyvsp[(1) - (1)].d); ;} break; case 87: -#line 1120 "Gmsh.y" +#line 1121 "Gmsh.y" { (yyval.i) = GModel::current()->setPhysicalName (std::string((yyvsp[(1) - (1)].c)), ++GModel::current()->getGEOInternals()->MaxPhysicalNum); @@ -4793,14 +4794,14 @@ yyreduce: break; case 88: -#line 1129 "Gmsh.y" +#line 1130 "Gmsh.y" { (yyval.l) = 0; ;} break; case 89: -#line 1133 "Gmsh.y" +#line 1134 "Gmsh.y" { (yyval.l) = List_Create(4, 4, sizeof(double)); Vertex *v = FindPoint((int)(yyvsp[(4) - (5)].d)); @@ -4815,7 +4816,7 @@ yyreduce: break; case 90: -#line 1151 "Gmsh.y" +#line 1152 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindPoint(num)){ @@ -4840,7 +4841,7 @@ yyreduce: break; case 91: -#line 1173 "Gmsh.y" +#line 1174 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_POINT)){ @@ -4859,7 +4860,7 @@ yyreduce: break; case 92: -#line 1189 "Gmsh.y" +#line 1190 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -4881,7 +4882,7 @@ yyreduce: break; case 93: -#line 1211 "Gmsh.y" +#line 1212 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4902,7 +4903,7 @@ yyreduce: break; case 94: -#line 1229 "Gmsh.y" +#line 1230 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4923,7 +4924,7 @@ yyreduce: break; case 95: -#line 1247 "Gmsh.y" +#line 1248 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4944,7 +4945,7 @@ yyreduce: break; case 96: -#line 1265 "Gmsh.y" +#line 1266 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindCurve(num)){ @@ -4973,7 +4974,7 @@ yyreduce: break; case 97: -#line 1291 "Gmsh.y" +#line 1292 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -4994,7 +4995,7 @@ yyreduce: break; case 98: -#line 1309 "Gmsh.y" +#line 1310 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindCurve(num)){ @@ -5023,7 +5024,7 @@ yyreduce: break; case 99: -#line 1336 "Gmsh.y" +#line 1337 "Gmsh.y" { int num = (int)(yyvsp[(3) - (17)].d); if(FindCurve(num)){ @@ -5045,7 +5046,7 @@ yyreduce: break; case 100: -#line 1355 "Gmsh.y" +#line 1356 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -5066,7 +5067,7 @@ yyreduce: break; case 101: -#line 1373 "Gmsh.y" +#line 1374 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindCurve(num)){ @@ -5087,7 +5088,7 @@ yyreduce: break; case 102: -#line 1391 "Gmsh.y" +#line 1392 "Gmsh.y" { int num = (int)(yyvsp[(3) - (11)].d); if(List_Nbr((yyvsp[(6) - (11)].l)) + (int)(yyvsp[(10) - (11)].d) + 1 != List_Nbr((yyvsp[(8) - (11)].l))){ @@ -5116,7 +5117,7 @@ yyreduce: break; case 103: -#line 1417 "Gmsh.y" +#line 1418 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindEdgeLoop(num)){ @@ -5136,7 +5137,7 @@ yyreduce: break; case 104: -#line 1434 "Gmsh.y" +#line 1435 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_LINE)){ @@ -5155,7 +5156,7 @@ yyreduce: break; case 105: -#line 1453 "Gmsh.y" +#line 1454 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindSurface(num)){ @@ -5176,7 +5177,7 @@ yyreduce: break; case 106: -#line 1471 "Gmsh.y" +#line 1472 "Gmsh.y" { int num = (int)(yyvsp[(4) - (9)].d), type = 0; if(FindSurface(num)){ @@ -5218,7 +5219,7 @@ yyreduce: break; case 107: -#line 1510 "Gmsh.y" +#line 1511 "Gmsh.y" { myGmshSurface = 0; (yyval.s).Type = 0; @@ -5227,7 +5228,7 @@ yyreduce: break; case 108: -#line 1516 "Gmsh.y" +#line 1517 "Gmsh.y" { myGmshSurface = gmshSurface::getSurface((int)(yyvsp[(3) - (4)].d)); (yyval.s).Type = 0; @@ -5236,7 +5237,7 @@ yyreduce: break; case 109: -#line 1522 "Gmsh.y" +#line 1523 "Gmsh.y" { int num = (int)(yyvsp[(4) - (10)].d); myGmshSurface = gmshParametricSurface::NewParametricSurface(num, (yyvsp[(7) - (10)].c), (yyvsp[(8) - (10)].c), (yyvsp[(9) - (10)].c)); @@ -5246,7 +5247,7 @@ yyreduce: break; case 110: -#line 1529 "Gmsh.y" +#line 1530 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if (List_Nbr((yyvsp[(6) - (7)].l)) != 2){ @@ -5274,7 +5275,7 @@ yyreduce: break; case 111: -#line 1554 "Gmsh.y" +#line 1555 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if (List_Nbr((yyvsp[(6) - (7)].l)) != 2){ @@ -5302,7 +5303,7 @@ yyreduce: break; case 112: -#line 1579 "Gmsh.y" +#line 1580 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].d); if(FindSurfaceLoop(num)){ @@ -5321,7 +5322,7 @@ yyreduce: break; case 113: -#line 1595 "Gmsh.y" +#line 1596 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_SURFACE)){ @@ -5340,7 +5341,7 @@ yyreduce: break; case 114: -#line 1615 "Gmsh.y" +#line 1616 "Gmsh.y" { yymsg(0, "'Complex Volume' command is deprecated: use 'Volume' instead"); int num = (int)(yyvsp[(4) - (8)].d); @@ -5361,7 +5362,7 @@ yyreduce: break; case 115: -#line 1633 "Gmsh.y" +#line 1634 "Gmsh.y" { int num = (int)(yyvsp[(3) - (7)].d); if(FindVolume(num)){ @@ -5381,7 +5382,7 @@ yyreduce: break; case 116: -#line 1650 "Gmsh.y" +#line 1651 "Gmsh.y" { int num = (int)(yyvsp[(4) - (8)].i); if(FindPhysicalGroup(num, MSH_PHYSICAL_VOLUME)){ @@ -5400,7 +5401,7 @@ yyreduce: break; case 117: -#line 1671 "Gmsh.y" +#line 1672 "Gmsh.y" { TranslateShapes((yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], (yyvsp[(4) - (5)].l)); (yyval.l) = (yyvsp[(4) - (5)].l); @@ -5408,7 +5409,7 @@ yyreduce: break; case 118: -#line 1676 "Gmsh.y" +#line 1677 "Gmsh.y" { RotateShapes((yyvsp[(3) - (11)].v)[0], (yyvsp[(3) - (11)].v)[1], (yyvsp[(3) - (11)].v)[2], (yyvsp[(5) - (11)].v)[0], (yyvsp[(5) - (11)].v)[1], (yyvsp[(5) - (11)].v)[2], (yyvsp[(7) - (11)].d), (yyvsp[(10) - (11)].l)); (yyval.l) = (yyvsp[(10) - (11)].l); @@ -5416,7 +5417,7 @@ yyreduce: break; case 119: -#line 1681 "Gmsh.y" +#line 1682 "Gmsh.y" { SymmetryShapes((yyvsp[(2) - (5)].v)[0], (yyvsp[(2) - (5)].v)[1], (yyvsp[(2) - (5)].v)[2], (yyvsp[(2) - (5)].v)[3], (yyvsp[(4) - (5)].l)); (yyval.l) = (yyvsp[(4) - (5)].l); @@ -5424,7 +5425,7 @@ yyreduce: break; case 120: -#line 1686 "Gmsh.y" +#line 1687 "Gmsh.y" { DilatShapes((yyvsp[(3) - (9)].v)[0], (yyvsp[(3) - (9)].v)[1], (yyvsp[(3) - (9)].v)[2], (yyvsp[(5) - (9)].d), (yyvsp[(8) - (9)].l)); (yyval.l) = (yyvsp[(8) - (9)].l); @@ -5432,7 +5433,7 @@ yyreduce: break; case 121: -#line 1691 "Gmsh.y" +#line 1692 "Gmsh.y" { (yyval.l) = List_Create(3, 3, sizeof(Shape)); for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ @@ -5446,7 +5447,7 @@ yyreduce: break; case 122: -#line 1702 "Gmsh.y" +#line 1703 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); IntersectCurvesWithSurface((yyvsp[(4) - (9)].l), (int)(yyvsp[(8) - (9)].d), (yyval.l)); @@ -5455,7 +5456,7 @@ yyreduce: break; case 123: -#line 1708 "Gmsh.y" +#line 1709 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); BoundaryShapes((yyvsp[(3) - (4)].l), (yyval.l)); @@ -5464,31 +5465,31 @@ yyreduce: break; case 124: -#line 1716 "Gmsh.y" +#line 1717 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 125: -#line 1717 "Gmsh.y" +#line 1718 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 126: -#line 1722 "Gmsh.y" +#line 1723 "Gmsh.y" { (yyval.l) = List_Create(3, 3, sizeof(Shape)); ;} break; case 127: -#line 1726 "Gmsh.y" +#line 1727 "Gmsh.y" { List_Add((yyval.l), &(yyvsp[(2) - (2)].s)); ;} break; case 128: -#line 1730 "Gmsh.y" +#line 1731 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5514,7 +5515,7 @@ yyreduce: break; case 129: -#line 1753 "Gmsh.y" +#line 1754 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5540,7 +5541,7 @@ yyreduce: break; case 130: -#line 1776 "Gmsh.y" +#line 1777 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5566,7 +5567,7 @@ yyreduce: break; case 131: -#line 1799 "Gmsh.y" +#line 1800 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (6)].l)); i++){ double d; @@ -5592,7 +5593,7 @@ yyreduce: break; case 132: -#line 1827 "Gmsh.y" +#line 1828 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5604,14 +5605,14 @@ yyreduce: break; case 133: -#line 1836 "Gmsh.y" +#line 1837 "Gmsh.y" { GModel::current()->getFields()->delete_field((int)(yyvsp[(4) - (6)].d)); ;} break; case 134: -#line 1840 "Gmsh.y" +#line 1841 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ @@ -5629,7 +5630,7 @@ yyreduce: break; case 135: -#line 1855 "Gmsh.y" +#line 1856 "Gmsh.y" { if(!strcmp((yyvsp[(2) - (3)].c), "Meshes") || !strcmp((yyvsp[(2) - (3)].c), "All")){ GModel::current()->destroy(); @@ -5646,7 +5647,7 @@ yyreduce: break; case 136: -#line 1869 "Gmsh.y" +#line 1870 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (4)].c), "Empty") && !strcmp((yyvsp[(3) - (4)].c), "Views")){ @@ -5661,7 +5662,7 @@ yyreduce: break; case 137: -#line 1886 "Gmsh.y" +#line 1887 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(4) - (5)].l)); i++){ Shape TheShape; @@ -5673,7 +5674,7 @@ yyreduce: break; case 138: -#line 1900 "Gmsh.y" +#line 1901 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 1); @@ -5682,7 +5683,7 @@ yyreduce: break; case 139: -#line 1906 "Gmsh.y" +#line 1907 "Gmsh.y" { for(int i = 0; i < 4; i++) VisibilityShape((yyvsp[(2) - (3)].c), i, 0); @@ -5691,7 +5692,7 @@ yyreduce: break; case 140: -#line 1912 "Gmsh.y" +#line 1913 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5703,7 +5704,7 @@ yyreduce: break; case 141: -#line 1921 "Gmsh.y" +#line 1922 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ Shape TheShape; @@ -5715,7 +5716,7 @@ yyreduce: break; case 142: -#line 1935 "Gmsh.y" +#line 1936 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Include")){ char tmpstring[1024]; @@ -5766,7 +5767,7 @@ yyreduce: break; case 143: -#line 1983 "Gmsh.y" +#line 1984 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (7)].c), "Save") && !strcmp((yyvsp[(2) - (7)].c), "View")){ @@ -5787,7 +5788,7 @@ yyreduce: break; case 144: -#line 2001 "Gmsh.y" +#line 2002 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(1) - (7)].c), "Background") && !strcmp((yyvsp[(2) - (7)].c), "Mesh") && !strcmp((yyvsp[(3) - (7)].c), "View")){ @@ -5805,7 +5806,7 @@ yyreduce: break; case 145: -#line 2016 "Gmsh.y" +#line 2017 "Gmsh.y" { if(!strcmp((yyvsp[(1) - (3)].c), "Sleep")){ SleepInSeconds((yyvsp[(2) - (3)].d)); @@ -5830,7 +5831,7 @@ yyreduce: break; case 146: -#line 2038 "Gmsh.y" +#line 2039 "Gmsh.y" { #if !defined(HAVE_NO_POST) try { @@ -5845,7 +5846,7 @@ yyreduce: break; case 147: -#line 2050 "Gmsh.y" +#line 2051 "Gmsh.y" { #if !defined(HAVE_NO_POST) if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromAllViews")) @@ -5872,14 +5873,14 @@ yyreduce: break; case 148: -#line 2074 "Gmsh.y" +#line 2075 "Gmsh.y" { exit(0); ;} break; case 149: -#line 2078 "Gmsh.y" +#line 2079 "Gmsh.y" { CTX.forced_bbox = 0; SetBoundingBox(); @@ -5887,7 +5888,7 @@ yyreduce: break; case 150: -#line 2083 "Gmsh.y" +#line 2084 "Gmsh.y" { CTX.forced_bbox = 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)); @@ -5895,7 +5896,7 @@ yyreduce: break; case 151: -#line 2088 "Gmsh.y" +#line 2089 "Gmsh.y" { #if defined(HAVE_FLTK) Draw(); @@ -5904,7 +5905,7 @@ yyreduce: break; case 152: -#line 2100 "Gmsh.y" +#line 2101 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (6)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (6)].d); @@ -5924,7 +5925,7 @@ yyreduce: break; case 153: -#line 2117 "Gmsh.y" +#line 2118 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(3) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(5) - (8)].d); @@ -5944,7 +5945,7 @@ yyreduce: break; case 154: -#line 2134 "Gmsh.y" +#line 2135 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (8)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (8)].d); @@ -5974,7 +5975,7 @@ yyreduce: break; case 155: -#line 2161 "Gmsh.y" +#line 2162 "Gmsh.y" { LoopControlVariablesTab[ImbricatedLoop][0] = (yyvsp[(5) - (10)].d); LoopControlVariablesTab[ImbricatedLoop][1] = (yyvsp[(7) - (10)].d); @@ -6004,7 +6005,7 @@ yyreduce: break; case 156: -#line 2188 "Gmsh.y" +#line 2189 "Gmsh.y" { if(ImbricatedLoop <= 0){ yymsg(0, "Invalid For/EndFor loop"); @@ -6038,7 +6039,7 @@ yyreduce: break; case 157: -#line 2219 "Gmsh.y" +#line 2220 "Gmsh.y" { if(!FunctionManager::Instance()->createFunction((yyvsp[(2) - (2)].c), gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6049,7 +6050,7 @@ yyreduce: break; case 158: -#line 2227 "Gmsh.y" +#line 2228 "Gmsh.y" { if(!FunctionManager::Instance()->leaveFunction(&gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6058,7 +6059,7 @@ yyreduce: break; case 159: -#line 2233 "Gmsh.y" +#line 2234 "Gmsh.y" { if(!FunctionManager::Instance()->enterFunction((yyvsp[(2) - (3)].c), &gmsh_yyin, gmsh_yyname, gmsh_yylineno)) @@ -6068,20 +6069,20 @@ yyreduce: break; case 160: -#line 2240 "Gmsh.y" +#line 2241 "Gmsh.y" { if(!(yyvsp[(3) - (4)].d)) skip_until("If", "EndIf"); ;} break; case 161: -#line 2244 "Gmsh.y" +#line 2245 "Gmsh.y" { ;} break; case 162: -#line 2253 "Gmsh.y" +#line 2254 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (5)].l), @@ -6092,7 +6093,7 @@ yyreduce: break; case 163: -#line 2261 "Gmsh.y" +#line 2262 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (11)].l), @@ -6103,7 +6104,7 @@ yyreduce: break; case 164: -#line 2269 "Gmsh.y" +#line 2270 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (13)].l), @@ -6114,14 +6115,14 @@ yyreduce: break; case 165: -#line 2277 "Gmsh.y" +#line 2278 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 166: -#line 2281 "Gmsh.y" +#line 2282 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE, (yyvsp[(4) - (7)].l), @@ -6132,14 +6133,14 @@ yyreduce: break; case 167: -#line 2289 "Gmsh.y" +#line 2290 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 168: -#line 2293 "Gmsh.y" +#line 2294 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(ROTATE, (yyvsp[(10) - (13)].l), @@ -6150,14 +6151,14 @@ yyreduce: break; case 169: -#line 2301 "Gmsh.y" +#line 2302 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 170: -#line 2305 "Gmsh.y" +#line 2306 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(TRANSLATE_ROTATE, (yyvsp[(12) - (15)].l), @@ -6168,14 +6169,14 @@ yyreduce: break; case 171: -#line 2313 "Gmsh.y" +#line 2314 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 172: -#line 2317 "Gmsh.y" +#line 2318 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShapes(BOUNDARY_LAYER, (yyvsp[(3) - (6)].l), 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., @@ -6185,14 +6186,14 @@ yyreduce: break; case 173: -#line 2324 "Gmsh.y" +#line 2325 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 174: -#line 2328 "Gmsh.y" +#line 2329 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); extr.mesh.ViewIndex = (int)(yyvsp[(4) - (10)].d); @@ -6205,7 +6206,7 @@ yyreduce: break; case 175: -#line 2340 "Gmsh.y" +#line 2341 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (8)].d), @@ -6215,7 +6216,7 @@ yyreduce: break; case 176: -#line 2347 "Gmsh.y" +#line 2348 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (8)].d), @@ -6225,7 +6226,7 @@ yyreduce: break; case 177: -#line 2354 "Gmsh.y" +#line 2355 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (8)].d), @@ -6235,7 +6236,7 @@ yyreduce: break; case 178: -#line 2361 "Gmsh.y" +#line 2362 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6245,7 +6246,7 @@ yyreduce: break; case 179: -#line 2368 "Gmsh.y" +#line 2369 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6255,7 +6256,7 @@ yyreduce: break; case 180: -#line 2375 "Gmsh.y" +#line 2376 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6265,7 +6266,7 @@ yyreduce: break; case 181: -#line 2382 "Gmsh.y" +#line 2383 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (14)].d), @@ -6275,7 +6276,7 @@ yyreduce: break; case 182: -#line 2389 "Gmsh.y" +#line 2390 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (14)].d), @@ -6285,7 +6286,7 @@ yyreduce: break; case 183: -#line 2396 "Gmsh.y" +#line 2397 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (14)].d), @@ -6295,14 +6296,14 @@ yyreduce: break; case 184: -#line 2403 "Gmsh.y" +#line 2404 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 185: -#line 2407 "Gmsh.y" +#line 2408 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_POINT, (int)(yyvsp[(4) - (12)].d), @@ -6312,14 +6313,14 @@ yyreduce: break; case 186: -#line 2414 "Gmsh.y" +#line 2415 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 187: -#line 2418 "Gmsh.y" +#line 2419 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (12)].d), @@ -6329,14 +6330,14 @@ yyreduce: break; case 188: -#line 2425 "Gmsh.y" +#line 2426 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 189: -#line 2429 "Gmsh.y" +#line 2430 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (12)].d), @@ -6346,14 +6347,14 @@ yyreduce: break; case 190: -#line 2436 "Gmsh.y" +#line 2437 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 191: -#line 2440 "Gmsh.y" +#line 2441 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_POINT, (int)(yyvsp[(4) - (16)].d), @@ -6363,14 +6364,14 @@ yyreduce: break; case 192: -#line 2447 "Gmsh.y" +#line 2448 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 193: -#line 2451 "Gmsh.y" +#line 2452 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (16)].d), @@ -6380,14 +6381,14 @@ yyreduce: break; case 194: -#line 2458 "Gmsh.y" +#line 2459 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 195: -#line 2462 "Gmsh.y" +#line 2463 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (16)].d), @@ -6397,14 +6398,14 @@ yyreduce: break; case 196: -#line 2469 "Gmsh.y" +#line 2470 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 197: -#line 2473 "Gmsh.y" +#line 2474 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_POINT, (int)(yyvsp[(4) - (18)].d), @@ -6414,14 +6415,14 @@ yyreduce: break; case 198: -#line 2480 "Gmsh.y" +#line 2481 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 199: -#line 2484 "Gmsh.y" +#line 2485 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SEGM_LINE, (int)(yyvsp[(4) - (18)].d), @@ -6431,14 +6432,14 @@ yyreduce: break; case 200: -#line 2491 "Gmsh.y" +#line 2492 "Gmsh.y" { extr.mesh.ExtrudeMesh = extr.mesh.Recombine = false; ;} break; case 201: -#line 2495 "Gmsh.y" +#line 2496 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(Shape)); ExtrudeShape(TRANSLATE_ROTATE, MSH_SURF_PLAN, (int)(yyvsp[(4) - (18)].d), @@ -6448,19 +6449,19 @@ yyreduce: break; case 202: -#line 2506 "Gmsh.y" +#line 2507 "Gmsh.y" { ;} break; case 203: -#line 2509 "Gmsh.y" +#line 2510 "Gmsh.y" { ;} break; case 204: -#line 2515 "Gmsh.y" +#line 2516 "Gmsh.y" { extr.mesh.ExtrudeMesh = true; extr.mesh.NbLayer = 1; @@ -6472,7 +6473,7 @@ yyreduce: break; case 205: -#line 2524 "Gmsh.y" +#line 2525 "Gmsh.y" { double d; extr.mesh.ExtrudeMesh = true; @@ -6495,7 +6496,7 @@ yyreduce: break; case 206: -#line 2544 "Gmsh.y" +#line 2545 "Gmsh.y" { yymsg(0, "Explicit region numbers in layers are deprecated"); double d; @@ -6521,14 +6522,14 @@ yyreduce: break; case 207: -#line 2567 "Gmsh.y" +#line 2568 "Gmsh.y" { extr.mesh.Recombine = true; ;} break; case 208: -#line 2571 "Gmsh.y" +#line 2572 "Gmsh.y" { int num = (int)(yyvsp[(3) - (9)].d); if(FindSurface(num)){ @@ -6550,7 +6551,7 @@ yyreduce: break; case 209: -#line 2595 "Gmsh.y" +#line 2596 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6571,7 +6572,7 @@ yyreduce: break; case 210: -#line 2613 "Gmsh.y" +#line 2614 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6592,7 +6593,7 @@ yyreduce: break; case 211: -#line 2631 "Gmsh.y" +#line 2632 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (9)].l)); i++){ double d; @@ -6613,7 +6614,7 @@ yyreduce: break; case 212: -#line 2649 "Gmsh.y" +#line 2650 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (8)].d)); if(!s) @@ -6645,7 +6646,7 @@ yyreduce: break; case 213: -#line 2678 "Gmsh.y" +#line 2679 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(4) - (9)].d)); if(!s) @@ -6683,7 +6684,7 @@ yyreduce: break; case 214: -#line 2713 "Gmsh.y" +#line 2714 "Gmsh.y" { yymsg(1, "Elliptic Surface is deprecated: use Transfinite instead (with smoothing)"); List_Delete((yyvsp[(7) - (8)].l)); @@ -6691,7 +6692,7 @@ yyreduce: break; case 215: -#line 2718 "Gmsh.y" +#line 2719 "Gmsh.y" { Volume *v = FindVolume((int)(yyvsp[(4) - (8)].d)); if(!v) @@ -6721,7 +6722,7 @@ yyreduce: break; case 216: -#line 2745 "Gmsh.y" +#line 2746 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6738,7 +6739,7 @@ yyreduce: break; case 217: -#line 2759 "Gmsh.y" +#line 2760 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (4)].l)); i++){ double d; @@ -6754,7 +6755,7 @@ yyreduce: break; case 218: -#line 2772 "Gmsh.y" +#line 2773 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (6)].l)); i++){ double d; @@ -6768,7 +6769,7 @@ yyreduce: break; case 219: -#line 2789 "Gmsh.y" +#line 2790 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6777,7 +6778,7 @@ yyreduce: break; case 220: -#line 2795 "Gmsh.y" +#line 2796 "Gmsh.y" { Surface *s = FindSurface((int)(yyvsp[(8) - (10)].d)); if(s) @@ -6786,66 +6787,66 @@ yyreduce: break; case 221: -#line 2801 "Gmsh.y" +#line 2802 "Gmsh.y" { ;} break; case 222: -#line 2804 "Gmsh.y" +#line 2805 "Gmsh.y" { ;} break; case 223: -#line 2813 "Gmsh.y" +#line 2814 "Gmsh.y" { ReplaceAllDuplicates(); ;} break; case 224: -#line 2822 "Gmsh.y" +#line 2823 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 225: -#line 2823 "Gmsh.y" +#line 2824 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (3)].d); ;} break; case 226: -#line 2824 "Gmsh.y" +#line 2825 "Gmsh.y" { (yyval.d) = -(yyvsp[(2) - (2)].d); ;} break; case 227: -#line 2825 "Gmsh.y" +#line 2826 "Gmsh.y" { (yyval.d) = (yyvsp[(2) - (2)].d); ;} break; case 228: -#line 2826 "Gmsh.y" +#line 2827 "Gmsh.y" { (yyval.d) = !(yyvsp[(2) - (2)].d); ;} break; case 229: -#line 2827 "Gmsh.y" +#line 2828 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) - (yyvsp[(3) - (3)].d); ;} break; case 230: -#line 2828 "Gmsh.y" +#line 2829 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) + (yyvsp[(3) - (3)].d); ;} break; case 231: -#line 2829 "Gmsh.y" +#line 2830 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) * (yyvsp[(3) - (3)].d); ;} break; case 232: -#line 2831 "Gmsh.y" +#line 2832 "Gmsh.y" { if(!(yyvsp[(3) - (3)].d)) yymsg(0, "Division by zero in '%g / %g'", (yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); @@ -6855,307 +6856,307 @@ yyreduce: break; case 233: -#line 2837 "Gmsh.y" +#line 2838 "Gmsh.y" { (yyval.d) = (int)(yyvsp[(1) - (3)].d) % (int)(yyvsp[(3) - (3)].d); ;} break; case 234: -#line 2838 "Gmsh.y" +#line 2839 "Gmsh.y" { (yyval.d) = pow((yyvsp[(1) - (3)].d), (yyvsp[(3) - (3)].d)); ;} break; case 235: -#line 2839 "Gmsh.y" +#line 2840 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d); ;} break; case 236: -#line 2840 "Gmsh.y" +#line 2841 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) > (yyvsp[(3) - (3)].d); ;} break; case 237: -#line 2841 "Gmsh.y" +#line 2842 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) <= (yyvsp[(3) - (3)].d); ;} break; case 238: -#line 2842 "Gmsh.y" +#line 2843 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) >= (yyvsp[(3) - (3)].d); ;} break; case 239: -#line 2843 "Gmsh.y" +#line 2844 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) == (yyvsp[(3) - (3)].d); ;} break; case 240: -#line 2844 "Gmsh.y" +#line 2845 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) != (yyvsp[(3) - (3)].d); ;} break; case 241: -#line 2845 "Gmsh.y" +#line 2846 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) && (yyvsp[(3) - (3)].d); ;} break; case 242: -#line 2846 "Gmsh.y" +#line 2847 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (3)].d) || (yyvsp[(3) - (3)].d); ;} break; case 243: -#line 2847 "Gmsh.y" +#line 2848 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (5)].d)? (yyvsp[(3) - (5)].d) : (yyvsp[(5) - (5)].d); ;} break; case 244: -#line 2848 "Gmsh.y" +#line 2849 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 245: -#line 2849 "Gmsh.y" +#line 2850 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 246: -#line 2850 "Gmsh.y" +#line 2851 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 247: -#line 2851 "Gmsh.y" +#line 2852 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 248: -#line 2852 "Gmsh.y" +#line 2853 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 249: -#line 2853 "Gmsh.y" +#line 2854 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 250: -#line 2854 "Gmsh.y" +#line 2855 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 251: -#line 2855 "Gmsh.y" +#line 2856 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 252: -#line 2856 "Gmsh.y" +#line 2857 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 253: -#line 2857 "Gmsh.y" +#line 2858 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 254: -#line 2858 "Gmsh.y" +#line 2859 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 255: -#line 2859 "Gmsh.y" +#line 2860 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 256: -#line 2860 "Gmsh.y" +#line 2861 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 257: -#line 2861 "Gmsh.y" +#line 2862 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 258: -#line 2862 "Gmsh.y" +#line 2863 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 259: -#line 2863 "Gmsh.y" +#line 2864 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 260: -#line 2864 "Gmsh.y" +#line 2865 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 261: -#line 2865 "Gmsh.y" +#line 2866 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 262: -#line 2866 "Gmsh.y" +#line 2867 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 263: -#line 2867 "Gmsh.y" +#line 2868 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 264: -#line 2868 "Gmsh.y" +#line 2869 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 265: -#line 2870 "Gmsh.y" +#line 2871 "Gmsh.y" { (yyval.d) = exp((yyvsp[(3) - (4)].d)); ;} break; case 266: -#line 2871 "Gmsh.y" +#line 2872 "Gmsh.y" { (yyval.d) = log((yyvsp[(3) - (4)].d)); ;} break; case 267: -#line 2872 "Gmsh.y" +#line 2873 "Gmsh.y" { (yyval.d) = log10((yyvsp[(3) - (4)].d)); ;} break; case 268: -#line 2873 "Gmsh.y" +#line 2874 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (4)].d)); ;} break; case 269: -#line 2874 "Gmsh.y" +#line 2875 "Gmsh.y" { (yyval.d) = sin((yyvsp[(3) - (4)].d)); ;} break; case 270: -#line 2875 "Gmsh.y" +#line 2876 "Gmsh.y" { (yyval.d) = asin((yyvsp[(3) - (4)].d)); ;} break; case 271: -#line 2876 "Gmsh.y" +#line 2877 "Gmsh.y" { (yyval.d) = cos((yyvsp[(3) - (4)].d)); ;} break; case 272: -#line 2877 "Gmsh.y" +#line 2878 "Gmsh.y" { (yyval.d) = acos((yyvsp[(3) - (4)].d)); ;} break; case 273: -#line 2878 "Gmsh.y" +#line 2879 "Gmsh.y" { (yyval.d) = tan((yyvsp[(3) - (4)].d)); ;} break; case 274: -#line 2879 "Gmsh.y" +#line 2880 "Gmsh.y" { (yyval.d) = atan((yyvsp[(3) - (4)].d)); ;} break; case 275: -#line 2880 "Gmsh.y" +#line 2881 "Gmsh.y" { (yyval.d) = atan2((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d));;} break; case 276: -#line 2881 "Gmsh.y" +#line 2882 "Gmsh.y" { (yyval.d) = sinh((yyvsp[(3) - (4)].d)); ;} break; case 277: -#line 2882 "Gmsh.y" +#line 2883 "Gmsh.y" { (yyval.d) = cosh((yyvsp[(3) - (4)].d)); ;} break; case 278: -#line 2883 "Gmsh.y" +#line 2884 "Gmsh.y" { (yyval.d) = tanh((yyvsp[(3) - (4)].d)); ;} break; case 279: -#line 2884 "Gmsh.y" +#line 2885 "Gmsh.y" { (yyval.d) = fabs((yyvsp[(3) - (4)].d)); ;} break; case 280: -#line 2885 "Gmsh.y" +#line 2886 "Gmsh.y" { (yyval.d) = floor((yyvsp[(3) - (4)].d)); ;} break; case 281: -#line 2886 "Gmsh.y" +#line 2887 "Gmsh.y" { (yyval.d) = ceil((yyvsp[(3) - (4)].d)); ;} break; case 282: -#line 2887 "Gmsh.y" +#line 2888 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 283: -#line 2888 "Gmsh.y" +#line 2889 "Gmsh.y" { (yyval.d) = fmod((yyvsp[(3) - (6)].d), (yyvsp[(5) - (6)].d)); ;} break; case 284: -#line 2889 "Gmsh.y" +#line 2890 "Gmsh.y" { (yyval.d) = sqrt((yyvsp[(3) - (6)].d)*(yyvsp[(3) - (6)].d)+(yyvsp[(5) - (6)].d)*(yyvsp[(5) - (6)].d)); ;} break; case 285: -#line 2890 "Gmsh.y" +#line 2891 "Gmsh.y" { (yyval.d) = (yyvsp[(3) - (4)].d)*(double)rand()/(double)RAND_MAX; ;} break; case 286: -#line 2899 "Gmsh.y" +#line 2900 "Gmsh.y" { (yyval.d) = (yyvsp[(1) - (1)].d); ;} break; case 287: -#line 2900 "Gmsh.y" +#line 2901 "Gmsh.y" { (yyval.d) = 3.141592653589793; ;} break; case 288: -#line 2901 "Gmsh.y" +#line 2902 "Gmsh.y" { (yyval.d) = Msg::GetCommRank(); ;} break; case 289: -#line 2902 "Gmsh.y" +#line 2903 "Gmsh.y" { (yyval.d) = Msg::GetCommSize(); ;} break; case 290: -#line 2903 "Gmsh.y" +#line 2904 "Gmsh.y" { (yyval.d) = Get_GmshMajorVersion(); ;} break; case 291: -#line 2904 "Gmsh.y" +#line 2905 "Gmsh.y" { (yyval.d) = Get_GmshMinorVersion(); ;} break; case 292: -#line 2905 "Gmsh.y" +#line 2906 "Gmsh.y" { (yyval.d) = Get_GmshPatchVersion(); ;} break; case 293: -#line 2910 "Gmsh.y" +#line 2911 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (1)].c); @@ -7171,7 +7172,7 @@ yyreduce: break; case 294: -#line 2926 "Gmsh.y" +#line 2927 "Gmsh.y" { char tmpstring[1024]; sprintf(tmpstring, "%s_%d", (yyvsp[(1) - (5)].c), (int)(yyvsp[(4) - (5)].d)) ; @@ -7189,7 +7190,7 @@ yyreduce: break; case 295: -#line 2941 "Gmsh.y" +#line 2942 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (4)].c); @@ -7212,7 +7213,7 @@ yyreduce: break; case 296: -#line 2961 "Gmsh.y" +#line 2962 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(2) - (4)].c); @@ -7228,7 +7229,7 @@ yyreduce: break; case 297: -#line 2974 "Gmsh.y" +#line 2975 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (2)].c); @@ -7244,7 +7245,7 @@ yyreduce: break; case 298: -#line 2987 "Gmsh.y" +#line 2988 "Gmsh.y" { Symbol TheSymbol; TheSymbol.Name = (yyvsp[(1) - (5)].c); @@ -7267,7 +7268,7 @@ yyreduce: break; case 299: -#line 3010 "Gmsh.y" +#line 3011 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7288,7 +7289,7 @@ yyreduce: break; case 300: -#line 3028 "Gmsh.y" +#line 3029 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7309,7 +7310,7 @@ yyreduce: break; case 301: -#line 3046 "Gmsh.y" +#line 3047 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7330,7 +7331,7 @@ yyreduce: break; case 302: -#line 3064 "Gmsh.y" +#line 3065 "Gmsh.y" { double (*pNumOpt)(int num, int action, double value); StringXNumber *pNumCat; @@ -7351,7 +7352,7 @@ yyreduce: break; case 303: -#line 3082 "Gmsh.y" +#line 3083 "Gmsh.y" { (yyval.d) = Msg::GetValue((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].d)); Free((yyvsp[(3) - (6)].c)); @@ -7359,70 +7360,70 @@ yyreduce: break; case 304: -#line 3090 "Gmsh.y" +#line 3091 "Gmsh.y" { memcpy((yyval.v), (yyvsp[(1) - (1)].v), 5*sizeof(double)); ;} break; case 305: -#line 3094 "Gmsh.y" +#line 3095 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = -(yyvsp[(2) - (2)].v)[i]; ;} break; case 306: -#line 3098 "Gmsh.y" +#line 3099 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(2) - (2)].v)[i]; ;} break; case 307: -#line 3102 "Gmsh.y" +#line 3103 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] - (yyvsp[(3) - (3)].v)[i]; ;} break; case 308: -#line 3106 "Gmsh.y" +#line 3107 "Gmsh.y" { for(int i = 0; i < 5; i++) (yyval.v)[i] = (yyvsp[(1) - (3)].v)[i] + (yyvsp[(3) - (3)].v)[i]; ;} break; case 309: -#line 3113 "Gmsh.y" +#line 3114 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (11)].d); (yyval.v)[1] = (yyvsp[(4) - (11)].d); (yyval.v)[2] = (yyvsp[(6) - (11)].d); (yyval.v)[3] = (yyvsp[(8) - (11)].d); (yyval.v)[4] = (yyvsp[(10) - (11)].d); ;} break; case 310: -#line 3117 "Gmsh.y" +#line 3118 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (9)].d); (yyval.v)[1] = (yyvsp[(4) - (9)].d); (yyval.v)[2] = (yyvsp[(6) - (9)].d); (yyval.v)[3] = (yyvsp[(8) - (9)].d); (yyval.v)[4] = 1.0; ;} break; case 311: -#line 3121 "Gmsh.y" +#line 3122 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 312: -#line 3125 "Gmsh.y" +#line 3126 "Gmsh.y" { (yyval.v)[0] = (yyvsp[(2) - (7)].d); (yyval.v)[1] = (yyvsp[(4) - (7)].d); (yyval.v)[2] = (yyvsp[(6) - (7)].d); (yyval.v)[3] = 0.0; (yyval.v)[4] = 1.0; ;} break; case 313: -#line 3132 "Gmsh.y" +#line 3133 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(List_T*)); List_Add((yyval.l), &((yyvsp[(1) - (1)].l))); @@ -7430,14 +7431,14 @@ yyreduce: break; case 314: -#line 3137 "Gmsh.y" +#line 3138 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].l))); ;} break; case 315: -#line 3145 "Gmsh.y" +#line 3146 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7445,14 +7446,14 @@ yyreduce: break; case 316: -#line 3150 "Gmsh.y" +#line 3151 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 317: -#line 3154 "Gmsh.y" +#line 3155 "Gmsh.y" { // creates an empty list (yyval.l) = List_Create(2, 1, sizeof(double)); @@ -7460,14 +7461,14 @@ yyreduce: break; case 318: -#line 3159 "Gmsh.y" +#line 3160 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 319: -#line 3163 "Gmsh.y" +#line 3164 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (4)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7478,7 +7479,7 @@ yyreduce: break; case 320: -#line 3171 "Gmsh.y" +#line 3172 "Gmsh.y" { (yyval.l) = (yyvsp[(4) - (5)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7489,7 +7490,7 @@ yyreduce: break; case 321: -#line 3182 "Gmsh.y" +#line 3183 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (2)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7500,7 +7501,7 @@ yyreduce: break; case 322: -#line 3190 "Gmsh.y" +#line 3191 "Gmsh.y" { (yyval.l) = (yyvsp[(3) - (3)].l); for(int i = 0; i < List_Nbr((yyval.l)); i++){ @@ -7511,7 +7512,7 @@ yyreduce: break; case 323: -#line 3198 "Gmsh.y" +#line 3199 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); for(double d = (yyvsp[(1) - (3)].d); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d <= (yyvsp[(3) - (3)].d)) : (d >= (yyvsp[(3) - (3)].d)); ((yyvsp[(1) - (3)].d) < (yyvsp[(3) - (3)].d)) ? (d += 1.) : (d -= 1.)) @@ -7520,7 +7521,7 @@ yyreduce: break; case 324: -#line 3204 "Gmsh.y" +#line 3205 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); if(!(yyvsp[(5) - (5)].d) || ((yyvsp[(1) - (5)].d) < (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) < 0) || ((yyvsp[(1) - (5)].d) > (yyvsp[(3) - (5)].d) && (yyvsp[(5) - (5)].d) > 0)){ @@ -7534,7 +7535,7 @@ yyreduce: break; case 325: -#line 3215 "Gmsh.y" +#line 3216 "Gmsh.y" { // Returns the coordinates of a point and fills a list with it. // This allows to ensure e.g. that relative point positions are @@ -7557,7 +7558,7 @@ yyreduce: break; case 326: -#line 3235 "Gmsh.y" +#line 3236 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7570,7 +7571,7 @@ yyreduce: break; case 327: -#line 3245 "Gmsh.y" +#line 3246 "Gmsh.y" { (yyval.l) = List_Create(List_Nbr((yyvsp[(1) - (1)].l)), 1, sizeof(double)); for(int i = 0; i < List_Nbr((yyvsp[(1) - (1)].l)); i++){ @@ -7583,7 +7584,7 @@ yyreduce: break; case 328: -#line 3255 "Gmsh.y" +#line 3256 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7603,7 +7604,7 @@ yyreduce: break; case 329: -#line 3272 "Gmsh.y" +#line 3273 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); Symbol TheSymbol; @@ -7630,7 +7631,7 @@ yyreduce: break; case 330: -#line 3299 "Gmsh.y" +#line 3300 "Gmsh.y" { (yyval.l) = List_Create(2, 1, sizeof(double)); List_Add((yyval.l), &((yyvsp[(1) - (1)].d))); @@ -7638,21 +7639,21 @@ yyreduce: break; case 331: -#line 3304 "Gmsh.y" +#line 3305 "Gmsh.y" { (yyval.l) = (yyvsp[(1) - (1)].l); ;} break; case 332: -#line 3308 "Gmsh.y" +#line 3309 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].d))); ;} break; case 333: -#line 3312 "Gmsh.y" +#line 3313 "Gmsh.y" { for(int i = 0; i < List_Nbr((yyvsp[(3) - (3)].l)); i++){ double d; @@ -7664,21 +7665,21 @@ yyreduce: break; case 334: -#line 3325 "Gmsh.y" +#line 3326 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (9)].d), (int)(yyvsp[(4) - (9)].d), (int)(yyvsp[(6) - (9)].d), (int)(yyvsp[(8) - (9)].d)); ;} break; case 335: -#line 3329 "Gmsh.y" +#line 3330 "Gmsh.y" { (yyval.u) = CTX.PACK_COLOR((int)(yyvsp[(2) - (7)].d), (int)(yyvsp[(4) - (7)].d), (int)(yyvsp[(6) - (7)].d), 255); ;} break; case 336: -#line 3341 "Gmsh.y" +#line 3342 "Gmsh.y" { int flag; (yyval.u) = Get_ColorForString(ColorString, -1, (yyvsp[(1) - (1)].c), &flag); @@ -7688,7 +7689,7 @@ yyreduce: break; case 337: -#line 3348 "Gmsh.y" +#line 3349 "Gmsh.y" { unsigned int (*pColOpt)(int num, int action, unsigned int value); StringXColor *pColCat; @@ -7709,14 +7710,14 @@ yyreduce: break; case 338: -#line 3369 "Gmsh.y" +#line 3370 "Gmsh.y" { (yyval.l) = (yyvsp[(2) - (3)].l); ;} break; case 339: -#line 3373 "Gmsh.y" +#line 3374 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); GmshColorTable *ct = Get_ColorTable((int)(yyvsp[(3) - (6)].d)); @@ -7731,7 +7732,7 @@ yyreduce: break; case 340: -#line 3388 "Gmsh.y" +#line 3389 "Gmsh.y" { (yyval.l) = List_Create(256, 10, sizeof(unsigned int)); List_Add((yyval.l), &((yyvsp[(1) - (1)].u))); @@ -7739,35 +7740,35 @@ yyreduce: break; case 341: -#line 3393 "Gmsh.y" +#line 3394 "Gmsh.y" { List_Add((yyval.l), &((yyvsp[(3) - (3)].u))); ;} break; case 342: -#line 3400 "Gmsh.y" +#line 3401 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 343: -#line 3404 "Gmsh.y" +#line 3405 "Gmsh.y" { Msg::Warning("Named string expressions not implemented yet"); ;} break; case 344: -#line 3411 "Gmsh.y" +#line 3412 "Gmsh.y" { (yyval.c) = (yyvsp[(1) - (1)].c); ;} break; case 345: -#line 3415 "Gmsh.y" +#line 3416 "Gmsh.y" { (yyval.c) = (char *)Malloc(32*sizeof(char)); time_t now; @@ -7778,7 +7779,7 @@ yyreduce: break; case 346: -#line 3423 "Gmsh.y" +#line 3424 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (6)].c))+strlen((yyvsp[(5) - (6)].c))+1)*sizeof(char)); strcpy((yyval.c), (yyvsp[(3) - (6)].c)); @@ -7789,7 +7790,7 @@ yyreduce: break; case 347: -#line 3431 "Gmsh.y" +#line 3432 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7806,7 +7807,7 @@ yyreduce: break; case 348: -#line 3445 "Gmsh.y" +#line 3446 "Gmsh.y" { (yyval.c) = (char *)Malloc((strlen((yyvsp[(3) - (4)].c))+1)*sizeof(char)); int i; @@ -7823,14 +7824,14 @@ yyreduce: break; case 349: -#line 3459 "Gmsh.y" +#line 3460 "Gmsh.y" { (yyval.c) = (yyvsp[(3) - (4)].c); ;} break; case 350: -#line 3463 "Gmsh.y" +#line 3464 "Gmsh.y" { char tmpstring[1024]; int i = PrintListOfDouble((yyvsp[(3) - (6)].c), (yyvsp[(5) - (6)].l), tmpstring); @@ -7852,7 +7853,7 @@ yyreduce: break; case 351: -#line 3482 "Gmsh.y" +#line 3483 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -7878,7 +7879,7 @@ yyreduce: break; case 352: -#line 3505 "Gmsh.y" +#line 3506 "Gmsh.y" { const char* (*pStrOpt)(int num, int action, const char *value); StringXString *pStrCat; @@ -7905,7 +7906,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 7909 "Gmsh.tab.cpp" +#line 7910 "Gmsh.tab.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -8119,7 +8120,7 @@ yyreturn: } -#line 3529 "Gmsh.y" +#line 3530 "Gmsh.y" void DeleteSymbol(void *a, void *b) @@ -8178,6 +8179,22 @@ int PrintListOfDouble(char *format, List_T *list, char *buffer) return 0; } +void FixRelativePath(const char *in, char *out) +{ + if(in[0] == '/' || in[0] == '\\' || (strlen(in)>2 && in[1] == ':')){ + // do nothing: 'in' is an absolute path + strcpy(out, in); + } + else{ + // append 'in' to the path of the parent file + strcpy(out, gmsh_yyname); + int i = strlen(out)-1 ; + while(i >= 0 && gmsh_yyname[i] != '/' && gmsh_yyname[i] != '\\') i-- ; + out[i+1] = '\0'; + strcat(out, in); + } +} + void yyerror(char *s) { Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname, gmsh_yylineno - 1, s, gmsh_yytext); diff --git a/Parser/Gmsh.tab.hpp b/Parser/Gmsh.tab.hpp index 7f8f26c5d9d26beceda77a2663a3dcc518f24258..5f12b0dc5456679270a0593f095a83b84c0e47e1 100644 --- a/Parser/Gmsh.tab.hpp +++ b/Parser/Gmsh.tab.hpp @@ -288,7 +288,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 82 "Gmsh.y" +#line 83 "Gmsh.y" { char *c; int i; diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 3ef53d0702595b2ca4aea08ae650dabc0de40ad6..3956d22b7e8eecaec0356a7a9100c16966ace3b8 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -1,5 +1,5 @@ %{ -// $Id: Gmsh.y,v 1.320 2008-07-01 14:24:11 geuzaine Exp $ +// $Id: Gmsh.y,v 1.321 2008-07-04 14:58:35 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -77,6 +77,7 @@ void yyerror(char *s); void yymsg(int level, const char *fmt, ...); void skip_until(const char *skip, const char *until); int PrintListOfDouble(char *format, List_T *list, char *buffer); +void FixRelativePath(const char *in, char *out); %} %union { @@ -3584,6 +3585,22 @@ int PrintListOfDouble(char *format, List_T *list, char *buffer) return 0; } +void FixRelativePath(const char *in, char *out) +{ + if(in[0] == '/' || in[0] == '\\' || (strlen(in)>2 && in[1] == ':')){ + // do nothing: 'in' is an absolute path + strcpy(out, in); + } + else{ + // append 'in' to the path of the parent file + strcpy(out, gmsh_yyname); + int i = strlen(out)-1 ; + while(i >= 0 && gmsh_yyname[i] != '/' && gmsh_yyname[i] != '\\') i-- ; + out[i+1] = '\0'; + strcat(out, in); + } +} + void yyerror(char *s) { Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname, gmsh_yylineno - 1, s, gmsh_yytext); diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp index 02cd6109fed33c165aca7d1c91f8220373387427..32779e8e18d336502cf015c56b4e67b6410d6369 100644 --- a/Parser/Gmsh.yy.cpp +++ b/Parser/Gmsh.yy.cpp @@ -835,7 +835,7 @@ int gmsh_yy_flex_debug = 0; char *gmsh_yytext; #line 1 "Gmsh.l" #line 2 "Gmsh.l" -// $Id: Gmsh.yy.cpp,v 1.370 2008-07-01 14:24:11 geuzaine Exp $ +// $Id: Gmsh.yy.cpp,v 1.371 2008-07-04 14:58:36 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // diff --git a/Parser/Makefile b/Parser/Makefile index 76b8c6124dae5528ca6c632343394bfce514d49f..f42f903bcdd380e5da225782f22ead589b983890 100644 --- a/Parser/Makefile +++ b/Parser/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.159 2008-06-07 17:20:56 geuzaine Exp $ +# $Id: Makefile,v 1.160 2008-07-04 14:58:36 geuzaine Exp $ # # Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle # @@ -31,8 +31,6 @@ CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE} SRC = Gmsh.tab.cpp\ Gmsh.yy.cpp\ - OpenFile.cpp\ - CreateFile.cpp\ FunctionManager.cpp OBJ = ${SRC:.cpp=${OBJEXT}} @@ -87,11 +85,11 @@ Gmsh.tab.o: Gmsh.tab.cpp ../Common/Message.h ../Common/MallocUtils.h \ ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ ../Geo/GeoInterpolation.h ../Geo/Geo.h ../Mesh/Generator.h \ ../Graphics/Draw.h ../Common/Options.h ../Post/ColorTable.h \ - ../Common/Colors.h ../Common/Options.h Parser.h OpenFile.h \ - ../Common/CommandLine.h FunctionManager.h ../Common/OS.h CreateFile.h \ - ../Mesh/Field.h ../Post/PView.h ../Mesh/BackgroundMesh.h \ - ../Post/PViewDataList.h ../Post/PViewData.h ../Plugin/PluginManager.h \ - ../Plugin/Plugin.h ../Common/GmshMatrix.h + ../Common/Colors.h ../Common/Options.h Parser.h ../Common/OpenFile.h \ + ../Common/CommandLine.h FunctionManager.h ../Common/OS.h \ + ../Common/CreateFile.h ../Mesh/Field.h ../Post/PView.h \ + ../Mesh/BackgroundMesh.h ../Post/PViewDataList.h ../Post/PViewData.h \ + ../Plugin/PluginManager.h ../Plugin/Plugin.h ../Common/GmshMatrix.h Gmsh.yy.o: Gmsh.yy.cpp ../Common/Message.h ../Numeric/Numeric.h \ ../Numeric/NumericEmbedded.h ../Geo/Geo.h ../Common/GmshDefines.h \ ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \ @@ -100,40 +98,4 @@ Gmsh.yy.o: Gmsh.yy.cpp ../Common/Message.h ../Numeric/Numeric.h \ ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ Gmsh.tab.hpp -OpenFile.o: OpenFile.cpp ../Common/Message.h ../Geo/Geo.h \ - ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \ - ../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \ - ../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Common/ListUtils.h \ - ../Common/TreeUtils.h ../Common/avl.h ../Common/ListUtils.h \ - ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Common/SmoothData.h \ - ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \ - ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h \ - ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h \ - ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h \ - ../Geo/GEntity.h ../Geo/SBoundingBox3d.h ../Common/Context.h Parser.h \ - OpenFile.h ../Common/CommandLine.h ../Graphics/ReadImg.h ../Common/OS.h \ - ../Mesh/HighOrder.h ../Post/PView.h ../Post/PViewData.h \ - ../Common/GmshUI.h ../Graphics/Draw.h ../Graphics/SelectBuffer.h \ - ../Fltk/GUI.h ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h \ - ../Post/ColorTable.h ../Fltk/Popup_Button.h \ - ../Fltk/SpherePosition_Widget.h ../Mesh/Field.h -CreateFile.o: CreateFile.cpp ../Common/Message.h ../Geo/GModel.h \ - ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ - ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/GPoint.h \ - ../Geo/SPoint2.h ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h \ - ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \ - ../Geo/GFace.h ../Geo/GEntity.h ../Geo/GPoint.h ../Geo/GEdgeLoop.h \ - ../Geo/GEdge.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \ - ../Geo/GRegion.h ../Geo/GEntity.h ../Geo/SBoundingBox3d.h \ - ../Common/GmshDefines.h OpenFile.h ../Common/Context.h \ - ../Common/Options.h ../Post/ColorTable.h ../Common/GmshUI.h \ - ../Graphics/gl2ps.h ../Graphics/gl2gif.h ../Graphics/PixelBuffer.h \ - ../Common/MallocUtils.h ../Graphics/Draw.h ../Graphics/gl2jpeg.h \ - ../Graphics/PixelBuffer.h ../Graphics/gl2png.h \ - ../Graphics/PixelBuffer.h ../Graphics/gl2ppm.h \ - ../Graphics/PixelBuffer.h ../Graphics/gl2yuv.h \ - ../Graphics/PixelBuffer.h FunctionManager.o: FunctionManager.cpp FunctionManager.h diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp deleted file mode 100644 index 8c20cafabaa155bf28c0cd1d8f923d762738b1f5..0000000000000000000000000000000000000000 --- a/Parser/OpenFile.cpp +++ /dev/null @@ -1,497 +0,0 @@ -// $Id: OpenFile.cpp,v 1.188 2008-05-06 21:11:54 geuzaine Exp $ -// -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -#if defined(__CYGWIN__) -#include <sys/cygwin.h> -#endif - -#include <string.h> -#include "Message.h" -#include "Geo.h" -#include "GModel.h" -#include "Numeric.h" -#include "Context.h" -#include "Parser.h" -#include "OpenFile.h" -#include "CommandLine.h" -#include "ReadImg.h" -#include "OS.h" -#include "HighOrder.h" - -#if !defined(HAVE_NO_POST) -#include "PView.h" -#include "PViewData.h" -#endif - -#if defined(HAVE_FLTK) -#include "GmshUI.h" -#include "Draw.h" -#include "SelectBuffer.h" -#include "GUI.h" -extern GUI *WID; -#endif - -extern Context_T CTX; - -void FixRelativePath(const char *in, char *out) -{ - if(in[0] == '/' || in[0] == '\\' || (strlen(in)>2 && in[1] == ':')){ - // do nothing: 'in' is an absolute path - strcpy(out, in); - } - else{ - // append 'in' to the path of the parent file - strcpy(out, gmsh_yyname); - int i = strlen(out)-1 ; - while(i >= 0 && gmsh_yyname[i] != '/' && gmsh_yyname[i] != '\\') i-- ; - out[i+1] = '\0'; - strcat(out, in); - } -} - -void FixWindowsPath(const char *in, char *out) -{ -#if defined(__CYGWIN__) - cygwin_conv_to_win32_path(in, out); -#else - strcpy(out, in); -#endif -} - -void SplitFileName(const char *name, char *no_ext, char *ext, char *base) -{ - strcpy(no_ext, name); - strcpy(ext, ""); - for(int i = strlen(name) - 1; i >= 0; i--){ - if(name[i] == '.'){ - strcpy(ext, &name[i]); - no_ext[i] = '\0'; - break; - } - } - strcpy(base, no_ext); - for(int i = strlen(no_ext) - 1; i >= 0; i--){ - if(no_ext[i] == '/' || no_ext[i] == '\\'){ - strcpy(base, &no_ext[i + 1]); - break; - } - } -} - -static void FinishUpBoundingBox() -{ - double range[3]; - - for(int i = 0; i < 3; i++){ - CTX.cg[i] = 0.5 * (CTX.min[i] + CTX.max[i]); - range[i] = CTX.max[i] - CTX.min[i]; - } - - if(range[0] < CTX.geom.tolerance && - range[1] < CTX.geom.tolerance && - range[2] < CTX.geom.tolerance) { - CTX.min[0] -= 1.; CTX.min[1] -= 1.; - CTX.max[0] += 1.; CTX.max[1] += 1.; - CTX.lc = 1.; - } - else if(range[0] < CTX.geom.tolerance && - range[1] < CTX.geom.tolerance) { - CTX.lc = range[2]; - CTX.min[0] -= CTX.lc; CTX.min[1] -= CTX.lc; - CTX.max[0] += CTX.lc; CTX.max[1] += CTX.lc; - } - else if(range[0] < CTX.geom.tolerance && - range[2] < CTX.geom.tolerance) { - CTX.lc = range[1]; - CTX.min[0] -= CTX.lc; CTX.max[0] += CTX.lc; - } - else if(range[1] < CTX.geom.tolerance && - range[2] < CTX.geom.tolerance) { - CTX.lc = range[0]; - CTX.min[1] -= CTX.lc; CTX.max[1] += CTX.lc; - } - else if(range[0] < CTX.geom.tolerance) { - CTX.lc = sqrt(DSQR(range[1]) + DSQR(range[2])); - CTX.min[0] -= CTX.lc; CTX.max[0] += CTX.lc; - } - else if(range[1] < CTX.geom.tolerance) { - CTX.lc = sqrt(DSQR(range[0]) + DSQR(range[2])); - CTX.min[1] -= CTX.lc; CTX.max[1] += CTX.lc; - } - else if(range[2] < CTX.geom.tolerance) { - CTX.lc = sqrt(DSQR(range[0]) + DSQR(range[1])); - } - else { - CTX.lc = sqrt(DSQR(range[0]) + DSQR(range[1]) + DSQR(range[2])); - } -} - -void SetBoundingBox(double xmin, double xmax, - double ymin, double ymax, - double zmin, double zmax) -{ - CTX.min[0] = xmin; CTX.max[0] = xmax; - CTX.min[1] = ymin; CTX.max[1] = ymax; - CTX.min[2] = zmin; CTX.max[2] = zmax; - FinishUpBoundingBox(); -} - -void SetBoundingBox(void) -{ - if(CTX.forced_bbox) return; - - SBoundingBox3d bb = GModel::current()->bounds(); - -#if !defined(HAVE_NO_POST) - if(bb.empty()) { - for(unsigned int i = 0; i < PView::list.size(); i++) - if(!PView::list[i]->getData()->getBoundingBox().empty()) - bb += PView::list[i]->getData()->getBoundingBox(); - } -#endif - - if(bb.empty()){ - bb += SPoint3(-1., -1., -1.); - bb += SPoint3(1., 1., 1.); - } - - CTX.min[0] = bb.min().x(); CTX.max[0] = bb.max().x(); - CTX.min[1] = bb.min().y(); CTX.max[1] = bb.max().y(); - CTX.min[2] = bb.min().z(); CTX.max[2] = bb.max().z(); - FinishUpBoundingBox(); -} - -// FIXME: this is necessary for now to have an approximate CTX.lc -// *while* parsing input files (it's important since some of the -// geometrical operations use a tolerance that depends on -// CTX.lc). This will be removed once the new database is filled -// directly during the parsing step -static SBoundingBox3d temp_bb; - -void ResetTemporaryBoundingBox() -{ - temp_bb.reset(); -} - -void AddToTemporaryBoundingBox(double x, double y, double z) -{ - temp_bb += SPoint3(x, y, z); - CTX.min[0] = temp_bb.min().x(); CTX.max[0] = temp_bb.max().x(); - CTX.min[1] = temp_bb.min().y(); CTX.max[1] = temp_bb.max().y(); - CTX.min[2] = temp_bb.min().z(); CTX.max[2] = temp_bb.max().z(); - FinishUpBoundingBox(); -} - -int ParseFile(const char *f, int close, int warn_if_missing) -{ - char yyname_old[256], tmp[256]; - FILE *yyin_old, *fp; - int yylineno_old, yyerrorstate_old, yyviewindex_old; - - // add 'b' for pure Windows programs: opening in text mode messes up - // fsetpos/fgetpos (used e.g. for user-defined functions) - if(!(fp = fopen(f, "rb"))){ - if(warn_if_missing) Msg::Warning("Unable to open file '%s'", f); - return 0; - } - -#if !defined(HAVE_NO_POST) - int numViewsBefore = PView::list.size(); -#endif - - strncpy(yyname_old, gmsh_yyname, 255); - yyin_old = gmsh_yyin; - yyerrorstate_old = gmsh_yyerrorstate; - yylineno_old = gmsh_yylineno; - yyviewindex_old = gmsh_yyviewindex; - - strncpy(gmsh_yyname, f, 255); - gmsh_yyin = fp; - gmsh_yyerrorstate = 0; - gmsh_yylineno = 1; - gmsh_yyviewindex = 0; - - fpos_t position; - fgetpos(gmsh_yyin, &position); - fgets(tmp, sizeof(tmp), gmsh_yyin); - fsetpos(gmsh_yyin, &position); - - while(!feof(gmsh_yyin)){ - gmsh_yyparse(); - if(gmsh_yyerrorstate > 20){ - Msg::Error("Too many errors: aborting..."); - force_yyflush(); - break; - } - } - - if(close) fclose(gmsh_yyin); - - strncpy(gmsh_yyname, yyname_old, 255); - gmsh_yyin = yyin_old; - gmsh_yyerrorstate = yyerrorstate_old; - gmsh_yylineno = yylineno_old; - gmsh_yyviewindex = yyviewindex_old; - -#if defined(HAVE_FLTK) && !defined(HAVE_NO_POST) - if(!CTX.batch && numViewsBefore != (int)PView::list.size()) - WID->update_views(); -#endif - - return 1; -} - -void ParseString(const char *str) -{ - if(!str) return; - FILE *fp; - if((fp = fopen(CTX.tmp_filename_fullpath, "w"))) { - fprintf(fp, str); - fprintf(fp, "\n"); - fclose(fp); - ParseFile(CTX.tmp_filename_fullpath, 1); - GModel::current()->importGEOInternals(); - } -} - -void SetProjectName(const char *name) -{ - char no_ext[256], ext[256], base[256]; - SplitFileName(name, no_ext, ext, base); - - if(CTX.filename != name) // yes, we mean to compare the pointers - strncpy(CTX.filename, name, 255); - strncpy(CTX.no_ext_filename, no_ext, 255); - strncpy(CTX.base_filename, base, 255); - - GModel::current()->setName(base); - -#if defined(HAVE_FLTK) - if(!CTX.batch) WID->set_title(CTX.filename); -#endif -} - -int MergeFile(const char *name, int warn_if_missing) -{ - // added 'b' for pure Windows programs, since some of these files - // contain binary data - FILE *fp = fopen(name, "rb"); - if(!fp){ - if(warn_if_missing) Msg::Warning("Unable to open file '%s'", name); - return 0; - } - - char header[256]; - fgets(header, sizeof(header), fp); - fclose(fp); - - Msg::StatusBar(2, true, "Reading '%s'", name); - - char no_ext[256], ext[256], base[256]; - SplitFileName(name, no_ext, ext, base); - -#if defined(HAVE_FLTK) - if(!CTX.batch) { - if(!strcmp(ext, ".gz")) { - // the real solution would be to rewrite all our I/O functions in - // terms of gzFile, but until then, this is better than nothing - if(fl_choice("File '%s' is in gzip format.\n\nDo you want to uncompress it?", - "Cancel", "Uncompress", NULL, name)){ - char tmp[256]; - sprintf(tmp, "gunzip -c %s > %s", name, no_ext); - if(SystemCall(tmp)) - Msg::Error("Failed to uncompress `%s': check directory permissions", name); - if(!strcmp(CTX.filename, name)) // this is the project file - SetProjectName(no_ext); - return MergeFile(no_ext); - } - } - } -#endif - - CTX.geom.draw = 0; // don't try to draw the model while reading - - GModel *m = GModel::current(); - - // FIXME: We need to decide what do do for CAD entities, meshes, - // etc. For meshes we should definitely create one new model per - // merge (and reset current() to the previous value after the - // merge). This will make multi-step multi-meshes post-pro views - // work out of the box. - // GModel *m = new GModel; - -#if !defined(HAVE_NO_POST) - int numViewsBefore = PView::list.size(); -#endif - - int status = 0; - if(!strcmp(ext, ".stl") || !strcmp(ext, ".STL")){ - status = m->readSTL(name, CTX.geom.tolerance); - } - else if(!strcmp(ext, ".brep") || !strcmp(ext, ".rle") || - !strcmp(ext, ".brp") || !strcmp(ext, ".BRP")){ - status = m->readOCCBREP(std::string(name)); - } - else if(!strcmp(ext, ".iges") || !strcmp(ext, ".IGES") || - !strcmp(ext, ".igs") || !strcmp(ext, ".IGS")){ - status = m->readOCCIGES(std::string(name)); - } - else if(!strcmp(ext, ".step") || !strcmp(ext, ".STEP") || - !strcmp(ext, ".stp") || !strcmp(ext, ".STP")){ - status = m->readOCCSTEP(std::string(name)); - } - else if(!strcmp(ext, ".unv") || !strcmp(ext, ".UNV")){ - status = m->readUNV(name); - } - else if(!strcmp(ext, ".wrl") || !strcmp(ext, ".WRL") || - !strcmp(ext, ".vrml") || !strcmp(ext, ".VRML") || - !strcmp(ext, ".iv") || !strcmp(ext, ".IV")){ - status = m->readVRML(name); - } - else if(!strcmp(ext, ".mesh") || !strcmp(ext, ".MESH")){ - status = m->readMESH(name); - } -#if !defined(HAVE_NO_POST) - else if(!strcmp(ext, ".med") || !strcmp(ext, ".MED") || - !strcmp(ext, ".mmed") || !strcmp(ext, ".MMED") || - !strcmp(ext, ".rmed") || !strcmp(ext, ".RMED")){ - status = GModel::readMED(name); - if(status > 1) status = PView::readMED(name); - } -#endif - else if(!strcmp(ext, ".bdf") || !strcmp(ext, ".BDF") || - !strcmp(ext, ".nas") || !strcmp(ext, ".NAS")){ - status = m->readBDF(name); - } - else if(!strcmp(ext, ".p3d") || !strcmp(ext, ".P3D")){ - status = m->readP3D(name); - } - else if(!strcmp(ext, ".fm") || !strcmp(ext, ".FM")) { - status = m->readFourier(name); - } -#if defined(HAVE_FLTK) - else if(!strcmp(ext, ".pnm") || !strcmp(ext, ".PNM") || - !strcmp(ext, ".pbm") || !strcmp(ext, ".PBM") || - !strcmp(ext, ".pgm") || !strcmp(ext, ".PGM") || - !strcmp(ext, ".ppm") || !strcmp(ext, ".PPM")) { - status = read_pnm(name); - } - else if(!strcmp(ext, ".bmp") || !strcmp(ext, ".BMP")) { - status = read_bmp(name); - } -#if defined(HAVE_LIBJPEG) - else if(!strcmp(ext, ".jpg") || !strcmp(ext, ".JPG") || - !strcmp(ext, ".jpeg") || !strcmp(ext, ".JPEG")) { - status = read_jpeg(name); - } -#endif -#if defined(HAVE_LIBPNG) - else if(!strcmp(ext, ".png") || !strcmp(ext, ".PNG")) { - status = read_png(name); - } -#endif -#endif - else { - CTX.geom.draw = 1; - if(!strncmp(header, "$PTS", 4) || !strncmp(header, "$NO", 3) || - !strncmp(header, "$PARA", 5) || !strncmp(header, "$ELM", 4) || - !strncmp(header, "$MeshFormat", 11)) { - status = m->readMSH(name); -#if !defined(HAVE_NO_POST) - if(status > 1) status = PView::readMSH(name); -#endif - } -#if !defined(HAVE_NO_POST) - else if(!strncmp(header, "$PostFormat", 11) || - !strncmp(header, "$View", 5)) { - status = PView::readPOS(name); - } -#endif - else { - status = m->readGEO(name); - } - } - - SetBoundingBox(); - - CTX.geom.draw = 1; - CTX.mesh.changed = ENT_ALL; - -#if defined(HAVE_FLTK) && !defined(HAVE_NO_POST) - if(!CTX.batch && numViewsBefore != (int)PView::list.size()) - WID->update_views(); -#endif - - Msg::StatusBar(2, true, "Read '%s'", name); - return status; -} - -void OpenProject(const char *name) -{ - if(CTX.threads_lock) { - Msg::Info("I'm busy! Ask me that later..."); - return; - } - CTX.threads_lock = 1; - - // FIXME: this will change once we clarify Open/Merge/Clear -#if !defined(HAVE_NO_POST) - for(int i = PView::list.size() - 1; i >= 0; i--) - if(PView::list[i]->getData()->hasModel(GModel::current())) - delete PView::list[i]; -#endif - GModel::current()->destroy(); - GModel::current()->getGEOInternals()->destroy(); - - // temporary hack until we fill the current GModel on the fly during - // parsing - ResetTemporaryBoundingBox(); - - SetProjectName(name); - MergeFile(name); - - CTX.threads_lock = 0; - -#if defined(HAVE_FLTK) - if(!CTX.batch){ - WID->reset_visibility(); - WID->update_views(); - } - ZeroHighlight(); -#endif -} - -void OpenProjectMacFinder(const char *filename) -{ - static int first = 1; - if(first || CTX.batch){ - // just copy the filename: it will be opened when the GUI is ready - // in main() - strncpy(CTX.filename, filename, 255); - first = 0; - } - else{ - OpenProject(filename); -#if defined(HAVE_FLTK) - Draw(); -#endif - } -} diff --git a/Parser/OpenFile.h b/Parser/OpenFile.h deleted file mode 100644 index 05d32a87e34f226e8cd592c3fd464e3f7b74a559..0000000000000000000000000000000000000000 --- a/Parser/OpenFile.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _OPENFILE_H_ -#define _OPENFILE_H_ - -// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to <gmsh@geuz.org>. - -int ParseFile(const char *filename, int close, int warn_if_missing=0); -void ParseString(const char *str); -void OpenProject(const char *filename); -void OpenProjectMacFinder(const char *filename); -int MergeFile(const char *filename, int warn_if_missing=0); -void FixRelativePath(const char *in, char *out); -void FixWindowsPath(const char *in, char *out); -void SplitFileName(const char *name, char *no_ext, char *ext, char *base); -void SetBoundingBox(double xmin, double xmax, - double ymin, double ymax, - double zmin, double zmax); -void SetBoundingBox(void); -void AddToTemporaryBoundingBox(double x, double y, double z); - -#endif diff --git a/configure b/configure index 33e1a4bce3a817b3e962c97e495d83e5018e459f..cb6cc29b29efa312409b14dd8fdc63ac69afc217 100755 --- a/configure +++ b/configure @@ -1265,6 +1265,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-gsl use GSL as numerical toolkit (default=yes) --enable-gui build the graphical user interface (default=yes) + --enable-parser build the parser (default=yes) --enable-post build the post-processing module (default=yes) --enable-cygwin use the Cygwin library on Windows (default=no) --enable-jpeg enable JPEG support (default=yes) @@ -1846,6 +1847,11 @@ if test "${enable_gui+set}" = set; then enableval=$enable_gui; fi +# Check whether --enable-parser was given. +if test "${enable_parser+set}" = set; then + enableval=$enable_parser; +fi + # Check whether --enable-post was given. if test "${enable_post+set}" = set; then enableval=$enable_post; @@ -1944,6 +1950,7 @@ fi if test "x$enable_minimal" = "xyes"; then enable_gui=no; + enable_parser=no; enable_post=no; enable_gsl=no; # enable_occ=no; @@ -4119,14 +4126,22 @@ fi else + GMSH_DIRS="Common Geo Mesh Numeric" + GMSH_LIBS="-Llib Common/Main.o" + + if test "x$enable_parser" != "xno"; then + GMSH_DIRS="${GMSH_DIRS} Parser" + GMSH_LIBS="${GMSH_LIBS} -lGmshParser" + else + FLAGS="-DHAVE_NO_PARSER ${FLAGS}" + fi + if test "x$enable_post" != "xno"; then - GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin -lGmshGeo" - GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshPost -lGmshCommon -lGmshNumeric" + GMSH_DIRS="${GMSH_DIRS} Post Plugin" + GMSH_LIBS="${GMSH_LIBS} -lGmshPlugin -lGmshGeo -lGmshMesh -lGmshPost" + GMSH_LIBS="${GMSH_LIBS} -lGmshCommon -lGmshNumeric" else - GMSH_DIRS="Common Geo Mesh Numeric Parser" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshGeo -lGmshMesh -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshNumeric" + GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshCommon -lGmshNumeric" FLAGS="-DHAVE_NO_POST ${FLAGS}" fi diff --git a/configure.in b/configure.in index 7cdb464da7d0f5e14723306d582d32c9ab251cce..54aabe48a066c62e40e594bd051e283378f52b65 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.159 2008-06-30 17:42:49 geuzaine Exp $ +dnl $Id: configure.in,v 1.160 2008-07-04 14:58:30 geuzaine Exp $ dnl dnl Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle dnl @@ -93,6 +93,9 @@ AC_ARG_ENABLE(gsl, AC_ARG_ENABLE(gui, AC_HELP_STRING([--enable-gui], [build the graphical user interface (default=yes)])) +AC_ARG_ENABLE(parser, + AC_HELP_STRING([--enable-parser], + [build the parser (default=yes)])) AC_ARG_ENABLE(post, AC_HELP_STRING([--enable-post], [build the post-processing module (default=yes)])) @@ -154,6 +157,7 @@ AC_ARG_ENABLE(minimal, dnl "minimal" build shortcut if test "x$enable_minimal" = "xyes"; then enable_gui=no; + enable_parser=no; enable_post=no; enable_gsl=no; # enable_occ=no; @@ -355,14 +359,22 @@ if test "x$enable_gui" != "xno"; then else + GMSH_DIRS="Common Geo Mesh Numeric" + GMSH_LIBS="-Llib Common/Main.o" + + if test "x$enable_parser" != "xno"; then + GMSH_DIRS="${GMSH_DIRS} Parser" + GMSH_LIBS="${GMSH_LIBS} -lGmshParser" + else + FLAGS="-DHAVE_NO_PARSER ${FLAGS}" + fi + if test "x$enable_post" != "xno"; then - GMSH_DIRS="Common Geo Mesh Post Numeric Parser Plugin" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshPlugin -lGmshGeo" - GMSH_LIBS="${GMSH_LIBS} -lGmshMesh -lGmshPost -lGmshCommon -lGmshNumeric" + GMSH_DIRS="${GMSH_DIRS} Post Plugin" + GMSH_LIBS="${GMSH_LIBS} -lGmshPlugin -lGmshGeo -lGmshMesh -lGmshPost" + GMSH_LIBS="${GMSH_LIBS} -lGmshCommon -lGmshNumeric" else - GMSH_DIRS="Common Geo Mesh Numeric Parser" - GMSH_LIBS="-Llib Common/Main.o -lGmshParser -lGmshGeo -lGmshMesh -lGmshCommon" - GMSH_LIBS="${GMSH_LIBS} -lGmshNumeric" + GMSH_LIBS="${GMSH_LIBS} -lGmshGeo -lGmshMesh -lGmshCommon -lGmshNumeric" FLAGS="-DHAVE_NO_POST ${FLAGS}" fi