SimulationViewerStd.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef SIMULATIONVIEWERSTD_H_DEFINED
00039 #define SIMULATIONVIEWERSTD_H_DEFINED
00040
00041 #include "Component/ModelParam.H"
00042 #include "Image/ImageSet.H"
00043 #include "Image/LevelSpec.H"
00044 #include "Image/NamedImage.H"
00045 #include "Image/Pixels.H"
00046 #include "Image/SimpleFont.H"
00047 #include "Neuro/SimulationViewer.H"
00048 #include "Simulation/SimEvents.H"
00049 #include "rutz/shared_ptr.h"
00050
00051 class SpatialMetrics;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class SimulationViewerStd : public SimulationViewerAdapter {
00064 public:
00065
00066
00067
00068
00069
00070
00071
00072
00073 SimulationViewerStd(OptionManager& mgr,
00074 const std::string& descrName = "Simulation Viewer Std",
00075 const std::string& tagName = "SimulationViewerStd");
00076
00077 virtual ~SimulationViewerStd();
00078
00079
00080
00081 protected:
00082
00083 SIMCALLBACK_DECLARE(SimulationViewerStd, SimEventSaccadeStatusEye);
00084
00085
00086 SIMCALLBACK_DECLARE(SimulationViewerStd, SimEventSaccadeStatusHead);
00087
00088
00089 SIMCALLBACK_DECLARE(SimulationViewerStd, SimEventSaveOutput);
00090
00091
00092 SIMCALLBACK_DECLARE(SimulationViewerStd, SimEventITOutput);
00093
00094
00095 OModelParam<SimTime> itsTimeStep;
00096
00097
00098 OModelParam<LevelSpec> itsLevelSpec;
00099
00100
00101 nub::ref<SpatialMetrics> itsMetrics;
00102
00103
00104 OModelParam<uint> itsFontSize;
00105 OModelParam<bool> itsSaveTraj;
00106 OModelParam<bool> itsSaveXcombo;
00107 OModelParam<bool> itsSaveYcombo;
00108 OModelParam<bool> itsSaveTRMXcombo;
00109 OModelParam<bool> itsSaveTRMYcombo;
00110 OModelParam<bool> itsSaveTRMmegaCombo;
00111 OModelParam<bool> itsWarp3D;
00112 OModelParam<bool> itsMegaCombo;
00113 OModelParam<uint> itsMegaComboZoom;
00114 OModelParam<bool> itsMegaComboTopCMapsOnly;
00115 OModelParam<Dims> itsCropFOA;
00116 OModelParam<bool> itsFoveateTraj;
00117
00118
00119 OModelParam<bool> itsDisplayFOA;
00120 OModelParam<bool> itsDisplayPatch;
00121 OModelParam<bool> itsDisplayFOAnum;
00122 OModelParam<bool> itsDisplayFOALinks;
00123 OModelParam<bool> itsDisplayEye;
00124 OModelParam<bool> itsDisplayEyeLinks;
00125 OModelParam<bool> itsDisplayHead;
00126 OModelParam<bool> itsDisplayHeadLinks;
00127 OModelParam<bool> itsDisplayTime;
00128 OModelParam<bool> itsDisplayAdditive;
00129 OModelParam<bool> itsDisplayHighlights;
00130 OModelParam<bool> itsDisplaySMmodulate;
00131 OModelParam<bool> itsDisplayBoring;
00132 NModelParam<bool> itsDisplayShapeEstimator;
00133
00134
00135 NModelParam< PixRGB<byte> > itsColorNormal;
00136 NModelParam< PixRGB<byte> > itsColorBoring;
00137 NModelParam< PixRGB<byte> > itsColorBlink;
00138 NModelParam< PixRGB<byte> > itsColorSaccade;
00139 NModelParam< PixRGB<byte> > itsColorSmoothPursuit;
00140 NModelParam< PixRGB<byte> > itsColorLink;
00141 NModelParam< PixRGB<byte> > itsColorText;
00142
00143
00144 NModelParam<int> itsHighlightMax;
00145 NModelParam<float> itsShapeEstimatorBaseContrast;
00146 NModelParam<int> itsShapeEstimatorBaseBright;
00147
00148 NModelParam<float> itsWarp3Dpitch;
00149 NModelParam<float> itsWarp3Dyaw;
00150 NModelParam<float> itsWarp3DpitchRate;
00151 NModelParam<float> itsWarp3DyawRate;
00152 NModelParam<float> itsWarp3DpitchMax;
00153 NModelParam<float> itsWarp3DyawMax;
00154
00155
00156 OModelParam<int> itsHeadRadius;
00157 OModelParam<int> itsMultiRetinaDepth;
00158
00159
00160 NModelParam<int> itsFOApsiz;
00161 NModelParam<int> itsFOAthick;
00162 NModelParam<int> itsFOAlinkThick;
00163 NModelParam<int> itsFOVpsiz;
00164 NModelParam<int> itsFOVpthick;
00165 NModelParam<int> itsFOVthick;
00166 NModelParam<int> itsFOVlinkThick;
00167 NModelParam<int> itsHEDpsiz;
00168 NModelParam<int> itsHEDpthick;
00169 NModelParam<int> itsHEDthick;
00170 NModelParam<int> itsHEDlinkThick;
00171
00172 OModelParam<bool> itsUseLargerDrawings;
00173
00174
00175
00176
00177 OModelParam<bool> itsObsolete1;
00178
00179
00180 virtual void doEventRetinaImage(SimEventQueue& q, rutz::shared_ptr<SimEventRetinaImage>& e);
00181
00182
00183 virtual void doEventWTAwinner(SimEventQueue& q, rutz::shared_ptr<SimEventWTAwinner>& e);
00184
00185
00186 virtual void start2();
00187
00188
00189
00190 virtual void reset1();
00191
00192
00193 virtual void save1(const ModelComponentSaveInfo& sinfo);
00194
00195
00196 Image< PixRGB<byte> > getTraj(SimEventQueue& q);
00197
00198
00199
00200
00201
00202
00203 void drawFOA();
00204
00205
00206 void linkFOAs();
00207
00208
00209 void drawEye();
00210
00211
00212 void linkEyes();
00213
00214
00215 void drawHead();
00216
00217
00218 void linkHeads();
00219
00220
00221 void drawTime(Image< PixRGB<byte> >& image);
00222
00223
00224 void drawHighlights();
00225
00226
00227 Image< PixRGB<byte> > drawMegaCombo(SimEventQueue& q,
00228 const Image< PixRGB<byte> >& in);
00229
00230
00231 Image< PixRGB<byte> > drawMotionSixPack(const Image< PixRGB<byte> >& in);
00232
00233
00234
00235
00236 void drawMaskOutline(Image< PixRGB<byte> >& traj, const Image<byte> mask,
00237 const PixRGB<byte>& col, const int thick,
00238 const Point2D<int>& pos, const int radius);
00239
00240
00241 void getMegaComboMaps(const rutz::shared_ptr<ChannelMaps>& chm,
00242 ImageSet< PixRGB<byte> >& cmaps, const uint depth = 0);
00243
00244
00245 Image< PixRGB<byte> > prepMapForDisplay(const NamedImage<float>& m) const;
00246
00247
00248
00249 private:
00250 friend class SimulationViewerEyeSim;
00251 Image< PixRGB<byte> > itsTraj;
00252 uint itsFOAshiftNum;
00253 Image<byte> itsCurrFOAmask;
00254 Image<byte> itsCumFOAmask;
00255 Point2D<int> itsCurrEye;
00256 Image<byte> itsCurrFoveaMask;
00257 Image<byte> itsCumFoveaMask;
00258 Point2D<int> itsCurrHead;
00259 Image<byte> itsCurrHeadMask;
00260 Image<byte> itsCumHeadMask;
00261
00262 Point2D<int> itsPrevEye;
00263 Point2D<int> itsPrevHead;
00264 SimTime itsCurrTime;
00265 bool itsEyeSaccade;
00266 bool itsEyeSmoothPursuit;
00267 bool itsHeadSaccade;
00268 bool itsHeadSmoothPursuit;
00269 bool itsEyeBlink;
00270 ImageSet< PixRGB<byte> > itsMultiTraj;
00271 Dims itsDims3D;
00272 mutable float itsPitch3D, itsYaw3D;
00273 bool itsHasNewInput;
00274 SimpleFont itsFont;
00275 };
00276
00277 #endif
00278
00279
00280
00281
00282
00283