00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _AREA_H_
00021 #define _AREA_H_
00022
00023 #include "mbsim/contours/plane.h"
00024 #include "fmatvec.h"
00025 #include "linear_algebra_double.h"
00026 #include "linear_algebra.h"
00027
00028 namespace MBSim {
00029
00035 class Area : public Plane {
00036 public:
00041 Area(const std::string &name);
00042
00043
00044 std::string getType() const {
00045 return "Area";
00046 }
00047 virtual void init(InitStage stage);
00048
00049
00050
00051 void setLimitY(double l) {
00052 limy = l;
00053 }
00054 void setLimitZ(double l) {
00055 limz = l;
00056 }
00057
00058 double getLimitY() const {
00059 return limy;
00060 }
00061 double getLimitZ() const {
00062 return limz;
00063 }
00064
00065 const fmatvec::Vec3 & getA() const {
00066 return RrA;
00067 }
00068 const fmatvec::Vec3 & getB() const {
00069 return RrB;
00070 }
00071 const fmatvec::Vec3 & getC() const {
00072 return RrC;
00073 }
00074 const fmatvec::Vec3 & getD() const {
00075 return RrD;
00076 }
00077
00078
00085 bool PointInArea(const fmatvec::Vec3& Point);
00086
00094 bool PointInCircle(const fmatvec::Vec3& Point, const fmatvec::Vec3& CenCir, const double & radius);
00095
00100 fmatvec::Vec3 Point_closest_toCircle_onLineseg(const fmatvec::Vec3& EndP1, const fmatvec::Vec3& EndP2, const fmatvec::Vec3& CenCir);
00101
00110 bool Intersect_Circle(const double & radius, const fmatvec::Vec3& CenCir);
00111
00112
00113 #ifdef HAVE_OPENMBVCPPINTERFACE
00114 virtual void enableOpenMBV(bool enable = true, int number = 10);
00115 #endif
00116
00117 protected:
00118 double limy, limz;
00119
00123 fmatvec::Vec3 RrA;
00124
00128 fmatvec::Vec3 RrB;
00129
00133 fmatvec::Vec3 RrC;
00134
00138 fmatvec::Vec3 RrD;
00139
00140 private:
00144 void setVertices();
00145
00146 };
00147 }
00148
00149 #endif