23 #ifndef CONTRACTION_EDGE_PROFILE_H_
24 #define CONTRACTION_EDGE_PROFILE_H_
30 namespace contraction {
32 template<
typename GeometricSimplifiableComplex>
class Edge_profile {
34 typedef GeometricSimplifiableComplex
Complex;
35 typedef typename Complex::GT GT;
37 typedef typename GeometricSimplifiableComplex::Vertex_handle Vertex_handle;
41 typedef typename GeometricSimplifiableComplex::Edge_handle Edge_handle;
42 typedef typename GeometricSimplifiableComplex::Graph_vertex Graph_vertex;
43 typedef typename GeometricSimplifiableComplex::Graph_edge Graph_edge;
44 typedef typename GeometricSimplifiableComplex::Point Point;
46 Edge_profile(GeometricSimplifiableComplex& complex, Edge_handle edge) : complex_(complex), edge_handle_(edge),
47 v0_(complex_.first_vertex(edge_handle_)), v1_(complex_.second_vertex(edge_handle_)) {
48 assert(complex_.get_address(complex_[edge_handle_].first()));
49 assert(complex_.get_address(complex_[edge_handle_].second()));
50 assert(complex_.contains_edge(v0_handle(), v1_handle()));
51 assert(v0_handle() != v1_handle());
54 virtual ~Edge_profile() { }
56 GeometricSimplifiableComplex& complex()
const {
60 Edge_handle edge_handle()
const {
64 Graph_edge& edge()
const {
65 return complex_[edge_handle_];
68 Graph_vertex& v0()
const {
69 return complex_[v0_handle()];
72 Graph_vertex& v1()
const {
73 return complex_[v1_handle()];
76 Vertex_handle v0_handle()
const {
83 Vertex_handle v1_handle()
const {
90 const Point& p0()
const {
91 return complex_.point(v0_handle());
94 const Point& p1()
const {
95 return complex_.point(v1_handle());
98 friend std::ostream& operator<<(std::ostream& o,
const Edge_profile& v) {
99 return o <<
"v0:" << v.v0_handle() <<
" v1:" << v.v1_handle();
103 GeometricSimplifiableComplex& complex_;
105 Edge_handle edge_handle_;
112 template<
typename EdgeProfile>
class Edge_profile_factory {
114 typedef typename EdgeProfile::Edge_handle Edge_handle_;
115 typedef typename EdgeProfile::Complex Complex_;
117 virtual EdgeProfile make_profile(
119 Edge_handle_ edge)
const {
120 return EdgeProfile(complex, edge);
123 virtual ~Edge_profile_factory() { }
130 #endif // CONTRACTION_EDGE_PROFILE_H_
Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor used in boost ...
Definition: SkeletonBlockerDS.h:50