00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _LINE_SEGMENT_H_
00021 #define _LINE_SEGMENT_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
00031 class ContourPointData;
00032
00039 class LineSegment : public MBSim::RigidContour {
00040 public:
00045 LineSegment(const std::string& name, double l, double t, Frame *R=0);
00046
00047 LineSegment(const std::string& name, double l, Frame *R=0);
00048
00049 LineSegment(const std::string& name="", Frame *R=0);
00050
00051
00052 std::string getType() const { return "LineSegment"; }
00053 virtual void init(InitStage stage);
00054
00055
00056
00057 virtual double computeCurvature(ContourPointData &cp) { return 0; }
00058
00059
00060 #ifdef HAVE_OPENMBVCPPINTERFACE
00061 BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
00062 OpenMBVLine ombv(1,diffuseColor,transparency);
00063 openMBVRigidBody=ombv.createOpenMBV();
00064 }
00065 #endif
00066
00067 virtual void initializeUsingXML(xercesc::DOMElement *element);
00068 virtual xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *element);
00069
00070 void updateKinematicsForFrame(ContourPointData &cp, Frame::Feature ff);
00071
00072
00073 void setLength(double length_) {length = length_; }
00074 double getLength() const {return length; }
00075 void setThickness(double thickness_) {thickness = thickness_;}
00076 double getThickness() const {return thickness;}
00077
00078
00079 private:
00083 double length;
00084
00088 double thickness;
00089 };
00090 }
00091
00092 #endif
00093