Elaboradar  0.1
 Tutto Classi Namespace File Funzioni Variabili Tipi enumerati (enum) Gruppi
template<typename T>
PolarScan<T>& radarelab::volume::Scans< T >::make_scan ( unsigned  idx,
unsigned  beam_count,
unsigned  beam_size,
double  elevation,
double  cell_size 
)
inline

Create or reuse a scan at position idx, with the given beam size.

Parametri
[in]idx- index of the PolarScan
[in]beam_count
[in]beam_size
[in]elevation
[in]cell_size
Restituisce
the idx PolarScan

Definizione alla linea 355 del file volume.h.

Referenziato da radarelab::Volume< unsigned char >::make_scan().

356  {
357  if (idx < this->size())
358  {
359  if (beam_count != (*this)[idx].beam_count)
360  {
361  LOG_CATEGORY("radar.io");
362  LOG_ERROR("make_scan(idx=%u, beam_count=%u, beam_size=%u) called, but the scan already existed with beam_count=%u", idx, beam_count, beam_size, (*this)[idx].beam_count);
363  throw std::runtime_error("beam_size mismatch");
364  }
365  if (beam_size != (*this)[idx].beam_size)
366  {
367  LOG_CATEGORY("radar.io");
368  LOG_ERROR("make_scan(idx=%u, beam_count=%u, beam_size=%u) called, but the scan already existed with beam_size=%u", idx, beam_count, beam_size, (*this)[idx].beam_size);
369  throw std::runtime_error("beam_size mismatch");
370  }
371  } else {
372  // If some elevation has been skipped, fill in the gap
373  if (idx > this->size())
374  {
375  if (this->empty())
376  this->push_back(PolarScan<T>(beam_count, beam_size));
377  while (this->size() < idx)
378  this->push_back(PolarScan<T>(beam_count, this->back().beam_size));
379  }
380 
381  // Add the new polar scan
382  this->push_back(PolarScan<T>(beam_count, beam_size));
383  this->back().elevation = elevation;
384  this->back().cell_size = cell_size;
385  }
386 
387  // Return it
388  return (*this)[idx];
389  }