FACT++  1.0
void MCaos::CalcCenters ( const std::vector< Led > &  leds,
float  min,
float  max 
)
private

Definition at line 42 of file MCaos.cc.

References Ring::CalcCenter(), Ring::GetR(), and i.

43 {
44  fRings.clear();
45 
46  const int nPoints = leds.size();
47 
48  // A minimum of at least 3 points is mandatory!
49  if (nPoints<fMinNumberLeds || nPoints<3)
50  return;
51 
52 // ofstream fout("rings.txt", ios::app);
53 
54  for (int i=0; i<nPoints-2; i++)
55  for (int j=i+1; j<nPoints-1; j++)
56  for (int k=j+1; k<nPoints; k++)
57  {
58  Ring ring;
59  if (!ring.CalcCenter(leds[i], leds[j], leds[k]))
60  continue;
61 
62 // fout << i+j*10+k*100 << " " << ring.GetR() << " " << ring.GetX() << " " << ring.GetY() << endl;
63 
64  //
65  //filter and remove rings with too big or too small radius
66  //
67  if ((min>=0&&ring.GetR()<min) || (max>=0&&ring.GetR()>max))
68  continue;
69 
70  fRings.push_back(ring);
71  }
72 }
int i
Definition: db_dim_client.c:21
Definition: Ring.h:10
std::vector< Ring > fRings
Definition: MCaos.h:23
double GetR() const
Definition: Ring.h:30
bool CalcCenter(Led, Led, Led)
Definition: Ring.cc:16
int16_t fMinNumberLeds
Definition: MCaos.h:14

+ Here is the call graph for this function: