diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 730b6fac8da61dcef3b4b4e3a334f4d547a37839..892c4f65a8faa7155822abcf1bc02dd4c967a61c 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -91,41 +91,53 @@ int GmshSetBoundingBox(double xmin, double xmax, return 1; } -int GmshSetOption(std::string category, std::string name, std::string value, int index) +int GmshSetOption(const std::string &category, const std::string &name, + std::string value, int index) { return StringOption(GMSH_SET|GMSH_GUI, category.c_str(), index, name.c_str(), value); } -int GmshSetOption(std::string category, std::string name, double value, int index) +int GmshSetOption(const std::string &category, const std::string &name, + double value, int index) { return NumberOption(GMSH_SET|GMSH_GUI, category.c_str(), index, name.c_str(), value); } -int GmshSetOption(std::string category, std::string name, unsigned int value, int index) +int GmshSetOption(const std::string &category, const std::string &name, + unsigned int value, int index) { return ColorOption(GMSH_SET|GMSH_GUI, category.c_str(), index, name.c_str(), value); } -int GmshGetOption(std::string category, std::string name, std::string &value, int index) +int GmshGetOption(const std::string &category, const std::string &name, + std::string &value, int index) { return StringOption(GMSH_GET, category.c_str(), index, name.c_str(), value); } -int GmshGetOption(std::string category, std::string name, double &value, int index) +int GmshGetOption(const std::string &category, const std::string &name, + double &value, int index) { return NumberOption(GMSH_GET, category.c_str(), index, name.c_str(), value); } -int GmshGetOption(std::string category, std::string name, unsigned int &value, int index) +int GmshGetOption(const std::string &category, const std::string &name, + unsigned int &value, int index) { return ColorOption(GMSH_GET, category.c_str(), index, name.c_str(), value); } -int GmshMergeFile(std::string fileName) +int GmshMergeFile(const std::string &fileName) { return MergeFile(fileName, true); } +int GmshOpenProject(const std::string &fileName) +{ + OpenProject(fileName); + return 1; +} + int GmshWriteFile(std::string fileName) { CreateOutputFile(fileName, FORMAT_AUTO); diff --git a/Common/Gmsh.h b/Common/Gmsh.h index 40301090aa98752855c7f1843775e08c3ba786f0..a0c5e1ff4c4f5512968069fb675a21d6a9415cc0 100644 --- a/Common/Gmsh.h +++ b/Common/Gmsh.h @@ -14,14 +14,21 @@ int GmshSetMessageHandler(GmshMessage *callback); int GmshSetBoundingBox(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); -int GmshSetOption(std::string category, std::string name, std::string value, int index=0); -int GmshSetOption(std::string category, std::string name, double value, int index=0); -int GmshSetOption(std::string category, std::string name, unsigned int value, int index=0); -int GmshGetOption(std::string category, std::string name, std::string &value, int index=0); -int GmshGetOption(std::string category, std::string name, double &value, int index=0); -int GmshGetOption(std::string category, std::string name, unsigned int &value, int index=0); -int GmshMergeFile(std::string fileName); -int GmshWriteFile(std::string fileName); +int GmshSetOption(const std::string &category, const std::string &name, + std::string value, int index=0); +int GmshSetOption(const std::string &category, const std::string &name, + double value, int index=0); +int GmshSetOption(const std::string &category, const std::string &name, + unsigned int value, int index=0); +int GmshGetOption(const std::string &category, const std::string &name, + std::string &value, int index=0); +int GmshGetOption(const std::string &category, const std::string &name, + double &value, int index=0); +int GmshGetOption(const std::string &category, const std::string &name, + unsigned int &value, int index=0); +int GmshMergeFile(const std::string &fileName); +int GmshOpenProject(const std::string &fileName); +int GmshWriteFile(const std::string &fileName); int GmshFinalize(); int GmshBatch(); int GmshFLTK(int argc=0, char **argv=0);