GLsceneBase.h
Go to the documentation of this file.
1 #ifndef __GL_SCENE_BASE_H__
2 #define __GL_SCENE_BASE_H__
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <sys/time.h>
8 //Open CV header
9 #include <cv.h>
10 #include <highgui.h>
11 #include <SDL/SDL_thread.h>
12 #include <hrpCorba/ModelLoader.hh>
14 #include <hrpModel/World.h>
15 
16 class GLbody;
17 class GLcamera;
18 class LogManagerBase;
19 
20 #define DEFAULT_W 640
21 #define DEFAULT_H 480
22 #define SLIDER_AREA_HEIGHT 30
23 #define SLIDER_SIDE_MARGIN 10
24 
25 class GLsceneBase : virtual public hrp::World<hrp::ConstraintForceSolver>
26 {
27 public:
29  virtual ~GLsceneBase();
30  void save(const char *i_fname);
31  void capture(char *o_image);
32  void init();
33  void initLights();
34  void defaultLights(bool flag);
35  bool defaultLights();
36  void clear();
37  void requestClear();
38  void requestCapture(const char *i_fname);
39  void setCamera(GLcamera *i_camera);
40  void nextCamera();
41  void nextObject();
44  void setMessages(const std::vector<std::string>& i_msgs) { m_msgs = i_msgs;}
45  void showSlider(bool flag) { m_showSlider = flag; }
46  void setScreenSize(int w, int h);
48  void draw();
49  size_t drawObjects(bool showSensors=true);
50  void setView();
51  virtual void showStatus() {}
52  virtual void drawAdditionalLines() {}
53  virtual void updateScene()=0;
54  void showFloorGrid(bool flag);
55  bool showFloorGrid();
56  void showInfo(bool flag);
57  void addBody(hrp::BodyPtr i_body);
58  void maxEdgeLen(double i_len);
60  void setBackGroundColor(float rgb[3]);
62  void capture() { m_isCapturing = true; }
63 protected:
65 
66  void drawFloorGrid();
67  void drawInfo(double fps, size_t ntri);
68 
69  std::vector<std::string> m_msgs;
73  struct timeval m_lastDraw;
74  CvVideoWriter *m_videoWriter;
75  IplImage *m_cvImage;
77  SDL_sem *m_sem;
79  int m_request;
80  std::string m_fname;
81  double m_maxEdgeLen;
83  float m_bgColor[3];
85 };
86 
87 #endif
bool defaultLights()
void setCamera(GLcamera *i_camera)
Definition: GLsceneBase.cpp:60
bool m_showFloorGrid
Definition: GLsceneBase.h:78
GLcamera * m_default_camera
Definition: GLsceneBase.h:72
void initLights()
void drawFloorGrid()
virtual void updateScene()=0
GLsceneBase(LogManagerBase *i_log)
Definition: GLsceneBase.cpp:28
void setBackGroundColor(float rgb[3])
hrp::Vector3 center()
bool showFloorGrid()
double m_maxEdgeLen
Definition: GLsceneBase.h:81
std::vector< std::string > m_msgs
Definition: GLsceneBase.h:69
void nextCamera()
Definition: GLsceneBase.cpp:67
GLcamera * getDefaultCamera()
Definition: GLsceneBase.cpp:99
w
void toggleRobotState()
Definition: GLsceneBase.h:47
bool m_isCapturing
Definition: GLsceneBase.h:84
size_t drawObjects(bool showSensors=true)
Definition: GLbody.h:11
Eigen::Vector3d Vector3
float m_bgColor[3]
Definition: GLsceneBase.h:83
int m_targetObject
Definition: GLsceneBase.h:82
IplImage * m_cvImage
Definition: GLsceneBase.h:75
void addBody(hrp::BodyPtr i_body)
std::string m_fname
Definition: GLsceneBase.h:80
void showSlider(bool flag)
Definition: GLsceneBase.h:45
void save(const char *i_fname)
LogManagerBase * m_log
Definition: GLsceneBase.h:76
virtual void showStatus()
Definition: GLsceneBase.h:51
void setView()
bool m_showSlider
Definition: GLsceneBase.h:70
bool m_showingStatus
Definition: GLsceneBase.h:70
void requestCapture(const char *i_fname)
void setScreenSize(int w, int h)
Definition: GLsceneBase.cpp:55
SDL_sem * m_sem
Definition: GLsceneBase.h:77
hrp::BodyPtr targetObject()
bool m_showInfo
Definition: GLsceneBase.h:78
bool m_defaultLights
Definition: GLsceneBase.h:78
GLcamera * m_camera
Definition: GLsceneBase.h:72
void showInfo(bool flag)
void drawInfo(double fps, size_t ntri)
void maxEdgeLen(double i_len)
void setMessages(const std::vector< std::string > &i_msgs)
Definition: GLsceneBase.h:44
void capture()
Definition: GLsceneBase.h:62
void requestClear()
virtual void drawAdditionalLines()
Definition: GLsceneBase.h:52
png_infop png_uint_32 flag
virtual ~GLsceneBase()
Definition: GLsceneBase.cpp:48
CvVideoWriter * m_videoWriter
Definition: GLsceneBase.h:74
struct timeval m_lastDraw
Definition: GLsceneBase.h:73
void nextObject()
Definition: GLsceneBase.cpp:88
GLcamera * getCamera()
Definition: GLsceneBase.cpp:94


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50