diff --git a/UVAtlas/inc/UVAtlas.h b/UVAtlas/inc/UVAtlas.h index 540f245c..65212e4d 100644 --- a/UVAtlas/inc/UVAtlas.h +++ b/UVAtlas/inc/UVAtlas.h @@ -23,7 +23,7 @@ #include #include -#define UVATLAS_VERSION 160 +#define UVATLAS_VERSION 170 namespace DirectX { @@ -149,7 +149,7 @@ namespace DirectX _Inout_opt_ std::vector* pvFacePartitioning = nullptr, _Inout_opt_ std::vector* pvVertexRemapArray = nullptr, _Out_opt_ float *maxStretchOut = nullptr, - _Out_opt_ size_t *numChartsOut = nullptr); + _Out_opt_ size_t *numChartsOut = nullptr) noexcept; // This has the same exact arguments as Create, except that it does not perform the // final packing step. This method allows one to get a partitioning out, and possibly @@ -196,7 +196,7 @@ namespace DirectX _Inout_opt_ std::vector* pvVertexRemapArray, _Inout_ std::vector& vPartitionResultAdjacency, _Out_opt_ float *maxStretchOut = nullptr, - _Out_opt_ size_t *numChartsOut = nullptr); + _Out_opt_ size_t *numChartsOut = nullptr) noexcept; // This takes the face partitioning result from Partition and packs it into an // atlas of the given size. pPartitionResultAdjacency should be derived from @@ -210,7 +210,7 @@ namespace DirectX _In_ float gutter, _In_ const std::vector& vPartitionResultAdjacency, _In_opt_ std::function statusCallBack, - _In_ float callbackFrequency); + _In_ float callbackFrequency) noexcept; //============================================================================ @@ -252,7 +252,7 @@ namespace DirectX _In_ size_t signalDimension, _In_ size_t signalStride, _In_opt_ std::function statusCallBack, - _Out_writes_(nFaces * 3) float* pIMTArray); + _Out_writes_(nFaces * 3) float* pIMTArray) noexcept; // This function is used to calculate the IMT from data that varies over the // surface of the mesh (generally at a higher frequency than vertex data). @@ -285,7 +285,7 @@ namespace DirectX signalCallback, _In_opt_ void *userData, _In_opt_ std::function statusCallBack, - _Out_writes_(nFaces * 3) float* pIMTArray); + _Out_writes_(nFaces * 3) float* pIMTArray) noexcept; // This function is used to calculate the IMT from texture data. Given a texture // that maps over the surface of the mesh, the algorithm computes the IMT for @@ -309,7 +309,7 @@ namespace DirectX _In_ size_t height, _In_ DWORD options, _In_opt_ std::function statusCallBack, - _Out_writes_(nFaces * 3) float* pIMTArray); + _Out_writes_(nFaces * 3) float* pIMTArray) noexcept; // This function is very similar to UVAtlasComputeIMTFromTexture, but it can // calculate higher dimensional values than 4. @@ -325,18 +325,18 @@ namespace DirectX _In_reads_(nVerts) const XMFLOAT3* positions, _In_reads_(nVerts) const XMFLOAT2* texcoords, _In_ size_t nVerts, - _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint16_t))) - _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices, + _When_(indexFormat == DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * sizeof(uint16_t))) + _When_(indexFormat != DXGI_FORMAT_R16_UINT, _In_reads_bytes_(nFaces * sizeof(uint32_t))) const void* indices, _In_ DXGI_FORMAT indexFormat, _In_ size_t nFaces, - _In_reads_(width*height*nComponents) const float *pTexelSignal, + _In_reads_(width* height* nComponents) const float* pTexelSignal, _In_ size_t width, _In_ size_t height, _In_ size_t signalDimension, _In_ size_t nComponents, _In_ DWORD options, _In_opt_ std::function statusCallBack, - _Out_writes_(nFaces * 3) float* pIMTArray); + _Out_writes_(nFaces * 3) float* pIMTArray) noexcept; // This function is for applying the a vertex remap array from UVAtlasCreate/UVAtlasPartition to a vertex buffer // @@ -344,10 +344,10 @@ namespace DirectX // vbout - This is the output vertex buffer and is nNewVerts*stride in size // nNewVerts - This should be >= nVerts HRESULT __cdecl UVAtlasApplyRemap( - _In_reads_bytes_(nVerts*stride) const void* vbin, + _In_reads_bytes_(nVerts* stride) const void* vbin, _In_ size_t stride, _In_ size_t nVerts, _In_ size_t nNewVerts, _In_reads_(nNewVerts) const uint32_t* vertexRemap, - _Out_writes_bytes_(nNewVerts*stride) void* vbout ); + _Out_writes_bytes_(nNewVerts* stride) void* vbout) noexcept; } diff --git a/UVAtlas/isochart/UVAtlas.cpp b/UVAtlas/isochart/UVAtlas.cpp index eb2bb882..975808f0 100644 --- a/UVAtlas/isochart/UVAtlas.cpp +++ b/UVAtlas/isochart/UVAtlas.cpp @@ -586,7 +586,7 @@ HRESULT __cdecl DirectX::UVAtlasPartition( std::vector* pvVertexRemapArray, std::vector& vPartitionResultAdjacency, float *maxStretchOut, - size_t *numChartsOut) + size_t *numChartsOut) noexcept { return UVAtlasPartitionInt(positions, nVerts, @@ -626,7 +626,7 @@ HRESULT __cdecl DirectX::UVAtlasPack( float gutter, const std::vector& vPartitionResultAdjacency, std::function statusCallBack, - float callbackFrequency) + float callbackFrequency) noexcept { return UVAtlasPackInt(vMeshVertexBuffer, vMeshIndexBuffer, @@ -666,7 +666,7 @@ HRESULT __cdecl DirectX::UVAtlasCreate( std::vector* pvFacePartitioning, std::vector* pvVertexRemapArray, float *maxStretchOut, - size_t *numChartsOut) + size_t *numChartsOut) noexcept { std::vector vFacePartitioning; std::vector vAdjacencyOut; @@ -733,7 +733,7 @@ HRESULT __cdecl DirectX::UVAtlasComputeIMTFromPerVertexSignal( size_t signalDimension, size_t signalStride, std::function statusCallBack, - float* pIMTArray) + float* pIMTArray) noexcept { if (!positions || !nVerts || !indices || !nFaces || !pVertexSignal || !pIMTArray) return E_INVALIDARG; @@ -855,7 +855,7 @@ HRESULT __cdecl DirectX::UVAtlasComputeIMTFromSignal( std::function signalCallback, void *userData, std::function statusCallBack, - float* pIMTArray) + float* pIMTArray) noexcept { if (!positions || !texcoords || !nVerts || !indices || !nFaces || !pIMTArray) return E_INVALIDARG; @@ -1241,7 +1241,7 @@ HRESULT __cdecl DirectX::UVAtlasComputeIMTFromTexture( size_t height, DWORD options, std::function statusCallBack, - float* pIMTArray) + float* pIMTArray) noexcept { if (!positions || !texcoords || !nVerts || !indices || !nFaces || !pTexture || !pIMTArray) return E_INVALIDARG; @@ -1644,7 +1644,7 @@ HRESULT __cdecl DirectX::UVAtlasComputeIMTFromPerTexelSignal( size_t nComponents, DWORD options, std::function statusCallBack, - float* pIMTArray) + float* pIMTArray) noexcept { if (!positions || !texcoords || !nVerts || !indices || !nFaces || !pTexelSignal || !pIMTArray) return E_INVALIDARG; @@ -1780,7 +1780,7 @@ HRESULT __cdecl DirectX::UVAtlasApplyRemap( size_t nVerts, size_t nNewVerts, const uint32_t* vertexRemap, - void* vbout ) + void* vbout ) noexcept { if ( !vbin || !stride || !nVerts || !nNewVerts || !vertexRemap || !vbout ) return E_INVALIDARG; diff --git a/UVAtlas/isochart/isochart.h b/UVAtlas/isochart/isochart.h index 127e6d92..9cb2ba06 100644 --- a/UVAtlas/isochart/isochart.h +++ b/UVAtlas/isochart/isochart.h @@ -116,7 +116,7 @@ class IIsochartEngine static IIsochartEngine* CreateIsochartEngine(); static void ReleaseIsochartEngine(IIsochartEngine* pIsochartEngine); - STDMETHOD(Initialize)( + virtual HRESULT Initialize( const void* pVertexArray, size_t VertexCount, size_t VertexStride, @@ -126,18 +126,18 @@ class IIsochartEngine const FLOAT3* pIMTArray, const uint32_t* pOriginalAjacency, const uint32_t* pSplitHint, - DWORD dwOptions) PURE; + DWORD dwOptions) noexcept = 0; - STDMETHOD(Free)() PURE; + virtual HRESULT Free() noexcept = 0; - STDMETHOD(Partition)( + virtual HRESULT Partition( size_t MaxChartNumber, float Stretch, size_t& ChartNumberOut, float& MaxChartStretchOut, - uint32_t* pFaceAttributeIDOut) PURE; + uint32_t* pFaceAttributeIDOut) noexcept = 0; - STDMETHOD(Pack)( + virtual HRESULT Pack( size_t Width, size_t Height, float Gutter, @@ -145,31 +145,29 @@ class IIsochartEngine std::vector* pvVertexArrayOut, std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, - _In_opt_ std::vector* pvAttributeID) PURE; + _In_opt_ std::vector* pvAttributeID) noexcept = 0; - STDMETHOD(SetCallback)( + virtual HRESULT SetCallback( LPISOCHARTCALLBACK pCallback, - float Frequency) PURE; + float Frequency) noexcept = 0; - STDMETHOD(SetStage)( + virtual HRESULT SetStage( unsigned int TotalStageCount, - unsigned int DoneStageCount) PURE; - + unsigned int DoneStageCount) noexcept = 0; - STDMETHOD (ExportPartitionResult)( + virtual HRESULT ExportPartitionResult( std::vector* pvVertexArrayOut, std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, std::vector* pvAttributeIDOut, - std::vector* pvAdjacencyOut) PURE; - + std::vector* pvAdjacencyOut) noexcept = 0; - STDMETHOD (InitializePacking)( + virtual HRESULT InitializePacking( std::vector* pvVertexBuffer, size_t VertexCount, std::vector* pvFaceIndexBuffer, size_t FaceCount, - const uint32_t* pdwFaceAdjacentArrayIn) PURE; + const uint32_t* pdwFaceAdjacentArrayIn) noexcept = 0; }; ///////////////////////////////////////////////////////////////////////// diff --git a/UVAtlas/isochart/isochartengine.cpp b/UVAtlas/isochart/isochartengine.cpp index 3347855a..dac06508 100644 --- a/UVAtlas/isochart/isochartengine.cpp +++ b/UVAtlas/isochart/isochartengine.cpp @@ -90,7 +90,7 @@ HRESULT CIsochartEngine::Initialize( const FLOAT3* pIMTArray, const uint32_t* pOriginalAjacency, const uint32_t* pSplitHint, - DWORD dwOptions) + DWORD dwOptions) noexcept { DPF(1, "Initialize..."); @@ -168,7 +168,7 @@ HRESULT CIsochartEngine::Initialize( } // Release all buffers and reset CIsochartEngine -HRESULT CIsochartEngine::Free() +HRESULT CIsochartEngine::Free() noexcept { HRESULT hr = S_OK; @@ -202,7 +202,7 @@ HRESULT CIsochartEngine::Partition( float Stretch, size_t& ChartNumberOut, float& MaxChartStretchOut, - uint32_t* pFaceAttributeIDOut) + uint32_t* pFaceAttributeIDOut) noexcept { DPF(1, "Partition...."); @@ -711,7 +711,7 @@ HRESULT CIsochartEngine::Pack( std::vector* pvVertexArrayOut, std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, - _In_opt_ std::vector* pvAttributeID) + _In_opt_ std::vector* pvAttributeID) noexcept { DPF(1, "Packing Charts..."); if (!CheckPackParameters( @@ -841,7 +841,7 @@ void CIsochartEngine::ExportPackResultToOrgMesh( // HRESULT CIsochartEngine::SetCallback( LPISOCHARTCALLBACK pCallback, - float Frequency) + float Frequency) noexcept { if (!CheckSetCallbackParameters( pCallback, @@ -869,7 +869,7 @@ HRESULT CIsochartEngine::SetCallback( HRESULT CIsochartEngine::SetStage( unsigned int TotalStageCount, - unsigned int DoneStageCount) + unsigned int DoneStageCount) noexcept { if (TotalStageCount < DoneStageCount) { @@ -899,7 +899,7 @@ HRESULT CIsochartEngine::ExportPartitionResult( std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, std::vector* pvAttributeIDOut, - std::vector* pvAdjacencyOut) + std::vector* pvAdjacencyOut) noexcept { if (!CheckExportPartitionResultParameters( @@ -936,7 +936,7 @@ HRESULT CIsochartEngine::InitializePacking( size_t VertexCount, std::vector* pvFaceIndexBuffer, size_t FaceCount, - const uint32_t* pdwFaceAdjacentArrayIn) + const uint32_t* pdwFaceAdjacentArrayIn) noexcept { if (!CheckInitializePackingParameters( pvVertexBuffer, diff --git a/UVAtlas/isochart/isochartengine.h b/UVAtlas/isochart/isochartengine.h index dca1f9f4..40ecb15b 100644 --- a/UVAtlas/isochart/isochartengine.h +++ b/UVAtlas/isochart/isochartengine.h @@ -26,7 +26,7 @@ class CIsochartEngine : public IIsochartEngine virtual ~CIsochartEngine() override; // IIsochartEngine - STDMETHODIMP Initialize( + virtual HRESULT Initialize( const void* pVertexArray, size_t VertexCount, size_t VertexStride, @@ -36,18 +36,18 @@ class CIsochartEngine : public IIsochartEngine const FLOAT3* pIMTArray, const uint32_t* pOriginalAjacency, const uint32_t* pSplitHint, - DWORD dwOptions) override; + DWORD dwOptions) noexcept override; - STDMETHODIMP Free() override; + virtual HRESULT Free() noexcept override; - STDMETHODIMP Partition( + virtual HRESULT Partition( size_t MaxChartNumber, float Stretch, size_t& ChartNumberOut, float& MaxChartStretchOut, - uint32_t* pFaceAttributeIDOut) override; + uint32_t* pFaceAttributeIDOut) noexcept override; - STDMETHODIMP Pack( + virtual HRESULT Pack( size_t Width, size_t Height, float Gutter, @@ -55,29 +55,29 @@ class CIsochartEngine : public IIsochartEngine std::vector* pvVertexArrayOut, std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, - _In_opt_ std::vector* pvAttributeID) override; + _In_opt_ std::vector* pvAttributeID) noexcept override; - STDMETHODIMP SetCallback( + virtual HRESULT SetCallback( LPISOCHARTCALLBACK pCallback, - float Frequency) override; + float Frequency) noexcept override; - STDMETHODIMP SetStage( + virtual HRESULT SetStage( unsigned int TotalStageCount, - unsigned int DoneStageCount) override; + unsigned int DoneStageCount) noexcept override; - STDMETHODIMP ExportPartitionResult( + virtual HRESULT ExportPartitionResult( std::vector* pvVertexArrayOut, std::vector* pvFaceIndexArrayOut, std::vector* pvVertexRemapArrayOut, std::vector* pvAttributeIDOut, - std::vector* pvAdjacencyOut) override; + std::vector* pvAdjacencyOut) noexcept override; - STDMETHODIMP InitializePacking( + virtual HRESULT InitializePacking( std::vector* pvVertexBuffer, size_t VertexCount, std::vector* pvFaceIndexBuffer, size_t FaceCount, - const uint32_t* pdwFaceAdjacentArrayIn) override; + const uint32_t* pdwFaceAdjacentArrayIn) noexcept override; HRESULT CreateEngineMutex(); private: