27 #include "neuroninterfaces.h"
30 #include "wheeledexperimenthelper.h"
31 #include "baseexception.h"
32 #include "helperresources.h"
33 #include "intervals.h"
93 static void describe(QString type);
98 virtual void update();
171 static void describe( QString type );
195 namespace LinearCameraOld {
196 namespace __LinearCamera_internal {
197 class LinearCameraGraphic;
247 LinearCamera(
WObject* obj,
wMatrix mtr,
double aperture,
unsigned int numReceptors,
double maxDistance, QColor backgroundColor);
265 const QColor& colorForReceptor(
int i)
const
267 return m_receptors[i];
275 double getAperture()
const
285 unsigned int getNumReceptors()
const
287 return m_numReceptors;
296 QColor getBackgroundColor()
const
298 return m_backgroundColor;
307 void setBackgroundColor(QColor color)
309 m_backgroundColor = color;
317 void drawCamera(
bool d);
325 void ignoreWalls(
bool ignore)
327 m_ignoreWalls = ignore;
336 bool wallsIgnored()
const
338 return m_ignoreWalls;
349 virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
354 QVector<QColor> m_receptors;
369 const wMatrix m_transformation;
374 const double m_aperture;
379 const unsigned int m_numReceptors;
384 const double m_maxDistance;
391 QColor m_backgroundColor;
398 const double m_apertureMin;
405 const double m_apertureMax;
412 const double m_receptorRange;
441 namespace LinearCameraNew {
442 namespace __LinearCamera_internal {
443 class LinearCameraGraphic;
501 LinearCamera(
WObject* obj,
wMatrix mtr,
double aperture,
unsigned int numReceptors,
double maxDistance, QColor backgroundColor);
538 const QColor& colorForReceptor(
int i)
const
540 return m_receptors[i];
548 unsigned int getNumReceptors()
const
550 return m_receptors.size();
559 QColor getBackgroundColor()
const
561 return m_backgroundColor;
570 void setBackgroundColor(QColor color)
572 m_backgroundColor = color;
580 void drawCamera(
bool d);
588 void ignoreWalls(
bool ignore)
590 m_ignoreWalls = ignore;
599 bool wallsIgnored()
const
601 return m_ignoreWalls;
612 virtual void resourceChanged(QString resourceName, ResourceChangeType changeType);
617 QVector<QColor> m_receptors;
632 const wMatrix m_transformation;
637 const QVector<SimpleInterval> m_receptorsRanges;
642 const double m_maxDistance;
649 QColor m_backgroundColor;
680 typedef LinearCameraOld::LinearCamera LinearCamera;
703 strncpy(m_filename, filename, 256);
704 m_filename[255] =
'\0';
705 strncpy(m_description, description, 256);
706 m_description[255] =
'\0';
707 sprintf(m_errorMessage,
"Error when loading the file with IR samples \"%s\". Description: %s", m_filename, m_description);
708 m_errorMessage[1023] =
'\0';
719 strncpy(m_filename, other.m_filename, 256);
720 m_filename[255] =
'\0';
721 strncpy(m_description, other.m_description, 256);
722 m_description[255] =
'\0';
723 strncpy(m_errorMessage, other.m_errorMessage, 1024);
724 m_errorMessage[1023] =
'\0';
734 if (&other ==
this) {
738 BaseException::operator=(other);
739 strncpy(m_filename, other.m_filename, 256);
740 m_filename[255] =
'\0';
741 strncpy(m_description, other.m_description, 256);
742 m_description[255] =
'\0';
743 strncpy(m_errorMessage, other.m_errorMessage, 1024);
744 m_errorMessage[1023] =
'\0';
761 virtual const char *what()
const throw()
763 return m_errorMessage;
771 const char *filename()
const throw()
781 const char *description()
const throw()
783 return m_description;
796 char m_filename[256];
801 char m_description[256];
806 char m_errorMessage[1024];
851 SampledIRDataLoader(QString filename);
856 ~SampledIRDataLoader();
863 const QString& filename()
const
873 unsigned int numIR()
const
883 unsigned int numSamplingAngles()
const
885 return m_numSamplingAngles;
893 unsigned int numDistances()
const
895 return m_numDistances;
905 return m_initialDistance;
915 return m_distanceInterval;
925 return m_finalDistance;
938 unsigned int getActivation(
unsigned int i,
real dist,
real ang)
const;
952 QVector<unsigned int>::const_iterator getActivation(
real dist,
real ang)
const;
963 unsigned int getLinearIndex(
unsigned int id,
unsigned int ang,
unsigned int dist)
const;
968 const QString m_filename;
973 unsigned int m_numIR;
978 unsigned int m_numSamplingAngles;
983 unsigned int m_numDistances;
988 real m_initialDistance;
993 real m_distanceInterval;
998 real m_finalDistance;
1006 QVector<unsigned int> m_activations;
1014 QVector<unsigned int> m_nullActivations;
1028 QColor getColorAtArenaGroundPosition(Arena* arena, wVector pos);