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

don't need "forceDestroy" anymore: synchronize takes care of business

parent 3ee66a06
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "onelab.h" #include "onelab.h"
#endif #endif
void add_infile(const std::string &text, const std::string &fileName, bool forceDestroy) void add_infile(const std::string &text, const std::string &fileName)
{ {
Msg::Debug("Adding `%s' to file `%s'", text.c_str(), fileName.c_str()); Msg::Debug("Adding `%s' to file `%s'", text.c_str(), fileName.c_str());
std::vector<std::string> split = SplitFileName(fileName); std::vector<std::string> split = SplitFileName(fileName);
...@@ -97,11 +97,6 @@ void add_infile(const std::string &text, const std::string &fileName, bool force ...@@ -97,11 +97,6 @@ void add_infile(const std::string &text, const std::string &fileName, bool force
gmshclose(gmsh_yyin); gmshclose(gmsh_yyin);
gmsh_yyin = gmsh_yyin_old; gmsh_yyin = gmsh_yyin_old;
if(forceDestroy){
// we need to start from scratch (e.g. if the command just parsed
// could have deleted some entities)
GModel::current()->destroy();
}
GModel::current()->getGEOInternals()->synchronize(GModel::current()); GModel::current()->getGEOInternals()->synchronize(GModel::current());
if(GModel::current()->getOCCInternals()) if(GModel::current()->getOCCInternals())
GModel::current()->getOCCInternals()->synchronize(GModel::current()); GModel::current()->getOCCInternals()->synchronize(GModel::current());
...@@ -159,11 +154,6 @@ void add_infile(const std::string &text, const std::string &fileName, bool force ...@@ -159,11 +154,6 @@ void add_infile(const std::string &text, const std::string &fileName, bool force
} }
} }
void coherence(const std::string &fileName)
{
add_infile("Coherence;", fileName, true);
}
static std::string list2string(List_T *list) static std::string list2string(List_T *list)
{ {
std::ostringstream sstream; std::ostringstream sstream;
...@@ -176,13 +166,6 @@ static std::string list2string(List_T *list) ...@@ -176,13 +166,6 @@ static std::string list2string(List_T *list)
return sstream.str(); return sstream.str();
} }
void delet(List_T *list, const std::string &fileName, const std::string &what)
{
std::ostringstream sstream;
sstream << "Delete {\n " << what << "{" << list2string(list) << "};\n}";
add_infile(sstream.str(), fileName, true);
}
void add_charlength(List_T *list, const std::string &fileName, const std::string &lc) void add_charlength(List_T *list, const std::string &fileName, const std::string &lc)
{ {
std::ostringstream sstream; std::ostringstream sstream;
...@@ -254,7 +237,7 @@ void add_embedded(const std::string &what, std::vector<int> &l, ...@@ -254,7 +237,7 @@ void add_embedded(const std::string &what, std::vector<int> &l,
sstream << l[i]; sstream << l[i];
} }
sstream << "} In Surface{" << l[0] << "};"; sstream << "} In Surface{" << l[0] << "};";
add_infile(sstream.str(), fileName, true); add_infile(sstream.str(), fileName);
} }
void add_param(const std::string &par, const std::string &value, void add_param(const std::string &par, const std::string &value,
...@@ -628,7 +611,7 @@ void split_edge(int edge_id, List_T *vertices, const std::string &fileName) ...@@ -628,7 +611,7 @@ void split_edge(int edge_id, List_T *vertices, const std::string &fileName)
{ {
std::ostringstream sstream; std::ostringstream sstream;
sstream << "Split Line(" << edge_id << ") {" << list2string(vertices) << "};"; sstream << "Split Line(" << edge_id << ") {" << list2string(vertices) << "};";
add_infile(sstream.str(), fileName, true); add_infile(sstream.str(), fileName);
} }
void apply_boolean(const std::string &fileName, const std::string &op, void apply_boolean(const std::string &fileName, const std::string &op,
...@@ -655,3 +638,15 @@ void apply_boolean(const std::string &fileName, const std::string &op, ...@@ -655,3 +638,15 @@ void apply_boolean(const std::string &fileName, const std::string &op,
sstream << "Delete; }"; sstream << "Delete; }";
add_infile(sstream.str(), fileName); add_infile(sstream.str(), fileName);
} }
void coherence(const std::string &fileName)
{
add_infile("Coherence;", fileName);
}
void delet(List_T *list, const std::string &fileName, const std::string &what)
{
std::ostringstream sstream;
sstream << "Delete {\n " << what << "{" << list2string(list) << "};\n}";
add_infile(sstream.str(), fileName);
}
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
class GEntity; class GEntity;
void coherence(const std::string &fileName); void add_infile(const std::string &text, const std::string &fileName);
void delet(List_T *list, const std::string &fileName, const std::string &what);
void add_infile(const std::string &text, const std::string &fileName,
bool deleted_something=false);
void add_charlength(List_T *list, const std::string &fileName, const std::string &lc); void add_charlength(List_T *list, const std::string &fileName, const std::string &lc);
void add_recosurf(List_T *list, const std::string &fileName); void add_recosurf(List_T *list, const std::string &fileName);
void add_trsfline(std::vector<int> &l, const std::string &fileName, void add_trsfline(std::vector<int> &l, const std::string &fileName,
...@@ -105,5 +102,7 @@ void split_edge(int edge_id, List_T *vertices, const std::string &fileName); ...@@ -105,5 +102,7 @@ void split_edge(int edge_id, List_T *vertices, const std::string &fileName);
void apply_boolean(const std::string &fileName, const std::string &op, void apply_boolean(const std::string &fileName, const std::string &op,
const std::vector<GEntity*> &object, const std::vector<GEntity*> &object,
const std::vector<GEntity*> &tool); const std::vector<GEntity*> &tool);
void coherence(const std::string &fileName);
void delet(List_T *list, const std::string &fileName, const std::string &what);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment