00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RIGID_BODY_OBSERVER_H__
00021 #define _RIGID_BODY_OBSERVER_H__
00022 #include "mbsim/observer.h"
00023
00024 #ifdef HAVE_OPENMBVCPPINTERFACE
00025 #include <openmbvcppinterface/arrow.h>
00026 namespace OpenMBV {
00027 class Frame;
00028 }
00029 #endif
00030
00031 namespace MBSim {
00032 class RigidBody;
00033 class Frame;
00034
00035 class RigidBodyObserver: public Observer {
00036 private:
00037 RigidBody* body;
00038 #ifdef HAVE_OPENMBVCPPINTERFACE
00039 OpenMBV::Group* openMBVGrp;
00040 OpenMBV::Arrow *openMBVAxisOfRotation;
00041 #endif
00042
00043 public:
00044 RigidBodyObserver(const std::string &name);
00045 void setRigidBody(RigidBody *body_) { body = body_; }
00046
00047 void init(InitStage stage);
00048 virtual void plot(double t, double dt);
00049
00050 #ifdef HAVE_OPENMBVCPPINTERFACE
00051 void enableOpenMBVAxisOfRotation(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00052 #endif
00053
00054 };
00055
00056 }
00057
00058 #endif
00059