chrono::geometry::ChGeometry Class Referenceabstract

Description

Base class for geometric objects used for collisions and visualization.

#include <ChGeometry.h>

Inheritance diagram for chrono::geometry::ChGeometry:

Public Types

enum  GeometryType {
  NONE, SPHERE, BOX, CYLINDER,
  TRIANGLE, CAPSULE, CONE, LINE,
  LINE_ARC, LINE_BEZIER, LINE_CAM, LINE_PATH,
  LINE_POLY, LINE_SEGMENT, ROUNDED_BOX, ROUNDED_CYLINDER,
  ROUNDED_CONE, TRIANGLEMESH, TRIANGLEMESH_CONNECTED, TRIANGLEMESH_SOUP
}
 Enumeration of geometric objects.
 

Public Member Functions

 ChGeometry (const ChGeometry &source)
 
virtual ChGeometryClone () const =0
 "Virtual" copy constructor.
 
virtual GeometryType GetClassType () const
 Get the class type as unique numerical ID (faster than using ChronoRTTI mechanism). More...
 
virtual void GetBoundingBox (double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, ChMatrix33<> *Rot=NULL) const
 Compute bounding box. More...
 
virtual void InflateBoundingBox (double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, ChMatrix33<> *Rot=NULL) const
 Enlarge a previous existing bounding box. More...
 
virtual double Size () const
 Returns the radius of the sphere which can enclose the geometry.
 
virtual void Evaluate (ChVector<> &pos, const double parU, const double parV=0., const double parW=0.) const
 Evaluates a point on a geometry, given parametric coordinates, if possible. More...
 
virtual void Derive (ChVector<> &dir, const double parU, const double parV=0., const double parW=0.) const
 Evaluates a tangent versor on a geometry, given parametric coordinates, if possible. More...
 
virtual ChVector Baricenter () const
 Compute center of mass It should be overriden by inherited classes.
 
virtual void CovarianceMatrix (ChMatrix33<> &C) const
 Compute the 3x3 covariance matrix (only the diagonal and upper part) It should be overriden by inherited classes.
 
virtual int GetManifoldDimension () const
 Tells the dimension of the geometry (0=point, 1=line, 2=surface, 3=solid)
 
virtual void Update ()
 Generic update of internal data. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de serialization of transient data from archives.
 

Member Function Documentation

void chrono::geometry::ChGeometry::Derive ( ChVector<> &  dir,
const double  parU,
const double  parV = 0.,
const double  parW = 0. 
) const
virtual

Evaluates a tangent versor on a geometry, given parametric coordinates, if possible.

Parameters U,V,W should be usually in 0..1 range. For a line, only U parameter is needed, for a surface also V. Computed value goes into the 'pos' reference. It could be overriden by inherited classes if a precise solution is known (otherwise it defaults to numerical BDF using the Evaluate() function.

virtual void chrono::geometry::ChGeometry::Evaluate ( ChVector<> &  pos,
const double  parU,
const double  parV = 0.,
const double  parW = 0. 
) const
virtual

Evaluates a point on a geometry, given parametric coordinates, if possible.

Parameters U,V,W should be usually in 0..1 range. For a line, only U parameter is needed, for a surface also V. Computed value goes into the 'pos' reference. It should be overriden by inherited classes.

Reimplemented in chrono::geometry::ChLineCam, chrono::geometry::ChRoundedBox, chrono::geometry::ChBox, chrono::geometry::ChLineArc, chrono::geometry::ChLinePath, chrono::geometry::ChLineBezier, chrono::geometry::ChLinePoly, and chrono::geometry::ChLineSegment.

virtual void chrono::geometry::ChGeometry::GetBoundingBox ( double &  xmin,
double &  xmax,
double &  ymin,
double &  ymax,
double &  zmin,
double &  zmax,
ChMatrix33<> *  Rot = NULL 
) const
virtual

Compute bounding box.

If a matrix Rot is not null, it should compute bounding box along the rotated directions represented by that transformation matrix Rot. It must be overridden by inherited classes.

Reimplemented in chrono::geometry::ChTriangleMesh, chrono::geometry::ChRoundedBox, chrono::geometry::ChTriangle, chrono::geometry::ChBox, chrono::geometry::ChRoundedCylinder, chrono::geometry::ChCapsule, chrono::geometry::ChCylinder, chrono::geometry::ChCone, chrono::geometry::ChEllipsoid, chrono::geometry::ChSphere, and chrono::geometry::ChRoundedCone.

void chrono::geometry::ChGeometry::InflateBoundingBox ( double &  xmin,
double &  xmax,
double &  ymin,
double &  ymax,
double &  zmin,
double &  zmax,
ChMatrix33<> *  Rot = NULL 
) const
virtual

Enlarge a previous existing bounding box.

Usually it does not need to be overriden: base function uses GetBoundingBox() If Rot is not null, the bounding box axes are considered rotated.

virtual void chrono::geometry::ChGeometry::Update ( )
virtual

Generic update of internal data.

Default, does nothing. Most often it is not needed to implement this method, but some inherited classes may implement it (ex. to update references to external data. etc.).