00001 00002 00003 #ifndef _TOMGINE_THREAD_H_ 00004 #define _TOMGINE_THREAD_H_ 00005 00006 // WIN32: Ensure that glew.h is included before gl.h 00007 #ifdef WIN32 00008 #include <GL/glew.h> 00009 #endif 00010 00011 // WIN32: "ThreadObject/Thread.h" must be included before "Recognizer3D/Recognizer3D.h" and "TomGine/tgEngine.h" 00012 #include <blort/ThreadObject/Thread.h> 00013 // WIN32: "Recognizer3D/Recognizer3D.h" must be included before "TomGine/tgEngine.h" 00014 #include <blort/Recognizer3D/Recognizer3D.h> 00015 #include <blort/TomGine/tgEngine.h> 00016 00017 class CTomGineThread : public CThread 00018 { 00019 private: 00020 bool m_quit; 00021 00022 bool m_use_campars; 00023 00024 int m_width, m_height; 00025 std::vector<blortRecognizer::Siftex> m_siftexlist, m_lastsiftexlist; 00026 float m_max_vertex_length; 00027 TomGine::tgRenderModel m_model; 00028 TomGine::tgRenderModel m_sphere, m_cone; 00029 TomGine::tgPose m_pose; 00030 std::vector<TomGine::tgPose> m_viewlist; 00031 std::vector<vec3> m_viewscale; 00032 TomGine::tgCamera::Parameter m_camPars; 00033 00034 CEventClass m_evCmd, m_evData; 00035 CMutexClass m_running; 00036 00037 00038 public: 00039 CTomGineThread(int width, int height); 00040 CTomGineThread(int width, int height, const TomGine::tgCamera::Parameter& tgCamParams); 00041 ~CTomGineThread(); 00042 00043 void SetModel(const TomGine::tgModel& model); 00044 void SetPose(const TomGine::tgPose& pose); 00045 void AddSifts(const std::vector<blortRecognizer::Siftex>& sl); 00046 void AddView(const TomGine::tgPose& view); 00047 00048 virtual BOOL OnTask(); 00049 00050 }; 00051 00052 #endif /* _TOMGINE_THREAD_H_ */ 00053