eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::Easy3D::EMesh Class Reference

Represents a 3D meshed object. More...

#include <eVision/Easy3D/EMesh.h>

Collaboration diagram for eVision::Easy3D::EMesh:

Public Member Functions

 EMesh ()
 Creates an EMesh object.
 EMesh (const eVision::Easy3D::EPointCloud &pointCloud, const std::vector< int32_t > &triangleIndexes)
 Creates an EMesh object.
 EMesh (const eVision::Easy3D::EPointCloud &pointCloud, const std::vector< int32_t > &triangleIndexes, const std::vector< eVision::Easy3D::E3DPoint > &normals)
 Creates an EMesh object.
 EMesh (const eVision::Easy3D::EMesh &other)
 Creates an EMesh object.
virtual ~EMesh () throw ()
eVision::Easy3D::EMesh & operator= (const eVision::Easy3D::EMesh &other)
 Assignment operator.
const eVision::Easy3D::EPointCloud & GetPointCloud () const
 Returns the point cloud of the EMesh object.
const void * GetTriangleIndexes () const
 Returns a pointer to the index array (an array of 32 bit signed integers) representing the list of triangles. Indexes are referring to the array of E3DPoint.
const void * GetNormals () const
 Returns a pointer to the array (of E3DPoint) representing the list of normals. If the EMesh object has no triangle mesh data, this method returns NULL.
int32_t GetTriangleCount () const
 Returns the number of triangles.
void Clear ()
 Empties the Mesh.
void Load (const std::string &path)
 Loads the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Loads the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Saves the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Saves the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for writing.
void SaveSTL (const std::string &path, bool binary) const
 Saves the triangle mesh to an STL file.
void SaveSTL (const std::string &path) const
 Saves the triangle mesh to an STL file.
void LoadSTL (const std::string &path)
 Loads a triangle mesh from an STL file.
eVision::Easy3D::E3DPlane ComputePlaneBehind (eVision::Easy3D::E3DPoint normal, float margin) const
 Returns the E3DPlane with given normal on which the EMesh lays. This is useful when projecting an EMesh on an EZMap.
eVision::Easy3D::E3DPlane ComputePlaneBehind (eVision::Easy3D::E3DPoint normal) const
 Returns the E3DPlane with given normal on which the EMesh lays. This is useful when projecting an EMesh on an EZMap.
 EMesh (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a 3D meshed object.

License(s): Easy3D

Constructor & Destructor Documentation

◆ EMesh() [1/5]

eVision::Easy3D::EMesh::EMesh ( )

Creates an EMesh object.

◆ EMesh() [2/5]

eVision::Easy3D::EMesh::EMesh ( const eVision::Easy3D::EPointCloud & pointCloud,
const std::vector< int32_t > & triangleIndexes )

Creates an EMesh object.

Parameters
pointCloudA point cloud
triangleIndexesThe triangle mesh is a list of indexes, referring to the array contained in "pointCloud".

A triangle is defined by 3 indexes (T1a T1b T1c T2a T2b T2c T3a ....). Index values must be in [0, N[ with N the number of points in the EPointCloud. The triangle index array size is a multiple of 3.

◆ EMesh() [3/5]

eVision::Easy3D::EMesh::EMesh ( const eVision::Easy3D::EPointCloud & pointCloud,
const std::vector< int32_t > & triangleIndexes,
const std::vector< eVision::Easy3D::E3DPoint > & normals )

Creates an EMesh object.

Parameters
pointCloudA point cloud
triangleIndexesThe triangle mesh is a list of indexes, referring to the array contained in "pointCloud".

A triangle is defined by 3 indexes (T1a T1b T1c T2a T2b T2c T3a ....). Index values must be in [0, N[ with N the number of points in the EPointCloud. The triangle index array size is a multiple of 3.

Parameters
normalsNormals of each of the faces of the mesh. Must be the third of the size of "triangleIndexes".

If not provided, they will be computed automatically from the faces by assuming the vertices are listed in counter-clock-wise order from outside (which is the convention used by the stl file format).

◆ EMesh() [4/5]

eVision::Easy3D::EMesh::EMesh ( const eVision::Easy3D::EMesh & other)

Creates an EMesh object.

Parameters
otherAnother EMesh.

◆ ~EMesh()

eVision::Easy3D::EMesh::~EMesh ( )
throw ( )
virtual

◆ EMesh() [5/5]

eVision::Easy3D::EMesh::EMesh ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ Clear()

void eVision::Easy3D::EMesh::Clear ( )

Empties the Mesh.

◆ ComputePlaneBehind() [1/2]

eVision::Easy3D::E3DPlane eVision::Easy3D::EMesh::ComputePlaneBehind ( eVision::Easy3D::E3DPoint normal) const

Returns the E3DPlane with given normal on which the EMesh lays. This is useful when projecting an EMesh on an EZMap.

Parameters
normalThe normal of the plane.

◆ ComputePlaneBehind() [2/2]

eVision::Easy3D::E3DPlane eVision::Easy3D::EMesh::ComputePlaneBehind ( eVision::Easy3D::E3DPoint normal,
float margin ) const

Returns the E3DPlane with given normal on which the EMesh lays. This is useful when projecting an EMesh on an EZMap.

Parameters
normalThe normal of the plane.
marginLet P be the plane, A point of the EMesh closest to P and B the of the EMesh furthest to B. margin = dist(P, A) / dist(P, B). Must be positive. Default: 0.02.

◆ GetNormals()

const void * eVision::Easy3D::EMesh::GetNormals ( ) const

Returns a pointer to the array (of E3DPoint) representing the list of normals. If the EMesh object has no triangle mesh data, this method returns NULL.

◆ GetPointCloud()

const eVision::Easy3D::EPointCloud & eVision::Easy3D::EMesh::GetPointCloud ( ) const

Returns the point cloud of the EMesh object.

◆ GetTriangleCount()

int32_t eVision::Easy3D::EMesh::GetTriangleCount ( ) const

Returns the number of triangles.

If the EMesh object has no triangle mesh data, the method returns 0.

◆ GetTriangleIndexes()

const void * eVision::Easy3D::EMesh::GetTriangleIndexes ( ) const

Returns a pointer to the index array (an array of 32 bit signed integers) representing the list of triangles. Indexes are referring to the array of E3DPoint.

A triangle is defined by 3 indexes (T1a T1b T1c T2a T2b T2c T3a ....). The triangle index array size is a multiple of 3.

Index values must be in [0, N[ where N is the number of points in the point cloud. If the EMesh object has no triangle mesh data, this method returns NULL.

◆ Load() [1/2]

void eVision::Easy3D::EMesh::Load ( const std::string & path)

Loads the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::Easy3D::EMesh::Load ( eVision::ESerializer * serializer)

Loads the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ LoadSTL()

void eVision::Easy3D::EMesh::LoadSTL ( const std::string & path)

Loads a triangle mesh from an STL file.

Parameters
pathThe path to the STL file.

◆ operator=()

eVision::Easy3D::EMesh & eVision::Easy3D::EMesh::operator= ( const eVision::Easy3D::EMesh & other)

Assignment operator.

Parameters
otherThe other EMesh that we will copy into this one.

◆ Save() [1/2]

void eVision::Easy3D::EMesh::Save ( const std::string & path)

Saves the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::Easy3D::EMesh::Save ( eVision::ESerializer * serializer)

Saves the EMesh. Supported formats are eVision proprietary and STL. The given ESerializer must have been created for writing.

Parameters
serializerThe ESerializer object that is written to.

◆ SaveSTL() [1/2]

void eVision::Easy3D::EMesh::SaveSTL ( const std::string & path) const

Saves the triangle mesh to an STL file.

Parameters
pathThe path to the STL file.

◆ SaveSTL() [2/2]

void eVision::Easy3D::EMesh::SaveSTL ( const std::string & path,
bool binary ) const

Saves the triangle mesh to an STL file.

Parameters
pathThe path to the STL file.
binaryOptional parameter, activates the binary file format (default is true).

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::Easy3D::EMesh::wrappedClass_