Skip to content
Snippets Groups Projects
Commit 0e372f5a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add OpenProject in the API + cleanup consts

parent 6db3429a
Branches
Tags
No related merge requests found
...@@ -91,41 +91,53 @@ int GmshSetBoundingBox(double xmin, double xmax, ...@@ -91,41 +91,53 @@ int GmshSetBoundingBox(double xmin, double xmax,
return 1; 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); 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); 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); 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); 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); 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); 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); return MergeFile(fileName, true);
} }
int GmshOpenProject(const std::string &fileName)
{
OpenProject(fileName);
return 1;
}
int GmshWriteFile(std::string fileName) int GmshWriteFile(std::string fileName)
{ {
CreateOutputFile(fileName, FORMAT_AUTO); CreateOutputFile(fileName, FORMAT_AUTO);
......
...@@ -14,14 +14,21 @@ int GmshSetMessageHandler(GmshMessage *callback); ...@@ -14,14 +14,21 @@ int GmshSetMessageHandler(GmshMessage *callback);
int GmshSetBoundingBox(double xmin, double xmax, int GmshSetBoundingBox(double xmin, double xmax,
double ymin, double ymax, double ymin, double ymax,
double zmin, double zmax); double zmin, double zmax);
int GmshSetOption(std::string category, std::string name, std::string value, int index=0); int GmshSetOption(const std::string &category, const std::string &name,
int GmshSetOption(std::string category, std::string name, double value, int index=0); std::string value, int index=0);
int GmshSetOption(std::string category, std::string name, unsigned int value, int index=0); int GmshSetOption(const std::string &category, const std::string &name,
int GmshGetOption(std::string category, std::string name, std::string &value, int index=0); double value, int index=0);
int GmshGetOption(std::string category, std::string name, double &value, int index=0); int GmshSetOption(const std::string &category, const std::string &name,
int GmshGetOption(std::string category, std::string name, unsigned int &value, int index=0); unsigned int value, int index=0);
int GmshMergeFile(std::string fileName); int GmshGetOption(const std::string &category, const std::string &name,
int GmshWriteFile(std::string fileName); 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 GmshFinalize();
int GmshBatch(); int GmshBatch();
int GmshFLTK(int argc=0, char **argv=0); int GmshFLTK(int argc=0, char **argv=0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment