Update ADO build pipelines (#130)

Includes code review feedback.
This commit is contained in:
Chuck Walbourn 2023-11-26 12:59:08 -08:00 committed by GitHub
parent f1946b4cf7
commit 25d3dde4af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 248 additions and 193 deletions

View File

@ -395,7 +395,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endforeach()
endif()
set(WarningsEXE "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd4061" "/wd4062" "/wd5219")
set(WarningsEXE "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd4061" "/wd4062" "/wd5219")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
list(APPEND WarningsEXE "/wd5262" "/wd5264")
target_compile_options(${PROJECT_NAME} PRIVATE "/wd5262")

View File

@ -21,7 +21,7 @@ void CApproximateOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
TypeEdgeWindowsHeap::item_type* pItem = m_EdgeWindowsHeap.cutTop();
uint32_t dwIdxSelf = FLAG_INVALIDDWORD;
for (uint32_t i = 0; i < pItem->m_data.pEdge->WindowsList.size(); ++i)
for (size_t i = 0; i < pItem->m_data.pEdge->WindowsList.size(); ++i)
{
if (!pItem->m_data.pEdge->WindowsList[i].pHeapItem)
{
@ -31,7 +31,7 @@ void CApproximateOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
if (pItem->m_data.pEdge->WindowsList[i].pHeapItem == pItem)
{
// here we get a byproduct, because we actually need the idx of the popped off window itself
dwIdxSelf = i;
dwIdxSelf = static_cast<uint32_t>(i);
// when searching for a window adjacent to the popped off (from the heap) window, skip the window itself on the edge
continue;
@ -299,11 +299,10 @@ void CApproximateOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
// the idx of the popped off window is not yet set, so search for it here
// we only need to search from i + 1 (rather than from 0), because the previous ones have already been searched
for (uint32_t t = i + 1; t < pItem->m_data.pEdge->WindowsList.size(); ++t)
for (size_t t = (i + 1); t < pItem->m_data.pEdge->WindowsList.size(); ++t)
if (pItem->m_data.pEdge->WindowsList[t].pHeapItem == pItem)
{
dwIdxSelf = t;
dwIdxSelf = static_cast<uint32_t>(t);
break;
}
}

View File

@ -43,7 +43,7 @@ void CExactOneToAll::SetSrcVertexIdx(const uint32_t dwSrcVertexIdx)
m_VertexList[i].bShadowBoundary = false;
}
for (uint32_t i = 0; i < m_EdgeList.size(); ++i)
for (size_t i = 0; i < m_EdgeList.size(); ++i)
{
Edge& thisEdge = m_EdgeList[i];
@ -60,7 +60,7 @@ void CExactOneToAll::SetSrcVertexIdx(const uint32_t dwSrcVertexIdx)
EdgeWindow tmpEdgeWindow;
// generate a window covering the whole edge as one of the initial windows
tmpEdgeWindow.SetEdgeIdx(m_EdgeList, i);
tmpEdgeWindow.SetEdgeIdx(m_EdgeList, static_cast<uint32_t>(i));
tmpEdgeWindow.dPseuSrcToSrcDistance = 0;
tmpEdgeWindow.b0 = 0;
tmpEdgeWindow.b1 = tmpEdgeWindow.pEdge->dEdgeLength;
@ -84,8 +84,7 @@ void CExactOneToAll::SetSrcVertexIdx(const uint32_t dwSrcVertexIdx)
void CExactOneToAll::AddWindowToHeapAndEdge(const EdgeWindow& WindowToAdd)
{
// add the new window to heap and the edge
TypeEdgeWindowsHeap::item_type* pItem =
new TypeEdgeWindowsHeap::item_type(std::min(WindowToAdd.d0, WindowToAdd.d1) + WindowToAdd.dPseuSrcToSrcDistance, WindowToAdd);
auto pItem = new TypeEdgeWindowsHeap::item_type(std::min(WindowToAdd.d0, WindowToAdd.d1) + WindowToAdd.dPseuSrcToSrcDistance, WindowToAdd);
m_EdgeWindowsHeap.insert(pItem);
WindowToAdd.pEdge->WindowsList.push_back(Edge::WindowListElement(pItem, WindowToAdd));
@ -111,7 +110,7 @@ void CExactOneToAll::AddWindowToHeapAndEdge(const EdgeWindow& WindowToAdd)
// pop off one window from the heap and unreference the corresponding one on the edge
void CExactOneToAll::CutHeapTopData(EdgeWindow& EdgeWindowOut)
{
TypeEdgeWindowsHeap::item_type* pItem = m_EdgeWindowsHeap.cutTop();
auto pItem = m_EdgeWindowsHeap.cutTop();
for (size_t i = 0; i < pItem->m_data.pEdge->WindowsList.size(); ++i)
if (pItem->m_data.pEdge->WindowsList[i].pHeapItem == pItem)
@ -598,7 +597,7 @@ void CExactOneToAll::InternalRun()
}
}
void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
void CExactOneToAll::ProcessNewWindow(_In_ EdgeWindow* pNewEdgeWindow)
{
std::vector<EdgeWindow> NewWindowsList;
NewWindowsList.push_back(*pNewEdgeWindow);
@ -617,14 +616,12 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
for (i = 0; i < pNewEdgeWindow->pEdge->WindowsList.size(); ++i)
{
TypeEdgeWindowsHeap::item_type* pExistingWindowItem;
bExistingWindowChanged = false;
bNewWindowChanged = false;
bExistingWindowNotAvailable = false;
// get a copy of current window on edge
pExistingWindowItem =
auto pExistingWindowItem =
new TypeEdgeWindowsHeap::item_type(
std::min(pNewEdgeWindow->pEdge->WindowsList[i].theWindow.d0, pNewEdgeWindow->pEdge->WindowsList[i].theWindow.d1) + pNewEdgeWindow->pEdge->WindowsList[i].theWindow.dPseuSrcToSrcDistance,
pNewEdgeWindow->pEdge->WindowsList[i].theWindow
@ -710,10 +707,9 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
}
}
if (WindowToBeInserted.b1 - WindowToBeInserted.b0 > 0)
if (WindowToBeInserted.pMarkFromEdgeVertex != nullptr && WindowToBeInserted.pEdge != nullptr && (WindowToBeInserted.b1 - WindowToBeInserted.b0 > 0))
{
TypeEdgeWindowsHeap::item_type* pNewWindowItem =
new TypeEdgeWindowsHeap::item_type(std::min(WindowToBeInserted.d0, WindowToBeInserted.d1) + WindowToBeInserted.dPseuSrcToSrcDistance, WindowToBeInserted);
auto pNewWindowItem = new TypeEdgeWindowsHeap::item_type(std::min(WindowToBeInserted.d0, WindowToBeInserted.d1) + WindowToBeInserted.dPseuSrcToSrcDistance, WindowToBeInserted);
m_EdgeWindowsHeap.insert(pNewWindowItem);
@ -731,7 +727,7 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
}
Vertex* pAnotherPt = WindowToBeInserted.pEdge->GetAnotherVertex(WindowToBeInserted.dwMarkFromEdgeVertexIdx);
if (WindowToBeInserted.b1 > (WindowToBeInserted.pEdge->dEdgeLength - 0.01))
if (pAnotherPt != nullptr && (WindowToBeInserted.b1 > (WindowToBeInserted.pEdge->dEdgeLength - 0.01)))
{
if ((WindowToBeInserted.d1 + WindowToBeInserted.dPseuSrcToSrcDistance) < pAnotherPt->dGeoDistanceToSrc)
{
@ -746,15 +742,14 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
// add it to the edge and heap
if (!bNewWindowNotAvailable/*pNewEdgeWindow->b0 < pNewEdgeWindow->b1*/)
{
TypeEdgeWindowsHeap::item_type* pNewWindowItem =
new TypeEdgeWindowsHeap::item_type(std::min(pNewEdgeWindow->d0, pNewEdgeWindow->d1) + pNewEdgeWindow->dPseuSrcToSrcDistance, *pNewEdgeWindow);
auto pNewWindowItem = new TypeEdgeWindowsHeap::item_type(std::min(pNewEdgeWindow->d0, pNewEdgeWindow->d1) + pNewEdgeWindow->dPseuSrcToSrcDistance, *pNewEdgeWindow);
m_EdgeWindowsHeap.insert(pNewWindowItem);
pNewEdgeWindow->pEdge->WindowsList.push_back(Edge::WindowListElement(pNewWindowItem, pNewWindowItem->m_data));
// update the geodesic distance on vertices affected by this new window
if (pNewEdgeWindow->b0 < 0.01)
if (pNewEdgeWindow->pMarkFromEdgeVertex != nullptr && (pNewEdgeWindow->b0 < 0.01))
{
if ((pNewEdgeWindow->d0 + pNewEdgeWindow->dPseuSrcToSrcDistance) < pNewEdgeWindow->pMarkFromEdgeVertex->dGeoDistanceToSrc)
{
@ -765,7 +760,7 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
}
Vertex* pAnotherPt = pNewEdgeWindow->pEdge->GetAnotherVertex(pNewEdgeWindow->dwMarkFromEdgeVertexIdx);
if (pNewEdgeWindow->b1 > (pNewEdgeWindow->pEdge->dEdgeLength - 0.01))
if (pAnotherPt && (pNewEdgeWindow->b1 > (pNewEdgeWindow->pEdge->dEdgeLength - 0.01)))
{
if ((pNewEdgeWindow->d1 + pNewEdgeWindow->dPseuSrcToSrcDistance) < pAnotherPt->dGeoDistanceToSrc)
{
@ -781,8 +776,8 @@ void CExactOneToAll::ProcessNewWindow(EdgeWindow* pNewEdgeWindow)
}
// [see "intersection of overlapping windows" of the paper]
void CExactOneToAll::IntersectWindow(EdgeWindow* pExistingWindow,
EdgeWindow* pNewWindow,
void CExactOneToAll::IntersectWindow(_In_ EdgeWindow* pExistingWindow,
_In_ EdgeWindow* pNewWindow,
bool* pExistingWindowChanged,
bool* pNewWindowChanged,
bool* pExistingWindowNotAvailable,

View File

@ -31,9 +31,9 @@ namespace GeodesicDist
TypeEdgeWindowsHeap m_EdgeWindowsHeap;
virtual void CutHeapTopData(EdgeWindow& EdgeWindowOut);
void ProcessNewWindow(EdgeWindow* pNewEdgeWindow);
void IntersectWindow(EdgeWindow* pExistingWindow,
EdgeWindow* pNewWindow,
void ProcessNewWindow(_In_ EdgeWindow* pNewEdgeWindow);
void IntersectWindow(_In_ EdgeWindow* pExistingWindow,
_In_ EdgeWindow* pNewWindow,
bool* pExistingWindowChanged,
bool* pNewWindowChanged,
bool* pExistingWindowNotAvailable,

View File

@ -43,7 +43,7 @@ namespace GeodesicDist
{
x = y = 0;
}
double Length()
double Length() const
{
return sqrt(x * x + y * y);
}
@ -127,20 +127,41 @@ namespace GeodesicDist
#pragma warning(disable : 26495)
#endif
EdgeWindow()
EdgeWindow() :
dwTag(0),
dwEdgeIdx(0),
pEdge(nullptr),
dwMarkFromEdgeVertexIdx(0),
pMarkFromEdgeVertex(nullptr),
dwPseuSrcVertexIdx(0),
pPseuSrcVertex(nullptr),
b0(0.0),
b1(0.0),
d0(0.0),
d1(0.0),
dv2Src{},
dPseuSrcToSrcDistance(0.0),
dwFaceIdxPropagatedFrom(0),
pFacePropagatedFrom(nullptr),
pEdgePropagatedFrom(nullptr),
ksi(0.0)
{
memset(this, 0, sizeof(EdgeWindow));
}
// trick constructor
EdgeWindow(const uint32_t R)
{
if (R == 0)
memset(this, 0, sizeof(EdgeWindow));
{
EdgeWindow();
}
}
EdgeWindow(const EdgeWindow&) = default;
EdgeWindow& operator=(const EdgeWindow&) = default;
EdgeWindow(EdgeWindow&&) noexcept = default;
EdgeWindow& operator= (EdgeWindow&&) noexcept = default;
#ifdef _PREFAST_
#pragma warning(pop)
#endif
@ -184,7 +205,23 @@ namespace GeodesicDist
double dEdgeLength; // the length of this edge
Edge() : pVertex0(nullptr), pVertex1(nullptr), pAdjFace0(nullptr), pAdjFace1(nullptr) {}
Edge() :
dwVertexIdx0(0),
pVertex0(nullptr),
dwVertexIdx1(0),
pVertex1(nullptr),
dwAdjFaceIdx0(0),
pAdjFace0(nullptr),
dwAdjFaceIdx1(0),
pAdjFace1(nullptr),
dEdgeLength(0.0)
{}
Edge(const Edge&) = default;
Edge& operator=(const Edge&) = default;
Edge(Edge&&) noexcept = default;
Edge& operator= (Edge&&) noexcept = default;
Vertex* GetVertexByIdx(const uint32_t dwIdx) const
{
@ -303,7 +340,7 @@ namespace GeodesicDist
uint32_t dwVertexIdx2; // index of the third vertex of the face
Vertex* pVertex2; // pointer to that vertex
Edge* GetOpposingEdge(const uint32_t dwVertexIdx)
Edge* GetOpposingEdge(const uint32_t dwVertexIdx) const
{
if (dwVertexIdx != dwVertexIdx0 && dwVertexIdx != dwVertexIdx1 && dwVertexIdx != dwVertexIdx2)
return reinterpret_cast<Edge*>(FLAG_INVALID_SIZE_T);
@ -329,17 +366,17 @@ namespace GeodesicDist
return dwEdgeIdx2;
}
Vertex* GetOpposingVertex(const Edge* pEdge)
Vertex* GetOpposingVertex(const Edge* pEdge) const
{
return reinterpret_cast<Vertex*>(intptr_t(pVertex0) ^ intptr_t(pVertex1) ^ intptr_t(pVertex2) ^ intptr_t(pEdge->pVertex0) ^ intptr_t(pEdge->pVertex1));
}
uint32_t GetOpposingVertexIdx(TypeEdgeList& EdgeList, const uint32_t dwEdge)
uint32_t GetOpposingVertexIdx(TypeEdgeList& EdgeList, const uint32_t dwEdge) const
{
return dwVertexIdx0 ^ dwVertexIdx1 ^ dwVertexIdx2 ^ EdgeList[dwEdge].dwVertexIdx0 ^ EdgeList[dwEdge].dwVertexIdx1;
}
void GetOtherTwoEdgesIdx(const uint32_t dwThisEdgeIdx, uint32_t& dwResEdgeIdx1, uint32_t& dwResEdgeIdx2)
void GetOtherTwoEdgesIdx(const uint32_t dwThisEdgeIdx, uint32_t& dwResEdgeIdx1, uint32_t& dwResEdgeIdx2) const
{
if (dwThisEdgeIdx == dwEdgeIdx0)
{
@ -445,7 +482,7 @@ namespace GeodesicDist
z = 0;
}
double Length()
double Length() const
{
return sqrt(x * x + y * y + z * z);
}
@ -500,25 +537,25 @@ namespace GeodesicDist
std::vector<Face*> facesAdj; // faces that use this vertex
std::vector<Edge*> edgesAdj; // edges that have this vertex
Vertex()
Vertex() :
bBoundary(false),
dAngle(0.0),
dLengthOfWindowEdgeToThisVertex(DBL_MAX),
dGeoDistanceToSrc(DBL_MAX),
pEdgeReportedGeoDist(nullptr),
bUsed(false),
bShadowBoundary(false)
{
bBoundary = false;
dAngle = 0;
dGeoDistanceToSrc = DBL_MAX;
dLengthOfWindowEdgeToThisVertex = DBL_MAX;
pEdgeReportedGeoDist = nullptr;
bShadowBoundary = false;
bUsed = false;
}
// get the index in the vertex array
size_t GetIdx(TypeVertexList& VertexList)
size_t GetIdx(TypeVertexList& VertexList) const
{
return (uintptr_t(this) - uintptr_t(&(VertexList[0]))) / sizeof(Vertex);
}
// is this vertex a saddle or boundary one?
bool IsSaddleBoundary()
bool IsSaddleBoundary() const
{
constexpr double pi = 3.14159265358979323846;

View File

@ -23,8 +23,8 @@ namespace
HRESULT UVAtlasGetRealVertexRemap(
_In_ size_t nFaces,
_In_ size_t nVerts,
_In_reads_(nFaces * 3) const IndexType* pInIndexData,
_Inout_updates_all_(nFaces * 3) IndexType* pOutIndexData,
_In_reads_(nFaces * 3) const IndexType* pInIndexData,
_Inout_updates_all_(nFaces * 3) IndexType* pOutIndexData,
_Out_ size_t* nNewVerts,
_Inout_ std::vector<uint32_t>& vOutVertexRemapBuffer,
_Inout_ std::unique_ptr<uint32_t[]>& forwardRemapArray)
@ -55,11 +55,11 @@ namespace
// updated index buffer
IndexType* pNewIndexData = newIndexData.get();
for (uint32_t i = 0; i < 3 * nFaces + nVerts; i++)
for (size_t i = 0; i < (3 * nFaces + nVerts); i++)
{
pForwardRemapArray[i] = uint32_t(-1);
pReverseRemapArray[i] = uint32_t(-1);
pPossibleRemapArray[i] = i;
pForwardRemapArray[i] = static_cast<uint32_t>(-1);
pReverseRemapArray[i] = static_cast<uint32_t>(-1);
pPossibleRemapArray[i] = static_cast<uint32_t>(i);
}
for (size_t i = 0; i < 3 * nFaces; i++)
@ -130,10 +130,12 @@ namespace
}
// ensure that unused vertices are remapped back onto themselves
for (uint32_t i = 0; i < nVerts; i++)
for (size_t i = 0; i < nVerts; i++)
{
if (pReverseRemapArray[i] == uint32_t(-1))
pReverseRemapArray[i] = i;
if (pReverseRemapArray[i] == static_cast<uint32_t>(-1))
{
pReverseRemapArray[i] = static_cast<uint32_t>(i);
}
}
memcpy(vOutVertexRemapBuffer.data(), pReverseRemapArray, (*nNewVerts) * sizeof(uint32_t));
@ -170,8 +172,10 @@ namespace
uint32_t* pEquivs = equivs.get();
for (uint32_t i = 0; i < nFaces * 3; i++)
pEquivs[i] = i;
for (size_t i = 0; i < (nFaces * 3); i++)
{
pEquivs[i] = static_cast<uint32_t>(i);
}
// join vertices that are equivalent through adjacency
for (size_t i = 0; i < nFaces; i++)
@ -411,7 +415,7 @@ namespace
for (size_t i = 0; i < outMeshNumVertices; i++)
{
memcpy(&bBaseOut[i].pos.x, bBaseIn + pdwRemap[i] * sizeof(XMFLOAT3), sizeof(XMFLOAT3));
memcpy(&bBaseOut[i].pos, bBaseIn + pdwRemap[i] * sizeof(XMFLOAT3), sizeof(XMFLOAT3));
if (pForwardRemapArray[i] == uint32_t(-1))
{
bBaseOut[i].uv.x = bBaseOut[i].uv.y = 0.f;

View File

@ -759,11 +759,11 @@ HRESULT CUVAtlasRepacker::GenerateAdjacentInfo()
// faces that connected with one vertex together
m_VertexAdjInfo.resize(m_iNumVertices);
for (uint32_t i = 0; i < m_iNumFaces; i++)
for (size_t i = 0; i < m_iNumFaces; i++)
{
m_VertexAdjInfo[ib[i].vertex[0]].push_back(i);
m_VertexAdjInfo[ib[i].vertex[1]].push_back(i);
m_VertexAdjInfo[ib[i].vertex[2]].push_back(i);
m_VertexAdjInfo[ib[i].vertex[0]].push_back(static_cast<uint32_t>(i));
m_VertexAdjInfo[ib[i].vertex[1]].push_back(static_cast<uint32_t>(i));
m_VertexAdjInfo[ib[i].vertex[2]].push_back(static_cast<uint32_t>(i));
}
}
catch (std::bad_alloc&)
@ -782,9 +782,9 @@ HRESULT CUVAtlasRepacker::GenerateAdjacentInfo()
// generate adjacent information
static const int order[3][2] = { {0, 1}, {1, 2}, {0, 2} };
for (uint32_t i = 0; i < m_iNumFaces - 1; i++)
for (size_t i = 0; i < m_iNumFaces - 1; i++)
{
for (uint32_t j = i + 1; j < m_iNumFaces; j++)
for (size_t j = i + 1; j < m_iNumFaces; j++)
{
for (size_t m = 0; m < 3; m++) if (m_AdjacentInfo[i * 3 + m] == uint32_t(-1))
for (size_t n = 0; n < 3; n++) if (m_AdjacentInfo[j * 3 + n] == uint32_t(-1))
@ -794,8 +794,8 @@ HRESULT CUVAtlasRepacker::GenerateAdjacentInfo()
ib[i].vertex[order[m][1]] == ib[j].vertex[order[n][0]]))
// if two triangles have two common vertices, they are adjacent
{
m_AdjacentInfo[i * 3 + m] = j;
m_AdjacentInfo[j * 3 + n] = i;
m_AdjacentInfo[i * 3 + m] = static_cast<uint32_t>(j);
m_AdjacentInfo[j * 3 + n] = static_cast<uint32_t>(i);
m = 3;
break;
}
@ -856,14 +856,14 @@ HRESULT CUVAtlasRepacker::GenerateNewBuffers()
uint32_t num = 0;
uint32_t indexnum = 0;
uint32_t facestart = 0;
for (uint32_t i = 0; i < m_iNumFaces; i++)
for (size_t i = 0; i < m_iNumFaces; i++)
{
if (pAB[i] == uint32_t(-1))
{
ab.clear();
if (!bUsedFace[i])
{
ab.push_back(i);
ab.push_back(static_cast<uint32_t>(i));
bUsedFace[i] = true;
}
size_t t = 0;
@ -1305,12 +1305,12 @@ void CUVAtlasRepacker::PutChart(uint32_t index)
std::uniform_int_distribution<> dis(0, 1);
for (uint32_t i = 0; i < m_iRotateNum; i++)
for (size_t i = 0; i < m_iRotateNum; i++)
{
// for every position of chart, first do tessellation on it
// then try to put it into the atlas after rotate 0, 90, 180, 270 degrees
auto pPosInfo = reinterpret_cast<PositionInfo*>(&(pCInfo->PosInfo[i]));
DoTessellation(index, i);
DoTessellation(index, static_cast<uint32_t>(i));
PrepareSpaceInfo(m_currSpaceInfo, m_currChartUVBoard,
0, pPosInfo->numX, 0, pPosInfo->numY, true);
@ -1388,7 +1388,7 @@ void CUVAtlasRepacker::PutChart(uint32_t index)
}
// save the best chart position at present
if (m_triedRotate == i) {
if (m_triedRotate == static_cast<uint32_t>(i)) {
for (size_t j = 0; j < size_t(pPosInfo->numY); j++)
for (size_t k = 0; k < size_t(pPosInfo->numX); k++)
m_triedUVBoard[j][k] = m_currChartUVBoard[j][k];

View File

@ -902,13 +902,13 @@ namespace
double* pTanList = tanList.get();
uint32_t dwLeftMost = 0;
for (uint32_t ii = 0; ii < keyPointList.size(); ii++)
for (size_t ii = 0; ii < keyPointList.size(); ii++)
{
if (leftMost.x > keyPointList[ii].x ||
(leftMost.x == keyPointList[ii].x && leftMost.y > keyPointList[ii].y))
{
leftMost = keyPointList[ii];
dwLeftMost = ii;
dwLeftMost = static_cast<uint32_t>(ii);
}
if (rightMost.x < keyPointList[ii].x ||
(rightMost.x == keyPointList[ii].x && rightMost.y > keyPointList[ii].y))
@ -966,7 +966,7 @@ namespace
// 3. Get above & below lines.
try
{
uint32_t dwCur = 0;
size_t dwCur = 0;
do
{
below.push_back(keyPointList[dwCur]);
@ -1031,12 +1031,12 @@ namespace
std::vector<DOUBLEVECTOR2>& line,
uint32_t dwCur)
{
uint32_t dwNext = dwCur + 1;
size_t dwNext = dwCur + 1;
while (dwNext < line.size())
{
if (!IsInZeroRangeDouble(line[dwNext].x - line[dwCur].x))
{
return dwNext;
return static_cast<uint32_t>(dwNext);
}
dwNext++;
}

View File

@ -331,7 +331,7 @@ HRESULT CIsochartEngine::ParameterizeChartsInHeapParallelized(
if (pChart->HasChildren())
{
/// Add children to children vector to be ran in the following parallelization run
for (uint32_t i = 0; i < pChart->GetChildrenCount(); i++)
for (size_t i = 0; i < pChart->GetChildrenCount(); i++)
{
CIsochartMesh* pChild = pChart->GetChild(i);
assert(pChild != nullptr);
@ -804,7 +804,7 @@ HRESULT CIsochartEngine::AddChildrenToCurrentChartHeap(
{
HRESULT hr = S_OK;
for (uint32_t i = 0; i < pChart->GetChildrenCount(); i++)
for (size_t i = 0; i < pChart->GetChildrenCount(); i++)
{
CIsochartMesh* pChild = pChart->GetChild(i);
assert(pChild != nullptr);
@ -1284,7 +1284,7 @@ HRESULT CIsochartEngine::ApplyInitEngine(
if (pChart->HasChildren())
{
for (uint32_t i = 0; i < pChart->GetChildrenCount(); i++)
for (size_t i = 0; i < pChart->GetChildrenCount(); i++)
{
CIsochartMesh* pChild = pChart->GetChild(i);
assert(pChild != nullptr);
@ -1403,7 +1403,7 @@ HRESULT CIsochartEngine::ExportCurrentCharts(
std::vector<CIsochartMesh*>& finalChartList,
uint32_t* pFaceAttributeIDOut)
{
for (uint32_t i = 0; i < finalChartList.size(); i++)
for (size_t i = 0; i < finalChartList.size(); i++)
{
CIsochartMesh* pChart = finalChartList[i];
assert(pChart != nullptr);
@ -1414,7 +1414,7 @@ HRESULT CIsochartEngine::ExportCurrentCharts(
{
assert(pChartFaceBuffer->dwIDInRootMesh
< m_baseInfo.dwFaceCount);
pFaceAttributeIDOut[pChartFaceBuffer->dwIDInRootMesh] = i;
pFaceAttributeIDOut[pChartFaceBuffer->dwIDInRootMesh] = static_cast<uint32_t>(i);
pChartFaceBuffer++;
}
}
@ -1579,11 +1579,11 @@ HRESULT CIsochartEngine::PrepareExportBuffers(
rgbVertUsed[pVert[j].dwIDInRootMesh] = true;
}
}
for (uint32_t i = 0; i < m_baseInfo.dwVertexCount; i++)
for (size_t i = 0; i < m_baseInfo.dwVertexCount; i++)
{
if (!rgbVertUsed[i])
{
notUsedVertList.push_back(i);
notUsedVertList.push_back(static_cast<uint32_t>(i));
}
}
dwVertCount += notUsedVertList.size();
@ -1749,14 +1749,14 @@ HRESULT CIsochartEngine::FillExportFaceAttributeBuffer(
uint32_t dwFaceID = 0;
for (uint32_t i = 0; i < finalChartList.size(); i++)
for (size_t i = 0; i < finalChartList.size(); i++)
{
CIsochartMesh* pChart = finalChartList[i];
const ISOCHARTFACE* pChartFaceBuffer = pChart->GetFaceBuffer();
for (uint32_t j = 0; j < pChart->GetFaceNumber(); j++)
for (size_t j = 0; j < pChart->GetFaceNumber(); j++)
{
dwFaceID = pChartFaceBuffer[j].dwIDInRootMesh;
pAttributeID[dwFaceID] = i;
pAttributeID[dwFaceID] = static_cast<uint32_t>(i);
}
}

View File

@ -238,9 +238,9 @@ namespace
ISOCHARTFACE* pFace = pFaceBuffer;
const INDEXTYPE* pFacesIn = pFacesInBase;
for (uint32_t i = 0; i < dwFaceCount; i++)
for (size_t i = 0; i < dwFaceCount; i++)
{
pFace->dwID = pFace->dwIDInRootMesh = i;
pFace->dwID = pFace->dwIDInRootMesh = static_cast<uint32_t>(i);
pFace->dwVertexID[0] = pFacesIn[0];
pFace->dwVertexID[1] = pFacesIn[1];
pFace->dwVertexID[2] = pFacesIn[2];
@ -287,10 +287,10 @@ HRESULT CIsochartMesh::BuildRootChart(
pChart->m_dwFaceNumber = dwFaceCount;
pChart->m_dwVertNumber = dwVertexCount;
for (uint32_t i = 0; i < dwVertexCount; i++)
for (size_t i = 0; i < dwVertexCount; i++)
{
pChart->m_pVerts[i].dwID = i;
pChart->m_pVerts[i].dwIDInRootMesh = i;
pChart->m_pVerts[i].dwID = static_cast<uint32_t>(i);
pChart->m_pVerts[i].dwIDInRootMesh = static_cast<uint32_t>(i);
}
if (DXGI_FORMAT_R32_UINT == IndexFormat)
@ -475,7 +475,7 @@ namespace
std::vector<uint32_t> splitEdgePos;
uint32_t* pIdx = rgdwFaceIdx;
for (uint32_t iFace = 0; iFace < dwFaceCount; iFace++)
for (size_t iFace = 0; iFace < dwFaceCount; iFace++)
{
for (size_t iVert = 0; iVert < 3; iVert++)
{
@ -491,11 +491,11 @@ namespace
if (IsNeedToSplit(
pVertEdgeList[v1],
v2,
iFace,
static_cast<uint32_t>(iFace),
rgdwAdjacency,
&pEdge))
{
HRESULT hr = AddConnectedFalseEdges(&splitFaceList, rgdwAdjacency, rgdwFalseEdges, iFace);
HRESULT hr = AddConnectedFalseEdges(&splitFaceList, rgdwAdjacency, rgdwFalseEdges, static_cast<uint32_t>(iFace));
if (FAILED(hr))
{
return hr;
@ -561,16 +561,16 @@ namespace
memset(rgdwNewFaceIdx, 0xff, dwFaceCount * 3 * sizeof(uint32_t));
dwNewVertCount = 0;
for (uint32_t iFace = 0; iFace < dwFaceCount; iFace++)
for (size_t iFace = 0; iFace < dwFaceCount; iFace++)
{
for (uint32_t iVert = 0; iVert < 3; iVert++)
for (size_t iVert = 0; iVert < 3; iVert++)
{
if (rgdwNewFaceIdx[iFace * 3 + iVert] != INVALID_VERT_ID)
{
continue;
}
if (!vertIter.Init(iFace, iVert, dwFaceCount))
if (!vertIter.Init(static_cast<uint32_t>(iFace), static_cast<uint32_t>(iVert), dwFaceCount))
{
return HRESULT_E_INVALID_DATA;
}
@ -847,9 +847,9 @@ HRESULT CIsochartMesh::ComputeBiParitionLandmark()
uint32_t dwIdx1 = INVALID_INDEX;
uint32_t dwIdx2 = INVALID_INDEX;
for (uint32_t ii = 0; ii < m_dwVertNumber - 1; ii++)
for (size_t ii = 0; ii < m_dwVertNumber - 1; ii++)
{
for (uint32_t jj = ii + 1; jj < m_dwVertNumber; jj++)
for (size_t jj = ii + 1; jj < m_dwVertNumber; jj++)
{
float fDeltaX = (m_pVerts[ii].uv.x - m_pVerts[jj].uv.x);
float fDeltaY = (m_pVerts[ii].uv.y - m_pVerts[jj].uv.y);
@ -858,8 +858,8 @@ HRESULT CIsochartMesh::ComputeBiParitionLandmark()
if (fMaxDistance < fTempDistance)
{
fMaxDistance = fTempDistance;
dwIdx1 = ii;
dwIdx2 = jj;
dwIdx1 = static_cast<uint32_t>(ii);
dwIdx2 = static_cast<uint32_t>(jj);
}
}
}
@ -880,10 +880,10 @@ HRESULT CIsochartMesh::ComputeBiParitionLandmark()
uint32_t dwIdx1 = INVALID_INDEX;
uint32_t dwIdx2 = INVALID_INDEX;
for (uint32_t ii = 0; ii < m_landmarkVerts.size() - 1; ii++)
for (size_t ii = 0; ii < m_landmarkVerts.size() - 1; ii++)
{
uint32_t id1 = m_landmarkVerts[ii];
for (uint32_t jj = ii + 1; jj < m_landmarkVerts.size(); jj++)
for (size_t jj = ii + 1; jj < m_landmarkVerts.size(); jj++)
{
uint32_t id2 = m_landmarkVerts[jj];
float fDeltaX = (m_pVerts[id1].uv.x - m_pVerts[id2].uv.x);
@ -893,8 +893,8 @@ HRESULT CIsochartMesh::ComputeBiParitionLandmark()
if (fMaxDistance < fTempDistance)
{
fMaxDistance = fTempDistance;
dwIdx1 = ii;
dwIdx2 = jj;
dwIdx1 = static_cast<uint32_t>(ii);
dwIdx2 = static_cast<uint32_t>(jj);
}
}
}
@ -1048,9 +1048,9 @@ HRESULT CIsochartMesh::Bipartition2D()
{
return E_OUTOFMEMORY;
}
for (uint32_t ii = 0; ii < m_dwVertNumber - 1; ii++)
for (size_t ii = 0; ii < m_dwVertNumber - 1; ii++)
{
for (uint32_t jj = ii + 1; jj < m_dwVertNumber; jj++)
for (size_t jj = ii + 1; jj < m_dwVertNumber; jj++)
{
float fDeltaX = (m_pVerts[ii].uv.x - m_pVerts[jj].uv.x);
float fDeltaY = (m_pVerts[ii].uv.y - m_pVerts[jj].uv.y);
@ -1059,8 +1059,8 @@ HRESULT CIsochartMesh::Bipartition2D()
if (fMaxDistance < fTempDistance)
{
fMaxDistance = fTempDistance;
keyVerts[0] = ii;
keyVerts[1] = jj;
keyVerts[0] = static_cast<uint32_t>(ii);
keyVerts[1] = static_cast<uint32_t>(jj);
}
}
}
@ -1556,11 +1556,11 @@ HRESULT CIsochartMesh::FindAllEdges(
pTriangle++;
}
for (uint32_t i = 0; i < m_dwEdgeNumber; i++)
for (size_t i = 0; i < m_dwEdgeNumber; i++)
{
ISOCHARTEDGE& edge = m_edges[i];
m_pVerts[edge.dwVertexID[0]].edgeAdjacent.push_back(i);
m_pVerts[edge.dwVertexID[1]].edgeAdjacent.push_back(i);
m_pVerts[edge.dwVertexID[0]].edgeAdjacent.push_back(static_cast<uint32_t>(i));
m_pVerts[edge.dwVertexID[1]].edgeAdjacent.push_back(static_cast<uint32_t>(i));
}
}
catch (std::bad_alloc&)
@ -2964,7 +2964,7 @@ HRESULT CIsochartMesh::FindSplitPath(
assert(!dijkstraPath.empty());
HRESULT hr = S_OK;
uint32_t dwStartCutID = 0;
size_t dwStartCutID = 0;
// Find the first vertex need to be splited
while (dwStartCutID < dijkstraPath.size() - 1
@ -3095,17 +3095,17 @@ CalSplitInfoOfMiddleSplitVerts(
size_t dwRingSize = pCurrVertex->vertAdjacent.size();
vertListOnOneSide.clear();
for (uint32_t j = 0; j < dwRingSize; j++)
for (size_t j = 0; j < dwRingSize; j++)
{
if (pCurrVertex->vertAdjacent[j] == pPrevVertex->dwID)
{
dwPrevIndex = j;
dwPrevIndex = static_cast<uint32_t>(j);
break;
}
}
for (uint32_t k = 1; k < dwRingSize; k++)
for (size_t k = 1; k < dwRingSize; k++)
{
dwNextIndex = (dwPrevIndex + k) % dwRingSize;
dwNextIndex = static_cast<uint32_t>((dwPrevIndex + k) % dwRingSize);
if (pCurrVertex->vertAdjacent[dwNextIndex] == pNextVertex->dwID)
{
@ -3171,11 +3171,11 @@ CIsochartMesh::CalSplitInfoOfLastSplitVert(
size_t dwRingSize = pCurrVertex->vertAdjacent.size();
uint32_t dwPrevIndex = INVALID_INDEX;
for (uint32_t i = 0; i < dwRingSize; i++)
for (size_t i = 0; i < dwRingSize; i++)
{
if (pCurrVertex->vertAdjacent[i] == pPrevVertex->dwID)
{
dwPrevIndex = i;
dwPrevIndex = static_cast<uint32_t>(i);
break;
}
}
@ -3299,7 +3299,7 @@ CIsochartMesh* CIsochartMesh::SplitVertices(
return nullptr;
}
uint32_t i = 0;
size_t i = 0;
for (; i < m_dwVertNumber; i++)
{
@ -3312,7 +3312,7 @@ CIsochartMesh* CIsochartMesh::SplitVertices(
for (size_t j = 0; j < nDupVerts && i < dwNewVertNumber; i++, j++)
{
auto pCurrVertex = m_pVerts + splitPath[j];
pChart->m_pVerts[i].dwID = i;
pChart->m_pVerts[i].dwID = static_cast<uint32_t>(i);
pChart->m_pVerts[i].dwIDInFatherMesh = pCurrVertex->dwID;

View File

@ -274,7 +274,7 @@ namespace Isochart
size_t GetChildrenCount() const { return m_children.size(); }
CIsochartMesh* GetChild(uint32_t dwIndex) const
CIsochartMesh* GetChild(size_t dwIndex) const
{
if (dwIndex >= m_children.size())
{
@ -282,7 +282,7 @@ namespace Isochart
}
return m_children[dwIndex];
}
void UnlinkChild(uint32_t dwIndex)
void UnlinkChild(size_t dwIndex)
{
m_children[dwIndex] = nullptr;
}

View File

@ -156,20 +156,20 @@ CIsochartMesh::CalAdjacentChartsForEachChart(
return E_OUTOFMEMORY;
}
for (uint32_t i = 0; i < children.size(); i++)
for (size_t i = 0; i < children.size(); i++)
{
ISOCHARTFACE* pFace = children[i]->GetFaceBuffer();
for (size_t j = 0; j < children[i]->GetFaceNumber(); j++)
{
pdwFaceChartId[pFace->dwIDInRootMesh] = i;
pdwFaceChartId[pFace->dwIDInRootMesh] = static_cast<uint32_t>(i);
pFace++;
}
}
for (uint32_t i = 0; i < children.size(); i++)
for (size_t i = 0; i < children.size(); i++)
{
HRESULT hr = children[i]->CalculateAdjacentChart(
i,
static_cast<uint32_t>(i),
pdwFaceChartId.get(),
pdwFaceAdjacentArray);
if (FAILED(hr))
@ -215,10 +215,10 @@ HRESULT CIsochartMesh::PerformMerging(
CIsochartMesh* pChart = nullptr;
// 1 Prepare all charts to be merged.
for (uint32_t i = 0; i < nchildren; i++)
for (size_t i = 0; i < nchildren; i++)
{
pChart = children[i];
pChart->CalculateAveragNormal(pChartNormal.get() + i);
pChart->CalculateAveragNormal(pChartNormal.get() + static_cast<uint32_t>(i));
if (pChart->GetAdjacentChartList().empty())
{
continue;
@ -229,8 +229,8 @@ HRESULT CIsochartMesh::PerformMerging(
}
pHeapItems[i].m_weight = static_cast<uint32_t>(MAX_FACE_NUMBER - pChart->GetFaceNumber());
pHeapItems[i].m_data = i;
heap.insert(pHeapItems.get() + i);
pHeapItems[i].m_data = static_cast<uint32_t>(i);
heap.insert(pHeapItems.get() + static_cast<uint32_t>(i));
}
memset(pbMergeFlag.get(), 1, sizeof(bool) * children.size());

View File

@ -88,7 +88,7 @@ HRESULT CIsochartMesh::OptimizeBoundaryByAngle(
// 2. Decide fuzzy region used in graph cut.
HRESULT hr = S_OK;
memset(pbIsFuzzyFatherFace.get(), 0, sizeof(bool) * m_dwFaceNumber);
for (uint32_t i = 0; i < m_children.size(); i++)
for (size_t i = 0; i < m_children.size(); i++)
{
CIsochartMesh* pChart = m_children[i];
hr = pChart->CalculateFuzzyRegion(pbIsFuzzyFatherFace.get());
@ -99,7 +99,7 @@ HRESULT CIsochartMesh::OptimizeBoundaryByAngle(
for (size_t j = 0; j < pChart->m_dwFaceNumber; j++)
{
ISOCHARTFACE* pFace = pChart->m_pFaces + j;
pdwFaceChartID[pFace->dwIDInFatherMesh] = i;
pdwFaceChartID[pFace->dwIDInFatherMesh] = static_cast<uint32_t>(i);
}
}
@ -375,14 +375,14 @@ HRESULT CIsochartMesh::DriveGraphCutByAngle(
{
HRESULT hr = S_OK;
// 1. For each sub-chart, get its adjacent sub-charts
for (uint32_t i = 0; i < m_children.size(); i++)
for (size_t i = 0; i < m_children.size(); i++)
{
CIsochartMesh* pChart = m_children[i];
pChart->CalculateSubChartAdjacentChart(i, pdwFaceChartID);
pChart->CalculateSubChartAdjacentChart(static_cast<uint32_t>(i), pdwFaceChartID);
}
// 2. Optimize boundaries between each 2 sub-charts
for (uint32_t dwChartIdx1 = 0; dwChartIdx1 < m_children.size(); dwChartIdx1++)
for (size_t dwChartIdx1 = 0; dwChartIdx1 < m_children.size(); dwChartIdx1++)
{
CIsochartMesh* pChart1 = m_children[dwChartIdx1];
for (size_t i = 0; i < pChart1->m_adjacentChart.size(); i++)
@ -395,7 +395,7 @@ HRESULT CIsochartMesh::DriveGraphCutByAngle(
FAILURE_RETURN(
OptimizeOneBoundaryByAngle(
dwChartIdx1,
static_cast<uint32_t>(dwChartIdx1),
dwChartIdx2,
graphCut,
pdwFaceGraphNodeID,
@ -685,13 +685,13 @@ HRESULT CIsochartMesh::CalSubchartsFuzzyRegion(
try
{
for (uint32_t i = 0; i < m_children.size(); i++)
for (size_t i = 0; i < m_children.size(); i++)
{
CIsochartMesh* pChart = m_children[i];
for (size_t j = 0; j < pChart->GetFaceNumber(); j++)
{
ISOCHARTFACE* pFace = pChart->m_pFaces + j;
pdwFaceChartID[pFace->dwIDInFatherMesh] = i;
pdwFaceChartID[pFace->dwIDInFatherMesh] = static_cast<uint32_t>(i);
}
HRESULT hr = pChart->CalculateLandmarkAndFuzzyRegion(
@ -1189,17 +1189,17 @@ HRESULT CIsochartMesh::ApplyGraphCutByStretch(
// 3.4 For each sub-chart , getting adjacent sub-charts.
HRESULT hr = S_OK;
for (uint32_t i = 0; i < m_children.size(); i++)
for (size_t i = 0; i < m_children.size(); i++)
{
CIsochartMesh* pChart = m_children[i];
hr = pChart->CalculateSubChartAdjacentChart(i, pdwFaceChartID);
hr = pChart->CalculateSubChartAdjacentChart(static_cast<uint32_t>(i), pdwFaceChartID);
if (FAILED(hr))
{
return hr;
}
}
for (uint32_t dwChartIdx1 = 0; dwChartIdx1 < m_children.size(); dwChartIdx1++)
for (size_t dwChartIdx1 = 0; dwChartIdx1 < m_children.size(); dwChartIdx1++)
{
CIsochartMesh* pChart1 = m_children[dwChartIdx1];
@ -1216,7 +1216,7 @@ HRESULT CIsochartMesh::ApplyGraphCutByStretch(
hr =
OptimizeOneBoundaryByAngle(
dwChartIdx1,
static_cast<uint32_t>(dwChartIdx1),
dwChartIdx2,
graphCut,
pdwFaceGraphNodeID.get(),

View File

@ -172,7 +172,7 @@ uint32_t CIsochartMesh::GetChartWidthLargestGeoAvgStretch(
{
fMaxAvgL2Stretch = 0;
uint32_t dwIdx = 0;
for (uint32_t ii = 0; ii < chartList.size(); ii++)
for (size_t ii = 0; ii < chartList.size(); ii++)
{
if (IsInZeroRange(chartList[ii]->m_fChart2DArea)
|| IsInZeroRange(chartList[ii]->m_fChart3DArea))
@ -191,7 +191,7 @@ uint32_t CIsochartMesh::GetChartWidthLargestGeoAvgStretch(
{
fMaxAvgL2Stretch =
chartList[ii]->m_fParamStretchL2 / chartList[ii]->m_fChart3DArea;
dwIdx = ii;
dwIdx = static_cast<uint32_t>(ii);
}
}
@ -204,7 +204,7 @@ uint32_t CIsochartMesh::GetBestPartitionCanidate(
uint32_t dwMaxIdx = INVALID_INDEX;
float fMaxL2SquaredStretch = -1;
for (uint32_t ii = 0; ii < chartList.size(); ii++)
for (size_t ii = 0; ii < chartList.size(); ii++)
{
// The average chart stretch has reached the minimal point, No use to parition
// it again.
@ -223,17 +223,17 @@ uint32_t CIsochartMesh::GetBestPartitionCanidate(
if (fMaxL2SquaredStretch < chartList[ii]->GetL2SquaredStretch())
{
fMaxL2SquaredStretch = chartList[ii]->GetL2SquaredStretch();
dwMaxIdx = ii;
dwMaxIdx = static_cast<uint32_t>(ii);
}
}
if (INVALID_INDEX == dwMaxIdx)
{
for (uint32_t ii = 0; ii < chartList.size(); ii++)
for (size_t ii = 0; ii < chartList.size(); ii++)
{
if (chartList[ii]->GetFaceNumber() > 1)
{
dwMaxIdx = ii;
dwMaxIdx = static_cast<uint32_t>(ii);
break;
}
}

View File

@ -231,10 +231,10 @@ HRESULT CIsochartMesh::SmoothPartitionResult(
auto pHeapItems = heapItems.get();
for (uint32_t i = 0; i < dwMaxSubchartCount; i++)
for (size_t i = 0; i < dwMaxSubchartCount; i++)
{
pHeapItems[i].m_weight = 0;
pHeapItems[i].m_data = i;
pHeapItems[i].m_data = static_cast<uint32_t>(i);
}
for (size_t i = 0; i < m_dwFaceNumber; i++)
{
@ -563,7 +563,7 @@ HRESULT CIsochartMesh::FindCongenerFaces(
congenerFaceCategories.push_back(ii);
bProcessedFace[ii] = true;
uint32_t dwCur = dwBegin;
size_t dwCur = dwBegin;
do
{
uint32_t dwCurrentFace = congenerFaceCategories[dwCur];
@ -591,7 +591,7 @@ HRESULT CIsochartMesh::FindCongenerFaces(
dwCur++;
} while (dwCur < congenerFaceCategories.size());
uint32_t dwCongEdgeCount = dwCur - dwBegin;
uint32_t dwCongEdgeCount = static_cast<uint32_t>(dwCur - dwBegin);
congenerFaceCategoryLen.push_back(dwCongEdgeCount);
}
}
@ -2281,19 +2281,19 @@ HRESULT CIsochartMesh::CalculateRepresentiveVertices(
uint32_t vi = INVALID_INDEX;
uint32_t vj = INVALID_INDEX;
for (uint32_t i = 0; i < m_landmarkVerts.size(); i++)
for (size_t i = 0; i < m_landmarkVerts.size(); i++)
{
float fCoord = pfVertMappingCoord[
dwPrimaryEigenDimension * m_landmarkVerts[i] + dwDimIndex];
if (fCoord > fMaxDist)
{
vi = i;
vi = static_cast<uint32_t>(i);
fMaxDist = fCoord;
}
if (fCoord < fMinDist)
{
vj = i;
vj = static_cast<uint32_t>(i);
fMinDist = fCoord;
}
}
@ -2537,7 +2537,7 @@ void CIsochartMesh::ClusterFacesByParameterDistance(
float fMinDistance = FLT_MAX;
pdwFaceChartID[i] = INVALID_INDEX;
for (uint32_t j = 0; j < representativeVertsIdx.size(); j++)
for (size_t j = 0; j < representativeVertsIdx.size(); j++)
{
const float* pfParameterDistance
= pfVertParitionDistance
@ -2548,7 +2548,7 @@ void CIsochartMesh::ClusterFacesByParameterDistance(
+ pfParameterDistance[pFace->dwVertexID[2]];
if (fDistance < fMinDistance)
{
pdwFaceChartID[i] = j;
pdwFaceChartID[i] = static_cast<uint32_t>(j);
fMinDistance = fDistance;
}
}
@ -2647,12 +2647,12 @@ HRESULT CIsochartMesh::BiPartitionParameterlizeShape(
// Restore pdwFaceChartID to the content before boundary opitimization
if (!bIsOptimized)
{
for (uint32_t i = 0; i < m_children.size(); i++)
for (size_t i = 0; i < m_children.size(); i++)
{
ISOCHARTFACE* pFace = m_children[i]->m_pFaces;
for (size_t j = 0; j < m_children[i]->m_dwFaceNumber; j++)
{
pdwFaceChartID[pFace->dwIDInFatherMesh] = i;
pdwFaceChartID[pFace->dwIDInFatherMesh] = static_cast<uint32_t>(i);
pFace++;
}
}
@ -3002,9 +3002,9 @@ HRESULT CIsochartMesh::ReserveFarestTwoLandmarks(
float fMaxDistance = -FLT_MAX;
uint32_t dwIdx[2] = {};
for (uint32_t ii = 0; ii < m_landmarkVerts.size() - 1; ii++)
for (size_t ii = 0; ii < m_landmarkVerts.size() - 1; ii++)
{
for (uint32_t jj = ii + 1; jj < m_landmarkVerts.size(); jj++)
for (size_t jj = ii + 1; jj < m_landmarkVerts.size(); jj++)
{
assert(
pfVertGeodesicDistance[ii * m_dwVertNumber + m_landmarkVerts[jj]] ==
@ -3015,8 +3015,8 @@ HRESULT CIsochartMesh::ReserveFarestTwoLandmarks(
{
fMaxDistance =
pfVertGeodesicDistance[ii * m_dwVertNumber + m_landmarkVerts[jj]];
dwIdx[0] = ii;
dwIdx[1] = jj;
dwIdx[0] = static_cast<uint32_t>(ii);
dwIdx[1] = static_cast<uint32_t>(jj);
}
}
}

View File

@ -3087,12 +3087,12 @@ HRESULT CIsochartMesh::CalculateChartBorders(
// start vertex
uint32_t dwFirstBoundaryIndex = 0;
ISOCHARTEDGE* pBoundaryEdge = nullptr;
for (uint32_t i = 0; i < pStartVertex->edgeAdjacent.size(); i++)
for (size_t i = 0; i < pStartVertex->edgeAdjacent.size(); i++)
{
pBoundaryEdge = &(m_edges[pStartVertex->edgeAdjacent[i]]);
if (pBoundaryEdge->bIsBoundary)
{
dwFirstBoundaryIndex = i;
dwFirstBoundaryIndex = static_cast<uint32_t>(i);
break;
}
}
@ -3111,12 +3111,12 @@ HRESULT CIsochartMesh::CalculateChartBorders(
// 3. Find the second one of the two boundary edges connecting to
// start vertex
pBoundaryEdge = nullptr;
for (uint32_t i = dwFirstBoundaryIndex + 1; i < pStartVertex->edgeAdjacent.size(); i++)
for (size_t i = dwFirstBoundaryIndex + 1; i < pStartVertex->edgeAdjacent.size(); i++)
{
pBoundaryEdge = &(m_edges[pStartVertex->edgeAdjacent[i]]);
if (pBoundaryEdge->bIsBoundary)
{
dwFirstBoundaryIndex = i;
dwFirstBoundaryIndex = static_cast<uint32_t>(i);
break;
}
}

View File

@ -63,7 +63,7 @@ jobs:
# We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers
displayName: Fetch VCPKG
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: VCPKG Bootstrap
@ -144,12 +144,12 @@ jobs:
- task: CmdLine@2
displayName: Fetch VCPKG
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:

View File

@ -174,6 +174,9 @@ jobs:
inputs:
cwd: $(Build.SourcesDirectory)/UVAtlas
cmakeArgs: --build out/build/x64-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Config
inputs:
@ -184,6 +187,9 @@ jobs:
inputs:
cwd: $(Build.SourcesDirectory)/UVAtlas
cmakeArgs: --build out/build/x64-Release -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Config
inputs:
@ -194,6 +200,9 @@ jobs:
inputs:
cwd: $(Build.SourcesDirectory)/UVAtlas
cmakeArgs: --build out/build/x64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Config
inputs:
@ -204,6 +213,9 @@ jobs:
inputs:
cwd: $(Build.SourcesDirectory)/UVAtlas
cmakeArgs: --build out/build/x64-Release-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CmdLine@2
displayName: 'Set LIB for ARM64'
inputs:
@ -225,6 +237,9 @@ jobs:
inputs:
cwd: $(Build.SourcesDirectory)/UVAtlas
cmakeArgs: --build out/build/arm64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Release) Config
inputs:

View File

@ -63,16 +63,16 @@ jobs:
displayName: Fetch Libraries
inputs:
script: |
git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMesh.git
git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXTex.git
git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/UVAtlas.git
git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMesh.git
git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXTex.git
git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/UVAtlas.git
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests
workingDirectory: $(Build.SourcesDirectory)/UVAtlas
failOnStderr: true
- task: VSBuild@1

View File

@ -42,7 +42,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directx-headers
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
@ -61,7 +61,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directxmath
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
- task: CMake@1
displayName: CMake DirectXMath
inputs:

View File

@ -61,7 +61,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directx-headers
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
@ -80,7 +80,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directxmath
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
- task: CMake@1
displayName: CMake DirectXMath
inputs:

View File

@ -27,6 +27,8 @@ variables:
VS_GENERATOR: 'Visual Studio 17 2022'
VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
Codeql.Language: cpp
Codeql.ExcludePathPatterns: vcpkg
pool:
vmImage: windows-2022
@ -53,13 +55,15 @@ jobs:
displayName: 'Run PoliCheck'
inputs:
result: PoliCheck.xml
optionsPE: 1
optionsRulesDBPath: $(Build.SourcesDirectory)/build/rule.mdb
- task: Armory@2
displayName: Run ARMory
- task: CmdLine@2
# We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers
displayName: Fetch VCPKG
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: VCPKG Bootstrap
@ -93,18 +97,19 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DENABLE_SPECTRE_MITIGATION=ON -DBUILD_TOOLS=ON -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)"'
- task: Semmle@1
displayName: 'Run CodeQL (Semmle) (C++)'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: CodeQL3000Init@0
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)'
language: 'cpp'
querySuite: 'Recommended'
timeout: '1800'
ram: '16384'
addProjectDirToScanningExclusionList: true
buildCommandsString: '"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/out/UVAtlas.sln /p:Configuration=Release'
Enabled: true
- task: VSBuild@1
displayName: 'Build C++ with CodeQL'
inputs:
solution: '$(Build.SourcesDirectory)/out/UVAtlas.sln'
vsVersion: 17.0
platform: x64
configuration: Release
msbuildArchitecture: x64
- task: CodeQL3000Finalize@0
condition: always()
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs: