|
@@ -60,10 +60,8 @@ namespace Assimp {
|
|
* @note Although it is called #VertexTriangleAdjacency, the current version does also
|
|
* @note Although it is called #VertexTriangleAdjacency, the current version does also
|
|
* support arbitrary polygons. */
|
|
* support arbitrary polygons. */
|
|
// --------------------------------------------------------------------------------------------
|
|
// --------------------------------------------------------------------------------------------
|
|
-class ASSIMP_API VertexTriangleAdjacency
|
|
|
|
-{
|
|
|
|
|
|
+class ASSIMP_API VertexTriangleAdjacency {
|
|
public:
|
|
public:
|
|
-
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------------
|
|
/** @brief Construction from an existing index buffer
|
|
/** @brief Construction from an existing index buffer
|
|
* @param pcFaces Index buffer
|
|
* @param pcFaces Index buffer
|
|
@@ -77,39 +75,30 @@ public:
|
|
unsigned int iNumVertices = 0,
|
|
unsigned int iNumVertices = 0,
|
|
bool bComputeNumTriangles = true);
|
|
bool bComputeNumTriangles = true);
|
|
|
|
|
|
-
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------------
|
|
/** @brief Destructor */
|
|
/** @brief Destructor */
|
|
~VertexTriangleAdjacency();
|
|
~VertexTriangleAdjacency();
|
|
|
|
|
|
-
|
|
|
|
-public:
|
|
|
|
-
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------------
|
|
/** @brief Get all triangles adjacent to a vertex
|
|
/** @brief Get all triangles adjacent to a vertex
|
|
* @param iVertIndex Index of the vertex
|
|
* @param iVertIndex Index of the vertex
|
|
* @return A pointer to the adjacency list. */
|
|
* @return A pointer to the adjacency list. */
|
|
- unsigned int* GetAdjacentTriangles(unsigned int iVertIndex) const
|
|
|
|
- {
|
|
|
|
- ai_assert(iVertIndex < iNumVertices);
|
|
|
|
|
|
+ unsigned int* GetAdjacentTriangles(unsigned int iVertIndex) const {
|
|
|
|
+ ai_assert(iVertIndex < mNumVertices);
|
|
return &mAdjacencyTable[ mOffsetTable[iVertIndex]];
|
|
return &mAdjacencyTable[ mOffsetTable[iVertIndex]];
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// ----------------------------------------------------------------------------
|
|
/** @brief Get the number of triangles that are referenced by
|
|
/** @brief Get the number of triangles that are referenced by
|
|
* a vertex. This function returns a reference that can be modified
|
|
* a vertex. This function returns a reference that can be modified
|
|
* @param iVertIndex Index of the vertex
|
|
* @param iVertIndex Index of the vertex
|
|
* @return Number of referenced triangles */
|
|
* @return Number of referenced triangles */
|
|
- unsigned int& GetNumTrianglesPtr(unsigned int iVertIndex)
|
|
|
|
- {
|
|
|
|
- ai_assert(iVertIndex < iNumVertices && NULL != mLiveTriangles);
|
|
|
|
|
|
+ unsigned int& GetNumTrianglesPtr(unsigned int iVertIndex) {
|
|
|
|
+ ai_assert( iVertIndex < mNumVertices );
|
|
|
|
+ ai_assert( nullptr != mLiveTriangles );
|
|
return mLiveTriangles[iVertIndex];
|
|
return mLiveTriangles[iVertIndex];
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-public:
|
|
|
|
-
|
|
|
|
//! Offset table
|
|
//! Offset table
|
|
unsigned int* mOffsetTable;
|
|
unsigned int* mOffsetTable;
|
|
|
|
|
|
@@ -120,9 +109,9 @@ public:
|
|
unsigned int* mLiveTriangles;
|
|
unsigned int* mLiveTriangles;
|
|
|
|
|
|
//! Debug: Number of referenced vertices
|
|
//! Debug: Number of referenced vertices
|
|
- unsigned int iNumVertices;
|
|
|
|
-
|
|
|
|
|
|
+ unsigned int mNumVertices;
|
|
};
|
|
};
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+} //! ns Assimp
|
|
|
|
|
|
#endif // !! AI_VTADJACENCY_H_INC
|
|
#endif // !! AI_VTADJACENCY_H_INC
|