$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

plb::TriangleSet< T > Class Template Reference

#include <triangleSet.h>

Collaboration diagram for plb::TriangleSet< T >:

List of all members.

Public Types

typedef Array< Array< T, 3 >, 3 > Triangle

Public Member Functions

 TriangleSet (Precision precision_=FLT)
 TriangleSet (std::vector< Triangle > const &triangles_, Precision precision_=FLT)
 TriangleSet (std::string fname, Precision precision_=FLT, SurfaceGeometryFileFormat fformat=STL)
std::vector< Triangle > const & getTriangles () const
Precision getPrecision () const
void setPrecision (Precision precision_)
void translate (Array< T, 3 > const &vector)
 Translate the triangle set surface mesh.
void scale (T alpha)
 Scale the triangle set surface mesh.
void rotate (T phi, T theta, T psi)
void rotateAtOrigin (Array< T, 3 > const &normedAxis, T theta)
void merge (std::vector< TriangleSet< T > > meshes)
void reverseOrientation ()
 A very simple orientation reversing function.
void writeAsciiSTL (std::string fname) const
 Export the mesh as an ASCII STL file.
void writeBinarySTL (std::string fname) const
 Export the mesh as an binary STL file.
int cutWithPlane (Plane< T > const &plane, TriangleSet< T > &newTriangleSet) const
int cutWithPlane (Plane< T > const &plane, Cuboid< T > const &cuboid, TriangleSet< T > &newTriangleSet) const
getMinEdgeLength () const
getMaxEdgeLength () const
Cuboid< T > getBoundingCuboid () const

template<typename T>
class plb::TriangleSet< T >


Member Typedef Documentation

template<typename T>
typedef Array<Array<T,3>,3> plb::TriangleSet< T >::Triangle

Constructor & Destructor Documentation

template<typename T >
plb::TriangleSet< T >::TriangleSet ( Precision  precision_ = FLT  )  [inline]

References plb::DBL, plb::FLT, plb::LDBL, and PLB_ASSERT.

template<typename T >
plb::TriangleSet< T >::TriangleSet ( std::vector< Triangle > const &  triangles_,
Precision  precision_ = FLT 
) [inline]
template<typename T >
plb::TriangleSet< T >::TriangleSet ( std::string  fname,
Precision  precision_ = FLT,
SurfaceGeometryFileFormat  fformat = STL 
) [inline]

Member Function Documentation

template<typename T>
int plb::TriangleSet< T >::cutWithPlane ( Plane< T > const &  plane,
Cuboid< T > const &  cuboid,
TriangleSet< T > &  newTriangleSet 
) const [inline]

Cut the current triangle set mesh by a plane "plane" which is defined by a point and a normal and a cuboid "cuboid" which is defined by a lower left corner and a right upper corner. This cutting operation will cut off all triangles, or parts of triangles that are fully contained in the cuboid and are positioned in the half-space that the normal of the cutting plane points into. Caution is needed, because this function does not use the cuboid to cut, but only to select parts of the original triangle set, to be then cut by the plane. Obviously, at least a part of the cutting plane must be contained in the cuboid, for the cutting to make any sense. If not used wisely, this function can lead to broken STL files. The function returns 1 if the cut was successful, 0 if there was no intersection between the original triangle set the plane and the cuboid provided, and -1 if an error occured.

template<typename T>
int plb::TriangleSet< T >::cutWithPlane ( Plane< T > const &  plane,
TriangleSet< T > &  newTriangleSet 
) const [inline]

Cut the current triangle set mesh by a plane "plane" which is defined by a point and a normal. This cutting operation will produce a new triangle set "newTriangleSet" which is the one that belongs to the half-space that the normal of the cutting plane points outside of. The function returns 1 if the cut was successful, 0 if there was no intersection between the original triangle set and the plane provided, and -1 if an error occured.

template<typename T>
Cuboid<T> plb::TriangleSet< T >::getBoundingCuboid (  )  const [inline]
template<typename T>
T plb::TriangleSet< T >::getMaxEdgeLength (  )  const [inline]
template<typename T>
T plb::TriangleSet< T >::getMinEdgeLength (  )  const [inline]
template<typename T>
Precision plb::TriangleSet< T >::getPrecision (  )  const [inline]

Referenced by plb::patchTubes().

template<typename T >
std::vector< typename TriangleSet< T >::Triangle > const & plb::TriangleSet< T >::getTriangles (  )  const [inline]

Referenced by plb::patchTubes().

template<typename T>
void plb::TriangleSet< T >::merge ( std::vector< TriangleSet< T > >  meshes  )  [inline]

Erase the current triangle set surface mesh, and merge into it the new meshes. This function currently does not check for duplicate triangles in the new meshes, and does not handle cases when the resulting merged surface mesh is non-manifold. It is in the user's jurisdiction to make sure that the resulting mesh is well defined. Practically, this can be achieved if the new triangle set meshes given as arguments are mutually disjoint.

template<typename T >
void plb::TriangleSet< T >::reverseOrientation (  )  [inline]

A very simple orientation reversing function.

template<typename T>
void plb::TriangleSet< T >::rotate ( phi,
theta,
psi 
) [inline]

Rotate the triangle set surface mesh. The arguments of this function are the Euler angles in radians. The so-called "x-convention" is used, in which the rotation is given by the three angles (phi, theta, psi), where: 1.] The first rotation is by an angle phi about the z-axis, 2.] The second rotation is by an angle theta in [0, pi] about the new x-axis, 3.] The third rotation is by an angle psi about the new z-axis.

template<typename T>
void plb::TriangleSet< T >::rotateAtOrigin ( Array< T, 3 > const &  normedAxis,
theta 
) [inline]

Referenced by plb::constructCylinder().

template<typename T>
void plb::TriangleSet< T >::scale ( alpha  )  [inline]

Scale the triangle set surface mesh.

Referenced by plb::constructSphere().

template<typename T >
void plb::TriangleSet< T >::setPrecision ( Precision  precision_  )  [inline]
template<typename T>
void plb::TriangleSet< T >::translate ( Array< T, 3 > const &  vector  )  [inline]

Translate the triangle set surface mesh.

Referenced by plb::constructCylinder(), and plb::constructSphere().

template<typename T >
void plb::TriangleSet< T >::writeAsciiSTL ( std::string  fname  )  const [inline]

Export the mesh as an ASCII STL file.

template<typename T >
void plb::TriangleSet< T >::writeBinarySTL ( std::string  fname  )  const [inline]

Export the mesh as an binary STL file.


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