All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
plate.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: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _RECTANGLE_H_
21 #define _RECTANGLE_H_
22 
23 #include "mbsim/contours/plane.h"
24 #include "fmatvec/fmatvec.h"
25 #include "fmatvec/linear_algebra_double.h"
26 #include "fmatvec/linear_algebra.h"
27 
28 #include <mbsim/utils/openmbv_utils.h>
29 
30 namespace MBSim {
31 
37  class Plate : public Plane {
38  public:
43  Plate(const std::string &name="", Frame *R=0);
44 
45  Plate(const std::string &name, double yL, double zL, Frame *R=0);
46 
47  Plate(const std::string &name, double yL, double zL, double t, Frame *R=0);
48 
49  /* INHERITED INTERFACE OF ELEMENT */
50  std::string getType() const {
51  return "Plate";
52  }
53  virtual void init(InitStage stage);
54  /**********************************/
55 
56  /* GETTER / SETTER */
57  void setYLength(double l) {
58  yLength = l;
59  }
60  void setZLength(double l) {
61  zLength = l;
62  }
63 
64  double getYLength() const {
65  return yLength;
66  }
67  double getZLength() const {
68  return zLength;
69  }
70  //get vertex of the plate, under reference frame of the plate
71  const fmatvec::Vec3 & getA() const {
72  return RrA;
73  }
74  const fmatvec::Vec3 & getB() const {
75  return RrB;
76  }
77  const fmatvec::Vec3 & getC() const {
78  return RrC;
79  }
80  const fmatvec::Vec3 & getD() const {
81  return RrD;
82  }
83 
84  /***************************************************//*new added part by ting 05.10.2012*/
91  bool PointInPlate(const fmatvec::Vec3& Point); //need to be check again.......................................................
92 
100  bool PointInCircle(const fmatvec::Vec3& Point, const fmatvec::Vec3& CenCir, const double & radius);
101 
106  fmatvec::Vec3 Point_closest_toCircle_onLineseg(const fmatvec::Vec3& EndP1, const fmatvec::Vec3& EndP2, const fmatvec::Vec3& CenCir);
107 
116  bool Intersect_Circle(const double & radius, const fmatvec::Vec3& CenCir);
117  /***************************************************/
118 
119  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
120  OpenMBVCuboid ombv(fmatvec::Vec3(),diffuseColor,transparency);
121  openMBVRigidBody=ombv.createOpenMBV();
122  }
123 
124  protected:
125  double yLength, zLength;
126  //vertices under reference frame
130  fmatvec::Vec3 RrA;
131 
135  fmatvec::Vec3 RrB;
136 
140  fmatvec::Vec3 RrC;
141 
145  fmatvec::Vec3 RrD;
146 
147  private:
151  void setVertices();
152 
153  };
154 }
155 
156 #endif /* _AREA_H_ */
Plate(const std::string &name="", Frame *R=0)
constructor
bool PointInCircle(const fmatvec::Vec3 &Point, const fmatvec::Vec3 &CenCir, const double &radius)
check if a point lies in the circle (point and circle are on the same plane)
Definition: plate.cc:93
fmatvec::Vec3 RrD
vertex for y = limy/2, z = -limz/2
Definition: plate.h:145
bool Intersect_Circle(const double &radius, const fmatvec::Vec3 &CenCir)
check if this plate intersect with a circle,
Definition: plate.cc:120
bool PointInPlate(const fmatvec::Vec3 &Point)
if the point and plate are on the same plane by default, this function checks if a point lies in the ...
Definition: plate.cc:82
virtual void init(InitStage stage)
plots time series header
Definition: plate.cc:41
std::string getType() const
Definition: plate.h:50
fmatvec::Vec3 Point_closest_toCircle_onLineseg(const fmatvec::Vec3 &EndP1, const fmatvec::Vec3 &EndP2, const fmatvec::Vec3 &CenCir)
search the closest point on the line segment to a circle
Definition: plate.cc:102
plane without borders
Definition: plane.h:38
RigidContour Plate.
Definition: plate.h:37
InitStage
The stages of the initialization.
Definition: element.h:97
fmatvec::Vec3 RrC
vertex for y = -limy/2, z = -limz/2
Definition: plate.h:140
fmatvec::Vec3 RrB
vertex for y = -limy/2, z = limz/2
Definition: plate.h:135
std::string name
name of element
Definition: element.h:298
fmatvec::Vec3 RrA
vertex for y = limy/2, z = limz/2
Definition: plate.h:130
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
void setVertices()
set the verticies positions
Definition: plate.cc:60
Frame * R
coordinate system of contour
Definition: rigid_contour.h:88

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML