27 #include "neuroninterfaces.h"
30 #include "wheeledexperimenthelper.h"
31 #include "baseexception.h"
53 static void describe( QString type );
77 namespace __LinearCamera_internal {
141 const QColor& colorForReceptor(
int i)
const
143 return m_receptors[i];
151 double getAperture()
const
161 unsigned int getNumReceptors()
const
163 return m_numReceptors;
172 QColor getBackgroundColor()
const
174 return m_backgroundColor;
183 void setBackgroundColor(QColor color)
185 m_backgroundColor = color;
193 void drawCamera(
bool d);
203 virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
208 QVector<QColor> m_receptors;
223 const wMatrix m_transformation;
228 const double m_aperture;
233 const unsigned int m_numReceptors;
240 QColor m_backgroundColor;
247 const double m_apertureMin;
254 const double m_apertureMax;
261 const double m_receptorRange;
301 strncpy(m_filename, filename, 256);
302 m_filename[255] =
'\0';
303 strncpy(m_description, description, 256);
304 m_description[255] =
'\0';
305 sprintf(m_errorMessage,
"Error when loading the file with IR samples \"%s\". Description: %s", m_filename, m_description);
306 m_errorMessage[1023] =
'\0';
317 strncpy(m_filename, other.m_filename, 256);
318 m_filename[255] =
'\0';
319 strncpy(m_description, other.m_description, 256);
320 m_description[255] =
'\0';
321 strncpy(m_errorMessage, other.m_errorMessage, 1024);
322 m_errorMessage[1023] =
'\0';
332 if (&other ==
this) {
336 BaseException::operator=(other);
337 strncpy(m_filename, other.m_filename, 256);
338 m_filename[255] =
'\0';
339 strncpy(m_description, other.m_description, 256);
340 m_description[255] =
'\0';
341 strncpy(m_errorMessage, other.m_errorMessage, 1024);
342 m_errorMessage[1023] =
'\0';
359 virtual const char *what()
const throw()
361 return m_errorMessage;
369 const char *filename()
const throw()
379 const char *description()
const throw()
381 return m_description;
394 char m_filename[256];
399 char m_description[256];
404 char m_errorMessage[1024];
445 SampledIRDataLoader(QString filename);
450 ~SampledIRDataLoader();
457 const QString& filename()
const
467 unsigned int numIR()
const
477 unsigned int numSamplingAngles()
const
479 return m_numSamplingAngles;
487 unsigned int numDistances()
const
489 return m_numDistances;
497 real initialDistance()
const
499 return m_initialDistance;
507 real distanceInterval()
const
509 return m_distanceInterval;
517 real finalDistance()
const
519 return m_finalDistance;
532 unsigned int getActivation(
unsigned int i, real dist, real ang)
const;
546 QVector<unsigned int>::const_iterator getActivation(real dist, real ang)
const;
557 unsigned int getLinearIndex(
unsigned int id,
unsigned int ang,
unsigned int dist)
const;
568 void getIndexes(
unsigned int i,
unsigned int &
id,
unsigned int &ang,
unsigned int &dist)
const;
573 const QString m_filename;
578 unsigned int m_numIR;
583 unsigned int m_numSamplingAngles;
588 unsigned int m_numDistances;
593 real m_initialDistance;
598 real m_distanceInterval;
603 real m_finalDistance;
611 QVector<unsigned int> m_activations;
619 QVector<unsigned int> m_nullActivations;