3-D triangle mesh geometry. More...
#include <Core/Geometry/TriangleMesh3.hpp>
Classes | |
| class | Builder |
| Front-end to create TriangleMesh3 objects step by step. More... | |
Public Types | |
| using | Vector2DArray = Array1< Vector2D > |
| using | Vector3DArray = Array1< Vector3D > |
| using | IndexArray = Array1< Vector3UZ > |
| using | PointArray = Vector3DArray |
| using | NormalArray = Vector3DArray |
| using | UVArray = Vector2DArray |
Public Member Functions | |
| TriangleMesh3 (const Transform3 &_transform=Transform3{}, bool _isNormalFlipped=false) | |
| Constructs an empty triangle mesh. | |
| TriangleMesh3 (PointArray points, NormalArray normals, UVArray uvs, IndexArray pointIndices, IndexArray normalIndices, IndexArray uvIndices, const Transform3 &_transform=Transform3{}, bool _isNormalFlipped=false) | |
| Constructs mesh with points, normals, uvs, and their indices. | |
| TriangleMesh3 (const TriangleMesh3 &other) | |
| Copy constructor. | |
| TriangleMesh3 (TriangleMesh3 &&other) noexcept=delete | |
| Deleted move constructor. | |
| ~TriangleMesh3 () override=default | |
| TriangleMesh3 & | operator= (const TriangleMesh3 &other) |
| Deleted copy assignment operator. | |
| TriangleMesh3 & | operator= (TriangleMesh3 &&other) noexcept=delete |
| Deleted move assignment operator. | |
| void | UpdateQueryEngine () override |
| Updates internal spatial query engine. | |
| void | UpdateQueryEngine () const |
| Updates internal spatial query engine. | |
| void | Clear () |
| Clears all content. | |
| void | Set (const TriangleMesh3 &other) |
Copies the contents from other mesh. | |
| void | Swap (TriangleMesh3 &other) |
Swaps the contents with other mesh. | |
| double | Area () const |
| Returns area of this mesh. | |
| double | Volume () const |
| Returns volume of this mesh. | |
| const Vector3D & | Point (size_t i) const |
| Returns constant reference to the i-th point. | |
| Vector3D & | Point (size_t i) |
| Returns reference to the i-th point. | |
| const Vector3D & | Normal (size_t i) const |
| Returns constant reference to the i-th normal. | |
| Vector3D & | Normal (size_t i) |
| Returns reference to the i-th normal. | |
| const Vector2D & | UV (size_t i) const |
| Returns constant reference to the i-th UV coordinates. | |
| Vector2D & | UV (size_t i) |
| Returns reference to the i-th UV coordinates. | |
| const Vector3UZ & | PointIndex (size_t i) const |
| Returns constant reference to the point indices of i-th triangle. | |
| Vector3UZ & | PointIndex (size_t i) |
| Returns reference to the point indices of i-th triangle. | |
| const Vector3UZ & | NormalIndex (size_t i) const |
| Returns constant reference to the normal indices of i-th triangle. | |
| Vector3UZ & | NormalIndex (size_t i) |
| Returns reference to the normal indices of i-th triangle. | |
| const Vector3UZ & | UVIndex (size_t i) const |
| Returns constant reference to the UV indices of i-th triangle. | |
| Vector3UZ & | UVIndex (size_t i) |
| Returns reference to the UV indices of i-th triangle. | |
| Triangle3 | Triangle (size_t i) const |
| Returns i-th triangle. | |
| size_t | NumberOfPoints () const |
| Returns number of points. | |
| size_t | NumberOfNormals () const |
| Returns number of normals. | |
| size_t | NumberOfUVs () const |
| Returns number of UV coordinates. | |
| size_t | NumberOfTriangles () const |
| Returns number of triangles. | |
| bool | HasNormals () const |
| Returns true if the mesh has normals. | |
| bool | HasUVs () const |
| Returns true if the mesh has UV coordinates. | |
| void | AddPoint (const Vector3D &pt) |
| Adds a point. | |
| void | AddNormal (const Vector3D &n) |
| Adds a normal. | |
| void | AddUV (const Vector2D &t) |
| Adds a UV. | |
| void | AddPointTriangle (const Vector3UZ &newPointIndices) |
| Adds a triangle with point. | |
| void | AddNormalTriangle (const Vector3UZ &newNormalIndices) |
| Adds a triangle with normal. | |
| void | AddUVTriangle (const Vector3UZ &newUVIndices) |
| Adds a triangle with UV. | |
| void | AddTriangle (const Triangle3 &tri) |
| Add a triangle. | |
| void | SetFaceNormal () |
| Sets entire normals to the face normals. | |
| void | SetAngleWeightedVertexNormal () |
| Sets angle weighted vertex normal. | |
| void | Scale (double factor) |
| Scales the mesh by given factor. | |
| void | Translate (const Vector3D &t) |
| Translates the mesh. | |
| void | Rotate (const QuaternionD &q) |
| Rotates the mesh. | |
| void | WriteObj (std::ostream *stream) const |
| Writes the mesh in obj format to the output stream. | |
| bool | WriteObj (const std::string &fileName) const |
| Writes the mesh in obj format to the file. | |
| bool | ReadObj (std::istream *stream) |
| Reads the mesh in obj format from the input stream. | |
| bool | ReadObj (const std::string &fileName) |
| Reads the mesh in obj format from the file. | |
Public Member Functions inherited from CubbyFlow::Surface< N > | |
| Surface (const Transform< N > &transform=Transform< N >(), bool isNormalFlipped=false) | |
| Constructs a surface with normal direction. | |
| virtual | ~Surface ()=default |
| Default virtual destructor. | |
| Surface (const Surface &other) | |
| Copy constructor. | |
| Surface (Surface &&other) noexcept | |
| Move constructor. | |
| Surface & | operator= (const Surface &other) |
| Copy assignment operator. | |
| Surface & | operator= (Surface &&other) noexcept |
| Move assignment operator. | |
| Vector< double, N > | ClosestPoint (const Vector< double, N > &otherPoint) const |
| BoundingBox< double, N > | GetBoundingBox () const |
| Returns the bounding box of this surface object. | |
| bool | Intersects (const Ray< double, N > &ray) const |
Returns true if the given ray intersects with this surface object. | |
| double | ClosestDistance (const Vector< double, N > &otherPoint) const |
| SurfaceRayIntersection< N > | ClosestIntersection (const Ray< double, N > &ray) const |
Returns the closest intersection point for given ray. | |
| Vector< double, N > | ClosestNormal (const Vector< double, N > &otherPoint) const |
| virtual bool | IsBounded () const |
| Returns true if bounding box can be defined. | |
| virtual bool | IsValidGeometry () const |
| Returns true if the surface is a valid geometry. | |
| bool | IsInside (const Vector< double, N > &otherPoint) const |
Static Public Member Functions | |
| static Builder | GetBuilder () |
| Returns builder fox TriangleMesh3. | |
Additional Inherited Members | |
Public Attributes inherited from CubbyFlow::Surface< N > | |
| Transform< N > | transform |
| Local-to-world transform. | |
| bool | isNormalFlipped = false |
| Flips normal. | |
Detailed Description
3-D triangle mesh geometry.
This class represents 3-D triangle mesh geometry which extends Surface3 by overriding surface-related queries. The mesh structure stores point, normals, and UV coordinates.
Member Typedef Documentation
◆ IndexArray
◆ NormalArray
◆ PointArray
◆ UVArray
◆ Vector2DArray
◆ Vector3DArray
Constructor & Destructor Documentation
◆ TriangleMesh3() [1/4]
| CubbyFlow::TriangleMesh3::TriangleMesh3 | ( | const Transform3 & | _transform = Transform3{}, |
| bool | _isNormalFlipped = false |
||
| ) |
Constructs an empty triangle mesh.
◆ TriangleMesh3() [2/4]
| CubbyFlow::TriangleMesh3::TriangleMesh3 | ( | PointArray | points, |
| NormalArray | normals, | ||
| UVArray | uvs, | ||
| IndexArray | pointIndices, | ||
| IndexArray | normalIndices, | ||
| IndexArray | uvIndices, | ||
| const Transform3 & | _transform = Transform3{}, |
||
| bool | _isNormalFlipped = false |
||
| ) |
Constructs mesh with points, normals, uvs, and their indices.
◆ TriangleMesh3() [3/4]
| CubbyFlow::TriangleMesh3::TriangleMesh3 | ( | const TriangleMesh3 & | other | ) |
Copy constructor.
◆ TriangleMesh3() [4/4]
|
deletenoexcept |
Deleted move constructor.
◆ ~TriangleMesh3()
|
overridedefault |
Member Function Documentation
◆ AddNormal()
◆ AddNormalTriangle()
Adds a triangle with normal.
◆ AddPoint()
◆ AddPointTriangle()
Adds a triangle with point.
◆ AddTriangle()
◆ AddUV()
◆ AddUVTriangle()
Adds a triangle with UV.
◆ Area()
| double CubbyFlow::TriangleMesh3::Area | ( | ) | const |
Returns area of this mesh.
◆ BoundingBoxLocal()
|
overrideprotectedvirtual |
Returns the bounding box of this surface object in local frame.
Implements CubbyFlow::Surface< N >.
◆ Clear()
| void CubbyFlow::TriangleMesh3::Clear | ( | ) |
Clears all content.
◆ ClosestDistanceLocal()
|
overrideprotected |
◆ ClosestIntersectionLocal()
|
overrideprotected |
◆ ClosestNormalLocal()
|
overrideprotected |
◆ ClosestPointLocal()
|
overrideprotected |
◆ GetBuilder()
Returns builder fox TriangleMesh3.
◆ HasNormals()
| bool CubbyFlow::TriangleMesh3::HasNormals | ( | ) | const |
Returns true if the mesh has normals.
◆ HasUVs()
| bool CubbyFlow::TriangleMesh3::HasUVs | ( | ) | const |
Returns true if the mesh has UV coordinates.
◆ IntersectsLocal()
◆ IsInsideLocal()
◆ Normal() [1/2]
◆ Normal() [2/2]
Returns constant reference to the i-th normal.
◆ NormalIndex() [1/2]
Returns reference to the normal indices of i-th triangle.
◆ NormalIndex() [2/2]
Returns constant reference to the normal indices of i-th triangle.
◆ NumberOfNormals()
| size_t CubbyFlow::TriangleMesh3::NumberOfNormals | ( | ) | const |
Returns number of normals.
◆ NumberOfPoints()
| size_t CubbyFlow::TriangleMesh3::NumberOfPoints | ( | ) | const |
Returns number of points.
◆ NumberOfTriangles()
| size_t CubbyFlow::TriangleMesh3::NumberOfTriangles | ( | ) | const |
Returns number of triangles.
◆ NumberOfUVs()
| size_t CubbyFlow::TriangleMesh3::NumberOfUVs | ( | ) | const |
Returns number of UV coordinates.
◆ operator=() [1/2]
| TriangleMesh3 & CubbyFlow::TriangleMesh3::operator= | ( | const TriangleMesh3 & | other | ) |
Deleted copy assignment operator.
◆ operator=() [2/2]
|
deletenoexcept |
Deleted move assignment operator.
◆ Point() [1/2]
◆ Point() [2/2]
Returns constant reference to the i-th point.
◆ PointIndex() [1/2]
Returns reference to the point indices of i-th triangle.
◆ PointIndex() [2/2]
Returns constant reference to the point indices of i-th triangle.
◆ ReadObj() [1/2]
Reads the mesh in obj format from the file.
◆ ReadObj() [2/2]
| bool CubbyFlow::TriangleMesh3::ReadObj | ( | std::istream * | stream | ) |
Reads the mesh in obj format from the input stream.
◆ Rotate()
| void CubbyFlow::TriangleMesh3::Rotate | ( | const QuaternionD & | q | ) |
Rotates the mesh.
◆ Scale()
◆ Set()
| void CubbyFlow::TriangleMesh3::Set | ( | const TriangleMesh3 & | other | ) |
Copies the contents from other mesh.
◆ SetAngleWeightedVertexNormal()
| void CubbyFlow::TriangleMesh3::SetAngleWeightedVertexNormal | ( | ) |
Sets angle weighted vertex normal.
◆ SetFaceNormal()
| void CubbyFlow::TriangleMesh3::SetFaceNormal | ( | ) |
Sets entire normals to the face normals.
◆ Swap()
| void CubbyFlow::TriangleMesh3::Swap | ( | TriangleMesh3 & | other | ) |
Swaps the contents with other mesh.
◆ Translate()
◆ Triangle()
◆ UpdateQueryEngine() [1/2]
| void CubbyFlow::TriangleMesh3::UpdateQueryEngine | ( | ) | const |
Updates internal spatial query engine.
◆ UpdateQueryEngine() [2/2]
|
overridevirtual |
Updates internal spatial query engine.
Reimplemented from CubbyFlow::Surface< N >.
◆ UV() [1/2]
◆ UV() [2/2]
Returns constant reference to the i-th UV coordinates.
◆ UVIndex() [1/2]
Returns reference to the UV indices of i-th triangle.
◆ UVIndex() [2/2]
Returns constant reference to the UV indices of i-th triangle.
◆ Volume()
| double CubbyFlow::TriangleMesh3::Volume | ( | ) | const |
Returns volume of this mesh.
◆ WriteObj() [1/2]
Writes the mesh in obj format to the file.
◆ WriteObj() [2/2]
| void CubbyFlow::TriangleMesh3::WriteObj | ( | std::ostream * | stream | ) | const |
Writes the mesh in obj format to the output stream.
The documentation for this class was generated from the following file:
- Core/Geometry/TriangleMesh3.hpp
Public Member Functions inherited from
1.9.8