MEPP2 Project
Graph_traits_aif.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
14 
15 #include <boost/graph/graph_traits.hpp>
16 #include <boost/graph/properties.hpp>
17 #include <boost/iterator/transform_iterator.hpp>
18 //#include "FEVV/Wrappings/Graph_properties_aif.h" // Do not include it!
19 
20 #include <algorithm>
21 
22 // shortcut for mesh type
25 
26 
27 namespace boost {
28 template<>
29 struct vertex_property_type< FEVV::DataStructures::AIF::AIFMesh >
30 {
31  // typedef AIFMeshT::vertex_type::ptr type;
33 };
34 
35 template<>
36 struct vertex_property_type< const FEVV::DataStructures::AIF::AIFMesh >
37 {
38  // typedef AIFMeshT::vertex_type::ptr type;
40 };
41 
42 template<>
43 struct edge_property_type< FEVV::DataStructures::AIF::AIFMesh >
44 {
45  typedef void type;
46 };
47 
48 template<>
49 struct edge_property_type< const FEVV::DataStructures::AIF::AIFMesh >
50 {
51  typedef void type;
52 };
53 
54 template<>
55 struct graph_traits< FEVV::DataStructures::AIF::AIFMesh >
56 {
57 public:
58  // Graph
62  typedef void edge_property_type;
63  typedef boost::undirected_tag directed_category;
64  typedef boost::disallow_parallel_edge_tag edge_parallel_category;
65  // typedef boost::bidirectional_graph_tag traversal_category;
66  struct my_traversal_category : public boost::vertex_list_graph_tag,
67  public boost::edge_list_graph_tag,
68  public boost::adjacency_graph_tag,
69  // public boost::incidence_graph_tag,
70  public boost::bidirectional_graph_tag
71  {
72  };
73  typedef my_traversal_category traversal_category;
74 
75  // FaceGraph
77 
78  // FaceListGraph
81 
82  // HalfedgeGraph
84  // typedef AIFMeshT::EdgeContainerType::iterator halfedge_iterator;
85 
86  // VertexListGraph
89 
90  // EdgeListGraph
93 
94  // BGL valid expression:
95  // http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/Graph.html
96  static inline vertex_descriptor null_vertex() { return vertex_descriptor(); }
97 
98  // CGAL-BGL HalfedgeGraph Concept
100  {
101  return halfedge_descriptor();
102  }
103 
104  // No Concept
105  static inline edge_descriptor null_edge() { return edge_descriptor(); }
106 
107  // CGAL-BGL FaceGraph Concept
108  static inline face_descriptor null_face() { return face_descriptor(); }
109 
110  // IncidenceGraph Concept
113 
114  template< typename CellType = vertex_descriptor >
115  struct IncidenceTraits // default is the 1D case
116  {
119  };
120 
125 };
126 
127 template<>
128 struct graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits<
129  typename boost::graph_traits<
130  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >
131 {
132  // MUTS FaceIncidentGraph Concept
134 };
135 template<>
136 struct graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits<
137  typename boost::graph_traits<
138  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >
139 {
140  // MUTS FaceIncidentGraph Concept
142 };
143 
144 template<>
145 struct graph_traits< const FEVV::DataStructures::AIF::AIFMesh >
146  : public graph_traits< FEVV::DataStructures::AIF::AIFMesh >
147 {
148 };
149 
150 } // namespace boost
151 
152 namespace FEVV {
153 namespace DataStructures {
154 namespace AIF {
155 
156 // Essential free functions specialization for AIF.
157 
158 // See http://www.boost.org/doc/libs/1_61_0/libs/graph/doc/graph_concepts.html
159 // for BGL concepts description.
160 
161 // See http://doc.cgal.org/latest/BGL/group__PkgBGLConcepts.html
162 // for CGAL-BGL concepts description.
163 
164 // BGL VertexListGraph
168 inline std::pair< typename boost::graph_traits<
169  FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator,
170  typename boost::graph_traits<
171  FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator >
173 {
174  // TODO-elo Fix const_cast when CGAL will be const correct
175  auto vertices_range =
176  (const_cast< FEVV::DataStructures::AIF::AIFMesh & >(sm)).GetVertices();
177 
178  return std::pair< typename boost::graph_traits<
179  FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator,
180  typename boost::graph_traits<
181  FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator >(
182  vertices_range.begin(), vertices_range.end());
183 }
184 
185 // BGL VertexListGraph
189 inline typename boost::graph_traits<
190  FEVV::DataStructures::AIF::AIFMesh >::vertices_size_type
192 {
193  return static_cast< typename boost::graph_traits<
194  FEVV::DataStructures::AIF::AIFMesh >::vertices_size_type >(
195  sm.GetNumberOfVertices());
196 }
197 
198 // BGL VertexIndexGraph Concept
199 inline void
201 {
202  auto vertex_range_pair = vertices(sm);
203  auto vertex_iter = vertex_range_pair.first;
204  int index = 0;
205  for(; vertex_iter != vertex_range_pair.second; ++vertex_iter)
206  {
207  (*vertex_iter)->SetIndex(index++);
208  }
209 }
210 
211 
212 // BGL AdjacencyGraph
213 inline std::pair< typename boost::graph_traits<
214  FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator,
215  typename boost::graph_traits<
216  FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator >
217 adjacent_vertices(typename boost::graph_traits<
220 {
221  auto vertices_range = AIFHelpers::adjacent_vertices(v);
222  return std::pair<
223  typename boost::graph_traits<
224  FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator,
225  typename boost::graph_traits<
226  FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator >(
227  vertices_range.begin(), vertices_range.end());
228 }
229 
230 // BGL EdgeListGraph
234 inline std::pair< typename boost::graph_traits<
235  FEVV::DataStructures::AIF::AIFMesh >::edge_iterator,
236  typename boost::graph_traits<
237  FEVV::DataStructures::AIF::AIFMesh >::edge_iterator >
239 {
240  // TODO-elo Fix const_cast when CGAL will be const correct
241  auto edges_range =
242  (const_cast< FEVV::DataStructures::AIF::AIFMesh & >(sm)).GetEdges();
243 
244  return std::pair< typename boost::graph_traits<
245  FEVV::DataStructures::AIF::AIFMesh >::edge_iterator,
246  typename boost::graph_traits<
247  FEVV::DataStructures::AIF::AIFMesh >::edge_iterator >(
248  edges_range.begin(), edges_range.end());
249 }
250 
251 // BGL EdgeListGraph
255 inline typename boost::graph_traits<
256  FEVV::DataStructures::AIF::AIFMesh >::edges_size_type
258 {
259  return static_cast< typename boost::graph_traits<
260  FEVV::DataStructures::AIF::AIFMesh >::edges_size_type >(
261  sm.GetNumberOfEdges());
262 }
263 
264 // BGL EdgeIndexGraph Concept
265 inline
266 void
268 {
269  auto edgeRangePair = edges(sm);
270  auto edgeIter = edgeRangePair.first;
271  int index = 0;
272  for (; edgeIter != edgeRangePair.second; ++edgeIter) {
273  (*edgeIter)->SetIndex(index++);
274  }
275 }
276 
277 // CGAL FaceListGraph
281 inline typename boost::graph_traits<
282  FEVV::DataStructures::AIF::AIFMesh >::faces_size_type
284 {
285  return static_cast< typename boost::graph_traits<
286  FEVV::DataStructures::AIF::AIFMesh >::faces_size_type >(
287  sm.GetNumberOfFaces());
288 }
289 
290 // CGAL-BGL HalfedgeGraph Concept
294 inline typename boost::graph_traits<
295  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
296 halfedge(typename boost::graph_traits<
299 {
300  return AIFHelpers::halfedge(v, sm);
301 }
302 
303 // CGAL-BGL HalfedgeGraph Concept
308 inline std::pair< typename boost::graph_traits<
309  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor,
310  bool >
312  typename boost::graph_traits<
314  typename boost::graph_traits<
317 {
319  GraphTrait;
320  typename GraphTrait::halfedge_descriptor h = AIFHelpers::halfedge(u, v, sm);
321 
322  return std::pair< typename GraphTrait::halfedge_descriptor, bool >(
323  h, (h != GraphTrait::null_halfedge()));
324 }
325 
326 // CGAL-BGL HalfedgeGraph Concept
330 inline typename boost::graph_traits<
331  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
332 halfedge(typename boost::graph_traits<
333  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
335 {
336  return AIFHelpers::halfedge(e, sm);
337 }
338 
339 // CGAL-BGL HalfedgeGraph Concept
343 inline typename boost::graph_traits<
344  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor
345 edge(typename boost::graph_traits<
346  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
348 {
349  return AIFHelpers::edge(h, sm);
350 }
351 
352 // BGL AdjacencyMatrix Concept
353 // The edge() function return in constant time.
357 inline std::pair< typename boost::graph_traits<
358  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor,
359  bool >
360 edge(typename boost::graph_traits<
362  typename boost::graph_traits<
365 {
367  GraphTrait;
368  typename GraphTrait::edge_descriptor e = AIFHelpers::common_edge(u, v);
369 
370  if(e != GraphTrait::null_edge())
371  {
372  if((e->get_first_vertex() != u) &&
373  (e->get_second_vertex() != v)) // to get the rigth edge on demand (just
374  // swapping its vertices when needed)
376  }
377  return std::pair< typename GraphTrait::edge_descriptor, bool >(
378  e, (e != GraphTrait::null_edge()));
379 }
380 
381 // BGL IncidenceGraph Concept
385 inline typename boost::graph_traits<
387 source(typename boost::graph_traits<
388  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
390 {
391  return e->get_first_vertex();
392 }
393 
394 // BGL IncidenceGraph Concept
398 inline typename boost::graph_traits<
400 target(typename boost::graph_traits<
401  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
403 {
404  return e->get_second_vertex();
405 }
406 
407 // BGL IncidenceGraph Concept
412 inline std::pair< typename boost::graph_traits<
413  FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator,
414  typename boost::graph_traits<
415  FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator >
416 out_edges(typename boost::graph_traits<
419 {
420  auto edges_range = u->GetIncidentEdges();
421  auto e_it = edges_range.begin(), e_ite = edges_range.end();
422  // Issue: this method is not constant as boost concept requires
423  // (http://www.boost.org/doc/libs/1_61_0/libs/graph/doc/IncidenceGraph.html),
424  // it is linear in the number of out-edges.
425  // But making it constant would imply commenting the next 3 lines of source
426  // codes, which would imply that each edge added to the vector of incidence
427  // edges of u is oriented outward u. Thus for each edge (u, v) u and v would
428  // need to store 2 edges in opposite direction, but we do not want to use that
429  // extra memory.
430  for(; e_it != e_ite; ++e_it)
431  if((*e_it)->get_first_vertex() !=
432  u) // get_first_vertex() is supposed to be the source vertex
434 
435  return std::pair<
436  typename boost::graph_traits<
437  FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator,
438  typename boost::graph_traits<
439  FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator >(
440  edges_range.begin(), edges_range.end());
441 }
442 
443 // BGL BidirectionalGraph Concept
447 inline std::pair< typename boost::graph_traits<
448  FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator,
449  typename boost::graph_traits<
450  FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator >
451 in_edges(typename boost::graph_traits<
454 {
455  auto edges_range = u->GetIncidentEdges();
456  auto e_it = edges_range.begin(), e_ite = edges_range.end();
457  for(; e_it != e_ite; ++e_it)
458  if((*e_it)->get_second_vertex() !=
459  u) // get_second_vertex() is supposed to be the target vertex
461 
462  return std::pair<
463  typename boost::graph_traits<
464  FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator,
465  typename boost::graph_traits<
466  FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator >(
467  edges_range.begin(), edges_range.end());
468 }
469 
470 // MUTS FaceIncidentGraph concept refined by CellIncidenceGraph Concept [see
471 // out_edges in CellIncidenceGraphConceptPage]
472 inline std::pair<
474  IncidenceTraits< typename boost::graph_traits<
475  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >::
476  out_edge_iterator,
478  IncidenceTraits< typename boost::graph_traits<
479  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >::
480  out_edge_iterator >
481 out_edges(typename boost::graph_traits<
482  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
484 {
485  auto edge_range = AIFHelpers::incident_edges(f);
486 
487  return std::pair<
489  IncidenceTraits< typename boost::graph_traits<
490  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >::
491  out_edge_iterator,
493  IncidenceTraits< typename boost::graph_traits<
494  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >::
495  out_edge_iterator >(edge_range.begin(), edge_range.end());
496 }
497 // MUTS FaceIncidentGraph concept refined by CellIncidenceGraph Concept [see
498 // in_edges in CellIncidenceGraphConceptPage]
499 inline std::pair<
501  IncidenceTraits< typename boost::graph_traits<
502  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >::
503  in_edge_iterator,
505  IncidenceTraits< typename boost::graph_traits<
506  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >::
507  in_edge_iterator >
508 in_edges(typename boost::graph_traits<
509  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
511 {
512  auto face_range = AIFHelpers::incident_faces(e);
513 
514  return std::pair<
516  IncidenceTraits< typename boost::graph_traits<
517  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >::
518  in_edge_iterator,
520  IncidenceTraits< typename boost::graph_traits<
521  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >::
522  in_edge_iterator >(face_range.begin(), face_range.end());
523 }
524 
525 // BGL IncidenceGraph Concept
526 inline typename boost::graph_traits<
527  FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
528 out_degree(typename boost::graph_traits<
531 {
532  return u->GetIncidentEdges().size();
533 }
534 
535 // BGL BidirectionalGraph Concept
536 inline typename boost::graph_traits<
537  FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
538 in_degree(typename boost::graph_traits<
541 {
542  return u->GetIncidentEdges().size();
543 }
544 
545 // BGL BidirectionalGraph Concept
546 inline typename boost::graph_traits<
547  FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
548 degree(typename boost::graph_traits<
551 {
552  return u->GetIncidentEdges().size();
553 }
554 
555 // MUTS FaceIncidentGraph concept refined by CellIncidenceGraph Concept
556 inline typename boost::graph_traits<
557  FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
558 degree(typename boost::graph_traits<
559  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
561 {
562  auto face_range = AIFHelpers::incident_faces(e);
563 
564  return face_range.size();
565 }
566 
567 // CGALFaceGraph Concept
571 inline typename boost::graph_traits<
572  FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
573 degree(typename boost::graph_traits<
574  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
576 {
577  return f->GetDegree();
578 }
579 
580 // CGAL-BGL HalfedgeGraph Concept
584 inline typename boost::graph_traits<
586 source(typename boost::graph_traits<
587  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
589 {
590  return h.get_source();
591 }
592 
593 // CGAL-BGL HalfedgeGraph Concept
597 inline typename boost::graph_traits<
598  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
599 next(typename boost::graph_traits<
600  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
602 {
603  return h.next(sm);
604 }
605 
606 // CGAL-BGL HalfedgeGraph Concept
610 inline typename boost::graph_traits<
611  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
612 prev(typename boost::graph_traits<
613  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
615 {
616  return h.prev(sm);
617 }
618 
619 // CGAL-BGL HalfedgeGraph Concept
623 inline typename boost::graph_traits<
624  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
625 opposite(typename boost::graph_traits<
626  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
628 {
629  return h.opposite(sm);
630 }
631 
632 // CGAL-BGL HalfedgeGraph Concept
636 inline typename boost::graph_traits<
638 target(typename boost::graph_traits<
639  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
641 {
642  return h.get_target();
643 }
644 
645 // CGAL-BGL FaceGraph Concept
649 inline typename boost::graph_traits<
650  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
651 halfedge(typename boost::graph_traits<
652  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
654 {
655  return AIFHelpers::halfedge(f, sm);
656 }
657 
658 // CGAL-BGL FaceGraph Concept
662 inline typename boost::graph_traits<
663  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor
664 face(typename boost::graph_traits<
665  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
667 {
668  return h.get_face();
669 }
670 
671 // CGAL-BGL FaceListGraph Concept
675 inline std::pair< typename boost::graph_traits<
676  FEVV::DataStructures::AIF::AIFMesh >::face_iterator,
677  typename boost::graph_traits<
678  FEVV::DataStructures::AIF::AIFMesh >::face_iterator >
680 {
681  // TODO-elo Fix const_cast when CGAL will be const correct
682  auto faces_range =
683  (const_cast< FEVV::DataStructures::AIF::AIFMesh & >(sm)).GetFaces();
684 
685  return std::pair< typename boost::graph_traits<
686  FEVV::DataStructures::AIF::AIFMesh >::face_iterator,
687  typename boost::graph_traits<
688  FEVV::DataStructures::AIF::AIFMesh >::face_iterator >(
689  faces_range.begin(), faces_range.end());
690 }
691 
692 // BGL VertexMutableGraph Concept
697 inline typename boost::graph_traits<
700 {
701  return AIFHelpers::add_vertex(sm);
702 }
703 
704 // CGAL MutableHalfedgeGraph Concept
705 inline void
706 add_vertex(typename boost::graph_traits<
709 {
711  GraphTrait;
712  if(v == GraphTrait::null_vertex())
713  {
714  throw std::invalid_argument(
715  "Helpers::add_vertex(v, m) -> vertex is null, cannot add it to mesh.");
716  }
717  else
718  {
719  AIFHelpers::add_vertex(v, sm);
720  }
721 }
722 
723 // CGAL MutableHalfedgeGraph Concept
727 inline void
728 remove_vertex(typename boost::graph_traits<
731 {
733 }
734 
735 // CGAL MutableHalfedgeGraph Concept
739 inline void
741  halfedge_descriptor /*&*/ h, // cannot use a ref
742  typename boost::graph_traits<
745 {
746  AIFHelpers::set_target(h, v, sm);
747 }
748 /*
749 inline
750 void set_source(typename
751 boost::graph_traits<FEVV::DataStructures::AIF::AIFMesh>::edge_descriptor e,
752  typename
753 boost::graph_traits<FEVV::DataStructures::AIF::AIFMesh>::vertex_descriptor v,
754  FEVV::DataStructures::AIF::AIFMesh& sm)
755 {
756  AIFHelpers::link_vertex_and_edge(v, e, AIFHelpers::vertex_position(e,
757 source(e, sm)));
758 }
759 inline
760 void set_target(typename
761 boost::graph_traits<FEVV::DataStructures::AIF::AIFMesh>::edge_descriptor e,
762  typename
763 boost::graph_traits<FEVV::DataStructures::AIF::AIFMesh>::vertex_descriptor v,
764  FEVV::DataStructures::AIF::AIFMesh& sm)
765 {
766  AIFHelpers::link_vertex_and_edge(v, e, AIFHelpers::vertex_position(e,
767 target(e, sm)));
768 }*/
769 
770 // CGAL MutableHalfedgeGraph Concept
774 inline void
775 set_halfedge(typename boost::graph_traits<
777  typename boost::graph_traits<
778  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
780 {
781  AIFHelpers::set_halfedge(v, h, sm);
782 }
783 
784 // CGAL MutableHalfedgeGraph Concept
789 inline void
790 set_next(typename boost::graph_traits<
791  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h1,
792  typename boost::graph_traits<
793  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h2,
795 {
796  AIFHelpers::set_next(h1, h2, sm);
797 }
798 //#define USE_ADD_EDGE_AIF
799 #ifdef USE_ADD_EDGE_AIF // conflict with function in Euler_operations.h (CGAL)
800 inline std::pair< typename boost::graph_traits<
808  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor,
809  bool >
810 add_edge(typename boost::graph_traits<
812  typename boost::graph_traits<
815 {
816  return AIFHelpers::add_edge(u, v, sm);
817 }
818 #endif
819 
820 // CGAL MutableHalfedgeGraph Concept
825 inline typename boost::graph_traits<
826  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor
828 {
829  return AIFHelpers::add_edge(sm);
830 }
831 
832 
833 // NOT IN MutableHalfedgeGraph Concept
834 inline void
835 add_edge(typename boost::graph_traits<
836  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
838 {
840  GraphTrait;
841  if(e == GraphTrait::null_edge())
842  {
843  throw std::invalid_argument(
844  "Helpers::add_edge(e, m) -> edge is null, cannot add it to mesh.");
845  }
846  else
847  {
848  AIFHelpers::add_edge(e, sm);
849  }
850 }
851 
852 
853 // CGAL MutableHalfedgeGraph Concept
857 inline void
858 remove_edge(typename boost::graph_traits<
859  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
861 {
863 }
864 
865 // BGL MutableEdgeGraph Concept
869 inline void
870 remove_edge(typename boost::graph_traits<
872  typename boost::graph_traits<
875 {
876  AIFHelpers::remove_edge(u, v, sm);
877 }
878 
879 // BGL MutableEdgeGraph Concept [this function is needed when the data structure
880 // also follows BGL incidence graph concept]
881 inline void
882 remove_edge(typename boost::graph_traits<
883  FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator
884  iter, // mandatory to use out_edge_iterator (and not as we may
885  // think the usual edge_iterator)
887 {
888  sm.EraseIsolatedEdge(*iter);
889 }
890 
891 // BGL MutableEdgeGraph Concept
892 template< typename UnaryPredicate >
893 inline void
895 {
896  auto edges_range =
897  (const_cast< FEVV::DataStructures::AIF::AIFMesh & >(sm)).GetEdges();
898  std::vector< typename boost::graph_traits<
899  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >
900  edges_to_unlink;
901  std::copy(
902  edges_range.begin(),
903  edges_range.end(),
904  std::back_inserter(edges_to_unlink)); // the relations need to be copied
905  // to keep iterator valid
906  std::remove_if(edges_to_unlink.begin(), edges_to_unlink.end(), p);
907 }
908 
909 // BGL MutableEdgeGraph Concept [this function is needed when the data structure
910 // also follows BGL incidence graph concept]
911 template< typename UnaryPredicate >
912 inline void
914  typename boost::graph_traits<
916  UnaryPredicate p,
918 {
919  auto edges_range_pair = out_edges(u, sm);
920  std::vector< typename boost::graph_traits<
921  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >
922  edges_to_unlink;
923  std::copy(
924  edges_range_pair.first,
925  edges_range_pair.second,
926  std::back_inserter(edges_to_unlink)); // the relations need to be copied
927  // to keep iterator valid
928  std::remove_if(edges_to_unlink.begin(), edges_to_unlink.end(), p);
929 }
930 
931 // BGL MutableEdgeGraph Concept [this function is needed when the data structure
932 // also follows BGL bidirectional graph concept]
933 template< typename UnaryPredicate >
934 inline void
935 remove_in_edge_if(typename boost::graph_traits<
937  UnaryPredicate p,
939 {
940  auto edges_range_pair = in_edges(u, sm);
941  std::vector< typename boost::graph_traits<
942  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >
943  edges_to_unlink;
944  std::copy(
945  edges_range_pair.first,
946  edges_range_pair.second,
947  std::back_inserter(edges_to_unlink)); // the relations need to be copied
948  // to keep iterator valid
949  std::remove_if(edges_to_unlink.begin(), edges_to_unlink.end(), p);
950 }
951 
952 // BGL MutableEdgeGraph Concept
956 inline void
957 clear_vertex(typename boost::graph_traits<
960 {
962 
964 }
965 
966 // CGAL MutableFaceGraph Concept
970 inline void
971 remove_face(typename boost::graph_traits<
972  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
974 {
976 }
977 
978 // CGAL MutableFaceGraph Concept
982 inline void
984  halfedge_descriptor h, // cannot use a ref
985  typename boost::graph_traits<
986  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
988 {
989  AIFHelpers::set_face(h, f, sm);
990 }
991 
992 // MUTS MutableFaceIncidentGraph concept refined by MutableCellIncidenceGraph
993 // Concept
994 inline void
995 add_in_edge(typename boost::graph_traits<
996  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
997  typename boost::graph_traits<
998  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f)
999 {
1000  AIFHelpers::add_face(e, f);
1001 }
1002 
1003 // MUTS MutableFaceIncidentGraph concept refined by MutableCellIncidenceGraph
1004 // Concept
1005 inline void
1006 remove_in_edge(typename boost::graph_traits<
1007  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e,
1008  typename boost::graph_traits<
1009  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f)
1010 {
1012 }
1013 
1014 // CGAL MutableFaceGraph Concept
1018 inline void
1019 set_halfedge(typename boost::graph_traits<
1020  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
1021  typename boost::graph_traits<
1022  FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h,
1024 {
1025  AIFHelpers::set_halfedge(f, h, sm);
1026 }
1027 
1028 // MUTS MutableFaceIncidentGraph concept refined by MutableCellIncidenceGraph
1029 // Concept
1030 inline void
1031 add_out_edge(typename boost::graph_traits<
1032  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
1033  typename boost::graph_traits<
1034  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e)
1035 {
1036  AIFHelpers::add_edge(f, e);
1037 }
1038 
1039 // MUTS MutableFaceIncidentGraph concept refined by MutableCellIncidenceGraph
1040 // Concept
1041 inline void
1042 remove_out_edge(typename boost::graph_traits<
1043  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f,
1044  typename boost::graph_traits<
1045  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e)
1046 {
1048 }
1049 
1050 // CGAL MutableFaceGraph Concept
1054 inline typename boost::graph_traits<
1055  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor
1057 {
1058  return AIFHelpers::add_face(sm);
1059 }
1060 
1061 } // namespace AIF
1062 } // namespace DataStructures
1063 } // namespace FEVV
1064 
1065 
1066 // overload Euler::add_face(const VertexRange& vr, Graph& g) from
1067 // Euler_operations.h ; this is not the most appropriate place to put this code
1068 // because it is not related to any concept, but this is the most handy place to
1069 // be sure that it will be found when Euler::add_face(vr, g) is used with AIF
1070 namespace CGAL {
1071 namespace Euler {
1072 #ifndef USE_ADD_EDGE_AIF
1073 
1077 typename boost::graph_traits<
1078  FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor
1082 {
1084 
1085  if (source(e, g) != s)
1087 
1088  return e;
1089 }
1090 #endif
1091 
1101 template< typename VertexRange >
1102 typename boost::graph_traits<
1103  FEVV::DataStructures::AIF::AIFMesh >::face_descriptor
1105 {
1106  typedef FEVV::DataStructures::AIF::AIFMesh Graph;
1109  typedef
1110  typename boost::graph_traits< Graph >::face_descriptor face_descriptor;
1111  typedef
1112  typename boost::graph_traits< Graph >::edge_descriptor edge_descriptor;
1113 
1115 
1116  std::vector< vertex_descriptor > vertices(vr.begin(),
1117  vr.end()); // quick and dirty copy
1118  unsigned int nv =
1119  (unsigned int)vertices.size(); // number of vertices in the face
1120 
1121  // build the face
1122  face_descriptor face = AIFHelpers::null_face();
1123 #if 0
1124  //TODO-elo-choose What to do if the face has 2 vertices only
1125  // -> solution 1: create one single edge and return a null face
1126  if( nv < 2 )
1127  {
1128  // don't allow degenerated faces
1129  throw std::runtime_error("add_face(vr, g) in Graph_traits_aif.h was called with less than 2 vertices");
1130  }
1131  else if( nv == 2 )
1132  {
1133  // Single edge
1134 
1135  // create the edge in the mesh
1136  edge_descriptor edge = AIFHelpers::add_edge(g);
1137 
1138  // link the edge and the vertices
1139  AIFHelpers::link_vertex_and_edge(vertices[0], edge, AIFHelpers::vertex_pos::FIRST);
1140  AIFHelpers::link_vertex_and_edge(vertices[1], edge, AIFHelpers::vertex_pos::SECOND);
1141  }
1142 #else
1143  // TODO-elo-choose What to do if the face has 2 vertices only
1144  // -> solution 2: do not create any edge, throw an exception
1145  // -> other solution (not implemented): do not create any
1146  // edge, return a null face
1147  if(nv < 3)
1148  {
1149  // don't allow degenerated faces
1150  throw std::runtime_error("add_face(vr, g) in Graph_traits_aif.h was called "
1151  "with less than 3 vertices");
1152  }
1153 #endif
1154  else if(nv > 2)
1155  {
1156  // create the face in the mesh
1158 
1159  // the source of the first edge is the last vertex in the list
1160  vertex_descriptor vsource = vertices.back();
1161 
1162  // loop over face's vertices to create the edges
1163  for(unsigned int i = 0; i < nv; i++)
1164  {
1165  vertex_descriptor vtarget = vertices[i];
1166 
1167  // create the edge if it doesn't already exist
1168  edge_descriptor edge = AIFHelpers::common_edge(vsource, vtarget);
1169  if(edge == AIFHelpers::null_edge())
1170  {
1171  // create the edge in the mesh
1173 
1174  // link the edge and the vertices
1176  vsource, edge, AIFHelpers::vertex_pos::FIRST);
1178  vtarget, edge, AIFHelpers::vertex_pos::SECOND);
1179  }
1180 
1181  // link the edge and the face (when needed -> else dangling edge)
1184 
1185  // the target of the current edge is the source of the next edge
1186  vsource = vtarget;
1187  }
1188  }
1189 
1190  return face;
1191 }
1192 
1193 } // namespace Euler
1194 } // namespace CGAL
FEVV::DataStructures::AIF::AIFTopologyHelpers::set_target
static void set_target(halfedge_descriptor h, vertex_descriptor target, AIFMesh &)
Definition: AIFTopologyHelpers.h:6014
CGAL::Euler::add_face
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor add_face(const VertexRange &vr, FEVV::DataStructures::AIF::AIFMesh &g)
Definition: Graph_traits_aif.h:1104
FEVV::DataStructures::AIF::AIFMesh::GetNumberOfEdges
unsigned int GetNumberOfEdges() const
Definition: AIFMesh.hpp:214
FEVV::DataStructures::AIF::vertices
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator > vertices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the vertices of the mesh.
Definition: Graph_traits_aif.h:172
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertices_size_type
AIFHelpers::size_type vertices_size_type
Definition: Graph_traits_aif.h:88
FEVV::DataStructures::AIF::AIFTopologyHelpers::common_edge
static edge_descriptor common_edge(vertex_descriptor vertex1, vertex_descriptor vertex2)
Definition: AIFTopologyHelpers.h:458
FEVV::DataStructures::AIF::remove_vertex
void remove_vertex(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, FEVV::DataStructures::AIF::AIFMesh &sm)
Removes v from the mesh.
Definition: Graph_traits_aif.h:728
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor
AIFMeshT::face_type::ptr face_descriptor
Definition: Graph_traits_aif.h:76
FEVV::DataStructures::AIF::add_in_edge
void add_in_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f)
Definition: Graph_traits_aif.h:995
FEVV::DataStructures::AIF::num_vertices
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertices_size_type num_vertices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an upper bound of the number of vertices of the mesh.
Definition: Graph_traits_aif.h:191
FEVV::DataStructures::AIF::next
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor next(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the next halfedge around its face.
Definition: Graph_traits_aif.h:599
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_property_type
void edge_property_type
Definition: Graph_traits_aif.h:62
FEVV::DataStructures::AIF::degree
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::degree_size_type degree(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:548
FEVV::DataStructures::AIF::AIFTopologyHelpers::add_face
static face_descriptor add_face(ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:2887
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor
AIFMeshT::edge_type::ptr edge_descriptor
Definition: Graph_traits_aif.h:61
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator
AIFMeshT::VertexContainerType::iterator vertex_iterator
Definition: Graph_traits_aif.h:87
AIFMeshT
FEVV::DataStructures::AIF::AIFMesh AIFMeshT
Definition: Graph_traits_aif.h:23
FEVV::DataStructures::AIF::AIFTopologyHelpers::AIFHalfEdge
Definition: AIFTopologyHelpers.h:4748
CGAL::Euler::add_edge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor add_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor s, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor t, FEVV::DataStructures::AIF::AIFMesh &g)
Definition: Graph_traits_aif.h:1079
FEVV::DataStructures::AIF::AIFTopologyHelpers::link_edge_and_face
static void link_edge_and_face(edge_descriptor edge, face_descriptor face)
Definition: AIFTopologyHelpers.h:1305
FEVV::DataStructures::AIF::remove_edge_if
void remove_edge_if(UnaryPredicate p, FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_traits_aif.h:894
boost::vertex_property_type< const FEVV::DataStructures::AIF::AIFMesh >::type
AIFMeshT::Point type
Definition: Graph_traits_aif.h:39
FEVV::DataStructures::AIF::out_edges
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator > out_edges(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:416
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits::out_edge_iterator
AIFHelpers::out_edge_iterator out_edge_iterator
Definition: Graph_traits_aif.h:117
FEVV::DataStructures::AIF::AIFMesh::ptr
boost::shared_ptr< Self > ptr
Definition: AIFMesh.hpp:50
FEVV::DataStructures::AIF::remove_in_edge
void remove_in_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f)
Definition: Graph_traits_aif.h:1006
FEVV::DataStructures::AIF::set_halfedge
void set_halfedge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, FEVV::DataStructures::AIF::AIFMesh &sm)
Sets the halfedge of v to h. The target vertex of h must be v.
Definition: Graph_traits_aif.h:775
FEVV::DataStructures::AIF::edges
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator > edges(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the edges of the mesh.
Definition: Graph_traits_aif.h:238
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_parallel_category
boost::disallow_parallel_edge_tag edge_parallel_category
Definition: Graph_traits_aif.h:64
FEVV::DataStructures::AIF::AIFTopologyHelpers::out_edge_iterator
edge_container_in_vertex::const_iterator out_edge_iterator
Definition: AIFTopologyHelpers.h:89
FEVV::DataStructures::AIF::AIFTopologyHelpers::adjacency_iterator
vertex_container_in_vertex::const_iterator adjacency_iterator
Definition: AIFTopologyHelpers.h:92
FEVV::DataStructures::AIF::AIFTopologyHelpers::remove_face
static void remove_face(face_descriptor face, ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:3120
FEVV::DataStructures::AIF::set_next
void set_next(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h1, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h2, FEVV::DataStructures::AIF::AIFMesh &sm)
Sets the successor of h1 around a face to h2, and the prededecessor of h2 to h1.
Definition: Graph_traits_aif.h:790
FEVV::DataStructures::AIF::add_face
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor add_face(FEVV::DataStructures::AIF::AIFMesh &sm)
Adds a new face to the graph without initializing the connectivity.
Definition: Graph_traits_aif.h:1056
FEVV::DataStructures::AIF::remove_edge
void remove_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, FEVV::DataStructures::AIF::AIFMesh &sm)
Remove edge e.
Definition: Graph_traits_aif.h:858
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator
AIFMeshT::EdgeContainerType::iterator edge_iterator
Definition: Graph_traits_aif.h:91
FEVV::DataStructures::AIF::opposite
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor opposite(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the halfedge with source and target swapped.
Definition: Graph_traits_aif.h:625
FEVV::DataStructures::AIF::AIFTopologyHelpers::incident_edge_iterator
edge_container_in_face::iterator incident_edge_iterator
Definition: AIFTopologyHelpers.h:94
boost
Definition: Graph_properties_aif.h:48
FEVV::DataStructures::AIF::edge
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor, bool > edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the edge with extremities u and v.
Definition: Graph_traits_aif.h:360
FEVV::DataStructures::AIF::AIFTopologyHelpers::edge
static edge_descriptor edge(halfedge_descriptor h, const AIFMesh &)
Definition: AIFTopologyHelpers.h:5998
FEVV::DataStructures::AIF::AIFTopologyHelpers::null_edge
static edge_descriptor null_edge()
Definition: AIFTopologyHelpers.h:113
FEVV::DataStructures::AIF::AIFTopologyHelpers::add_edge
static edge_descriptor add_edge(ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:2772
FEVV::DataStructures::AIF::AIFTopologyHelpers::incident_faces
static boost::iterator_range< face_container_in_vertex::const_iterator > incident_faces(vertex_descriptor vertex)
Definition: AIFTopologyHelpers.h:415
FEVV::DataStructures::AIF::in_degree
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::degree_size_type in_degree(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:538
FEVV::DataStructures::AIF::AIFTopologyHelpers::null_face
static face_descriptor null_face()
Definition: AIFTopologyHelpers.h:114
FEVV::DataStructures::AIF::source
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor source(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the source vertex of e.
Definition: Graph_traits_aif.h:387
FEVV::DataStructures::AIF::AIFTopologyHelpers::set_halfedge
static void set_halfedge(vertex_descriptor target, halfedge_descriptor h, AIFMesh &)
Definition: AIFTopologyHelpers.h:6041
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::out_edge_iterator
IncidenceTraits< vertex_descriptor >::out_edge_iterator out_edge_iterator
Definition: Graph_traits_aif.h:122
FEVV::DataStructures::AIF::AIFTopologyHelpers::swap_vertices
static void swap_vertices(edge_descriptor edge)
Definition: AIFTopologyHelpers.h:1286
FEVV::DataStructures::AIF::remove_out_edge
void remove_out_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e)
Definition: Graph_traits_aif.h:1042
FEVV::DataStructures::AIF::add_edge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor add_edge(FEVV::DataStructures::AIF::AIFMesh &sm)
Adds two opposite halfedges to the graph without initializing the connectivity.
Definition: Graph_traits_aif.h:827
FEVV::DataStructures::AIF::edge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the edge corresponding to h and opposite(h).
Definition: Graph_traits_aif.h:345
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::null_edge
static edge_descriptor null_edge()
Definition: Graph_traits_aif.h:105
FEVV::DataStructures::AIF::AIFCellContainer< face_type::ptr >::iterator
std::vector< face_type::ptr >::iterator iterator
Definition: AIFCellContainer.h:28
FEVV::DataStructures::AIF::AIFTopologyHelpers::link_vertex_and_edge
static void link_vertex_and_edge(vertex_descriptor vertex, edge_descriptor edge, vertex_pos position)
Definition: AIFTopologyHelpers.h:515
FEVV::DataStructures::AIF::remove_in_edge_if
void remove_in_edge_if(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, UnaryPredicate p, FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_traits_aif.h:935
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator
AIFMeshT::FaceContainerType::iterator face_iterator
Definition: Graph_traits_aif.h:79
FEVV::DataStructures::AIF::AIFMesh::GetNumberOfVertices
unsigned int GetNumberOfVertices() const
Definition: AIFMesh.hpp:206
FEVV::DataStructures::AIF::renumber_edge_indices
void renumber_edge_indices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_traits_aif.h:267
FEVV::DataStructures::AIF::num_faces
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::faces_size_type num_faces(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an upper bound of the number of faces of the graph.
Definition: Graph_traits_aif.h:283
FEVV::DataStructures::AIF::AIFTopologyHelpers::remove_edge
static void remove_edge(edge_descriptor edge, ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:3012
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
AIFMesh.hpp
FEVV::DataStructures::AIF::faces
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator > faces(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an iterator range over all faces of the mesh.
Definition: Graph_traits_aif.h:679
FEVV::DataStructures::AIF::AIFTopologyHelpers::is_isolated_vertex
static bool is_isolated_vertex(vertex_descriptor vertex)
Definition: AIFTopologyHelpers.h:159
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits< boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor >::in_edge_iterator
AIFHelpers::incident_face_iterator in_edge_iterator
Definition: Graph_traits_aif.h:133
FEVV::DataStructures::AIF::AIFTopologyHelpers::incident_face_iterator
face_container_in_edge::iterator incident_face_iterator
Definition: AIFTopologyHelpers.h:95
AIFHelpers
FEVV::DataStructures::AIF::AIFTopologyHelpers AIFHelpers
Definition: Graph_traits_aif.h:24
FEVV::DataStructures::AIF::halfedge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor halfedge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns a halfedge with target v.
Definition: Graph_traits_aif.h:296
FEVV::DataStructures::AIF::AIFTopologyHelpers::set_face
static void set_face(halfedge_descriptor h, face_descriptor face, AIFMesh &)
Definition: AIFTopologyHelpers.h:6199
CGAL
Definition: Graph_properties_cgal_point_set.h:32
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::directed_category
boost::undirected_tag directed_category
Definition: Graph_traits_aif.h:63
FEVV::DataStructures::AIF::target
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor target(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the target vertex of e.
Definition: Graph_traits_aif.h:400
FEVV::DataStructures::AIF::AIFTopologyHelpers::size_type
unsigned int size_type
Definition: AIFTopologyHelpers.h:87
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits::in_edge_iterator
AIFHelpers::out_edge_iterator in_edge_iterator
Definition: Graph_traits_aif.h:118
FEVV::DataStructures::AIF::AIFTopologyHelpers::halfedge
static halfedge_descriptor halfedge(face_descriptor face, const AIFMesh &)
Definition: AIFTopologyHelpers.h:5769
FEVV::DataStructures::AIF::AIFTopologyHelpers::set_next
static void set_next(halfedge_descriptor h1, halfedge_descriptor h2, AIFMesh &mesh)
Definition: AIFTopologyHelpers.h:6067
FEVV::DataStructures::AIF::AIFTopologyHelpers::remove_vertex
static void remove_vertex(vertex_descriptor vertex, ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:2960
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::faces_size_type
AIFHelpers::size_type faces_size_type
Definition: Graph_traits_aif.h:80
FEVV::DataStructures::AIF::renumber_vertex_indices
void renumber_vertex_indices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_traits_aif.h:200
FEVV::DataStructures::AIF::add_out_edge
void add_out_edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e)
Definition: Graph_traits_aif.h:1031
CGAL::vertices
std::pair< typename boost::graph_traits< FEVV::CGALPointSet >::vertex_iterator, typename boost::graph_traits< FEVV::CGALPointSet >::vertex_iterator > vertices(FEVV::CGALPointSet &ps)
Returns the iterator range of the vertices of the mesh.
Definition: Graph_traits_cgal_point_set.h:87
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator
IncidenceTraits< vertex_descriptor >::in_edge_iterator in_edge_iterator
Definition: Graph_traits_aif.h:124
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::null_face
static face_descriptor null_face()
Definition: Graph_traits_aif.h:108
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >
Definition: Graph_traits_aif.h:56
boost::edge_property_type< FEVV::DataStructures::AIF::AIFMesh >::type
void type
Definition: Graph_traits_aif.h:45
FEVV::DataStructures::AIF::num_edges
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edges_size_type num_edges(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an upper bound of the number of edges of the graph.
Definition: Graph_traits_aif.h:257
FEVV::DataStructures::AIF::set_target
void set_target(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, FEVV::DataStructures::AIF::AIFMesh &sm)
Sets the target vertex of h and the source of opposite(h) to v.
Definition: Graph_traits_aif.h:740
FEVV::DataStructures::AIF::AIFMesh::GetNumberOfFaces
unsigned int GetNumberOfFaces() const
Definition: AIFMesh.hpp:222
FEVV::DataStructures::AIF::add_vertex
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor add_vertex(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_property_type vp, FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_properties_aif.h:263
FEVV::DataStructures::AIF::in_edges
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator > in_edges(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:451
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edges_size_type
AIFHelpers::size_type edges_size_type
Definition: Graph_traits_aif.h:92
boost::vertex_property_type< FEVV::DataStructures::AIF::AIFMesh >::type
AIFMeshT::Point type
Definition: Graph_traits_aif.h:32
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::null_vertex
static vertex_descriptor null_vertex()
Definition: Graph_traits_aif.h:96
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::degree_size_type
AIFHelpers::degree_size_type degree_size_type
Definition: Graph_traits_aif.h:111
FEVV::DataStructures::AIF::prev
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor prev(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the previous halfedge around its face.
Definition: Graph_traits_aif.h:612
FEVV::DataStructures::AIF::AIFTopologyHelpers::incident_edges
static boost::iterator_range< edge_container_in_vertex::const_iterator > incident_edges(vertex_descriptor vertex)
Definition: AIFTopologyHelpers.h:399
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::traversal_category
my_traversal_category traversal_category
Definition: Graph_traits_aif.h:73
FEVV::DataStructures::AIF::adjacent_vertices
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator > adjacent_vertices(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:217
FEVV::DataStructures::AIF::AIFTopologyHelpers
This class is an helper class associated to the AIFMesh structure. AIFTopologyHelpers implements all ...
Definition: AIFTopologyHelpers.h:57
FEVV::DataStructures::AIF::AIFTopologyHelpers::clear_vertex
static void clear_vertex(vertex_descriptor vertex)
Definition: AIFTopologyHelpers.h:2946
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47
FEVV::DataStructures::AIF::face
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor face(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the face incident to halfedge h.
Definition: Graph_traits_aif.h:664
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::IncidenceTraits< boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor >::out_edge_iterator
AIFHelpers::incident_edge_iterator out_edge_iterator
Definition: Graph_traits_aif.h:141
FEVV::DataStructures::AIF::AIFTopologyHelpers::add_vertex
static vertex_descriptor add_vertex(ptr_mesh mesh)
Definition: AIFTopologyHelpers.h:2709
FEVV::DataStructures::AIF::out_degree
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::degree_size_type out_degree(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:528
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::adjacency_iterator
AIFHelpers::adjacency_iterator adjacency_iterator
Definition: Graph_traits_aif.h:112
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::null_halfedge
static halfedge_descriptor null_halfedge()
Definition: Graph_traits_aif.h:99
FEVV::DataStructures::AIF::AIFTopologyHelpers::adjacent_vertices
static std::vector< vertex_descriptor > adjacent_vertices(vertex_descriptor vertex)
Definition: AIFTopologyHelpers.h:377
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor
AIFHelpers::AIFHalfEdge halfedge_descriptor
Definition: Graph_traits_aif.h:83
AIFMesh
FEVV::DataStructures::AIF::AIFMesh AIFMesh
Definition: Graph_properties_aif.h:19
FEVV::DataStructures::AIF::AIFTopologyHelpers::are_incident
static bool are_incident(vertex_descriptor vertex, edge_descriptor edge)
Function determining if the arguments share an incidence relation.
Definition: AIFTopologyHelpers.h:303
FEVV::DataStructures::AIF::AIFMesh::EraseIsolatedEdge
void EraseIsolatedEdge(edge_type::ptr edge)
Definition: AIFMesh.hpp:299
FEVV::DataStructures::AIF::clear_vertex
void clear_vertex(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, FEVV::DataStructures::AIF::AIFMesh &)
Definition: Graph_traits_aif.h:957
FEVV::DataStructures::AIF::AIFTopologyHelpers::degree_size_type
edge_container_in_vertex::size_type degree_size_type
Definition: AIFTopologyHelpers.h:90
FEVV::DataStructures::AIF::remove_out_edge_if
void remove_out_edge_if(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, UnaryPredicate p, FEVV::DataStructures::AIF::AIFMesh &sm)
Definition: Graph_traits_aif.h:913
FEVV::DataStructures::AIF::set_face
void set_face(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f, FEVV::DataStructures::AIF::AIFMesh &sm)
Sets the corresponding face of h to f.
Definition: Graph_traits_aif.h:983
FEVV::DataStructures::AIF::source
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor source(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the source vertex of h.
Definition: Graph_traits_aif.h:586
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_property_type
AIFMeshT::Point vertex_property_type
Definition: Graph_traits_aif.h:60
boost::edge_property_type< const FEVV::DataStructures::AIF::AIFMesh >::type
void type
Definition: Graph_traits_aif.h:51
FEVV::DataStructures::AIF::AIFPoint
Definition: AIFProperties.h:31
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor
AIFMeshT::vertex_type::ptr vertex_descriptor
Definition: Graph_traits_aif.h:59
FEVV::DataStructures::AIF::remove_face
void remove_face(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor f, FEVV::DataStructures::AIF::AIFMesh &sm)
Removes f from the mesh.
Definition: Graph_traits_aif.h:971