00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CYLINDER_COORDINATES_OBSERVER_H__
00021 #define _CYLINDER_COORDINATES_OBSERVER_H__
00022 #include "mbsim/observer.h"
00023
00024 #ifdef HAVE_OPENMBVCPPINTERFACE
00025 #include <openmbvcppinterface/arrow.h>
00026
00027 namespace OpenMBV {
00028 class Frame;
00029 }
00030 #endif
00031
00032 namespace MBSim {
00033 class Frame;
00034
00035 class CylinderCoordinatesObserver : public Observer {
00036 private:
00037 Frame* frame;
00038 fmatvec::Vec3 ez;
00039 #ifdef HAVE_OPENMBVCPPINTERFACE
00040 OpenMBV::Arrow *openMBVPosition, *openMBVRadialPosition, *openMBVZPosition, *openMBVVelocity, *openMBVRadialVelocity, *openMBVCircularVelocity, *openMBVZVelocity, *openMBVAcceleration, *openMBVRadialAcceleration, *openMBVCircularAcceleration, *openMBVZAcceleration;
00041 OpenMBV::Frame* openMBVFrame;
00042 #endif
00043
00044 public:
00045 CylinderCoordinatesObserver(const std::string &name);
00046 void setFrame(Frame *frame_) { frame = frame_; }
00047 void setez(const fmatvec::Vec3 &ez_) {ez = ez_/nrm2(ez_);}
00048
00049 void init(InitStage stage);
00050 virtual void plot(double t, double dt);
00051
00052 #ifdef HAVE_OPENMBVCPPINTERFACE
00053 virtual void enableOpenMBVPosition(double diameter=0.5, double headDiameter=1, double headLength=1, double color=0.5);
00054 virtual void enableOpenMBVVelocity(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 virtual void enableOpenMBVAcceleration(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 virtual void enableOpenMBVFrame(double size=1, double offset=1);
00057 #endif
00058
00059 };
00060
00061 }
00062
00063 #endif
00064