Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "PersonParticlePainter.h"
00012
00013 #include "Messages/TrackedPeopleM.h"
00014 #include "Messages/PersonParticleFilterDataM.h"
00015
00016 #include <QtOpenGL>
00017 #include <GL/glut.h>
00018
00019 #include "Architecture/Config/Config.h"
00020
00021 #define THIS PersonParticlePainter
00022
00023 THIS::THIS() : PainterPlugin( )
00024 {
00025 setName ( "People particles (test)" );
00026 m_ParticleModel = SceneGraph ( "config/PersonParticle.xml" );
00027 m_OtherParticleModel = SceneGraph ( "config/OtherParticle.xml" );
00028 m_NumParticlesToDraw = Config::getInt("testParticleFilter.iNumParticlesToDraw");
00029 }
00030
00031
00032 THIS::~THIS()
00033 {
00034 }
00035
00036
00037 void THIS::processMessage ( Message* newMessage )
00038 {
00039 PainterPlugin::processMessage ( newMessage );
00040 switch ( newMessage->getType() )
00041 {
00042 case MessageTypes::PERSON_PARTICLE_FILTER_DATA_M:
00043 {
00044 if ( PersonParticleFilterDataM* message = Message::castTo<PersonParticleFilterDataM> ( newMessage ) )
00045 {
00046
00047 m_BestParticles = message->getBestCandidates();
00048 m_ParticleFilters = message->getParticleFilters();
00049
00050 if (m_BestParticles.size() != m_ParticleFilters.size())
00051 TRACE_WARNING("Number of best candidates is different to the number of particle filters!");
00052
00053 requestRedraw();
00054 }
00055 break;
00056 }
00057 default:
00058 break;
00059
00060 }
00061 }
00062
00063 void THIS::paint ( float next2DLayer )
00064 {
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 }
00101
00102
00103
00104 #undef THIS