MEPP2 Project
CGALConceptsCheck.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 
13 //#include <boost/concept_check.hpp>
14 //#include <boost/concept/assert.hpp>
15 #include <boost/graph/graph_concepts.hpp>
16 #include <boost/concept/detail/concept_def.hpp>
17 
18 namespace FEVV {
19 
20 using namespace boost;
29 BOOST_concept(CGALHalfedgeGraph, (G))
30 {
31  typedef typename boost::graph_traits< G >::halfedge_descriptor
32  halfedge_descriptor;
33  typedef typename boost::graph_traits< G >::edge_descriptor edge_descriptor;
34  typedef
36  BOOST_CONCEPT_USAGE(CGALHalfedgeGraph)
37  {
38  BOOST_CONCEPT_ASSERT((DefaultConstructible< halfedge_descriptor >));
39  BOOST_CONCEPT_ASSERT((Assignable< halfedge_descriptor >));
40  BOOST_CONCEPT_ASSERT((EqualityComparable< halfedge_descriptor >));
41  BOOST_CONCEPT_ASSERT((LessThanComparable< halfedge_descriptor >));
42  e = edge(h, g);
43  h = halfedge(e, g);
44  h = halfedge(v, g);
45  p = halfedge(u, v, g);
46  h = opposite(h, g);
47  v = source(h, g);
48  v = target(h, g);
49  h = next(h, g);
50  h = prev(h, g);
51  h = boost::graph_traits< G >::null_halfedge();
52  }
53  halfedge_descriptor h;
54  edge_descriptor e;
55  vertex_descriptor u, v;
56  std::pair< halfedge_descriptor, bool > p;
57  G g;
58 };
59 
68 BOOST_concept(CGALHalfedgeListGraph, (G)) : CGALHalfedgeGraph< G >
69 {
70  typedef
71  typename boost::graph_traits< G >::halfedge_iterator halfedge_iterator;
72  typedef typename boost::graph_traits< G >::halfedges_size_type
73  halfedges_size_type;
74  BOOST_CONCEPT_USAGE(CGALHalfedgeListGraph)
75  {
76  BOOST_CONCEPT_ASSERT((DefaultConstructible< halfedge_iterator >));
77  BOOST_CONCEPT_ASSERT((Assignable< halfedge_iterator >));
78  BOOST_CONCEPT_ASSERT((EqualityComparable< halfedge_iterator >));
79  E = num_halfedges(g);
80  p = halfedges(g);
81  }
82  std::pair< halfedge_iterator, halfedge_iterator > p;
83  halfedges_size_type E;
84  G g;
85 };
86 
95 BOOST_concept(CGALMutableHalfedgeGraph, (G))
96 {
97  typedef typename boost::graph_traits< G >::halfedge_descriptor
98  halfedge_descriptor;
99  typedef typename boost::graph_traits< G >::edge_descriptor edge_descriptor;
100  typedef
102  BOOST_CONCEPT_USAGE(CGALMutableHalfedgeGraph)
103  {
104  v = add_vertex(g);
105  remove_vertex(v, g);
106  e = add_edge(g);
107  remove_edge(e, g);
108  set_target(h, v, g);
109  set_halfedge(v, h, g);
110  set_next(h1, h2, g);
111  }
112  halfedge_descriptor h, h1, h2;
113  edge_descriptor e;
115  G g;
116 };
117 
125 BOOST_concept(CGALFaceGraph, (G)) : CGALHalfedgeGraph< G >
126 {
127  typedef typename boost::graph_traits< G >::face_descriptor face_descriptor;
128  typedef typename boost::graph_traits< G >::halfedge_descriptor
129  halfedge_descriptor;
130  BOOST_CONCEPT_USAGE(CGALFaceGraph)
131  {
132  f = face(h, g);
133  h = halfedge(f, g);
134  (void)degree(f, g);
135  f = boost::graph_traits< G >::null_face();
136  }
137  face_descriptor f;
138  halfedge_descriptor h;
139  G g;
140 };
141 
150 BOOST_concept(CGALFaceListGraph, (G)) : CGALFaceGraph< G >
151 {
152  typedef typename boost::graph_traits< G >::face_iterator face_iterator;
153  typedef typename boost::graph_traits< G >::faces_size_type faces_size_type;
154 
155  BOOST_CONCEPT_USAGE(CGALFaceListGraph)
156  {
157  p = faces(g);
158  F = num_faces(g);
159  }
160  std::pair< face_iterator, face_iterator > p;
161  faces_size_type F;
162  G g;
163 };
164 
173 BOOST_concept(CGALMutableFaceGraph, (G))
174  : CGALFaceGraph< G >, CGALMutableHalfedgeGraph< G >
175 {
176  typedef typename boost::graph_traits< G >::face_descriptor face_descriptor;
177  typedef typename boost::graph_traits< G >::halfedge_descriptor
178  halfedge_descriptor;
179  BOOST_CONCEPT_USAGE(CGALMutableFaceGraph)
180  {
181  f = add_face(g);
182  remove_face(f, g);
183  set_face(h, f, g);
184  set_halfedge(f, h, g);
185  }
186  face_descriptor f;
187  halfedge_descriptor h;
188  G g;
189 };
190 
198 BOOST_concept(MutableHalfedgeFaceListGraph, (G))
199  : CGALMutableFaceGraph< G >, CGALHalfedgeListGraph< G >,
200  CGALFaceListGraph< G >{};
201 
202 } // namespace FEVV
203 
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
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
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::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::BOOST_concept
BOOST_concept(CGALHalfedgeGraph,(G))
CGAL's HalfedgeGraph concept (expressed with Boost Concept Check Library) (BCCL)
Definition: CGALConceptsCheck.h:29
F
double F(double input)
Definition: rgb_to_lab.h:14
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
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
boost
Definition: Graph_properties_aif.h:48
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::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
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
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
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::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::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::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::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::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
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
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
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::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