52 const ::cluster::ClusterParamsAlg& cluster2)
55 if ((cluster1.GetHitVector().size() <
_min_hits) ||
56 (cluster2.GetHitVector().size() <
_min_hits))
59 if ((cluster1.GetHitVector().size() >
_max_hits) ||
60 (cluster2.GetHitVector().size() >
_max_hits))
64 if ((cluster1.GetParams().PolyObject.Size() < 2) or
65 (cluster2.GetParams().PolyObject.Size() < 2)) {
74 unsigned int npoints1 = cluster1.GetParams().PolyObject.Size();
75 unsigned int npoints2 = cluster2.GetParams().PolyObject.Size();
77 for (
unsigned int i = 0; i < npoints1; ++i) {
78 float pt1w = cluster1.GetParams().PolyObject.Point(i).first;
79 float pt1t = cluster1.GetParams().PolyObject.Point(i).second;
81 for (
unsigned int j = 0; j < npoints2; ++j) {
82 float pt2w = cluster2.GetParams().PolyObject.Point(j).first;
83 float pt2t = cluster2.GetParams().PolyObject.Point(j).second;
84 double distsqrd = pow(pt2w - pt1w, 2) + pow(pt2t - pt1t, 2);
89 std::cout <<
"two polygon points dist2 is " << distsqrd << std::endl;
90 std::cout <<
"minimum dist was " <<
tmp_min_dist << std::endl;
Class def header for a class CBAlgoPolyShortestDist.