22 return std::count(wire.begin(), wire.end(), ge);
28 GEdge *ge = *(wire.begin());
29 wire.erase(wire.begin());
35 std::list<GEdge *> possibleChoices;
37 auto it = wire.begin();
38 auto ite = wire.end();
43 if(v1 == gv || v2 == gv) possibleChoices.push_back(ge);
46 it = possibleChoices.begin();
47 ite = possibleChoices.end();
51 wire.erase(std::remove_if(wire.begin(), wire.end(),
52 std::bind2nd(std::equal_to<GEdge *>(), ge)),
64 it = possibleChoices.begin();
65 ite = possibleChoices.end();
69 wire.erase(std::remove_if(wire.begin(), wire.end(),
70 std::bind2nd(std::equal_to<GEdge *>(), ge)),
89 for(
auto it =
begin(); it !=
end(); ++it) {
90 if(it->getEdge() == ge)
count++;
97 for(
auto it =
begin(); it !=
end(); ++it) { it->print(); }
103 for(
auto it =
begin(); it !=
end(); ++it) {
edges.push_back(it->getEdge()); }
109 for(
auto it =
begin(); it !=
end(); ++it) { signs.push_back(it->getSign()); }
112 static void loopTheLoop(std::list<GEdge *> &wire, std::list<GEdgeSigned> &loop,
113 GEdge **degeneratedToInsert)
119 if(prevOne && (*degeneratedToInsert) &&
122 *degeneratedToInsert =
nullptr;
128 Msg::Debug(
"Could not find next curve in loop, aborting");
143 std::list<GEdge *> wire;
144 std::vector<GEdge *> degenerated;
145 GEdge *degeneratedToInsert =
nullptr;
146 for(
auto it = cwire.begin(); it != cwire.end(); ++it) {
149 degenerated.push_back(ed);
154 if(degenerated.size() == 1) { wire.push_front(degenerated[0]); }
155 else if(degenerated.size() == 2) {
156 degeneratedToInsert = degenerated[1];
157 wire.push_front(degenerated[0]);
159 else if(degenerated.size() > 2) {
161 "More than two degenerated edges in one model face of an OCC model");
164 std::list<GEdge *> wire(cwire.begin(), cwire.end());
165 GEdge *degeneratedToInsert =
nullptr;
168 while(!wire.empty()) {
loopTheLoop(wire,
loop, °eneratedToInsert); }
178 if(
loop.empty())
return true;
179 std::vector<GEdgeSigned> all(
begin(),
end());
180 for(std::size_t i = 1; i < all.size(); i++) {
181 if(all[i - 1].getEndVertex() != all[i].getBeginVertex())
184 if(all.back().getEndVertex() != all.front().getBeginVertex())
191 std::reverse(
loop.begin(),
loop.end());
192 for(
auto es :
loop) es.changeSign();