1 // Copyright (c) 2003-2005  INRIA Sophia-Antipolis (France).
2 // All rights reserved.
3 //
4 // This file is part of CGAL (www.cgal.org).
5 //
6 // $URL: https://github.com/CGAL/cgal/blob/v5.3/Surface_mesher/include/CGAL/Complex_2_in_triangulation_vertex_base_3.h $
7 // $Id: Complex_2_in_triangulation_vertex_base_3.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot
8 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
9 //
10 //
11 // Author(s)     : Steve Oudot, David Rey, Mariette Yvinec, Laurent Rineau, Andreas Fabri
12 
13 
14 
15 
16 #ifndef CGAL_COMPLEX_2_IN_TRIANGULATION_VERTEX_BASE_3_H
17 #define CGAL_COMPLEX_2_IN_TRIANGULATION_VERTEX_BASE_3_H
18 
19 #include <CGAL/license/Surface_mesher.h>
20 
21 
22 
23 #include <CGAL/Triangulation_vertex_base_3.h>
24 
25 namespace CGAL {
26 
27   template < class GT, class Vb = Triangulation_vertex_base_3 <GT> >
28   class Complex_2_in_triangulation_vertex_base_3 : public Vb {
29 
30   public:
31     typedef Complex_2_in_triangulation_vertex_base_3 <GT, Vb> Self;
32 
33     template < class TDS3 >
34     struct Rebind_TDS {
35       typedef typename Vb::template Rebind_TDS<TDS3>::Other  Vb3;
36       typedef Complex_2_in_triangulation_vertex_base_3 <GT, Vb3> Other;
37     };
38 
39     typedef typename Vb::Triangulation_data_structure Tds;
40     typedef typename Tds::Vertex_handle Vertex_handle;
41     typedef typename Tds::Cell_handle Cell_handle;
42     typedef typename Tds::Facet Facet;
43 
44   private:
45     int number_of_incident_facets_;
46     int number_of_components_; // number of components in the adjacency
47                                // graph of incident facets (in complex)
48     bool cache_validity;
49   public:
50     // Constructors
51 
Complex_2_in_triangulation_vertex_base_3()52     Complex_2_in_triangulation_vertex_base_3()
53       : Vb(),
54         number_of_incident_facets_(0),
55         number_of_components_(0),
56         cache_validity(false)
57     {}
58 
is_c2t3_cache_valid()59     bool is_c2t3_cache_valid() const {
60       return cache_validity;
61     }
62 
invalidate_c2t3_cache()63     void invalidate_c2t3_cache()
64     {
65       cache_validity = false;
66     }
67 
set_c2t3_cache(const int i,const int j)68     void set_c2t3_cache(const int i, const int j)
69     {
70       number_of_incident_facets_ = i;
71       number_of_components_ = j;
72       cache_validity = true;
73     }
74 
cached_number_of_incident_facets()75     int cached_number_of_incident_facets() const
76     {
77       return number_of_incident_facets_;
78     }
79 
cached_number_of_components()80     int cached_number_of_components() const
81     {
82       return number_of_components_;
83     }
84 
85 #ifdef CGAL_MESH_3_IO_H
86     static
io_signature()87     std::string io_signature()
88     {
89       return Get_io_signature<Vb>()();
90     }
91 #endif
92 
93   };  // end Complex_2_in_triangulation_vertex_base_3
94 
95 
96 }  // namespace CGAL
97 
98 
99 #endif // CGAL_COMPLEX_2_IN_TRIANGULATION_VERTEX_BASE_3_H
100