00001 // ArticulatedLimb.h: interface for the ArticulatedLimb class. 00002 // 00004 00005 #ifndef ARTICULATEDLIMB_H 00006 #define ARTICULATEDLIMB_H 00007 00008 #include "ArticulatedLink.h" 00009 00010 class Simulator; 00011 00012 class ArticulatedLimb { 00013 public: 00015 ArticulatedLimb(real l, real theta); 00016 00018 virtual ~ArticulatedLimb(); 00019 00021 void computeSinCos(); 00022 00024 void setProperties(real l, real theta); 00025 00026 ArticulatedLink* addLink(); 00027 00030 ArticulatedLink* addOneObjectLink(real l, real theta0, 00031 PhysicalObject* object, real x, real y, real alpha, ArticulatedLink* parent=NULL, 00032 bool hasElasticTorque=true); 00033 00034 virtual void draw(GUI *gui); 00035 00036 virtual void setOutlineColor(Color color); 00037 virtual void setFillColor(Color color); 00038 00039 std::string label; 00040 00041 public: 00042 real l; 00043 real theta; 00044 00046 real sinTheta, cosTheta, sin2, cos2, sinCos; 00047 00050 ArticulatedLinkPVector links; 00051 00053 void deleteLinks(); 00054 }; 00055 00056 typedef std::vector<ArticulatedLimb*> ArticulatedLimbPVector; 00057 00058 #endif //ARTICULATEDLIMB_H
Thyrix homepage Users' guide
(C) Arxia 2004-2005