MBSim

Project Page
contour1s.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: thschindler@users.berlios.de
18  */
19 
20 #ifndef _CONTOUR1S_H_
21 #define _CONTOUR1S_H_
22 
23 #include "mbsim/contours/contour_continuum.h"
24 
25 namespace MBSim {
26 
33  class Contour1s : public ContourContinuum<double> {
34  public:
39  Contour1s(const std::string &name) : ContourContinuum<double>(name), diameter(0.) {}
40 
41  /* INHERITED INTERFACE OF ELEMENT */
42  std::string getType() const { return "Contour1s"; }
43  /***************************************************/
44 
45  /* INTERFACE FOR DERIVED CLASSES */
50  virtual fmatvec::Vec computeTangent(ContourPointData &cp) { updateKinematicsForFrame(cp,firstTangent); return cp.getFrameOfReference().getOrientation().col(1); }
51 
56  virtual fmatvec::Vec computeBinormal(ContourPointData &cp) { updateKinematicsForFrame(cp,secondTangent); return cp.getFrameOfReference().getOrientation().col(2); }
57  /***************************************************/
58 
63  virtual double computeCurvature(ContourPointData &cp) { throw MBSimError("ERROR (Contour::computeCurvature): Not implemented."); return 0; }
64 
70  virtual double computeDistance(const double s, const int order=0) { throw MBSimError("ERROR (Contour::computeDistance): Not implemented."); return 0; }
71 
72  /* GETTER / SETTER */
73  void setDiameter(double diameter_) { diameter= diameter_; }
74  double getDiameter() { return diameter; }
75  /***************************************************/
76 
77  protected:
81  double diameter;
82  };
83 
84 }
85 
86 #endif /* _CONTOUR1S_H_ */
87