00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RIGID_BODY_GROUP_OBSERVER_H__
00021 #define _RIGID_BODY_GROUP_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 RigidBodyGroupObserver : public Observer {
00036 private:
00037 std::vector<RigidBody*> body;
00038 Frame* ref;
00039 #ifdef HAVE_OPENMBVCPPINTERFACE
00040 OpenMBV::Arrow *openMBVPosition, *openMBVVelocity, *openMBVAcceleration, *openMBVAngularVelocity, *openMBVAngularAcceleration, *openMBVWeight, *openMBVMomentum, *openMBVAngularMomentum, *openMBVDerivativeOfMomentum, *openMBVDerivativeOfAngularMomentum;
00041 #endif
00042
00043 public:
00044 RigidBodyGroupObserver(const std::string &name);
00045 void addBody(RigidBody *body_) { body.push_back(body_); }
00046 void setFrameOfReference(Frame* frame) { ref = frame; }
00047
00048 void init(InitStage stage);
00049 virtual void plot(double t, double dt);
00050
00051 #ifdef HAVE_OPENMBVCPPINTERFACE
00052 void enableOpenMBVWeight(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00053 void enableOpenMBVMomentum(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00054 void enableOpenMBVAngularMomentum(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00055 void enableOpenMBVDerivativeOfMomentum(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00056 void enableOpenMBVDerivativeOfAngularMomentum(double scale=1, OpenMBV::Arrow::ReferencePoint refPoint=OpenMBV::Arrow::fromPoint, double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00057 #endif
00058
00059 };
00060
00061 }
00062
00063 #endif
00064