本文整理汇总了C++中CModelTexture2DResource::getPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelTexture2DResource::getPath方法的具体用法?C++ CModelTexture2DResource::getPath怎么用?C++ CModelTexture2DResource::getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelTexture2DResource
的用法示例。
在下文中一共展示了CModelTexture2DResource::getPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CNMRException
LIB3MFMETHODIMP CCOMModelTexture2D::ReadFromFile(_In_z_ LPCWSTR pwszFilename)
{
try {
if (pwszFilename == nullptr)
throw CNMRException(NMR_ERROR_INVALIDPOINTER);
CModelTexture2DResource * pTextureResource = getTexture2D();
__NMRASSERT(pTextureResource);
PImportStream pImportStream = std::make_shared<CImportStream_COM>(pwszFilename);
CModel * pModel = pTextureResource->getModel();
__NMRASSERT(pModel);
pModel->removeTextureStream(pTextureResource->getPath());
pModel->addTextureStream(pTextureResource->getPath(), pImportStream);
return handleSuccess();
}
catch (CNMRException & Exception) {
return handleNMRException(&Exception);
}
catch (...) {
return handleGenericException();
}
}
示例2: CNMRException
LIB3MFMETHODIMP CCOMModelTexture2D::ReadFromBuffer(_In_ BYTE * pBuffer, _In_ ULONG64 cbBufferSize)
{
try {
if (pBuffer == nullptr)
throw CNMRException(NMR_ERROR_INVALIDPOINTER);
CModelTexture2DResource * pTextureResource = getTexture2D();
__NMRASSERT(pTextureResource);
PImportStream pImportStream = std::make_shared<CImportStream_Memory>(pBuffer, cbBufferSize);
CModel * pModel = pTextureResource->getModel();
__NMRASSERT(pModel);
pModel->removeAttachment(pTextureResource->getPath());
pModel->addAttachment(pTextureResource->getPath(), PACKAGE_TEXTURE_RELATIONSHIP_TYPE, pImportStream);
return handleSuccess();
}
catch (CNMRException & Exception) {
return handleNMRException(&Exception);
}
catch (...) {
return handleGenericException();
}
}