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 342 del file volume.h.

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

343  {
344  if (idx < this->size())
345  {
346  if (beam_count != (*this)[idx].beam_count)
347  {
348  LOG_CATEGORY("radar.io");
349  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);
350  throw std::runtime_error("beam_size mismatch");
351  }
352  if (beam_size != (*this)[idx].beam_size)
353  {
354  LOG_CATEGORY("radar.io");
355  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);
356  throw std::runtime_error("beam_size mismatch");
357  }
358  } else {
359  // If some elevation has been skipped, fill in the gap
360  if (idx > this->size())
361  {
362  if (this->empty())
363  this->push_back(PolarScan<T>(beam_count, beam_size));
364  while (this->size() < idx)
365  this->push_back(PolarScan<T>(beam_count, this->back().beam_size));
366  }
367 
368  // Add the new polar scan
369  this->push_back(PolarScan<T>(beam_count, beam_size));
370  this->back().elevation = elevation;
371  this->back().cell_size = cell_size;
372  }
373 
374  // Return it
375  return (*this)[idx];
376  }