Klamp't  0.9.0
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 
9 namespace Klampt {
10 
14 struct ViewRobot
15 {
16  ViewRobot(RobotModel* robot=NULL);
17  ~ViewRobot();
19  void Draw(RobotModel* robot);
21  void Draw();
23  void DrawOpaque(bool opaque);
25  void DrawLink_Local(int i,bool keepAppearance=true);
27  void DrawLink_World(int i,bool keepAppearance=true);
28  void DrawCenterOfMass(Real radius = 0.05);
29  void DrawLinkCenterOfMass(int i,Real radius = 0.05);
30  void DrawLinkFrames(Real size = 0.1);
31  void DrawLinkSkeleton();
32  void DrawTorques(const Vector& t);
33  void SetColors(const GLDraw::GLColor& c);
34  void SetColor(int i,const GLDraw::GLColor& c);
35  void SetTintColors(const GLDraw::GLColor& c,Real fraction);
36  void SetTintColor(int i,const GLDraw::GLColor& c,Real fraction);
37  void SetGrey();
38  //void BlendColors(const GLDraw::GLColor& c,Real fraction);
39  //void BlendColor(int i,const GLDraw::GLColor& c,Real fraction);
40  void SetTorqueColors(const Vector& t);
42  GLDraw::GeometryAppearance& Appearance(int link);
44  GLDraw::GeometryAppearance& LastAppearance(int link);
46  void PushAppearance();
48  void PopAppearance();
50  void RestoreAppearance();
52  vector<GLDraw::GeometryAppearance> GetAppearance();
54  void SetAppearance(const vector<GLDraw::GeometryAppearance>& );
55 
56  RobotModel* robot;
57  vector< vector<GLDraw::GeometryAppearance> > appearanceStack;
58 };
59 
60 } //namespace Klampt
61 
62 #endif
Draws the robot (potentially color-coded)
Definition: ViewRobot.h:14
void DrawLink_Local(int i, bool keepAppearance=true)
draws link i&#39;s geometry in its local frame
void Draw()
Draws the whole robot.
void PushAppearance()
pushes a new active appearance
void DrawOpaque(bool opaque)
Draws opaque / transparent parts of the robot.
void RestoreAppearance()
restores the base appearance
GLDraw::GeometryAppearance & Appearance(int link)
gets the currently active appearance
GLDraw::GeometryAppearance & LastAppearance(int link)
gets the appearance that you&#39;d get if you would run PopAppearance()
The main robot type used in RobotSim.
Definition: Robot.h:83
void PopAppearance()
pops the last active appearance
void SetAppearance(const vector< GLDraw::GeometryAppearance > &)
easy way to save/restore appearance
vector< GLDraw::GeometryAppearance > GetAppearance()
easy way to save/restore appearance
void DrawLink_World(int i, bool keepAppearance=true)
draws link i&#39;s geometry in the world frame
Definition: ContactDistance.h:6