MyGAL
Triangulation.h
1 /* MyGAL
2  * Copyright (C) 2019 Pierre Vigier
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published
6  * by the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 // STL
21 #include <vector>
22 
26 namespace mygal
27 {
28 
35 {
36 public:
42  explicit Triangulation(std::vector<std::vector<std::size_t>> neighbors) : mNeighbors(std::move(neighbors))
43  {
44 
45  }
46 
52  std::size_t getNbVertices() const
53  {
54  return mNeighbors.size();
55  }
56 
64  const std::vector<std::size_t>& getNeighbors(std::size_t i) const
65  {
66  return mNeighbors[i];
67  }
68 
69 private:
70  std::vector<std::vector<std::size_t>> mNeighbors;
71 };
72 
73 }
Triangulation(std::vector< std::vector< std::size_t >> neighbors)
Constructor of Triangulation.
Definition: Triangulation.h:42
Namespace of MyGAL.
Definition: Box.h:29
const std::vector< std::size_t > & getNeighbors(std::size_t i) const
Get the neighbors of a vertex.
Definition: Triangulation.h:64
std::size_t getNbVertices() const
Get the number of vertices.
Definition: Triangulation.h:52
Data structure representing a triangulation.
Definition: Triangulation.h:34