Go to the documentation of this file.
13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
25 template <
typename Graph,
37 typedef typename GeometryTraits::Scalar
Scalar;
43 const GeometryTraits
_gt;
48 Edge_comparator(
const Graph& g,
const PointMap& pm,
const EdgeWeightMap& ew,
const GeometryTraits& gt) :
_g(g),
_pm(pm),
_ew(ew),
_gt(gt) {}
55 if(e1==GraphTraits::null_edge())
60 if(e2==GraphTraits::null_edge())
65 if (
_ew.storage_begin()!=
_ew.storage_end())
71 else if (val_e1 > val_e2)
80 Point minie1(0,0,0), maxie1(0,0,0), minie2(0,0,0), maxie2(0,0,0);
81 bool minie1_is_pe1_pv1 =
false,
82 minie2_is_pe2_pv1 =
false;
83 if(
_gt.get_x(pe1_pv1) <
_gt.get_x(pe1_pv2) )
85 minie1 = pe1_pv1; minie1_is_pe1_pv1 =
true;
88 else if(
_gt.get_x(pe1_pv1) >
_gt.get_x(pe1_pv2) )
93 else if(
_gt.get_y(pe1_pv1) <
_gt.get_y(pe1_pv2) )
95 minie1 = pe1_pv1; minie1_is_pe1_pv1 =
true;
98 else if(
_gt.get_y(pe1_pv1) >
_gt.get_y(pe1_pv2) )
103 else if(
_gt.get_z(pe1_pv1) <
_gt.get_z(pe1_pv2) )
105 minie1 = pe1_pv1; minie1_is_pe1_pv1 =
true;
108 else if(
_gt.get_z(pe1_pv1) >
_gt.get_z(pe1_pv2) )
113 else minie1 = maxie1 = pe1_pv1;
115 if(
_gt.get_x(pe2_pv1) <
_gt.get_x(pe2_pv2) )
117 minie2 = pe2_pv1; minie2_is_pe2_pv1 =
true;
120 else if(
_gt.get_x(pe2_pv1) >
_gt.get_x(pe2_pv2) )
125 else if(
_gt.get_y(pe2_pv1) <
_gt.get_y(pe2_pv2) )
127 minie2 = pe2_pv1; minie2_is_pe2_pv1 =
true;
130 else if(
_gt.get_y(pe2_pv1) >
_gt.get_y(pe2_pv2) )
135 else if(
_gt.get_z(pe2_pv1) <
_gt.get_z(pe2_pv2) )
137 minie2 = pe2_pv1; minie2_is_pe2_pv1 =
true;
140 else if(
_gt.get_z(pe2_pv1) >
_gt.get_z(pe2_pv2) )
145 else minie2 = maxie2 = pe2_pv1;
148 return _gt.get_x(minie1) <
_gt.get_x(minie2);
150 return _gt.get_y(minie1) <
_gt.get_y(minie2);
152 return _gt.get_z(minie1) <
_gt.get_z(minie2);
154 return _gt.get_x(maxie1) <
_gt.get_x(maxie2);
156 return _gt.get_y(maxie1) <
_gt.get_y(maxie2);
158 return _gt.get_z(maxie1) <
_gt.get_z(maxie2);
166 auto e1_v1_deg = std::distance(e1_v1.first, e1_v1.second),
167 e1_v2_deg = std::distance(e1_v2.first, e1_v2.second),
168 e2_v1_deg = std::distance(e2_v1.first, e2_v1.second),
169 e2_v2_deg = std::distance(e2_v2.first, e2_v2.second);
170 if( minie1_is_pe1_pv1 )
172 if( minie2_is_pe2_pv1 )
174 if( e1_v1_deg!= e2_v1_deg)
175 return e1_v1_deg < e2_v1_deg;
179 if( e1_v1_deg!= e2_v2_deg)
180 return e1_v1_deg < e2_v2_deg;
185 if( minie2_is_pe2_pv1 )
187 if( e1_v2_deg!= e2_v1_deg)
188 return e1_v2_deg < e2_v1_deg;
192 if( e1_v2_deg!= e2_v2_deg)
193 return e1_v2_deg < e2_v2_deg;
197 if( !minie1_is_pe1_pv1 )
199 if( !minie2_is_pe2_pv1 )
201 if( e1_v1_deg!= e2_v1_deg)
202 return e1_v1_deg < e2_v1_deg;
206 if( e1_v1_deg!= e2_v2_deg)
207 return e1_v1_deg < e2_v2_deg;
212 if( !minie2_is_pe2_pv1 )
214 if( e1_v2_deg!= e2_v1_deg)
215 return e1_v2_deg < e2_v1_deg;
219 if( e1_v2_deg!= e2_v2_deg)
220 return e1_v2_deg < e2_v2_deg;
229 template <
typename Graph,
236 Edge_comparator<Graph, PointMap, EdgeWeightMap, GeometryTraits>
Edge_comparator(const Graph &g, const PointMap &pm, const GeometryTraits >)
Edge_comparator(const Graph &g, const PointMap &pm, const EdgeWeightMap &ew)
GeometryTraits::Point Point
Edge_comparator(const Edge_comparator &other)
Edge_comparator(const Graph &g, const PointMap &pm)
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
static Edge_comparator< Graph, PointMap, EdgeWeightMap, GeometryTraits > get_edge_comparator(const Graph &g, const PointMap &pm)
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor source(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the source vertex of e.
GeometryTraits::Scalar Scalar
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
GraphTraits::edge_descriptor edge_descriptor
Interfaces for plugins These interfaces will be used for different plugins.
Edge_comparator(const Graph &g, const PointMap &pm, const EdgeWeightMap &ew, const GeometryTraits >)
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor target(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the target vertex of e.
boost::graph_traits< Graph > GraphTraits
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::in_edge_iterator > in_edges(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
double fabs(const v_Curv< HalfedgeGraph > &input)
bool operator()(edge_descriptor e1, edge_descriptor e2)
GraphTraits::vertex_descriptor vertex_descriptor