| 294 | Map.insert(std::make_pair(std::make_pair(endpoint1, endpoint2), midpoint)); |
| 295 | } |
| 296 | vtkIdType FindEdge(vtkIdType endpoint1, vtkIdType endpoint2) |
| 297 | { |
| 298 | if (endpoint1 == endpoint2) |
| 299 | { |
| 300 | return endpoint1; |
| 301 | } |
| 302 | if (endpoint1 > endpoint2) |
| 303 | std::swap(endpoint1, endpoint2); |
| 304 | MapType::iterator iter = Map.find(std::make_pair(endpoint1, endpoint2)); |
| 305 | if (iter != Map.end()) |
| 306 | { |
| 307 | return iter->second; |
| 308 | } |
| 309 | else |
| 310 | { |
| 311 | return -1; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | void clear() { Map.clear(); } |
| 316 |