MEPP2 Project
test_complying_concepts_aif.cpp
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.
13 #include "FEVV/Wrappings/Graph_properties_aif.h" // to validate the propertygraph concept
14 
15 #include <boost/graph/graph_concepts.hpp>
17 
19 // Technical type alias in order for the tests for the different data
20 // structures to share some code (preparing generic test for the day
21 // when all data structure are fully compliant).
22 typedef Mesh G;
23 
24 int
25 main(void)
26 {
27  using namespace boost;
28 
30  // Graph already asserted
31 
32  // Assertions are sometimes redundant (IncidenceGraph concept assertion
33  // already internally assert the Graph concept). We nevertheless do such
34  // redudant checks along the concept "inheritance" hieararchy in order
35  // for the test to provide the simplest feedback when failing (fail early).
36 
37  // boost Graph concepts
38  BOOST_CONCEPT_ASSERT((GraphConcept< G >));
39  BOOST_CONCEPT_ASSERT((IncidenceGraphConcept< G >));
40  BOOST_CONCEPT_ASSERT((BidirectionalGraphConcept< G >));
41 
42  BOOST_CONCEPT_ASSERT((VertexListGraphConcept< G >));
43  BOOST_CONCEPT_ASSERT((EdgeListGraphConcept< G >));
44  BOOST_CONCEPT_ASSERT((VertexAndEdgeListGraphConcept< G >));
45 #ifdef USE_ADD_EDGE_AIF
46  BOOST_CONCEPT_ASSERT((EdgeMutableGraphConcept< G >));
47 #endif
48  BOOST_CONCEPT_ASSERT((VertexMutableGraphConcept< G >));
49 #ifdef USE_ADD_EDGE_AIF
50  BOOST_CONCEPT_ASSERT((MutableGraphConcept< G >));
51 #endif
52  BOOST_CONCEPT_ASSERT(
53  (PropertyGraphConcept< G,
55  boost::vertex_point_t >));
56 
57  // CGAL concepts
58  BOOST_CONCEPT_ASSERT((FEVV::CGALHalfedgeGraph< G >));
59  BOOST_CONCEPT_ASSERT((FEVV::CGALMutableHalfedgeGraph< G >));
60  BOOST_CONCEPT_ASSERT((FEVV::CGALFaceGraph< G >));
61  BOOST_CONCEPT_ASSERT((FEVV::CGALFaceListGraph< G >));
62  BOOST_CONCEPT_ASSERT((FEVV::CGALMutableFaceGraph< G >));
64  // BOOST_CONCEPT_ASSERT((FEVV::CGALHalfedgeListGraph< Mesh >));
65  // This concept is not compatible with the design of AIF datastructure.
66  // It thus should not be asserted.
67 
69  // BOOST_CONCEPT_ASSERT((FEVV::MutableHalfedgeFaceListGraph< Mesh >));
70  // This concept is not compatible with the design of AIF datastructure.
71  // It thus should not be asserted.
72 
75  // The following are not mandatory within the FEVV layer. It is just to
76  // to document some technical perks or failures of AIF.
77 
78  // boost Graph concepts
79  BOOST_CONCEPT_ASSERT((AdjacencyGraphConcept< G >));
80 
83  BOOST_CONCEPT_ASSERT((ReadablePropertyGraphConcept<
84  G,
86  boost::vertex_index_t >));
87 
89  BOOST_CONCEPT_ASSERT((
90  LvaluePropertyGraphConcept< G,
92  boost::vertex_point_t >));
93 
94  // The following cannot work (is expected to fail) since boost::vertex_index_t
95  // should not be modifiable (as opposed to vertex positions FAIL
96  // BOOST_CONCEPT_ASSERT(
97  // (WritablePropertyMapConcept<
98  // typename property_map< G, boost::vertex_index_t >::type,
99  // typename graph_traits< G>::vertex_descriptor>));
100 
101 
102 #ifndef WIN32
103  // BOOST_CONCEPT_ASSERT(
104  // (PropertyGraphConcept< G,
105  // graph_traits< G >::halfedge_descriptor,
106  // halfedge_index_t >)
107  // );
108 #endif
109 
110  BOOST_CONCEPT_ASSERT((VertexIndexGraphConcept< G >));
111  // FAIL BOOST_CONCEPT_ASSERT((EdgeIndexGraphConcept< G>)); // usefull for AIF:
112  // yes concept implemented in a future release
113 #ifdef USE_ADD_EDGE_AIF
114  BOOST_CONCEPT_ASSERT((MutableIncidenceGraphConcept< G >));
115  BOOST_CONCEPT_ASSERT((MutableBidirectionalGraphConcept< G >));
116  BOOST_CONCEPT_ASSERT((MutableEdgeListGraphConcept< G >));
117 #endif
118  BOOST_CONCEPT_ASSERT((VertexMutablePropertyGraphConcept< G >));
119 #ifdef USE_ADD_EDGE_AIF
120  // FAIL BOOST_CONCEPT_ASSERT((EdgeMutablePropertyGraphConcept< G>)); // do not
121 #endif
122  // attach any property to edge for the time being
123  BOOST_CONCEPT_ASSERT((AdjacencyMatrixConcept< G >));
124 
125  return 0;
126 }
G
Mesh G
Definition: test_complying_concepts_aif.cpp:22
CGALConceptsCheck.h
boost
Definition: Graph_properties_aif.h:48
Graph_properties_aif.h
AIFMesh.hpp
GraphConcept
Definition: test_boost_graph_concept_aif.cpp:20
Graph_traits_aif.h
Mesh
FEVV::DataStructures::AIF::AIFMesh Mesh
Definition: test_complying_concepts_aif.cpp:18
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
main
int main(void)
Definition: test_complying_concepts_aif.cpp:25