Description

A basic triangle mesh: just a list of triangles (no edge connectivity info).

#include <ChTriangleMeshSoup.h>

Inheritance diagram for chrono::ChTriangleMeshSoup:
Collaboration diagram for chrono::ChTriangleMeshSoup:

Public Member Functions

 ChTriangleMeshSoup (const ChTriangleMeshSoup &source)
 
virtual ChTriangleMeshSoupClone () const override
 "Virtual" copy constructor (covariant return type).
 
bool LoadWavefrontMesh (std::string filename)
 Load from the given Wavefront .obj file.
 
virtual void AddTriangle (const ChVector3d &vertex0, const ChVector3d &vertex1, const ChVector3d &vertex2) override
 Access the n-th triangle in mesh /virtual ChTriangle& Triangle(int index) { return m_triangles[index]; }.
 
virtual void AddTriangle (const ChTriangle &atriangle) override
 Add a triangle to this triangle mesh, by specifying a ChTriangle.
 
virtual unsigned int GetNumTriangles () const override
 Get the number of triangles already added to this mesh.
 
virtual ChTriangle GetTriangle (unsigned int index) const override
 Access the n-th triangle in mesh.
 
std::vector< ChTriangle > & GetTriangles ()
 Get the list of triangles.
 
virtual void Clear () override
 Clear all data.
 
virtual void Transform (const ChVector3d displ, const ChMatrix33<> rotscale) override
 Transform all vertexes, by displacing and rotating (rotation via matrix, so also scaling if needed)
 
virtual Type GetType () const override
 Get the class type as an enum.
 
virtual void ArchiveOut (ChArchiveOut &archive_out) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in) override
 Method to allow de-serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChTriangleMesh
virtual void Transform (const ChVector3d displ, const ChQuaternion<> mquat=ChQuaternion<>(1, 0, 0, 0))
 Transform all vertexes, by displacing and rotating (rotation via matrix, so also scaling if needed)
 
virtual ChAABB GetBoundingBox () const override
 Compute bounding box of this triangle mesh.
 
virtual int GetManifoldDimension () const override
 This is a surface.
 
- Public Member Functions inherited from chrono::ChGeometry
 ChGeometry (const ChGeometry &other)
 
void InflateBoundingBox (ChAABB &bbox) const
 Enlarge the given existing bounding box with the bounding box of this object.
 
virtual double GetBoundingSphereRadius () const
 Returns the radius of a bounding sphere for this geometry.
 
virtual ChVector3d Baricenter () const
 Compute center of mass.
 
virtual void Update ()
 Generic update of internal data.
 

Static Public Member Functions

static std::shared_ptr< ChTriangleMeshSoupCreateFromWavefrontFile (const std::string &filename)
 Create and return a ChTriangleMeshConnected from a Wavefront OBJ file.
 

Additional Inherited Members

- Public Types inherited from chrono::ChGeometry
enum class  Type {
  NONE , SPHERE , ELLIPSOID , BOX ,
  CYLINDER , TRIANGLE , CAPSULE , CONE ,
  LINE , LINE_ARC , LINE_BEZIER , LINE_CAM ,
  LINE_PATH , LINE_POLY , LINE_SEGMENT , ROUNDED_BOX ,
  ROUNDED_CYLINDER , TRIANGLEMESH , TRIANGLEMESH_CONNECTED , TRIANGLEMESH_SOUP
}
 Enumeration of geometric object types.
 

Member Function Documentation

◆ AddTriangle() [1/2]

virtual void chrono::ChTriangleMeshSoup::AddTriangle ( const ChTriangle & atriangle)
inlineoverridevirtual

Add a triangle to this triangle mesh, by specifying a ChTriangle.

Implements chrono::ChTriangleMesh.

◆ AddTriangle() [2/2]

void chrono::ChTriangleMeshSoup::AddTriangle ( const ChVector3d & vertex0,
const ChVector3d & vertex1,
const ChVector3d & vertex2 )
overridevirtual

Access the n-th triangle in mesh /virtual ChTriangle& Triangle(int index) { return m_triangles[index]; }.

Add a triangle to this triangle mesh, by specifying the three coordinates

Implements chrono::ChTriangleMesh.

◆ ArchiveIn()

void chrono::ChTriangleMeshSoup::ArchiveIn ( ChArchiveIn & archive_in)
overridevirtual

Method to allow de-serialization of transient data from archives.

Reimplemented from chrono::ChTriangleMesh.

◆ ArchiveOut()

void chrono::ChTriangleMeshSoup::ArchiveOut ( ChArchiveOut & archive_out)
overridevirtual

Method to allow serialization of transient data to archives.

Reimplemented from chrono::ChTriangleMesh.

◆ Clear()

virtual void chrono::ChTriangleMeshSoup::Clear ( )
inlineoverridevirtual

Clear all data.

Implements chrono::ChTriangleMesh.

◆ Clone()

virtual ChTriangleMeshSoup * chrono::ChTriangleMeshSoup::Clone ( ) const
inlineoverridevirtual

"Virtual" copy constructor (covariant return type).

Implements chrono::ChGeometry.

◆ CreateFromWavefrontFile()

std::shared_ptr< ChTriangleMeshSoup > chrono::ChTriangleMeshSoup::CreateFromWavefrontFile ( const std::string & filename)
static

Create and return a ChTriangleMeshConnected from a Wavefront OBJ file.

If an error occurrs during loading, an empty shared pointer is returned.

◆ GetNumTriangles()

virtual unsigned int chrono::ChTriangleMeshSoup::GetNumTriangles ( ) const
inlineoverridevirtual

Get the number of triangles already added to this mesh.

Implements chrono::ChTriangleMesh.

◆ GetTriangle()

virtual ChTriangle chrono::ChTriangleMeshSoup::GetTriangle ( unsigned int index) const
inlineoverridevirtual

Access the n-th triangle in mesh.

Implements chrono::ChTriangleMesh.

◆ GetType()

virtual Type chrono::ChTriangleMeshSoup::GetType ( ) const
inlineoverridevirtual

Get the class type as an enum.

Reimplemented from chrono::ChTriangleMesh.

◆ Transform()

void chrono::ChTriangleMeshSoup::Transform ( const ChVector3d displ,
const ChMatrix33<> rotscale )
overridevirtual

Transform all vertexes, by displacing and rotating (rotation via matrix, so also scaling if needed)

Implements chrono::ChTriangleMesh.


The documentation for this class was generated from the following files:
  • C:/M/B/src/chrono-9.0.1/src/chrono/geometry/ChTriangleMeshSoup.h
  • C:/M/B/src/chrono-9.0.1/src/chrono/geometry/ChTriangleMeshSoup.cpp