Klamp't  0.8.1
ViewRobot.h
1 #ifndef VIEW_ROBOT_H
2 #define VIEW_ROBOT_H
3 
4 #include <KrisLibrary/GLdraw/GLColor.h>
5 #include <KrisLibrary/GLdraw/GLDisplayList.h>
6 #include <KrisLibrary/GLdraw/GeometryAppearance.h>
7 #include <Klampt/Modeling/Robot.h>
8 
12 struct ViewRobot
13 {
14  ViewRobot(Robot* robot=NULL);
15  ~ViewRobot();
17  void Draw(Robot* robot);
19  void Draw();
21  void DrawLink_Local(int i,bool keepAppearance=true);
23  void DrawLink_World(int i,bool keepAppearance=true);
24  void DrawCenterOfMass(Real radius = 0.05);
25  void DrawLinkCenterOfMass(int i,Real radius = 0.05);
26  void DrawLinkFrames(Real size = 0.1);
27  void DrawLinkSkeleton();
28  void DrawTorques(const Vector& t);
29  void SetColors(const GLDraw::GLColor& c);
30  void SetColor(int i,const GLDraw::GLColor& c);
31  void SetGrey();
32  void SetTorqueColors(const Vector& t);
34  GLDraw::GeometryAppearance& Appearance(int link);
36  void PushAppearance();
38  void PopAppearance();
40  void RestoreAppearance();
42  vector<GLDraw::GeometryAppearance> GetAppearance();
44  void SetAppearance(const vector<GLDraw::GeometryAppearance>& );
45 
46  Robot* robot;
47  vector< vector<GLDraw::GeometryAppearance> > appearanceStack;
48 };
49 
50 #endif
The main robot type used in RobotSim.
Definition: Robot.h:79
void SetAppearance(const vector< GLDraw::GeometryAppearance > &)
easy way to save/restore appearance
void DrawLink_World(int i, bool keepAppearance=true)
draws link i&#39;s geometry in the world frame
Draws the robot (potentially color-coded)
Definition: ViewRobot.h:12
void Draw()
Draws the whole robot.
vector< GLDraw::GeometryAppearance > GetAppearance()
easy way to save/restore appearance
void PopAppearance()
pops the last active appearance
void PushAppearance()
pushes a new active appearance
void DrawLink_Local(int i, bool keepAppearance=true)
draws link i&#39;s geometry in its local frame
GLDraw::GeometryAppearance & Appearance(int link)
gets the currently active appearance
void RestoreAppearance()
restores the base appearance