00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CONTOUR1S_H_
00021 #define _CONTOUR1S_H_
00022
00023 #include "mbsim/contours/contour_continuum.h"
00024
00025 #ifdef HAVE_OPENMBVCPPINTERFACE
00026 #include <openmbvcppinterface/spineextrusion.h>
00027 #endif
00028
00029 namespace MBSim {
00030
00037 class Contour1s : public ContourContinuum<double> {
00038 public:
00043 Contour1s(const std::string &name);
00044
00045
00046 std::string getType() const {
00047 return "Contour1s";
00048 }
00049 void init(InitStage stage_);
00050 void plot(double t, double dt);
00051
00052
00053
00058 virtual fmatvec::Vec3 computeTangent(ContourPointData &cp) {
00059 updateKinematicsForFrame(cp, Frame::firstTangent);
00060 return cp.getFrameOfReference().getOrientation().col(1);
00061 }
00062
00067 virtual fmatvec::Vec3 computeBinormal(ContourPointData &cp) {
00068 updateKinematicsForFrame(cp, Frame::secondTangent);
00069 return cp.getFrameOfReference().getOrientation().col(2);
00070 }
00071
00072
00077 virtual double computeCurvature(ContourPointData &cp) {
00078 THROW_MBSIMERROR("(Contour::computeCurvature): Not implemented.");
00079 return 0;
00080 }
00081
00087 virtual double computeDistance(const double s, const int order = 0) {
00088 THROW_MBSIMERROR("(Contour::computeDistance): Not implemented.");
00089 return 0;
00090 }
00091
00092
00093 void setDiameter(double diameter_) {
00094 diameter = diameter_;
00095 }
00096 double getDiameter() {
00097 return diameter;
00098 }
00099
00100
00101
00102 #ifdef HAVE_OPENMBVCPPINTERFACE
00103 void setOpenMBVSpineExtrusion(OpenMBV::SpineExtrusion* spineExtrusion) {
00104 openMBVSpineExtrusion = spineExtrusion;
00105 }
00106 OpenMBV::Body* getOpenMBVSpineExtrusion() {
00107 return openMBVSpineExtrusion;
00108 }
00109 #endif
00110
00111 protected:
00117 double diameter;
00118
00119 #ifdef HAVE_OPENMBVCPPINTERFACE
00120
00123 OpenMBV::SpineExtrusion* openMBVSpineExtrusion;
00124
00125 #endif
00126
00127 };
00128
00129 }
00130
00131 #endif
00132