Пример #1
0
void
rangeSweep::compSeeds(void)
{
   RangeSweepRec rsr, item;
   Range fullrange, added, outgoing;
   float min, max;
   //double p;

   printf("------- computing seeds\n");

   // clear the array of mark bits
   plot.ClearTouched();
   seeds.Clear();

   // insert cell 0 into queue to begin
   rsr.cellid = 0;
   data.getCellRange(0, min, max);
   rsr.range.Set(min, max);
//   queue.insert(rsr, max-min);
   queue.insert(rsr, max-min, rsr.cellid);

   // process queue of cells
   while (! queue.isEmpty() ) {
      // get the item
      //p = queue.max(item);
      queue.max(item);

      // cell is a seed cell
      seeds.AddSeed(item.cellid, item.range.MinAll(), item.range.MaxAll());

#ifdef DEBUG
printf("*\n*\n*\ncell %d is a seed\n*\n*\n*\n", item.cellid);
#endif
#ifdef DEBUGSLEEP
sleep(3);
#endif

      // mark this cell as processed
//      plot.TouchCell(item.cellid);

      PropagateRegion(item.cellid, item.range.MinAll(), item.range.MaxAll());
   }

   printf("computed %d seeds\n", seeds.getNCells());
}
Пример #2
0
void rangeSweep::compSeeds(void)
{
	RangeSweepRec rsr, item;
	Range fullrange, added, outgoing;
	float min, max;
	// clear the array of mark bits
	plot.ClearTouched();
	seeds.Clear();
	// insert cell 0 into queue to begin
	rsr.cellid = 0;
	data.getCellRange(0, min, max);
	rsr.range.Set(min, max);
	queue.insert(rsr, max-min, rsr.cellid);
	// process queue of cells
	while(! queue.isEmpty())
	{
		// get the item
		queue.ipqmax(item);
		// cell is a seed cell
		seeds.AddSeed(item.cellid, item.range.MinAll(), item.range.MaxAll());
		// mark this cell as processed
		PropagateRegion(item.cellid, item.range.MinAll(), item.range.MaxAll());
	}
}