CBAlgoPolyContain.cxx
Go to the documentation of this file.
1 #include "CBAlgoPolyContain.h"
2 
3 namespace cmtool {
4 
6  {
7  // Nothing to be done in the base class
8  this->reconfigure();
9  }
10 
11 
13 
14  //not sure what needs to be reset/reconfigured for this algo
15 
16  }//end reconfigure function
17 
18 
19  bool CBAlgoPolyContain::Bool(const ::cluster::ClusterParamsAlg &cluster1,
20  const ::cluster::ClusterParamsAlg &cluster2)
21  {
22 
23  if ( (cluster1.GetParams().PolyObject.Size() < 3) or (cluster2.GetParams().PolyObject.Size() < 3) )
24  return false;
25 
26  //if either polygon is fully contained in other
27  //then return true! --> MERGE!
28  if ( (cluster1.GetParams().PolyObject.Contained(cluster2.GetParams().PolyObject)) or
29  (cluster2.GetParams().PolyObject.Contained(cluster1.GetParams().PolyObject)) )
30  return true;
31  else
32  return false;
33  }
34 
35 
36 }
void reconfigure()
Method to re-configure the instance.
virtual bool Bool(const ::cluster::ClusterParamsAlg &cluster1, const ::cluster::ClusterParamsAlg &cluster2)
CBAlgoPolyContain()
Default constructor.
Class def header for a class CBAlgoPolyContain.