11 #ifndef CONTRACTION_EDGE_PROFILE_H_
12 #define CONTRACTION_EDGE_PROFILE_H_
19 namespace contraction {
21 template<
typename GeometricSimplifiableComplex>
class Edge_profile {
23 typedef GeometricSimplifiableComplex Complex;
24 typedef typename Complex::GT GT;
26 typedef typename GeometricSimplifiableComplex::Vertex_handle Vertex_handle;
27 typedef typename GeometricSimplifiableComplex::Root_vertex_handle Root_vertex_handle;
30 typedef typename GeometricSimplifiableComplex::Edge_handle Edge_handle;
31 typedef typename GeometricSimplifiableComplex::Graph_vertex Graph_vertex;
32 typedef typename GeometricSimplifiableComplex::Graph_edge Graph_edge;
33 typedef typename GeometricSimplifiableComplex::Point Point;
35 Edge_profile(GeometricSimplifiableComplex& complex, Edge_handle edge) : complex_(complex), edge_handle_(edge),
36 v0_(complex_.first_vertex(edge_handle_)), v1_(complex_.second_vertex(edge_handle_)) {
37 assert(complex_.get_address(complex_[edge_handle_].first()));
38 assert(complex_.get_address(complex_[edge_handle_].second()));
39 assert(complex_.contains_edge(v0_handle(), v1_handle()));
40 assert(v0_handle() != v1_handle());
43 virtual ~Edge_profile() { }
45 GeometricSimplifiableComplex& complex()
const {
49 Edge_handle edge_handle()
const {
53 Graph_edge& edge()
const {
54 return complex_[edge_handle_];
57 Graph_vertex& v0()
const {
58 return complex_[v0_handle()];
61 Graph_vertex& v1()
const {
62 return complex_[v1_handle()];
65 Vertex_handle v0_handle()
const {
72 Vertex_handle v1_handle()
const {
79 const Point& p0()
const {
80 return complex_.point(v0_handle());
83 const Point& p1()
const {
84 return complex_.point(v1_handle());
87 friend std::ostream& operator<<(std::ostream& o,
const Edge_profile& v) {
88 return o <<
"v0:" << v.v0_handle() <<
" v1:" << v.v1_handle();
92 GeometricSimplifiableComplex& complex_;
94 Edge_handle edge_handle_;
101 template<
typename EdgeProfile>
class Edge_profile_factory {
103 typedef typename EdgeProfile::Edge_handle Edge_handle_;
104 typedef typename EdgeProfile::Complex Complex_;
106 virtual EdgeProfile make_profile(
108 Edge_handle_ edge)
const {
109 return EdgeProfile(complex, edge);
112 virtual ~Edge_profile_factory() { }
119 #endif // CONTRACTION_EDGE_PROFILE_H_