File: triangulation_data_structure_dynamic.cpp

package info (click to toggle)
cgal 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,912 kB
  • sloc: cpp: 810,858; ansic: 208,477; sh: 493; python: 411; makefile: 286; javascript: 174
file content (27 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <CGAL/Triangulation_data_structure.h>
#include <cassert>

#include <vector>

int main()
{
  const int ddim = 5; // dimension of TDS with dynamic dimension
  typedef CGAL::Triangulation_data_structure<CGAL::Dynamic_dimension_tag>
          TDS;
  typedef TDS::Vertex_handle    Vertex_handle;
  TDS D(ddim); // the argument is taken into account.

  assert( ddim == D.maximal_dimension() );
  assert( -2 == D.current_dimension() );
  assert( D.is_valid() );
  std::vector<Vertex_handle> V(5);
  V[0] = D.insert_increase_dimension();
  V[1] = D.insert_increase_dimension(V[0]);
  V[2] = D.insert_increase_dimension(V[0]);
  V[3] = D.insert_increase_dimension(V[0]);
  V[4] = D.insert_in_full_cell(V[3]->full_cell());
  assert( 6 == D.number_of_full_cells() );
  assert( 2 == D.current_dimension() );
  assert( D.is_valid() );
  return 0;
}