00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _EDGE_H_
00021 #define _EDGE_H_
00022
00023 #include "mbsim/contour.h"
00024
00025 #ifdef HAVE_OPENMBVCPPINTERFACE
00026 #include <mbsim/utils/openmbv_utils.h>
00027 #endif
00028
00029 namespace MBSim {
00030
00037 class Edge : public MBSim::RigidContour {
00038 public:
00043 Edge(const std::string &name="", Frame *R=0) : RigidContour(name,R), length(1), thickness(0.01) {};
00044
00045 std::string getType() const {return "Edge";}
00046 virtual void init(InitStage stage);
00047
00048 virtual void updateKinematicsForFrame(ContourPointData &cp, Frame::Feature ff);
00049
00050
00051 void setLength(double length_) {length = length_;}
00052 double getLength() const { return length; }
00053 double getThickness() const {return thickness;}
00054
00055
00056 #ifdef HAVE_OPENMBVCPPINTERFACE
00057 BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
00058 OpenMBVLine ombv(1,diffuseColor,transparency);
00059 openMBVRigidBody=ombv.createOpenMBV();
00060 }
00061 #endif
00062
00063 private:
00064 double length, thickness;
00065 };
00066 }
00067
00068 #endif