MBSim

Project Page
Public Member Functions | Protected Attributes | Private Member Functions
MBSim::Rectangle Class Reference

RigidContour Rectangle. More...

#include <rectangle.h>

Inheritance diagram for MBSim::Rectangle:
MBSim::Plane MBSim::RigidContour MBSim::Contour MBSim::Element

List of all members.

Public Member Functions

 Rectangle (const std::string &name)
 constructor
std::string getType () const
virtual void init (InitStage stage)
 TODO.
void setYLength (double l)
void setZLength (double l)
void setThickness (double thickness_)
double getYLength () const
double getZLength () const
const fmatvec::Vec3 & getA () const
const fmatvec::Vec3 & getB () const
const fmatvec::Vec3 & getC () const
const fmatvec::Vec3 & getD () const
double getThickness () const
bool PointInRectangle (const fmatvec::Vec3 &Point)
 if the point and rectangle are on the same plane by default, this function checks if a point lies in the rectangle; else this function checks if the projection of the point lies in the rectangle;
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)
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
bool Intersect_Circle (const double &radius, const fmatvec::Vec3 &CenCir)
 check if this rectangle intersect with a circle,

Protected Attributes

double yLength
double zLength
double thickness
fmatvec::Vec3 RrA
 vertex for y = limy/2, z = limz/2
fmatvec::Vec3 RrB
 vertex for y = -limy/2, z = limz/2
fmatvec::Vec3 RrC
 vertex for y = -limy/2, z = -limz/2
fmatvec::Vec3 RrD
 vertex for y = limy/2, z = -limz/2

Private Member Functions

void setVertices ()
 set the verticies positions

Detailed Description

RigidContour Rectangle.

Date:
2009-07-14 some comments (Bastian Esefeld)
2009-07-16 new file (Bastian Esefeld)

Constructor & Destructor Documentation

MBSim::Rectangle::Rectangle ( const std::string &  name)

constructor

Parameters:
nameof contour

Member Function Documentation

std::string MBSim::Rectangle::getType ( ) const [inline, virtual]
Returns:
std::string representation

Reimplemented from MBSim::Plane.

bool MBSim::Rectangle::Intersect_Circle ( const double &  radius,
const fmatvec::Vec3 &  CenCir 
)

check if this rectangle intersect with a circle,

Parameters:
radiusradius of the circle
CenCircenter of the circle in world coordinates
Returns:
true: this rectangle intersects the circle
Attention:
: the circle is the intersection circle between the sphere and the plane, thus the center of the circle is different from the center of the sphere.
fmatvec::Vec3 MBSim::Rectangle::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

Parameters:
EndP1,EndP2,:end points of the line segment; CenCir: center of the circle.
bool MBSim::Rectangle::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)

Parameters:
Pointposition of the point
CenCircenter of the circle
radiusradius of the circle.
Returns:
true: point in the circle, else false
bool MBSim::Rectangle::PointInRectangle ( const fmatvec::Vec3 &  Point)

if the point and rectangle are on the same plane by default, this function checks if a point lies in the rectangle; else this function checks if the projection of the point lies in the rectangle;

Parameters:
Point,:position of the point
Returns:
true: point in the rectangle

The documentation for this class was generated from the following file: