11#ifndef CONTRACTION_EDGE_PROFILE_H_
12#define CONTRACTION_EDGE_PROFILE_H_
19namespace contraction {
21template<
typename GeometricSimplifiableComplex>
class Edge_profile {
23 typedef GeometricSimplifiableComplex
Complex;
24 typedef typename Complex::GT GT;
26 typedef typename GeometricSimplifiableComplex::Vertex_handle
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()];
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_;
101template<
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() { }
Class that represents a geometric complex that can be simplified. The class allows access to points o...
Definition: Skeleton_blocker_geometric_complex.h:29
std::ostream & operator<<(std::ostream &os, const Permutahedral_representation< Vertex, OrderedSetPartition > &simplex)
Print a permutahedral representation to a stream.
Definition: Permutahedral_representation.h:173
Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor used in boost ...
Definition: SkeletonBlockerDS.h:47
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15