SimulationViewerConfigurator.C
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 #include "Neuro/SimulationViewerConfigurator.H"
00039 #include "Component/OptionManager.H"
00040 #include "Neuro/NeuroOpts.H"
00041 #include "Neuro/SimulationViewer.H"
00042 #include "Neuro/SimulationViewerCompress.H"
00043 #include "Neuro/SimulationViewerEyeMvt.H"
00044 #include "Neuro/SimulationViewerEyeMvt2.H"
00045 #include "Neuro/SimulationViewerEyeMvtNeuro.H"
00046 #include "Neuro/SimulationViewerEyeRegion.H"
00047 #include "Neuro/SimulationViewerEyeSim.H"
00048 #include "Neuro/SimulationViewerStd.H"
00049 #include "Neuro/SimulationViewerStub.H"
00050 #include "Neuro/SimulationViewerSurpCont.H"
00051 #include "Neuro/SimulationViewerNerdCam.H"
00052 #include "Neuro/SimulationViewerStats.H"
00053 #include "Neuro/SimulationViewerRecStats.H"
00054 #include "Neuro/SimulationViewerHand.H"
00055 #include "Neuro/SimulationViewerEyeHand.H"
00056
00057
00058
00059
00060 SimulationViewerConfigurator::
00061 SimulationViewerConfigurator(OptionManager& mgr,
00062 const std::string& descrName,
00063 const std::string& tagName) :
00064 ModelComponent(mgr, descrName, tagName),
00065 itsSVtype(&OPT_SimulationViewerType, this),
00066 itsSV(new SimulationViewerStub(mgr))
00067 {
00068 addSubComponent(itsSV);
00069 }
00070
00071
00072 SimulationViewerConfigurator::~SimulationViewerConfigurator()
00073 { }
00074
00075
00076 nub::ref<SimulationViewer> SimulationViewerConfigurator::getSV() const
00077 { return itsSV; }
00078
00079
00080 void SimulationViewerConfigurator::
00081 paramChanged(ModelParamBase* const param,
00082 const bool valueChanged,
00083 ParamClient::ChangeStatus* status)
00084 {
00085 ModelComponent::paramChanged(param, valueChanged, status);
00086
00087
00088 if (param == &itsSVtype) {
00089
00090
00091
00092 removeSubComponent(*itsSV);
00093
00094
00095 if (itsSVtype.getVal().compare("None") == 0
00096 || itsSVtype.getVal().compare("Stub") == 0)
00097 itsSV.reset(new SimulationViewerStub(getManager()));
00098 else if (itsSVtype.getVal().compare("Std") == 0)
00099 itsSV.reset(new SimulationViewerStd(getManager()));
00100 else if (itsSVtype.getVal().compare("Compress") == 0)
00101 itsSV.reset(new SimulationViewerCompress(getManager()));
00102 else if (itsSVtype.getVal().compare("EyeMvt") == 0)
00103 itsSV.reset(new SimulationViewerEyeMvt(getManager()));
00104 else if (itsSVtype.getVal().compare("EyeMvt2") == 0)
00105 itsSV.reset(new SimulationViewerEyeMvt2(getManager()));
00106 else if (itsSVtype.getVal().compare("EyeMvtNeuro") == 0)
00107 itsSV.reset(new SimulationViewerEyeMvtNeuro(getManager()));
00108 else if (itsSVtype.getVal().compare("EyeRegion") == 0)
00109 itsSV.reset(new SimulationViewerEyeRegion(getManager()));
00110 else if (itsSVtype.getVal().compare("EyeSim") == 0)
00111 itsSV.reset(new SimulationViewerEyeSim(getManager()));
00112 else if (itsSVtype.getVal().compare("ASAC") == 0)
00113 itsSV.reset(new SimulationViewerSurpCont(getManager()));
00114 else if (itsSVtype.getVal().compare("NerdCam") == 0)
00115 itsSV.reset(new SimulationViewerNerdCam(getManager()));
00116 else if (itsSVtype.getVal().compare("Stats") == 0)
00117 itsSV.reset(new SimulationViewerStats(getManager()));
00118 else if (itsSVtype.getVal().compare("RecStats") == 0)
00119 itsSV.reset(new SimulationViewerRecStats(getManager()));
00120 else if (itsSVtype.getVal().compare("Hand") == 0)
00121 itsSV.reset(new SimulationViewerHand(getManager()));
00122 else if (itsSVtype.getVal().compare("EyeHand") == 0)
00123 itsSV.reset(new SimulationViewerEyeHand(getManager()));
00124 else
00125 LFATAL("Unknown SimulationViewer type %s", itsSVtype.getVal().c_str());
00126
00127
00128
00129
00130
00131
00132 addSubComponent(itsSV);
00133
00134
00135 itsSV->exportOptions(MC_RECURSE);
00136
00137
00138 LINFO("Selected SV of type %s", itsSVtype.getVal().c_str());
00139 }
00140 }
00141
00142
00143
00144
00145
00146
00147