mbsim  4.0.0
MBSim Kernel
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
30namespace MBSim {
31
37 class Plate : public Plane {
38 public:
43 Plate(const std::string &name="", Frame *R=nullptr);
44
45 Plate(const std::string &name, double yL, double zL, Frame *R=nullptr);
46
47 Plate(const std::string &name, double yL, double zL, double t, Frame *R=nullptr);
48
49 /* INHERITED INTERFACE OF ELEMENT */
50 void init(InitStage stage, const InitConfigSet &config) override;
51 /**********************************/
52
53 /* GETTER / SETTER */
54 void setYLength(double l) {
55 yLength = l;
56 }
57 void setZLength(double l) {
58 zLength = l;
59 }
60
61 double getYLength() const {
62 return yLength;
63 }
64 double getZLength() const {
65 return zLength;
66 }
67 //get vertex of the plate, under reference frame of the plate
68 const fmatvec::Vec3 & getA() const {
69 return RrA;
70 }
71 const fmatvec::Vec3 & getB() const {
72 return RrB;
73 }
74 const fmatvec::Vec3 & getC() const {
75 return RrC;
76 }
77 const fmatvec::Vec3 & getD() const {
78 return RrD;
79 }
80
81 /***************************************************//*new added part by ting 05.10.2012*/
88 bool PointInPlate(const fmatvec::Vec3& Point); //need to be check again.......................................................
89
97 bool PointInCircle(const fmatvec::Vec3& Point, const fmatvec::Vec3& CenCir, const double & radius);
98
103 fmatvec::Vec3 Point_closest_toCircle_onLineseg(const fmatvec::Vec3& EndP1, const fmatvec::Vec3& EndP2, const fmatvec::Vec3& CenCir);
104
113 bool Intersect_Circle(const double & radi, const fmatvec::Vec3& CenCir);
114 /***************************************************/
115
116 BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, tag, (optional (diffuseColor,(const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(double),0)(pointSize,(double),0)(lineWidth,(double),0))) {
117 OpenMBVColoredBody ombv(diffuseColor,transparency,pointSize,lineWidth);
118 openMBVRigidBody=ombv.createOpenMBV<OpenMBV::Cuboid>();
119 }
120
121 protected:
122 double yLength{1};
123 double zLength{1};
124 //vertices under reference frame
128 fmatvec::Vec3 RrA;
129
133 fmatvec::Vec3 RrB;
134
138 fmatvec::Vec3 RrC;
139
143 fmatvec::Vec3 RrD;
144
145 private:
149 void setVertices();
150
151 };
152}
153
154#endif /* _AREA_H_ */
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
plane without borders
Definition: plane.h:39
RigidContour Plate.
Definition: plate.h:37
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:81
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: plate.cc:41
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:73
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:87
bool Intersect_Circle(const double &radi, const fmatvec::Vec3 &CenCir)
check if this plate intersect with a circle,
Definition: plate.cc:105
fmatvec::Vec3 RrD
vertex for y = limy/2, z = -limz/2
Definition: plate.h:143
fmatvec::Vec3 RrA
vertex for y = limy/2, z = limz/2
Definition: plate.h:128
fmatvec::Vec3 RrB
vertex for y = -limy/2, z = limz/2
Definition: plate.h:133
void setVertices()
set the verticies positions
Definition: plate.cc:51
Plate(const std::string &name="", Frame *R=nullptr)
constructor
fmatvec::Vec3 RrC
vertex for y = -limy/2, z = -limz/2
Definition: plate.h:138
Frame * R
coordinate system of contour
Definition: rigid_contour.h:135
namespace MBSim
Definition: bilateral_constraint.cc:30