BALL  1.5.0
graphFace.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_GRAPHFACE_H
6 #define BALL_STRUCTURE_GRAPHFACE_H
7 
8 #ifndef BALL_COMMON_H
9 # include <BALL/common.h>
10 #endif
11 
12 #include <list>
13 #include <vector>
14 
15 namespace BALL
16 {
17 
18  template <typename Vertex, typename Edge, typename Face>
19  class GraphVertex;
20 
21  template <typename Vertex, typename Edge, typename Face>
22  class GraphEdge;
23 
27  template <typename Vertex, typename Edge, typename Face>
28  class GraphFace
29  {
30  public:
31 
38  friend class GraphVertex<Vertex,Edge,Face>;
39  friend class GraphEdge<Vertex,Edge,Face>;
40 
42 
43 
46 
47  typedef typename std::list<Vertex*>::iterator VertexIterator;
48  typedef typename std::list<Vertex*>::const_iterator ConstVertexIterator;
49  typedef typename std::list<Edge*>::iterator EdgeIterator;
50  typedef typename std::list<Edge*>::const_iterator ConstEdgeIterator;
51 
53 
56 
60  GraphFace();
61 
69  GraphFace(const GraphFace<Vertex,Edge,Face>& face, bool deep = false);
70 
74  virtual ~GraphFace();
75 
77 
80 
87  void set(const GraphFace<Vertex,Edge,Face>& face, bool deep = false);
88 
94  GraphFace<Vertex,Edge,Face>& operator =
95  (const GraphFace<Vertex,Edge,Face>& face);
96 
98 
101 
105  void insert(Vertex* vertex);
106 
110  void insert(Edge* edge);
111 
115  void remove(Vertex* vertex);
116 
120  void remove(Edge* edge);
121 
125  Position numberOfVertices() const;
126 
130  Position numberOfEdges() const;
131 
132 
136  void setIndex(Index index);
137 
141  Index getIndex() const;
142 
150  bool getEdges(const Vertex* vertex, Edge*& edge1, Edge*& edge2) const;
151 
159  bool getEdge
160  (const Vertex* vertex1,
161  const Vertex* vertex2,
162  Edge*& edge) const;
163 
169  Edge* getSimilarEdge(const Edge* edge) const;
170 
177  bool substitute(const Vertex* old_vertex, Vertex* new_vertex);
178 
185  bool substitute(const Edge* old_edge, Edge* new_edge);
186 
188 
191 
195  virtual bool operator == (const Face& face) const;
196 
200  virtual bool operator != (const Face& face) const;
201 
205  virtual bool operator *= (const Face& face) const;
206 
212  Vertex* has(Vertex* vertex) const;
213 
218  Edge* has(Edge* edge) const;
219 
221 
224 
232  ConstEdgeIterator endEdge() const;
233 
235 
236  protected:
237 
238  /*_ @name Attributes
239  */
241 
242  /*_ The vertices of the GraphFace
243  */
244  std::list<Vertex*> vertex_;
245  /*_ The edges of the GraphFace
246  */
247  std::list<Edge*> edge_;
248  /* The index of the GraphFace
249  */
251 
253 
254  };
255 
256 
257 
258  template <typename Vertex, typename Edge, typename Face>
259  GraphFace<Vertex,Edge,Face>::GraphFace()
260  : vertex_(),
261  edge_(),
262  index_(-1)
263  {
264  }
265 
266 
267  template <typename Vertex, typename Edge, typename Face>
269  (const GraphFace<Vertex,Edge,Face>& face, bool deep)
270  : vertex_(),
271  edge_(),
272  index_(face.index_)
273  {
274  if (deep)
275  {
276  vertex_ = face.vertex_;
277  edge_ = face.edge_;
278  }
279  }
280 
281 
282  template <typename Vertex, typename Edge, typename Face>
284  {
285  }
286 
287 
288  template <typename Vertex, typename Edge, typename Face>
290  (const GraphFace<Vertex,Edge,Face>& face, bool deep)
291  {
292  if (this != &face)
293  {
294  if (deep)
295  {
296  vertex_ = face.vertex_;
297  edge_ = face.edge_;
298  }
299  index_ = face.index_;
300  }
301  }
302 
303 
304  template <typename Vertex, typename Edge, typename Face>
307  {
308  if (this != &face)
309  {
310  vertex_ = face.vertex_;
311  edge_ = face.edge_;
312  index_ = face.index_;
313  }
314  return *this;
315  }
316 
317 
318  template <typename Vertex, typename Edge, typename Face>
320  {
321  typename std::list<Vertex*>::iterator v = vertex_.begin();
322  bool found = false;
323  while ((!found) && (v != vertex_.end()))
324  {
325  found = (*v == vertex);
326  v++;
327  }
328  if (!found)
329  {
330  vertex_.push_back(vertex);
331  }
332  }
333 
334 
335  template <typename Vertex, typename Edge, typename Face>
337  {
338  typename std::list<Edge*>::iterator e = edge_.begin();
339  bool found = false;
340  while ((!found) && (e != edge_.end()))
341  {
342  found = (*e == edge);
343  e++;
344  }
345  if (!found)
346  {
347  edge_.push_back(edge);
348  }
349  }
350 
351 
352  template <typename Vertex, typename Edge, typename Face>
354  {
355  vertex_.remove(vertex);
356  }
357 
358 
359  template <typename Vertex, typename Edge, typename Face>
361  {
362  edge_.remove(edge);
363  }
364 
365 
366  template <typename Vertex, typename Edge, typename Face>
368  {
369  return vertex_.size();
370  }
371 
372 
373  template <typename Vertex, typename Edge, typename Face>
375  {
376  return edge_.size();
377  }
378 
379 
380  template <typename Vertex, typename Edge, typename Face>
382  {
383  index_ = index;
384  }
385 
386 
387  template <typename Vertex, typename Edge, typename Face>
389  {
390  return index_;
391  }
392 
393 
394  template <typename Vertex, typename Edge, typename Face>
396  (const Vertex* vertex,
397  Edge*& edge1,
398  Edge*& edge2) const
399  {
400  bool found1 = false;
401  bool found2 = false;
402  typename std::list<Edge*>::const_iterator e = edge_.begin();
403  while ((!found1) && (e != edge_.end()))
404  {
405  if (((*e)->vertex_[0] == vertex) || ((*e)->vertex_[1] == vertex))
406  {
407  edge1 = *e;
408  found1 = true;
409  }
410  e++;
411  }
412  if (found1)
413  {
414  while ((!found2) && (e != edge_.end()))
415  {
416  if (((*e)->vertex_[0] == vertex) || ((*e)->vertex_[1] == vertex))
417  {
418  edge2 = *e;
419  found2 = true;
420  }
421  e++;
422  }
423  }
424  return (found1 && found2);
425  }
426 
427 
428  template <typename Vertex, typename Edge, typename Face>
430  (const Vertex* vertex1,
431  const Vertex* vertex2,
432  Edge*& edge) const
433  {
434  typename std::list<Edge*>::const_iterator e = edge_.begin();
435  bool found = false;
436  while ((!found) && (e != edge_.end()))
437  {
438  if ((((*e)->vertex_[0] == vertex1) && ((*e)->vertex_[1] == vertex2)) ||
439  (((*e)->vertex_[0] == vertex2) && ((*e)->vertex_[1] == vertex1)) )
440  {
441  edge = *e;
442  found = true;
443  }
444  e++;
445  }
446  return found;
447  }
448 
449 
450  template <typename Vertex, typename Edge, typename Face>
451  Edge* GraphFace<Vertex,Edge,Face>::getSimilarEdge(const Edge* edge) const
452  {
453  typename std::list<Edge*>::const_iterator e = edge_.begin();
454  while (e != edge_.end())
455  {
456  if (**e *= *edge)
457  {
458  return *e;
459  }
460  e++;
461  }
462  return NULL;
463  }
464 
465 
466  template <typename Vertex, typename Edge, typename Face>
468  (const Vertex* old_vertex, Vertex* new_vertex)
469  {
470  typename std::list<Vertex*>::iterator v = vertex_.begin();
471  while (v != vertex_.end())
472  {
473  if (*v == old_vertex)
474  {
475  *v = new_vertex;
476  return true;
477  }
478  v++;
479  }
480  return false;
481  }
482 
483 
484  template <typename Vertex, typename Edge, typename Face>
486  (const Edge* old_edge, Edge* new_edge)
487  {
488  typename std::list<Edge*>::iterator e = edge_.begin();
489  while (e != edge_.end())
490  {
491  if (*e == old_edge)
492  {
493  *e = new_edge;
494  return true;
495  }
496  e++;
497  }
498  return false;
499  }
500 
501 
502  template <typename Vertex, typename Edge, typename Face>
504  {
505  return true;
506  }
507 
508 
509  template <typename Vertex, typename Edge, typename Face>
511  {
512  return false;
513  }
514 
515 
516  template <typename Vertex, typename Edge, typename Face>
518  {
519  return true;
520  }
521 
522 
523  template <typename Vertex, typename Edge, typename Face>
525  {
526  typename std::list<Vertex*>::const_iterator v = vertex_.begin();
527  while (v != vertex_.end())
528  {
529  if (*v == vertex)
530  {
531  return *v;
532  }
533  v++;
534  }
535  return NULL;
536  }
537 
538 
539  template <typename Vertex, typename Edge, typename Face>
540  Edge* GraphFace<Vertex,Edge,Face>::has(Edge* edge) const
541  {
542  typename std::list<Edge*>::const_iterator e = edge_.begin();
543  while (e != edge_.end())
544  {
545  if (*e == edge)
546  {
547  return *e;
548  }
549  e++;
550  }
551  return NULL;
552  }
553 
554 
555  template <typename Vertex, typename Edge, typename Face>
558  {
559  return vertex_.begin();
560  }
561 
562 
563  template <typename Vertex, typename Edge, typename Face>
566  {
567  return vertex_.begin();
568  }
569 
570 
571  template <typename Vertex, typename Edge, typename Face>
574  {
575  return vertex_.end();
576  }
577 
578 
579  template <typename Vertex, typename Edge, typename Face>
582  {
583  return vertex_.end();
584  }
585 
586 
587  template <typename Vertex, typename Edge, typename Face>
590  {
591  return edge_.begin();
592  }
593 
594 
595  template <typename Vertex, typename Edge, typename Face>
598  {
599  return edge_.begin();
600  }
601 
602 
603  template <typename Vertex, typename Edge, typename Face>
606  {
607  return edge_.end();
608  }
609 
610 
611  template <typename Vertex, typename Edge, typename Face>
614  {
615  return edge_.end();
616  }
617 
618 
619 
623  template <typename Vertex, typename Edge, typename Face>
624  class GraphTriangle
625  {
626  public:
627 
634  friend class GraphVertex<Vertex,Edge,Face>;
635  friend class GraphEdge<Vertex,Edge,Face>;
636 
640 
642 
643 
646  GraphTriangle();
647 
656  (const GraphTriangle<Vertex,Edge,Face>& face, bool deep = false);
657 
669  (Vertex* vertex1, Vertex* vertex2, Vertex* vertex3,
670  Edge* edge1, Edge* edge2, Edge* edge3,
671  Index index);
672 
676  virtual ~GraphTriangle();
677 
679 
682 
690  void set(const GraphTriangle<Vertex,Edge,Face>& face, bool deep = false);
691 
698  (const GraphTriangle<Vertex,Edge,Face>& face);
699 
709  void set
710  (Vertex* vertex1, Vertex* vertex2, Vertex* vertex3,
711  Edge* edge1, Edge* edge2, Edge* edge3,
712  Index index);
713 
715 
718 
725  void setVertex(Position i, Vertex* vertex);
726 
734  Vertex* getVertex(Position i) const;
735 
742  void setEdge(Position i, Edge* edge);
743 
750  Edge* getEdge(Position i) const;
751 
755  void setIndex(Index index);
756 
760  Index getIndex() const;
761 
769  bool getEdges(const Vertex* vertex, Edge*& edge1, Edge*& edge2) const;
770 
779  bool getEdge
780  (const Vertex* vertex1,
781  const Vertex* vertex2,
782  Edge*& edge) const;
783 
791  Index getSimilarEdge(const Edge* edge, Edge*& similar_edge) const;
792 
796  Index getRelativeIndex(const Vertex* vertex) const;
797 
801  Index getRelativeIndex(const Edge* edge) const;
802 
808  Vertex* third(const Vertex* v1, const Vertex* v2) const;
809 
815  Edge* third(const Edge* e1, const Edge* e2) const;
816 
817 
823  Edge* getOppositeEdge(const Vertex* vertex) const;
824 
825 
831  Vertex* getOppositeVertex(const Edge* edge) const;
832 
839  bool substitute(const Vertex* old_vertex, Vertex* new_vertex);
840 
847  bool substitute(const Edge* old_edge, Edge* new_edge);
848 
850 
853 
857  virtual bool operator == (const Face&) const;
858 
862  virtual bool operator != (const Face&) const;
863 
867  virtual bool operator *= (const Face&) const;
868 
874  Vertex* has(Vertex* vertex) const;
875 
880  Edge* has(Edge* edge) const;
881 
883 
884  protected:
885 
886  /*_ The vertices of the GraphTriangle
887  */
889  /*_ The edges of the GraphTriangle
890  */
891  Edge* edge_[3];
892  /* The index of the GraphTriangle
893  */
895 
896  };
897 
898 
899 
900  template <typename Vertex, typename Edge, typename Face>
902  : index_(-1)
903  {
904  vertex_[0] = NULL;
905  vertex_[1] = NULL;
906  vertex_[2] = NULL;
907  edge_[0] = NULL;
908  edge_[1] = NULL;
909  edge_[2] = NULL;
910  }
911 
912 
913  template <typename Vertex, typename Edge, typename Face>
915  (const GraphTriangle<Vertex,Edge,Face>& face, bool deep)
916  : index_(face.index_)
917  {
918  if (deep)
919  {
920  vertex_[0] = face.vertex_[0];
921  vertex_[1] = face.vertex_[1];
922  vertex_[2] = face.vertex_[2];
923  edge_[0] = face.edge_[0];
924  edge_[1] = face.edge_[1];
925  edge_[2] = face.edge_[2];
926  }
927  else
928  {
929  vertex_[0] = NULL;
930  vertex_[1] = NULL;
931  vertex_[2] = NULL;
932  edge_[0] = NULL;
933  edge_[1] = NULL;
934  edge_[2] = NULL;
935  }
936  }
937 
938 
939  template <typename Vertex, typename Edge, typename Face>
941  (Vertex* vertex1, Vertex* vertex2, Vertex* vertex3,
942  Edge* edge1, Edge* edge2, Edge* edge3,
943  Index index)
944  : index_(index)
945  {
946  vertex_[0] = vertex1;
947  vertex_[1] = vertex2;
948  vertex_[2] = vertex3;
949  edge_[0] = edge1;
950  edge_[1] = edge2;
951  edge_[2] = edge3;
952  }
953 
954 
955  template <typename Vertex, typename Edge, typename Face>
957  {
958  }
959 
960 
961  template <typename Vertex, typename Edge, typename Face>
963  (const GraphTriangle<Vertex,Edge,Face>& face, bool deep)
964  {
965  if (this != &face)
966  {
967  if (deep)
968  {
969  vertex_[0] = face.vertex_[0];
970  vertex_[1] = face.vertex_[1];
971  vertex_[2] = face.vertex_[2];
972  edge_[0] = face.edge_[0];
973  edge_[1] = face.edge_[1];
974  edge_[2] = face.edge_[2];
975  }
976  else
977  {
978  vertex_[0] = NULL;
979  vertex_[1] = NULL;
980  vertex_[2] = NULL;
981  edge_[0] = NULL;
982  edge_[1] = NULL;
983  edge_[2] = NULL;
984  }
985  index_ = face.index_;
986  }
987  }
988 
989 
990  template <typename Vertex, typename Edge, typename Face>
993  {
994  if (this != &face)
995  {
996  vertex_[0] = face.vertex_[0];
997  vertex_[1] = face.vertex_[1];
998  vertex_[2] = face.vertex_[2];
999  edge_[0] = face.edge_[0];
1000  edge_[1] = face.edge_[1];
1001  edge_[2] = face.edge_[2];
1002  index_ = face.index_;
1003  }
1004  return *this;
1005  }
1006 
1007 
1008  template <typename Vertex, typename Edge, typename Face>
1010  (Vertex* vertex1, Vertex* vertex2, Vertex* vertex3,
1011  Edge* edge1, Edge* edge2, Edge* edge3,
1012  Index index)
1013  {
1014  vertex_[0] = vertex1;
1015  vertex_[1] = vertex2;
1016  vertex_[2] = vertex3;
1017  edge_[0] = edge1;
1018  edge_[1] = edge2;
1019  edge_[2] = edge3;
1020  index_ = index;
1021  }
1022 
1023 
1024  template <typename Vertex, typename Edge, typename Face>
1026  {
1027  if (i > 2)
1028  {
1029  throw Exception::IndexOverflow(__FILE__,__LINE__,i,2);
1030  }
1031  else
1032  {
1033  vertex_[i] = vertex;
1034  }
1035  }
1036 
1037 
1038  template <typename Vertex, typename Edge, typename Face>
1040  {
1041  if (i > 2)
1042  {
1043  throw Exception::IndexOverflow(__FILE__,__LINE__,i,2);
1044  }
1045  else
1046  {
1047  return vertex_[i];
1048  }
1049  }
1050 
1051 
1052  template <typename Vertex, typename Edge, typename Face>
1054  {
1055  if (i > 2)
1056  {
1057  throw Exception::IndexOverflow(__FILE__,__LINE__,i,2);
1058  }
1059  else
1060  {
1061  edge_[i] = edge;
1062  }
1063  }
1064 
1065 
1066  template <typename Vertex, typename Edge, typename Face>
1068  {
1069  if (i > 2)
1070  {
1071  throw Exception::IndexOverflow(__FILE__,__LINE__,i,2);
1072  }
1073  else
1074  {
1075  return edge_[i];
1076  }
1077  }
1078 
1079 
1080  template <typename Vertex, typename Edge, typename Face>
1082  {
1083  index_ = index;
1084  }
1085 
1086 
1087  template <typename Vertex, typename Edge, typename Face>
1089  {
1090  return index_;
1091  }
1092 
1093 
1094  template <typename Vertex, typename Edge, typename Face>
1096  (const Vertex* vertex,
1097  Edge*& edge1,
1098  Edge*& edge2) const
1099  {
1100  Position i = 0;
1101  bool found1 = false;
1102  bool found2 = false;
1103  while ((!found1) && (i < 3))
1104  {
1105  if (edge_[i] != NULL)
1106  {
1107  if ((edge_[i]->vertex_[0] == vertex) ||
1108  (edge_[i]->vertex_[1] == vertex) )
1109  {
1110  edge1 = edge_[i];
1111  found1 = true;
1112  }
1113  }
1114  i++;
1115  }
1116  if (found1)
1117  {
1118  while ((!found2) && (i < 3))
1119  {
1120  if (edge_[i] != NULL)
1121  {
1122  if ((edge_[i]->vertex_[0] == vertex) ||
1123  (edge_[i]->vertex_[1] == vertex) )
1124  {
1125  edge2 = edge_[i];
1126  found2 = true;
1127  }
1128  }
1129  i++;
1130  }
1131  }
1132  return (found1 && found2);
1133  }
1134 
1135 
1136  template <typename Vertex, typename Edge, typename Face>
1138  (const Vertex* vertex1,
1139  const Vertex* vertex2,
1140  Edge*& edge) const
1141  {
1142  Position i = 0;
1143  bool found = false;
1144  while ((!found) && (i < 3))
1145  {
1146  if (edge_[i] != NULL)
1147  {
1148  if (((edge_[i]->vertex_[0] == vertex1) &&
1149  (edge_[i]->vertex_[1] == vertex2) ) ||
1150  ((edge_[i]->vertex_[0] == vertex2) &&
1151  (edge_[i]->vertex_[1] == vertex1) ) )
1152  {
1153  edge = edge_[i];
1154  found = true;
1155  }
1156  }
1157  i++;
1158  }
1159  return found;
1160  }
1161 
1162 
1163  template <typename Vertex, typename Edge, typename Face>
1165  (const Edge* edge, Edge*& similar_edge) const
1166  {
1167  if (*edge_[0] *= *edge)
1168  {
1169  similar_edge = edge_[0];
1170  return 0;
1171  }
1172  if (*edge_[1] *= *edge)
1173  {
1174  similar_edge = edge_[1];
1175  return 1;
1176  }
1177  if (*edge_[2] *= *edge)
1178  {
1179  similar_edge = edge_[2];
1180  return 2;
1181  }
1182  similar_edge = NULL;
1183  return -1;
1184  }
1185 
1186 
1187  template <typename Vertex, typename Edge, typename Face>
1189  (const Vertex* vertex) const
1190  {
1191  for (Position i = 0; i < 3; i++)
1192  {
1193  if (vertex_[i] == vertex)
1194  {
1195  return i;
1196  }
1197  }
1198  return -1;
1199  }
1200 
1201 
1202  template <typename Vertex, typename Edge, typename Face>
1204  (const Edge* edge) const
1205  {
1206  for (Position i = 0; i < 3; i++)
1207  {
1208  if (edge_[i] == edge)
1209  {
1210  return i;
1211  }
1212  }
1213  return -1;
1214  }
1215 
1216 
1217  template <typename Vertex, typename Edge, typename Face>
1219  (const Vertex* v1, const Vertex* v2) const
1220  {
1221  if ((vertex_[0] == v1) || (vertex_[0] == v2))
1222  {
1223  if ((vertex_[1] == v1) || (vertex_[1] == v2))
1224  {
1225  return vertex_[2];
1226  }
1227  else
1228  {
1229  return vertex_[1];
1230  }
1231  }
1232  else
1233  {
1234  return vertex_[0];
1235  }
1236  }
1237 
1238 
1239  template <typename Vertex, typename Edge, typename Face>
1241  (const Edge* e1, const Edge* e2) const
1242  {
1243  if ((edge_[0] == e1) || (edge_[0] == e2))
1244  {
1245  if ((edge_[1] == e1) || (edge_[1] == e2))
1246  {
1247  return edge_[2];
1248  }
1249  else
1250  {
1251  return edge_[1];
1252  }
1253  }
1254  else
1255  {
1256  return edge_[0];
1257  }
1258  }
1259 
1260 
1261  template <typename Vertex, typename Edge, typename Face>
1263  (const Vertex* vertex) const
1264  {
1265  for (Position i = 0; i < 3; i++)
1266  {
1267  if ((edge_[i]->vertex_[0] != vertex) &&
1268  (edge_[i]->vertex_[1] != vertex) )
1269  {
1270  return edge_[i];
1271  }
1272  }
1273  return NULL;
1274  }
1275 
1276 
1277  template <typename Vertex, typename Edge, typename Face>
1279  (const Edge* edge) const
1280  {
1281  for (Position i = 0; i < 3; i++)
1282  {
1283  if ((vertex_[i] != edge->vertex_[0]) &&
1284  (vertex_[i] != edge->vertex_[1]) )
1285  {
1286  return vertex_[i];
1287  }
1288  }
1289  return NULL;
1290  }
1291 
1292 
1293  template <typename Vertex, typename Edge, typename Face>
1295  (const Vertex* old_vertex, Vertex* new_vertex)
1296  {
1297  for (Position i = 0; i < 3; i++)
1298  {
1299  if (vertex_[i] == old_vertex)
1300  {
1301  vertex_[i] = new_vertex;
1302  return true;
1303  }
1304  }
1305  return false;
1306  }
1307 
1308 
1309  template <typename Vertex, typename Edge, typename Face>
1311  (const Edge* old_edge, Edge* new_edge)
1312  {
1313  for (Position i = 0; i < 3; i++)
1314  {
1315  if (edge_[i] == old_edge)
1316  {
1317  edge_[i] = new_edge;
1318  return true;
1319  }
1320  }
1321  return false;
1322  }
1323 
1324 
1325  template <typename Vertex, typename Edge, typename Face>
1327  {
1328  return true;
1329  }
1330 
1331 
1332  template <typename Vertex, typename Edge, typename Face>
1334  {
1335  return false;
1336  }
1337 
1338 
1339  template <typename Vertex, typename Edge, typename Face>
1341  {
1342  return true;
1343  }
1344 
1345 
1346  template <typename Vertex, typename Edge, typename Face>
1348  {
1349  if (vertex_[0] == vertex)
1350  {
1351  return vertex_[0];
1352  }
1353  if (vertex_[1] == vertex)
1354  {
1355  return vertex_[1];
1356  }
1357  if (vertex_[2] == vertex)
1358  {
1359  return vertex_[2];
1360  }
1361  return NULL;
1362  }
1363 
1364 
1365  template <typename Vertex, typename Edge, typename Face>
1367  {
1368  if (edge_[0] == edge)
1369  {
1370  return edge_[0];
1371  }
1372  if (edge_[1] == edge)
1373  {
1374  return edge_[1];
1375  }
1376  if (edge_[2] == edge)
1377  {
1378  return edge_[2];
1379  }
1380  return NULL;
1381  }
1382 
1383 
1384 } // namespace BALL
1385 
1386 #endif // BALL_STRUCTURE_RSFACE_H
BALL::GraphFace::endEdge
EdgeIterator endEdge()
Definition: graphFace.h:605
BALL::GraphFace::numberOfVertices
Position numberOfVertices() const
Definition: graphFace.h:367
BALL::GraphFace::beginEdge
EdgeIterator beginEdge()
Definition: graphFace.h:589
BALL::GraphTriangle
Definition: graphEdge.h:24
BALL::GraphFace::endVertex
VertexIterator endVertex()
Definition: graphFace.h:573
BALL::GraphVertex
Definition: graphEdge.h:18
BALL::operator!=
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
BALL::GraphFace::edge_
std::list< Edge * > edge_
Definition: graphFace.h:247
BALL::GraphFace::operator!=
virtual bool operator!=(const Face &face) const
Definition: graphFace.h:510
BALL::GraphFace::insert
void insert(Vertex *vertex)
Definition: graphFace.h:319
BALL::GraphTriangle::GraphTriangle
GraphTriangle()
Definition: graphFace.h:901
BALL::GraphFace::beginVertex
VertexIterator beginVertex()
Definition: graphFace.h:557
BALL::GraphFace::~GraphFace
virtual ~GraphFace()
Definition: graphFace.h:283
BALL::GraphFace::vertex_
std::list< Vertex * > vertex_
Definition: graphFace.h:244
BALL
Definition: constants.h:12
BALL::GraphFace< SASVertex, SASEdge, SASFace >::VertexIterator
std::list< SASVertex * >::iterator VertexIterator
Definition: graphFace.h:47
BALL::GraphFace::getEdges
bool getEdges(const Vertex *vertex, Edge *&edge1, Edge *&edge2) const
Definition: graphFace.h:396
BALL::GraphEdge
Definition: graphEdge.h:30
BALL::GraphFace::index_
Index index_
Definition: graphFace.h:250
BALL::GraphFace::remove
void remove(Vertex *vertex)
Definition: graphFace.h:353
BALL::GraphFace< SASVertex, SASEdge, SASFace >::ConstVertexIterator
std::list< SASVertex * >::const_iterator ConstVertexIterator
Definition: graphFace.h:48
BALL::GraphFace::numberOfEdges
Position numberOfEdges() const
Definition: graphFace.h:374
BALL::GraphFace
Definition: graphEdge.h:21
BALL_INDEX_TYPE
BALL::GraphFace::has
Vertex * has(Vertex *vertex) const
Definition: graphFace.h:524
BALL::GraphFace::setIndex
void setIndex(Index index)
Definition: graphFace.h:381
BALL_SIZE_TYPE
BALL::GraphFace::getEdge
bool getEdge(const Vertex *vertex1, const Vertex *vertex2, Edge *&edge) const
Definition: graphFace.h:430
BALL::GraphFace::substitute
bool substitute(const Vertex *old_vertex, Vertex *new_vertex)
Definition: graphFace.h:468
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
common.h
BALL::GraphFace::set
void set(const GraphFace< Vertex, Edge, Face > &face, bool deep=false)
Definition: graphFace.h:290
BALL::Exception::IndexOverflow
Definition: COMMON/exception.h:162
BALL::GraphFace::getSimilarEdge
Edge * getSimilarEdge(const Edge *edge) const
Definition: graphFace.h:451
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::GraphFace::operator*=
virtual bool operator*=(const Face &face) const
Definition: graphFace.h:517
BALL::GraphFace::getIndex
Index getIndex() const
Definition: graphFace.h:388
BALL::GraphFace< SASVertex, SASEdge, SASFace >::ConstEdgeIterator
std::list< SASEdge * >::const_iterator ConstEdgeIterator
Definition: graphFace.h:50
BALL::GraphFace::GraphFace
GraphFace()
Definition: graphFace.h:259
BALL::GraphTriangle::index_
Index index_
Definition: graphFace.h:894
BALL::GraphFace::operator==
virtual bool operator==(const Face &face) const
Definition: graphFace.h:503
BALL::VIEW::Vertex
Definition: vertex1.h:31
BALL::GraphFace< SASVertex, SASEdge, SASFace >::EdgeIterator
std::list< SASEdge * >::iterator EdgeIterator
Definition: graphFace.h:49