Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -18,125 +18,130 @@ All rights reserved.
|
||||
#include "vhacdCircularList.h"
|
||||
#include "vhacdSArray.h"
|
||||
#include "vhacdVector.h"
|
||||
namespace VHACD {
|
||||
namespace VHACD
|
||||
{
|
||||
class TMMTriangle;
|
||||
class TMMEdge;
|
||||
class TMMesh;
|
||||
class ICHull;
|
||||
|
||||
//! Vertex data structure used in a triangular manifold mesh (TMM).
|
||||
class TMMVertex {
|
||||
class TMMVertex
|
||||
{
|
||||
public:
|
||||
void Initialize();
|
||||
TMMVertex(void);
|
||||
~TMMVertex(void);
|
||||
void Initialize();
|
||||
TMMVertex(void);
|
||||
~TMMVertex(void);
|
||||
|
||||
private:
|
||||
Vec3<double> m_pos;
|
||||
int m_name;
|
||||
size_t m_id;
|
||||
CircularListElement<TMMEdge>* m_duplicate; // pointer to incident cone edge (or NULL)
|
||||
bool m_onHull;
|
||||
bool m_tag;
|
||||
TMMVertex(const TMMVertex& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMesh;
|
||||
friend class TMMTriangle;
|
||||
friend class TMMEdge;
|
||||
Vec3<double> m_pos;
|
||||
int m_name;
|
||||
size_t m_id;
|
||||
CircularListElement<TMMEdge>* m_duplicate; // pointer to incident cone edge (or NULL)
|
||||
bool m_onHull;
|
||||
bool m_tag;
|
||||
TMMVertex(const TMMVertex& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMesh;
|
||||
friend class TMMTriangle;
|
||||
friend class TMMEdge;
|
||||
};
|
||||
|
||||
//! Edge data structure used in a triangular manifold mesh (TMM).
|
||||
class TMMEdge {
|
||||
class TMMEdge
|
||||
{
|
||||
public:
|
||||
void Initialize();
|
||||
TMMEdge(void);
|
||||
~TMMEdge(void);
|
||||
void Initialize();
|
||||
TMMEdge(void);
|
||||
~TMMEdge(void);
|
||||
|
||||
private:
|
||||
size_t m_id;
|
||||
CircularListElement<TMMTriangle>* m_triangles[2];
|
||||
CircularListElement<TMMVertex>* m_vertices[2];
|
||||
CircularListElement<TMMTriangle>* m_newFace;
|
||||
TMMEdge(const TMMEdge& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMTriangle;
|
||||
friend class TMMVertex;
|
||||
friend class TMMesh;
|
||||
size_t m_id;
|
||||
CircularListElement<TMMTriangle>* m_triangles[2];
|
||||
CircularListElement<TMMVertex>* m_vertices[2];
|
||||
CircularListElement<TMMTriangle>* m_newFace;
|
||||
TMMEdge(const TMMEdge& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMTriangle;
|
||||
friend class TMMVertex;
|
||||
friend class TMMesh;
|
||||
};
|
||||
|
||||
//! Triangle data structure used in a triangular manifold mesh (TMM).
|
||||
class TMMTriangle {
|
||||
class TMMTriangle
|
||||
{
|
||||
public:
|
||||
void Initialize();
|
||||
TMMTriangle(void);
|
||||
~TMMTriangle(void);
|
||||
void Initialize();
|
||||
TMMTriangle(void);
|
||||
~TMMTriangle(void);
|
||||
|
||||
private:
|
||||
size_t m_id;
|
||||
CircularListElement<TMMEdge>* m_edges[3];
|
||||
CircularListElement<TMMVertex>* m_vertices[3];
|
||||
bool m_visible;
|
||||
size_t m_id;
|
||||
CircularListElement<TMMEdge>* m_edges[3];
|
||||
CircularListElement<TMMVertex>* m_vertices[3];
|
||||
bool m_visible;
|
||||
|
||||
TMMTriangle(const TMMTriangle& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMesh;
|
||||
friend class TMMVertex;
|
||||
friend class TMMEdge;
|
||||
TMMTriangle(const TMMTriangle& rhs);
|
||||
friend class ICHull;
|
||||
friend class TMMesh;
|
||||
friend class TMMVertex;
|
||||
friend class TMMEdge;
|
||||
};
|
||||
//! triangular manifold mesh data structure.
|
||||
class TMMesh {
|
||||
class TMMesh
|
||||
{
|
||||
public:
|
||||
//! Returns the number of vertices>
|
||||
inline size_t GetNVertices() const { return m_vertices.GetSize(); }
|
||||
//! Returns the number of edges
|
||||
inline size_t GetNEdges() const { return m_edges.GetSize(); }
|
||||
//! Returns the number of triangles
|
||||
inline size_t GetNTriangles() const { return m_triangles.GetSize(); }
|
||||
//! Returns the vertices circular list
|
||||
inline const CircularList<TMMVertex>& GetVertices() const { return m_vertices; }
|
||||
//! Returns the edges circular list
|
||||
inline const CircularList<TMMEdge>& GetEdges() const { return m_edges; }
|
||||
//! Returns the triangles circular list
|
||||
inline const CircularList<TMMTriangle>& GetTriangles() const { return m_triangles; }
|
||||
//! Returns the vertices circular list
|
||||
inline CircularList<TMMVertex>& GetVertices() { return m_vertices; }
|
||||
//! Returns the edges circular list
|
||||
inline CircularList<TMMEdge>& GetEdges() { return m_edges; }
|
||||
//! Returns the triangles circular list
|
||||
inline CircularList<TMMTriangle>& GetTriangles() { return m_triangles; }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMVertex>* AddVertex() { return m_vertices.Add(); }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMEdge>* AddEdge() { return m_edges.Add(); }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMTriangle>* AddTriangle() { return m_triangles.Add(); }
|
||||
//! Print mesh information
|
||||
void Print();
|
||||
//!
|
||||
void GetIFS(Vec3<double>* const points, Vec3<int>* const triangles);
|
||||
//!
|
||||
void Clear();
|
||||
//!
|
||||
void Copy(TMMesh& mesh);
|
||||
//!
|
||||
bool CheckConsistancy();
|
||||
//!
|
||||
bool Normalize();
|
||||
//!
|
||||
bool Denormalize();
|
||||
//! Constructor
|
||||
TMMesh();
|
||||
//! Destructor
|
||||
virtual ~TMMesh(void);
|
||||
//! Returns the number of vertices>
|
||||
inline size_t GetNVertices() const { return m_vertices.GetSize(); }
|
||||
//! Returns the number of edges
|
||||
inline size_t GetNEdges() const { return m_edges.GetSize(); }
|
||||
//! Returns the number of triangles
|
||||
inline size_t GetNTriangles() const { return m_triangles.GetSize(); }
|
||||
//! Returns the vertices circular list
|
||||
inline const CircularList<TMMVertex>& GetVertices() const { return m_vertices; }
|
||||
//! Returns the edges circular list
|
||||
inline const CircularList<TMMEdge>& GetEdges() const { return m_edges; }
|
||||
//! Returns the triangles circular list
|
||||
inline const CircularList<TMMTriangle>& GetTriangles() const { return m_triangles; }
|
||||
//! Returns the vertices circular list
|
||||
inline CircularList<TMMVertex>& GetVertices() { return m_vertices; }
|
||||
//! Returns the edges circular list
|
||||
inline CircularList<TMMEdge>& GetEdges() { return m_edges; }
|
||||
//! Returns the triangles circular list
|
||||
inline CircularList<TMMTriangle>& GetTriangles() { return m_triangles; }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMVertex>* AddVertex() { return m_vertices.Add(); }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMEdge>* AddEdge() { return m_edges.Add(); }
|
||||
//! Add vertex to the mesh
|
||||
CircularListElement<TMMTriangle>* AddTriangle() { return m_triangles.Add(); }
|
||||
//! Print mesh information
|
||||
void Print();
|
||||
//!
|
||||
void GetIFS(Vec3<double>* const points, Vec3<int>* const triangles);
|
||||
//!
|
||||
void Clear();
|
||||
//!
|
||||
void Copy(TMMesh& mesh);
|
||||
//!
|
||||
bool CheckConsistancy();
|
||||
//!
|
||||
bool Normalize();
|
||||
//!
|
||||
bool Denormalize();
|
||||
//! Constructor
|
||||
TMMesh();
|
||||
//! Destructor
|
||||
virtual ~TMMesh(void);
|
||||
|
||||
private:
|
||||
CircularList<TMMVertex> m_vertices;
|
||||
CircularList<TMMEdge> m_edges;
|
||||
CircularList<TMMTriangle> m_triangles;
|
||||
CircularList<TMMVertex> m_vertices;
|
||||
CircularList<TMMEdge> m_edges;
|
||||
CircularList<TMMTriangle> m_triangles;
|
||||
|
||||
// not defined
|
||||
TMMesh(const TMMesh& rhs);
|
||||
friend class ICHull;
|
||||
// not defined
|
||||
TMMesh(const TMMesh& rhs);
|
||||
friend class ICHull;
|
||||
};
|
||||
}
|
||||
#endif // VHACD_MANIFOLD_MESH_H
|
||||
} // namespace VHACD
|
||||
#endif // VHACD_MANIFOLD_MESH_H
|
||||
Reference in New Issue
Block a user