From 9c34153fd6bae42d5501ba7aaf0c9415e543add2 Mon Sep 17 00:00:00 2001 From: Erika Harrison Date: Thu, 9 Nov 2023 18:35:04 -0700 Subject: [PATCH 001/202] Expand function tracing for materialx performance profiling --- pxr/usd/usdMtlx/discovery.cpp | 18 +++++++++++++++++- pxr/usd/usdMtlx/parser.cpp | 30 +++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/pxr/usd/usdMtlx/discovery.cpp b/pxr/usd/usdMtlx/discovery.cpp index 439b790e73..0dfed8e3f1 100644 --- a/pxr/usd/usdMtlx/discovery.cpp +++ b/pxr/usd/usdMtlx/discovery.cpp @@ -1,5 +1,5 @@ // -// Copyright 2018 Pixar +// Copyright 2023 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in @@ -33,6 +33,8 @@ #include #include +#include "pxr/base/trace/trace.h" + namespace mx = MaterialX; PXR_NAMESPACE_OPEN_SCOPE @@ -52,6 +54,8 @@ using _NameMapping = std::map; void _MapNodeNamesToBaseForVersioning(mx::ConstElementPtr mtlx, _NameMapping* mapping) { + TRACE_FUNCTION(); + static const std::string inheritAttr("inherit"); // Find shortest: @@ -102,6 +106,8 @@ _MapNodeNamesToBaseForVersioning(mx::ConstElementPtr mtlx, _NameMapping* mapping _NameMapping _ComputeNameMapping(const mx::ConstDocumentPtr& doc) { + TRACE_FUNCTION(); + _NameMapping result; // For each nodeDef with an inheritance chain, we populate the @@ -134,6 +140,8 @@ _ComputeNameMapping(const mx::ConstDocumentPtr& doc) std::string _ChooseName(const std::string& nodeDefName, const _NameMapping& nameMapping) { + TRACE_FUNCTION(); + auto i = nameMapping.find(nodeDefName); return i == nameMapping.end() ? nodeDefName : i->second; } @@ -146,6 +154,8 @@ _DiscoverNodes( const NdrDiscoveryUri& fileResult, const _NameMapping& nameMapping) { + TRACE_FUNCTION(); + static const TfToken family = TfToken(); // Get the node definitions @@ -187,6 +197,8 @@ class UsdMtlxDiscoveryPlugin : public NdrDiscoveryPlugin { UsdMtlxDiscoveryPlugin::UsdMtlxDiscoveryPlugin() { + TRACE_FUNCTION(); + _customSearchPaths = UsdMtlxCustomSearchPaths(); _allSearchPaths = UsdMtlxSearchPaths(); } @@ -194,6 +206,8 @@ UsdMtlxDiscoveryPlugin::UsdMtlxDiscoveryPlugin() NdrNodeDiscoveryResultVec UsdMtlxDiscoveryPlugin::DiscoverNodes(const Context& context) { + TRACE_FUNCTION(); + NdrNodeDiscoveryResultVec result; // Merge all MaterialX standard library files into a single document. @@ -226,6 +240,8 @@ UsdMtlxDiscoveryPlugin::DiscoverNodes(const Context& context) const NdrStringVec& UsdMtlxDiscoveryPlugin::GetSearchURIs() const { + TRACE_FUNCTION(); + return _allSearchPaths; } diff --git a/pxr/usd/usdMtlx/parser.cpp b/pxr/usd/usdMtlx/parser.cpp index a8473ebea5..173180ac80 100644 --- a/pxr/usd/usdMtlx/parser.cpp +++ b/pxr/usd/usdMtlx/parser.cpp @@ -1,5 +1,5 @@ // -// Copyright 2018 Pixar +// Copyright 2023 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in @@ -37,6 +37,8 @@ #include "pxr/base/tf/staticTokens.h" #include "pxr/base/tf/stringUtils.h" +#include "pxr/base/trace/trace.h" + namespace mx = MaterialX; PXR_NAMESPACE_OPEN_SCOPE @@ -77,6 +79,8 @@ TF_DEFINE_ENV_SETTING(USDMTLX_PRIMARY_UV_NAME, "", static const std::string _GetPrimaryUvSetName() { + TRACE_FUNCTION(); + static const std::string env = TfGetEnvSetting(USDMTLX_PRIMARY_UV_NAME); if (env.empty()) { return UsdUtilsGetPrimaryUVSetName(); @@ -100,6 +104,8 @@ struct ShaderBuilder { NdrNodeUniquePtr Build() { + TRACE_FUNCTION(); + if (!*this) { return NdrParserPlugin::GetInvalidNode(discoveryResult); } @@ -120,6 +126,8 @@ struct ShaderBuilder { void AddPropertyNameRemapping(const std::string& from, const std::string& to) { + TRACE_FUNCTION(); + if (from != to) { _propertyNameRemapping[from] = to; } @@ -151,6 +159,8 @@ ParseMetadata( const mx::ConstElementPtr& element, const std::string& attribute) { + TRACE_FUNCTION(); + const auto& value = element->getAttribute(attribute); if (!value.empty()) { metadata.emplace(key, value); @@ -164,6 +174,8 @@ ParseMetadata( const TfToken& key, const mx::ConstElementPtr& element) { + TRACE_FUNCTION(); + const auto& value = element->getAttribute(key); if (!value.empty()) { metadata.emplace(key, value); @@ -177,6 +189,8 @@ ParseOptions( const mx::ConstElementPtr& element ) { + TRACE_FUNCTION(); + const auto& enumLabels = element->getAttribute(_tokens->enum_); if (enumLabels.empty()) { return; @@ -228,6 +242,8 @@ ShaderBuilder::AddProperty( const mx::ConstTypedElementPtr& element, bool isOutput, NdrStringVec *primvars, bool addedTexcoordPrimvar) { + TRACE_FUNCTION(); + TfToken type; NdrTokenMap metadata; NdrTokenMap hints; @@ -397,6 +413,8 @@ ParseMetadata( const mx::ConstElementPtr& element, const std::string& attribute) { + TRACE_FUNCTION(); + const auto& value = element->getAttribute(attribute); if (!value.empty()) { // Change the 'texture2d' role for stdlib MaterialX Texture nodes @@ -414,6 +432,8 @@ static TfToken GetContext(const mx::ConstDocumentPtr& doc, const std::string& type) { + TRACE_FUNCTION(); + if (doc) { if (auto mtlxTypeDef = doc->getTypeDef(type)) { // Use the context if the type has "shader" semantic. @@ -429,6 +449,8 @@ static void ParseElement(ShaderBuilder* builder, const mx::ConstNodeDefPtr& nodeDef) { + TRACE_FUNCTION(); + if (!TF_VERIFY(nodeDef)) { return; } @@ -556,6 +578,8 @@ class UsdMtlxParserPlugin : public NdrParserPlugin { NdrNodeUniquePtr UsdMtlxParserPlugin::Parse(const NdrNodeDiscoveryResult& discoveryResult) { + TRACE_FUNCTION(); + MaterialX::ConstDocumentPtr document = nullptr; // Get the MaterialX document. if (!discoveryResult.resolvedUri.empty()) { @@ -594,6 +618,8 @@ UsdMtlxParserPlugin::Parse(const NdrNodeDiscoveryResult& discoveryResult) const NdrTokenVec& UsdMtlxParserPlugin::GetDiscoveryTypes() const { + TRACE_FUNCTION(); + static const NdrTokenVec discoveryTypes = { _tokens->discoveryType }; @@ -603,6 +629,8 @@ UsdMtlxParserPlugin::GetDiscoveryTypes() const const TfToken& UsdMtlxParserPlugin::GetSourceType() const { + TRACE_FUNCTION(); + return _tokens->sourceType; } From 79e2dbecd3f8a6e317b38951603b3e9d31c2d572 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 12 Dec 2023 16:14:23 -0800 Subject: [PATCH 002/202] [hdSt] Enable Hgi resource generation for non-HgiGL Hgi backends, such as HgiVulkan, by default. --- pxr/imaging/hdSt/codeGen.cpp | 15 ++++++------- pxr/imaging/hdSt/codeGen.h | 5 ++--- pxr/imaging/hdSt/commandBuffer.cpp | 25 +++++++++++----------- pxr/imaging/hdSt/commandBuffer.h | 8 +++---- pxr/imaging/hdSt/imageShaderRenderPass.cpp | 4 +--- pxr/imaging/hdSt/pipelineDrawBatch.cpp | 6 +++--- pxr/imaging/hdSt/pipelineDrawBatch.h | 4 ++-- pxr/imaging/hdSt/renderPass.cpp | 6 ++---- 8 files changed, 33 insertions(+), 40 deletions(-) diff --git a/pxr/imaging/hdSt/codeGen.cpp b/pxr/imaging/hdSt/codeGen.cpp index 28c14c8138..db3329b625 100644 --- a/pxr/imaging/hdSt/codeGen.cpp +++ b/pxr/imaging/hdSt/codeGen.cpp @@ -152,17 +152,16 @@ TF_DEFINE_ENV_SETTING(HDST_ENABLE_HGI_RESOURCE_GENERATION, false, /* static */ bool -HdSt_CodeGen::IsEnabledHgiResourceGeneration( - HgiCapabilities const *hgiCapabilities) +HdSt_CodeGen::IsEnabledHgiResourceGeneration(Hgi const *hgi) { static bool const isEnabled = TfGetEnvSetting(HDST_ENABLE_HGI_RESOURCE_GENERATION); + + TfToken const& hgiName = hgi->GetAPIName(); - // Hgi resource generation is required for Metal - bool const isMetal = - hgiCapabilities->IsSet(HgiDeviceCapabilitiesBitsMetalTessellation); - - return isEnabled || isMetal; + // Check if is env var is true, otherwise return true if NOT using HgiGL, + // as Hgi resource generation is required for Metal and Vulkan. + return isEnabled || hgiName != HgiTokens->OpenGL; } HdSt_CodeGen::HdSt_CodeGen(HdSt_GeometricShaderPtr const &geometricShader, @@ -1684,7 +1683,7 @@ HdSt_CodeGen::Compile(HdStResourceRegistry*const registry) capabilities->IsSet(HgiDeviceCapabilitiesBitsDepthRangeMinusOnetoOne); bool const useHgiResourceGeneration = - IsEnabledHgiResourceGeneration(capabilities); + IsEnabledHgiResourceGeneration(registry->GetHgi()); // shader sources // geometric shader owns main() diff --git a/pxr/imaging/hdSt/codeGen.h b/pxr/imaging/hdSt/codeGen.h index b9a38d6f4c..f40df795f7 100644 --- a/pxr/imaging/hdSt/codeGen.h +++ b/pxr/imaging/hdSt/codeGen.h @@ -41,7 +41,7 @@ using HdStShaderCodeSharedPtr = std::shared_ptr; using HdStShaderCodeSharedPtrVector = std::vector; using HdSt_GeometricShaderPtr = std::shared_ptr; -class HgiCapabilities; +class Hgi; /// \class HdSt_CodeGen /// @@ -56,8 +56,7 @@ class HdSt_CodeGen /// Returns true if shader resource definitions are being /// generated by Hgi or false if shader resource definitions /// are generated as native GLSL. - static bool IsEnabledHgiResourceGeneration( - HgiCapabilities const *capabilities); + static bool IsEnabledHgiResourceGeneration(Hgi const *hgi); /// Constructor. HDST_API diff --git a/pxr/imaging/hdSt/commandBuffer.cpp b/pxr/imaging/hdSt/commandBuffer.cpp index 95c0a959b4..46c65fba27 100644 --- a/pxr/imaging/hdSt/commandBuffer.cpp +++ b/pxr/imaging/hdSt/commandBuffer.cpp @@ -30,7 +30,6 @@ #include "pxr/imaging/hdSt/resourceRegistry.h" #include "pxr/imaging/hdSt/materialNetworkShader.h" -#include "pxr/imaging/hgi/capabilities.h" #include "pxr/imaging/hgi/computeCmds.h" #include "pxr/imaging/hd/perfLog.h" @@ -64,9 +63,9 @@ HdStCommandBuffer::~HdStCommandBuffer() = default; static HdSt_DrawBatchSharedPtr _NewDrawBatch(HdStDrawItemInstance * drawItemInstance, - HgiCapabilities const * hgiCapabilities) + Hgi const * hgi) { - if (HdSt_PipelineDrawBatch::IsEnabled(hgiCapabilities)) { + if (HdSt_PipelineDrawBatch::IsEnabled(hgi)) { return std::make_shared(drawItemInstance); } else { return std::make_shared(drawItemInstance); @@ -75,17 +74,18 @@ _NewDrawBatch(HdStDrawItemInstance * drawItemInstance, static bool -_IsEnabledFrustumCullCPU(HgiCapabilities const * const capabilities) +_IsEnabledFrustumCullCPU(Hgi const *hgi) { if (TfDebug::IsEnabled(HDST_DISABLE_FRUSTUM_CULLING)) { return false; } + HgiCapabilities const * const capabilities = hgi->GetCapabilities(); const bool multiDrawIndirectEnabled = capabilities->IsSet(HgiDeviceCapabilitiesBitsMultiDrawIndirect); const bool gpuFrustumCullingEnabled = - HdSt_PipelineDrawBatch::IsEnabled(capabilities) ? + HdSt_PipelineDrawBatch::IsEnabled(hgi) ? HdSt_PipelineDrawBatch::IsEnabledGPUFrustumCulling() : HdSt_IndirectDrawBatch::IsEnabledGPUFrustumCulling(); @@ -110,9 +110,8 @@ HdStCommandBuffer::PrepareDraw( } Hgi const * const hgi = resourceRegistry->GetHgi(); - HgiCapabilities const * const capabilities = hgi->GetCapabilities(); - if (_IsEnabledFrustumCullCPU(capabilities)) { + if (_IsEnabledFrustumCullCPU(hgi)) { const bool freezeCulling = TfDebug::IsEnabled(HD_FREEZE_CULL_FRUSTUM); if (!freezeCulling) { @@ -184,20 +183,20 @@ void HdStCommandBuffer::SetDrawItems( HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentDrawBatchesVersion, - HgiCapabilities const *hgiCapabilities) + Hgi const *hgi) { if (drawItems == _drawItems && currentDrawBatchesVersion == _drawBatchesVersion) { return; } _drawItems = drawItems; - _RebuildDrawBatches(hgiCapabilities); + _RebuildDrawBatches(hgi); _drawBatchesVersion = currentDrawBatchesVersion; } void HdStCommandBuffer::RebuildDrawBatchesIfNeeded(unsigned currentBatchesVersion, - HgiCapabilities const *hgiCapabilities) + Hgi const *hgi) { HD_TRACE_FUNCTION(); @@ -255,12 +254,12 @@ HdStCommandBuffer::RebuildDrawBatchesIfNeeded(unsigned currentBatchesVersion, } if (rebuildAllDrawBatches) { - _RebuildDrawBatches(hgiCapabilities); + _RebuildDrawBatches(hgi); } } void -HdStCommandBuffer::_RebuildDrawBatches(HgiCapabilities const *hgiCapabilities) +HdStCommandBuffer::_RebuildDrawBatches(Hgi const *hgi) { HD_TRACE_FUNCTION(); @@ -353,7 +352,7 @@ HdStCommandBuffer::_RebuildDrawBatches(HgiCapabilities const *hgiCapabilities) if (!batched) { HdSt_DrawBatchSharedPtr batch = - _NewDrawBatch(drawItemInstance, hgiCapabilities); + _NewDrawBatch(drawItemInstance, hgi); _drawBatches.emplace_back(batch); prevBatch.Update(key, batch); diff --git a/pxr/imaging/hdSt/commandBuffer.h b/pxr/imaging/hdSt/commandBuffer.h index 204344f8eb..a8e5d7e36a 100644 --- a/pxr/imaging/hdSt/commandBuffer.h +++ b/pxr/imaging/hdSt/commandBuffer.h @@ -39,7 +39,7 @@ PXR_NAMESPACE_OPEN_SCOPE class HdRenderIndex; class HdStDrawItem; class HdStDrawItemInstance; -class HgiCapabilities; +class Hgi; class HgiGraphicsCmds; using HdStRenderPassStateSharedPtr = std::shared_ptr; @@ -90,12 +90,12 @@ class HdStCommandBuffer { HDST_API void SetDrawItems(HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentBatchVersion, - HgiCapabilities const *hgiCapabilities); + Hgi const *hgi); /// Rebuild all draw batches if any underlying buffer array is invalidated. HDST_API void RebuildDrawBatchesIfNeeded(unsigned currentBatchVersion, - HgiCapabilities const *hgiCapabilities); + Hgi const *hgi); /// Returns the total number of draw items, including culled items. size_t GetTotalSize() const { @@ -118,7 +118,7 @@ class HdStCommandBuffer { void SetEnableTinyPrimCulling(bool tinyPrimCulling); private: - void _RebuildDrawBatches(HgiCapabilities const *hgiCapabilities); + void _RebuildDrawBatches(Hgi const *hgi); /// Cull drawItemInstances based on view frustum cull matrix void _FrustumCullCPU(GfMatrix4d const &cullMatrix); diff --git a/pxr/imaging/hdSt/imageShaderRenderPass.cpp b/pxr/imaging/hdSt/imageShaderRenderPass.cpp index eebb10b7c2..39d0568868 100644 --- a/pxr/imaging/hdSt/imageShaderRenderPass.cpp +++ b/pxr/imaging/hdSt/imageShaderRenderPass.cpp @@ -50,14 +50,12 @@ _NewDrawBatch(HdStDrawItemInstance *drawItemInstance, HdStResourceRegistrySharedPtr const &resourceRegistry = std::static_pointer_cast( index->GetResourceRegistry()); - HgiCapabilities const *hgiCapabilities = - resourceRegistry->GetHgi()->GetCapabilities(); // Since we're just drawing a single full-screen triangle // we don't want frustum culling or indirect command encoding. bool const allowGpuFrustumCulling = false; bool const allowIndirectCommandEncoding = false; - if (HdSt_PipelineDrawBatch::IsEnabled(hgiCapabilities)) { + if (HdSt_PipelineDrawBatch::IsEnabled(resourceRegistry->GetHgi())) { return std::make_shared( drawItemInstance, allowGpuFrustumCulling, diff --git a/pxr/imaging/hdSt/pipelineDrawBatch.cpp b/pxr/imaging/hdSt/pipelineDrawBatch.cpp index b1b6e381ae..66707e55b7 100644 --- a/pxr/imaging/hdSt/pipelineDrawBatch.cpp +++ b/pxr/imaging/hdSt/pipelineDrawBatch.cpp @@ -160,10 +160,10 @@ HdSt_PipelineDrawBatch::SetEnableTinyPrimCulling(bool tinyPrimCulling) /* static */ bool -HdSt_PipelineDrawBatch::IsEnabled(HgiCapabilities const *hgiCapabilities) +HdSt_PipelineDrawBatch::IsEnabled(Hgi const *hgi) { // We require Hgi resource generation. - return HdSt_CodeGen::IsEnabledHgiResourceGeneration(hgiCapabilities); + return HdSt_CodeGen::IsEnabledHgiResourceGeneration(hgi); } /* static */ @@ -1122,7 +1122,7 @@ _BindingState::GetBindingsForDrawing( binder.GetBindingRequestBindingDesc(bindingsDesc, req); } HdSt_TextureBinder::GetBindingDescs( - binder, bindingsDesc, shader->GetNamedTextureHandles()); + binder, bindingsDesc, shader->GetNamedTextureHandles()); } } diff --git a/pxr/imaging/hdSt/pipelineDrawBatch.h b/pxr/imaging/hdSt/pipelineDrawBatch.h index bbdac8eee1..647f7e487c 100644 --- a/pxr/imaging/hdSt/pipelineDrawBatch.h +++ b/pxr/imaging/hdSt/pipelineDrawBatch.h @@ -34,7 +34,7 @@ PXR_NAMESPACE_OPEN_SCOPE -class HgiCapabilities; +class Hgi; struct HgiIndirectCommands; using HdStBindingRequestVector = std::vector; @@ -92,7 +92,7 @@ class HdSt_PipelineDrawBatch : public HdSt_DrawBatch /// Returns whether pipeline draw batching is enabled. HDST_API - static bool IsEnabled(HgiCapabilities const *hgiCapabilities); + static bool IsEnabled(Hgi const *hgi); /// Returns whether to do frustum culling on the GPU HDST_API diff --git a/pxr/imaging/hdSt/renderPass.cpp b/pxr/imaging/hdSt/renderPass.cpp index 672a694320..253e9fb4d8 100644 --- a/pxr/imaging/hdSt/renderPass.cpp +++ b/pxr/imaging/hdSt/renderPass.cpp @@ -339,8 +339,7 @@ HdSt_RenderPass::_UpdateCommandBuffer(TfTokenVector const& renderTags) const int batchVersion = _GetDrawBatchesVersion(GetRenderIndex()); // Rebuild draw batches based on new draw items if (_drawItemsChanged) { - _cmdBuffer.SetDrawItems(_drawItems, batchVersion, - _hgi->GetCapabilities()); + _cmdBuffer.SetDrawItems(_drawItems, batchVersion, _hgi); _drawItemsChanged = false; size_t itemCount = _cmdBuffer.GetTotalSize(); @@ -348,8 +347,7 @@ HdSt_RenderPass::_UpdateCommandBuffer(TfTokenVector const& renderTags) } else { // validate command buffer to not include expired drawItems, // which could be produced by migrating BARs at the new repr creation. - _cmdBuffer.RebuildDrawBatchesIfNeeded(batchVersion, - _hgi->GetCapabilities()); + _cmdBuffer.RebuildDrawBatchesIfNeeded(batchVersion, _hgi); } // ------------------------------------------------------------------- From 82c5727c23cba71ee52caa89f00ce27a1507ea3f Mon Sep 17 00:00:00 2001 From: Mark Tucker Date: Wed, 17 Nov 2021 12:36:53 -0500 Subject: [PATCH 003/202] Ignore reparse points on network file systems. The destination is unlikely to be accessible from the remote machine. # Conflicts: # pxr/base/tf/fileUtils.cpp --- pxr/base/tf/fileUtils.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pxr/base/tf/fileUtils.cpp b/pxr/base/tf/fileUtils.cpp index 8a544dd2f5..6f89cf09bb 100644 --- a/pxr/base/tf/fileUtils.cpp +++ b/pxr/base/tf/fileUtils.cpp @@ -83,8 +83,7 @@ Tf_HasAttribute( if (path.back() == '/' || path.back() == '\\') resolveSymlinks = true; - const DWORD attribs = - GetFileAttributesW(ArchWindowsUtf8ToUtf16(path).c_str()); + DWORD attribs = GetFileAttributesW(ArchWindowsUtf8ToUtf16(path).c_str()); if (attribs == INVALID_FILE_ATTRIBUTES) { if (attribute == 0 && (GetLastError() == ERROR_FILE_NOT_FOUND || @@ -94,6 +93,21 @@ Tf_HasAttribute( } return false; } + + // Ignore reparse points on network volumes. They can't be resolved + // properly, so simply remove the reparse point attribute and treat + // if like a regular file/directory. + if ((attribs & FILE_ATTRIBUTE_REPARSE_POINT) != 0) { + // Calling PathIsNetworkPath sometimes sets the "last error" to an + // error code indicating an incomplete overlapped I/O function. We + // want to ignore this error. + DWORD olderr = GetLastError(); + if (PathIsNetworkPathW(ArchWindowsUtf8ToUtf16(path).c_str())) { + attribs &= ~FILE_ATTRIBUTE_REPARSE_POINT; + } + SetLastError(olderr); + } + if (!resolveSymlinks || (attribs & FILE_ATTRIBUTE_REPARSE_POINT) == 0) { return attribute == 0 || (attribs & attribute) == expected; } From 0c2594d874348bd37292d73147899752d62adcfa Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Fri, 16 Feb 2024 12:46:25 -0800 Subject: [PATCH 004/202] Test using volk --- pxr/imaging/hgiVulkan/CMakeLists.txt | 1 + pxr/imaging/hgiVulkan/device.cpp | 52 ++++++++++++++++++++++++++-- pxr/imaging/hgiVulkan/instance.cpp | 6 ++++ pxr/imaging/hgiVulkan/volk.cpp | 26 ++++++++++++++ pxr/imaging/hgiVulkan/volk.h | 31 +++++++++++++++++ pxr/imaging/hgiVulkan/vulkan.h | 2 +- 6 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 pxr/imaging/hgiVulkan/volk.cpp create mode 100644 pxr/imaging/hgiVulkan/volk.h diff --git a/pxr/imaging/hgiVulkan/CMakeLists.txt b/pxr/imaging/hgiVulkan/CMakeLists.txt index 061c742af1..716fad14f5 100644 --- a/pxr/imaging/hgiVulkan/CMakeLists.txt +++ b/pxr/imaging/hgiVulkan/CMakeLists.txt @@ -41,6 +41,7 @@ pxr_library(hgiVulkan shaderSection texture vk_mem_alloc + volk PUBLIC_HEADERS api.h diff --git a/pxr/imaging/hgiVulkan/device.cpp b/pxr/imaging/hgiVulkan/device.cpp index 9cd361b226..ee8db15120 100755 --- a/pxr/imaging/hgiVulkan/device.cpp +++ b/pxr/imaging/hgiVulkan/device.cpp @@ -28,7 +28,6 @@ #include "pxr/imaging/hgiVulkan/hgi.h" #include "pxr/imaging/hgiVulkan/instance.h" #include "pxr/imaging/hgiVulkan/pipelineCache.h" -#include "pxr/imaging/hgiVulkan/vk_mem_alloc.h" #include "pxr/base/tf/diagnostic.h" @@ -59,16 +58,34 @@ _GetGraphicsQueueFamilyIndex(VkPhysicalDevice physicalDevice) static bool _SupportsPresentation( + HgiVulkanInstance* instance, VkPhysicalDevice physicalDevice, uint32_t familyIndex) { + // XXX With volk, these functions weren't loaded correctly for me (would + // crash when called). Loading them like this seems to work. Unsure why. #if defined(VK_USE_PLATFORM_WIN32_KHR) + VkInstance vkInstance = instance->GetVulkanInstance(); + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR + vkGetPhysicalDeviceWin32PresentationSupportKHR = + (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR) + vkGetInstanceProcAddr( + vkInstance, + "vkGetPhysicalDeviceWin32PresentationSupportKHR"); return vkGetPhysicalDeviceWin32PresentationSupportKHR( physicalDevice, familyIndex); #elif defined(VK_USE_PLATFORM_XLIB_KHR) Display* dsp = XOpenDisplay(nullptr); VisualID visualID = XVisualIDFromVisual( DefaultVisual(dsp, DefaultScreen(dsp))); + + VkInstance vkInstance = instance->GetVulkanInstance(); + PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR + vkGetPhysicalDeviceXlibPresentationSupportKHR = + (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR) + vkGetInstanceProcAddr( + vkInstance, + "vkGetPhysicalDeviceXlibPresentationSupportKHR"); return vkGetPhysicalDeviceXlibPresentationSupportKHR( physicalDevice, familyIndex, dsp, visualID); #elif defined(VK_USE_PLATFORM_MACOS_MVK) @@ -111,7 +128,7 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance) if (familyIndex == VK_QUEUE_FAMILY_IGNORED) continue; // Assume we always want a presentation capable device for now. - if (!_SupportsPresentation(physicalDevices[i], familyIndex)) { + if (!_SupportsPresentation(instance, physicalDevices[i], familyIndex)) { continue; } @@ -307,6 +324,8 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance) &_vkDevice) == VK_SUCCESS ); + volkLoadDevice(_vkDevice); + HgiVulkanSetupDeviceDebug(instance, this); // @@ -332,6 +351,35 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance) allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT; } + // If we ever wish to use functions from Vulkan 1.1+ (i.e. use a later + // version of VMA), we'll need to add those functions here. + VmaVulkanFunctions vmaVulkanFunctions = {}; + vmaVulkanFunctions.vkGetInstanceProcAddr = vkGetInstanceProcAddr; + vmaVulkanFunctions.vkGetDeviceProcAddr = vkGetDeviceProcAddr; + vmaVulkanFunctions.vkAllocateMemory = vkAllocateMemory; + vmaVulkanFunctions.vkBindBufferMemory = vkBindBufferMemory; + vmaVulkanFunctions.vkBindImageMemory = vkBindImageMemory; + vmaVulkanFunctions.vkCreateBuffer = vkCreateBuffer; + vmaVulkanFunctions.vkCreateImage = vkCreateImage; + vmaVulkanFunctions.vkDestroyBuffer = vkDestroyBuffer; + vmaVulkanFunctions.vkDestroyImage = vkDestroyImage; + vmaVulkanFunctions.vkFlushMappedMemoryRanges = vkFlushMappedMemoryRanges; + vmaVulkanFunctions.vkFreeMemory = vkFreeMemory; + vmaVulkanFunctions.vkGetBufferMemoryRequirements = + vkGetBufferMemoryRequirements; + vmaVulkanFunctions.vkGetImageMemoryRequirements = + vkGetImageMemoryRequirements; + vmaVulkanFunctions.vkGetPhysicalDeviceMemoryProperties = + vkGetPhysicalDeviceMemoryProperties; + vmaVulkanFunctions.vkGetPhysicalDeviceProperties = + vkGetPhysicalDeviceProperties; + vmaVulkanFunctions.vkInvalidateMappedMemoryRanges = + vkInvalidateMappedMemoryRanges; + vmaVulkanFunctions.vkMapMemory = vkMapMemory; + vmaVulkanFunctions.vkUnmapMemory = vkUnmapMemory; + vmaVulkanFunctions.vkCmdCopyBuffer = vkCmdCopyBuffer; + allocatorInfo.pVulkanFunctions = &vmaVulkanFunctions; + TF_VERIFY( vmaCreateAllocator(&allocatorInfo, &_vmaAllocator) == VK_SUCCESS ); diff --git a/pxr/imaging/hgiVulkan/instance.cpp b/pxr/imaging/hgiVulkan/instance.cpp index 9a40230e8e..5efcbc8ab6 100755 --- a/pxr/imaging/hgiVulkan/instance.cpp +++ b/pxr/imaging/hgiVulkan/instance.cpp @@ -39,6 +39,10 @@ HgiVulkanInstance::HgiVulkanInstance() , vkDestroyDebugUtilsMessengerEXT(nullptr) , _vkInstance(nullptr) { + TF_VERIFY( + volkInitialize() == VK_SUCCESS + ); + VkApplicationInfo appInfo = {VK_STRUCTURE_TYPE_APPLICATION_INFO}; appInfo.apiVersion = VK_API_VERSION_1_3; @@ -88,6 +92,8 @@ HgiVulkanInstance::HgiVulkanInstance() &_vkInstance) == VK_SUCCESS ); + volkLoadInstance(_vkInstance); + HgiVulkanCreateDebug(this); } diff --git a/pxr/imaging/hgiVulkan/volk.cpp b/pxr/imaging/hgiVulkan/volk.cpp new file mode 100644 index 0000000000..bd4166caed --- /dev/null +++ b/pxr/imaging/hgiVulkan/volk.cpp @@ -0,0 +1,26 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the Apache License, Version 2.0 (the "Apache License") +// with the following modification; you may not use this file except in +// compliance with the Apache License and the following modification to it: +// Section 6. Trademarks. is deleted and replaced with: +// +// 6. Trademarks. This License does not grant permission to use the trade +// names, trademarks, service marks, or product names of the Licensor +// and its affiliates, except as required to comply with Section 4(c) of +// the License and to reproduce the content of the NOTICE file. +// +// You may obtain a copy of the Apache License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the Apache License with the above modification is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the Apache License for the specific +// language governing permissions and limitations under the Apache License. +// +#define VOLK_IMPLEMENTATION + +#include "pxr/imaging/hgiVulkan/volk.h" diff --git a/pxr/imaging/hgiVulkan/volk.h b/pxr/imaging/hgiVulkan/volk.h new file mode 100644 index 0000000000..6e099c125e --- /dev/null +++ b/pxr/imaging/hgiVulkan/volk.h @@ -0,0 +1,31 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the Apache License, Version 2.0 (the "Apache License") +// with the following modification; you may not use this file except in +// compliance with the Apache License and the following modification to it: +// Section 6. Trademarks. is deleted and replaced with: +// +// 6. Trademarks. This License does not grant permission to use the trade +// names, trademarks, service marks, or product names of the Licensor +// and its affiliates, except as required to comply with Section 4(c) of +// the License and to reproduce the content of the NOTICE file. +// +// You may obtain a copy of the Apache License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the Apache License with the above modification is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the Apache License for the specific +// language governing permissions and limitations under the Apache License. +// +#ifndef PXR_IMAGING_HGIVULKAN_VOLK_H +#define PXR_IMAGING_HGIVULKAN_VOLK_H + +// This is an implementation of Volk included from the Vulkan SDK. + +#include + +#endif diff --git a/pxr/imaging/hgiVulkan/vulkan.h b/pxr/imaging/hgiVulkan/vulkan.h index 08d968f278..e43f34e5d6 100644 --- a/pxr/imaging/hgiVulkan/vulkan.h +++ b/pxr/imaging/hgiVulkan/vulkan.h @@ -37,7 +37,7 @@ #error Unsupported Platform #endif -#include +#include "pxr/imaging/hgiVulkan/volk.h" #include "pxr/imaging/hgiVulkan/vk_mem_alloc.h" From a7417d99594299421ccd3fd7a865070350652451 Mon Sep 17 00:00:00 2001 From: Mark Tucker Date: Wed, 27 Mar 2024 16:32:59 -0400 Subject: [PATCH 005/202] Add some comments to explicitly call out the unique behaviors of some of these Tf file utilities in the case of reparse points on network volumes. --- pxr/base/tf/fileUtils.cpp | 9 +++++++++ pxr/base/tf/fileUtils.h | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pxr/base/tf/fileUtils.cpp b/pxr/base/tf/fileUtils.cpp index 6f89cf09bb..e2a399027d 100644 --- a/pxr/base/tf/fileUtils.cpp +++ b/pxr/base/tf/fileUtils.cpp @@ -108,6 +108,15 @@ Tf_HasAttribute( SetLastError(olderr); } + // Because we remove the REPARSE_POINT attribute above for reparse points + // on network shares, the behavior of this bit of code will be slightly + // different than for reparse points on non-network volumes. We will not + // try to follow the link and get the attributes of the destination. This + // will result in a link to an invalid destination directory claiming that + // the directory exists. It might be possible to use some other function + // to test for the existence of the destination directory in this case + // (such as FindFirstFile), but doing this doesn't seem to be relevent + // to how USD uses this method. if (!resolveSymlinks || (attribs & FILE_ATTRIBUTE_REPARSE_POINT) == 0) { return attribute == 0 || (attribs & attribute) == expected; } diff --git a/pxr/base/tf/fileUtils.h b/pxr/base/tf/fileUtils.h index f3d82cc3b0..1c1c268e83 100644 --- a/pxr/base/tf/fileUtils.h +++ b/pxr/base/tf/fileUtils.h @@ -42,6 +42,11 @@ PXR_NAMESPACE_OPEN_SCOPE /// If \p resolveSymlinks is false (default), the path is checked using /// lstat(). if \p resolveSymlinks is true, the path is checked using stat(), /// which resolves all symbolic links in the path. +/// +/// On Windows, if the path points to a reparse point symlink on a network +/// share, even if resolveSymlinks is true we are unable to follow the +/// symlink, and so will return true even if the destination of the symlink +/// does not exist. TF_API bool TfPathExists(std::string const& path, bool resolveSymlinks = false); @@ -50,6 +55,11 @@ bool TfPathExists(std::string const& path, bool resolveSymlinks = false); /// If \p resolveSymlinks is false (default), the path is checked using /// lstat(). if \p resolveSymlinks is true, the path is checked using stat(), /// which resolves all symbolic links in the path. +/// +/// On Windows, if the path points to a reparse point symlink on a network +/// share, even if resolveSymlinks is true we are unable to follow the +/// symlink, and so will return true even if the destination of the symlink +/// does not exist. TF_API bool TfIsDir(std::string const& path, bool resolveSymlinks = false); @@ -58,10 +68,21 @@ bool TfIsDir(std::string const& path, bool resolveSymlinks = false); /// If \p resolveSymlinks is false (default), the path is checked using /// lstat(). if \p resolveSymlinks is true, the path is checked using stat(), /// which resolves all symbolic links in the path. +/// +/// On Windows, if the path points to a reparse point symlink on a network +/// share, even if resolveSymlinks is true we are unable to follow the +/// symlink, and so will return true even if the destination of the symlink +/// does not exist. TF_API bool TfIsFile(std::string const& path, bool resolveSymlinks = false); /// Returns true if the path exists and is a symbolic link. +/// +/// On Windows, if the path points to a reparse point symlink on a network +/// share, we are unable to follow the symlink, so we will return false for +/// this directory even though it is a link. This is because any attempt to +/// actually follow this link will fail, so it is safer to pretend it is not +/// actually a link. TF_API bool TfIsLink(std::string const& path); From 8b6aaacbc6072ec040ac3a615cf9e811f248cbdf Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 9 Apr 2024 12:58:28 -0700 Subject: [PATCH 006/202] Volk Fix: Provides interface to borrow function pointer of vkGetInstanceProcAddr. --- pxr/imaging/hgiVulkan/instance.cpp | 5 +++++ pxr/imaging/hgiVulkan/instance.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pxr/imaging/hgiVulkan/instance.cpp b/pxr/imaging/hgiVulkan/instance.cpp index 5efcbc8ab6..d259813338 100755 --- a/pxr/imaging/hgiVulkan/instance.cpp +++ b/pxr/imaging/hgiVulkan/instance.cpp @@ -109,5 +109,10 @@ HgiVulkanInstance::GetVulkanInstance() const return _vkInstance; } +PFN_vkGetInstanceProcAddr +HgiVulkanInstance::GetPFNInstancProcAddr() +{ + return vkGetInstanceProcAddr; +} PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/hgiVulkan/instance.h b/pxr/imaging/hgiVulkan/instance.h index 39617a7809..75eacc87c8 100644 --- a/pxr/imaging/hgiVulkan/instance.h +++ b/pxr/imaging/hgiVulkan/instance.h @@ -54,6 +54,9 @@ class HgiVulkanInstance final PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT = 0; PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT = 0; + HGIVULKAN_API + PFN_vkGetInstanceProcAddr GetPFNInstancProcAddr(); + private: VkInstance _vkInstance; }; From 4854999a6ba9159d399fcb46fe91cc7ed0c25035 Mon Sep 17 00:00:00 2001 From: Edward Slavin Date: Fri, 15 Mar 2024 22:24:02 -0400 Subject: [PATCH 007/202] PEGTL USDA Parser - Added additional text file format parser based on PEGTL - Added tests specific to PEGTL parser - Removed lex / yacc based parser Contributions from Matt Kuruc and Tyler Hubbard from NVIDIA --- pxr/usd/sdf/CMakeLists.txt | 20 +- pxr/usd/sdf/debugCodes.h | 9 + .../testenv/testSdfTextFileFormatParsing.cpp | 1554 ++++ pxr/usd/sdf/textFileFormat.cpp | 6 +- pxr/usd/sdf/textFileFormat.lex.cpp | 6813 ----------------- pxr/usd/sdf/textFileFormat.ll | 346 - pxr/usd/sdf/textFileFormat.tab.cpp | 6620 ---------------- pxr/usd/sdf/textFileFormat.tab.h | 132 - pxr/usd/sdf/textFileFormat.yy | 3388 -------- pxr/usd/sdf/textFileFormatParser.cpp | 3613 +++++++++ pxr/usd/sdf/textFileFormatParser.h | 1325 ++++ pxr/usd/sdf/textParserContext.cpp | 7 +- pxr/usd/sdf/textParserContext.h | 76 +- pxr/usd/sdf/textParserHelpers.cpp | 1455 ++-- pxr/usd/sdf/textParserHelpers.h | 253 +- pxr/usdImaging/bin/testusdview/CMakeLists.txt | 2 +- .../baseline/invalidSyntax_test_out | 2 +- 17 files changed, 7348 insertions(+), 18273 deletions(-) create mode 100644 pxr/usd/sdf/testenv/testSdfTextFileFormatParsing.cpp delete mode 100644 pxr/usd/sdf/textFileFormat.lex.cpp delete mode 100644 pxr/usd/sdf/textFileFormat.ll delete mode 100644 pxr/usd/sdf/textFileFormat.tab.cpp delete mode 100644 pxr/usd/sdf/textFileFormat.tab.h delete mode 100644 pxr/usd/sdf/textFileFormat.yy create mode 100644 pxr/usd/sdf/textFileFormatParser.cpp create mode 100644 pxr/usd/sdf/textFileFormatParser.h diff --git a/pxr/usd/sdf/CMakeLists.txt b/pxr/usd/sdf/CMakeLists.txt index c38fbd29e5..106484944a 100644 --- a/pxr/usd/sdf/CMakeLists.txt +++ b/pxr/usd/sdf/CMakeLists.txt @@ -77,9 +77,6 @@ pxr_library(sdf variableExpression variantSetSpec variantSpec - - # Flex/Bison generated code - textFileFormat.tab PYTHON_PUBLIC_CLASSES pyChildrenProxy @@ -116,6 +113,7 @@ pxr_library(sdf parserValueContext pathParser subLayerListEditor + textFileFormatParser textParserContext textParserHelpers valueTypeRegistry @@ -127,10 +125,6 @@ pxr_library(sdf instantiatePool.h valueTypePrivate.h - CPPFILES - # Flex/Bison generated code - textFileFormat.lex.cpp - PYTHON_CPPFILES moduleDeps.cpp @@ -349,6 +343,14 @@ pxr_build_test(testSdfPredicateExpression_Cpp testenv/testSdfPredicateExpression.cpp ) +pxr_build_test(testSdfTextFileFormatParsing + LIBRARIES + sdf + tf + CPPFILES + testenv/testSdfTextFileFormatParsing.cpp +) + pxr_install_test_dir( SRC testenv/testSdfBatchNamespaceEdit.testenv DEST testSdfBatchNamespaceEdit/testSdfBatchNamespaceEdit.testenv @@ -515,6 +517,10 @@ pxr_register_test(testSdfPredicateExpression_Cpp COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testSdfPredicateExpression_Cpp" ) +pxr_register_test(testSdfTextFileFormatParsing + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testSdfTextFileFormatParsing" +) + pxr_register_test(testSdfPayload PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testSdfPayload" diff --git a/pxr/usd/sdf/debugCodes.h b/pxr/usd/sdf/debugCodes.h index 42ec367e99..8da97c282b 100644 --- a/pxr/usd/sdf/debugCodes.h +++ b/pxr/usd/sdf/debugCodes.h @@ -38,6 +38,15 @@ TF_DEBUG_CODES( SDF_VARIABLE_EXPRESSION_PARSING ); +//////////////////////////////////////////////////////////////////////// +// Debugging Symbols for Grammar +// These symbols can be turned off at compile time by setting the first +// argument value to `false`. +TF_CONDITIONALLY_COMPILE_TIME_ENABLED_DEBUG_CODES( + true, + SDF_TEXT_FILE_FORMAT_CONTEXT +); + PXR_NAMESPACE_CLOSE_SCOPE #endif // PXR_USD_SDF_DEBUG_CODES_H diff --git a/pxr/usd/sdf/testenv/testSdfTextFileFormatParsing.cpp b/pxr/usd/sdf/testenv/testSdfTextFileFormatParsing.cpp new file mode 100644 index 0000000000..b4672d15f9 --- /dev/null +++ b/pxr/usd/sdf/testenv/testSdfTextFileFormatParsing.cpp @@ -0,0 +1,1554 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the Apache License, Version 2.0 (the "Apache License") +// with the following modification; you may not use this file except in +// compliance with the Apache License and the following modification to it: +// Section 6. Trademarks. is deleted and replaced with: +// +// 6. Trademarks. This License does not grant permission to use the trade +// names, trademarks, service marks, or product names of the Licensor +// and its affiliates, except as required to comply with Section 4(c) of +// the License and to reproduce the content of the NOTICE file. +// +// You may obtain a copy of the Apache License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the Apache License with the above modification is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the Apache License for the specific +// language governing permissions and limitations under the Apache License. +// +#include +#include +#include +#include + +#include "pxr/pxr.h" +#include "pxr/base/tf/diagnostic.h" +#include "pxr/usd/sdf/textFileFormatParser.h" + +PXR_NAMESPACE_USING_DIRECTIVE + +namespace PEGTL_NS = Sdf_TextFileFormatParser::PEGTL_NS; + +template +bool DoParse(const std::string& expression) +{ + try + { + Sdf_TextParserContext context; + context.magicIdentifierToken = "sdf"; + context.versionString = "1.4.32"; + + std::cout << "Parsing " << expression << "\n"; + if(!PEGTL_NS::parse( + PEGTL_NS::string_input<> { expression ,""}, context)) + { + return false; + } + } + catch(const std::exception& e) + { + std::cerr << e.what() << '\n'; + return false; + } + + return true; +} + +bool +TestDigits() +{ + std::vector validExpressions = { + "0", + "12345", + "98765", + "02345", + "-0", + "-12345", + "-98765", + "-02345", + "0.425436", + ".625462", + "-0.43626", + ".9097456", + "0e2359670", + "12345e2359670", + "98765e2359670", + "02345e2359670", + "-0e2359670", + "-12345e2359670", + "-98765e2359670", + "-02345e2359670", + "0.425436e2359670", + ".625462e2359670", + "-0.43626e2359670", + ".9097456e2359670", + "12345E2359670", + "98765E2359670", + "02345E2359670", + "-0E2359670", + "-12345E2359670", + "-98765E2359670", + "-02345E2359670", + "0.425436E2359670", + ".625462E2359670", + "-0.43626E2359670", + ".9097456E2359670", + "12345e-2359670", + "98765e-2359670", + "02345e-2359670", + "-0e-2359670", + "-12345e-2359670", + "-98765e-2359670", + "-02345e-2359670", + "0.425436e-2359670", + ".625462e-2359670", + "-0.43626e-2359670", + ".9097456e-2359670", + "12345E-2359670", + "98765E-2359670", + "02345E-2359670", + "-0E-2359670", + "-12345E-2359670", + "-98765E-2359670", + "-02345E-2359670", + "0.425436E-2359670", + ".625462E-2359670", + "-0.43626E-2359670", + ".9097456E-2359670", + "-0e+2359670", + "-12345e+2359670", + "-98765e+2359670", + "-02345e+2359670", + "0.425436e+2359670", + ".625462e+2359670", + "-0.43626e+2359670", + ".9097456e+2359670", + "12345E+2359670", + "98765E+2359670", + "02345E+2359670", + "-0E+2359670", + "-12345E+2359670", + "-98765E+2359670", + "-02345E+2359670", + "0.425436E+2359670", + ".625462E+2359670", + "-0.43626E+2359670", + ".9097456E+2359670", + "inf", + "-inf", + "nan" + }; + + std::vector invalidExpressions = { + "-", + "-nan", + "0.", + "0e", + "e", + "E", + "E324", + "-.E324", + "-.", + "0345346a", + "63.42534t", + "-23452.e", + "8476.343e", + "4264einf", + "45346e-inf", + "3456-", + ".inf", + ".nan", + "-.inf", + "-.nan" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestIdentifiers() +{ + std::vector validIdentifiers = { + "foo", + "foo_bar", + "_foo", + "_12432foo", + "foo1257__", + "foo_1235_bar__", + "foo::bar", + "foo::bar::baz", + "FOO", + "FOO::BAR", + "foo__::__bar::_4BAZ99_" + }; + + std::vector invalidIdentifiers = { + "1foo", + "connect", + "rel", + "0foo", + "-inf", + "None", + "foo:bar", + "foo:bar:baz", + "foo_bar:baz", + "FOO::bAr84_:baz", + "foo::relocates", + "foo/234" + }; + + TF_AXIOM(std::all_of(validIdentifiers.begin(), + validIdentifiers.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidIdentifiers.begin(), + invalidIdentifiers.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validNamespacedNames = { + "foo:bar", + "foo:bar:baz", + "foo_bar:baz", + "FOO:bAr84_:baz", + "foo", + "_foo", + "foo_12345_bar__", + "relocates", + "def", + "over", + "rootPrims:specializes:over" + }; + + std::vector invalidNamespacedNames = { + "foo::bar", + "foo::bar::baz", + "0foo", + "f71.3124o7125o", + "foo/234", + "/" + }; + + TF_AXIOM(std::all_of(validNamespacedNames.begin(), + validNamespacedNames.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidNamespacedNames.begin(), + invalidNamespacedNames.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + // valid dictionary value types include all identifiers + // plus identifiers with [] possibly padded with spaces / tabs + // we algorithmically build this test from the existing identifiers + size_t i = 1; + std::vector validTypeNames = validIdentifiers; + for (const std::string& str : validIdentifiers) + { + std::string typeName = str; + if ((i%2) == 0) + { + // pad tabs on front + for (size_t numTabs = 0; numTabs < i; numTabs++) + { + typeName += "\t"; + } + + typeName += "[]"; + } + else + { + // pad spaces on front + for (size_t numSpaces = 0; numSpaces < i; numSpaces++) + { + typeName += " "; + } + + typeName += "[]"; + } + + validTypeNames.push_back(typeName); + i++; + } + + // all invalid identifiers are invalid type names + std::vector invalidTypeNames = invalidIdentifiers; + invalidTypeNames.push_back("foo \n []"); + invalidTypeNames.push_back("foo [3]"); + + TF_AXIOM(std::all_of(validTypeNames.begin(), + validTypeNames.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidTypeNames.begin(), + invalidTypeNames.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestStrings() +{ + // analyze will fail with custom actions like those we need for strings + // so we skip the analyze part + std::vector validSingleLineStrings = { + "'a simple string'", + "'a simple string with a couple of utf-8 characters ß篲ü濯'", + "'a string with an escaped \\''", + "'a string with an escaped character \\b\\b'", + "'ß___\\y\\x'", + "'a string with embedded double quote\"'" + }; + + std::vector invalidSingleLineStrings = { + "'''", + "'a string with an embedded CR \r'", + "'a string with no end quote", + "'a string with an embedded LF \n'", + "'a string with an attempt at escaping \''", + "'a string with a properly escaped \\' but ending wrong''", + }; + + TF_AXIOM(std::all_of(validSingleLineStrings.begin(), + validSingleLineStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidSingleLineStrings.begin(), + invalidSingleLineStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validMultiLineStrings = { + "'''a simple multi-line string\n'''", + "'''a \n many \n lined \r\n multi-line \n string\n'''", + "'''a multiline string \n\n\n\r\n with an escaped \\'\\' set\n'''", + "'''\n\n A string \n containing \n utf-8 characters\n ß篲ü濯 \n '''" + }; + + std::vector invalidMultiLineStrings = { + "'''\nan \nunterminated multi-\r\nline string", + "'''An incorrectly \n terminated multi-line string''", + "'''\n\n A string \n containing \n utf-8 characters\n ß篲ü濯 \n ''\\''", + "'A regular single quote string'" + }; + + TF_AXIOM(std::all_of(validMultiLineStrings.begin(), + validMultiLineStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidMultiLineStrings.begin(), + invalidMultiLineStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validSingleLineDoubleQuoteStrings = { + "\"a simple string\"", + "\"a simple string with a couple of utf-8 characters ß篲ü濯\"", + "\"a string with an escaped \\\"\"", + "\"a string with an escaped character \\b\\b\"", + "\"ß___\\y\\x\"", + "\"a string with embedded single quote '\"" + }; + + std::vector invalidSingleLineDoubleQuoteStrings = { + "\"\"\"", + "\"a string with an embedded CR \r\"", + "\"a string with no end quote", + "\"a string with an embedded LF \n\"", + "\"a string with an attempt at escaping \\ \"\"", + "\"a string with a properly escaped \\\" but ending wrong\"\"", + }; + + TF_AXIOM(std::all_of(validSingleLineDoubleQuoteStrings.begin(), + validSingleLineDoubleQuoteStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidSingleLineDoubleQuoteStrings.begin(), + invalidSingleLineDoubleQuoteStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validMultiLineDoubleQuoteStrings = { + "\"\"\"a simple multi-line string\n\"\"\"", + "\"\"\"a \n many \n lined \r\n multi-line \n string\n\"\"\"", + "\"\"\"a multiline string \n\n\n\r\n with" + " an escaped \\\"\\\" set\n\"\"\"", + "\"\"\"\n\n A string \n containing \n " + "utf-8 characters\n ß篲ü濯 \n \"\"\"" + }; + + std::vector invalidMultiLineDoubleQuoteStrings = { + "\"\"\"\nan \nunterminated multi-\r\nline string", + "\"\"\"An incorrectly \n terminated multi-line string\"\"", + "\"\"\"\n\n A string \n containing \n " + "utf-8 characters\n ß篲ü濯 \n ''\\'\"\"", + "\"A regular single quote string\"" + }; + + TF_AXIOM(std::all_of(validMultiLineDoubleQuoteStrings.begin(), + validMultiLineDoubleQuoteStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidMultiLineDoubleQuoteStrings.begin(), + invalidMultiLineDoubleQuoteStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validMixedStrings = { + "''", + "\"\"", + "''''''", + "\"\"\"\"\"\"", + "\"a simple string\"", + "'''a multiline string \n\n\n\r\n with an escaped \\'\\' set\n'''", + "'''\n\n\n\n\n\\'\\'\n\n\n'''", + "\"\"\"''\\\"\\\"\'\n\n\n\n\n\n\n\"\"\"", + "'''\n\n\n\n\n\n''\n\n\n\n\n'''" + }; + + std::vector invalidMixedStrings = { + "'", + "\"", + "'''''", + "\"\"\"\"\"", + "\"a string with a properly escaped \\\" but ending wrong\"\"", + "\"\"\"\n\n A string \n containing \n " + "utf-8 characters\n ß篲ü濯 \n ''\\'\"\"", + "'''\n\n A string \n containing \n utf-8 characters\n ß篲ü濯 \n ''\\''" + }; + + TF_AXIOM(std::all_of(validMixedStrings.begin(), + validMixedStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidMixedStrings.begin(), + invalidMixedStrings.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestAssetRefs() +{ + std::vector validExpressions = { + "@@", + "@c:\\foo\\bar_baz\\foo@", + "@foo__34-123\\ß篲ü濯@", + "@@@C:foobar_bazfoo@@@", + "@@@c:\\foo\\bar_baz\\foo@@@", + "@@@foo__34-123\\ß篲ü濯@@@", + "@@@c:\\foo\\@@@\\@@_@_\\@@@@@@", + "@@@@foo.sdf@@@@" + }; + + std::vector invalidExpressions = { + "@c:\\foo\\@bar_baz\\foo@", + "@@@c:\\foo@@@\\@@_@_\\@@@@@@" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPathRefs() +{ + std::vector validExpressions = { + "", + "", + "", + "", + "", + "<.bar>", + "", + "", + "<../Some/Kinda/Long/Path/Just/To/Make/Sure>", + "<../../Some/Kinda/Long/Path/Just/To/Make/Sure.property>", + "", + "", + "<.bar[targ].boom>", + "", + "", + "", + "", + "" + }; + + std::vector invalidExpressions = { + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "<123>", + "<123test>", + "", + "" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestTupleValues() +{ + std::vector validExpressions = { + "(-inf)", + "(-inf,)", + "( -923452345.2, .234125e+56243 ,)", + "(foo, bar, baz)", + "( foo , bar, baz)", + "(\n \"this is a string value\", -67.45e2311, \n\n 'another string',)", + "(\"\"\"a multiline \n \n string as a tuple value\n\"\"\")", + "(@this is an asset references in a tuple@, foo, nan)", + "(45.75, @@@an escaped asset reference @ in \\@@@ a tuple@@@)", + "(foo, bar, baz,)", + "(-0.56e-456, foo, 0, 0.56, bar)", + "(\n-inf)", + "(\r\n-inf,)", + "(\r -923452345.2, .234125e+56243 ,)", + "(foo, bar, baz\n)", + "(\nfoo, \n bar, \n baz,)", + "(-0.56e-456, foo, 0, 0.56, bar\r\n)", + "(\n foo, \n bar ,\n (\n baz,\n\n 567.3e-45\n)\n\n\n)", + "(foo /*HELLO*/, bar)", + "(foo, #comment\n bar)", + "(\n1 /*HELLO*//*WORLD*/,\n 2, \n 3)" + }; + + std::vector invalidExpressions = { + "(", + ")", + "()", + "(foo, bar, ())", + "\n(foo, bar, baz)", + "(varying)", + "(foo, uniform)", + "(foo \n, uniform)", // The newline may not be before the commma + "(foo #comment\n, uniform)" // Single line comments may not preceed the comma + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestListValues() +{ + std::vector validExpressions = { + "[-inf]", + "[-inf,]", + "[ -923452345.2, .234125e+56243 ,]", + "[foo, bar, baz]", + "[ foo , bar, baz]", + "[\n \"this is a string value\", -67.45e2311, \n\n 'another string',]", + "[\"\"\"a multiline \n \n string as a list value\n\"\"\"]", + "[@this is an asset references in a list@, foo, nan]", + "[45.75, @@@an escaped asset reference @ in \\@@@ a list@@@]", + "[foo, bar, baz,]", + "[-0.56e-456, foo, 0, 0.56, bar]", + "[\n-inf]", + "[\r\n-inf,]", + "[\r -923452345.2, .234125e+56243 ,]", + "[foo, bar, baz\n]", + "[\nfoo, \n bar, \n baz,]", + "[-0.56e-456, foo, 0, 0.56, bar\r\n]", + "[\n foo, \n bar ,\n (\n baz,\n\n 567.3e-45\n)\n\n\n]", + "[\n foo, \n bar ,\n [\n baz,\n\n 567.3e-45\n]\n\n\n]", + "[\n foo, \n bar ,\n (\n baz,\n\n" + " 567.3e-45\n) , [(4.5, -2)] , \n\n\n]" + }; + + std::vector invalidExpressions = { + "[", + "]", + "[]", + "[foo, bar, []]", + "[foo, bar, ()]", + "\n[foo, bar, baz]", + "[varying]", + "[foo, uniform]", + "[foo, bar, \n (7, config)]" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestDictionaryValues() +{ + std::vector validExpressions = { + "{}", + "{\n\n\n\n}", + "{\r\n\r\n\n\r}", + "{ \n \n \n }", + "{\n\nfoo \"bar_key\"=[foo, bar, baz]\n}", + "{\n\nfoo \"bar_key\" = [foo, bar, baz];\n}", + "{\n\ndictionary \"bar_key\" = " + "{float foo = bar; int bar=baz; newType baz=foo;};\n}", + "{\n\ndictionary \"bar_key\" = " + "{float foo = bar\nint bar=baz\nnewType baz=foo;};\n}", + "{foo_ uniform = \"myValue\"}", + "{foo_ _bar_234 = \"\"\"my\n\nValue\"\"\"}", + "{\n dictionary foo={double key=-23.6e7} ;" + "\n\n foo_type baz_key = \"bazValue\"\n\n string add = " + "(\"keyword_test\");\n\n}" + }; + + std::vector invalidExpressions = { + "{", + "{foo=bar add=baz}", + "{float foo=bar double add=baz}", + "{dictionary foo=bar add=baz}", + "{foo=2;bar=\"string\";baz=;}", + "{foo=2;bar=\"string\";baz=foo;;;}", + "no_open_brace = \"foo\";}", + "{\n\ndictionary foo \"bar_key\" = [foo, bar, baz];\n}", + "{\n\ndictionary \"bar_key\" = [foo, bar, baz];\n}", + "{\n dictionary foo={double key=-23.6e7} ;" + "\n\n foo_type baz_key = \"bazValue\"\n\n; add = " + "(\"keyword_test\");\n\n}" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestMetadata() +{ + std::vector validExpressions = { + "()", + "( \t \t\t\t )", + "(\r\n\n\n\r)", + "( \r \n\n\n\n\n \n\n \n\n )", + "(\"a comment\" ; \"another comment\"; \n \n \n )", + "(\n\tfoo = baz\n\ndoc = \"my doc\" ; " + "\n\t\treorder foo = None\ndelete bar::baz =" + " [\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n)", + "(doc=\"\"\"all list\n ops\n\"\"\";delete foo =[\"not an empty list\"]" + " ;\nadd bar::baz= [@@@asset\\ref\\@@@@@@ , [ 123e45]];prepend " + "foo_bar=[\"string1\",'string2'];\nappend foo2bar5=[(34, 45, 56)]" + "\n\nreorder foo2::bar5=[-.9876];\n)", + "(\n\npermission=foo;)", + "(permission=foo::bar)", + "(symmetryFunction=)", + "(doc=\"test of symmetryFunction\"\nsymmetryFunction=foo::bar;)" + }; + + std::vector invalidExpressions = { + "(", + ")", + "(\r\n\n \n doc=\"several metadata items not properly " + "separated\"\nfoo=bar baz=foo)", + "(doc=\"no close parenthesis\";", + }; + + std::vector invalidRelationshipOnlyExpressions = { + "(\t doc=\"test of displayUnit\"\n displayUnit = foo)", + "(displayUnit =\t\t foo::bar::baz)" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidRelationshipOnlyExpressions.begin(), + invalidRelationshipOnlyExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + // all of the above metadata should also be valid prim attribute metadata + // but prim attributes also have displayUnit, so we check both the original + // set and a few new ones + std::vector validAdditionalExpressions = { + "(\t doc=\"test of displayUnit\"\n displayUnit = foo)", + "(displayUnit =\t\t foo::bar::baz)" + }; + + std::vector invalidAdditionalExpressions = { + "(displayUnit=)", + "(doc='An invalid display unit definition'\n " + "displayUnit=foo:bar:baz)" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::all_of(validAdditionalExpressions.begin(), + validAdditionalExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidAdditionalExpressions.begin(), + invalidAdditionalExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPrimRelationship() +{ + std::vector validExpressions = { + "rel F00OO = [ ]", + "custom varying rel add:delete.timeSamples \t = {\n\n 24.567e23 " + " : @foo\\asset\\ref@ ,\t\n 2: \"string value\",-77 :(\"" + "tuple_value\", -65.8),\n45.65 :\t None\n}", + "varying \t\t rel foo.\tdefault\t\t = <.bar>", + "rel myRel = <.bar> (doc=\"\"\"all list\n ops\n\"\"\";delete foo =" + "[\"not an empty list\"] ;\nadd bar::baz= [@@@asset\\ref\\@@@@@@ , " + "[ 123e45]];prepend foo_bar=[\"string1\",'string2'];\nappend foo2bar5=" + "[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)", + "custom rel withoutAssignment (\n\tfoo = baz\n\ndoc = \"my " + "doc\" ; \n\t\treorder foo = None\ndelete bar::baz = " + "[\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n)", + "rel myRel []" + }; + + std::vector invalidExpressions = { + "add", + "rel", + "custom varying rel foo.", + "custom rel varying foo", + "varying rel badMetadata=<.bar>(displayUnit=mm)", + "custom varying rel add:delete.timeSamples \t = {\n\n 24.567e23" + " : @foo\\asset\\ref@ ,\t\n foo: \"string value\",(\"tuple_value\"" + ", -65.8),\n45.65 :\t None\n}", + "prepend\t\t\tvarying rel my:relationship=[\n\n,\r\n,\n]", + "custom rel withoutAssignment\n\n(\n\tfoo = baz\n\ndoc " + "= \"my doc\" ; \n\t\treorder foo = None\ndelete bar::baz " + "= [\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n)", + + // these are valid relations, but are parsed with the PropertySpec reduction + "add rel add:delete", + "delete custom rel foo_bar_23 = None", + "prepend custom varying rel FOO_=[]", + "append varying rel F00OO = ", + "reorder rel foo =[, \n<.bar>]", + "add \t\t \t rel \t\t add:delete", + "prepend\t\t\tvarying rel my:relationship=[,\n\n," + "\r\n,\n]", + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPrimAttribute() +{ + std::vector validExpressions = { + "custom float[] add:delete:rootPrims", + "float3 foo", + "uniform half bar_\t\t= \"not a valid value but validated later\"", + "double3 [] foo.connect = None", + "custom_type my:custom:type:instance:_:add.\t\ttimeSamples = " + "{\n\n 24.567e23 : @foo\\asset\\ref@ ,\t\n 2: \"string value\"," + "-77 :(\"tuple_value\", -65.8),\n45.65 :\t None\n}", + "uniform int3 foo = (7, 6,\n 2)(displayUnit=mm)", + "config int3 foo\t= (\n7,2,\n\n5)(doc=\"\"\"all list\n ops\n\"\"\";" + "delete foo =[\"not an empty list\"] ;\nadd bar::baz= [@@@asset\\ref\\@@@@@@ , " + "[ 123e45]];prepend foo_bar=[\"string1\",'string2'];\nappend foo2bar5=" + "[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)" + }; + + std::vector invalidExpressions = { + "noTypeAttribute", + "custom\nfloat[] add:delete:rootPrims", + "double3 [].connect", + "config int3 foo\t= (\n7,2,\n\n5)\n(doc=\"\"\"all list\n ops\n\"\"\";" + "delete foo =[\"not an empty list\"] \n;\nadd bar::baz= [@@@asset\\ref" + "\\@@@@@@ , [ 123e45]];prepend foo_bar=[\"string1\",'string2'];\n" + "append foo2bar5=[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876]\n;\n)", + + // these are valid attribute specs, but get parsed with + // the PropertySpec reduction + "add int2 foo:bar.connect=[]", + "delete myType _F00_.connect\t=[\n\n\n\n]", + "prepend foo[] __:connect:_.connect=", + "append string bar__\t.\t connect \t\t =[]", + "reorder foo::bar[] _baz00.connect=[," + "\n,]", + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPrimProperty() +{ + // a prim property is either a relationship or attribute + // so we take all the valid relationships and attributes + // we had in the individual tests, combine them and make + // sure the rule parses (or doesn't for the invalid ones) + std::vector validExpressions = { + "add rel add:delete", + "delete custom rel foo_bar_23 = None", + "prepend custom varying rel FOO_=[]", + "append varying rel F00OO = ", + "reorder rel foo =[,\n<.bar>]", + "add \t\t \t rel \t\t add:delete", + "prepend\t\t\tvarying rel my:relationship=[,\n\n,\r\n,\n]", + "rel F00OO = [ ]", + "custom varying rel add:delete.timeSamples \t = {\n\n 24.567e23 : " + "@foo\\asset\\ref@ ,\t\n 2: \"string value\",-77 :(\"tuple_" + "value\", -65.8),\n45.65 :\t None\n}","add int2 foo:bar.connect=[]", + "delete myType _F00_.connect\t=[\n\n\n\n]", + "prepend foo[] __:connect:_.connect=", + "append string bar__\t.\t connect \t\t =[]", + "reorder foo::bar[] _baz00.connect=[," + "\n,]", + "varying \t\t rel foo.\tdefault\t\t = <.bar>", + "rel myRel = <.bar> (doc=\"\"\"all list\n ops\n\"\"\";delete foo " + "=[\"not an empty list\"] ;\nadd bar::baz= [@@@asset\\ref\\@@@@@@ , " + "[ 123e45]];prepend foo_bar=[\"string1\",'string2'];\nappend " + "foo2bar5=[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)", + "custom rel withoutAssignment(\n\tfoo = baz\n\ndoc = \"my " + "doc\" ; \n\t\treorder foo = None\ndelete bar::baz = " + "[\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n)", + "custom float[] add:delete:rootPrims", + "float3 foo", + "uniform half bar_\t\t= \"not a valid value but validated later\"", + "double3 [] foo.connect = None", + "add int2 foo:bar.connect=[]", + "delete myType _F00_.connect\t=[\n\n\n\n]", + "prepend foo[] __:connect:_.connect=", + "append string bar__\t.\t connect \t\t =" + "[]", + "reorder foo::bar[] _baz00.connect=[," + "\n,]", + "custom_type my:custom:type:instance:_:add.\t\ttimeSamples = " + "{\n\n 24.567e23 : @foo\\asset\\ref@ ,\t\n 2: \"string value\"," + "-77 :(\"tuple_value\", -65.8),\n45.65 :\t None\n}", + "uniform int3 foo = (7, 6,\n 2)(displayUnit=mm)", + "config int3 foo\t= (\n7,2,\n\n5)(doc=\"\"\"all list\n ops\n\"\"\";" + "delete foo =[\"not an empty list\"] ;\nadd bar::baz= [@@@asset\\ref\\" + "@@@@@@ , [ 123e45]];prepend foo_bar=[\"string1\",'string2'];\nappend " + "foo2bar5=[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)" + }; + + std::vector invalidExpressions = { + "add", + "rel", + "custom varying rel foo.", + "custom rel varying foo", + "custom varying rel add:delete.timeSamples \t = " + "{\n\n 24.567e23 : @foo\\asset\\ref@ ,\t\n foo: \"" + "string value\",(\"tuple_value\", -65.8),\n45.65 :\t None\n}", + "prepend\t\t\tvarying rel my:relationship=" + "[\n\n," + "\r\n,\n]", + "noTypeAttribute", + "custom\nfloat[] add:delete:rootPrims", + "double3 [].connect", + "config int3 foo\t= (\n7,2,\n\n5)\n(doc=\"\"\"all list\n " + "ops\n\"\"\";delete foo =[\"not an empty list\"] \n;\nadd bar::" + "baz= [@@@asset\\ref\\@@@@@@ , [ 123e45]];prepend foo_bar=[\"" + "string1\",'string2'];\nappend foo2bar5=[(34, 45, 56)]\n\n" + "reorder foo2::bar5=[-.9876]\n;\n)", + "custom rel withoutAssignment\n\n(\n\tfoo = baz\n\ndoc " + "= \"my doc\" ; \n\t\treorder foo = None\ndelete bar::" + "baz = [\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n)" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPrimMetadata() +{ + std::vector validExpressions = { + "(\n\n\n)", + "()", + "(\"one piece of prim metadata\" ;\n\n)", + "('foo'; foo=\"\"\"bar\n\n\"\"\" ; foo =\t\t34.64\n\nadd __ = " + "None;delete foo\t=[-89.723 , \"foo_string\"] ;prepend foo_bar=" + "[bar\t, baz::foo]\nappend _056245 = \t[@c:\\asset\\ref\\path@ " + ",];\n\n\n\n\nreorder _my__f00 = None;)", + "( doc=\"\"\"my_Documentation \n\n string\n\"\"\")", + "(kind\t = '____' ; \n\n)", + "(kind = \"class\"\npermission=__foo)", + "(\t\tpayload\t\t = \tNone\n\npayload =[]; payload=[ \n \n " + "\n];payload=[\n\n@./asset1@ , @@@escaped_asset\\@@@_1@@@ ,\n\n])", + "(payload=[@my_layer_ref@ (offset = 45\n scale = 2.6)" + " , ])", + "(add payload=\t\t[@my_layer_ref@ (offset = 45\n " + "scale = 2.6) , ] ;\n\n delete payload=\t\t" + "[@my_layer_ref@ (offset = 45\n scale = 2.6) , " + "])", + "( prepend payload=\t\t[@my_layer_ref@ (offset = " + "45\n scale = 2.6) , ] ;\n\n append payload=" + "\t\t[@my_layer_ref@ (offset = 45\n scale = 2.6) " + ", ])", + "(reorder payload=\t\t[ \t,\n@my_layer_ref@" + " (offset = 45\n scale = 2.6) , ])", + "(references = [] ; \n references = None)", + "(references=[@@@my_lay@@er_ref@@@ (offset = " + "45\n scale = 2.6)])", + "(references=[@@@my_lay@@er_ref@@@ ()])", + "(references=[@@@my_lay@@er_ref@@@ ( \n\n)])", + "(references=[@@@my_lay@@er_ref@@@ ( customData " + "= { float \"my_key\" = 457.0e23})])", + "(kind = \"custom_kind_01\"\nsymmetryFunction=\nsymmetryFunction=" + "my_symmetry_function;prefixSubstitutions = {};suffixSubstitutions = " + "{'key1':'my_value', 'key2':'68.32'})", + "(explicit=foo_valu3\n'some string metadata')", + "(inherits = []\n\n inherits=[];inherits=[\n\n\n ]\ninherits=[ " + " ,\n ] \n)", + "(add inherits = [ ];delete inherits=[]\n\nappend " + "inherits= [, ]; prepend " + "inherits = [ ]; reorder inherits = [, ])", + "(specializes = \t[]\nspecializes=[ \n\n\t\t ]; specializes=None" + "\n\nspecializes = [, ,])", + "(add specializes = []; \n\n delete specializes = None\n\nprepend " + "specializes = [\n];append specializes = [, " + "\n]\n\n\n reorder specializes = [])", + "( relocates = {}; relocates = {\n\n } ;relocates={\n\n : , \n\n : })", + "( variants = {\n\n float3[] add = (8.3, 0.5,\n 6.7)\n\nstring " + "shadingVariant = \"red\";})", + "(\n\tvariants = {\n\t\tstring shadingVariant = \"green\"\n\t}\n\t" + "prepend variantSets = \"shadingVariant\"\n)", + "(variantSets=[\"shadingVariant1\",\"shadingVariant2\",\"shadingVariant3" + "\",\"shadingVariant4\",\"shadingVariant5\"])", + "(\tvariantSets = [\"shadingVariant1\" , \"shadingVariant2\",\n" + "\"shadingVariant3\", 'shadingVariant4', \"\"\"shadingVariant5\"\"\"\n\n])", + "(add variantSets=[\n\"shadingVariant\"]\ndelete variantSets=" + "[\"shadingVariant\"]; prepend variantSets=\"___\"\n append variantSets=" + "[\"56\", \"anotherVariant\"]; reorder variantSets =\t[\n\n" + "\"anotherVariant\",\n\n\"variant2\",\n])" + }; + + std::vector invalidExpressions = { + "(", + "(kind= = '____' ; \n\n)", + "(kind-class)", + "(payload=[@my_layer_ref@ (offset = 45\n scale = 2.6)" + " ; ])", + "(references=[@@@my_lay@@er_ref@@@ ( customData = " + "{ \"my_key\" = 457.0e23})])", + "(kind = \"custom_kind_01\"\nsymmetryFunction=\nsymmetryFunction=" + "my_symmetry_function;displayUnit=mm\n\n\n;permission=\tfoo)", + "(kind = \"custom_kind_01\"\nsymmetryFunction=\nsymmetryFunction=" + "my_symmetry_function;prefixSubstitutions = {};suffixSubstitutions " + "= {'key1'='my_value', 'key2'='68.32'})", + "(variantSets=[])", + "(variantSets=[56])", + "(variantSets=[\"variant1\", 56])", + "(\tvariantSets = [\"shadingVariant1\" , \"shadingVariant2\"\n\"" + "shadingVariant3\", 'shadingVariant4', \"\"\"shadingVariant5\"\"\"\n\n])" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestVariantSetStatement() +{ + std::vector validVariantStatements = { + "\"blue\" {}", + "\"blue\" {\n\t}" + }; + + std::vector invalidVariantStatements = { + "\"blue {}", + "\"blue\" {" + }; + + TF_AXIOM(std::all_of(validVariantStatements.begin(), + validVariantStatements.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidVariantStatements.begin(), + invalidVariantStatements.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validExpressions = { + "variantSet \"shadingVariant\" = { \"blue\" {}}", + "variantSet 'shadingVariant' = {'blue'{}'green'{}}", + "variantSet \"abc\" = { \"inlineproperties\" { int x = 5; int y = 7; } }", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n}", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t}\n}", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tvariantSet \"subShadingVariant\" =\n\t\t" + "{\n\t\t\t\"scarlet\" {\n\t\t\t}\n\t\t}\t\n}\n}", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tover \"world\"\n\t\t{}\n\t\n}\n}", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tover \"world\"\n\t\t{\n\t\t\tcolor3f[] " + "primvars:displayColor = [(1, 0, 0)]\n\t\t}\n\t\n}\n}" + }; + + std::vector invalidExpressions = { + "variantSet", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tvariantSet \"subShadingVariant\" =\n\t\t" + "{\n\t\t\t\"scarlet\" {\n\t\t\t}\n\t\t}\t\n}\n}\n", + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestPrim() +{ + std::vector validExpressions = { + "custom float[] add:delete:rootPrims\n", + "float3 foo;", + "uniform half bar_\t\t= \"not a valid value but validated later\"\n", + "double3 [] foo.connect = None;", + "add int2 foo:bar.connect=[]\n", + "delete myType _F00_.connect\t=[\n\n\n\n];", + "prepend foo[] __:connect:_.connect=\n", + "append string bar__\t.\t connect \t\t =[];", + "reorder foo::bar[] _baz00.connect=[,\n" + ",]\n", + "custom_type my:custom:type:instance:_:add.\t\ttimeSamples = {\n\n " + "24.567e23 : @foo\\asset\\ref@ ,\t\n 2: \"string value\",-77 " + ":(\"tuple_value\", -65.8),\n45.65 :\t None\n};", + "uniform int3 foo = (7, 6,\n 2)(displayUnit=mm)\n", + "config int3 foo\t= (\n7,2,\n\n5)(doc=\"\"\"all list\n ops\n\"\"\";" + "delete foo =[\"not an empty list\"] \t;\nadd bar::baz= [@@@asset\\ref" + "\\@@@@@@ , [ 123e45]];prepend foo_bar=[\"string1\",'string2'];\n" + "append foo2bar5=[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)\n", + "add rel add:delete\n", + "delete custom rel foo_bar_23 = None;", + "prepend custom varying rel FOO_=[]\n", + "append varying rel F00OO = ;", + "reorder rel foo =[,\n<.bar>]\n", + "add \t\t \t rel \t\t add:delete;", + "prepend\t\t\tvarying rel my:relationship=[,\n\n,\r\n,\n]\n", + "rel F00OO = [ ];", + "custom varying rel add:delete.timeSamples \t = {\n\n " + "24.567e23 : @foo\\asset\\ref@ ,\t\n 2: \"string value\"," + "-77 :(\"tuple_value\", -65.8),\n45.65 :\t None\n}\n", + "varying \t\t rel foo.\tdefault\t\t = <.bar>;", + "rel myRel = <.bar> (doc=\"\"\"all list\n ops\n\"\"\";delete foo =" + "[\"not an empty list\"] ;\nadd bar::baz= [@@@asset\\ref\\@@@@@@ , " + "[ 123e45]];prepend foo_bar=[\"string1\",'string2'];\nappend foo2bar5=" + "[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876];\n)\n", + "custom rel withoutAssignment(\n\tfoo = baz\n\ndoc = \"my doc\"" + " ; \n\t\treorder foo = None\ndelete bar::baz = [\"myString\"" + ", (23.4, -inf, @assetRef\\path@)]\n\n);", + "variantSet \"shadingVariant\" = { \"blue\" {}}\n", + "variantSet \"shadingVariant\" = {}\n", + "variantSet 'shadingVaraint' = {'blue'{}'green'{}}\n", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n}\n", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t}\n}\n", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tvariantSet \"subShadingVariant\" =\n\t\t" + "{\n\t\t\t\"scarlet\" {\n\t\t\t}\n\t\t}\t\n}\n}\n", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tover \"world\"\n\t\t{}\n\t\n}\n}\n", + "variantSet \"shadingVariant\" = {\n\t\"blue\" {\n\t}\n\n\t\"green\" " + "{\n\t}\n\n\t\"red\" {\n\t\tover \"world\"\n\t\t{\n\t\t\tcolor3f[] " + "primvars:displayColor = [(1, 0, 0)]\n\t\t}\n\t\n}\n}\n", + "reorder nameChildren = [\"foo\", \"bar\"];", + "reorder nameChildren = ['foo', 'bar',\n 'baz']\n", + "reorder properties = ['prop1', \"_prop2\"];" + }; + + std::vector invalidExpressions = { + "custom float[] add:delete:rootPrims", + "float3 foo", + "variantSet \"shadingVariant\" = { \"blue\" {}};", + "config int3 foo\t= (\n7,2,\n\n5)\n(doc=\"\"\"all list\n ops\n\"\"\";" + "delete foo =[\"not an empty list\"] \n;\nadd bar::baz= [@@@asset\\ref" + "\\@@@@@@ , [ 123e45]];prepend foo_bar=[\"string1\",'string2'];\n" + "append foo2bar5=[(34, 45, 56)]\n\nreorder foo2::bar5=[-.9876]\n;\n);", + "custom rel withoutAssignment\n\n(\n\tfoo = baz\n\ndoc = " + "\"my doc\" ; \n\t\treorder foo = None\ndelete bar::baz " + "= [\"myString\", (23.4, -inf, @assetRef\\path@)]\n\n);" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + std::vector validPrimStatements = { + "def \"foo\" {}", + "def F00 \"foo\" {}", + "class \"foo\" {}", + "class _ \"foo\" {}", + "over \"foo\" {}", + "over __ \"B_A_5\" {}", + "def Xform \"hello\"\n{\n\tdef Sphere \"world\"\n\t{\n\t}\n}", + // The comment counts as a newline + "def \"abc\"(){ /*hello*/ def \"abc\" {}\n}", + // The semicolon ends the reorder statement + "def \"cat\" (){\nreorder nameChildren = [\"dog\"]; /*comment*/ def \"dog\" {}\n}", + // A single line comment is sufficient to separate statements + "def \"cat\" (){reorder nameChildren = [\"dog\"] #comment\n reorder nameChildren = [\"whale\"]\n}", + "def \"cat\" (){reorder nameChildren = [\"dog\"] #comment\n def \"dog\" {}\n}", + "def \"cat\" (){#comment\n def \"dog\" {} //comment\n def \"whale\" {}\n}" + }; + + std::vector invalidPrimStatements = { + "def", + "def foo {}", + "def Xform \"hello\"\n{\n\tdef Sphere \"world\"\n\t{\n\t}}", + "reorder rootPrims = ['foo', '_', \"\"\"B_A_5\"\"\"]", + // Inline comments do not end statement + "def \"abc\"(){ def \"abc\" {} /*comment*/ }", + // Inline comments do not separate statements + "def \"cat\" (){\nreorder nameChildren = [\"dog\"] /*comment*/ def \"dog\" {}\n}", + "def \"cat\" (){\ndef \"dog\" {} /*comment*/ def \"whale\" {}\n}" + }; + + TF_AXIOM(std::all_of(validPrimStatements.begin(), + validPrimStatements.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidPrimStatements.begin(), + invalidPrimStatements.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestLayerMetadata() +{ + std::vector validExpressions = { + "()", + "(\n)", + "(\"layerMetadata\"; foo = (3, 2, 1); doc=\"\"\"some documentation " + "for\n layer \n metadata\n\"\"\"\n)", + "(add foo = None\ndelete foo = [3, \"5 in a string\", bar,];prepend " + "_=[(1, 2, \"3\")]\nappend F00 = None;\n\n\nreorder " + "foo =\t[bar, baz, foo::bar])", + "(subLayers = [])", + "(subLayers = [];subLayers=[\n\n\n])", + "(subLayers = [];subLayers=[\n\n\n]\nsubLayers\t=\t" + "[\n\n@an/asset/ref@])", + "(subLayers = [];subLayers=[\n\n\n]\nsubLayers\t=\t" + "[\n\n@an/asset/ref@];subLayers=[@another/asset/ref@" + "(offset = 6;\n scale=4.5e0)])", + "(subLayers=[]#comment\nappend foo = None)" + }; + + std::vector invalidExpressions = { + "(", + "\n\n(\n\n", + "subLayers=[@@@an/asset/path@@@(offset=\"myOffset\")]", + "(add foo = None\ndelete foo = [3, \"5 in a string\", bar,];" + "prepend _=[(1, 2, \"3\")\nappend = None;\n\n\nreorder " + "foo =\t[bar, baz, foo::bar])", + "(subLayers = [];subLayers=[\n\n\n]\nsubLayers\t=\t[\n\n@an/" + "asset/ref@];subLayers=[@another/asset/ref@[offset = 6,\n scale=4.5e0]])" + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +bool +TestLayer() +{ + std::vector validExpressions = { + "#sdf 1.4.32", + "#sdf 1.4.32\n\ndef Xform \"hello\"\n{\n\tdef Sphere \"world\"\n" + "\t{\n\t}\n}", + "#sdf 1.4.32\n\nover \"refSphere\" (\n\tprepend references = @./" + "HelloWorld.usda@\n)\n{\n}", + "#sdf 1.4.32\n(\n doc = \"\"\"Generated from Composed Stage " + "of root layer RefExample.usda\n\"\"\"\n)\n\ndef Xform \"refSphere" + "\"\n{\n double3 xformOp:translate = (4, 5, 6) \n uniform " + "token[] xformOpOrder = []\n\n def Sphere \"world\"\n {\n " + " float3[] extent = [(-2, -2, -2), (2, 2, 2)]\n color3f[] " + "primvars:displayColor = [(0, 0, 1)] \n double radius = 2\n " + " }\n}\n\ndef Xform \"refSphere2\"\n{\n double3 xformOp:translate =" + " (4, 5, 6)\n uniform token[] xformOpOrder = [\"xformOp:translate\"" + "]\n\n def Sphere \"world\"\n {\n float3[] extent = [(-2, " + "-2, -2), (2, 2, 2)]\n color3f[] primvars:displayColor = [(1, " + "0, 0)]\n double radius = 2\n }\n}", + "#sdf 1.4.32\n(\n doc = \"\"\"Generated from Composed Stage " + "of root layer RefExample.usda\n\"\"\"\n)\n\ndef Xform \"refSphere" + "\"\n{\n double3 xformOp:translate = (4, 5, 6) \n uniform " + "token[] xformOpOrder = [\"xformOp:translate\"]\n}\n\ndef Xform " + "\"refSphere2\"\n{\n double3 xformOp:translate = (4, 5, 6)\n " + "uniform token[] xformOpOrder = [\"xformOp:translate\"]\n\n}", + "#sdf 1.4.32\nreorder rootPrims = ['foo', '_', \"\"\"B_A_5\"\"\"]" + }; + + std::vector invalidExpressions = { + "def Xform \"hello\"\n{\n\tdef Sphere \"world\"\n\t{\n\t}\n}", + "usda 1.0\n\ndef Xform \"hello\"\n{\n\tdef Sphere " + "\"world\"\n\t{\n\t}\n}", + }; + + TF_AXIOM(std::all_of(validExpressions.begin(), + validExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + TF_AXIOM(std::none_of(invalidExpressions.begin(), + invalidExpressions.end(), [](const std::string& expression) + { + return DoParse>(expression); + })); + + return true; +} + +int +main() +{ + bool valid = TestDigits() && + TestIdentifiers() && + TestStrings() && + TestAssetRefs() && + TestPathRefs() && + TestTupleValues() && + TestListValues() && + TestDictionaryValues() && + TestMetadata() && + TestPrimRelationship() && + TestPrimAttribute() && + TestPrimProperty() && + TestPrimMetadata() && + TestVariantSetStatement() && + TestPrim() && + TestLayerMetadata() && + TestLayer(); + + return valid ? 0 : -1; +} \ No newline at end of file diff --git a/pxr/usd/sdf/textFileFormat.cpp b/pxr/usd/sdf/textFileFormat.cpp index e503001c4e..8a85c87077 100644 --- a/pxr/usd/sdf/textFileFormat.cpp +++ b/pxr/usd/sdf/textFileFormat.cpp @@ -54,9 +54,7 @@ TF_DEFINE_ENV_SETTING( "Warn when reading a text file larger than this number of MB " "(no warnings if set to 0)"); -PXR_NAMESPACE_CLOSE_SCOPE - -// Our interface to the YACC layer parser for parsing to SdfData. +// Our interface to the parser for parsing to SdfData. extern bool Sdf_ParseLayer( const string& context, const std::shared_ptr& asset, @@ -73,8 +71,6 @@ extern bool Sdf_ParseLayerFromString( PXR_NS::SdfDataRefPtr data, PXR_NS::SdfLayerHints *hints); -PXR_NAMESPACE_OPEN_SCOPE - TF_REGISTRY_FUNCTION(TfType) { SDF_DEFINE_FILE_FORMAT(SdfTextFileFormat, SdfFileFormat); diff --git a/pxr/usd/sdf/textFileFormat.lex.cpp b/pxr/usd/sdf/textFileFormat.lex.cpp deleted file mode 100644 index 7e7234d21c..0000000000 --- a/pxr/usd/sdf/textFileFormat.lex.cpp +++ /dev/null @@ -1,6813 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// -#line 2 "pxr/usd/sdf/textFileFormat.lex.cpp" - -#line 4 "pxr/usd/sdf/textFileFormat.lex.cpp" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE textFileFormatYyrestart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via textFileFormatYyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] - -void textFileFormatYyrestart (FILE *input_file ,yyscan_t yyscanner ); -void textFileFormatYy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE textFileFormatYy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void textFileFormatYy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void textFileFormatYy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void textFileFormatYypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void textFileFormatYypop_buffer_state (yyscan_t yyscanner ); - -static void textFileFormatYyensure_buffer_stack (yyscan_t yyscanner ); -static void textFileFormatYy_load_buffer_state (yyscan_t yyscanner ); -static void textFileFormatYy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER textFileFormatYy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE textFileFormatYy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE textFileFormatYy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE textFileFormatYy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); - -void *textFileFormatYyalloc (yy_size_t ,yyscan_t yyscanner ); -void *textFileFormatYyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void textFileFormatYyfree (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer textFileFormatYy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - textFileFormatYyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - textFileFormatYy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - textFileFormatYyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - textFileFormatYy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define textFileFormatYywrap(yyscanner) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -static yyconst flex_int16_t yy_nxt[][61] = - { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0 - }, - - { - 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, - 6, 14, 15, 16, 17, 17, 12, 18, 6, 19, - 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, - - 20, 22, 20, 23, 20, 24, 25, 20, 20, 20, - 20, 26, 20, 27, 20, 20, 28, 29, 30, 31, - 32, 33, 34, 35, 20, 20, 20, 6, 36, 37, - 38 - }, - - { - 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, - 6, 14, 15, 16, 17, 17, 12, 18, 6, 19, - 20, 20, 20, 20, 20, 20, 20, 21, 20, 20, - 20, 22, 20, 23, 20, 24, 25, 20, 20, 20, - 20, 26, 20, 27, 20, 20, 28, 29, 30, 31, - 32, 33, 34, 35, 20, 20, 20, 6, 36, 37, - - 38 - }, - - { - 5, 39, 39, 40, 41, 39, 39, 39, 39, 42, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 43, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39 - }, - - { - 5, 39, 39, 40, 41, 39, 39, 39, 39, 42, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 43, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39 - }, - - { - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, - -5 - }, - - { - 5, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6 - }, - - { - 5, -7, 44, -7, -7, -7, -7, -7, -7, -7, - - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, - -7 - }, - - { - 5, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - - -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, - -8 - }, - - { - 5, -9, -9, 45, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9 - - }, - - { - 5, 46, 46, -10, -10, 47, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 48, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46 - }, - - { - 5, 49, 49, -11, -11, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49 - }, - - { - 5, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - - -12 - }, - - { - 5, 50, 50, -13, -13, 50, 50, 50, 51, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 52, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50 - }, - - { - 5, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, 53, -14, 54, 55, -14, -14, -14, -14, - - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, 56, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14 - }, - - { - 5, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, 57, 57, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15 - }, - - { - 5, -16, -16, -16, -16, -16, -16, -16, -16, 58, - -16, -16, -16, 59, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16 - }, - - { - 5, -17, -17, -17, -17, -17, -17, -17, -17, -17, - - -17, -17, 60, -17, 61, 61, -17, -17, -17, -17, - -17, -17, -17, -17, 62, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, 62, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17 - }, - - { - 5, 63, 63, -18, -18, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, -18, 64, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63 - }, - - { - 5, 65, 65, -19, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65 - - }, - - { - 5, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, 67, 67, 68, -20, -20, -20, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -20, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -20, 69, 70, - 71 - }, - - { - 5, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, 67, 67, 68, -21, -21, -21, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -21, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 72, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -21, 69, 70, - 71 - }, - - { - 5, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, 73, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - - -22 - }, - - { - 5, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, 67, 67, 68, -23, -23, -23, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -23, 67, 67, 67, 67, 74, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 75, 67, - 67, 67, 67, 67, 67, 67, 67, -23, 69, 70, - 71 - }, - - { - 5, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, 67, 67, 68, -24, -24, -24, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -24, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 76, 67, 67, 77, 67, 67, - 67, 67, 78, 67, 67, 67, 67, -24, 69, 70, - 71 - }, - - { - 5, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, 67, 67, 68, -25, -25, -25, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -25, 67, 67, 67, 67, 67, 79, 67, 67, - 67, 80, 67, 67, 67, 67, 67, 81, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -25, 69, 70, - 71 - }, - - { - 5, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, 67, 67, 68, -26, -26, -26, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -26, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 82, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -26, 69, 70, - 71 - }, - - { - 5, -27, -27, -27, -27, -27, -27, -27, -27, -27, - - -27, -27, -27, -27, 67, 67, 68, -27, -27, -27, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -27, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 83, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -27, 69, 70, - 71 - }, - - { - 5, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, 67, 67, 68, -28, -28, -28, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -28, 67, 84, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -28, 69, 70, - 71 - }, - - { - 5, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, 67, 67, 68, -29, -29, -29, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -29, 67, 67, 67, 67, 67, 67, 85, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 86, 67, 67, 67, -29, 69, 70, - 71 - - }, - - { - 5, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, 67, 67, 68, -30, -30, -30, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -30, 67, 87, 67, 67, 67, 88, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 89, - 67, 67, 67, 67, 67, 67, 67, -30, 69, 70, - 71 - }, - - { - 5, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, 67, 67, 68, -31, -31, -31, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -31, 67, 67, 67, 67, 67, 90, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 91, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -31, 69, 70, - 71 - }, - - { - 5, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, 67, 67, 68, -32, -32, -32, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -32, 67, 67, 67, 92, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 93, 67, - 67, 67, 94, 67, 67, 95, 67, -32, 69, 70, - - 71 - }, - - { - 5, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, 67, 67, 68, -33, -33, -33, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -33, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 96, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -33, 69, 70, - 71 - }, - - { - 5, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, 67, 67, 68, -34, -34, -34, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -34, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 97, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -34, 69, 70, - 71 - }, - - { - 5, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, 67, 67, 68, -35, -35, -35, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -35, 67, 98, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -35, 69, 70, - 71 - }, - - { - 5, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, 99, -36, -36, - -36 - }, - - { - 5, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, 100, -37, -37, - -37 - }, - - { - 5, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, 101, -38, -38, - -38 - }, - - { - 5, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39 - - }, - - { - 5, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40 - }, - - { - 5, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41 - }, - - { - 5, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, 102, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42 - }, - - { - 5, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, 73, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43 - }, - - { - 5, -44, 44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44 - }, - - { - 5, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45 - }, - - { - 5, 46, 46, -46, -46, 103, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 48, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46 - }, - - { - 5, 104, 104, 104, 104, 105, 104, 104, 104, 104, - - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104 - }, - - { - 5, 46, 46, -48, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46 - }, - - { - 5, 49, 49, -49, -49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49 - - }, - - { - 5, 50, 50, -50, -50, 50, 50, 50, 106, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 52, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50 - }, - - { - 5, 107, 107, 107, 107, 107, 107, 107, 108, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107 - }, - - { - 5, 50, 50, -52, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - - 50 - }, - - { - 5, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, 57, 57, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53 - }, - - { - 5, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, 60, -54, 55, 55, -54, -54, -54, -54, - - -54, -54, -54, -54, 62, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, 62, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54 - }, - - { - 5, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, 60, -55, 55, 55, -55, -55, -55, -55, - -55, -55, -55, -55, 62, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, 62, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55 - }, - - { - 5, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, 109, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56 - }, - - { - 5, -57, -57, -57, -57, -57, -57, -57, -57, -57, - - -57, -57, -57, -57, 57, 57, -57, -57, -57, -57, - -57, -57, -57, -57, 110, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, 110, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57 - }, - - { - 5, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58 - }, - - { - 5, 111, 111, -59, -59, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111 - - }, - - { - 5, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, 112, 112, -60, -60, -60, -60, - -60, -60, -60, -60, 62, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, 62, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60 - }, - - { - 5, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, 60, -61, 61, 61, -61, -61, -61, -61, - -61, -61, -61, -61, 62, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, 62, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61 - }, - - { - 5, -62, -62, -62, -62, -62, -62, -62, -62, -62, - 113, 113, -62, -62, 114, 114, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - - -62 - }, - - { - 5, 63, 63, -63, -63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, -63, 64, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63 - }, - - { - 5, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64 - }, - - { - 5, 65, 65, -65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 115, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65 - }, - - { - 5, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, 116, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66 - }, - - { - 5, -67, -67, -67, -67, -67, -67, -67, -67, -67, - - -67, -67, -67, -67, 67, 67, 68, -67, -67, -67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -67, 69, 70, - 71 - }, - - { - 5, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, 117, -68, -68, -68, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, -68, 118, 118, 118, 118, 118, 118, 118, 118, - - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, -68, 119, 120, - 121 - }, - - { - 5, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, 122, -69, -69, - -69 - - }, - - { - 5, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, 123, -70, -70, - -70 - }, - - { - 5, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, 124, -71, -71, - -71 - }, - - { - 5, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, 67, 67, 68, -72, -72, -72, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -72, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 125, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -72, 69, 70, - - 71 - }, - - { - 5, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73 - }, - - { - 5, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, 67, 67, 68, -74, -74, -74, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -74, 67, 67, 67, 67, 126, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -74, 69, 70, - 71 - }, - - { - 5, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, 67, 67, 68, -75, -75, -75, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -75, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 127, 67, - - 67, 67, 67, 67, 67, 67, 67, -75, 69, 70, - 71 - }, - - { - 5, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, 67, 67, 68, -76, -76, -76, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -76, 67, 128, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -76, 69, 70, - 71 - }, - - { - 5, -77, -77, -77, -77, -77, -77, -77, -77, -77, - - -77, -77, -77, -77, 67, 67, 68, -77, -77, -77, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -77, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 129, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -77, 69, 70, - 71 - }, - - { - 5, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, 67, 67, 68, -78, -78, -78, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -78, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 130, 67, 67, 67, 67, 67, 67, -78, 69, 70, - 71 - }, - - { - 5, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, 67, 67, 68, -79, -79, -79, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -79, 67, 67, 67, 67, 67, 67, 131, 67, - 67, 67, 67, 67, 132, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -79, 69, 70, - 71 - - }, - - { - 5, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, 67, 67, 68, -80, -80, -80, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -80, 67, 67, 67, 133, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 134, 67, 67, 67, 67, 67, 67, -80, 69, 70, - 71 - }, - - { - 5, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, 67, 67, 68, -81, -81, -81, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -81, 67, 67, 67, 135, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -81, 69, 70, - 71 - }, - - { - 5, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, 67, 67, 68, -82, -82, -82, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -82, 67, 67, 67, 67, 67, 67, 67, 67, - 136, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -82, 69, 70, - - 71 - }, - - { - 5, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, 67, 67, 68, -83, -83, -83, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -83, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 137, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -83, 69, 70, - 71 - }, - - { - 5, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, 67, 67, 68, -84, -84, -84, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -84, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 138, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -84, 69, 70, - 71 - }, - - { - 5, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, 67, 67, 68, -85, -85, -85, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -85, 67, 67, 67, 67, 67, 67, 139, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -85, 69, 70, - 71 - }, - - { - 5, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, 67, 67, 68, -86, -86, -86, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -86, 67, 67, 67, 67, 67, 140, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -86, 69, 70, - 71 - }, - - { - 5, -87, -87, -87, -87, -87, -87, -87, -87, -87, - - -87, -87, -87, -87, 67, 67, 68, -87, -87, -87, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -87, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 141, 67, -87, 69, 70, - 71 - }, - - { - 5, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, 67, 67, 68, -88, -88, -88, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -88, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 142, - 67, 67, 67, 67, 67, 67, 67, -88, 69, 70, - 71 - }, - - { - 5, -89, -89, -89, -89, -89, -89, -89, -89, -89, - -89, -89, -89, -89, 67, 67, 68, -89, -89, -89, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -89, 67, 67, 67, 67, 67, 143, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 144, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -89, 69, 70, - 71 - - }, - - { - 5, -90, -90, -90, -90, -90, -90, -90, -90, -90, - -90, -90, -90, -90, 67, 67, 68, -90, -90, -90, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -90, 67, 67, 67, 67, 67, 67, 145, 67, - 67, 67, 67, 67, 146, 67, 67, 147, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -90, 69, 70, - 71 - }, - - { - 5, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, 67, 67, 68, -91, -91, -91, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -91, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 148, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -91, 69, 70, - 71 - }, - - { - 5, -92, -92, -92, -92, -92, -92, -92, -92, -92, - -92, -92, -92, -92, 67, 67, 68, -92, -92, -92, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -92, 67, 149, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -92, 69, 70, - - 71 - }, - - { - 5, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, -93, 67, 67, 68, -93, -93, -93, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -93, 67, 67, 67, 67, 67, 150, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -93, 69, 70, - 71 - }, - - { - 5, -94, -94, -94, -94, -94, -94, -94, -94, -94, - -94, -94, -94, -94, 67, 67, 68, -94, -94, -94, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -94, 67, 67, 151, 67, 67, 67, 152, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -94, 69, 70, - 71 - }, - - { - 5, -95, -95, -95, -95, -95, -95, -95, -95, -95, - -95, -95, -95, -95, 67, 67, 68, -95, -95, -95, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -95, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 153, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -95, 69, 70, - 71 - }, - - { - 5, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, -96, 67, 67, 68, -96, -96, -96, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -96, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 154, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -96, 69, 70, - 71 - }, - - { - 5, -97, -97, -97, -97, -97, -97, -97, -97, -97, - - -97, -97, -97, -97, 67, 67, 68, -97, -97, -97, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -97, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 155, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -97, 69, 70, - 71 - }, - - { - 5, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, 67, 67, 68, -98, -98, -98, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -98, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 156, - 67, 67, 67, 67, 67, 67, 67, -98, 69, 70, - 71 - }, - - { - 5, -99, -99, -99, -99, -99, -99, -99, -99, -99, - -99, -99, -99, -99, 157, 157, 158, -99, -99, -99, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, -99, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, -99, 69, 70, - 71 - - }, - - { - 5, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, -100, -100, -100, -100, 99, -100, -100, - -100 - }, - - { - 5, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, -101, -101, -101, -101, 159, -101, -101, - -101 - }, - - { - 5, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - - -102 - }, - - { - 5, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103 - }, - - { - 5, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - - -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104 - }, - - { - 5, 160, 160, 160, 160, 161, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 162, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160 - }, - - { - 5, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, - -106 - }, - - { - 5, -107, -107, -107, -107, -107, -107, -107, -107, -107, - - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107 - }, - - { - 5, 163, 163, 163, 163, 163, 163, 163, 164, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 165, 163, 163, 163, 163, 163, 163, 163, 163, - - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109, -109, -109, -109, -109, -109, -109, -109, 166, -109, - -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, - -109 - - }, - - { - 5, -110, -110, -110, -110, -110, -110, -110, -110, -110, - 167, 167, -110, -110, 168, 168, -110, -110, -110, -110, - -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110 - }, - - { - 5, 111, 111, -111, -111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111 - }, - - { - 5, -112, -112, -112, -112, -112, -112, -112, -112, -112, - -112, -112, -112, -112, 112, 112, -112, -112, -112, -112, - -112, -112, -112, -112, 62, -112, -112, -112, -112, -112, - -112, -112, -112, -112, -112, -112, -112, 62, -112, -112, - -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, - -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, - - -112 - }, - - { - 5, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113, -113, -113, -113, 114, 114, -113, -113, -113, -113, - -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, - -113 - }, - - { - 5, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114, -114, -114, -114, 114, 114, -114, -114, -114, -114, - - -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, - -114 - }, - - { - 5, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, - - -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115 - }, - - { - 5, 169, 169, -116, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, -117, -117, -117, -117, -117, -117, -117, -117, -117, - - -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, -117, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, -117, -117, -117, - -117 - }, - - { - 5, -118, -118, -118, -118, -118, -118, -118, -118, -118, - -118, -118, -118, -118, 173, 173, 158, -118, -118, -118, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, -118, 173, 173, 173, 173, 173, 173, 173, 173, - - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, -118, 174, 175, - 176 - }, - - { - 5, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, - -119, -119, -119, -119, -119, -119, -119, 177, -119, -119, - -119 - - }, - - { - 5, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, -120, -120, -120, -120, 178, -120, -120, - -120 - }, - - { - 5, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, - - -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, -121, 179, -121, -121, - -121 - }, - - { - 5, -122, -122, -122, -122, -122, -122, -122, -122, -122, - -122, -122, -122, -122, 157, 157, 158, -122, -122, -122, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, -122, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, -122, 69, 70, - - 71 - }, - - { - 5, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, - -123, -123, -123, -123, -123, -123, -123, 122, -123, -123, - -123 - }, - - { - 5, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, - - -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, - -124, -124, -124, -124, -124, -124, -124, 180, -124, -124, - -124 - }, - - { - 5, -125, -125, -125, -125, -125, -125, -125, -125, -125, - -125, -125, -125, -125, 67, 67, 68, -125, -125, -125, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -125, 67, 67, 67, 67, 67, 181, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -125, 69, 70, - 71 - }, - - { - 5, -126, -126, -126, -126, -126, -126, -126, -126, -126, - -126, -126, -126, -126, 67, 67, 68, -126, -126, -126, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -126, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -126, 69, 70, - 71 - }, - - { - 5, -127, -127, -127, -127, -127, -127, -127, -127, -127, - - -127, -127, -127, -127, 67, 67, 68, -127, -127, -127, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -127, 67, 67, 67, 67, 67, 182, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -127, 69, 70, - 71 - }, - - { - 5, -128, -128, -128, -128, -128, -128, -128, -128, -128, - -128, -128, -128, -128, 67, 67, 68, -128, -128, -128, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -128, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 183, 67, 67, 67, 67, 67, 67, -128, 69, 70, - 71 - }, - - { - 5, -129, -129, -129, -129, -129, -129, -129, -129, -129, - -129, -129, -129, -129, 67, 67, 68, -129, -129, -129, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -129, 67, 67, 67, 67, 67, 67, 184, 67, - 67, 67, 67, 67, 67, 67, 185, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -129, 69, 70, - 71 - - }, - - { - 5, -130, -130, -130, -130, -130, -130, -130, -130, -130, - -130, -130, -130, -130, 67, 67, 68, -130, -130, -130, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -130, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 186, 67, 67, 67, 67, 67, -130, 69, 70, - 71 - }, - - { - 5, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, 67, 67, 68, -131, -131, -131, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -131, 67, 187, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -131, 69, 70, - 71 - }, - - { - 5, -132, -132, -132, -132, -132, -132, -132, -132, -132, - -132, -132, -132, -132, 67, 67, 68, -132, -132, -132, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -132, 67, 67, 67, 67, 67, 188, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -132, 69, 70, - - 71 - }, - - { - 5, -133, -133, -133, -133, -133, -133, -133, -133, -133, - -133, -133, -133, -133, 67, 67, 68, -133, -133, -133, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -133, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 189, 67, 67, 67, 67, 67, -133, 69, 70, - 71 - }, - - { - 5, -134, -134, -134, -134, -134, -134, -134, -134, -134, - -134, -134, -134, -134, 67, 67, 68, -134, -134, -134, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -134, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 190, 67, - 67, 67, 67, 67, 67, 67, 67, -134, 69, 70, - 71 - }, - - { - 5, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, -135, 67, 67, 68, -135, -135, -135, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -135, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -135, 69, 70, - 71 - }, - - { - 5, -136, -136, -136, -136, -136, -136, -136, -136, -136, - -136, -136, -136, -136, 67, 67, 68, -136, -136, -136, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -136, 67, 67, 67, 67, 67, 191, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -136, 69, 70, - 71 - }, - - { - 5, -137, -137, -137, -137, -137, -137, -137, -137, -137, - - -137, -137, -137, -137, 67, 67, 68, -137, -137, -137, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -137, 67, 67, 67, 67, 192, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -137, 69, 70, - 71 - }, - - { - 5, -138, -138, -138, -138, -138, -138, -138, -138, -138, - -138, -138, -138, -138, 67, 67, 68, -138, -138, -138, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -138, 67, 67, 67, 67, 67, 193, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -138, 69, 70, - 71 - }, - - { - 5, -139, -139, -139, -139, -139, -139, -139, -139, -139, - -139, -139, -139, -139, 67, 67, 68, -139, -139, -139, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -139, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 194, 67, 67, 67, 67, 67, 67, -139, 69, 70, - 71 - - }, - - { - 5, -140, -140, -140, -140, -140, -140, -140, -140, -140, - -140, -140, -140, -140, 67, 67, 68, -140, -140, -140, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -140, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 195, - 67, 67, 67, 67, 67, 67, 67, -140, 69, 70, - 71 - }, - - { - 5, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, 67, 67, 68, -141, -141, -141, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -141, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 196, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -141, 69, 70, - 71 - }, - - { - 5, -142, -142, -142, -142, -142, -142, -142, -142, -142, - -142, -142, -142, -142, 67, 67, 68, -142, -142, -142, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -142, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 197, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -142, 69, 70, - - 71 - }, - - { - 5, -143, -143, -143, -143, -143, -143, -143, -143, -143, - -143, -143, -143, -143, 67, 67, 68, -143, -143, -143, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -143, 67, 67, 67, 67, 67, 67, 198, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 199, 67, - 67, 67, 67, 67, 67, 67, 67, -143, 69, 70, - 71 - }, - - { - 5, -144, -144, -144, -144, -144, -144, -144, -144, -144, - -144, -144, -144, -144, 67, 67, 68, -144, -144, -144, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -144, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 200, 67, - 67, 67, 67, 67, 67, 67, 67, -144, 69, 70, - 71 - }, - - { - 5, -145, -145, -145, -145, -145, -145, -145, -145, -145, - -145, -145, -145, -145, 67, 67, 68, -145, -145, -145, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -145, 67, 67, 67, 67, 67, 201, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -145, 69, 70, - 71 - }, - - { - 5, -146, -146, -146, -146, -146, -146, -146, -146, -146, - -146, -146, -146, -146, 67, 67, 68, -146, -146, -146, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -146, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 202, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -146, 69, 70, - 71 - }, - - { - 5, -147, -147, -147, -147, -147, -147, -147, -147, -147, - - -147, -147, -147, -147, 67, 67, 68, -147, -147, -147, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -147, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 203, - 67, 67, 67, 67, 67, 67, 67, -147, 69, 70, - 71 - }, - - { - 5, -148, -148, -148, -148, -148, -148, -148, -148, -148, - -148, -148, -148, -148, 67, 67, 68, -148, -148, -148, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -148, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 204, 67, 67, 67, 67, 67, -148, 69, 70, - 71 - }, - - { - 5, -149, -149, -149, -149, -149, -149, -149, -149, -149, - -149, -149, -149, -149, 67, 67, 68, -149, -149, -149, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -149, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 205, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -149, 69, 70, - 71 - - }, - - { - 5, -150, -150, -150, -150, -150, -150, -150, -150, -150, - -150, -150, -150, -150, 67, 67, 68, -150, -150, -150, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -150, 67, 67, 67, 206, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -150, 69, 70, - 71 - }, - - { - 5, -151, -151, -151, -151, -151, -151, -151, -151, -151, - -151, -151, -151, -151, 67, 67, 68, -151, -151, -151, - 67, 67, 67, 67, 67, 67, 207, 67, 67, 67, - - 67, -151, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -151, 69, 70, - 71 - }, - - { - 5, -152, -152, -152, -152, -152, -152, -152, -152, -152, - -152, -152, -152, -152, 67, 67, 68, -152, -152, -152, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -152, 67, 67, 67, 67, 67, 67, 208, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -152, 69, 70, - - 71 - }, - - { - 5, -153, -153, -153, -153, -153, -153, -153, -153, -153, - -153, -153, -153, -153, 67, 67, 68, -153, -153, -153, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -153, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 209, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -153, 69, 70, - 71 - }, - - { - 5, -154, -154, -154, -154, -154, -154, -154, -154, -154, - -154, -154, -154, -154, 67, 67, 68, -154, -154, -154, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -154, 67, 67, 67, 67, 67, 210, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -154, 69, 70, - 71 - }, - - { - 5, -155, -155, -155, -155, -155, -155, -155, -155, -155, - -155, -155, -155, -155, 67, 67, 68, -155, -155, -155, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -155, 67, 67, 67, 67, 67, 67, 211, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -155, 69, 70, - 71 - }, - - { - 5, -156, -156, -156, -156, -156, -156, -156, -156, -156, - -156, -156, -156, -156, 67, 67, 68, -156, -156, -156, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -156, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 212, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 213, 67, -156, 69, 70, - 71 - }, - - { - 5, -157, -157, -157, -157, -157, -157, -157, -157, -157, - - -157, -157, -157, -157, 157, 157, 158, -157, -157, -157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, -157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, -157, 69, 70, - 71 - }, - - { - 5, -158, -158, -158, -158, -158, -158, -158, -158, -158, - -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, -158, 118, 118, 118, 118, 118, 118, 118, 118, - - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, -158, 119, 120, - 121 - }, - - { - 5, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, -159, -159, -159, -159, 99, -159, -159, - -159 - - }, - - { - 5, 160, 160, 160, 160, 161, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 162, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160 - }, - - { - 5, 160, 160, 160, 160, 214, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160 - }, - - { - 5, 160, 160, 160, 215, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160 - }, - - { - 5, 163, 163, 163, 163, 163, 163, 163, 164, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 165, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, 163, 163, 163, 163, 163, 163, 163, 216, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, 163, 163, 163, 217, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166 - }, - - { - 5, -167, -167, -167, -167, -167, -167, -167, -167, -167, - - -167, -167, -167, -167, 168, 168, -167, -167, -167, -167, - -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, - -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, - -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, - -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, - -167 - }, - - { - 5, -168, -168, -168, -168, -168, -168, -168, -168, -168, - -168, -168, -168, -168, 168, 168, -168, -168, -168, -168, - -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, - -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, - - -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, - -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, - -168 - }, - - { - 5, 169, 169, -169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - - }, - - { - 5, 169, 169, -170, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 218, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, 169, 169, -171, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 219, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - - 169, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, -172, -172, -172, -172, -172, -172, -172, -172, -172, - -172, -172, -172, -172, 220, 220, 221, -172, -172, -172, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, -172, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, -172, -172, -172, - - -172 - }, - - { - 5, -173, -173, -173, -173, -173, -173, -173, -173, -173, - -173, -173, -173, -173, 173, 173, 158, -173, -173, -173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, -173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, -173, 174, 175, - 176 - }, - - { - 5, -174, -174, -174, -174, -174, -174, -174, -174, -174, - -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, - - -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, - -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, - -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, - -174, -174, -174, -174, -174, -174, -174, 222, -174, -174, - -174 - }, - - { - 5, -175, -175, -175, -175, -175, -175, -175, -175, -175, - -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, - -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, - -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, - -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, - - -175, -175, -175, -175, -175, -175, -175, 223, -175, -175, - -175 - }, - - { - 5, -176, -176, -176, -176, -176, -176, -176, -176, -176, - -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, - -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, - -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, - -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, - -176, -176, -176, -176, -176, -176, -176, 224, -176, -176, - -176 - }, - - { - 5, -177, -177, -177, -177, -177, -177, -177, -177, -177, - - -177, -177, -177, -177, 173, 173, 158, -177, -177, -177, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, -177, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, -177, 174, 175, - 176 - }, - - { - 5, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, 177, -178, -178, - -178 - }, - - { - 5, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, - -179, -179, -179, -179, -179, -179, -179, 225, -179, -179, - -179 - - }, - - { - 5, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, - -180, -180, -180, -180, -180, -180, -180, 122, -180, -180, - -180 - }, - - { - 5, -181, -181, -181, -181, -181, -181, -181, -181, -181, - -181, -181, -181, -181, 67, 67, 68, -181, -181, -181, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -181, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -181, 69, 70, - 71 - }, - - { - 5, -182, -182, -182, -182, -182, -182, -182, -182, -182, - -182, -182, -182, -182, 67, 67, 68, -182, -182, -182, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -182, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 226, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -182, 69, 70, - - 71 - }, - - { - 5, -183, -183, -183, -183, -183, -183, -183, -183, -183, - -183, -183, -183, -183, 67, 67, 68, -183, -183, -183, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -183, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 227, 67, 67, 67, 67, 67, 67, -183, 69, 70, - 71 - }, - - { - 5, -184, -184, -184, -184, -184, -184, -184, -184, -184, - -184, -184, -184, -184, 67, 67, 68, -184, -184, -184, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -184, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 228, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -184, 69, 70, - 71 - }, - - { - 5, -185, -185, -185, -185, -185, -185, -185, -185, -185, - -185, -185, -185, -185, 67, 67, 68, -185, -185, -185, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -185, 67, 67, 67, 67, 67, 229, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -185, 69, 70, - 71 - }, - - { - 5, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, 67, 67, 68, -186, -186, -186, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -186, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 230, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -186, 69, 70, - 71 - }, - - { - 5, -187, -187, -187, -187, -187, -187, -187, -187, -187, - - -187, -187, -187, -187, 67, 67, 68, -187, -187, -187, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -187, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 231, 67, 67, 67, 67, -187, 69, 70, - 71 - }, - - { - 5, -188, -188, -188, -188, -188, -188, -188, -188, -188, - -188, -188, -188, -188, 67, 67, 68, -188, -188, -188, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -188, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 232, 67, 67, 67, 67, 67, -188, 69, 70, - 71 - }, - - { - 5, -189, -189, -189, -189, -189, -189, -189, -189, -189, - -189, -189, -189, -189, 67, 67, 68, -189, -189, -189, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -189, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 233, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -189, 69, 70, - 71 - - }, - - { - 5, -190, -190, -190, -190, -190, -190, -190, -190, -190, - -190, -190, -190, -190, 67, 67, 68, -190, -190, -190, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -190, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 234, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -190, 69, 70, - 71 - }, - - { - 5, -191, -191, -191, -191, -191, -191, -191, -191, -191, - -191, -191, -191, -191, 67, 67, 68, -191, -191, -191, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -191, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 235, - 67, 67, 67, 67, 67, 67, 67, -191, 69, 70, - 71 - }, - - { - 5, -192, -192, -192, -192, -192, -192, -192, -192, -192, - -192, -192, -192, -192, 67, 67, 68, -192, -192, -192, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -192, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -192, 69, 70, - - 71 - }, - - { - 5, -193, -193, -193, -193, -193, -193, -193, -193, -193, - -193, -193, -193, -193, 67, 67, 68, -193, -193, -193, - 67, 67, 236, 67, 67, 67, 67, 67, 67, 67, - 67, -193, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -193, 69, 70, - 71 - }, - - { - 5, -194, -194, -194, -194, -194, -194, -194, -194, -194, - -194, -194, -194, -194, 67, 67, 68, -194, -194, -194, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -194, 67, 67, 67, 67, 67, 237, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -194, 69, 70, - 71 - }, - - { - 5, -195, -195, -195, -195, -195, -195, -195, -195, -195, - -195, -195, -195, -195, 67, 67, 68, -195, -195, -195, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -195, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -195, 69, 70, - 71 - }, - - { - 5, -196, -196, -196, -196, -196, -196, -196, -196, -196, - -196, -196, -196, -196, 67, 67, 68, -196, -196, -196, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -196, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 238, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -196, 69, 70, - 71 - }, - - { - 5, -197, -197, -197, -197, -197, -197, -197, -197, -197, - - -197, -197, -197, -197, 67, 67, 68, -197, -197, -197, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -197, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 239, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -197, 69, 70, - 71 - }, - - { - 5, -198, -198, -198, -198, -198, -198, -198, -198, -198, - -198, -198, -198, -198, 67, 67, 68, -198, -198, -198, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -198, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 240, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -198, 69, 70, - 71 - }, - - { - 5, -199, -199, -199, -199, -199, -199, -199, -199, -199, - -199, -199, -199, -199, 67, 67, 68, -199, -199, -199, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -199, 67, 67, 67, 67, 67, 241, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -199, 69, 70, - 71 - - }, - - { - 5, -200, -200, -200, -200, -200, -200, -200, -200, -200, - -200, -200, -200, -200, 67, 67, 68, -200, -200, -200, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -200, 67, 67, 67, 67, 67, 242, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -200, 69, 70, - 71 - }, - - { - 5, -201, -201, -201, -201, -201, -201, -201, -201, -201, - -201, -201, -201, -201, 67, 67, 68, -201, -201, -201, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -201, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 243, - 67, 67, 67, 67, 67, 67, 67, -201, 69, 70, - 71 - }, - - { - 5, -202, -202, -202, -202, -202, -202, -202, -202, -202, - -202, -202, -202, -202, 67, 67, 68, -202, -202, -202, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -202, 67, 67, 67, 244, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -202, 69, 70, - - 71 - }, - - { - 5, -203, -203, -203, -203, -203, -203, -203, -203, -203, - -203, -203, -203, -203, 67, 67, 68, -203, -203, -203, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -203, 67, 67, 67, 67, 245, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -203, 69, 70, - 71 - }, - - { - 5, -204, -204, -204, -204, -204, -204, -204, -204, -204, - -204, -204, -204, -204, 67, 67, 68, -204, -204, -204, - - 67, 67, 67, 67, 67, 67, 67, 67, 246, 67, - 67, -204, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -204, 69, 70, - 71 - }, - - { - 5, -205, -205, -205, -205, -205, -205, -205, -205, -205, - -205, -205, -205, -205, 67, 67, 68, -205, -205, -205, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -205, 67, 67, 67, 67, 67, 247, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -205, 69, 70, - 71 - }, - - { - 5, -206, -206, -206, -206, -206, -206, -206, -206, -206, - -206, -206, -206, -206, 67, 67, 68, -206, -206, -206, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -206, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 248, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -206, 69, 70, - 71 - }, - - { - 5, -207, -207, -207, -207, -207, -207, -207, -207, -207, - - -207, -207, -207, -207, 67, 67, 68, -207, -207, -207, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -207, 67, 249, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -207, 69, 70, - 71 - }, - - { - 5, -208, -208, -208, -208, -208, -208, -208, -208, -208, - -208, -208, -208, -208, 67, 67, 68, -208, -208, -208, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -208, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 250, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -208, 69, 70, - 71 - }, - - { - 5, -209, -209, -209, -209, -209, -209, -209, -209, -209, - -209, -209, -209, -209, 67, 67, 68, -209, -209, -209, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -209, 67, 67, 67, 67, 67, 251, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -209, 69, 70, - 71 - - }, - - { - 5, -210, -210, -210, -210, -210, -210, -210, -210, -210, - -210, -210, -210, -210, 67, 67, 68, -210, -210, -210, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 252, - 67, -210, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -210, 69, 70, - 71 - }, - - { - 5, -211, -211, -211, -211, -211, -211, -211, -211, -211, - -211, -211, -211, -211, 67, 67, 68, -211, -211, -211, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -211, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 253, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -211, 69, 70, - 71 - }, - - { - 5, -212, -212, -212, -212, -212, -212, -212, -212, -212, - -212, -212, -212, -212, 67, 67, 68, -212, -212, -212, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -212, 67, 254, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -212, 69, 70, - - 71 - }, - - { - 5, -213, -213, -213, -213, -213, -213, -213, -213, -213, - -213, -213, -213, -213, 67, 67, 68, -213, -213, -213, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -213, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 255, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -213, 69, 70, - 71 - }, - - { - 5, 160, 160, 160, 160, 256, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160 - }, - - { - 5, 160, 160, 160, 160, 161, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 162, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160 - }, - - { - 5, 163, 163, 163, 163, 163, 163, 163, 257, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, 163, 163, 163, 163, 163, 163, 163, 164, 163, - - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 165, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163 - }, - - { - 5, 169, 169, -218, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 258, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, 169, 169, -219, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 259, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - - }, - - { - 5, -220, -220, -220, -220, -220, -220, -220, -220, -220, - -220, -220, -220, -220, 220, 220, 221, -220, -220, -220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, -220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, -220, -220, -220, - -220 - }, - - { - 5, -221, -221, -221, -221, -221, -221, -221, -221, -221, - -221, -221, -221, -221, -221, -221, 117, -221, -221, -221, - -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, - - -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, - -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, - -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, - -221 - }, - - { - 5, -222, -222, -222, -222, -222, -222, -222, -222, -222, - -222, -222, -222, -222, 173, 173, 158, -222, -222, -222, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, -222, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, -222, 174, 175, - - 176 - }, - - { - 5, -223, -223, -223, -223, -223, -223, -223, -223, -223, - -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, - -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, - -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, - -223, -223, -223, -223, -223, -223, -223, -223, -223, -223, - -223, -223, -223, -223, -223, -223, -223, 222, -223, -223, - -223 - }, - - { - 5, -224, -224, -224, -224, -224, -224, -224, -224, -224, - -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, - - -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, - -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, - -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, - -224, -224, -224, -224, -224, -224, -224, 260, -224, -224, - -224 - }, - - { - 5, -225, -225, -225, -225, -225, -225, -225, -225, -225, - -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, - -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, - -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, - -225, -225, -225, -225, -225, -225, -225, -225, -225, -225, - - -225, -225, -225, -225, -225, -225, -225, 177, -225, -225, - -225 - }, - - { - 5, -226, -226, -226, -226, -226, -226, -226, -226, -226, - -226, -226, -226, -226, 67, 67, 68, -226, -226, -226, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -226, 67, 67, 67, 67, 261, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -226, 69, 70, - 71 - }, - - { - 5, -227, -227, -227, -227, -227, -227, -227, -227, -227, - - -227, -227, -227, -227, 67, 67, 68, -227, -227, -227, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -227, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -227, 69, 70, - 71 - }, - - { - 5, -228, -228, -228, -228, -228, -228, -228, -228, -228, - -228, -228, -228, -228, 67, 67, 68, -228, -228, -228, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -228, 67, 67, 67, 67, 67, 67, 67, 262, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -228, 69, 70, - 71 - }, - - { - 5, -229, -229, -229, -229, -229, -229, -229, -229, -229, - -229, -229, -229, -229, 67, 67, 68, -229, -229, -229, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -229, 67, 67, 67, 263, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -229, 69, 70, - 71 - - }, - - { - 5, -230, -230, -230, -230, -230, -230, -230, -230, -230, - -230, -230, -230, -230, 67, 67, 68, -230, -230, -230, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -230, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 264, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -230, 69, 70, - 71 - }, - - { - 5, -231, -231, -231, -231, -231, -231, -231, -231, -231, - -231, -231, -231, -231, 67, 67, 68, -231, -231, -231, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -231, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 265, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -231, 69, 70, - 71 - }, - - { - 5, -232, -232, -232, -232, -232, -232, -232, -232, -232, - -232, -232, -232, -232, 67, 67, 68, -232, -232, -232, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -232, 67, 67, 67, 67, 67, 266, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -232, 69, 70, - - 71 - }, - - { - 5, -233, -233, -233, -233, -233, -233, -233, -233, -233, - -233, -233, -233, -233, 67, 67, 68, -233, -233, -233, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -233, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 267, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -233, 69, 70, - 71 - }, - - { - 5, -234, -234, -234, -234, -234, -234, -234, -234, -234, - -234, -234, -234, -234, 67, 67, 68, -234, -234, -234, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -234, 67, 268, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -234, 69, 70, - 71 - }, - - { - 5, -235, -235, -235, -235, -235, -235, -235, -235, -235, - -235, -235, -235, -235, 67, 67, 68, -235, -235, -235, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -235, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 269, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -235, 69, 70, - 71 - }, - - { - 5, -236, -236, -236, -236, -236, -236, -236, -236, -236, - -236, -236, -236, -236, 67, 67, 68, -236, -236, -236, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -236, 67, 67, 67, 67, 67, 67, 67, 67, - 270, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -236, 69, 70, - 71 - }, - - { - 5, -237, -237, -237, -237, -237, -237, -237, -237, -237, - - -237, -237, -237, -237, 67, 67, 68, -237, -237, -237, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -237, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 271, 67, 67, 67, 67, 67, -237, 69, 70, - 71 - }, - - { - 5, -238, -238, -238, -238, -238, -238, -238, -238, -238, - -238, -238, -238, -238, 67, 67, 68, -238, -238, -238, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -238, 67, 272, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -238, 69, 70, - 71 - }, - - { - 5, -239, -239, -239, -239, -239, -239, -239, -239, -239, - -239, -239, -239, -239, 67, 67, 68, -239, -239, -239, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -239, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 273, 67, 67, 67, 67, 67, 67, -239, 69, 70, - 71 - - }, - - { - 5, -240, -240, -240, -240, -240, -240, -240, -240, -240, - -240, -240, -240, -240, 67, 67, 68, -240, -240, -240, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -240, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 274, 67, 67, -240, 69, 70, - 71 - }, - - { - 5, -241, -241, -241, -241, -241, -241, -241, -241, -241, - -241, -241, -241, -241, 67, 67, 68, -241, -241, -241, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -241, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 275, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -241, 69, 70, - 71 - }, - - { - 5, -242, -242, -242, -242, -242, -242, -242, -242, -242, - -242, -242, -242, -242, 67, 67, 68, -242, -242, -242, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -242, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 276, - 67, 67, 67, 67, 67, 67, 67, -242, 69, 70, - - 71 - }, - - { - 5, -243, -243, -243, -243, -243, -243, -243, -243, -243, - -243, -243, -243, -243, 67, 67, 68, -243, -243, -243, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -243, 67, 67, 67, 67, 67, 277, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -243, 69, 70, - 71 - }, - - { - 5, -244, -244, -244, -244, -244, -244, -244, -244, -244, - -244, -244, -244, -244, 67, 67, 68, -244, -244, -244, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -244, 67, 278, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -244, 69, 70, - 71 - }, - - { - 5, -245, -245, -245, -245, -245, -245, -245, -245, -245, - -245, -245, -245, -245, 67, 67, 68, -245, -245, -245, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -245, 67, 67, 67, 67, 67, 279, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -245, 69, 70, - 71 - }, - - { - 5, -246, -246, -246, -246, -246, -246, -246, -246, -246, - -246, -246, -246, -246, 67, 67, 68, -246, -246, -246, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -246, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 280, - 67, 67, 67, 67, 67, 67, 67, -246, 69, 70, - 71 - }, - - { - 5, -247, -247, -247, -247, -247, -247, -247, -247, -247, - - -247, -247, -247, -247, 67, 67, 68, -247, -247, -247, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -247, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -247, 69, 70, - 71 - }, - - { - 5, -248, -248, -248, -248, -248, -248, -248, -248, -248, - -248, -248, -248, -248, 67, 67, 68, -248, -248, -248, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -248, 67, 281, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -248, 69, 70, - 71 - }, - - { - 5, -249, -249, -249, -249, -249, -249, -249, -249, -249, - -249, -249, -249, -249, 67, 67, 68, -249, -249, -249, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -249, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 282, 67, -249, 69, 70, - 71 - - }, - - { - 5, -250, -250, -250, -250, -250, -250, -250, -250, -250, - -250, -250, -250, -250, 67, 67, 68, -250, -250, -250, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -250, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 283, 67, 67, -250, 69, 70, - 71 - }, - - { - 5, -251, -251, -251, -251, -251, -251, -251, -251, -251, - -251, -251, -251, -251, 67, 67, 68, -251, -251, -251, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -251, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 284, 67, 67, 67, 67, 67, -251, 69, 70, - 71 - }, - - { - 5, -252, -252, -252, -252, -252, -252, -252, -252, -252, - -252, -252, -252, -252, 67, 67, 68, -252, -252, -252, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -252, 67, 285, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -252, 69, 70, - - 71 - }, - - { - 5, -253, -253, -253, -253, -253, -253, -253, -253, -253, - -253, -253, -253, -253, 67, 67, 68, -253, -253, -253, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -253, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 286, - 67, 67, 67, 67, 67, 67, 67, -253, 69, 70, - 71 - }, - - { - 5, -254, -254, -254, -254, -254, -254, -254, -254, -254, - -254, -254, -254, -254, 67, 67, 68, -254, -254, -254, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -254, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 287, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -254, 69, 70, - 71 - }, - - { - 5, -255, -255, -255, -255, -255, -255, -255, -255, -255, - -255, -255, -255, -255, 67, 67, 68, -255, -255, -255, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -255, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 288, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -255, 69, 70, - 71 - }, - - { - 5, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, - -256 - }, - - { - 5, -257, -257, -257, -257, -257, -257, -257, -257, -257, - - -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, - -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, - -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, - -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, - -257, -257, -257, -257, -257, -257, -257, -257, -257, -257, - -257 - }, - - { - 5, -258, -258, -258, -258, -258, -258, -258, -258, -258, - -258, -258, -258, -258, -258, -258, -258, -258, -258, 289, - -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, - -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, - - -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, - -258, -258, -258, -258, -258, -258, -258, -258, -258, -258, - -258 - }, - - { - 5, 169, 169, -259, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 290, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - - }, - - { - 5, -260, -260, -260, -260, -260, -260, -260, -260, -260, - -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, - -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, - -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, - -260, -260, -260, -260, -260, -260, -260, -260, -260, -260, - -260, -260, -260, -260, -260, -260, -260, 222, -260, -260, - -260 - }, - - { - 5, -261, -261, -261, -261, -261, -261, -261, -261, -261, - -261, -261, -261, -261, 67, 67, 68, -261, -261, -261, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -261, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -261, 69, 70, - 71 - }, - - { - 5, -262, -262, -262, -262, -262, -262, -262, -262, -262, - -262, -262, -262, -262, 67, 67, 68, -262, -262, -262, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -262, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -262, 69, 70, - - 71 - }, - - { - 5, -263, -263, -263, -263, -263, -263, -263, -263, -263, - -263, -263, -263, -263, 67, 67, 68, -263, -263, -263, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -263, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 291, 67, 67, 67, 67, 67, -263, 69, 70, - 71 - }, - - { - 5, -264, -264, -264, -264, -264, -264, -264, -264, -264, - -264, -264, -264, -264, 67, 67, 68, -264, -264, -264, - - 67, 67, 67, 292, 67, 67, 67, 67, 67, 67, - 67, -264, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -264, 69, 70, - 71 - }, - - { - 5, -265, -265, -265, -265, -265, -265, -265, -265, -265, - -265, -265, -265, -265, 67, 67, 68, -265, -265, -265, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -265, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 293, 67, 67, 67, 67, 67, -265, 69, 70, - 71 - }, - - { - 5, -266, -266, -266, -266, -266, -266, -266, -266, -266, - -266, -266, -266, -266, 67, 67, 68, -266, -266, -266, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -266, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -266, 69, 70, - 71 - }, - - { - 5, -267, -267, -267, -267, -267, -267, -267, -267, -267, - - -267, -267, -267, -267, 67, 67, 68, -267, -267, -267, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -267, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 294, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -267, 69, 70, - 71 - }, - - { - 5, -268, -268, -268, -268, -268, -268, -268, -268, -268, - -268, -268, -268, -268, 67, 67, 68, -268, -268, -268, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -268, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 295, 67, -268, 69, 70, - 71 - }, - - { - 5, -269, -269, -269, -269, -269, -269, -269, -269, -269, - -269, -269, -269, -269, 67, 67, 68, -269, -269, -269, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -269, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 296, 67, 67, 67, 67, 67, -269, 69, 70, - 71 - - }, - - { - 5, -270, -270, -270, -270, -270, -270, -270, -270, -270, - -270, -270, -270, -270, 67, 67, 68, -270, -270, -270, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -270, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 297, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -270, 69, 70, - 71 - }, - - { - 5, -271, -271, -271, -271, -271, -271, -271, -271, -271, - -271, -271, -271, -271, 67, 67, 68, -271, -271, -271, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -271, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -271, 69, 70, - 71 - }, - - { - 5, -272, -272, -272, -272, -272, -272, -272, -272, -272, - -272, -272, -272, -272, 67, 67, 68, -272, -272, -272, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -272, 67, 67, 67, 67, 298, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -272, 69, 70, - - 71 - }, - - { - 5, -273, -273, -273, -273, -273, -273, -273, -273, -273, - -273, -273, -273, -273, 67, 67, 68, -273, -273, -273, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -273, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 299, 67, 67, 67, 67, 67, 67, -273, 69, 70, - 71 - }, - - { - 5, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, 67, 67, 68, -274, -274, -274, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 300, - 67, -274, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -274, 69, 70, - 71 - }, - - { - 5, -275, -275, -275, -275, -275, -275, -275, -275, -275, - -275, -275, -275, -275, 67, 67, 68, -275, -275, -275, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -275, 67, 67, 67, 67, 301, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -275, 69, 70, - 71 - }, - - { - 5, -276, -276, -276, -276, -276, -276, -276, -276, -276, - -276, -276, -276, -276, 67, 67, 68, -276, -276, -276, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -276, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 302, 67, 67, 67, 67, 67, -276, 69, 70, - 71 - }, - - { - 5, -277, -277, -277, -277, -277, -277, -277, -277, -277, - - -277, -277, -277, -277, 67, 67, 68, -277, -277, -277, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -277, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 303, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -277, 69, 70, - 71 - }, - - { - 5, -278, -278, -278, -278, -278, -278, -278, -278, -278, - -278, -278, -278, -278, 67, 67, 68, -278, -278, -278, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -278, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 304, 67, 67, 67, 67, 67, -278, 69, 70, - 71 - }, - - { - 5, -279, -279, -279, -279, -279, -279, -279, -279, -279, - -279, -279, -279, -279, 67, 67, 68, -279, -279, -279, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -279, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 305, - 67, 67, 67, 67, 67, 67, 67, -279, 69, 70, - 71 - - }, - - { - 5, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, 67, 67, 68, -280, -280, -280, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -280, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 306, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -280, 69, 70, - 71 - }, - - { - 5, -281, -281, -281, -281, -281, -281, -281, -281, -281, - -281, -281, -281, -281, 67, 67, 68, -281, -281, -281, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -281, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 307, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -281, 69, 70, - 71 - }, - - { - 5, -282, -282, -282, -282, -282, -282, -282, -282, -282, - -282, -282, -282, -282, 67, 67, 68, -282, -282, -282, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -282, 67, 67, 67, 67, 67, 308, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -282, 69, 70, - - 71 - }, - - { - 5, -283, -283, -283, -283, -283, -283, -283, -283, -283, - -283, -283, -283, -283, 67, 67, 68, -283, -283, -283, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 309, - 67, -283, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -283, 69, 70, - 71 - }, - - { - 5, -284, -284, -284, -284, -284, -284, -284, -284, -284, - -284, -284, -284, -284, 67, 67, 68, -284, -284, -284, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -284, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 310, - 67, 67, 67, 67, 67, 67, 67, -284, 69, 70, - 71 - }, - - { - 5, -285, -285, -285, -285, -285, -285, -285, -285, -285, - -285, -285, -285, -285, 67, 67, 68, -285, -285, -285, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -285, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 311, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -285, 69, 70, - 71 - }, - - { - 5, -286, -286, -286, -286, -286, -286, -286, -286, -286, - -286, -286, -286, -286, 67, 67, 68, -286, -286, -286, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -286, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 312, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -286, 69, 70, - 71 - }, - - { - 5, -287, -287, -287, -287, -287, -287, -287, -287, -287, - - -287, -287, -287, -287, 67, 67, 68, -287, -287, -287, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -287, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 313, 67, 67, 67, 67, 67, -287, 69, 70, - 71 - }, - - { - 5, -288, -288, -288, -288, -288, -288, -288, -288, -288, - -288, -288, -288, -288, 67, 67, 68, -288, -288, -288, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -288, 67, 67, 67, 67, 67, 67, 67, 314, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -288, 69, 70, - 71 - }, - - { - 5, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, 315, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, - -289 - - }, - - { - 5, 169, 169, -290, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 316, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 171, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, -291, -291, -291, -291, -291, -291, -291, -291, -291, - -291, -291, -291, -291, 67, 67, 68, -291, -291, -291, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -291, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -291, 69, 70, - 71 - }, - - { - 5, -292, -292, -292, -292, -292, -292, -292, -292, -292, - -292, -292, -292, -292, 67, 67, 68, -292, -292, -292, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -292, 67, 317, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -292, 69, 70, - - 71 - }, - - { - 5, -293, -293, -293, -293, -293, -293, -293, -293, -293, - -293, -293, -293, -293, 67, 67, 68, -293, -293, -293, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -293, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -293, 69, 70, - 71 - }, - - { - 5, -294, -294, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, -294, 67, 67, 68, -294, -294, -294, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -294, 67, 318, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -294, 69, 70, - 71 - }, - - { - 5, -295, -295, -295, -295, -295, -295, -295, -295, -295, - -295, -295, -295, -295, 67, 67, 68, -295, -295, -295, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 319, -295, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -295, 69, 70, - 71 - }, - - { - 5, -296, -296, -296, -296, -296, -296, -296, -296, -296, - -296, -296, -296, -296, 67, 67, 68, -296, -296, -296, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -296, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 320, 67, 67, 67, 67, 67, 67, -296, 69, 70, - 71 - }, - - { - 5, -297, -297, -297, -297, -297, -297, -297, -297, -297, - - -297, -297, -297, -297, 67, 67, 68, -297, -297, -297, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -297, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 321, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -297, 69, 70, - 71 - }, - - { - 5, -298, -298, -298, -298, -298, -298, -298, -298, -298, - -298, -298, -298, -298, 67, 67, 68, -298, -298, -298, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -298, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -298, 69, 70, - 71 - }, - - { - 5, -299, -299, -299, -299, -299, -299, -299, -299, -299, - -299, -299, -299, -299, 67, 67, 68, -299, -299, -299, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -299, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 322, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -299, 69, 70, - 71 - - }, - - { - 5, -300, -300, -300, -300, -300, -300, -300, -300, -300, - -300, -300, -300, -300, 67, 67, 68, -300, -300, -300, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -300, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 323, 67, 67, 67, 67, -300, 69, 70, - 71 - }, - - { - 5, -301, -301, -301, -301, -301, -301, -301, -301, -301, - -301, -301, -301, -301, 67, 67, 68, -301, -301, -301, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -301, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -301, 69, 70, - 71 - }, - - { - 5, -302, -302, -302, -302, -302, -302, -302, -302, -302, - -302, -302, -302, -302, 67, 67, 68, -302, -302, -302, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -302, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 324, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -302, 69, 70, - - 71 - }, - - { - 5, -303, -303, -303, -303, -303, -303, -303, -303, -303, - -303, -303, -303, -303, 67, 67, 68, -303, -303, -303, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -303, 67, 67, 67, 325, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -303, 69, 70, - 71 - }, - - { - 5, -304, -304, -304, -304, -304, -304, -304, -304, -304, - -304, -304, -304, -304, 67, 67, 68, -304, -304, -304, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -304, 67, 67, 67, 67, 67, 326, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -304, 69, 70, - 71 - }, - - { - 5, -305, -305, -305, -305, -305, -305, -305, -305, -305, - -305, -305, -305, -305, 67, 67, 68, -305, -305, -305, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -305, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -305, 69, 70, - 71 - }, - - { - 5, -306, -306, -306, -306, -306, -306, -306, -306, -306, - -306, -306, -306, -306, 67, 67, 68, -306, -306, -306, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -306, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 327, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -306, 69, 70, - 71 - }, - - { - 5, -307, -307, -307, -307, -307, -307, -307, -307, -307, - - -307, -307, -307, -307, 67, 67, 68, -307, -307, -307, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -307, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 328, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -307, 69, 70, - 71 - }, - - { - 5, -308, -308, -308, -308, -308, -308, -308, -308, -308, - -308, -308, -308, -308, 67, 67, 68, -308, -308, -308, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -308, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 329, - 67, 67, 67, 67, 67, 67, 67, -308, 69, 70, - 71 - }, - - { - 5, -309, -309, -309, -309, -309, -309, -309, -309, -309, - -309, -309, -309, -309, 67, 67, 68, -309, -309, -309, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -309, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 330, 67, 67, 67, 67, -309, 69, 70, - 71 - - }, - - { - 5, -310, -310, -310, -310, -310, -310, -310, -310, -310, - -310, -310, -310, -310, 67, 67, 68, -310, -310, -310, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -310, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 331, 67, -310, 69, 70, - 71 - }, - - { - 5, -311, -311, -311, -311, -311, -311, -311, -311, -311, - -311, -311, -311, -311, 67, 67, 68, -311, -311, -311, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -311, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 332, 67, - 67, 67, 67, 67, 67, 67, 67, -311, 69, 70, - 71 - }, - - { - 5, -312, -312, -312, -312, -312, -312, -312, -312, -312, - -312, -312, -312, -312, 67, 67, 68, -312, -312, -312, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -312, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -312, 69, 70, - - 71 - }, - - { - 5, -313, -313, -313, -313, -313, -313, -313, -313, -313, - -313, -313, -313, -313, 67, 67, 68, -313, -313, -313, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 333, - 67, -313, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 334, 67, 67, 67, 67, 67, 67, -313, 69, 70, - 71 - }, - - { - 5, -314, -314, -314, -314, -314, -314, -314, -314, -314, - -314, -314, -314, -314, 67, 67, 68, -314, -314, -314, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -314, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -314, 69, 70, - 71 - }, - - { - 5, -315, -315, -315, -315, -315, -315, -315, -315, -315, - -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, - -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, - -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, - -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, - - -315, -315, -315, -315, -315, -315, -315, -315, -315, -315, - -315 - }, - - { - 5, 169, 169, -316, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 335, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, -317, -317, -317, -317, -317, -317, -317, -317, -317, - - -317, -317, -317, -317, 67, 67, 68, -317, -317, -317, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -317, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 336, 67, 67, 67, 67, 67, -317, 69, 70, - 71 - }, - - { - 5, -318, -318, -318, -318, -318, -318, -318, -318, -318, - -318, -318, -318, -318, 67, 67, 68, -318, -318, -318, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -318, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 337, - 67, 67, 67, 67, 67, 67, 67, -318, 69, 70, - 71 - }, - - { - 5, -319, -319, -319, -319, -319, -319, -319, -319, -319, - -319, -319, -319, -319, 67, 67, 68, -319, -319, -319, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -319, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 338, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -319, 69, 70, - 71 - - }, - - { - 5, -320, -320, -320, -320, -320, -320, -320, -320, -320, - -320, -320, -320, -320, 67, 67, 68, -320, -320, -320, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -320, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -320, 69, 70, - 71 - }, - - { - 5, -321, -321, -321, -321, -321, -321, -321, -321, -321, - -321, -321, -321, -321, 67, 67, 68, -321, -321, -321, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -321, 67, 67, 67, 67, 339, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -321, 69, 70, - 71 - }, - - { - 5, -322, -322, -322, -322, -322, -322, -322, -322, -322, - -322, -322, -322, -322, 67, 67, 68, -322, -322, -322, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -322, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 340, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -322, 69, 70, - - 71 - }, - - { - 5, -323, -323, -323, -323, -323, -323, -323, -323, -323, - -323, -323, -323, -323, 67, 67, 68, -323, -323, -323, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -323, 67, 67, 341, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -323, 69, 70, - 71 - }, - - { - 5, -324, -324, -324, -324, -324, -324, -324, -324, -324, - -324, -324, -324, -324, 67, 67, 68, -324, -324, -324, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -324, 67, 67, 67, 67, 67, 342, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -324, 69, 70, - 71 - }, - - { - 5, -325, -325, -325, -325, -325, -325, -325, -325, -325, - -325, -325, -325, -325, 67, 67, 68, -325, -325, -325, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -325, 67, 67, 67, 67, 67, 343, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -325, 69, 70, - 71 - }, - - { - 5, -326, -326, -326, -326, -326, -326, -326, -326, -326, - -326, -326, -326, -326, 67, 67, 68, -326, -326, -326, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -326, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 344, 67, 67, 67, 67, 67, 67, -326, 69, 70, - 71 - }, - - { - 5, -327, -327, -327, -327, -327, -327, -327, -327, -327, - - -327, -327, -327, -327, 67, 67, 68, -327, -327, -327, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -327, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 345, 67, 67, 67, 67, 67, 67, -327, 69, 70, - 71 - }, - - { - 5, -328, -328, -328, -328, -328, -328, -328, -328, -328, - -328, -328, -328, -328, 67, 67, 68, -328, -328, -328, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -328, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 346, -328, 69, 70, - 71 - }, - - { - 5, -329, -329, -329, -329, -329, -329, -329, -329, -329, - -329, -329, -329, -329, 67, 67, 68, -329, -329, -329, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -329, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 347, 67, 67, 67, 67, 67, 67, -329, 69, 70, - 71 - - }, - - { - 5, -330, -330, -330, -330, -330, -330, -330, -330, -330, - -330, -330, -330, -330, 67, 67, 68, -330, -330, -330, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -330, 67, 67, 348, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -330, 69, 70, - 71 - }, - - { - 5, -331, -331, -331, -331, -331, -331, -331, -331, -331, - -331, -331, -331, -331, 67, 67, 68, -331, -331, -331, - 349, 67, 67, 67, 67, 350, 67, 67, 67, 67, - - 67, -331, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -331, 69, 70, - 71 - }, - - { - 5, -332, -332, -332, -332, -332, -332, -332, -332, -332, - -332, -332, -332, -332, 67, 67, 68, -332, -332, -332, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -332, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 351, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -332, 69, 70, - - 71 - }, - - { - 5, -333, -333, -333, -333, -333, -333, -333, -333, -333, - -333, -333, -333, -333, 67, 67, 68, -333, -333, -333, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -333, 67, 67, 67, 67, 67, 352, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -333, 69, 70, - 71 - }, - - { - 5, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, -334, -334, -334, 67, 67, 68, -334, -334, -334, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -334, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -334, 69, 70, - 71 - }, - - { - 5, 169, 169, -335, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 258, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169 - }, - - { - 5, -336, -336, -336, -336, -336, -336, -336, -336, -336, - -336, -336, -336, -336, 67, 67, 68, -336, -336, -336, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -336, 67, 353, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -336, 69, 70, - 71 - }, - - { - 5, -337, -337, -337, -337, -337, -337, -337, -337, -337, - - -337, -337, -337, -337, 67, 67, 68, -337, -337, -337, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -337, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 354, 67, -337, 69, 70, - 71 - }, - - { - 5, -338, -338, -338, -338, -338, -338, -338, -338, -338, - -338, -338, -338, -338, 67, 67, 68, -338, -338, -338, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -338, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 355, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -338, 69, 70, - 71 - }, - - { - 5, -339, -339, -339, -339, -339, -339, -339, -339, -339, - -339, -339, -339, -339, 67, 67, 68, -339, -339, -339, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -339, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 356, - 67, 67, 67, 67, 67, 67, 67, -339, 69, 70, - 71 - - }, - - { - 5, -340, -340, -340, -340, -340, -340, -340, -340, -340, - -340, -340, -340, -340, 67, 67, 68, -340, -340, -340, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -340, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 357, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -340, 69, 70, - 71 - }, - - { - 5, -341, -341, -341, -341, -341, -341, -341, -341, -341, - -341, -341, -341, -341, 67, 67, 68, -341, -341, -341, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -341, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 358, 67, 67, 67, 67, 67, 67, -341, 69, 70, - 71 - }, - - { - 5, -342, -342, -342, -342, -342, -342, -342, -342, -342, - -342, -342, -342, -342, 67, 67, 68, -342, -342, -342, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -342, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 359, 67, 67, 67, 67, 67, 67, -342, 69, 70, - - 71 - }, - - { - 5, -343, -343, -343, -343, -343, -343, -343, -343, -343, - -343, -343, -343, -343, 67, 67, 68, -343, -343, -343, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -343, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 360, 67, 67, 67, 67, 67, 67, -343, 69, 70, - 71 - }, - - { - 5, -344, -344, -344, -344, -344, -344, -344, -344, -344, - -344, -344, -344, -344, 67, 67, 68, -344, -344, -344, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -344, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -344, 69, 70, - 71 - }, - - { - 5, -345, -345, -345, -345, -345, -345, -345, -345, -345, - -345, -345, -345, -345, 67, 67, 68, -345, -345, -345, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -345, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -345, 69, 70, - 71 - }, - - { - 5, -346, -346, -346, -346, -346, -346, -346, -346, -346, - -346, -346, -346, -346, 67, 67, 68, -346, -346, -346, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -346, 67, 67, 67, 67, 67, 361, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -346, 69, 70, - 71 - }, - - { - 5, -347, -347, -347, -347, -347, -347, -347, -347, -347, - - -347, -347, -347, -347, 67, 67, 68, -347, -347, -347, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -347, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -347, 69, 70, - 71 - }, - - { - 5, -348, -348, -348, -348, -348, -348, -348, -348, -348, - -348, -348, -348, -348, 67, 67, 68, -348, -348, -348, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -348, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 362, 67, 67, 67, 67, 67, 67, -348, 69, 70, - 71 - }, - - { - 5, -349, -349, -349, -349, -349, -349, -349, -349, -349, - -349, -349, -349, -349, 67, 67, 68, -349, -349, -349, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -349, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 363, - 67, 67, 67, 67, 67, 67, 67, -349, 69, 70, - 71 - - }, - - { - 5, -350, -350, -350, -350, -350, -350, -350, -350, -350, - -350, -350, -350, -350, 67, 67, 68, -350, -350, -350, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -350, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 364, 67, 67, 67, 67, -350, 69, 70, - 71 - }, - - { - 5, -351, -351, -351, -351, -351, -351, -351, -351, -351, - -351, -351, -351, -351, 67, 67, 68, -351, -351, -351, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -351, 67, 67, 67, 67, 67, 365, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -351, 69, 70, - 71 - }, - - { - 5, -352, -352, -352, -352, -352, -352, -352, -352, -352, - -352, -352, -352, -352, 67, 67, 68, -352, -352, -352, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -352, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 366, 67, 67, 67, 67, 67, -352, 69, 70, - - 71 - }, - - { - 5, -353, -353, -353, -353, -353, -353, -353, -353, -353, - -353, -353, -353, -353, 67, 67, 68, -353, -353, -353, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -353, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -353, 69, 70, - 71 - }, - - { - 5, -354, -354, -354, -354, -354, -354, -354, -354, -354, - -354, -354, -354, -354, 67, 67, 68, -354, -354, -354, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -354, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -354, 69, 70, - 71 - }, - - { - 5, -355, -355, -355, -355, -355, -355, -355, -355, -355, - -355, -355, -355, -355, 67, 67, 68, -355, -355, -355, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -355, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 367, 67, 67, 67, 67, 67, -355, 69, 70, - 71 - }, - - { - 5, -356, -356, -356, -356, -356, -356, -356, -356, -356, - -356, -356, -356, -356, 67, 67, 68, -356, -356, -356, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -356, 67, 67, 67, 67, 67, 368, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -356, 69, 70, - 71 - }, - - { - 5, -357, -357, -357, -357, -357, -357, -357, -357, -357, - - -357, -357, -357, -357, 67, 67, 68, -357, -357, -357, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -357, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -357, 69, 70, - 71 - }, - - { - 5, -358, -358, -358, -358, -358, -358, -358, -358, -358, - -358, -358, -358, -358, 67, 67, 68, -358, -358, -358, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -358, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 369, 67, 67, 67, 67, 67, -358, 69, 70, - 71 - }, - - { - 5, -359, -359, -359, -359, -359, -359, -359, -359, -359, - -359, -359, -359, -359, 67, 67, 68, -359, -359, -359, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -359, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -359, 69, 70, - 71 - - }, - - { - 5, -360, -360, -360, -360, -360, -360, -360, -360, -360, - -360, -360, -360, -360, 67, 67, 68, -360, -360, -360, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -360, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -360, 69, 70, - 71 - }, - - { - 5, -361, -361, -361, -361, -361, -361, -361, -361, -361, - -361, -361, -361, -361, 67, 67, 68, -361, -361, -361, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -361, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 370, 67, 67, 67, 67, 67, 67, -361, 69, 70, - 71 - }, - - { - 5, -362, -362, -362, -362, -362, -362, -362, -362, -362, - -362, -362, -362, -362, 67, 67, 68, -362, -362, -362, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -362, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 371, 67, 67, 67, 67, 67, -362, 69, 70, - - 71 - }, - - { - 5, -363, -363, -363, -363, -363, -363, -363, -363, -363, - -363, -363, -363, -363, 67, 67, 68, -363, -363, -363, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -363, 67, 67, 67, 67, 67, 67, 67, 372, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -363, 69, 70, - 71 - }, - - { - 5, -364, -364, -364, -364, -364, -364, -364, -364, -364, - -364, -364, -364, -364, 67, 67, 68, -364, -364, -364, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -364, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 373, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -364, 69, 70, - 71 - }, - - { - 5, -365, -365, -365, -365, -365, -365, -365, -365, -365, - -365, -365, -365, -365, 67, 67, 68, -365, -365, -365, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -365, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 374, 67, 67, 67, 67, 67, 67, -365, 69, 70, - 71 - }, - - { - 5, -366, -366, -366, -366, -366, -366, -366, -366, -366, - -366, -366, -366, -366, 67, 67, 68, -366, -366, -366, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -366, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 375, 67, 67, 67, 67, 67, 67, -366, 69, 70, - 71 - }, - - { - 5, -367, -367, -367, -367, -367, -367, -367, -367, -367, - - -367, -367, -367, -367, 67, 67, 68, -367, -367, -367, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -367, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -367, 69, 70, - 71 - }, - - { - 5, -368, -368, -368, -368, -368, -368, -368, -368, -368, - -368, -368, -368, -368, 67, 67, 68, -368, -368, -368, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -368, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 376, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -368, 69, 70, - 71 - }, - - { - 5, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, 67, 67, 68, -369, -369, -369, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -369, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 377, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -369, 69, 70, - 71 - - }, - - { - 5, -370, -370, -370, -370, -370, -370, -370, -370, -370, - -370, -370, -370, -370, 67, 67, 68, -370, -370, -370, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -370, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -370, 69, 70, - 71 - }, - - { - 5, -371, -371, -371, -371, -371, -371, -371, -371, -371, - -371, -371, -371, -371, 67, 67, 68, -371, -371, -371, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -371, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 378, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -371, 69, 70, - 71 - }, - - { - 5, -372, -372, -372, -372, -372, -372, -372, -372, -372, - -372, -372, -372, -372, 67, 67, 68, -372, -372, -372, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -372, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 379, 67, 67, 67, 67, -372, 69, 70, - - 71 - }, - - { - 5, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, -373, 67, 67, 68, -373, -373, -373, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -373, 67, 67, 67, 380, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -373, 69, 70, - 71 - }, - - { - 5, -374, -374, -374, -374, -374, -374, -374, -374, -374, - -374, -374, -374, -374, 67, 67, 68, -374, -374, -374, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -374, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -374, 69, 70, - 71 - }, - - { - 5, -375, -375, -375, -375, -375, -375, -375, -375, -375, - -375, -375, -375, -375, 67, 67, 68, -375, -375, -375, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -375, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, -375, 69, 70, - 71 - }, - - { - 5, -376, -376, -376, -376, -376, -376, -376, -376, -376, - -376, -376, -376, -376, 67, 67, 68, -376, -376, -376, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -376, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -376, 69, 70, - 71 - }, - - { - 5, -377, -377, -377, -377, -377, -377, -377, -377, -377, - - -377, -377, -377, -377, 67, 67, 68, -377, -377, -377, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -377, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 381, 67, 67, 67, 67, 67, -377, 69, 70, - 71 - }, - - { - 5, -378, -378, -378, -378, -378, -378, -378, -378, -378, - -378, -378, -378, -378, 67, 67, 68, -378, -378, -378, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -378, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 382, 67, 67, 67, 67, 67, -378, 69, 70, - 71 - }, - - { - 5, -379, -379, -379, -379, -379, -379, -379, -379, -379, - -379, -379, -379, -379, 67, 67, 68, -379, -379, -379, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -379, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 383, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -379, 69, 70, - 71 - - }, - - { - 5, -380, -380, -380, -380, -380, -380, -380, -380, -380, - -380, -380, -380, -380, 67, 67, 68, -380, -380, -380, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -380, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 384, 67, 67, 67, 67, 67, -380, 69, 70, - 71 - }, - - { - 5, -381, -381, -381, -381, -381, -381, -381, -381, -381, - -381, -381, -381, -381, 67, 67, 68, -381, -381, -381, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -381, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 385, 67, 67, 67, 67, -381, 69, 70, - 71 - }, - - { - 5, -382, -382, -382, -382, -382, -382, -382, -382, -382, - -382, -382, -382, -382, 67, 67, 68, -382, -382, -382, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -382, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 386, 67, 67, 67, 67, -382, 69, 70, - - 71 - }, - - { - 5, -383, -383, -383, -383, -383, -383, -383, -383, -383, - -383, -383, -383, -383, 67, 67, 68, -383, -383, -383, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -383, 67, 67, 67, 67, 67, 387, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -383, 69, 70, - 71 - }, - - { - 5, -384, -384, -384, -384, -384, -384, -384, -384, -384, - -384, -384, -384, -384, 67, 67, 68, -384, -384, -384, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -384, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 388, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -384, 69, 70, - 71 - }, - - { - 5, -385, -385, -385, -385, -385, -385, -385, -385, -385, - -385, -385, -385, -385, 67, 67, 68, -385, -385, -385, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -385, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 389, 67, 67, 67, 67, 67, -385, 69, 70, - 71 - }, - - { - 5, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, 67, 67, 68, -386, -386, -386, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -386, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 390, 67, 67, 67, 67, 67, -386, 69, 70, - 71 - }, - - { - 5, -387, -387, -387, -387, -387, -387, -387, -387, -387, - - -387, -387, -387, -387, 67, 67, 68, -387, -387, -387, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -387, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 391, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -387, 69, 70, - 71 - }, - - { - 5, -388, -388, -388, -388, -388, -388, -388, -388, -388, - -388, -388, -388, -388, 67, 67, 68, -388, -388, -388, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -388, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 67, 392, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -388, 69, 70, - 71 - }, - - { - 5, -389, -389, -389, -389, -389, -389, -389, -389, -389, - -389, -389, -389, -389, 67, 67, 68, -389, -389, -389, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -389, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 393, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -389, 69, 70, - 71 - - }, - - { - 5, -390, -390, -390, -390, -390, -390, -390, -390, -390, - -390, -390, -390, -390, 67, 67, 68, -390, -390, -390, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -390, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 394, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -390, 69, 70, - 71 - }, - - { - 5, -391, -391, -391, -391, -391, -391, -391, -391, -391, - -391, -391, -391, -391, 67, 67, 68, -391, -391, -391, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -391, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 395, 67, 67, 67, 67, 67, -391, 69, 70, - 71 - }, - - { - 5, -392, -392, -392, -392, -392, -392, -392, -392, -392, - -392, -392, -392, -392, 67, 67, 68, -392, -392, -392, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -392, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 396, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -392, 69, 70, - - 71 - }, - - { - 5, -393, -393, -393, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, 67, 67, 68, -393, -393, -393, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -393, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 397, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -393, 69, 70, - 71 - }, - - { - 5, -394, -394, -394, -394, -394, -394, -394, -394, -394, - -394, -394, -394, -394, 67, 67, 68, -394, -394, -394, - - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -394, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 398, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -394, 69, 70, - 71 - }, - - { - 5, -395, -395, -395, -395, -395, -395, -395, -395, -395, - -395, -395, -395, -395, 67, 67, 68, -395, -395, -395, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -395, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 399, 67, 67, 67, 67, 67, 67, -395, 69, 70, - 71 - }, - - { - 5, -396, -396, -396, -396, -396, -396, -396, -396, -396, - -396, -396, -396, -396, 67, 67, 68, -396, -396, -396, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -396, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -396, 69, 70, - 71 - }, - - { - 5, -397, -397, -397, -397, -397, -397, -397, -397, -397, - - -397, -397, -397, -397, 67, 67, 68, -397, -397, -397, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -397, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 400, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -397, 69, 70, - 71 - }, - - { - 5, -398, -398, -398, -398, -398, -398, -398, -398, -398, - -398, -398, -398, -398, 67, 67, 68, -398, -398, -398, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -398, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, 67, 67, 67, 67, 67, 401, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -398, 69, 70, - 71 - }, - - { - 5, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, 67, 67, 68, -399, -399, -399, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -399, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -399, 69, 70, - 71 - - }, - - { - 5, -400, -400, -400, -400, -400, -400, -400, -400, -400, - -400, -400, -400, -400, 67, 67, 68, -400, -400, -400, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -400, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 402, 67, 67, 67, 67, 67, 67, -400, 69, 70, - 71 - }, - - { - 5, -401, -401, -401, -401, -401, -401, -401, -401, -401, - -401, -401, -401, -401, 67, 67, 68, -401, -401, -401, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - - 67, -401, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 403, 67, 67, 67, 67, 67, 67, -401, 69, 70, - 71 - }, - - { - 5, -402, -402, -402, -402, -402, -402, -402, -402, -402, - -402, -402, -402, -402, 67, 67, 68, -402, -402, -402, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -402, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -402, 69, 70, - - 71 - }, - - { - 5, -403, -403, -403, -403, -403, -403, -403, -403, -403, - -403, -403, -403, -403, 67, 67, 68, -403, -403, -403, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, -403, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, -403, 69, 70, - 71 - }, - - } ; - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yyg->yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 69 -#define YY_END_OF_BUFFER 70 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[404] = - { 0, - 0, 0, 0, 0, 70, 68, 1, 7, 7, 68, - 2, 67, 68, 67, 67, 68, 62, 68, 67, 50, - 50, 68, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 68, 68, 68, 5, 5, - 5, 5, 5, 1, 7, 0, 0, 0, 2, 0, - 0, 0, 0, 61, 63, 0, 65, 4, 3, 64, - 62, 0, 0, 52, 0, 53, 50, 0, 0, 0, - 0, 50, 68, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, - - 0, 6, 56, 58, 0, 55, 57, 0, 0, 0, - 3, 64, 0, 64, 53, 0, 0, 51, 0, 0, - 0, 50, 0, 0, 50, 8, 50, 50, 50, 50, - 16, 50, 50, 50, 20, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 34, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 0, 0, 0, - 0, 0, 0, 0, 0, 66, 0, 65, 0, 0, - 0, 49, 51, 0, 0, 0, 51, 0, 0, 0, - 24, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 22, 50, 50, 26, 50, 50, 50, 50, 50, - - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 0, 0, 0, 0, 0, 0, 49, - 0, 51, 0, 0, 0, 50, 10, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 37, 50, 50, 50, - 50, 50, 50, 50, 50, 60, 59, 54, 0, 0, - 9, 11, 50, 13, 50, 17, 50, 50, 50, 50, - 25, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 54, 54, - 12, 50, 15, 50, 50, 50, 50, 27, 50, 50, - - 30, 50, 50, 50, 35, 50, 50, 50, 50, 50, - 50, 44, 50, 48, 54, 54, 50, 50, 50, 21, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 47, 54, 50, 50, 50, 50, 50, - 50, 50, 50, 33, 36, 50, 38, 50, 50, 50, - 50, 50, 14, 18, 50, 50, 28, 50, 31, 32, - 50, 50, 50, 50, 50, 45, 19, 50, 50, 40, - 50, 50, 50, 43, 46, 23, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 42, 50, 50, 41, 50, - - 50, 29, 39 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 7, 1, 7, 8, 7, - 7, 9, 10, 7, 11, 12, 13, 14, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 16, 7, 17, - 7, 18, 1, 19, 20, 21, 22, 23, 24, 25, - 21, 21, 21, 21, 21, 26, 21, 27, 21, 28, - 21, 21, 29, 21, 30, 21, 21, 21, 21, 21, - 7, 31, 7, 1, 32, 1, 33, 34, 35, 36, - - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 42, 49, 50, 51, 52, 53, 42, 54, - 55, 56, 7, 1, 7, 1, 1, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 1, 1, 58, 58, 58, 58, 58, 58, 58, - - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, - 60, 60, 60, 60, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "pxr/usd/sdf/textFileFormat.ll" -#line 2 "pxr/usd/sdf/textFileFormat.ll" -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -#include "pxr/pxr.h" -#include "pxr/base/arch/fileSystem.h" -#include "pxr/base/tf/errorMark.h" -#include "pxr/base/tf/stringUtils.h" -#include "pxr/usd/sdf/textParserContext.h" -#include "pxr/usd/sdf/parserHelpers.h" -#include "pxr/usd/sdf/schema.h" - -// Token table from yacc file -#include "textFileFormat.tab.h" - -#ifndef fileno -#define fileno(fd) ArchFileNo(fd) -#endif -#ifndef isatty -#define isatty(fd) ArchFileIsaTTY(fd) -#endif - -using std::map; -using std::vector; - -PXR_NAMESPACE_USING_DIRECTIVE - -#define YYSTYPE Sdf_ParserHelpers::Value - -// As a pure parser, we must define the following -#define YY_DECL int textFileFormatYylex(YYSTYPE *yylval_param, yyscan_t yyscanner) - -// The context object will be used to store global state for the parser. -#define YY_EXTRA_TYPE Sdf_TextParserContext * - -/* Configuration options for flex */ -/* character classes - * defines UTF-8 encoded byte values for standard ASCII - * and multi-byte UTF-8 character sets - * valid multi-byte UTF-8 sequences are as follows: - * For an n-byte encoded UTF-8 character, the last n-1 bytes range [\x80-\xbf] - * 2-byte UTF-8 characters, first byte in range [\xc2-\xdf] - * 3-byte UTF-8 characters, first byte in range [\xe0-\xef] - * 4-byte UTF-8 characters, first byte in range [\xf0-\xf4] - * ASCII characters span [\x41-\x5a] (upper case) [\x61-\x7a] (lower case) [\x30-39] (digits) - */ -/* States */ - -#line 4848 "pxr/usd/sdf/textFileFormat.lex.cpp" - -#define INITIAL 0 -#define SLASHTERIX_COMMENT 1 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - }; /* end struct yyguts_t */ - -static int yy_init_globals (yyscan_t yyscanner ); - - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - -int textFileFormatYylex_init (yyscan_t* scanner); - -int textFileFormatYylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int textFileFormatYylex_destroy (yyscan_t yyscanner ); - -int textFileFormatYyget_debug (yyscan_t yyscanner ); - -void textFileFormatYyset_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE textFileFormatYyget_extra (yyscan_t yyscanner ); - -void textFileFormatYyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *textFileFormatYyget_in (yyscan_t yyscanner ); - -void textFileFormatYyset_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *textFileFormatYyget_out (yyscan_t yyscanner ); - -void textFileFormatYyset_out (FILE * out_str ,yyscan_t yyscanner ); - -yy_size_t textFileFormatYyget_leng (yyscan_t yyscanner ); - -char *textFileFormatYyget_text (yyscan_t yyscanner ); - -int textFileFormatYyget_lineno (yyscan_t yyscanner ); - -void textFileFormatYyset_lineno (int line_number ,yyscan_t yyscanner ); - -int textFileFormatYyget_column (yyscan_t yyscanner ); - -void textFileFormatYyset_column (int column_no ,yyscan_t yyscanner ); - -YYSTYPE * textFileFormatYyget_lval (yyscan_t yyscanner ); - -void textFileFormatYyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int textFileFormatYywrap (yyscan_t yyscanner ); -#else -extern int textFileFormatYywrap (yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int textFileFormatYylex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); - -#define YY_DECL int textFileFormatYylex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yylval = yylval_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - textFileFormatYyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - textFileFormatYy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - textFileFormatYy_load_buffer_state(yyscanner ); - } - - { -#line 98 "pxr/usd/sdf/textFileFormat.ll" - - - /* skip over whitespace and comments */ - /* handle the first line # comment specially, since it contains the - magic token */ -#line 5119 "pxr/usd/sdf/textFileFormat.lex.cpp" - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yyg->yy_start; -yy_match: - while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) - { - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - - ++yy_cp; - } - - yy_current_state = -yy_current_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos + 1; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 103 "pxr/usd/sdf/textFileFormat.ll" -{} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 104 "pxr/usd/sdf/textFileFormat.ll" -{ - if (yyextra->sdfLineNo == 1) { - (*yylval_param) = std::string(yytext, yyleng); - return TOK_MAGIC; - } - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 110 "pxr/usd/sdf/textFileFormat.ll" -{} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 111 "pxr/usd/sdf/textFileFormat.ll" -BEGIN SLASHTERIX_COMMENT ; - YY_BREAK -case 5: -/* rule 5 can match eol */ -YY_RULE_SETUP -#line 112 "pxr/usd/sdf/textFileFormat.ll" -; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 113 "pxr/usd/sdf/textFileFormat.ll" -BEGIN INITIAL ; - YY_BREAK -/* newline is returned as TOK_NL - * Note that newlines embedded in quoted strings and tuples are counted - * as part of the token and do NOT emit a separate TOK_NL. - */ -case 7: -/* rule 7 can match eol */ -YY_RULE_SETUP -#line 119 "pxr/usd/sdf/textFileFormat.ll" -{ - yyextra->sdfLineNo++; - return TOK_NL; - } - YY_BREAK -/* literal keywords. we return the yytext so that the yacc grammar - can make use of it. */ -case 8: -YY_RULE_SETUP -#line 126 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_ADD; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 127 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_APPEND; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 128 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_CLASS; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 129 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_CONFIG; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 130 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_CONNECT; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 131 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOM; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 132 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOMDATA; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 133 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DEFAULT; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 134 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DEF; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 135 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DELETE; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 136 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DICTIONARY; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 137 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DISPLAYUNIT; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 138 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_DOC; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 139 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_INHERITS; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 140 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_KIND; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 141 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_NAMECHILDREN; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 142 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_NONE; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 143 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_OFFSET; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 144 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_OVER; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 145 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_PAYLOAD; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 146 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_PERMISSION; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 147 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_PREFIX_SUBSTITUTIONS; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 148 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_PREPEND; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 149 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_PROPERTIES; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 150 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_REFERENCES; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 151 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_RELOCATES; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 152 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_REL; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 153 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_REORDER; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 154 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_ROOTPRIMS; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 155 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SCALE; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 156 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SUBLAYERS; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 157 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SUFFIX_SUBSTITUTIONS; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 158 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SPECIALIZES; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 159 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYARGUMENTS; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 160 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYFUNCTION; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 161 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_TIME_SAMPLES; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 162 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_UNIFORM; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 163 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 164 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSETS; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 165 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTS; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 166 "pxr/usd/sdf/textFileFormat.ll" -{ (*yylval_param) = std::string(yytext, yyleng); return TOK_VARYING; } - YY_BREAK -/* unquoted C++ namespaced identifier -- see bug 10775 */ -case 49: -YY_RULE_SETUP -#line 169 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = std::string(yytext, yyleng); - return TOK_CXX_NAMESPACED_IDENTIFIER; - } - YY_BREAK -/* In a Unicode enabled scheme, 'identifiers' are generally - * categorized as something that begins with something in the - * XID_Start category followed by zero or more things in the - * XID_Continue category. Since the number of characters in - * these classes are large, we can't explicitly validate them - * here easily, so the lex rule is pretty permissive with some - * further validation done in code prior to calling what was - * read an 'identifier'. Note this rule will also match - * standard ASCII strings because the UTF-8 encoded byte - * representation is the same for these characters. - * However, unlike the path lexer, we can guarantee that - * prim names aren't something special to be called out here - * so we can be a little more specific about the kinds of strings - * we match, particularly to not collide with the pure digit match rule - * below - */ -case 50: -YY_RULE_SETUP -#line 190 "pxr/usd/sdf/textFileFormat.ll" -{ - std::string matched = std::string(yytext, yyleng); - - // we perform an extra validation step here - // to make sure what we matched is actually a valid - // identifier because we can overmatch UTF-8 characters - // based on this definition - if (!SdfSchema::IsValidIdentifier(matched)) { - return TOK_SYNTAX_ERROR; - } - - (*yylval_param) = matched; - return TOK_IDENTIFIER; -} - YY_BREAK -/* unquoted namespaced identifiers match any number of colon - * delimited identifiers - */ -case 51: -YY_RULE_SETUP -#line 208 "pxr/usd/sdf/textFileFormat.ll" -{ - std::string matched = std::string(yytext, yyleng); - - // like for regular identifiers, we do a validation - // check here to prevent overmatching UTF-8 characters - if (!SdfSchema::IsValidNamespacedIdentifier(matched)) { - return TOK_SYNTAX_ERROR; - } - - (*yylval_param) = matched; - return TOK_NAMESPACED_IDENTIFIER; -} - YY_BREAK -/* scene paths */ -case 52: -YY_RULE_SETUP -#line 222 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); - return TOK_PATHREF; - } - YY_BREAK -/* Single '@'-delimited asset references */ -case 53: -YY_RULE_SETUP -#line 228 "pxr/usd/sdf/textFileFormat.ll" -{ - TfErrorMark m; - (*yylval_param) = - Sdf_EvalAssetPath(yytext, yyleng, /* tripleDelimited = */ false); - return m.IsClean() ? TOK_ASSETREF : TOK_SYNTAX_ERROR; - } - YY_BREAK -/* Triple '@'-delimited asset references. */ -case 54: -YY_RULE_SETUP -#line 236 "pxr/usd/sdf/textFileFormat.ll" -{ - TfErrorMark m; - (*yylval_param) = - Sdf_EvalAssetPath(yytext, yyleng, /* tripleDelimited = */ true); - return m.IsClean() ? TOK_ASSETREF : TOK_SYNTAX_ERROR; - } - YY_BREAK -/* Singly quoted, single line strings with escapes. - Note: we handle empty singly quoted strings below, to disambiguate - them from the beginning of triply-quoted strings. - Ex: "Foo \"foo\"" */ -case 55: -#line 248 "pxr/usd/sdf/textFileFormat.ll" -case 56: -YY_RULE_SETUP -#line 248 "pxr/usd/sdf/textFileFormat.ll" -{ /* " //<- unfreak out coloring code */ - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); - return TOK_STRING; - } - YY_BREAK -/* Empty singly quoted strings that aren't the beginning of - a triply-quoted string. */ -case 57: -/* rule 57 can match eol */ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -YY_LINENO_REWIND_TO(yy_bp + 2); -yyg->yy_c_buf_p = yy_cp = yy_bp + 2; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 255 "pxr/usd/sdf/textFileFormat.ll" -{ /* ' // <- keep syntax coloring from freaking out */ - (*yylval_param) = std::string(); - return TOK_STRING; - } - YY_BREAK -case 58: -/* rule 58 can match eol */ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -YY_LINENO_REWIND_TO(yy_bp + 2); -yyg->yy_c_buf_p = yy_cp = yy_bp + 2; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 259 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = std::string(); - return TOK_STRING; - } - YY_BREAK -/* Triply quoted, multi-line strings with escapes. - Ex: """A\n\"B\"\nC""" */ -case 59: -/* rule 59 can match eol */ -#line 267 "pxr/usd/sdf/textFileFormat.ll" -case 60: -/* rule 60 can match eol */ -YY_RULE_SETUP -#line 267 "pxr/usd/sdf/textFileFormat.ll" -{ /* " //<- unfreak out coloring code */ - - unsigned int numlines = 0; - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 3, &numlines); - yyextra->sdfLineNo += numlines; - return TOK_STRING; - } - YY_BREAK -/* Super special case for negative 0. We have to store this as a double to - * preserve the sign. There is no negative zero integral value, and we - * don't know at this point what the final stored type will be. */ -case 61: -YY_RULE_SETUP -#line 278 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = double(-0.0); - return TOK_NUMBER; - } - YY_BREAK -/* Positive integers: store as uint64_t if in range, otherwise double. */ -case 62: -YY_RULE_SETUP -#line 284 "pxr/usd/sdf/textFileFormat.ll" -{ - bool outOfRange = false; - (*yylval_param) = TfStringToUInt64(yytext, &outOfRange); - if (outOfRange) { - TF_WARN("Integer literal '%s' on line %d%s%s out of range, parsing " - "as double. Consider exponential notation for large " - "floating point values.", yytext, yyextra->sdfLineNo, - yyextra->fileContext.empty() ? "" : " in file ", - yyextra->fileContext.empty() ? "" : - yyextra->fileContext.c_str()); - (*yylval_param) = TfStringToDouble(yytext); - } - return TOK_NUMBER; - } - YY_BREAK -/* Negative integers: store as long. */ -case 63: -YY_RULE_SETUP -#line 300 "pxr/usd/sdf/textFileFormat.ll" -{ - bool outOfRange = false; - (*yylval_param) = TfStringToInt64(yytext, &outOfRange); - if (outOfRange) { - TF_WARN("Integer literal '%s' on line %d%s%s out of range, parsing " - "as double. Consider exponential notation for large " - "floating point values.", yytext, yyextra->sdfLineNo, - yyextra->fileContext.empty() ? "" : " in file ", - yyextra->fileContext.empty() ? "" : - yyextra->fileContext.c_str()); - (*yylval_param) = TfStringToDouble(yytext); - } - return TOK_NUMBER; - } - YY_BREAK -/* Numbers with decimal places or exponents: store as double. */ -case 64: -#line 317 "pxr/usd/sdf/textFileFormat.ll" -case 65: -YY_RULE_SETUP -#line 317 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = TfStringToDouble(yytext); - return TOK_NUMBER; - } - YY_BREAK -/* regexps for negative infinity. we don't handle inf and nan here - * because they look like identifiers. we handle them in parser where - * we have the additional context we need to distinguish them from - * identifiers. */ -case 66: -YY_RULE_SETUP -#line 326 "pxr/usd/sdf/textFileFormat.ll" -{ - (*yylval_param) = -std::numeric_limits::infinity(); - return TOK_NUMBER; - } - YY_BREAK -/* various single-character punctuation. return the character - * itself as the token. - */ -case 67: -YY_RULE_SETUP -#line 334 "pxr/usd/sdf/textFileFormat.ll" -{ - return yytext[0]; - } - YY_BREAK -/* the default rule is to ECHO any unmatched character. by returning a - * token that the parser does not know how to handle these become syntax - * errors instead. - */ -case 68: -YY_RULE_SETUP -#line 342 "pxr/usd/sdf/textFileFormat.ll" -{ - return TOK_SYNTAX_ERROR; - } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 346 "pxr/usd/sdf/textFileFormat.ll" -ECHO; - YY_BREAK -#line 5670 "pxr/usd/sdf/textFileFormat.lex.cpp" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(SLASHTERIX_COMMENT): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * textFileFormatYylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yyg->yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( textFileFormatYywrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of textFileFormatYylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = yyg->yytext_ptr; - int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - textFileFormatYyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - textFileFormatYyrestart(yyin ,yyscanner); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) textFileFormatYyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -{ - yy_state_type yy_current_state; - char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { - yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -{ - int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - char *yy_cp = yyg->yy_c_buf_p; - - yy_current_state = yy_nxt[yy_current_state][1]; - yy_is_jam = (yy_current_state <= 0); - - if ( ! yy_is_jam ) - { - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - } - - (void)yyg; - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) -#else - static int input (yyscan_t yyscanner) -#endif - -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else - { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - textFileFormatYyrestart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( textFileFormatYywrap(yyscanner ) ) - return EOF; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ - void textFileFormatYyrestart (FILE * input_file , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ){ - textFileFormatYyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - textFileFormatYy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - textFileFormatYy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - textFileFormatYy_load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ - void textFileFormatYy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * textFileFormatYypop_buffer_state(); - * textFileFormatYypush_buffer_state(new_buffer); - */ - textFileFormatYyensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - textFileFormatYy_load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (textFileFormatYywrap()) processing, but the only time this flag - * is looked at is after textFileFormatYywrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -static void textFileFormatYy_load_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ - YY_BUFFER_STATE textFileFormatYy_create_buffer (FILE * file, int size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) textFileFormatYyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) textFileFormatYyalloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - textFileFormatYy_init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with textFileFormatYy_create_buffer() - * @param yyscanner The scanner object. - */ - void textFileFormatYy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - textFileFormatYyfree((void *) b->yy_ch_buf ,yyscanner ); - - textFileFormatYyfree((void *) b ,yyscanner ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a textFileFormatYyrestart() or at EOF. - */ - static void textFileFormatYy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - textFileFormatYy_flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then textFileFormatYy_init_buffer was _probably_ - * called from textFileFormatYyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ - void textFileFormatYy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - textFileFormatYy_load_buffer_state(yyscanner ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -void textFileFormatYypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - textFileFormatYyensure_buffer_stack(yyscanner); - - /* This block is copied from textFileFormatYy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from textFileFormatYy_switch_to_buffer. */ - textFileFormatYy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -void textFileFormatYypop_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - textFileFormatYy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - textFileFormatYy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void textFileFormatYyensure_buffer_stack (yyscan_t yyscanner) -{ - yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)textFileFormatYyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYyensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)textFileFormatYyrealloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE textFileFormatYy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) textFileFormatYyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - textFileFormatYy_switch_to_buffer(b ,yyscanner ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to textFileFormatYylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * textFileFormatYy_scan_bytes() instead. - */ -YY_BUFFER_STATE textFileFormatYy_scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - - return textFileFormatYy_scan_bytes(yystr,strlen(yystr) ,yyscanner); -} - -/** Setup the input buffer state to scan the given bytes. The next call to textFileFormatYylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE textFileFormatYy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) textFileFormatYyalloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in textFileFormatYy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = textFileFormatYy_scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in textFileFormatYy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE textFileFormatYyget_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int textFileFormatYyget_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int textFileFormatYyget_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *textFileFormatYyget_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *textFileFormatYyget_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -yy_size_t textFileFormatYyget_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *textFileFormatYyget_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void textFileFormatYyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void textFileFormatYyset_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "textFileFormatYyset_lineno called with no buffer" ); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void textFileFormatYyset_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "textFileFormatYyset_column called with no buffer" ); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see textFileFormatYy_switch_to_buffer - */ -void textFileFormatYyset_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void textFileFormatYyset_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int textFileFormatYyget_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void textFileFormatYyset_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* Accessor methods for yylval and yylloc */ - -YYSTYPE * textFileFormatYyget_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void textFileFormatYyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -/* User-visible API */ - -/* textFileFormatYylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int textFileFormatYylex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) textFileFormatYyalloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* textFileFormatYylex_init_extra has the same functionality as textFileFormatYylex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to textFileFormatYyalloc in - * the yyextra field. - */ - -int textFileFormatYylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - textFileFormatYyset_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) textFileFormatYyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - textFileFormatYyset_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from textFileFormatYylex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * textFileFormatYylex_init() - */ - return 0; -} - -/* textFileFormatYylex_destroy is for both reentrant and non-reentrant scanners. */ -int textFileFormatYylex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - textFileFormatYy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - textFileFormatYypop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - textFileFormatYyfree(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - textFileFormatYyfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * textFileFormatYylex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* Destroy the main struct (reentrant only). */ - textFileFormatYyfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *textFileFormatYyalloc (yy_size_t size , yyscan_t yyscanner) -{ - return (void *) malloc( size ); -} - -void *textFileFormatYyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void textFileFormatYyfree (void * ptr , yyscan_t yyscanner) -{ - free( (char *) ptr ); /* see textFileFormatYyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 346 "pxr/usd/sdf/textFileFormat.ll" - - - diff --git a/pxr/usd/sdf/textFileFormat.ll b/pxr/usd/sdf/textFileFormat.ll deleted file mode 100644 index fa032f101b..0000000000 --- a/pxr/usd/sdf/textFileFormat.ll +++ /dev/null @@ -1,346 +0,0 @@ -%{ -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -#include "pxr/pxr.h" -#include "pxr/base/arch/fileSystem.h" -#include "pxr/base/tf/errorMark.h" -#include "pxr/base/tf/stringUtils.h" -#include "pxr/usd/sdf/textParserContext.h" -#include "pxr/usd/sdf/parserHelpers.h" -#include "pxr/usd/sdf/schema.h" - -// Token table from yacc file -#include "textFileFormat.tab.h" - -#ifndef fileno -#define fileno(fd) ArchFileNo(fd) -#endif -#ifndef isatty -#define isatty(fd) ArchFileIsaTTY(fd) -#endif - -using std::map; -using std::vector; - -PXR_NAMESPACE_USING_DIRECTIVE - -#define YYSTYPE Sdf_ParserHelpers::Value - -// As a pure parser, we must define the following -#define YY_DECL int textFileFormatYylex(YYSTYPE *yylval_param, yyscan_t yyscanner) - -// The context object will be used to store global state for the parser. -#define YY_EXTRA_TYPE Sdf_TextParserContext * - -%} - -/* Configuration options for flex */ -%option noyywrap -%option nounput -%option reentrant -%option bison-bridge - -/* character classes - * defines UTF-8 encoded byte values for standard ASCII - * and multi-byte UTF-8 character sets - * valid multi-byte UTF-8 sequences are as follows: - * For an n-byte encoded UTF-8 character, the last n-1 bytes range [\x80-\xbf] - * 2-byte UTF-8 characters, first byte in range [\xc2-\xdf] - * 3-byte UTF-8 characters, first byte in range [\xe0-\xef] - * 4-byte UTF-8 characters, first byte in range [\xf0-\xf4] - * ASCII characters span [\x41-\x5a] (upper case) [\x61-\x7a] (lower case) [\x30-39] (digits) - */ -ALPHA1 [\x41-\x5a] -ALPHA2 [\x61-\x7a] -DIGIT [\x30-\x39] -UEND [\x80-\xbf] -U2PRE [\xc2-\xdf] -U3PRE [\xe0-\xef] -U4PRE [\xf0-\xf4] -UNDER [_] -DASH [\-] -BAR [\|] -ALPHA {ALPHA1}|{ALPHA2} -ALPHANUM {ALPHA}|{DIGIT} -UTF8X {U2PRE}{UEND}|{U3PRE}{UEND}{UEND}|{U4PRE}{UEND}{UEND}{UEND} -UTF8 {ALPHANUM}|{UTF8X} -UTF8NODIG {ALPHA}|{UTF8X} -UTF8U {UTF8}|{UNDER} -UTF8NODIGU {UTF8NODIG}|{UNDER} -UTF8UD {UTF8U}|{DASH} -UTF8UDB {UTF8UD}|{BAR} - -/* States */ -%x SLASHTERIX_COMMENT - -%% - - /* skip over whitespace and comments */ - /* handle the first line # comment specially, since it contains the - magic token */ -[[:blank:]]+ {} -"#"[^\r\n]* { - if (yyextra->sdfLineNo == 1) { - (*yylval_param) = std::string(yytext, yyleng); - return TOK_MAGIC; - } - } -"//"[^\r\n]* {} -"/*" BEGIN SLASHTERIX_COMMENT ; -.|\n|\r ; -"*/" BEGIN INITIAL ; - - /* newline is returned as TOK_NL - * Note that newlines embedded in quoted strings and tuples are counted - * as part of the token and do NOT emit a separate TOK_NL. - */ -((\r\n)|\r|\n) { - yyextra->sdfLineNo++; - return TOK_NL; - } - - /* literal keywords. we return the yytext so that the yacc grammar - can make use of it. */ -"add" { (*yylval_param) = std::string(yytext, yyleng); return TOK_ADD; } -"append" { (*yylval_param) = std::string(yytext, yyleng); return TOK_APPEND; } -"class" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CLASS; } -"config" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CONFIG; } -"connect" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CONNECT; } -"custom" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOM; } -"customData" { (*yylval_param) = std::string(yytext, yyleng); return TOK_CUSTOMDATA; } -"default" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DEFAULT; } -"def" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DEF; } -"delete" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DELETE; } -"dictionary" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DICTIONARY; } -"displayUnit" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DISPLAYUNIT; } -"doc" { (*yylval_param) = std::string(yytext, yyleng); return TOK_DOC; } -"inherits" { (*yylval_param) = std::string(yytext, yyleng); return TOK_INHERITS; } -"kind" { (*yylval_param) = std::string(yytext, yyleng); return TOK_KIND; } -"nameChildren" { (*yylval_param) = std::string(yytext, yyleng); return TOK_NAMECHILDREN; } -"None" { (*yylval_param) = std::string(yytext, yyleng); return TOK_NONE; } -"offset" { (*yylval_param) = std::string(yytext, yyleng); return TOK_OFFSET; } -"over" { (*yylval_param) = std::string(yytext, yyleng); return TOK_OVER; } -"payload" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PAYLOAD; } -"permission" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PERMISSION; } -"prefixSubstitutions" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PREFIX_SUBSTITUTIONS; } -"prepend" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PREPEND; } -"properties" { (*yylval_param) = std::string(yytext, yyleng); return TOK_PROPERTIES; } -"references" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REFERENCES; } -"relocates" { (*yylval_param) = std::string(yytext, yyleng); return TOK_RELOCATES; } -"rel" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REL; } -"reorder" { (*yylval_param) = std::string(yytext, yyleng); return TOK_REORDER; } -"rootPrims" { (*yylval_param) = std::string(yytext, yyleng); return TOK_ROOTPRIMS; } -"scale" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SCALE; } -"subLayers" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SUBLAYERS; } -"suffixSubstitutions" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SUFFIX_SUBSTITUTIONS; } -"specializes" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SPECIALIZES; } -"symmetryArguments" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYARGUMENTS; } -"symmetryFunction" { (*yylval_param) = std::string(yytext, yyleng); return TOK_SYMMETRYFUNCTION; } -"timeSamples" { (*yylval_param) = std::string(yytext, yyleng); return TOK_TIME_SAMPLES; } -"uniform" { (*yylval_param) = std::string(yytext, yyleng); return TOK_UNIFORM; } -"variantSet" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSET; } -"variantSets" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTSETS; } -"variants" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARIANTS; } -"varying" { (*yylval_param) = std::string(yytext, yyleng); return TOK_VARYING; } - - /* unquoted C++ namespaced identifier -- see bug 10775 */ -[[:alpha:]_][[:alnum:]_]*(::[[:alpha:]_][[:alnum:]_]*)+ { - (*yylval_param) = std::string(yytext, yyleng); - return TOK_CXX_NAMESPACED_IDENTIFIER; - } - - /* In a Unicode enabled scheme, 'identifiers' are generally - * categorized as something that begins with something in the - * XID_Start category followed by zero or more things in the - * XID_Continue category. Since the number of characters in - * these classes are large, we can't explicitly validate them - * here easily, so the lex rule is pretty permissive with some - * further validation done in code prior to calling what was - * read an 'identifier'. Note this rule will also match - * standard ASCII strings because the UTF-8 encoded byte - * representation is the same for these characters. - * However, unlike the path lexer, we can guarantee that - * prim names aren't something special to be called out here - * so we can be a little more specific about the kinds of strings - * we match, particularly to not collide with the pure digit match rule - * below - */ -{UTF8NODIGU}{UTF8U}* { - std::string matched = std::string(yytext, yyleng); - - // we perform an extra validation step here - // to make sure what we matched is actually a valid - // identifier because we can overmatch UTF-8 characters - // based on this definition - if (!SdfSchema::IsValidIdentifier(matched)) { - return TOK_SYNTAX_ERROR; - } - - (*yylval_param) = matched; - return TOK_IDENTIFIER; -} - - /* unquoted namespaced identifiers match any number of colon - * delimited identifiers - */ -{UTF8NODIGU}{UTF8U}*(:{UTF8NODIGU}{UTF8U}*)+ { - std::string matched = std::string(yytext, yyleng); - - // like for regular identifiers, we do a validation - // check here to prevent overmatching UTF-8 characters - if (!SdfSchema::IsValidNamespacedIdentifier(matched)) { - return TOK_SYNTAX_ERROR; - } - - (*yylval_param) = matched; - return TOK_NAMESPACED_IDENTIFIER; -} - - /* scene paths */ -\<[^\<\>\r\n]*\> { - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); - return TOK_PATHREF; - } - - /* Single '@'-delimited asset references */ -@[^@\n]*@ { - TfErrorMark m; - (*yylval_param) = - Sdf_EvalAssetPath(yytext, yyleng, /* tripleDelimited = */ false); - return m.IsClean() ? TOK_ASSETREF : TOK_SYNTAX_ERROR; - } - - /* Triple '@'-delimited asset references. */ -@@@([^@\n]|@{1,2}[^@\n]|\\@@@)*@{0,2}@@@ { - TfErrorMark m; - (*yylval_param) = - Sdf_EvalAssetPath(yytext, yyleng, /* tripleDelimited = */ true); - return m.IsClean() ? TOK_ASSETREF : TOK_SYNTAX_ERROR; - } - - /* Singly quoted, single line strings with escapes. - Note: we handle empty singly quoted strings below, to disambiguate - them from the beginning of triply-quoted strings. - Ex: "Foo \"foo\"" */ -'([^'\\\r\n]|(\\.))+' | /* ' //<- unfreak out coloring code */ -\"([^"\\\r\n]|(\\.))+\" { /* " //<- unfreak out coloring code */ - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 1); - return TOK_STRING; - } - - /* Empty singly quoted strings that aren't the beginning of - a triply-quoted string. */ -''/[^'] { /* ' // <- keep syntax coloring from freaking out */ - (*yylval_param) = std::string(); - return TOK_STRING; - } -\"\"/[^"] { - (*yylval_param) = std::string(); - return TOK_STRING; - } - - /* Triply quoted, multi-line strings with escapes. - Ex: """A\n\"B\"\nC""" */ -'''([^'\\]|(\\.)|(\\[\r\n])|('{1,2}[^']))*''' | /* ' //<- unfreak out coloring code */ -\"\"\"([^"\\]|(\\.)|(\\[\r\n])|(\"{1,2}[^"]))*\"\"\" { /* " //<- unfreak out coloring code */ - - unsigned int numlines = 0; - (*yylval_param) = Sdf_EvalQuotedString(yytext, yyleng, 3, &numlines); - yyextra->sdfLineNo += numlines; - return TOK_STRING; - } - - /* Super special case for negative 0. We have to store this as a double to - * preserve the sign. There is no negative zero integral value, and we - * don't know at this point what the final stored type will be. */ --0 { - (*yylval_param) = double(-0.0); - return TOK_NUMBER; - } - - /* Positive integers: store as uint64_t if in range, otherwise double. */ -[[:digit:]]+ { - bool outOfRange = false; - (*yylval_param) = TfStringToUInt64(yytext, &outOfRange); - if (outOfRange) { - TF_WARN("Integer literal '%s' on line %d%s%s out of range, parsing " - "as double. Consider exponential notation for large " - "floating point values.", yytext, yyextra->sdfLineNo, - yyextra->fileContext.empty() ? "" : " in file ", - yyextra->fileContext.empty() ? "" : - yyextra->fileContext.c_str()); - (*yylval_param) = TfStringToDouble(yytext); - } - return TOK_NUMBER; - } - - /* Negative integers: store as long. */ --[[:digit:]]+ { - bool outOfRange = false; - (*yylval_param) = TfStringToInt64(yytext, &outOfRange); - if (outOfRange) { - TF_WARN("Integer literal '%s' on line %d%s%s out of range, parsing " - "as double. Consider exponential notation for large " - "floating point values.", yytext, yyextra->sdfLineNo, - yyextra->fileContext.empty() ? "" : " in file ", - yyextra->fileContext.empty() ? "" : - yyextra->fileContext.c_str()); - (*yylval_param) = TfStringToDouble(yytext); - } - return TOK_NUMBER; - } - - /* Numbers with decimal places or exponents: store as double. */ --?[[:digit:]]+(\.[[:digit:]]*)?([eE][+\-]?[[:digit:]]+)? | --?\.[[:digit:]]+([eE][+\-]?[[:digit:]]+)? { - (*yylval_param) = TfStringToDouble(yytext); - return TOK_NUMBER; - } - - /* regexps for negative infinity. we don't handle inf and nan here - * because they look like identifiers. we handle them in parser where - * we have the additional context we need to distinguish them from - * identifiers. */ --inf { - (*yylval_param) = -std::numeric_limits::infinity(); - return TOK_NUMBER; - } - - /* various single-character punctuation. return the character - * itself as the token. - */ -[=,:;\$\.\[\]\(\){}&@-] { - return yytext[0]; - } - - /* the default rule is to ECHO any unmatched character. by returning a - * token that the parser does not know how to handle these become syntax - * errors instead. - */ -<*>.|\\n { - return TOK_SYNTAX_ERROR; - } - -%% diff --git a/pxr/usd/sdf/textFileFormat.tab.cpp b/pxr/usd/sdf/textFileFormat.tab.cpp deleted file mode 100644 index 2949ac1198..0000000000 --- a/pxr/usd/sdf/textFileFormat.tab.cpp +++ /dev/null @@ -1,6620 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse textFileFormatYyparse -#define yylex textFileFormatYylex -#define yyerror textFileFormatYyerror -#define yylval textFileFormatYylval -#define yychar textFileFormatYychar -#define yydebug textFileFormatYydebug -#define yynerrs textFileFormatYynerrs - - -/* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 25 "pxr/usd/sdf/textFileFormat.yy" - - -#include "pxr/pxr.h" -#include "pxr/base/arch/errno.h" -#include "pxr/base/arch/fileSystem.h" -#include "pxr/base/vt/array.h" -#include "pxr/base/vt/dictionary.h" -#include "pxr/usd/ar/asset.h" -#include "pxr/usd/sdf/allowed.h" -#include "pxr/usd/sdf/data.h" -#include "pxr/usd/sdf/fileIO_Common.h" -#include "pxr/usd/sdf/layerOffset.h" -#include "pxr/usd/sdf/listOp.h" -#include "pxr/usd/sdf/textParserContext.h" -#include "pxr/usd/sdf/parserValueContext.h" -#include "pxr/usd/sdf/payload.h" -#include "pxr/usd/sdf/reference.h" -#include "pxr/usd/sdf/schema.h" -#include "pxr/usd/sdf/types.h" - -#include "pxr/base/trace/trace.h" - -#include "pxr/base/arch/errno.h" -#include "pxr/base/tf/enum.h" -#include "pxr/base/tf/iterator.h" -#include "pxr/base/tf/ostreamMethods.h" -#include "pxr/base/tf/stringUtils.h" -#include "pxr/base/tf/type.h" -#include "pxr/base/gf/matrix4d.h" -#include "pxr/base/tf/mallocTag.h" - -#include -#include -#include -#include - -// See this page for info as to why this is here. Especially note the last -// paragraph. http://www.delorie.com/gnu/docs/bison/bison_91.html -#define YYINITDEPTH 1500 - -PXR_NAMESPACE_USING_DIRECTIVE - -using Sdf_ParserHelpers::Value; - -//-------------------------------------------------------------------- -// Helper macros/functions for handling errors -//-------------------------------------------------------------------- - -#define ABORT_IF_ERROR(seenError) if (seenError) YYABORT -#define Err(context, ...) \ - textFileFormatYyerror(context, TfStringPrintf(__VA_ARGS__).c_str()) - -#define ERROR_IF_NOT_ALLOWED(context, allowed) \ - { \ - const SdfAllowed allow = allowed; \ - if (!allow) { \ - Err(context, "%s", allow.GetWhyNot().c_str()); \ - } \ - } - -#define ERROR_AND_RETURN_IF_NOT_ALLOWED(context, allowed) \ - { \ - const SdfAllowed allow = allowed; \ - if (!allow) { \ - Err(context, "%s", allow.GetWhyNot().c_str()); \ - return; \ - } \ - } - -//-------------------------------------------------------------------- -// Extern declarations to scanner data and functions -//-------------------------------------------------------------------- - -#define YYSTYPE Sdf_ParserHelpers::Value - -// Opaque buffer type handle. -struct yy_buffer_state; - -// Generated bison symbols. -void textFileFormatYyerror(Sdf_TextParserContext *context, const char *s); - -extern int textFileFormatYylex(YYSTYPE *yylval_param, yyscan_t yyscanner); -extern char *textFileFormatYyget_text(yyscan_t yyscanner); -extern size_t textFileFormatYyget_leng(yyscan_t yyscanner); -extern int textFileFormatYylex_init(yyscan_t *yyscanner); -extern int textFileFormatYylex_destroy(yyscan_t yyscanner); -extern void textFileFormatYyset_extra(Sdf_TextParserContext *context, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_buffer(char *yy_str, size_t size, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_string(const char *yy_str, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_bytes(const char *yy_str, size_t numBytes, - yyscan_t yyscanner); -extern void textFileFormatYy_delete_buffer(yy_buffer_state *b, yyscan_t yyscanner); - -#define yyscanner context->scanner - -//-------------------------------------------------------------------- -// Helpers -//-------------------------------------------------------------------- - -static bool -_SetupValue(const std::string& typeName, Sdf_TextParserContext *context) -{ - return context->values.SetupFactory(typeName); -} - -template -static bool -_GeneralHasDuplicates(const std::vector &v) -{ - // Copy and sort to look for dupes. - std::vector copy(v); - std::sort(copy.begin(), copy.end()); - return std::adjacent_find(copy.begin(), copy.end()) != copy.end(); -} - -template -static inline bool -_HasDuplicates(const std::vector &v) -{ - // Many of the vectors we see here are either just a few elements long - // (references, payloads) or are already sorted and unique (topology - // indexes, etc). - if (v.size() <= 1) { - return false; - } - - // Many are of small size, just check all pairs. - if (v.size() <= 10) { - using iter = typename std::vector::const_iterator; - iter iend = std::prev(v.end()), jend = v.end(); - for (iter i = v.begin(); i != iend; ++i) { - for (iter j = std::next(i); j != jend; ++j) { - if (*i == *j) { - return true; - } - } - } - return false; - } - - // Check for strictly sorted order. - if (std::adjacent_find(v.begin(), v.end(), - [](T const &l, T const &r) { - return l >= r; - }) == v.end()) { - return false; - } - // Otherwise do a more expensive copy & sort to check for dupes. - return _GeneralHasDuplicates(v); -} - -namespace -{ -template -const std::vector& _ToItemVector(const std::vector& v) -{ - return v; -} -template -std::vector _ToItemVector(const VtArray& v) -{ - return std::vector(v.begin(), v.end()); -} -} - -// Set a single ListOp vector in the list op for the current -// path and specified key. -template -static void -_SetListOpItems(const TfToken &key, SdfListOpType type, - const T &itemList, Sdf_TextParserContext *context) -{ - typedef SdfListOp ListOpType; - typedef typename ListOpType::ItemVector ItemVector; - - const ItemVector& items = _ToItemVector(itemList); - - if (_HasDuplicates(items)) { - Err(context, "Duplicate items exist for field '%s' at '%s'", - key.GetText(), context->path.GetText()); - } - - ListOpType op = context->data->GetAs(context->path, key); - op.SetItems(items, type); - - context->data->Set(context->path, key, VtValue::Take(op)); -} - -// Append a single item to the vector for the current path and specified key. -template -static void -_AppendVectorItem(const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - std::vector vec = - context->data->GetAs >(context->path, key); - vec.push_back(item); - - context->data->Set(context->path, key, VtValue(vec)); -} - -inline static void -_SetDefault(const SdfPath& path, VtValue val, - Sdf_TextParserContext *context) -{ - // If is holding SdfPathExpression (or array of same), make absolute with - // path.GetPrimPath() as anchor. - if (val.IsHolding()) { - val.UncheckedMutate([&](SdfPathExpression &pe) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - }); - } - else if (val.IsHolding>()) { - val.UncheckedMutate>( - [&](VtArray &peArr) { - for (SdfPathExpression &pe: peArr) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - } - }); - } - /* - else if (val.IsHolding()) { - SdfPath valPath; - val.UncheckedSwap(valPath); - expr.MakeAbsolutePath(path.GetPrimPath()); - val.UncheckedSwap(valPath); - } - */ - context->data->Set(path, SdfFieldKeys->Default, val); -} - -template -inline static void -_SetField(const SdfPath& path, const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - context->data->Set(path, key, VtValue(item)); -} - -inline static bool -_HasField(const SdfPath& path, const TfToken& key, VtValue* value, - Sdf_TextParserContext *context) -{ - return context->data->Has(path, key, value); -} - -inline static bool -_HasSpec(const SdfPath& path, Sdf_TextParserContext *context) -{ - return context->data->HasSpec(path); -} - -inline static void -_CreateSpec(const SdfPath& path, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->data->CreateSpec(path, specType); -} - -static void -_MatchMagicIdentifier(const Value& arg1, Sdf_TextParserContext *context) -{ - const std::string cookie = TfStringTrimRight(arg1.Get()); - const std::string expected = "#" + context->magicIdentifierToken + " "; - if (TfStringStartsWith(cookie, expected)) { - if (!context->versionString.empty() && - !TfStringEndsWith(cookie, context->versionString)) { - TF_WARN("File '%s' is not the latest %s version (found '%s', " - "expected '%s'). The file may parse correctly and yield " - "incorrect results.", - context->fileContext.c_str(), - context->magicIdentifierToken.c_str(), - cookie.substr(expected.length()).c_str(), - context->versionString.c_str()); - } - } - else { - Err(context, "Magic Cookie '%s'. Expected prefix of '%s'", - TfStringTrim(cookie).c_str(), - expected.c_str()); - } -} - -static SdfPermission -_GetPermissionFromString(const std::string & str, - Sdf_TextParserContext *context) -{ - if (str == "public") { - return SdfPermissionPublic; - } else if (str == "private") { - return SdfPermissionPrivate; - } else { - Err(context, "'%s' is not a valid permission constant", str.c_str()); - return SdfPermissionPublic; - } -} - -static TfEnum -_GetDisplayUnitFromString(const std::string & name, - Sdf_TextParserContext *context) -{ - const TfEnum &unit = SdfGetUnitFromName(name); - if (unit == TfEnum()) { - Err(context, "'%s' is not a valid display unit", name.c_str()); - } - return unit; -} - -static void -_ValueAppendAtomic(const Value& arg1, Sdf_TextParserContext *context) -{ - context->values.AppendValue(arg1); -} - -static void -_ValueSetAtomic(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - Err(context, "Type name has [] for non-shaped value!\n"); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue.IsEmpty()) { - Err(context, "Error parsing simple value: %s", errStr.c_str()); - return; - } -} - -static void -_PrimSetInheritListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->inheritParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting inherit paths to None (or empty list) is only allowed " - "when setting explicit inherit paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->inheritParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidInheritPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->InheritPaths, opType, - context->inheritParsingTargetPaths, context); -} - -static void -_InheritAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Inherit paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->inheritParsingTargetPaths.push_back(absPath); -} - -static void -_PrimSetSpecializesListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->specializesParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting specializes paths to None (or empty list) is only allowed " - "when setting explicit specializes paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->specializesParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidSpecializesPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->Specializes, opType, - context->specializesParsingTargetPaths, context); -} - -static void -_SpecializesAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Specializes paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->specializesParsingTargetPaths.push_back(absPath); -} - -static void -_PrimSetReferenceListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->referenceParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting references to None (or an empty list) is only allowed " - "when setting explicit references, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->referenceParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidReference(*ref)); - } - - _SetListOpItems(SdfFieldKeys->References, opType, - context->referenceParsingRefs, context); -} - -static void -_PrimSetPayloadListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->payloadParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting payload to None (or an empty list) is only allowed " - "when setting explicit payloads, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->payloadParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidPayload(*ref)); - } - - _SetListOpItems(SdfFieldKeys->Payload, opType, - context->payloadParsingRefs, context); -} - -static void -_PrimSetVariantSetNamesListItems(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - std::vector names; - names.reserve(context->nameVector.size()); - TF_FOR_ALL(name, context->nameVector) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantIdentifier(*name)); - names.push_back(name->GetText()); - } - - _SetListOpItems(SdfFieldKeys->VariantSetNames, opType, names, context); - - // If the op type is added or explicit, create the variant sets - if (opType == SdfListOpTypeAdded || opType == SdfListOpTypeExplicit) { - TF_FOR_ALL(i, context->nameVector) { - _CreateSpec( - context->path.AppendVariantSelection(*i,""), - SdfSpecTypeVariantSet, context); - } - - _SetField( - context->path, SdfChildrenKeys->VariantSetChildren, - context->nameVector, context); - } - -} - -static void -_RelationshipInitTarget(const SdfPath& targetPath, - Sdf_TextParserContext *context) -{ - SdfPath path = context->path.AppendTarget(targetPath); - - if (!_HasSpec(path, context)) { - // Create relationship target spec by setting the appropriate - // object type flag. - _CreateSpec(path, SdfSpecTypeRelationshipTarget, context); - - // Add the target path to the owning relationship's list of target - // children. - context->relParsingNewTargetChildren.push_back(targetPath); - } -} - -static void -_RelationshipSetTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (!context->relParsingTargetPaths) { - // No target paths were encountered. - return; - } - - if (context->relParsingTargetPaths->empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting relationship targets to None (or empty list) is only " - "allowed when setting explicit targets, not for list editing"); - return; - } - - TF_FOR_ALL(path, *context->relParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidRelationshipTargetPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - // Initialize relationship target specs for each target path that - // is added in this layer. - TF_FOR_ALL(pathIter, *context->relParsingTargetPaths) { - _RelationshipInitTarget(*pathIter, context); - } - } - - _SetListOpItems(SdfFieldKeys->TargetPaths, opType, - *context->relParsingTargetPaths, context); -} - -static void -_PrimSetVariantSelection(Sdf_TextParserContext *context) -{ - SdfVariantSelectionMap refVars; - - // The previous parser implementation allowed multiple variant selection - // dictionaries in prim metadata to be merged, so we do the same here. - VtValue oldVars; - if (_HasField( - context->path, SdfFieldKeys->VariantSelection, &oldVars, context)) { - refVars = oldVars.Get(); - } - - TF_FOR_ALL(it, context->currentDictionaries[0]) { - if (!it->second.IsHolding()) { - Err(context, "variant name must be a string"); - return; - } else { - const std::string variantName = it->second.Get(); - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantSelection(variantName)); - - refVars[it->first] = variantName; - } - } - - _SetField(context->path, SdfFieldKeys->VariantSelection, refVars, context); - context->currentDictionaries[0].clear(); -} - -static void -_RelocatesAdd(const Value& arg1, const Value& arg2, - Sdf_TextParserContext *context) -{ - const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { - Err(context, "'%s' is not a valid relocates path", - srcStr.c_str()); - return; - } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - Err(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. - srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); - - context->layerHints.mightHaveRelocates = true; -} - -static void -_AttributeSetConnectionTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (context->connParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, "Setting connection paths to None (or an empty list) " - "is only allowed when setting explicit connection paths, " - "not for list editing"); - return; - } - - TF_FOR_ALL(path, context->connParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidAttributeConnectionPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - TF_FOR_ALL(pathIter, context->connParsingTargetPaths) { - SdfPath path = context->path.AppendTarget(*pathIter); - if (!_HasSpec(path, context)) { - _CreateSpec(path, SdfSpecTypeConnection, context); - } - } - - _SetField( - context->path, SdfChildrenKeys->ConnectionChildren, - context->connParsingTargetPaths, context); - } - - _SetListOpItems(SdfFieldKeys->ConnectionPaths, opType, - context->connParsingTargetPaths, context); -} - -static void -_AttributeAppendConnectionPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Connection paths never point into the variant namespace. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - // XXX Workaround for bug 68132: - // Prior to the fix to bug 67916, FilterGenVariantBase was authoring - // invalid connection paths containing variant selections (which - // Sd was failing to report as erroneous). As a result, there's - // a fair number of assets out there with these broken forms of - // connection paths. As a migration measure, we discard those - // variant selections here. - if (absPath.ContainsPrimVariantSelection()) { - TF_WARN("Connection path <%s> (in file @%s@, line %i) has a variant " - "selection, but variant selections are not meaningful in " - "connection paths. Stripping the variant selection and " - "using <%s> instead. Resaving the file will fix this issue.", - absPath.GetText(), - context->fileContext.c_str(), - context->sdfLineNo, - absPath.StripAllVariantSelections().GetText()); - absPath = absPath.StripAllVariantSelections(); - } - - context->connParsingTargetPaths.push_back(absPath); -} - -static void -_PrimInitAttribute(const Value &arg1, Sdf_TextParserContext *context) -{ - TfToken name(arg1.Get()); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - Err(context, "'%s' is not a valid attribute name", name.GetText()); - } - - context->path = context->path.AppendProperty(name); - - // If we haven't seen this attribute before, then set the object type - // and add it to the parent's list of properties. Otherwise both have - // already been done, so we don't need to do anything. - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeAttribute, context); - _SetField(context->path, SdfFieldKeys->Custom, false, context); - } - - if(context->custom) - _SetField(context->path, SdfFieldKeys->Custom, true, context); - - // If the type was previously set, check that it matches. Otherwise set it. - const TfToken newType(context->values.valueTypeName); - - VtValue oldTypeValue; - if (_HasField( - context->path, SdfFieldKeys->TypeName, &oldTypeValue, context)) { - const TfToken& oldType = oldTypeValue.Get(); - - if (newType != oldType) { - Err(context, - "attribute '%s' already has type '%s', cannot change to '%s'", - context->path.GetName().c_str(), - oldType.GetText(), - newType.GetText()); - } - } - else { - _SetField(context->path, SdfFieldKeys->TypeName, newType, context); - } - - // If the variability was previously set, check that it matches. Otherwise - // set it. If the 'variability' VtValue is empty, that indicates varying - // variability. - SdfVariability variability = context->variability.IsEmpty() ? - SdfVariabilityVarying : context->variability.Get(); - VtValue oldVariability; - if (_HasField( - context->path, SdfFieldKeys->Variability, &oldVariability, - context)) { - if (variability != oldVariability.Get()) { - Err(context, - "attribute '%s' already has variability '%s', " - "cannot change to '%s'", - context->path.GetName().c_str(), - TfEnum::GetName(oldVariability.Get()).c_str(), - TfEnum::GetName(variability).c_str() ); - } - } else { - _SetField( - context->path, SdfFieldKeys->Variability, variability, context); - } -} - -static void -_DictionaryBegin(Sdf_TextParserContext *context) -{ - context->currentDictionaries.push_back(VtDictionary()); - - // Whenever we parse a value for an unregistered generic metadata field, - // the parser value context records the string representation only, because - // we don't have enough type information to generate a C++ value. However, - // dictionaries are a special case because we have all the type information - // we need to generate C++ values. So, override the previous setting. - if (context->values.IsRecordingString()) { - context->values.StopRecordingString(); - } -} - -static void -_DictionaryEnd(Sdf_TextParserContext *context) -{ - context->currentDictionaries.pop_back(); -} - -static void -_DictionaryInsertValue(const Value& arg1, Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - context->currentDictionaries[n-2][arg1.Get()] = - context->currentValue; -} - -static void -_DictionaryInsertDictionary(const Value& arg1, - Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - // Insert the parsed dictionary into the parent dictionary. - context->currentDictionaries[n-2][arg1.Get()].Swap( - context->currentDictionaries[n-1]); - // Clear out the last dictionary (there can be more dictionaries on the - // same nesting level). - context->currentDictionaries[n-1].clear(); -} - -static void -_DictionaryInitScalarFactory(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& typeName = arg1.Get(); - if (!_SetupValue(typeName, context)) { - Err(context, "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); - } -} - -static void -_DictionaryInitShapedFactory(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string typeName = arg1.Get() + "[]"; - if (!_SetupValue(typeName, context)) { - Err(context, "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); - } -} - -static void -_ValueSetTuple(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - Err(context, "Type name has [] for non-shaped value.\n"); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - Err(context, "Error parsing tuple value: %s", errStr.c_str()); - return; - } -} - -static void -_ValueSetList(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - Err(context, "Type name missing [] for shaped value."); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - Err(context, "Error parsing shaped value: %s", errStr.c_str()); - return; - } -} - -static void -_ValueSetShaped(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - Err(context, "Type name missing [] for shaped value."); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - // The factory method ProduceValue() uses for shaped types - // only returns empty VtArrays, not empty VtValues, so this - // is impossible to hit currently. - // CODE_COVERAGE_OFF - Err(context, "Error parsing shaped value: %s", errStr.c_str()); - // CODE_COVERAGE_OFF_GCOV_BUG - // The following line actually shows as executed (a ridiculous - // number of times) even though the line above shwos as - // not executed - return; - // CODE_COVERAGE_ON_GCOV_BUG - // CODE_COVERAGE_ON - } -} - -static void _ValueSetCurrentToSdfPath(const Value& arg1, - Sdf_TextParserContext *context) -{ - // make current Value an SdfPath of the given argument... - std::string s = arg1.Get(); - // If path is empty, use default c'tor to construct empty path. - // XXX: 08/04/08 Would be nice if SdfPath would allow - // SdfPath("") without throwing a warning. - context->currentValue = s.empty() ? SdfPath() : SdfPath(s); -} - -static void -_PrimInitRelationship(const Value& arg1, - Sdf_TextParserContext *context) -{ - TfToken name( arg1.Get() ); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - Err(context, "'%s' is not a valid relationship name", name.GetText()); - return; - } - - context->path = context->path.AppendProperty(name); - - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeRelationship, context); - } - - _SetField( - context->path, SdfFieldKeys->Variability, - context->variability, context); - - if (context->custom) { - _SetField(context->path, SdfFieldKeys->Custom, context->custom, context); - } - - context->relParsingAllowTargetData = false; - context->relParsingTargetPaths.reset(); - context->relParsingNewTargetChildren.clear(); -} - -static void -_PrimEndRelationship(Sdf_TextParserContext *context) -{ - if (!context->relParsingNewTargetChildren.empty()) { - std::vector children = - context->data->GetAs >( - context->path, SdfChildrenKeys->RelationshipTargetChildren); - - children.insert(children.end(), - context->relParsingNewTargetChildren.begin(), - context->relParsingNewTargetChildren.end()); - - _SetField( - context->path, SdfChildrenKeys->RelationshipTargetChildren, - children, context); - } - - context->path = context->path.GetParentPath(); -} - -static void -_RelationshipAppendTargetPath(const Value& arg1, - Sdf_TextParserContext *context) -{ - // Add a new target to the current relationship - const std::string& pathStr = arg1.Get(); - SdfPath path(pathStr); - - if (!path.IsAbsolutePath()) { - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Target paths never point into the variant namespace. - path = path.MakeAbsolutePath(context->path.GetPrimPath()); - } - - if (!context->relParsingTargetPaths) { - // This is the first target we've seen for this relationship. - // Start tracking them in a vector. - context->relParsingTargetPaths = SdfPathVector(); - } - context->relParsingTargetPaths->push_back(path); -} - -static void -_PathSetPrim(const Value& arg1, Sdf_TextParserContext *context) -{ - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - if (!context->savedPath.IsPrimPath()) { - Err(context, "'%s' is not a valid prim path", pathStr.c_str()); - } -} - -static void -_PathSetPrimOrPropertyScenePath(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - // Valid paths are prim or property paths that do not contain variant - // selections. - SdfPath const &path = context->savedPath; - bool pathValid = (path.IsPrimPath() || path.IsPropertyPath()) && - !path.ContainsPrimVariantSelection(); - if (!pathValid) { - Err(context, "'%s' is not a valid prim or property scene path", - pathStr.c_str()); - } -} - -template -static bool -_SetItemsIfListOp(const TfType& type, Sdf_TextParserContext *context) -{ - if (!type.IsA()) { - return false; - } - - typedef VtArray ArrayType; - - if (!TF_VERIFY(context->currentValue.IsHolding() || - context->currentValue.IsEmpty())) { - return true; - } - - ArrayType vtArray; - if (context->currentValue.IsHolding()) { - vtArray = context->currentValue.UncheckedGet(); - } - - _SetListOpItems( - context->genericMetadataKey, context->listOpType, vtArray, context); - return true; -} - -static void -_SetGenericMetadataListOpItems(const TfType& fieldType, - Sdf_TextParserContext *context) -{ - // Chain together attempts to set list op items using 'or' to bail - // out as soon as we successfully write out the list op we're holding. - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context); -} - -template -static std::pair -_GetListOpAndArrayTfTypes() { - return { - TfType::Find(), - TfType::Find>() - }; -} - -static bool -_IsGenericMetadataListOpType(const TfType& type, - TfType* itemArrayType = nullptr) -{ - static std::pair listOpAndArrayTypes[] = { - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - }; - - auto iter = std::find_if(std::begin(listOpAndArrayTypes), - std::end(listOpAndArrayTypes), - [&type](auto const &p) { - return p.first == type; - }); - - if (iter == std::end(listOpAndArrayTypes)) { - return false; - } - - if (itemArrayType) { - *itemArrayType = iter->second; - } - - return true; -} - -static void -_GenericMetadataStart(const Value &name, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->genericMetadataKey = TfToken(name.Get()); - context->listOpType = SdfListOpTypeExplicit; - - const SdfSchema& schema = SdfSchema::GetInstance(); - const SdfSchema::SpecDefinition &specDef = - *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { - // Prepare to parse a known field - const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); - const TfType fieldType = fieldDef.GetFallbackValue().GetType(); - - // For list op-valued metadata fields, set up the parser as if - // we were parsing an array of the list op's underlying type. - // In _GenericMetadataEnd, we'll produce this list and set it - // into the appropriate place in the list op. - TfType itemArrayType; - if (_IsGenericMetadataListOpType(fieldType, &itemArrayType)) { - _SetupValue(schema.FindType(itemArrayType). - GetAsToken().GetString(), context); - } - else { - _SetupValue(schema.FindType(fieldDef.GetFallbackValue()). - GetAsToken().GetString(), context); - } - } else { - // Prepare to parse only the string representation of this metadata - // value, since it's an unregistered field. - context->values.StartRecordingString(); - } -} - -static void -_GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) -{ - const SdfSchema& schema = SdfSchema::GetInstance(); - const SdfSchema::SpecDefinition &specDef = - *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { - // Validate known fields before storing them - const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); - const TfType fieldType = fieldDef.GetFallbackValue().GetType(); - - if (_IsGenericMetadataListOpType(fieldType)) { - if (!fieldDef.IsValidListValue(context->currentValue)) { - Err(context, "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); - } - else { - _SetGenericMetadataListOpItems(fieldType, context); - } - } - else { - if (!fieldDef.IsValidValue(context->currentValue) || - context->currentValue.IsEmpty()) { - Err(context, "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); - } - else { - _SetField( - context->path, context->genericMetadataKey, - context->currentValue, context); - } - } - } else if (specDef.IsValidField(context->genericMetadataKey)) { - // Prevent the user from overwriting fields that aren't metadata - Err(context, "\"%s\" is registered as a non-metadata field", - context->genericMetadataKey.GetText()); - } else { - // Stuff unknown fields into a SdfUnregisteredValue so they can pass - // through loading and saving unmodified - VtValue value; - if (context->currentValue.IsHolding()) { - // If we parsed a dictionary, store it's actual value. Dictionaries - // can be parsed fully because they contain type information. - value = - SdfUnregisteredValue(context->currentValue.Get()); - } else { - // Otherwise, we parsed a simple value or a shaped list of simple - // values. We want to store the parsed string, but we need to - // determine whether to unpack it into an SdfUnregisteredListOp - // or to just store the string directly. - auto getOldValue = [context]() { - VtValue v; - if (_HasField(context->path, context->genericMetadataKey, - &v, context) - && TF_VERIFY(v.IsHolding())) { - v = v.UncheckedGet().GetValue(); - } - else { - v = VtValue(); - } - return v; - }; - - auto getRecordedStringAsUnregisteredValue = [context]() { - std::string s = context->values.GetRecordedString(); - if (s == "None") { - return std::vector(); - } - - // Put the entire string representation of this list into - // a single SdfUnregisteredValue, but strip off the enclosing - // brackets so that we don't write out two sets of brackets - // when serializing out the list op. - if (!s.empty() && s.front() == '[') { s.erase(0, 1); } - if (!s.empty() && s.back() == ']') { s.pop_back(); } - return std::vector( - { SdfUnregisteredValue(s) }); - }; - - VtValue oldValue = getOldValue(); - if (context->listOpType == SdfListOpTypeExplicit) { - // In this case, we can't determine whether the we've parsed - // an explicit list op statement or a simple value. - // We just store the recorded string directly, as that's the - // simplest thing to do. - value = - SdfUnregisteredValue(context->values.GetRecordedString()); - } - else if (oldValue.IsEmpty() - || oldValue.IsHolding()) { - // In this case, we've parsed a list op statement so unpack - // it into a list op unless we've already parsed something - // for this field that *isn't* a list op. - SdfUnregisteredValueListOp listOp = - oldValue.GetWithDefault(); - listOp.SetItems(getRecordedStringAsUnregisteredValue(), - context->listOpType); - value = SdfUnregisteredValue(listOp); - } - else { - // If we've parsed a list op statement but have a non-list op - // stored in this field, leave that value in place and ignore - // the new value. We should only encounter this case if someone - // hand-edited the layer in an unexpected or invalid way, so - // just keeping the first value we find should be OK. - } - } - - if (!value.IsEmpty()) { - _SetField(context->path, context->genericMetadataKey, - value, context); - } - } - - context->values.Clear(); - context->currentValue = VtValue(); -} - -//-------------------------------------------------------------------- -// The following are used to configure bison -//-------------------------------------------------------------------- - -// Use this to enable generation of parser trace code. -// Useful when debugging, but costly. To enable/disable, (un)comment: -//#define SDF_PARSER_DEBUG_MODE - -#ifdef SDF_PARSER_DEBUG_MODE -#define YYDEBUG 1 -#endif // SDF_PARSER_DEBUG_MODE - - - -/* Line 189 of yacc.c */ -#line 1302 "pxr/usd/sdf/textFileFormat.tab.cpp" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOK_NL = 258, - TOK_MAGIC = 259, - TOK_SYNTAX_ERROR = 260, - TOK_ASSETREF = 261, - TOK_PATHREF = 262, - TOK_IDENTIFIER = 263, - TOK_CXX_NAMESPACED_IDENTIFIER = 264, - TOK_NAMESPACED_IDENTIFIER = 265, - TOK_NUMBER = 266, - TOK_STRING = 267, - TOK_ABSTRACT = 268, - TOK_ADD = 269, - TOK_APPEND = 270, - TOK_CLASS = 271, - TOK_CONFIG = 272, - TOK_CONNECT = 273, - TOK_CUSTOM = 274, - TOK_CUSTOMDATA = 275, - TOK_DEF = 276, - TOK_DEFAULT = 277, - TOK_DELETE = 278, - TOK_DICTIONARY = 279, - TOK_DISPLAYUNIT = 280, - TOK_DOC = 281, - TOK_INHERITS = 282, - TOK_KIND = 283, - TOK_NAMECHILDREN = 284, - TOK_NONE = 285, - TOK_OFFSET = 286, - TOK_OVER = 287, - TOK_PERMISSION = 288, - TOK_PAYLOAD = 289, - TOK_PREFIX_SUBSTITUTIONS = 290, - TOK_SUFFIX_SUBSTITUTIONS = 291, - TOK_PREPEND = 292, - TOK_PROPERTIES = 293, - TOK_REFERENCES = 294, - TOK_RELOCATES = 295, - TOK_REL = 296, - TOK_RENAMES = 297, - TOK_REORDER = 298, - TOK_ROOTPRIMS = 299, - TOK_SCALE = 300, - TOK_SPECIALIZES = 301, - TOK_SUBLAYERS = 302, - TOK_SYMMETRYARGUMENTS = 303, - TOK_SYMMETRYFUNCTION = 304, - TOK_TIME_SAMPLES = 305, - TOK_UNIFORM = 306, - TOK_VARIANTS = 307, - TOK_VARIANTSET = 308, - TOK_VARIANTSETS = 309, - TOK_VARYING = 310 - }; -#endif - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 264 of yacc.c */ -#line 1399 "pxr/usd/sdf/textFileFormat.tab.cpp" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 5 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 982 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 67 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 215 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 470 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 857 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 310 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 56, 57, 2, 2, 66, 2, 61, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 64, 65, - 2, 58, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 59, 2, 60, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 62, 2, 63, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 97, 98, - 102, 104, 110, 112, 116, 118, 122, 124, 126, 127, - 132, 133, 139, 140, 146, 147, 153, 154, 160, 161, - 167, 171, 175, 179, 183, 189, 191, 195, 198, 200, - 201, 206, 208, 212, 216, 220, 222, 226, 227, 231, - 232, 237, 238, 242, 243, 248, 249, 253, 254, 259, - 264, 266, 270, 271, 278, 280, 286, 288, 292, 294, - 298, 300, 302, 304, 306, 307, 312, 313, 319, 320, - 326, 327, 333, 334, 340, 341, 347, 351, 355, 359, - 360, 365, 366, 372, 373, 379, 380, 386, 387, 393, - 394, 400, 401, 406, 407, 413, 414, 420, 421, 427, - 428, 434, 435, 441, 442, 447, 448, 454, 455, 461, - 462, 468, 469, 475, 476, 482, 483, 488, 489, 495, - 496, 502, 503, 509, 510, 516, 517, 523, 527, 531, - 535, 540, 545, 550, 555, 560, 564, 567, 571, 575, - 577, 579, 583, 589, 591, 595, 599, 600, 604, 605, - 609, 615, 617, 621, 623, 625, 627, 631, 637, 639, - 643, 647, 648, 652, 653, 657, 663, 665, 669, 671, - 675, 677, 679, 683, 689, 691, 695, 697, 699, 701, - 705, 711, 713, 717, 719, 724, 725, 728, 730, 734, - 738, 740, 746, 748, 752, 754, 756, 759, 761, 764, - 767, 770, 773, 776, 779, 780, 790, 792, 795, 796, - 804, 809, 814, 816, 818, 820, 822, 824, 826, 830, - 832, 835, 836, 837, 844, 845, 846, 854, 855, 863, - 864, 873, 874, 883, 884, 893, 894, 903, 904, 913, - 914, 922, 924, 926, 928, 930, 932, 934, 938, 944, - 946, 950, 952, 953, 959, 960, 963, 965, 969, 970, - 975, 979, 980, 984, 990, 992, 996, 998, 1000, 1002, - 1004, 1005, 1010, 1011, 1017, 1018, 1024, 1025, 1031, 1032, - 1038, 1039, 1045, 1049, 1053, 1057, 1061, 1064, 1065, 1068, - 1070, 1072, 1073, 1079, 1080, 1083, 1085, 1089, 1094, 1099, - 1101, 1103, 1105, 1107, 1109, 1113, 1114, 1120, 1121, 1124, - 1126, 1130, 1134, 1136, 1138, 1140, 1142, 1144, 1146, 1148, - 1150, 1153, 1155, 1157, 1159, 1161, 1163, 1164, 1169, 1173, - 1175, 1179, 1181, 1183, 1185, 1186, 1191, 1195, 1197, 1201, - 1203, 1205, 1207, 1210, 1214, 1217, 1218, 1226, 1233, 1234, - 1240, 1241, 1247, 1248, 1254, 1255, 1261, 1262, 1268, 1269, - 1275, 1281, 1283, 1285, 1286, 1290, 1296, 1298, 1302, 1304, - 1306, 1308, 1310, 1311, 1316, 1317, 1323, 1324, 1330, 1331, - 1337, 1338, 1344, 1345, 1351, 1355, 1359, 1363, 1366, 1367, - 1370, 1372, 1374, 1378, 1384, 1386, 1390, 1392, 1393, 1395, - 1397, 1399, 1401, 1403, 1405, 1407, 1409, 1411, 1413, 1415, - 1417, 1418, 1420, 1423, 1425, 1427, 1429, 1432, 1433, 1435, - 1437 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 68, 0, -1, 71, -1, 13, -1, 14, -1, 15, - -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, - -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, - -1, 26, -1, 27, -1, 28, -1, 29, -1, 30, - -1, 31, -1, 32, -1, 34, -1, 33, -1, 35, - -1, 36, -1, 37, -1, 38, -1, 39, -1, 40, - -1, 41, -1, 42, -1, 43, -1, 44, -1, 45, - -1, 46, -1, 47, -1, 48, -1, 49, -1, 50, - -1, 51, -1, 52, -1, 53, -1, 54, -1, 55, - -1, 73, -1, 73, 91, 280, -1, -1, 4, 72, - 70, -1, 280, -1, 280, 56, 74, 57, 280, -1, - 280, -1, 280, 75, 276, -1, 77, -1, 75, 277, - 77, -1, 274, -1, 12, -1, -1, 76, 78, 58, - 231, -1, -1, 23, 274, 79, 58, 230, -1, -1, - 14, 274, 80, 58, 230, -1, -1, 37, 274, 81, - 58, 230, -1, -1, 15, 274, 82, 58, 230, -1, - -1, 43, 274, 83, 58, 230, -1, 26, 58, 12, - -1, 40, 58, 157, -1, 47, 58, 84, -1, 59, - 280, 60, -1, 59, 280, 85, 278, 60, -1, 86, - -1, 85, 279, 86, -1, 87, 88, -1, 6, -1, - -1, 56, 89, 276, 57, -1, 90, -1, 89, 277, - 90, -1, 31, 58, 11, -1, 45, 58, 11, -1, - 92, -1, 91, 281, 92, -1, -1, 21, 93, 100, - -1, -1, 21, 99, 94, 100, -1, -1, 16, 95, - 100, -1, -1, 16, 99, 96, 100, -1, -1, 32, - 97, 100, -1, -1, 32, 99, 98, 100, -1, 43, - 44, 58, 161, -1, 274, -1, 99, 61, 274, -1, - -1, 12, 101, 102, 62, 164, 63, -1, 280, -1, - 280, 56, 103, 57, 280, -1, 280, -1, 280, 104, - 276, -1, 106, -1, 104, 277, 106, -1, 274, -1, - 20, -1, 48, -1, 12, -1, -1, 105, 107, 58, - 231, -1, -1, 23, 274, 108, 58, 230, -1, -1, - 14, 274, 109, 58, 230, -1, -1, 37, 274, 110, - 58, 230, -1, -1, 15, 274, 111, 58, 230, -1, - -1, 43, 274, 112, 58, 230, -1, 26, 58, 12, - -1, 28, 58, 12, -1, 33, 58, 274, -1, -1, - 34, 113, 58, 137, -1, -1, 23, 34, 114, 58, - 137, -1, -1, 14, 34, 115, 58, 137, -1, -1, - 37, 34, 116, 58, 137, -1, -1, 15, 34, 117, - 58, 137, -1, -1, 43, 34, 118, 58, 137, -1, - -1, 27, 119, 58, 151, -1, -1, 23, 27, 120, - 58, 151, -1, -1, 14, 27, 121, 58, 151, -1, - -1, 37, 27, 122, 58, 151, -1, -1, 15, 27, - 123, 58, 151, -1, -1, 43, 27, 124, 58, 151, - -1, -1, 46, 125, 58, 154, -1, -1, 23, 46, - 126, 58, 154, -1, -1, 14, 46, 127, 58, 154, - -1, -1, 37, 46, 128, 58, 154, -1, -1, 15, - 46, 129, 58, 154, -1, -1, 43, 46, 130, 58, - 154, -1, -1, 39, 131, 58, 144, -1, -1, 23, - 39, 132, 58, 144, -1, -1, 14, 39, 133, 58, - 144, -1, -1, 37, 39, 134, 58, 144, -1, -1, - 15, 39, 135, 58, 144, -1, -1, 43, 39, 136, - 58, 144, -1, 40, 58, 157, -1, 52, 58, 216, - -1, 54, 58, 161, -1, 23, 54, 58, 161, -1, - 14, 54, 58, 161, -1, 37, 54, 58, 161, -1, - 15, 54, 58, 161, -1, 43, 54, 58, 161, -1, - 49, 58, 274, -1, 49, 58, -1, 35, 58, 225, - -1, 36, 58, 225, -1, 30, -1, 139, -1, 59, - 280, 60, -1, 59, 280, 138, 278, 60, -1, 139, - -1, 138, 279, 139, -1, 87, 269, 141, -1, -1, - 7, 140, 141, -1, -1, 56, 280, 57, -1, 56, - 280, 142, 276, 57, -1, 143, -1, 142, 277, 143, - -1, 90, -1, 30, -1, 146, -1, 59, 280, 60, - -1, 59, 280, 145, 278, 60, -1, 146, -1, 145, - 279, 146, -1, 87, 269, 148, -1, -1, 7, 147, - 148, -1, -1, 56, 280, 57, -1, 56, 280, 149, - 276, 57, -1, 150, -1, 149, 277, 150, -1, 90, - -1, 20, 58, 216, -1, 30, -1, 153, -1, 59, - 280, 60, -1, 59, 280, 152, 278, 60, -1, 153, - -1, 152, 279, 153, -1, 270, -1, 30, -1, 156, - -1, 59, 280, 60, -1, 59, 280, 155, 278, 60, - -1, 156, -1, 155, 279, 156, -1, 270, -1, 62, - 280, 158, 63, -1, -1, 159, 278, -1, 160, -1, - 159, 279, 160, -1, 7, 64, 7, -1, 163, -1, - 59, 280, 162, 278, 60, -1, 163, -1, 162, 279, - 163, -1, 12, -1, 280, -1, 280, 165, -1, 166, - -1, 165, 166, -1, 174, 277, -1, 172, 277, -1, - 173, 277, -1, 92, 281, -1, 167, 281, -1, -1, - 53, 12, 168, 58, 280, 62, 280, 169, 63, -1, - 170, -1, 169, 170, -1, -1, 12, 171, 102, 62, - 164, 63, 280, -1, 43, 29, 58, 161, -1, 43, - 38, 58, 161, -1, 194, -1, 248, -1, 51, -1, - 17, -1, 175, -1, 274, -1, 274, 59, 60, -1, - 177, -1, 176, 177, -1, -1, -1, 178, 273, 180, - 214, 181, 204, -1, -1, -1, 19, 178, 273, 183, - 214, 184, 204, -1, -1, 178, 273, 61, 18, 58, - 186, 195, -1, -1, 14, 178, 273, 61, 18, 58, - 187, 195, -1, -1, 37, 178, 273, 61, 18, 58, - 188, 195, -1, -1, 15, 178, 273, 61, 18, 58, - 189, 195, -1, -1, 23, 178, 273, 61, 18, 58, - 190, 195, -1, -1, 43, 178, 273, 61, 18, 58, - 191, 195, -1, -1, 178, 273, 61, 50, 58, 193, - 198, -1, 182, -1, 179, -1, 185, -1, 192, -1, - 30, -1, 197, -1, 59, 280, 60, -1, 59, 280, - 196, 278, 60, -1, 197, -1, 196, 279, 197, -1, - 271, -1, -1, 62, 199, 280, 200, 63, -1, -1, - 201, 278, -1, 202, -1, 201, 279, 202, -1, -1, - 275, 64, 203, 232, -1, 275, 64, 30, -1, -1, - 56, 280, 57, -1, 56, 280, 205, 276, 57, -1, - 207, -1, 205, 277, 207, -1, 274, -1, 20, -1, - 48, -1, 12, -1, -1, 206, 208, 58, 231, -1, - -1, 23, 274, 209, 58, 230, -1, -1, 14, 274, - 210, 58, 230, -1, -1, 37, 274, 211, 58, 230, - -1, -1, 15, 274, 212, 58, 230, -1, -1, 43, - 274, 213, 58, 230, -1, 26, 58, 12, -1, 33, - 58, 274, -1, 25, 58, 274, -1, 49, 58, 274, - -1, 49, 58, -1, -1, 58, 215, -1, 232, -1, - 30, -1, -1, 62, 217, 280, 218, 63, -1, -1, - 219, 276, -1, 220, -1, 219, 277, 220, -1, 222, - 221, 58, 232, -1, 24, 221, 58, 216, -1, 12, - -1, 272, -1, 223, -1, 224, -1, 274, -1, 274, - 59, 60, -1, -1, 62, 226, 280, 227, 63, -1, - -1, 228, 278, -1, 229, -1, 228, 279, 229, -1, - 12, 64, 12, -1, 30, -1, 234, -1, 216, -1, - 232, -1, 30, -1, 233, -1, 239, -1, 234, -1, - 59, 60, -1, 7, -1, 11, -1, 12, -1, 274, - -1, 6, -1, -1, 59, 235, 236, 60, -1, 280, - 237, 278, -1, 238, -1, 237, 279, 238, -1, 233, - -1, 234, -1, 239, -1, -1, 56, 240, 241, 57, - -1, 280, 242, 278, -1, 243, -1, 242, 279, 243, - -1, 233, -1, 239, -1, 41, -1, 19, 41, -1, - 19, 55, 41, -1, 55, 41, -1, -1, 244, 273, - 61, 50, 58, 246, 198, -1, 244, 273, 61, 22, - 58, 7, -1, -1, 244, 273, 249, 265, 255, -1, - -1, 23, 244, 273, 250, 265, -1, -1, 14, 244, - 273, 251, 265, -1, -1, 37, 244, 273, 252, 265, - -1, -1, 15, 244, 273, 253, 265, -1, -1, 43, - 244, 273, 254, 265, -1, 244, 273, 59, 7, 60, - -1, 245, -1, 247, -1, -1, 56, 280, 57, -1, - 56, 280, 256, 276, 57, -1, 258, -1, 256, 277, - 258, -1, 274, -1, 20, -1, 48, -1, 12, -1, - -1, 257, 259, 58, 231, -1, -1, 23, 274, 260, - 58, 230, -1, -1, 14, 274, 261, 58, 230, -1, - -1, 37, 274, 262, 58, 230, -1, -1, 15, 274, - 263, 58, 230, -1, -1, 43, 274, 264, 58, 230, - -1, 26, 58, 12, -1, 33, 58, 274, -1, 49, - 58, 274, -1, 49, 58, -1, -1, 58, 266, -1, - 268, -1, 30, -1, 59, 280, 60, -1, 59, 280, - 267, 278, 60, -1, 268, -1, 267, 279, 268, -1, - 7, -1, -1, 270, -1, 7, -1, 7, -1, 274, - -1, 69, -1, 8, -1, 10, -1, 69, -1, 8, - -1, 9, -1, 11, -1, 8, -1, -1, 277, -1, - 65, 280, -1, 281, -1, 280, -1, 279, -1, 66, - 280, -1, -1, 281, -1, 3, -1, 281, 3, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1319, 1319, 1322, 1323, 1324, 1325, 1326, 1327, 1328, - 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, - 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, - 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, - 1359, 1360, 1361, 1362, 1363, 1364, 1372, 1373, 1384, 1384, - 1396, 1402, 1414, 1415, 1419, 1420, 1424, 1428, 1433, 1433, - 1442, 1442, 1448, 1448, 1454, 1454, 1460, 1460, 1466, 1466, - 1474, 1481, 1489, 1493, 1494, 1508, 1509, 1513, 1521, 1528, - 1530, 1534, 1535, 1539, 1543, 1550, 1551, 1559, 1559, 1563, - 1563, 1567, 1567, 1571, 1571, 1575, 1575, 1579, 1579, 1583, - 1593, 1594, 1601, 1601, 1661, 1662, 1666, 1667, 1671, 1672, - 1676, 1677, 1678, 1682, 1687, 1687, 1696, 1696, 1702, 1702, - 1708, 1708, 1714, 1714, 1720, 1720, 1728, 1735, 1742, 1749, - 1749, 1756, 1756, 1763, 1763, 1770, 1770, 1777, 1777, 1784, - 1784, 1792, 1792, 1797, 1797, 1802, 1802, 1807, 1807, 1812, - 1812, 1817, 1817, 1823, 1823, 1828, 1828, 1833, 1833, 1838, - 1838, 1843, 1843, 1848, 1848, 1854, 1854, 1861, 1861, 1868, - 1868, 1875, 1875, 1882, 1882, 1889, 1889, 1898, 1909, 1913, - 1917, 1921, 1925, 1929, 1933, 1939, 1944, 1951, 1959, 1968, - 1969, 1970, 1971, 1975, 1976, 1980, 1992, 1992, 2015, 2017, - 2018, 2022, 2023, 2027, 2031, 2032, 2033, 2034, 2038, 2039, - 2043, 2056, 2056, 2080, 2082, 2083, 2087, 2088, 2092, 2093, - 2097, 2098, 2099, 2100, 2104, 2105, 2109, 2115, 2116, 2117, - 2118, 2122, 2123, 2127, 2133, 2136, 2138, 2142, 2143, 2147, - 2153, 2154, 2158, 2159, 2163, 2171, 2172, 2176, 2177, 2181, - 2182, 2183, 2184, 2185, 2189, 2189, 2223, 2224, 2228, 2228, - 2271, 2280, 2293, 2294, 2302, 2305, 2314, 2320, 2323, 2329, - 2333, 2339, 2346, 2339, 2357, 2365, 2357, 2376, 2376, 2384, - 2384, 2392, 2392, 2400, 2400, 2408, 2408, 2416, 2416, 2427, - 2427, 2439, 2440, 2441, 2442, 2450, 2451, 2452, 2453, 2457, - 2458, 2462, 2472, 2472, 2477, 2479, 2483, 2484, 2488, 2488, - 2495, 2507, 2509, 2510, 2514, 2515, 2519, 2520, 2521, 2525, - 2530, 2530, 2539, 2539, 2545, 2545, 2551, 2551, 2557, 2557, - 2563, 2563, 2571, 2578, 2585, 2593, 2598, 2605, 2607, 2611, - 2614, 2624, 2624, 2632, 2634, 2638, 2639, 2643, 2646, 2654, - 2655, 2659, 2660, 2664, 2670, 2680, 2680, 2688, 2690, 2694, - 2695, 2699, 2712, 2718, 2728, 2732, 2733, 2746, 2749, 2752, - 2755, 2766, 2772, 2775, 2778, 2783, 2796, 2796, 2805, 2809, - 2810, 2814, 2815, 2816, 2824, 2824, 2831, 2835, 2836, 2840, - 2841, 2849, 2853, 2857, 2861, 2868, 2868, 2880, 2895, 2895, - 2905, 2905, 2913, 2913, 2921, 2921, 2929, 2929, 2938, 2938, - 2946, 2953, 2954, 2957, 2959, 2960, 2964, 2965, 2969, 2970, - 2971, 2975, 2980, 2980, 2989, 2989, 2995, 2995, 3001, 3001, - 3007, 3007, 3013, 3013, 3021, 3028, 3036, 3041, 3048, 3050, - 3054, 3055, 3058, 3061, 3065, 3066, 3070, 3080, 3083, 3087, - 3093, 3104, 3105, 3111, 3112, 3113, 3118, 3119, 3124, 3125, - 3128, 3130, 3134, 3135, 3139, 3140, 3144, 3147, 3149, 3153, - 3154 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TOK_NL", "TOK_MAGIC", - "TOK_SYNTAX_ERROR", "TOK_ASSETREF", "TOK_PATHREF", "TOK_IDENTIFIER", - "TOK_CXX_NAMESPACED_IDENTIFIER", "TOK_NAMESPACED_IDENTIFIER", - "TOK_NUMBER", "TOK_STRING", "TOK_ABSTRACT", "TOK_ADD", "TOK_APPEND", - "TOK_CLASS", "TOK_CONFIG", "TOK_CONNECT", "TOK_CUSTOM", "TOK_CUSTOMDATA", - "TOK_DEF", "TOK_DEFAULT", "TOK_DELETE", "TOK_DICTIONARY", - "TOK_DISPLAYUNIT", "TOK_DOC", "TOK_INHERITS", "TOK_KIND", - "TOK_NAMECHILDREN", "TOK_NONE", "TOK_OFFSET", "TOK_OVER", - "TOK_PERMISSION", "TOK_PAYLOAD", "TOK_PREFIX_SUBSTITUTIONS", - "TOK_SUFFIX_SUBSTITUTIONS", "TOK_PREPEND", "TOK_PROPERTIES", - "TOK_REFERENCES", "TOK_RELOCATES", "TOK_REL", "TOK_RENAMES", - "TOK_REORDER", "TOK_ROOTPRIMS", "TOK_SCALE", "TOK_SPECIALIZES", - "TOK_SUBLAYERS", "TOK_SYMMETRYARGUMENTS", "TOK_SYMMETRYFUNCTION", - "TOK_TIME_SAMPLES", "TOK_UNIFORM", "TOK_VARIANTS", "TOK_VARIANTSET", - "TOK_VARIANTSETS", "TOK_VARYING", "'('", "')'", "'='", "'['", "']'", - "'.'", "'{'", "'}'", "':'", "';'", "','", "$accept", "sdf_file", - "keyword", "layer_metadata_form", "layer", "$@1", "layer_metadata_opt", - "layer_metadata_list_opt", "layer_metadata_list", "layer_metadata_key", - "layer_metadata", "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", - "sublayer_list", "sublayer_list_int", "sublayer_stmt", "layer_ref", - "layer_offset_opt", "layer_offset_int", "layer_offset_stmt", "prim_list", - "prim_stmt", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", - "prim_type_name", "prim_stmt_int", "$@14", "prim_metadata_opt", - "prim_metadata_list_opt", "prim_metadata_list", "prim_metadata_key", - "prim_metadata", "$@15", "$@16", "$@17", "$@18", "$@19", "$@20", "$@21", - "$@22", "$@23", "$@24", "$@25", "$@26", "$@27", "$@28", "$@29", "$@30", - "$@31", "$@32", "$@33", "$@34", "$@35", "$@36", "$@37", "$@38", "$@39", - "$@40", "$@41", "$@42", "$@43", "$@44", "payload_list", - "payload_list_int", "payload_list_item", "$@45", "payload_params_opt", - "payload_params_int", "payload_params_item", "reference_list", - "reference_list_int", "reference_list_item", "$@46", - "reference_params_opt", "reference_params_int", "reference_params_item", - "inherit_list", "inherit_list_int", "inherit_list_item", - "specializes_list", "specializes_list_int", "specializes_list_item", - "relocates_map", "relocates_stmt_list_opt", "relocates_stmt_list", - "relocates_stmt", "name_list", "name_list_int", "name_list_item", - "prim_contents_list_opt", "prim_contents_list", - "prim_contents_list_item", "variantset_stmt", "$@47", "variant_list", - "variant_stmt", "$@48", "prim_child_order_stmt", - "prim_property_order_stmt", "prim_property", "prim_attr_variability", - "prim_attr_qualifiers", "prim_attr_type", "prim_attribute_full_type", - "prim_attribute_default", "$@49", "$@50", "prim_attribute_fallback", - "$@51", "$@52", "prim_attribute_connect", "$@53", "$@54", "$@55", "$@56", - "$@57", "$@58", "prim_attribute_time_samples", "$@59", "prim_attribute", - "connect_rhs", "connect_list", "connect_item", "time_samples_rhs", - "$@60", "time_sample_list", "time_sample_list_int", "time_sample", - "$@61", "attribute_metadata_list_opt", "attribute_metadata_list", - "attribute_metadata_key", "attribute_metadata", "$@62", "$@63", "$@64", - "$@65", "$@66", "$@67", "attribute_assignment_opt", "attribute_value", - "typed_dictionary", "$@68", "typed_dictionary_list_opt", - "typed_dictionary_list", "typed_dictionary_element", "dictionary_key", - "dictionary_value_type", "dictionary_value_scalar_type", - "dictionary_value_shaped_type", "string_dictionary", "$@69", - "string_dictionary_list_opt", "string_dictionary_list", - "string_dictionary_element", "metadata_listop_list", "metadata_value", - "typed_value", "typed_value_atomic", "typed_value_list", "$@70", - "typed_value_list_int", "typed_value_list_items", - "typed_value_list_item", "typed_value_tuple", "$@71", - "typed_value_tuple_int", "typed_value_tuple_items", - "typed_value_tuple_item", "prim_relationship_type", - "prim_relationship_time_samples", "$@72", "prim_relationship_default", - "prim_relationship", "$@73", "$@74", "$@75", "$@76", "$@77", "$@78", - "relationship_metadata_list_opt", "relationship_metadata_list", - "relationship_metadata_key", "relationship_metadata", "$@79", "$@80", - "$@81", "$@82", "$@83", "$@84", "relationship_assignment_opt", - "relationship_rhs", "relationship_target_list", "relationship_target", - "prim_path_opt", "prim_path", "prim_or_property_scene_path", "name", - "namespaced_name", "identifier", "extended_number", "stmtsep_opt", - "stmtsep", "listsep_opt", "listsep", "newlines_opt", "newlines", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 40, 41, 61, 91, - 93, 46, 123, 125, 58, 59, 44 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 67, 68, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 70, 70, 72, 71, - 73, 73, 74, 74, 75, 75, 76, 77, 78, 77, - 79, 77, 80, 77, 81, 77, 82, 77, 83, 77, - 77, 77, 77, 84, 84, 85, 85, 86, 87, 88, - 88, 89, 89, 90, 90, 91, 91, 93, 92, 94, - 92, 95, 92, 96, 92, 97, 92, 98, 92, 92, - 99, 99, 101, 100, 102, 102, 103, 103, 104, 104, - 105, 105, 105, 106, 107, 106, 108, 106, 109, 106, - 110, 106, 111, 106, 112, 106, 106, 106, 106, 113, - 106, 114, 106, 115, 106, 116, 106, 117, 106, 118, - 106, 119, 106, 120, 106, 121, 106, 122, 106, 123, - 106, 124, 106, 125, 106, 126, 106, 127, 106, 128, - 106, 129, 106, 130, 106, 131, 106, 132, 106, 133, - 106, 134, 106, 135, 106, 136, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 137, - 137, 137, 137, 138, 138, 139, 140, 139, 141, 141, - 141, 142, 142, 143, 144, 144, 144, 144, 145, 145, - 146, 147, 146, 148, 148, 148, 149, 149, 150, 150, - 151, 151, 151, 151, 152, 152, 153, 154, 154, 154, - 154, 155, 155, 156, 157, 158, 158, 159, 159, 160, - 161, 161, 162, 162, 163, 164, 164, 165, 165, 166, - 166, 166, 166, 166, 168, 167, 169, 169, 171, 170, - 172, 173, 174, 174, 175, 175, 176, 177, 177, 178, - 178, 180, 181, 179, 183, 184, 182, 186, 185, 187, - 185, 188, 185, 189, 185, 190, 185, 191, 185, 193, - 192, 194, 194, 194, 194, 195, 195, 195, 195, 196, - 196, 197, 199, 198, 200, 200, 201, 201, 203, 202, - 202, 204, 204, 204, 205, 205, 206, 206, 206, 207, - 208, 207, 209, 207, 210, 207, 211, 207, 212, 207, - 213, 207, 207, 207, 207, 207, 207, 214, 214, 215, - 215, 217, 216, 218, 218, 219, 219, 220, 220, 221, - 221, 222, 222, 223, 224, 226, 225, 227, 227, 228, - 228, 229, 230, 230, 231, 231, 231, 232, 232, 232, - 232, 232, 233, 233, 233, 233, 235, 234, 236, 237, - 237, 238, 238, 238, 240, 239, 241, 242, 242, 243, - 243, 244, 244, 244, 244, 246, 245, 247, 249, 248, - 250, 248, 251, 248, 252, 248, 253, 248, 254, 248, - 248, 248, 248, 255, 255, 255, 256, 256, 257, 257, - 257, 258, 259, 258, 260, 258, 261, 258, 262, 258, - 263, 258, 264, 258, 258, 258, 258, 258, 265, 265, - 266, 266, 266, 266, 267, 267, 268, 269, 269, 270, - 271, 272, 272, 273, 273, 273, 274, 274, 275, 275, - 276, 276, 277, 277, 278, 278, 279, 280, 280, 281, - 281 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 0, 3, - 1, 5, 1, 3, 1, 3, 1, 1, 0, 4, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 3, 3, 3, 3, 5, 1, 3, 2, 1, 0, - 4, 1, 3, 3, 3, 1, 3, 0, 3, 0, - 4, 0, 3, 0, 4, 0, 3, 0, 4, 4, - 1, 3, 0, 6, 1, 5, 1, 3, 1, 3, - 1, 1, 1, 1, 0, 4, 0, 5, 0, 5, - 0, 5, 0, 5, 0, 5, 3, 3, 3, 0, - 4, 0, 5, 0, 5, 0, 5, 0, 5, 0, - 5, 0, 4, 0, 5, 0, 5, 0, 5, 0, - 5, 0, 5, 0, 4, 0, 5, 0, 5, 0, - 5, 0, 5, 0, 5, 0, 4, 0, 5, 0, - 5, 0, 5, 0, 5, 0, 5, 3, 3, 3, - 4, 4, 4, 4, 4, 3, 2, 3, 3, 1, - 1, 3, 5, 1, 3, 3, 0, 3, 0, 3, - 5, 1, 3, 1, 1, 1, 3, 5, 1, 3, - 3, 0, 3, 0, 3, 5, 1, 3, 1, 3, - 1, 1, 3, 5, 1, 3, 1, 1, 1, 3, - 5, 1, 3, 1, 4, 0, 2, 1, 3, 3, - 1, 5, 1, 3, 1, 1, 2, 1, 2, 2, - 2, 2, 2, 2, 0, 9, 1, 2, 0, 7, - 4, 4, 1, 1, 1, 1, 1, 1, 3, 1, - 2, 0, 0, 6, 0, 0, 7, 0, 7, 0, - 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, - 7, 1, 1, 1, 1, 1, 1, 3, 5, 1, - 3, 1, 0, 5, 0, 2, 1, 3, 0, 4, - 3, 0, 3, 5, 1, 3, 1, 1, 1, 1, - 0, 4, 0, 5, 0, 5, 0, 5, 0, 5, - 0, 5, 3, 3, 3, 3, 2, 0, 2, 1, - 1, 0, 5, 0, 2, 1, 3, 4, 4, 1, - 1, 1, 1, 1, 3, 0, 5, 0, 2, 1, - 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 0, 4, 3, 1, - 3, 1, 1, 1, 0, 4, 3, 1, 3, 1, - 1, 1, 2, 3, 2, 0, 7, 6, 0, 5, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 5, 1, 1, 0, 3, 5, 1, 3, 1, 1, - 1, 1, 0, 4, 0, 5, 0, 5, 0, 5, - 0, 5, 0, 5, 3, 3, 3, 2, 0, 2, - 1, 1, 3, 5, 1, 3, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 1, 2, 1, 1, 1, 2, 0, 1, 1, - 2 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 0, 48, 0, 2, 467, 1, 469, 49, 46, 50, - 468, 91, 87, 95, 0, 467, 85, 467, 470, 456, - 457, 0, 93, 100, 0, 89, 0, 97, 0, 47, - 468, 0, 52, 102, 92, 0, 0, 88, 0, 96, - 0, 0, 86, 467, 57, 0, 0, 0, 0, 0, - 0, 0, 0, 460, 58, 54, 56, 467, 101, 94, - 90, 98, 244, 467, 99, 240, 51, 62, 66, 60, - 0, 64, 0, 68, 0, 467, 53, 461, 463, 0, - 0, 104, 0, 0, 0, 0, 70, 0, 467, 71, - 0, 467, 72, 462, 55, 0, 467, 467, 467, 242, - 0, 0, 0, 0, 235, 0, 0, 375, 371, 372, - 373, 366, 384, 376, 341, 364, 59, 365, 367, 369, - 368, 374, 0, 245, 0, 106, 467, 0, 465, 464, - 362, 376, 63, 363, 67, 61, 65, 0, 0, 467, - 237, 69, 78, 73, 467, 75, 79, 467, 370, 467, - 467, 103, 0, 0, 265, 0, 0, 0, 391, 0, - 264, 0, 0, 0, 246, 247, 0, 0, 0, 0, - 266, 0, 269, 0, 292, 291, 293, 294, 262, 0, - 411, 412, 263, 267, 467, 113, 0, 0, 111, 0, - 0, 141, 0, 0, 129, 0, 0, 0, 165, 0, - 0, 153, 112, 0, 0, 0, 460, 114, 108, 110, - 466, 241, 243, 0, 234, 236, 465, 0, 465, 0, - 77, 0, 0, 0, 0, 343, 0, 0, 0, 0, - 0, 392, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 254, 394, 252, 248, 253, 250, 251, 249, - 270, 453, 454, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 24, 23, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 455, 271, 398, 0, - 105, 145, 133, 169, 157, 0, 118, 149, 137, 173, - 161, 0, 122, 143, 131, 167, 155, 0, 116, 0, - 0, 0, 0, 0, 0, 0, 147, 135, 171, 159, - 0, 120, 0, 0, 151, 139, 175, 163, 0, 124, - 0, 186, 0, 0, 107, 461, 0, 239, 238, 74, - 76, 0, 0, 460, 81, 385, 389, 390, 467, 387, - 377, 381, 382, 467, 379, 383, 0, 0, 460, 345, - 0, 351, 352, 353, 0, 402, 0, 406, 393, 274, - 0, 400, 0, 404, 0, 0, 0, 408, 0, 0, - 337, 0, 0, 438, 268, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 126, 0, 127, 128, 0, 355, 187, - 188, 0, 0, 0, 0, 0, 0, 0, 177, 0, - 0, 0, 0, 0, 0, 0, 185, 178, 179, 109, - 0, 0, 0, 0, 461, 386, 465, 378, 465, 349, - 452, 0, 350, 451, 342, 344, 461, 0, 0, 0, - 438, 0, 438, 337, 0, 438, 0, 438, 260, 261, - 0, 438, 467, 0, 0, 0, 272, 0, 0, 0, - 0, 413, 0, 0, 0, 0, 181, 0, 0, 0, - 0, 0, 183, 0, 0, 0, 0, 0, 180, 0, - 449, 220, 467, 142, 221, 226, 196, 189, 467, 447, - 130, 190, 467, 0, 0, 0, 0, 182, 0, 211, - 204, 467, 447, 166, 205, 0, 0, 0, 0, 184, - 0, 227, 467, 154, 228, 233, 115, 83, 84, 80, - 82, 388, 380, 0, 346, 0, 354, 0, 403, 0, - 407, 275, 0, 401, 0, 405, 0, 409, 0, 277, - 289, 340, 338, 339, 311, 410, 0, 395, 446, 441, - 467, 439, 440, 467, 399, 146, 134, 170, 158, 119, - 150, 138, 174, 162, 123, 144, 132, 168, 156, 117, - 0, 198, 0, 198, 448, 357, 148, 136, 172, 160, - 121, 213, 0, 213, 152, 140, 176, 164, 125, 0, - 348, 347, 279, 283, 311, 285, 281, 287, 467, 0, - 0, 467, 273, 397, 0, 0, 0, 222, 467, 224, - 467, 197, 191, 467, 193, 195, 0, 0, 467, 359, - 467, 212, 206, 467, 208, 210, 229, 467, 231, 0, - 0, 276, 0, 0, 0, 0, 450, 295, 467, 278, - 296, 301, 302, 290, 0, 396, 442, 467, 444, 421, - 0, 0, 419, 0, 0, 0, 0, 0, 420, 0, - 414, 460, 422, 416, 418, 0, 465, 0, 0, 465, - 0, 356, 358, 465, 0, 0, 465, 0, 465, 280, - 284, 286, 282, 288, 258, 0, 256, 0, 467, 319, - 0, 0, 317, 0, 0, 0, 0, 0, 0, 318, - 0, 312, 460, 320, 314, 316, 0, 465, 426, 430, - 424, 0, 0, 428, 432, 437, 0, 461, 0, 223, - 225, 199, 203, 460, 201, 192, 194, 361, 360, 0, - 214, 218, 460, 216, 207, 209, 230, 232, 467, 255, - 257, 297, 467, 299, 304, 324, 328, 322, 0, 0, - 0, 326, 330, 336, 0, 461, 0, 443, 445, 0, - 0, 0, 434, 435, 0, 0, 436, 415, 417, 0, - 0, 461, 0, 0, 461, 0, 0, 465, 459, 458, - 0, 467, 306, 0, 0, 0, 0, 334, 332, 333, - 0, 0, 335, 313, 315, 0, 0, 0, 0, 0, - 0, 423, 200, 202, 219, 215, 217, 467, 298, 300, - 303, 305, 465, 308, 0, 0, 0, 0, 0, 321, - 427, 431, 425, 429, 433, 0, 307, 310, 0, 325, - 329, 323, 327, 331, 467, 309, 259 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 2, 296, 7, 3, 4, 8, 31, 53, 54, - 55, 79, 85, 83, 87, 84, 90, 92, 144, 145, - 509, 220, 353, 742, 15, 163, 24, 38, 21, 36, - 26, 40, 22, 34, 57, 80, 124, 206, 207, 208, - 346, 412, 400, 426, 406, 434, 323, 408, 396, 422, - 402, 430, 320, 407, 395, 421, 401, 429, 340, 410, - 398, 424, 404, 432, 332, 409, 397, 423, 403, 431, - 510, 633, 511, 591, 631, 743, 744, 523, 643, 524, - 601, 641, 752, 753, 503, 628, 504, 533, 647, 534, - 89, 138, 139, 140, 64, 98, 65, 122, 164, 165, - 166, 388, 705, 706, 758, 167, 168, 169, 170, 171, - 172, 173, 174, 390, 564, 175, 463, 614, 176, 619, - 649, 653, 650, 652, 654, 177, 620, 178, 659, 762, - 660, 663, 708, 800, 801, 802, 848, 622, 722, 723, - 724, 776, 806, 804, 810, 805, 811, 476, 562, 115, - 150, 367, 368, 369, 451, 370, 371, 372, 419, 512, - 637, 638, 639, 132, 116, 117, 118, 133, 149, 223, - 363, 364, 120, 147, 221, 358, 359, 179, 180, 624, - 181, 182, 393, 465, 460, 467, 462, 471, 574, 681, - 682, 683, 738, 781, 779, 784, 780, 785, 481, 571, - 667, 572, 593, 505, 661, 452, 297, 121, 803, 76, - 77, 127, 128, 129, 10 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -674 -static const yytype_int16 yypact[] = -{ - 58, -674, 60, -674, 82, -674, -674, -674, 358, 12, - 99, 119, 119, 119, 90, 82, -674, 82, -674, -674, - -674, 128, 92, -674, 128, 92, 128, 92, 129, -674, - 278, 136, 615, -674, -674, 119, 128, -674, 128, -674, - 128, 66, -674, 82, -674, 119, 119, 119, 139, 119, - 148, 119, 154, 32, -674, -674, -674, 82, -674, -674, - -674, -674, -674, 82, -674, -674, -674, -674, -674, -674, - 207, -674, 163, -674, 175, 82, -674, 615, 99, 182, - 179, 188, 236, 196, 198, 211, -674, 226, 82, -674, - 228, 82, -674, -674, -674, 252, 82, 82, 29, -674, - 18, 18, 18, 18, 280, 18, 39, -674, -674, -674, - -674, -674, -674, 229, -674, -674, -674, -674, -674, -674, - -674, -674, 227, 565, 231, 886, 82, 235, 236, -674, - -674, -674, -674, -674, -674, -674, -674, 238, 243, 29, - -674, -674, -674, -674, 29, -674, 257, 82, -674, 82, - 82, -674, 329, 329, -674, 431, 329, 329, -674, 426, - -674, 314, 251, 82, 565, -674, 82, 32, 32, 32, - -674, 119, -674, 838, -674, -674, -674, -674, -674, 838, - -674, -674, -674, 271, 82, -674, 266, 451, -674, 480, - 274, -674, 285, 291, -674, 292, 293, 504, -674, 295, - 544, -674, -674, 299, 300, 305, 32, -674, -674, -674, - -674, -674, -674, 357, -674, -674, 280, 306, 367, 131, - -674, 318, 259, 326, 190, 65, 120, 838, 838, 838, - 838, -674, 350, 838, 838, 838, 838, 838, 338, 339, - 838, 838, -674, -674, 99, -674, 99, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, 337, 124, 351, - -674, -674, -674, -674, -674, 341, -674, -674, -674, -674, - -674, 360, -674, -674, -674, -674, -674, 361, -674, 403, - 362, 409, 119, 368, 363, 363, -674, -674, -674, -674, - 369, -674, 373, 163, -674, -674, -674, -674, 375, -674, - 378, 119, 376, 66, -674, 886, 389, -674, -674, -674, - -674, 391, 398, 32, -674, -674, -674, -674, 29, -674, - -674, -674, -674, 29, -674, -674, 763, 387, 32, -674, - 763, -674, -674, 399, 396, -674, 400, -674, -674, -674, - 401, -674, 402, -674, 66, 66, 404, -674, 408, 80, - 411, 464, 41, 415, -674, 416, 417, 421, 422, 66, - 425, 429, 433, 434, 435, 66, 436, 437, 438, 442, - 444, 66, 445, -674, 74, -674, -674, 73, -674, -674, - -674, 452, 457, 460, 463, 66, 465, 217, -674, 466, - 471, 472, 475, 66, 477, 114, -674, -674, -674, -674, - 252, 498, 525, 482, 131, -674, 259, -674, 190, -674, - -674, 484, -674, -674, -674, -674, 65, 496, 497, 538, - 415, 541, 415, 411, 542, 415, 546, 415, -674, -674, - 547, 415, 82, 509, 510, 221, -674, 502, 512, 514, - 183, 519, 74, 73, 217, 114, -674, 18, 74, 73, - 217, 114, -674, 18, 74, 73, 217, 114, -674, 18, - -674, -674, 82, -674, -674, -674, -674, -674, 82, 570, - -674, -674, 82, 74, 73, 217, 114, -674, 18, -674, - -674, 82, 570, -674, -674, 74, 73, 217, 114, -674, - 18, -674, 82, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, 376, -674, 130, -674, 527, -674, 529, - -674, -674, 531, -674, 533, -674, 534, -674, 532, -674, - -674, -674, -674, -674, 539, -674, 589, -674, -674, -674, - 82, -674, -674, 82, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - 36, 543, 30, 543, -674, 588, -674, -674, -674, -674, - -674, 545, 50, 545, -674, -674, -674, -674, -674, 40, - -674, -674, -674, -674, 539, -674, -674, -674, 82, 232, - 548, 82, -674, -674, 548, 45, 380, -674, 29, -674, - 82, -674, -674, 29, -674, -674, 549, 540, 29, -674, - 82, -674, -674, 29, -674, -674, -674, 29, -674, 232, - 232, -674, 232, 232, 232, 593, -674, -674, 82, -674, - -674, -674, -674, -674, 319, -674, -674, 29, -674, -674, - 119, 119, -674, 119, 551, 553, 119, 119, -674, 554, - -674, 32, -674, -674, -674, 555, 570, 134, 559, 171, - 595, -674, -674, 588, 143, 562, 197, 568, 570, -674, - -674, -674, -674, -674, -674, 43, -674, 59, 82, -674, - 119, 119, -674, 119, 573, 574, 575, 119, 119, -674, - 579, -674, 32, -674, -674, -674, 580, 632, -674, -674, - -674, 630, 119, -674, -674, 119, 586, 933, 587, -674, - -674, -674, -674, 32, -674, -674, -674, -674, -674, 590, - -674, -674, 32, -674, -674, -674, -674, -674, 82, -674, - -674, -674, 29, -674, 147, -674, -674, -674, 119, 634, - 119, -674, -674, 119, 592, 677, 599, -674, -674, 602, - 603, 605, -674, -674, 606, 609, -674, -674, -674, 252, - 594, 131, 376, 596, 38, 582, 610, 640, -674, -674, - 612, 29, -674, 613, 611, 618, 620, -674, -674, -674, - 621, 622, -674, -674, -674, 252, 18, 18, 18, 18, - 18, -674, -674, -674, -674, -674, -674, 82, -674, -674, - -674, -674, 147, 643, 18, 18, 18, 18, 18, -674, - -674, -674, -674, -674, -674, 624, -674, -674, 130, -674, - -674, -674, -674, -674, 82, -674, -674 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -674, -674, -305, -674, -674, -674, -674, -674, -674, -674, - 604, -674, -674, -674, -674, -674, -674, -674, -674, 432, - -103, -674, -674, -218, -674, 56, -674, -674, -674, -674, - -674, -674, 225, 406, -674, -75, -674, -674, -674, 343, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -217, -674, -577, -674, 91, -674, -101, -211, -674, -579, - -674, 95, -674, -100, -153, -674, -572, -114, -674, -587, - 366, -674, -674, 485, -276, -674, 44, -134, -674, 552, - -674, -674, -674, 2, -674, -674, -674, -674, -674, -674, - 550, 392, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -245, -674, - -673, 85, -674, -674, -674, -121, -674, 101, -674, -674, - -58, -674, -674, -674, -674, -674, -674, 255, -674, -338, - -674, -674, -674, 263, 354, -674, -674, -674, 410, -674, - -674, -674, 35, -77, -430, -470, -203, -93, -674, -674, - -674, 281, -193, -674, -674, -674, 287, 166, -674, -674, - -674, -674, -674, -674, -674, -674, -674, -674, -674, -674, - -674, -6, -674, -674, -674, -674, -674, -674, -164, -674, - -674, -611, 212, -415, -674, -674, -19, -5, -674, -197, - -118, -127, -106, -4, 1 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint16 yytable[] = -{ - 9, 354, 119, 146, 437, 563, 23, 23, 23, 344, - 536, 29, 215, 32, 668, 634, 30, 217, 629, 356, - 535, 361, 648, 644, 134, 135, 136, 56, 141, 357, - 58, 365, 6, 216, 763, 6, 142, 506, 218, 66, - 67, 68, 69, 500, 71, 142, 73, 500, 130, 247, - 248, 249, 568, 81, 78, 704, 142, 519, 749, 82, - 5, 450, 1, 478, 16, 450, 656, 438, 17, 351, - 535, 93, 56, 19, 20, 611, 535, 131, 62, 142, - 506, 500, 535, 352, 104, 6, 42, 106, 345, 366, - 632, 479, 123, 125, 594, 126, 627, 75, 473, 143, - 646, 535, 18, 507, 501, 666, 759, 594, 468, 469, - 642, 757, 746, 535, 740, 146, 778, 755, 183, 761, - 209, 500, 210, 486, 829, 63, 99, 19, 20, 492, - 474, 362, 508, 502, 28, 498, 107, 108, 19, 20, - 33, 109, 110, 222, 531, 224, 225, 183, 183, 517, - 183, 183, 183, 35, 183, 798, 443, 529, 799, 183, - 298, 231, 351, 749, 244, 351, 183, 246, 78, 78, - 78, 455, 212, 532, 351, 232, 352, 142, 506, 352, - 300, 306, 312, 391, 318, 392, 112, 41, 352, 113, - 568, 741, 331, 43, 535, 339, 107, 70, 19, 20, - 750, 109, 110, 142, 519, 610, 72, 78, 374, 375, - 376, 377, 74, 569, 379, 380, 381, 382, 383, 86, - 373, 386, 387, 142, 519, 88, 540, 107, 108, 19, - 20, 445, 109, 110, 91, 444, 447, 25, 27, 656, - 95, 96, 570, 356, 97, 361, 112, 520, 62, 131, - 456, 561, 446, 357, 100, 365, 101, 448, 107, 108, - 19, 20, 657, 109, 110, 107, 576, 19, 20, 102, - 109, 110, 581, 577, 19, 20, 521, 112, 586, 582, - 113, 18, 111, 535, 103, 587, 105, 137, 184, 148, - 151, 658, 243, 301, 11, 211, 548, 597, 550, 12, - 302, 553, 213, 555, 598, 303, 214, 557, 112, 605, - 13, 113, 304, 219, 114, 112, 606, 416, 228, 230, - 305, 14, 235, 237, 522, 241, 242, 19, 20, 575, - 299, 709, 319, 710, 711, 580, 436, 19, 20, 712, - 209, 585, 713, 321, 714, 715, 154, 119, 226, 322, - 324, 325, 716, 333, 78, 362, 717, 341, 342, 821, - 596, 453, 718, 343, 347, 453, 349, 719, 720, 78, - 158, 578, 604, 142, 11, 355, 721, 583, 855, 12, - 160, 522, 119, 588, 162, 839, 360, 522, 19, 20, - 13, 378, 669, 522, 670, 671, 384, 385, 389, 399, - 672, 14, 599, 673, 699, 700, 674, 701, 702, 703, - 579, 394, 522, 675, 607, 413, 584, 676, 405, 411, - 414, 415, 589, 677, 522, 418, 417, 425, 678, 679, - 37, 427, 39, 433, 19, 20, 435, 680, 114, 19, - 20, 600, 59, 154, 60, 226, 61, 440, 154, 441, - 454, 373, 119, 608, 824, 238, 442, 459, 458, 19, - 20, 461, 464, 466, 239, 470, 472, 158, 558, 475, - 28, 477, 231, 480, 482, 483, 751, 160, 307, 484, - 485, 162, 160, 487, 736, 308, 232, 488, 19, 20, - 309, 489, 490, 491, 493, 494, 495, 310, 590, 522, - 496, 685, 497, 499, 592, 311, 688, 313, 595, 537, - 513, 692, 19, 20, 314, 514, 695, 602, 515, 315, - 697, 516, 686, 518, 525, 774, 316, 689, 609, 526, - 527, 326, 693, 528, 317, 530, 538, 696, 327, 539, - 726, 698, 543, 328, 227, 229, 790, 233, 234, 236, - 329, 240, 19, 20, 545, 793, 547, 546, 330, 549, - 552, 727, 565, 737, 554, 556, 625, 559, 560, 626, - 566, 334, 567, 19, 20, 573, 751, 500, 335, 152, - 153, 11, 154, 336, 155, 612, 12, 613, 156, 615, - 337, 616, 617, 522, 618, 621, 623, 13, 338, 630, - 636, 640, 157, 691, 775, 704, 158, 747, 159, 731, - 662, 732, 735, 690, 655, 739, 160, 664, 161, 745, - 162, 684, 754, 19, 20, 791, 687, 44, 756, 45, - 46, 768, 769, 770, 794, 796, 694, 773, 47, 568, - 777, 48, 782, 787, 827, 789, 808, 656, 792, 813, - 350, 822, 49, 825, 707, 50, 797, 815, 51, 725, - 816, 817, 52, 818, 819, 728, 729, 820, 730, 834, - 828, 733, 734, 847, 831, 830, 835, 833, 836, 837, - 838, 94, 78, 795, 635, 19, 20, 854, 439, 709, - 823, 710, 711, 845, 826, 832, 119, 712, 645, 428, - 713, 348, 714, 715, 764, 765, 766, 760, 767, 665, - 716, 846, 771, 772, 717, 651, 245, 814, 551, 544, - 718, 250, 119, 78, 457, 719, 720, 783, 748, 542, - 786, 788, 684, 541, 603, 420, 0, 0, 0, 840, - 841, 842, 843, 844, 78, 0, 0, 0, 0, 0, - 0, 0, 0, 78, 81, 119, 0, 849, 850, 851, - 852, 853, 0, 807, 0, 809, 0, 0, 812, 0, - 725, 19, 20, 0, 0, 449, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 0, - 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 251, 0, 252, 0, - 856, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 19, 20, 0, 0, 185, 0, - 186, 187, 0, 0, 0, 0, 188, 0, 0, 189, - 0, 0, 190, 191, 192, 0, 0, 0, 0, 193, - 194, 195, 196, 197, 0, 198, 199, 0, 0, 200, - 0, 0, 201, 0, 202, 203, 0, 0, 204, 0, - 205, 19, 20, 0, 0, 669, 0, 670, 671, 0, - 0, 0, 0, 672, 0, 0, 673, 0, 0, 674, - 0, 0, 0, 0, 0, 0, 675, 0, 0, 0, - 676, 0, 0, 0, 0, 0, 677, 0, 0, 0, - 0, 678, 679 -}; - -static const yytype_int16 yycheck[] = -{ - 4, 219, 95, 106, 342, 475, 11, 12, 13, 206, - 440, 15, 139, 17, 625, 592, 15, 144, 590, 222, - 435, 224, 609, 602, 101, 102, 103, 32, 105, 222, - 35, 224, 3, 139, 707, 3, 6, 7, 144, 43, - 45, 46, 47, 7, 49, 6, 51, 7, 30, 167, - 168, 169, 7, 57, 53, 12, 6, 7, 20, 63, - 0, 366, 4, 22, 8, 370, 7, 343, 56, 31, - 485, 75, 77, 8, 9, 545, 491, 59, 12, 6, - 7, 7, 497, 45, 88, 3, 30, 91, 206, 24, - 60, 50, 96, 97, 509, 66, 60, 65, 18, 60, - 60, 516, 3, 30, 30, 60, 63, 522, 384, 385, - 60, 698, 689, 528, 686, 218, 727, 696, 123, 60, - 125, 7, 126, 399, 797, 59, 82, 8, 9, 405, - 50, 224, 59, 59, 44, 411, 6, 7, 8, 9, - 12, 11, 12, 147, 30, 149, 150, 152, 153, 425, - 155, 156, 157, 61, 159, 8, 353, 433, 11, 164, - 179, 41, 31, 20, 163, 31, 171, 166, 167, 168, - 169, 368, 128, 59, 31, 55, 45, 6, 7, 45, - 184, 186, 187, 59, 189, 61, 56, 58, 45, 59, - 7, 57, 197, 57, 609, 200, 6, 58, 8, 9, - 57, 11, 12, 6, 7, 543, 58, 206, 227, 228, - 229, 230, 58, 30, 233, 234, 235, 236, 237, 12, - 225, 240, 241, 6, 7, 62, 444, 6, 7, 8, - 9, 358, 11, 12, 59, 353, 363, 12, 13, 7, - 58, 62, 59, 446, 56, 448, 56, 30, 12, 59, - 368, 30, 358, 446, 58, 448, 58, 363, 6, 7, - 8, 9, 30, 11, 12, 6, 483, 8, 9, 58, - 11, 12, 489, 484, 8, 9, 59, 56, 495, 490, - 59, 3, 30, 698, 58, 496, 58, 7, 57, 60, - 63, 59, 41, 27, 16, 60, 460, 514, 462, 21, - 34, 465, 64, 467, 515, 39, 63, 471, 56, 526, - 32, 59, 46, 56, 62, 56, 527, 322, 152, 153, - 54, 43, 156, 157, 427, 159, 12, 8, 9, 482, - 59, 12, 58, 14, 15, 488, 341, 8, 9, 20, - 345, 494, 23, 58, 25, 26, 17, 440, 19, 58, - 58, 58, 33, 58, 353, 448, 37, 58, 58, 789, - 513, 366, 43, 58, 7, 370, 60, 48, 49, 368, - 41, 485, 525, 6, 16, 57, 57, 491, 848, 21, - 51, 484, 475, 497, 55, 815, 60, 490, 8, 9, - 32, 41, 12, 496, 14, 15, 58, 58, 61, 58, - 20, 43, 516, 23, 649, 650, 26, 652, 653, 654, - 487, 60, 515, 33, 528, 12, 493, 37, 58, 58, - 58, 12, 499, 43, 527, 62, 58, 58, 48, 49, - 24, 58, 26, 58, 8, 9, 58, 57, 62, 8, - 9, 518, 36, 17, 38, 19, 40, 58, 17, 58, - 63, 456, 545, 530, 792, 29, 58, 61, 59, 8, - 9, 61, 61, 61, 38, 61, 58, 41, 472, 58, - 44, 7, 41, 58, 58, 58, 694, 51, 27, 58, - 58, 55, 51, 58, 681, 34, 55, 58, 8, 9, - 39, 58, 58, 58, 58, 58, 58, 46, 502, 602, - 58, 628, 58, 58, 508, 54, 633, 27, 512, 11, - 58, 638, 8, 9, 34, 58, 643, 521, 58, 39, - 647, 58, 628, 58, 58, 722, 46, 633, 532, 58, - 58, 27, 638, 58, 54, 58, 11, 643, 34, 57, - 667, 647, 58, 39, 152, 153, 743, 155, 156, 157, - 46, 159, 8, 9, 58, 752, 18, 60, 54, 18, - 18, 667, 60, 681, 18, 18, 570, 58, 58, 573, - 58, 27, 58, 8, 9, 56, 794, 7, 34, 14, - 15, 16, 17, 39, 19, 58, 21, 58, 23, 58, - 46, 58, 58, 696, 62, 56, 7, 32, 54, 56, - 12, 56, 37, 63, 722, 12, 41, 12, 43, 58, - 62, 58, 58, 64, 618, 60, 51, 621, 53, 60, - 55, 626, 60, 8, 9, 743, 630, 12, 60, 14, - 15, 58, 58, 58, 752, 762, 640, 58, 23, 7, - 60, 26, 12, 57, 62, 58, 12, 7, 58, 57, - 218, 57, 37, 57, 658, 40, 762, 58, 43, 664, - 58, 58, 47, 58, 58, 670, 671, 58, 673, 58, - 60, 676, 677, 30, 801, 63, 58, 64, 58, 58, - 58, 77, 681, 758, 593, 8, 9, 63, 345, 12, - 791, 14, 15, 827, 794, 801, 789, 20, 603, 333, - 23, 216, 25, 26, 708, 710, 711, 705, 713, 624, - 33, 832, 717, 718, 37, 614, 164, 775, 463, 456, - 43, 171, 815, 722, 370, 48, 49, 732, 693, 448, - 735, 737, 737, 446, 522, 325, -1, -1, -1, 816, - 817, 818, 819, 820, 743, -1, -1, -1, -1, -1, - -1, -1, -1, 752, 758, 848, -1, 834, 835, 836, - 837, 838, -1, 768, -1, 770, -1, -1, 773, -1, - 775, 8, 9, -1, -1, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, -1, - -1, -1, -1, 827, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 8, -1, 10, -1, - 854, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 8, 9, -1, -1, 12, -1, - 14, 15, -1, -1, -1, -1, 20, -1, -1, 23, - -1, -1, 26, 27, 28, -1, -1, -1, -1, 33, - 34, 35, 36, 37, -1, 39, 40, -1, -1, 43, - -1, -1, 46, -1, 48, 49, -1, -1, 52, -1, - 54, 8, 9, -1, -1, 12, -1, 14, 15, -1, - -1, -1, -1, 20, -1, -1, 23, -1, -1, 26, - -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, - 37, -1, -1, -1, -1, -1, 43, -1, -1, -1, - -1, 48, 49 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 4, 68, 71, 72, 0, 3, 70, 73, 280, - 281, 16, 21, 32, 43, 91, 92, 56, 3, 8, - 9, 95, 99, 274, 93, 99, 97, 99, 44, 280, - 281, 74, 280, 12, 100, 61, 96, 100, 94, 100, - 98, 58, 92, 57, 12, 14, 15, 23, 26, 37, - 40, 43, 47, 75, 76, 77, 274, 101, 274, 100, - 100, 100, 12, 59, 161, 163, 280, 274, 274, 274, - 58, 274, 58, 274, 58, 65, 276, 277, 281, 78, - 102, 280, 280, 80, 82, 79, 12, 81, 62, 157, - 83, 59, 84, 280, 77, 58, 62, 56, 162, 163, - 58, 58, 58, 58, 280, 58, 280, 6, 7, 11, - 12, 30, 56, 59, 62, 216, 231, 232, 233, 234, - 239, 274, 164, 280, 103, 280, 66, 278, 279, 280, - 30, 59, 230, 234, 230, 230, 230, 7, 158, 159, - 160, 230, 6, 60, 85, 86, 87, 240, 60, 235, - 217, 63, 14, 15, 17, 19, 23, 37, 41, 43, - 51, 53, 55, 92, 165, 166, 167, 172, 173, 174, - 175, 176, 177, 178, 179, 182, 185, 192, 194, 244, - 245, 247, 248, 274, 57, 12, 14, 15, 20, 23, - 26, 27, 28, 33, 34, 35, 36, 37, 39, 40, - 43, 46, 48, 49, 52, 54, 104, 105, 106, 274, - 280, 60, 163, 64, 63, 278, 279, 278, 279, 56, - 88, 241, 280, 236, 280, 280, 19, 178, 244, 178, - 244, 41, 55, 178, 178, 244, 178, 244, 29, 38, - 178, 244, 12, 41, 281, 166, 281, 277, 277, 277, - 177, 8, 10, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 69, 273, 273, 59, - 280, 27, 34, 39, 46, 54, 274, 27, 34, 39, - 46, 54, 274, 27, 34, 39, 46, 54, 274, 58, - 119, 58, 58, 113, 58, 58, 27, 34, 39, 46, - 54, 274, 131, 58, 27, 34, 39, 46, 54, 274, - 125, 58, 58, 58, 276, 277, 107, 7, 160, 60, - 86, 31, 45, 89, 90, 57, 233, 239, 242, 243, - 60, 233, 234, 237, 238, 239, 24, 218, 219, 220, - 222, 223, 224, 274, 273, 273, 273, 273, 41, 273, - 273, 273, 273, 273, 58, 58, 273, 273, 168, 61, - 180, 59, 61, 249, 60, 121, 115, 133, 127, 58, - 109, 123, 117, 135, 129, 58, 111, 120, 114, 132, - 126, 58, 108, 12, 58, 12, 274, 58, 62, 225, - 225, 122, 116, 134, 128, 58, 110, 58, 157, 124, - 118, 136, 130, 58, 112, 58, 274, 216, 161, 106, - 58, 58, 58, 276, 277, 278, 279, 278, 279, 12, - 69, 221, 272, 274, 63, 276, 277, 221, 59, 61, - 251, 61, 253, 183, 61, 250, 61, 252, 161, 161, - 61, 254, 58, 18, 50, 58, 214, 7, 22, 50, - 58, 265, 58, 58, 58, 58, 161, 58, 58, 58, - 58, 58, 161, 58, 58, 58, 58, 58, 161, 58, - 7, 30, 59, 151, 153, 270, 7, 30, 59, 87, - 137, 139, 226, 58, 58, 58, 58, 161, 58, 7, - 30, 59, 87, 144, 146, 58, 58, 58, 58, 161, - 58, 30, 59, 154, 156, 270, 231, 11, 11, 57, - 90, 243, 238, 58, 220, 58, 60, 18, 265, 18, - 265, 214, 18, 265, 18, 265, 18, 265, 280, 58, - 58, 30, 215, 232, 181, 60, 58, 58, 7, 30, - 59, 266, 268, 56, 255, 151, 137, 144, 154, 230, - 151, 137, 144, 154, 230, 151, 137, 144, 154, 230, - 280, 140, 280, 269, 270, 280, 151, 137, 144, 154, - 230, 147, 280, 269, 151, 137, 144, 154, 230, 280, - 216, 232, 58, 58, 184, 58, 58, 58, 62, 186, - 193, 56, 204, 7, 246, 280, 280, 60, 152, 153, - 56, 141, 60, 138, 139, 141, 12, 227, 228, 229, - 56, 148, 60, 145, 146, 148, 60, 155, 156, 187, - 189, 204, 190, 188, 191, 280, 7, 30, 59, 195, - 197, 271, 62, 198, 280, 198, 60, 267, 268, 12, - 14, 15, 20, 23, 26, 33, 37, 43, 48, 49, - 57, 256, 257, 258, 274, 278, 279, 280, 278, 279, - 64, 63, 278, 279, 280, 278, 279, 278, 279, 195, - 195, 195, 195, 195, 12, 169, 170, 280, 199, 12, - 14, 15, 20, 23, 25, 26, 33, 37, 43, 48, - 49, 57, 205, 206, 207, 274, 278, 279, 274, 274, - 274, 58, 58, 274, 274, 58, 276, 277, 259, 60, - 153, 57, 90, 142, 143, 60, 139, 12, 229, 20, - 57, 90, 149, 150, 60, 146, 60, 156, 171, 63, - 170, 60, 196, 197, 280, 274, 274, 274, 58, 58, - 58, 274, 274, 58, 276, 277, 208, 60, 268, 261, - 263, 260, 12, 274, 262, 264, 274, 57, 258, 58, - 276, 277, 58, 276, 277, 102, 278, 279, 8, 11, - 200, 201, 202, 275, 210, 212, 209, 274, 12, 274, - 211, 213, 274, 57, 207, 58, 58, 58, 58, 58, - 58, 231, 57, 143, 216, 57, 150, 62, 60, 197, - 63, 278, 279, 64, 58, 58, 58, 58, 58, 231, - 230, 230, 230, 230, 230, 164, 202, 30, 203, 230, - 230, 230, 230, 230, 63, 232, 280 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (context, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, yyscanner) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, context); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Sdf_TextParserContext *context) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, context) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - Sdf_TextParserContext *context; -#endif -{ - if (!yyvaluep) - return; - YYUSE (context); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Sdf_TextParserContext *context) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, context) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - Sdf_TextParserContext *context; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, context); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Sdf_TextParserContext *context) -#else -static void -yy_reduce_print (yyvsp, yyrule, context) - YYSTYPE *yyvsp; - int yyrule; - Sdf_TextParserContext *context; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , context); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, context); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Sdf_TextParserContext *context) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, context) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - Sdf_TextParserContext *context; -#endif -{ - YYUSE (yyvaluep); - YYUSE (context); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (Sdf_TextParserContext *context); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (Sdf_TextParserContext *context) -#else -int -yyparse (context) - Sdf_TextParserContext *context; -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 47: - -/* Line 1455 of yacc.c */ -#line 1373 "pxr/usd/sdf/textFileFormat.yy" - { - - // Store the names of the root prims. - _SetField( - SdfPath::AbsoluteRootPath(), SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - context->nameChildrenStack.pop_back(); - ;} - break; - - case 48: - -/* Line 1455 of yacc.c */ -#line 1384 "pxr/usd/sdf/textFileFormat.yy" - { - _MatchMagicIdentifier((yyvsp[(1) - (1)]), context); - context->nameChildrenStack.push_back(std::vector()); - - _CreateSpec( - SdfPath::AbsoluteRootPath(), SdfSpecTypePseudoRoot, context); - - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 50: - -/* Line 1455 of yacc.c */ -#line 1396 "pxr/usd/sdf/textFileFormat.yy" - { - // If we're only reading metadata and we got here, - // we're done. - if (context->metadataOnly) - YYACCEPT; - ;} - break; - - case 51: - -/* Line 1455 of yacc.c */ -#line 1402 "pxr/usd/sdf/textFileFormat.yy" - { - // Abort if error after layer metadata. - ABORT_IF_ERROR(context->seenError); - - // If we're only reading metadata and we got here, - // we're done. - if (context->metadataOnly) - YYACCEPT; - ;} - break; - - case 57: - -/* Line 1455 of yacc.c */ -#line 1428 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Comment, - (yyvsp[(1) - (1)]).Get(), context); - ;} - break; - - case 58: - -/* Line 1455 of yacc.c */ -#line 1433 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypePseudoRoot, context); - ;} - break; - - case 59: - -/* Line 1455 of yacc.c */ -#line 1435 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 60: - -/* Line 1455 of yacc.c */ -#line 1442 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeDeleted; - ;} - break; - - case 61: - -/* Line 1455 of yacc.c */ -#line 1445 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 62: - -/* Line 1455 of yacc.c */ -#line 1448 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeAdded; - ;} - break; - - case 63: - -/* Line 1455 of yacc.c */ -#line 1451 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 64: - -/* Line 1455 of yacc.c */ -#line 1454 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypePrepended; - ;} - break; - - case 65: - -/* Line 1455 of yacc.c */ -#line 1457 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 66: - -/* Line 1455 of yacc.c */ -#line 1460 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeAppended; - ;} - break; - - case 67: - -/* Line 1455 of yacc.c */ -#line 1463 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 68: - -/* Line 1455 of yacc.c */ -#line 1466 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeOrdered; - ;} - break; - - case 69: - -/* Line 1455 of yacc.c */ -#line 1469 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - ;} - break; - - case 70: - -/* Line 1455 of yacc.c */ -#line 1474 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Documentation, - (yyvsp[(3) - (3)]).Get(), context); - ;} - break; - - case 71: - -/* Line 1455 of yacc.c */ -#line 1481 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->LayerRelocates, - context->relocatesParsing, context); - context->relocatesParsing.clear(); - ;} - break; - - case 74: - -/* Line 1455 of yacc.c */ -#line 1494 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - SdfPath::AbsoluteRootPath(), SdfFieldKeys->SubLayers, - context->subLayerPaths, context); - _SetField( - SdfPath::AbsoluteRootPath(), SdfFieldKeys->SubLayerOffsets, - context->subLayerOffsets, context); - - context->subLayerPaths.clear(); - context->subLayerOffsets.clear(); - ;} - break; - - case 77: - -/* Line 1455 of yacc.c */ -#line 1513 "pxr/usd/sdf/textFileFormat.yy" - { - context->subLayerPaths.push_back(context->layerRefPath); - context->subLayerOffsets.push_back(context->layerRefOffset); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 78: - -/* Line 1455 of yacc.c */ -#line 1521 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = (yyvsp[(1) - (1)]).Get(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 83: - -/* Line 1455 of yacc.c */ -#line 1539 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefOffset.SetOffset( (yyvsp[(3) - (3)]).Get() ); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 84: - -/* Line 1455 of yacc.c */ -#line 1543 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefOffset.SetScale( (yyvsp[(3) - (3)]).Get() ); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 87: - -/* Line 1455 of yacc.c */ -#line 1559 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierDef; - context->typeName = TfToken(); - ;} - break; - - case 89: - -/* Line 1455 of yacc.c */ -#line 1563 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierDef; - context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); - ;} - break; - - case 91: - -/* Line 1455 of yacc.c */ -#line 1567 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierClass; - context->typeName = TfToken(); - ;} - break; - - case 93: - -/* Line 1455 of yacc.c */ -#line 1571 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierClass; - context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); - ;} - break; - - case 95: - -/* Line 1455 of yacc.c */ -#line 1575 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierOver; - context->typeName = TfToken(); - ;} - break; - - case 97: - -/* Line 1455 of yacc.c */ -#line 1579 "pxr/usd/sdf/textFileFormat.yy" - { - context->specifier = SdfSpecifierOver; - context->typeName = TfToken((yyvsp[(2) - (2)]).Get()); - ;} - break; - - case 99: - -/* Line 1455 of yacc.c */ -#line 1583 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->PrimOrder, - context->nameVector, context); - context->nameVector.clear(); - ;} - break; - - case 100: - -/* Line 1455 of yacc.c */ -#line 1593 "pxr/usd/sdf/textFileFormat.yy" - { (yyval) = (yyvsp[(1) - (1)]); ;} - break; - - case 101: - -/* Line 1455 of yacc.c */ -#line 1594 "pxr/usd/sdf/textFileFormat.yy" - { - (yyval) = std::string( (yyvsp[(1) - (3)]).Get() + '.' - + (yyvsp[(3) - (3)]).Get() ); - ;} - break; - - case 102: - -/* Line 1455 of yacc.c */ -#line 1601 "pxr/usd/sdf/textFileFormat.yy" - { - TfToken name((yyvsp[(1) - (1)]).Get()); - if (!SdfPath::IsValidIdentifier(name)) { - Err(context, "'%s' is not a valid prim name", name.GetText()); - } - context->path = context->path.AppendChild(name); - - if (_HasSpec(context->path, context)) { - Err(context, "Duplicate prim '%s'", context->path.GetText()); - } else { - // Record the existence of this prim. - _CreateSpec(context->path, SdfSpecTypePrim, context); - - // Add this prim to its parent's name children - context->nameChildrenStack.back().push_back(name); - } - - // Create our name children vector and properties vector. - context->nameChildrenStack.push_back(std::vector()); - context->propertiesStack.push_back(std::vector()); - - _SetField( - context->path, SdfFieldKeys->Specifier, - context->specifier, context); - - if (!context->typeName.IsEmpty()) - _SetField( - context->path, SdfFieldKeys->TypeName, - context->typeName, context); - ;} - break; - - case 103: - -/* Line 1455 of yacc.c */ -#line 1634 "pxr/usd/sdf/textFileFormat.yy" - { - // Store the names of our children - if (!context->nameChildrenStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - } - - // Store the names of our properties, if there are any - if (!context->propertiesStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PropertyChildren, - context->propertiesStack.back(), context); - } - - context->nameChildrenStack.pop_back(); - context->propertiesStack.pop_back(); - context->path = context->path.GetParentPath(); - - // Abort after each prim if we hit an error. - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 113: - -/* Line 1455 of yacc.c */ -#line 1682 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Comment, - (yyvsp[(1) - (1)]).Get(), context); - ;} - break; - - case 114: - -/* Line 1455 of yacc.c */ -#line 1687 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypePrim, context); - ;} - break; - - case 115: - -/* Line 1455 of yacc.c */ -#line 1689 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 116: - -/* Line 1455 of yacc.c */ -#line 1696 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeDeleted; - ;} - break; - - case 117: - -/* Line 1455 of yacc.c */ -#line 1699 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 118: - -/* Line 1455 of yacc.c */ -#line 1702 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeAdded; - ;} - break; - - case 119: - -/* Line 1455 of yacc.c */ -#line 1705 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 120: - -/* Line 1455 of yacc.c */ -#line 1708 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypePrepended; - ;} - break; - - case 121: - -/* Line 1455 of yacc.c */ -#line 1711 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 122: - -/* Line 1455 of yacc.c */ -#line 1714 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeAppended; - ;} - break; - - case 123: - -/* Line 1455 of yacc.c */ -#line 1717 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 124: - -/* Line 1455 of yacc.c */ -#line 1720 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeOrdered; - ;} - break; - - case 125: - -/* Line 1455 of yacc.c */ -#line 1723 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypePrim, context); - ;} - break; - - case 126: - -/* Line 1455 of yacc.c */ -#line 1728 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Documentation, - (yyvsp[(3) - (3)]).Get(), context); - ;} - break; - - case 127: - -/* Line 1455 of yacc.c */ -#line 1735 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Kind, - TfToken((yyvsp[(3) - (3)]).Get()), context); - ;} - break; - - case 128: - -/* Line 1455 of yacc.c */ -#line 1742 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString((yyvsp[(3) - (3)]).Get(), context), - context); - ;} - break; - - case 129: - -/* Line 1455 of yacc.c */ -#line 1749 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 130: - -/* Line 1455 of yacc.c */ -#line 1753 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypeExplicit, context); - ;} - break; - - case 131: - -/* Line 1455 of yacc.c */ -#line 1756 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 132: - -/* Line 1455 of yacc.c */ -#line 1760 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypeDeleted, context); - ;} - break; - - case 133: - -/* Line 1455 of yacc.c */ -#line 1763 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 134: - -/* Line 1455 of yacc.c */ -#line 1767 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypeAdded, context); - ;} - break; - - case 135: - -/* Line 1455 of yacc.c */ -#line 1770 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 136: - -/* Line 1455 of yacc.c */ -#line 1774 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypePrepended, context); - ;} - break; - - case 137: - -/* Line 1455 of yacc.c */ -#line 1777 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 138: - -/* Line 1455 of yacc.c */ -#line 1781 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypeAppended, context); - ;} - break; - - case 139: - -/* Line 1455 of yacc.c */ -#line 1784 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - ;} - break; - - case 140: - -/* Line 1455 of yacc.c */ -#line 1788 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetPayloadListItems(SdfListOpTypeOrdered, context); - ;} - break; - - case 141: - -/* Line 1455 of yacc.c */ -#line 1792 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 142: - -/* Line 1455 of yacc.c */ -#line 1794 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypeExplicit, context); - ;} - break; - - case 143: - -/* Line 1455 of yacc.c */ -#line 1797 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 144: - -/* Line 1455 of yacc.c */ -#line 1799 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypeDeleted, context); - ;} - break; - - case 145: - -/* Line 1455 of yacc.c */ -#line 1802 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 146: - -/* Line 1455 of yacc.c */ -#line 1804 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypeAdded, context); - ;} - break; - - case 147: - -/* Line 1455 of yacc.c */ -#line 1807 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 148: - -/* Line 1455 of yacc.c */ -#line 1809 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypePrepended, context); - ;} - break; - - case 149: - -/* Line 1455 of yacc.c */ -#line 1812 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 150: - -/* Line 1455 of yacc.c */ -#line 1814 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypeAppended, context); - ;} - break; - - case 151: - -/* Line 1455 of yacc.c */ -#line 1817 "pxr/usd/sdf/textFileFormat.yy" - { - context->inheritParsingTargetPaths.clear(); - ;} - break; - - case 152: - -/* Line 1455 of yacc.c */ -#line 1819 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetInheritListItems(SdfListOpTypeOrdered, context); - ;} - break; - - case 153: - -/* Line 1455 of yacc.c */ -#line 1823 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 154: - -/* Line 1455 of yacc.c */ -#line 1825 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypeExplicit, context); - ;} - break; - - case 155: - -/* Line 1455 of yacc.c */ -#line 1828 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 156: - -/* Line 1455 of yacc.c */ -#line 1830 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypeDeleted, context); - ;} - break; - - case 157: - -/* Line 1455 of yacc.c */ -#line 1833 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 158: - -/* Line 1455 of yacc.c */ -#line 1835 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypeAdded, context); - ;} - break; - - case 159: - -/* Line 1455 of yacc.c */ -#line 1838 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 160: - -/* Line 1455 of yacc.c */ -#line 1840 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypePrepended, context); - ;} - break; - - case 161: - -/* Line 1455 of yacc.c */ -#line 1843 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 162: - -/* Line 1455 of yacc.c */ -#line 1845 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypeAppended, context); - ;} - break; - - case 163: - -/* Line 1455 of yacc.c */ -#line 1848 "pxr/usd/sdf/textFileFormat.yy" - { - context->specializesParsingTargetPaths.clear(); - ;} - break; - - case 164: - -/* Line 1455 of yacc.c */ -#line 1850 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetSpecializesListItems(SdfListOpTypeOrdered, context); - ;} - break; - - case 165: - -/* Line 1455 of yacc.c */ -#line 1854 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 166: - -/* Line 1455 of yacc.c */ -#line 1858 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypeExplicit, context); - ;} - break; - - case 167: - -/* Line 1455 of yacc.c */ -#line 1861 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 168: - -/* Line 1455 of yacc.c */ -#line 1865 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypeDeleted, context); - ;} - break; - - case 169: - -/* Line 1455 of yacc.c */ -#line 1868 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 170: - -/* Line 1455 of yacc.c */ -#line 1872 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypeAdded, context); - ;} - break; - - case 171: - -/* Line 1455 of yacc.c */ -#line 1875 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 172: - -/* Line 1455 of yacc.c */ -#line 1879 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypePrepended, context); - ;} - break; - - case 173: - -/* Line 1455 of yacc.c */ -#line 1882 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 174: - -/* Line 1455 of yacc.c */ -#line 1886 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypeAppended, context); - ;} - break; - - case 175: - -/* Line 1455 of yacc.c */ -#line 1889 "pxr/usd/sdf/textFileFormat.yy" - { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - ;} - break; - - case 176: - -/* Line 1455 of yacc.c */ -#line 1893 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetReferenceListItems(SdfListOpTypeOrdered, context); - ;} - break; - - case 177: - -/* Line 1455 of yacc.c */ -#line 1898 "pxr/usd/sdf/textFileFormat.yy" - { - SdfRelocatesMap relocatesParsingMap( - std::make_move_iterator(context->relocatesParsing.begin()), - std::make_move_iterator(context->relocatesParsing.end())); - context->relocatesParsing.clear(); - _SetField( - context->path, SdfFieldKeys->Relocates, - relocatesParsingMap, context); - ;} - break; - - case 178: - -/* Line 1455 of yacc.c */ -#line 1909 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSelection(context); - ;} - break; - - case 179: - -/* Line 1455 of yacc.c */ -#line 1913 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypeExplicit, context); - context->nameVector.clear(); - ;} - break; - - case 180: - -/* Line 1455 of yacc.c */ -#line 1917 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypeDeleted, context); - context->nameVector.clear(); - ;} - break; - - case 181: - -/* Line 1455 of yacc.c */ -#line 1921 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypeAdded, context); - context->nameVector.clear(); - ;} - break; - - case 182: - -/* Line 1455 of yacc.c */ -#line 1925 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypePrepended, context); - context->nameVector.clear(); - ;} - break; - - case 183: - -/* Line 1455 of yacc.c */ -#line 1929 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypeAppended, context); - context->nameVector.clear(); - ;} - break; - - case 184: - -/* Line 1455 of yacc.c */ -#line 1933 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimSetVariantSetNamesListItems(SdfListOpTypeOrdered, context); - context->nameVector.clear(); - ;} - break; - - case 185: - -/* Line 1455 of yacc.c */ -#line 1939 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken((yyvsp[(3) - (3)]).Get()), context); - ;} - break; - - case 186: - -/* Line 1455 of yacc.c */ -#line 1944 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - ;} - break; - - case 187: - -/* Line 1455 of yacc.c */ -#line 1951 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->PrefixSubstitutions, - context->currentDictionaries[0], context); - context->currentDictionaries[0].clear(); - ;} - break; - - case 188: - -/* Line 1455 of yacc.c */ -#line 1959 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SuffixSubstitutions, - context->currentDictionaries[0], context); - context->currentDictionaries[0].clear(); - ;} - break; - - case 195: - -/* Line 1455 of yacc.c */ -#line 1980 "pxr/usd/sdf/textFileFormat.yy" - { - if (context->layerRefPath.empty()) { - Err(context, "Payload asset path must not be empty. If this " - "is intended to be an internal payload, remove the " - "'@' delimiters."); - } - - SdfPayload payload(context->layerRefPath, - context->savedPath, - context->layerRefOffset); - context->payloadParsingRefs.push_back(payload); - ;} - break; - - case 196: - -/* Line 1455 of yacc.c */ -#line 1992 "pxr/usd/sdf/textFileFormat.yy" - { - // Internal payloads do not begin with an asset path so there's - // no layer_ref rule, but we need to make sure we reset state the - // so we don't pick up data from a previously-parsed payload. - context->layerRefPath.clear(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 197: - -/* Line 1455 of yacc.c */ -#line 2000 "pxr/usd/sdf/textFileFormat.yy" - { - if (!(yyvsp[(1) - (3)]).Get().empty()) { - _PathSetPrim((yyvsp[(1) - (3)]), context); - } - else { - context->savedPath = SdfPath::EmptyPath(); - } - - SdfPayload payload(std::string(), - context->savedPath, - context->layerRefOffset); - context->payloadParsingRefs.push_back(payload); - ;} - break; - - case 210: - -/* Line 1455 of yacc.c */ -#line 2043 "pxr/usd/sdf/textFileFormat.yy" - { - if (context->layerRefPath.empty()) { - Err(context, "Reference asset path must not be empty. If this " - "is intended to be an internal reference, remove the " - "'@' delimiters."); - } - - SdfReference ref(context->layerRefPath, - context->savedPath, - context->layerRefOffset); - ref.SwapCustomData(context->currentDictionaries[0]); - context->referenceParsingRefs.push_back(ref); - ;} - break; - - case 211: - -/* Line 1455 of yacc.c */ -#line 2056 "pxr/usd/sdf/textFileFormat.yy" - { - // Internal references do not begin with an asset path so there's - // no layer_ref rule, but we need to make sure we reset state the - // so we don't pick up data from a previously-parsed reference. - context->layerRefPath.clear(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - ;} - break; - - case 212: - -/* Line 1455 of yacc.c */ -#line 2064 "pxr/usd/sdf/textFileFormat.yy" - { - if (!(yyvsp[(1) - (3)]).Get().empty()) { - _PathSetPrim((yyvsp[(1) - (3)]), context); - } - else { - context->savedPath = SdfPath::EmptyPath(); - } - - SdfReference ref(std::string(), - context->savedPath, - context->layerRefOffset); - ref.SwapCustomData(context->currentDictionaries[0]); - context->referenceParsingRefs.push_back(ref); - ;} - break; - - case 226: - -/* Line 1455 of yacc.c */ -#line 2109 "pxr/usd/sdf/textFileFormat.yy" - { - _InheritAppendPath(context); - ;} - break; - - case 233: - -/* Line 1455 of yacc.c */ -#line 2127 "pxr/usd/sdf/textFileFormat.yy" - { - _SpecializesAppendPath(context); - ;} - break; - - case 239: - -/* Line 1455 of yacc.c */ -#line 2147 "pxr/usd/sdf/textFileFormat.yy" - { - _RelocatesAdd((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), context); - ;} - break; - - case 244: - -/* Line 1455 of yacc.c */ -#line 2163 "pxr/usd/sdf/textFileFormat.yy" - { - context->nameVector.push_back(TfToken((yyvsp[(1) - (1)]).Get())); - ;} - break; - - case 249: - -/* Line 1455 of yacc.c */ -#line 2181 "pxr/usd/sdf/textFileFormat.yy" - {;} - break; - - case 250: - -/* Line 1455 of yacc.c */ -#line 2182 "pxr/usd/sdf/textFileFormat.yy" - {;} - break; - - case 251: - -/* Line 1455 of yacc.c */ -#line 2183 "pxr/usd/sdf/textFileFormat.yy" - {;} - break; - - case 254: - -/* Line 1455 of yacc.c */ -#line 2189 "pxr/usd/sdf/textFileFormat.yy" - { - const std::string name = (yyvsp[(2) - (2)]).Get(); - ERROR_IF_NOT_ALLOWED(context, SdfSchema::IsValidVariantIdentifier(name)); - - context->currentVariantSetNames.push_back( name ); - context->currentVariantNames.push_back( std::vector() ); - - context->path = context->path.AppendVariantSelection(name, ""); - ;} - break; - - case 255: - -/* Line 1455 of yacc.c */ -#line 2197 "pxr/usd/sdf/textFileFormat.yy" - { - - SdfPath variantSetPath = context->path; - context->path = context->path.GetParentPath(); - - // Create this VariantSetSpec if it does not already exist. - if (!_HasSpec(variantSetPath, context)) { - _CreateSpec(variantSetPath, SdfSpecTypeVariantSet, context); - - // Add the name of this variant set to the VariantSets field - _AppendVectorItem(SdfChildrenKeys->VariantSetChildren, - TfToken(context->currentVariantSetNames.back()), - context); - } - - // Author the variant set's variants - _SetField( - variantSetPath, SdfChildrenKeys->VariantChildren, - TfToTokenVector(context->currentVariantNames.back()), context); - - context->currentVariantSetNames.pop_back(); - context->currentVariantNames.pop_back(); - ;} - break; - - case 258: - -/* Line 1455 of yacc.c */ -#line 2228 "pxr/usd/sdf/textFileFormat.yy" - { - const std::string variantName = (yyvsp[(1) - (1)]).Get(); - ERROR_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantIdentifier(variantName)); - - context->currentVariantNames.back().push_back(variantName); - - // A variant is basically like a new pseudo-root, so we need to push - // a new item onto our name children stack to store prims defined - // within this variant. - context->nameChildrenStack.push_back(std::vector()); - context->propertiesStack.push_back(std::vector()); - - std::string variantSetName = context->currentVariantSetNames.back(); - context->path = context->path.GetParentPath() - .AppendVariantSelection(variantSetName, variantName); - - _CreateSpec(context->path, SdfSpecTypeVariant, context); - - ;} - break; - - case 259: - -/* Line 1455 of yacc.c */ -#line 2248 "pxr/usd/sdf/textFileFormat.yy" - { - // Store the names of the prims and properties defined in this variant. - if (!context->nameChildrenStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - } - if (!context->propertiesStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PropertyChildren, - context->propertiesStack.back(), context); - } - - context->nameChildrenStack.pop_back(); - context->propertiesStack.pop_back(); - - std::string variantSet = context->path.GetVariantSelection().first; - context->path = - context->path.GetParentPath().AppendVariantSelection(variantSet, ""); - ;} - break; - - case 260: - -/* Line 1455 of yacc.c */ -#line 2271 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->PrimOrder, - context->nameVector, context); - context->nameVector.clear(); - ;} - break; - - case 261: - -/* Line 1455 of yacc.c */ -#line 2280 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->PropertyOrder, - context->nameVector, context); - context->nameVector.clear(); - ;} - break; - - case 264: - -/* Line 1455 of yacc.c */ -#line 2302 "pxr/usd/sdf/textFileFormat.yy" - { - context->variability = VtValue(SdfVariabilityUniform); - ;} - break; - - case 265: - -/* Line 1455 of yacc.c */ -#line 2305 "pxr/usd/sdf/textFileFormat.yy" - { - // Convert legacy "config" variability to SdfVariabilityUniform. - // This value was never officially used in USD but we handle - // this just in case the value was written out. - context->variability = VtValue(SdfVariabilityUniform); - ;} - break; - - case 266: - -/* Line 1455 of yacc.c */ -#line 2314 "pxr/usd/sdf/textFileFormat.yy" - { - context->assoc = VtValue(); - ;} - break; - - case 267: - -/* Line 1455 of yacc.c */ -#line 2320 "pxr/usd/sdf/textFileFormat.yy" - { - _SetupValue((yyvsp[(1) - (1)]).Get(), context); - ;} - break; - - case 268: - -/* Line 1455 of yacc.c */ -#line 2323 "pxr/usd/sdf/textFileFormat.yy" - { - _SetupValue(std::string((yyvsp[(1) - (3)]).Get() + "[]"), context); - ;} - break; - - case 269: - -/* Line 1455 of yacc.c */ -#line 2329 "pxr/usd/sdf/textFileFormat.yy" - { - context->variability = VtValue(); - context->custom = false; - ;} - break; - - case 270: - -/* Line 1455 of yacc.c */ -#line 2333 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = false; - ;} - break; - - case 271: - -/* Line 1455 of yacc.c */ -#line 2339 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(2) - (2)]), context); - - if (!context->values.valueTypeIsValid) { - context->values.StartRecordingString(); - } - ;} - break; - - case 272: - -/* Line 1455 of yacc.c */ -#line 2346 "pxr/usd/sdf/textFileFormat.yy" - { - if (!context->values.valueTypeIsValid) { - context->values.StopRecordingString(); - } - ;} - break; - - case 273: - -/* Line 1455 of yacc.c */ -#line 2351 "pxr/usd/sdf/textFileFormat.yy" - { - context->path = context->path.GetParentPath(); - ;} - break; - - case 274: - -/* Line 1455 of yacc.c */ -#line 2357 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = true; - _PrimInitAttribute((yyvsp[(3) - (3)]), context); - - if (!context->values.valueTypeIsValid) { - context->values.StartRecordingString(); - } - ;} - break; - - case 275: - -/* Line 1455 of yacc.c */ -#line 2365 "pxr/usd/sdf/textFileFormat.yy" - { - if (!context->values.valueTypeIsValid) { - context->values.StopRecordingString(); - } - ;} - break; - - case 276: - -/* Line 1455 of yacc.c */ -#line 2370 "pxr/usd/sdf/textFileFormat.yy" - { - context->path = context->path.GetParentPath(); - ;} - break; - - case 277: - -/* Line 1455 of yacc.c */ -#line 2376 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(2) - (5)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - ;} - break; - - case 278: - -/* Line 1455 of yacc.c */ -#line 2380 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypeExplicit, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 279: - -/* Line 1455 of yacc.c */ -#line 2384 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(3) - (6)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - ;} - break; - - case 280: - -/* Line 1455 of yacc.c */ -#line 2388 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypeAdded, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 281: - -/* Line 1455 of yacc.c */ -#line 2392 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(3) - (6)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - ;} - break; - - case 282: - -/* Line 1455 of yacc.c */ -#line 2396 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypePrepended, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 283: - -/* Line 1455 of yacc.c */ -#line 2400 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(3) - (6)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - ;} - break; - - case 284: - -/* Line 1455 of yacc.c */ -#line 2404 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypeAppended, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 285: - -/* Line 1455 of yacc.c */ -#line 2408 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(3) - (6)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = false; - ;} - break; - - case 286: - -/* Line 1455 of yacc.c */ -#line 2412 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypeDeleted, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 287: - -/* Line 1455 of yacc.c */ -#line 2416 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(3) - (6)]), context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = false; - ;} - break; - - case 288: - -/* Line 1455 of yacc.c */ -#line 2420 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeSetConnectionTargetsList(SdfListOpTypeOrdered, context); - context->path = context->path.GetParentPath(); - ;} - break; - - case 289: - -/* Line 1455 of yacc.c */ -#line 2427 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitAttribute((yyvsp[(2) - (5)]), context); - ;} - break; - - case 290: - -/* Line 1455 of yacc.c */ -#line 2430 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - context->path = context->path.GetParentPath(); // pop attr - ;} - break; - - case 301: - -/* Line 1455 of yacc.c */ -#line 2462 "pxr/usd/sdf/textFileFormat.yy" - { - _AttributeAppendConnectionPath(context); - ;} - break; - - case 302: - -/* Line 1455 of yacc.c */ -#line 2472 "pxr/usd/sdf/textFileFormat.yy" - { - context->timeSamples = SdfTimeSampleMap(); - ;} - break; - - case 308: - -/* Line 1455 of yacc.c */ -#line 2488 "pxr/usd/sdf/textFileFormat.yy" - { - context->timeSampleTime = (yyvsp[(1) - (2)]).Get(); - ;} - break; - - case 309: - -/* Line 1455 of yacc.c */ -#line 2491 "pxr/usd/sdf/textFileFormat.yy" - { - context->timeSamples[ context->timeSampleTime ] = context->currentValue; - ;} - break; - - case 310: - -/* Line 1455 of yacc.c */ -#line 2495 "pxr/usd/sdf/textFileFormat.yy" - { - context->timeSampleTime = (yyvsp[(1) - (3)]).Get(); - context->timeSamples[ context->timeSampleTime ] - = VtValue(SdfValueBlock()); - ;} - break; - - case 319: - -/* Line 1455 of yacc.c */ -#line 2525 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Comment, - (yyvsp[(1) - (1)]).Get(), context); - ;} - break; - - case 320: - -/* Line 1455 of yacc.c */ -#line 2530 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypeAttribute, context); - ;} - break; - - case 321: - -/* Line 1455 of yacc.c */ -#line 2532 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 322: - -/* Line 1455 of yacc.c */ -#line 2539 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeDeleted; - ;} - break; - - case 323: - -/* Line 1455 of yacc.c */ -#line 2542 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 324: - -/* Line 1455 of yacc.c */ -#line 2545 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeAdded; - ;} - break; - - case 325: - -/* Line 1455 of yacc.c */ -#line 2548 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 326: - -/* Line 1455 of yacc.c */ -#line 2551 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypePrepended; - ;} - break; - - case 327: - -/* Line 1455 of yacc.c */ -#line 2554 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 328: - -/* Line 1455 of yacc.c */ -#line 2557 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeAppended; - ;} - break; - - case 329: - -/* Line 1455 of yacc.c */ -#line 2560 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 330: - -/* Line 1455 of yacc.c */ -#line 2563 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeOrdered; - ;} - break; - - case 331: - -/* Line 1455 of yacc.c */ -#line 2566 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - ;} - break; - - case 332: - -/* Line 1455 of yacc.c */ -#line 2571 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Documentation, - (yyvsp[(3) - (3)]).Get(), context); - ;} - break; - - case 333: - -/* Line 1455 of yacc.c */ -#line 2578 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString((yyvsp[(3) - (3)]).Get(), context), - context); - ;} - break; - - case 334: - -/* Line 1455 of yacc.c */ -#line 2585 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->DisplayUnit, - _GetDisplayUnitFromString((yyvsp[(3) - (3)]).Get(), context), - context); - ;} - break; - - case 335: - -/* Line 1455 of yacc.c */ -#line 2593 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken((yyvsp[(3) - (3)]).Get()), context); - ;} - break; - - case 336: - -/* Line 1455 of yacc.c */ -#line 2598 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - ;} - break; - - case 339: - -/* Line 1455 of yacc.c */ -#line 2611 "pxr/usd/sdf/textFileFormat.yy" - { - _SetDefault(context->path, context->currentValue, context); - ;} - break; - - case 340: - -/* Line 1455 of yacc.c */ -#line 2614 "pxr/usd/sdf/textFileFormat.yy" - { - _SetDefault(context->path, VtValue(SdfValueBlock()), context); - ;} - break; - - case 341: - -/* Line 1455 of yacc.c */ -#line 2624 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryBegin(context); - ;} - break; - - case 342: - -/* Line 1455 of yacc.c */ -#line 2627 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryEnd(context); - ;} - break; - - case 347: - -/* Line 1455 of yacc.c */ -#line 2643 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryInsertValue((yyvsp[(2) - (4)]), context); - ;} - break; - - case 348: - -/* Line 1455 of yacc.c */ -#line 2646 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryInsertDictionary((yyvsp[(2) - (4)]), context); - ;} - break; - - case 353: - -/* Line 1455 of yacc.c */ -#line 2664 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryInitScalarFactory((yyvsp[(1) - (1)]), context); - ;} - break; - - case 354: - -/* Line 1455 of yacc.c */ -#line 2670 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryInitShapedFactory((yyvsp[(1) - (3)]), context); - ;} - break; - - case 355: - -/* Line 1455 of yacc.c */ -#line 2680 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryBegin(context); - ;} - break; - - case 356: - -/* Line 1455 of yacc.c */ -#line 2683 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryEnd(context); - ;} - break; - - case 361: - -/* Line 1455 of yacc.c */ -#line 2699 "pxr/usd/sdf/textFileFormat.yy" - { - _DictionaryInitScalarFactory(Value(std::string("string")), context); - _ValueAppendAtomic((yyvsp[(3) - (3)]), context); - _ValueSetAtomic(context); - _DictionaryInsertValue((yyvsp[(1) - (3)]), context); - ;} - break; - - case 362: - -/* Line 1455 of yacc.c */ -#line 2712 "pxr/usd/sdf/textFileFormat.yy" - { - context->currentValue = VtValue(); - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("None"); - } - ;} - break; - - case 363: - -/* Line 1455 of yacc.c */ -#line 2718 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueSetList(context); - ;} - break; - - case 364: - -/* Line 1455 of yacc.c */ -#line 2728 "pxr/usd/sdf/textFileFormat.yy" - { - context->currentValue.Swap(context->currentDictionaries[0]); - context->currentDictionaries[0].clear(); - ;} - break; - - case 366: - -/* Line 1455 of yacc.c */ -#line 2733 "pxr/usd/sdf/textFileFormat.yy" - { - // This is only here to allow 'None' metadata values for - // an explicit list operation on an SdfListOp-valued field. - // We'll reject this value for any other metadata field - // in _GenericMetadataEnd. - context->currentValue = VtValue(); - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("None"); - } - ;} - break; - - case 367: - -/* Line 1455 of yacc.c */ -#line 2746 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueSetAtomic(context); - ;} - break; - - case 368: - -/* Line 1455 of yacc.c */ -#line 2749 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueSetTuple(context); - ;} - break; - - case 369: - -/* Line 1455 of yacc.c */ -#line 2752 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueSetList(context); - ;} - break; - - case 370: - -/* Line 1455 of yacc.c */ -#line 2755 "pxr/usd/sdf/textFileFormat.yy" - { - // Set the recorded string on the ParserValueContext. Normally - // 'values' is able to keep track of the parsed string, but in this - // case it doesn't get the BeginList() and EndList() calls so the - // recorded string would have been "". We want "[]" instead. - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("[]"); - } - - _ValueSetShaped(context); - ;} - break; - - case 371: - -/* Line 1455 of yacc.c */ -#line 2766 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueSetCurrentToSdfPath((yyvsp[(1) - (1)]), context); - ;} - break; - - case 372: - -/* Line 1455 of yacc.c */ -#line 2772 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueAppendAtomic((yyvsp[(1) - (1)]), context); - ;} - break; - - case 373: - -/* Line 1455 of yacc.c */ -#line 2775 "pxr/usd/sdf/textFileFormat.yy" - { - _ValueAppendAtomic((yyvsp[(1) - (1)]), context); - ;} - break; - - case 374: - -/* Line 1455 of yacc.c */ -#line 2778 "pxr/usd/sdf/textFileFormat.yy" - { - // The ParserValueContext needs identifiers to be stored as TfToken - // instead of std::string to be able to distinguish between them. - _ValueAppendAtomic(TfToken((yyvsp[(1) - (1)]).Get()), context); - ;} - break; - - case 375: - -/* Line 1455 of yacc.c */ -#line 2783 "pxr/usd/sdf/textFileFormat.yy" - { - // The ParserValueContext needs asset paths to be stored as - // SdfAssetPath instead of std::string to be able to distinguish - // between them - _ValueAppendAtomic(SdfAssetPath((yyvsp[(1) - (1)]).Get()), context); - ;} - break; - - case 376: - -/* Line 1455 of yacc.c */ -#line 2796 "pxr/usd/sdf/textFileFormat.yy" - { - context->values.BeginList(); - ;} - break; - - case 377: - -/* Line 1455 of yacc.c */ -#line 2799 "pxr/usd/sdf/textFileFormat.yy" - { - context->values.EndList(); - ;} - break; - - case 384: - -/* Line 1455 of yacc.c */ -#line 2824 "pxr/usd/sdf/textFileFormat.yy" - { - context->values.BeginTuple(); - ;} - break; - - case 385: - -/* Line 1455 of yacc.c */ -#line 2826 "pxr/usd/sdf/textFileFormat.yy" - { - context->values.EndTuple(); - ;} - break; - - case 391: - -/* Line 1455 of yacc.c */ -#line 2849 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = false; - context->variability = VtValue(SdfVariabilityUniform); - ;} - break; - - case 392: - -/* Line 1455 of yacc.c */ -#line 2853 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = true; - context->variability = VtValue(SdfVariabilityUniform); - ;} - break; - - case 393: - -/* Line 1455 of yacc.c */ -#line 2857 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = true; - context->variability = VtValue(SdfVariabilityVarying); - ;} - break; - - case 394: - -/* Line 1455 of yacc.c */ -#line 2861 "pxr/usd/sdf/textFileFormat.yy" - { - context->custom = false; - context->variability = VtValue(SdfVariabilityVarying); - ;} - break; - - case 395: - -/* Line 1455 of yacc.c */ -#line 2868 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(2) - (5)]), context); - ;} - break; - - case 396: - -/* Line 1455 of yacc.c */ -#line 2871 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - _PrimEndRelationship(context); - ;} - break; - - case 397: - -/* Line 1455 of yacc.c */ -#line 2880 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(2) - (6)]), context); - - // If path is empty, use default c'tor to construct empty path. - // XXX: 08/04/08 Would be nice if SdfPath would allow - // SdfPath("") without throwing a warning. - std::string pathString = (yyvsp[(6) - (6)]).Get(); - SdfPath path = pathString.empty() ? SdfPath() : SdfPath(pathString); - - _SetDefault(context->path, VtValue(path), context); - _PrimEndRelationship(context); - ;} - break; - - case 398: - -/* Line 1455 of yacc.c */ -#line 2895 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(2) - (2)]), context); - context->relParsingAllowTargetData = true; - ;} - break; - - case 399: - -/* Line 1455 of yacc.c */ -#line 2900 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypeExplicit, context); - _PrimEndRelationship(context); - ;} - break; - - case 400: - -/* Line 1455 of yacc.c */ -#line 2905 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(3) - (3)]), context); - ;} - break; - - case 401: - -/* Line 1455 of yacc.c */ -#line 2908 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypeDeleted, context); - _PrimEndRelationship(context); - ;} - break; - - case 402: - -/* Line 1455 of yacc.c */ -#line 2913 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(3) - (3)]), context); - context->relParsingAllowTargetData = true; - ;} - break; - - case 403: - -/* Line 1455 of yacc.c */ -#line 2917 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypeAdded, context); - _PrimEndRelationship(context); - ;} - break; - - case 404: - -/* Line 1455 of yacc.c */ -#line 2921 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(3) - (3)]), context); - context->relParsingAllowTargetData = true; - ;} - break; - - case 405: - -/* Line 1455 of yacc.c */ -#line 2925 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypePrepended, context); - _PrimEndRelationship(context); - ;} - break; - - case 406: - -/* Line 1455 of yacc.c */ -#line 2929 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(3) - (3)]), context); - context->relParsingAllowTargetData = true; - ;} - break; - - case 407: - -/* Line 1455 of yacc.c */ -#line 2933 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypeAppended, context); - _PrimEndRelationship(context); - ;} - break; - - case 408: - -/* Line 1455 of yacc.c */ -#line 2938 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(3) - (3)]), context); - ;} - break; - - case 409: - -/* Line 1455 of yacc.c */ -#line 2941 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipSetTargetsList(SdfListOpTypeOrdered, context); - _PrimEndRelationship(context); - ;} - break; - - case 410: - -/* Line 1455 of yacc.c */ -#line 2946 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(2) - (5)]), context); - context->relParsingAllowTargetData = true; - _RelationshipAppendTargetPath((yyvsp[(4) - (5)]), context); - _RelationshipInitTarget(context->relParsingTargetPaths->back(), - context); - ;} - break; - - case 421: - -/* Line 1455 of yacc.c */ -#line 2975 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Comment, - (yyvsp[(1) - (1)]).Get(), context); - ;} - break; - - case 422: - -/* Line 1455 of yacc.c */ -#line 2980 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypeRelationship, context); - ;} - break; - - case 423: - -/* Line 1455 of yacc.c */ -#line 2982 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 424: - -/* Line 1455 of yacc.c */ -#line 2989 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeDeleted; - ;} - break; - - case 425: - -/* Line 1455 of yacc.c */ -#line 2992 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 426: - -/* Line 1455 of yacc.c */ -#line 2995 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeAdded; - ;} - break; - - case 427: - -/* Line 1455 of yacc.c */ -#line 2998 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 428: - -/* Line 1455 of yacc.c */ -#line 3001 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypePrepended; - ;} - break; - - case 429: - -/* Line 1455 of yacc.c */ -#line 3004 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 430: - -/* Line 1455 of yacc.c */ -#line 3007 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeAppended; - ;} - break; - - case 431: - -/* Line 1455 of yacc.c */ -#line 3010 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 432: - -/* Line 1455 of yacc.c */ -#line 3013 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeOrdered; - ;} - break; - - case 433: - -/* Line 1455 of yacc.c */ -#line 3016 "pxr/usd/sdf/textFileFormat.yy" - { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - ;} - break; - - case 434: - -/* Line 1455 of yacc.c */ -#line 3021 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Documentation, - (yyvsp[(3) - (3)]).Get(), context); - ;} - break; - - case 435: - -/* Line 1455 of yacc.c */ -#line 3028 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString((yyvsp[(3) - (3)]).Get(), context), - context); - ;} - break; - - case 436: - -/* Line 1455 of yacc.c */ -#line 3036 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken((yyvsp[(3) - (3)]).Get()), context); - ;} - break; - - case 437: - -/* Line 1455 of yacc.c */ -#line 3041 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - ;} - break; - - case 441: - -/* Line 1455 of yacc.c */ -#line 3055 "pxr/usd/sdf/textFileFormat.yy" - { - context->relParsingTargetPaths = SdfPathVector(); - ;} - break; - - case 442: - -/* Line 1455 of yacc.c */ -#line 3058 "pxr/usd/sdf/textFileFormat.yy" - { - context->relParsingTargetPaths = SdfPathVector(); - ;} - break; - - case 446: - -/* Line 1455 of yacc.c */ -#line 3070 "pxr/usd/sdf/textFileFormat.yy" - { - _RelationshipAppendTargetPath((yyvsp[(1) - (1)]), context); - ;} - break; - - case 447: - -/* Line 1455 of yacc.c */ -#line 3080 "pxr/usd/sdf/textFileFormat.yy" - { - context->savedPath = SdfPath(); - ;} - break; - - case 449: - -/* Line 1455 of yacc.c */ -#line 3087 "pxr/usd/sdf/textFileFormat.yy" - { - _PathSetPrim((yyvsp[(1) - (1)]), context); - ;} - break; - - case 450: - -/* Line 1455 of yacc.c */ -#line 3093 "pxr/usd/sdf/textFileFormat.yy" - { - _PathSetPrimOrPropertyScenePath((yyvsp[(1) - (1)]), context); - ;} - break; - - case 459: - -/* Line 1455 of yacc.c */ -#line 3125 "pxr/usd/sdf/textFileFormat.yy" - { (yyval) = (yyvsp[(1) - (1)]); ;} - break; - - - -/* Line 1455 of yacc.c */ -#line 6153 "pxr/usd/sdf/textFileFormat.tab.cpp" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (context, YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (context, yymsg); - } - else - { - yyerror (context, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, context); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, context); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (context, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, context); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, context); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - -/* Line 1675 of yacc.c */ -#line 3157 "pxr/usd/sdf/textFileFormat.yy" - - -//-------------------------------------------------------------------- -// textFileFormatYyerror -//-------------------------------------------------------------------- -void textFileFormatYyerror(Sdf_TextParserContext *context, const char *msg) -{ - const std::string nextToken(textFileFormatYyget_text(context->scanner), - textFileFormatYyget_leng(context->scanner)); - const bool isNewlineToken = - (nextToken.length() == 1 && nextToken[0] == '\n'); - - int errLineNumber = context->sdfLineNo; - - // By this time, sdfLineNo has already been updated to account for - // nextToken. So, if nextToken is a newline, the error really occurred on - // the previous line. - if (isNewlineToken) { - errLineNumber -= 1; - } - - std::string s = TfStringPrintf( - "%s%s in <%s> on line %i", - msg, - isNewlineToken ? - "" : TfStringPrintf(" at \'%s\'", nextToken.c_str()).c_str(), - context->path.GetText(), - errLineNumber); - - // Append file context, if known. - if (!context->fileContext.empty()) { - s += " in file " + context->fileContext; - } - s += "\n"; - - // Return the line number in the error info. - TfDiagnosticInfo info(errLineNumber); - - TF_ERROR(info, TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE, s); - - context->seenError = true; -} - -static void _ReportParseError(Sdf_TextParserContext *context, - const std::string &text) -{ - if (!context->values.IsRecordingString()) { - textFileFormatYyerror(context, text.c_str()); - } -} - -// Helper class for generating/managing the buffer used by flex. -// -// This simply reads the given file entirely into memory, padded as flex -// requires, and passes it along. Normally, flex reads data from a given file in -// blocks of 8KB, which leads to O(n^2) behavior when trying to match strings -// that are over this size. Giving flex a pre-filled buffer avoids this -// behavior. -struct Sdf_MemoryFlexBuffer -{ - Sdf_MemoryFlexBuffer(const Sdf_MemoryFlexBuffer&) = delete; - Sdf_MemoryFlexBuffer& operator=(const Sdf_MemoryFlexBuffer&) = delete; -public: - Sdf_MemoryFlexBuffer(const std::shared_ptr& asset, - const std::string& name, yyscan_t scanner); - ~Sdf_MemoryFlexBuffer(); - - yy_buffer_state *GetBuffer() { return _flexBuffer; } - -private: - yy_buffer_state *_flexBuffer; - - std::unique_ptr _fileBuffer; - - yyscan_t _scanner; -}; - -Sdf_MemoryFlexBuffer::Sdf_MemoryFlexBuffer( - const std::shared_ptr& asset, - const std::string& name, yyscan_t scanner) - : _flexBuffer(nullptr) - , _scanner(scanner) -{ - // flex requires 2 bytes of null padding at the end of any buffers it is - // given. We'll allocate a buffer with 2 padding bytes, then read the - // entire file in. - static const size_t paddingBytesRequired = 2; - - size_t size = asset->GetSize(); - std::unique_ptr buffer(new char[size + paddingBytesRequired]); - - if (asset->Read(buffer.get(), size, 0) != size) { - TF_RUNTIME_ERROR("Failed to read asset contents @%s@: " - "an error occurred while reading", - name.c_str()); - return; - } - - // Set null padding. - memset(buffer.get() + size, '\0', paddingBytesRequired); - _fileBuffer = std::move(buffer); - _flexBuffer = textFileFormatYy_scan_buffer( - _fileBuffer.get(), size + paddingBytesRequired, _scanner); -} - -Sdf_MemoryFlexBuffer::~Sdf_MemoryFlexBuffer() -{ - if (_flexBuffer) - textFileFormatYy_delete_buffer(_flexBuffer, _scanner); -} - -#ifdef SDF_PARSER_DEBUG_MODE -extern int yydebug; -#else -static int yydebug; -#endif // SDF_PARSER_DEBUG_MODE - -namespace { -struct _DebugContext { - explicit _DebugContext(bool state=true) : _old(yydebug) { yydebug = state; } - ~_DebugContext() { yydebug = _old; } -private: - bool _old; -}; -} - -/// Parse a text layer into an SdfData -bool -Sdf_ParseLayer( - const std::string& fileContext, - const std::shared_ptr& asset, - const std::string& magicId, - const std::string& versionString, - bool metadataOnly, - SdfDataRefPtr data, - SdfLayerHints *hints) -{ - TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayer"); - - TRACE_FUNCTION(); - - // Turn on debugging, if enabled. - _DebugContext debugCtx; - - // Configure for input file. - Sdf_TextParserContext context; - - context.data = data; - context.fileContext = fileContext; - context.magicIdentifierToken = magicId; - context.versionString = versionString; - context.metadataOnly = metadataOnly; - context.values.errorReporter = - std::bind(_ReportParseError, &context, std::placeholders::_1); - - // Initialize the scanner, allowing it to be reentrant. - textFileFormatYylex_init(&context.scanner); - textFileFormatYyset_extra(&context, context.scanner); - - int status = -1; - { - Sdf_MemoryFlexBuffer input(asset, fileContext, context.scanner); - yy_buffer_state *buf = input.GetBuffer(); - - // Continue parsing if we have a valid input buffer. If there - // is no buffer, the appropriate error will have already been emitted. - if (buf) { - try { - TRACE_SCOPE("textFileFormatYyParse"); - status = textFileFormatYyparse(&context); - *hints = context.layerHints; - } catch (std::bad_variant_access const &) { - TF_CODING_ERROR("Bad variant access in layer parser."); - Err(&context, "Internal layer parser error."); - } - } - } - - // Note that the destructor for 'input' calls - // textFileFormatYy_delete_buffer(), which requires a valid scanner - // object. So we need 'input' to go out of scope before we can destroy the - // scanner. - textFileFormatYylex_destroy(context.scanner); - - return status == 0; -} - -/// Parse a layer text string into an SdfData -bool -Sdf_ParseLayerFromString( - const std::string & layerString, - const std::string & magicId, - const std::string & versionString, - SdfDataRefPtr data, - SdfLayerHints *hints) -{ - TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayerFromString"); - - TRACE_FUNCTION(); - - // Configure for input string. - Sdf_TextParserContext context; - - context.data = data; - context.magicIdentifierToken = magicId; - context.versionString = versionString; - context.values.errorReporter = - std::bind(_ReportParseError, &context, std::placeholders::_1); - - // Initialize the scanner, allowing it to be reentrant. - textFileFormatYylex_init(&context.scanner); - textFileFormatYyset_extra(&context, context.scanner); - - // Run parser. - yy_buffer_state *buf = textFileFormatYy_scan_string( - layerString.c_str(), context.scanner); - int status = -1; - try { - TRACE_SCOPE("textFileFormatYyParse"); - status = textFileFormatYyparse(&context); - *hints = context.layerHints; - } catch (std::bad_variant_access const &) { - TF_CODING_ERROR("Bad variant access in layer parser."); - Err(&context, "Internal layer parser error."); - } - - // Clean up. - textFileFormatYy_delete_buffer(buf, context.scanner); - textFileFormatYylex_destroy(context.scanner); - - return status == 0; -} - diff --git a/pxr/usd/sdf/textFileFormat.tab.h b/pxr/usd/sdf/textFileFormat.tab.h deleted file mode 100644 index 483afff046..0000000000 --- a/pxr/usd/sdf/textFileFormat.tab.h +++ /dev/null @@ -1,132 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOK_NL = 258, - TOK_MAGIC = 259, - TOK_SYNTAX_ERROR = 260, - TOK_ASSETREF = 261, - TOK_PATHREF = 262, - TOK_IDENTIFIER = 263, - TOK_CXX_NAMESPACED_IDENTIFIER = 264, - TOK_NAMESPACED_IDENTIFIER = 265, - TOK_NUMBER = 266, - TOK_STRING = 267, - TOK_ABSTRACT = 268, - TOK_ADD = 269, - TOK_APPEND = 270, - TOK_CLASS = 271, - TOK_CONFIG = 272, - TOK_CONNECT = 273, - TOK_CUSTOM = 274, - TOK_CUSTOMDATA = 275, - TOK_DEF = 276, - TOK_DEFAULT = 277, - TOK_DELETE = 278, - TOK_DICTIONARY = 279, - TOK_DISPLAYUNIT = 280, - TOK_DOC = 281, - TOK_INHERITS = 282, - TOK_KIND = 283, - TOK_NAMECHILDREN = 284, - TOK_NONE = 285, - TOK_OFFSET = 286, - TOK_OVER = 287, - TOK_PERMISSION = 288, - TOK_PAYLOAD = 289, - TOK_PREFIX_SUBSTITUTIONS = 290, - TOK_SUFFIX_SUBSTITUTIONS = 291, - TOK_PREPEND = 292, - TOK_PROPERTIES = 293, - TOK_REFERENCES = 294, - TOK_RELOCATES = 295, - TOK_REL = 296, - TOK_RENAMES = 297, - TOK_REORDER = 298, - TOK_ROOTPRIMS = 299, - TOK_SCALE = 300, - TOK_SPECIALIZES = 301, - TOK_SUBLAYERS = 302, - TOK_SYMMETRYARGUMENTS = 303, - TOK_SYMMETRYFUNCTION = 304, - TOK_TIME_SAMPLES = 305, - TOK_UNIFORM = 306, - TOK_VARIANTS = 307, - TOK_VARIANTSET = 308, - TOK_VARIANTSETS = 309, - TOK_VARYING = 310 - }; -#endif - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - - - diff --git a/pxr/usd/sdf/textFileFormat.yy b/pxr/usd/sdf/textFileFormat.yy deleted file mode 100644 index dc8ee2f0d4..0000000000 --- a/pxr/usd/sdf/textFileFormat.yy +++ /dev/null @@ -1,3388 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the Apache License, Version 2.0 (the "Apache License") -// with the following modification; you may not use this file except in -// compliance with the Apache License and the following modification to it: -// Section 6. Trademarks. is deleted and replaced with: -// -// 6. Trademarks. This License does not grant permission to use the trade -// names, trademarks, service marks, or product names of the Licensor -// and its affiliates, except as required to comply with Section 4(c) of -// the License and to reproduce the content of the NOTICE file. -// -// You may obtain a copy of the Apache License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the Apache License with the above modification is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the Apache License for the specific -// language governing permissions and limitations under the Apache License. -// - -%{ - -#include "pxr/pxr.h" -#include "pxr/base/arch/errno.h" -#include "pxr/base/arch/fileSystem.h" -#include "pxr/base/vt/array.h" -#include "pxr/base/vt/dictionary.h" -#include "pxr/usd/ar/asset.h" -#include "pxr/usd/sdf/allowed.h" -#include "pxr/usd/sdf/data.h" -#include "pxr/usd/sdf/fileIO_Common.h" -#include "pxr/usd/sdf/layerOffset.h" -#include "pxr/usd/sdf/listOp.h" -#include "pxr/usd/sdf/textParserContext.h" -#include "pxr/usd/sdf/parserValueContext.h" -#include "pxr/usd/sdf/payload.h" -#include "pxr/usd/sdf/reference.h" -#include "pxr/usd/sdf/schema.h" -#include "pxr/usd/sdf/types.h" - -#include "pxr/base/trace/trace.h" - -#include "pxr/base/arch/errno.h" -#include "pxr/base/tf/enum.h" -#include "pxr/base/tf/iterator.h" -#include "pxr/base/tf/ostreamMethods.h" -#include "pxr/base/tf/stringUtils.h" -#include "pxr/base/tf/type.h" -#include "pxr/base/gf/matrix4d.h" -#include "pxr/base/tf/mallocTag.h" - -#include -#include -#include -#include - -// See this page for info as to why this is here. Especially note the last -// paragraph. http://www.delorie.com/gnu/docs/bison/bison_91.html -#define YYINITDEPTH 1500 - -PXR_NAMESPACE_USING_DIRECTIVE - -using Sdf_ParserHelpers::Value; - -//-------------------------------------------------------------------- -// Helper macros/functions for handling errors -//-------------------------------------------------------------------- - -#define ABORT_IF_ERROR(seenError) if (seenError) YYABORT -#define Err(context, ...) \ - textFileFormatYyerror(context, TfStringPrintf(__VA_ARGS__).c_str()) - -#define ERROR_IF_NOT_ALLOWED(context, allowed) \ - { \ - const SdfAllowed allow = allowed; \ - if (!allow) { \ - Err(context, "%s", allow.GetWhyNot().c_str()); \ - } \ - } - -#define ERROR_AND_RETURN_IF_NOT_ALLOWED(context, allowed) \ - { \ - const SdfAllowed allow = allowed; \ - if (!allow) { \ - Err(context, "%s", allow.GetWhyNot().c_str()); \ - return; \ - } \ - } - -//-------------------------------------------------------------------- -// Extern declarations to scanner data and functions -//-------------------------------------------------------------------- - -#define YYSTYPE Sdf_ParserHelpers::Value - -// Opaque buffer type handle. -struct yy_buffer_state; - -// Generated bison symbols. -void textFileFormatYyerror(Sdf_TextParserContext *context, const char *s); - -extern int textFileFormatYylex(YYSTYPE *yylval_param, yyscan_t yyscanner); -extern char *textFileFormatYyget_text(yyscan_t yyscanner); -extern size_t textFileFormatYyget_leng(yyscan_t yyscanner); -extern int textFileFormatYylex_init(yyscan_t *yyscanner); -extern int textFileFormatYylex_destroy(yyscan_t yyscanner); -extern void textFileFormatYyset_extra(Sdf_TextParserContext *context, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_buffer(char *yy_str, size_t size, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_string(const char *yy_str, - yyscan_t yyscanner); -extern yy_buffer_state *textFileFormatYy_scan_bytes(const char *yy_str, size_t numBytes, - yyscan_t yyscanner); -extern void textFileFormatYy_delete_buffer(yy_buffer_state *b, yyscan_t yyscanner); - -#define yyscanner context->scanner - -//-------------------------------------------------------------------- -// Helpers -//-------------------------------------------------------------------- - -static bool -_SetupValue(const std::string& typeName, Sdf_TextParserContext *context) -{ - return context->values.SetupFactory(typeName); -} - -template -static bool -_GeneralHasDuplicates(const std::vector &v) -{ - // Copy and sort to look for dupes. - std::vector copy(v); - std::sort(copy.begin(), copy.end()); - return std::adjacent_find(copy.begin(), copy.end()) != copy.end(); -} - -template -static inline bool -_HasDuplicates(const std::vector &v) -{ - // Many of the vectors we see here are either just a few elements long - // (references, payloads) or are already sorted and unique (topology - // indexes, etc). - if (v.size() <= 1) { - return false; - } - - // Many are of small size, just check all pairs. - if (v.size() <= 10) { - using iter = typename std::vector::const_iterator; - iter iend = std::prev(v.end()), jend = v.end(); - for (iter i = v.begin(); i != iend; ++i) { - for (iter j = std::next(i); j != jend; ++j) { - if (*i == *j) { - return true; - } - } - } - return false; - } - - // Check for strictly sorted order. - if (std::adjacent_find(v.begin(), v.end(), - [](T const &l, T const &r) { - return l >= r; - }) == v.end()) { - return false; - } - // Otherwise do a more expensive copy & sort to check for dupes. - return _GeneralHasDuplicates(v); -} - -namespace -{ -template -const std::vector& _ToItemVector(const std::vector& v) -{ - return v; -} -template -std::vector _ToItemVector(const VtArray& v) -{ - return std::vector(v.begin(), v.end()); -} -} - -// Set a single ListOp vector in the list op for the current -// path and specified key. -template -static void -_SetListOpItems(const TfToken &key, SdfListOpType type, - const T &itemList, Sdf_TextParserContext *context) -{ - typedef SdfListOp ListOpType; - typedef typename ListOpType::ItemVector ItemVector; - - const ItemVector& items = _ToItemVector(itemList); - - if (_HasDuplicates(items)) { - Err(context, "Duplicate items exist for field '%s' at '%s'", - key.GetText(), context->path.GetText()); - } - - ListOpType op = context->data->GetAs(context->path, key); - op.SetItems(items, type); - - context->data->Set(context->path, key, VtValue::Take(op)); -} - -// Append a single item to the vector for the current path and specified key. -template -static void -_AppendVectorItem(const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - std::vector vec = - context->data->GetAs >(context->path, key); - vec.push_back(item); - - context->data->Set(context->path, key, VtValue(vec)); -} - -inline static void -_SetDefault(const SdfPath& path, VtValue val, - Sdf_TextParserContext *context) -{ - // If is holding SdfPathExpression (or array of same), make absolute with - // path.GetPrimPath() as anchor. - if (val.IsHolding()) { - val.UncheckedMutate([&](SdfPathExpression &pe) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - }); - } - else if (val.IsHolding>()) { - val.UncheckedMutate>( - [&](VtArray &peArr) { - for (SdfPathExpression &pe: peArr) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - } - }); - } - /* - else if (val.IsHolding()) { - SdfPath valPath; - val.UncheckedSwap(valPath); - expr.MakeAbsolutePath(path.GetPrimPath()); - val.UncheckedSwap(valPath); - } - */ - context->data->Set(path, SdfFieldKeys->Default, val); -} - -template -inline static void -_SetField(const SdfPath& path, const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - context->data->Set(path, key, VtValue(item)); -} - -inline static bool -_HasField(const SdfPath& path, const TfToken& key, VtValue* value, - Sdf_TextParserContext *context) -{ - return context->data->Has(path, key, value); -} - -inline static bool -_HasSpec(const SdfPath& path, Sdf_TextParserContext *context) -{ - return context->data->HasSpec(path); -} - -inline static void -_CreateSpec(const SdfPath& path, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->data->CreateSpec(path, specType); -} - -static void -_MatchMagicIdentifier(const Value& arg1, Sdf_TextParserContext *context) -{ - const std::string cookie = TfStringTrimRight(arg1.Get()); - const std::string expected = "#" + context->magicIdentifierToken + " "; - if (TfStringStartsWith(cookie, expected)) { - if (!context->versionString.empty() && - !TfStringEndsWith(cookie, context->versionString)) { - TF_WARN("File '%s' is not the latest %s version (found '%s', " - "expected '%s'). The file may parse correctly and yield " - "incorrect results.", - context->fileContext.c_str(), - context->magicIdentifierToken.c_str(), - cookie.substr(expected.length()).c_str(), - context->versionString.c_str()); - } - } - else { - Err(context, "Magic Cookie '%s'. Expected prefix of '%s'", - TfStringTrim(cookie).c_str(), - expected.c_str()); - } -} - -static SdfPermission -_GetPermissionFromString(const std::string & str, - Sdf_TextParserContext *context) -{ - if (str == "public") { - return SdfPermissionPublic; - } else if (str == "private") { - return SdfPermissionPrivate; - } else { - Err(context, "'%s' is not a valid permission constant", str.c_str()); - return SdfPermissionPublic; - } -} - -static TfEnum -_GetDisplayUnitFromString(const std::string & name, - Sdf_TextParserContext *context) -{ - const TfEnum &unit = SdfGetUnitFromName(name); - if (unit == TfEnum()) { - Err(context, "'%s' is not a valid display unit", name.c_str()); - } - return unit; -} - -static void -_ValueAppendAtomic(const Value& arg1, Sdf_TextParserContext *context) -{ - context->values.AppendValue(arg1); -} - -static void -_ValueSetAtomic(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - Err(context, "Type name has [] for non-shaped value!\n"); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue.IsEmpty()) { - Err(context, "Error parsing simple value: %s", errStr.c_str()); - return; - } -} - -static void -_PrimSetInheritListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->inheritParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting inherit paths to None (or empty list) is only allowed " - "when setting explicit inherit paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->inheritParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidInheritPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->InheritPaths, opType, - context->inheritParsingTargetPaths, context); -} - -static void -_InheritAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Inherit paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->inheritParsingTargetPaths.push_back(absPath); -} - -static void -_PrimSetSpecializesListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->specializesParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting specializes paths to None (or empty list) is only allowed " - "when setting explicit specializes paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->specializesParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidSpecializesPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->Specializes, opType, - context->specializesParsingTargetPaths, context); -} - -static void -_SpecializesAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Specializes paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->specializesParsingTargetPaths.push_back(absPath); -} - -static void -_PrimSetReferenceListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->referenceParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting references to None (or an empty list) is only allowed " - "when setting explicit references, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->referenceParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidReference(*ref)); - } - - _SetListOpItems(SdfFieldKeys->References, opType, - context->referenceParsingRefs, context); -} - -static void -_PrimSetPayloadListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->payloadParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting payload to None (or an empty list) is only allowed " - "when setting explicit payloads, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->payloadParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidPayload(*ref)); - } - - _SetListOpItems(SdfFieldKeys->Payload, opType, - context->payloadParsingRefs, context); -} - -static void -_PrimSetVariantSetNamesListItems(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - std::vector names; - names.reserve(context->nameVector.size()); - TF_FOR_ALL(name, context->nameVector) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantIdentifier(*name)); - names.push_back(name->GetText()); - } - - _SetListOpItems(SdfFieldKeys->VariantSetNames, opType, names, context); - - // If the op type is added or explicit, create the variant sets - if (opType == SdfListOpTypeAdded || opType == SdfListOpTypeExplicit) { - TF_FOR_ALL(i, context->nameVector) { - _CreateSpec( - context->path.AppendVariantSelection(*i,""), - SdfSpecTypeVariantSet, context); - } - - _SetField( - context->path, SdfChildrenKeys->VariantSetChildren, - context->nameVector, context); - } - -} - -static void -_RelationshipInitTarget(const SdfPath& targetPath, - Sdf_TextParserContext *context) -{ - SdfPath path = context->path.AppendTarget(targetPath); - - if (!_HasSpec(path, context)) { - // Create relationship target spec by setting the appropriate - // object type flag. - _CreateSpec(path, SdfSpecTypeRelationshipTarget, context); - - // Add the target path to the owning relationship's list of target - // children. - context->relParsingNewTargetChildren.push_back(targetPath); - } -} - -static void -_RelationshipSetTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (!context->relParsingTargetPaths) { - // No target paths were encountered. - return; - } - - if (context->relParsingTargetPaths->empty() && - opType != SdfListOpTypeExplicit) { - Err(context, - "Setting relationship targets to None (or empty list) is only " - "allowed when setting explicit targets, not for list editing"); - return; - } - - TF_FOR_ALL(path, *context->relParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidRelationshipTargetPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - // Initialize relationship target specs for each target path that - // is added in this layer. - TF_FOR_ALL(pathIter, *context->relParsingTargetPaths) { - _RelationshipInitTarget(*pathIter, context); - } - } - - _SetListOpItems(SdfFieldKeys->TargetPaths, opType, - *context->relParsingTargetPaths, context); -} - -static void -_PrimSetVariantSelection(Sdf_TextParserContext *context) -{ - SdfVariantSelectionMap refVars; - - // The previous parser implementation allowed multiple variant selection - // dictionaries in prim metadata to be merged, so we do the same here. - VtValue oldVars; - if (_HasField( - context->path, SdfFieldKeys->VariantSelection, &oldVars, context)) { - refVars = oldVars.Get(); - } - - TF_FOR_ALL(it, context->currentDictionaries[0]) { - if (!it->second.IsHolding()) { - Err(context, "variant name must be a string"); - return; - } else { - const std::string variantName = it->second.Get(); - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantSelection(variantName)); - - refVars[it->first] = variantName; - } - } - - _SetField(context->path, SdfFieldKeys->VariantSelection, refVars, context); - context->currentDictionaries[0].clear(); -} - -static void -_RelocatesAdd(const Value& arg1, const Value& arg2, - Sdf_TextParserContext *context) -{ - const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { - Err(context, "'%s' is not a valid relocates path", - srcStr.c_str()); - return; - } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - Err(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. - srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); - - context->layerHints.mightHaveRelocates = true; -} - -static void -_AttributeSetConnectionTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (context->connParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - Err(context, "Setting connection paths to None (or an empty list) " - "is only allowed when setting explicit connection paths, " - "not for list editing"); - return; - } - - TF_FOR_ALL(path, context->connParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidAttributeConnectionPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - TF_FOR_ALL(pathIter, context->connParsingTargetPaths) { - SdfPath path = context->path.AppendTarget(*pathIter); - if (!_HasSpec(path, context)) { - _CreateSpec(path, SdfSpecTypeConnection, context); - } - } - - _SetField( - context->path, SdfChildrenKeys->ConnectionChildren, - context->connParsingTargetPaths, context); - } - - _SetListOpItems(SdfFieldKeys->ConnectionPaths, opType, - context->connParsingTargetPaths, context); -} - -static void -_AttributeAppendConnectionPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Connection paths never point into the variant namespace. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - // XXX Workaround for bug 68132: - // Prior to the fix to bug 67916, FilterGenVariantBase was authoring - // invalid connection paths containing variant selections (which - // Sd was failing to report as erroneous). As a result, there's - // a fair number of assets out there with these broken forms of - // connection paths. As a migration measure, we discard those - // variant selections here. - if (absPath.ContainsPrimVariantSelection()) { - TF_WARN("Connection path <%s> (in file @%s@, line %i) has a variant " - "selection, but variant selections are not meaningful in " - "connection paths. Stripping the variant selection and " - "using <%s> instead. Resaving the file will fix this issue.", - absPath.GetText(), - context->fileContext.c_str(), - context->sdfLineNo, - absPath.StripAllVariantSelections().GetText()); - absPath = absPath.StripAllVariantSelections(); - } - - context->connParsingTargetPaths.push_back(absPath); -} - -static void -_PrimInitAttribute(const Value &arg1, Sdf_TextParserContext *context) -{ - TfToken name(arg1.Get()); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - Err(context, "'%s' is not a valid attribute name", name.GetText()); - } - - context->path = context->path.AppendProperty(name); - - // If we haven't seen this attribute before, then set the object type - // and add it to the parent's list of properties. Otherwise both have - // already been done, so we don't need to do anything. - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeAttribute, context); - _SetField(context->path, SdfFieldKeys->Custom, false, context); - } - - if(context->custom) - _SetField(context->path, SdfFieldKeys->Custom, true, context); - - // If the type was previously set, check that it matches. Otherwise set it. - const TfToken newType(context->values.valueTypeName); - - VtValue oldTypeValue; - if (_HasField( - context->path, SdfFieldKeys->TypeName, &oldTypeValue, context)) { - const TfToken& oldType = oldTypeValue.Get(); - - if (newType != oldType) { - Err(context, - "attribute '%s' already has type '%s', cannot change to '%s'", - context->path.GetName().c_str(), - oldType.GetText(), - newType.GetText()); - } - } - else { - _SetField(context->path, SdfFieldKeys->TypeName, newType, context); - } - - // If the variability was previously set, check that it matches. Otherwise - // set it. If the 'variability' VtValue is empty, that indicates varying - // variability. - SdfVariability variability = context->variability.IsEmpty() ? - SdfVariabilityVarying : context->variability.Get(); - VtValue oldVariability; - if (_HasField( - context->path, SdfFieldKeys->Variability, &oldVariability, - context)) { - if (variability != oldVariability.Get()) { - Err(context, - "attribute '%s' already has variability '%s', " - "cannot change to '%s'", - context->path.GetName().c_str(), - TfEnum::GetName(oldVariability.Get()).c_str(), - TfEnum::GetName(variability).c_str() ); - } - } else { - _SetField( - context->path, SdfFieldKeys->Variability, variability, context); - } -} - -static void -_DictionaryBegin(Sdf_TextParserContext *context) -{ - context->currentDictionaries.push_back(VtDictionary()); - - // Whenever we parse a value for an unregistered generic metadata field, - // the parser value context records the string representation only, because - // we don't have enough type information to generate a C++ value. However, - // dictionaries are a special case because we have all the type information - // we need to generate C++ values. So, override the previous setting. - if (context->values.IsRecordingString()) { - context->values.StopRecordingString(); - } -} - -static void -_DictionaryEnd(Sdf_TextParserContext *context) -{ - context->currentDictionaries.pop_back(); -} - -static void -_DictionaryInsertValue(const Value& arg1, Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - context->currentDictionaries[n-2][arg1.Get()] = - context->currentValue; -} - -static void -_DictionaryInsertDictionary(const Value& arg1, - Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - // Insert the parsed dictionary into the parent dictionary. - context->currentDictionaries[n-2][arg1.Get()].Swap( - context->currentDictionaries[n-1]); - // Clear out the last dictionary (there can be more dictionaries on the - // same nesting level). - context->currentDictionaries[n-1].clear(); -} - -static void -_DictionaryInitScalarFactory(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& typeName = arg1.Get(); - if (!_SetupValue(typeName, context)) { - Err(context, "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); - } -} - -static void -_DictionaryInitShapedFactory(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string typeName = arg1.Get() + "[]"; - if (!_SetupValue(typeName, context)) { - Err(context, "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); - } -} - -static void -_ValueSetTuple(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - Err(context, "Type name has [] for non-shaped value.\n"); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - Err(context, "Error parsing tuple value: %s", errStr.c_str()); - return; - } -} - -static void -_ValueSetList(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - Err(context, "Type name missing [] for shaped value."); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - Err(context, "Error parsing shaped value: %s", errStr.c_str()); - return; - } -} - -static void -_ValueSetShaped(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - Err(context, "Type name missing [] for shaped value."); - return; - } - } - - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - // The factory method ProduceValue() uses for shaped types - // only returns empty VtArrays, not empty VtValues, so this - // is impossible to hit currently. - // CODE_COVERAGE_OFF - Err(context, "Error parsing shaped value: %s", errStr.c_str()); - // CODE_COVERAGE_OFF_GCOV_BUG - // The following line actually shows as executed (a ridiculous - // number of times) even though the line above shwos as - // not executed - return; - // CODE_COVERAGE_ON_GCOV_BUG - // CODE_COVERAGE_ON - } -} - -static void _ValueSetCurrentToSdfPath(const Value& arg1, - Sdf_TextParserContext *context) -{ - // make current Value an SdfPath of the given argument... - std::string s = arg1.Get(); - // If path is empty, use default c'tor to construct empty path. - // XXX: 08/04/08 Would be nice if SdfPath would allow - // SdfPath("") without throwing a warning. - context->currentValue = s.empty() ? SdfPath() : SdfPath(s); -} - -static void -_PrimInitRelationship(const Value& arg1, - Sdf_TextParserContext *context) -{ - TfToken name( arg1.Get() ); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - Err(context, "'%s' is not a valid relationship name", name.GetText()); - return; - } - - context->path = context->path.AppendProperty(name); - - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeRelationship, context); - } - - _SetField( - context->path, SdfFieldKeys->Variability, - context->variability, context); - - if (context->custom) { - _SetField(context->path, SdfFieldKeys->Custom, context->custom, context); - } - - context->relParsingAllowTargetData = false; - context->relParsingTargetPaths.reset(); - context->relParsingNewTargetChildren.clear(); -} - -static void -_PrimEndRelationship(Sdf_TextParserContext *context) -{ - if (!context->relParsingNewTargetChildren.empty()) { - std::vector children = - context->data->GetAs >( - context->path, SdfChildrenKeys->RelationshipTargetChildren); - - children.insert(children.end(), - context->relParsingNewTargetChildren.begin(), - context->relParsingNewTargetChildren.end()); - - _SetField( - context->path, SdfChildrenKeys->RelationshipTargetChildren, - children, context); - } - - context->path = context->path.GetParentPath(); -} - -static void -_RelationshipAppendTargetPath(const Value& arg1, - Sdf_TextParserContext *context) -{ - // Add a new target to the current relationship - const std::string& pathStr = arg1.Get(); - SdfPath path(pathStr); - - if (!path.IsAbsolutePath()) { - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Target paths never point into the variant namespace. - path = path.MakeAbsolutePath(context->path.GetPrimPath()); - } - - if (!context->relParsingTargetPaths) { - // This is the first target we've seen for this relationship. - // Start tracking them in a vector. - context->relParsingTargetPaths = SdfPathVector(); - } - context->relParsingTargetPaths->push_back(path); -} - -static void -_PathSetPrim(const Value& arg1, Sdf_TextParserContext *context) -{ - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - if (!context->savedPath.IsPrimPath()) { - Err(context, "'%s' is not a valid prim path", pathStr.c_str()); - } -} - -static void -_PathSetPrimOrPropertyScenePath(const Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - // Valid paths are prim or property paths that do not contain variant - // selections. - SdfPath const &path = context->savedPath; - bool pathValid = (path.IsPrimPath() || path.IsPropertyPath()) && - !path.ContainsPrimVariantSelection(); - if (!pathValid) { - Err(context, "'%s' is not a valid prim or property scene path", - pathStr.c_str()); - } -} - -template -static bool -_SetItemsIfListOp(const TfType& type, Sdf_TextParserContext *context) -{ - if (!type.IsA()) { - return false; - } - - typedef VtArray ArrayType; - - if (!TF_VERIFY(context->currentValue.IsHolding() || - context->currentValue.IsEmpty())) { - return true; - } - - ArrayType vtArray; - if (context->currentValue.IsHolding()) { - vtArray = context->currentValue.UncheckedGet(); - } - - _SetListOpItems( - context->genericMetadataKey, context->listOpType, vtArray, context); - return true; -} - -static void -_SetGenericMetadataListOpItems(const TfType& fieldType, - Sdf_TextParserContext *context) -{ - // Chain together attempts to set list op items using 'or' to bail - // out as soon as we successfully write out the list op we're holding. - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context); -} - -template -static std::pair -_GetListOpAndArrayTfTypes() { - return { - TfType::Find(), - TfType::Find>() - }; -} - -static bool -_IsGenericMetadataListOpType(const TfType& type, - TfType* itemArrayType = nullptr) -{ - static std::pair listOpAndArrayTypes[] = { - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - }; - - auto iter = std::find_if(std::begin(listOpAndArrayTypes), - std::end(listOpAndArrayTypes), - [&type](auto const &p) { - return p.first == type; - }); - - if (iter == std::end(listOpAndArrayTypes)) { - return false; - } - - if (itemArrayType) { - *itemArrayType = iter->second; - } - - return true; -} - -static void -_GenericMetadataStart(const Value &name, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->genericMetadataKey = TfToken(name.Get()); - context->listOpType = SdfListOpTypeExplicit; - - const SdfSchema& schema = SdfSchema::GetInstance(); - const SdfSchema::SpecDefinition &specDef = - *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { - // Prepare to parse a known field - const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); - const TfType fieldType = fieldDef.GetFallbackValue().GetType(); - - // For list op-valued metadata fields, set up the parser as if - // we were parsing an array of the list op's underlying type. - // In _GenericMetadataEnd, we'll produce this list and set it - // into the appropriate place in the list op. - TfType itemArrayType; - if (_IsGenericMetadataListOpType(fieldType, &itemArrayType)) { - _SetupValue(schema.FindType(itemArrayType). - GetAsToken().GetString(), context); - } - else { - _SetupValue(schema.FindType(fieldDef.GetFallbackValue()). - GetAsToken().GetString(), context); - } - } else { - // Prepare to parse only the string representation of this metadata - // value, since it's an unregistered field. - context->values.StartRecordingString(); - } -} - -static void -_GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) -{ - const SdfSchema& schema = SdfSchema::GetInstance(); - const SdfSchema::SpecDefinition &specDef = - *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { - // Validate known fields before storing them - const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); - const TfType fieldType = fieldDef.GetFallbackValue().GetType(); - - if (_IsGenericMetadataListOpType(fieldType)) { - if (!fieldDef.IsValidListValue(context->currentValue)) { - Err(context, "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); - } - else { - _SetGenericMetadataListOpItems(fieldType, context); - } - } - else { - if (!fieldDef.IsValidValue(context->currentValue) || - context->currentValue.IsEmpty()) { - Err(context, "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); - } - else { - _SetField( - context->path, context->genericMetadataKey, - context->currentValue, context); - } - } - } else if (specDef.IsValidField(context->genericMetadataKey)) { - // Prevent the user from overwriting fields that aren't metadata - Err(context, "\"%s\" is registered as a non-metadata field", - context->genericMetadataKey.GetText()); - } else { - // Stuff unknown fields into a SdfUnregisteredValue so they can pass - // through loading and saving unmodified - VtValue value; - if (context->currentValue.IsHolding()) { - // If we parsed a dictionary, store it's actual value. Dictionaries - // can be parsed fully because they contain type information. - value = - SdfUnregisteredValue(context->currentValue.Get()); - } else { - // Otherwise, we parsed a simple value or a shaped list of simple - // values. We want to store the parsed string, but we need to - // determine whether to unpack it into an SdfUnregisteredListOp - // or to just store the string directly. - auto getOldValue = [context]() { - VtValue v; - if (_HasField(context->path, context->genericMetadataKey, - &v, context) - && TF_VERIFY(v.IsHolding())) { - v = v.UncheckedGet().GetValue(); - } - else { - v = VtValue(); - } - return v; - }; - - auto getRecordedStringAsUnregisteredValue = [context]() { - std::string s = context->values.GetRecordedString(); - if (s == "None") { - return std::vector(); - } - - // Put the entire string representation of this list into - // a single SdfUnregisteredValue, but strip off the enclosing - // brackets so that we don't write out two sets of brackets - // when serializing out the list op. - if (!s.empty() && s.front() == '[') { s.erase(0, 1); } - if (!s.empty() && s.back() == ']') { s.pop_back(); } - return std::vector( - { SdfUnregisteredValue(s) }); - }; - - VtValue oldValue = getOldValue(); - if (context->listOpType == SdfListOpTypeExplicit) { - // In this case, we can't determine whether the we've parsed - // an explicit list op statement or a simple value. - // We just store the recorded string directly, as that's the - // simplest thing to do. - value = - SdfUnregisteredValue(context->values.GetRecordedString()); - } - else if (oldValue.IsEmpty() - || oldValue.IsHolding()) { - // In this case, we've parsed a list op statement so unpack - // it into a list op unless we've already parsed something - // for this field that *isn't* a list op. - SdfUnregisteredValueListOp listOp = - oldValue.GetWithDefault(); - listOp.SetItems(getRecordedStringAsUnregisteredValue(), - context->listOpType); - value = SdfUnregisteredValue(listOp); - } - else { - // If we've parsed a list op statement but have a non-list op - // stored in this field, leave that value in place and ignore - // the new value. We should only encounter this case if someone - // hand-edited the layer in an unexpected or invalid way, so - // just keeping the first value we find should be OK. - } - } - - if (!value.IsEmpty()) { - _SetField(context->path, context->genericMetadataKey, - value, context); - } - } - - context->values.Clear(); - context->currentValue = VtValue(); -} - -//-------------------------------------------------------------------- -// The following are used to configure bison -//-------------------------------------------------------------------- - -// Use this to enable generation of parser trace code. -// Useful when debugging, but costly. To enable/disable, (un)comment: -//#define SDF_PARSER_DEBUG_MODE - -#ifdef SDF_PARSER_DEBUG_MODE -#define YYDEBUG 1 -#endif // SDF_PARSER_DEBUG_MODE - -%} - -// Make this re-entrant -%define api.pure -%lex-param { yyscan_t yyscanner } -%parse-param { Sdf_TextParserContext *context } - -//-------------------------------------------------------------------- -// Define our tokens and types -//-------------------------------------------------------------------- - -%token TOK_NL -%token TOK_MAGIC -%token TOK_SYNTAX_ERROR - -// Basic lexed data types -%token TOK_ASSETREF -%token TOK_PATHREF -%token TOK_IDENTIFIER -%token TOK_CXX_NAMESPACED_IDENTIFIER -%token TOK_NAMESPACED_IDENTIFIER -%token TOK_NUMBER -%token TOK_STRING - -// Keywords -// -// NOTE! If you add any keywords or literal tokens here, be sure to add -// them to the 'keyword' production rule below. -%token TOK_ABSTRACT -%token TOK_ADD -%token TOK_APPEND -%token TOK_CLASS -%token TOK_CONFIG -%token TOK_CONNECT -%token TOK_CUSTOM -%token TOK_CUSTOMDATA -%token TOK_DEF -%token TOK_DEFAULT -%token TOK_DELETE -%token TOK_DICTIONARY -%token TOK_DISPLAYUNIT -%token TOK_DOC -%token TOK_INHERITS -%token TOK_KIND -%token TOK_NAMECHILDREN -%token TOK_NONE -%token TOK_OFFSET -%token TOK_OVER -%token TOK_PERMISSION -%token TOK_PAYLOAD -%token TOK_PREFIX_SUBSTITUTIONS -%token TOK_SUFFIX_SUBSTITUTIONS -%token TOK_PREPEND -%token TOK_PROPERTIES -%token TOK_REFERENCES -%token TOK_RELOCATES -%token TOK_REL -%token TOK_RENAMES -%token TOK_REORDER -%token TOK_ROOTPRIMS -%token TOK_SCALE -%token TOK_SPECIALIZES -%token TOK_SUBLAYERS -%token TOK_SYMMETRYARGUMENTS -%token TOK_SYMMETRYFUNCTION -%token TOK_TIME_SAMPLES -%token TOK_UNIFORM -%token TOK_VARIANTS -%token TOK_VARIANTSET -%token TOK_VARIANTSETS -%token TOK_VARYING - -%% - -// The first, root production rule -sdf_file: - layer - -keyword: - TOK_ABSTRACT - | TOK_ADD - | TOK_APPEND - | TOK_CLASS - | TOK_CONFIG - | TOK_CONNECT - | TOK_CUSTOM - | TOK_CUSTOMDATA - | TOK_DEF - | TOK_DEFAULT - | TOK_DELETE - | TOK_DICTIONARY - | TOK_DISPLAYUNIT - | TOK_DOC - | TOK_INHERITS - | TOK_KIND - | TOK_NAMECHILDREN - | TOK_NONE - | TOK_OFFSET - | TOK_OVER - | TOK_PAYLOAD - | TOK_PERMISSION - | TOK_PREFIX_SUBSTITUTIONS - | TOK_SUFFIX_SUBSTITUTIONS - | TOK_PREPEND - | TOK_PROPERTIES - | TOK_REFERENCES - | TOK_RELOCATES - | TOK_REL - | TOK_RENAMES - | TOK_REORDER - | TOK_ROOTPRIMS - | TOK_SCALE - | TOK_SPECIALIZES - | TOK_SUBLAYERS - | TOK_SYMMETRYARGUMENTS - | TOK_SYMMETRYFUNCTION - | TOK_TIME_SAMPLES - | TOK_UNIFORM - | TOK_VARIANTS - | TOK_VARIANTSET - | TOK_VARIANTSETS - | TOK_VARYING - ; - -//-------------------------------------------------------------------- -// Layer Structure -//-------------------------------------------------------------------- - -layer_metadata_form: - layer_metadata_opt - | layer_metadata_opt prim_list newlines_opt { - - // Store the names of the root prims. - _SetField( - SdfPath::AbsoluteRootPath(), SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - context->nameChildrenStack.pop_back(); - } - ; - -layer: - TOK_MAGIC { - _MatchMagicIdentifier($1, context); - context->nameChildrenStack.push_back(std::vector()); - - _CreateSpec( - SdfPath::AbsoluteRootPath(), SdfSpecTypePseudoRoot, context); - - ABORT_IF_ERROR(context->seenError); - } layer_metadata_form - ; - -layer_metadata_opt: - newlines_opt { - // If we're only reading metadata and we got here, - // we're done. - if (context->metadataOnly) - YYACCEPT; - } - | newlines_opt '(' layer_metadata_list_opt ')' newlines_opt { - // Abort if error after layer metadata. - ABORT_IF_ERROR(context->seenError); - - // If we're only reading metadata and we got here, - // we're done. - if (context->metadataOnly) - YYACCEPT; - } - ; - -layer_metadata_list_opt: - newlines_opt - | newlines_opt layer_metadata_list stmtsep_opt - ; - -layer_metadata_list: - layer_metadata - | layer_metadata_list stmtsep layer_metadata - ; - -layer_metadata_key: - identifier - ; - -layer_metadata: - TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Comment, - $1.Get(), context); - } - | layer_metadata_key { - _GenericMetadataStart($1, SdfSpecTypePseudoRoot, context); - } '=' metadata_value { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - // Handling for generic metadata fields that use list ops. - // Note that handling of the 'explicit' list op type is done - // in the generic metadata clause above, since there is no - // marker that the parser can use to recognize that case. - | TOK_DELETE identifier { - _GenericMetadataStart($2, SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeDeleted; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - | TOK_ADD identifier { - _GenericMetadataStart($2, SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeAdded; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - | TOK_PREPEND identifier { - _GenericMetadataStart($2, SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypePrepended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - | TOK_APPEND identifier { - _GenericMetadataStart($2, SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeAppended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - | TOK_REORDER identifier { - _GenericMetadataStart($2, SdfSpecTypePseudoRoot, context); - context->listOpType = SdfListOpTypeOrdered; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePseudoRoot, context); - } - // Not parsed with generic metadata because: key name changes from "doc" to - // "documentation" - | TOK_DOC '=' TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Documentation, - $3.Get(), context); - } - // Not parsed with generic metadata because: uses special Python-like - // dictionary syntax with paths - | TOK_RELOCATES '=' relocates_map { - _SetField( - context->path, SdfFieldKeys->LayerRelocates, - context->relocatesParsing, context); - context->relocatesParsing.clear(); - } - // Not parsed with generic metadata because: actually maps to two values - // instead of one - | TOK_SUBLAYERS '=' sublayer_list - ; - -sublayer_list: - '[' newlines_opt ']' - | '[' newlines_opt sublayer_list_int listsep_opt ']' { - _SetField( - SdfPath::AbsoluteRootPath(), SdfFieldKeys->SubLayers, - context->subLayerPaths, context); - _SetField( - SdfPath::AbsoluteRootPath(), SdfFieldKeys->SubLayerOffsets, - context->subLayerOffsets, context); - - context->subLayerPaths.clear(); - context->subLayerOffsets.clear(); - } - ; - -sublayer_list_int: - sublayer_stmt - | sublayer_list_int listsep sublayer_stmt - ; - -sublayer_stmt: - layer_ref layer_offset_opt { - context->subLayerPaths.push_back(context->layerRefPath); - context->subLayerOffsets.push_back(context->layerRefOffset); - ABORT_IF_ERROR(context->seenError); - } - ; - -layer_ref: - TOK_ASSETREF { - context->layerRefPath = $1.Get(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - } - ; - -layer_offset_opt: - /* empty */ - | '(' layer_offset_int stmtsep_opt ')' - ; - -layer_offset_int: - layer_offset_stmt - | layer_offset_int stmtsep layer_offset_stmt - ; - -layer_offset_stmt: - TOK_OFFSET '=' TOK_NUMBER { - context->layerRefOffset.SetOffset( $3.Get() ); - ABORT_IF_ERROR(context->seenError); - } - | TOK_SCALE '=' TOK_NUMBER { - context->layerRefOffset.SetScale( $3.Get() ); - ABORT_IF_ERROR(context->seenError); - } - ; - -prim_list: - prim_stmt - | prim_list newlines prim_stmt - ; - -//-------------------------------------------------------------------- -// Prim Structure -//-------------------------------------------------------------------- - -prim_stmt: - TOK_DEF { - context->specifier = SdfSpecifierDef; - context->typeName = TfToken(); - } prim_stmt_int - | TOK_DEF prim_type_name { - context->specifier = SdfSpecifierDef; - context->typeName = TfToken($2.Get()); - } prim_stmt_int - | TOK_CLASS { - context->specifier = SdfSpecifierClass; - context->typeName = TfToken(); - } prim_stmt_int - | TOK_CLASS prim_type_name { - context->specifier = SdfSpecifierClass; - context->typeName = TfToken($2.Get()); - } prim_stmt_int - | TOK_OVER { - context->specifier = SdfSpecifierOver; - context->typeName = TfToken(); - } prim_stmt_int - | TOK_OVER prim_type_name { - context->specifier = SdfSpecifierOver; - context->typeName = TfToken($2.Get()); - } prim_stmt_int - | TOK_REORDER TOK_ROOTPRIMS '=' name_list { - _SetField( - context->path, SdfFieldKeys->PrimOrder, - context->nameVector, context); - context->nameVector.clear(); - } - ; - -/* need support for fully qualified python identifiers */ -prim_type_name : - identifier { $$ = $1; } - | prim_type_name '.' identifier { - $$ = std::string( $1.Get() + '.' - + $3.Get() ); - } - ; - -prim_stmt_int: - TOK_STRING { - TfToken name($1.Get()); - if (!SdfPath::IsValidIdentifier(name)) { - Err(context, "'%s' is not a valid prim name", name.GetText()); - } - context->path = context->path.AppendChild(name); - - if (_HasSpec(context->path, context)) { - Err(context, "Duplicate prim '%s'", context->path.GetText()); - } else { - // Record the existence of this prim. - _CreateSpec(context->path, SdfSpecTypePrim, context); - - // Add this prim to its parent's name children - context->nameChildrenStack.back().push_back(name); - } - - // Create our name children vector and properties vector. - context->nameChildrenStack.push_back(std::vector()); - context->propertiesStack.push_back(std::vector()); - - _SetField( - context->path, SdfFieldKeys->Specifier, - context->specifier, context); - - if (!context->typeName.IsEmpty()) - _SetField( - context->path, SdfFieldKeys->TypeName, - context->typeName, context); - } - prim_metadata_opt - '{' - prim_contents_list_opt - '}' { - // Store the names of our children - if (!context->nameChildrenStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - } - - // Store the names of our properties, if there are any - if (!context->propertiesStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PropertyChildren, - context->propertiesStack.back(), context); - } - - context->nameChildrenStack.pop_back(); - context->propertiesStack.pop_back(); - context->path = context->path.GetParentPath(); - - // Abort after each prim if we hit an error. - ABORT_IF_ERROR(context->seenError); - } - ; - -// Prim Metadata - -prim_metadata_opt: - newlines_opt - | newlines_opt '(' prim_metadata_list_opt ')' newlines_opt - ; - -prim_metadata_list_opt: - newlines_opt - | newlines_opt prim_metadata_list stmtsep_opt - ; - -prim_metadata_list: - prim_metadata - | prim_metadata_list stmtsep prim_metadata - ; - -prim_metadata_key: - identifier - | TOK_CUSTOMDATA - | TOK_SYMMETRYARGUMENTS - ; - -prim_metadata: - TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Comment, - $1.Get(), context); - } - | prim_metadata_key { - _GenericMetadataStart($1, SdfSpecTypePrim, context); - } '=' metadata_value { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - // Handling for generic metadata fields that use list ops. - // Note that handling of the 'explicit' list op type is done - // in the generic metadata clause above, since there is no - // marker that the parser can use to recognize that case. - | TOK_DELETE identifier { - _GenericMetadataStart($2, SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeDeleted; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - | TOK_ADD identifier { - _GenericMetadataStart($2, SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeAdded; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - | TOK_PREPEND identifier { - _GenericMetadataStart($2, SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypePrepended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - | TOK_APPEND identifier { - _GenericMetadataStart($2, SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeAppended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - | TOK_REORDER identifier { - _GenericMetadataStart($2, SdfSpecTypePrim, context); - context->listOpType = SdfListOpTypeOrdered; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypePrim, context); - } - // Not parsed with generic metadata because: key name changes from "doc" to - // "documentation" - | TOK_DOC '=' TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Documentation, - $3.Get(), context); - } - // Not parsed with generic metadata because: value is parsed as a string - // but stored as a token - | TOK_KIND '=' TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Kind, - TfToken($3.Get()), context); - } - // Not parsed with generic metadata because: has shortcut names like - // "public" instead of SdfPermissionPublic - | TOK_PERMISSION '=' identifier { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString($3.Get(), context), - context); - } - // Not parsed with generic metadata because: SdfListOp is not supported - | TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypeExplicit, context); - } - | TOK_DELETE TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypeDeleted, context); - } - | TOK_ADD TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypeAdded, context); - } - | TOK_PREPEND TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypePrepended, context); - } - | TOK_APPEND TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypeAppended, context); - } - | TOK_REORDER TOK_PAYLOAD { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->payloadParsingRefs.clear(); - } '=' payload_list { - _PrimSetPayloadListItems(SdfListOpTypeOrdered, context); - } - // Not parsed with generic metadata because: SdfListOp is not supported - | TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypeExplicit, context); - } - | TOK_DELETE TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypeDeleted, context); - } - | TOK_ADD TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypeAdded, context); - } - | TOK_PREPEND TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypePrepended, context); - } - | TOK_APPEND TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypeAppended, context); - } - | TOK_REORDER TOK_INHERITS { - context->inheritParsingTargetPaths.clear(); - } '=' inherit_list { - _PrimSetInheritListItems(SdfListOpTypeOrdered, context); - } - // Not parsed with generic metadata because: SdfListOp is not supported - | TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypeExplicit, context); - } - | TOK_DELETE TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypeDeleted, context); - } - | TOK_ADD TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypeAdded, context); - } - | TOK_PREPEND TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypePrepended, context); - } - | TOK_APPEND TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypeAppended, context); - } - | TOK_REORDER TOK_SPECIALIZES { - context->specializesParsingTargetPaths.clear(); - } '=' specializes_list { - _PrimSetSpecializesListItems(SdfListOpTypeOrdered, context); - } - // Not parsed with generic metadata because: SdfListOp is not supported - | TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypeExplicit, context); - } - | TOK_DELETE TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypeDeleted, context); - } - | TOK_ADD TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypeAdded, context); - } - | TOK_PREPEND TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypePrepended, context); - } - | TOK_APPEND TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypeAppended, context); - } - | TOK_REORDER TOK_REFERENCES { - context->layerRefPath = std::string(); - context->savedPath = SdfPath(); - context->referenceParsingRefs.clear(); - } '=' reference_list { - _PrimSetReferenceListItems(SdfListOpTypeOrdered, context); - } - // Not parsed with generic metadata because: uses special Python-like - // dictionary syntax with paths - | TOK_RELOCATES '=' relocates_map { - SdfRelocatesMap relocatesParsingMap( - std::make_move_iterator(context->relocatesParsing.begin()), - std::make_move_iterator(context->relocatesParsing.end())); - context->relocatesParsing.clear(); - _SetField( - context->path, SdfFieldKeys->Relocates, - relocatesParsingMap, context); - } - // Not parsed with generic metadata because: multiple definitions are - // merged into one dictionary instead of overwriting previous definitions - | TOK_VARIANTS '=' typed_dictionary { - _PrimSetVariantSelection(context); - } - // Not parsed with generic metadata because: SdfListOp is not supported - | TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypeExplicit, context); - context->nameVector.clear(); - } - | TOK_DELETE TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypeDeleted, context); - context->nameVector.clear(); - } - | TOK_ADD TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypeAdded, context); - context->nameVector.clear(); - } - | TOK_PREPEND TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypePrepended, context); - context->nameVector.clear(); - } - | TOK_APPEND TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypeAppended, context); - context->nameVector.clear(); - } - | TOK_REORDER TOK_VARIANTSETS '=' name_list { - _PrimSetVariantSetNamesListItems(SdfListOpTypeOrdered, context); - context->nameVector.clear(); - } - // Not parsed with generic metadata because: allows assignment to an empty - // string by omitting the value - | TOK_SYMMETRYFUNCTION '=' identifier { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken($3.Get()), context); - } - | TOK_SYMMETRYFUNCTION '=' { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - } - // Not parsed with generic metadata because: uses special Python-like - // dictionary syntax - | TOK_PREFIX_SUBSTITUTIONS '=' string_dictionary { - _SetField( - context->path, SdfFieldKeys->PrefixSubstitutions, - context->currentDictionaries[0], context); - context->currentDictionaries[0].clear(); - } - // Not parsed with generic metadata because: uses special Python-like - // dictionary syntax - | TOK_SUFFIX_SUBSTITUTIONS '=' string_dictionary { - _SetField( - context->path, SdfFieldKeys->SuffixSubstitutions, - context->currentDictionaries[0], context); - context->currentDictionaries[0].clear(); - } - ; - -payload_list: - TOK_NONE - | payload_list_item - | '[' newlines_opt ']' - | '[' newlines_opt payload_list_int listsep_opt ']' - ; - -payload_list_int: - payload_list_item - | payload_list_int listsep payload_list_item - ; - -payload_list_item: - layer_ref prim_path_opt payload_params_opt { - if (context->layerRefPath.empty()) { - Err(context, "Payload asset path must not be empty. If this " - "is intended to be an internal payload, remove the " - "'@' delimiters."); - } - - SdfPayload payload(context->layerRefPath, - context->savedPath, - context->layerRefOffset); - context->payloadParsingRefs.push_back(payload); - } - | TOK_PATHREF { - // Internal payloads do not begin with an asset path so there's - // no layer_ref rule, but we need to make sure we reset state the - // so we don't pick up data from a previously-parsed payload. - context->layerRefPath.clear(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - } - payload_params_opt { - if (!$1.Get().empty()) { - _PathSetPrim($1, context); - } - else { - context->savedPath = SdfPath::EmptyPath(); - } - - SdfPayload payload(std::string(), - context->savedPath, - context->layerRefOffset); - context->payloadParsingRefs.push_back(payload); - } - ; - -payload_params_opt: - /* empty */ - | '(' newlines_opt ')' - | '(' newlines_opt payload_params_int stmtsep_opt ')' - ; - -payload_params_int: - payload_params_item - | payload_params_int stmtsep payload_params_item - ; - -payload_params_item: - layer_offset_stmt - ; - -reference_list: - TOK_NONE - | reference_list_item - | '[' newlines_opt ']' - | '[' newlines_opt reference_list_int listsep_opt ']' - ; - -reference_list_int: - reference_list_item - | reference_list_int listsep reference_list_item - ; - -reference_list_item: - layer_ref prim_path_opt reference_params_opt { - if (context->layerRefPath.empty()) { - Err(context, "Reference asset path must not be empty. If this " - "is intended to be an internal reference, remove the " - "'@' delimiters."); - } - - SdfReference ref(context->layerRefPath, - context->savedPath, - context->layerRefOffset); - ref.SwapCustomData(context->currentDictionaries[0]); - context->referenceParsingRefs.push_back(ref); - } - | TOK_PATHREF { - // Internal references do not begin with an asset path so there's - // no layer_ref rule, but we need to make sure we reset state the - // so we don't pick up data from a previously-parsed reference. - context->layerRefPath.clear(); - context->layerRefOffset = SdfLayerOffset(); - ABORT_IF_ERROR(context->seenError); - } - reference_params_opt { - if (!$1.Get().empty()) { - _PathSetPrim($1, context); - } - else { - context->savedPath = SdfPath::EmptyPath(); - } - - SdfReference ref(std::string(), - context->savedPath, - context->layerRefOffset); - ref.SwapCustomData(context->currentDictionaries[0]); - context->referenceParsingRefs.push_back(ref); - } - ; - -reference_params_opt: - /* empty */ - | '(' newlines_opt ')' - | '(' newlines_opt reference_params_int stmtsep_opt ')' - ; - -reference_params_int: - reference_params_item - | reference_params_int stmtsep reference_params_item - ; - -reference_params_item: - layer_offset_stmt - | TOK_CUSTOMDATA '=' typed_dictionary - ; - -inherit_list: - TOK_NONE - | inherit_list_item - | '[' newlines_opt ']' - | '[' newlines_opt inherit_list_int listsep_opt ']' - ; - -inherit_list_int: - inherit_list_item - | inherit_list_int listsep inherit_list_item - ; - -inherit_list_item: - prim_path { - _InheritAppendPath(context); - } - ; - -specializes_list: - TOK_NONE - | specializes_list_item - | '[' newlines_opt ']' - | '[' newlines_opt specializes_list_int listsep_opt ']' - ; - -specializes_list_int: - specializes_list_item - | specializes_list_int listsep specializes_list_item - ; - -specializes_list_item: - prim_path { - _SpecializesAppendPath(context); - } - ; - -relocates_map: - '{' newlines_opt relocates_stmt_list_opt '}' - ; - -relocates_stmt_list_opt: - /* empty */ - | relocates_stmt_list listsep_opt - ; - -relocates_stmt_list: - relocates_stmt - | relocates_stmt_list listsep relocates_stmt - ; - -relocates_stmt: - TOK_PATHREF ':' TOK_PATHREF { - _RelocatesAdd($1, $3, context); - } - ; - -name_list: - name_list_item - | '[' newlines_opt name_list_int listsep_opt ']' - ; - -name_list_int: - name_list_item - | name_list_int listsep name_list_item - ; - -name_list_item: - TOK_STRING { - context->nameVector.push_back(TfToken($1.Get())); - } - ; - -// Prim Contents - -prim_contents_list_opt: - newlines_opt - | newlines_opt prim_contents_list - ; - -prim_contents_list: - prim_contents_list_item - | prim_contents_list prim_contents_list_item - ; - -prim_contents_list_item: - prim_property stmtsep {} - | prim_child_order_stmt stmtsep {} - | prim_property_order_stmt stmtsep {} - | prim_stmt newlines - | variantset_stmt newlines - ; - -variantset_stmt: - TOK_VARIANTSET TOK_STRING { - const std::string name = $2.Get(); - ERROR_IF_NOT_ALLOWED(context, SdfSchema::IsValidVariantIdentifier(name)); - - context->currentVariantSetNames.push_back( name ); - context->currentVariantNames.push_back( std::vector() ); - - context->path = context->path.AppendVariantSelection(name, ""); - } '=' newlines_opt '{' newlines_opt variant_list '}' { - - SdfPath variantSetPath = context->path; - context->path = context->path.GetParentPath(); - - // Create this VariantSetSpec if it does not already exist. - if (!_HasSpec(variantSetPath, context)) { - _CreateSpec(variantSetPath, SdfSpecTypeVariantSet, context); - - // Add the name of this variant set to the VariantSets field - _AppendVectorItem(SdfChildrenKeys->VariantSetChildren, - TfToken(context->currentVariantSetNames.back()), - context); - } - - // Author the variant set's variants - _SetField( - variantSetPath, SdfChildrenKeys->VariantChildren, - TfToTokenVector(context->currentVariantNames.back()), context); - - context->currentVariantSetNames.pop_back(); - context->currentVariantNames.pop_back(); - } - ; - -variant_list: - variant_stmt - | variant_list variant_stmt - ; - -variant_stmt: - TOK_STRING { - const std::string variantName = $1.Get(); - ERROR_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantIdentifier(variantName)); - - context->currentVariantNames.back().push_back(variantName); - - // A variant is basically like a new pseudo-root, so we need to push - // a new item onto our name children stack to store prims defined - // within this variant. - context->nameChildrenStack.push_back(std::vector()); - context->propertiesStack.push_back(std::vector()); - - std::string variantSetName = context->currentVariantSetNames.back(); - context->path = context->path.GetParentPath() - .AppendVariantSelection(variantSetName, variantName); - - _CreateSpec(context->path, SdfSpecTypeVariant, context); - - } prim_metadata_opt '{' prim_contents_list_opt '}' newlines_opt { - // Store the names of the prims and properties defined in this variant. - if (!context->nameChildrenStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PrimChildren, - context->nameChildrenStack.back(), context); - } - if (!context->propertiesStack.back().empty()) { - _SetField( - context->path, SdfChildrenKeys->PropertyChildren, - context->propertiesStack.back(), context); - } - - context->nameChildrenStack.pop_back(); - context->propertiesStack.pop_back(); - - std::string variantSet = context->path.GetVariantSelection().first; - context->path = - context->path.GetParentPath().AppendVariantSelection(variantSet, ""); - } - ; - -prim_child_order_stmt: - TOK_REORDER TOK_NAMECHILDREN '=' name_list { - _SetField( - context->path, SdfFieldKeys->PrimOrder, - context->nameVector, context); - context->nameVector.clear(); - } - ; - -prim_property_order_stmt: - TOK_REORDER TOK_PROPERTIES '=' name_list { - _SetField( - context->path, SdfFieldKeys->PropertyOrder, - context->nameVector, context); - context->nameVector.clear(); - } - ; - -//-------------------------------------------------------------------- -// Property Structure -//-------------------------------------------------------------------- - -prim_property: - prim_attribute - | prim_relationship - ; - -//-------------------------------------------------------------------- -// Attribute Structure -//-------------------------------------------------------------------- - -prim_attr_variability : - TOK_UNIFORM { - context->variability = VtValue(SdfVariabilityUniform); - } - | TOK_CONFIG { - // Convert legacy "config" variability to SdfVariabilityUniform. - // This value was never officially used in USD but we handle - // this just in case the value was written out. - context->variability = VtValue(SdfVariabilityUniform); - } - ; - -prim_attr_qualifiers: - prim_attr_variability { - context->assoc = VtValue(); - } - ; - -prim_attr_type: - identifier { - _SetupValue($1.Get(), context); - } - | identifier '[' ']' { - _SetupValue(std::string($1.Get() + "[]"), context); - } - ; - -prim_attribute_full_type : - prim_attr_type { - context->variability = VtValue(); - context->custom = false; - } - | prim_attr_qualifiers prim_attr_type { - context->custom = false; - } - ; - -prim_attribute_default: - prim_attribute_full_type namespaced_name { - _PrimInitAttribute($2, context); - - if (!context->values.valueTypeIsValid) { - context->values.StartRecordingString(); - } - } - attribute_assignment_opt { - if (!context->values.valueTypeIsValid) { - context->values.StopRecordingString(); - } - } - attribute_metadata_list_opt { - context->path = context->path.GetParentPath(); - } - ; - -prim_attribute_fallback: - TOK_CUSTOM prim_attribute_full_type namespaced_name { - context->custom = true; - _PrimInitAttribute($3, context); - - if (!context->values.valueTypeIsValid) { - context->values.StartRecordingString(); - } - } - attribute_assignment_opt { - if (!context->values.valueTypeIsValid) { - context->values.StopRecordingString(); - } - } - attribute_metadata_list_opt { - context->path = context->path.GetParentPath(); - } - ; - -prim_attribute_connect : - prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($2, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypeExplicit, context); - context->path = context->path.GetParentPath(); - } - | TOK_ADD prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($3, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypeAdded, context); - context->path = context->path.GetParentPath(); - } - | TOK_PREPEND prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($3, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypePrepended, context); - context->path = context->path.GetParentPath(); - } - | TOK_APPEND prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($3, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = true; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypeAppended, context); - context->path = context->path.GetParentPath(); - } - | TOK_DELETE prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($3, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = false; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypeDeleted, context); - context->path = context->path.GetParentPath(); - } - | TOK_REORDER prim_attribute_full_type namespaced_name '.' TOK_CONNECT '=' { - _PrimInitAttribute($3, context); - context->connParsingTargetPaths.clear(); - context->connParsingAllowConnectionData = false; - } connect_rhs { - _AttributeSetConnectionTargetsList(SdfListOpTypeOrdered, context); - context->path = context->path.GetParentPath(); - } - ; - -prim_attribute_time_samples: - prim_attribute_full_type namespaced_name '.' TOK_TIME_SAMPLES '=' { - _PrimInitAttribute($2, context); - } - time_samples_rhs { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - context->path = context->path.GetParentPath(); // pop attr - } - ; - -prim_attribute: - prim_attribute_fallback - | prim_attribute_default - | prim_attribute_connect - | prim_attribute_time_samples - ; - -//-------------------------------------------------------------------- -// Attribute connections -//-------------------------------------------------------------------- - -connect_rhs: - TOK_NONE - | connect_item - | '[' newlines_opt ']' - | '[' newlines_opt connect_list listsep_opt ']' - ; - -connect_list: - connect_item - | connect_list listsep connect_item - ; - -connect_item: - prim_or_property_scene_path { - _AttributeAppendConnectionPath(context); - } - ; - -//-------------------------------------------------------------------- -// Time sample maps -//-------------------------------------------------------------------- - -time_samples_rhs: - '{' { - context->timeSamples = SdfTimeSampleMap(); - } newlines_opt time_sample_list '}' - ; - -time_sample_list: - /* empty */ - | time_sample_list_int listsep_opt - ; - -time_sample_list_int: - time_sample - | time_sample_list_int listsep time_sample - ; - -time_sample: - extended_number ':' { - context->timeSampleTime = $1.Get(); - } - typed_value { - context->timeSamples[ context->timeSampleTime ] = context->currentValue; - } - - | extended_number ':' TOK_NONE { - context->timeSampleTime = $1.Get(); - context->timeSamples[ context->timeSampleTime ] - = VtValue(SdfValueBlock()); - } - - ; - -//-------------------------------------------------------------------- -// Attribute Metadata -//-------------------------------------------------------------------- - -attribute_metadata_list_opt: - /* empty */ - | '(' newlines_opt ')' - | '(' newlines_opt attribute_metadata_list stmtsep_opt ')' - ; - -attribute_metadata_list: - attribute_metadata - | attribute_metadata_list stmtsep attribute_metadata - ; - -attribute_metadata_key: - identifier - | TOK_CUSTOMDATA - | TOK_SYMMETRYARGUMENTS - ; - -attribute_metadata: - TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Comment, - $1.Get(), context); - } - | attribute_metadata_key { - _GenericMetadataStart($1, SdfSpecTypeAttribute, context); - } '=' metadata_value { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - // Handling for generic metadata fields that use list ops. - // Note that handling of the 'explicit' list op type is done - // in the generic metadata clause above, since there is no - // marker that the parser can use to recognize that case. - | TOK_DELETE identifier { - _GenericMetadataStart($2, SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeDeleted; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - | TOK_ADD identifier { - _GenericMetadataStart($2, SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeAdded; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - | TOK_PREPEND identifier { - _GenericMetadataStart($2, SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypePrepended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - | TOK_APPEND identifier { - _GenericMetadataStart($2, SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeAppended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - | TOK_REORDER identifier { - _GenericMetadataStart($2, SdfSpecTypeAttribute, context); - context->listOpType = SdfListOpTypeOrdered; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeAttribute, context); - } - // Not parsed with generic metadata because: key name changes from "doc" to - // "documentation" - | TOK_DOC '=' TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Documentation, - $3.Get(), context); - } - // Not parsed with generic metadata because: has shortcut names like - // "public" instead of SdfPermissionPublic - | TOK_PERMISSION '=' identifier { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString($3.Get(), context), - context); - } - // Not parsed with generic metadata because: parsed as a TfEnum - | TOK_DISPLAYUNIT '=' identifier { - _SetField( - context->path, SdfFieldKeys->DisplayUnit, - _GetDisplayUnitFromString($3.Get(), context), - context); - } - // Not parsed with generic metadata because: allows assignment to an empty - // string by omitting the value - | TOK_SYMMETRYFUNCTION '=' identifier { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken($3.Get()), context); - } - | TOK_SYMMETRYFUNCTION '=' { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - } - ; - -attribute_assignment_opt: - /* empty */ - | '=' attribute_value - ; - -attribute_value: - typed_value { - _SetDefault(context->path, context->currentValue, context); - } - | TOK_NONE { - _SetDefault(context->path, VtValue(SdfValueBlock()), context); - } - ; - -//------------------------ -// Dictionary structure -//------------------------ - -typed_dictionary: - '{' { - _DictionaryBegin(context); - } - newlines_opt typed_dictionary_list_opt '}' { - _DictionaryEnd(context); - } - ; - -typed_dictionary_list_opt: - /* empty */ - | typed_dictionary_list stmtsep_opt - ; - -typed_dictionary_list: - typed_dictionary_element - | typed_dictionary_list stmtsep typed_dictionary_element - ; - -typed_dictionary_element: - dictionary_value_type dictionary_key '=' typed_value { - _DictionaryInsertValue($2, context); - } - | TOK_DICTIONARY dictionary_key '=' typed_dictionary { - _DictionaryInsertDictionary($2, context); - } - ; - -// dictionary keys should be able to strings that are numbers, like "1" or "20", -// so we need to add TOK_STRING in addition to name. -dictionary_key: - TOK_STRING - | name - ; - -dictionary_value_type: - dictionary_value_scalar_type - | dictionary_value_shaped_type - ; - -dictionary_value_scalar_type: - identifier { - _DictionaryInitScalarFactory($1, context); - } - ; - -dictionary_value_shaped_type: - identifier '[' ']' { - _DictionaryInitShapedFactory($1, context); - } - ; - -//------------------------ -// String-to-string dictionary -//------------------------ - -string_dictionary: - '{' { - _DictionaryBegin(context); - } - newlines_opt string_dictionary_list_opt '}' { - _DictionaryEnd(context); - } - ; - -string_dictionary_list_opt: - /* empty */ - | string_dictionary_list listsep_opt - ; - -string_dictionary_list: - string_dictionary_element - | string_dictionary_list listsep string_dictionary_element - ; - -string_dictionary_element: - TOK_STRING ':' TOK_STRING { - _DictionaryInitScalarFactory(Value(std::string("string")), context); - _ValueAppendAtomic($3, context); - _ValueSetAtomic(context); - _DictionaryInsertValue($1, context); - } - ; - -//---------------------- -// List operation value -//---------------------- - -metadata_listop_list: - TOK_NONE { - context->currentValue = VtValue(); - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("None"); - } - } - | typed_value_list { - _ValueSetList(context); - } - ; - -//-------------------------------------------------------------------- -// Value structure: scalar, shaped, and tuple values -//-------------------------------------------------------------------- - -metadata_value: - typed_dictionary { - context->currentValue.Swap(context->currentDictionaries[0]); - context->currentDictionaries[0].clear(); - } - | typed_value - | TOK_NONE { - // This is only here to allow 'None' metadata values for - // an explicit list operation on an SdfListOp-valued field. - // We'll reject this value for any other metadata field - // in _GenericMetadataEnd. - context->currentValue = VtValue(); - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("None"); - } - } - ; - -typed_value: - typed_value_atomic { - _ValueSetAtomic(context); - } - | typed_value_tuple { - _ValueSetTuple(context); - } - | typed_value_list { - _ValueSetList(context); - } - | '[' ']' { - // Set the recorded string on the ParserValueContext. Normally - // 'values' is able to keep track of the parsed string, but in this - // case it doesn't get the BeginList() and EndList() calls so the - // recorded string would have been "". We want "[]" instead. - if (context->values.IsRecordingString()) { - context->values.SetRecordedString("[]"); - } - - _ValueSetShaped(context); - } - | TOK_PATHREF { - _ValueSetCurrentToSdfPath($1, context); - } - ; - -typed_value_atomic: - TOK_NUMBER { - _ValueAppendAtomic($1, context); - } - | TOK_STRING { - _ValueAppendAtomic($1, context); - } - | identifier { - // The ParserValueContext needs identifiers to be stored as TfToken - // instead of std::string to be able to distinguish between them. - _ValueAppendAtomic(TfToken($1.Get()), context); - } - | TOK_ASSETREF { - // The ParserValueContext needs asset paths to be stored as - // SdfAssetPath instead of std::string to be able to distinguish - // between them - _ValueAppendAtomic(SdfAssetPath($1.Get()), context); - } - ; - -//---------------------- -// Value lists, aka shaped values -//---------------------- - -typed_value_list: - '[' { - context->values.BeginList(); - } - typed_value_list_int ']' { - context->values.EndList(); - } - ; - -typed_value_list_int: - newlines_opt typed_value_list_items listsep_opt - ; - -typed_value_list_items: - typed_value_list_item - | typed_value_list_items listsep typed_value_list_item - ; - -typed_value_list_item: - typed_value_atomic - | typed_value_list - | typed_value_tuple - ; - -//---------------------- -// Value tuples -//---------------------- - -typed_value_tuple: - '(' { - context->values.BeginTuple(); - } typed_value_tuple_int ')' { - context->values.EndTuple(); - } ; - -typed_value_tuple_int: - newlines_opt typed_value_tuple_items listsep_opt - ; - -typed_value_tuple_items: - typed_value_tuple_item - | typed_value_tuple_items listsep typed_value_tuple_item - ; - -typed_value_tuple_item: - typed_value_atomic - | typed_value_tuple - ; - -//-------------------------------------------------------------------- -// Relationships -//-------------------------------------------------------------------- - -prim_relationship_type : - TOK_REL { - context->custom = false; - context->variability = VtValue(SdfVariabilityUniform); - } - | TOK_CUSTOM TOK_REL { - context->custom = true; - context->variability = VtValue(SdfVariabilityUniform); - } - | TOK_CUSTOM TOK_VARYING TOK_REL { - context->custom = true; - context->variability = VtValue(SdfVariabilityVarying); - } - | TOK_VARYING TOK_REL { - context->custom = false; - context->variability = VtValue(SdfVariabilityVarying); - } - ; - -prim_relationship_time_samples: - prim_relationship_type namespaced_name '.' TOK_TIME_SAMPLES '=' { - _PrimInitRelationship($2, context); - } - time_samples_rhs { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - _PrimEndRelationship(context); - } - ; - -prim_relationship_default: - prim_relationship_type namespaced_name '.' TOK_DEFAULT '=' TOK_PATHREF { - _PrimInitRelationship($2, context); - - // If path is empty, use default c'tor to construct empty path. - // XXX: 08/04/08 Would be nice if SdfPath would allow - // SdfPath("") without throwing a warning. - std::string pathString = $6.Get(); - SdfPath path = pathString.empty() ? SdfPath() : SdfPath(pathString); - - _SetDefault(context->path, VtValue(path), context); - _PrimEndRelationship(context); - } - ; - -prim_relationship: - prim_relationship_type namespaced_name { - _PrimInitRelationship($2, context); - context->relParsingAllowTargetData = true; - } - relationship_assignment_opt - relationship_metadata_list_opt { - _RelationshipSetTargetsList(SdfListOpTypeExplicit, context); - _PrimEndRelationship(context); - } - - | TOK_DELETE prim_relationship_type namespaced_name { - _PrimInitRelationship($3, context); - } - relationship_assignment_opt { - _RelationshipSetTargetsList(SdfListOpTypeDeleted, context); - _PrimEndRelationship(context); - } - - | TOK_ADD prim_relationship_type namespaced_name { - _PrimInitRelationship($3, context); - context->relParsingAllowTargetData = true; - } - relationship_assignment_opt { - _RelationshipSetTargetsList(SdfListOpTypeAdded, context); - _PrimEndRelationship(context); - } - | TOK_PREPEND prim_relationship_type namespaced_name { - _PrimInitRelationship($3, context); - context->relParsingAllowTargetData = true; - } - relationship_assignment_opt { - _RelationshipSetTargetsList(SdfListOpTypePrepended, context); - _PrimEndRelationship(context); - } - | TOK_APPEND prim_relationship_type namespaced_name { - _PrimInitRelationship($3, context); - context->relParsingAllowTargetData = true; - } - relationship_assignment_opt { - _RelationshipSetTargetsList(SdfListOpTypeAppended, context); - _PrimEndRelationship(context); - } - - | TOK_REORDER prim_relationship_type namespaced_name { - _PrimInitRelationship($3, context); - } - relationship_assignment_opt { - _RelationshipSetTargetsList(SdfListOpTypeOrdered, context); - _PrimEndRelationship(context); - } - - | prim_relationship_type namespaced_name '[' TOK_PATHREF ']' { - _PrimInitRelationship($2, context); - context->relParsingAllowTargetData = true; - _RelationshipAppendTargetPath($4, context); - _RelationshipInitTarget(context->relParsingTargetPaths->back(), - context); - } - | prim_relationship_time_samples - | prim_relationship_default - ; - -relationship_metadata_list_opt: - /* empty */ - | '(' newlines_opt ')' - | '(' newlines_opt relationship_metadata_list stmtsep_opt ')' - ; - -relationship_metadata_list: - relationship_metadata - | relationship_metadata_list stmtsep relationship_metadata - ; - -relationship_metadata_key: - identifier - | TOK_CUSTOMDATA - | TOK_SYMMETRYARGUMENTS - ; - -relationship_metadata: - TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Comment, - $1.Get(), context); - } - | relationship_metadata_key { - _GenericMetadataStart($1, SdfSpecTypeRelationship, context); - } '=' metadata_value { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - // Handling for generic metadata fields that use list ops. - // Note that handling of the 'explicit' list op type is done - // in the generic metadata clause above, since there is no - // marker that the parser can use to recognize that case. - | TOK_DELETE identifier { - _GenericMetadataStart($2, SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeDeleted; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - | TOK_ADD identifier { - _GenericMetadataStart($2, SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeAdded; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - | TOK_PREPEND identifier { - _GenericMetadataStart($2, SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypePrepended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - | TOK_APPEND identifier { - _GenericMetadataStart($2, SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeAppended; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - | TOK_REORDER identifier { - _GenericMetadataStart($2, SdfSpecTypeRelationship, context); - context->listOpType = SdfListOpTypeOrdered; - } '=' metadata_listop_list { - _GenericMetadataEnd(SdfSpecTypeRelationship, context); - } - // Not parsed with generic metadata because: key name changes from "doc" to - // "documentation" - | TOK_DOC '=' TOK_STRING { - _SetField( - context->path, SdfFieldKeys->Documentation, - $3.Get(), context); - } - // Not parsed with generic metadata because: has shortcut names like - // "public" instead of SdfPermissionPublic - | TOK_PERMISSION '=' identifier { - _SetField( - context->path, SdfFieldKeys->Permission, - _GetPermissionFromString($3.Get(), context), - context); - } - // Not parsed with generic metadata because: allows assignment to an empty - // string by omitting the value - | TOK_SYMMETRYFUNCTION '=' identifier { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken($3.Get()), context); - } - | TOK_SYMMETRYFUNCTION '=' { - _SetField( - context->path, SdfFieldKeys->SymmetryFunction, - TfToken(), context); - } - ; - -relationship_assignment_opt: - /* empty */ - | '=' relationship_rhs - ; - -relationship_rhs: - relationship_target - | TOK_NONE { - context->relParsingTargetPaths = SdfPathVector(); - } - | '[' newlines_opt ']' { - context->relParsingTargetPaths = SdfPathVector(); - } - | '[' newlines_opt relationship_target_list listsep_opt ']' - ; - -relationship_target_list: - relationship_target - | relationship_target_list listsep relationship_target - ; - -relationship_target: - TOK_PATHREF { - _RelationshipAppendTargetPath($1, context); - } - ; - -//-------------------------------------------------------------------- -// Syntactic utilities -//-------------------------------------------------------------------- - -prim_path_opt: - /* empty */ { - context->savedPath = SdfPath(); - } - | prim_path - ; - -prim_path: - TOK_PATHREF { - _PathSetPrim($1, context); - } - ; - -prim_or_property_scene_path: - TOK_PATHREF { - _PathSetPrimOrPropertyScenePath($1, context); - } - ; - -// A generic name, used to name prims, etc. -// -// We accept C/Python identifiers, C++ namespaced identifiers, and our -// full set of keywords to ensure that we don't prevent people from using -// keywords for names where it would not be ambiguous. -name: - identifier - | keyword - ; - -// An optionally namespaced name, used to name attributes and relationships. -// We do not support C++ namespaced names. -namespaced_name: - TOK_IDENTIFIER - | TOK_NAMESPACED_IDENTIFIER - | keyword - ; - -// A generic name including C++ namespaced names but not keywords. -identifier: - TOK_IDENTIFIER - | TOK_CXX_NAMESPACED_IDENTIFIER - ; - -// A number, inf, -inf or nan, all as double. -extended_number: - TOK_NUMBER - | TOK_IDENTIFIER { $$ = $1; } - ; - -stmtsep_opt: - /* empty */ - | stmtsep - ; - -stmtsep: - ';' newlines_opt - | newlines - ; - -listsep_opt: - newlines_opt - | listsep - ; - -listsep: - ',' newlines_opt - ; - -newlines_opt: - /* empty */ - | newlines - ; - -newlines: - TOK_NL - | newlines TOK_NL - ; - -%% - -//-------------------------------------------------------------------- -// textFileFormatYyerror -//-------------------------------------------------------------------- -void textFileFormatYyerror(Sdf_TextParserContext *context, const char *msg) -{ - const std::string nextToken(textFileFormatYyget_text(context->scanner), - textFileFormatYyget_leng(context->scanner)); - const bool isNewlineToken = - (nextToken.length() == 1 && nextToken[0] == '\n'); - - int errLineNumber = context->sdfLineNo; - - // By this time, sdfLineNo has already been updated to account for - // nextToken. So, if nextToken is a newline, the error really occurred on - // the previous line. - if (isNewlineToken) { - errLineNumber -= 1; - } - - std::string s = TfStringPrintf( - "%s%s in <%s> on line %i", - msg, - isNewlineToken ? - "" : TfStringPrintf(" at \'%s\'", nextToken.c_str()).c_str(), - context->path.GetText(), - errLineNumber); - - // Append file context, if known. - if (!context->fileContext.empty()) { - s += " in file " + context->fileContext; - } - s += "\n"; - - // Return the line number in the error info. - TfDiagnosticInfo info(errLineNumber); - - TF_ERROR(info, TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE, s); - - context->seenError = true; -} - -static void _ReportParseError(Sdf_TextParserContext *context, - const std::string &text) -{ - if (!context->values.IsRecordingString()) { - textFileFormatYyerror(context, text.c_str()); - } -} - -// Helper class for generating/managing the buffer used by flex. -// -// This simply reads the given file entirely into memory, padded as flex -// requires, and passes it along. Normally, flex reads data from a given file in -// blocks of 8KB, which leads to O(n^2) behavior when trying to match strings -// that are over this size. Giving flex a pre-filled buffer avoids this -// behavior. -struct Sdf_MemoryFlexBuffer -{ - Sdf_MemoryFlexBuffer(const Sdf_MemoryFlexBuffer&) = delete; - Sdf_MemoryFlexBuffer& operator=(const Sdf_MemoryFlexBuffer&) = delete; -public: - Sdf_MemoryFlexBuffer(const std::shared_ptr& asset, - const std::string& name, yyscan_t scanner); - ~Sdf_MemoryFlexBuffer(); - - yy_buffer_state *GetBuffer() { return _flexBuffer; } - -private: - yy_buffer_state *_flexBuffer; - - std::unique_ptr _fileBuffer; - - yyscan_t _scanner; -}; - -Sdf_MemoryFlexBuffer::Sdf_MemoryFlexBuffer( - const std::shared_ptr& asset, - const std::string& name, yyscan_t scanner) - : _flexBuffer(nullptr) - , _scanner(scanner) -{ - // flex requires 2 bytes of null padding at the end of any buffers it is - // given. We'll allocate a buffer with 2 padding bytes, then read the - // entire file in. - static const size_t paddingBytesRequired = 2; - - size_t size = asset->GetSize(); - std::unique_ptr buffer(new char[size + paddingBytesRequired]); - - if (asset->Read(buffer.get(), size, 0) != size) { - TF_RUNTIME_ERROR("Failed to read asset contents @%s@: " - "an error occurred while reading", - name.c_str()); - return; - } - - // Set null padding. - memset(buffer.get() + size, '\0', paddingBytesRequired); - _fileBuffer = std::move(buffer); - _flexBuffer = textFileFormatYy_scan_buffer( - _fileBuffer.get(), size + paddingBytesRequired, _scanner); -} - -Sdf_MemoryFlexBuffer::~Sdf_MemoryFlexBuffer() -{ - if (_flexBuffer) - textFileFormatYy_delete_buffer(_flexBuffer, _scanner); -} - -#ifdef SDF_PARSER_DEBUG_MODE -extern int yydebug; -#else -static int yydebug; -#endif // SDF_PARSER_DEBUG_MODE - -namespace { -struct _DebugContext { - explicit _DebugContext(bool state=true) : _old(yydebug) { yydebug = state; } - ~_DebugContext() { yydebug = _old; } -private: - bool _old; -}; -} - -/// Parse a text layer into an SdfData -bool -Sdf_ParseLayer( - const std::string& fileContext, - const std::shared_ptr& asset, - const std::string& magicId, - const std::string& versionString, - bool metadataOnly, - SdfDataRefPtr data, - SdfLayerHints *hints) -{ - TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayer"); - - TRACE_FUNCTION(); - - // Turn on debugging, if enabled. - _DebugContext debugCtx; - - // Configure for input file. - Sdf_TextParserContext context; - - context.data = data; - context.fileContext = fileContext; - context.magicIdentifierToken = magicId; - context.versionString = versionString; - context.metadataOnly = metadataOnly; - context.values.errorReporter = - std::bind(_ReportParseError, &context, std::placeholders::_1); - - // Initialize the scanner, allowing it to be reentrant. - textFileFormatYylex_init(&context.scanner); - textFileFormatYyset_extra(&context, context.scanner); - - int status = -1; - { - Sdf_MemoryFlexBuffer input(asset, fileContext, context.scanner); - yy_buffer_state *buf = input.GetBuffer(); - - // Continue parsing if we have a valid input buffer. If there - // is no buffer, the appropriate error will have already been emitted. - if (buf) { - try { - TRACE_SCOPE("textFileFormatYyParse"); - status = textFileFormatYyparse(&context); - *hints = context.layerHints; - } catch (std::bad_variant_access const &) { - TF_CODING_ERROR("Bad variant access in layer parser."); - Err(&context, "Internal layer parser error."); - } - } - } - - // Note that the destructor for 'input' calls - // textFileFormatYy_delete_buffer(), which requires a valid scanner - // object. So we need 'input' to go out of scope before we can destroy the - // scanner. - textFileFormatYylex_destroy(context.scanner); - - return status == 0; -} - -/// Parse a layer text string into an SdfData -bool -Sdf_ParseLayerFromString( - const std::string & layerString, - const std::string & magicId, - const std::string & versionString, - SdfDataRefPtr data, - SdfLayerHints *hints) -{ - TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayerFromString"); - - TRACE_FUNCTION(); - - // Configure for input string. - Sdf_TextParserContext context; - - context.data = data; - context.magicIdentifierToken = magicId; - context.versionString = versionString; - context.values.errorReporter = - std::bind(_ReportParseError, &context, std::placeholders::_1); - - // Initialize the scanner, allowing it to be reentrant. - textFileFormatYylex_init(&context.scanner); - textFileFormatYyset_extra(&context, context.scanner); - - // Run parser. - yy_buffer_state *buf = textFileFormatYy_scan_string( - layerString.c_str(), context.scanner); - int status = -1; - try { - TRACE_SCOPE("textFileFormatYyParse"); - status = textFileFormatYyparse(&context); - *hints = context.layerHints; - } catch (std::bad_variant_access const &) { - TF_CODING_ERROR("Bad variant access in layer parser."); - Err(&context, "Internal layer parser error."); - } - - // Clean up. - textFileFormatYy_delete_buffer(buf, context.scanner); - textFileFormatYylex_destroy(context.scanner); - - return status == 0; -} diff --git a/pxr/usd/sdf/textFileFormatParser.cpp b/pxr/usd/sdf/textFileFormatParser.cpp new file mode 100644 index 0000000000..93e73b8970 --- /dev/null +++ b/pxr/usd/sdf/textFileFormatParser.cpp @@ -0,0 +1,3613 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the Apache License, Version 2.0 (the "Apache License") +// with the following modification; you may not use this file except in +// compliance with the Apache License and the following modification to it: +// Section 6. Trademarks. is deleted and replaced with: +// +// 6. Trademarks. This License does not grant permission to use the trade +// names, trademarks, service marks, or product names of the Licensor +// and its affiliates, except as required to comply with Section 4(c) of +// the License and to reproduce the content of the NOTICE file. +// +// You may obtain a copy of the Apache License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the Apache License with the above modification is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the Apache License for the specific +// language governing permissions and limitations under the Apache License. +// + +#include "pxr/pxr.h" +#include "pxr/base/trace/trace.h" +#include "pxr/usd/ar/asset.h" +#include "pxr/usd/sdf/textParserContext.h" +#include "pxr/usd/sdf/textFileFormatParser.h" +#include "pxr/usd/sdf/textParserHelpers.h" + +PXR_NAMESPACE_OPEN_SCOPE + +namespace Sdf_TextFileFormatParser { + +//////////////////////////////////////////////////////////////////////// +// TextFileFormat customized errors + +template<> constexpr auto errorMessage = + "Expected '"; +template<> constexpr auto errorMessage = + "Expected \""; +template<> constexpr auto errorMessage = + "Expected ("; +template<> constexpr auto errorMessage = + "Expected )"; +template<> constexpr auto errorMessage = + "Expected ["; +template<> constexpr auto errorMessage = + "Expected ]"; +template<> constexpr auto errorMessage = + "Expected {"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage = + "Expected <"; +template<> constexpr auto errorMessage = + "Expected >"; +template<> constexpr auto errorMessage = + "Expected @"; +template<> constexpr auto errorMessage = + "Expected ="; +template<> constexpr auto errorMessage = + "Expected number [0-9]"; +template<> constexpr auto errorMessage = + "Expected Path"; +template<> constexpr auto errorMessage> = + "Expected list of number, identifier, string, asset ref, or tuples " + "separated by ,"; +template<> constexpr auto errorMessage = + "Expected number, identifier, string, asset ref, or tuple"; +template<> constexpr auto errorMessage> = + "Expected list of number, identifier, string, asset ref, list, or tuples " + "separated by ,"; +template<> constexpr auto errorMessage = + "Expected number, identifier, string, asset ref, list or tuple"; +template<> constexpr auto errorMessage = + "Expected spaces"; +template<> constexpr auto errorMessage = + "Expected string or identifier"; +template<> constexpr auto errorMessage = + "Expected dictionary"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage> = + "Expected list of strings separated by ,"; +template<> constexpr auto errorMessage = + "Expected string"; +template<> constexpr auto errorMessage = + "Expected {"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage = + "Expected string : string"; +template<> constexpr auto errorMessage = + "Expected identifier"; +template<> constexpr auto errorMessage = + "Expected )"; +template<> constexpr auto errorMessage = + "Expected path reference"; +template<> constexpr auto errorMessage = + "Expected dictionary of time samples (x : y)"; +template<> constexpr auto errorMessage = + "Expected None, path ref, or list of path refs separated by ,"; +template<> constexpr auto errorMessage = + "Expected ]"; +template<> constexpr auto errorMessage = + "Expected ]"; +template<> constexpr auto errorMessage = + "Expected {"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage = + "Expected None, reference, or list of references separated by ,"; +template<> constexpr auto errorMessage = + "Expected None, payload, or list of payloads separated by ,"; +template<> constexpr auto errorMessage = + "Expected None, path ref, or list of path refs separated by ,"; +template<> constexpr auto errorMessage = + "Expected string or list of strings enclosed in [] separated by ,"; +template<> constexpr auto errorMessage = + "Expected {"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage = + "Expected {"; +template<> constexpr auto errorMessage = + "Expected }"; +template<> constexpr auto errorMessage = + "Expected sequence of child order, property order, prim, property, " + "or variant sets enclosed in { }"; +template<> constexpr auto errorMessage = + "Expected child order, property order, prim, property, or variant set"; +template<> constexpr auto errorMessage = + "Expected ]"; +template<> constexpr auto errorMessage = + "Expected None or ["; + +//////////////////////////////////////////////////////////////////////// +// Common Keyword actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext parsingContext = + context.parsingContext.back(); + if (parsingContext == + Sdf_TextParserCurrentParsingContext::KeyValueMetadata || + parsingContext == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + // if the value is None, set the string + // being recorded to None + context.currentValue = VtValue(); + if (context.values.IsRecordingString()) + { + context.values.SetRecordedString(std::string("None")); + } + + // None was the end of that production, so pop back + // out to the Metadata context + _PopContext(context); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _SetDefault(context.path, VtValue(SdfValueBlock()), context); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + context.relParsingTargetPaths = SdfPathVector(); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::TimeSamples) + { + context.timeSamples[context.timeSampleTime] + = VtValue(SdfValueBlock()); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::RelationshipAssignment) + { + context.relParsingTargetPaths = SdfPathVector(); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if the current context is Metadata, this signals we need + // to start a key value metadata production + // the context previous to the current one (which should be + // metadata) will tell us the spec the metadata belongs to + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + + _KeyValueMetadataStart(in.string(), specType, context); + _PushContext(context, Sdf_TextParserCurrentParsingContext::KeyValueMetadata); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if the current context is Metadata, this signals we need + // to start a key value metadata production + // the context previous to the current one (which should be + // metadata) will tell us the spec the metadata belongs to + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + _KeyValueMetadataStart(in.string(), specType, context); + _PushContext(context, Sdf_TextParserCurrentParsingContext::KeyValueMetadata); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if we are in metadata, this opens a new parsing context + // for permission metadata + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::PermissionMetadata); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if we are in metadata, this opens a new parsing context + // for symmetry function metadata + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::SymmetryFunctionMetadata); + + context.symmetryFunctionName.clear(); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if we are in metadata, this opens a new parsing context + // for symmetry function metadata + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::DisplayUnitMetadata); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.custom = true; + } +}; + +//////////////////////////////////////////////////////////////////////// +// Basic Type actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // obtain the text inside of the quotes + // we have to first check for multi-line quotes + // so we know what to pass to Sdf_EvalQuotedString + std::string inputString = in.string(); + std::string evaluatedString; + if (TfStringStartsWith(inputString, "'''") || + TfStringStartsWith(inputString, "\"\"\"")) + { + evaluatedString = Sdf_EvalQuotedString( + inputString.c_str(), inputString.length(), 3, nullptr); + } + else + { + evaluatedString = Sdf_EvalQuotedString( + inputString.c_str(), inputString.length(), 1, nullptr); + } + + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::DocMetadata) + { + context.data->Set( + context.path, + SdfFieldKeys->Documentation, + VtValue(evaluatedString)); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.data->Set( + context.path, + SdfFieldKeys->Comment, + VtValue(evaluatedString)); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PrimSpec) + { + std::string errorMessage; + if (!_CreatePrimSpec(evaluatedString, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderRootPrims || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderNameChildren || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderProperties || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::VariantSetsMetadata) + { + context.nameVector.push_back(TfToken(evaluatedString)); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::VariantSetStatement) + { + const SdfAllowed allow = + SdfSchema::IsValidVariantIdentifier(evaluatedString); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot() + ); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + + context.currentVariantSetNames.push_back(evaluatedString); + context.currentVariantNames.push_back(std::vector()); + context.path = context.path.AppendVariantSelection( + evaluatedString, ""); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::VariantStatementList) + { + const SdfAllowed allow = + SdfSchema::IsValidVariantIdentifier(evaluatedString); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot() + ); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + + context.currentVariantNames.back().push_back(evaluatedString); + + // A variant is basically like a new pseudo-root, so we need to push + // a new item onto our name children stack to store prims defined + // within this variant. + context.nameChildrenStack.push_back(std::vector()); + context.propertiesStack.push_back(std::vector()); + + std::string variantSetName = context.currentVariantSetNames.back(); + context.path = context.path.GetParentPath() + .AppendVariantSelection(variantSetName, evaluatedString); + + context.data->CreateSpec(context.path, SdfSpecTypeVariant); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::KindMetadata) + { + context.data->Set( + context.path, + SdfFieldKeys->Kind, + VtValue(TfToken(evaluatedString))); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PrefixSubstitutionsMetadata || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::SuffixSubstitutionsMetadata) + { + if (!context.seenStringDictionaryKey) + { + // this is the dictionary key + context.seenStringDictionaryKey = true; + context.stringDictionaryKey = evaluatedString; + } + else + { + // this is the dictionary value + if (!context.values.SetupFactory(std::string("string"))) + { + std::string errorMessage = + "Unrecognized value typename 'string' for dictionary"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.values.AppendValue(evaluatedString); + + std::string errorMessage; + if (!_ValueSetAtomic(context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + size_t n = context.currentDictionaries.size(); + context.currentDictionaries[n-2][context.stringDictionaryKey] = + context.currentValue; + + context.seenStringDictionaryKey = false; + context.stringDictionaryKey.clear(); + } + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::TimeSamples) + { + const std::pair result = + _GetNumericValueFromString(in.string_view()); + if (!result.first) + { + TF_WARN("Integer literal '%s' on line %zu%s%s out of range, parsing " + "as double. Consider exponential notation for large " + "floating point values.", in.string().c_str(), in.position().line, + context.fileContext.empty() ? "" : " in file ", + context.fileContext.empty() ? "" : + context.fileContext.c_str()); + } + + context.timeSampleTime = result.second.Get(); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::LayerOffset || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::LayerScale) + { + const std::pair result = + _GetNumericValueFromString(in.string_view()); + if(!result.first) + { + TF_WARN("Integer literal '%s' on line %zu%s%s out of range, parsing " + "as double. Consider exponential notation for large " + "floating point values.", in.string().c_str(), in.position().line, + context.fileContext.empty() ? "" : " in file ", + context.fileContext.empty() ? "" : + context.fileContext.c_str()); + } + + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::LayerOffset) + { + context.layerRefOffset.SetOffset(result.second.Get()); + } + else + { + context.layerRefOffset.SetScale(result.second.Get()); + } + + // in either case, we are done with this custom context + _PopContext(context); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext parsingContext = + context.parsingContext.back(); + + if (parsingContext == + Sdf_TextParserCurrentParsingContext::DictionaryTypeName) + { + context.dictionaryTypeName += in.string(); + } + else if (parsingContext == Sdf_TextParserCurrentParsingContext::Metadata || + parsingContext == Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + // if we are in a metadata context, the identifier + // is the production in which we start the generic + // metadata recording, but we need the spec context we are + // in - for Metadata that's one level deeper on the stack, + // for ListOpMetadata it's two levels + Sdf_TextParserCurrentParsingContext specContext = + parsingContext == Sdf_TextParserCurrentParsingContext::Metadata ? + context.parsingContext.rbegin()[1] : + context.parsingContext.rbegin()[2]; + + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + _KeyValueMetadataStart(in.string(), specType, context); + if (parsingContext == Sdf_TextParserCurrentParsingContext::Metadata) + { + // if we were already in a list op context, leave that one + // as the current, otherwise start a key value context + _PushContext(context, Sdf_TextParserCurrentParsingContext::KeyValueMetadata); + } + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::PermissionMetadata) + { + SdfPermission permission; + std::string permissionStr = in.string(); + if (permissionStr == "public") + { + permission = SdfPermissionPublic; + } + else if (permissionStr == "private") + { + permission = SdfPermissionPrivate; + } + else + { + std::string errorMessage = "'" + + permissionStr + "' is not a valid permission constant"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.data->Set( + context.path, + SdfFieldKeys->Permission, + VtValue(permission)); + + // this signals the end of the permission + // metadata context + _PopContext(context); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::SymmetryFunctionMetadata) + { + context.symmetryFunctionName = in.string(); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::DisplayUnitMetadata) + { + const TfEnum &unit = SdfGetUnitFromName(in.string()); + if (unit == TfEnum()) { + std::string errorMessage = "'" + + in.string() + "' is not a valid display unit"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + context.data->Set( + context.path, + SdfFieldKeys->DisplayUnit, + VtValue(unit)); + + // this signals the end of the display unit + // metadata context + _PopContext(context); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.attributeTypeName += in.string(); + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::PrimSpec) + { + // this is broken into two actions (Identifier and Dot) + // so that we don't have to reparse out the token spacing + // between the identifier and . if we reduced on the full + // PrimTypeName rule + context.primTypeName += in.string(); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext parsingContext = + context.parsingContext.back(); + if (parsingContext == + Sdf_TextParserCurrentParsingContext::DictionaryTypeName) + { + context.dictionaryTypeName += "[]"; + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + // the [] is part of the attribute type name + context.attributeTypeName += "[]"; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + std::string errorMessage; + if (!_CreateAttributeSpec(in.string(), context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + if (!context.values.valueTypeIsValid) { + context.values.StartRecordingString(); + } + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + std::string errorMessage; + if (!_CreateRelationshipSpec(in.string(), context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ConnectAttribute) + { + std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + context.savedPath = SdfPath(pathStr); + + // Valid paths are prim or property paths that do not contain variant + // selections. + SdfPath const &path = context.savedPath; + bool pathValid = (path.IsPrimPath() || path.IsPropertyPath()) && + !path.ContainsPrimVariantSelection(); + if (!pathValid) { + std::string errorMessage = "'" + + pathStr + "' is not a valid prim or property scene path"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // Expand paths relative to the containing prim. + // + // This strips any variant selections from the containing prim + // path before expanding the relative path, which is what we + // want. Connection paths never point into the variant namespace. + SdfPath absPath = context.savedPath.MakeAbsolutePath(context.path.GetPrimPath()); + + // XXX Workaround for bug 68132: + // Prior to the fix to bug 67916, FilterGenVariantBase was authoring + // connection paths. As a migration measure, we discard those + // variant selections here. + if (absPath.ContainsPrimVariantSelection()) + { + TF_WARN("Connection path <%s> (in file @%s@, line %zu) has a variant " + "selection, but variant selections are not meaningful in " + "connection paths. Stripping the variant selection and " + "using <%s> instead. Resaving the file will fix this issue.", + absPath.GetText(), + context.fileContext.c_str(), + in.position().line, + absPath.StripAllVariantSelections().GetText()); + + absPath = absPath.StripAllVariantSelections(); + } + context.connParsingTargetPaths.push_back(absPath); + } + else if(context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::InheritsListOpMetadata || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::SpecializesListOpMetadata) + { + const std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + context.savedPath = SdfPath(pathStr); + if (!context.savedPath.IsPrimPath()) { + std::string errorMessage = "'" + + pathStr + "' is not a valid prim path"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // Expand paths relative to the containing prim. + // + // This strips any variant selections from the containing prim + // path before expanding the relative path, which is what we + // want. Inherit paths are not allowed to be variants. + SdfPath absPath = + context.savedPath.MakeAbsolutePath(context.path.GetPrimPath()); + + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::InheritsListOpMetadata) + { + context.inheritParsingTargetPaths.push_back(absPath); + } + else + { + context.specializesParsingTargetPaths.push_back(absPath); + } + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipAssignment || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipTarget || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + SdfPath path(pathStr); + if (!path.IsAbsolutePath()) { + // Expand paths relative to the containing prim. + // + // This strips any variant selections from the containing prim + // path before expanding the relative path, which is what we + // want. Target paths never point into the variant namespace. + path = path.MakeAbsolutePath(context.path.GetPrimPath()); + } + + if (!context.relParsingTargetPaths) { + // This is the first target we've seen for this relationship. + // Start tracking them in a vector. + context.relParsingTargetPaths = SdfPathVector(); + } + context.relParsingTargetPaths->push_back(path); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipDefault) + { + std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + // If path is empty, use default c'tor to construct empty path. + // XXX: 08/04/08 Would be nice if SdfPath would allow + // SdfPath("") without throwing a warning. + SdfPath path = pathStr.empty() ? SdfPath() : SdfPath(pathStr); + context.data->Set(context.path, SdfFieldKeys->Default, VtValue(path)); + + if (!context.relParsingNewTargetChildren.empty()) { + std::vector children = + context.data->GetAs >( + context.path, SdfChildrenKeys->RelationshipTargetChildren); + + children.insert(children.end(), + context.relParsingNewTargetChildren.begin(), + context.relParsingNewTargetChildren.end()); + + context.data->Set( + context.path, + SdfChildrenKeys->RelationshipTargetChildren, + VtValue(children)); + } + + _PopContext(context); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelocatesMetadata) + { + std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + SdfPath path = SdfPath(pathStr); + if (!context.seenFirstRelocatesPath) + { + // this is the first relocates path + // store it - we will use it when we see + // the relocates value + context.relocatesKey = path; + context.seenFirstRelocatesPath = true; + } + else + { + // this is the relocates value + // store the key / value relocates item + // and reset the context + if (!SdfSchema::IsValidRelocatesPath(context.relocatesKey)) { + std::string errorMessage = "'" + + context.relocatesKey.GetAsString() + + "' is not a valid relocates path"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + if (!SdfSchema::IsValidRelocatesPath(path)) { + std::string errorMessage = "'" + + context.relocatesKey.GetAsString() + + "' is not a valid relocates path"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // The relocates map is expected to only hold absolute paths. The + // SdRelocatesMapProxy ensures that all paths are made absolute when + // editing, but since we're bypassing that proxy and setting the map + // directly into the underlying SdfData, we need to explicitly absolutize + // paths here. + const SdfPath srcPath = + context.relocatesKey.MakeAbsolutePath(context.path); + const SdfPath targetPath = + path.MakeAbsolutePath(context.path); + + context.relocatesParsing.emplace_back(std::move(srcPath), + std::move(targetPath)); + context.layerHints.mightHaveRelocates = true; + + context.relocatesKey = SdfPath(); + context.seenFirstRelocatesPath = false; + } + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReferencesListOpMetadata || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PayloadListOpMetadata) + { + std::string pathStr = Sdf_EvalQuotedString( + in.string().c_str(), + in.string().length(), + 1); + + SdfPath path = SdfPath(pathStr); + if (path.IsEmpty()) + { + context.savedPath = SdfPath::EmptyPath(); + } + else + { + if (!path.IsPrimPath()) + { + std::string errorMessage = "'" + + pathStr + "' is not a valid prim path"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.savedPath = path; + } + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReferencesListOpMetadata || + context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PayloadListOpMetadata) + { + std::string inputString = in.string(); + bool isTripleDelimited = TfStringStartsWith(inputString, "@@@"); + std::string evaluatedAssetPath = Sdf_EvalAssetPath( + inputString.c_str(), + inputString.length(), + isTripleDelimited); + + if (evaluatedAssetPath.empty()) + { + std::string errorMessage = + "Reference / payload asset path must not be empty. If this " + "is intended to be an internal reference / payload, " + "remove the '@' delimiters."; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.layerRefPath = evaluatedAssetPath; + context.layerRefOffset = SdfLayerOffset(); + context.savedPath = SdfPath::EmptyPath(); + } + else if(context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::SubLayerMetadata) + { + std::string inputString = in.string(); + bool isTripleDelimited = TfStringStartsWith(inputString, "@@@"); + std::string evaluatedAssetPath = Sdf_EvalAssetPath( + inputString.c_str(), + inputString.length(), + isTripleDelimited); + + context.layerRefPath = evaluatedAssetPath; + context.layerRefOffset = SdfLayerOffset(); + } + } +}; + +//////////////////////////////////////////////////////////////////////// +// Value actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // super special case for negative 0 + // we have to store this as a double to preserve + // the sign. There is no negative zero integral + // value, and we don't know at this point + // what the final stored type will be. + const std::pair result = + _GetNumericValueFromString(in.string_view()); + if(!result.first) + { + TF_WARN("Integer literal '%s' on line %zu%s%s out of range, parsing " + "as double. Consider exponential notation for large " + "floating point values.", in.string().c_str(), in.position().line, + context.fileContext.empty() ? "" : " in file ", + context.fileContext.empty() ? "" : + context.fileContext.c_str()); + + } + + context.values.AppendValue(result.second); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // the ParserValueContext needs identifiers to be stored + // as TfToken instead of std::string to be able to distinguish + // between them + context.values.AppendValue(TfToken(in.string())); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + std::string inputString = in.string(); + size_t numDelimeters = 1; + if(TfStringStartsWith(inputString, "\"\"\"") || + TfStringStartsWith(inputString, "'''")) + { + numDelimeters = 3; + } + + std::string evaluatedString = Sdf_EvalQuotedString( + inputString.c_str(), + inputString.length(), + numDelimeters); + + context.values.AppendValue(evaluatedString); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // the ParserValueContext needs asset paths to be stored + // as SdfAssetPath instead of std::string to be able to + // distinguish between them + std::string inputString = in.string(); + bool isTripleDelimited = TfStringStartsWith(inputString, "@@@"); + std::string evaluatedAssetPath = Sdf_EvalAssetPath( + inputString.c_str(), + inputString.length(), + isTripleDelimited); + + context.values.AppendValue(SdfAssetPath(evaluatedAssetPath)); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // this is the atomic value and we are completely + // finished reducing it + std::string errorMessage; + if (!_ValueSetAtomic(context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + std::string inputString = in.string(); + std::string pathRef = Sdf_EvalQuotedString( + inputString.c_str(), + inputString.length(), + 1); + + context.currentValue = pathRef.empty() ? SdfPath() : + SdfPath(pathRef); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::KeyValueMetadata) + { + _PopContext(context); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _SetDefault(context.path, context.currentValue, context); + } + else if(context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::TimeSamples) + { + context.timeSamples[context.timeSampleTime] = + context.currentValue; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderRootPrims) + { + context.data->Set(context.path, + SdfFieldKeys->PrimOrder, + VtValue(context.nameVector)); + + context.nameVector.clear(); + + _PopContext(context); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::VariantSetsMetadata) + { + // this evaluation is done here rather than in a reduction for + // VariantSetsMetadata because list op keyword are greedy and + // when there is a list op keyword there is no production for + // VariantSetsMetadata, even though the interior productions + // are the same + std::vector names; + names.reserve(context.nameVector.size()); + for (const auto& name : context.nameVector) { + const SdfAllowed allow = + SdfSchema::IsValidVariantIdentifier(name); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + names.push_back(name); + } + + std::string errorMessage; + if (!_SetListOpItemsWithError(SdfFieldKeys->VariantSetNames, + context.listOpType, names, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // If the op type is added or explicit, create the variant sets + if (context.listOpType == SdfListOpTypeAdded || + context.listOpType == SdfListOpTypeExplicit) { + for (const auto& i : context.nameVector) { + context.data->CreateSpec( + context.path.AppendVariantSelection(i, ""), + SdfSpecTypeVariantSet); + } + + context.data->Set( + context.path, + SdfChildrenKeys->VariantSetChildren, + VtValue(context.nameVector)); + } + + context.nameVector.clear(); + context.listOpType = SdfListOpTypeExplicit; + + // all done parsing the variant sets metadata + _PopContext(context); + + // if the operation was a list op, there is a listopMetadata + // context on the stack that also needs to be popped + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + _PopContext(context); + } + } + } +}; + +//////////////////////////////////////////////////////////////////////// +// Tuple actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.values.BeginTuple(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.values.EndTuple(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + std::string errorMessage; + if (!_ValueSetTuple(context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } +}; + +//////////////////////////////////////////////////////////////////////// +// List actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.values.BeginList(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.values.EndList(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + std::string errorMessage; + if (!_ValueSetList(context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // if were were parsing list op metadata, this signals the end + // of that context + Sdf_TextParserCurrentParsingContext parsingContext = + context.parsingContext.back(); + if (parsingContext == Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + // pop back out to the metadata context - the list op type will get reset + // when we reduce the final list op metadata production + _PopContext(context); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // it's an array type + // Set the recorded string on the ParserValueContext. Normally + // 'values' is able to keep track of the parsed string, but in this + // case it doesn't get the BeginList() and EndList() calls so the + // recorded string would have been "". We want "[]" instead. + if (context.values.IsRecordingString()) { + context.values.SetRecordedString("[]"); + } + + std::string errorMessage; + if(!_ValueSetShaped(context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } +}; + +//////////////////////////////////////////////////////////////////////// +// Dictionary actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // reset dictionary state + // dictionaries can be nested, so the expectation + // of a dictionary value as well as the current key + // are stack-based + context.expectDictionaryValue.push_back(false); + context.dictionaryTypeName.clear(); + + // set context to expect to parse a type name + // (unless we see the dictionary keyword) + _PushContext(context, Sdf_TextParserCurrentParsingContext::Dictionary); + _PushContext(context, Sdf_TextParserCurrentParsingContext::DictionaryTypeName); + + context.currentDictionaries.push_back(VtDictionary()); + + // Whenever we parse a value for an unregistered generic metadata field, + // the parser value context records the string representation only, because + // we don't have enough type information to generate a C++ value. However, + // dictionaries are a special case because we have all the type information + // we need to generate C++ values. So, override the previous setting. + if (context.values.IsRecordingString()) { + context.values.StopRecordingString(); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // when we hit a dictionary close, we need to pop the + // expectation of a dictionary value + context.expectDictionaryValue.pop_back(); + + // we also need to pop off two contexts + // the first is the DictionaryTypeName, which we pushed + // expecting the next key / value pair + // the second is the Dictionary context, which is now done + context.currentDictionaries.pop_back(); + _PopContext(context); + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // our initial guess is that a dictionary value won't be expected + // so we pushed false onto the stack, however, here we have to + // replace that value + context.expectDictionaryValue.pop_back(); + context.expectDictionaryValue.push_back(true); + + // pop off the type name state as we won't be parsing that + _PopContext(context); + + // push the dictionary key state + _PushContext(context, Sdf_TextParserCurrentParsingContext::DictionaryKey); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // pop off the type name state as we are done + _PopContext(context); + + if (!context.values.SetupFactory(context.dictionaryTypeName)) + { + std::string errorMessage = "Unrecognized value typename '" + + context.dictionaryTypeName + "' for dictionary"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // push the dictionary key context + _PushContext(context, Sdf_TextParserCurrentParsingContext::DictionaryKey); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + std::string dictionaryKey = in.string(); + if (TfStringStartsWith(dictionaryKey, "\"") || + TfStringStartsWith(dictionaryKey, "'")) + { + size_t numDelimeters = 1; + if(TfStringStartsWith(dictionaryKey, "\"\"\"") || + TfStringStartsWith(dictionaryKey, "'''")) + { + numDelimeters = 3; + } + + dictionaryKey = Sdf_EvalQuotedString( + dictionaryKey.c_str(), + dictionaryKey.length(), + numDelimeters); + } + + context.currentDictionaryKey.push_back(dictionaryKey); + + // done the dictionary key context + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // we've matched the value at this point, and we know whether + // or not the value should be a dictionary or typed value + // the last thing we need to do is insert the key / value pair + if (context.expectDictionaryValue.back()) + { + size_t n = context.currentDictionaries.size(); + // Insert the parsed dictionary into the parent dictionary. + context.currentDictionaries[n-2][context.currentDictionaryKey.back()].Swap( + context.currentDictionaries[n-1]); + // Clear out the last dictionary (there can be more dictionaries on the + // same nesting level). + context.currentDictionaries[n-1].clear(); + } + else + { + size_t n = context.currentDictionaries.size(); + context.currentDictionaries[n-2][context.currentDictionaryKey.back()] = + context.currentValue; + } + + // expect the next dictionary type name + // and reset dictionary state + _PushContext(context, Sdf_TextParserCurrentParsingContext::DictionaryTypeName); + + context.expectDictionaryValue.pop_back(); + context.currentDictionaryKey.pop_back(); + context.dictionaryTypeName.clear(); + + // expect the next value to be a typed value + context.expectDictionaryValue.push_back(false); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::KeyValueMetadata) + { + // it's a dictionary, we need to ensure the current + // value that gets set in the context is the dictionary + // we've been parsing + context.currentValue.Swap(context.currentDictionaries[0]); + context.currentDictionaries[0].clear(); + + _PopContext(context); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.currentDictionaries.push_back(VtDictionary()); + + // Whenever we parse a value for an unregistered generic metadata field, + // the parser value context records the string representation only, because + // we don't have enough type information to generate a C++ value. However, + // dictionaries are a special case because we have all the type information + // we need to generate C++ values. So, override the previous setting. + if (context.values.IsRecordingString()) { + context.values.StopRecordingString(); + } + + context.seenStringDictionaryKey = false; + context.stringDictionaryKey.clear(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.currentDictionaries.pop_back(); + } +}; + +//////////////////////////////////////////////////////////////////////// +// Common Metadata actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::Metadata); + + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + + std::string errorMessage; + if(!_KeyValueMetadataEnd(specType, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // no need to pop the parsing context as it was already popped in + // the individual reductions for None, TypedValue, and DictionaryValue + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + + std::string errorMessage; + if (!_KeyValueMetadataEnd(specType, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // no need to pop the parsing context as it was already popped in + // the individual reductions for None, TypedValue, and DictionaryValue + // but we do need to reset the list op type (we couldn't reset it + // before because _KeyValueMetadataEnd needed it and this reduces + // after the TypedValue) + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + + std::string errorMessage; + if (!_KeyValueMetadataEnd(specType, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // no need to pop the parsing context as it was already popped in + // the individual reductions for None, TypedValue, and DictionaryValue + // but we do need to reset the list op type (we couldn't reset it + // before because _KeyValueMetadataEnd needed it and this reduces + // after the TypedValue) + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::DocMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // finished the DocMetadata context + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // this signals the end of the symmetry function + // metadata context - if symmetryFunctionName is empty + // we set it as empty + context.data->Set( + context.path, + SdfFieldKeys->SymmetryFunction, + context.symmetryFunctionName.empty() ? VtValue(TfToken()) : + VtValue(TfToken(context.symmetryFunctionName))); + + _PopContext(context); + } +}; + +//////////////////////////////////////////////////////////////////////// +// Listop actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.listOpType = SdfListOpTypeAdded; + _PushContext(context, Sdf_TextParserCurrentParsingContext::ListOpMetadata); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.listOpType = SdfListOpTypeAdded; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.listOpType = SdfListOpTypeDeleted; + _PushContext(context, Sdf_TextParserCurrentParsingContext::ListOpMetadata); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.listOpType = SdfListOpTypeDeleted; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.listOpType = SdfListOpTypeAppended; + _PushContext(context, Sdf_TextParserCurrentParsingContext::ListOpMetadata); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.listOpType = SdfListOpTypeAppended; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.listOpType = SdfListOpTypePrepended; + _PushContext(context, Sdf_TextParserCurrentParsingContext::ListOpMetadata); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.listOpType = SdfListOpTypePrepended; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::Metadata) + { + context.listOpType = SdfListOpTypeOrdered; + _PushContext(context, Sdf_TextParserCurrentParsingContext::ListOpMetadata); + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + context.listOpType = SdfListOpTypeOrdered; + } + } +}; + +//////////////////////////////////////////////////////////////////////// +// Attribute actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PrimSpec) + { + context.primTypeName += "."; + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.variability = VtValue(SdfVariabilityVarying); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // convert legacy "config" variability to SdfVariabilityUniform + // this value was never officially used in USD but we handle + // this just in case the value was written outiform = "uniform"; + context.variability = VtValue(SdfVariabilityUniform); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.variability = VtValue(SdfVariabilityUniform); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.assoc = VtValue(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // once the AttributeType is reduced, we have the full + // type name of the attribute stored in attributeTypeName + // so we know what type the attribute is at this point + // (Note: we build the type name by Identifier and ArrayType + // reductions rather than here because otherwise we'd have + // to parse out the AttributeVariability as well) + context.values.SetupFactory(context.attributeTypeName); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (!context.values.valueTypeIsValid) { + context.values.StopRecordingString(); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // finished parsing an attribute spec + // reset the assumption that we are going to parse an + // attribute next unless a keyword tells us otherwise + // note that the parsing context on the stack simply remains + // it will get removed by e.g., relation if it's the wrong one + context.custom = false; + context.variability = VtValue(); + context.attributeTypeName.clear(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.timeSamples = SdfTimeSampleMap(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::TimeSamples); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.data->Set( + context.path, + SdfFieldKeys->TimeSamples, + VtValue(context.timeSamples)); + + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::ConnectAttribute); + + context.connParsingTargetPaths.clear(); + context.connParsingAllowConnectionData = true; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.connParsingTargetPaths.empty() && + context.listOpType != SdfListOpTypeExplicit) + { + std::string errorMessage = + "Setting connection paths to None (or an empty list) " + "is only allowed when setting explicit connection paths, " + "not for list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + for (const auto& path : context.connParsingTargetPaths) { + const SdfAllowed allow = + SdfSchema::IsValidAttributeConnectionPath(path); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + if (context.listOpType == SdfListOpTypeAdded || + context.listOpType == SdfListOpTypeExplicit) + { + for (const auto& pathIter : context.connParsingTargetPaths) { + SdfPath path = context.path.AppendTarget(pathIter); + if (!context.data->HasSpec(path)) + { + context.data->CreateSpec( + path, + SdfSpecTypeConnection); + } + } + + context.data->Set(context.path, + SdfChildrenKeys->ConnectionChildren, + VtValue(context.connParsingTargetPaths)); + } + + std::string errorMessage; + if (!_SetListOpItemsWithError(SdfFieldKeys->ConnectionPaths, + context.listOpType, + context.connParsingTargetPaths, + context, + errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.listOpType = SdfListOpTypeExplicit; + context.custom = false; + context.variability = VtValue(); + context.attributeTypeName.clear(); + + // done parsing the connection attribute context + _PopContext(context); + } +}; + +//////////////////////////////////////////////////////////////////////// +// Relationship actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + // we assume attribute spec by default unless there + // is an indication it isn't an attribute spec + // the keyword "rel" is a relation, so we remove + // the attribute spec context and replace it + _PopContext(context); + } + + // default variability for relationships is uniform + // but we may have seen the KeywordVarying prior to this + // keyword, so we check whether the value is empty (a reset default) + // or whether it was explicitly set to varying - if so we don't change it + if (context.variability.IsEmpty()) + { + context.variability = VtValue(SdfVariabilityUniform); + } + + _PushContext(context,Sdf_TextParserCurrentParsingContext::RelationshipSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // finished parsing an relationship spec + _PopContext(context); + + context.custom = false; + context.variability = VtValue(); + + // reset the assumption that we are going to parse an + // attribute next unless a keyword tells us otherwise + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::RelationshipDefault); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // if we hit an assignment in a relationship context + // this is a different context than if we didn't + // so we push that here + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::RelationshipAssignment); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // at the end of the relationship assigment, we assign the targets + // and pop the relationship assignment context + std::string errorMessage; + if (!context.relParsingTargetPaths) { + // No target paths were encountered. + + // pop the relationship assignment context if we had entered it + // since this is an optional assignment, we may never have + // seen the '=' + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipAssignment) + { + _PopContext(context); + } + + if (context.listOpType != SdfListOpTypeExplicit) + { + // in this case, we will never reduce a RelationshipSpec + // so we have to do here what we would have done in + // the RelationshipSpec reduction - this is an artifact + // that results from trying to be greedy about consuming + // list op keywords rather than a big sor on RelationshipSpec + // that would result in more backtracking + + // pop the relationship spec context + _PopContext(context); + + context.custom = false; + context.variability = VtValue(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } + + context.listOpType = SdfListOpTypeExplicit; + + return; + } + + if (context.relParsingTargetPaths->empty() && + context.listOpType != SdfListOpTypeExplicit) { + std::string errorMessage = + "Setting relationship targets to None (or empty list) " + "is only allowed when setting explicit targets, not for " + "list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + for (const auto& path : *context.relParsingTargetPaths) { + const SdfAllowed allow = + SdfSchema::IsValidRelationshipTargetPath(path); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + if (context.listOpType == SdfListOpTypeAdded || + context.listOpType == SdfListOpTypeExplicit) { + + // Initialize relationship target specs for each target path that + // is added in this layer. + for (const auto& pathIter : *context.relParsingTargetPaths) { + SdfPath targetPath = context.path.AppendTarget(pathIter); + if (!context.data->HasSpec(targetPath)) { + // Create relationship target spec by setting the appropriate + // object type flag. + context.data->CreateSpec( + targetPath, + SdfSpecTypeRelationshipTarget); + + // Add the target path to the owning relationship's list of target + // children. + context.relParsingNewTargetChildren.push_back(pathIter); + } + } + } + + if(!_SetListOpItemsWithError(SdfFieldKeys->TargetPaths, context.listOpType, + *context.relParsingTargetPaths, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + if (!context.relParsingNewTargetChildren.empty()) + { + std::vector children = + context.data->GetAs>( + context.path, SdfChildrenKeys->RelationshipTargetChildren); + + children.insert(children.end(), + context.relParsingNewTargetChildren.begin(), + context.relParsingNewTargetChildren.end()); + + context.data->Set( + context.path, + SdfChildrenKeys->RelationshipTargetChildren, + VtValue(children)); + } + + // pop the relationship assignment context if we had entered it + // since this is an optional assignment, we may never have + // seen the '=' + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::RelationshipAssignment) + { + _PopContext(context); + } + + if (context.listOpType != SdfListOpTypeExplicit) + { + // in this case, we will never reduce a RelationshipSpec + // so we have to do here what we would have done in + // the RelationshipSpec reduction - this is an artifact + // that results from trying to be greedy about consuming + // list op keywords rather than a big sor on RelationshipSpec + // that would result in more backtracking + + // pop the relationship spec context + _PopContext(context); + + context.custom = false; + context.variability = VtValue(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } + + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.relParsingTargetPaths = SdfPathVector(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::RelationshipTarget); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + SdfPath path = context.path.AppendTarget( + context.relParsingTargetPaths->back()); + + if (!context.data->HasSpec(path)) { + // Create relationship target spec by setting the appropriate + // object type flag. + context.data->CreateSpec(path, SdfSpecTypeRelationshipTarget); + + // Add the target path to the owning relationship's list of target + // children. + context.relParsingNewTargetChildren.push_back(context.relParsingTargetPaths->back()); + } + + // pop the relationship target context + _PopContext(context); + } +}; + +//////////////////////////////////////////////////////////////////////// +// Prim actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // this will reset the parent path for attributes, relations, + // connect values, etc. - the reason we do it here instead of + // the individual ends is because there is some ambiguity + // that would have to be resolved between non-list op attributes + // with connect values vs list op ones + context.path = context.path.GetParentPath(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // assume when parsing a prim spec that the default + // expectation is an attribute unless there is a + // keyword indication otherwise + context.custom = false; + context.variability = VtValue(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // store the names of our children + if (!context.nameChildrenStack.back().empty()) + { + context.data->Set(context.path, + SdfChildrenKeys->PrimChildren, + VtValue(context.nameChildrenStack.back())); + } + + // store the names of our properties, if there are any + if (!context.propertiesStack.back().empty()) + { + context.data->Set(context.path, + SdfChildrenKeys->PropertyChildren, + VtValue(context.propertiesStack.back())); + } + + // done parsing the prim spec, restore context state + // to parent context + context.nameChildrenStack.pop_back(); + context.propertiesStack.pop_back(); + context.path = context.path.GetParentPath(); + + // this will pop the default attribute context + // that we expect when parsing prim contents + _PopContext(context); + + // now we need to pop the prim spec itself + _PopContext(context); + + // if after popping if we aren't in the context + // of a layer spec, we are somewhere parsing inside + // of a parent prim / variant statement, so by default we should + // be looking for an attribute spec unless told otherwise + if (context.parsingContext.back() != + Sdf_TextParserCurrentParsingContext::LayerSpec) + { + context.custom = false; + context.variability = VtValue(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.specifier = SdfSpecifierDef; + + // if we are inside a prim spec or variant statement, we are expecting an + // attribute, but got a prim instead, so pop off the attribute + // context before pushing the prim context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::PrimSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.specifier = SdfSpecifierClass; + + // if we are inside a prim spec or variant statement, we are expecting an + // attribute, but got a prim instead, so pop off the attribute + // context before pushing the prim context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::PrimSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.specifier = SdfSpecifierOver; + + // if we are inside a prim spec or variant statement, we are expecting an + // attribute, but got a prim instead, so pop off the attribute + // context before pushing the prim context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::PrimSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::KindMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // done with the kind metdata context + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.relocatesKey = SdfPath(); + context.seenFirstRelocatesPath = false; + + _PushContext(context, Sdf_TextParserCurrentParsingContext::RelocatesMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // are we in a prim or a layer context? + // relocates metadata is top of the stack + // below it would be metadata and then the + // entity we want + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[2]; + if (specContext == + Sdf_TextParserCurrentParsingContext::PrimSpec) + { + SdfRelocatesMap relocatesParsingMap( + std::make_move_iterator(context.relocatesParsing.begin()), + std::make_move_iterator(context.relocatesParsing.end())); + + context.data->Set( + context.path, + SdfFieldKeys->Relocates, + VtValue(relocatesParsingMap)); + } + else if (specContext == + Sdf_TextParserCurrentParsingContext::LayerSpec) + { + context.data->Set( + context.path, + SdfFieldKeys->LayerRelocates, + VtValue(context.relocatesParsing)); + } + else + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + "Unable to parse relocates data, unknown context!"); + } + + context.relocatesParsing.clear(); + + // finished with relocates metadata + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // we may have seen a list op keyword, which + // would have put us in the listop parsing + // context, we replace that here with + // a references list op context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::PayloadListOpMetadata); + + context.layerRefPath = std::string(); + context.savedPath = SdfPath(); + context.layerRefOffset = SdfLayerOffset(); + context.payloadParsingRefs.clear(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.payloadParsingRefs.empty() && + context.listOpType != SdfListOpTypeExplicit) + { + std::string errorMessage = + "Setting payload to None (or an empty list)" + "is only allowed when setting explicit payloads," + " not for list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + + for (const auto& ref : context.payloadParsingRefs) { + const SdfAllowed allow = SdfSchema::IsValidPayload(ref); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + std::string errorMessage; + if (!_SetListOpItemsWithError(SdfFieldKeys->Payload, + context.listOpType, + context.payloadParsingRefs, + context, + errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.listOpType = SdfListOpTypeExplicit; + + // all done parsing the payload list + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + SdfPayload payload(context.layerRefPath, + context.savedPath, + context.layerRefOffset); + context.payloadParsingRefs.push_back(payload); + + context.layerRefPath.clear(); + context.savedPath = SdfPath::EmptyPath(); + context.layerRefOffset = SdfLayerOffset(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // we may have seen a list op keyword, which + // would have put us in the listop parsing + // context, we replace that here with + // a references list op context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::ReferencesListOpMetadata); + + context.layerRefPath = std::string(); + context.savedPath = SdfPath(); + context.layerRefOffset = SdfLayerOffset(); + context.referenceParsingRefs.clear(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::ReferenceParameters); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // all done parsing the reference parameters + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + SdfReference ref(context.layerRefPath, + context.savedPath, + context.layerRefOffset); + ref.SwapCustomData(context.currentDictionaries[0]); + context.referenceParsingRefs.push_back(ref); + + context.layerRefPath.clear(); + context.savedPath = SdfPath::EmptyPath(); + context.layerRefOffset = SdfLayerOffset(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::LayerOffset); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::LayerScale); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.referenceParsingRefs.empty() && + context.listOpType != SdfListOpTypeExplicit) { + std::string errorMessage = + "Setting references to None (or an empty list)" + "is only allowed when setting explicit references," + " not for list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + for (const auto& ref : context.referenceParsingRefs) { + const SdfAllowed allow = SdfSchema::IsValidReference(ref); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + std::string errorMessage; + if (!_SetListOpItemsWithError(SdfFieldKeys->References, + context.listOpType, + context.referenceParsingRefs, + context, + errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.listOpType = SdfListOpTypeExplicit; + + // all done parsing the references list + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // we may have seen a list op keyword, which would + // have put us in the listop parsing context + // we replace that with a specializes list op context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + _PopContext(context); + } + + context.specializesParsingTargetPaths.clear(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::SpecializesListOpMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // we may have seen a list op keyword, which would + // have put us in the listop parsing context + // we replace that with a inherits list op context + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ListOpMetadata) + { + _PopContext(context); + } + + context.inheritParsingTargetPaths.clear(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::InheritsListOpMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::InheritsListOpMetadata) + { + if (context.inheritParsingTargetPaths.empty() && + context.listOpType != SdfListOpTypeExplicit) { + std::string errorMessage = + "Setting inherit paths to None (or empty list) is only allowed " + "when setting explicit inherit paths, not for list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + for (const auto& path : context.inheritParsingTargetPaths) { + const SdfAllowed allow = SdfSchema::IsValidInheritPath(path); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + std::string errorMessage; + if (!_SetListOpItemsWithError( + SdfFieldKeys->InheritPaths, + context.listOpType, + context.inheritParsingTargetPaths, + context, + errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } + else if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::SpecializesListOpMetadata) + { + if (context.specializesParsingTargetPaths.empty() && + context.listOpType != SdfListOpTypeExplicit) { + std::string errorMessage = + "Setting specializes paths to None (or empty list) is only allowed " + "when setting explicit specializes paths, not for list editing"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + for (const auto& path : context.specializesParsingTargetPaths) { + const SdfAllowed allow = SdfSchema::IsValidSpecializesPath(path); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + } + + std::string errorMessage; + if (!_SetListOpItemsWithError( + SdfFieldKeys->Specializes, + context.listOpType, + context.specializesParsingTargetPaths, + context, + errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + } + + // all done parsing the inherits / specializes list + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::VariantsMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + SdfVariantSelectionMap refVars; + + // The previous parser implementation allowed multiple variant selection + // dictionaries in prim metadata to be merged, so we do the same here. + VtValue oldVars; + if (context.data->Has(context.path, SdfFieldKeys->VariantSelection, + &oldVars)) + { + refVars = oldVars.Get(); + } + + for (const auto& it : context.currentDictionaries[0]) { + if (!it.second.IsHolding()) { + std::string errorMessage = "variant name must be a string"; + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } else { + const std::string variantName = it.second.Get(); + const SdfAllowed allow = + SdfSchema::IsValidVariantSelection(variantName); + if (!allow) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + allow.GetWhyNot()); + + throw PEGTL_NS::parse_error(allow.GetWhyNot(), in); + } + + refVars[it.first] = variantName; + } + } + + context.data->Set( + context.path, + SdfFieldKeys->VariantSelection, + VtValue(refVars)); + + context.currentDictionaries[0].clear(); + + // all done parsing the variants metadata + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::VariantSetsMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // need to remove the attribute context that was pushed on before + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + _PopContext(context); + } + + _PushContext(context, Sdf_TextParserCurrentParsingContext::VariantSetStatement); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // parsing the contents of a variant statement is like + // parsing the contents of a prim, so we have to assume + // that the first thing we will see is an attribute spec + // until keywords contextualize us otherwise + context.custom = false; + context.variability = VtValue(); + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // this should be an attribute spec context + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::VariantStatementList); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // all done parsing variant statement list + _PopContext(context); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // Store the names of the prims and properties defined in this variant. + if (!context.nameChildrenStack.back().empty()) { + context.data->Set( + context.path, + SdfChildrenKeys->PrimChildren, + VtValue(context.nameChildrenStack.back())); + } + if (!context.propertiesStack.back().empty()) { + context.data->Set( + context.path, + SdfChildrenKeys->PropertyChildren, + VtValue(context.propertiesStack.back())); + } + + context.nameChildrenStack.pop_back(); + context.propertiesStack.pop_back(); + + std::string variantSet = context.path.GetVariantSelection().first; + context.path = + context.path.GetParentPath().AppendVariantSelection(variantSet, ""); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + SdfPath variantSetPath = context.path; + context.path = context.path.GetParentPath(); + + // Create this VariantSetSpec if it does not already exist. + if (!context.data->HasSpec(variantSetPath)) + { + context.data->CreateSpec(variantSetPath, + SdfSpecTypeVariantSet); + + // add the name of this variant set to the VariantSets field + std::vector vec = + context.data->GetAs>(context.path, + SdfChildrenKeys->VariantSetChildren); + + vec.push_back(TfToken(context.currentVariantSetNames.back())); + context.data->Set(context.path, + SdfChildrenKeys->VariantSetChildren, + VtValue(vec)); + } + + // Author the variant set's variants + context.data->Set(variantSetPath, + SdfChildrenKeys->VariantChildren, + VtValue(TfToTokenVector(context.currentVariantNames.back()))); + + context.currentVariantSetNames.pop_back(); + context.currentVariantNames.pop_back(); + + // all done parsing variant set statement + _PopContext(context); + + // at the end of this context, we jump back into the prim context + // which means by default we need to expect an attribute + context.custom = false; + context.variability = VtValue(); + _PushContext(context, Sdf_TextParserCurrentParsingContext::AttributeSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::ReorderNameChildren); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::ReorderProperties); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderNameChildren) + { + context.data->Set( + context.path, + SdfFieldKeys->PrimOrder, + VtValue(context.nameVector)); + + _PopContext(context); + } + else if(context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::ReorderProperties) + { + context.data->Set( + context.path, + SdfFieldKeys->PropertyOrder, + VtValue(context.nameVector)); + + _PopContext(context); + } + + // the list op type got set by the reorder keyword so reset it here + context.listOpType = SdfListOpTypeExplicit; + context.nameVector.clear(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::PrefixSubstitutionsMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::SuffixSubstitutionsMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (context.parsingContext.back() == + Sdf_TextParserCurrentParsingContext::PrefixSubstitutionsMetadata) + { + context.data->Set( + context.path, + SdfFieldKeys->PrefixSubstitutions, + VtValue(context.currentDictionaries[0])); + } + else + { + // suffix substitutions + context.data->Set( + context.path, + SdfFieldKeys->SuffixSubstitutions, + VtValue(context.currentDictionaries[0])); + } + + context.currentDictionaries[0].clear(); + + // done with this context + _PopContext(context); + } +}; + +//////////////////////////////////////////////////////////////////////// +// Layer actions + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + const std::string cookie = TfStringTrimRight(in.string()); + const std::string expected = "#" + context.magicIdentifierToken + " "; + if (TfStringStartsWith(cookie, expected)) + { + if (!context.versionString.empty() && + !TfStringEndsWith(cookie, context.versionString)) + { + TF_WARN("File '%s' is not the latest %s version (found '%s', " + "expected '%s'). The file may parse correctly and yield " + "incorrect results.", + context.fileContext.c_str(), + context.magicIdentifierToken.c_str(), + cookie.substr(expected.length()).c_str(), + context.versionString.c_str()); + } + } + else + { + // throw error + std::string errorMessage = TfStringPrintf( + "Magic Cookie '%s'. Expected prefix of '%s'", + TfStringTrim(cookie).c_str(), + expected.c_str()); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + context.nameChildrenStack.push_back(std::vector()); + context.data->CreateSpec( + SdfPath::AbsoluteRootPath(), SdfSpecTypePseudoRoot); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::LayerSpec); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + // store the names of the root prims + context.data->Set(SdfPath::AbsoluteRootPath(), + SdfChildrenKeys->PrimChildren, + VtValue(context.nameChildrenStack.back())); + + context.nameChildrenStack.pop_back(); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + _PushContext(context, Sdf_TextParserCurrentParsingContext::ReorderRootPrims); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + Sdf_TextParserCurrentParsingContext specContext = + context.parsingContext.rbegin()[1]; + SdfSpecType specType = _GetSpecTypeFromContext(specContext); + + std::string errorMessage; + if (!_KeyValueMetadataEnd(specType, context, errorMessage)) + { + Sdf_TextFileFormatParser_Err( + context, + in.input(), + in.position(), + errorMessage); + + throw PEGTL_NS::parse_error(errorMessage, in); + } + + // no need to pop the parsing context as it was already popped in + // the individual reductions for None, TypedValue, and DictionaryValue + context.listOpType = SdfListOpTypeExplicit; + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.subLayerPaths.clear(); + context.subLayerOffsets.clear(); + + _PushContext(context, Sdf_TextParserCurrentParsingContext::SubLayerMetadata); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + context.subLayerPaths.push_back(context.layerRefPath); + context.subLayerOffsets.push_back(context.layerRefOffset); + } +}; + +template <> +struct TextParserAction +{ + template + static void apply(const Input& in, Sdf_TextParserContext& context) + { + if (!context.subLayerPaths.empty()) + { + context.data->Set(SdfPath::AbsoluteRootPath(), + SdfFieldKeys->SubLayers, + VtValue(context.subLayerPaths)); + + context.data->Set(SdfPath::AbsoluteRootPath(), + SdfFieldKeys->SubLayerOffsets, + VtValue(context.subLayerOffsets)); + + context.subLayerPaths.clear(); + context.subLayerOffsets.clear(); + } + + _PopContext(context); + } +}; + +} // end namespace Sdf_TextFileFormatParser + +//////////////////////////////////////////////////////////////////////// +// Parsing entry-point methods + +/// Parse a text layer into an SdfData +bool +Sdf_ParseLayer( + const std::string& fileContext, + const std::shared_ptr& asset, + const std::string& magicId, + const std::string& versionString, + bool metadataOnly, + SdfDataRefPtr data, + SdfLayerHints *hints) +{ + TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayer"); + + TRACE_FUNCTION(); + + // Configure for input file. + Sdf_TextParserContext context; + + context.data = data; + context.fileContext = fileContext; + context.magicIdentifierToken = magicId; + context.versionString = versionString; + + // read the entire file into memory + size_t size = asset->GetSize(); + std::string buffer(size, ' '); + if (asset->Read(&buffer[0], size, 0) != size) + { + TF_RUNTIME_ERROR("Failed to read asset contents @%s@: " + "an error occurred while reading", + fileContext.c_str()); + } + + Sdf_TextFileFormatParser::PEGTL_NS::string_input<> content { std::move(buffer), fileContext}; + context.values.errorReporter = + std::bind(Sdf_TextFileFormatParser::_ReportParseError< + Sdf_TextFileFormatParser::PEGTL_NS::string_input<>>, + std::ref(context), std::cref(content), std::placeholders::_1); + bool status = false; + try + { + if (!metadataOnly) + { + status = Sdf_TextFileFormatParser::PEGTL_NS::parse< + Sdf_TextFileFormatParser::PEGTL_NS::must, + Sdf_TextFileFormatParser::TextParserAction, + Sdf_TextFileFormatParser::TextParserControl>(content, context); + *hints = context.layerHints; + } + else + { + // note the absence of the eof here - there will be more + // content in the layer and we don't know what that content is, + // so we stop at reduction of LayerMetadataOnly + status = Sdf_TextFileFormatParser::PEGTL_NS::parse< + Sdf_TextFileFormatParser::PEGTL_NS::must, + Sdf_TextFileFormatParser::TextParserAction, + Sdf_TextFileFormatParser::TextParserControl>(content, context); + *hints = context.layerHints; + } + } + catch (std::bad_variant_access const &) + { + TF_CODING_ERROR("Bad variant access in layer parser."); + Sdf_TextFileFormatParser::Sdf_TextFileFormatParser_Err( + context, + content, + content.position(), + "Internal layer parser error."); + + throw Sdf_TextFileFormatParser::PEGTL_NS::parse_error("Internal layer parser error", content); + } + catch (const Sdf_TextFileFormatParser::PEGTL_NS::parse_error& e) + { + Sdf_TextFileFormatParser::Sdf_TextFileFormatParser_Err( + context, + content, + e.positions().size() == 0 ? content.position() : e.positions()[0], + e.what()); + } + + return status; +} + +/// Parse a layer text string into an SdfData +bool +Sdf_ParseLayerFromString( + const std::string & layerString, + const std::string & magicId, + const std::string & versionString, + SdfDataRefPtr data, + SdfLayerHints *hints) +{ + TfAutoMallocTag2 tag("Sdf", "Sdf_ParseLayerFromString"); + + TRACE_FUNCTION(); + + // Configure for input string. + Sdf_TextParserContext context; + + context.data = data; + context.magicIdentifierToken = magicId; + context.versionString = versionString; + + Sdf_TextFileFormatParser::PEGTL_NS::string_input<> content { std::move(layerString), ""}; + context.values.errorReporter = + std::bind(Sdf_TextFileFormatParser::_ReportParseError>, + std::ref(context), std::cref(content), std::placeholders::_1); + bool status = false; + try + { + status = Sdf_TextFileFormatParser::PEGTL_NS::parse< + Sdf_TextFileFormatParser::PEGTL_NS::must, + Sdf_TextFileFormatParser::TextParserAction, + Sdf_TextFileFormatParser::TextParserControl>(content, context); + } + catch (std::bad_variant_access const &) + { + TF_CODING_ERROR("Bad variant access in layer parser."); + Sdf_TextFileFormatParser::Sdf_TextFileFormatParser_Err( + context, + content, + content.position(), + "Internal layer parser error."); + + throw Sdf_TextFileFormatParser::PEGTL_NS::parse_error("Internal layer parser error", content); + } + catch (const Sdf_TextFileFormatParser::PEGTL_NS::parse_error& e) + { + Sdf_TextFileFormatParser::Sdf_TextFileFormatParser_Err( + context, + content, + e.positions().size() == 0 ? content.position() : e.positions()[0], + e.what()); + } + + return status; +} + +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/pxr/usd/sdf/textFileFormatParser.h b/pxr/usd/sdf/textFileFormatParser.h new file mode 100644 index 0000000000..12e8bd1d2d --- /dev/null +++ b/pxr/usd/sdf/textFileFormatParser.h @@ -0,0 +1,1325 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the Apache License, Version 2.0 (the "Apache License") +// with the following modification; you may not use this file except in +// compliance with the Apache License and the following modification to it: +// Section 6. Trademarks. is deleted and replaced with: +// +// 6. Trademarks. This License does not grant permission to use the trade +// names, trademarks, service marks, or product names of the Licensor +// and its affiliates, except as required to comply with Section 4(c) of +// the License and to reproduce the content of the NOTICE file. +// +// You may obtain a copy of the Apache License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the Apache License with the above modification is +// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the Apache License for the specific +// language governing permissions and limitations under the Apache License. +// +#ifndef PXR_USD_SDF_TEXT_FILE_FORMAT_PARSER_H +#define PXR_USD_SDF_TEXT_FILE_FORMAT_PARSER_H + +#include "pxr/pxr.h" +#include "pxr/base/pegtl/pegtl.hpp" +#include "pxr/base/tf/debug.h" +#include "pxr/base/tf/stringUtils.h" +#include "pxr/base/tf/token.h" +#include "pxr/base/vt/value.h" +#include "pxr/usd/sdf/data.h" +#include "pxr/usd/sdf/debugCodes.h" +#include "pxr/usd/sdf/listOp.h" +#include "pxr/usd/sdf/path.h" +#include "pxr/usd/sdf/pathParser.h" +#include "pxr/usd/sdf/parserHelpers.h" +#include "pxr/usd/sdf/parserValueContext.h" +#include "pxr/usd/sdf/schema.h" +#include "pxr/usd/sdf/textParserContext.h" + +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +//////////////////////////////////////////////////////////////////////// +// TextFileFormat grammar: +// We adopt the convention in the following PEGTL rules where they take +// care of "internal padding" (i.e. whitespace within the grammar rule +// itself) but not "external padding" (i.e. they will not consume +// whitespace prior to the first token, nor whitespace following the +// last token in the rule). +// +// The exception to this rule is the class of "separators" which do +// try to consume leading and trailing whitespace where appropriate +namespace Sdf_TextFileFormatParser { + +namespace PEGTL_NS = PXR_PEGTL_NAMESPACE; + +// special characters +// note - Dot comes from pathParser.h +struct SingleQuote : PEGTL_NS::one<'\''> {}; +struct DoubleQuote : PEGTL_NS::one<'"'> {}; +struct LeftParen : PEGTL_NS::one<'('> {}; +struct RightParen : PEGTL_NS::one<')'> {}; +struct LeftBrace : PEGTL_NS::one<'['> {}; +struct RightBrace : PEGTL_NS::one<']'> {}; +struct LeftCurlyBrace : PEGTL_NS::one<'{'> {}; +struct RightCurlyBrace : PEGTL_NS::one<'}'> {}; +struct LeftAngleBracket : PEGTL_NS::one<'<'> {}; +struct RightAngleBracket : PEGTL_NS::one<'>'> {}; +struct At : PEGTL_NS::one<'@'> {}; +struct Equals : PEGTL_NS::one<'='> {}; +struct Sign : PEGTL_NS::one<'+', '-'> {}; +struct Minus : PEGTL_NS::one<'-'> {}; +struct Exponent : PEGTL_NS::one<'e', 'E'> {}; +struct Space : PEGTL_NS::one<' ', '\t'> {}; + +// character classes +struct Digit : PEGTL_NS::digit {}; +struct HexDigit : PEGTL_NS::xdigit {}; +struct OctDigit : PEGTL_NS::range<0, 7> {}; +struct Eol : PEGTL_NS::one<'\r', '\n'> {}; +struct Eolf : PEGTL_NS::eolf {}; +struct Utf8 : PEGTL_NS::utf8::any {}; +struct Utf8NoEolf : PEGTL_NS::minus {}; + +// Escape character sets as defined by `TfEscapeStringReplaceChar` plus quotes +struct EscapeSingleCharacter : + PEGTL_NS::seq> {}; +struct EscapeHex : + PEGTL_NS::seq, + PEGTL_NS::rep_opt<2, HexDigit>> {}; +struct EscapeOct : + PEGTL_NS::seq> {}; +struct Escaped : + PEGTL_NS::seq, + PEGTL_NS::sor> {}; + +// keyword +struct KeywordAdd : PXR_PEGTL_KEYWORD("add") {}; +struct KeywordAppend : PXR_PEGTL_KEYWORD("append") {}; +struct KeywordClass : PXR_PEGTL_KEYWORD("class") {}; +struct KeywordConfig : PXR_PEGTL_KEYWORD("config") {}; +struct KeywordConnect : PXR_PEGTL_KEYWORD("connect") {}; +struct KeywordCustom : PXR_PEGTL_KEYWORD("custom") {}; +struct KeywordCustomData : PXR_PEGTL_KEYWORD("customData") {}; +struct KeywordDefault : PXR_PEGTL_KEYWORD("default") {}; +struct KeywordDef : PXR_PEGTL_KEYWORD("def") {}; +struct KeywordDelete : PXR_PEGTL_KEYWORD("delete") {}; +struct KeywordDictionary : PXR_PEGTL_KEYWORD("dictionary") {}; +struct KeywordDisplayUnit : PXR_PEGTL_KEYWORD("displayUnit") {}; +struct KeywordDoc : PXR_PEGTL_KEYWORD("doc") {}; +struct KeywordInherits : PXR_PEGTL_KEYWORD("inherits") {}; +struct KeywordKind : PXR_PEGTL_KEYWORD("kind") {}; +struct KeywordNameChildren : PXR_PEGTL_KEYWORD("nameChildren") {}; +struct KeywordNone : PXR_PEGTL_KEYWORD("None") {}; +struct KeywordOffset : PXR_PEGTL_KEYWORD("offset") {}; +struct KeywordOver : PXR_PEGTL_KEYWORD("over") {}; +struct KeywordPayload : PXR_PEGTL_KEYWORD("payload") {}; +struct KeywordPermission : PXR_PEGTL_KEYWORD("permission") {}; +struct KeywordPrefixSubstitutions : PXR_PEGTL_KEYWORD("prefixSubstitutions") {}; +struct KeywordPrepend : PXR_PEGTL_KEYWORD("prepend") {}; +struct KeywordProperties : PXR_PEGTL_KEYWORD("properties") {}; +struct KeywordReferences : PXR_PEGTL_KEYWORD("references") {}; +struct KeywordRelocates : PXR_PEGTL_KEYWORD("relocates") {}; +struct KeywordRel : PXR_PEGTL_KEYWORD("rel") {}; +struct KeywordReorder : PXR_PEGTL_KEYWORD("reorder") {}; +struct KeywordRootPrims : PXR_PEGTL_KEYWORD("rootPrims") {}; +struct KeywordScale : PXR_PEGTL_KEYWORD("scale") {}; +struct KeywordSubLayers : PXR_PEGTL_KEYWORD("subLayers") {}; +struct KeywordSuffixSubstitutions : PXR_PEGTL_KEYWORD("suffixSubstitutions") {}; +struct KeywordSpecializes : PXR_PEGTL_KEYWORD("specializes") {}; +struct KeywordSymmetryArguments : PXR_PEGTL_KEYWORD("symmetryArguments") {}; +struct KeywordSymmetryFunction : PXR_PEGTL_KEYWORD("symmetryFunction") {}; +struct KeywordTimeSamples : PXR_PEGTL_KEYWORD("timeSamples") {}; +struct KeywordUniform : PXR_PEGTL_KEYWORD("uniform") {}; +struct KeywordVariantSet : PXR_PEGTL_KEYWORD("variantSet") {}; +struct KeywordVariantSets : PXR_PEGTL_KEYWORD("variantSets") {}; +struct KeywordVariants : PXR_PEGTL_KEYWORD("variants") {}; +struct KeywordVarying : PXR_PEGTL_KEYWORD("varying") {}; + +struct Keywords : PEGTL_NS::sor< +KeywordAdd, +KeywordAppend, +KeywordClass, +KeywordConfig, +KeywordConnect, +KeywordCustom, +KeywordCustomData, +KeywordDefault, +KeywordDef, +KeywordDelete, +KeywordDictionary, +KeywordDisplayUnit, +KeywordDoc, +KeywordInherits, +KeywordKind, +KeywordNameChildren, +KeywordNone, +KeywordOffset, +KeywordOver, +KeywordPayload, +KeywordPermission, +KeywordPrefixSubstitutions, +KeywordPrepend, +KeywordProperties, +KeywordReferences, +KeywordRelocates, +KeywordRel, +KeywordReorder, +KeywordRootPrims, +KeywordScale, +KeywordSubLayers, +KeywordSuffixSubstitutions, +KeywordSpecializes, +KeywordSymmetryArguments, +KeywordSymmetryFunction, +KeywordTimeSamples, +KeywordUniform, +KeywordVariantSet, +KeywordVariantSets, +KeywordVariants, +KeywordVarying +> {}; + +struct MathKeywordInf : PXR_PEGTL_KEYWORD("inf") {}; +struct MathKeywordNan : PXR_PEGTL_KEYWORD("nan") {}; + +// PythonStyleComment = # (NonCrlfUtf8Character)* +// CppStyleSingleLineComment = // (NonCrlfUtf8Character)* +// CppStyleMultiLineComment = /* (!(*/) (Utf8Character)*) */ +// Comment = PythonStyleComment / +// CppStyleSingleLineComment / +// CppStyleMultiLineComment +struct CppStyleMultilineOpen : + PEGTL_NS::seq, PEGTL_NS::one<'*'>> {}; +struct CppStyleMultilineClose : + PEGTL_NS::seq, PEGTL_NS::one<'/'>> {}; +struct SingleLineContents : PEGTL_NS::star, Utf8> {}; +struct PythonStyleComment :PEGTL_NS::disable< + PEGTL_NS::one<'#'>, SingleLineContents> {}; +struct CppStyleSingleLineComment : PEGTL_NS::disable< + PEGTL_NS::two<'/'>, SingleLineContents> {}; +struct CppStyleMultiLineComment : PEGTL_NS::disable< + CppStyleMultilineOpen, + PEGTL_NS::until>{}; +// Use to avoid '/' backtracking +struct CppStyleComment : + PEGTL_NS::seq< + PEGTL_NS::one<'/'>, + PEGTL_NS::sor< + PEGTL_NS::disable, + PEGTL_NS::until>, + PEGTL_NS::disable, SingleLineContents> + > + > {}; +struct Comment : PEGTL_NS::sor {}; + +// whitespace rules +// TokenSeparator represents whitespace between tokens, +// which can include space, tab, and c++ multiline style comments +// but MUST include a single space / tab character, that is: +// def/*comment*/foo is illegal but +// def /*comment*/foo or +// def/*comment*/ foo are both legal +// TokenSeparator = (Space)+ (CppStyleMultiLineComment (Space)*)?)* / +// (CppStyleMultiLineComment (Space)*)?)* (Space)+ +struct InlinePadding : + PEGTL_NS::sor{}; +struct SinglelinePadding : + PEGTL_NS::sor{}; +struct MultilinePadding : + PEGTL_NS::sor{}; +struct TokenSeparator : + PEGTL_NS::pad {}; + +// array type +struct ArrayType : PEGTL_NS::if_must< + LeftBrace, + PEGTL_NS::star, + RightBrace> {}; + +// separators +// ListSeparator = , (NewLines)? +// ListEnd = ListSeparator / +// (NewLines)? +// StatementSeparator = ; (NewLines)? / +// NewLines +// StatementEnd = StatementSeparator / +// (NewLines)? +// Assignment = (TokenSeparator)? = (TokenSeparator)? +struct ListSeparator : PEGTL_NS::one<','> {}; +struct StatementSeparator : + PEGTL_NS::sor> {}; +struct NamespaceSeparator : PEGTL_NS::one<':'> {}; +struct CXXNamespaceSeparator : PEGTL_NS::two<':'> {}; +struct Assignment : PEGTL_NS::pad {}; + +// generic lists +template +struct ListOf : + PEGTL_NS::list_tail< + R, PEGTL_NS::pad> {}; + +// generic statements +template +struct StatementSequenceOf : + PEGTL_NS::list_tail< + R, + PEGTL_NS::pad> {}; + +// numbers +// Number = ((-)? ((Digit)+ / (Digit)+ . (Digit)+ / . (Digit)+) (ExponentPart)?) / +// inf / +// -inf / +// nan +struct ExponentPart : PEGTL_NS::opt_must< + Exponent, + PEGTL_NS::opt, + PEGTL_NS::plus> {}; +struct NumberStandard : PEGTL_NS::seq< + PEGTL_NS::plus, + PEGTL_NS::opt_must>, + ExponentPart> {}; +struct NumberLeadingDot : PEGTL_NS::seq< + PEGTL_NS::if_must>, + ExponentPart> {}; +struct Number : PEGTL_NS::sor< + PEGTL_NS::seq< + PEGTL_NS::opt, + PEGTL_NS::sor>, + MathKeywordNan> {}; + +// strings +// EscapedDoubleQuote = \" +// DoubleQuoteSingleLineStringChar = EscapedDoubleQuote / !" NonCrlfUtf8Character +// EscapedSingleQuote = \' +// SingleQuoteSingleLineStringChar = EscapedSingleQuote / !' NonCrlfUtf8Character +// DoubleQuoteMultiLineStringChar = EscapedDoubleQuote / !" Utf8Character +// SingleQuoteMultiLineStringChar = EscapedSingleQuote / !' Utf8Character +// String = " DoubleQuoteSingleLineStringChar* " / +// """ DoubleQuoteMultiLineStringChar* """ / +// ' SingleQuoteSingleLineStringChar* ' / +// ''' SingleQuoteMultiLineStringChar* ' +struct MultilineContents : PEGTL_NS::sor {}; +struct ThreeSingleQuotes : + PEGTL_NS::seq {}; +struct ThreeDoubleQuotes : + PEGTL_NS::seq {}; +struct MultilineSingleQuoteString : PEGTL_NS::if_must< + ThreeSingleQuotes, + PEGTL_NS::until> {}; +struct MultilineDoubleQuoteString : PEGTL_NS::if_must< + ThreeDoubleQuotes, + PEGTL_NS::until> {}; +struct SinglelineContents : PEGTL_NS::sor {}; +struct SinglelineSingleQuoteString : PEGTL_NS::if_must< + SingleQuote, + PEGTL_NS::until> {}; +struct SinglelineDoubleQuoteString : PEGTL_NS::if_must< + DoubleQuote, + PEGTL_NS::until> {}; +struct SingleQuoteString : PEGTL_NS::sor< + MultilineSingleQuoteString, + SinglelineSingleQuoteString> {}; +struct DoubleQuoteString : PEGTL_NS::sor< + MultilineDoubleQuoteString, + SinglelineDoubleQuoteString> {}; +struct String : PEGTL_NS::sor< + SingleQuoteString, + DoubleQuoteString> {}; + +// // asset references +struct AtAtAt : PEGTL_NS::seq {}; +struct EscapeAtAtAt : + PEGTL_NS::seq, AtAtAt> {}; + +// AssetRefCharacter = !@ NonCrlfUtf8Character +// EscapedTripleAt = \@@@ +// AssetRefTripleCharacter = EscapedTripleAt / !@ NonCrlfUtf8Character +// AssetRef = @ (AssetRefCharacter)* @ / +// @@@ (AssetRefTripleCharacter)* (@ / @@)? @@@ +struct AssetRef : PEGTL_NS::sor< + PEGTL_NS::if_must< + AtAtAt, + // A triple quoted asset path is closed by 3-5 @, with the last three + // always "closing" and the previous 0-2 being considered a part of the + // asset path. + PEGTL_NS::until>, + PEGTL_NS::sor>>, + PEGTL_NS::if_must< + At, + PEGTL_NS::until>>{}; + +// path reference +// PathRef = <> / +// < Path > +struct PathRef : PEGTL_NS::if_must< + LeftAngleBracket, + PEGTL_NS::sor< + RightAngleBracket, + PEGTL_NS::seq< + Sdf_PathParser::Path, + RightAngleBracket>>> {}; + +// LayerOffset = offset Assignment Number / +// scale Assignment Number +struct LayerOffset : PEGTL_NS::seq< + PEGTL_NS::sor< + KeywordOffset, + KeywordScale>, + Assignment, + Number> {}; + +// grammar rule that matches UTF-8 identifiers +struct BaseIdentifier : Sdf_PathParser::Utf8Identifier {}; +struct KeywordlessIdentifier : PEGTL_NS::minus< + Sdf_PathParser::Utf8Identifier, Keywords> {}; +struct NamespacedIdentifier : + PEGTL_NS::list{}; + +// CXXNamespacedIdentifier = KeywordlessIdentifier (:: KeywordlessIdentifier)+ +// Identifier = CXXNamespacedIdentifier / +// KeywordlessIdentifier +struct Identifier : + PEGTL_NS::list {}; +struct NamespacedName : PEGTL_NS::sor {}; + +// atomic values +struct NumberValue : Number {}; +struct IdentifierValue : Identifier {}; +struct StringValue : String {}; +struct AssetRefValue : AssetRef {}; +struct AtomicValue : PEGTL_NS::sor< + NumberValue, + IdentifierValue, + StringValue, + AssetRefValue> {}; + +struct TypedTupleValue; +struct TypedListValue; +struct EmptyListValue; +struct PathRefValue : PathRef {}; + +// TypedValue = AtomicValue / +// TupleValue / +// [ (TokenSpace)? ] / +// ListValue / +// PathRefValue +struct TypedValue : PEGTL_NS::sor< + AtomicValue, + TypedTupleValue, + EmptyListValue, + TypedListValue, + PathRefValue> {}; + +// tuple values +// TupleItem = AtomicValue / +// TupleValue +// TupleInterior = TupleInterior ListSeparator (TokenSpace)? TupleItem (TokenSpace)? / +// (TokenSpace)? TupleItem (TokenSpace)? +// TupleValue = ( (NewLines)? TupleInterior ListEnd (TokenSpace)? ) +struct TupleValue; +struct TupleValueOpen : LeftParen {}; +struct TupleValueClose : RightParen {}; +struct TupleValueItem : PEGTL_NS::sor< + NumberValue, + IdentifierValue, + StringValue, + AssetRefValue, + TupleValue> {}; + +struct TupleValue : PEGTL_NS::if_must< + TupleValueOpen, + PEGTL_NS::pad< + ListOf, + MultilinePadding>, + TupleValueClose> {}; +struct TypedTupleValue : TupleValue {}; + +// list values +// ListItem = AtomicValue / +// ListValue / +// TupleValue +// ListInterior = ListInterior ListSeparator (TokenSpace)? ListItem (TokenSpace)? / +// (TokenSpace)? ListItem (TokenSpace)? +// ListValue = [ (NewLines)? ListInterior ListEnd (TokenSpace)? ] +struct ListValue; +struct ListValueOpen : LeftBrace {}; +struct ListValueClose : RightBrace {}; +struct ListValueItem : PEGTL_NS::sor< + NumberValue, + IdentifierValue, + StringValue, + AssetRefValue, + ListValue, + TupleValue> {}; +struct ListValue : PEGTL_NS::if_must< + ListValueOpen, + PEGTL_NS::pad< + ListOf, + MultilinePadding>, + ListValueClose> {}; +struct TypedListValue : ListValue {}; + +// empty list value uses LeftBrace / RightBrace +// rather than ListValueOpen / ListValueClose +// because it doesn't want to execute the +// action semantics on reduction +struct EmptyListValue : PEGTL_NS::seq< + LeftBrace, + PEGTL_NS::star, + RightBrace> {}; + +// dictionary values +// DictionaryKey = String / +// Identifier / +// Keyword +// KeyValuePair = DictionaryKey Assignment TypedValue +// KeyDictionaryValuePair = DictionaryKey Assignment DictionaryValue +// DictionaryItemTypedValue = Identifier TokenSpace KeyValuePair / +// Identifier (TokenSpace)? [ (TokenSpace)? ] TokenSpace KeyValuePair +// DictionaryItemDictionaryValue = dictionary TokenSpace KeyDictionaryValuePair +// DictionaryItem = DictionaryItemDictionaryValue / +// DictionaryItemTypedValue +// DictionaryInterior = DictionaryInterior StaementSeparator (TokenSpace)? DictionaryItem (TokenSpace)? / +// (TokenSpace)? DictionaryItem (TokenSpace)? +// DictionaryValue = { (NewLines)? DictionaryInterior StatementEnd (TokenSpace)? } +struct DictionaryValue; +struct DictionaryValueOpen : LeftCurlyBrace {}; +struct DictionaryValueClose : RightCurlyBrace {}; +struct DictionaryKey : PEGTL_NS::sor< + String, + Identifier, + Keywords> {}; +struct DictionaryType : PEGTL_NS::seq< + Identifier, + PEGTL_NS::opt, ArrayType>> {}; +struct DictionaryValueItem : PEGTL_NS::sor< + PEGTL_NS::if_must< + KeywordDictionary, + TokenSeparator, + DictionaryKey, + Assignment, + DictionaryValue>, + PEGTL_NS::seq< + DictionaryType, + TokenSeparator, + DictionaryKey, + Assignment, + TypedValue>> {}; +struct DictionaryValue : PEGTL_NS::if_must< + DictionaryValueOpen, + PEGTL_NS::pad_opt, + MultilinePadding>, + DictionaryValueClose> {}; + +// shared metadata +// MetadataOpen = LeftParen +// MetadataClose = RightParen +struct MetadataOpen : LeftParen {}; +struct MetadataClose : RightParen {}; + +template +struct MetadataBlock :PEGTL_NS::if_must< + MetadataOpen, + PEGTL_NS::pad_opt, + MultilinePadding>, + MetadataClose> {}; + + +// MetadataKey = customData / +// symmetryArguments / +// Identifier +// MetadataValue = None / +// DictionaryValue / +// TypedValue +// KeyValueMetadata = Identifier Assignment MetadataValue +struct MetadataKey : PEGTL_NS::sor< + KeywordCustomData, + KeywordSymmetryArguments, + Identifier> {}; +struct KeyValueMetadata : PEGTL_NS::seq< + MetadataKey, + Assignment, + PEGTL_NS::sor< + KeywordNone, + DictionaryValue, + TypedValue>> {}; +struct LayerKeyValueMetadata : PEGTL_NS::seq< + Identifier, + Assignment, + PEGTL_NS::sor< + KeywordNone, + DictionaryValue, + TypedValue>> {}; + +// DocMetadata = doc Assignment String +struct DocMetadata : PEGTL_NS::seq< + KeywordDoc, + Assignment, + String> {}; + +struct ListOpKeyword : PEGTL_NS::sor< + KeywordAdd, + KeywordDelete, + KeywordAppend, + KeywordPrepend, + KeywordReorder> {}; + +struct NoneOrTypedListValue : PEGTL_NS::sor< + KeywordNone, + TypedListValue> {}; +struct ListOpKeyValueMetadata : PEGTL_NS::seq< + Identifier, + Assignment, + PEGTL_NS::must> {}; + +// ListOpMetadataValue = None / +// ListValue +// GeneralListOpMetadata = add TokenSeparator Identifier Assignment ListOpMetadataValue / +// delete TokenSeparator Identifier Assignment ListOpMetadatValue / +// append TokenSeparator Identifier Assignment ListOpMetadatValue / +// prepend TokenSeparator Identifier Assignment ListOpMetadatValue / +// reorder TokenSeparator Identifier Assignment ListOpMetadatValue +struct GeneralListOpMetadata : PEGTL_NS::seq< + ListOpKeyword, + TokenSeparator, + Identifier, + Assignment, + PEGTL_NS::sor< + KeywordNone, + TypedListValue>> {}; + +// SharedMetadata = String / +// KeyValueMetadata / +// DocMetadata +// note for layers it's slightly different because the key +// in key / value pair metadata can only be Identifier +struct SharedMetadata : PEGTL_NS::sor< + String, + KeyValueMetadata, + DocMetadata> {}; +struct SharedWithListOpMetadata : PEGTL_NS::sor< + SharedMetadata, + GeneralListOpMetadata> {}; +struct LayerSharedWithListOpMetadata : PEGTL_NS::sor< + String, + LayerKeyValueMetadata, + DocMetadata, + GeneralListOpMetadata> {}; + +// PermissionMetadata = permission Assignment Identifier +struct PermissionMetadata : PEGTL_NS::if_must< + KeywordPermission, + Assignment, + Identifier> {}; + +// SymmetryFunctionMetadata = symmetryFunction Assignment (Identifier)? +struct SymmetryFunctionMetadata : PEGTL_NS::seq< + KeywordSymmetryFunction, + Assignment, + PEGTL_NS::opt> {}; + +// NameList = String / +// [ (NewLines)? (TokenSeparator)? String (TokenSeparator)? (ListSeparator (TokenSeparator)? String (TokenSeparator)?)* ListEnd (TokenSeparator)? ] +struct NameList : PEGTL_NS::sor< + String, + PEGTL_NS::if_must< + LeftBrace, + // Should this be optional? + PEGTL_NS::pad, MultilinePadding>, + RightBrace>> {}; + +// StringDictionaryItem = String (TokenSeparator)? : (TokenSeparator)? String +struct StringDictionaryItem : + PEGTL_NS::seq, + String> {}; + +// StringDictionary = { (NewLines)? ( (TokenSeparator)? StringDictionaryItem (TokenSeparator)? (ListSeparator (TokenSeparator)? StringDictionaryItem (TokenSeparator)?)* ListEnd)? (TokenSeparator)? } +struct StringDictionaryOpen : LeftCurlyBrace {}; +struct StringDictionaryClose : RightCurlyBrace {}; +struct StringDictionary : PEGTL_NS::must< + StringDictionaryOpen, + PEGTL_NS::pad_opt, MultilinePadding>, + StringDictionaryClose> {}; + +// time samples +// TimeSample = Number (TokenSeparator)? : (TokenSeparator)? None / +// Number (TokenSeparator)? : (TokenSeparator)? TypedValue +struct TimeSample : PEGTL_NS::seq< + Number, + PEGTL_NS::pad, + PEGTL_NS::sor< + KeywordNone, + TypedValue>> {}; + +// TimeSampleMap = { (NewLines)? ((TokenSeparator)? TimeSample (TokenSeparator)? (ListSeparator (TokenSeparator)? TimeSample (TokenSeparator)?)* ListEnd)? (TokenSeparator)? } +struct TimeSampleMap : PEGTL_NS::seq< + LeftCurlyBrace, + PEGTL_NS::pad_opt, MultilinePadding>, + RightCurlyBrace> {}; + +// prim attribute metadata +// DisplayUnitMetadata = displayUnit Assignment Identifier +struct DisplayUnitMetadata : PEGTL_NS::if_must< + KeywordDisplayUnit, + Assignment, + Identifier> {}; + +// AttributeMetadataItem = SharedWithListOpMetadata / +// DisplayUnitMetadata / +// PermissionMetadata / +// SymmetryFunctionMetadata +struct AttributeMetadataItem : PEGTL_NS::sor< + SharedWithListOpMetadata, + DisplayUnitMetadata, + PermissionMetadata, + SymmetryFunctionMetadata> {}; + +// AttributeMetadata = ( (NewLines)? ((TokenSeparator)? AttributeMetadataItem (TokenSeparator)? (StatementSeparator (TokenSeparator)? AttributeMetadataItem (TokenSeparator)?)* StatementEnd)? (TokenSeparator)? ) +struct AttributeMetadata : MetadataBlock{}; + +// prim attribute definition +// AttributeVariability = config / uniform +struct AttributeVariability : PEGTL_NS::sor< + KeywordConfig, + KeywordUniform> {}; + +// AttributeType = (AttributeVariability TokenSeparator)? Identifier (TokenSeparator)? ([ (TokenSeparator)? ])? +struct AttributeType : PEGTL_NS::seq< + PEGTL_NS::opt, + Identifier, + PEGTL_NS::opt, ArrayType>> {}; + +// AttributeDeclaration = AttributeType TokenSeparator NamespacedName +struct AttributeDeclaration : PEGTL_NS::seq< + PEGTL_NS::opt, + AttributeType, + TokenSeparator, + NamespacedName> {}; + +// AttributeValue = None / TypedValue +// AttributeAssignment = Assignment AttributeValue +struct AttributeAssignment : PEGTL_NS::seq< + Assignment, + PEGTL_NS::sor< + KeywordNone, + TypedValue>> {}; +struct AttributeAssignmentOptional : PEGTL_NS::opt< + AttributeAssignment> {}; + +// ConnectValue = KeywordNone / +// PathRef / +// [ (NewLines)? ((TokenSeparator)? (PathRef) (TokenSeparator)? (ListSeparator (TokenSeparator)? (PathRef) (TokenSeparator)?)* ListEnd)? (TokenSeparator)?] +struct ConnectValue : PEGTL_NS::sor< + KeywordNone, + PathRef, + PEGTL_NS::if_must< + LeftBrace, + PEGTL_NS::pad_opt, MultilinePadding>, + RightBrace>> {}; + +// AttributeSpec = ConnectListOp (parsed as part of PropertySpec) +// AttributeDeclaration (AttributeAssignment)? (TokenSeparator)? (AttributeMetadata)? / +// AttributeDeclaration (TokenSeparator)? Dot (TokenSeparator)? TimeSamples Assignment TimeSampleMap / +// AttributeDeclaration (TokenSeparator)? Dot (TokenSeparator)? Connect Assigment ConnectValue +struct AttributeSpec : PEGTL_NS::seq< + AttributeDeclaration, + PEGTL_NS::if_must_else< + PEGTL_NS::pad, + PEGTL_NS::sor< + PEGTL_NS::if_must< + KeywordTimeSamples, + PEGTL_NS::seq< + Assignment, + TimeSampleMap>>, + PEGTL_NS::if_must< + KeywordConnect, + PEGTL_NS::seq< + Assignment, + ConnectValue>>>, + PEGTL_NS::seq< + AttributeAssignmentOptional, + PEGTL_NS::pad_opt + >> + > {}; + +// prim relationship metadata +// RelationshipMetadataItem = String / +// KeyValueMetadata / +// ListOpMetadata / +// DocMetadata / +// PermissionMetadata / +// SymmetryFunctionMetadata +struct RelationshipMetadataItem : PEGTL_NS::sor< + SharedWithListOpMetadata, + PermissionMetadata, + SymmetryFunctionMetadata> {}; + +// RelationshipMetadataList = RelationshipMetadataList StatementSeparator (TokenSeparator)? RelationshipMetadataItem (TokenSeparator)? / +// (TokenSeparator)? RelationshipMetadataItem (TokenSeparator)? +// RelationshipMetadata = ( (NewLines)? (RelationshipMetadataList StatementEnd)? (TokenSeparator)? +struct RelationshipMetadata : MetadataBlock{}; + +// prim relationship definition +// RelationshipAssignment = Assignment None / +// Assignment PathRef / +// Assignment [ ((NewLines)? ((TokenSeparator)? PathRef (TokenSeparator)? (ListSeparator (TokenSeparator)? PathRef (TokenSeparator)?)* ListEnd)? (TokenSeparator)?)? ] +struct RelationshipAssignmentOpen : LeftBrace {}; +struct RelationshipAssignmentClose : RightBrace {}; +struct RelationshipAssignment : PEGTL_NS::seq< + Assignment, + PEGTL_NS::sor< + KeywordNone, + PathRef, + PEGTL_NS::if_must< + RelationshipAssignmentOpen, + PEGTL_NS::pad_opt, + MultilinePadding>, + RelationshipAssignmentClose>>> {}; + +// RelationshipType = rel / +// custom TokenSeparator rel / +// custom TokenSeparator varying TokenSeparator rel / +// varying TokenSeparator rel +struct RelationshipType : PEGTL_NS::sor< + KeywordRel, + PEGTL_NS::seq< + KeywordVarying, + TokenSeparator, + KeywordRel>, + PEGTL_NS::seq< + KeywordCustom, + TokenSeparator, + PEGTL_NS::sor< + KeywordRel, + PEGTL_NS::seq< + KeywordVarying, + TokenSeparator, + KeywordRel>>>> {}; + +// RelationshipSpec = RelationshipListOp (parsed as part of PropertySpec) +// RelationshipType TokenSeparator NamespacedName (RelationshipAssignment)? (TokenSeparator)? (RelationshipMetadata)? / +// RelationshipType TokenSeparator NamespacedName (TokenSeparator)? [ (TokenSeparator)? PathRef (TokenSeparator)? ] / +// RelationshipType TokenSeparator NamespacedName (TokenSeparator)? . (TokenSeparator)? timeSamples Assignment TimeSampleMap / +// RelationshipType TokenSeparator NamespacedName (TokenSeparator)? . (TokenSeparator)? default Assignment PathRef +struct RelationshipTargetOpen : LeftBrace {}; +struct RelationshipTargetClose : RightBrace {}; +struct RelationshipAssignmentOptional : PEGTL_NS::opt< + RelationshipAssignment> {}; +struct RelationshipSpec : PEGTL_NS::seq< + RelationshipType, + TokenSeparator, + NamespacedName, + PEGTL_NS::if_must_else< + PEGTL_NS::pad, + PEGTL_NS::sor< + PEGTL_NS::if_must< + KeywordTimeSamples, + PEGTL_NS::seq< + Assignment, + TimeSampleMap>>, + PEGTL_NS::if_must< + KeywordDefault, + PEGTL_NS::seq< + Assignment, + PathRef>>>, + PEGTL_NS::sor< + PEGTL_NS::seq< + PEGTL_NS::star, + PEGTL_NS::if_must< + RelationshipTargetOpen, + PEGTL_NS::pad, + RelationshipTargetClose>>, + PEGTL_NS::seq< + RelationshipAssignmentOptional, + PEGTL_NS::star, + PEGTL_NS::opt>>>> {}; + +// prim metadata +// InheritsOrSpecializesList = None / +// PathRef / +// [ (NewLines)? ( (TokenSeparator)? PathRef (TokenSeparator)? (ListSeparator (TokenSeparator)? PathRef (TokenSeparator)?)* ListEnd)? (TokenSeparator)? ] +struct InheritsOrSpecializesList : PEGTL_NS::sor< + KeywordNone, + PathRef, + PEGTL_NS::seq< + LeftBrace, + PEGTL_NS::pad_opt, + MultilinePadding>, + RightBrace>> {}; + +// SpecializesMetadata = specializes Assignment InheritsOrSpecializesList / +// add specializes Assignment InheritsOrSpecializesList / +// delete specializes Assignment InheritsOrSpecializesList / +// append specializes Assignment InheritsOrSpecializesList / +// prepend specializes Assignment InheritsOrSpecializesList / +// reorder specializes Assignment InheritsOrSpecializesList +struct SpecializesMetadata : PEGTL_NS::if_must< + KeywordSpecializes, + Assignment, + InheritsOrSpecializesList> {}; + +// InheritsMetadata = inherits Assignment InheritsOrSpecializesList / +// add inherits Assignment InheritsOrSpecializesList / +// delete inherits Assignment InheritsOrSpecializesList / +// append inherits Assignment InheritsOrSpecializesList / +// prepend inherits Assignment InheritsOrSpecializesList / +// reorder inherits Assignment InheritsOrSpecializesList +struct InheritsMetadata : PEGTL_NS::if_must< + KeywordInherits, + Assignment, + InheritsOrSpecializesList> {}; + +// ReferenceParameter = customData Assignment DictionaryValue / +// LayerOffset +struct ReferenceParameter : PEGTL_NS::sor< + PEGTL_NS::seq< + KeywordCustomData, + Assignment, + DictionaryValue>, + LayerOffset> {}; + +// ReferenceParameterList = (TokenSeparator)? ReferenceParameter (TokenSeparator)? (StatementSeparator (TokenSeparator)? ReferenceParameter (TokenSeparator)?)* +// ReferenceParameters = ( (NewLines)? (ReferenceParameterList StatementEnd)? (TokenSeparator)? ) +// ReferenceListItem = AssetRef (TokenSeparator)? (PathRef)? (TokenSeparator)? (ReferenceParameters)? / +// PathRef (TokenSeparator)? (ReferenceParameters)? +struct ReferenceParametersOpen : LeftParen {}; +struct ReferenceParametersClose : RightParen {}; +struct ReferenceListItem : PEGTL_NS::seq< + PEGTL_NS::sor< + PathRef, + PEGTL_NS::seq< + AssetRef, + PEGTL_NS::star, + PEGTL_NS::opt> + >, + PEGTL_NS::star, + PEGTL_NS::opt< + ReferenceParametersOpen, + PEGTL_NS::pad_opt, + MultilinePadding>, + ReferenceParametersClose> + > {}; + +// ReferenceListItems = (TokenSeparator)? ReferenceListItem (TokenSeparator)? (ListSeparator (TokenSeparator)? ReferenceListItem (TokenSeparator)?)* +// ReferenceList = None / +// ReferenceListItem / +// [ (NewLines)? (ReferenceListItems ListEnd)? (TokenSeparator)? ] +struct ReferenceList : PEGTL_NS::sor< + KeywordNone, + ReferenceListItem, + PEGTL_NS::seq< + LeftBrace, + PEGTL_NS::pad_opt, MultilinePadding>, + RightBrace>> {}; + +// ReferencesMetadata = references Assignment ReferenceList / +// add references Assignment ReferenceList / +// delete references Assignment ReferenceList / +// append references Assignment ReferenceList / +// prepend references Assignment ReferenceList / +// reorder references Assignment ReferenceList +struct ReferencesMetadata : PEGTL_NS::if_must< + KeywordReferences, + Assignment, + ReferenceList> {}; + +// PayloadParameters = ( (NewLines)? ((TokenSeparator)? LayerOffset (TokenSeparator)? (StatementSeparator (TokenSeparator)? LayerOffset (TokenSeparator)?)* StatementEnd)? (TokenSeparator)? ) +// PayloadListItem = AssetRef (TokenSeparator)? (PathRef)? (TokenSeparator)? (PayloadParameters)? / +// PathRef (TokenSeparator)? (PayloadParamaters)? +struct PayloadListItem : PEGTL_NS::seq< + PEGTL_NS::sor< + PathRef, + PEGTL_NS::seq< + AssetRef, + PEGTL_NS::star, + PEGTL_NS::opt> + >, + PEGTL_NS::star, + PEGTL_NS::opt< + LeftParen, + PEGTL_NS::pad_opt, + MultilinePadding>, + RightParen>> {}; + +// PayloadListItems = (TokenSeparator)? PayloadListItem (TokenSeparator)? (ListSeparator (TokenSeparator)? PayloadListItem (TokenSeparator)?)* +// PayloadList = None / +// PayloadListItem / +// [ (NewLines)? (PayloadListItems ListEnd)? (TokenSeparator)? ] +struct PayloadList : PEGTL_NS::sor< + KeywordNone, + PayloadListItem, + PEGTL_NS::seq< + LeftBrace, + PEGTL_NS::pad_opt, MultilinePadding>, + RightBrace>> {}; + +// PayloadMetadata = payload Assignment PayloadList / +// add payload Assignment PayloadList / +// delete payload Assignment PayloadList / +// append payload Assignment PayloadList / +// prepend payload Assignment PayloadList / +// reorder payload Assignment PayloadList +struct PayloadMetadata : PEGTL_NS::if_must< + KeywordPayload, + Assignment, + PayloadList> {}; + +// RelocatesItem = PathRef (TokenSeparator)? : (TokenSeparator)? PathRef +// RelocatesMetadata = relocates Assignment { (NewLines)? ((TokenSeparator)? RelocatesItem (TokenSeparator)? (ListSeparator (TokenSeparator)? RelocatesItem (TokenSeparator)?)* ListEnd)? (TokenSeparator)? } +struct RelocatesMapOpen : LeftCurlyBrace {}; +struct RelocatesMapClose : RightCurlyBrace {}; +struct RelocatesMetadata : PEGTL_NS::if_must< + KeywordRelocates, + Assignment, + PEGTL_NS::must< + RelocatesMapOpen, + PEGTL_NS::pad_opt< + ListOf< + PEGTL_NS::seq< + PathRef, + PEGTL_NS::pad, + PathRef>>, + MultilinePadding>, + RelocatesMapClose>> {}; + +// VariantsMetadata = variants Assignment DictionaryValue +struct VariantsMetadata : PEGTL_NS::if_must< + KeywordVariants, + Assignment, + DictionaryValue> {}; + +// VariantSetsMetadata = variantSets Assignment NameList / +// add variantSets Assignment NameList / +// delete variantSets Assignment NameList / +// append variantSets Assignment NameList / +// prepend variantSets Assignment NameList / +// reorder variantSets Assignment NameList +struct VariantSetsMetadata : PEGTL_NS::if_must< + KeywordVariantSets, + Assignment, + NameList> {}; + +// KindMetadata = kind Assignment String +struct KindMetadata : PEGTL_NS::if_must< + KeywordKind, + Assignment, + String> {}; + +// PrefixOrSuffixSubstitutionsMetadata = prefixSubstitutions Assignment StringDictionary / +// suffixSubstitutions Assignment StringDictionary +struct PrefixOrSuffixSubstitutionsMetadata : PEGTL_NS::if_must< + PEGTL_NS::sor< + KeywordPrefixSubstitutions, + KeywordSuffixSubstitutions>, + Assignment, + StringDictionary> {}; + +// PrimMetadataItem = String / +// KeyValueMetadata / +// ListOpMetadata / +// DocMetadata / +// KindMetadata / +// PayloadMetadata / +// InheritsMetadata / +// SpecializesMetadata / +// ReferencesMetadata / +// RelocatesMetadata / +// VariantsMetadata / +// VariantSetsMetadata / +// PrefixOrSuffixSubstitutionsMetadata / +// PermissionMetadata / +// SymmetryFunctionMetadata +struct PrimMetadataItem : PEGTL_NS::sor< + SharedMetadata, + KindMetadata, + ReferencesMetadata, + PayloadMetadata, + VariantsMetadata, + VariantSetsMetadata, + InheritsMetadata, + SpecializesMetadata, + RelocatesMetadata, + PEGTL_NS::if_must< + ListOpKeyword, + TokenSeparator, + PEGTL_NS::if_must_else< + KeywordReferences, + PEGTL_NS::seq< + Assignment, + ReferenceList>, + PEGTL_NS::if_must_else< + KeywordPayload, + PEGTL_NS::seq< + Assignment, + PayloadList>, + PEGTL_NS::if_must_else< + PEGTL_NS::sor< + KeywordInherits, + KeywordSpecializes>, + PEGTL_NS::seq< + Assignment, + InheritsOrSpecializesList>, + PEGTL_NS::if_must_else< + KeywordVariantSets, + PEGTL_NS::seq< + Assignment, + NameList>, + ListOpKeyValueMetadata>>>>>, + PrefixOrSuffixSubstitutionsMetadata, + PermissionMetadata, + SymmetryFunctionMetadata> {}; + +// PrimMetadata = (NewLines)? (TokenSeparator)? (( (NewLines)? ((TokenSeparator)? PrimMetadataItem (TokenSeparator)? (StatementSeparator (TokenSeparator)? PrimMetadatItem (TokenSeparator)?)* StatementEnd)? (TokenSeparator)? ))? +struct PrimMetadata : MetadataBlock {}; + +// prim definition +// PropertySpec = AttributeSpec / +// RelationshipSpec +// ConnectListOp = add TokenSeparator AttributeDeclaration (TokenSeparator)? . (TokenSeparator)? connect Assignment ConnectValue / +// delete TokenSeparator AttributeDeclaration (TokenSeparator)? . (TokenSeparator)? connect Assignment ConnectValue / +// append TokenSeparator AttributeDeclaration (TokenSeparator)? . (TokenSeparator)? connect Assignment ConnectValue / +// prepend TokenSeparator AttributeDeclaration (TokenSeparator)? . (TokenSeparator)? connect Assignment ConnectValue / +// reorder TokenSeparator AttributeDeclaration (TokenSeparator)? . (TokenSeparator)? connect Assignment ConnectValue +// RelationshipListOp = add TokenSeparator RelationshipType TokenSeparator NamespacedName (RelationshipAssignment)? / +// delete TokenSeparator RelationshipType TokenSeparator NamespaceName (RelationshipAssignment)? / +// append TokenSeparator RelationshipType TokenSeparator NamespaceName (RelationshipAssignment)? / +// prepend TokenSeparator RelationshipType TokenSeparator NamespaceName (RelationshipAssignment)? / +// reorder TokenSeparator RelationshipType TokenSeparator NamespaceName (RelationshipAssignment)? +// Note this is not a direct translation - in order to greedily optimize +// we take note that attribute specs can contain connect list ops +// so we separate out list ops for the two specs +// and parse them separately as an additional production +// additionally, the keyword 'reorder' can start either list op +// statements or the child / property order ones, so we have to greedily take that +// into account here as well (which aren't truly PropertySpecs but captured here for optimization) +struct PropertySpec : PEGTL_NS::sor< + AttributeSpec, + RelationshipSpec, + PEGTL_NS::seq< + ListOpKeyword, + TokenSeparator, + PEGTL_NS::if_must_else< + RelationshipType, + PEGTL_NS::seq< + TokenSeparator, + NamespacedName, + RelationshipAssignmentOptional>, + PEGTL_NS::seq< + AttributeDeclaration, + PEGTL_NS::pad, + KeywordConnect, + Assignment, + ConnectValue>>>> {}; + +// ChildOrderStatement = reorder TokenSeparator nameChildren Assignment NameList +// PropertyOrderStatement = reorder TokenSeparator properties Assignment NameList +struct ChildOrPropertyOrderStatement : PEGTL_NS::seq< + KeywordReorder, + TokenSeparator, + PEGTL_NS::sor< + KeywordNameChildren, + KeywordProperties>, + Assignment, + NameList> {}; + +// VariantStatement = String (TokenSeparator)? (PrimMetadata)? (NewLines)? (TokenSeparator)? { (NewLines)? (TokenSeparator)? (PrimContentsList)? (TokenSeparator)? } (NewLines)? +struct PrimContents; +struct VariantStatementOpen : LeftCurlyBrace {}; +struct VariantStatementClose : RightCurlyBrace {}; +struct VariantStatement : PEGTL_NS::seq< + String, + PEGTL_NS::pad_opt, + PEGTL_NS::must< + VariantStatementOpen, + PrimContents, + VariantStatementClose> + > {}; + +// VariantSetStatement = variantSet TokenSeparator String Assignment (NewLines)? (TokenSeparator)? { (NewLines)? ((TokenSeparator)? VariantStatement)+ (TokenSeparator)? } +struct VariantStatementListOpen : LeftCurlyBrace {}; +struct VariantStatementListClose : RightCurlyBrace {}; +struct VariantSetStatement : PEGTL_NS::seq< + KeywordVariantSet, + TokenSeparator, + String, + PEGTL_NS::pad, + PEGTL_NS::must< + VariantStatementListOpen, + PEGTL_NS::star>, + VariantStatementListClose>> {}; + +// PrimItem = ChildOrderStatement / +// PropertyOrderStatement / +// PropertySpec / +// PrimSpec / +// VariantSetStatement +struct PrimSpec; +struct PrimItem : PEGTL_NS::sor< + PEGTL_NS::seq< + PEGTL_NS::sor, + PEGTL_NS::star, + StatementSeparator>, + PEGTL_NS::seq< + PEGTL_NS::sor, + PEGTL_NS::star, + Eol>>{}; + +// PrimContents = (NewLines)? ((TokenSeparator)? PrimItem)* +struct PrimContents : + PEGTL_NS::seq< + PEGTL_NS::star, + PEGTL_NS::star>> {}; + +// PrimTypeName = Identifier ((TokenSeparator)? . (TokenSeparator)? Identifier)* +struct PrimTypeName : + PEGTL_NS::list {}; + +// PrimSpec = def TokenSeparator (PrimTypeName TokenSeparator)? String (TokenSeparator)? (PrimMetadata)? (NewLines)? (TokenSeparator)? { PrimContents (TokenSeparator)? } / +// over TokenSeparator (PrimTypeName TokenSeparator)? String (TokenSeparator)? (PrimMetadata)? (NewLines)? (TokenSeparator)? { PrimContents (TokenSeparator)? } / +// class TokenSeparator (PrimTypeName TokenSeparator)? String (TokenSeparator)? (PrimMetadata)? (NewLines)? (TokenSeparator)? { PrimContents (TokenSeparator)? } +struct PrimMetadataOptional : PEGTL_NS::pad_opt {}; +struct PrimSpec : PEGTL_NS::seq< + PEGTL_NS::sor< + KeywordDef, + KeywordOver, + KeywordClass>, + TokenSeparator, + PEGTL_NS::opt, + String, + PrimMetadataOptional, + LeftCurlyBrace, + PEGTL_NS::must< + PrimContents, + RightCurlyBrace> + > {}; + +// LayerOffsetList = ( (TokenSeparator)? LayerOffset (TokenSeparator)? (StatementSeparator (TokenSeparator)? LayerOffset (TokenSeparator)?)* StatementEnd ) +// SublayerItem = AssetRef (TokenSeparator)? (LayerOffsetList)? +struct SublayerItem : PEGTL_NS::seq< + AssetRef, + PEGTL_NS::star, + PEGTL_NS::opt< + LeftParen, + PEGTL_NS::pad_opt, MultilinePadding>, + PEGTL_NS::must> + > {}; + +// SublayerMetadata = subLayers Assignment [ (NewLines)? ((TokenSeparator)? SublayerItem (TokenSeparator)? (ListSeparator (TokenSeparator)? SublayerItem (TokenSeparator)?)* ListEnd)? (TokenSeparator)? ] +struct SublayerListOpen : LeftBrace {}; +struct SublayerListClose : RightBrace {}; +struct SublayerMetadata : PEGTL_NS::seq< + KeywordSubLayers, + Assignment, + SublayerListOpen, + PEGTL_NS::pad_opt, MultilinePadding>, + PEGTL_NS::must> {}; + +// LayerMetadataItem = SharedMetadata / +// SublayerMetadata +struct LayerMetadataItem : PEGTL_NS::sor< + LayerSharedWithListOpMetadata, + RelocatesMetadata, + SublayerMetadata> {}; + +// LayerMetadata = (NewLines)? (TokenSeparator)? ( ( (NewLines)? (TokenSeparator)? LayerMetadataItem (TokenSeparator)? (StatementSeparator (TokenSeparator)? LayerMetadataItem (TokenSeparator)?)* StatementEnd)? ) )? (NewLines)? +struct LayerMetadata : MetadataBlock {}; + +// LayerHeader = # (!(CrLf) AnyChar)* +struct LayerHeader : + PEGTL_NS::must, PEGTL_NS::until>{}; + +// PrimList = PrimList NewLines (TokenSeparator)? PrimStatement (TokenSeparator)? / +// (TokenSeparator)? PrimStatement (TokenSeparator)? +// LayerSpec = LayerHeader (LayerMetadata)? (NewLines)? (TokenSeparator PrimList NewLines)? (EolWhitspace)? +struct LayerSpec : PEGTL_NS::seq< + LayerHeader, + PEGTL_NS::pad_opt, + PEGTL_NS::star< + PEGTL_NS::sor< + PEGTL_NS::seq< + KeywordReorder, + TokenSeparator, + KeywordRootPrims, + Assignment, + NameList, + PEGTL_NS::star, + PEGTL_NS::sor + >, + PEGTL_NS::seq< + PrimSpec, + PEGTL_NS::star, + Eolf + >, + MultilinePadding> + >> {}; + +// LayerMetadataOnly = LayerHeader (LayerMetadata)? +// production used to interrogate layer metadata without reading the entire layer +struct LayerMetadataOnly : PEGTL_NS::seq< + LayerHeader, + PEGTL_NS::pad_opt> {}; + +template +struct TextParserAction : PEGTL_NS::nothing {}; + +//////////////////////////////////////////////////////////////////////// +// TextFileFormat custom control + +template class Base = PEGTL_NS::normal> +struct TextParserDefaultErrorControl +{ + template + struct control : Base + { + template + static void raise(const Input& in, [[maybe_unused]] States&&... st) + { + if constexpr(Controller::template message != nullptr) + { + // use custom error message for rule + constexpr const char* errorMessage = + Controller::template message; + throw PEGTL_NS::parse_error(errorMessage, in); + } + else + { + // emit default parse error for the rule + Base::raise(in, st...); + } + } + }; +}; + +// default error message is nullptr, which redirects parse error +// message to default control class raise method +template inline constexpr const char* errorMessage = nullptr; + +// TextParserDefaultErrorControl doesn't take the error_message as a template +// parameter directly, so it's wrapped here +struct TextParserControlValues +{ + template + static constexpr auto message = errorMessage; +}; + +template +using TextParserControl = + TextParserDefaultErrorControl::control; + +} // end namespace Sdf_TextFileFormatParser + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif \ No newline at end of file diff --git a/pxr/usd/sdf/textParserContext.cpp b/pxr/usd/sdf/textParserContext.cpp index 910af207e8..3f104e5616 100644 --- a/pxr/usd/sdf/textParserContext.cpp +++ b/pxr/usd/sdf/textParserContext.cpp @@ -28,16 +28,13 @@ PXR_NAMESPACE_OPEN_SCOPE Sdf_TextParserContext::Sdf_TextParserContext() : + parsingContext(std::vector()), listOpType(SdfListOpTypeExplicit), currentDictionaries(std::vector(1)), - seenError(false), path(SdfPath::AbsoluteRootPath()), - metadataOnly(false), // This parser supports the maybe-has-relocates hint. The parser will set // it to true if it encounters a relocates field. - layerHints{/*.mightHaveRelocates =*/ false}, - sdfLineNo(1), - scanner(NULL) + layerHints{/*.mightHaveRelocates =*/ false} { } diff --git a/pxr/usd/sdf/textParserContext.h b/pxr/usd/sdf/textParserContext.h index 65b9a1612b..fa2db02baa 100644 --- a/pxr/usd/sdf/textParserContext.h +++ b/pxr/usd/sdf/textParserContext.h @@ -48,13 +48,59 @@ typedef void *yyscan_t; PXR_NAMESPACE_OPEN_SCOPE + +// Contains symbolic names for states the parser can +// be in when traversing the scene hierarchy during +// a parse run such that simple values can be +// disambiguated +enum class Sdf_TextParserCurrentParsingContext { + LayerSpec, + PrimSpec, + AttributeSpec, + RelationshipSpec, + Metadata, + KeyValueMetadata, + ListOpMetadata, + DocMetadata, + PermissionMetadata, + SymmetryFunctionMetadata, + DisplayUnitMetadata, + Dictionary, + DictionaryTypeName, + DictionaryKey, + ConnectAttribute, + ReorderRootPrims, + ReorderNameChildren, + ReorderProperties, + ReferencesListOpMetadata, + PayloadListOpMetadata, + InheritsListOpMetadata, + SpecializesListOpMetadata, + VariantsMetadata, + VariantSetsMetadata, + RelocatesMetadata, + KindMetadata, + RelationshipAssignment, + RelationshipTarget, + RelationshipDefault, + TimeSamples, + ReferenceParameters, + LayerOffset, + LayerScale, + VariantSetStatement, + VariantStatementList, + PrefixSubstitutionsMetadata, + SuffixSubstitutionsMetadata, + SubLayerMetadata +}; + // This class contains the global state while parsing an sdf file. // It contains the data structures that we use to create the scene description // from the file. - class Sdf_TextParserContext { public: // Constructor. + SDF_API Sdf_TextParserContext(); std::string magicIdentifierToken; @@ -71,6 +117,15 @@ class Sdf_TextParserContext { // State for sublayer offsets std::vector subLayerOffsets; + // state for building up different type names + std::string primTypeName; + std::string attributeTypeName; + std::string dictionaryTypeName; + std::string symmetryFunctionName; + + // state for various parsing contexts + std::vector parsingContext; + // String list currently being built std::vector nameVector; @@ -107,6 +162,12 @@ class Sdf_TextParserContext { // helper for relocates parsing SdfRelocates relocatesParsing; + SdfPath relocatesKey; + bool seenFirstRelocatesPath; + + // helper for string dictionaries + std::string stringDictionaryKey; + bool seenStringDictionaryKey; // helpers for generic metadata TfToken genericMetadataKey; @@ -121,20 +182,16 @@ class Sdf_TextParserContext { // Vector of dictionaries used to parse nested dictionaries. // The first element in the vector contains the last parsed dictionary. std::vector currentDictionaries; - - bool seenError; + std::vector currentDictionaryKey; + std::vector expectDictionaryValue; bool custom; SdfSpecifier specifier; SdfDataRefPtr data; SdfPath path; - TfToken typeName; VtValue variability; VtValue assoc; - // Should we only read metadata from the file? - bool metadataOnly; - // Hints to fill in about the layer's contents. SdfLayerHints layerHints; @@ -154,11 +211,6 @@ class Sdf_TextParserContext { // Stack of names of variants for the variant sets being built std::vector > currentVariantNames; - - unsigned int sdfLineNo; - - // Used by flex for reentrant parsing - yyscan_t scanner; }; PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/sdf/textParserHelpers.cpp b/pxr/usd/sdf/textParserHelpers.cpp index a29aa5256c..ead5f0f5fc 100644 --- a/pxr/usd/sdf/textParserHelpers.cpp +++ b/pxr/usd/sdf/textParserHelpers.cpp @@ -22,886 +22,219 @@ // language governing permissions and limitations under the Apache License. // +#include "pxr/base/tf/debug.h" +#include "pxr/usd/sdf/debugCodes.h" #include "pxr/usd/sdf/textParserHelpers.h" PXR_NAMESPACE_OPEN_SCOPE namespace Sdf_TextFileFormatParser { -#define ERROR_AND_RETURN_IF_NOT_ALLOWED(context, allowed) \ - { \ - const SdfAllowed allow = allowed; \ - if (!allow) { \ - SDF_TEXTFILEFORMATPARSER_ERR(context, "%s", \ - allow.GetWhyNot().c_str()); \ - return; \ - } \ - } - bool -_SetupValue(const std::string& typeName, Sdf_TextParserContext *context) -{ - return context->values.SetupFactory(typeName); -} - -void -_MatchMagicIdentifier(const Sdf_ParserHelpers::Value& arg1, Sdf_TextParserContext *context) -{ - const std::string cookie = TfStringTrimRight(arg1.Get()); - const std::string expected = "#" + context->magicIdentifierToken + " "; - if (TfStringStartsWith(cookie, expected)) { - if (!context->versionString.empty() && - !TfStringEndsWith(cookie, context->versionString)) { - TF_WARN("File '%s' is not the latest %s version (found '%s', " - "expected '%s'). The file may parse correctly and yield " - "incorrect results.", - context->fileContext.c_str(), - context->magicIdentifierToken.c_str(), - cookie.substr(expected.length()).c_str(), - context->versionString.c_str()); - } - } - else { - SDF_TEXTFILEFORMATPARSER_ERR(context, "Magic Cookie '%s'. Expected prefix of '%s'", - TfStringTrim(cookie).c_str(), - expected.c_str()); - } -} - -SdfPermission -_GetPermissionFromString(const std::string & str, - Sdf_TextParserContext *context) -{ - if (str == "public") { - return SdfPermissionPublic; - } else if (str == "private") { - return SdfPermissionPrivate; - } else { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "'%s' is not a valid permission constant", str.c_str()); - return SdfPermissionPublic; - } -} - -TfEnum -_GetDisplayUnitFromString(const std::string & name, - Sdf_TextParserContext *context) +_ValueSetAtomic(Sdf_TextParserContext& context, + std::string& errorMessage) { - const TfEnum &unit = SdfGetUnitFromName(name); - if (unit == TfEnum()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "'%s' is not a valid display unit", name.c_str()); - } - return unit; -} - -void -_ValueAppendAtomic(const Sdf_ParserHelpers::Value& arg1, Sdf_TextParserContext *context) -{ - context->values.AppendValue(arg1); -} - -void -_ValueSetAtomic(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Type name has [] for non-shaped value!\n"); - return; + if (!context.values.IsRecordingString()) { + if (context.values.valueIsShaped) { + errorMessage = "Type name has [] for non-shaped value!\n"; + return false; } } std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue.IsEmpty()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Error parsing simple value: %s", errStr.c_str()); - return; - } -} - -void -_PrimSetInheritListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->inheritParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting inherit paths to None (or empty list) is only allowed " - "when setting explicit inherit paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->inheritParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidInheritPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->InheritPaths, opType, - context->inheritParsingTargetPaths, context); -} - -void -_InheritAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Inherit paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->inheritParsingTargetPaths.push_back(absPath); -} - -void -_PrimSetSpecializesListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->specializesParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting specializes paths to None (or empty list) is only allowed " - "when setting explicit specializes paths, not for list editing"); - return; - } - - TF_FOR_ALL(path, context->specializesParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidSpecializesPath(*path)); - } - - _SetListOpItems(SdfFieldKeys->Specializes, opType, - context->specializesParsingTargetPaths, context); -} - -void -_SpecializesAppendPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Specializes paths are not allowed to be variants. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - context->specializesParsingTargetPaths.push_back(absPath); -} - -void -_PrimSetReferenceListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->referenceParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting references to None (or an empty list) is only allowed " - "when setting explicit references, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->referenceParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidReference(*ref)); - } - - _SetListOpItems(SdfFieldKeys->References, opType, - context->referenceParsingRefs, context); -} - -void -_PrimSetPayloadListItems(SdfListOpType opType, Sdf_TextParserContext *context) -{ - if (context->payloadParsingRefs.empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting payload to None (or an empty list) is only allowed " - "when setting explicit payloads, not for list editing"); - return; - } - - TF_FOR_ALL(ref, context->payloadParsingRefs) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidPayload(*ref)); - } - - _SetListOpItems(SdfFieldKeys->Payload, opType, - context->payloadParsingRefs, context); -} - -void -_PrimSetVariantSetNamesListItems(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - std::vector names; - names.reserve(context->nameVector.size()); - TF_FOR_ALL(name, context->nameVector) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantIdentifier(*name)); - names.push_back(name->GetText()); - } - - _SetListOpItems(SdfFieldKeys->VariantSetNames, opType, names, context); - - // If the op type is added or explicit, create the variant sets - if (opType == SdfListOpTypeAdded || opType == SdfListOpTypeExplicit) { - TF_FOR_ALL(i, context->nameVector) { - _CreateSpec( - context->path.AppendVariantSelection(*i,""), - SdfSpecTypeVariantSet, context); - } - - _SetField( - context->path, SdfChildrenKeys->VariantSetChildren, - context->nameVector, context); - } - -} - -void -_RelationshipInitTarget(const SdfPath& targetPath, - Sdf_TextParserContext *context) -{ - SdfPath path = context->path.AppendTarget(targetPath); - - if (!_HasSpec(path, context)) { - // Create relationship target spec by setting the appropriate - // object type flag. - _CreateSpec(path, SdfSpecTypeRelationshipTarget, context); - - // Add the target path to the owning relationship's list of target - // children. - context->relParsingNewTargetChildren.push_back(targetPath); - } -} - -void -_RelationshipSetTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (!context->relParsingTargetPaths) { - // No target paths were encountered. - return; - } - - if (context->relParsingTargetPaths->empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting relationship targets to None (or empty list) is only " - "allowed when setting explicit targets, not for list editing"); - return; - } - - TF_FOR_ALL(path, *context->relParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidRelationshipTargetPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - // Initialize relationship target specs for each target path that - // is added in this layer. - TF_FOR_ALL(pathIter, *context->relParsingTargetPaths) { - _RelationshipInitTarget(*pathIter, context); - } - } - - _SetListOpItems(SdfFieldKeys->TargetPaths, opType, - *context->relParsingTargetPaths, context); -} - -void -_PrimSetVariantSelection(Sdf_TextParserContext *context) -{ - SdfVariantSelectionMap refVars; - - // The previous parser implementation allowed multiple variant selection - // dictionaries in prim metadata to be merged, so we do the same here. - VtValue oldVars; - if (_HasField( - context->path, SdfFieldKeys->VariantSelection, &oldVars, context)) { - refVars = oldVars.Get(); - } - - TF_FOR_ALL(it, context->currentDictionaries[0]) { - if (!it->second.IsHolding()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, "variant name must be a string"); - return; - } else { - const std::string variantName = it->second.Get(); - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidVariantSelection(variantName)); - - refVars[it->first] = variantName; - } - } - - _SetField(context->path, SdfFieldKeys->VariantSelection, refVars, context); - context->currentDictionaries[0].clear(); -} - -void -_RelocatesAdd(const Sdf_ParserHelpers::Value& arg1, const Sdf_ParserHelpers::Value& arg2, - Sdf_TextParserContext *context) -{ - const std::string& srcStr = arg1.Get(); - const std::string& targetStr = arg2.Get(); - - SdfPath srcPath(srcStr); - SdfPath targetPath(targetStr); - - if (!SdfSchema::IsValidRelocatesPath(srcPath)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid relocates path", - srcStr.c_str()); - return; - } - if (!SdfSchema::IsValidRelocatesPath(targetPath)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid relocates path", - targetStr.c_str()); - return; - } - - // The relocates map is expected to only hold absolute paths. The - // SdRelocatesMapProxy ensures that all paths are made absolute when - // editing, but since we're bypassing that proxy and setting the map - // directly into the underlying SdfData, we need to explicitly absolutize - // paths here. - srcPath = srcPath.MakeAbsolutePath(context->path); - targetPath = targetPath.MakeAbsolutePath(context->path); - - context->relocatesParsing.emplace_back( - std::move(srcPath), std::move(targetPath)); - - context->layerHints.mightHaveRelocates = true; -} - -void -_AttributeSetConnectionTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context) -{ - if (context->connParsingTargetPaths.empty() && - opType != SdfListOpTypeExplicit) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Setting connection paths to None (or an empty list) " - "is only allowed when setting explicit connection paths, " - "not for list editing"); - return; - } - - TF_FOR_ALL(path, context->connParsingTargetPaths) { - ERROR_AND_RETURN_IF_NOT_ALLOWED( - context, - SdfSchema::IsValidAttributeConnectionPath(*path)); - } - - if (opType == SdfListOpTypeAdded || - opType == SdfListOpTypeExplicit) { - - TF_FOR_ALL(pathIter, context->connParsingTargetPaths) { - SdfPath path = context->path.AppendTarget(*pathIter); - if (!_HasSpec(path, context)) { - _CreateSpec(path, SdfSpecTypeConnection, context); - } - } - - _SetField( - context->path, SdfChildrenKeys->ConnectionChildren, - context->connParsingTargetPaths, context); + context.currentValue = context.values.ProduceValue(&errStr); + if (context.currentValue.IsEmpty()) { + errorMessage = "Error parsing simple value: " + errStr; + return false; } - _SetListOpItems(SdfFieldKeys->ConnectionPaths, opType, - context->connParsingTargetPaths, context); -} - -void -_AttributeAppendConnectionPath(Sdf_TextParserContext *context) -{ - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Connection paths never point into the variant namespace. - SdfPath absPath = - context->savedPath.MakeAbsolutePath(context->path.GetPrimPath()); - - // XXX Workaround for bug 68132: - // Prior to the fix to bug 67916, FilterGenVariantBase was authoring - // invalid connection paths containing variant selections (which - // Sd was failing to report as erroneous). As a result, there's - // a fair number of assets out there with these broken forms of - // connection paths. As a migration measure, we discard those - // variant selections here. - if (absPath.ContainsPrimVariantSelection()) { - TF_WARN("Connection path <%s> (in file @%s@, line %i) has a variant " - "selection, but variant selections are not meaningful in " - "connection paths. Stripping the variant selection and " - "using <%s> instead. Resaving the file will fix this issue.", - absPath.GetText(), - context->fileContext.c_str(), - context->sdfLineNo, - absPath.StripAllVariantSelections().GetText()); - absPath = absPath.StripAllVariantSelections(); - } - - context->connParsingTargetPaths.push_back(absPath); + return true; } -void -_PrimInitAttribute(const Sdf_ParserHelpers::Value &arg1, Sdf_TextParserContext *context) +bool +_ValueSetTuple(Sdf_TextParserContext& context, + std::string& errorMessage) { - TfToken name(arg1.Get()); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, "'%s' is not a valid attribute name", - name.GetText()); - } - - context->path = context->path.AppendProperty(name); - - // If we haven't seen this attribute before, then set the object type - // and add it to the parent's list of properties. Otherwise both have - // already been done, so we don't need to do anything. - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeAttribute, context); - _SetField(context->path, SdfFieldKeys->Custom, false, context); - } - - if(context->custom) - _SetField(context->path, SdfFieldKeys->Custom, true, context); - - // If the type was previously set, check that it matches. Otherwise set it. - const TfToken newType(context->values.valueTypeName); - - VtValue oldTypeValue; - if (_HasField( - context->path, SdfFieldKeys->TypeName, &oldTypeValue, context)) { - const TfToken& oldType = oldTypeValue.Get(); - - if (newType != oldType) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "attribute '%s' already has type '%s', cannot change to '%s'", - context->path.GetName().c_str(), - oldType.GetText(), - newType.GetText()); + if (!context.values.IsRecordingString()) { + if (context.values.valueIsShaped) { + errorMessage = "Type name has [] for non-shaped value.\n"; + return false; } } - else { - _SetField(context->path, SdfFieldKeys->TypeName, newType, context); - } - - // If the variability was previously set, check that it matches. Otherwise - // set it. If the 'variability' VtValue is empty, that indicates varying - // variability. - SdfVariability variability = context->variability.IsEmpty() ? - SdfVariabilityVarying : context->variability.Get(); - VtValue oldVariability; - if (_HasField( - context->path, SdfFieldKeys->Variability, &oldVariability, - context)) { - if (variability != oldVariability.Get()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "attribute '%s' already has variability '%s', " - "cannot change to '%s'", - context->path.GetName().c_str(), - TfEnum::GetName(oldVariability.Get()).c_str(), - TfEnum::GetName(variability).c_str() ); - } - } else { - _SetField( - context->path, SdfFieldKeys->Variability, variability, context); - } -} - -void -_DictionaryBegin(Sdf_TextParserContext *context) -{ - context->currentDictionaries.push_back(VtDictionary()); - - // Whenever we parse a value for an unregistered generic metadata field, - // the parser value context records the string representation only, because - // we don't have enough type information to generate a C++ value. However, - // dictionaries are a special case because we have all the type information - // we need to generate C++ values. So, override the previous setting. - if (context->values.IsRecordingString()) { - context->values.StopRecordingString(); - } -} - -void -_DictionaryEnd(Sdf_TextParserContext *context) -{ - context->currentDictionaries.pop_back(); -} - -void -_DictionaryInsertValue(const Sdf_ParserHelpers::Value& arg1, Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - context->currentDictionaries[n-2][arg1.Get()] = - context->currentValue; -} - -void -_DictionaryInsertDictionary(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - size_t n = context->currentDictionaries.size(); - // Insert the parsed dictionary into the parent dictionary. - context->currentDictionaries[n-2][arg1.Get()].Swap( - context->currentDictionaries[n-1]); - // Clear out the last dictionary (there can be more dictionaries on the - // same nesting level). - context->currentDictionaries[n-1].clear(); -} -void -_DictionaryInitScalarFactory(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& typeName = arg1.Get(); - if (!_SetupValue(typeName, context)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); + std::string errStr; + context.currentValue = context.values.ProduceValue(&errStr); + if (context.currentValue == VtValue()) { + errorMessage = "Error parsing tuple value: " + errStr; + return false; } -} -void -_DictionaryInitShapedFactory(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string typeName = arg1.Get() + "[]"; - if (!_SetupValue(typeName, context)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Unrecognized value typename '%s' for dictionary", - typeName.c_str()); - } + return true; } -void -_ValueSetTuple(Sdf_TextParserContext *context) +bool +_ValueSetList(Sdf_TextParserContext& context, + std::string& errorMessage) { - if (!context->values.IsRecordingString()) { - if (context->values.valueIsShaped) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Type name has [] for non-shaped value.\n"); - return; + if (!context.values.IsRecordingString()) { + if (!context.values.valueIsShaped) { + errorMessage = "Type name missing [] for shaped value."; + return false; } } std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Error parsing tuple value: %s", errStr.c_str()); - return; - } -} - -void -_ValueSetList(Sdf_TextParserContext *context) -{ - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Type name missing [] for shaped value."); - return; - } + context.currentValue = context.values.ProduceValue(&errStr); + if (context.currentValue == VtValue()) { + errorMessage = "Error parsing shaped value: " + errStr; + return false; } - std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Error parsing shaped value: %s", errStr.c_str()); - return; - } + return true; } -void -_ValueSetShaped(Sdf_TextParserContext *context) +bool +_ValueSetShaped(Sdf_TextParserContext& context, + std::string& errorMessage) { - if (!context->values.IsRecordingString()) { - if (!context->values.valueIsShaped) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Type name missing [] for shaped value."); - return; + if (!context.values.IsRecordingString()) { + if (!context.values.valueIsShaped) { + errorMessage = "Type name missing [] for shaped value."; + return false; } } std::string errStr; - context->currentValue = context->values.ProduceValue(&errStr); - if (context->currentValue == VtValue()) { + context.currentValue = context.values.ProduceValue(&errStr); + if (context.currentValue == VtValue()) { // The factory method ProduceValue() uses for shaped types // only returns empty VtArrays, not empty VtValues, so this // is impossible to hit currently. // CODE_COVERAGE_OFF - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Error parsing shaped value: %s", errStr.c_str()); + errorMessage = "Error parsing shaped value: " + errStr; // CODE_COVERAGE_OFF_GCOV_BUG // The following line actually shows as executed (a ridiculous // number of times) even though the line above shwos as // not executed - return; + return false; // CODE_COVERAGE_ON_GCOV_BUG // CODE_COVERAGE_ON } -} -void -_ValueSetCurrentToSdfPath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - // make current Value an SdfPath of the given argument... - std::string s = arg1.Get(); - // If path is empty, use default c'tor to construct empty path. - // XXX: 08/04/08 Would be nice if SdfPath would allow - // SdfPath("") without throwing a warning. - context->currentValue = s.empty() ? SdfPath() : SdfPath(s); -} - -void -_PrimInitRelationship(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - TfToken name( arg1.Get() ); - if (!SdfPath::IsValidNamespacedIdentifier(name)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "'%s' is not a valid relationship name", name.GetText()); - return; - } - - context->path = context->path.AppendProperty(name); - - if (!_HasSpec(context->path, context)) { - context->propertiesStack.back().push_back(name); - _CreateSpec(context->path, SdfSpecTypeRelationship, context); - } - - _SetField( - context->path, SdfFieldKeys->Variability, - context->variability, context); - - if (context->custom) { - _SetField(context->path, SdfFieldKeys->Custom, context->custom, context); - } - - context->relParsingAllowTargetData = false; - context->relParsingTargetPaths.reset(); - context->relParsingNewTargetChildren.clear(); -} - -void -_PrimEndRelationship(Sdf_TextParserContext *context) -{ - if (!context->relParsingNewTargetChildren.empty()) { - std::vector children = - context->data->GetAs >( - context->path, SdfChildrenKeys->RelationshipTargetChildren); - - children.insert(children.end(), - context->relParsingNewTargetChildren.begin(), - context->relParsingNewTargetChildren.end()); - - _SetField( - context->path, SdfChildrenKeys->RelationshipTargetChildren, - children, context); - } - - context->path = context->path.GetParentPath(); -} - -void -_RelationshipAppendTargetPath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - // Add a new target to the current relationship - const std::string& pathStr = arg1.Get(); - SdfPath path(pathStr); - - if (!path.IsAbsolutePath()) { - // Expand paths relative to the containing prim. - // - // This strips any variant selections from the containing prim - // path before expanding the relative path, which is what we - // want. Target paths never point into the variant namespace. - path = path.MakeAbsolutePath(context->path.GetPrimPath()); - } - - if (!context->relParsingTargetPaths) { - // This is the first target we've seen for this relationship. - // Start tracking them in a vector. - context->relParsingTargetPaths = SdfPathVector(); - } - context->relParsingTargetPaths->push_back(path); + return true; } void -_PathSetPrim(const Sdf_ParserHelpers::Value& arg1, Sdf_TextParserContext *context) +_SetDefault(const SdfPath& path, VtValue val, + Sdf_TextParserContext& context) { - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - if (!context->savedPath.IsPrimPath()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "'%s' is not a valid prim path", pathStr.c_str()); + // If is holding SdfPathExpression (or array of same), make absolute with + // path.GetPrimPath() as anchor. + if (val.IsHolding()) { + val.UncheckedMutate([&](SdfPathExpression &pe) { + pe = pe.MakeAbsolute(path.GetPrimPath()); + }); } -} - -void -_PathSetPrimOrPropertyScenePath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context) -{ - const std::string& pathStr = arg1.Get(); - context->savedPath = SdfPath(pathStr); - // Valid paths are prim or property paths that do not contain variant - // selections. - SdfPath const &path = context->savedPath; - bool pathValid = (path.IsPrimPath() || path.IsPropertyPath()) && - !path.ContainsPrimVariantSelection(); - if (!pathValid) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "'%s' is not a valid prim or property scene path", - pathStr.c_str()); + else if (val.IsHolding>()) { + val.UncheckedMutate>( + [&](VtArray &peArr) { + for (SdfPathExpression &pe: peArr) { + pe = pe.MakeAbsolute(path.GetPrimPath()); + } + }); } + context.data->Set(path, SdfFieldKeys->Default, val); } void -_SetGenericMetadataListOpItems(const TfType& fieldType, - Sdf_TextParserContext *context) -{ - // Chain together attempts to set list op items using 'or' to bail - // out as soon as we successfully write out the list op we're holding. - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context) || - _SetItemsIfListOp(fieldType, context); -} - -bool -_IsGenericMetadataListOpType(const TfType& type, - TfType* itemArrayType) +_KeyValueMetadataStart(const std::string& key, SdfSpecType specType, + Sdf_TextParserContext& context) { - static std::pair listOpAndArrayTypes[] = { - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - _GetListOpAndArrayTfTypes(), - }; + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Starting metadata for key: " + key + + "(List op: " + _ListOpTypeToString(context.listOpType) + ")\n"); - auto iter = std::find_if(std::begin(listOpAndArrayTypes), - std::end(listOpAndArrayTypes), - [&type](auto const &p) { - return p.first == type; - }); - - if (iter == std::end(listOpAndArrayTypes)) { - return false; - } - - if (itemArrayType) { - *itemArrayType = iter->second; - } - - return true; -} - -void -_GenericMetadataStart(const Sdf_ParserHelpers::Value &name, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->genericMetadataKey = TfToken(name.Get()); - context->listOpType = SdfListOpTypeExplicit; + context.genericMetadataKey = TfToken(key); const SdfSchema& schema = SdfSchema::GetInstance(); const SdfSchema::SpecDefinition &specDef = *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { + if (specDef.IsMetadataField(context.genericMetadataKey)) { // Prepare to parse a known field const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); + *schema.GetFieldDefinition(context.genericMetadataKey); const TfType fieldType = fieldDef.GetFallbackValue().GetType(); // For list op-valued metadata fields, set up the parser as if // we were parsing an array of the list op's underlying type. - // In _GenericMetadataEnd, we'll produce this list and set it + // In _KeyValueMetadataEnd, we'll produce this list and set it // into the appropriate place in the list op. TfType itemArrayType; if (_IsGenericMetadataListOpType(fieldType, &itemArrayType)) { - _SetupValue(schema.FindType(itemArrayType). - GetAsToken().GetString(), context); + context.values.SetupFactory(schema.FindType(itemArrayType). + GetAsToken().GetString()); } else { - _SetupValue(schema.FindType(fieldDef.GetFallbackValue()). - GetAsToken().GetString(), context); + context.values.SetupFactory(schema.FindType( + fieldDef.GetFallbackValue()).GetAsToken().GetString()); } } else { // Prepare to parse only the string representation of this metadata // value, since it's an unregistered field. - context->values.StartRecordingString(); + context.values.StartRecordingString(); } } -void -_GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) +bool +_KeyValueMetadataEnd(SdfSpecType specType, Sdf_TextParserContext& context, + std::string& errorMessage) { const SdfSchema& schema = SdfSchema::GetInstance(); const SdfSchema::SpecDefinition &specDef = *schema.GetSpecDefinition(specType); - if (specDef.IsMetadataField(context->genericMetadataKey)) { + if (specDef.IsMetadataField(context.genericMetadataKey)) { // Validate known fields before storing them const SdfSchema::FieldDefinition &fieldDef = - *schema.GetFieldDefinition(context->genericMetadataKey); + *schema.GetFieldDefinition(context.genericMetadataKey); const TfType fieldType = fieldDef.GetFallbackValue().GetType(); if (_IsGenericMetadataListOpType(fieldType)) { - if (!fieldDef.IsValidListValue(context->currentValue)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); + if (!fieldDef.IsValidListValue(context.currentValue)) { + errorMessage = "invalid value for field \"" + + context.genericMetadataKey.GetString() + "\""; + return false; } else { _SetGenericMetadataListOpItems(fieldType, context); } } else { - if (!fieldDef.IsValidValue(context->currentValue) || - context->currentValue.IsEmpty()) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "invalid value for field \"%s\"", - context->genericMetadataKey.GetText()); + if (!fieldDef.IsValidValue(context.currentValue) || + context.currentValue.IsEmpty()) { + errorMessage = "invalid value for field \"" + + context.genericMetadataKey.GetString() + "\""; + return false; } else { - _SetField( - context->path, context->genericMetadataKey, - context->currentValue, context); + context.data->Set(context.path, + context.genericMetadataKey, + VtValue(context.currentValue)); } } - } else if (specDef.IsValidField(context->genericMetadataKey)) { + } else if (specDef.IsValidField(context.genericMetadataKey)) { // Prevent the user from overwriting fields that aren't metadata - SDF_TEXTFILEFORMATPARSER_ERR(context, - "\"%s\" is registered as a non-metadata field", - context->genericMetadataKey.GetText()); + errorMessage = "\"" + context.genericMetadataKey.GetString() + + "\" is registered as a non-metadata field"; + return false; } else { // Stuff unknown fields into a SdfUnregisteredValue so they can pass // through loading and saving unmodified VtValue value; - if (context->currentValue.IsHolding()) { + if (context.currentValue.IsHolding()) { // If we parsed a dictionary, store it's actual value. Dictionaries // can be parsed fully because they contain type information. value = - SdfUnregisteredValue(context->currentValue.Get()); + SdfUnregisteredValue(context.currentValue.Get()); } else { // Otherwise, we parsed a simple value or a shaped list of simple // values. We want to store the parsed string, but we need to @@ -909,8 +242,8 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) // or to just store the string directly. auto getOldValue = [context]() { VtValue v; - if (_HasField(context->path, context->genericMetadataKey, - &v, context) + if (context.data->Has(context.path, + context.genericMetadataKey, &v) && TF_VERIFY(v.IsHolding())) { v = v.UncheckedGet().GetValue(); } @@ -921,7 +254,7 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) }; auto getRecordedStringAsUnregisteredValue = [context]() { - std::string s = context->values.GetRecordedString(); + std::string s = context.values.GetRecordedString(); if (s == "None") { return std::vector(); } @@ -937,13 +270,13 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) }; VtValue oldValue = getOldValue(); - if (context->listOpType == SdfListOpTypeExplicit) { + if (context.listOpType == SdfListOpTypeExplicit) { // In this case, we can't determine whether the we've parsed // an explicit list op statement or a simple value. // We just store the recorded string directly, as that's the // simplest thing to do. value = - SdfUnregisteredValue(context->values.GetRecordedString()); + SdfUnregisteredValue(context.values.GetRecordedString()); } else if (oldValue.IsEmpty() || oldValue.IsHolding()) { @@ -953,7 +286,7 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) SdfUnregisteredValueListOp listOp = oldValue.GetWithDefault(); listOp.SetItems(getRecordedStringAsUnregisteredValue(), - context->listOpType); + context.listOpType); value = SdfUnregisteredValue(listOp); } else { @@ -966,37 +299,569 @@ _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context) } if (!value.IsEmpty()) { - _SetField(context->path, context->genericMetadataKey, - value, context); + context.data->Set(context.path, context.genericMetadataKey, + VtValue(value)); + } + } + + context.values.Clear(); + context.currentValue = VtValue(); + + return true; +} + +bool +_CreatePrimSpec(const std::string& primIdentifierString, + Sdf_TextParserContext& context, std::string& errorMessage) +{ + TfToken primIdentifier(primIdentifierString); + if (!SdfPath::IsValidIdentifier(primIdentifier)) + { + errorMessage = "'" + primIdentifierString + "' is not a valid prim name"; + return false; + } + context.path = context.path.AppendChild(primIdentifier); + + // create the spec + if(context.data->HasSpec(context.path)) + { + errorMessage = "Duplicate prim '" + primIdentifierString + "'"; + return false; + } + else + { + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Creating prim spec: " + primIdentifierString + "\n"); + context.data->CreateSpec(context.path, SdfSpecTypePrim); + context.nameChildrenStack.back().push_back(primIdentifier); + } + + // set the context for this prim's name children and properties + context.nameChildrenStack.push_back(std::vector()); + context.propertiesStack.push_back(std::vector()); + + // set the specifier, typeName, and clear the isParsingPrimName context + context.data->Set(context.path, + SdfFieldKeys->Specifier, VtValue(context.specifier)); + if (!context.primTypeName.empty()) + { + TfToken typeName = TfToken(context.primTypeName); + context.data->Set(context.path, + SdfFieldKeys->TypeName, VtValue(typeName)); + } + + context.primTypeName.clear(); + + return true; +} + +bool +_CreateRelationshipSpec(const std::string& relationshipName, + Sdf_TextParserContext& context, + std::string& errorMessage) +{ + TfToken name(relationshipName); + if (!SdfPath::IsValidNamespacedIdentifier(name)) { + errorMessage = "'" + name.GetString() + + " is not a valid relationship name"; + + return false; + } + + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Creating relationship spec for " + relationshipName + + ", current path is: " + context.path.GetAsString() + "\n"); + + context.path = context.path.AppendProperty(name); + + if (!context.data->HasSpec(context.path)) { + context.propertiesStack.back().push_back(name); + context.data->CreateSpec(context.path, SdfSpecTypeRelationship); + } + + context.data->Set( + context.path, SdfFieldKeys->Variability, + VtValue(context.variability)); + + if (context.custom) { + context.data->Set( + context.path, + SdfFieldKeys->Custom, + VtValue(true)); + } + + context.relParsingTargetPaths.reset(); + context.relParsingNewTargetChildren.clear(); + + return true; +} + +bool +_CreateAttributeSpec(const std::string& attributeName, + Sdf_TextParserContext& context, + std::string& errorMessage) +{ + TfToken name(attributeName); + if (!SdfPath::IsValidNamespacedIdentifier(name)) + { + errorMessage = "'" + name.GetString() + + "' is not a valid attribute name"; + + return false; + } + + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Creating attribute spec for " + attributeName + + ", current path is: " + context.path.GetAsString() + "\n"); + + context.path = context.path.AppendProperty(name); + + // If we haven't seen this attribute before, then set the object type + // and add it to the parent's list of properties. Otherwise both have + // already been done, so we don't need to do anything. + if (!context.data->HasSpec(context.path)) + { + context.propertiesStack.back().push_back(name); + context.data->CreateSpec(context.path, SdfSpecTypeAttribute); + context.data->Set(context.path, + SdfFieldKeys->Custom, + VtValue(false)); + } + + // this may be a redefinition, and custom may have changed on the spec + // so we set that here + if(context.custom) + { + context.data->Set(context.path, + SdfFieldKeys->Custom, + VtValue(true)); + } + + // If the type was previously set, check that it matches. Otherwise set it. + const TfToken newType(context.values.valueTypeName); + VtValue oldTypeValue; + if (context.data->Has(context.path, + SdfFieldKeys->TypeName, + &oldTypeValue)) + { + const TfToken& oldType = oldTypeValue.Get(); + if (newType != oldType) + { + errorMessage = "attribute '" + context.path.GetName() + + "' already has type '" + oldType.GetString() + + "', cannot change to '" + newType.GetString() + "'"; + + return false; + } + } + else + { + context.data->Set(context.path, + SdfFieldKeys->TypeName, + VtValue(newType)); + } + + // If the variability was previously set, check that it matches. Otherwise + // set it. If the 'variability' VtValue is empty, that indicates varying + // variability. + SdfVariability variability = context.variability.IsEmpty() ? + SdfVariabilityVarying : context.variability.Get(); + VtValue oldVariability; + if (context.data->Has(context.path, + SdfFieldKeys->Variability, + &oldVariability)) + { + if (variability != oldVariability.Get()) + { + errorMessage = "attribute '" + context.path.GetName() + + "' already has variability '" + + TfEnum::GetName(oldVariability.Get()) + + "', cannot change to '" + + TfEnum::GetName(variability) + "'"; + + return false; + } + } + else + { + context.data->Set(context.path, + SdfFieldKeys->Variability, + VtValue(variability)); + } + + return true; +} + +std::pair +_GetNumericValueFromString(const std::string_view in) +{ + bool no_overflow = true; + Sdf_ParserHelpers::Value value; + constexpr std::string_view negativeZero = "-0"; + constexpr std::string_view negativeInfinity = "-inf"; + constexpr std::string_view positiveInfinity = "inf"; + constexpr std::string_view nan = "nan"; + + auto mustBeDouble = [](const std::string_view str) { + return str.find('.') != str.npos || + str.find('e') != str.npos || + str.find('E') != str.npos; + }; + + if (in == negativeZero) + { + value = double(-0.0); + } + else if(in == negativeInfinity) + { + value = -std::numeric_limits::infinity(); + } + + else if (in == positiveInfinity) + { + value = std::numeric_limits::infinity(); + } + else if (in == nan) + { + value = std::numeric_limits::quiet_NaN(); + } + else if (mustBeDouble(in)) + { + value = TfStringToDouble(in.data(), in.length()); + } + else + { + // positive and negative integers are stored as long + // unless out of range + bool outOfRange = false; + if (!in.empty() && in.front() == '-') + { + value = TfStringToInt64(std::string(in), &outOfRange); + } + else + { + value = TfStringToUInt64(std::string(in), &outOfRange); + } + + if (outOfRange) + { + no_overflow = false; + value = TfStringToDouble(in.data(), in.length()); } } - context->values.Clear(); - context->currentValue = VtValue(); + return {no_overflow, value}; +} + +void +_SetGenericMetadataListOpItems(const TfType& fieldType, + Sdf_TextParserContext& context) +{ + // Chain together attempts to set list op items using 'or' to bail + // out as soon as we successfully write out the list op we're holding. + // we don't return the error message here because some of these can be + // unsuccessful + std::string errorMessage; + _SetItemsIfListOpWithError(fieldType, context, errorMessage) || + _SetItemsIfListOpWithError(fieldType, context, errorMessage) || + _SetItemsIfListOpWithError(fieldType, context, errorMessage) || + _SetItemsIfListOpWithError(fieldType, context, errorMessage) || + _SetItemsIfListOpWithError(fieldType, context, errorMessage) || + _SetItemsIfListOpWithError(fieldType, context, errorMessage); +} + +bool +_IsGenericMetadataListOpType(const TfType& type, + TfType* itemArrayType) +{ + static std::pair listOpAndArrayTypes[] = { + _GetListOpAndArrayTfTypes(), + _GetListOpAndArrayTfTypes(), + _GetListOpAndArrayTfTypes(), + _GetListOpAndArrayTfTypes(), + _GetListOpAndArrayTfTypes(), + _GetListOpAndArrayTfTypes(), + }; + + auto iter = std::find_if(std::begin(listOpAndArrayTypes), + std::end(listOpAndArrayTypes), + [&type](auto const &p) { + return p.first == type; + }); + + if (iter == std::end(listOpAndArrayTypes)) { + return false; + } + + if (itemArrayType) { + *itemArrayType = iter->second; + } + + return true; +} + +std::string +_ContextToString(Sdf_TextParserCurrentParsingContext parsingContext) +{ + switch(parsingContext) + { + case Sdf_TextParserCurrentParsingContext::LayerSpec: + { + return "LayerSpec"; + } + case Sdf_TextParserCurrentParsingContext::PrimSpec: + { + return "PrimSpec"; + } + case Sdf_TextParserCurrentParsingContext::AttributeSpec: + { + return "AttributeSpec"; + } + case Sdf_TextParserCurrentParsingContext::RelationshipSpec: + { + return "RelationshipSpec"; + } + case Sdf_TextParserCurrentParsingContext::Metadata: + { + return "Metadata"; + } + case Sdf_TextParserCurrentParsingContext::KeyValueMetadata: + { + return "KeyValueMetadata"; + } + case Sdf_TextParserCurrentParsingContext::ListOpMetadata: + { + return "ListOpMetadata"; + } + case Sdf_TextParserCurrentParsingContext::DocMetadata: + { + return "DocMetadata"; + } + case Sdf_TextParserCurrentParsingContext::PermissionMetadata: + { + return "PermissionMetadata"; + } + case Sdf_TextParserCurrentParsingContext::SymmetryFunctionMetadata: + { + return "SymmetryFunctionMetadata"; + } + case Sdf_TextParserCurrentParsingContext::DisplayUnitMetadata: + { + return "DisplayUnitMetadata"; + } + case Sdf_TextParserCurrentParsingContext::Dictionary: + { + return "Dictionary"; + } + case Sdf_TextParserCurrentParsingContext::DictionaryTypeName: + { + return "DictionaryTypeName"; + } + case Sdf_TextParserCurrentParsingContext::DictionaryKey: + { + return "DictionaryKey"; + } + case Sdf_TextParserCurrentParsingContext::ConnectAttribute: + { + return "ConnectAttribute"; + } + case Sdf_TextParserCurrentParsingContext::TimeSamples: + { + return "TimeSamples"; + } + case Sdf_TextParserCurrentParsingContext::ReorderRootPrims: + { + return "ReorderRootPrims"; + } + case Sdf_TextParserCurrentParsingContext::ReorderNameChildren: + { + return "ReorderNameChildren"; + } + case Sdf_TextParserCurrentParsingContext::ReorderProperties: + { + return "ReorderProperties"; + } + case Sdf_TextParserCurrentParsingContext::InheritsListOpMetadata: + { + return "InheritsListOpMetadata"; + } + case Sdf_TextParserCurrentParsingContext::SpecializesListOpMetadata: + { + return "SpecializesListOpMetadata"; + } + case Sdf_TextParserCurrentParsingContext::ReferencesListOpMetadata: + { + return "ReferencesListOpMetadata"; + } + case Sdf_TextParserCurrentParsingContext::PayloadListOpMetadata: + { + return "PayloadListOpMetadata"; + } + case Sdf_TextParserCurrentParsingContext::VariantSetsMetadata: + { + return "VariantSetsMetadata"; + } + case Sdf_TextParserCurrentParsingContext::ReferenceParameters: + { + return "ReferenceParameters"; + } + case Sdf_TextParserCurrentParsingContext::RelocatesMetadata: + { + return "RelocatesMetadata"; + } + case Sdf_TextParserCurrentParsingContext::KindMetadata: + { + return "KindMetadata"; + } + case Sdf_TextParserCurrentParsingContext::RelationshipAssignment: + { + return "RelationshipAssignment"; + } + case Sdf_TextParserCurrentParsingContext::RelationshipTarget: + { + return "RelationshipTarget"; + } + case Sdf_TextParserCurrentParsingContext::RelationshipDefault: + { + return "RelationshipDefault"; + } + case Sdf_TextParserCurrentParsingContext::LayerOffset: + { + return "LayerOffset"; + } + case Sdf_TextParserCurrentParsingContext::LayerScale: + { + return "LayerScale"; + } + case Sdf_TextParserCurrentParsingContext::VariantsMetadata: + { + return "VariantsMetadata"; + } + case Sdf_TextParserCurrentParsingContext::VariantSetStatement: + { + return "VariantSetStatement"; + } + case Sdf_TextParserCurrentParsingContext::VariantStatementList: + { + return "VariantStatementList"; + } + case Sdf_TextParserCurrentParsingContext::PrefixSubstitutionsMetadata: + { + return "PrefixSubstitutionsMetadata"; + } + case Sdf_TextParserCurrentParsingContext::SuffixSubstitutionsMetadata: + { + return "SuffixSubstitutionsMetadata"; + } + case Sdf_TextParserCurrentParsingContext::SubLayerMetadata: + { + return "SubLayerMetadata"; + } + default: + { + return ""; + } + } } -void _RaiseError(Sdf_TextParserContext *context, const char *msg) +std::string +_ListOpTypeToString(SdfListOpType listOpType) { - int errLineNumber = context->sdfLineNo; + if (listOpType == SdfListOpTypeExplicit) + { + return "explicit"; + } + else if (listOpType == SdfListOpTypeAdded) + { + return "add"; + } + else if (listOpType == SdfListOpTypeDeleted) + { + return "delete"; + } + else if (listOpType == SdfListOpTypeAppended) + { + return "append"; + } + else if (listOpType == SdfListOpTypePrepended) + { + return "prepend"; + } + else if (listOpType == SdfListOpTypeOrdered) + { + return "reorder"; + } + else + { + return "unknown"; + } +} - std::string s = TfStringPrintf( - "%s in <%s> on line %i", - msg, - context->path.GetText(), - errLineNumber); +SdfSpecType +_GetSpecTypeFromContext(Sdf_TextParserCurrentParsingContext parsingContext) +{ + if (parsingContext == + Sdf_TextParserCurrentParsingContext::AttributeSpec) + { + return SdfSpecTypeAttribute; + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::RelationshipSpec) + { + return SdfSpecTypeRelationship; + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::PrimSpec) + { + return SdfSpecTypePrim; + } + else if(parsingContext == + Sdf_TextParserCurrentParsingContext::LayerSpec) + { + return SdfSpecTypePseudoRoot; + } + else if (parsingContext == + Sdf_TextParserCurrentParsingContext::VariantStatementList) + { + return SdfSpecTypePrim; + } + else + { + return SdfSpecTypeUnknown; + } +} - // Append file context, if known. - if (!context->fileContext.empty()) { - s += " in file " + context->fileContext; +void +_PushContext(Sdf_TextParserContext& context, + Sdf_TextParserCurrentParsingContext newParsingContext) +{ + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Pushing context: " + _ContextToString(newParsingContext) + "\n"); + if (!context.parsingContext.empty()) + { + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Parent: " + _ContextToString(context.parsingContext.back()) + "\n"); } - s += "\n"; - // Return the line number in the error info. - TfDiagnosticInfo info(errLineNumber); + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Current path: " + context.path.GetAsString() + "\n"); - TF_ERROR(info, TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE, s); + context.parsingContext.push_back(newParsingContext); +} - context->seenError = true; +void +_PopContext(Sdf_TextParserContext& context) +{ + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Popping context: " + _ContextToString(context.parsingContext.back()) + "\n"); + + context.parsingContext.pop_back(); + + if (!context.parsingContext.empty()) + { + TF_DEBUG(SDF_TEXT_FILE_FORMAT_CONTEXT).Msg( + "Return to: " + _ContextToString(context.parsingContext.back()) + "\n"); + } } } // end namespace Sdf_TextFileFormatParser diff --git a/pxr/usd/sdf/textParserHelpers.h b/pxr/usd/sdf/textParserHelpers.h index 8331c5f047..608e4e07b8 100644 --- a/pxr/usd/sdf/textParserHelpers.h +++ b/pxr/usd/sdf/textParserHelpers.h @@ -43,76 +43,79 @@ PXR_NAMESPACE_OPEN_SCOPE namespace Sdf_TextFileFormatParser { -#define SDF_TEXTFILEFORMATPARSER_ERR(context, ...) \ - _RaiseError(context, TfStringPrintf(__VA_ARGS__).c_str()) +template +void +_RaiseErrorPEGTL(const Sdf_TextParserContext& context, const Input& in, + const Position& pos, const std::string& msg) +{ + // to get the position of interest, we need + // the current position of the input iterator + // which we can get via in.at - but this gives + // only a character pointer, so the best end + // we have is the end of that line + std::string inputAtError = + std::string(in.at(pos), in.end_of_line(pos)); + std::string s = TfStringPrintf( + "%s%s in <%s>", + msg.c_str(), + (" at '" + inputAtError + "'").c_str(), + context.path.GetText()); + + s += "\n"; + + // Return the line number in the error info. + TfDiagnosticInfo info(pos.line); + + TF_ERROR(info, TF_DIAGNOSTIC_RUNTIME_ERROR_TYPE, s); +} + +template +void Sdf_TextFileFormatParser_Err(const Sdf_TextParserContext& context, + const Input& input, + const Position& position, + const std::string& errorMessage) +{ + _RaiseErrorPEGTL(context, input, position, errorMessage); +} //-------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------- -bool _SetupValue(const std::string& typeName, Sdf_TextParserContext* context); -void _MatchMagicIdentifier(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -SdfPermission _GetPermissionFromString(const std::string & str, - Sdf_TextParserContext *context); -TfEnum _GetDisplayUnitFromString(const std::string & name, - Sdf_TextParserContext *context); -void _ValueAppendAtomic(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _ValueSetAtomic(Sdf_TextParserContext *context); -void _PrimSetInheritListItems(SdfListOpType opType, Sdf_TextParserContext *context); -void _InheritAppendPath(Sdf_TextParserContext *context); -void _PrimSetSpecializesListItems(SdfListOpType opType, - Sdf_TextParserContext *context); -void _SpecializesAppendPath(Sdf_TextParserContext *context); -void _PrimSetReferenceListItems(SdfListOpType opType, - Sdf_TextParserContext *context); -void _PrimSetPayloadListItems(SdfListOpType opType, Sdf_TextParserContext *context); -void _PrimSetVariantSetNamesListItems(SdfListOpType opType, - Sdf_TextParserContext *context); -void _RelationshipInitTarget(const SdfPath& targetPath, - Sdf_TextParserContext *context); -void _RelationshipSetTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context); -void _PrimSetVariantSelection(Sdf_TextParserContext *context); -void _RelocatesAdd(const Sdf_ParserHelpers::Value& arg1, - const Sdf_ParserHelpers::Value& arg2, Sdf_TextParserContext *context); -void _AttributeSetConnectionTargetsList(SdfListOpType opType, - Sdf_TextParserContext *context); -void _AttributeAppendConnectionPath(Sdf_TextParserContext *context); -void _PrimInitAttribute(const Sdf_ParserHelpers::Value &arg1, - Sdf_TextParserContext *context); -void _DictionaryBegin(Sdf_TextParserContext *context); -void _DictionaryEnd(Sdf_TextParserContext *context); -void _DictionaryInsertValue(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _DictionaryInsertDictionary(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _DictionaryInitScalarFactory(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _DictionaryInitShapedFactory(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _ValueSetTuple(Sdf_TextParserContext *context); -void _ValueSetList(Sdf_TextParserContext *context); -void _ValueSetShaped(Sdf_TextParserContext *context); -void _ValueSetCurrentToSdfPath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _PrimInitRelationship(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _PrimEndRelationship(Sdf_TextParserContext *context); -void _RelationshipAppendTargetPath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); -void _PathSetPrim(const Sdf_ParserHelpers::Value& arg1, Sdf_TextParserContext *context); -void _PathSetPrimOrPropertyScenePath(const Sdf_ParserHelpers::Value& arg1, - Sdf_TextParserContext *context); +bool _ValueSetAtomic(Sdf_TextParserContext& context, + std::string& errorMessage); +bool _ValueSetTuple(Sdf_TextParserContext& context, + std::string& errorMessage); +bool _ValueSetList(Sdf_TextParserContext& context, + std::string& errorMessage); +bool _ValueSetShaped(Sdf_TextParserContext& context, + std::string& errorMessage); +void _SetDefault(const SdfPath& path, VtValue val, + Sdf_TextParserContext& context); void _SetGenericMetadataListOpItems(const TfType& fieldType, - Sdf_TextParserContext *context); + Sdf_TextParserContext& context); bool _IsGenericMetadataListOpType(const TfType& type, TfType* itemArrayType = nullptr); -void _GenericMetadataStart(const Sdf_ParserHelpers::Value &name, SdfSpecType specType, - Sdf_TextParserContext *context); -void _GenericMetadataEnd(SdfSpecType specType, Sdf_TextParserContext *context); +void _KeyValueMetadataStart(const std::string& key, SdfSpecType specType, + Sdf_TextParserContext& context); +bool _KeyValueMetadataEnd(SdfSpecType specType, Sdf_TextParserContext& context, + std::string& errorMessage); void _RaiseError(Sdf_TextParserContext *context, const char *msg); +bool _CreatePrimSpec(const std::string& primIdentifierString, + Sdf_TextParserContext& context, std::string& errorMessage); +bool _CreateRelationshipSpec(const std::string& relationshipName, + Sdf_TextParserContext& context, std::string& errorMessage); +bool _CreateAttributeSpec(const std::string& attributeName, + Sdf_TextParserContext& context, std::string& errorMessage); +std::pair _GetNumericValueFromString( + const std::string_view in); +std::string _ContextToString(Sdf_TextParserCurrentParsingContext parsingContext); +std::string _ListOpTypeToString(SdfListOpType listOpType); +SdfSpecType _GetSpecTypeFromContext( + Sdf_TextParserCurrentParsingContext parsingContext); +void _PushContext(Sdf_TextParserContext& context, + Sdf_TextParserCurrentParsingContext newParsingContext); +void _PopContext(Sdf_TextParserContext& context); template bool @@ -165,6 +168,7 @@ const std::vector& _ToItemVector(const std::vector& v) { return v; } + template std::vector _ToItemVector(const VtArray& v) { @@ -174,101 +178,36 @@ std::vector _ToItemVector(const VtArray& v) // Set a single ListOp vector in the list op for the current // path and specified key. template -void -_SetListOpItems(const TfToken &key, SdfListOpType type, - const T &itemList, Sdf_TextParserContext *context) +bool +_SetListOpItemsWithError(const TfToken &key, SdfListOpType type, + const T &itemList, Sdf_TextParserContext& context, + std::string& errorMessage) { typedef SdfListOp ListOpType; typedef typename ListOpType::ItemVector ItemVector; const ItemVector& items = _ToItemVector(itemList); - if (_HasDuplicates(items)) { - SDF_TEXTFILEFORMATPARSER_ERR(context, - "Duplicate items exist for field '%s' at '%s'", - key.GetText(), context->path.GetText()); - } - - ListOpType op = context->data->GetAs(context->path, key); - op.SetItems(items, type); - - context->data->Set(context->path, key, VtValue::Take(op)); -} + if (_HasDuplicates(items)) + { + errorMessage = "Duplicate items exist for field '" + + key.GetString() + "' at '" + context.path.GetAsString() + "'"; -// Append a single item to the vector for the current path and specified key. -template -void -_AppendVectorItem(const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - std::vector vec = - context->data->GetAs >(context->path, key); - vec.push_back(item); - - context->data->Set(context->path, key, VtValue(vec)); -} - -inline void -_SetDefault(const SdfPath& path, VtValue val, - Sdf_TextParserContext *context) -{ - // If is holding SdfPathExpression (or array of same), make absolute with - // path.GetPrimPath() as anchor. - if (val.IsHolding()) { - val.UncheckedMutate([&](SdfPathExpression &pe) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - }); - } - else if (val.IsHolding>()) { - val.UncheckedMutate>( - [&](VtArray &peArr) { - for (SdfPathExpression &pe: peArr) { - pe = pe.MakeAbsolute(path.GetPrimPath()); - } - }); - } - /* - else if (val.IsHolding()) { - SdfPath valPath; - val.UncheckedSwap(valPath); - expr.MakeAbsolutePath(path.GetPrimPath()); - val.UncheckedSwap(valPath); + return false; } - */ - context->data->Set(path, SdfFieldKeys->Default, val); -} -template -inline void -_SetField(const SdfPath& path, const TfToken& key, const T& item, - Sdf_TextParserContext *context) -{ - context->data->Set(path, key, VtValue(item)); -} + ListOpType op = context.data->GetAs(context.path, key); + op.SetItems(items, type); -inline bool -_HasField(const SdfPath& path, const TfToken& key, VtValue* value, - Sdf_TextParserContext *context) -{ - return context->data->Has(path, key, value); -} + context.data->Set(context.path, key, VtValue::Take(op)); -inline bool -_HasSpec(const SdfPath& path, Sdf_TextParserContext *context) -{ - return context->data->HasSpec(path); -} - -inline void -_CreateSpec(const SdfPath& path, SdfSpecType specType, - Sdf_TextParserContext *context) -{ - context->data->CreateSpec(path, specType); + return true; } template bool -_SetItemsIfListOp(const TfType& type, Sdf_TextParserContext *context) +_SetItemsIfListOpWithError(const TfType& type, Sdf_TextParserContext& context, + std::string& errorMessage) { if (!type.IsA()) { return false; @@ -276,19 +215,22 @@ _SetItemsIfListOp(const TfType& type, Sdf_TextParserContext *context) typedef VtArray ArrayType; - if (!TF_VERIFY(context->currentValue.IsHolding() || - context->currentValue.IsEmpty())) { + if (!TF_VERIFY(context.currentValue.IsHolding() || + context.currentValue.IsEmpty())) { return true; } ArrayType vtArray; - if (context->currentValue.IsHolding()) { - vtArray = context->currentValue.UncheckedGet(); + if (context.currentValue.IsHolding()) { + vtArray = context.currentValue.UncheckedGet(); } - _SetListOpItems( - context->genericMetadataKey, context->listOpType, vtArray, context); - return true; + return _SetListOpItemsWithError( + context.genericMetadataKey, + context.listOpType, + vtArray, + context, + errorMessage); } template @@ -300,6 +242,21 @@ _GetListOpAndArrayTfTypes() { }; } +template +void +_ReportParseError(Sdf_TextParserContext& context, const Input& in, + const std::string& text) +{ + if (!context.values.IsRecordingString()) + { + // in this case, we don't have good information on the + // exact position this occurred at because the + // input here is the original content, not the + // action input + _RaiseErrorPEGTL(context, in, in.position(), text.c_str()); + } +} + } // end namespace Sdf_TextFileFormatParser PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/bin/testusdview/CMakeLists.txt b/pxr/usdImaging/bin/testusdview/CMakeLists.txt index 67d2ff4fee..76da78bb27 100644 --- a/pxr/usdImaging/bin/testusdview/CMakeLists.txt +++ b/pxr/usdImaging/bin/testusdview/CMakeLists.txt @@ -441,7 +441,7 @@ pxr_register_test(testUsdviewFileArguments4 pxr_register_test(testUsdviewFileArguments5 PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/bin/testusdview --testScript testInvalidFileArg.py invalidSyntax.usda" - CLEAN_OUTPUT "(?:[A-Za-z]:)?/(?!refSphere2).*/" + CLEAN_OUTPUT "(?:[A-Za-z]:)?/.*(?=invalidSyntax)" STDERR_REDIRECT invalidSyntax_test_out DIFF_COMPARE invalidSyntax_test_out EXPECTED_RETURN_CODE 1 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/baseline/invalidSyntax_test_out b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/baseline/invalidSyntax_test_out index a764ca0cf6..8d6d013939 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/baseline/invalidSyntax_test_out +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewFileArguments/baseline/invalidSyntax_test_out @@ -1,2 +1,2 @@ Error: Unable to open stage 'invalidSyntax.usda' -syntax error at '@HelloWorld.usda@' in on line 11 in file invalidSyntax.usda +invalidSyntax.usda:11:23: Expected None or [ at '@HelloWorld.usda@' in From 0429e70a5bdc7dde41126fef733aea959c4d8f15 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Fri, 17 May 2024 09:41:23 -0700 Subject: [PATCH 008/202] Render Vulkan image upside down --- pxr/imaging/hgiVulkan/conversions.cpp | 6 ++- pxr/imaging/hgiVulkan/graphicsCmds.cpp | 53 +++++++++++++---------- pxr/imaging/hgiVulkan/shaderGenerator.cpp | 6 ++- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/pxr/imaging/hgiVulkan/conversions.cpp b/pxr/imaging/hgiVulkan/conversions.cpp index ed188b95da..b9b765da95 100644 --- a/pxr/imaging/hgiVulkan/conversions.cpp +++ b/pxr/imaging/hgiVulkan/conversions.cpp @@ -187,8 +187,10 @@ static_assert(HgiPolygonModeCount==3, ""); static const uint32_t _WindingTable[HgiWindingCount][2] = { - {HgiWindingClockwise, VK_FRONT_FACE_CLOCKWISE}, - {HgiWindingCounterClockwise, VK_FRONT_FACE_COUNTER_CLOCKWISE} + // We flip the winding order in HgiVulkan. See + // HgiVulkanGraphicsCmds::SetViewport for details. + {HgiWindingClockwise, VK_FRONT_FACE_COUNTER_CLOCKWISE}, + {HgiWindingCounterClockwise, VK_FRONT_FACE_CLOCKWISE} }; static_assert(HgiWindingCount==2, ""); diff --git a/pxr/imaging/hgiVulkan/graphicsCmds.cpp b/pxr/imaging/hgiVulkan/graphicsCmds.cpp index 263a6a73ec..026c7aefbd 100644 --- a/pxr/imaging/hgiVulkan/graphicsCmds.cpp +++ b/pxr/imaging/hgiVulkan/graphicsCmds.cpp @@ -101,32 +101,41 @@ HgiVulkanGraphicsCmds::SetViewport(GfVec4i const& vp) // Delay until the pipeline is set and the render pass has begun. _pendingUpdates.push_back( [this, vp] { - float offsetX = (float) vp[0]; - float offsetY = (float) vp[1]; - float width = (float) vp[2]; - float height = (float) vp[3]; - - // Flip viewport in Y-axis, because the vertex.y position is flipped - // between opengl and vulkan. This also moves origin to bottom-left. - // Requires VK_KHR_maintenance1 extension. - - // Alternatives are: - // 1. Multiply projection by 'inverted Y and half Z' matrix: - // const GfMatrix4d clip( - // 1.0, 0.0, 0.0, 0.0, - // 0.0, -1.0, 0.0, 0.0, - // 0.0, 0.0, 0.5, 0.0, - // 0.0, 0.0, 0.5, 1.0); - // projection = clip * projection; + const float offsetX = (float) vp[0]; + const float offsetY = (float) vp[1]; + const float width = (float) vp[2]; + const float height = (float) vp[3]; + + // Though we continue to use an OpenGL-style projection matrix in + // Storm, we choose not to flip the viewport here. + // We instead WANT to render an upside down image, as this makes + // the handling of clip-space and downstream coordinate system + // differences betwen Vulkan and OpenGL easier. + // + // For example, since framebuffers in Vulkan are y-down (versus y-up + // for OpenGL by default), sampling (0,0) from an AOV texture in + // the shader will grab from the top left of the texture in Vulkan + // (versus bottom left in GL). But since we rendered the Vulkan + // image upside down, this ends up being the same texel value as it + // would've been for GL. + // Vulkan-GL differences between the value of gl_FragCoord.y and + // the sign of screenspace derivatives w.r.t. to y are resolved + // similarly. + // Rendering Vulkan upside down also means we can also flip AOVs + // when writing them to file as we currently do for OpenGL and get + // the correct result for Vulkan, too. + // + // We do however flip the winding order for Vulkan, as otherwise + // the rendered geometry would be both upside down AND facing + // the wrong way, as Vulkan clip-space is right-handed while + // OpenGL's is left-handed. This happens in + // hgiVulkan/conversions.cpp and hgiVulkan/shaderGenerator.cpp. // - // 2. Adjust vertex position: - // gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0; - VkViewport viewport; viewport.x = offsetX; - viewport.y = offsetY + height; + viewport.y = offsetY; viewport.width = width; - viewport.height = -height; + viewport.height = height; viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f; diff --git a/pxr/imaging/hgiVulkan/shaderGenerator.cpp b/pxr/imaging/hgiVulkan/shaderGenerator.cpp index 2e7b1a5ba1..02e8e78332 100644 --- a/pxr/imaging/hgiVulkan/shaderGenerator.cpp +++ b/pxr/imaging/hgiVulkan/shaderGenerator.cpp @@ -116,14 +116,16 @@ HgiVulkanShaderGenerator::HgiVulkanShaderGenerator( _shaderLayoutAttributes.emplace_back( "layout (fractional_odd_spacing) in;\n"); } + // We flip the winding order in HgiVulkan. See + // HgiVulkanGraphicsCmds::SetViewport for details. if (descriptor.tessellationDescriptor.ordering == HgiShaderFunctionTessellationDesc::Ordering::CW) { _shaderLayoutAttributes.emplace_back( - "layout (cw) in;\n"); + "layout (ccw) in;\n"); } else if (descriptor.tessellationDescriptor.ordering == HgiShaderFunctionTessellationDesc::Ordering::CCW) { _shaderLayoutAttributes.emplace_back( - "layout (ccw) in;\n"); + "layout (cw) in;\n"); } } else if (descriptor.shaderStage == HgiShaderStageGeometry) { if (descriptor.geometryDescriptor.inPrimitiveType == From a80590179f9af85900f85d792c37db193a4db6b3 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Fri, 17 May 2024 09:55:45 -0700 Subject: [PATCH 009/202] Add Hgi::CreateNamedHgi --- pxr/imaging/hgi/debugCodes.cpp | 2 + pxr/imaging/hgi/debugCodes.h | 3 +- pxr/imaging/hgi/hgi.cpp | 104 ++++++++++++++++++++++++++++++++- pxr/imaging/hgi/hgi.h | 28 ++++++++- 4 files changed, 131 insertions(+), 6 deletions(-) diff --git a/pxr/imaging/hgi/debugCodes.cpp b/pxr/imaging/hgi/debugCodes.cpp index 53f7ff908c..e1ff2f8af3 100644 --- a/pxr/imaging/hgi/debugCodes.cpp +++ b/pxr/imaging/hgi/debugCodes.cpp @@ -36,6 +36,8 @@ TF_REGISTRY_FUNCTION(TfDebug) TF_DEBUG_ENVIRONMENT_SYMBOL(HGI_DEBUG_DEVICE_CAPABILITIES, "Hgi report when device capabilities are initialized and dump " "contents"); + TF_DEBUG_ENVIRONMENT_SYMBOL(HGI_DEBUG_INSTANCE_CREATION, + "Hgi report when attempting to create an Hgi instance"); } PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/hgi/debugCodes.h b/pxr/imaging/hgi/debugCodes.h index 637362516e..65f619e4a3 100644 --- a/pxr/imaging/hgi/debugCodes.h +++ b/pxr/imaging/hgi/debugCodes.h @@ -34,7 +34,8 @@ PXR_NAMESPACE_OPEN_SCOPE TF_DEBUG_CODES( - HGI_DEBUG_DEVICE_CAPABILITIES + HGI_DEBUG_DEVICE_CAPABILITIES, + HGI_DEBUG_INSTANCE_CREATION ); diff --git a/pxr/imaging/hgi/hgi.cpp b/pxr/imaging/hgi/hgi.cpp index 5cd70d8c25..73478a4668 100644 --- a/pxr/imaging/hgi/hgi.cpp +++ b/pxr/imaging/hgi/hgi.cpp @@ -22,6 +22,9 @@ // language governing permissions and limitations under the Apache License. // #include "pxr/imaging/hgi/hgi.h" +#include "pxr/imaging/hgi/debugCodes.h" +#include "pxr/imaging/hgi/tokens.h" + #include "pxr/base/arch/defines.h" #include "pxr/base/plug/plugin.h" #include "pxr/base/plug/registry.h" @@ -59,6 +62,9 @@ Hgi::SubmitCmds(HgiCmds* cmds, HgiSubmitWaitType wait) static Hgi* _MakeNewPlatformDefaultHgi() { + TF_DEBUG(HGI_DEBUG_INSTANCE_CREATION).Msg("Attempting to create platform " + "default Hgi\n"); + // We use the plugin system to construct derived Hgi classes to avoid any // linker complications. @@ -86,6 +92,9 @@ _MakeNewPlatformDefaultHgi() #endif } + TF_DEBUG(HGI_DEBUG_INSTANCE_CREATION).Msg("Platform default Hgi: " + "%s\n", hgiType); + const TfType plugType = plugReg.FindDerivedTypeByName(hgiType); PlugPluginPtr plugin = plugReg.GetPluginForType(plugType); @@ -110,6 +119,78 @@ _MakeNewPlatformDefaultHgi() return nullptr; } + TF_DEBUG(HGI_DEBUG_INSTANCE_CREATION).Msg("Successfully created platform " + "default Hgi %s\n", hgiType); + + return instance; +} + +static Hgi* +_MakeNamedHgi(const TfToken& hgiToken) +{ + TF_DEBUG(HGI_DEBUG_INSTANCE_CREATION).Msg("Attempting to create named Hgi " + "%s\n", hgiToken.GetText()); + + std::string hgiType; + + if (hgiToken == HgiTokens->OpenGL) { +#if defined(PXR_GL_SUPPORT_ENABLED) + hgiType = "HgiGL"; +#endif + } else if (hgiToken == HgiTokens->Vulkan) { +#if defined(PXR_VULKAN_SUPPORT_ENABLED) + hgiType = "HgiVulkan"; +#endif + } else if (hgiToken == HgiTokens->Metal) { +#if defined(PXR_METAL_SUPPORT_ENABLED) + hgiType = "HgiMetal"; +#endif + } else if (hgiToken.IsEmpty()) { + return _MakeNewPlatformDefaultHgi(); + } else { + // If an invalid token is provided, return nullptr. + TF_CODING_ERROR("Unsupported token %s was provided.", + hgiToken.GetText()); + return nullptr; + } + + // If a valid, non-empty token was provided but that Hgi type is + // unsupported by the build, return nullptr. + if (hgiType.empty()) { + TF_CODING_ERROR("Build does not support proposed Hgi type %s on " + "this platform.", hgiType.c_str()); + return nullptr; + } + + PlugRegistry& plugReg = PlugRegistry::GetInstance(); + + const TfType plugType = plugReg.FindDerivedTypeByName(hgiType); + + PlugPluginPtr plugin = plugReg.GetPluginForType(plugType); + if (!plugin || !plugin->Load()) { + TF_CODING_ERROR( + "[PluginLoad] PlugPlugin could not be loaded for TfType '%s'\n", + plugType.GetTypeName().c_str()); + return nullptr; + } + + HgiFactoryBase* factory = plugType.GetFactory(); + if (!factory) { + TF_CODING_ERROR("[PluginLoad] Cannot manufacture type '%s' \n", + plugType.GetTypeName().c_str()); + return nullptr; + } + + Hgi* instance = factory->New(); + if (!instance) { + TF_CODING_ERROR("[PluginLoad] Cannot construct instance of type '%s'\n", + plugType.GetTypeName().c_str()); + return nullptr; + } + + TF_DEBUG(HGI_DEBUG_INSTANCE_CREATION).Msg("Successfully created named Hgi " + "%s\n", hgiType.c_str()); + return instance; } @@ -128,10 +209,29 @@ Hgi::CreatePlatformDefaultHgi() return HgiUniquePtr(_MakeNewPlatformDefaultHgi()); } +HgiUniquePtr +Hgi::CreateNamedHgi(const TfToken& hgiToken) +{ + return HgiUniquePtr(_MakeNamedHgi(hgiToken)); +} + bool -Hgi::IsSupported() +Hgi::IsSupported(const TfToken& hgiToken) { - if (HgiUniquePtr const instance = CreatePlatformDefaultHgi()) { + // TODO: By current design, a Hgi instance is created and initialized as a + // method of confirming support on a platform. Once this is done, the + // instance is destroyed along with the created API contexts. This is not + // the best way to check for support on a platform and we'd like to change + // this approach in the future. + + HgiUniquePtr instance = nullptr; + if (hgiToken.IsEmpty()) { + instance = CreatePlatformDefaultHgi(); + } else { + instance = CreateNamedHgi(hgiToken); + } + + if (instance) { return instance->IsBackendSupported(); } diff --git a/pxr/imaging/hgi/hgi.h b/pxr/imaging/hgi/hgi.h index 0dbd94e9e1..d7ed1ba3f3 100644 --- a/pxr/imaging/hgi/hgi.h +++ b/pxr/imaging/hgi/hgi.h @@ -141,16 +141,38 @@ class Hgi HGI_API static HgiUniquePtr CreatePlatformDefaultHgi(); + /// Helper function to return a Hgi object of choice supported by current + /// platform and build configuration. + /// For example, on macOS, this may allow HgiMetal only. + /// If the Hgi device specified is not available on the current platform, + /// this function will fail and return nullptr. + /// If an empty token is provided, the default Hgi type (see + /// CreatePlatformDefaultHgi) will be created. + /// Supported TfToken values are OpenGL, Metal, Vulkan, or an empty token; + /// if not using an empty token, the caller is expected to use a token from + /// HgiTokens. + /// Caller, usually the application, owns the lifetime of the Hgi object and + /// the object is destroyed when the caller drops the unique ptr. + /// Thread safety: Not thread safe. + HGI_API + static HgiUniquePtr CreateNamedHgi(const TfToken& hgiToken); + /// Determine if Hgi instance can run on current hardware. /// Thread safety: This call is thread safe. HGI_API virtual bool IsBackendSupported() const = 0; - /// Constructs a temporary Hgi object for the current platform and calls - /// the object's IsBackendSupported() function. + /// Constructs a temporary Hgi object and calls the object's + /// IsBackendSupported() function. + /// A token can optionally be provided to specify a specific Hgi backend to + /// create. Supported TfToken values are OpenGL, Metal, Vulkan, or an empty + /// token; if not using an empty token, the caller is expected to use a + /// token from HgiTokens. + /// An empty token will check support for creating the platform default Hgi. + /// An invalid token will result in this function returning false. /// Thread safety: Not thread safe. HGI_API - static bool IsSupported(); + static bool IsSupported(const TfToken& hgiToken = TfToken()); /// Returns a GraphicsCmds object (for temporary use) that is ready to /// record draw commands. GraphicsCmds is a lightweight object that From 469c9c903a00f2b9ebb4e64f7f7ab850567b94a0 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Wed, 5 Jun 2024 11:04:23 -0400 Subject: [PATCH 010/202] update URL to USD Assets Working Group "Primvar Interpolation" asset in the render user guide This asset was moved from "test_assets" to "docs" in commit https://github.com/usd-wg/assets/commit/75bba2e73b27a93641b17e33e3d8a791134831af --- docs/user_guides/render_user_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guides/render_user_guide.rst b/docs/user_guides/render_user_guide.rst index 1f5e80f37d..afb7bf4923 100644 --- a/docs/user_guides/render_user_guide.rst +++ b/docs/user_guides/render_user_guide.rst @@ -625,7 +625,7 @@ from RenderMan. These are: interpolated over each face of the mesh. Bilinear interpolation is used for interpolation between the four values. -For a graphical illustration of these modes, see `Primvar Interpolation `__ +For a graphical illustration of these modes, see `Primvar Interpolation `__ As :usda:`faceVarying` allows for per-vertex-per-face values, you can use this interpolation to create discontinuous vertex UVs or normals. For example, with From b27a73dbdc0d2c5fddd071d0359a41fe976b58a1 Mon Sep 17 00:00:00 2001 From: Aleksi Sapon Date: Wed, 12 Jun 2024 09:56:58 -0400 Subject: [PATCH 011/202] Update Vulkan support on macOS --- cmake/defaults/Packages.cmake | 5 +--- pxr/imaging/hgiVulkan/capabilities.cpp | 8 +++--- pxr/imaging/hgiVulkan/device.cpp | 25 +++++++++--------- pxr/imaging/hgiVulkan/instance.cpp | 35 +++++++++++++++++++++++--- pxr/imaging/hgiVulkan/vulkan.h | 2 +- 5 files changed, 49 insertions(+), 26 deletions(-) diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake index 3f1400f617..bbdc0b07bf 100644 --- a/cmake/defaults/Packages.cmake +++ b/cmake/defaults/Packages.cmake @@ -265,10 +265,7 @@ if (PXR_BUILD_IMAGING) endforeach() # Find the OS specific libs we need - if (APPLE) - find_library(MVK_LIBRARIES NAMES MoltenVK PATHS $ENV{VULKAN_SDK}/lib) - list(APPEND VULKAN_LIBS ${MVK_LIBRARIES}) - elseif (UNIX AND NOT APPLE) + if (UNIX AND NOT APPLE) find_package(X11 REQUIRED) list(APPEND VULKAN_LIBS ${X11_LIBRARIES}) elseif (WIN32) diff --git a/pxr/imaging/hgiVulkan/capabilities.cpp b/pxr/imaging/hgiVulkan/capabilities.cpp index 05e15de4d9..bff4a399d2 100644 --- a/pxr/imaging/hgiVulkan/capabilities.cpp +++ b/pxr/imaging/hgiVulkan/capabilities.cpp @@ -111,11 +111,9 @@ HgiVulkanCapabilities::HgiVulkanCapabilities(HgiVulkanDevice* device) TF_VERIFY( vkVulkan11Features.shaderDrawParameters); - #if !defined(VK_USE_PLATFORM_MACOS_MVK) - TF_VERIFY( - vkIndexingFeatures.shaderSampledImageArrayNonUniformIndexing && - vkIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing); - #endif + TF_VERIFY( + vkIndexingFeatures.shaderSampledImageArrayNonUniformIndexing && + vkIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing); TF_VERIFY( vkVertexAttributeDivisorFeatures.vertexAttributeInstanceRateDivisor); diff --git a/pxr/imaging/hgiVulkan/device.cpp b/pxr/imaging/hgiVulkan/device.cpp index ee8db15120..4b93f3beac 100644 --- a/pxr/imaging/hgiVulkan/device.cpp +++ b/pxr/imaging/hgiVulkan/device.cpp @@ -88,7 +88,7 @@ _SupportsPresentation( "vkGetPhysicalDeviceXlibPresentationSupportKHR"); return vkGetPhysicalDeviceXlibPresentationSupportKHR( physicalDevice, familyIndex, dsp, visualID); - #elif defined(VK_USE_PLATFORM_MACOS_MVK) + #elif defined(VK_USE_PLATFORM_METAL_EXT) // Presentation currently always supported on Metal / MoltenVk return true; #else @@ -187,9 +187,12 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance) queueInfo.queueCount = 1; queueInfo.pQueuePriorities = queuePriorities; - std::vector extensions = { - VK_KHR_SWAPCHAIN_EXTENSION_NAME - }; + std::vector extensions; + + // Not available if we're surfaceless (minimal Lavapipe build for example). + if (IsSupportedExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME)) { + extensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + } // Allow certain buffers/images to have dedicated memory allocations to // improve performance on some GPUs. @@ -300,14 +303,12 @@ HgiVulkanDevice::HgiVulkanDevice(HgiVulkanInstance* instance) features.features.fragmentStoresAndAtomics = _capabilities->vkDeviceFeatures.fragmentStoresAndAtomics; - #if !defined(VK_USE_PLATFORM_MACOS_MVK) - // Needed for buffer address feature - features.features.shaderInt64 = - _capabilities->vkDeviceFeatures.shaderInt64; - // Needed for gl_primtiveID - features.features.geometryShader = - _capabilities->vkDeviceFeatures.geometryShader; - #endif + // Needed for buffer address feature + features.features.shaderInt64 = + _capabilities->vkDeviceFeatures.shaderInt64; + // Needed for gl_primtiveID + features.features.geometryShader = + _capabilities->vkDeviceFeatures.geometryShader; VkDeviceCreateInfo createInfo = {VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO}; createInfo.queueCreateInfoCount = 1; diff --git a/pxr/imaging/hgiVulkan/instance.cpp b/pxr/imaging/hgiVulkan/instance.cpp index fce46d25d9..8fdc18a333 100755 --- a/pxr/imaging/hgiVulkan/instance.cpp +++ b/pxr/imaging/hgiVulkan/instance.cpp @@ -58,8 +58,10 @@ HgiVulkanInstance::HgiVulkanInstance() VK_KHR_WIN32_SURFACE_EXTENSION_NAME, #elif defined(VK_USE_PLATFORM_XLIB_KHR) VK_KHR_XLIB_SURFACE_EXTENSION_NAME, - #elif defined(VK_USE_PLATFORM_MACOS_MVK) - VK_MVK_MACOS_SURFACE_EXTENSION_NAME, + #elif defined(VK_USE_PLATFORM_METAL_EXT) + VK_EXT_METAL_SURFACE_EXTENSION_NAME, + // See: https://github.com/KhronosGroup/MoltenVK/blob/main/Docs/MoltenVK_Runtime_UserGuide.md#interacting-with-the-moltenvk-runtime + VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME, #else #error Unsupported Platform #endif @@ -79,11 +81,36 @@ HgiVulkanInstance::HgiVulkanInstance() if (HgiVulkanIsDebugEnabled()) { extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); createInfo.ppEnabledLayerNames = debugLayers; - createInfo.enabledLayerCount = (uint32_t) TfArraySize(debugLayers); + createInfo.enabledLayerCount = static_cast(TfArraySize(debugLayers)); + } + + uint32_t numAvailableExtensions = 0u; + TF_VERIFY(vkEnumerateInstanceExtensionProperties(nullptr, &numAvailableExtensions, + nullptr) == VK_SUCCESS); + std::vector availableExtensions; + availableExtensions.resize(numAvailableExtensions); + TF_VERIFY(vkEnumerateInstanceExtensionProperties(nullptr, &numAvailableExtensions, + availableExtensions.data()) == VK_SUCCESS); + + for (auto iter = extensions.begin(); iter != extensions.end();) { + if (std::find_if(availableExtensions.begin(), availableExtensions.end(), + [name = *iter](const VkExtensionProperties& p) {return strcmp(p.extensionName, name) == 0;}) + == availableExtensions.end()) { + iter = extensions.erase(iter); + } else { + ++iter; + } } createInfo.ppEnabledExtensionNames = extensions.data(); - createInfo.enabledExtensionCount = (uint32_t) extensions.size(); + createInfo.enabledExtensionCount = static_cast(extensions.size()); + + #if defined(VK_USE_PLATFORM_METAL_EXT) + if (std::find(extensions.begin(), extensions.end(), + VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME) != extensions.end()) { + createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; + } + #endif TF_VERIFY( vkCreateInstance( diff --git a/pxr/imaging/hgiVulkan/vulkan.h b/pxr/imaging/hgiVulkan/vulkan.h index e43f34e5d6..6a4ba37cf4 100644 --- a/pxr/imaging/hgiVulkan/vulkan.h +++ b/pxr/imaging/hgiVulkan/vulkan.h @@ -32,7 +32,7 @@ #elif defined(ARCH_OS_LINUX) #define VK_USE_PLATFORM_XLIB_KHR #elif defined(ARCH_OS_OSX) - #define VK_USE_PLATFORM_MACOS_MVK + #define VK_USE_PLATFORM_METAL_EXT #else #error Unsupported Platform #endif From d6f58f3b420345d62846b2bfcbd033c926007ead Mon Sep 17 00:00:00 2001 From: Aleksi Sapon Date: Wed, 19 Jun 2024 12:01:48 -0400 Subject: [PATCH 012/202] Explicit include for std::find_if --- pxr/imaging/hgiVulkan/instance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/pxr/imaging/hgiVulkan/instance.cpp b/pxr/imaging/hgiVulkan/instance.cpp index 8fdc18a333..bc4816d029 100755 --- a/pxr/imaging/hgiVulkan/instance.cpp +++ b/pxr/imaging/hgiVulkan/instance.cpp @@ -28,6 +28,7 @@ #include "pxr/base/tf/iterator.h" #include +#include PXR_NAMESPACE_OPEN_SCOPE From b138ea90a21bf3b6721f77948db5a5e2d6daee7d Mon Sep 17 00:00:00 2001 From: Aura Munoz Date: Tue, 9 Jul 2024 17:44:51 +0200 Subject: [PATCH 013/202] [hdx] Update multisample state - Update render pass multisample state based on parameters - Update color correction task multisample state based on the sample count --- pxr/imaging/hdx/colorCorrectionTask.cpp | 1 + pxr/imaging/hdx/renderSetupTask.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pxr/imaging/hdx/colorCorrectionTask.cpp b/pxr/imaging/hdx/colorCorrectionTask.cpp index 01aef4535f..0b4290d3dd 100644 --- a/pxr/imaging/hdx/colorCorrectionTask.cpp +++ b/pxr/imaging/hdx/colorCorrectionTask.cpp @@ -1003,6 +1003,7 @@ HdxColorCorrectionTask::_CreatePipeline(HgiTextureHandle const& aovTexture) // The MSAA on renderPipelineState has to match the render target. desc.multiSampleState.sampleCount = aovTexture->GetDescriptor().sampleCount; + desc.multiSampleState.multiSampleEnable = desc.multiSampleState.sampleCount > 1; // Setup rasterization state desc.rasterizationState.cullMode = HgiCullModeBack; diff --git a/pxr/imaging/hdx/renderSetupTask.cpp b/pxr/imaging/hdx/renderSetupTask.cpp index 726319f532..27bb89e088 100644 --- a/pxr/imaging/hdx/renderSetupTask.cpp +++ b/pxr/imaging/hdx/renderSetupTask.cpp @@ -172,6 +172,8 @@ HdxRenderSetupTask::SyncParams(HdSceneDelegate* delegate, !params.enableIdRender && !TfDebug::IsEnabled(HDX_DISABLE_ALPHA_TO_COVERAGE)); + renderPassState->SetMultiSampleEnabled(params.useAovMultiSample); + if (HdStRenderPassState * const hdStRenderPassState = dynamic_cast(renderPassState.get())) { From e1cfe971ee5149ea5a85ab4cc0f7b2239e5e58bd Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Tue, 23 Jul 2024 09:33:58 -0700 Subject: [PATCH 014/202] [hdEmbree] default-initialize HdEmbreeConfig --- pxr/imaging/plugin/hdEmbree/config.cpp | 48 +++++++++++++++++--------- pxr/imaging/plugin/hdEmbree/config.h | 32 +++++++++++------ 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/pxr/imaging/plugin/hdEmbree/config.cpp b/pxr/imaging/plugin/hdEmbree/config.cpp index 2501a99d04..65768582cb 100644 --- a/pxr/imaging/plugin/hdEmbree/config.cpp +++ b/pxr/imaging/plugin/hdEmbree/config.cpp @@ -20,26 +20,40 @@ TF_INSTANTIATE_SINGLETON(HdEmbreeConfig); // Each configuration variable has an associated environment variable. // The environment variable macro takes the variable name, a default value, // and a description... -TF_DEFINE_ENV_SETTING(HDEMBREE_SAMPLES_TO_CONVERGENCE, 100, - "Samples per pixel before we stop rendering (must be >= 1)"); +TF_DEFINE_ENV_SETTING( + HDEMBREE_SAMPLES_TO_CONVERGENCE, + HdEmbreeDefaultSamplesToConvergence, + "Samples per pixel before we stop rendering (must be >= 1)"); -TF_DEFINE_ENV_SETTING(HDEMBREE_TILE_SIZE, 8, - "Size (per axis) of threading work units (must be >= 1)"); +TF_DEFINE_ENV_SETTING( + HDEMBREE_TILE_SIZE, + HdEmbreeDefaultTileSize, + "Size (per axis) of threading work units (must be >= 1)"); -TF_DEFINE_ENV_SETTING(HDEMBREE_AMBIENT_OCCLUSION_SAMPLES, 16, - "Ambient occlusion samples per camera ray (must be >= 0; a value of 0 disables ambient occlusion)"); +TF_DEFINE_ENV_SETTING( + HDEMBREE_AMBIENT_OCCLUSION_SAMPLES, + HdEmbreeDefaultAmbientOcclusionSamples, + "Ambient occlusion samples per camera ray (must be >= 0;" + " a value of 0 disables ambient occlusion)"); -TF_DEFINE_ENV_SETTING(HDEMBREE_JITTER_CAMERA, 1, - "Should HdEmbree jitter camera rays while rendering? (values >0 are true)"); +TF_DEFINE_ENV_SETTING( + HDEMBREE_JITTER_CAMERA, + HdEmbreeDefaultJitterCamera, + "Should HdEmbree jitter camera rays while rendering?"); -TF_DEFINE_ENV_SETTING(HDEMBREE_USE_FACE_COLORS, 1, - "Should HdEmbree use face colors while rendering? (values > 0 are true)"); +TF_DEFINE_ENV_SETTING( + HDEMBREE_USE_FACE_COLORS, + HdEmbreeDefaultUseFaceColors, + "Should HdEmbree use face colors while rendering?"); -TF_DEFINE_ENV_SETTING(HDEMBREE_CAMERA_LIGHT_INTENSITY, 300, - "Intensity of the camera light, specified as a percentage of <1,1,1>."); +TF_DEFINE_ENV_SETTING( + HDEMBREE_CAMERA_LIGHT_INTENSITY, + HdEmbreeDefaultCameraLightIntensity, + "Intensity of the camera light, specified as a percentage of <1,1,1>."); -TF_DEFINE_ENV_SETTING(HDEMBREE_PRINT_CONFIGURATION, 0, - "Should HdEmbree print configuration on startup? (values > 0 are true)"); +TF_DEFINE_ENV_SETTING(HDEMBREE_PRINT_CONFIGURATION, + false, + "Should HdEmbree print configuration on startup?"); HdEmbreeConfig::HdEmbreeConfig() { @@ -50,12 +64,12 @@ HdEmbreeConfig::HdEmbreeConfig() TfGetEnvSetting(HDEMBREE_TILE_SIZE)); ambientOcclusionSamples = std::max(0, TfGetEnvSetting(HDEMBREE_AMBIENT_OCCLUSION_SAMPLES)); - jitterCamera = (TfGetEnvSetting(HDEMBREE_JITTER_CAMERA) > 0); - useFaceColors = (TfGetEnvSetting(HDEMBREE_USE_FACE_COLORS) > 0); + jitterCamera = (TfGetEnvSetting(HDEMBREE_JITTER_CAMERA)); + useFaceColors = (TfGetEnvSetting(HDEMBREE_USE_FACE_COLORS)); cameraLightIntensity = (std::max(100, TfGetEnvSetting(HDEMBREE_CAMERA_LIGHT_INTENSITY)) / 100.0f); - if (TfGetEnvSetting(HDEMBREE_PRINT_CONFIGURATION) > 0) { + if (TfGetEnvSetting(HDEMBREE_PRINT_CONFIGURATION)) { std::cout << "HdEmbree Configuration: \n" << " samplesToConvergence = " diff --git a/pxr/imaging/plugin/hdEmbree/config.h b/pxr/imaging/plugin/hdEmbree/config.h index 708c2cd43a..593ebb794d 100644 --- a/pxr/imaging/plugin/hdEmbree/config.h +++ b/pxr/imaging/plugin/hdEmbree/config.h @@ -12,6 +12,15 @@ PXR_NAMESPACE_OPEN_SCOPE +// NOTE: types here restricted to bool/int/string, as also used for +// TF_DEFINE_ENV_SETTING +constexpr int HdEmbreeDefaultSamplesToConvergence = 100; +constexpr int HdEmbreeDefaultTileSize = 8; +constexpr int HdEmbreeDefaultAmbientOcclusionSamples = 16; +constexpr bool HdEmbreeDefaultJitterCamera = true; +constexpr bool HdEmbreeDefaultUseFaceColors = true; +constexpr int HdEmbreeDefaultCameraLightIntensity = 300; + /// \class HdEmbreeConfig /// /// This class is a singleton, holding configuration parameters for HdEmbree. @@ -27,6 +36,7 @@ PXR_NAMESPACE_OPEN_SCOPE /// class HdEmbreeConfig { public: + /// \brief Return the configuration singleton. static const HdEmbreeConfig &GetInstance(); @@ -34,38 +44,40 @@ class HdEmbreeConfig { /// converged? /// /// Override with *HDEMBREE_SAMPLES_TO_CONVERGENCE*. - unsigned int samplesToConvergence; + unsigned int samplesToConvergence = HdEmbreeDefaultSamplesToConvergence; /// How many pixels are in an atomic unit of parallel work? /// A work item is a square of size [tileSize x tileSize] pixels. /// /// Override with *HDEMBREE_TILE_SIZE*. - unsigned int tileSize; + unsigned int tileSize = HdEmbreeDefaultTileSize; /// How many ambient occlusion rays should we generate per /// camera ray? /// /// Override with *HDEMBREE_AMBIENT_OCCLUSION_SAMPLES*. - unsigned int ambientOcclusionSamples; + unsigned int ambientOcclusionSamples = HdEmbreeDefaultAmbientOcclusionSamples; /// Should the renderpass jitter camera rays for antialiasing? /// - /// Override with *HDEMBREE_JITTER_CAMERA*. Integer values greater than - /// zero are considered "true". - bool jitterCamera; + /// Override with *HDEMBREE_JITTER_CAMERA*. The case-insensitive strings + /// "true", "yes", "on", and "1" are considered true; an empty value uses + /// the default, and all other values are false. + bool jitterCamera = HdEmbreeDefaultJitterCamera; /// Should the renderpass use the color primvar, or flat white colors? /// (Flat white shows off ambient occlusion better). /// - /// Override with *HDEMBREE_USE_FACE_COLORS*. Integer values greater than - /// zero are considered "true". - bool useFaceColors; + /// Override with *HDEMBREE_USE_FACE_COLORS*. The case-insensitive strings + /// "true", "yes", "on", and "1" are considered true; an empty value uses + /// the default, and all other values are false. + bool useFaceColors = HdEmbreeDefaultUseFaceColors; /// What should the intensity of the camera light be, specified as a /// percent of <1, 1, 1>. For example, 300 would be <3, 3, 3>. /// /// Override with *HDEMBREE_CAMERA_LIGHT_INTENSITY*. - float cameraLightIntensity; + float cameraLightIntensity = HdEmbreeDefaultCameraLightIntensity; private: // The constructor initializes the config variables with their From f53d3e6dec0e6cfee14aa29835cf2889a63780ca Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Tue, 2 Jul 2024 12:20:26 -0700 Subject: [PATCH 015/202] [hdEmbree] add HDEMBREE_RANDOM_NUMBER_SEED --- pxr/imaging/plugin/hdEmbree/config.cpp | 12 +++++++++++ pxr/imaging/plugin/hdEmbree/config.h | 10 ++++++++++ .../plugin/hdEmbree/renderDelegate.cpp | 5 ++++- pxr/imaging/plugin/hdEmbree/renderDelegate.h | 3 ++- pxr/imaging/plugin/hdEmbree/renderPass.cpp | 4 ++++ pxr/imaging/plugin/hdEmbree/renderer.cpp | 20 +++++++++++++++---- pxr/imaging/plugin/hdEmbree/renderer.h | 10 +++++++++- 7 files changed, 57 insertions(+), 7 deletions(-) diff --git a/pxr/imaging/plugin/hdEmbree/config.cpp b/pxr/imaging/plugin/hdEmbree/config.cpp index 65768582cb..f0d2d4d6e8 100644 --- a/pxr/imaging/plugin/hdEmbree/config.cpp +++ b/pxr/imaging/plugin/hdEmbree/config.cpp @@ -51,6 +51,15 @@ TF_DEFINE_ENV_SETTING( HdEmbreeDefaultCameraLightIntensity, "Intensity of the camera light, specified as a percentage of <1,1,1>."); +TF_DEFINE_ENV_SETTING( + HDEMBREE_RANDOM_NUMBER_SEED, + HdEmbreeDefaultRandomNumberSeed, + "Seed to give to the random number generator. A value of anything other" + " than -1, combined with setting PXR_WORK_THREAD_LIMIT=1, should" + " give deterministic / repeatable results. A value of -1 (the" + " default) will allow the implementation to set a value that varies" + " from invocation to invocation and thread to thread."); + TF_DEFINE_ENV_SETTING(HDEMBREE_PRINT_CONFIGURATION, false, "Should HdEmbree print configuration on startup?"); @@ -68,6 +77,7 @@ HdEmbreeConfig::HdEmbreeConfig() useFaceColors = (TfGetEnvSetting(HDEMBREE_USE_FACE_COLORS)); cameraLightIntensity = (std::max(100, TfGetEnvSetting(HDEMBREE_CAMERA_LIGHT_INTENSITY)) / 100.0f); + randomNumberSeed = TfGetEnvSetting(HDEMBREE_RANDOM_NUMBER_SEED); if (TfGetEnvSetting(HDEMBREE_PRINT_CONFIGURATION)) { std::cout @@ -84,6 +94,8 @@ HdEmbreeConfig::HdEmbreeConfig() << useFaceColors << "\n" << " cameraLightIntensity = " << cameraLightIntensity << "\n" + << " randomNumberSeed = " + << randomNumberSeed << "\n" ; } } diff --git a/pxr/imaging/plugin/hdEmbree/config.h b/pxr/imaging/plugin/hdEmbree/config.h index 593ebb794d..2632cbb35f 100644 --- a/pxr/imaging/plugin/hdEmbree/config.h +++ b/pxr/imaging/plugin/hdEmbree/config.h @@ -20,6 +20,7 @@ constexpr int HdEmbreeDefaultAmbientOcclusionSamples = 16; constexpr bool HdEmbreeDefaultJitterCamera = true; constexpr bool HdEmbreeDefaultUseFaceColors = true; constexpr int HdEmbreeDefaultCameraLightIntensity = 300; +constexpr int HdEmbreeDefaultRandomNumberSeed = -1; /// \class HdEmbreeConfig /// @@ -79,6 +80,15 @@ class HdEmbreeConfig { /// Override with *HDEMBREE_CAMERA_LIGHT_INTENSITY*. float cameraLightIntensity = HdEmbreeDefaultCameraLightIntensity; + /// Seed to give to the random number generator. A value of anything other + /// than -1, combined with setting PXR_WORK_THREAD_LIMIT=1, should give + /// deterministic / repeatable results. A value of -1 (the default) will + /// allow the implementation to set a value that varies from invocation to + /// invocation and thread to thread. + /// + /// Override with *HDEMBREE_RANDOM_NUMBER_SEED*. + int randomNumberSeed = HdEmbreeDefaultRandomNumberSeed; + private: // The constructor initializes the config variables with their // default or environment-provided override, and optionally prints diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.cpp b/pxr/imaging/plugin/hdEmbree/renderDelegate.cpp index fb77050b40..32ef99dbbb 100644 --- a/pxr/imaging/plugin/hdEmbree/renderDelegate.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.cpp @@ -99,7 +99,7 @@ void HdEmbreeRenderDelegate::_Initialize() { // Initialize the settings and settings descriptors. - _settingDescriptors.resize(4); + _settingDescriptors.resize(5); _settingDescriptors[0] = { "Enable Scene Colors", HdEmbreeRenderSettingsTokens->enableSceneColors, VtValue(HdEmbreeConfig::GetInstance().useFaceColors) }; @@ -112,6 +112,9 @@ HdEmbreeRenderDelegate::_Initialize() _settingDescriptors[3] = { "Samples To Convergence", HdRenderSettingsTokens->convergedSamplesPerPixel, VtValue(int(HdEmbreeConfig::GetInstance().samplesToConvergence)) }; + _settingDescriptors[4] = { "Random Number Seed", + HdEmbreeRenderSettingsTokens->randomNumberSeed, + VtValue(HdEmbreeConfig::GetInstance().randomNumberSeed) }; _PopulateDefaultSettings(_settingDescriptors); // Initialize the embree library handle (_rtcDevice). diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h index d4f8f78d54..1d8694daa6 100644 --- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h +++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h @@ -23,7 +23,8 @@ class HdEmbreeRenderParam; #define HDEMBREE_RENDER_SETTINGS_TOKENS \ (enableAmbientOcclusion) \ (enableSceneColors) \ - (ambientOcclusionSamples) + (ambientOcclusionSamples) \ + (randomNumberSeed) // Also: HdRenderSettingsTokens->convergedSamplesPerPixel diff --git a/pxr/imaging/plugin/hdEmbree/renderPass.cpp b/pxr/imaging/plugin/hdEmbree/renderPass.cpp index 9583d8c757..4b28269cd5 100644 --- a/pxr/imaging/plugin/hdEmbree/renderPass.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderPass.cpp @@ -113,6 +113,10 @@ HdEmbreeRenderPass::_Execute(HdRenderPassStateSharedPtr const& renderPassState, renderDelegate->GetRenderSetting( HdEmbreeRenderSettingsTokens->enableSceneColors, true)); + _renderer->SetRandomNumberSeed( + renderDelegate->GetRenderSetting( + HdEmbreeRenderSettingsTokens->randomNumberSeed, (unsigned int)-1)); + needStartRender = true; } diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp index 13956c7b25..e216216759 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp @@ -69,6 +69,12 @@ HdEmbreeRenderer::SetEnableSceneColors(bool enableSceneColors) _enableSceneColors = enableSceneColors; } +void +HdEmbreeRenderer::SetRandomNumberSeed(int randomNumberSeed) +{ + _randomNumberSeed = randomNumberSeed; +} + void HdEmbreeRenderer::SetDataWindow(const GfRect2i &dataWindow) { @@ -432,8 +438,8 @@ HdEmbreeRenderer::Render(HdRenderThread *renderThread) // Always pass the renderThread to _RenderTiles to allow the first frame // to be interrupted. WorkParallelForN(numTilesX*numTilesY, - std::bind(&HdEmbreeRenderer::_RenderTiles, this, renderThread, - std::placeholders::_1, std::placeholders::_2)); + std::bind(&HdEmbreeRenderer::_RenderTiles, this, + renderThread, i, std::placeholders::_1, std::placeholders::_2)); // After the first pass, mark the single-sampled attachments as // converged and unmap them. If there are no multisampled attachments, @@ -472,7 +478,7 @@ HdEmbreeRenderer::Render(HdRenderThread *renderThread) } void -HdEmbreeRenderer::_RenderTiles(HdRenderThread *renderThread, +HdEmbreeRenderer::_RenderTiles(HdRenderThread *renderThread, int sampleNum, size_t tileStart, size_t tileEnd) { const unsigned int minX = _dataWindow.GetMinX(); @@ -497,8 +503,14 @@ HdEmbreeRenderer::_RenderTiles(HdRenderThread *renderThread, // Initialize the RNG for this tile (each tile creates one as // a lazy way to do thread-local RNGs). - size_t seed = std::chrono::system_clock::now().time_since_epoch().count(); + size_t seed; + if (_randomNumberSeed == -1) { + seed = std::chrono::system_clock::now().time_since_epoch().count(); + } else { + seed = static_cast(_randomNumberSeed); + } seed = TfHash::Combine(seed, tileStart); + seed = TfHash::Combine(seed, sampleNum); std::default_random_engine random(seed); // Create a uniform distribution for jitter calculations. diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h index 8e727ecba0..2da9880848 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.h +++ b/pxr/imaging/plugin/hdEmbree/renderer.h @@ -81,6 +81,12 @@ class HdEmbreeRenderer final /// everything as white. void SetEnableSceneColors(bool enableSceneColors); + /// Sets a number to seed the random number generator with. + /// \param randomNumberSeed If -1, then the random number generator + /// is seeded in a non-deterministic way; + /// otherwise, it is seeded with this value. + void SetRandomNumberSeed(int randomNumberSeed); + /// Rendering entrypoint: add one sample per pixel to the whole sample /// buffer, and then loop until the image is converged. After each pass, /// the image will be resolved into a color buffer. @@ -115,7 +121,7 @@ class HdEmbreeRenderer final // work. For each tile, iterate over pixels in the tile, generating camera // rays, and following them/calculating color with _TraceRay. This function // renders all tiles between tileStart and tileEnd. - void _RenderTiles(HdRenderThread *renderThread, + void _RenderTiles(HdRenderThread *renderThread, int sampleNum, size_t tileStart, size_t tileEnd); // Cast a ray into the scene and if it hits an object, write to the bound @@ -184,6 +190,8 @@ class HdEmbreeRenderer final int _ambientOcclusionSamples; // Should we enable scene colors? bool _enableSceneColors; + // If other than -1, use this to seed the random number generator with. + int _randomNumberSeed; // How many samples have been completed. std::atomic _completedSamples; From a3389b0373e346bad647ecbaecf27491b24c5f12 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 2 Aug 2024 21:11:15 -0400 Subject: [PATCH 016/202] usd: Initial files to create usdz validation - added template code for usdz validation - referenced existing code in usdUtils to do the work of checking if all files are encapsulated NOTE: this branch fails to link currently --- pxr/usd/usd/CMakeLists.txt | 18 ++++ pxr/usd/usd/plugInfo.json | 8 +- pxr/usd/usd/testenv/testUsdUsdzValidators.cpp | 69 +++++++++++++ pxr/usd/usd/usdzValidators.cpp | 96 +++++++++++++++++++ pxr/usd/usd/validatorTokens.h | 7 +- 5 files changed, 193 insertions(+), 5 deletions(-) create mode 100644 pxr/usd/usd/testenv/testUsdUsdzValidators.cpp create mode 100644 pxr/usd/usd/usdzValidators.cpp diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index 055c0f31fb..085d031601 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -110,6 +110,7 @@ pxr_library(usd CPPFILES coreValidators.cpp + usdzValidators.cpp PYTHON_CPPFILES moduleDeps.cpp @@ -495,6 +496,18 @@ pxr_build_test(testUsdZipFile_CPP testenv/testUsdZipFile.cpp ) +pxr_build_test(testUsdUsdzValidators + LIBRARIES + ar + arch + tf + sdf + usd + usdUtils + CPPFILES + testenv/testUsdUsdzValidators.cpp +) + pxr_install_test_dir( SRC testenv/testUsdAppliedAPISchemas DEST testUsdAppliedAPISchemas @@ -1320,3 +1333,8 @@ pxr_register_test(testUsdOpaqueAttributes COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdOpaqueAttributes" EXPECTED_RETURN_CODE 0 ) + +pxr_register_test(testUsdUsdzValidators + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUsdzValidators" + EXPECTED_RETURN_CODE 0 +) diff --git a/pxr/usd/usd/plugInfo.json b/pxr/usd/usd/plugInfo.json index 016a8898c3..eef719c085 100644 --- a/pxr/usd/usd/plugInfo.json +++ b/pxr/usd/usd/plugInfo.json @@ -148,9 +148,13 @@ "Validators": { "CompositionErrorTest": { "doc": "Validator aims at providing all composition errors, which were generated while composing the stage." - }, + }, + "UsdzPackageEncapsulationValidator": { + "doc": "If the root layer is a package, then the composed stage must not contain references to files outside the package. The package must be self-contained." + }, "keywords": [ - "UsdCoreValidators" + "UsdCoreValidators", + "UsdUsdzValidators" ] } }, diff --git a/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp b/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp new file mode 100644 index 0000000000..787b735168 --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp @@ -0,0 +1,69 @@ +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validatorTokens.h" +#include "pxr/usd/usd/validationRegistry.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +static +void +TestUsdUsdzValidators() +{ + // This should be updated with every new validator added with + // UsdUsdzValidators keyword. + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + UsdValidatorMetadataVector metadata = + registry.GetValidatorMetadataForKeyword( + UsdValidatorKeywordTokens->UsdUsdzValidators); + // Since other validators can be registered with a UsdUsdzValidators + // keyword, our validators registered in usd are a subset of the entire + // set. + std::set validatorMetadataNameSet; + for (const UsdValidatorMetadata &metadata : metadata) { + validatorMetadataNameSet.insert(metadata.name); + } + + const std::set expectedValidatorNames = + {UsdValidatorNameTokens->usdzPackageEncapsulationValidator}; + + TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), + validatorMetadataNameSet.end(), + expectedValidatorNames.begin(), + expectedValidatorNames.end())); +} + +static +void +TestPackageEncapsulationValidator() +{ + // Get validator + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + + // Verify validator + const UsdValidator *validator = registry.GetOrLoadValidatorByName( + UsdValidatorNameTokens->usdzPackageEncapsulationValidator); + + TF_AXIOM(validator); + + // load invalid root layer usdz + SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(); + + // validate and verify errors + auto errors = validator->Validate(layer); + + // remove invalid reference? change reference to be valid? load different valid reference? + + // validate errors are gone + TF_AXIOM(errors.size() == 0); +} + +int +main() +{ + TestUsdUsdzValidators(); + TestPackageEncapsulationValidator(); + + std::cout << "OK\n"; +} \ No newline at end of file diff --git a/pxr/usd/usd/usdzValidators.cpp b/pxr/usd/usd/usdzValidators.cpp new file mode 100644 index 0000000000..bf07f802a0 --- /dev/null +++ b/pxr/usd/usd/usdzValidators.cpp @@ -0,0 +1,96 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usd/validatorTokens.h" +#include "pxr/usd/ar/packageUtils.h" +#include "pxr/usd/usdUtils/dependencies.h" +#include "pxr/usd/usdUtils/userProcessingFunc.h" + +PXR_NAMESPACE_OPEN_SCOPE + +static +UsdValidationErrorVector +_PackageEncapsulationValidator(const SdfLayerHandle& layer) { + UsdValidationErrorVector errors; + + const bool isPackage = [](const SdfLayerHandle& layer){ + return layer->GetFileFormat()->IsPackage() || ArIsPackageRelativePath(layer->GetIdentifier()); + }(layer); + + if (!isPackage){ + return errors; + } + + std::vector> layers; + std::vector> assets, unresolvedPaths; + const SdfAssetPath &path = SdfAssetPath(layer->GetIdentifier()); + + + + std::function processingFunc = [](const pxr::TfWeakPtr& layer, const pxr::UsdUtilsDependencyInfo& info) { + // Define your processing function here + return pxr::UsdUtilsDependencyInfo(); + }; + + UsdUtilsComputeAllDependencies(path, &layers, &assets, + &unresolvedPaths, processingFunc); + + auto realPath = layer->GetRealPath(); + const std::string packagePath = ArIsPackageRelativePath(layer->GetIdentifier()) ? + ArSplitPackageRelativePathOuter(realPath).first : + realPath; + + if (packagePath.length() > 0){ + for(const SdfLayerRefPtr& subLayer : layers){ + const auto realPath = subLayer->GetRealPath(); + if (!TfStringStartsWith(realPath, packagePath)){ + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(layer, + subLayer->GetDefaultPrimAsPath()) + }, + TfStringPrintf(("Found loaded layer '%s' that " + "does not belong to the package '%s'."), + subLayer->GetIdentifier().c_str(), packagePath.c_str()) + ); + } + } + + for(const std::string& asset : assets){ + if (!TfStringStartsWith(asset, packagePath)){ + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(layer, + SdfPath(asset)) + }, + TfStringPrintf(("Found asset reference '%s' that " + "does not belong to the package '%s'."), + asset.c_str(), packagePath.c_str()) + ); + } + } + } + + return errors; +} + +TF_REGISTRY_FUNCTION(UsdValidationRegistry) +{ + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + registry.RegisterPluginValidator( + UsdValidatorNameTokens->usdzPackageEncapsulationValidator, _PackageEncapsulationValidator); +} + +PXR_NAMESPACE_CLOSE_SCOPE + diff --git a/pxr/usd/usd/validatorTokens.h b/pxr/usd/usd/validatorTokens.h index edd43cdca7..104515c3aa 100644 --- a/pxr/usd/usd/validatorTokens.h +++ b/pxr/usd/usd/validatorTokens.h @@ -17,11 +17,12 @@ PXR_NAMESPACE_OPEN_SCOPE #define USD_VALIDATOR_NAME_TOKENS \ - ((compositionErrorTest, "usd:CompositionErrorTest")) + ((compositionErrorTest, "usd:CompositionErrorTest")) \ + ((usdzPackageEncapsulationValidator, "usd:UsdzPackageEncapsulationValidator")) #define USD_VALIDATOR_KEYWORD_TOKENS \ - (UsdCoreValidators) - + (UsdCoreValidators) \ + (UsdUsdzValidators) /// Tokens representing validator names. Note that for plugin provided /// validators, the names must be prefixed by usd:, which is the name of /// the usd plugin. From 88e95203fe67a2fa33e89746a119f558f179a4c5 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 2 Aug 2024 21:30:54 -0400 Subject: [PATCH 017/202] remove versions in types --- pxr/usd/usd/usdzValidators.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pxr/usd/usd/usdzValidators.cpp b/pxr/usd/usd/usdzValidators.cpp index bf07f802a0..d2af2408ae 100644 --- a/pxr/usd/usd/usdzValidators.cpp +++ b/pxr/usd/usd/usdzValidators.cpp @@ -34,9 +34,9 @@ _PackageEncapsulationValidator(const SdfLayerHandle& layer) { - std::function processingFunc = [](const pxr::TfWeakPtr& layer, const pxr::UsdUtilsDependencyInfo& info) { + std::function processingFunc = [](const pxr::TfWeakPtr& layer, const pxr::UsdUtilsDependencyInfo& info) { // Define your processing function here return pxr::UsdUtilsDependencyInfo(); }; From 1c2a80da108e5d2cbfedbf27f9148e93e1a92301 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 4 Aug 2024 20:05:38 -0400 Subject: [PATCH 018/202] feat: move usdzValidator to usdUtils - moved all files from usd -> usdUtils - added initial test for packageEncapsulation --- pxr/usd/usd/CMakeLists.txt | 18 ---- pxr/usd/usd/plugInfo.json | 6 +- pxr/usd/usd/testenv/testUsdUsdzValidators.cpp | 69 ------------- pxr/usd/usd/usdzValidators.cpp | 96 ------------------ pxr/usd/usdUtils/CMakeLists.txt | 29 ++++++ pxr/usd/usdUtils/plugInfo.json | 22 ++++ .../0/image.jpg | Bin 0 -> 4233 bytes .../0/layer.usda | 6 ++ .../badRoot.usda | 18 ++++ .../fail.usdz | Bin 0 -> 5075 bytes .../goodRoot.usda | 18 ++++ .../pass.usdz | Bin 0 -> 4983 bytes .../testenv/testUsdUtilsValidators.cpp | 94 +++++++++++++++++ pxr/usd/usdUtils/validatorTokens.cpp | 15 +++ pxr/usd/usdUtils/validatorTokens.h | 42 ++++++++ pxr/usd/usdUtils/validators.cpp | 88 ++++++++++++++++ 16 files changed, 333 insertions(+), 188 deletions(-) delete mode 100644 pxr/usd/usd/testenv/testUsdUsdzValidators.cpp delete mode 100644 pxr/usd/usd/usdzValidators.cpp create mode 100644 pxr/usd/usdUtils/plugInfo.json create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/image.jpg create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/layer.usda create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp create mode 100644 pxr/usd/usdUtils/validatorTokens.cpp create mode 100644 pxr/usd/usdUtils/validatorTokens.h create mode 100644 pxr/usd/usdUtils/validators.cpp diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index 085d031601..055c0f31fb 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -110,7 +110,6 @@ pxr_library(usd CPPFILES coreValidators.cpp - usdzValidators.cpp PYTHON_CPPFILES moduleDeps.cpp @@ -496,18 +495,6 @@ pxr_build_test(testUsdZipFile_CPP testenv/testUsdZipFile.cpp ) -pxr_build_test(testUsdUsdzValidators - LIBRARIES - ar - arch - tf - sdf - usd - usdUtils - CPPFILES - testenv/testUsdUsdzValidators.cpp -) - pxr_install_test_dir( SRC testenv/testUsdAppliedAPISchemas DEST testUsdAppliedAPISchemas @@ -1333,8 +1320,3 @@ pxr_register_test(testUsdOpaqueAttributes COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdOpaqueAttributes" EXPECTED_RETURN_CODE 0 ) - -pxr_register_test(testUsdUsdzValidators - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUsdzValidators" - EXPECTED_RETURN_CODE 0 -) diff --git a/pxr/usd/usd/plugInfo.json b/pxr/usd/usd/plugInfo.json index eef719c085..6361699429 100644 --- a/pxr/usd/usd/plugInfo.json +++ b/pxr/usd/usd/plugInfo.json @@ -149,12 +149,8 @@ "CompositionErrorTest": { "doc": "Validator aims at providing all composition errors, which were generated while composing the stage." }, - "UsdzPackageEncapsulationValidator": { - "doc": "If the root layer is a package, then the composed stage must not contain references to files outside the package. The package must be self-contained." - }, "keywords": [ - "UsdCoreValidators", - "UsdUsdzValidators" + "UsdCoreValidators" ] } }, diff --git a/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp b/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp deleted file mode 100644 index 787b735168..0000000000 --- a/pxr/usd/usd/testenv/testUsdUsdzValidators.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "pxr/usd/usd/validator.h" -#include "pxr/usd/usd/validationError.h" -#include "pxr/usd/usd/validatorTokens.h" -#include "pxr/usd/usd/validationRegistry.h" - -#include - -PXR_NAMESPACE_USING_DIRECTIVE - -static -void -TestUsdUsdzValidators() -{ - // This should be updated with every new validator added with - // UsdUsdzValidators keyword. - UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); - UsdValidatorMetadataVector metadata = - registry.GetValidatorMetadataForKeyword( - UsdValidatorKeywordTokens->UsdUsdzValidators); - // Since other validators can be registered with a UsdUsdzValidators - // keyword, our validators registered in usd are a subset of the entire - // set. - std::set validatorMetadataNameSet; - for (const UsdValidatorMetadata &metadata : metadata) { - validatorMetadataNameSet.insert(metadata.name); - } - - const std::set expectedValidatorNames = - {UsdValidatorNameTokens->usdzPackageEncapsulationValidator}; - - TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), - validatorMetadataNameSet.end(), - expectedValidatorNames.begin(), - expectedValidatorNames.end())); -} - -static -void -TestPackageEncapsulationValidator() -{ - // Get validator - UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); - - // Verify validator - const UsdValidator *validator = registry.GetOrLoadValidatorByName( - UsdValidatorNameTokens->usdzPackageEncapsulationValidator); - - TF_AXIOM(validator); - - // load invalid root layer usdz - SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(); - - // validate and verify errors - auto errors = validator->Validate(layer); - - // remove invalid reference? change reference to be valid? load different valid reference? - - // validate errors are gone - TF_AXIOM(errors.size() == 0); -} - -int -main() -{ - TestUsdUsdzValidators(); - TestPackageEncapsulationValidator(); - - std::cout << "OK\n"; -} \ No newline at end of file diff --git a/pxr/usd/usd/usdzValidators.cpp b/pxr/usd/usd/usdzValidators.cpp deleted file mode 100644 index d2af2408ae..0000000000 --- a/pxr/usd/usd/usdzValidators.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// -// Copyright 2024 Pixar -// -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// - -#include -#include "pxr/usd/usd/validationError.h" -#include "pxr/usd/usd/validationRegistry.h" -#include "pxr/usd/usd/validatorTokens.h" -#include "pxr/usd/ar/packageUtils.h" -#include "pxr/usd/usdUtils/dependencies.h" -#include "pxr/usd/usdUtils/userProcessingFunc.h" - -PXR_NAMESPACE_OPEN_SCOPE - -static -UsdValidationErrorVector -_PackageEncapsulationValidator(const SdfLayerHandle& layer) { - UsdValidationErrorVector errors; - - const bool isPackage = [](const SdfLayerHandle& layer){ - return layer->GetFileFormat()->IsPackage() || ArIsPackageRelativePath(layer->GetIdentifier()); - }(layer); - - if (!isPackage){ - return errors; - } - - std::vector> layers; - std::vector> assets, unresolvedPaths; - const SdfAssetPath &path = SdfAssetPath(layer->GetIdentifier()); - - - - std::function processingFunc = [](const pxr::TfWeakPtr& layer, const pxr::UsdUtilsDependencyInfo& info) { - // Define your processing function here - return pxr::UsdUtilsDependencyInfo(); - }; - - UsdUtilsComputeAllDependencies(path, &layers, &assets, - &unresolvedPaths, processingFunc); - - auto realPath = layer->GetRealPath(); - const std::string packagePath = ArIsPackageRelativePath(layer->GetIdentifier()) ? - ArSplitPackageRelativePathOuter(realPath).first : - realPath; - - if (packagePath.length() > 0){ - for(const SdfLayerRefPtr& subLayer : layers){ - const auto realPath = subLayer->GetRealPath(); - if (!TfStringStartsWith(realPath, packagePath)){ - errors.emplace_back( - UsdValidationErrorType::Error, - UsdValidationErrorSites{ - UsdValidationErrorSite(layer, - subLayer->GetDefaultPrimAsPath()) - }, - TfStringPrintf(("Found loaded layer '%s' that " - "does not belong to the package '%s'."), - subLayer->GetIdentifier().c_str(), packagePath.c_str()) - ); - } - } - - for(const std::string& asset : assets){ - if (!TfStringStartsWith(asset, packagePath)){ - errors.emplace_back( - UsdValidationErrorType::Error, - UsdValidationErrorSites{ - UsdValidationErrorSite(layer, - SdfPath(asset)) - }, - TfStringPrintf(("Found asset reference '%s' that " - "does not belong to the package '%s'."), - asset.c_str(), packagePath.c_str()) - ); - } - } - } - - return errors; -} - -TF_REGISTRY_FUNCTION(UsdValidationRegistry) -{ - UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); - registry.RegisterPluginValidator( - UsdValidatorNameTokens->usdzPackageEncapsulationValidator, _PackageEncapsulationValidator); -} - -PXR_NAMESPACE_CLOSE_SCOPE - diff --git a/pxr/usd/usdUtils/CMakeLists.txt b/pxr/usd/usdUtils/CMakeLists.txt index 65c96bd366..1f1e797d35 100644 --- a/pxr/usd/usdUtils/CMakeLists.txt +++ b/pxr/usd/usdUtils/CMakeLists.txt @@ -34,6 +34,7 @@ pxr_library(usdUtils stitch stitchClips timeCodeRange + validatorTokens usdzPackage PRIVATE_CLASSES @@ -45,6 +46,9 @@ pxr_library(usdUtils api.h userProcessingFunc.h + CPPFILES + validators.cpp + PYTHON_CPPFILES moduleDeps.cpp @@ -75,6 +79,9 @@ pxr_library(usdUtils updateSchemaWithSdrNode.py usdzUtils.py + RESOURCE_FILES + plugInfo.json + DOXYGEN_FILES overview.dox ) @@ -144,6 +151,18 @@ pxr_build_test(testUsdUtilsTimeCodeRangeCpp testenv/testUsdUtilsTimeCodeRange.cpp ) +pxr_build_test(testUsdUtilsValidators + LIBRARIES + ar + arch + tf + sdf + usd + usdUtils + CPPFILES + testenv/testUsdUtilsValidators.cpp +) + pxr_install_test_dir( SRC testenv/testUsdUtilsAuthoring DEST testUsdUtilsAuthoring @@ -290,6 +309,11 @@ pxr_install_test_dir( DEST testUsdUtilsUserProcessingFunc ) +pxr_install_test_dir( + SRC testenv/testUsdUtilsPackageEncapsulation + DEST testUsdUtilsPackageEncapsulation +) + pxr_register_test(testUsdUtilsAuthoring PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUtilsAuthoring" @@ -687,3 +711,8 @@ pxr_register_test(testUsdUtilsUsdzUtils COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUtilsUsdzUtils" EXPECTED_RETURN_CODE 0 ) + +pxr_register_test(testUsdUtilsValidators + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdUtilsValidators" + EXPECTED_RETURN_CODE 0 +) diff --git a/pxr/usd/usdUtils/plugInfo.json b/pxr/usd/usdUtils/plugInfo.json new file mode 100644 index 0000000000..de2078c7ea --- /dev/null +++ b/pxr/usd/usdUtils/plugInfo.json @@ -0,0 +1,22 @@ +{ + "Plugins": [ + { + "Info": { + "Validators": { + "PackageEncapsulationValidator": { + "doc": "If the root layer is a package, then the composed stage must not contain references to files outside the package. The package must be self-contained." + }, + "keywords": [ + "UsdUtilsValidators", + "UsdzValidators" + ] + } + }, + "LibraryPath": "@PLUG_INFO_LIBRARY_PATH@", + "Name": "usdUtils", + "ResourcePath": "@PLUG_INFO_RESOURCE_PATH@", + "Root": "@PLUG_INFO_ROOT@", + "Type": "library" + } + ] +} diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/image.jpg b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/image.jpg new file mode 100644 index 0000000000000000000000000000000000000000..995743ce148a12bc316d1d0920cda63cf347a6fc GIT binary patch literal 4233 zcmb_fcU)7++MZKVNq{7PfRxY?1nC5j5<&}zbP#(;0)!G`0*Kg^MFm$B6%nlHs;Fy0 zrL7eUwpFoVU(iKCSr-d-&7A~^_uIejcYpUy=Dg2&&O7hSGdYvrJIXuCE}$D3#t#Ds z0>Dc60m^Pr8CoPs2Ov5cH~;|107r}g0U{Uz0+5j!9ER8fOwFSJERg{Gd(3#~RR*)E z`wV%kvJ{XY!-TD93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Encapsulation/0/layer.usda new file mode 100644 index 0000000000..2f94b858cf --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/layer.usda @@ -0,0 +1,6 @@ +#usda 1.0 + +def "Layer" ( +) +{ +} \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda new file mode 100644 index 0000000000..770cf276c7 --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda @@ -0,0 +1,18 @@ +#usda 1.0 +( + metersPerUnit = 1 + upAxis = "Y" + defaultPrim = "Root" +) + +def Xform "Root" ( + kind = "group" + references = @/Users/andrewbeers/libs/usd-2408-dev/tests/ctest/testUsdUtilsPackageEncapsulation/0/layer.usda@ +) +{ + def Cube "MyCube" + { + } + + asset file = @/Users/andrewbeers/libs/usd-2408-dev/tests/ctest/testUsdUtilsPackageEncapsulation/0/image.jpg@ +} \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz new file mode 100644 index 0000000000000000000000000000000000000000..e86c598d37dec61cece36acb8b08ad055fdd91de GIT binary patch literal 5075 zcmcIo2UJs8w?4O|CqQTdf`s0rw}65`XaSMX!5)$Tfe>N}Aoen-=vYt@#fpxKI(88m zEA}!f_CBD4iaHJ!>`vafL4yCRf7bioTkq}U-t*mk_xaA==iYPIK3kB8;dDSq&0;*~ z5?^988v%egn7|z53dN}&bz*#qss>p}W#KP>LmLiBctyC^O_z zH7AVYtJ7)}k>yeqytL1;*D1u3JfTLW7AU2~gq9e@p6*7cLp>)uuS8k=O~>hBEt1N` zgk8R}M5E|oP)hP7N{L(~A!sAKGgNR`Z=qbQl$7O42rQH4s=T3ho_+y7Tu-s2)LSi4 zsa4)0qS4_Dl{iB!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E8?spF?3PaioGcIM#O(6a~5anJ2PA9TL)Lg0mc zzXtxg?_$u!#!JDMnl6W2Zf+gidictaE61)zUp;k=f9?GBVb@!4WZbxQbL7poTjEI`R^WCZUNcXDl8{MyYVEv%}H@Dw*v<0;tYL9Ne@G$M+-AAHF&wp3_{-tB) zW7gxEC$>)-p87pK*csb-`PqnP9nTfdKfkE_gZ;Hvz!P0l?%k%pXSdn4q-SpcG4kyo)PKW0xj1nH<`7`JDF7)i zV0Lp8fSnrvaEAPbBLNVw07wr3sK3Ad&~<@(7hV1ifKaHANd-c2`-0sQzTNtlrYEJ&HBoeVnK_-Gt-Fx=#Yuw*-ptQ*{j!Y-gdux|KZ~&A}$1AJz?o1`&(RW7#E7;7)~MLLeMgJU~HUZ z=Swz@OrZ$Jnb`YHqnbu7TDR*M&A~sl%Pd#fN;h{5Xm@%=grP%d z54ZTJ_6}fT2z;3^HW&iFeyOi=1@OSMxBChhDX@S+`OzW=?g@x}0W3tZU;(4A8dGUW z>wWRyCRty9($$Xab#)qhST-UmHLxmzz`Ddg*SGq32=w1qyT0f9cXgINzB6!f{Bzai id!Bz6ZXeGaV}j=&f)^x`$b>0O+X39!fCtbRfd2xuf50dJ literal 0 HcmV?d00001 diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda new file mode 100644 index 0000000000..68e8185703 --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda @@ -0,0 +1,18 @@ +#usda 1.0 +( + metersPerUnit = 1 + upAxis = "Y" + defaultPrim = "Root" +) + +def Xform "Root" ( + kind = "group" + references = @0/layer.usda@ +) +{ + def Cube "MyCube" + { + } + + asset file = @0/image.jpg@ +} \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncap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/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp new file mode 100644 index 0000000000..5df6994aea --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -0,0 +1,94 @@ +#include "pxr/usd/usd/validator.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usdUtils/validatorTokens.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/base/arch/systemInfo.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +static +void +TestUsdUsdzValidators() +{ + // This should be updated with every new validator added with + // UsdUsdzValidators keyword. + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + UsdValidatorMetadataVector metadata = + registry.GetValidatorMetadataForKeyword( + UsdUtilsValidatorKeywordTokens->UsdUtilsValidators); + // Since other validators can be registered with a UsdUsdzValidators + // keyword, our validators registered in usd are a subset of the entire + // set. + std::set validatorMetadataNameSet; + for (const UsdValidatorMetadata &metadata : metadata) { + validatorMetadataNameSet.insert(metadata.name); + } + + const std::set expectedValidatorNames = + {UsdUtilsValidatorNameTokens->packageEncapsulationValidator}; + + TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), + validatorMetadataNameSet.end(), + expectedValidatorNames.begin(), + expectedValidatorNames.end())); +} + +static +void +TestPackageEncapsulationValidator() +{ + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + + // Verify the validator exists + const UsdValidator *validator = registry.GetOrLoadValidatorByName( + UsdUtilsValidatorNameTokens->packageEncapsulationValidator); + + TF_AXIOM(validator); + + const std::string testAssetDirectory = ArchGetCwd() + "/ctest/testUsdUtilsPackageEncapsulation/"; + + // Load the pre-created usdz stage with fully qualified paths to both a reference and an asset + const UsdStageRefPtr& stage = UsdStage::Open(testAssetDirectory + "fail.usdz"); + + UsdValidationErrorVector errors = validator->Validate(stage); + + // Verify both the layer & asset errors are present + TF_AXIOM(errors.size() == 2); + const std::string& errorLayer = (testAssetDirectory + "0/layer.usda"); + const std::string& rootLayer = testAssetDirectory + "fail.usdz"; + const std::string& errorAsset = testAssetDirectory + "0/image.jpg"; + + std::vector expectedErrorMessages = { + TfStringPrintf(("Found loaded layer '%s' that does not belong to the package '%s'."), + errorLayer.c_str(), rootLayer.c_str()), + TfStringPrintf(("Found asset reference '%s' that does not belong to the package '%s'."), + errorAsset.c_str(), rootLayer.c_str()) + }; + + for(size_t i = 0; i < errors.size(); ++i) + { + TF_AXIOM(errors[i].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[i].GetSites().size() == 1); + TF_AXIOM(!errors[i].GetSites()[0].GetLayer().IsInvalid()); + TF_AXIOM(errors[i].GetMessage() == expectedErrorMessages[i]); + } + + // Load the pre-created usdz stage with relative paths to both a reference and an asset. + const UsdStageRefPtr &passStage = UsdStage::Open(testAssetDirectory + "pass.usdz"); + + errors = validator->Validate(passStage); + + // Verify the errors are gone + TF_AXIOM(errors.size() == 0); +} + +int +main() +{ + TestUsdUsdzValidators(); + TestPackageEncapsulationValidator(); + + std::cout << "OK\n"; +} \ No newline at end of file diff --git a/pxr/usd/usdUtils/validatorTokens.cpp b/pxr/usd/usdUtils/validatorTokens.cpp new file mode 100644 index 0000000000..5521fccba7 --- /dev/null +++ b/pxr/usd/usdUtils/validatorTokens.cpp @@ -0,0 +1,15 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/usd/usdUtils/validatorTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + + TF_DEFINE_PUBLIC_TOKENS(UsdUtilsValidatorNameTokens, USDUTILS_VALIDATOR_NAMES_TOKENS); + TF_DEFINE_PUBLIC_TOKENS(UsdUtilsValidatorKeywordTokens, USDUTILS_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/usdUtils/validatorTokens.h b/pxr/usd/usdUtils/validatorTokens.h new file mode 100644 index 0000000000..39c2c7e5b0 --- /dev/null +++ b/pxr/usd/usdUtils/validatorTokens.h @@ -0,0 +1,42 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef USDGEOM_VALIDATOR_TOKENS_H +#define USDGEOM_VALIDATOR_TOKENS_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/usd/usdUtils/api.h" +#include "pxr/base/tf/staticTokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +#define USD_UTILS_VALIDATOR_NAME_TOKENS \ + ((packageEncapsulationValidator, "usdUtils:PackageEncapsulationValidator")) + +#define USD_UTILS_VALIDATOR_KEYWORD_TOKENS \ + (UsdUtilsValidators) \ + (UsdzValidators) +///\def +/// Tokens representing validator names. Note that for plugin provided +/// validators, the names must be prefixed by usdGeom:, which is the name of +/// the usdGeom plugin. + TF_DECLARE_PUBLIC_TOKENS(UsdUtilsValidatorNameTokens, USDUTILS_API, + USD_UTILS_VALIDATOR_NAME_TOKENS); + +///\def +/// Tokens representing keywords associated with any validator in the usdGeom +/// plugin. Clients can use this to inspect validators contained within a +/// specific keywords, or use these to be added as keywords to any new +/// validator. + TF_DECLARE_PUBLIC_TOKENS(UsdUtilsValidatorKeywordTokens, USDUTILS_API, + USD_UTILS_VALIDATOR_KEYWORD_TOKENS); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp new file mode 100644 index 0000000000..0ae96e4531 --- /dev/null +++ b/pxr/usd/usdUtils/validators.cpp @@ -0,0 +1,88 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validationRegistry.h" +#include "pxr/usd/usdUtils/validatorTokens.h" +#include "pxr/usd/ar/packageUtils.h" +#include "pxr/usd/usdUtils/dependencies.h" +#include "pxr/usd/usdUtils/userProcessingFunc.h" + +PXR_NAMESPACE_OPEN_SCOPE + + static + UsdValidationErrorVector + _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { + UsdValidationErrorVector errors; + + const SdfLayerRefPtr& rootLayer = usdStage->GetRootLayer(); + const bool isPackage = [](const SdfLayerHandle& layer){ + return layer->GetFileFormat()->IsPackage() || ArIsPackageRelativePath(layer->GetIdentifier()); + }(rootLayer); + + if (!isPackage){ + return errors; + } + + std::vector> layers; + std::vector> assets, unresolvedPaths; + const SdfAssetPath& path = SdfAssetPath(rootLayer->GetIdentifier()); + + UsdUtilsComputeAllDependencies(path, &layers, &assets, + &unresolvedPaths, nullptr); + + const std::string& realPath = rootLayer->GetRealPath(); + const std::string& packagePath = ArIsPackageRelativePath(rootLayer->GetIdentifier()) ? + ArSplitPackageRelativePathOuter(realPath).first : + realPath; + + if (packagePath.length() > 0){ + for(const SdfLayerRefPtr& subLayer : layers){ + const std::string& realPath = subLayer->GetRealPath(); + if (!TfStringStartsWith(realPath, packagePath)){ + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(rootLayer, + subLayer->GetDefaultPrimAsPath()) + }, + TfStringPrintf(("Found loaded layer '%s' that " + "does not belong to the package '%s'."), + subLayer->GetIdentifier().c_str(), packagePath.c_str()) + ); + } + } + + for(const std::string& asset : assets){ + if (!TfStringStartsWith(asset, packagePath)){ + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(rootLayer, + SdfPath(asset)) + }, + TfStringPrintf(("Found asset reference '%s' that " + "does not belong to the package '%s'."), + asset.c_str(), packagePath.c_str()) + ); + } + } + } + + return errors; + } + + TF_REGISTRY_FUNCTION(UsdValidationRegistry) + { + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + registry.RegisterPluginValidator( + UsdUtilsValidatorNameTokens->packageEncapsulationValidator, _PackageEncapsulationValidator); + } + +PXR_NAMESPACE_CLOSE_SCOPE + From 585e5ff9ca0e5acd0c92f6a94b825b9b73217b4e Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 4 Aug 2024 20:11:38 -0400 Subject: [PATCH 019/202] fix: remove usdzValidators from usd - clean up validatorTokens from usd --- pxr/usd/usd/validatorTokens.h | 7 +++---- pxr/usd/usdUtils/plugInfo.json | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pxr/usd/usd/validatorTokens.h b/pxr/usd/usd/validatorTokens.h index 104515c3aa..edd43cdca7 100644 --- a/pxr/usd/usd/validatorTokens.h +++ b/pxr/usd/usd/validatorTokens.h @@ -17,12 +17,11 @@ PXR_NAMESPACE_OPEN_SCOPE #define USD_VALIDATOR_NAME_TOKENS \ - ((compositionErrorTest, "usd:CompositionErrorTest")) \ - ((usdzPackageEncapsulationValidator, "usd:UsdzPackageEncapsulationValidator")) + ((compositionErrorTest, "usd:CompositionErrorTest")) #define USD_VALIDATOR_KEYWORD_TOKENS \ - (UsdCoreValidators) \ - (UsdUsdzValidators) + (UsdCoreValidators) + /// Tokens representing validator names. Note that for plugin provided /// validators, the names must be prefixed by usd:, which is the name of /// the usd plugin. diff --git a/pxr/usd/usdUtils/plugInfo.json b/pxr/usd/usdUtils/plugInfo.json index de2078c7ea..044fa3cf8d 100644 --- a/pxr/usd/usdUtils/plugInfo.json +++ b/pxr/usd/usdUtils/plugInfo.json @@ -7,8 +7,7 @@ "doc": "If the root layer is a package, then the composed stage must not contain references to files outside the package. The package must be self-contained." }, "keywords": [ - "UsdUtilsValidators", - "UsdzValidators" + "UsdUtilsValidators" ] } }, From 2a85844f0a282088987877460e718fdf1a4d0bdd Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 4 Aug 2024 20:24:35 -0400 Subject: [PATCH 020/202] refactor: clean up whitespace --- pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp | 2 +- pxr/usd/usdUtils/validators.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 5df6994aea..2c926ecacf 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -67,7 +67,7 @@ TestPackageEncapsulationValidator() errorAsset.c_str(), rootLayer.c_str()) }; - for(size_t i = 0; i < errors.size(); ++i) + for (size_t i = 0; i < errors.size(); ++i) { TF_AXIOM(errors[i].GetType() == UsdValidationErrorType::Error); TF_AXIOM(errors[i].GetSites().size() == 1); diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index 0ae96e4531..545644f1b4 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -41,10 +41,10 @@ PXR_NAMESPACE_OPEN_SCOPE ArSplitPackageRelativePathOuter(realPath).first : realPath; - if (packagePath.length() > 0){ - for(const SdfLayerRefPtr& subLayer : layers){ + if (packagePath.length() > 0) { + for (const SdfLayerRefPtr& subLayer : layers) { const std::string& realPath = subLayer->GetRealPath(); - if (!TfStringStartsWith(realPath, packagePath)){ + if (!TfStringStartsWith(realPath, packagePath)) { errors.emplace_back( UsdValidationErrorType::Error, UsdValidationErrorSites{ @@ -58,8 +58,8 @@ PXR_NAMESPACE_OPEN_SCOPE } } - for(const std::string& asset : assets){ - if (!TfStringStartsWith(asset, packagePath)){ + for (const std::string& asset : assets) { + if (!TfStringStartsWith(asset, packagePath)) { errors.emplace_back( UsdValidationErrorType::Error, UsdValidationErrorSites{ From 4d38bf495193dbd20e87491f1bea43698d9848c1 Mon Sep 17 00:00:00 2001 From: adamrwoodbury Date: Thu, 8 Aug 2024 16:13:45 -0700 Subject: [PATCH 021/202] Add qualifiers to doxygen \section names to address doxygen warnings. - Add qualifiers to section names that could easily become non-unique in the future. (Internal change: 2336042) --- pxr/usd/usd/attributeQuery.h | 6 +++--- pxr/usd/usd/prim.h | 2 +- pxr/usd/usd/primCompositionQuery.h | 2 +- pxr/usd/usd/resolveTarget.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pxr/usd/usd/attributeQuery.h b/pxr/usd/usd/attributeQuery.h index f784a996f6..447d76e5c9 100644 --- a/pxr/usd/usd/attributeQuery.h +++ b/pxr/usd/usd/attributeQuery.h @@ -36,7 +36,7 @@ PXR_NAMESPACE_OPEN_SCOPE /// the attribute \em is affected by Value Clips, the performance gain will /// just be less. /// -/// \section Resolve_targets Resolve targets +/// \section UsdAttributeQuery_Resolve_targets Resolve targets /// An attribute query can also be constructed for an attribute along with a /// UsdResolveTarget. A resolve target allows value resolution to consider only /// a subrange of the prim stack instead of the entirety of it. All of the methods @@ -45,11 +45,11 @@ PXR_NAMESPACE_OPEN_SCOPE /// value of an attribute resolved up to a particular layer or for determining /// if a value authored on layer would be overridden by a stronger opinion. /// -/// \section Thread_safety Thread safety +/// \section UsdAttributeQuery_Thread_safety Thread safety /// This object provides the basic thread-safety guarantee. Multiple threads /// may call the value accessor functions simultaneously. /// -/// \section Invalidation +/// \section UsdAttributeQuery_Invalidation Invalidation /// This object does not listen for change notification. If a consumer is /// holding on to a UsdAttributeQuery, it is their responsibility to dispose /// of it in response to a resync change to the associated attribute. diff --git a/pxr/usd/usd/prim.h b/pxr/usd/usd/prim.h index 69ebb130df..4b32a46381 100644 --- a/pxr/usd/usd/prim.h +++ b/pxr/usd/usd/prim.h @@ -92,7 +92,7 @@ class UsdPrimSubtreeRange; /// optionally making use of the \ref primFlags.h "prim predicates facility" /// (GetChildren(), GetAllChildren(), GetFilteredChildren()). /// -/// \section Lifetime Management +/// \section UsdPrim_Lifetime_Management Lifetime Management /// /// Clients acquire UsdPrim objects, which act like weak/guarded pointers /// to persistent objects owned and managed by their originating UsdStage. diff --git a/pxr/usd/usd/primCompositionQuery.h b/pxr/usd/usd/primCompositionQuery.h index 11764418d5..8012f9fdd7 100644 --- a/pxr/usd/usd/primCompositionQuery.h +++ b/pxr/usd/usd/primCompositionQuery.h @@ -251,7 +251,7 @@ class UsdPrimCompositionQueryArc /// It creates a list of strength ordering UsdPrimCompositionQueryArc that /// can be filtered by a combination of criteria and returned. /// -/// \section Invalidation +/// \section UsdPrimCompositionQuery_Invalidation Invalidation /// This object does not listen for change notification. If a consumer is /// holding on to a UsdPrimCompositionQuery, it is their responsibility to /// dispose of it in response to a resync change to the associated prim. diff --git a/pxr/usd/usd/resolveTarget.h b/pxr/usd/usd/resolveTarget.h index b5fa0fab01..c463f66e8a 100644 --- a/pxr/usd/usd/resolveTarget.h +++ b/pxr/usd/usd/resolveTarget.h @@ -46,7 +46,7 @@ SDF_DECLARE_HANDLES(SdfLayer); /// is created for and can only be used in a UsdAttributeQuery for attributes /// on this prim. /// -/// \section Invalidation +/// \section UsdResolveTarget_Invalidation Invalidation /// This object does not listen for change notification. If a consumer is /// holding on to a UsdResolveTarget, it is their responsibility to dispose /// of it in response to a resync change to the associated prim. From eec59eaf2d33e16b9924d19280b8422383660856 Mon Sep 17 00:00:00 2001 From: clach Date: Thu, 8 Aug 2024 16:14:03 -0700 Subject: [PATCH 022/202] [hgiVulkan] One piece of Autodesk pull request #3170, a change meant to fix failing HdSt tests when using Lavapipe. However, this change fixes a hang in many situations when using HgiVulkan, not just for Lavapipe. From PR description: testHdStDrawItemsCache - Problem: is consuming command buffers faster than Lavapipe can execute them, so it reaches the maximum allowed inflight of 64. Normally buffers would be reset by _EndFrameSync after submission (or by EndFrame if it gets called), but since this sync is non-blocking, and Lavapipe is slow, it's called too early and does nothing (because all the buffers are still executing). And since all these calls must be on the main thread, it deadlocks: main thread is waiting for more command buffers, but those require calling _EndFrameSync to be made available, which it can't do because it's blocked... - Fix: Be smarter about allocating in-flight bits: search for the next available bit. If no in-flight bits are available, then update the existing command buffers in-flight status to release ones no longer in use, instead of just waiting (which is a deadlock). See #3170. (Internal change: 2336072) --- pxr/imaging/hgiVulkan/commandBuffer.cpp | 88 ++++++++++++------ pxr/imaging/hgiVulkan/commandBuffer.h | 45 ++++++++- pxr/imaging/hgiVulkan/commandQueue.cpp | 117 +++++++++++++++++------- pxr/imaging/hgiVulkan/commandQueue.h | 13 ++- 4 files changed, 194 insertions(+), 69 deletions(-) diff --git a/pxr/imaging/hgiVulkan/commandBuffer.cpp b/pxr/imaging/hgiVulkan/commandBuffer.cpp index 024b6a2918..3662257b9e 100644 --- a/pxr/imaging/hgiVulkan/commandBuffer.cpp +++ b/pxr/imaging/hgiVulkan/commandBuffer.cpp @@ -22,6 +22,7 @@ HgiVulkanCommandBuffer::HgiVulkanCommandBuffer( , _vkCommandBuffer(nullptr) , _vkFence(nullptr) , _vkSemaphore(nullptr) + , _isReset(true) , _isInFlight(false) , _isSubmitted(false) , _inflightId(0) @@ -96,19 +97,27 @@ HgiVulkanCommandBuffer::~HgiVulkanCommandBuffer() void HgiVulkanCommandBuffer::BeginCommandBuffer(uint8_t inflightId) { - if (!_isInFlight) { + TF_VERIFY(_isReset); + TF_VERIFY(!_isInFlight); + TF_VERIFY(!_isSubmitted); - VkCommandBufferBeginInfo beginInfo = - {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO}; - beginInfo.flags |= VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; + VkCommandBufferBeginInfo beginInfo = + {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO}; + beginInfo.flags |= VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; - TF_VERIFY( - vkBeginCommandBuffer(_vkCommandBuffer, &beginInfo) == VK_SUCCESS - ); + TF_VERIFY( + vkBeginCommandBuffer(_vkCommandBuffer, &beginInfo) == VK_SUCCESS + ); - _inflightId = inflightId; - _isInFlight = true; - } + _inflightId = inflightId; + _isInFlight = true; + _isReset = false; +} + +bool +HgiVulkanCommandBuffer::IsReset() const +{ + return _isReset; } bool @@ -120,28 +129,28 @@ HgiVulkanCommandBuffer::IsInFlight() const void HgiVulkanCommandBuffer::EndCommandBuffer() { - if (_isInFlight) { - TF_VERIFY( - vkEndCommandBuffer(_vkCommandBuffer) == VK_SUCCESS - ); + TF_VERIFY(!_isReset); + TF_VERIFY(_isInFlight); + TF_VERIFY(!_isSubmitted); - _isSubmitted = true; - } + TF_VERIFY( + vkEndCommandBuffer(_vkCommandBuffer) == VK_SUCCESS + ); + + _isSubmitted = true; } -bool -HgiVulkanCommandBuffer::ResetIfConsumedByGPU(HgiSubmitWaitType wait) +HgiVulkanCommandBuffer::InFlightUpdateResult +HgiVulkanCommandBuffer::UpdateInFlightStatus(HgiSubmitWaitType wait) { - // Command buffer is already available (previously reset). - // We do not have to test the fence or reset the cmd buffer. if (!_isInFlight) { - return false; + return InFlightUpdateResultNotInFlight; } // The command buffer is still recording. We should not test its fence until // we have submitted the command buffer to the queue (vulkan requirement). if (!_isSubmitted) { - return false; + return InFlightUpdateResultStillInFlight; } VkDevice vkDevice = _device->GetVulkanDevice(); @@ -149,19 +158,38 @@ HgiVulkanCommandBuffer::ResetIfConsumedByGPU(HgiSubmitWaitType wait) // Check the fence to see if the GPU has consumed the command buffer. // We cannnot reuse a command buffer until the GPU is finished with it. if (vkGetFenceStatus(vkDevice, _vkFence) == VK_NOT_READY){ - if (wait == HgiSubmitWaitTypeWaitUntilCompleted) { - static const uint64_t timeOut = 100000000000; - TF_VERIFY(vkWaitForFences( - vkDevice, 1, &_vkFence, VK_TRUE, timeOut) == VK_SUCCESS); - } else { - return false; + if (wait != HgiSubmitWaitTypeWaitUntilCompleted) { + return InFlightUpdateResultStillInFlight; } + + static const uint64_t timeOut = 100000000000; + TF_VERIFY(vkWaitForFences( + vkDevice, 1, &_vkFence, VK_TRUE, timeOut) == VK_SUCCESS); + } + + _isInFlight = false; + return InFlightUpdateResultFinishedFlight; +} + +bool +HgiVulkanCommandBuffer::ResetIfConsumedByGPU(HgiSubmitWaitType wait) +{ + // Command buffer is already available (previously reset). + // We do not have to test the fence or reset the cmd buffer. + if (_isReset) { + return false; + } + + if (UpdateInFlightStatus(wait) == InFlightUpdateResultStillInFlight) { + return false; } // GPU is done with command buffer, execute the custom fns the client wants // to see executed when cmd buf is consumed. RunAndClearCompletedHandlers(); + VkDevice vkDevice = _device->GetVulkanDevice(); + // GPU is done with command buffer, reset fence and command buffer. TF_VERIFY( vkResetFences(vkDevice, 1, &_vkFence) == VK_SUCCESS @@ -179,8 +207,8 @@ HgiVulkanCommandBuffer::ResetIfConsumedByGPU(HgiSubmitWaitType wait) ); // Command buffer may now be reused for new recordings / resource creation. - _isInFlight = false; _isSubmitted = false; + _isReset = true; return true; } @@ -280,4 +308,4 @@ HgiVulkanCommandBuffer::_GetCommandBufferResetFlags() return flags; } -PXR_NAMESPACE_CLOSE_SCOPE +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/pxr/imaging/hgiVulkan/commandBuffer.h b/pxr/imaging/hgiVulkan/commandBuffer.h index a87e1d25f1..049963910e 100644 --- a/pxr/imaging/hgiVulkan/commandBuffer.h +++ b/pxr/imaging/hgiVulkan/commandBuffer.h @@ -27,9 +27,35 @@ using HgiVulkanCompletedHandlerVector = std::vector; /// Represents a primary command buffer in Vulkan. /// Command buffers are managed by the CommandQueue. /// +/// It has the following lifecycle: +/// +-> Initial: Reset=T, InFlight=F, Submitted=F +/// | \/ +/// | BeginCommandBuffer(): Reset=F, InFlight=T, Submitted=F +/// | \/ +/// | EndCommandBuffer(): Reset=F, InFlight=T, Submitted=T +/// | \/ +/// | *UpdateInFlightStatus(): Reset=F, InFlight=F, Submitted=T +/// | \/ +/// +-- *†ResetIfConsumedByGPU(): Reset=T, InFlight=F, Submitted=F +/// +/// *Only if execution finished or waited on. +/// †Also internally called by ResetIfConsumedByGPU(). +/// class HgiVulkanCommandBuffer final { public: + /// \enum InFlightUpdateResult + /// + /// The result from calling UpdateInFlightStatus(). + /// This captures the state transition from in-flight + /// to not in-flight as "FinishedFlight". + /// + enum InFlightUpdateResult { + InFlightUpdateResultNotInFlight, + InFlightUpdateResultStillInFlight, + InFlightUpdateResultFinishedFlight + }; + HGIVULKAN_API HgiVulkanCommandBuffer(HgiVulkanDevice* device, VkCommandPool pool); @@ -48,8 +74,14 @@ class HgiVulkanCommandBuffer final HGIVULKAN_API void EndCommandBuffer(); + /// Returns true if the command buffer was reset and is ready for re-use, + /// otherwise false. The initial state is true. + HGIVULKAN_API + bool IsReset() const; + /// Returns true if the command buffer is recording commands or being - /// consumed by the GPU. Returns false if command buffer is available. + /// consumed by the GPU. Returns false if command buffer is ready for reset, + /// using ResetIfConsumedByGPU() HGIVULKAN_API bool IsInFlight() const; @@ -71,6 +103,14 @@ class HgiVulkanCommandBuffer final HGIVULKAN_API VkSemaphore GetVulkanSemaphore() const; + /// Update the command buffer in-flight status. If the status was + /// StillInFlight on the last update, the result will be FinishedFlight if + /// the device has finished consuming the buffer. Otherwise if not + /// consumed, it will be StillInFlight. Finally if the buffer had finished + /// flight or was not in flight, it will be NotInFlight. + HGIVULKAN_API + InFlightUpdateResult UpdateInFlightStatus(HgiSubmitWaitType wait); + /// Resets the cmd buffer if it has been consumed by the GPU. /// Returns true if the command buffer was reset, false if it was not reset. /// 'not reset' means it is still inflight or that it was previously reset. @@ -120,6 +160,7 @@ class HgiVulkanCommandBuffer final HgiVulkanCompletedHandlerVector _completedHandlers; + bool _isReset; bool _isInFlight; bool _isSubmitted; uint8_t _inflightId; @@ -127,4 +168,4 @@ class HgiVulkanCommandBuffer final PXR_NAMESPACE_CLOSE_SCOPE -#endif +#endif \ No newline at end of file diff --git a/pxr/imaging/hgiVulkan/commandQueue.cpp b/pxr/imaging/hgiVulkan/commandQueue.cpp index 764b4a7db3..c70f479e8a 100644 --- a/pxr/imaging/hgiVulkan/commandQueue.cpp +++ b/pxr/imaging/hgiVulkan/commandQueue.cpp @@ -168,7 +168,7 @@ HgiVulkanCommandQueue::AcquireCommandBuffer() // Grab one of the available command buffers. HgiVulkanCommandBuffer* cmdBuf = nullptr; for (HgiVulkanCommandBuffer* cb : pool->commandBuffers) { - if (!cb->IsInFlight()) { + if (cb->IsReset()) { cmdBuf = cb; break; } @@ -181,11 +181,33 @@ HgiVulkanCommandQueue::AcquireCommandBuffer() } // Acquire an unique id for this cmd buffer amongst inflight cmd buffers. - uint8_t inflightId = _AcquireInflightIdBit(); - _SetInflightBit(inflightId, /*enabled*/ true); + std::optional inflightId = _AcquireInflightIdBit(); + + // No id available: check if any command buffers are no longer in-flight, + // and release their bit. Spin until we can acquire a bit. + if (!inflightId) { + do { + // To avoid a hot loop with high CPU usage, sleep a bit. + // We want to sleep as little as possible, but the actual + // sleep time is system dependent. This is unfortunate and + // will cause framerate hitches, but if we got here in the + // first place it's because the device is overloaded and things + // are not going well. + std::this_thread::sleep_for(std::chrono::microseconds(1)); + for (HgiVulkanCommandBuffer* cb : pool->commandBuffers) { + if (cb->UpdateInFlightStatus(HgiSubmitWaitTypeNoWait) == + HgiVulkanCommandBuffer::InFlightUpdateResultFinishedFlight) + { + _ReleaseInflightBit(cb->GetInflightId()); + } + } + + inflightId = _AcquireInflightIdBit(); + } while (!inflightId); + } // Begin recording to ensure the caller has exclusive access to cmd buffer. - cmdBuf->BeginCommandBuffer(inflightId); + cmdBuf->BeginCommandBuffer(*inflightId); return cmdBuf; } @@ -209,7 +231,8 @@ HgiVulkanCommandQueue::AcquireResourceCommandBuffer() uint64_t HgiVulkanCommandQueue::GetInflightCommandBuffersBits() { - return _inflightBits.load(); + // See _AcquireInflightIdBit for explanation of memory order. + return _inflightBits.load(std::memory_order_relaxed); } /* Multi threaded */ @@ -231,7 +254,7 @@ HgiVulkanCommandQueue::ResetConsumedCommandBuffers(HgiSubmitWaitType wait) HgiVulkan_CommandPool* pool = it.second; for (HgiVulkanCommandBuffer* cb : pool->commandBuffers) { if (cb->ResetIfConsumedByGPU(wait)) { - _SetInflightBit(cb->GetInflightId(), /*enabled*/ false); + _ReleaseInflightBit(cb->GetInflightId()); } } } @@ -256,40 +279,70 @@ HgiVulkanCommandQueue::_AcquireThreadCommandPool( } /* Multi threaded */ -uint8_t +std::optional HgiVulkanCommandQueue::_AcquireInflightIdBit() { - // Command buffers can be acquired by threads, so we need to do an - // increment that is thread safe. We circle back to the first bit after - // all bits have been used once. These means we can track the in-flight - // status of up to 64 consecutive command buffer usages. - // This becomes important in garbage collection and is explained more there. - return _inflightCounter.fetch_add(1) % 64; + // Command buffers can be acquired by threads, so we need to do an id + // acquire that is thread safe. We search for the next zero bit in a + // 64bit word. This means we can track the in-flight status of up to 64 + // consecutive command buffer usages. This becomes important in garbage + // collection and is explained more there. + const uint8_t nextBitIndex = 0x3F & _inflightCounter.fetch_add(1, + std::memory_order_relaxed); + const uint64_t previousBits = + (static_cast(1) << nextBitIndex) - 1; + + // We need to set the bit atomically since this function can be called by + // multiple threads. Try to set the value and if it fails (another thread + // may have updated the `expected` value!), we re-apply our bit and try + // again. Relaxed memory order since this isn't used to order read/writes. + // If no bits are available, then exit with nothing. The caller will try + // to free some bits by updating the in-flight status of the existing + // buffers. + uint64_t freeBit; + uint64_t expected = _inflightBits.load(std::memory_order_relaxed); + uint64_t desired; + do { + // Don't re-use lower bits if possible: mask them as used. + // _inflightCounter will wrap around when we run out. + const uint64_t usedBits = expected | previousBits; + freeBit = ~usedBits & (usedBits + 1); + if (freeBit == 0) { + return std::nullopt; + } + + expected &= ~freeBit; + desired = expected | freeBit; + } while (!_inflightBits.compare_exchange_weak(expected, desired, + std::memory_order_relaxed)); + + // Based on: https://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightParallel + // C++20: use std::countr_zero instead + uint8_t id = 63; + if (freeBit & 0x00000000FFFFFFFF) id -= 32; + if (freeBit & 0x0000FFFF0000FFFF) id -= 16; + if (freeBit & 0x00FF00FF00FF00FF) id -= 8; + if (freeBit & 0x0F0F0F0F0F0F0F0F) id -= 4; + if (freeBit & 0x3333333333333333) id -= 2; + if (freeBit & 0x5555555555555555) id -= 1; + + return id; } /* Multi threaded */ void -HgiVulkanCommandQueue::_SetInflightBit(uint8_t id, bool enabled) +HgiVulkanCommandQueue::_ReleaseInflightBit(uint8_t id) { // We need to set the bit atomically since this function can be called by // multiple threads. Try to set the value and if it fails (another thread - // may have updated the `expected` value!), we re-apply our bit and - // try again. - uint64_t expect = _inflightBits.load(); - - if (enabled) { - // Spin if bit was already enabled. This means we have reached our max - // of 64 command buffers and must wait until it becomes available. - expect &= ~(1ULL< #include #include +#include PXR_NAMESPACE_OPEN_SCOPE @@ -105,13 +106,15 @@ class HgiVulkanCommandQueue final std::thread::id const& threadId); // Returns an id-bit that uniquely identifies the cmd buffer amongst all - // in-flight cmd buffers. + // in-flight cmd buffers. Returns an empty result if all bits have been + // acquired, in which case the existing buffers must have their bit released + // if no longer in flight. // Thread safety: This call is thread safe.. - uint8_t _AcquireInflightIdBit(); + std::optional _AcquireInflightIdBit(); - // Set if a command buffer is in-flight (enabled=true) or not. + // Set a command buffer as not in-flight. // Thread safety: This call is thread safe. - void _SetInflightBit(uint8_t inflightId, bool enabled); + void _ReleaseInflightBit(uint8_t inflightId); HgiVulkanDevice* _device; VkQueue _vkGfxQueue; @@ -127,4 +130,4 @@ class HgiVulkanCommandQueue final PXR_NAMESPACE_CLOSE_SCOPE -#endif +#endif \ No newline at end of file From 97de4a845431a67cca109ce26bca218f2d63f79d Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Thu, 8 Aug 2024 16:16:26 -0700 Subject: [PATCH 023/202] Move couple of tests around for usd core validators. (Internal change: 2336073) --- pxr/usd/usd/testenv/testUsdCoreValidators.cpp | 112 +++++++++++++++++- .../usd/testenv/testUsdValidationRegistry.cpp | 100 ---------------- 2 files changed, 111 insertions(+), 101 deletions(-) diff --git a/pxr/usd/usd/testenv/testUsdCoreValidators.cpp b/pxr/usd/usd/testenv/testUsdCoreValidators.cpp index 08ca462822..c9c1ab3ff2 100644 --- a/pxr/usd/usd/testenv/testUsdCoreValidators.cpp +++ b/pxr/usd/usd/testenv/testUsdCoreValidators.cpp @@ -15,7 +15,37 @@ PXR_NAMESPACE_USING_DIRECTIVE static -void TestCoreUsdStageMetadata() +void +TestUsdValidators() +{ + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + + // The following test keeps track of all the available validators within + // UsdCoreValidators keyword, hence as new validators are added under + // this keyword this unit test will have to be updated. + const UsdValidatorMetadataVector coreValidatorMetadata = + registry.GetValidatorMetadataForKeyword( + UsdValidatorKeywordTokens->UsdCoreValidators); + TF_AXIOM(coreValidatorMetadata.size() == 2); + + std::set validatorMetadataNameSet; + for (const UsdValidatorMetadata &metadata : coreValidatorMetadata) { + validatorMetadataNameSet.insert(metadata.name); + } + + const std::set expectedValidatorNames = + {UsdValidatorNameTokens->compositionErrorTest, + UsdValidatorNameTokens->stageMetadataChecker}; + + TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), + validatorMetadataNameSet.end(), + expectedValidatorNames.begin(), + expectedValidatorNames.end())); +} + +static +void +TestCoreUsdStageMetadata() { // Get stageMetadataChecker @@ -50,10 +80,90 @@ void TestCoreUsdStageMetadata() TF_AXIOM(errors.size() == 0); } +static +void +TestUsdCompositionErrorTest() +{ + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + + // test to make sure CompositionErrorTest validator provided in the core + // usd plugin works correctly by reporting all the composition errors, + // error sites and appropriate messages pertaining to these errors. + const UsdValidator* const compositionErrorValidator = + registry.GetOrLoadValidatorByName( + UsdValidatorNameTokens->compositionErrorTest); + TF_AXIOM(compositionErrorValidator); + + static const std::string layerContents = + R"usda(#usda 1.0 + ( + subLayers = [ + @missingLayer.usda@ + ] + ) + def "World" + { + def "Inst1" ( + instanceable = true + prepend references = + ) + { + } + def "Inst2" ( + instanceable = true + prepend references = + ) + { + } + } + def "Main" + { + def "First" ( + add references = + ) + { + } + def "Second" ( + add references = + ) + { + } + } + )usda"; + SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(".usda"); + layer->ImportFromString(layerContents); + UsdStageRefPtr usdStage = UsdStage::Open(layer); + + // Get expected list of composition errors from the stage. + const PcpErrorVector expectedPcpErrors = + usdStage->GetCompositionErrors(); + TF_AXIOM(expectedPcpErrors.size() == 5); + + // Get wrapped validation errors from our compositionErrorValidator + UsdValidationErrorVector errors = + compositionErrorValidator->Validate(usdStage); + TF_AXIOM(errors.size() == 5); + + // Lets make sure pcpErrors and validationErrors match + for (size_t index = 0; index < errors.size(); ++index) { + TF_AXIOM(errors[index].GetValidator() == compositionErrorValidator); + TF_AXIOM(errors[index].GetMessage() == + expectedPcpErrors[index]->ToString()); + TF_AXIOM(errors[index].GetSites().size() == 1); + TF_AXIOM(errors[index].GetSites().size() == 1); + TF_AXIOM(errors[index].GetSites()[0].IsValid()); + TF_AXIOM(errors[index].GetSites()[0].IsPrim()); + TF_AXIOM(errors[index].GetSites()[0].GetPrim().GetPath() == + expectedPcpErrors[index]->rootSite.path); + } +} + int main() { + TestUsdValidators(); TestCoreUsdStageMetadata(); + TestUsdCompositionErrorTest(); std::cout << "OK\n"; } diff --git a/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp b/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp index efcc4b2e72..27fd429370 100644 --- a/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp +++ b/pxr/usd/usd/testenv/testUsdValidationRegistry.cpp @@ -222,107 +222,8 @@ void TestUsdValidationRegistry() TfToken("testValidationPlugin:FailedValidatorSuite")); TF_AXIOM(!suite); } - { - // test to make sure CompositionErrorTest validator provided in the core - // usd plugin works correctly by reporting all the composition errors, - // error sites and appropriate messages pertaining to these errors. - const UsdValidator* const compositionErrorValidator = - registry.GetOrLoadValidatorByName( - UsdValidatorNameTokens->compositionErrorTest); - TF_AXIOM(compositionErrorValidator); - - static const std::string layerContents = - R"usda(#usda 1.0 - ( - subLayers = [ - @missingLayer.usda@ - ] - ) - def "World" - { - def "Inst1" ( - instanceable = true - prepend references = - ) - { - } - def "Inst2" ( - instanceable = true - prepend references = - ) - { - } - } - def "Main" - { - def "First" ( - add references = - ) - { - } - def "Second" ( - add references = - ) - { - } - } - )usda"; - SdfLayerRefPtr layer = SdfLayer::CreateAnonymous(".usda"); - layer->ImportFromString(layerContents); - UsdStageRefPtr usdStage = UsdStage::Open(layer); - - // Get expected list of composition errors from the stage. - const PcpErrorVector expectedPcpErrors = - usdStage->GetCompositionErrors(); - TF_AXIOM(expectedPcpErrors.size() == 5); - - // Get wrapped validation errors from our compositionErrorValidator - UsdValidationErrorVector errors = - compositionErrorValidator->Validate(usdStage); - TF_AXIOM(errors.size() == 5); - - // Lets make sure pcpErrors and validationErrors match - for (size_t index = 0; index < errors.size(); ++index) { - TF_AXIOM(errors[index].GetValidator() == compositionErrorValidator); - TF_AXIOM(errors[index].GetMessage() == - expectedPcpErrors[index]->ToString()); - TF_AXIOM(errors[index].GetSites().size() == 1); - TF_AXIOM(errors[index].GetSites().size() == 1); - TF_AXIOM(errors[index].GetSites()[0].IsValid()); - TF_AXIOM(errors[index].GetSites()[0].IsPrim()); - TF_AXIOM(errors[index].GetSites()[0].GetPrim().GetPath() == - expectedPcpErrors[index]->rootSite.path); - } - } } -void -TestUsdValidators() -{ - UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); - - // The following test keeps track of all the available validators within - // UsdCoreValidators keyword, hence as new validators are added under - // this keyword this unit test will have to be updated. - const UsdValidatorMetadataVector coreValidatorMetadata = - registry.GetValidatorMetadataForKeyword( - UsdValidatorKeywordTokens->UsdCoreValidators); - TF_AXIOM(coreValidatorMetadata.size() == 2); - - std::set validatorMetadataNameSet; - for (const UsdValidatorMetadata &metadata : coreValidatorMetadata) { - validatorMetadataNameSet.insert(metadata.name); - } - - const std::set expectedValidatorNames = - {UsdValidatorNameTokens->compositionErrorTest, - UsdValidatorNameTokens->stageMetadataChecker}; - - TF_AXIOM(std::includes(validatorMetadataNameSet.begin(), - validatorMetadataNameSet.end(), - expectedValidatorNames.begin(), - expectedValidatorNames.end())); -} int main() { @@ -331,7 +232,6 @@ main() TF_AXIOM(!PlugRegistry::GetInstance().RegisterPlugins(testDir).empty()); TestUsdValidationRegistry(); - TestUsdValidators(); printf("OK\n"); } From 5d12d37c768a8504f5fb55943269192f0e936ec1 Mon Sep 17 00:00:00 2001 From: adamrwoodbury Date: Thu, 8 Aug 2024 16:17:35 -0700 Subject: [PATCH 024/202] Convert .dox files in usd to .md and rename the enclosing directory from "doxygen" to "docs". - The only edits here are to remove the C-style comments enclosing the contents, which are no longer needed and to convert \page, \section, and \subsection to #, ##, and ###. - This corrects some instances where documentation is otherwise formatted incorrectly. - Moving toward using Markdown makes our documentation more portable. (Internal change: 2336086) --- pxr/usd/usd/CMakeLists.txt | 36 +++++------ .../advancedFeatures.md} | 6 +- pxr/usd/usd/docs/authoringEditing.md | 8 +++ .../bestPractices.md} | 14 ++--- .../commonIdioms.dox => docs/commonIdioms.md} | 21 +++---- .../datatypes.dox => docs/datatypes.md} | 16 ++--- .../dynamicFileFormat.md} | 18 +++--- .../usd/{doxygen/front.dox => docs/front.md} | 8 +-- .../generatingSchemas.md} | 38 +++++------- .../images/instancing/Instancing_Example.png | Bin .../images/instancing/Instancing_Example.xml | 0 .../instancing/Nested_Instancing_Example.png | Bin .../instancing/Nested_Instancing_Example.xml | 0 .../instancing/Relationship_Example.png | Bin .../instancing/Relationship_Example.xml | 0 .../instancing/Uninstanced_vs_Instanced.png | Bin .../instancing/Uninstanced_vs_Instanced.xml | 0 .../instancing.dox => docs/instancing.md} | 36 +++++------ .../multiThreading.md} | 10 +-- .../objectModel.dox => docs/objectModel.md} | 36 +++++------ .../propertiesOfSceneDescription.md} | 20 +++--- .../utf8Overview.dox => docs/utf8Overview.md} | 26 ++++---- .../valueClips.dox => docs/valueClips.md} | 58 ++++++++---------- pxr/usd/usd/doxygen/authoringEditing.dox | 12 ---- 24 files changed, 155 insertions(+), 208 deletions(-) rename pxr/usd/usd/{doxygen/advancedFeatures.dox => docs/advancedFeatures.md} (72%) create mode 100644 pxr/usd/usd/docs/authoringEditing.md rename pxr/usd/usd/{doxygen/bestPractices.dox => docs/bestPractices.md} (65%) rename pxr/usd/usd/{doxygen/commonIdioms.dox => docs/commonIdioms.md} (91%) rename pxr/usd/usd/{doxygen/datatypes.dox => docs/datatypes.md} (96%) rename pxr/usd/usd/{doxygen/dynamicFileFormat.dox => docs/dynamicFileFormat.md} (97%) rename pxr/usd/usd/{doxygen/front.dox => docs/front.md} (97%) rename pxr/usd/usd/{doxygen/generatingSchemas.dox => docs/generatingSchemas.md} (97%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Instancing_Example.png (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Instancing_Example.xml (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Nested_Instancing_Example.png (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Nested_Instancing_Example.xml (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Relationship_Example.png (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Relationship_Example.xml (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Uninstanced_vs_Instanced.png (100%) rename pxr/usd/usd/{doxygen => docs}/images/instancing/Uninstanced_vs_Instanced.xml (100%) rename pxr/usd/usd/{doxygen/instancing.dox => docs/instancing.md} (95%) rename pxr/usd/usd/{doxygen/multiThreading.dox => docs/multiThreading.md} (85%) rename pxr/usd/usd/{doxygen/objectModel.dox => docs/objectModel.md} (91%) rename pxr/usd/usd/{doxygen/propertiesOfSceneDescription.dox => docs/propertiesOfSceneDescription.md} (86%) rename pxr/usd/usd/{doxygen/utf8Overview.dox => docs/utf8Overview.md} (92%) rename pxr/usd/usd/{doxygen/valueClips.dox => docs/valueClips.md} (95%) delete mode 100644 pxr/usd/usd/doxygen/authoringEditing.dox diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index a6dc3abea5..26981d78b4 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -179,24 +179,24 @@ pxr_library(usd codegenTemplates/wrapTokens.cpp DOXYGEN_FILES - doxygen/advancedFeatures.dox - doxygen/authoringEditing.dox - doxygen/bestPractices.dox - doxygen/commonIdioms.dox - doxygen/datatypes.dox - doxygen/dynamicFileFormat.dox - doxygen/front.dox - doxygen/generatingSchemas.dox - doxygen/instancing.dox - doxygen/multiThreading.dox - doxygen/objectModel.dox - doxygen/propertiesOfSceneDescription.dox - doxygen/utf8Overview.dox - doxygen/valueClips.dox - doxygen/images/instancing/Instancing_Example.png - doxygen/images/instancing/Nested_Instancing_Example.png - doxygen/images/instancing/Relationship_Example.png - doxygen/images/instancing/Uninstanced_vs_Instanced.png + docs/advancedFeatures.md + docs/authoringEditing.md + docs/bestPractices.md + docs/commonIdioms.md + docs/datatypes.md + docs/dynamicFileFormat.md + docs/front.md + docs/generatingSchemas.md + docs/instancing.md + docs/multiThreading.md + docs/objectModel.md + docs/propertiesOfSceneDescription.md + docs/utf8Overview.md + docs/valueClips.md + docs/images/instancing/Instancing_Example.png + docs/images/instancing/Nested_Instancing_Example.png + docs/images/instancing/Relationship_Example.png + docs/images/instancing/Uninstanced_vs_Instanced.png examples_usd.cpp ) diff --git a/pxr/usd/usd/doxygen/advancedFeatures.dox b/pxr/usd/usd/docs/advancedFeatures.md similarity index 72% rename from pxr/usd/usd/doxygen/advancedFeatures.dox rename to pxr/usd/usd/docs/advancedFeatures.md index a9d2157257..4f381d65fe 100644 --- a/pxr/usd/usd/doxygen/advancedFeatures.dox +++ b/pxr/usd/usd/docs/advancedFeatures.md @@ -1,6 +1,4 @@ -/*! - -\page Usd_Page_AdvancedFeatures Advanced Scenegraph Scalability Features +# Advanced Scenegraph Scalability Features {#Usd_Page_AdvancedFeatures} The pages in this section document advanced features provided by USD: @@ -9,5 +7,3 @@ The pages in this section document advanced features provided by USD:

  • \subpage Usd_Page_ScenegraphInstancing
  • \subpage Usd_Page_ValueClips
  • - -*/ diff --git a/pxr/usd/usd/docs/authoringEditing.md b/pxr/usd/usd/docs/authoringEditing.md new file mode 100644 index 0000000000..edac37dd2a --- /dev/null +++ b/pxr/usd/usd/docs/authoringEditing.md @@ -0,0 +1,8 @@ +# Authoring and Editing Scene Description {#Usd_Page_AuthoringEditing} + +## Specifying Where Edits Should Go {#Usd_SelectiveEditing} + +## Client Safety and Response to Edits {#Usd_Notification} + +See the section on \ref Usd_BoolReturns for how to ensure retained Usd objects +are still valid for use. diff --git a/pxr/usd/usd/doxygen/bestPractices.dox b/pxr/usd/usd/docs/bestPractices.md similarity index 65% rename from pxr/usd/usd/doxygen/bestPractices.dox rename to pxr/usd/usd/docs/bestPractices.md index 1b81e58739..90e2785dce 100644 --- a/pxr/usd/usd/doxygen/bestPractices.dox +++ b/pxr/usd/usd/docs/bestPractices.md @@ -1,20 +1,18 @@ -/*! +# Best Practices and Common Questions {#Usd_Page_BestPractices} -\page Usd_Page_BestPractices Best Practices and Common Questions +## Object Parameters as Const-Ref {#Usd_SharedConstRef} -\section Usd_SharedConstRef Object Parameters as Const-Ref - -\section Usd_DataStreaming Reading Data Efficiently +## Reading Data Efficiently {#Usd_DataStreaming} Processing different subtrees of a stage in different threads to reduce contention for prims and paths. Converting datatypes (VtValue::Cast) and potentially reading native datatypes. -\section Usd_Payloads Payloads: Impact of Using and Not Using +## Payloads: Impact of Using and Not Using {#Usd_Payloads} -\section Usd_Misc_Dos_Donts Miscellaneous Do's and Dont's +## Miscellaneous Do's and Dont's {#Usd_Misc_Dos_Donts} SdfPath::GetString() gives a fully unrolled, representation of any location in namespace, and is very useful for debugging. However, it is rather @@ -22,5 +20,3 @@ expensive, and may cause a globally-shared cache to be populated. Don't call it (or SdfPath::GetText()) in any performance-critical loops, and in general, if using it for diagnostics, only call it inside a block that is guarded by your debug flag. - -*/ diff --git a/pxr/usd/usd/doxygen/commonIdioms.dox b/pxr/usd/usd/docs/commonIdioms.md similarity index 91% rename from pxr/usd/usd/doxygen/commonIdioms.dox rename to pxr/usd/usd/docs/commonIdioms.md index 017d9f6c61..a9c7824ab7 100644 --- a/pxr/usd/usd/doxygen/commonIdioms.dox +++ b/pxr/usd/usd/docs/commonIdioms.md @@ -1,8 +1,6 @@ -/*! +# Common Idioms and Examples {#Usd_Page_CommonIdioms} -\page Usd_Page_CommonIdioms Common Idioms and Examples - -\section Usd_StageTraversal Traversing a Stage +## Traversing a Stage {#Usd_StageTraversal} The Usd API provides a number of methods for fast, configurable traversal of a stage or sub-trees of prims on a stage. The two categories @@ -13,7 +11,7 @@ conjunctions, disjunctions, and negations of a set of tests of core properties of UsdPrim that are cached for speedy access during stage population. See \ref Usd_PrimFlags "Prim Flags" for more detail and examples. -\subsection Usd_StageTraversal_Recursion Traversing with Recursion +### Traversing with Recursion {#Usd_StageTraversal_Recursion} UsdPrim provides a number of methods for accessing its direct children via a "range", with which one can construct very efficient recursive functions. @@ -21,7 +19,7 @@ The standard UsdPrim::GetChildren() uses the "canonical traversal predicate," which implies all active, loaded, defined, non-abstract children. UsdPrim::GetFilteredChildren() allows specification of a custom predicate. -\subsection Usd_StageTraversal_Ieration Traversing with Iteration +### Traversing with Iteration {#Usd_StageTraversal_Ieration} UsdPrim::GetDescendants() returns a range for all of a prim's "canonical" decendants, and UsdPrim::GetFilteredDescendants() allows the range's @@ -33,11 +31,11 @@ The convenience method UsdStage::Traverse() returns a UsdPrimRange that visits all descendants of the pseudo-root, but not the pseudo-root itself. -\section Usd_WorkingWithSchemas Working With Schema Classes +## Working With Schema Classes {#Usd_WorkingWithSchemas} Later we'll talk about how to create new schema classes... -\subsection Usd_Create_Or_Get_Property Create vs Get Property Methods +### Create vs Get Property Methods {#Usd_Create_Or_Get_Property} For a UsdAttribute named "points" defined in a schema class, you will find two access methods in the schema class in C++ and python: @@ -103,9 +101,6 @@ However, code that consistently uses CreateXXXAttr() for authoring will be easier to maintain since it will help distinguish reader sections from writer sections. -\section Usd_BoolReturns Bool Return Values and Safe Operator Bool - -\section Usd_ErrorReporting Error Reporting Policy and Control - +## Bool Return Values and Safe Operator Bool {#Usd_BoolReturns} -*/ +## Error Reporting Policy and Control {#Usd_ErrorReporting} diff --git a/pxr/usd/usd/doxygen/datatypes.dox b/pxr/usd/usd/docs/datatypes.md similarity index 96% rename from pxr/usd/usd/doxygen/datatypes.dox rename to pxr/usd/usd/docs/datatypes.md index 7790a93150..b190491c1a 100644 --- a/pxr/usd/usd/doxygen/datatypes.dox +++ b/pxr/usd/usd/docs/datatypes.md @@ -1,8 +1,6 @@ -/*! +# Basic Datatypes for Scene Description Provided by Sdf {#Usd_Page_Datatypes} -\page Usd_Page_Datatypes Basic Datatypes for Scene Description Provided by Sdf - -\section Usd_Datatypes Attribute value types +## Attribute value types {#Usd_Datatypes} USD supports a variety of data types for attribute values. These types are encoded in an SdfValueTypeName object that corresponds to an @@ -28,7 +26,7 @@ else: # error creating the attribute \endcode -\section Usd_Basic_Datatypes Basic data types +## Basic data types {#Usd_Basic_Datatypes} This table lists the fundamental data types supported by USD. @@ -70,7 +68,7 @@ This table lists the fundamental data types supported by USD. Note that opaque-valued attributes cannot be authored, and are used for cases where the value can't be represented in USD, such as shader outputs. -\section Usd_Roles Roles +## Roles {#Usd_Roles} Value types may also be specified by one of a set of special type names. These names correspond to the basic data types listed above but provide @@ -115,7 +113,7 @@ and the role name and meaning. A Group attribute is an opaque attribute used to represent a group of other properties. It behaves like a connectable/targetable property namespace. -\section Usd_Array_Datatypes Array data types +## Array data types {#Usd_Array_Datatypes} USD also supports arrays of the above data types. The value type name for these arrays is simply the name of the underlying value type @@ -124,7 +122,7 @@ SdfValueTypeNames with a "Array" suffix on the basic datatype (e.g. SdfValueTypeNames->FloatArray provides "float[]"). The corresponding C++ type is VtArray, e.g. VtArray, VtArray, etc. -\section Usd_Dictionary_Type Dictionary-valued Metadata +## Dictionary-valued Metadata {#Usd_Dictionary_Type} Metadata in USD (See \ref Usd_OM_Metadata) can take on several other datatypes. Most of these are highly-specialized, pertaining to composition, @@ -148,5 +146,3 @@ You can use the builtin customData for your truly ad-hoc user-data needs, but you can also add new dictionary-valued metadata by defining it in a module plugInfo.json file - see \ref sdf_plugin_metadata for details on how to do so. - -*/ diff --git a/pxr/usd/usd/doxygen/dynamicFileFormat.dox b/pxr/usd/usd/docs/dynamicFileFormat.md similarity index 97% rename from pxr/usd/usd/doxygen/dynamicFileFormat.dox rename to pxr/usd/usd/docs/dynamicFileFormat.md index 342b551646..b79aacf355 100644 --- a/pxr/usd/usd/doxygen/dynamicFileFormat.dox +++ b/pxr/usd/usd/docs/dynamicFileFormat.md @@ -1,8 +1,6 @@ -/*! +# Dynamic File Formats {#Usd_Page_DynamicFileFormat} -\page Usd_Page_DynamicFileFormat Dynamic File Formats - -\section Usd_DynamicFileFormat_Overview Overview +## Overview {#Usd_DynamicFileFormat_Overview} A dynamic file format is an SdfFileFormat that allows the contents of its layers to be generated dynamically, when @@ -21,7 +19,7 @@ layer will be included. When the values of any of the composed fields or attribute defaults change, the prim automatically regenerates the file format arguments and creates new layer contents. -\section Usd_DynamicFileFormat_Creation Creating a Dynamic File Format +## Creating a Dynamic File Format {#Usd_DynamicFileFormat_Creation} To create a dynamic file format, we first create a plugin library that implements a new derived subclass of SdfFileFormat, just like we would for any @@ -333,7 +331,7 @@ The resolved payload layer path is now: We have new layer with a different identity and contents from the same payload field without changing the payload declaration itself. -\subsection Usd_DynamicFileFormat_Attributes Using Attributes To Compute Arguments +### Using Attributes To Compute Arguments {#Usd_DynamicFileFormat_Attributes} Your dynamic file format plugin can also use uniform attribute defaults instead of metadata fields to compute file format arguments. Unlike metadata fields, @@ -407,7 +405,7 @@ def "Params" ( } \endcode -\section Usd_DynamicFileFormat_Examples Advanced Examples +## Advanced Examples {#Usd_DynamicFileFormat_Examples} We include two examples of dynamic file format plugins in pxr/extras/usd/examples. One ot the major differences between these examples that's worth highlighting is @@ -433,7 +431,7 @@ spec data on the fly when requested. This example greatly benefits from a customized SdfAbstractData implementation as it avoids having to precompute every time sample for every prim when the layer is opened. -\section Usd_DynamicFileFormat_DynamicPayloads Dynamic Payloads +## Dynamic Payloads {#Usd_DynamicFileFormat_DynamicPayloads} As mentioned above, the composition of prim fields or attribute defaults into file format arguments only occurs when a dynamic asset is included as a payload. @@ -453,7 +451,7 @@ A prim index can have multiple payload arcs with any number of them being dynamic. Opinions from stronger payloads are included in the context for weaker dynamic payloads when computing file format arguments. -\section Usd_DynamicFileFormat_ChangeManagement Dependencies and Change Management +## Dependencies and Change Management {#Usd_DynamicFileFormat_ChangeManagement} When the PcpDynamicFileFormatContext is used to compute a field value in \ref PcpDynamicFileFormatInterface::ComposeFieldsForFileFormatArguments "ComposeFieldsForFileFormatArguments" @@ -523,5 +521,3 @@ value change is relevant. The \p dependencyContextData is stored and passed back when processing a field change within the same prim index context. See \ref Usd_DynamicFileFormat_Examples "usdRecursivePayloadsExample" for a very basic example of how this can be used. - -*/ diff --git a/pxr/usd/usd/doxygen/front.dox b/pxr/usd/usd/docs/front.md similarity index 97% rename from pxr/usd/usd/doxygen/front.dox rename to pxr/usd/usd/docs/front.md index 46403f6405..d811d69891 100644 --- a/pxr/usd/usd/doxygen/front.dox +++ b/pxr/usd/usd/docs/front.md @@ -1,6 +1,4 @@ -/*! - -\page usd_page_front Usd : Universal Scene Description (Core) +# Usd : Universal Scene Description (Core) {#usd_page_front} \if ( PIXAR_MFB_BUILD ) \mainpage Usd : Universal Scene Description \endif @@ -11,7 +9,7 @@ hierarchically organized, static and time-sampled data, for the primary purpose of interchanging and augmenting the data between cooperating Digital Content Creation applications. -\section Usd_ManualDesc Core API Manual +## Core API Manual {#Usd_ManualDesc} This manual contains the API documentation for the core Usd module, prefaced with an introduction to the key concepts behind the API, and including a @@ -126,5 +124,5 @@ import/export. -*/ + diff --git a/pxr/usd/usd/doxygen/generatingSchemas.dox b/pxr/usd/usd/docs/generatingSchemas.md similarity index 97% rename from pxr/usd/usd/doxygen/generatingSchemas.dox rename to pxr/usd/usd/docs/generatingSchemas.md index dfa4c473a7..b4c47ed04e 100644 --- a/pxr/usd/usd/doxygen/generatingSchemas.dox +++ b/pxr/usd/usd/docs/generatingSchemas.md @@ -1,6 +1,4 @@ -/*! - -\page Usd_Page_GeneratingSchemas Creating New Schema Classes with usdGenSchema +# Creating New Schema Classes with usdGenSchema {#Usd_Page_GeneratingSchemas} USD provides a code generator script 'usdGenSchema' for creating new schema classes. The script is driven by a USD layer (typically named schema.usda) and @@ -38,7 +36,7 @@ to compile and work with USD Core successfully. See pxr/usd/lib/usdGeom/schema.usda for an example. -\section Usd_IsAVsAPISchemas IsA Vs. API Schemas +## IsA Vs. API Schemas {#Usd_IsAVsAPISchemas} Schema classes can be classified into the following two types: @@ -141,7 +139,7 @@ class declaration in a schema.usda file. See \ref Usd_ExampleSchema for examples of each type of schema class. -\section Usd_BuiltinAPISchemas Built-in applied API schemas +## Built-in applied API schemas {#Usd_BuiltinAPISchemas} In some cases an IsA schema may want to have certain API schemas always applied to prims of its schema type. To avoid having to manually apply these API schemas @@ -188,7 +186,7 @@ and can be specified in two ways: apply it using the instance name "foo", then, OtherMultiApplyAPI would also be applied using the suffixed instance name "foo:someName" -\subsection Usd_SchemaDefinedBuiltinAPIs Schema defined built-in APIs +### Schema defined built-in APIs {#Usd_SchemaDefinedBuiltinAPIs} The first and most straightforward way an IsA or applied API schema author can specify which applied API schemas it wants built-in is by prepending them @@ -268,7 +266,7 @@ itself (like changing the property's type) and is typically used for changing the default value for the property. \sa \ref Usd_APISchemaStrengthOrdering -\subsection Usd_AutoAppliedAPISchemas Auto applied API schemas +### Auto applied API schemas {#Usd_AutoAppliedAPISchemas} In addition to schemas being able to declare built-in applied API schemas, an applied API schema can specify that it should be automatically applied to @@ -311,7 +309,7 @@ listed types. Note that this customData field is only supported for single apply API schemas as multiple apply API schemas cannot be applied without an instance name. -\subsection Usd_PluginAutoAppliedAPISchemas Plugin defined auto applied API schemas +### Plugin defined auto applied API schemas {#Usd_PluginAutoAppliedAPISchemas} Lastly, it is also possible for plugins to specify additional built-in API schemas for other schema types outside of schema generation. This is useful if a @@ -355,7 +353,7 @@ Multiple apply schemas (in addition to single apply) can also be auto applied using this plugin metadata as long as the fully qualified instance name for the mulitple apply schema is provided. -\subsection Usd_APISchemaStrengthOrdering Property conflicts, composition, and API schema strength ordering +### Property conflicts, composition, and API schema strength ordering {#Usd_APISchemaStrengthOrdering} Given that we encourage (or even require in the case of multiple-apply schemas) the use of namespace prefixes for API schema property names, we expect most @@ -410,7 +408,7 @@ conditions are met: - The field is in the set of _allowed composable fields_ which currently includes only _default_ and _hidden_. We may expand the set of allowed composable fields in the future. -\subsection Usd_APISchemaPropertyOverride API schema property overrides +### API schema property overrides {#Usd_APISchemaPropertyOverride} Sometimes when an IsA or an API schema includes another API schema as a built-in, it may also want to alter one or more of the built-in schema's @@ -496,7 +494,7 @@ from built-in API schemas and do not apply to overriding properties via schema inheritance. This is because schema properties always sparsely compose via class inheritance during schema generation so no specification is necessary. -\section Usd_SchemaCodeGeneration Schema Code Generation +## Schema Code Generation {#Usd_SchemaCodeGeneration} Simply run the ```usdGenSchema``` command to generate code in the current directory for the schema classes defined in the file named 'schema.usda'. @@ -541,7 +539,7 @@ add them to these files yourself. Various command-line options are available for customizing the code generation process. Run ```usdGenSchema --help``` for more details. -\section Usd_NameSpacedPropertiesInCodeGen Namespaced Properties in Code Generation +## Namespaced Properties in Code Generation {#Usd_NameSpacedPropertiesInCodeGen} usdGenSchema also supports the use of namespaced properties for code generation. For example, float foo:bar will generate UsdMyClass::GetFooBarAttr() and @@ -567,7 +565,7 @@ class MyClass "MyClass" { } \endcode -\section Usd_GlobalSchemaProperties Global Schema Properties +## Global Schema Properties {#Usd_GlobalSchemaProperties} Each schema.usda file can contain a \em GLOBAL section like the following to provide customizations that apply to all the classes in the module: @@ -634,7 +632,7 @@ Here's a short description of each datum in the global customData dictionary: will be camelCased to "namespacePrefixAttrName" irrespective of useLiteralIdentifier being set or not. -\section Codeless_Schemas Codeless Schemas +## Codeless Schemas {#Codeless_Schemas} By default ```usdGenSchema``` generates C++ and Python code, providing appropriate APIs. Clients also have an option of not generating any code by @@ -656,7 +654,7 @@ definitions (args files) using the Sdr library. ```usdgenschemafromsdr``` is the utility which generates schema.usda, generatedSchema.usda and plugInfo.json for the usdRiPxr schema domain. -\section Usd_PerClassProperties Customizing Per-Class Properties +## Customizing Per-Class Properties {#Usd_PerClassProperties} \code class PxHairman "PxHairman" ( @@ -766,7 +764,7 @@ Here's a short description of each datum in the per-class customData dictionary: versions which lack this schema will use to choose a suitable alternative schema type. -\section Usd_CustomizingPerProperty Customizing Per-Property +## Customizing Per-Property {#Usd_CustomizingPerProperty} \code ColorFloat[] primvars:displayColor ( @@ -799,7 +797,7 @@ dictionary: accessor API will be generated for this property, as if the property had set 'apiName' to the empty string. -\section Usd_ExampleSchema Example Schema Classes +## Example Schema Classes {#Usd_ExampleSchema} \code #usda 1.0 @@ -1010,15 +1008,13 @@ class "GridCrittersAPI" ( See \ref Usd_Page_Datatypes for the list of all data types provided by Sdf. -\section Usd_GeneratedSchemaCustomCode Adding Custom Code To Generated Schemas +## Adding Custom Code To Generated Schemas {#Usd_GeneratedSchemaCustomCode} Custom code written after the "// --(BEGIN CUSTOM CODE)--" delimiter in the generated schema files will be preserved between successive usdGenSchema runs. Typically, this will include additional API you may want to provide on your schema classes. -\section Usd_SchemaExtensionPhilosophy Impact on Interchange of Creating and Extending Schemas +## Impact on Interchange of Creating and Extending Schemas {#Usd_SchemaExtensionPhilosophy} Coming soon! - -*/ diff --git a/pxr/usd/usd/doxygen/images/instancing/Instancing_Example.png b/pxr/usd/usd/docs/images/instancing/Instancing_Example.png similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Instancing_Example.png rename to pxr/usd/usd/docs/images/instancing/Instancing_Example.png diff --git a/pxr/usd/usd/doxygen/images/instancing/Instancing_Example.xml b/pxr/usd/usd/docs/images/instancing/Instancing_Example.xml similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Instancing_Example.xml rename to pxr/usd/usd/docs/images/instancing/Instancing_Example.xml diff --git a/pxr/usd/usd/doxygen/images/instancing/Nested_Instancing_Example.png b/pxr/usd/usd/docs/images/instancing/Nested_Instancing_Example.png similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Nested_Instancing_Example.png rename to pxr/usd/usd/docs/images/instancing/Nested_Instancing_Example.png diff --git a/pxr/usd/usd/doxygen/images/instancing/Nested_Instancing_Example.xml b/pxr/usd/usd/docs/images/instancing/Nested_Instancing_Example.xml similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Nested_Instancing_Example.xml rename to pxr/usd/usd/docs/images/instancing/Nested_Instancing_Example.xml diff --git a/pxr/usd/usd/doxygen/images/instancing/Relationship_Example.png b/pxr/usd/usd/docs/images/instancing/Relationship_Example.png similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Relationship_Example.png rename to pxr/usd/usd/docs/images/instancing/Relationship_Example.png diff --git a/pxr/usd/usd/doxygen/images/instancing/Relationship_Example.xml b/pxr/usd/usd/docs/images/instancing/Relationship_Example.xml similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Relationship_Example.xml rename to pxr/usd/usd/docs/images/instancing/Relationship_Example.xml diff --git a/pxr/usd/usd/doxygen/images/instancing/Uninstanced_vs_Instanced.png b/pxr/usd/usd/docs/images/instancing/Uninstanced_vs_Instanced.png similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Uninstanced_vs_Instanced.png rename to pxr/usd/usd/docs/images/instancing/Uninstanced_vs_Instanced.png diff --git a/pxr/usd/usd/doxygen/images/instancing/Uninstanced_vs_Instanced.xml b/pxr/usd/usd/docs/images/instancing/Uninstanced_vs_Instanced.xml similarity index 100% rename from pxr/usd/usd/doxygen/images/instancing/Uninstanced_vs_Instanced.xml rename to pxr/usd/usd/docs/images/instancing/Uninstanced_vs_Instanced.xml diff --git a/pxr/usd/usd/doxygen/instancing.dox b/pxr/usd/usd/docs/instancing.md similarity index 95% rename from pxr/usd/usd/doxygen/instancing.dox rename to pxr/usd/usd/docs/instancing.md index 3fb717acd0..d73be4af13 100644 --- a/pxr/usd/usd/doxygen/instancing.dox +++ b/pxr/usd/usd/docs/instancing.md @@ -1,8 +1,6 @@ -/*! +# Scenegraph Instancing {#Usd_Page_ScenegraphInstancing} -\page Usd_Page_ScenegraphInstancing Scenegraph Instancing - -\section Usd_ScenegraphInstancing_Overview Overview +## Overview {#Usd_ScenegraphInstancing_Overview} USD's instancing functionality allows prims that bring in common scene description via
    composition arcs @@ -35,7 +33,7 @@ provide higher degrees of scalability; the benefits become more and more significant as the number of Car prims increases, or as the number of prims beneath the referenced Car model grows. -\section Usd_ScenegraphInstancing_Instancing Explicit Instances, Implicit Prototypes +## Explicit Instances, Implicit Prototypes {#Usd_ScenegraphInstancing_Instancing} Prims that share parts of the scenegraph through instancing are called "instance" prims. Each of these instance prims are associated with a @@ -138,7 +136,7 @@ run-to-run. Consumers should not save or hard-code the paths to prims in prototypes, but can use the API described below if they need to determine an instance's prototype at runtime. -\section Usd_ScenegraphInstancing_Querying Working with Instancing +## Working with Instancing {#Usd_ScenegraphInstancing_Querying} This section goes into more detail about instance and prototype prims and the API for working with them. The following example will be used throughout: @@ -207,7 +205,7 @@ def "Car" -\subsection Usd_ScenegraphInstancing_Instanceable Making Prims Instanceable +### Making Prims Instanceable {#Usd_ScenegraphInstancing_Instanceable} UsdStage can only create prototype prims for portions of the scenegraph that are brought into a scene via a composition arc. Because of this, @@ -224,7 +222,7 @@ layers. For example, a user could author their "instanceable" metadata in a session layer to see the effects of enabling (or disabling) instancing on prims in a scene without editing that scene directly. -\subsection Usd_ScenegraphInstancing_Instances Classifying Prims with Instancing +### Classifying Prims with Instancing {#Usd_ScenegraphInstancing_Instances} Consumers can check if a UsdPrim is an instance with an associated prototype using the following API. @@ -233,7 +231,7 @@ using the following API. | -------- | ------- | ------- | | UsdPrim::IsInstance | Check if prim is an instance. | Returns true for Car_1 and Car_2 since they are instances, but returns false for Car_3. | -\subsection Usd_ScenegraphInstancing_Prototypes Finding and Traversing Prototypes +### Finding and Traversing Prototypes {#Usd_ScenegraphInstancing_Prototypes} A prototype prim is a special UsdPrim whose sole purpose is to serve as the parent for the scenegraph shared by its associated instance prims. The @@ -308,7 +306,7 @@ False \endcode -\subsection Usd_ScenegraphInstancing_InstanceProxies Traversing Into Instances with Instance Proxies +### Traversing Into Instances with Instance Proxies {#Usd_ScenegraphInstancing_InstanceProxies} An instance proxy is a UsdPrim that represents a descendant prim beneath an instance, even though no such prim actually exists in the scenegraph. Instance @@ -381,7 +379,7 @@ Gf.Matrix4d(...) \endcode -\subsection Usd_ScenegraphInstancing_Editing Editing Instances and Prototypes +### Editing Instances and Prototypes {#Usd_ScenegraphInstancing_Editing} Properties and metadata (e.g., variant selections) on instance prims can be edited and overridden like any other prim. However, properties and metadata @@ -432,7 +430,7 @@ to achieve many of the same effects. For example, a consumer could add inherit or specializes arcs to instances, then make edits to the class targeted by those arcs. Those edits would then affect all of the specified instances. -\subsection Usd_ScenegraphInstancing_TargetsAndConnections Relationship Targets and Attribute Connections +### Relationship Targets and Attribute Connections {#Usd_ScenegraphInstancing_TargetsAndConnections} Relationships and attributes may have authored target and connection paths that point to objects beneath an instance prim. In these cases, the API for @@ -560,9 +558,9 @@ Sdf.Path('/ParkingLot/Car_2/Body.doorRel') [Sdf.Path('/ParkingLot/Car_2/Door')] \endcode -\section Usd_ScenegraphInstancing_Issues Common Issues +## Common Issues {#Usd_ScenegraphInstancing_Issues} -\subsection Usd_ScenegraphInstancing_IssuesSinglePrim Instancing Single Prims +### Instancing Single Prims {#Usd_ScenegraphInstancing_IssuesSinglePrim} Since instancing shares the scenegraph hierarchy beneath instance prims, instancing a single prim that has no descendants provides no benefits. In the @@ -603,9 +601,9 @@ def "Model" } \endcode -\section Usd_ScenegraphInstancing_Advanced Advanced Topics +## Advanced Topics {#Usd_ScenegraphInstancing_Advanced} -\subsection Usd_ScenegraphInstancing_PrototypeSelection How USD Generates Prototype Prims +### How USD Generates Prototype Prims {#Usd_ScenegraphInstancing_PrototypeSelection} To determine the set of prototype prims needed, UsdStage analyzes each prim marked as instanceable and computes an "instancing key" that consists of: @@ -637,7 +635,7 @@ if an instance prim's variant selection is changed, UsdStage will recompute its key and either assign that instance to an already-existing prototype if there are existing instances with the same key, or create a new prototype. -\subsection Usd_ScenegraphInstancing_NestedInstancing Nested Instancing +### Nested Instancing {#Usd_ScenegraphInstancing_NestedInstancing} An instanceable prim may have children that are themselves instanceable. This "nested instancing" allows consumers to build up large aggregate assets from @@ -740,11 +738,9 @@ When \ref Usd_ScenegraphInstancing_InstanceProxies "working with instance proxie nested instancing will be taken into account and resolved as if instancing were not being used on the stage. -\subsection Usd_ScenegraphInstancing_Flattening Flattening +### Flattening {#Usd_ScenegraphInstancing_Flattening} When flattening a UsdStage into a single layer via its various \ref Usd_stageSerialization "serialization methods", each prototype prim in the scenegraph will be written out to specially-named root prim. These prims will be referenced by the flattened instance prims that were associated with that prototype. - -*/ diff --git a/pxr/usd/usd/doxygen/multiThreading.dox b/pxr/usd/usd/docs/multiThreading.md similarity index 85% rename from pxr/usd/usd/doxygen/multiThreading.dox rename to pxr/usd/usd/docs/multiThreading.md index ec9678636e..66b8da390f 100644 --- a/pxr/usd/usd/doxygen/multiThreading.dox +++ b/pxr/usd/usd/docs/multiThreading.md @@ -1,6 +1,4 @@ -/*! - -\page Usd_Page_MultiThreading Threading Model and Performance Considerations +# Threading Model and Performance Considerations {#Usd_Page_MultiThreading} stl threading model : multiple readers *or* a single writer @@ -9,7 +7,7 @@ own exclusive sections for writing to the same stage from multiple threads, what *all* clients get in exchange is a thread-efficient USD core, in which nearly all read access to USD data is lockless. -\section Usd_ThreadSafetyModel Thread-safety Guarantee +## Thread-safety Guarantee {#Usd_ThreadSafetyModel} Any UsdStage-mutating or SdfLayer-mutating operation considered a write. UsdStage::Load() and UsdPrim::Load() (and unload) are considered write @@ -27,6 +25,4 @@ thread, therefore, is mutating C.usd, then **no other thread can mutate A.usd or B.usd** because either would cause simultaneous changes to either stage A or stage B. -\section Usd_InternalMultiThreading Usd's Internal Use of Multi-threading - -*/ \ No newline at end of file +## Usd's Internal Use of Multi-threading {#Usd_InternalMultiThreading} diff --git a/pxr/usd/usd/doxygen/objectModel.dox b/pxr/usd/usd/docs/objectModel.md similarity index 91% rename from pxr/usd/usd/doxygen/objectModel.dox rename to pxr/usd/usd/docs/objectModel.md index 0a8bb3a951..8ba79cb047 100644 --- a/pxr/usd/usd/doxygen/objectModel.dox +++ b/pxr/usd/usd/docs/objectModel.md @@ -1,8 +1,6 @@ -/*! +# Object Model and How the Classes Work Together {#Usd_Page_ObjectModel} -\page Usd_Page_ObjectModel Object Model and How the Classes Work Together - -\section Usd_OM_SdfLayer SdfLayer: Shared Data Files +## SdfLayer: Shared Data Files {#Usd_OM_SdfLayer} An SdfLayer provides the interface to a persistent (in a file) or in-memory only (via "anonymous" layers) container of scene description. The scene @@ -32,7 +30,7 @@ Resolution plugin API to resolve layer identifiers to external (e.g. file) assets. The Ar plugin API lets USD clients provide customized behavior for resolving "asset identifiers" and querying asset metadata. -\section Usd_OM_UsdStage UsdStage: Composed View of an SdfLayer +## UsdStage: Composed View of an SdfLayer {#Usd_OM_UsdStage} As described in its class documentation, a UsdStage is the interface to a specific SdfLayer (known as its \em rootLayer), interpreting the data it @@ -67,7 +65,7 @@ response to mutations of SdfLayer 's that are composed into the stage. Thus, a UsdStage will remain accurate even if one uses the lower-level Sdf API's to mutate layers, rather than the USD object API's. -\subsection Usd_OM_UsdStage_Management UsdStage Lifetime and Management +### UsdStage Lifetime and Management {#Usd_OM_UsdStage_Management} SdfLayer and UsdStage are the only objects in USD whose lifetime matters. SdfLayer is the true data container in USD, and if a layer is destroyed before @@ -92,7 +90,7 @@ be perturbed to pass a UsdStagePtr back and forth. collects, and the cache can be explicitly cleared. -\section Usd_OM_UsdPrim UsdPrim: Nestable Namespace Containers +## UsdPrim: Nestable Namespace Containers {#Usd_OM_UsdPrim} UsdPrim is the primary object used to interact with composed scene description, and has the largest API of any of the core objects. A UsdPrim represents a @@ -132,12 +130,12 @@ possible "prim specifiers" that inform USD of the intended purpose of the data authored for a prim in a particular layer. For a deeper explanation, please see \ref Usd_PrimSpecifiers . -\subsection Usd_OM_UsdPrim_Retention Retaining and Using UsdPrims Safely +### Retaining and Using UsdPrims Safely {#Usd_OM_UsdPrim_Retention} \todo contents/caching, then , etc -\section Usd_OM_UsdProperty UsdProperty: Common Interface for Attributes and Relationships +## UsdProperty: Common Interface for Attributes and Relationships {#Usd_OM_UsdProperty} -\section Usd_OM_UsdAttribute UsdAttribute: Typed, Sampled, Data +## UsdAttribute: Typed, Sampled, Data {#Usd_OM_UsdAttribute} -\subsection Usd_OM_UsdTimeCode Time and Timing in USD +### Time and Timing in USD {#Usd_OM_UsdTimeCode} -\section Usd_OM_UsdRelationship UsdRelationship: Targetting Namespace Objects +## UsdRelationship: Targetting Namespace Objects {#Usd_OM_UsdRelationship} -\section Usd_OM_Metadata General Metadata in USD +## General Metadata in USD {#Usd_OM_Metadata} All of the objects we have described so far, SdfLayer, UsdStage, UsdPrim, and both subclasses of UsdProperty, can possess \em metadata. In USD, metadata @@ -219,7 +217,7 @@ not be changed for extension metadata,* however - all extension metadata will be resolved based on its datatype: strongest wins for primitive datatypes, element-wise strongest wins for dictionaries. -\section Usd_OM_SchemaDefinitionRegistry Schema and Prim Definition Registry +## Schema and Prim Definition Registry {#Usd_OM_SchemaDefinitionRegistry} The singleton class UsdSchemaRegistry exists to provide access to all available schemas. It queries plugins to find all registered schema types and generates @@ -241,7 +239,7 @@ combination of its type name and the list of any applied API schemas applied to the prim and is generally what we are referring to when we talk about a UsdPrim's "prim definition". -\section Usd_OM_FallbackPrimTypes Fallback Prim Types +## Fallback Prim Types {#Usd_OM_FallbackPrimTypes} When you create a new "IsA" schema to use as a prim type, there may be an expectation that stages containing prims of your new type will be opened using @@ -271,8 +269,6 @@ of the first recognized type in the list. \sa UsdPrim::GetPrimTypeInfo, UsdPrim::IsA, UsdSchemaRegistry::GetFallbackPrimTypes -\section Usd_OM_OtherObjects Composition Operator Interfaces: UsdReferences, UsdInherits, UsdVariantSets - -\subsection Usd_OM_ListOps ListOps and List Editing +## Composition Operator Interfaces: UsdReferences, UsdInherits, UsdVariantSets {#Usd_OM_OtherObjects} -*/ +### ListOps and List Editing {#Usd_OM_ListOps} diff --git a/pxr/usd/usd/doxygen/propertiesOfSceneDescription.dox b/pxr/usd/usd/docs/propertiesOfSceneDescription.md similarity index 86% rename from pxr/usd/usd/doxygen/propertiesOfSceneDescription.dox rename to pxr/usd/usd/docs/propertiesOfSceneDescription.md index 7499e7c41e..f3daabdb80 100644 --- a/pxr/usd/usd/doxygen/propertiesOfSceneDescription.dox +++ b/pxr/usd/usd/docs/propertiesOfSceneDescription.md @@ -1,16 +1,14 @@ -/*! +# Important Properties of Scene Description {#Usd_Page_PropertiesOfSceneDescription} -\page Usd_Page_PropertiesOfSceneDescription Important Properties of Scene Description +## Names, Namespace Ordering, and Property Namespaces {#Usd_Ordering} -\section Usd_Ordering Names, Namespace Ordering, and Property Namespaces +## TimeSamples, Defaults, and Value Resolution {#Usd_ValueResolution} -\section Usd_ValueResolution TimeSamples, Defaults, and Value Resolution - -\section Usd_PrimSpecifiers Defs, Overs, Classes, and Prim Types +## Defs, Overs, Classes, and Prim Types {#Usd_PrimSpecifiers} \sa What's the difference between an "over" and a "typeless def"? -\section Usd_ModelHierarchy Model Hierarchy: Meaning and Purpose +## Model Hierarchy: Meaning and Purpose {#Usd_ModelHierarchy} Borrowing from \ref kind_coreKinds, we review the primary \em kinds we use to create the model hierarchy. @@ -49,7 +47,7 @@ UsdPrimRange and UsdStage::Traverse() that will visit all models on a stage, and no "sub-model" prims. UsdPrim::IsModel() and UsdPrim::IsGroup() answer the corresponding questions. -\section Usd_ActiveInactive How "active" Affects Prims on a UsdStage +## How "active" Affects Prims on a UsdStage {#Usd_ActiveInactive} How does one "delete a prim" in USD? Considering that any given UsdPrim on a UsdStage may be comprised of SdfPrimSpec's from numerous layers, and that one @@ -76,8 +74,6 @@ consider the prim to be *deactivated*, which has two important consequences: scene complexity and cost. -\section Usd_Filetypes Text, Binary, and Plugin Filetypes +## Text, Binary, and Plugin Filetypes {#Usd_Filetypes} -\section Usd_AssetResolution Resolving Asset References - -*/ +## Resolving Asset References {#Usd_AssetResolution} diff --git a/pxr/usd/usd/doxygen/utf8Overview.dox b/pxr/usd/usd/docs/utf8Overview.md similarity index 92% rename from pxr/usd/usd/doxygen/utf8Overview.dox rename to pxr/usd/usd/docs/utf8Overview.md index 2f14a19f2d..d235dd84a2 100644 --- a/pxr/usd/usd/doxygen/utf8Overview.dox +++ b/pxr/usd/usd/docs/utf8Overview.md @@ -1,6 +1,6 @@ -/*! \page Usd_Page_UTF_8 Unicode in USD +# Unicode in USD {#Usd_Page_UTF_8} -\section Usd_UTF_8_Overview Overview +## Overview {#Usd_UTF_8_Overview} Text, unless otherwise noted, should be assumed to be UTF-8 encoded. It's erroneous to describe USDA as an "ASCII" file format, as strings, tokens, and @@ -10,7 +10,7 @@ USD 24.03 extends UTF-8 support to path and metadata identifiers. This document aims to help users and developers reason about how to best build and validate UTF-8 content and tooling for USD. -\section Usd_UTF_8_Encoding UTF-8 Encoding +## UTF-8 Encoding {#Usd_UTF_8_Encoding} UTF-8 is a variable length encoding that is backwards compatible with ASCII. Every ASCII character and string is byte-equivalent to its UTF-8 encoded @@ -18,14 +18,14 @@ character and string. Users should think of UTF-8 strings as bytes representing "code points" in the Unicode code charts. A single code point may be represented by 1, 2, 3, or 4 byte sequences. -\subsection Usd_UTF_8_Encoding_Replacement Replacement Code Point +### Replacement Code Point {#Usd_UTF_8_Encoding_Replacement} Not every 1, 2, 3, or 4 byte sequence represents a valid UTF-8 code point. When a byte sequence is invalid and cannot be decoded, USD replaces the sequence with �. Note that USD does not have to decode most strings that pass through it and should not be relied on for validation of content. -\subsection Usd_UTF_8_Encoding_Normalization Normalization +### Normalization {#Usd_UTF_8_Encoding_Normalization} UTF-8 encoded strings may have sequences of code points that describe equivalent text rendered to the user. As an example, the second letter in München can be @@ -48,9 +48,9 @@ normalization so a user does not have to be aware of specific encoding semantics. Strict validators may choose to warn users about siblings that have colliding NFKC normalization representations. -\section Usd_UTF_8_Language_Support Language Support +## Language Support {#Usd_UTF_8_Language_Support} -\subsection Usd_UTF_8_Language_Support_CPP C++ +### C++ {#Usd_UTF_8_Language_Support_CPP} USD assumes that all C++ string types (including tokens, scene paths, and asset paths) are UTF-8 encoded unless otherwise specified. Applications must @@ -62,7 +62,7 @@ documentation and including UTF-8 content in test cases. Tf provides a minimal set of Unicode utilities primarily for its own internal usage and does not aim to be a fully featured Unicode support library. -\subsection Usd_UTF_8_Language_Support_Python Python +### Python {#Usd_UTF_8_Language_Support_Python} Strings as of Python 3.0 are natively Unicode (though not UTF-8 encoded). It provides string operations like `casefold` for case insensitive comparison and a @@ -70,7 +70,7 @@ library unicodedata for some transformations and queries. Utilities in Boost Python and Tf handle string conversion to and from UTF-8 at the USD C++/Python language boundary. -\section Usd_UTF_8_Identifiers Identifiers +## Identifiers {#Usd_UTF_8_Identifiers} Identifiers are used to name prims, properties, and metadata fields. The Unicode specification provides two classes of code points, XID_Start and XID_Continue @@ -82,7 +82,7 @@ SdfPath::IsValidNamespacedIdentifier. TfIsValidIdentifier and TfMakeValidIdentifier should generally not be used to validate and produce prim or path identifiers. -\section Usd_UTF_8_Operation_Reference Operation Quick Reference +## Operation Quick Reference {#Usd_UTF_8_Operation_Reference} This table lists common string operations and how to reason about them within USD's UTF-8 support. @@ -100,7 +100,7 @@ Concatenation | Concatenation of two valid UTF-8 strings is still a val Length | In C++, a string's length is its number of bytes, not the number of code points. The number of code points can be computed by taking the distance between a TfUtf8CodePointView's begin and end. In Python, `len` will count code points. Path identifier validation | Do not use TfIsValidIdentifier as it will reject UTF-8 characters. Use SdfPath::IsValidIdentifier, SdfPath::IsValidNamespacedIdentifier, SdfSchemaBase::IsValidVariantIdentifier, and SdfSchemaBase::IsValidVariantSelection. -\section Usd_UTF_8_Encoding_Reference Encoding Quick Reference +## Encoding Quick Reference {#Usd_UTF_8_Encoding_Reference} This table records the encoding representations and rules for USD content. Strict validators can use the best practices to warn users about @@ -121,10 +121,8 @@ non-conforming content. | file format extension (Sdf) | UTF-8. Only ASCII characters are casefolded for equivalence / dispatch. | Prefer casefolded | | resolver scheme (Ar) | URI specification. Starts with a single ASCII letter, followed by any ASCII alphanumeric, `-`, `+`, and `.`. Casefolded for equivalence and dispatch. | Prefer casefolded | -\section Usd_UTF_8_Additional_Resources Additional Resources +## Additional Resources {#Usd_UTF_8_Additional_Resources} - [Unicode Identifiers in USD proposal](https://github.com/PixarAnimationStudios/OpenUSD-proposals/tree/main/proposals/tf_utf8_identifiers) - [Unicode Standard v15.0 (PDF)](https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf) - [Unicode Identifiers and Syntax](https://www.unicode.org/reports/tr31/) - -*/ \ No newline at end of file diff --git a/pxr/usd/usd/doxygen/valueClips.dox b/pxr/usd/usd/docs/valueClips.md similarity index 95% rename from pxr/usd/usd/doxygen/valueClips.dox rename to pxr/usd/usd/docs/valueClips.md index a43f7ef3cf..38f8441f1f 100644 --- a/pxr/usd/usd/doxygen/valueClips.dox +++ b/pxr/usd/usd/docs/valueClips.md @@ -1,8 +1,6 @@ -/*! +# Sequencable, Re-timable Animated "Value Clips" {#Usd_Page_ValueClips} -\page Usd_Page_ValueClips Sequencable, Re-timable Animated "Value Clips" - -\section Usd_ValueClips_Overview Overview +## Overview {#Usd_ValueClips_Overview} USD's composition arcs allow timeSampled animation to be assembled from a variety of sources into @@ -33,7 +31,7 @@ indicating: - the intervals over which each clip is active - how "stage time" maps into each clip -\section Usd_ValueClips_Terminology Terminology +## Terminology {#Usd_ValueClips_Terminology} Before going further, let's establish some terminology: @@ -57,7 +55,7 @@ Before going further, let's establish some terminology: given clip set. This determines the strength of clips with respect to value resolution, see \ref Usd_ValueClips_ClipValueResolution for details. -\section Usd_ValueClips_ClipSets Clip Sets +## Clip Sets {#Usd_ValueClips_ClipSets} A "clip set" is a named group of value clips. The set of value clips along with sequencing and timing information and other value resolution @@ -103,7 +101,7 @@ Users can specify the clip set to author to when using the UsdClipsAPI schema to author clip metadata. If no clip set is specified, UsdClipsAPI will author to a clip set named "default". -\subsection Usd_ValueClips_ClipSetOrdering Strength Ordering +### Strength Ordering {#Usd_ValueClips_ClipSetOrdering} Clip sets authored on multiple prims are ordered by distance from the attribute. Clip sets authored on an attribute's owning prim are @@ -115,7 +113,7 @@ name. However, users can control the strength ordering or even remove a clip set from consideration by specifying the ordering/membership in the \em clipSets list-op metadata field via \ref UsdClipsAPI::SetClipSets. -\section Usd_ValueClips_Metadata Clip Set Definitions +## Clip Set Definitions {#Usd_ValueClips_Metadata} Clip sets may be defined using one of two possible forms: \em template and \em explicit metadata. Explicit metadata @@ -222,7 +220,7 @@ USD provides schema level support for authoring this metadata via \ref UsdClipsA This gives a typesafe way to interact with the relevant metadata as well as various helper functions. -\subsection Usd_ValueClips_Metadata_TemplateClips Template Clip Metadata +### Template Clip Metadata {#Usd_ValueClips_Metadata_TemplateClips} If a clip set is defined using template clip metadata, USD will use that data to derive the explicit clip metadata with the following logic: @@ -240,7 +238,7 @@ to derive the explicit clip metadata with the following logic: applied to the \em times and \em active derivation as described in the previous section. -\section Usd_ValueClips_ActiveClips Active Clips +## Active Clips {#Usd_ValueClips_ActiveClips} The entries in the \em active metadata determine when a particular clip is active. Value resolution will retrieve values from the active clip at a given @@ -262,7 +260,7 @@ Clip "foo.usd" is considered active in the time range [-inf, 105), "bar.usd" is active in the time range [105, 110), and baz.usd is active in the time range [110, +inf). -\section Usd_ValueClips_TimeMapping Stage Times and Clip Times +## Stage Times and Clip Times {#Usd_ValueClips_TimeMapping} Conceptually, the (stageTime, clipTime) entries in the \em times metadata define a timing curve that specifies the time in the active clip to retrieve @@ -287,7 +285,7 @@ value authored at time 8 in the active clip. The \em times metadata can be used to offset and scale animation from clips, providing flexibility in how they are applied to the stage. -\subsection Usd_ValueClips_Discontinuities Jump Discontinuities +### Jump Discontinuities {#Usd_ValueClips_Discontinuities} Jump discontinuities in the timing curve can be represented in the \em times metadata by authoring two entries with the same stage time, but different @@ -313,7 +311,7 @@ the second clip at times [25, 35]. See \ref Usd_ValueClips_ClipBehaviorsLooping for a common use-case for this functionality. -\subsection Usd_ValueClips_TimeOrdering Ordering +### Ordering {#Usd_ValueClips_TimeOrdering} A given stageTime may appear at most twice in the \em times metadata. In the typical case, a stageTime will only appear once; the only time it may appear @@ -325,7 +323,7 @@ authored in \em times does not matter, except for jump discontinuities: the left-most entry with a given stageTime represents the left side of the discontinuity and the right-most entry represents the right side. -\section Usd_ValueClips_ClipManifest Clip Manifest +## Clip Manifest {#Usd_ValueClips_ClipManifest} The clip manifest is a \ref SdfLayer "layer" that declares the attributes that have time samples in the value clips for the associated clip set. @@ -341,7 +339,7 @@ Each clip set has one manifest which may be specified via the generate one automatically at runtime. See \ref Usd_ValueClips_GeneratingManifest for more details. -\subsection Usd_ValueClips_ManifestFormat What Data Is In a Manifest? +### What Data Is In a Manifest? {#Usd_ValueClips_ManifestFormat} In its simplest form, the clip manifest just contains declarations for attributes. For example, @@ -419,7 +417,7 @@ are ignored. Attributes in the manifest may have default values or time samples containing value blocks. See \ref Usd_ValueClips_ClipValueResolution for how these values may be used. -\subsection Usd_ValueClips_GeneratingManifest Generating a Manifest +### Generating a Manifest {#Usd_ValueClips_GeneratingManifest} The Usd and Sdf authoring APIs can be used to manually create a manifest. For convenience, clients can use \ref UsdClipsAPI::GenerateClipManifest or @@ -434,7 +432,7 @@ use the UsdClipsAPI methods above to generate a clip manifest, save it out, and then set that as the clip set's manifest via \ref UsdClipsAPI::SetManifestAssetPath. -\section Usd_ValueClips_ClipValueResolution Value Resolution Semantics +## Value Resolution Semantics {#Usd_ValueClips_ClipValueResolution} A clip set may provide values for attributes on the prim on which the clip set is defined and any attributes on descendants of that prim. It is @@ -485,7 +483,7 @@ owning prim or any ancestors, USD will do the following: the behavior when the active clip does not have any authored time samples. -\subsection Usd_ValueClips_ClipValueResolution_Gaps Missing Values in Clip Set +### Missing Values in Clip Set {#Usd_ValueClips_ClipValueResolution_Gaps} A clip set has "gaps" if some of the value clips in the set do not contain authored time samples for an attribute that has been declared in the manifest. @@ -591,7 +589,7 @@ def "TestModel" ( -\subsection Usd_ValueClips_ClipValueResolution_InterpolatingGaps Interpolating Missing Values in Clip Set +### Interpolating Missing Values in Clip Set {#Usd_ValueClips_ClipValueResolution_InterpolatingGaps} The above behavior allows USD to avoid opening an arbitrary number of clips if a gap is encountered in the clip set and can be useful in some situations. For @@ -706,7 +704,7 @@ def "TestModel" ( -\subsection Usd_ValueClips_ClipValueResolution_LayerOffsets Layer Offsets +### Layer Offsets {#Usd_ValueClips_ClipValueResolution_LayerOffsets} Layer offsets affect value clips in the following ways: @@ -721,13 +719,13 @@ Layer offsets affect value clips in the following ways: to the strongest layer in which they were authored. Note that this layer may be different from the \ref Usd_ValueClips_AnchorPoint "anchor point". -\section Usd_ValueClips_AdditionalNotes Additional Notes +## Additional Notes {#Usd_ValueClips_AdditionalNotes} The flexibility and reuse of animated data that clips provides does come with some performance characteristics with which pipeline builders may want to be familiar. -\subsection Usd_ValueClips_ClipDeferredLoading Clip Layers Opened On-Demand +### Clip Layers Opened On-Demand {#Usd_ValueClips_ClipDeferredLoading} In Pixar use of clips, it is not uncommon for a single UsdStage to consume thousands to tens of thousands of clip layers. If the act of opening a stage @@ -752,7 +750,7 @@ clients (renderers) are generally unaffected, and the applications that do want to stream through time generally prioritize highest performance over memory consumption, we are satisfied with the caching strategy for now. -\subsection Usd_ValueClips_Flattening Flattening +### Flattening {#Usd_ValueClips_Flattening} Flattening a UsdStage with value clips will merge the appropriate time samples from the value clips into the time samples on the attribute on @@ -760,7 +758,7 @@ the flattened stage and remove the clip set definitions. Querying for time samples and values on the flattened stage should always give the same result as on the unflattened stage. -\subsection Usd_ValueClips_usdview usdview +### usdview {#Usd_ValueClips_usdview} - Usdview supports value clip debugging through the layer stack viewer(lower left). When a particular attribute(who's value is held in a clip layer) is highlighted, @@ -769,7 +767,7 @@ the layer stack viewer will show which clip the value is coming from. - The metadata tab will display the value of each piece of metadata authored on the prim introducing clips. -\subsection Usd_ValueClips_usdstitchclips usdstitchclips +### usdstitchclips {#Usd_ValueClips_usdstitchclips} The usdstitchclips utility will generate a stage that uses value clips to stitch together the time samples in a given set of clip layers. This @@ -873,14 +871,14 @@ def "World" } \endcode -\subsection Usd_ValueClips_UsdUtils UsdUtils Utility Functions +### UsdUtils Utility Functions {#Usd_ValueClips_UsdUtils} The UsdUtils library contains several utility functions for stitching together multiple layers using value clips in usdUtils/stitchClips.h. -\section Usd_ValueClips_Examples Examples +## Examples {#Usd_ValueClips_Examples} -\subsection Usd_ValueClips_ClipBehaviorsLooping Looping +### Looping {#Usd_ValueClips_ClipBehaviorsLooping} A common use case is to loop over animation authored in a clip or set of clips. For example, at Pixar clips containing a handful of frames of keep-alive @@ -931,7 +929,7 @@ additional asset loads or restructuring needed to happen. \warning Note that this supposes that the final frame and the first frame of the clip transitions smoothly. -\subsection Usd_ValueClips_AnimatedVisibility Animated Visibility +### Animated Visibility {#Usd_ValueClips_AnimatedVisibility} Value clips are used at Pixar to stitch together the results of simulators or procedural generation tools like Houdini that are run in parallel for @@ -953,5 +951,3 @@ attribute making the prim visible at that time. If they do not write out geometry, they don't write out the "visibility" attribute. This makes value resolution use the "invisible" value for "visibility" at times when the clips have no geometry. - -*/ diff --git a/pxr/usd/usd/doxygen/authoringEditing.dox b/pxr/usd/usd/doxygen/authoringEditing.dox deleted file mode 100644 index 9afcfbd5e8..0000000000 --- a/pxr/usd/usd/doxygen/authoringEditing.dox +++ /dev/null @@ -1,12 +0,0 @@ -/*! - -\page Usd_Page_AuthoringEditing Authoring and Editing Scene Description - -\section Usd_SelectiveEditing Specifying Where Edits Should Go - -\section Usd_Notification Client Safety and Response to Edits - -See the section on \ref Usd_BoolReturns for how to ensure retained Usd objects -are still valid for use. - -*/ \ No newline at end of file From d14bd58e3007b4dea93dcec98e2f3c187467c7e3 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Thu, 8 Aug 2024 16:18:10 -0700 Subject: [PATCH 025/202] missing HdTask docs in opensrc build (Internal change: 2336113) --- pxr/imaging/hd/task.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pxr/imaging/hd/task.h b/pxr/imaging/hd/task.h index f03def45d0..07b5c10ae6 100644 --- a/pxr/imaging/hd/task.h +++ b/pxr/imaging/hd/task.h @@ -34,6 +34,12 @@ using HdTaskSharedPtrVector = std::vector; using HdTaskContext = std::unordered_map; +/// \class HdTask +/// +/// HdTask represents a unit of work to perform during a Hydra render. +/// Developers can subclass HdTask to prepare resources, run 3d renderpasses, +/// run 2d renderpasses such as compositing or color correction, or coordinate +/// integration with the application or other renderers. class HdTask { public: /// Construct a new task. From 64f3412ff9992912ec5db1c9774f014f1d3c269a Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Fri, 9 Aug 2024 20:31:17 -0700 Subject: [PATCH 026/202] Move TimeSamples field from the SDF Property to SDF Attribute schema (Internal change: 2336150) --- .../usdDancingCubesExample/dataImpl.cpp | 2 +- pxr/usd/sdf/attributeSpec.cpp | 6 + pxr/usd/sdf/attributeSpec.h | 4 + pxr/usd/sdf/fileIO_Common.h | 9 - pxr/usd/sdf/layer.cpp | 11 +- pxr/usd/sdf/propertySpec.h | 3 + pxr/usd/sdf/schema.cpp | 2 +- .../183_time_samples.sdf | 5 - .../185_namespaced_properties.sdf | 4 - .../baseline/183_time_samples.sdf | 5 - .../baseline/185_namespaced_properties.sdf | 5 - pxr/usd/sdf/textFileFormat.tab.cpp | 1544 ++++++++--------- pxr/usd/sdf/textFileFormat.yy | 13 - 13 files changed, 773 insertions(+), 840 deletions(-) diff --git a/extras/usd/examples/usdDancingCubesExample/dataImpl.cpp b/extras/usd/examples/usdDancingCubesExample/dataImpl.cpp index 14625acc89..219e810ce5 100644 --- a/extras/usd/examples/usdDancingCubesExample/dataImpl.cpp +++ b/extras/usd/examples/usdDancingCubesExample/dataImpl.cpp @@ -247,7 +247,7 @@ UsdDancingCubesExample_DataImpl::List(const SdfPath &path) const const _LeafPrimPropertyInfo *propInfo = TfMapLookupPtr(*_LeafPrimProperties, path.GetNameToken()); if (propInfo &&_leafPrimDataMap.count(path.GetAbsoluteRootOrPrimPath())) { - // Include time sample field in the property is animated. + // Include time sample field if the property is animated. if (propInfo->isAnimated) { static std::vector animPropFields( {SdfFieldKeys->TypeName, diff --git a/pxr/usd/sdf/attributeSpec.cpp b/pxr/usd/sdf/attributeSpec.cpp index 85c27c4310..e298f76d53 100644 --- a/pxr/usd/sdf/attributeSpec.cpp +++ b/pxr/usd/sdf/attributeSpec.cpp @@ -147,6 +147,12 @@ SdfAttributeSpec::ClearConnectionPaths() // Attribute Value API +SdfTimeSampleMap +SdfAttributeSpec::GetTimeSampleMap() const +{ + return GetFieldAs(SdfFieldKeys->TimeSamples); +} + SDF_DEFINE_GET_SET_HAS_CLEAR(AllowedTokens, SdfFieldKeys->AllowedTokens, VtTokenArray) SDF_DEFINE_GET_SET_HAS_CLEAR(ColorSpace, SdfFieldKeys->ColorSpace, TfToken) diff --git a/pxr/usd/sdf/attributeSpec.h b/pxr/usd/sdf/attributeSpec.h index d34d22cf7d..522b8c06f1 100644 --- a/pxr/usd/sdf/attributeSpec.h +++ b/pxr/usd/sdf/attributeSpec.h @@ -83,6 +83,10 @@ class SdfAttributeSpec : public SdfPropertySpec /// \name Attribute value API /// @{ + /// Returns the entire set of time samples. + SDF_API + SdfTimeSampleMap GetTimeSampleMap() const; + /// Returns the allowed tokens metadata for this attribute. /// Consumers may use this metadata to define a set of predefined /// options for this attribute's value. However, this metadata is diff --git a/pxr/usd/sdf/fileIO_Common.h b/pxr/usd/sdf/fileIO_Common.h index 6f91de89d5..75dadfc5ab 100644 --- a/pxr/usd/sdf/fileIO_Common.h +++ b/pxr/usd/sdf/fileIO_Common.h @@ -980,7 +980,6 @@ Sdf_WriteRelationship( bool hasComment = !rel.GetComment().empty(); bool hasTargets = rel.HasField(SdfFieldKeys->TargetPaths); bool hasDefaultValue = rel.HasField(SdfFieldKeys->Default); - bool hasTimeSamples = rel.HasField(SdfFieldKeys->TimeSamples); bool hasCustom = rel.IsCustom(); @@ -1132,14 +1131,6 @@ Sdf_WriteRelationship( } } - if (hasTimeSamples) { - Sdf_FileIOUtility::Write(out, indent, "%srel %s.timeSamples = {\n", - varyingStr.c_str(), - rel.GetName().c_str()); - Sdf_FileIOUtility::WriteTimeSamples(out, indent, rel); - Sdf_FileIOUtility::Puts(out, indent, "}\n"); - } - // Write out the default value for the relationship if we have one... if (hasDefaultValue) { diff --git a/pxr/usd/sdf/layer.cpp b/pxr/usd/sdf/layer.cpp index 8977eb5e33..1de5a2303d 100644 --- a/pxr/usd/sdf/layer.cpp +++ b/pxr/usd/sdf/layer.cpp @@ -1248,21 +1248,16 @@ _GetExpectedTimeSampleValueType( "not exist", path.GetText()); return TfType(); } - else if (specType != SdfSpecTypeAttribute && - specType != SdfSpecTypeRelationship) { + else if (specType != SdfSpecTypeAttribute) { TF_CODING_ERROR("Cannot set time sample at <%s> because spec " - "is not an attribute or relationship", + "is not an attribute", path.GetText()); return TfType(); } TfType valueType; TfToken valueTypeName; - if (specType == SdfSpecTypeRelationship) { - static const TfType pathType = TfType::Find(); - valueType = pathType; - } - else if (layer.HasField(path, SdfFieldKeys->TypeName, &valueTypeName)) { + if (layer.HasField(path, SdfFieldKeys->TypeName, &valueTypeName)) { valueType = layer.GetSchema().FindType(valueTypeName).GetType(); } diff --git a/pxr/usd/sdf/propertySpec.h b/pxr/usd/sdf/propertySpec.h index cee3948d93..8fa6f18d59 100644 --- a/pxr/usd/sdf/propertySpec.h +++ b/pxr/usd/sdf/propertySpec.h @@ -250,6 +250,9 @@ class SdfPropertySpec : public SdfSpec /// @{ /// Returns the entire set of time samples. + /// + /// \deprecated + /// Use SdfAttributeSpec::GetTimeSampleMap instead. SDF_API SdfTimeSampleMap GetTimeSampleMap() const; diff --git a/pxr/usd/sdf/schema.cpp b/pxr/usd/sdf/schema.cpp index e4157d1272..eb4b4d0a83 100644 --- a/pxr/usd/sdf/schema.cpp +++ b/pxr/usd/sdf/schema.cpp @@ -921,7 +921,6 @@ SdfSchemaBase::_RegisterStandardFields() .Field(SdfFieldKeys->Comment) .Field(SdfFieldKeys->Default) - .Field(SdfFieldKeys->TimeSamples) .MetadataField(SdfFieldKeys->AssetInfo, SdfMetadataDisplayGroupTokens->core) @@ -957,6 +956,7 @@ SdfSchemaBase::_RegisterStandardFields() .Field(SdfChildrenKeys->ConnectionChildren) .Field(SdfFieldKeys->ConnectionPaths) .Field(SdfFieldKeys->DisplayUnit) + .Field(SdfFieldKeys->TimeSamples) .MetadataField(SdfFieldKeys->AllowedTokens, SdfMetadataDisplayGroupTokens->core) diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/183_time_samples.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/183_time_samples.sdf index f243be9759..b54468421f 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/183_time_samples.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/183_time_samples.sdf @@ -23,9 +23,4 @@ def GprimSphere "Sphere" 3: None, } varying rel constraint - varying rel constraint.timeSamples = { - 1: , - 10: , - 20: None, - } } diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/185_namespaced_properties.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/185_namespaced_properties.sdf index f1f60791e5..82a6c042ae 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/185_namespaced_properties.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/185_namespaced_properties.sdf @@ -23,10 +23,6 @@ def Scope "Prim" 2: 4, } rel argle:bargle = - rel a:b:c.timeSamples = { - 1: , - 2: , - } delete varying rel a:b:d = add varying rel a:b:d = [ , diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/183_time_samples.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/183_time_samples.sdf index ecf2dacd43..300b49ba97 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/183_time_samples.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/183_time_samples.sdf @@ -3,11 +3,6 @@ def GprimSphere "Sphere" { varying rel constraint - varying rel constraint.timeSamples = { - 1: , - 10: , - 20: None, - } string desc.timeSamples = { 1.23: "foo", 3.23: "bar", diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/185_namespaced_properties.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/185_namespaced_properties.sdf index 18d08c6c4b..8a3d3ce195 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/185_namespaced_properties.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/185_namespaced_properties.sdf @@ -9,11 +9,6 @@ def Scope "Prim" { reorder properties = ["bar:baz", "foo:baz", "foo:argle", "bar:argle"] - rel a:b:c - rel a:b:c.timeSamples = { - 1: , - 2: , - } delete varying rel a:b:d = add varying rel a:b:d = [ , diff --git a/pxr/usd/sdf/textFileFormat.tab.cpp b/pxr/usd/sdf/textFileFormat.tab.cpp index 0e402ae102..6d56b98529 100644 --- a/pxr/usd/sdf/textFileFormat.tab.cpp +++ b/pxr/usd/sdf/textFileFormat.tab.cpp @@ -1774,16 +1774,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1103 +#define YYLAST 1045 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 82 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 240 +#define YYNNTS 238 /* YYNRULES -- Number of rules. */ -#define YYNRULES 533 +#define YYNRULES 530 /* YYNRULES -- Number of states. */ -#define YYNSTATES 958 +#define YYNSTATES 953 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -1880,15 +1880,15 @@ static const yytype_uint16 yyprhs[] = 1295, 1296, 1299, 1301, 1305, 1309, 1311, 1313, 1315, 1317, 1319, 1321, 1323, 1325, 1328, 1330, 1332, 1334, 1336, 1338, 1339, 1344, 1348, 1350, 1354, 1356, 1358, 1360, 1361, 1366, - 1370, 1372, 1376, 1378, 1380, 1382, 1385, 1389, 1392, 1393, - 1401, 1408, 1409, 1415, 1416, 1422, 1423, 1429, 1430, 1436, - 1437, 1443, 1444, 1450, 1456, 1458, 1460, 1461, 1465, 1471, - 1473, 1477, 1479, 1481, 1483, 1485, 1486, 1491, 1492, 1498, - 1499, 1505, 1506, 1512, 1513, 1519, 1520, 1526, 1530, 1534, - 1538, 1541, 1542, 1545, 1547, 1549, 1553, 1559, 1561, 1565, - 1567, 1568, 1570, 1572, 1574, 1576, 1578, 1580, 1582, 1584, - 1586, 1588, 1590, 1592, 1593, 1595, 1598, 1600, 1602, 1604, - 1607, 1608, 1610, 1612 + 1370, 1372, 1376, 1378, 1380, 1382, 1385, 1389, 1392, 1399, + 1400, 1406, 1407, 1413, 1414, 1420, 1421, 1427, 1428, 1434, + 1435, 1441, 1447, 1449, 1450, 1454, 1460, 1462, 1466, 1468, + 1470, 1472, 1474, 1475, 1480, 1481, 1487, 1488, 1494, 1495, + 1501, 1502, 1508, 1509, 1515, 1519, 1523, 1527, 1530, 1531, + 1534, 1536, 1538, 1542, 1548, 1550, 1554, 1556, 1557, 1559, + 1561, 1563, 1565, 1567, 1569, 1571, 1573, 1575, 1577, 1579, + 1581, 1582, 1584, 1587, 1589, 1591, 1593, 1596, 1597, 1599, + 1601 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -1906,33 +1906,33 @@ static const yytype_int16 yyrhs[] = -1, 56, -1, 57, -1, 58, -1, 59, -1, 60, -1, 61, -1, 62, -1, 63, -1, 64, -1, 65, -1, 66, -1, 67, -1, 68, -1, 69, -1, 88, - -1, 88, 106, 320, -1, -1, 4, 87, 85, -1, - 320, -1, 320, 70, 89, 71, 320, -1, 320, -1, - 320, 90, 316, -1, 92, -1, 90, 317, 92, -1, - 314, -1, 12, -1, -1, 91, 93, 72, 271, -1, - -1, 25, 314, 94, 72, 270, -1, -1, 14, 314, - 95, 72, 270, -1, -1, 47, 314, 96, 72, 270, - -1, -1, 15, 314, 97, 72, 270, -1, -1, 53, - 314, 98, 72, 270, -1, 28, 72, 12, -1, 50, - 72, 172, -1, 61, 72, 99, -1, 73, 320, 74, - -1, 73, 320, 100, 318, 74, -1, 101, -1, 100, - 319, 101, -1, 102, 103, -1, 6, -1, -1, 70, - 104, 316, 71, -1, 105, -1, 104, 317, 105, -1, + -1, 88, 106, 318, -1, -1, 4, 87, 85, -1, + 318, -1, 318, 70, 89, 71, 318, -1, 318, -1, + 318, 90, 314, -1, 92, -1, 90, 315, 92, -1, + 312, -1, 12, -1, -1, 91, 93, 72, 271, -1, + -1, 25, 312, 94, 72, 270, -1, -1, 14, 312, + 95, 72, 270, -1, -1, 47, 312, 96, 72, 270, + -1, -1, 15, 312, 97, 72, 270, -1, -1, 53, + 312, 98, 72, 270, -1, 28, 72, 12, -1, 50, + 72, 172, -1, 61, 72, 99, -1, 73, 318, 74, + -1, 73, 318, 100, 316, 74, -1, 101, -1, 100, + 317, 101, -1, 102, 103, -1, 6, -1, -1, 70, + 104, 314, 71, -1, 105, -1, 104, 315, 105, -1, 38, 72, 11, -1, 57, 72, 11, -1, 107, -1, - 106, 321, 107, -1, -1, 23, 108, 115, -1, -1, + 106, 319, 107, -1, -1, 23, 108, 115, -1, -1, 23, 114, 109, 115, -1, -1, 17, 110, 115, -1, -1, 17, 114, 111, 115, -1, -1, 40, 112, 115, -1, -1, 40, 114, 113, 115, -1, 53, 54, 72, - 176, -1, 314, -1, 114, 75, 314, -1, -1, 12, - 116, 117, 76, 179, 77, -1, 320, -1, 320, 70, - 118, 71, 320, -1, 320, -1, 320, 119, 316, -1, - 121, -1, 119, 317, 121, -1, 314, -1, 22, -1, + 176, -1, 312, -1, 114, 75, 312, -1, -1, 12, + 116, 117, 76, 179, 77, -1, 318, -1, 318, 70, + 118, 71, 318, -1, 318, -1, 318, 119, 314, -1, + 121, -1, 119, 315, 121, -1, 312, -1, 22, -1, 62, -1, 12, -1, -1, 120, 122, 72, 271, -1, - -1, 25, 314, 123, 72, 270, -1, -1, 14, 314, - 124, 72, 270, -1, -1, 47, 314, 125, 72, 270, - -1, -1, 15, 314, 126, 72, 270, -1, -1, 53, - 314, 127, 72, 270, -1, 28, 72, 12, -1, 32, - 72, 12, -1, 41, 72, 314, -1, -1, 44, 128, + -1, 25, 312, 123, 72, 270, -1, -1, 14, 312, + 124, 72, 270, -1, -1, 47, 312, 125, 72, 270, + -1, -1, 15, 312, 126, 72, 270, -1, -1, 53, + 312, 127, 72, 270, -1, 28, 72, 12, -1, 32, + 72, 12, -1, 41, 72, 312, -1, -1, 44, 128, 72, 152, -1, -1, 25, 44, 129, 72, 152, -1, -1, 14, 44, 130, 72, 152, -1, -1, 47, 44, 131, 72, 152, -1, -1, 15, 44, 132, 72, 152, @@ -1953,51 +1953,51 @@ static const yytype_int16 yyrhs[] = 72, 176, -1, 25, 68, 72, 176, -1, 14, 68, 72, 176, -1, 47, 68, 72, 176, -1, 15, 68, 72, 176, -1, 53, 68, 72, 176, -1, 63, 72, - 314, -1, 63, 72, -1, 45, 72, 265, -1, 46, - 72, 265, -1, 36, -1, 154, -1, 73, 320, 74, - -1, 73, 320, 153, 318, 74, -1, 154, -1, 153, - 319, 154, -1, 102, 309, 156, -1, -1, 7, 155, - 156, -1, -1, 70, 320, 71, -1, 70, 320, 157, - 316, 71, -1, 158, -1, 157, 317, 158, -1, 105, - -1, 36, -1, 161, -1, 73, 320, 74, -1, 73, - 320, 160, 318, 74, -1, 161, -1, 160, 319, 161, - -1, 102, 309, 163, -1, -1, 7, 162, 163, -1, - -1, 70, 320, 71, -1, 70, 320, 164, 316, 71, - -1, 165, -1, 164, 317, 165, -1, 105, -1, 22, - 72, 256, -1, 36, -1, 168, -1, 73, 320, 74, - -1, 73, 320, 167, 318, 74, -1, 168, -1, 167, - 319, 168, -1, 310, -1, 36, -1, 171, -1, 73, - 320, 74, -1, 73, 320, 170, 318, 74, -1, 171, - -1, 170, 319, 171, -1, 310, -1, 76, 320, 173, - 77, -1, -1, 174, 318, -1, 175, -1, 174, 319, - 175, -1, 7, 78, 7, -1, 178, -1, 73, 320, - 177, 318, 74, -1, 178, -1, 177, 319, 178, -1, - 12, -1, 320, -1, 320, 180, -1, 181, -1, 180, - 181, -1, 189, 317, -1, 187, 317, -1, 188, 317, - -1, 107, 321, -1, 182, 321, -1, -1, 67, 12, - 183, 72, 320, 76, 320, 184, 77, -1, 185, -1, + 312, -1, 63, 72, -1, 45, 72, 265, -1, 46, + 72, 265, -1, 36, -1, 154, -1, 73, 318, 74, + -1, 73, 318, 153, 316, 74, -1, 154, -1, 153, + 317, 154, -1, 102, 307, 156, -1, -1, 7, 155, + 156, -1, -1, 70, 318, 71, -1, 70, 318, 157, + 314, 71, -1, 158, -1, 157, 315, 158, -1, 105, + -1, 36, -1, 161, -1, 73, 318, 74, -1, 73, + 318, 160, 316, 74, -1, 161, -1, 160, 317, 161, + -1, 102, 307, 163, -1, -1, 7, 162, 163, -1, + -1, 70, 318, 71, -1, 70, 318, 164, 314, 71, + -1, 165, -1, 164, 315, 165, -1, 105, -1, 22, + 72, 256, -1, 36, -1, 168, -1, 73, 318, 74, + -1, 73, 318, 167, 316, 74, -1, 168, -1, 167, + 317, 168, -1, 308, -1, 36, -1, 171, -1, 73, + 318, 74, -1, 73, 318, 170, 316, 74, -1, 171, + -1, 170, 317, 171, -1, 308, -1, 76, 318, 173, + 77, -1, -1, 174, 316, -1, 175, -1, 174, 317, + 175, -1, 7, 78, 7, -1, 178, -1, 73, 318, + 177, 316, 74, -1, 178, -1, 177, 317, 178, -1, + 12, -1, 318, -1, 318, 180, -1, 181, -1, 180, + 181, -1, 189, 315, -1, 187, 315, -1, 188, 315, + -1, 107, 319, -1, 182, 319, -1, -1, 67, 12, + 183, 72, 318, 76, 318, 184, 77, -1, 185, -1, 184, 185, -1, -1, 12, 186, 117, 76, 179, 77, - 320, -1, 53, 35, 72, 176, -1, 53, 48, 72, - 176, -1, 211, -1, 288, -1, 65, -1, 18, -1, - 190, -1, 314, -1, 314, 73, 74, -1, 192, -1, - 191, 192, -1, -1, -1, 193, 313, 195, 254, 196, - 244, -1, -1, -1, 21, 193, 313, 198, 254, 199, - 244, -1, -1, 193, 313, 75, 19, 72, 201, 212, - -1, -1, 14, 193, 313, 75, 19, 72, 202, 212, - -1, -1, 47, 193, 313, 75, 19, 72, 203, 212, - -1, -1, 15, 193, 313, 75, 19, 72, 204, 212, - -1, -1, 25, 193, 313, 75, 19, 72, 205, 212, - -1, -1, 53, 193, 313, 75, 19, 72, 206, 212, - -1, -1, 193, 313, 75, 64, 72, 208, 215, -1, - -1, 193, 313, 75, 60, 72, 210, 221, -1, 197, + 318, -1, 53, 35, 72, 176, -1, 53, 48, 72, + 176, -1, 211, -1, 286, -1, 65, -1, 18, -1, + 190, -1, 312, -1, 312, 73, 74, -1, 192, -1, + 191, 192, -1, -1, -1, 193, 311, 195, 254, 196, + 244, -1, -1, -1, 21, 193, 311, 198, 254, 199, + 244, -1, -1, 193, 311, 75, 19, 72, 201, 212, + -1, -1, 14, 193, 311, 75, 19, 72, 202, 212, + -1, -1, 47, 193, 311, 75, 19, 72, 203, 212, + -1, -1, 15, 193, 311, 75, 19, 72, 204, 212, + -1, -1, 25, 193, 311, 75, 19, 72, 205, 212, + -1, -1, 53, 193, 311, 75, 19, 72, 206, 212, + -1, -1, 193, 311, 75, 64, 72, 208, 215, -1, + -1, 193, 311, 75, 60, 72, 210, 221, -1, 197, -1, 194, -1, 200, -1, 207, -1, 209, -1, 36, - -1, 214, -1, 73, 320, 74, -1, 73, 320, 213, - 318, 74, -1, 214, -1, 213, 319, 214, -1, 311, - -1, -1, 76, 216, 320, 217, 77, -1, -1, 218, - 318, -1, 219, -1, 218, 319, 219, -1, -1, 315, - 78, 220, 272, -1, 315, 78, 36, -1, 76, 320, - 222, 77, -1, -1, 223, 318, -1, 224, -1, 223, - 319, 224, -1, 225, -1, 226, -1, 227, -1, 229, + -1, 214, -1, 73, 318, 74, -1, 73, 318, 213, + 316, 74, -1, 214, -1, 213, 317, 214, -1, 309, + -1, -1, 76, 216, 318, 217, 77, -1, -1, 218, + 316, -1, 219, -1, 218, 317, 219, -1, -1, 313, + 78, 220, 272, -1, 313, 78, 36, -1, 76, 318, + 222, 77, -1, -1, 223, 316, -1, 224, -1, 223, + 317, 224, -1, 225, -1, 226, -1, 227, -1, 229, -1, 230, -1, 16, -1, 30, -1, 43, 78, 228, -1, 42, 78, 228, -1, 37, -1, 29, -1, 33, -1, 58, 70, 11, 71, -1, 34, 55, -1, 34, @@ -2008,54 +2008,53 @@ static const yytype_int16 yyrhs[] = 235, -1, 236, -1, 238, -1, 243, -1, -1, 43, 237, 242, -1, -1, 42, 241, 239, 240, -1, -1, 242, -1, 37, -1, 29, -1, 33, -1, 20, -1, - 314, 70, 11, 79, 11, 71, -1, 314, 70, 11, - 71, -1, 256, -1, -1, 70, 320, 71, -1, 70, - 320, 245, 316, 71, -1, 247, -1, 245, 317, 247, - -1, 314, -1, 22, -1, 62, -1, 12, -1, -1, - 246, 248, 72, 271, -1, -1, 25, 314, 249, 72, - 270, -1, -1, 14, 314, 250, 72, 270, -1, -1, - 47, 314, 251, 72, 270, -1, -1, 15, 314, 252, - 72, 270, -1, -1, 53, 314, 253, 72, 270, -1, - 28, 72, 12, -1, 41, 72, 314, -1, 27, 72, - 314, -1, 63, 72, 314, -1, 63, 72, -1, -1, + 312, 70, 11, 79, 11, 71, -1, 312, 70, 11, + 71, -1, 256, -1, -1, 70, 318, 71, -1, 70, + 318, 245, 314, 71, -1, 247, -1, 245, 315, 247, + -1, 312, -1, 22, -1, 62, -1, 12, -1, -1, + 246, 248, 72, 271, -1, -1, 25, 312, 249, 72, + 270, -1, -1, 14, 312, 250, 72, 270, -1, -1, + 47, 312, 251, 72, 270, -1, -1, 15, 312, 252, + 72, 270, -1, -1, 53, 312, 253, 72, 270, -1, + 28, 72, 12, -1, 41, 72, 312, -1, 27, 72, + 312, -1, 63, 72, 312, -1, 63, 72, -1, -1, 72, 255, -1, 272, -1, 36, -1, -1, 76, 257, - 320, 258, 77, -1, -1, 259, 316, -1, 260, -1, - 259, 317, 260, -1, 262, 261, 72, 272, -1, 26, - 261, 72, 256, -1, 12, -1, 312, -1, 263, -1, - 264, -1, 314, -1, 314, 73, 74, -1, -1, 76, - 266, 320, 267, 77, -1, -1, 268, 318, -1, 269, - -1, 268, 319, 269, -1, 12, 78, 12, -1, 36, + 318, 258, 77, -1, -1, 259, 314, -1, 260, -1, + 259, 315, 260, -1, 262, 261, 72, 272, -1, 26, + 261, 72, 256, -1, 12, -1, 310, -1, 263, -1, + 264, -1, 312, -1, 312, 73, 74, -1, -1, 76, + 266, 318, 267, 77, -1, -1, 268, 316, -1, 269, + -1, 268, 317, 269, -1, 12, 78, 12, -1, 36, -1, 274, -1, 256, -1, 272, -1, 36, -1, 273, -1, 279, -1, 274, -1, 73, 74, -1, 7, -1, - 11, -1, 12, -1, 314, -1, 6, -1, -1, 73, - 275, 276, 74, -1, 320, 277, 318, -1, 278, -1, - 277, 319, 278, -1, 273, -1, 274, -1, 279, -1, - -1, 70, 280, 281, 71, -1, 320, 282, 318, -1, - 283, -1, 282, 319, 283, -1, 273, -1, 279, -1, + 11, -1, 12, -1, 312, -1, 6, -1, -1, 73, + 275, 276, 74, -1, 318, 277, 316, -1, 278, -1, + 277, 317, 278, -1, 273, -1, 274, -1, 279, -1, + -1, 70, 280, 281, 71, -1, 318, 282, 316, -1, + 283, -1, 282, 317, 283, -1, 273, -1, 279, -1, 51, -1, 21, 51, -1, 21, 69, 51, -1, 69, - 51, -1, -1, 284, 313, 75, 64, 72, 286, 215, - -1, 284, 313, 75, 24, 72, 7, -1, -1, 284, - 313, 289, 305, 295, -1, -1, 25, 284, 313, 290, - 305, -1, -1, 14, 284, 313, 291, 305, -1, -1, - 47, 284, 313, 292, 305, -1, -1, 15, 284, 313, - 293, 305, -1, -1, 53, 284, 313, 294, 305, -1, - 284, 313, 73, 7, 74, -1, 285, -1, 287, -1, - -1, 70, 320, 71, -1, 70, 320, 296, 316, 71, - -1, 298, -1, 296, 317, 298, -1, 314, -1, 22, - -1, 62, -1, 12, -1, -1, 297, 299, 72, 271, - -1, -1, 25, 314, 300, 72, 270, -1, -1, 14, - 314, 301, 72, 270, -1, -1, 47, 314, 302, 72, - 270, -1, -1, 15, 314, 303, 72, 270, -1, -1, - 53, 314, 304, 72, 270, -1, 28, 72, 12, -1, - 41, 72, 314, -1, 63, 72, 314, -1, 63, 72, - -1, -1, 72, 306, -1, 308, -1, 36, -1, 73, - 320, 74, -1, 73, 320, 307, 318, 74, -1, 308, - -1, 307, 319, 308, -1, 7, -1, -1, 310, -1, - 7, -1, 7, -1, 314, -1, 84, -1, 8, -1, - 10, -1, 84, -1, 8, -1, 9, -1, 11, -1, - 8, -1, -1, 317, -1, 81, 320, -1, 321, -1, - 320, -1, 319, -1, 79, 320, -1, -1, 321, -1, - 3, -1, 321, 3, -1 + 51, -1, 284, 311, 75, 24, 72, 7, -1, -1, + 284, 311, 287, 303, 293, -1, -1, 25, 284, 311, + 288, 303, -1, -1, 14, 284, 311, 289, 303, -1, + -1, 47, 284, 311, 290, 303, -1, -1, 15, 284, + 311, 291, 303, -1, -1, 53, 284, 311, 292, 303, + -1, 284, 311, 73, 7, 74, -1, 285, -1, -1, + 70, 318, 71, -1, 70, 318, 294, 314, 71, -1, + 296, -1, 294, 315, 296, -1, 312, -1, 22, -1, + 62, -1, 12, -1, -1, 295, 297, 72, 271, -1, + -1, 25, 312, 298, 72, 270, -1, -1, 14, 312, + 299, 72, 270, -1, -1, 47, 312, 300, 72, 270, + -1, -1, 15, 312, 301, 72, 270, -1, -1, 53, + 312, 302, 72, 270, -1, 28, 72, 12, -1, 41, + 72, 312, -1, 63, 72, 312, -1, 63, 72, -1, + -1, 72, 304, -1, 306, -1, 36, -1, 73, 318, + 74, -1, 73, 318, 305, 316, 74, -1, 306, -1, + 305, 317, 306, -1, 7, -1, -1, 308, -1, 7, + -1, 7, -1, 312, -1, 84, -1, 8, -1, 10, + -1, 84, -1, 8, -1, 9, -1, 11, -1, 8, + -1, -1, 315, -1, 81, 318, -1, 319, -1, 318, + -1, 317, -1, 79, 318, -1, -1, 319, -1, 3, + -1, 319, 3, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -2106,15 +2105,15 @@ static const yytype_uint16 yyrline[] = 3045, 3047, 3051, 3052, 3056, 3069, 3075, 3085, 3089, 3090, 3103, 3106, 3109, 3112, 3123, 3129, 3132, 3135, 3140, 3153, 3153, 3162, 3166, 3167, 3171, 3172, 3173, 3181, 3181, 3188, - 3192, 3193, 3197, 3198, 3206, 3210, 3214, 3218, 3225, 3225, - 3237, 3252, 3252, 3262, 3262, 3270, 3270, 3278, 3278, 3286, - 3286, 3295, 3295, 3303, 3310, 3311, 3314, 3316, 3317, 3321, - 3322, 3326, 3327, 3328, 3332, 3337, 3337, 3346, 3346, 3352, - 3352, 3358, 3358, 3364, 3364, 3370, 3370, 3378, 3385, 3393, - 3398, 3405, 3407, 3411, 3412, 3415, 3418, 3422, 3423, 3427, - 3437, 3440, 3444, 3450, 3461, 3462, 3468, 3469, 3470, 3475, - 3476, 3481, 3482, 3485, 3487, 3491, 3492, 3496, 3497, 3501, - 3504, 3506, 3510, 3511 + 3192, 3193, 3197, 3198, 3206, 3210, 3214, 3218, 3225, 3240, + 3240, 3250, 3250, 3258, 3258, 3266, 3266, 3274, 3274, 3283, + 3283, 3291, 3298, 3301, 3303, 3304, 3308, 3309, 3313, 3314, + 3315, 3319, 3324, 3324, 3333, 3333, 3339, 3339, 3345, 3345, + 3351, 3351, 3357, 3357, 3365, 3372, 3380, 3385, 3392, 3394, + 3398, 3399, 3402, 3405, 3409, 3410, 3414, 3424, 3427, 3431, + 3437, 3448, 3449, 3455, 3456, 3457, 3462, 3463, 3468, 3469, + 3472, 3474, 3478, 3479, 3483, 3484, 3488, 3491, 3493, 3497, + 3498 }; #endif @@ -2193,15 +2192,15 @@ static const char *const yytname[] = "typed_value_list_items", "typed_value_list_item", "typed_value_tuple", "$@75", "typed_value_tuple_int", "typed_value_tuple_items", "typed_value_tuple_item", "prim_relationship_type", - "prim_relationship_time_samples", "$@76", "prim_relationship_default", - "prim_relationship", "$@77", "$@78", "$@79", "$@80", "$@81", "$@82", - "relationship_metadata_list_opt", "relationship_metadata_list", - "relationship_metadata_key", "relationship_metadata", "$@83", "$@84", - "$@85", "$@86", "$@87", "$@88", "relationship_assignment_opt", - "relationship_rhs", "relationship_target_list", "relationship_target", - "prim_path_opt", "prim_path", "prim_or_property_scene_path", "name", - "namespaced_name", "identifier", "extended_number", "stmtsep_opt", - "stmtsep", "listsep_opt", "listsep", "newlines_opt", "newlines", 0 + "prim_relationship_default", "prim_relationship", "$@76", "$@77", "$@78", + "$@79", "$@80", "$@81", "relationship_metadata_list_opt", + "relationship_metadata_list", "relationship_metadata_key", + "relationship_metadata", "$@82", "$@83", "$@84", "$@85", "$@86", "$@87", + "relationship_assignment_opt", "relationship_rhs", + "relationship_target_list", "relationship_target", "prim_path_opt", + "prim_path", "prim_or_property_scene_path", "name", "namespaced_name", + "identifier", "extended_number", "stmtsep_opt", "stmtsep", "listsep_opt", + "listsep", "newlines_opt", "newlines", 0 }; #endif @@ -2270,15 +2269,15 @@ static const yytype_uint16 yyr1[] = 267, 267, 268, 268, 269, 270, 270, 271, 271, 271, 272, 272, 272, 272, 272, 273, 273, 273, 273, 275, 274, 276, 277, 277, 278, 278, 278, 280, 279, 281, - 282, 282, 283, 283, 284, 284, 284, 284, 286, 285, - 287, 289, 288, 290, 288, 291, 288, 292, 288, 293, - 288, 294, 288, 288, 288, 288, 295, 295, 295, 296, - 296, 297, 297, 297, 298, 299, 298, 300, 298, 301, - 298, 302, 298, 303, 298, 304, 298, 298, 298, 298, - 298, 305, 305, 306, 306, 306, 306, 307, 307, 308, - 309, 309, 310, 311, 312, 312, 313, 313, 313, 314, - 314, 315, 315, 316, 316, 317, 317, 318, 318, 319, - 320, 320, 321, 321 + 282, 282, 283, 283, 284, 284, 284, 284, 285, 287, + 286, 288, 286, 289, 286, 290, 286, 291, 286, 292, + 286, 286, 286, 293, 293, 293, 294, 294, 295, 295, + 295, 296, 297, 296, 298, 296, 299, 296, 300, 296, + 301, 296, 302, 296, 296, 296, 296, 296, 303, 303, + 304, 304, 304, 304, 305, 305, 306, 307, 307, 308, + 309, 310, 310, 311, 311, 311, 312, 312, 313, 313, + 314, 314, 315, 315, 316, 316, 317, 318, 318, 319, + 319 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -2329,15 +2328,15 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 0, 4, 3, 1, 3, 1, 1, 1, 0, 4, 3, - 1, 3, 1, 1, 1, 2, 3, 2, 0, 7, - 6, 0, 5, 0, 5, 0, 5, 0, 5, 0, - 5, 0, 5, 5, 1, 1, 0, 3, 5, 1, - 3, 1, 1, 1, 1, 0, 4, 0, 5, 0, - 5, 0, 5, 0, 5, 0, 5, 3, 3, 3, - 2, 0, 2, 1, 1, 3, 5, 1, 3, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 2, 1, 1, 1, 2, - 0, 1, 1, 2 + 1, 3, 1, 1, 1, 2, 3, 2, 6, 0, + 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, + 5, 5, 1, 0, 3, 5, 1, 3, 1, 1, + 1, 1, 0, 4, 0, 5, 0, 5, 0, 5, + 0, 5, 0, 5, 3, 3, 3, 2, 0, 2, + 1, 1, 3, 5, 1, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 2, 1, 1, 1, 2, 0, 1, 1, + 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2345,263 +2344,263 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 62, 0, 2, 530, 1, 532, 63, 60, 64, - 531, 105, 101, 109, 0, 530, 99, 530, 533, 519, - 520, 0, 107, 114, 0, 103, 0, 111, 0, 61, - 531, 0, 66, 116, 106, 0, 0, 102, 0, 110, - 0, 0, 100, 530, 71, 0, 0, 0, 0, 0, - 0, 0, 0, 523, 72, 68, 70, 530, 115, 108, - 104, 112, 258, 530, 113, 254, 65, 76, 80, 74, - 0, 78, 0, 82, 0, 530, 67, 524, 526, 0, - 0, 118, 0, 0, 0, 0, 84, 0, 530, 85, - 0, 530, 86, 525, 69, 0, 530, 530, 530, 256, + 0, 62, 0, 2, 527, 1, 529, 63, 60, 64, + 528, 105, 101, 109, 0, 527, 99, 527, 530, 516, + 517, 0, 107, 114, 0, 103, 0, 111, 0, 61, + 528, 0, 66, 116, 106, 0, 0, 102, 0, 110, + 0, 0, 100, 527, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 520, 72, 68, 70, 527, 115, 108, + 104, 112, 258, 527, 113, 254, 65, 76, 80, 74, + 0, 78, 0, 82, 0, 527, 67, 521, 523, 0, + 0, 118, 0, 0, 0, 0, 84, 0, 527, 85, + 0, 527, 86, 522, 69, 0, 527, 527, 527, 256, 0, 0, 0, 0, 249, 0, 0, 438, 434, 435, 436, 429, 447, 439, 404, 427, 73, 428, 430, 432, - 431, 437, 0, 259, 0, 120, 530, 0, 528, 527, - 425, 439, 77, 426, 81, 75, 79, 0, 0, 530, - 251, 83, 92, 87, 530, 89, 93, 530, 433, 530, - 530, 117, 0, 0, 279, 0, 0, 0, 454, 0, + 431, 437, 0, 259, 0, 120, 527, 0, 525, 524, + 425, 439, 77, 426, 81, 75, 79, 0, 0, 527, + 251, 83, 92, 87, 527, 89, 93, 527, 433, 527, + 527, 117, 0, 0, 279, 0, 0, 0, 454, 0, 278, 0, 0, 0, 260, 261, 0, 0, 0, 0, 280, 0, 283, 0, 308, 307, 309, 310, 311, 276, - 0, 474, 475, 277, 281, 530, 127, 0, 0, 125, - 0, 0, 155, 0, 0, 143, 0, 0, 0, 179, - 0, 0, 167, 126, 0, 0, 0, 523, 128, 122, - 124, 529, 255, 257, 0, 248, 250, 528, 0, 528, - 0, 91, 0, 0, 0, 0, 406, 0, 0, 0, - 0, 0, 455, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 268, 457, 266, 262, 267, 264, 265, - 263, 284, 516, 517, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 32, 33, 34, 31, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 518, 285, 461, 0, 119, 159, 147, 183, 171, - 0, 132, 163, 151, 187, 175, 0, 136, 157, 145, - 181, 169, 0, 130, 0, 0, 0, 0, 0, 0, - 0, 161, 149, 185, 173, 0, 134, 0, 0, 165, - 153, 189, 177, 0, 138, 0, 200, 0, 0, 121, - 524, 0, 253, 252, 88, 90, 0, 0, 523, 95, - 448, 452, 453, 530, 450, 440, 444, 445, 530, 442, - 446, 0, 0, 523, 408, 0, 414, 415, 416, 0, - 465, 0, 469, 456, 288, 0, 463, 0, 467, 0, - 0, 0, 471, 0, 0, 400, 0, 0, 501, 282, + 0, 472, 277, 281, 527, 127, 0, 0, 125, 0, + 0, 155, 0, 0, 143, 0, 0, 0, 179, 0, + 0, 167, 126, 0, 0, 0, 520, 128, 122, 124, + 526, 255, 257, 0, 248, 250, 525, 0, 525, 0, + 91, 0, 0, 0, 0, 406, 0, 0, 0, 0, + 0, 455, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 268, 457, 266, 262, 267, 264, 265, 263, + 284, 513, 514, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 32, 33, 34, 31, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 515, 285, 459, 0, 119, 159, 147, 183, 171, 0, + 132, 163, 151, 187, 175, 0, 136, 157, 145, 181, + 169, 0, 130, 0, 0, 0, 0, 0, 0, 0, + 161, 149, 185, 173, 0, 134, 0, 0, 165, 153, + 189, 177, 0, 138, 0, 200, 0, 0, 121, 521, + 0, 253, 252, 88, 90, 0, 0, 520, 95, 448, + 452, 453, 527, 450, 440, 444, 445, 527, 442, 446, + 0, 0, 520, 408, 0, 414, 415, 416, 0, 463, + 0, 467, 456, 288, 0, 461, 0, 465, 0, 0, + 0, 469, 0, 0, 400, 0, 0, 498, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 140, 0, - 141, 142, 0, 418, 201, 202, 0, 0, 0, 0, - 0, 0, 0, 191, 0, 0, 0, 0, 0, 0, - 0, 199, 192, 193, 123, 0, 0, 0, 0, 524, - 449, 528, 441, 528, 412, 515, 0, 413, 514, 405, - 407, 524, 0, 0, 0, 501, 0, 501, 400, 0, - 501, 0, 501, 274, 275, 0, 501, 530, 0, 0, - 0, 0, 286, 0, 0, 0, 0, 476, 0, 0, - 0, 0, 195, 0, 0, 0, 0, 0, 197, 0, - 0, 0, 0, 0, 194, 0, 512, 234, 530, 156, - 235, 240, 210, 203, 530, 510, 144, 204, 530, 0, - 0, 0, 0, 196, 0, 225, 218, 530, 510, 180, - 219, 0, 0, 0, 0, 198, 0, 241, 530, 168, - 242, 247, 129, 97, 98, 94, 96, 451, 443, 0, - 409, 0, 417, 0, 466, 0, 470, 289, 0, 464, - 0, 468, 0, 472, 0, 291, 305, 303, 403, 401, - 402, 374, 473, 0, 458, 509, 504, 530, 502, 503, - 530, 462, 160, 148, 184, 172, 133, 164, 152, 188, - 176, 137, 158, 146, 182, 170, 131, 0, 212, 0, - 212, 511, 420, 162, 150, 186, 174, 135, 227, 0, - 227, 166, 154, 190, 178, 139, 0, 411, 410, 293, - 297, 374, 299, 295, 301, 530, 0, 0, 0, 530, - 287, 460, 0, 0, 0, 236, 530, 238, 530, 211, - 205, 530, 207, 209, 0, 0, 530, 422, 530, 226, - 220, 530, 222, 224, 243, 530, 245, 0, 0, 290, - 0, 0, 0, 0, 513, 312, 530, 292, 313, 318, - 530, 306, 319, 304, 0, 459, 505, 530, 507, 484, - 0, 0, 482, 0, 0, 0, 0, 0, 483, 0, - 477, 523, 485, 479, 481, 0, 528, 0, 0, 528, - 0, 419, 421, 528, 0, 0, 528, 0, 528, 294, - 298, 300, 296, 302, 272, 0, 270, 0, 329, 530, - 382, 0, 0, 380, 0, 0, 0, 0, 0, 0, - 381, 0, 375, 523, 383, 377, 379, 0, 528, 489, - 493, 487, 0, 0, 491, 495, 500, 0, 524, 0, - 237, 239, 213, 217, 523, 215, 206, 208, 424, 423, - 0, 228, 232, 523, 230, 221, 223, 244, 246, 530, - 269, 271, 314, 530, 316, 0, 338, 339, 0, 0, - 0, 0, 530, 331, 333, 334, 335, 336, 337, 321, - 387, 391, 385, 0, 0, 0, 389, 393, 399, 0, - 524, 0, 506, 508, 0, 0, 0, 497, 498, 0, - 0, 499, 478, 480, 0, 0, 524, 0, 0, 524, - 0, 0, 528, 350, 0, 0, 0, 328, 330, 528, - 522, 521, 0, 530, 323, 0, 0, 0, 0, 397, - 395, 396, 0, 0, 398, 376, 378, 0, 0, 0, - 0, 0, 0, 486, 214, 216, 233, 229, 231, 530, - 315, 317, 0, 0, 343, 344, 0, 342, 0, 341, - 340, 332, 320, 322, 528, 325, 0, 0, 0, 0, - 0, 384, 490, 494, 488, 492, 496, 0, 352, 354, - 0, 348, 346, 347, 0, 324, 327, 0, 388, 392, - 386, 390, 394, 530, 0, 0, 351, 0, 0, 326, - 273, 353, 0, 361, 355, 356, 358, 359, 360, 373, - 0, 345, 370, 368, 369, 367, 363, 0, 0, 0, - 365, 362, 0, 357, 0, 364, 366, 0, 0, 0, - 0, 372, 0, 0, 0, 0, 371, 349 + 0, 0, 0, 0, 0, 0, 0, 140, 0, 141, + 142, 0, 418, 201, 202, 0, 0, 0, 0, 0, + 0, 0, 191, 0, 0, 0, 0, 0, 0, 0, + 199, 192, 193, 123, 0, 0, 0, 0, 521, 449, + 525, 441, 525, 412, 512, 0, 413, 511, 405, 407, + 521, 0, 0, 0, 498, 0, 498, 400, 0, 498, + 0, 498, 274, 275, 0, 498, 527, 0, 0, 0, + 0, 286, 0, 0, 0, 473, 0, 0, 0, 0, + 195, 0, 0, 0, 0, 0, 197, 0, 0, 0, + 0, 0, 194, 0, 509, 234, 527, 156, 235, 240, + 210, 203, 527, 507, 144, 204, 527, 0, 0, 0, + 0, 196, 0, 225, 218, 527, 507, 180, 219, 0, + 0, 0, 0, 198, 0, 241, 527, 168, 242, 247, + 129, 97, 98, 94, 96, 451, 443, 0, 409, 0, + 417, 0, 464, 0, 468, 289, 0, 462, 0, 466, + 0, 470, 0, 291, 305, 303, 403, 401, 402, 374, + 471, 0, 506, 501, 527, 499, 500, 527, 460, 160, + 148, 184, 172, 133, 164, 152, 188, 176, 137, 158, + 146, 182, 170, 131, 0, 212, 0, 212, 508, 420, + 162, 150, 186, 174, 135, 227, 0, 227, 166, 154, + 190, 178, 139, 0, 411, 410, 293, 297, 374, 299, + 295, 301, 527, 0, 0, 0, 527, 287, 458, 0, + 0, 236, 527, 238, 527, 211, 205, 527, 207, 209, + 0, 0, 527, 422, 527, 226, 220, 527, 222, 224, + 243, 527, 245, 0, 0, 290, 0, 0, 0, 0, + 510, 312, 527, 292, 313, 318, 527, 306, 319, 304, + 0, 502, 527, 504, 481, 0, 0, 479, 0, 0, + 0, 0, 0, 480, 0, 474, 520, 482, 476, 478, + 0, 525, 0, 0, 525, 0, 419, 421, 525, 0, + 0, 525, 0, 525, 294, 298, 300, 296, 302, 272, + 0, 270, 0, 329, 527, 382, 0, 0, 380, 0, + 0, 0, 0, 0, 0, 381, 0, 375, 520, 383, + 377, 379, 0, 525, 486, 490, 484, 0, 0, 488, + 492, 497, 0, 521, 0, 237, 239, 213, 217, 520, + 215, 206, 208, 424, 423, 0, 228, 232, 520, 230, + 221, 223, 244, 246, 527, 269, 271, 314, 527, 316, + 0, 338, 339, 0, 0, 0, 0, 527, 331, 333, + 334, 335, 336, 337, 321, 387, 391, 385, 0, 0, + 0, 389, 393, 399, 0, 521, 0, 503, 505, 0, + 0, 0, 494, 495, 0, 0, 496, 475, 477, 0, + 0, 521, 0, 0, 521, 0, 0, 525, 350, 0, + 0, 0, 328, 330, 525, 519, 518, 0, 527, 323, + 0, 0, 0, 0, 397, 395, 396, 0, 0, 398, + 376, 378, 0, 0, 0, 0, 0, 0, 483, 214, + 216, 233, 229, 231, 527, 315, 317, 0, 0, 343, + 344, 0, 342, 0, 341, 340, 332, 320, 322, 525, + 325, 0, 0, 0, 0, 0, 384, 487, 491, 485, + 489, 493, 0, 352, 354, 0, 348, 346, 347, 0, + 324, 327, 0, 388, 392, 386, 390, 394, 527, 0, + 0, 351, 0, 0, 326, 273, 353, 0, 361, 355, + 356, 358, 359, 360, 373, 0, 345, 370, 368, 369, + 367, 363, 0, 0, 0, 365, 362, 0, 357, 0, + 364, 366, 0, 0, 0, 0, 372, 0, 0, 0, + 0, 371, 349 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 311, 7, 3, 4, 8, 31, 53, 54, + -1, 2, 310, 7, 3, 4, 8, 31, 53, 54, 55, 79, 85, 83, 87, 84, 90, 92, 144, 145, - 525, 221, 368, 763, 15, 163, 24, 38, 21, 36, - 26, 40, 22, 34, 57, 80, 124, 207, 208, 209, - 361, 427, 415, 441, 421, 449, 338, 423, 411, 437, - 417, 445, 335, 422, 410, 436, 416, 444, 355, 425, - 413, 439, 419, 447, 347, 424, 412, 438, 418, 446, - 526, 651, 527, 608, 649, 764, 765, 539, 661, 540, - 618, 659, 773, 774, 519, 646, 520, 549, 665, 550, + 523, 220, 367, 758, 15, 163, 24, 38, 21, 36, + 26, 40, 22, 34, 57, 80, 124, 206, 207, 208, + 360, 426, 414, 440, 420, 448, 337, 422, 410, 436, + 416, 444, 334, 421, 409, 435, 415, 443, 354, 424, + 412, 438, 418, 446, 346, 423, 411, 437, 417, 445, + 524, 647, 525, 605, 645, 759, 760, 537, 657, 538, + 615, 655, 768, 769, 517, 642, 518, 547, 661, 548, 89, 138, 139, 140, 64, 98, 65, 122, 164, 165, - 166, 403, 725, 726, 779, 167, 168, 169, 170, 171, - 172, 173, 174, 405, 581, 175, 478, 631, 176, 636, - 667, 671, 668, 670, 672, 177, 638, 178, 637, 179, - 677, 783, 678, 683, 729, 842, 843, 844, 907, 681, - 791, 792, 793, 794, 795, 796, 879, 797, 798, 872, - 899, 916, 924, 925, 926, 937, 927, 940, 945, 936, - 941, 928, 640, 743, 744, 745, 811, 848, 846, 852, - 847, 853, 492, 579, 115, 150, 382, 383, 384, 466, - 385, 386, 387, 434, 528, 655, 656, 657, 132, 116, - 117, 118, 133, 149, 224, 378, 379, 120, 147, 222, - 373, 374, 180, 181, 642, 182, 183, 408, 480, 475, - 482, 477, 486, 591, 701, 702, 703, 759, 816, 814, - 819, 815, 820, 497, 588, 687, 589, 610, 521, 679, - 467, 312, 121, 845, 76, 77, 127, 128, 129, 10 + 166, 402, 720, 721, 774, 167, 168, 169, 170, 171, + 172, 173, 174, 404, 579, 175, 477, 628, 176, 633, + 663, 667, 664, 666, 668, 177, 635, 178, 634, 179, + 673, 778, 674, 679, 724, 837, 838, 839, 902, 677, + 786, 787, 788, 789, 790, 791, 874, 792, 793, 867, + 894, 911, 919, 920, 921, 932, 922, 935, 940, 931, + 936, 923, 637, 738, 739, 740, 806, 843, 841, 847, + 842, 848, 491, 577, 115, 150, 381, 382, 383, 465, + 384, 385, 386, 433, 526, 651, 652, 653, 132, 116, + 117, 118, 133, 149, 223, 377, 378, 120, 147, 221, + 372, 373, 180, 181, 182, 407, 479, 474, 481, 476, + 485, 588, 696, 697, 698, 754, 811, 809, 814, 810, + 815, 495, 585, 682, 586, 607, 519, 675, 466, 311, + 121, 840, 76, 77, 127, 128, 129, 10 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -706 +#define YYPACT_NINF -710 static const yytype_int16 yypact[] = { - 63, -706, 77, -706, 136, -706, -706, -706, 217, 73, - 171, 141, 141, 141, 165, 136, -706, 136, -706, -706, - -706, 216, 176, -706, 216, 176, 216, 176, 181, -706, - 215, 164, 308, -706, -706, 141, 216, -706, 216, -706, - 216, 83, -706, 136, -706, 141, 141, 141, 184, 141, - 188, 141, 236, 41, -706, -706, -706, 136, -706, -706, - -706, -706, -706, 136, -706, -706, -706, -706, -706, -706, - 237, -706, 203, -706, 257, 136, -706, 308, 171, 260, - 258, 271, 347, 278, 288, 290, -706, 293, 136, -706, - 294, 136, -706, -706, -706, 48, 136, 136, 38, -706, - 125, 125, 125, 125, 360, 125, 42, -706, -706, -706, - -706, -706, -706, 299, -706, -706, -706, -706, -706, -706, - -706, -706, 298, 449, 305, 979, 136, 309, 347, -706, - -706, -706, -706, -706, -706, -706, -706, 313, 316, 38, - -706, -706, -706, -706, 38, -706, 324, 136, -706, 136, - 136, -706, 274, 274, -706, 338, 274, 274, -706, 303, - -706, 390, 353, 136, 449, -706, 136, 41, 41, 41, - -706, 141, -706, 917, -706, -706, -706, -706, -706, -706, - 917, -706, -706, -706, 332, 136, -706, 193, 388, -706, - 431, 336, -706, 341, 343, -706, 344, 345, 442, -706, - 355, 484, -706, -706, 357, 361, 366, 41, -706, -706, - -706, -706, -706, -706, 445, -706, -706, 360, 380, 453, - 12, -706, 384, 214, 394, 199, 292, 131, 917, 917, - 917, 917, -706, 420, 917, 917, 917, 917, 917, 404, - 406, 917, 917, -706, -706, 171, -706, 171, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, 410, 27, 407, -706, -706, -706, -706, -706, - 425, -706, -706, -706, -706, -706, 432, -706, -706, -706, - -706, -706, 433, -706, 491, 434, 495, 141, 437, 435, - 435, -706, -706, -706, -706, 448, -706, 451, 203, -706, - -706, -706, -706, 457, -706, 458, 141, 464, 83, -706, - 979, 470, -706, -706, -706, -706, 478, 479, 41, -706, - -706, -706, -706, 38, -706, -706, -706, -706, 38, -706, - -706, 804, 444, 41, -706, 804, -706, -706, 482, 486, - -706, 489, -706, -706, -706, 493, -706, 496, -706, 83, - 83, 498, -706, 485, 26, 503, 563, 44, 510, -706, - 511, 512, 514, 518, 83, 519, 520, 521, 525, 527, - 83, 528, 529, 530, 531, 532, 83, 533, -706, 144, - -706, -706, 55, -706, -706, -706, 534, 535, 536, 537, - 83, 539, 74, -706, 540, 542, 543, 545, 83, 546, - 163, -706, -706, -706, -706, 48, 583, 611, 552, 12, - -706, 214, -706, 199, -706, -706, 553, -706, -706, -706, - -706, 292, 556, 555, 613, 510, 616, 510, 503, 617, - 510, 619, 510, -706, -706, 622, 510, 136, 558, 559, - 570, 160, -706, 571, 572, 574, 168, 578, 144, 55, - 74, 163, -706, 125, 144, 55, 74, 163, -706, 125, - 144, 55, 74, 163, -706, 125, -706, -706, 136, -706, - -706, -706, -706, -706, 136, 643, -706, -706, 136, 144, - 55, 74, 163, -706, 125, -706, -706, 136, 643, -706, - -706, 144, 55, 74, 163, -706, 125, -706, 136, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, 464, - -706, 177, -706, 579, -706, 580, -706, -706, 582, -706, - 585, -706, 588, -706, 586, -706, -706, -706, -706, -706, - -706, 591, -706, 648, -706, -706, -706, 136, -706, -706, - 136, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, 51, 593, 57, - 593, -706, 652, -706, -706, -706, -706, -706, 597, 66, - 597, -706, -706, -706, -706, -706, 78, -706, -706, -706, - -706, 591, -706, -706, -706, 136, 185, 592, 594, 136, - -706, -706, 594, 80, 373, -706, 38, -706, 136, -706, - -706, 38, -706, -706, 598, 595, 38, -706, 136, -706, - -706, 38, -706, -706, -706, 38, -706, 185, 185, -706, - 185, 185, 185, 657, -706, -706, 136, -706, -706, -706, - 136, -706, -706, -706, 266, -706, -706, 38, -706, -706, - 141, 141, -706, 141, 599, 605, 141, 141, -706, 606, - -706, 41, -706, -706, -706, 609, 643, 174, 615, 283, - 675, -706, -706, 652, 156, 618, 346, 620, 643, -706, - -706, -706, -706, -706, -706, 34, -706, 99, 243, 136, - -706, 141, 141, -706, 141, 621, 623, 624, 141, 141, - -706, 626, -706, 41, -706, -706, -706, 625, 684, -706, - -706, -706, 688, 141, -706, -706, 141, 630, 1040, 631, - -706, -706, -706, -706, 41, -706, -706, -706, -706, -706, - 632, -706, -706, 41, -706, -706, -706, -706, -706, 136, - -706, -706, -706, 38, -706, 627, -706, -706, 628, 629, - 633, 635, 38, -706, -706, -706, -706, -706, -706, 112, - -706, -706, -706, 141, 690, 141, -706, -706, 141, 637, - 612, 638, -706, -706, 641, 642, 644, -706, -706, 645, - 646, -706, -706, -706, 48, 651, 12, 464, 653, 159, - 639, 655, 712, -706, 656, 450, 450, -706, -706, 243, - -706, -706, 654, 38, -706, 647, 658, 661, 662, -706, - -706, -706, 663, 664, -706, -706, -706, 48, 125, 125, - 125, 125, 125, -706, -706, -706, -706, -706, -706, 136, - -706, -706, 727, 729, -706, -706, 207, -706, 673, -706, - -706, -706, -706, -706, 112, 708, 125, 125, 125, 125, - 125, -706, -706, -706, -706, -706, -706, 669, 668, 670, - 671, -706, -706, -706, 738, -706, -706, 177, -706, -706, - -706, -706, -706, 136, 741, 50, -706, 742, 683, -706, - -706, -706, 311, -706, 674, -706, -706, -706, -706, -706, - 677, -706, -706, -706, -706, -706, -706, 141, 50, 746, - 141, -706, 689, -706, 679, -706, -706, 750, 751, 256, - 685, -706, 752, 755, 696, 697, -706, -706 + 56, -710, 86, -710, 78, -710, -710, -710, 151, 46, + 163, 277, 277, 277, 89, 78, -710, 78, -710, -710, + -710, 159, 130, -710, 159, 130, 159, 130, 143, -710, + 234, 153, 682, -710, -710, 277, 159, -710, 159, -710, + 159, 38, -710, 78, -710, 277, 277, 277, 170, 277, + 174, 277, 180, 34, -710, -710, -710, 78, -710, -710, + -710, -710, -710, 78, -710, -710, -710, -710, -710, -710, + 242, -710, 185, -710, 190, 78, -710, 682, 163, 201, + 202, 210, 279, 254, 259, 264, -710, 269, 78, -710, + 275, 78, -710, -710, -710, 189, 78, 78, 43, -710, + 12, 12, 12, 12, 332, 12, 36, -710, -710, -710, + -710, -710, -710, 276, -710, -710, -710, -710, -710, -710, + -710, -710, 272, 440, 286, 789, 78, 294, 279, -710, + -710, -710, -710, -710, -710, -710, -710, 281, 298, 43, + -710, -710, -710, -710, 43, -710, 301, 78, -710, 78, + 78, -710, 314, 314, -710, 325, 314, 314, -710, 337, + -710, 374, 341, 78, 440, -710, 78, 34, 34, 34, + -710, 277, -710, 976, -710, -710, -710, -710, -710, -710, + 976, -710, -710, 324, 78, -710, 239, 403, -710, 420, + 331, -710, 336, 346, -710, 349, 355, 468, -710, 358, + 522, -710, -710, 361, 363, 364, 34, -710, -710, -710, + -710, -710, -710, 402, -710, -710, 332, 350, 439, 17, + -710, 389, 227, 392, 81, 241, 8, 976, 976, 976, + 976, -710, 419, 976, 976, 976, 976, 976, 401, 406, + 976, 976, -710, -710, 163, -710, 163, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, 399, 115, 407, -710, -710, -710, -710, -710, 410, + -710, -710, -710, -710, -710, 411, -710, -710, -710, -710, + -710, 412, -710, 463, 413, 477, 277, 422, 416, 416, + -710, -710, -710, -710, 425, -710, 426, 185, -710, -710, + -710, -710, 428, -710, 429, 277, 427, 38, -710, 789, + 432, -710, -710, -710, -710, 436, 441, 34, -710, -710, + -710, -710, 43, -710, -710, -710, -710, 43, -710, -710, + 914, 434, 34, -710, 914, -710, -710, 445, 444, -710, + 448, -710, -710, -710, 449, -710, 459, -710, 38, 38, + 464, -710, 442, 119, 469, 533, 519, 473, -710, 479, + 482, 483, 484, 38, 486, 487, 490, 492, 493, 38, + 495, 496, 498, 500, 501, 38, 502, -710, 64, -710, + -710, 66, -710, -710, -710, 504, 505, 508, 516, 38, + 523, 149, -710, 529, 531, 534, 541, 38, 543, 88, + -710, -710, -710, -710, 189, 538, 605, 546, 17, -710, + 227, -710, 81, -710, -710, 547, -710, -710, -710, -710, + 241, 548, 551, 602, 473, 603, 473, 469, 607, 473, + 608, 473, -710, -710, 609, 473, 78, 559, 561, 562, + 97, -710, 563, 566, 133, 565, 64, 66, 149, 88, + -710, 12, 64, 66, 149, 88, -710, 12, 64, 66, + 149, 88, -710, 12, -710, -710, 78, -710, -710, -710, + -710, -710, 78, 634, -710, -710, 78, 64, 66, 149, + 88, -710, 12, -710, -710, 78, 634, -710, -710, 64, + 66, 149, 88, -710, 12, -710, 78, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, 427, -710, 220, + -710, 570, -710, 571, -710, -710, 573, -710, 575, -710, + 576, -710, 574, -710, -710, -710, -710, -710, -710, 579, + -710, 644, -710, -710, 78, -710, -710, 78, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, 49, 582, 45, 582, -710, 641, + -710, -710, -710, -710, -710, 586, 47, 586, -710, -710, + -710, -710, -710, 51, -710, -710, -710, -710, 579, -710, + -710, -710, 78, 145, 581, 583, 78, -710, -710, 54, + 352, -710, 43, -710, 78, -710, -710, 43, -710, -710, + 580, 584, 43, -710, 78, -710, -710, 43, -710, -710, + -710, 43, -710, 145, 145, -710, 145, 145, 145, 648, + -710, -710, 78, -710, -710, -710, 78, -710, -710, -710, + 267, -710, 43, -710, -710, 277, 277, -710, 277, 590, + 591, 277, 277, -710, 592, -710, 34, -710, -710, -710, + 593, 634, 27, 594, 62, 653, -710, -710, 641, 280, + 596, 293, 597, 634, -710, -710, -710, -710, -710, -710, + 105, -710, 60, 285, 78, -710, 277, 277, -710, 277, + 601, 610, 611, 277, 277, -710, 612, -710, 34, -710, + -710, -710, 614, 659, -710, -710, -710, 667, 277, -710, + -710, 277, 615, 851, 613, -710, -710, -710, -710, 34, + -710, -710, -710, -710, -710, 617, -710, -710, 34, -710, + -710, -710, -710, -710, 78, -710, -710, -710, 43, -710, + 620, -710, -710, 621, 622, 623, 616, 43, -710, -710, + -710, -710, -710, -710, 313, -710, -710, -710, 277, 683, + 277, -710, -710, 277, 631, 577, 632, -710, -710, 633, + 636, 637, -710, -710, 639, 640, -710, -710, -710, 189, + 642, 17, 427, 643, 42, 627, 645, 710, -710, 650, + 183, 183, -710, -710, 285, -710, -710, 649, 43, -710, + 647, 656, 658, 661, -710, -710, -710, 664, 669, -710, + -710, -710, 189, 12, 12, 12, 12, 12, -710, -710, + -710, -710, -710, -710, 78, -710, -710, 720, 728, -710, + -710, 23, -710, 651, -710, -710, -710, -710, -710, 313, + 708, 12, 12, 12, 12, 12, -710, -710, -710, -710, + -710, -710, 668, 666, 670, 671, -710, -710, -710, 736, + -710, -710, 220, -710, -710, -710, -710, -710, 78, 737, + 167, -710, 738, 681, -710, -710, -710, 367, -710, 672, + -710, -710, -710, -710, -710, 675, -710, -710, -710, -710, + -710, -710, 277, 167, 745, 277, -710, 687, -710, 679, + -710, -710, 748, 750, 140, 684, -710, 751, 754, 695, + 696, -710, -710 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -706, -706, -307, -706, -706, -706, -706, -706, -706, -706, - 693, -706, -706, -706, -706, -706, -706, -706, -706, 560, - -100, -706, -706, -216, -706, 67, -706, -706, -706, -706, - -706, -706, 302, 522, -706, -8, -706, -706, -706, 412, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -121, -706, -577, -706, 170, -706, -48, -120, -706, -586, - -706, 161, -706, -47, -76, -706, -568, -19, -706, -583, - 436, -706, -706, 566, -311, -706, -30, -84, -706, 634, - -706, -706, -706, 61, -706, -706, -706, -706, -706, -706, - 636, 382, -706, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, -706, -706, -706, -706, - -91, -706, -705, 146, -706, -706, -706, -95, -706, -706, - -706, -706, -49, -706, -706, -706, -45, -706, -706, -706, - -706, -706, -706, -145, -706, -706, -706, -706, -706, -706, - -144, -706, 169, -706, -706, -15, -706, -706, -706, -706, - -706, -706, 328, -706, -350, -706, -706, -706, 337, 424, - -706, -706, -706, 471, -706, -706, -706, 97, -85, -447, - -482, -197, -92, -706, -706, -706, 351, -196, -706, -706, - -706, 413, 289, -706, -706, -706, -706, -706, -706, -706, - -706, -706, -706, -706, -706, -706, 117, -706, -706, -706, - -706, -706, -706, 92, -706, -706, -612, 340, -431, -706, - -706, 68, -11, -706, -177, -154, -134, -102, 8, -4 + -710, -710, -150, -710, -710, -710, -710, -710, -710, -710, + 691, -710, -710, -710, -710, -710, -710, -710, -710, 552, + -88, -710, -710, -214, -710, 150, -710, -710, -710, -710, + -710, -710, 369, 316, -710, -5, -710, -710, -710, 414, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -108, -710, -584, -710, 164, -710, -49, -91, -710, -575, + -710, 158, -710, -48, -6, -710, -572, 33, -710, -578, + 435, -710, -710, 567, -226, -710, 75, -80, -710, 624, + -710, -710, -710, 65, -710, -710, -710, -710, -710, -710, + 619, 287, -710, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, -710, -710, -710, -710, -710, -710, + -70, -710, -709, -710, -710, -710, -710, -93, -710, -710, + -710, -710, -43, -710, -710, -710, -38, -710, -710, -710, + -710, -710, -710, -138, -710, -710, -710, -710, -710, -710, + -139, -710, 171, -710, -710, -3, -710, -710, -710, -710, + -710, -710, 323, -710, -350, -710, -710, -710, 342, 431, + -710, -710, -710, 474, -710, -710, -710, 108, -76, -435, + -476, -194, -92, -710, -710, -710, 356, -191, -710, -710, + -710, 359, 455, -710, -710, -710, -710, -710, -710, -710, + -710, -710, -710, -710, 69, -710, -710, -710, -710, -710, + -710, -221, -710, -710, -616, 288, -429, -710, -710, 76, + -11, -710, -190, -159, -132, -100, 0, -4 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -2611,334 +2610,322 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint16 yytable[] = { - 23, 23, 23, 119, 369, 216, 146, 452, 552, 580, - 218, 30, 9, 248, 249, 250, 134, 135, 136, 551, - 141, 56, 784, 29, 58, 32, 371, 372, 376, 380, - 359, 688, 652, 662, 67, 68, 69, 217, 71, 647, - 73, 6, 219, 666, 6, 488, 724, 453, 142, 78, - 366, 66, 99, 360, 107, 108, 19, 20, 516, 109, - 110, 142, 522, 142, 522, 81, 56, 1, 494, 367, - 551, 82, 142, 535, 465, 16, 551, 5, 465, 628, - 142, 535, 551, 93, 111, 516, 489, 585, 483, 484, - 490, 523, 922, 923, 611, 62, 104, 42, 213, 106, - 406, 551, 407, 502, 123, 125, 674, 611, 495, 508, - 536, 780, 184, 551, 210, 514, 143, 126, 112, 146, - 840, 113, 75, 841, 114, 645, 114, 871, 524, 533, - 776, 650, 767, 377, 211, 778, 813, 545, 761, 6, - 660, 184, 184, 17, 184, 184, 184, 537, 184, 19, - 20, 516, 664, 184, 686, 223, 63, 225, 226, 245, - 184, 130, 247, 78, 78, 78, 107, 108, 19, 20, - 516, 109, 110, 782, 18, 585, 321, 327, 770, 333, - 517, 770, 232, 107, 108, 19, 20, 346, 109, 110, - 354, 458, 674, 315, 366, 551, 578, 366, 131, 547, - 233, 19, 20, 78, 586, 107, 470, 19, 20, 627, - 109, 110, 366, 367, 459, 388, 367, 518, 18, 28, - 107, 675, 19, 20, 316, 109, 110, 771, 33, 471, - 112, 367, 11, 113, 11, 43, 548, 317, 12, 460, - 12, 587, 318, 556, 462, 762, 901, 112, 313, 86, - 113, 35, 319, 41, 785, 13, 70, 13, 676, 786, - 72, 320, 902, 903, 371, 372, 376, 380, 14, 112, - 14, 461, 131, 787, 19, 20, 463, 788, 730, 88, - 731, 732, 19, 20, 112, 789, 790, 551, 733, 142, - 522, 734, 154, 735, 736, 227, 389, 390, 391, 392, - 19, 20, 394, 395, 396, 397, 398, 737, 74, 401, - 402, 19, 20, 738, 25, 27, 19, 20, 381, 739, - 44, 154, 45, 46, 227, 158, 431, 951, 740, 741, - 91, 932, 95, 47, 96, 952, 48, 742, 239, 160, - 933, 97, 538, 162, 934, 451, 19, 20, 935, 210, - 100, 240, 142, 535, 158, 49, 154, 28, 50, 62, - 101, 51, 102, 119, 78, 103, 105, 137, 160, 52, - 468, 377, 162, 148, 468, 151, 185, 863, 593, 78, - 594, 19, 20, 212, 598, 689, 599, 690, 691, 232, - 603, 214, 604, 215, 220, 692, 19, 20, 693, 119, - 538, 694, 243, 160, 244, 314, 538, 233, 334, 614, - 891, 615, 538, 336, 695, 337, 339, 340, 596, 322, - 696, 622, 592, 623, 601, 919, 697, 348, 597, 356, - 606, 538, 323, 357, 602, 698, 699, 324, 358, 19, - 20, 229, 231, 538, 700, 236, 238, 325, 242, 617, - 19, 20, 362, 613, 364, 370, 326, 19, 20, 142, - 388, 625, 328, 152, 153, 621, 11, 154, 375, 119, - 155, 393, 12, 341, 156, 329, 399, 866, 400, 874, - 330, 409, 595, 875, 876, 404, 342, 877, 600, 13, - 331, 343, 19, 20, 605, 574, 157, 414, 772, 332, - 158, 344, 159, 428, 420, 426, 429, 430, 878, 432, - 345, 433, 705, 616, 160, 349, 161, 708, 162, 538, - 440, 469, 712, 442, 757, 624, 607, 715, 350, 448, - 450, 717, 609, 351, 228, 230, 612, 234, 235, 237, - 114, 241, 455, 352, 706, 619, 37, 758, 39, 709, - 456, 457, 353, 747, 713, 473, 626, 487, 59, 716, - 60, 474, 61, 718, 476, 929, 809, 564, 479, 566, - 493, 481, 569, 485, 571, 491, 719, 720, 573, 721, - 722, 723, 496, 498, 499, 748, 500, 825, 929, 810, - 501, 503, 504, 505, 553, 643, 828, 506, 644, 507, - 509, 510, 511, 512, 513, 515, 529, 530, 531, 532, - 826, 534, 541, 772, 542, 543, 538, 544, 546, 829, - 19, 20, 554, 555, 730, 559, 731, 732, 561, 562, - 575, 576, 563, 704, 733, 565, 568, 734, 570, 735, - 736, 572, 577, 673, 583, 582, 584, 684, 590, 831, - 516, 629, 630, 737, 632, 641, 707, 633, 838, 738, - 634, 639, 635, 648, 654, 739, 714, 658, 680, 724, - 682, 752, 711, 746, 740, 741, 710, 753, 756, 749, - 750, 832, 751, 760, 727, 754, 755, 768, 728, 766, - 839, 585, 775, 803, 777, 804, 805, 78, 808, 812, - 817, 822, 850, 824, 827, 833, 834, 835, 855, 883, - 857, 836, 837, 858, 859, 869, 860, 861, 862, 674, - 800, 801, 864, 802, 867, 885, 873, 806, 807, 870, - 886, 882, 119, 887, 888, 889, 890, 799, 898, 78, - 900, 884, 818, 904, 906, 821, 913, 704, 914, 918, - 917, 915, 921, 930, 931, 938, 939, 944, 948, 947, - 78, 949, 950, 954, 953, 119, 955, 956, 957, 78, - 94, 830, 454, 892, 893, 894, 895, 896, 865, 365, - 653, 663, 868, 363, 443, 897, 781, 81, 685, 905, - 881, 880, 849, 943, 851, 856, 946, 854, 246, 746, - 669, 908, 909, 910, 911, 912, 567, 251, 560, 472, - 769, 435, 19, 20, 558, 119, 464, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 557, 823, 0, 123, 620, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 23, 23, 23, 119, 9, 368, 451, 215, 247, 248, + 249, 30, 217, 779, 578, 29, 358, 32, 146, 550, + 549, 56, 648, 683, 58, 134, 135, 136, 370, 141, + 375, 371, 643, 379, 67, 68, 69, 6, 71, 216, + 73, 658, 142, 66, 218, 662, 6, 359, 130, 78, + 62, 142, 520, 142, 533, 365, 514, 81, 514, 231, + 1, 582, 896, 82, 765, 365, 56, 670, 142, 520, + 549, 514, 142, 520, 366, 93, 549, 232, 897, 898, + 365, 6, 549, 625, 366, 131, 5, 107, 104, 19, + 20, 106, 109, 110, 608, 514, 123, 125, 757, 366, + 515, 549, 521, 107, 108, 19, 20, 608, 109, 110, + 143, 63, 183, 549, 209, 75, 17, 719, 866, 646, + 762, 656, 126, 641, 545, 660, 210, 808, 681, 756, + 146, 452, 376, 576, 777, 773, 771, 516, 487, 522, + 582, 183, 183, 28, 183, 183, 183, 222, 183, 224, + 225, 112, 670, 183, 131, 142, 533, 99, 16, 244, + 183, 546, 246, 78, 78, 78, 18, 112, 11, 583, + 113, 33, 482, 483, 12, 320, 326, 457, 332, 488, + 42, 671, 775, 489, 314, 534, 345, 500, 405, 353, + 406, 13, 469, 506, 549, 107, 108, 19, 20, 512, + 109, 110, 78, 212, 14, 35, 584, 624, 458, 917, + 918, 946, 869, 531, 387, 41, 870, 871, 672, 947, + 872, 543, 535, 470, 43, 111, 107, 108, 19, 20, + 464, 109, 110, 107, 464, 19, 20, 18, 109, 110, + 459, 873, 70, 114, 554, 461, 72, 19, 20, 19, + 20, 11, 74, 562, 86, 564, 312, 12, 567, 112, + 569, 88, 113, 91, 571, 114, 370, 380, 375, 371, + 315, 379, 460, 95, 13, 19, 20, 462, 96, 725, + 97, 726, 727, 316, 549, 19, 20, 14, 317, 728, + 112, 62, 729, 113, 730, 731, 780, 112, 318, 142, + 533, 781, 765, 388, 389, 390, 391, 319, 732, 393, + 394, 395, 396, 397, 733, 782, 400, 401, 365, 783, + 734, 835, 19, 20, 836, 430, 100, 784, 785, 735, + 736, 101, 154, 19, 20, 226, 102, 366, 737, 137, + 37, 103, 39, 154, 450, 19, 20, 105, 209, 151, + 148, 766, 59, 536, 60, 154, 61, 184, 226, 213, + 19, 20, 119, 78, 684, 158, 685, 686, 211, 467, + 376, 219, 238, 467, 687, 214, 231, 688, 78, 160, + 689, 25, 27, 162, 858, 239, 242, 927, 158, 590, + 160, 28, 243, 690, 232, 595, 928, 313, 119, 691, + 929, 600, 160, 333, 930, 692, 162, 591, 335, 361, + 536, 19, 20, 596, 693, 694, 536, 886, 336, 601, + 611, 338, 536, 695, 363, 593, 914, 339, 19, 20, + 347, 598, 619, 355, 321, 356, 357, 603, 612, 227, + 229, 536, 233, 234, 236, 142, 240, 322, 19, 20, + 620, 327, 323, 536, 152, 153, 614, 11, 154, 387, + 369, 155, 324, 12, 328, 156, 374, 119, 622, 329, + 392, 325, 861, 398, 403, 427, 19, 20, 399, 330, + 13, 408, 413, 419, 425, 428, 572, 157, 331, 429, + 589, 158, 432, 159, 431, 767, 594, 439, 441, 340, + 447, 449, 599, 114, 454, 160, 752, 161, 455, 162, + 700, 468, 341, 456, 486, 703, 604, 342, 472, 473, + 707, 610, 606, 475, 478, 710, 609, 343, 536, 712, + 19, 20, 592, 618, 480, 616, 344, 753, 597, 484, + 492, 490, 701, 493, 602, 494, 623, 704, 804, 551, + 742, 496, 708, 348, 497, 498, 499, 711, 501, 502, + 924, 713, 503, 613, 504, 505, 349, 507, 508, 820, + 509, 350, 510, 511, 513, 621, 527, 528, 823, 805, + 529, 351, 743, 924, 639, 19, 20, 640, 530, 725, + 352, 726, 727, 714, 715, 532, 716, 717, 718, 728, + 821, 539, 729, 540, 730, 731, 541, 228, 230, 824, + 767, 235, 237, 542, 241, 544, 552, 553, 732, 557, + 559, 561, 563, 536, 733, 560, 566, 568, 570, 699, + 734, 573, 669, 574, 575, 587, 680, 580, 581, 735, + 736, 514, 626, 627, 702, 629, 826, 630, 631, 636, + 632, 638, 644, 650, 709, 833, 654, 676, 705, 678, + 719, 706, 747, 748, 751, 763, 582, 755, 761, 741, + 770, 772, 722, 798, 744, 745, 723, 746, 827, 812, + 749, 750, 799, 800, 803, 819, 817, 834, 807, 822, + 19, 20, 78, 832, 44, 845, 45, 46, 828, 829, + 830, 831, 850, 864, 852, 853, 878, 47, 854, 855, + 48, 856, 857, 859, 862, 795, 796, 670, 797, 865, + 868, 899, 801, 802, 794, 880, 877, 119, 881, 49, + 882, 893, 50, 883, 78, 51, 884, 813, 879, 895, + 816, 885, 699, 52, 901, 908, 909, 913, 916, 925, + 912, 910, 926, 933, 934, 78, 939, 942, 943, 944, + 119, 945, 949, 948, 78, 950, 951, 952, 94, 825, + 364, 649, 860, 453, 81, 659, 863, 887, 888, 889, + 890, 891, 442, 362, 892, 776, 900, 844, 245, 846, + 250, 876, 849, 875, 741, 938, 941, 19, 20, 665, + 565, 185, 851, 186, 187, 903, 904, 905, 906, 907, + 119, 188, 558, 434, 189, 471, 764, 190, 556, 555, + 191, 192, 818, 0, 617, 0, 0, 0, 0, 0, + 193, 0, 0, 194, 195, 196, 197, 0, 198, 199, + 0, 0, 200, 0, 0, 0, 0, 0, 201, 0, + 0, 202, 203, 0, 0, 204, 0, 205, 0, 19, + 20, 0, 0, 684, 123, 685, 686, 0, 0, 0, + 0, 0, 0, 687, 0, 0, 688, 0, 0, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 920, 0, 0, 0, 252, 942, 253, 0, 942, + 0, 0, 690, 0, 0, 0, 0, 0, 691, 0, + 0, 0, 0, 0, 692, 0, 0, 0, 915, 0, + 0, 0, 0, 693, 694, 0, 0, 0, 0, 0, + 0, 937, 19, 20, 937, 0, 463, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 251, 0, 252, 0, 0, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 19, 20, 0, - 0, 186, 0, 187, 188, 0, 0, 0, 0, 0, - 0, 189, 0, 0, 190, 0, 0, 191, 0, 0, - 192, 193, 0, 0, 0, 0, 0, 0, 0, 0, - 194, 0, 0, 195, 196, 197, 198, 0, 199, 200, - 0, 0, 201, 0, 0, 0, 0, 0, 202, 0, - 0, 203, 204, 0, 0, 205, 0, 206, 19, 20, - 0, 0, 689, 0, 690, 691, 0, 0, 0, 0, - 0, 0, 692, 0, 0, 693, 0, 0, 694, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 695, 0, 0, 0, 0, 0, 696, 0, 0, - 0, 0, 0, 697, 0, 0, 0, 0, 0, 0, - 0, 0, 698, 699 + 304, 305, 306, 307, 308, 309 }; static const yytype_int16 yycheck[] = { - 11, 12, 13, 95, 220, 139, 106, 357, 455, 491, - 144, 15, 4, 167, 168, 169, 101, 102, 103, 450, - 105, 32, 727, 15, 35, 17, 223, 223, 225, 225, - 207, 643, 609, 619, 45, 46, 47, 139, 49, 607, - 51, 3, 144, 626, 3, 19, 12, 358, 6, 53, - 38, 43, 82, 207, 6, 7, 8, 9, 7, 11, - 12, 6, 7, 6, 7, 57, 77, 4, 24, 57, - 501, 63, 6, 7, 381, 8, 507, 0, 385, 561, - 6, 7, 513, 75, 36, 7, 60, 7, 399, 400, - 64, 36, 42, 43, 525, 12, 88, 30, 128, 91, - 73, 532, 75, 414, 96, 97, 7, 538, 64, 420, - 36, 77, 123, 544, 125, 426, 74, 79, 70, 219, - 8, 73, 81, 11, 76, 74, 76, 832, 73, 440, - 716, 74, 709, 225, 126, 718, 748, 448, 706, 3, - 74, 152, 153, 70, 155, 156, 157, 73, 159, 8, - 9, 7, 74, 164, 74, 147, 73, 149, 150, 163, - 171, 36, 166, 167, 168, 169, 6, 7, 8, 9, - 7, 11, 12, 74, 3, 7, 187, 188, 22, 190, - 36, 22, 51, 6, 7, 8, 9, 198, 11, 12, - 201, 368, 7, 185, 38, 626, 36, 38, 73, 36, - 69, 8, 9, 207, 36, 6, 383, 8, 9, 559, - 11, 12, 38, 57, 368, 226, 57, 73, 3, 54, - 6, 36, 8, 9, 31, 11, 12, 71, 12, 383, - 70, 57, 17, 73, 17, 71, 73, 44, 23, 373, - 23, 73, 49, 459, 378, 71, 39, 70, 180, 12, - 73, 75, 59, 72, 11, 40, 72, 40, 73, 16, - 72, 68, 55, 56, 461, 461, 463, 463, 53, 70, - 53, 373, 73, 30, 8, 9, 378, 34, 12, 76, - 14, 15, 8, 9, 70, 42, 43, 718, 22, 6, - 7, 25, 18, 27, 28, 21, 228, 229, 230, 231, - 8, 9, 234, 235, 236, 237, 238, 41, 72, 241, - 242, 8, 9, 47, 12, 13, 8, 9, 26, 53, - 12, 18, 14, 15, 21, 51, 337, 71, 62, 63, - 73, 20, 72, 25, 76, 79, 28, 71, 35, 65, - 29, 70, 442, 69, 33, 356, 8, 9, 37, 360, - 72, 48, 6, 7, 51, 47, 18, 54, 50, 12, - 72, 53, 72, 455, 368, 72, 72, 7, 65, 61, - 381, 463, 69, 74, 385, 77, 71, 824, 499, 383, - 500, 8, 9, 74, 505, 12, 506, 14, 15, 51, - 511, 78, 512, 77, 70, 22, 8, 9, 25, 491, - 500, 28, 12, 65, 51, 73, 506, 69, 72, 530, - 857, 531, 512, 72, 41, 72, 72, 72, 503, 31, - 47, 542, 498, 543, 509, 907, 53, 72, 504, 72, - 515, 531, 44, 72, 510, 62, 63, 49, 72, 8, - 9, 152, 153, 543, 71, 156, 157, 59, 159, 534, - 8, 9, 7, 529, 74, 71, 68, 8, 9, 6, - 471, 546, 31, 14, 15, 541, 17, 18, 74, 561, - 21, 51, 23, 31, 25, 44, 72, 827, 72, 29, - 49, 74, 501, 33, 34, 75, 44, 37, 507, 40, - 59, 49, 8, 9, 513, 487, 47, 72, 714, 68, - 51, 59, 53, 12, 72, 72, 72, 12, 58, 72, - 68, 76, 646, 532, 65, 31, 67, 651, 69, 619, - 72, 77, 656, 72, 701, 544, 518, 661, 44, 72, - 72, 665, 524, 49, 152, 153, 528, 155, 156, 157, - 76, 159, 72, 59, 646, 537, 24, 701, 26, 651, - 72, 72, 68, 687, 656, 73, 548, 72, 36, 661, - 38, 75, 40, 665, 75, 915, 743, 475, 75, 477, - 7, 75, 480, 75, 482, 72, 667, 668, 486, 670, - 671, 672, 72, 72, 72, 687, 72, 764, 938, 743, - 72, 72, 72, 72, 11, 587, 773, 72, 590, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 764, 72, 72, 829, 72, 72, 716, 72, 72, 773, - 8, 9, 11, 71, 12, 72, 14, 15, 72, 74, - 72, 72, 19, 644, 22, 19, 19, 25, 19, 27, - 28, 19, 72, 635, 72, 74, 72, 639, 70, 783, - 7, 72, 72, 41, 72, 7, 648, 72, 792, 47, - 72, 70, 76, 70, 12, 53, 658, 70, 76, 12, - 76, 72, 77, 684, 62, 63, 78, 72, 72, 690, - 691, 783, 693, 74, 676, 696, 697, 12, 680, 74, - 792, 7, 74, 72, 74, 72, 72, 701, 72, 74, - 12, 71, 12, 72, 72, 78, 78, 78, 71, 843, - 72, 78, 77, 72, 72, 76, 72, 72, 72, 7, - 731, 732, 71, 734, 71, 78, 70, 738, 739, 74, - 72, 77, 824, 72, 72, 72, 72, 729, 11, 743, - 11, 843, 753, 70, 36, 756, 77, 758, 80, 11, - 79, 81, 11, 11, 71, 81, 79, 11, 79, 70, - 764, 11, 11, 11, 79, 857, 11, 71, 71, 773, - 77, 779, 360, 858, 859, 860, 861, 862, 826, 219, - 610, 620, 829, 217, 348, 869, 725, 779, 642, 884, - 839, 836, 803, 938, 805, 810, 940, 808, 164, 810, - 631, 886, 887, 888, 889, 890, 478, 171, 471, 385, - 713, 340, 8, 9, 463, 907, 12, 13, 14, 15, + 11, 12, 13, 95, 4, 219, 356, 139, 167, 168, + 169, 15, 144, 722, 490, 15, 206, 17, 106, 454, + 449, 32, 606, 639, 35, 101, 102, 103, 222, 105, + 224, 222, 604, 224, 45, 46, 47, 3, 49, 139, + 51, 616, 6, 43, 144, 623, 3, 206, 36, 53, + 12, 6, 7, 6, 7, 38, 7, 57, 7, 51, + 4, 7, 39, 63, 22, 38, 77, 7, 6, 7, + 499, 7, 6, 7, 57, 75, 505, 69, 55, 56, + 38, 3, 511, 559, 57, 73, 0, 6, 88, 8, + 9, 91, 11, 12, 523, 7, 96, 97, 71, 57, + 36, 530, 36, 6, 7, 8, 9, 536, 11, 12, + 74, 73, 123, 542, 125, 81, 70, 12, 827, 74, + 704, 74, 79, 74, 36, 74, 126, 743, 74, 701, + 218, 357, 224, 36, 74, 713, 711, 73, 19, 73, + 7, 152, 153, 54, 155, 156, 157, 147, 159, 149, + 150, 70, 7, 164, 73, 6, 7, 82, 8, 163, + 171, 73, 166, 167, 168, 169, 3, 70, 17, 36, + 73, 12, 398, 399, 23, 186, 187, 367, 189, 60, + 30, 36, 77, 64, 184, 36, 197, 413, 73, 200, + 75, 40, 382, 419, 623, 6, 7, 8, 9, 425, + 11, 12, 206, 128, 53, 75, 73, 557, 367, 42, + 43, 71, 29, 439, 225, 72, 33, 34, 73, 79, + 37, 447, 73, 382, 71, 36, 6, 7, 8, 9, + 380, 11, 12, 6, 384, 8, 9, 3, 11, 12, + 372, 58, 72, 76, 458, 377, 72, 8, 9, 8, + 9, 17, 72, 474, 12, 476, 180, 23, 479, 70, + 481, 76, 73, 73, 485, 76, 460, 26, 462, 460, + 31, 462, 372, 72, 40, 8, 9, 377, 76, 12, + 70, 14, 15, 44, 713, 8, 9, 53, 49, 22, + 70, 12, 25, 73, 27, 28, 11, 70, 59, 6, + 7, 16, 22, 227, 228, 229, 230, 68, 41, 233, + 234, 235, 236, 237, 47, 30, 240, 241, 38, 34, + 53, 8, 8, 9, 11, 336, 72, 42, 43, 62, + 63, 72, 18, 8, 9, 21, 72, 57, 71, 7, + 24, 72, 26, 18, 355, 8, 9, 72, 359, 77, + 74, 71, 36, 441, 38, 18, 40, 71, 21, 78, + 8, 9, 454, 367, 12, 51, 14, 15, 74, 380, + 462, 70, 35, 384, 22, 77, 51, 25, 382, 65, + 28, 12, 13, 69, 819, 48, 12, 20, 51, 497, + 65, 54, 51, 41, 69, 503, 29, 73, 490, 47, + 33, 509, 65, 72, 37, 53, 69, 498, 72, 7, + 498, 8, 9, 504, 62, 63, 504, 852, 72, 510, + 528, 72, 510, 71, 74, 501, 902, 72, 8, 9, + 72, 507, 540, 72, 31, 72, 72, 513, 529, 152, + 153, 529, 155, 156, 157, 6, 159, 44, 8, 9, + 541, 31, 49, 541, 14, 15, 532, 17, 18, 470, + 71, 21, 59, 23, 44, 25, 74, 559, 544, 49, + 51, 68, 822, 72, 75, 12, 8, 9, 72, 59, + 40, 74, 72, 72, 72, 72, 486, 47, 68, 12, + 496, 51, 76, 53, 72, 709, 502, 72, 72, 31, + 72, 72, 508, 76, 72, 65, 696, 67, 72, 69, + 642, 77, 44, 72, 72, 647, 516, 49, 73, 75, + 652, 527, 522, 75, 75, 657, 526, 59, 616, 661, + 8, 9, 499, 539, 75, 535, 68, 696, 505, 75, + 7, 72, 642, 24, 511, 72, 546, 647, 738, 11, + 682, 72, 652, 31, 72, 72, 72, 657, 72, 72, + 910, 661, 72, 530, 72, 72, 44, 72, 72, 759, + 72, 49, 72, 72, 72, 542, 72, 72, 768, 738, + 72, 59, 682, 933, 584, 8, 9, 587, 72, 12, + 68, 14, 15, 663, 664, 72, 666, 667, 668, 22, + 759, 72, 25, 72, 27, 28, 72, 152, 153, 768, + 824, 156, 157, 72, 159, 72, 11, 71, 41, 72, + 72, 19, 19, 711, 47, 74, 19, 19, 19, 640, + 53, 72, 632, 72, 72, 70, 636, 74, 72, 62, + 63, 7, 72, 72, 644, 72, 778, 72, 72, 70, + 76, 7, 70, 12, 654, 787, 70, 76, 78, 76, + 12, 77, 72, 72, 72, 12, 7, 74, 74, 680, + 74, 74, 672, 72, 685, 686, 676, 688, 778, 12, + 691, 692, 72, 72, 72, 72, 71, 787, 74, 72, + 8, 9, 696, 77, 12, 12, 14, 15, 78, 78, + 78, 78, 71, 76, 72, 72, 838, 25, 72, 72, + 28, 72, 72, 71, 71, 726, 727, 7, 729, 74, + 70, 70, 733, 734, 724, 78, 77, 819, 72, 47, + 72, 11, 50, 72, 738, 53, 72, 748, 838, 11, + 751, 72, 753, 61, 36, 77, 80, 11, 11, 11, + 79, 81, 71, 81, 79, 759, 11, 70, 79, 11, + 852, 11, 11, 79, 768, 11, 71, 71, 77, 774, + 218, 607, 821, 359, 774, 617, 824, 853, 854, 855, + 856, 857, 347, 216, 864, 720, 879, 798, 164, 800, + 171, 834, 803, 831, 805, 933, 935, 8, 9, 628, + 477, 12, 805, 14, 15, 881, 882, 883, 884, 885, + 902, 22, 470, 339, 25, 384, 708, 28, 462, 460, + 31, 32, 753, -1, 536, -1, -1, -1, -1, -1, + 41, -1, -1, 44, 45, 46, 47, -1, 49, 50, + -1, -1, 53, -1, -1, -1, -1, -1, 59, -1, + -1, 62, 63, -1, -1, 66, -1, 68, -1, 8, + 9, -1, -1, 12, 864, 14, 15, -1, -1, -1, + -1, -1, -1, 22, -1, -1, 25, -1, -1, 28, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 41, -1, -1, -1, -1, -1, 47, -1, + -1, -1, -1, -1, 53, -1, -1, -1, 908, -1, + -1, -1, -1, 62, 63, -1, -1, -1, -1, -1, + -1, 932, 8, 9, 935, -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 461, 758, -1, 869, 538, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 913, -1, -1, -1, 8, 937, 10, -1, 940, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 8, 9, -1, - -1, 12, -1, 14, 15, -1, -1, -1, -1, -1, - -1, 22, -1, -1, 25, -1, -1, 28, -1, -1, - 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, - 41, -1, -1, 44, 45, 46, 47, -1, 49, 50, - -1, -1, 53, -1, -1, -1, -1, -1, 59, -1, - -1, 62, 63, -1, -1, 66, -1, 68, 8, 9, - -1, -1, 12, -1, 14, 15, -1, -1, -1, -1, - -1, -1, 22, -1, -1, 25, -1, -1, 28, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 41, -1, -1, -1, -1, -1, 47, -1, -1, - -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, - -1, -1, 62, 63 + 66, 67, 68, 69, 8, -1, 10, -1, -1, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 4, 83, 86, 87, 0, 3, 85, 88, 320, - 321, 17, 23, 40, 53, 106, 107, 70, 3, 8, - 9, 110, 114, 314, 108, 114, 112, 114, 54, 320, - 321, 89, 320, 12, 115, 75, 111, 115, 109, 115, + 0, 4, 83, 86, 87, 0, 3, 85, 88, 318, + 319, 17, 23, 40, 53, 106, 107, 70, 3, 8, + 9, 110, 114, 312, 108, 114, 112, 114, 54, 318, + 319, 89, 318, 12, 115, 75, 111, 115, 109, 115, 113, 72, 107, 71, 12, 14, 15, 25, 28, 47, - 50, 53, 61, 90, 91, 92, 314, 116, 314, 115, - 115, 115, 12, 73, 176, 178, 320, 314, 314, 314, - 72, 314, 72, 314, 72, 81, 316, 317, 321, 93, - 117, 320, 320, 95, 97, 94, 12, 96, 76, 172, - 98, 73, 99, 320, 92, 72, 76, 70, 177, 178, - 72, 72, 72, 72, 320, 72, 320, 6, 7, 11, + 50, 53, 61, 90, 91, 92, 312, 116, 312, 115, + 115, 115, 12, 73, 176, 178, 318, 312, 312, 312, + 72, 312, 72, 312, 72, 81, 314, 315, 319, 93, + 117, 318, 318, 95, 97, 94, 12, 96, 76, 172, + 98, 73, 99, 318, 92, 72, 76, 70, 177, 178, + 72, 72, 72, 72, 318, 72, 318, 6, 7, 11, 12, 36, 70, 73, 76, 256, 271, 272, 273, 274, - 279, 314, 179, 320, 118, 320, 79, 318, 319, 320, + 279, 312, 179, 318, 118, 318, 79, 316, 317, 318, 36, 73, 270, 274, 270, 270, 270, 7, 173, 174, 175, 270, 6, 74, 100, 101, 102, 280, 74, 275, 257, 77, 14, 15, 18, 21, 25, 47, 51, 53, 65, 67, 69, 107, 180, 181, 182, 187, 188, 189, 190, 191, 192, 193, 194, 197, 200, 207, 209, 211, - 284, 285, 287, 288, 314, 71, 12, 14, 15, 22, - 25, 28, 31, 32, 41, 44, 45, 46, 47, 49, - 50, 53, 59, 62, 63, 66, 68, 119, 120, 121, - 314, 320, 74, 178, 78, 77, 318, 319, 318, 319, - 70, 103, 281, 320, 276, 320, 320, 21, 193, 284, - 193, 284, 51, 69, 193, 193, 284, 193, 284, 35, - 48, 193, 284, 12, 51, 321, 181, 321, 317, 317, - 317, 192, 8, 10, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 84, 313, 313, 73, 320, 31, 44, 49, 59, - 68, 314, 31, 44, 49, 59, 68, 314, 31, 44, - 49, 59, 68, 314, 72, 134, 72, 72, 128, 72, - 72, 31, 44, 49, 59, 68, 314, 146, 72, 31, - 44, 49, 59, 68, 314, 140, 72, 72, 72, 316, - 317, 122, 7, 175, 74, 101, 38, 57, 104, 105, - 71, 273, 279, 282, 283, 74, 273, 274, 277, 278, - 279, 26, 258, 259, 260, 262, 263, 264, 314, 313, - 313, 313, 313, 51, 313, 313, 313, 313, 313, 72, - 72, 313, 313, 183, 75, 195, 73, 75, 289, 74, - 136, 130, 148, 142, 72, 124, 138, 132, 150, 144, - 72, 126, 135, 129, 147, 141, 72, 123, 12, 72, - 12, 314, 72, 76, 265, 265, 137, 131, 149, 143, - 72, 125, 72, 172, 139, 133, 151, 145, 72, 127, - 72, 314, 256, 176, 121, 72, 72, 72, 316, 317, - 318, 319, 318, 319, 12, 84, 261, 312, 314, 77, - 316, 317, 261, 73, 75, 291, 75, 293, 198, 75, - 290, 75, 292, 176, 176, 75, 294, 72, 19, 60, - 64, 72, 254, 7, 24, 64, 72, 305, 72, 72, - 72, 72, 176, 72, 72, 72, 72, 72, 176, 72, - 72, 72, 72, 72, 176, 72, 7, 36, 73, 166, - 168, 310, 7, 36, 73, 102, 152, 154, 266, 72, - 72, 72, 72, 176, 72, 7, 36, 73, 102, 159, - 161, 72, 72, 72, 72, 176, 72, 36, 73, 169, - 171, 310, 271, 11, 11, 71, 105, 283, 278, 72, - 260, 72, 74, 19, 305, 19, 305, 254, 19, 305, - 19, 305, 19, 305, 320, 72, 72, 72, 36, 255, - 272, 196, 74, 72, 72, 7, 36, 73, 306, 308, - 70, 295, 166, 152, 159, 169, 270, 166, 152, 159, - 169, 270, 166, 152, 159, 169, 270, 320, 155, 320, - 309, 310, 320, 166, 152, 159, 169, 270, 162, 320, - 309, 166, 152, 159, 169, 270, 320, 256, 272, 72, - 72, 199, 72, 72, 72, 76, 201, 210, 208, 70, - 244, 7, 286, 320, 320, 74, 167, 168, 70, 156, - 74, 153, 154, 156, 12, 267, 268, 269, 70, 163, - 74, 160, 161, 163, 74, 170, 171, 202, 204, 244, - 205, 203, 206, 320, 7, 36, 73, 212, 214, 311, - 76, 221, 76, 215, 320, 215, 74, 307, 308, 12, - 14, 15, 22, 25, 28, 41, 47, 53, 62, 63, - 71, 296, 297, 298, 314, 318, 319, 320, 318, 319, - 78, 77, 318, 319, 320, 318, 319, 318, 319, 212, - 212, 212, 212, 212, 12, 184, 185, 320, 320, 216, - 12, 14, 15, 22, 25, 27, 28, 41, 47, 53, - 62, 63, 71, 245, 246, 247, 314, 318, 319, 314, - 314, 314, 72, 72, 314, 314, 72, 316, 317, 299, - 74, 168, 71, 105, 157, 158, 74, 154, 12, 269, - 22, 71, 105, 164, 165, 74, 161, 74, 171, 186, - 77, 185, 74, 213, 214, 11, 16, 30, 34, 42, - 43, 222, 223, 224, 225, 226, 227, 229, 230, 320, - 314, 314, 314, 72, 72, 72, 314, 314, 72, 316, - 317, 248, 74, 308, 301, 303, 300, 12, 314, 302, - 304, 314, 71, 298, 72, 316, 317, 72, 316, 317, - 117, 318, 319, 78, 78, 78, 78, 77, 318, 319, - 8, 11, 217, 218, 219, 315, 250, 252, 249, 314, - 12, 314, 251, 253, 314, 71, 247, 72, 72, 72, - 72, 72, 72, 271, 71, 158, 256, 71, 165, 76, - 74, 214, 231, 70, 29, 33, 34, 37, 58, 228, - 228, 224, 77, 318, 319, 78, 72, 72, 72, 72, - 72, 271, 270, 270, 270, 270, 270, 179, 11, 232, - 11, 39, 55, 56, 70, 219, 36, 220, 270, 270, - 270, 270, 270, 77, 80, 81, 233, 79, 11, 272, - 320, 11, 42, 43, 234, 235, 236, 238, 243, 256, - 11, 71, 20, 29, 33, 37, 241, 237, 81, 79, - 239, 242, 314, 235, 11, 240, 242, 70, 79, 11, - 11, 71, 79, 79, 11, 11, 71, 71 + 284, 285, 286, 312, 71, 12, 14, 15, 22, 25, + 28, 31, 32, 41, 44, 45, 46, 47, 49, 50, + 53, 59, 62, 63, 66, 68, 119, 120, 121, 312, + 318, 74, 178, 78, 77, 316, 317, 316, 317, 70, + 103, 281, 318, 276, 318, 318, 21, 193, 284, 193, + 284, 51, 69, 193, 193, 284, 193, 284, 35, 48, + 193, 284, 12, 51, 319, 181, 319, 315, 315, 315, + 192, 8, 10, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 84, 311, 311, 73, 318, 31, 44, 49, 59, 68, + 312, 31, 44, 49, 59, 68, 312, 31, 44, 49, + 59, 68, 312, 72, 134, 72, 72, 128, 72, 72, + 31, 44, 49, 59, 68, 312, 146, 72, 31, 44, + 49, 59, 68, 312, 140, 72, 72, 72, 314, 315, + 122, 7, 175, 74, 101, 38, 57, 104, 105, 71, + 273, 279, 282, 283, 74, 273, 274, 277, 278, 279, + 26, 258, 259, 260, 262, 263, 264, 312, 311, 311, + 311, 311, 51, 311, 311, 311, 311, 311, 72, 72, + 311, 311, 183, 75, 195, 73, 75, 287, 74, 136, + 130, 148, 142, 72, 124, 138, 132, 150, 144, 72, + 126, 135, 129, 147, 141, 72, 123, 12, 72, 12, + 312, 72, 76, 265, 265, 137, 131, 149, 143, 72, + 125, 72, 172, 139, 133, 151, 145, 72, 127, 72, + 312, 256, 176, 121, 72, 72, 72, 314, 315, 316, + 317, 316, 317, 12, 84, 261, 310, 312, 77, 314, + 315, 261, 73, 75, 289, 75, 291, 198, 75, 288, + 75, 290, 176, 176, 75, 292, 72, 19, 60, 64, + 72, 254, 7, 24, 72, 303, 72, 72, 72, 72, + 176, 72, 72, 72, 72, 72, 176, 72, 72, 72, + 72, 72, 176, 72, 7, 36, 73, 166, 168, 308, + 7, 36, 73, 102, 152, 154, 266, 72, 72, 72, + 72, 176, 72, 7, 36, 73, 102, 159, 161, 72, + 72, 72, 72, 176, 72, 36, 73, 169, 171, 308, + 271, 11, 11, 71, 105, 283, 278, 72, 260, 72, + 74, 19, 303, 19, 303, 254, 19, 303, 19, 303, + 19, 303, 318, 72, 72, 72, 36, 255, 272, 196, + 74, 72, 7, 36, 73, 304, 306, 70, 293, 166, + 152, 159, 169, 270, 166, 152, 159, 169, 270, 166, + 152, 159, 169, 270, 318, 155, 318, 307, 308, 318, + 166, 152, 159, 169, 270, 162, 318, 307, 166, 152, + 159, 169, 270, 318, 256, 272, 72, 72, 199, 72, + 72, 72, 76, 201, 210, 208, 70, 244, 7, 318, + 318, 74, 167, 168, 70, 156, 74, 153, 154, 156, + 12, 267, 268, 269, 70, 163, 74, 160, 161, 163, + 74, 170, 171, 202, 204, 244, 205, 203, 206, 318, + 7, 36, 73, 212, 214, 309, 76, 221, 76, 215, + 318, 74, 305, 306, 12, 14, 15, 22, 25, 28, + 41, 47, 53, 62, 63, 71, 294, 295, 296, 312, + 316, 317, 318, 316, 317, 78, 77, 316, 317, 318, + 316, 317, 316, 317, 212, 212, 212, 212, 212, 12, + 184, 185, 318, 318, 216, 12, 14, 15, 22, 25, + 27, 28, 41, 47, 53, 62, 63, 71, 245, 246, + 247, 312, 316, 317, 312, 312, 312, 72, 72, 312, + 312, 72, 314, 315, 297, 74, 168, 71, 105, 157, + 158, 74, 154, 12, 269, 22, 71, 105, 164, 165, + 74, 161, 74, 171, 186, 77, 185, 74, 213, 214, + 11, 16, 30, 34, 42, 43, 222, 223, 224, 225, + 226, 227, 229, 230, 318, 312, 312, 312, 72, 72, + 72, 312, 312, 72, 314, 315, 248, 74, 306, 299, + 301, 298, 12, 312, 300, 302, 312, 71, 296, 72, + 314, 315, 72, 314, 315, 117, 316, 317, 78, 78, + 78, 78, 77, 316, 317, 8, 11, 217, 218, 219, + 313, 250, 252, 249, 312, 12, 312, 251, 253, 312, + 71, 247, 72, 72, 72, 72, 72, 72, 271, 71, + 158, 256, 71, 165, 76, 74, 214, 231, 70, 29, + 33, 34, 37, 58, 228, 228, 224, 77, 316, 317, + 78, 72, 72, 72, 72, 72, 271, 270, 270, 270, + 270, 270, 179, 11, 232, 11, 39, 55, 56, 70, + 219, 36, 220, 270, 270, 270, 270, 270, 77, 80, + 81, 233, 79, 11, 272, 318, 11, 42, 43, 234, + 235, 236, 238, 243, 256, 11, 71, 20, 29, 33, + 37, 241, 237, 81, 79, 239, 242, 312, 235, 11, + 240, 242, 70, 79, 11, 11, 71, 79, 79, 11, + 11, 71, 71 }; #define yyerrok (yyerrstatus = 0) @@ -6301,27 +6288,6 @@ YYSTYPE yylval; /* Line 1455 of yacc.c */ #line 3225 "pxr/usd/sdf/textFileFormat.yy" - { - _PrimInitRelationship((yyvsp[(2) - (5)]), context); - ;} - break; - - case 459: - -/* Line 1455 of yacc.c */ -#line 3228 "pxr/usd/sdf/textFileFormat.yy" - { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - _PrimEndRelationship(context); - ;} - break; - - case 460: - -/* Line 1455 of yacc.c */ -#line 3237 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (6)]), context); @@ -6336,128 +6302,128 @@ YYSTYPE yylval; ;} break; - case 461: + case 459: /* Line 1455 of yacc.c */ -#line 3252 "pxr/usd/sdf/textFileFormat.yy" +#line 3240 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (2)]), context); context->relParsingAllowTargetData = true; ;} break; - case 462: + case 460: /* Line 1455 of yacc.c */ -#line 3257 "pxr/usd/sdf/textFileFormat.yy" +#line 3245 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeExplicit, context); _PrimEndRelationship(context); ;} break; - case 463: + case 461: /* Line 1455 of yacc.c */ -#line 3262 "pxr/usd/sdf/textFileFormat.yy" +#line 3250 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); ;} break; - case 464: + case 462: /* Line 1455 of yacc.c */ -#line 3265 "pxr/usd/sdf/textFileFormat.yy" +#line 3253 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeDeleted, context); _PrimEndRelationship(context); ;} break; - case 465: + case 463: /* Line 1455 of yacc.c */ -#line 3270 "pxr/usd/sdf/textFileFormat.yy" +#line 3258 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; ;} break; - case 466: + case 464: /* Line 1455 of yacc.c */ -#line 3274 "pxr/usd/sdf/textFileFormat.yy" +#line 3262 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeAdded, context); _PrimEndRelationship(context); ;} break; - case 467: + case 465: /* Line 1455 of yacc.c */ -#line 3278 "pxr/usd/sdf/textFileFormat.yy" +#line 3266 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; ;} break; - case 468: + case 466: /* Line 1455 of yacc.c */ -#line 3282 "pxr/usd/sdf/textFileFormat.yy" +#line 3270 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypePrepended, context); _PrimEndRelationship(context); ;} break; - case 469: + case 467: /* Line 1455 of yacc.c */ -#line 3286 "pxr/usd/sdf/textFileFormat.yy" +#line 3274 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); context->relParsingAllowTargetData = true; ;} break; - case 470: + case 468: /* Line 1455 of yacc.c */ -#line 3290 "pxr/usd/sdf/textFileFormat.yy" +#line 3278 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeAppended, context); _PrimEndRelationship(context); ;} break; - case 471: + case 469: /* Line 1455 of yacc.c */ -#line 3295 "pxr/usd/sdf/textFileFormat.yy" +#line 3283 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(3) - (3)]), context); ;} break; - case 472: + case 470: /* Line 1455 of yacc.c */ -#line 3298 "pxr/usd/sdf/textFileFormat.yy" +#line 3286 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipSetTargetsList(SdfListOpTypeOrdered, context); _PrimEndRelationship(context); ;} break; - case 473: + case 471: /* Line 1455 of yacc.c */ -#line 3303 "pxr/usd/sdf/textFileFormat.yy" +#line 3291 "pxr/usd/sdf/textFileFormat.yy" { _PrimInitRelationship((yyvsp[(2) - (5)]), context); context->relParsingAllowTargetData = true; @@ -6467,10 +6433,10 @@ YYSTYPE yylval; ;} break; - case 484: + case 481: /* Line 1455 of yacc.c */ -#line 3332 "pxr/usd/sdf/textFileFormat.yy" +#line 3319 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Comment, @@ -6478,123 +6444,123 @@ YYSTYPE yylval; ;} break; - case 485: + case 482: /* Line 1455 of yacc.c */ -#line 3337 "pxr/usd/sdf/textFileFormat.yy" +#line 3324 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(1) - (1)]), SdfSpecTypeRelationship, context); ;} break; - case 486: + case 483: /* Line 1455 of yacc.c */ -#line 3339 "pxr/usd/sdf/textFileFormat.yy" +#line 3326 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 487: + case 484: /* Line 1455 of yacc.c */ -#line 3346 "pxr/usd/sdf/textFileFormat.yy" +#line 3333 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeDeleted; ;} break; - case 488: + case 485: /* Line 1455 of yacc.c */ -#line 3349 "pxr/usd/sdf/textFileFormat.yy" +#line 3336 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 489: + case 486: /* Line 1455 of yacc.c */ -#line 3352 "pxr/usd/sdf/textFileFormat.yy" +#line 3339 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeAdded; ;} break; - case 490: + case 487: /* Line 1455 of yacc.c */ -#line 3355 "pxr/usd/sdf/textFileFormat.yy" +#line 3342 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 491: + case 488: /* Line 1455 of yacc.c */ -#line 3358 "pxr/usd/sdf/textFileFormat.yy" +#line 3345 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypePrepended; ;} break; - case 492: + case 489: /* Line 1455 of yacc.c */ -#line 3361 "pxr/usd/sdf/textFileFormat.yy" +#line 3348 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 493: + case 490: /* Line 1455 of yacc.c */ -#line 3364 "pxr/usd/sdf/textFileFormat.yy" +#line 3351 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeAppended; ;} break; - case 494: + case 491: /* Line 1455 of yacc.c */ -#line 3367 "pxr/usd/sdf/textFileFormat.yy" +#line 3354 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 495: + case 492: /* Line 1455 of yacc.c */ -#line 3370 "pxr/usd/sdf/textFileFormat.yy" +#line 3357 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataStart((yyvsp[(2) - (2)]), SdfSpecTypeRelationship, context); context->listOpType = SdfListOpTypeOrdered; ;} break; - case 496: + case 493: /* Line 1455 of yacc.c */ -#line 3373 "pxr/usd/sdf/textFileFormat.yy" +#line 3360 "pxr/usd/sdf/textFileFormat.yy" { _GenericMetadataEnd(SdfSpecTypeRelationship, context); ;} break; - case 497: + case 494: /* Line 1455 of yacc.c */ -#line 3378 "pxr/usd/sdf/textFileFormat.yy" +#line 3365 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Documentation, @@ -6602,10 +6568,10 @@ YYSTYPE yylval; ;} break; - case 498: + case 495: /* Line 1455 of yacc.c */ -#line 3385 "pxr/usd/sdf/textFileFormat.yy" +#line 3372 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->Permission, @@ -6614,10 +6580,10 @@ YYSTYPE yylval; ;} break; - case 499: + case 496: /* Line 1455 of yacc.c */ -#line 3393 "pxr/usd/sdf/textFileFormat.yy" +#line 3380 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -6625,10 +6591,10 @@ YYSTYPE yylval; ;} break; - case 500: + case 497: /* Line 1455 of yacc.c */ -#line 3398 "pxr/usd/sdf/textFileFormat.yy" +#line 3385 "pxr/usd/sdf/textFileFormat.yy" { _SetField( context->path, SdfFieldKeys->SymmetryFunction, @@ -6636,71 +6602,71 @@ YYSTYPE yylval; ;} break; - case 504: + case 501: /* Line 1455 of yacc.c */ -#line 3412 "pxr/usd/sdf/textFileFormat.yy" +#line 3399 "pxr/usd/sdf/textFileFormat.yy" { context->relParsingTargetPaths = SdfPathVector(); ;} break; - case 505: + case 502: /* Line 1455 of yacc.c */ -#line 3415 "pxr/usd/sdf/textFileFormat.yy" +#line 3402 "pxr/usd/sdf/textFileFormat.yy" { context->relParsingTargetPaths = SdfPathVector(); ;} break; - case 509: + case 506: /* Line 1455 of yacc.c */ -#line 3427 "pxr/usd/sdf/textFileFormat.yy" +#line 3414 "pxr/usd/sdf/textFileFormat.yy" { _RelationshipAppendTargetPath((yyvsp[(1) - (1)]), context); ;} break; - case 510: + case 507: /* Line 1455 of yacc.c */ -#line 3437 "pxr/usd/sdf/textFileFormat.yy" +#line 3424 "pxr/usd/sdf/textFileFormat.yy" { context->savedPath = SdfPath(); ;} break; - case 512: + case 509: /* Line 1455 of yacc.c */ -#line 3444 "pxr/usd/sdf/textFileFormat.yy" +#line 3431 "pxr/usd/sdf/textFileFormat.yy" { _PathSetPrim((yyvsp[(1) - (1)]), context); ;} break; - case 513: + case 510: /* Line 1455 of yacc.c */ -#line 3450 "pxr/usd/sdf/textFileFormat.yy" +#line 3437 "pxr/usd/sdf/textFileFormat.yy" { _PathSetPrimOrPropertyScenePath((yyvsp[(1) - (1)]), context); ;} break; - case 522: + case 519: /* Line 1455 of yacc.c */ -#line 3482 "pxr/usd/sdf/textFileFormat.yy" +#line 3469 "pxr/usd/sdf/textFileFormat.yy" { (yyval) = (yyvsp[(1) - (1)]); ;} break; /* Line 1455 of yacc.c */ -#line 6698 "pxr/usd/sdf/textFileFormat.tab.cpp" +#line 6664 "pxr/usd/sdf/textFileFormat.tab.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6912,7 +6878,7 @@ YYSTYPE yylval; /* Line 1675 of yacc.c */ -#line 3514 "pxr/usd/sdf/textFileFormat.yy" +#line 3501 "pxr/usd/sdf/textFileFormat.yy" //-------------------------------------------------------------------- diff --git a/pxr/usd/sdf/textFileFormat.yy b/pxr/usd/sdf/textFileFormat.yy index 6d5941b92c..14f3275d41 100644 --- a/pxr/usd/sdf/textFileFormat.yy +++ b/pxr/usd/sdf/textFileFormat.yy @@ -3220,18 +3220,6 @@ prim_relationship_type : context->variability = VtValue(SdfVariabilityVarying); } ; - -prim_relationship_time_samples: - prim_relationship_type namespaced_name '.' TOK_TIME_SAMPLES '=' { - _PrimInitRelationship($2, context); - } - time_samples_rhs { - _SetField( - context->path, SdfFieldKeys->TimeSamples, - context->timeSamples, context); - _PrimEndRelationship(context); - } - ; prim_relationship_default: prim_relationship_type namespaced_name '.' TOK_DEFAULT '=' TOK_PATHREF { @@ -3307,7 +3295,6 @@ prim_relationship: _RelationshipInitTarget(context->relParsingTargetPaths->back(), context); } - | prim_relationship_time_samples | prim_relationship_default ; From 41cdee522d532dfcb3f31fb165fced646395793c Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Fri, 9 Aug 2024 20:31:37 -0700 Subject: [PATCH 027/202] Moving code to compute contributing sample times out of data source legacy prim to HdGetContributingSampleTimesForInterval in hd/timeSampleArray.h (Internal change: 2336171) --- pxr/imaging/hd/dataSourceLegacyPrim.cpp | 63 ++++--------------------- pxr/imaging/hd/timeSampleArray.cpp | 57 ++++++++++++++++++++++ pxr/imaging/hd/timeSampleArray.h | 24 ++++++++++ 3 files changed, 91 insertions(+), 53 deletions(-) diff --git a/pxr/imaging/hd/dataSourceLegacyPrim.cpp b/pxr/imaging/hd/dataSourceLegacyPrim.cpp index 869bb26736..3132b493fc 100644 --- a/pxr/imaging/hd/dataSourceLegacyPrim.cpp +++ b/pxr/imaging/hd/dataSourceLegacyPrim.cpp @@ -97,49 +97,6 @@ HdLegacyPrimTypeIsVolumeField(TfToken const &primType) namespace { -// Returns contributing sample times for the interval from startTime to endTime. -// -// If there is no time sample at startTime, this will include the sample time -// of the sample just before startTime if it exists. -// Similarly for endTime. -// -template -static -void _FillSampleTimes( - const TimeSampleArray &timeSamples, - const HdSampledDataSource::Time startTime, - const HdSampledDataSource::Time endTime, - std::vector * const outSampleTimes) -{ - if (!outSampleTimes) { - return; - } - for (size_t i = 0; i < timeSamples.count; ++i) { - const float t = timeSamples.times[i]; - if (outSampleTimes->empty()) { - if (t > startTime && i > 0) { - // Include sample just before the start time. - outSampleTimes->push_back(timeSamples.times[i - 1]); - } - if (t >= startTime) { - // Include sample at start time or the first sample - // after the start time. - outSampleTimes->push_back(timeSamples.times[i]); - } - } else { - outSampleTimes->push_back(timeSamples.times[i]); - } - if (t >= endTime) { - // We have sound the sample at the end time or beyond - // the end time. We are done. - break; - } - } - if (outSampleTimes->empty() && timeSamples.count > 0) { - outSampleTimes->push_back(timeSamples.times[0]); - } -} - class Hd_DataSourceLegacyPrimvarValue : public HdSampledDataSource { public: @@ -189,9 +146,8 @@ class Hd_DataSourceLegacyPrimvarValue : public HdSampledDataSource // XXX: Start and end times come from the sene delegate, so we can't // get samples outside of those provided. However, we can clamp // returned samples to be in the right range. - _FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes); - - return outSampleTimes->size() > 1; + return _timeSamples.GetContributingSampleTimesForInterval( + startTime, endTime, outSampleTimes); } private: @@ -251,7 +207,8 @@ class Hd_DataSourceLegacyIndexedPrimvarValue : public HdSampledDataSource // XXX: Start and end times come from the sene delegate, so we can't // get samples outside of those provided. However, we can clamp // returned samples to be in the right range. - _FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes); + _timeSamples.GetContributingSampleTimesForInterval( + startTime, endTime, outSampleTimes); return true; } @@ -320,8 +277,8 @@ class Hd_DataSourceLegacyPrimvarIndices : // XXX: Start and end times come from the sene delegate, so we can't // get samples outside of those provided. However, we can clamp // returned samples to be in the right range. - _FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes); - + _timeSamples.GetContributingSampleTimesForInterval( + startTime, endTime, outSampleTimes); return true; } @@ -474,8 +431,8 @@ class Hd_DataSourceLegacyMatrixValue : public HdMatrixDataSource // XXX: Start and end times come from the scene delegate, so we can't // get samples outside of those provided. However, we can clamp // returned samples to be in the right range. - _FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes); - + _timeSamples.GetContributingSampleTimesForInterval( + startTime, endTime, outSampleTimes); return true; } @@ -1897,8 +1854,8 @@ class Hd_DataSourceLegacyExtComputationInput : public HdSampledDataSource // XXX: Start and end times come from the sene delegate, so we can't // get samples outside of those provided. However, we can clamp // returned samples to be in the right range. - _FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes); - + _timeSamples.GetContributingSampleTimesForInterval( + startTime, endTime, outSampleTimes); return true; } diff --git a/pxr/imaging/hd/timeSampleArray.cpp b/pxr/imaging/hd/timeSampleArray.cpp index d2777c167a..de6cb14a81 100644 --- a/pxr/imaging/hd/timeSampleArray.cpp +++ b/pxr/imaging/hd/timeSampleArray.cpp @@ -108,4 +108,61 @@ HdResampleNeighbors(float alpha, const VtValue& v0, const VtValue& v1) return result; } +bool +HdGetContributingSampleTimesForInterval( + const size_t count, + const float * const sampleTimes, + const float startTime, + const float endTime, + std::vector * const outSampleTimes) +{ + size_t numOutSamples = 0; + + for (size_t i = 0; i < count; ++i) { + const float t = sampleTimes[i]; + if (numOutSamples == 0) { + if (t > startTime && i > 0) { + numOutSamples++; + // Include sample just before the start time. + if (outSampleTimes) { + outSampleTimes->push_back(sampleTimes[i - 1]); + } + } + if (t >= startTime) { + // Include sample at start time or the first sample + // after the start time. + numOutSamples++; + if (outSampleTimes) { + outSampleTimes->push_back(t); + } else { + if (numOutSamples >= 2) { + return true; + } + } + } + } else { + numOutSamples++; + if (outSampleTimes) { + outSampleTimes->push_back(t); + } else { + return true; + } + } + if (t >= endTime) { + // We have sound the sample at the end time or beyond + // the end time. We are done. + break; + } + } + + if (numOutSamples == 0) { + if (outSampleTimes && count > 0) { + outSampleTimes->push_back(sampleTimes[0]); + } + return false; + } + + return numOutSamples > 1; +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/hd/timeSampleArray.h b/pxr/imaging/hd/timeSampleArray.h index b2b2420d3c..a8788b27d1 100644 --- a/pxr/imaging/hd/timeSampleArray.h +++ b/pxr/imaging/hd/timeSampleArray.h @@ -146,6 +146,21 @@ std::pair HdResampleRawTimeSamples( } } +// Returns contributing sample times for the interval from startTime to endTime. +// +// If there is no sample at the startTime, this will include the sample times +// just before the start time if it exists. Similarly for the endTime. +// +// Return true if the value is changing on the interval from startTime to +// endTime - or equivalently if we return two times. +bool +HdGetContributingSampleTimesForInterval( + size_t count, + const float * sampleTimes, + float startTime, + float endTime, + std::vector * outSampleTimes); + /// An array of a value sampled over time, in struct-of-arrays layout. /// This is provided as a convenience for time-sampling attributes. /// This type has static capacity but dynamic size, providing @@ -206,6 +221,15 @@ struct HdTimeSampleArray return ret; } + /// See HdGetContributingSampleTimesForInterval. + bool GetContributingSampleTimesForInterval( + const float startTime, const float endTime, + std::vector * const outSampleTimes) const + { + return HdGetContributingSampleTimesForInterval( + count, times.data(), startTime, endTime, outSampleTimes); + } + size_t count; TfSmallVector times; TfSmallVector values; From 63abeaffe95ea6b18caa697cfae3ec66e9e2b1fc Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Fri, 9 Aug 2024 20:31:53 -0700 Subject: [PATCH 028/202] Promote NdrSdfTypeIndicator to a Class (Internal change: 2336338) --- pxr/imaging/hdSt/materialNetwork.cpp | 4 +- pxr/usd/ndr/CMakeLists.txt | 2 + pxr/usd/ndr/declare.h | 1 - pxr/usd/ndr/module.cpp | 1 + pxr/usd/ndr/property.cpp | 7 +- pxr/usd/ndr/property.h | 16 ++-- pxr/usd/ndr/registry.cpp | 2 +- pxr/usd/ndr/sdfTypeIndicator.cpp | 54 +++++++++++++ pxr/usd/ndr/sdfTypeIndicator.h | 78 ++++++++++++++++++ pxr/usd/ndr/wrapProperty.cpp | 3 +- pxr/usd/ndr/wrapSdfTypeIndicator.cpp | 28 +++++++ pxr/usd/sdr/shaderParserTestUtils.py | 30 ++++--- pxr/usd/sdr/shaderProperty.cpp | 81 ++++++++++--------- pxr/usd/sdr/shaderProperty.h | 19 ++--- pxr/usd/sdr/testenv/testSdrRegistry.py | 10 +-- pxr/usd/usdLux/testenv/testUsdLuxLight.py | 5 +- .../usdShade/testenv/testUsdShadeShaderDef.py | 2 +- pxr/usd/usdShade/validators.cpp | 3 +- pxr/usd/usdUtils/complianceChecker.py | 3 +- pxr/usd/usdUtils/updateSchemaWithSdrNode.py | 2 +- 20 files changed, 262 insertions(+), 89 deletions(-) create mode 100644 pxr/usd/ndr/sdfTypeIndicator.cpp create mode 100644 pxr/usd/ndr/sdfTypeIndicator.h create mode 100644 pxr/usd/ndr/wrapSdfTypeIndicator.cpp diff --git a/pxr/imaging/hdSt/materialNetwork.cpp b/pxr/imaging/hdSt/materialNetwork.cpp index 8a8ebcb62c..d2329cc5a5 100644 --- a/pxr/imaging/hdSt/materialNetwork.cpp +++ b/pxr/imaging/hdSt/materialNetwork.cpp @@ -222,7 +222,7 @@ _GetNodeFallbackValue( // If no default value was registered with Sdr for // the output, fallback to the type's default. - return output->GetTypeAsSdfType().first.GetDefaultValue(); + return output->GetTypeAsSdfType().GetSdfType().GetDefaultValue(); } return VtValue(); @@ -280,7 +280,7 @@ _GetParamFallbackValue( // If not default value was registered with Sdr for // the output, fallback to the type's default. if (out.IsEmpty()) { - out = input->GetTypeAsSdfType().first.GetDefaultValue(); + out = input->GetTypeAsSdfType().GetSdfType().GetDefaultValue(); } if (!out.IsEmpty()) return out; diff --git a/pxr/usd/ndr/CMakeLists.txt b/pxr/usd/ndr/CMakeLists.txt index 929d5c592f..07de60ec88 100644 --- a/pxr/usd/ndr/CMakeLists.txt +++ b/pxr/usd/ndr/CMakeLists.txt @@ -24,6 +24,7 @@ pxr_library(ndr parserPlugin property registry + sdfTypeIndicator PUBLIC_HEADERS api.h @@ -42,6 +43,7 @@ pxr_library(ndr wrapNodeDiscoveryResult.cpp wrapProperty.cpp wrapRegistry.cpp + wrapSdfTypeIndicator.cpp PYMODULE_FILES __init__.py diff --git a/pxr/usd/ndr/declare.h b/pxr/usd/ndr/declare.h index 3cdbeda547..f0836ac14a 100644 --- a/pxr/usd/ndr/declare.h +++ b/pxr/usd/ndr/declare.h @@ -63,7 +63,6 @@ typedef std::vector NdrStringVec; typedef std::pair NdrOption; typedef std::vector NdrOptionVec; typedef std::unordered_set NdrStringSet; -typedef std::pair NdrSdfTypeIndicator; // Version class NdrVersion { diff --git a/pxr/usd/ndr/module.cpp b/pxr/usd/ndr/module.cpp index 323f82d8e3..00e73fdd33 100644 --- a/pxr/usd/ndr/module.cpp +++ b/pxr/usd/ndr/module.cpp @@ -20,4 +20,5 @@ TF_WRAP_MODULE TF_WRAP( NodeDiscoveryResult ); TF_WRAP( Property ); TF_WRAP( Registry ); + TF_WRAP( SdfTypeIndicator ); } diff --git a/pxr/usd/ndr/property.cpp b/pxr/usd/ndr/property.cpp index 4a05df3207..542b7eb6d9 100644 --- a/pxr/usd/ndr/property.cpp +++ b/pxr/usd/ndr/property.cpp @@ -62,12 +62,9 @@ NdrProperty::CanConnectTo(const NdrProperty& other) const return _type == other.GetType(); } -const NdrSdfTypeIndicator +NdrSdfTypeIndicator NdrProperty::GetTypeAsSdfType() const { - return std::make_pair( - SdfValueTypeNames->Token, - _type - ); + return NdrSdfTypeIndicator(SdfValueTypeNames->Token, _type, false); } const VtValue& diff --git a/pxr/usd/ndr/property.h b/pxr/usd/ndr/property.h index 07cf9af208..32194edfe0 100644 --- a/pxr/usd/ndr/property.h +++ b/pxr/usd/ndr/property.h @@ -12,6 +12,7 @@ #include "pxr/pxr.h" #include "pxr/usd/ndr/api.h" +#include "pxr/usd/ndr/sdfTypeIndicator.h" #include "pxr/base/tf/token.h" #include "pxr/base/vt/value.h" #include "pxr/usd/ndr/declare.h" @@ -129,14 +130,15 @@ class NdrProperty /// \name Utilities /// @{ - /// Converts the property's type from `GetType()` into a `SdfValueTypeName`. + /// Converts the property's type from `GetType()` into a + /// `NdrSdfTypeIndicator`. /// /// Two scenarios can result: an exact mapping from property type to Sdf - /// type, and an inexact mapping. In the first scenario, the first element - /// in the pair will be the cleanly-mapped Sdf type, and the second element, - /// a TfToken, will be empty. In the second scenario, the Sdf type will be - /// set to `Token` to indicate an unclean mapping, and the second element - /// will be set to the original type returned by `GetType()`. + /// type, and an inexact mapping. In the first scenario, + /// NdrSdfTypeIndicator will contain a cleanly-mapped Sdf type. In the + /// second scenario, the NdrSdfTypeIndicator will contain an Sdf type + /// set to `Token` to indicate an unclean mapping, and + /// NdrSdfTypeIndicator::HasSdfType will return false. /// /// This base property class is generic and cannot know ahead of time how to /// perform this mapping reliably, thus it will always fall into the second @@ -144,7 +146,7 @@ class NdrProperty /// /// \sa GetDefaultValueAsSdfType() NDR_API - virtual const NdrSdfTypeIndicator GetTypeAsSdfType() const; + virtual NdrSdfTypeIndicator GetTypeAsSdfType() const; /// Provides default value corresponding to the SdfValueTypeName returned /// by GetTypeAsSdfType. diff --git a/pxr/usd/ndr/registry.cpp b/pxr/usd/ndr/registry.cpp index 2b8df80b94..5996bc82c9 100644 --- a/pxr/usd/ndr/registry.cpp +++ b/pxr/usd/ndr/registry.cpp @@ -63,7 +63,7 @@ NdrRegistry_ValidateProperty( { const VtValue& defaultValue = property->GetDefaultValueAsSdfType(); const NdrSdfTypeIndicator sdfTypeIndicator = property->GetTypeAsSdfType(); - const SdfValueTypeName sdfType = sdfTypeIndicator.first; + const SdfValueTypeName sdfType = sdfTypeIndicator.GetSdfType(); // We allow default values to be unspecified, but if they aren't empty, then // we want to error if the value's type is different from the specified type diff --git a/pxr/usd/ndr/sdfTypeIndicator.cpp b/pxr/usd/ndr/sdfTypeIndicator.cpp new file mode 100644 index 0000000000..359e5f88d3 --- /dev/null +++ b/pxr/usd/ndr/sdfTypeIndicator.cpp @@ -0,0 +1,54 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/base/tf/token.h" +#include "pxr/usd/ndr/sdfTypeIndicator.h" +#include "pxr/usd/sdf/types.h" +#include "pxr/usd/sdf/valueTypeName.h" + +PXR_NAMESPACE_OPEN_SCOPE + +NdrSdfTypeIndicator::NdrSdfTypeIndicator() + : _sdfType(SdfValueTypeNames->Token), + _ndrType(TfToken()), + _hasSdfTypeMapping(false) {} + +NdrSdfTypeIndicator::NdrSdfTypeIndicator( + const SdfValueTypeName& sdfType, + const TfToken& ndrType, + bool hasSdfTypeMapping) + : _sdfType(sdfType), + _ndrType(ndrType), + _hasSdfTypeMapping(hasSdfTypeMapping) {} + +TfToken +NdrSdfTypeIndicator::GetNdrType() const { + return _ndrType; +} + +bool +NdrSdfTypeIndicator::HasSdfType() const { + return _hasSdfTypeMapping; +} + +SdfValueTypeName +NdrSdfTypeIndicator::GetSdfType() const { + return _sdfType; +} + +bool +NdrSdfTypeIndicator::operator==(const NdrSdfTypeIndicator &rhs) const { + return _sdfType == rhs._sdfType && _ndrType == rhs._ndrType; +} + +bool +NdrSdfTypeIndicator::operator!=(const NdrSdfTypeIndicator &rhs) const { + return !operator==(rhs); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/ndr/sdfTypeIndicator.h b/pxr/usd/ndr/sdfTypeIndicator.h new file mode 100644 index 0000000000..a70024d991 --- /dev/null +++ b/pxr/usd/ndr/sdfTypeIndicator.h @@ -0,0 +1,78 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#ifndef PXR_USD_NDR_SDF_TYPE_INDICATOR_H +#define PXR_USD_NDR_SDF_TYPE_INDICATOR_H + +/// \file ndr/sdfTypeIndicator.h + +#include "pxr/pxr.h" +#include "pxr/usd/ndr/api.h" +#include "pxr/base/tf/token.h" +#include "pxr/usd/sdf/valueTypeName.h" + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class NdrSdfTypeIndicator +/// Represents a mapping from an Ndr Property type to Sdf type. +/// +/// If an exact mapping exists from Ndr Property type to Sdf type, HasSdfType() +/// will return true, and GetSdfType() will return the Sdf type resulting from +/// the conversion. GetNdrType() will return the original Ndr Property type. +/// +/// If a mapping doesn't exist from Ndr Property type to Sdf type, HasSdfType() +/// will return false, and GetSdfType() will return either +/// SdfValueTypeNames->TokenArray or SdfValueTypeNames->Token. GetNdrType() +/// will return the original Ndr Property type. +class NdrSdfTypeIndicator +{ +public: + /// Default constructor. + NDR_API + NdrSdfTypeIndicator(); + + /// Constructor. The sdfType must be TokenArray or Token if hasSdfTypeMapping + /// is set to false. + NDR_API + NdrSdfTypeIndicator( + const SdfValueTypeName& sdfType, + const TfToken& ndrType, + bool hasSdfTypeMapping = true); + + /// Gets the original Ndr property type associated with the represented + /// Ndr property type to Sdf type mapping. + NDR_API + TfToken GetNdrType() const; + + /// Whether an exact Sdf type exists for the represented Ndr property type + /// to Sdf type mapping. + NDR_API + bool HasSdfType() const; + + /// Gets the Sdf type associated with the represented Ndr property type to + /// Sdf type mapping. If there is no valid Sdf type, either + /// SdfValueTypeNames->TokenArray or SdfValueTypeNames->Token is returned. + NDR_API + SdfValueTypeName GetSdfType() const; + + /// Equality operation + NDR_API + bool operator==(const NdrSdfTypeIndicator &rhs) const; + + /// Inequality operation + NDR_API + bool operator!=(const NdrSdfTypeIndicator &rhs) const; + +private: + SdfValueTypeName _sdfType; + TfToken _ndrType; + bool _hasSdfTypeMapping; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_NDR_SDF_TYPE_INDICATOR_H diff --git a/pxr/usd/ndr/wrapProperty.cpp b/pxr/usd/ndr/wrapProperty.cpp index 8e1bae7158..e3a5a278e7 100644 --- a/pxr/usd/ndr/wrapProperty.cpp +++ b/pxr/usd/ndr/wrapProperty.cpp @@ -38,7 +38,6 @@ void wrapProperty() return_value_policy()) .def("IsConnectable", &This::IsConnectable) .def("CanConnectTo", &This::CanConnectTo) - .def("GetTypeAsSdfType", &This::GetTypeAsSdfType, - return_value_policy()) + .def("GetTypeAsSdfType", &This::GetTypeAsSdfType) ; } diff --git a/pxr/usd/ndr/wrapSdfTypeIndicator.cpp b/pxr/usd/ndr/wrapSdfTypeIndicator.cpp new file mode 100644 index 0000000000..60ab54cf19 --- /dev/null +++ b/pxr/usd/ndr/wrapSdfTypeIndicator.cpp @@ -0,0 +1,28 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/base/vt/valueFromPython.h" +#include "pxr/usd/ndr/sdfTypeIndicator.h" + +#include +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +void wrapSdfTypeIndicator() +{ + typedef NdrSdfTypeIndicator This; + + class_("SdfTypeIndicator", no_init) + .def("GetSdfType", &This::GetSdfType) + .def("HasSdfType", &This::HasSdfType) + .def("GetNdrType", &This::GetNdrType) + ; +} diff --git a/pxr/usd/sdr/shaderParserTestUtils.py b/pxr/usd/sdr/shaderParserTestUtils.py index dc57761cad..2672d2603e 100644 --- a/pxr/usd/sdr/shaderParserTestUtils.py +++ b/pxr/usd/sdr/shaderParserTestUtils.py @@ -33,7 +33,7 @@ def GetType(property): Given a property (SdrShaderProperty), return the SdfValueTypeName type. """ sdfTypeIndicator = property.GetTypeAsSdfType() - sdfValueTypeName = sdfTypeIndicator[0] + sdfValueTypeName = sdfTypeIndicator.GetSdfType() tfType = sdfValueTypeName.type return tfType @@ -190,21 +190,31 @@ def TestShadingProperties(node): # -------------------------------------------------------------------------- # Check clean and unclean mappings to Sdf types # -------------------------------------------------------------------------- - assert properties["inputB"].GetTypeAsSdfType() == (SdfTypes.Int, "") - assert properties["inputF2"].GetTypeAsSdfType() == (SdfTypes.Float2, "") - assert properties["inputF3"].GetTypeAsSdfType() == (SdfTypes.Float3, "") - assert properties["inputF4"].GetTypeAsSdfType() == (SdfTypes.Float4, "") - assert properties["inputF5"].GetTypeAsSdfType() == (SdfTypes.FloatArray, "") - assert properties["inputStruct"].GetTypeAsSdfType() == \ - (SdfTypes.Token, Sdr.PropertyTypes.Struct) + expected_mappings = {"inputB": (SdfTypes.Int, "int"), + "inputF2": (SdfTypes.Float2, + Sdr.PropertyTypes.Float), + "inputF3": (SdfTypes.Float3, + Sdr.PropertyTypes.Float), + "inputF4": (SdfTypes.Float4, + Sdr.PropertyTypes.Float), + "inputF5": (SdfTypes.FloatArray, + Sdr.PropertyTypes.Float), + "inputStruct": (SdfTypes.Token, + Sdr.PropertyTypes.Struct)} + + for prop, expected in expected_mappings.items(): + indicator = properties[prop].GetTypeAsSdfType() + assert indicator.GetSdfType() == expected[0] + assert indicator.GetNdrType() == expected[1] # -------------------------------------------------------------------------- # Ensure asset identifiers are detected correctly # -------------------------------------------------------------------------- assert properties["inputAssetIdentifier"].IsAssetIdentifier() assert not properties["inputOptions"].IsAssetIdentifier() - assert properties["inputAssetIdentifier"].GetTypeAsSdfType() == \ - (SdfTypes.Asset, "") + indicator = properties["inputAssetIdentifier"].GetTypeAsSdfType() + assert indicator.GetSdfType() == SdfTypes.Asset + assert indicator.GetNdrType() == Sdr.PropertyTypes.String # Nested pages and VStructs are only possible in args files if not isOSL: diff --git a/pxr/usd/sdr/shaderProperty.cpp b/pxr/usd/sdr/shaderProperty.cpp index 9aaa5ed8c3..07f9b9a0e3 100644 --- a/pxr/usd/sdr/shaderProperty.cpp +++ b/pxr/usd/sdr/shaderProperty.cpp @@ -192,10 +192,9 @@ namespace { } // Returns the type indicator based on the type mappings defined in - // _GetTokenTypeToSdfType and _GetTokenTypeToSdfArrayType. If the type can't - // be found the SdfType will be returned as Token with the original type as - // a hint. - const NdrSdfTypeIndicator + // _GetTokenTypeToSdfType and _GetTokenTypeToSdfArrayType. If the exact + // type can't be found NdrSdfTypeIndicator::HasSdfType() will be false. + NdrSdfTypeIndicator _GetTypeIndicatorFromDefaultMapping(const TfToken& type, bool isArray) { const TokenToSdfTypeMap& tokenTypeToSdfType = @@ -203,11 +202,11 @@ namespace { TokenToSdfTypeMap::const_iterator it = tokenTypeToSdfType.find(type); if (it != tokenTypeToSdfType.end()) { - return std::make_pair(it->second, TfToken()); + return NdrSdfTypeIndicator(it->second, type); } - // If there is no clean mapping, it defaults to the 'Token' type - return std::make_pair(SdfValueTypeNames->Token, type); + // Return an indicator that there is no clean mapping. + return NdrSdfTypeIndicator(SdfValueTypeNames->Token, type, false); } // ------------------------------------------------------------------------- @@ -216,7 +215,7 @@ namespace { // internally at the inception of the Sdr at Pixar Animation // Studios namespace _Encoding_0 { - const NdrSdfTypeIndicator + NdrSdfTypeIndicator GetTypeAsSdfType( const TfToken& type, size_t arraySize, const NdrTokenMap& metadata) { @@ -225,23 +224,25 @@ namespace { // There is one Sdf type (Asset) that is not included in the type // mapping because it is determined dynamically if (_IsAssetIdentifier(metadata)) { - return std::make_pair(isArray ? SdfValueTypeNames->StringArray - : SdfValueTypeNames->String, - TfToken()); + auto sdfType = isArray ? SdfValueTypeNames->StringArray + : SdfValueTypeNames->String; + return NdrSdfTypeIndicator(sdfType, type); } if (type == SdrPropertyTypes->Terminal) { - return std::make_pair(SdfValueTypeNames->Token, type); + return NdrSdfTypeIndicator(SdfValueTypeNames->Token, + type, + false); } if (type == SdrPropertyTypes->Struct) { - return std::make_pair(SdfValueTypeNames->String, type); + return NdrSdfTypeIndicator(SdfValueTypeNames->String, type); } if (type == SdrPropertyTypes->Vstruct) { - return std::make_pair(isArray ? SdfValueTypeNames->FloatArray - : SdfValueTypeNames->Float, - type); + auto sdfType = isArray ? SdfValueTypeNames->FloatArray + : SdfValueTypeNames->Float; + return NdrSdfTypeIndicator(sdfType, type); } return _GetTypeIndicatorFromDefaultMapping(type, isArray); @@ -251,14 +252,14 @@ namespace { // Encoding 1: this is the original mapping from Sdr types to Sdf types that // is used to store attributes in USD. namespace _Encoding_1 { - const NdrSdfTypeIndicator + NdrSdfTypeIndicator GetTypeAsSdfType( const TfToken& type, size_t arraySize, const NdrTokenMap& metadata) { const SdfValueTypeName& sdfValueTypeName = _GetSdrUsdDefinitionType(metadata); if (sdfValueTypeName) { - return std::make_pair(sdfValueTypeName, TfToken()); + return NdrSdfTypeIndicator(sdfValueTypeName, type); } bool isArray = _IsArray(arraySize, metadata); @@ -266,9 +267,9 @@ namespace { // There is one Sdf type (Asset) that is not included in the type // mapping because it is determined dynamically if (_IsAssetIdentifier(metadata)) { - return std::make_pair(isArray ? SdfValueTypeNames->AssetArray - : SdfValueTypeNames->Asset, - TfToken()); + auto sdfType = isArray ? SdfValueTypeNames->AssetArray + : SdfValueTypeNames->Asset; + return NdrSdfTypeIndicator(sdfType, type); } // We have several special SdrPropertyTypes that we want to map to @@ -278,9 +279,9 @@ namespace { if (type == SdrPropertyTypes->Terminal || type == SdrPropertyTypes->Struct || type == SdrPropertyTypes->Vstruct) { - return std::make_pair(isArray ? SdfValueTypeNames->TokenArray - : SdfValueTypeNames->Token, - type); + SdfValueTypeName sdfType = isArray ? SdfValueTypeNames->TokenArray + : SdfValueTypeNames->Token; + return NdrSdfTypeIndicator(sdfType, type); } // We prefer more specific types, so if the arraySize is 2, 3, or 4, @@ -290,20 +291,20 @@ namespace { // array as well. if (type == SdrPropertyTypes->Int) { if (arraySize == 2) { - return std::make_pair(SdfValueTypeNames->Int2, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Int2, type); } else if (arraySize == 3) { - return std::make_pair(SdfValueTypeNames->Int3, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Int3, type); } else if (arraySize == 4) { - return std::make_pair(SdfValueTypeNames->Int4, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Int4, type); } } if (type == SdrPropertyTypes->Float) { if (arraySize == 2) { - return std::make_pair(SdfValueTypeNames->Float2, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Float2, type); } else if (arraySize == 3) { - return std::make_pair(SdfValueTypeNames->Float3, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Float3, type); } else if (arraySize == 4) { - return std::make_pair(SdfValueTypeNames->Float4, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Float4, type); } } @@ -321,7 +322,7 @@ namespace { // ------------------------------------------------------------------------- // Helper to convert the type to an Sdf type - const NdrSdfTypeIndicator + NdrSdfTypeIndicator _GetTypeAsSdfType( const TfToken& type, size_t arraySize, const NdrTokenMap& metadata, int usdEncodingVersion) @@ -336,7 +337,7 @@ namespace { "Invalid/unsupported usdEncodingVersion %d. " "Current version is %d.", usdEncodingVersion, _UsdEncodingVersionsCurrent); - return std::make_pair(SdfValueTypeNames->Token, TfToken()); + return NdrSdfTypeIndicator(SdfValueTypeNames->Token, type, false); } } @@ -526,9 +527,9 @@ namespace { } // Return early if no conformance issue - const NdrSdfTypeIndicator sdfTypeIndicator = _GetTypeAsSdfType( + NdrSdfTypeIndicator sdfTypeIndicator = _GetTypeAsSdfType( sdrType, arraySize, metadata, usdEncodingVersion); - const SdfValueTypeName sdfType = sdfTypeIndicator.first; + const SdfValueTypeName sdfType = sdfTypeIndicator.GetSdfType(); if (sdrDefaultValue.GetType() == sdfType.GetType()) { return sdrDefaultValue; @@ -724,14 +725,14 @@ SdrShaderProperty::CanConnectTo(const NdrProperty& other) const } // Convert input/output types to Sdf types - const NdrSdfTypeIndicator& sdfInputTypeInd = + NdrSdfTypeIndicator sdfInputTypeInd = _GetTypeAsSdfType(inputType, inputArraySize, inputMetadata, _usdEncodingVersion); - const NdrSdfTypeIndicator& sdfOutputTypeInd = + NdrSdfTypeIndicator sdfOutputTypeInd = _GetTypeAsSdfType(outputType, outputArraySize, outputMetadata, _usdEncodingVersion); - const SdfValueTypeName& sdfInputType = sdfInputTypeInd.first; - const SdfValueTypeName& sdfOutputType = sdfOutputTypeInd.first; + const SdfValueTypeName& sdfInputType = sdfInputTypeInd.GetSdfType(); + const SdfValueTypeName& sdfOutputType = sdfOutputTypeInd.GetSdfType(); bool inputIsFloat3 = (inputType == SdrPropertyTypes->Color) || @@ -788,7 +789,7 @@ SdrShaderProperty::IsVStruct() const return _type == SdrPropertyTypes->Vstruct; } -const NdrSdfTypeIndicator +NdrSdfTypeIndicator SdrShaderProperty::GetTypeAsSdfType() const { return _GetTypeAsSdfType(_type, _arraySize, _metadata, @@ -820,7 +821,7 @@ SdrShaderProperty::_ConvertToVStruct() // The default value should match the resulting Sdf type NdrSdfTypeIndicator typeIndicator = GetTypeAsSdfType(); - SdfValueTypeName typeName = typeIndicator.first; + SdfValueTypeName typeName = typeIndicator.GetSdfType(); _defaultValue = typeName.GetDefaultValue(); } diff --git a/pxr/usd/sdr/shaderProperty.h b/pxr/usd/sdr/shaderProperty.h index 017bb4417a..3cbf7584ae 100644 --- a/pxr/usd/sdr/shaderProperty.h +++ b/pxr/usd/sdr/shaderProperty.h @@ -17,6 +17,7 @@ #include "pxr/base/tf/weakBase.h" #include "pxr/base/vt/value.h" #include "pxr/usd/ndr/property.h" +#include "pxr/usd/ndr/sdfTypeIndicator.h" #include "pxr/usd/sdr/shaderNode.h" PXR_NAMESPACE_OPEN_SCOPE @@ -213,18 +214,18 @@ class SdrShaderProperty : public NdrProperty /// \name Utilities /// @{ - /// Converts the property's type from `GetType()` into a `SdfValueTypeName`. + /// Converts the property's type from `GetType()` into a + /// `NdrSdfTypeIndicator`. /// /// Two scenarios can result: an exact mapping from property type to Sdf - /// type, and an inexact mapping. In the first scenario, the first element - /// in the pair will be the cleanly-mapped Sdf type, and the second element, - /// a TfToken, will be empty. In the second scenario, the Sdf type will be - /// set to `Token` to indicate an unclean mapping, and the second element - /// will be set to the original type returned by `GetType()`. - /// - /// \sa GetDefaultValueAsSdfType + /// type, and an inexact mapping. In the first scenario, + /// NdrSdfTypeIndicator will contain a cleanly-mapped Sdf type. In the + /// second scenario, the NdrSdfTypeIndicator will contain an Sdf type + /// set to `Token` to indicate an unclean mapping, and + /// NdrSdfTypeIndicator::GetNdrType will be set to the original type + /// returned by `GetType()`. SDR_API - const NdrSdfTypeIndicator GetTypeAsSdfType() const override; + NdrSdfTypeIndicator GetTypeAsSdfType() const override; /// Accessor for default value corresponding to the SdfValueTypeName /// returned by GetTypeAsSdfType. Note that this is different than diff --git a/pxr/usd/sdr/testenv/testSdrRegistry.py b/pxr/usd/sdr/testenv/testSdrRegistry.py index c09d127e2b..218e62447a 100644 --- a/pxr/usd/sdr/testenv/testSdrRegistry.py +++ b/pxr/usd/sdr/testenv/testSdrRegistry.py @@ -47,7 +47,7 @@ def setUpClass(cls): cls.tpp2Type = Tf.Type.FindByName('_NdrOslTestParserPlugin') # We don't check for all the derived types of NdrDiscoveryPlugin - # because this test only uses the discovery and parser plugins + # because this test only uses the discovery and parser plugins # that are defined in this testenv assert {cls.tdpType, cls.tdp2Type}.issubset( set(cls.pr.GetAllDerivedTypes('NdrDiscoveryPlugin'))) @@ -55,9 +55,9 @@ def setUpClass(cls): set(cls.pr.GetAllDerivedTypes('NdrParserPlugin'))) # Instantiating the registry will kick off the discovery process. - # This test assumes the PXR_NDR_SKIP_DISCOVERY_PLUGIN_DISCOVERY - # and PXR_NDR_SKIP_PARSER_PLUGIN_DISCOVERY has been set prior to - # being run to ensure built-in plugins are not found. Instead + # This test assumes the PXR_NDR_SKIP_DISCOVERY_PLUGIN_DISCOVERY + # and PXR_NDR_SKIP_PARSER_PLUGIN_DISCOVERY has been set prior to + # being run to ensure built-in plugins are not found. Instead # we'll list the plugins we want explicitly. # Setting this from within the script does not work on Windows. @@ -199,7 +199,7 @@ def _CheckTypes(node, expectedTypes): for inputName in node.GetInputNames(): prop = node.GetInput(inputName) sdrType = prop.GetType() - sdfType, sdfHint = prop.GetTypeAsSdfType() + sdfType = prop.GetTypeAsSdfType().GetSdfType() expectedSdrType, expectedSdfType = expectedTypes[prop.GetName()] print(" ", prop.GetName(), sdrType, str(sdfType), 'vs expected', \ expectedSdrType, str(expectedSdfType)) diff --git a/pxr/usd/usdLux/testenv/testUsdLuxLight.py b/pxr/usd/usdLux/testenv/testUsdLuxLight.py index 91e33e96c5..cd3c9e44c1 100644 --- a/pxr/usd/usdLux/testenv/testUsdLuxLight.py +++ b/pxr/usd/usdLux/testenv/testUsdLuxLight.py @@ -575,11 +575,12 @@ def _CompareLightPropToNodeProp(nodeInput, primInput): # Verify the node's input type maps back to USD property's type # (with the noted above exceptions). self.assertEqual( - nodeInput.GetTypeAsSdfType()[0], expectedTypeName, + nodeInput.GetTypeAsSdfType().GetSdfType(), + expectedTypeName, msg="{}.{} Type {} != {}".format( str(node.GetName()), str(nodeInput.GetName()), - str(nodeInput.GetTypeAsSdfType()[0]), + str(nodeInput.GetTypeAsSdfType().GetSdfType()), str(expectedTypeName))) # If the USD property type is an Asset, it will be listed in # the node's asset identifier inputs. diff --git a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py index 10d726f78a..48d5c79182 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py +++ b/pxr/usd/usdShade/testenv/testUsdShadeShaderDef.py @@ -178,7 +178,7 @@ def test_ShaderProperties(self): attr = shaderDef.GetPrim(). \ GetAttribute('inputs:actualBool') self.assertEqual(attr.GetTypeName(), Sdf.ValueTypeNames.Bool) - self.assertEqual(actualBoolInput.GetTypeAsSdfType()[0], + self.assertEqual(actualBoolInput.GetTypeAsSdfType().GetSdfType(), Sdf.ValueTypeNames.Bool) self.assertEqual(actualBoolInput.GetType(), Sdf.ValueTypeNames.Int) diff --git a/pxr/usd/usdShade/validators.cpp b/pxr/usd/usdShade/validators.cpp index d3be1c88cc..7b2fe74448 100644 --- a/pxr/usd/usdShade/validators.cpp +++ b/pxr/usd/usdShade/validators.cpp @@ -247,7 +247,8 @@ _ShaderPropertyTypeConformance(const UsdPrim &usdPrim) const auto sdrPropnameToSdfType = [&propNameToPropertyMap]() { std::unordered_map map; for (const auto& prop : propNameToPropertyMap) { - map.emplace(prop.first, prop.second->GetTypeAsSdfType().first); + map.emplace(prop.first, + prop.second->GetTypeAsSdfType().GetSdfType()); } return map; }(); diff --git a/pxr/usd/usdUtils/complianceChecker.py b/pxr/usd/usdUtils/complianceChecker.py index 60370b9110..fec233e58c 100644 --- a/pxr/usd/usdUtils/complianceChecker.py +++ b/pxr/usd/usdUtils/complianceChecker.py @@ -659,8 +659,7 @@ def _FillSdrNameToTypeMap(self, shadeNode, mapping): for inputName in shadeNode.GetInputNames(): prop = shadeNode.GetInput(inputName) propName = prop.GetName() - sdfType, sdfHint = prop.GetTypeAsSdfType() - mapping[propName] = sdfType + mapping[propName] = prop.GetTypeAsSdfType().GetSdfType() diff --git a/pxr/usd/usdUtils/updateSchemaWithSdrNode.py b/pxr/usd/usdUtils/updateSchemaWithSdrNode.py index 2c085bef80..bd559f24af 100644 --- a/pxr/usd/usdUtils/updateSchemaWithSdrNode.py +++ b/pxr/usd/usdUtils/updateSchemaWithSdrNode.py @@ -73,7 +73,7 @@ def _CreateAttrSpecFromNodeAttribute(primSpec, prop, primDefForAttrPruning, "shader nodes' outputs to not have the \"outputs\" namespace " \ "prefix." %(propName, propertyNSPrefixOverride)) - attrType = prop.GetTypeAsSdfType()[0] + attrType = prop.GetTypeAsSdfType().GetSdfType() if not Sdf.Path.IsValidNamespacedIdentifier(propName): Tf.RaiseRuntimeError("Property name (%s) for schema (%s) is an " \ From b0d8ca1ea74bdf9acc94846bade06ec89c2eef7f Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Fri, 9 Aug 2024 20:33:20 -0700 Subject: [PATCH 029/202] hdPrman: all calls HdSceneDelegate::SampleFoo pass down the shutter interval if the HD_API_VERSION is high enough. (Internal change: 2336371) (Internal change: 2336396) --- .../plugin/hdPrman/basisCurves.cpp | 3 +- .../renderman-25/plugin/hdPrman/camera.cpp | 9 +++- .../renderman-25/plugin/hdPrman/cone.cpp | 4 +- .../renderman-25/plugin/hdPrman/coordSys.cpp | 8 +++- .../renderman-25/plugin/hdPrman/cylinder.cpp | 4 +- .../renderman-25/plugin/hdPrman/gprim.h | 8 +++- .../renderman-25/plugin/hdPrman/instancer.cpp | 44 ++++++++++++++++--- .../renderman-25/plugin/hdPrman/instancer.h | 2 +- .../renderman-25/plugin/hdPrman/light.cpp | 9 +++- .../plugin/hdPrman/lightFilter.cpp | 14 ++++-- .../renderman-25/plugin/hdPrman/lightFilter.h | 2 + .../renderman-25/plugin/hdPrman/mesh.cpp | 3 +- .../renderman-25/plugin/hdPrman/points.cpp | 3 +- .../plugin/hdPrman/renderParam.cpp | 31 ++++++++++--- .../renderman-25/plugin/hdPrman/renderParam.h | 1 + .../renderman-25/plugin/hdPrman/sphere.cpp | 4 +- .../renderman-25/plugin/hdPrman/volume.cpp | 3 +- .../plugin/hdPrman/basisCurves.cpp | 3 +- .../renderman-26/plugin/hdPrman/camera.cpp | 9 +++- .../renderman-26/plugin/hdPrman/cone.cpp | 4 +- .../renderman-26/plugin/hdPrman/coordSys.cpp | 8 +++- .../renderman-26/plugin/hdPrman/cylinder.cpp | 4 +- .../renderman-26/plugin/hdPrman/gprim.h | 8 +++- .../renderman-26/plugin/hdPrman/instancer.cpp | 44 ++++++++++++++++--- .../renderman-26/plugin/hdPrman/instancer.h | 2 +- .../renderman-26/plugin/hdPrman/light.cpp | 9 +++- .../plugin/hdPrman/lightFilter.cpp | 14 ++++-- .../renderman-26/plugin/hdPrman/lightFilter.h | 2 + .../renderman-26/plugin/hdPrman/mesh.cpp | 3 +- .../renderman-26/plugin/hdPrman/points.cpp | 3 +- .../plugin/hdPrman/renderParam.cpp | 31 ++++++++++--- .../renderman-26/plugin/hdPrman/renderParam.h | 1 + .../renderman-26/plugin/hdPrman/sphere.cpp | 4 +- .../renderman-26/plugin/hdPrman/volume.cpp | 3 +- 34 files changed, 250 insertions(+), 54 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp b/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp index c30d05a65e..373880a0ad 100644 --- a/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp +++ b/third_party/renderman-25/plugin/hdPrman/basisCurves.cpp @@ -142,7 +142,8 @@ HdPrman_BasisCurves::_ConvertGeometry(HdPrman_RenderParam *renderParam, HdPrman_ConvertPrimvars( sceneDelegate, id, primvars, numCurves, vertexPrimvarCount, - varyingPrimvarCount, facevaryingPrimvarCount); + varyingPrimvarCount, facevaryingPrimvarCount, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/camera.cpp b/third_party/renderman-25/plugin/hdPrman/camera.cpp index 7ce89f71db..b3d59e05b4 100644 --- a/third_party/renderman-25/plugin/hdPrman/camera.cpp +++ b/third_party/renderman-25/plugin/hdPrman/camera.cpp @@ -8,6 +8,7 @@ #include "hdPrman/cameraContext.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" #include @@ -94,7 +95,13 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, const HdDirtyBits bits = *dirtyBits; if (bits & DirtyTransform) { - sceneDelegate->SampleTransform(id, &_sampleXforms); + sceneDelegate->SampleTransform( + id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &_sampleXforms); } if (bits & AllDirty) { diff --git a/third_party/renderman-25/plugin/hdPrman/cone.cpp b/third_party/renderman-25/plugin/hdPrman/cone.cpp index 3e2493f381..a27699f02b 100644 --- a/third_party/renderman-25/plugin/hdPrman/cone.cpp +++ b/third_party/renderman-25/plugin/hdPrman/cone.cpp @@ -72,7 +72,9 @@ HdPrman_Cone::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_radius, radius); primvars.SetFloat(RixStr.k_Ri_height, height); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/coordSys.cpp b/third_party/renderman-25/plugin/hdPrman/coordSys.cpp index 2882979709..b126ce9258 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSys.cpp +++ b/third_party/renderman-25/plugin/hdPrman/coordSys.cpp @@ -13,6 +13,7 @@ #include "pxr/usd/sdf/types.h" #include "pxr/base/tf/staticTokens.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" #include "pxr/imaging/hf/diagnostic.h" #include "RiTypesHelper.h" @@ -65,7 +66,12 @@ HdPrmanCoordSys::Sync(HdSceneDelegate *sceneDelegate, if (bits & AllDirty) { // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); TfSmallVector xf_rt_values(xf.count); for (size_t i=0; i < xf.count; ++i) { diff --git a/third_party/renderman-25/plugin/hdPrman/cylinder.cpp b/third_party/renderman-25/plugin/hdPrman/cylinder.cpp index d07f34977e..ddf3ffd635 100644 --- a/third_party/renderman-25/plugin/hdPrman/cylinder.cpp +++ b/third_party/renderman-25/plugin/hdPrman/cylinder.cpp @@ -71,7 +71,9 @@ HdPrman_Cylinder::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_zmin, -0.5f * height); primvars.SetFloat(RixStr.k_Ri_zmax, 0.5f * height); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/gprim.h b/third_party/renderman-25/plugin/hdPrman/gprim.h index dded31efc0..cea94ddbe2 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprim.h +++ b/third_party/renderman-25/plugin/hdPrman/gprim.h @@ -8,6 +8,7 @@ #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H #include "pxr/pxr.h" +#include "pxr/imaging/hd/version.h" #include "pxr/usd/sdf/types.h" #include "pxr/base/gf/matrix4d.h" @@ -176,7 +177,12 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); // Update visibility so thet rprim->IsVisible() will work in render pass if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, id)) { diff --git a/third_party/renderman-25/plugin/hdPrman/instancer.cpp b/third_party/renderman-25/plugin/hdPrman/instancer.cpp index 4c4eac0389..c1166806b2 100644 --- a/third_party/renderman-25/plugin/hdPrman/instancer.cpp +++ b/third_party/renderman-25/plugin/hdPrman/instancer.cpp @@ -315,7 +315,7 @@ HdPrmanInstancer::Sync( _SyncPrimvars(dirtyBits); // cache the instancer and instance transforms - _SyncTransforms(dirtyBits); + _SyncTransforms(dirtyBits, param); // cache the instancer and instance categories _SyncCategories(dirtyBits); @@ -578,7 +578,8 @@ _ValidateSamplesTimes(HdTimeSampleArray& samples) } void -HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits) +HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits, + HdPrman_RenderParam * param) { HdSceneDelegate* delegate = GetDelegate(); const SdfPath& id = GetId(); @@ -629,15 +630,37 @@ HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits) HdTimeSampleArray boxedRotates; HdTimeSampleArray boxedScales; if (includeInstancerXform) { - delegate->SampleInstancerTransform(id, &instancerXform); + delegate->SampleInstancerTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &instancerXform); } delegate->SamplePrimvar(id, instanceTransformsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &boxedInstanceXforms); delegate->SamplePrimvar(id, instanceTranslationsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedTranslates); delegate->SamplePrimvar(id, instanceScalesToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedScales); delegate->SamplePrimvar(id, instanceRotationsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedRotates); // Unbox samples held as VtValues @@ -1080,7 +1103,13 @@ HdPrmanInstancer::_PopulateInstances( // include it. We must multiply the instance transforms by this // instancer's transform. HdTimeSampleArray xf; - delegate->SampleInstancerTransform(instancerId, &xf); + delegate->SampleInstancerTransform(instancerId, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); + for (_InstanceData& instance : instances) { instance.transform = _MultiplyTransforms( instance.transform, xf); @@ -1339,7 +1368,12 @@ HdPrmanInstancer::_PopulateInstances( // include it. The parent instancer will instead include it on the // instances it makes of this instancer's prototype groups. HdTimeSampleArray xf; - delegate->SampleInstancerTransform(instancerId, &xf); + delegate->SampleInstancerTransform(instancerId, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); // Get this instancer's params const RtParamList instancerParams = param->ConvertAttributes( diff --git a/third_party/renderman-25/plugin/hdPrman/instancer.h b/third_party/renderman-25/plugin/hdPrman/instancer.h index 28b156f8b6..1bcc073a69 100644 --- a/third_party/renderman-25/plugin/hdPrman/instancer.h +++ b/third_party/renderman-25/plugin/hdPrman/instancer.h @@ -487,7 +487,7 @@ class HdPrmanInstancer : public HdInstancer void _SyncPrimvars(const HdDirtyBits* dirtyBits); // Sync helper; caches the instancer and instance transforms - void _SyncTransforms(const HdDirtyBits* dirtyBits); + void _SyncTransforms(const HdDirtyBits* dirtyBits, HdPrman_RenderParam *); // Sync helper; caches instance or instancer categories as appropriate void _SyncCategories(const HdDirtyBits* dirtyBits); diff --git a/third_party/renderman-25/plugin/hdPrman/light.cpp b/third_party/renderman-25/plugin/hdPrman/light.cpp index be4a9cc652..740accfd22 100644 --- a/third_party/renderman-25/plugin/hdPrman/light.cpp +++ b/third_party/renderman-25/plugin/hdPrman/light.cpp @@ -274,7 +274,7 @@ _PopulateLightFilterNodes( if (HdSprim *sprim = sceneDelegate->GetRenderIndex().GetSprim( HdPrimTypeTokens->lightFilter, filterPath)) { if (auto* lightFilter = dynamic_cast(sprim)) { - lightFilter->SyncToRiley(sceneDelegate, riley); + lightFilter->SyncToRiley(sceneDelegate, param, riley); coordsysIds->push_back(lightFilter->GetCoordSysId()); } } else { @@ -798,7 +798,12 @@ HdPrmanLight::Sync(HdSceneDelegate *sceneDelegate, // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); GfMatrix4d geomMat(1.0); diff --git a/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp b/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp index fef5f58083..39b3caa9af 100644 --- a/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp +++ b/third_party/renderman-25/plugin/hdPrman/lightFilter.cpp @@ -83,7 +83,8 @@ HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, #endif std::lock_guard lock(_syncToRileyMutex); _rileyIsInSync = false; - _SyncToRileyWithLock(sceneDelegate, param->AcquireRiley()); + _SyncToRileyWithLock( + sceneDelegate, param, param->AcquireRiley()); } *dirtyBits = HdChangeTracker::Clean; @@ -92,24 +93,31 @@ HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, void HdPrmanLightFilter::SyncToRiley( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley) { std::lock_guard lock(_syncToRileyMutex); if (!_rileyIsInSync) { - _SyncToRileyWithLock(sceneDelegate, riley); + _SyncToRileyWithLock(sceneDelegate, param, riley); } } void HdPrmanLightFilter::_SyncToRileyWithLock( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam * param, riley::Riley *riley) { SdfPath const& id = GetId(); // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); TfSmallVector xf_rt_values(xf.count); for (size_t i=0; i < xf.count; ++i) { diff --git a/third_party/renderman-25/plugin/hdPrman/lightFilter.h b/third_party/renderman-25/plugin/hdPrman/lightFilter.h index 0e707e89e9..470356f615 100644 --- a/third_party/renderman-25/plugin/hdPrman/lightFilter.h +++ b/third_party/renderman-25/plugin/hdPrman/lightFilter.h @@ -52,6 +52,7 @@ class HdPrmanLightFilter final : public HdSprim /// Make sure this material has been updated in Riley. void SyncToRiley( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley); /// Returns the minimal set of dirty bits to place in the @@ -66,6 +67,7 @@ class HdPrmanLightFilter final : public HdSprim private: void _SyncToRileyWithLock( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley); riley::CoordinateSystemId _coordSysId; diff --git a/third_party/renderman-25/plugin/hdPrman/mesh.cpp b/third_party/renderman-25/plugin/hdPrman/mesh.cpp index 74748b20be..7845e198e7 100644 --- a/third_party/renderman-25/plugin/hdPrman/mesh.cpp +++ b/third_party/renderman-25/plugin/hdPrman/mesh.cpp @@ -300,7 +300,8 @@ HdPrman_Mesh::_ConvertGeometry(HdPrman_RenderParam *renderParam, HdPrman_ConvertPrimvars( sceneDelegate, id, primvars, nverts.size(), npoints, npoints, - verts.size()); + verts.size(), + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/points.cpp b/third_party/renderman-25/plugin/hdPrman/points.cpp index 36b33cf137..f58b37366c 100644 --- a/third_party/renderman-25/plugin/hdPrman/points.cpp +++ b/third_party/renderman-25/plugin/hdPrman/points.cpp @@ -61,7 +61,8 @@ HdPrman_Points::_ConvertGeometry(HdPrman_RenderParam *renderParam, *primType = RixStr.k_Ri_Points; HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, - npoints, npoints, npoints); + npoints, npoints, npoints, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp index cc58e23e96..bf2e6ef306 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp @@ -28,6 +28,7 @@ #include "pxr/imaging/hd/rprim.h" #include "pxr/imaging/hd/sceneDelegate.h" #include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/version.h" #include "pxr/usd/sdf/path.h" @@ -230,13 +231,21 @@ _ConvertPointsPrimvar( { HdTimeSampleArray boxedPoints; if (compPrimvar.empty()) { - sceneDelegate->SamplePrimvar(id, HdTokens->points, &boxedPoints); + sceneDelegate->SamplePrimvar(id, HdTokens->points, +#if HD_API_VERSION >= 68 + shutterInterval[0], + shutterInterval[1], +#endif + &boxedPoints); } else { HdExtComputationUtils::SampledValueStore compSamples; HdExtComputationUtils::SampleComputedPrimvarValues< HDPRMAN_MAX_TIME_SAMPLES>( compPrimvar, sceneDelegate, HDPRMAN_MAX_TIME_SAMPLES, +#if HD_API_VERSION >= 73 + shutterInterval[0], shutterInterval[1], +#endif &compSamples); boxedPoints = compSamples[HdTokens->points]; } @@ -435,6 +444,7 @@ template static void _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, HdInterpolation hdInterp, T& params, int expectedSize, + const GfVec2d &shutterInterval, float time = 0.f) { static_assert(std::disjunction< @@ -620,7 +630,12 @@ _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, } HdTimeSampleArray samples; - sceneDelegate->SamplePrimvar(id, primvar.name, &samples); + sceneDelegate->SamplePrimvar(id, primvar.name, +#if HD_API_VERSION >= 68 + shutterInterval[0], + shutterInterval[1], +#endif + &samples); // XXX: The motion blur scene index plugin ensures that only a single // sample at offset 0 is returned for any primvar on which Prman does // not support motion samples. Currently, that's all primvars except P. @@ -677,7 +692,9 @@ _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, void HdPrman_ConvertPrimvars(HdSceneDelegate *sceneDelegate, SdfPath const& id, RtPrimVarList& primvars, int numUniform, int numVertex, - int numVarying, int numFaceVarying, float time) + int numVarying, int numFaceVarying, + const GfVec2d &shutterInterval, + float time) { const HdInterpolation hdInterpValues[] = { HdInterpolationConstant, @@ -698,7 +715,9 @@ HdPrman_ConvertPrimvars(HdSceneDelegate *sceneDelegate, SdfPath const& id, const int modeCount = 5; for (size_t i = 0; i < modeCount; ++i) { _Convert(sceneDelegate, id, hdInterpValues[i], primvars, - primvarSizes[i], time); + primvarSizes[i], + shutterInterval, + time); } } @@ -737,7 +756,7 @@ HdPrman_TransferMaterialPrimvarOpinions(HdSceneDelegate *sceneDelegate, RtParamList HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, - SdfPath const& id, bool isGeometry) + SdfPath const& id, bool isGeometry) { RtParamList attrs; @@ -747,7 +766,7 @@ HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, HdInterpolationConstant, }; for (HdInterpolation hdInterp: hdInterpValues) { - _Convert(sceneDelegate, id, hdInterp, attrs, 1); + _Convert(sceneDelegate, id, hdInterp, attrs, 1, GetShutterInterval()); } // Hydra id -> Riley Rix::k_identifier_name diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.h b/third_party/renderman-25/plugin/hdPrman/renderParam.h index b5ddf28669..0298d462d8 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.h +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.h @@ -584,6 +584,7 @@ HdPrman_ConvertPrimvars( int numVertex, int numVarying, int numFaceVarying, + const GfVec2d &shutterInterval, float time = 0.f); /// Check for any primvar opinions on the material that should be Riley primvars. diff --git a/third_party/renderman-25/plugin/hdPrman/sphere.cpp b/third_party/renderman-25/plugin/hdPrman/sphere.cpp index f935877446..5134cb7847 100644 --- a/third_party/renderman-25/plugin/hdPrman/sphere.cpp +++ b/third_party/renderman-25/plugin/hdPrman/sphere.cpp @@ -65,7 +65,9 @@ HdPrman_Sphere::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_radius, radius); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-25/plugin/hdPrman/volume.cpp b/third_party/renderman-25/plugin/hdPrman/volume.cpp index 09ed44bb21..29fb64bead 100644 --- a/third_party/renderman-25/plugin/hdPrman/volume.cpp +++ b/third_party/renderman-25/plugin/hdPrman/volume.cpp @@ -472,7 +472,8 @@ HdPrman_Volume::_ConvertGeometry(HdPrman_RenderParam *renderParam, /* numUniform = */ 1, /* numVertex = */ 0, /* numVarying = */ 0, - /* numFaceVarying = */ 0); + /* numFaceVarying = */ 0, + renderParam->GetShutterInterval()); // Setup the volume for Prman with the appropriate DSO and its parameters HdVolumeFieldDescriptorVector fields = diff --git a/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp b/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp index c30d05a65e..373880a0ad 100644 --- a/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp +++ b/third_party/renderman-26/plugin/hdPrman/basisCurves.cpp @@ -142,7 +142,8 @@ HdPrman_BasisCurves::_ConvertGeometry(HdPrman_RenderParam *renderParam, HdPrman_ConvertPrimvars( sceneDelegate, id, primvars, numCurves, vertexPrimvarCount, - varyingPrimvarCount, facevaryingPrimvarCount); + varyingPrimvarCount, facevaryingPrimvarCount, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/camera.cpp b/third_party/renderman-26/plugin/hdPrman/camera.cpp index 7ce89f71db..b3d59e05b4 100644 --- a/third_party/renderman-26/plugin/hdPrman/camera.cpp +++ b/third_party/renderman-26/plugin/hdPrman/camera.cpp @@ -8,6 +8,7 @@ #include "hdPrman/cameraContext.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" #include @@ -94,7 +95,13 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, const HdDirtyBits bits = *dirtyBits; if (bits & DirtyTransform) { - sceneDelegate->SampleTransform(id, &_sampleXforms); + sceneDelegate->SampleTransform( + id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &_sampleXforms); } if (bits & AllDirty) { diff --git a/third_party/renderman-26/plugin/hdPrman/cone.cpp b/third_party/renderman-26/plugin/hdPrman/cone.cpp index 3e2493f381..a27699f02b 100644 --- a/third_party/renderman-26/plugin/hdPrman/cone.cpp +++ b/third_party/renderman-26/plugin/hdPrman/cone.cpp @@ -72,7 +72,9 @@ HdPrman_Cone::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_radius, radius); primvars.SetFloat(RixStr.k_Ri_height, height); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/coordSys.cpp b/third_party/renderman-26/plugin/hdPrman/coordSys.cpp index 2882979709..b126ce9258 100644 --- a/third_party/renderman-26/plugin/hdPrman/coordSys.cpp +++ b/third_party/renderman-26/plugin/hdPrman/coordSys.cpp @@ -13,6 +13,7 @@ #include "pxr/usd/sdf/types.h" #include "pxr/base/tf/staticTokens.h" #include "pxr/imaging/hd/sceneDelegate.h" +#include "pxr/imaging/hd/version.h" #include "pxr/imaging/hf/diagnostic.h" #include "RiTypesHelper.h" @@ -65,7 +66,12 @@ HdPrmanCoordSys::Sync(HdSceneDelegate *sceneDelegate, if (bits & AllDirty) { // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); TfSmallVector xf_rt_values(xf.count); for (size_t i=0; i < xf.count; ++i) { diff --git a/third_party/renderman-26/plugin/hdPrman/cylinder.cpp b/third_party/renderman-26/plugin/hdPrman/cylinder.cpp index d07f34977e..ddf3ffd635 100644 --- a/third_party/renderman-26/plugin/hdPrman/cylinder.cpp +++ b/third_party/renderman-26/plugin/hdPrman/cylinder.cpp @@ -71,7 +71,9 @@ HdPrman_Cylinder::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_zmin, -0.5f * height); primvars.SetFloat(RixStr.k_Ri_zmax, 0.5f * height); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/gprim.h b/third_party/renderman-26/plugin/hdPrman/gprim.h index dded31efc0..cea94ddbe2 100644 --- a/third_party/renderman-26/plugin/hdPrman/gprim.h +++ b/third_party/renderman-26/plugin/hdPrman/gprim.h @@ -8,6 +8,7 @@ #define EXT_RMANPKG_25_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H #include "pxr/pxr.h" +#include "pxr/imaging/hd/version.h" #include "pxr/usd/sdf/types.h" #include "pxr/base/gf/matrix4d.h" @@ -176,7 +177,12 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); // Update visibility so thet rprim->IsVisible() will work in render pass if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, id)) { diff --git a/third_party/renderman-26/plugin/hdPrman/instancer.cpp b/third_party/renderman-26/plugin/hdPrman/instancer.cpp index 4c4eac0389..c1166806b2 100644 --- a/third_party/renderman-26/plugin/hdPrman/instancer.cpp +++ b/third_party/renderman-26/plugin/hdPrman/instancer.cpp @@ -315,7 +315,7 @@ HdPrmanInstancer::Sync( _SyncPrimvars(dirtyBits); // cache the instancer and instance transforms - _SyncTransforms(dirtyBits); + _SyncTransforms(dirtyBits, param); // cache the instancer and instance categories _SyncCategories(dirtyBits); @@ -578,7 +578,8 @@ _ValidateSamplesTimes(HdTimeSampleArray& samples) } void -HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits) +HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits, + HdPrman_RenderParam * param) { HdSceneDelegate* delegate = GetDelegate(); const SdfPath& id = GetId(); @@ -629,15 +630,37 @@ HdPrmanInstancer::_SyncTransforms(const HdDirtyBits* dirtyBits) HdTimeSampleArray boxedRotates; HdTimeSampleArray boxedScales; if (includeInstancerXform) { - delegate->SampleInstancerTransform(id, &instancerXform); + delegate->SampleInstancerTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &instancerXform); } delegate->SamplePrimvar(id, instanceTransformsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &boxedInstanceXforms); delegate->SamplePrimvar(id, instanceTranslationsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedTranslates); delegate->SamplePrimvar(id, instanceScalesToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedScales); delegate->SamplePrimvar(id, instanceRotationsToken, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif &boxedRotates); // Unbox samples held as VtValues @@ -1080,7 +1103,13 @@ HdPrmanInstancer::_PopulateInstances( // include it. We must multiply the instance transforms by this // instancer's transform. HdTimeSampleArray xf; - delegate->SampleInstancerTransform(instancerId, &xf); + delegate->SampleInstancerTransform(instancerId, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); + for (_InstanceData& instance : instances) { instance.transform = _MultiplyTransforms( instance.transform, xf); @@ -1339,7 +1368,12 @@ HdPrmanInstancer::_PopulateInstances( // include it. The parent instancer will instead include it on the // instances it makes of this instancer's prototype groups. HdTimeSampleArray xf; - delegate->SampleInstancerTransform(instancerId, &xf); + delegate->SampleInstancerTransform(instancerId, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); // Get this instancer's params const RtParamList instancerParams = param->ConvertAttributes( diff --git a/third_party/renderman-26/plugin/hdPrman/instancer.h b/third_party/renderman-26/plugin/hdPrman/instancer.h index 28b156f8b6..1bcc073a69 100644 --- a/third_party/renderman-26/plugin/hdPrman/instancer.h +++ b/third_party/renderman-26/plugin/hdPrman/instancer.h @@ -487,7 +487,7 @@ class HdPrmanInstancer : public HdInstancer void _SyncPrimvars(const HdDirtyBits* dirtyBits); // Sync helper; caches the instancer and instance transforms - void _SyncTransforms(const HdDirtyBits* dirtyBits); + void _SyncTransforms(const HdDirtyBits* dirtyBits, HdPrman_RenderParam *); // Sync helper; caches instance or instancer categories as appropriate void _SyncCategories(const HdDirtyBits* dirtyBits); diff --git a/third_party/renderman-26/plugin/hdPrman/light.cpp b/third_party/renderman-26/plugin/hdPrman/light.cpp index be4a9cc652..740accfd22 100644 --- a/third_party/renderman-26/plugin/hdPrman/light.cpp +++ b/third_party/renderman-26/plugin/hdPrman/light.cpp @@ -274,7 +274,7 @@ _PopulateLightFilterNodes( if (HdSprim *sprim = sceneDelegate->GetRenderIndex().GetSprim( HdPrimTypeTokens->lightFilter, filterPath)) { if (auto* lightFilter = dynamic_cast(sprim)) { - lightFilter->SyncToRiley(sceneDelegate, riley); + lightFilter->SyncToRiley(sceneDelegate, param, riley); coordsysIds->push_back(lightFilter->GetCoordSysId()); } } else { @@ -798,7 +798,12 @@ HdPrmanLight::Sync(HdSceneDelegate *sceneDelegate, // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); GfMatrix4d geomMat(1.0); diff --git a/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp b/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp index fef5f58083..39b3caa9af 100644 --- a/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp +++ b/third_party/renderman-26/plugin/hdPrman/lightFilter.cpp @@ -83,7 +83,8 @@ HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, #endif std::lock_guard lock(_syncToRileyMutex); _rileyIsInSync = false; - _SyncToRileyWithLock(sceneDelegate, param->AcquireRiley()); + _SyncToRileyWithLock( + sceneDelegate, param, param->AcquireRiley()); } *dirtyBits = HdChangeTracker::Clean; @@ -92,24 +93,31 @@ HdPrmanLightFilter::Sync(HdSceneDelegate *sceneDelegate, void HdPrmanLightFilter::SyncToRiley( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley) { std::lock_guard lock(_syncToRileyMutex); if (!_rileyIsInSync) { - _SyncToRileyWithLock(sceneDelegate, riley); + _SyncToRileyWithLock(sceneDelegate, param, riley); } } void HdPrmanLightFilter::_SyncToRileyWithLock( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam * param, riley::Riley *riley) { SdfPath const& id = GetId(); // Sample transform HdTimeSampleArray xf; - sceneDelegate->SampleTransform(id, &xf); + sceneDelegate->SampleTransform(id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &xf); TfSmallVector xf_rt_values(xf.count); for (size_t i=0; i < xf.count; ++i) { diff --git a/third_party/renderman-26/plugin/hdPrman/lightFilter.h b/third_party/renderman-26/plugin/hdPrman/lightFilter.h index 0e707e89e9..470356f615 100644 --- a/third_party/renderman-26/plugin/hdPrman/lightFilter.h +++ b/third_party/renderman-26/plugin/hdPrman/lightFilter.h @@ -52,6 +52,7 @@ class HdPrmanLightFilter final : public HdSprim /// Make sure this material has been updated in Riley. void SyncToRiley( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley); /// Returns the minimal set of dirty bits to place in the @@ -66,6 +67,7 @@ class HdPrmanLightFilter final : public HdSprim private: void _SyncToRileyWithLock( HdSceneDelegate *sceneDelegate, + HdPrman_RenderParam *param, riley::Riley *riley); riley::CoordinateSystemId _coordSysId; diff --git a/third_party/renderman-26/plugin/hdPrman/mesh.cpp b/third_party/renderman-26/plugin/hdPrman/mesh.cpp index 74748b20be..7845e198e7 100644 --- a/third_party/renderman-26/plugin/hdPrman/mesh.cpp +++ b/third_party/renderman-26/plugin/hdPrman/mesh.cpp @@ -300,7 +300,8 @@ HdPrman_Mesh::_ConvertGeometry(HdPrman_RenderParam *renderParam, HdPrman_ConvertPrimvars( sceneDelegate, id, primvars, nverts.size(), npoints, npoints, - verts.size()); + verts.size(), + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/points.cpp b/third_party/renderman-26/plugin/hdPrman/points.cpp index 36b33cf137..f58b37366c 100644 --- a/third_party/renderman-26/plugin/hdPrman/points.cpp +++ b/third_party/renderman-26/plugin/hdPrman/points.cpp @@ -61,7 +61,8 @@ HdPrman_Points::_ConvertGeometry(HdPrman_RenderParam *renderParam, *primType = RixStr.k_Ri_Points; HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, - npoints, npoints, npoints); + npoints, npoints, npoints, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/renderParam.cpp b/third_party/renderman-26/plugin/hdPrman/renderParam.cpp index cc58e23e96..bf2e6ef306 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderParam.cpp +++ b/third_party/renderman-26/plugin/hdPrman/renderParam.cpp @@ -28,6 +28,7 @@ #include "pxr/imaging/hd/rprim.h" #include "pxr/imaging/hd/sceneDelegate.h" #include "pxr/imaging/hd/sceneIndexPluginRegistry.h" +#include "pxr/imaging/hd/version.h" #include "pxr/usd/sdf/path.h" @@ -230,13 +231,21 @@ _ConvertPointsPrimvar( { HdTimeSampleArray boxedPoints; if (compPrimvar.empty()) { - sceneDelegate->SamplePrimvar(id, HdTokens->points, &boxedPoints); + sceneDelegate->SamplePrimvar(id, HdTokens->points, +#if HD_API_VERSION >= 68 + shutterInterval[0], + shutterInterval[1], +#endif + &boxedPoints); } else { HdExtComputationUtils::SampledValueStore compSamples; HdExtComputationUtils::SampleComputedPrimvarValues< HDPRMAN_MAX_TIME_SAMPLES>( compPrimvar, sceneDelegate, HDPRMAN_MAX_TIME_SAMPLES, +#if HD_API_VERSION >= 73 + shutterInterval[0], shutterInterval[1], +#endif &compSamples); boxedPoints = compSamples[HdTokens->points]; } @@ -435,6 +444,7 @@ template static void _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, HdInterpolation hdInterp, T& params, int expectedSize, + const GfVec2d &shutterInterval, float time = 0.f) { static_assert(std::disjunction< @@ -620,7 +630,12 @@ _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, } HdTimeSampleArray samples; - sceneDelegate->SamplePrimvar(id, primvar.name, &samples); + sceneDelegate->SamplePrimvar(id, primvar.name, +#if HD_API_VERSION >= 68 + shutterInterval[0], + shutterInterval[1], +#endif + &samples); // XXX: The motion blur scene index plugin ensures that only a single // sample at offset 0 is returned for any primvar on which Prman does // not support motion samples. Currently, that's all primvars except P. @@ -677,7 +692,9 @@ _Convert(HdSceneDelegate *sceneDelegate, SdfPath const& id, void HdPrman_ConvertPrimvars(HdSceneDelegate *sceneDelegate, SdfPath const& id, RtPrimVarList& primvars, int numUniform, int numVertex, - int numVarying, int numFaceVarying, float time) + int numVarying, int numFaceVarying, + const GfVec2d &shutterInterval, + float time) { const HdInterpolation hdInterpValues[] = { HdInterpolationConstant, @@ -698,7 +715,9 @@ HdPrman_ConvertPrimvars(HdSceneDelegate *sceneDelegate, SdfPath const& id, const int modeCount = 5; for (size_t i = 0; i < modeCount; ++i) { _Convert(sceneDelegate, id, hdInterpValues[i], primvars, - primvarSizes[i], time); + primvarSizes[i], + shutterInterval, + time); } } @@ -737,7 +756,7 @@ HdPrman_TransferMaterialPrimvarOpinions(HdSceneDelegate *sceneDelegate, RtParamList HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, - SdfPath const& id, bool isGeometry) + SdfPath const& id, bool isGeometry) { RtParamList attrs; @@ -747,7 +766,7 @@ HdPrman_RenderParam::ConvertAttributes(HdSceneDelegate *sceneDelegate, HdInterpolationConstant, }; for (HdInterpolation hdInterp: hdInterpValues) { - _Convert(sceneDelegate, id, hdInterp, attrs, 1); + _Convert(sceneDelegate, id, hdInterp, attrs, 1, GetShutterInterval()); } // Hydra id -> Riley Rix::k_identifier_name diff --git a/third_party/renderman-26/plugin/hdPrman/renderParam.h b/third_party/renderman-26/plugin/hdPrman/renderParam.h index b5ddf28669..0298d462d8 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderParam.h +++ b/third_party/renderman-26/plugin/hdPrman/renderParam.h @@ -584,6 +584,7 @@ HdPrman_ConvertPrimvars( int numVertex, int numVarying, int numFaceVarying, + const GfVec2d &shutterInterval, float time = 0.f); /// Check for any primvar opinions on the material that should be Riley primvars. diff --git a/third_party/renderman-26/plugin/hdPrman/sphere.cpp b/third_party/renderman-26/plugin/hdPrman/sphere.cpp index f935877446..5134cb7847 100644 --- a/third_party/renderman-26/plugin/hdPrman/sphere.cpp +++ b/third_party/renderman-26/plugin/hdPrman/sphere.cpp @@ -65,7 +65,9 @@ HdPrman_Sphere::_ConvertGeometry(HdPrman_RenderParam *renderParam, primvars.SetFloat(RixStr.k_Ri_radius, radius); - HdPrman_ConvertPrimvars(sceneDelegate, id, primvars, 1, 0, 0, 0); + HdPrman_ConvertPrimvars( + sceneDelegate, id, primvars, 1, 0, 0, 0, + renderParam->GetShutterInterval()); return primvars; } diff --git a/third_party/renderman-26/plugin/hdPrman/volume.cpp b/third_party/renderman-26/plugin/hdPrman/volume.cpp index 09ed44bb21..29fb64bead 100644 --- a/third_party/renderman-26/plugin/hdPrman/volume.cpp +++ b/third_party/renderman-26/plugin/hdPrman/volume.cpp @@ -472,7 +472,8 @@ HdPrman_Volume::_ConvertGeometry(HdPrman_RenderParam *renderParam, /* numUniform = */ 1, /* numVertex = */ 0, /* numVarying = */ 0, - /* numFaceVarying = */ 0); + /* numFaceVarying = */ 0, + renderParam->GetShutterInterval()); // Setup the volume for Prman with the appropriate DSO and its parameters HdVolumeFieldDescriptorVector fields = From 7d6ba78f69433abe044282f67980f4814389876f Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Fri, 9 Aug 2024 20:34:19 -0700 Subject: [PATCH 030/202] Propagate time sample related methods from SdfLayer to SdfAttributeSpec (Internal change: 2336406) --- pxr/usd/sdf/attributeSpec.cpp | 51 ++++++++++++++++++ pxr/usd/sdf/attributeSpec.h | 61 ++++++++++++++++++++-- pxr/usd/sdf/layer.h | 22 ++++++++ pxr/usd/sdf/testenv/testSdfAttribute.py | 30 +++++++---- pxr/usd/sdf/testenv/testSdfHardToReach.cpp | 9 ++++ pxr/usd/sdf/wrapAttributeSpec.cpp | 58 ++++++++++++++++++++ 6 files changed, 217 insertions(+), 14 deletions(-) diff --git a/pxr/usd/sdf/attributeSpec.cpp b/pxr/usd/sdf/attributeSpec.cpp index e298f76d53..bbe18e782e 100644 --- a/pxr/usd/sdf/attributeSpec.cpp +++ b/pxr/usd/sdf/attributeSpec.cpp @@ -153,6 +153,57 @@ SdfAttributeSpec::GetTimeSampleMap() const return GetFieldAs(SdfFieldKeys->TimeSamples); } +std::set +SdfAttributeSpec::ListTimeSamples() const +{ + return GetLayer()->ListTimeSamplesForPath(GetPath()); +} + +size_t +SdfAttributeSpec::GetNumTimeSamples() const +{ + return GetLayer()->GetNumTimeSamplesForPath(GetPath()); +} + +bool +SdfAttributeSpec::GetBracketingTimeSamples(double time, double* tLower, + double* tUpper) const +{ + return GetLayer()->GetBracketingTimeSamplesForPath(GetPath(), time, + tLower, tUpper); +} + +bool +SdfAttributeSpec::QueryTimeSample(double time, VtValue* value) const +{ + return GetLayer()->QueryTimeSample(GetPath(), time, value); +} + +bool +SdfAttributeSpec::QueryTimeSample(double time, SdfAbstractDataValue* value) const +{ + return GetLayer()->QueryTimeSample(GetPath(), time, value); +} + +void +SdfAttributeSpec::SetTimeSample(double time, const VtValue& value) +{ + GetLayer()->SetTimeSample(GetPath(), time, value); +} + +void +SdfAttributeSpec::SetTimeSample(double time, + const SdfAbstractDataConstValue& value) +{ + GetLayer()->SetTimeSample(GetPath(), time, value); +} + +void +SdfAttributeSpec::EraseTimeSample(double time) +{ + GetLayer()->EraseTimeSample(GetPath(), time); +} + SDF_DEFINE_GET_SET_HAS_CLEAR(AllowedTokens, SdfFieldKeys->AllowedTokens, VtTokenArray) SDF_DEFINE_GET_SET_HAS_CLEAR(ColorSpace, SdfFieldKeys->ColorSpace, TfToken) diff --git a/pxr/usd/sdf/attributeSpec.h b/pxr/usd/sdf/attributeSpec.h index 522b8c06f1..af00eadab3 100644 --- a/pxr/usd/sdf/attributeSpec.h +++ b/pxr/usd/sdf/attributeSpec.h @@ -83,10 +83,6 @@ class SdfAttributeSpec : public SdfPropertySpec /// \name Attribute value API /// @{ - /// Returns the entire set of time samples. - SDF_API - SdfTimeSampleMap GetTimeSampleMap() const; - /// Returns the allowed tokens metadata for this attribute. /// Consumers may use this metadata to define a set of predefined /// options for this attribute's value. However, this metadata is @@ -152,6 +148,63 @@ class SdfAttributeSpec : public SdfPropertySpec TfToken GetRoleName() const; /// @} + + /// \name Time-sample API + /// @{ + /// Returns the entire set of time samples. + SDF_API + SdfTimeSampleMap GetTimeSampleMap() const; + + SDF_API + std::set ListTimeSamples() const; + + SDF_API + size_t GetNumTimeSamples() const; + + SDF_API + bool GetBracketingTimeSamples(double time, double* tLower, + double* tUpper) const; + + SDF_API + bool QueryTimeSample(double time, VtValue *value=NULL) const; + SDF_API + bool QueryTimeSample(double time, SdfAbstractDataValue *value) const; + + template + bool QueryTimeSample(double time, T* data) const + { + if (!data) { + return QueryTimeSample(time); + } + + SdfAbstractDataTypedValue outValue(data); + const bool hasValue = QueryTimeSample( + time, static_cast(&outValue)); + + if (std::is_same::value) { + return hasValue && outValue.isValueBlock; + } + + return hasValue && (!outValue.isValueBlock); + } + + SDF_API + void SetTimeSample(double time, const VtValue & value); + SDF_API + void SetTimeSample(double time, const SdfAbstractDataConstValue& value); + + template + void SetTimeSample(double time, const T& value) + { + const SdfAbstractDataConstTypedValue inValue(&value); + const SdfAbstractDataConstValue& untypedInValue = inValue; + return SetTimeSample(time, untypedInValue); + } + + SDF_API + void EraseTimeSample(double time); + + /// @} }; /// Convenience function to create an attributeSpec on a primSpec at the given diff --git a/pxr/usd/sdf/layer.h b/pxr/usd/sdf/layer.h index 1f11f49f39..3e5fd402ef 100644 --- a/pxr/usd/sdf/layer.h +++ b/pxr/usd/sdf/layer.h @@ -1538,6 +1538,8 @@ class SdfLayer SDF_API std::set ListAllTimeSamples() const; + /// \deprecated + /// Use SdfAttributeSpec::ListTimeSamples instead. SDF_API std::set ListTimeSamplesForPath(const SdfPath& path) const; @@ -1545,21 +1547,32 @@ class SdfLayer SDF_API bool GetBracketingTimeSamples(double time, double* tLower, double* tUpper); + /// \deprecated + /// Use SdfAttributeSpec::GetNumTimeSamples instead. SDF_API size_t GetNumTimeSamplesForPath(const SdfPath& path) const; + /// \deprecated + /// Use SdfAttributeSpec::GetBracketingTimeSamples instead. SDF_API bool GetBracketingTimeSamplesForPath(const SdfPath& path, double time, double* tLower, double* tUpper); + /// \deprecated + /// Use SdfAttributeSpec::QueryTimeSample instead. SDF_API bool QueryTimeSample(const SdfPath& path, double time, VtValue *value=NULL) const; + + /// \deprecated + /// Use SdfAttributeSpec::QueryTimeSample instead. SDF_API bool QueryTimeSample(const SdfPath& path, double time, SdfAbstractDataValue *value) const; + /// \deprecated + /// Use SdfAttributeSpec::QueryTimeSample instead. template bool QueryTimeSample(const SdfPath& path, double time, T* data) const @@ -1579,13 +1592,20 @@ class SdfLayer return hasValue && (!outValue.isValueBlock); } + /// \deprecated + /// Use SdfAttributeSpec::SetTimeSample instead. SDF_API void SetTimeSample(const SdfPath& path, double time, const VtValue & value); + + /// \deprecated + /// Use SdfAttributeSpec::SetTimeSample instead. SDF_API void SetTimeSample(const SdfPath& path, double time, const SdfAbstractDataConstValue& value); + /// \deprecated + /// Use SdfAttributeSpec::SetTimeSample instead. template void SetTimeSample(const SdfPath& path, double time, const T& value) @@ -1595,6 +1615,8 @@ class SdfLayer return SetTimeSample(path, time, untypedInValue); } + /// \deprecated + /// Use SdfAttributeSpec::EraseTimeSample instead. SDF_API void EraseTimeSample(const SdfPath& path, double time); diff --git a/pxr/usd/sdf/testenv/testSdfAttribute.py b/pxr/usd/sdf/testenv/testSdfAttribute.py index 8704f09e25..d6cee7e166 100644 --- a/pxr/usd/sdf/testenv/testSdfAttribute.py +++ b/pxr/usd/sdf/testenv/testSdfAttribute.py @@ -13,7 +13,7 @@ class TestSdfAttribute(unittest.TestCase): def test_Creation(self): - + # Test SdPropertySpec abstractness with self.assertRaises(RuntimeError): nullProp = Sdf.PropertySpec() @@ -31,7 +31,7 @@ def test_Creation(self): self.assertEqual(prim.properties[0], attr) self.assertEqual(prim.properties[ attr.name ], attr) self.assertEqual(prim.properties[0].custom, False) - + # Test SdfJustCreatePrimAttributeInLayer self.assertTrue(Sdf.JustCreatePrimAttributeInLayer( layer=layer, attrPath='/just/an.attributeSpec', @@ -70,7 +70,7 @@ def test_Creation(self): dupe = Sdf.AttributeSpec( attr.owner, attr.name, Sdf.ValueTypeNames.Int) self.assertEqual(len(prim.properties), 1) - + # create a duplicate attribute via renaming: error expected dupe = Sdf.AttributeSpec(attr.owner, 'dupe', Sdf.ValueTypeNames.Int) self.assertTrue(dupe) @@ -368,7 +368,7 @@ def test_Connections(self): attr.connectionPathList.addedItems[:] = [testPath1, testPath2] attr.connectionPathList.deletedItems[:] = [testPath3, testPath4] attr.connectionPathList.orderedItems[:] = [testPath2, testPath1] - + attr.connectionPathList.ReplaceItemEdits(testPath2, testPath_shlep) attr.connectionPathList.ReplaceItemEdits(testPath3, testPath_shlep2) self.assertEqual( @@ -389,18 +389,18 @@ def test_Connections(self): attr.connectionPathList.explicitItems[:] = [testPath1, testPath2] attr.connectionPathList.RemoveItemEdits( testPath2 ) self.assertEqual(attr.connectionPathList.explicitItems, [testPath1]) - + attr.connectionPathList.ClearEdits() attr.connectionPathList.addedItems[:] = [testPath1, testPath2] attr.connectionPathList.deletedItems[:] = [testPath1, testPath2] attr.connectionPathList.orderedItems[:] = [testPath1, testPath2] - + attr.connectionPathList.RemoveItemEdits( testPath1 ) self.assertEqual(attr.connectionPathList.addedItems, [testPath2]) self.assertEqual(attr.connectionPathList.deletedItems, [testPath2]) self.assertEqual(attr.connectionPathList.orderedItems, [testPath2]) - + attr.connectionPathList.ClearEdits() def test_Path(self): @@ -426,7 +426,7 @@ def test_Path(self): def test_Inertness(self): # Test attribute-specific 'IsInert()' and 'hasOnlyRequiredFields' # behavior. - # + # # Having any connections render the spec non-inert and having more than # only required fields. This is important due to the 'remove if inert' # cleanup step that automatically runs after any call to ClearInfo. @@ -440,14 +440,14 @@ def test_Inertness(self): attr.connectionPathList.explicitItems.append('/connection.path') self.assertFalse(attr.IsInert()) self.assertFalse(attr.hasOnlyRequiredFields) - + attr.connectionPathList.ClearEdits() self.assertEqual(len(attr.connectionPathList.explicitItems), 0) self.assertFalse(attr.IsInert()) self.assertTrue(attr.hasOnlyRequiredFields) def test_TimeSamples(self): - # Test querying time samples on an attribute + # Test interaction with time samples on an attribute timeSamplesLayer = Sdf.Layer.CreateAnonymous() timeSamplesLayer.ImportFromString( '''#sdf 1.4.32 @@ -479,6 +479,16 @@ def Scope "Scope" self.assertEqual(prim.attributes['desc'].GetInfo('timeSamples'), {1.23: 'foo', 3.23: 'bar', 6: 'baz'}) + prim.attributes['radius'].SetTimeSample(4.0, 2.0) + self.assertEqual(prim.attributes['radius'].QueryTimeSample(4.0), 2.0) + + prim.attributes['desc'].SetTimeSample(10, 'boom') + self.assertEqual(prim.attributes['desc'].GetNumTimeSamples(), 4) + self.assertEqual(prim.attributes['desc'].ListTimeSamples(), [1.23, 3.23, 6, 10]) + prim.attributes['desc'].EraseTimeSample(10) + self.assertEqual(prim.attributes['desc'].GetNumTimeSamples(), 3) + self.assertEqual(prim.attributes['desc'].GetBracketingTimeSamples(2.0), (True, 1.23, 3.23)) + def test_OpaqueNoAuthoredDefault(self): """ Attempting to set the default value of an opaque attribute should fail. diff --git a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp index 7184497337..f5c2c8402e 100644 --- a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp +++ b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp @@ -96,6 +96,15 @@ _TestSdfLayerTimeSampleValueType() TF_AXIOM(layer->QueryTimeSample(attr->GetPath(), 4.0, &vtValue)); TF_AXIOM(vtValue.IsHolding()); TF_AXIOM(vtValue.UncheckedGet() == 4.0); + + // Ensure time samples can be set and retrieved directly on + // attributes themselves. + attr->SetTimeSample(5.0, 5.0); + TF_AXIOM(attr->QueryTimeSample(5.0, &value)); + TF_AXIOM(value == 5.0); + TF_AXIOM(attr->GetNumTimeSamples() == 5); + TF_AXIOM(attr->QueryTimeSample(4.0, &value)); + TF_AXIOM(value == 4.0); } static void diff --git a/pxr/usd/sdf/wrapAttributeSpec.cpp b/pxr/usd/sdf/wrapAttributeSpec.cpp index 1da39df9d5..7a6418112b 100644 --- a/pxr/usd/sdf/wrapAttributeSpec.cpp +++ b/pxr/usd/sdf/wrapAttributeSpec.cpp @@ -17,6 +17,7 @@ #include "pxr/usd/sdf/pySpec.h" #include "pxr/usd/sdf/relationshipSpec.h" #include "pxr/base/tf/pyContainerConversions.h" +#include "pxr/base/tf/pyResultConversions.h" #include @@ -45,6 +46,53 @@ _WrapSetAllowedTokens( spec.SetAllowedTokens(tokenArray); } +static +std::set +_ListTimeSamples(SdfAttributeSpec const &self) +{ + return self.ListTimeSamples(); +} + +static +size_t +_GetNumTimeSamples(SdfAttributeSpec const &self) +{ + return self.GetNumTimeSamples(); +} + +static +VtValue +_QueryTimeSample(SdfAttributeSpec const &self, double time) +{ + VtValue value; + self.QueryTimeSample(time, &value); + return value; +} + +static +tuple +_GetBracketingTimeSamples(SdfAttributeSpec const &self, double time) +{ + double tLower = 0, tUpper = 0; + bool found = self.GetBracketingTimeSamples(time, &tLower, &tUpper); + return boost::python::make_tuple(found, tLower, tUpper); +} + +static +void +_SetTimeSample(SdfAttributeSpec &self, + double time, const VtValue& value) +{ + self.SetTimeSample(time, value); +} + +static +void +_EraseTimeSample(SdfAttributeSpec &self, double time) +{ + self.EraseTimeSample(time); +} + } // anonymous namespace void wrapAttributeSpec() @@ -130,6 +178,16 @@ void wrapAttributeSpec() .def("HasColorSpace", &This::HasColorSpace) .def("ClearColorSpace", &This::ClearColorSpace) + .def("ListTimeSamples", &_ListTimeSamples, + return_value_policy()) + .def("GetNumTimeSamples", &_GetNumTimeSamples) + .def("GetBracketingTimeSamples", + &_GetBracketingTimeSamples) + .def("QueryTimeSample", + &_QueryTimeSample) + .def("SetTimeSample", &_SetTimeSample) + .def("EraseTimeSample", &_EraseTimeSample) + // property keys // XXX DefaultValueKey are actually // implemented on PropertySpec, but are only exposed on From c2585a08655cb7bbbccee4056dcc309f6397bb87 Mon Sep 17 00:00:00 2001 From: Aleksi Sapon Date: Fri, 26 Jul 2024 15:55:27 -0400 Subject: [PATCH 031/202] Configurable anisotropic filtering --- pxr/imaging/hd/material.cpp | 1 + pxr/imaging/hd/types.cpp | 5 ++++- pxr/imaging/hd/types.h | 4 +++- pxr/imaging/hdSt/material.cpp | 1 + pxr/imaging/hdSt/renderPassShader.cpp | 2 +- pxr/imaging/hdSt/samplerObject.cpp | 4 ++++ pxr/imaging/hdSt/simpleLightingShader.cpp | 7 +++---- pxr/imaging/hgi/sampler.cpp | 7 ++++++- pxr/imaging/hgi/sampler.h | 16 ++++++++++++++++ pxr/imaging/hgiGL/sampler.cpp | 8 ++++++-- pxr/imaging/hgiGL/texture.cpp | 5 ++++- pxr/imaging/hgiMetal/sampler.mm | 5 +++-- pxr/imaging/hgiVulkan/sampler.cpp | 4 +++- 13 files changed, 55 insertions(+), 14 deletions(-) diff --git a/pxr/imaging/hd/material.cpp b/pxr/imaging/hd/material.cpp index e7c28e2881..6a8816fad2 100644 --- a/pxr/imaging/hd/material.cpp +++ b/pxr/imaging/hd/material.cpp @@ -270,6 +270,7 @@ _GetSamplerParameters( nodeTypeId, parameters, sdrNode, nodePath), _ResolveMagSamplerParameter( nodeTypeId, parameters, sdrNode, nodePath), + /*maxAnisotropy*/16, HdBorderColorTransparentBlack, /*enableCompare*/false, HdCmpFuncNever }; diff --git a/pxr/imaging/hd/types.cpp b/pxr/imaging/hd/types.cpp index 8224f03f11..32f5d52a30 100644 --- a/pxr/imaging/hd/types.cpp +++ b/pxr/imaging/hd/types.cpp @@ -109,7 +109,8 @@ HdSamplerParameters::HdSamplerParameters() HdSamplerParameters::HdSamplerParameters( HdWrap wrapS, HdWrap wrapT, HdWrap wrapR, - HdMinFilter minFilter, HdMagFilter magFilter, + HdMinFilter minFilter, HdMagFilter magFilter, + uint32_t maxAnisotropy, HdBorderColor borderColor, bool enableCompare, HdCompareFunction compareFunction) : wrapS(wrapS) @@ -117,6 +118,7 @@ HdSamplerParameters::HdSamplerParameters( , wrapR(wrapR) , minFilter(minFilter) , magFilter(magFilter) + , maxAnisotropy(maxAnisotropy) , borderColor(borderColor) , enableCompare(enableCompare) , compareFunction(compareFunction) @@ -131,6 +133,7 @@ HdSamplerParameters::operator==(const HdSamplerParameters &other) const (wrapR == other.wrapR) && (minFilter == other.minFilter) && (magFilter == other.magFilter) && + (maxAnisotropy == other.maxAnisotropy) && (borderColor == other.borderColor) && (enableCompare == other.enableCompare) && (compareFunction == other.compareFunction); diff --git a/pxr/imaging/hd/types.h b/pxr/imaging/hd/types.h index 7972ad90d2..9f08718132 100644 --- a/pxr/imaging/hd/types.h +++ b/pxr/imaging/hd/types.h @@ -117,13 +117,15 @@ class HdSamplerParameters { HdBorderColor borderColor; bool enableCompare; HdCompareFunction compareFunction; + uint32_t maxAnisotropy; HD_API HdSamplerParameters(); HD_API HdSamplerParameters(HdWrap wrapS, HdWrap wrapT, HdWrap wrapR, - HdMinFilter minFilter, HdMagFilter magFilter, + HdMinFilter minFilter, HdMagFilter magFilter, + uint32_t maxAnisotropy=16, HdBorderColor borderColor=HdBorderColorTransparentBlack, bool enableCompare=false, HdCompareFunction compareFunction=HdCmpFuncNever); diff --git a/pxr/imaging/hdSt/material.cpp b/pxr/imaging/hdSt/material.cpp index 5c66f893d1..361f92066e 100644 --- a/pxr/imaging/hdSt/material.cpp +++ b/pxr/imaging/hdSt/material.cpp @@ -104,6 +104,7 @@ _GetTextureHandleHash( samplerParams.wrapR, samplerParams.minFilter, samplerParams.magFilter, + samplerParams.maxAnisotropy, samplerParams.borderColor, samplerParams.enableCompare, samplerParams.compareFunction); diff --git a/pxr/imaging/hdSt/renderPassShader.cpp b/pxr/imaging/hdSt/renderPassShader.cpp index d7687179a8..1f3cf4971f 100644 --- a/pxr/imaging/hdSt/renderPassShader.cpp +++ b/pxr/imaging/hdSt/renderPassShader.cpp @@ -297,7 +297,7 @@ HdStRenderPassShader::UpdateAovInputTextures( for (const auto &namedTextureIdentifier : namedTextureIdentifiers) { static const HdSamplerParameters samplerParameters( HdWrapClamp, HdWrapClamp, HdWrapClamp, - HdMinFilterNearest, HdMagFilterNearest); + HdMinFilterNearest, HdMagFilterNearest, /*maxAnisotropy*/1); // Allocate texture handle for given identifier. HdStTextureHandleSharedPtr textureHandle = diff --git a/pxr/imaging/hdSt/samplerObject.cpp b/pxr/imaging/hdSt/samplerObject.cpp index 9aa8b6b0a6..c1335683ec 100644 --- a/pxr/imaging/hdSt/samplerObject.cpp +++ b/pxr/imaging/hdSt/samplerObject.cpp @@ -67,6 +67,7 @@ _ToHgiSamplerDesc(HdSamplerParameters const &samplerParameters) HdStHgiConversions::GetHgiSamplerAddressMode(samplerParameters.wrapT); desc.addressModeW = HdStHgiConversions::GetHgiSamplerAddressMode(samplerParameters.wrapR); + desc.maxAnisotropy = samplerParameters.maxAnisotropy; desc.borderColor = HdStHgiConversions::GetHgiBorderColor(samplerParameters.borderColor); desc.enableCompare = samplerParameters.enableCompare; @@ -198,6 +199,7 @@ HdSamplerParameters PTEX_SAMPLER_PARAMETERS( HdWrapClamp, HdMinFilterLinear, HdMagFilterLinear, + /*maxAnisotropy*/16, HdBorderColorTransparentBlack, /*enableCompare*/false, HdCmpFuncNever); @@ -209,6 +211,7 @@ HdSamplerParameters LAYOUT_SAMPLER_PARAMETERS( HdWrapRepeat, HdMinFilterNearest, HdMagFilterNearest, + /*maxAnisotropy*/1, HdBorderColorTransparentBlack, /*enableCompare*/false, HdCmpFuncNever); @@ -255,6 +258,7 @@ HdSamplerParameters UDIM_SAMPLER_PARAMETERS( HdWrapClamp, HdMinFilterLinearMipmapLinear, HdMagFilterLinear, + /*maxAnisotropy*/16, HdBorderColorTransparentBlack, /*enableCompare*/false, HdCmpFuncNever); diff --git a/pxr/imaging/hdSt/simpleLightingShader.cpp b/pxr/imaging/hdSt/simpleLightingShader.cpp index 58693c43b1..49e7731006 100644 --- a/pxr/imaging/hdSt/simpleLightingShader.cpp +++ b/pxr/imaging/hdSt/simpleLightingShader.cpp @@ -321,7 +321,7 @@ _MakeNamedTextureHandle( const HdSamplerParameters samplerParameters( wrapModeS, wrapModeT, wrapModeR, - minFilter, HdMagFilterLinear); + minFilter, HdMagFilterLinear, /*maxAnisotropy*/1); HdStTextureHandleSharedPtr const textureHandle = resourceRegistry->AllocateTextureHandle( @@ -451,7 +451,7 @@ HdStSimpleLightingShader::AllocateTextureHandles(HdRenderIndex const &renderInde static const HdSamplerParameters envSamplerParameters( HdWrapRepeat, HdWrapClamp, HdWrapClamp, - HdMinFilterLinearMipmapLinear, HdMagFilterLinear); + HdMinFilterLinearMipmapLinear, HdMagFilterLinear, /*maxAnisotropy*/1); _domeLightEnvironmentTextureHandle = resourceRegistry->AllocateTextureHandle( @@ -539,7 +539,7 @@ HdStSimpleLightingShader::AllocateTextureHandles(HdRenderIndex const &renderInde // for just-allocated texture objects. HdSamplerParameters const shadowSamplerParameters{ HdWrapClamp, HdWrapClamp, HdWrapClamp, - HdMinFilterLinear, HdMagFilterLinear, + HdMinFilterLinear, HdMagFilterLinear, /*maxAnisotropy*/1, HdBorderColorOpaqueWhite, /*enableCompare*/true, HdCmpFuncLEqual}; @@ -648,4 +648,3 @@ HdStSimpleLightingShader::GetNamedTextureHandles() const } PXR_NAMESPACE_CLOSE_SCOPE - diff --git a/pxr/imaging/hgi/sampler.cpp b/pxr/imaging/hgi/sampler.cpp index 993383929e..7c54f37463 100644 --- a/pxr/imaging/hgi/sampler.cpp +++ b/pxr/imaging/hgi/sampler.cpp @@ -8,6 +8,10 @@ PXR_NAMESPACE_OPEN_SCOPE +TF_DEFINE_ENV_SETTING(HGI_MAX_ANISOTROPY, 16, + "Maximum anisotropic filtering ratio for all samplers"); + + HgiSampler::HgiSampler(HgiSamplerDesc const& desc) : _descriptor(desc) { @@ -30,7 +34,8 @@ bool operator==(const HgiSamplerDesc& lhs, lhs.mipFilter == rhs.mipFilter && lhs.addressModeU == rhs.addressModeU && lhs.addressModeV == rhs.addressModeV && - lhs.addressModeW == rhs.addressModeW + lhs.addressModeW == rhs.addressModeW && + lhs.maxAnisotropy == rhs.maxAnisotropy ; } diff --git a/pxr/imaging/hgi/sampler.h b/pxr/imaging/hgi/sampler.h index a6dfb5537d..053caaa7af 100644 --- a/pxr/imaging/hgi/sampler.h +++ b/pxr/imaging/hgi/sampler.h @@ -8,6 +8,9 @@ #define PXR_IMAGING_HGI_SAMPLER_H #include "pxr/pxr.h" + +#include "pxr/base/tf/envSetting.h" + #include "pxr/imaging/hgi/api.h" #include "pxr/imaging/hgi/enums.h" #include "pxr/imaging/hgi/handle.h" @@ -18,6 +21,12 @@ PXR_NAMESPACE_OPEN_SCOPE +/// Sets the maximum anisotropic filtering ratio for all samplers. +/// By default this is 16x. The actual value used depends on the +/// device limits. A value of 1 effectively disables anisotropic sampling. +/// +HGI_API +extern TfEnvSetting HGI_MAX_ANISOTROPY; /// \struct HgiSamplerDesc /// @@ -42,6 +51,11 @@ PXR_NAMESPACE_OPEN_SCOPE /// Enables sampler comparison against a reference value during lookups. ///
  • compareFunction: /// The comparison function to apply if sampler compare is enabled.
  • +///
  • maxAnisotropy: +/// Maximum anisotropic filtering ratio. The default value of 16 corresponds +/// to the previously internal default value. The actual value used is subject +/// to the device maximum supported anisotropy and the HGI_MAX_ANISOTROPY +/// setting. A value of 1 effectively disables anisotropic sampling.
  • /// /// struct HgiSamplerDesc @@ -56,6 +70,7 @@ struct HgiSamplerDesc , borderColor(HgiBorderColorTransparentBlack) , enableCompare(false) , compareFunction(HgiCompareFunctionNever) + , maxAnisotropy(16) {} std::string debugName; @@ -68,6 +83,7 @@ struct HgiSamplerDesc HgiBorderColor borderColor; bool enableCompare; HgiCompareFunction compareFunction; + uint32_t maxAnisotropy; }; HGI_API diff --git a/pxr/imaging/hgiGL/sampler.cpp b/pxr/imaging/hgiGL/sampler.cpp index 555cf800bc..191e030a44 100644 --- a/pxr/imaging/hgiGL/sampler.cpp +++ b/pxr/imaging/hgiGL/sampler.cpp @@ -14,6 +14,8 @@ #include "pxr/base/gf/vec4f.h" #include "pxr/base/tf/diagnostic.h" +#include + PXR_NAMESPACE_OPEN_SCOPE @@ -68,11 +70,13 @@ HgiGLSampler::HgiGLSampler(HgiSamplerDesc const& desc) // when the filters are "nearest" to ensure those filters are used. if (minFilter != GL_NEAREST && minFilter != GL_NEAREST_MIPMAP_NEAREST && magFilter != GL_NEAREST) { - static const float maxAnisotropy = 16.0; + float aniso = 2.0f; + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &aniso); glSamplerParameterf( _samplerId, GL_TEXTURE_MAX_ANISOTROPY_EXT, - maxAnisotropy); + std::min({aniso, static_cast(desc.maxAnisotropy), + static_cast(TfGetEnvSetting(HGI_MAX_ANISOTROPY))})); } glSamplerParameteri( diff --git a/pxr/imaging/hgiGL/texture.cpp b/pxr/imaging/hgiGL/texture.cpp index 25db1d25d7..90273e5eea 100644 --- a/pxr/imaging/hgiGL/texture.cpp +++ b/pxr/imaging/hgiGL/texture.cpp @@ -6,6 +6,7 @@ // #include "pxr/imaging/garch/glApi.h" +#include "pxr/imaging/hgi/sampler.h" #include "pxr/imaging/hgiGL/diagnostic.h" #include "pxr/imaging/hgiGL/conversions.h" #include "pxr/imaging/hgiGL/texture.h" @@ -14,6 +15,7 @@ PXR_NAMESPACE_OPEN_SCOPE + static void _GlTextureStorageND( @@ -254,7 +256,8 @@ HgiGLTexture::HgiGLTexture(HgiTextureDesc const & desc) glTextureParameterf( _textureId, GL_TEXTURE_MAX_ANISOTROPY_EXT, - aniso); + std::min(aniso, + static_cast(TfGetEnvSetting(HGI_MAX_ANISOTROPY)))); } const uint16_t mips = desc.mipLevels; diff --git a/pxr/imaging/hgiMetal/sampler.mm b/pxr/imaging/hgiMetal/sampler.mm index cf5ff71884..c5e4e20a50 100644 --- a/pxr/imaging/hgiMetal/sampler.mm +++ b/pxr/imaging/hgiMetal/sampler.mm @@ -38,8 +38,9 @@ if ((desc.minFilter != HgiSamplerFilterNearest || desc.mipFilter == HgiMipFilterLinear) && desc.magFilter != HgiSamplerFilterNearest) { - static const int maxAnisotropy = 16; - smpDesc.maxAnisotropy = maxAnisotropy; + static const uint32_t maxAnisotropy = 16; + smpDesc.maxAnisotropy = std::min({maxAnisotropy, desc.maxAnisotropy, + static_cast(TfGetEnvSetting(HGI_MAX_ANISOTROPY))}); } HGIMETAL_DEBUG_LABEL(smpDesc, _descriptor.debugName.c_str()); diff --git a/pxr/imaging/hgiVulkan/sampler.cpp b/pxr/imaging/hgiVulkan/sampler.cpp index 2ae2ce1cb5..25990055e4 100644 --- a/pxr/imaging/hgiVulkan/sampler.cpp +++ b/pxr/imaging/hgiVulkan/sampler.cpp @@ -52,7 +52,9 @@ HgiVulkanSampler::HgiVulkanSampler( HgiVulkanCapabilities const& caps = device->GetDeviceCapabilities(); sampler.anisotropyEnable = caps.vkDeviceFeatures.samplerAnisotropy; sampler.maxAnisotropy = sampler.anisotropyEnable ? - caps.vkDeviceProperties.limits.maxSamplerAnisotropy : 1.0f; + std::min({caps.vkDeviceProperties.limits.maxSamplerAnisotropy, + static_cast(desc.maxAnisotropy), + static_cast(TfGetEnvSetting(HGI_MAX_ANISOTROPY))}) : 1.0f; } TF_VERIFY( From 102a3e2f3faad469544f82297479bc67cf3f0662 Mon Sep 17 00:00:00 2001 From: Roggie Zhang Date: Tue, 13 Aug 2024 10:36:37 +0800 Subject: [PATCH 032/202] Register UsdValidationErrorType as TfEnum --- pxr/usd/usd/validationError.cpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/pxr/usd/usd/validationError.cpp b/pxr/usd/usd/validationError.cpp index a3a78f19a7..9db883593d 100644 --- a/pxr/usd/usd/validationError.cpp +++ b/pxr/usd/usd/validationError.cpp @@ -5,10 +5,19 @@ // https://openusd.org/license. // +#include "pxr/base/tf/enum.h" #include "pxr/usd/usd/validationError.h" PXR_NAMESPACE_OPEN_SCOPE +TF_REGISTRY_FUNCTION(TfEnum) +{ + TF_ADD_ENUM_NAME(UsdValidationErrorType::None, "None"); + TF_ADD_ENUM_NAME(UsdValidationErrorType::Error, "Error"); + TF_ADD_ENUM_NAME(UsdValidationErrorType::Warn, "Warn"); + TF_ADD_ENUM_NAME(UsdValidationErrorType::Info, "Info"); +} + UsdValidationErrorSite::UsdValidationErrorSite( const SdfLayerHandle &layer, const SdfPath &objectPath) : _layer(layer), _objectPath(objectPath) @@ -39,24 +48,8 @@ UsdValidationError::UsdValidationError(const UsdValidationErrorType &type, std::string UsdValidationError::GetErrorAsString() const { - std::string errorTypeAsString; - switch(_errorType) { - case UsdValidationErrorType::None: - return _errorMsg; - break; - case UsdValidationErrorType::Error: - errorTypeAsString = "Error"; - break; - case UsdValidationErrorType::Warn: - errorTypeAsString = "Warn"; - break; - case UsdValidationErrorType::Info: - errorTypeAsString = "Info"; - break; - } - - const std::string separator = ": "; - return errorTypeAsString + separator + _errorMsg; + return _errorType == UsdValidationErrorType::None ? _errorMsg : TfStringPrintf( + "%s: %s", TfEnum::GetDisplayName(_errorType).c_str(), _errorMsg.c_str()); } void From 138ff224ee5293a371a1f61187d971556c989671 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 13 Aug 2024 16:46:07 -0400 Subject: [PATCH 033/202] feat: add connectable validator - added plugInfo, tokens, validation & test related to connectable nesting rules in usdShade --- pxr/usd/usdShade/plugInfo.json | 3 + .../testenv/testUsdShadeValidators.cpp | 55 ++++++++++++++- pxr/usd/usdShade/validatorTokens.h | 3 +- pxr/usd/usdShade/validators.cpp | 68 +++++++++++++++++++ 4 files changed, 127 insertions(+), 2 deletions(-) diff --git a/pxr/usd/usdShade/plugInfo.json b/pxr/usd/usdShade/plugInfo.json index 3437854ea3..31764db293 100644 --- a/pxr/usd/usdShade/plugInfo.json +++ b/pxr/usd/usdShade/plugInfo.json @@ -128,6 +128,9 @@ } }, "Validators": { + "ConnectableValidator": { + "doc": "Connectable prims (e.g. Shader, Material, etc) can only be nested inside other Container-like Connectable prims. Container-like prims include Material, NodeGraph, Light, LightFilter. Shader is not a Container-like prim." + }, "MaterialBindingApiAppliedValidator": { "doc": "Verify a prim has the MaterialBindingAPI applied if it has a material binding relationship." }, diff --git a/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp index 85d2b236bf..06141828be 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp +++ b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp @@ -16,6 +16,7 @@ #include "pxr/usd/usd/validationRegistry.h" #include "pxr/usd/usd/validator.h" #include "pxr/usd/usdGeom/validatorTokens.h" +#include "pxr/usd/usdGeom/scope.h" #include "pxr/usd/usdShade/shader.h" #include "pxr/usd/usdShade/shaderDefUtils.h" #include "pxr/usd/usdShade/tokens.h" @@ -41,7 +42,8 @@ TestUsdShadeValidators() UsdShadeValidatorNameTokens->materialBindingRelationships, UsdShadeValidatorNameTokens->shaderSdrCompliance, UsdShadeValidatorNameTokens->subsetMaterialBindFamilyName, - UsdShadeValidatorNameTokens->subsetsMaterialBindFamily + UsdShadeValidatorNameTokens->subsetsMaterialBindFamily, + UsdShadeValidatorNameTokens->connectableValidator }; // This should be updated with every new validator added with the @@ -410,6 +412,55 @@ TestUsdShadeMaterialBindingAPIAppliedValidator() TF_AXIOM(errors.size() == 0); } +void +TestUsdShadeConnectableValidator() +{ + UsdValidationRegistry ®istry = UsdValidationRegistry::GetInstance(); + const UsdValidator *validator = registry.GetOrLoadValidatorByName( + UsdShadeValidatorNameTokens->connectableValidator); + TF_AXIOM(validator); + + UsdStageRefPtr usdStage = UsdStage::CreateInMemory(); + + // Create a Material > Shader > Shader hierarchy + UsdShadeMaterial::Define(usdStage, SdfPath("/RootMaterial")); + UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Shader")); + const UsdShadeShader& insideShader = UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Shader/InsideShader")); + + // Verify error that does not allow a connectable to be parented by non-container connectable + UsdValidationErrorVector errors = validator->Validate(insideShader.GetPrim()); + + TF_AXIOM(errors.size() == 1); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetSites().size() == 1); + TF_AXIOM(errors[0].GetSites()[0].IsValid()); + TF_AXIOM(errors[0].GetSites()[0].IsPrim()); + TF_AXIOM(errors[0].GetSites()[0].GetPrim().GetPath() == SdfPath("/RootMaterial/Shader/InsideShader")); + std::string expectedErrorMsg = + "Connectable Shader cannot reside under a non-Container Connectable Shader"; + TF_AXIOM(errors[0].GetMessage() == expectedErrorMsg); + + // Create a Material > Scope > Shader hierarchy + usdStage->RemovePrim(SdfPath("/RootMaterial/Shader/InsideShader")); + usdStage->RemovePrim(SdfPath("/RootMaterial/Shader")); + UsdGeomScope::Define(usdStage, SdfPath("/RootMaterial/Scope")); + const UsdShadeShader& insideScopeShader = UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Scope/InsideShader")); + + // Verify error that does not allow a connectable to have any non-connectable container ancestors + errors = validator->Validate(insideScopeShader.GetPrim()); + TF_AXIOM(errors.size() == 1); + TF_AXIOM(errors[0].GetType() == UsdValidationErrorType::Error); + TF_AXIOM(errors[0].GetSites().size() == 1); + TF_AXIOM(errors[0].GetSites()[0].IsValid()); + TF_AXIOM(errors[0].GetSites()[0].IsPrim()); + TF_AXIOM(errors[0].GetSites()[0].GetPrim().GetPath() == SdfPath("/RootMaterial/Scope/InsideShader")); + expectedErrorMsg = + "Connectable Shader can only have Connectable Container ancestors up to " + "Material ancestor , but its parent Scope is a Scope."; + std::string message = errors[0].GetMessage(); + TF_AXIOM(errors[0].GetMessage() == expectedErrorMsg); +} + int main() { @@ -419,5 +470,7 @@ main() TestUsdShadeShaderPropertyCompliance(); TestUsdShadeSubsetMaterialBindFamilyName(); TestUsdShadeSubsetsMaterialBindFamily(); + TestUsdShadeConnectableValidator(); + return EXIT_SUCCESS; }; diff --git a/pxr/usd/usdShade/validatorTokens.h b/pxr/usd/usdShade/validatorTokens.h index e56baff7e1..f96564bf7b 100644 --- a/pxr/usd/usdShade/validatorTokens.h +++ b/pxr/usd/usdShade/validatorTokens.h @@ -16,7 +16,8 @@ PXR_NAMESPACE_OPEN_SCOPE -#define USD_SHADE_VALIDATOR_NAME_TOKENS \ +#define USD_SHADE_VALIDATOR_NAME_TOKENS \ + ((connectableValidator, "usdShade:ConnectableValidator")) \ ((materialBindingApiAppliedValidator, "usdShade:MaterialBindingApiAppliedValidator")) \ ((materialBindingRelationships, "usdShade:MaterialBindingRelationships")) \ ((shaderSdrCompliance, "usdShade:ShaderSdrCompliance")) \ diff --git a/pxr/usd/usdShade/validators.cpp b/pxr/usd/usdShade/validators.cpp index d3be1c88cc..5cead9d5a9 100644 --- a/pxr/usd/usdShade/validators.cpp +++ b/pxr/usd/usdShade/validators.cpp @@ -30,6 +30,70 @@ PXR_NAMESPACE_OPEN_SCOPE +static +UsdValidationErrorVector +_ConnectableValidator(const UsdPrim& usdPrim) +{ + UsdValidationErrorVector errors; + + const UsdShadeConnectableAPI& connectable = UsdShadeConnectableAPI(usdPrim); + + if (!usdPrim.GetTypeName().IsEmpty() && connectable) { + const UsdPrim& parentPrim = usdPrim.GetParent(); + + if (parentPrim && !parentPrim.IsPseudoRoot()) { + UsdShadeConnectableAPI parentConnectable = UsdShadeConnectableAPI(parentPrim); + if (parentPrim.GetTypeName().IsEmpty()){ + parentConnectable = UsdShadeConnectableAPI(); + } + + if (parentConnectable && !parentConnectable.IsContainer()) { + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(usdPrim.GetStage(), + usdPrim.GetPath()) + }, + TfStringPrintf("Connectable %s <%s> cannot reside " + "under a non-Container Connectable %s", + usdPrim.GetTypeName().GetText(), + usdPrim.GetPath().GetText(), + parentPrim.GetTypeName().GetText())); + } + else if (!parentConnectable) { + UsdPrim currentAncestor = parentPrim.GetParent(); + while(currentAncestor && !currentAncestor.IsPseudoRoot()) { + if (!currentAncestor.GetTypeName().IsEmpty()) { + const UsdShadeConnectableAPI& ancestorConnectable = UsdShadeConnectableAPI(currentAncestor); + if (ancestorConnectable) { + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites { + UsdValidationErrorSite(usdPrim.GetStage(), + usdPrim.GetPath()) + }, + TfStringPrintf("Connectable %s <%s> can only have" + " Connectable Container ancestors" + " up to %s ancestor <%s>, but its" + " parent %s is a %s.", + usdPrim.GetTypeName().GetText(), + usdPrim.GetPath().GetText(), + currentAncestor.GetTypeName().GetText(), + currentAncestor.GetPath().GetText(), + parentPrim.GetName().GetText(), + parentPrim.GetTypeName().GetText())); + break; + } + } + currentAncestor = currentAncestor.GetParent(); + } + } + } + } + + return errors; +} + static UsdValidationErrorVector _MaterialBindingApiAppliedValidator(const UsdPrim &usdPrim) @@ -411,6 +475,10 @@ TF_REGISTRY_FUNCTION(UsdValidationRegistry) registry.RegisterPluginValidator( UsdShadeValidatorNameTokens->subsetsMaterialBindFamily, _SubsetsMaterialBindFamily); + + registry.RegisterPluginValidator( + UsdShadeValidatorNameTokens->connectableValidator, + _ConnectableValidator); } PXR_NAMESPACE_CLOSE_SCOPE From d422a3c8c82869d90cd27fea60b775fb23568ef3 Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Fri, 9 Aug 2024 20:35:45 -0700 Subject: [PATCH 034/202] Scene delegate SampleFoo calls: updating HdExtComputationUtils to have the SampleComputedPrimvarValues also take startTime and endTime. (Internal change: 2336407) (Internal change: 2336414) --- pxr/imaging/hd/extComputationUtils.h | 73 +++++++++++++++++++++++++++- pxr/imaging/hd/version.h | 5 +- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/pxr/imaging/hd/extComputationUtils.h b/pxr/imaging/hd/extComputationUtils.h index 3d9d86470c..e01be2a9c2 100644 --- a/pxr/imaging/hd/extComputationUtils.h +++ b/pxr/imaging/hd/extComputationUtils.h @@ -16,6 +16,7 @@ #include "pxr/base/tf/token.h" #include "pxr/base/vt/value.h" +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -62,6 +63,16 @@ class HdExtComputationUtils { size_t maxSampleCount, SampledValueStore *computedPrimvarValueStore); + /// Overload taking startTime and endTime explicitly. + template + static void + SampleComputedPrimvarValues( + HdExtComputationPrimvarDescriptorVector const& compPrimvars, + HdSceneDelegate* sceneDelegate, + float startTime, float endTime, + size_t maxSampleCount, + SampledValueStore *computedPrimvarValueStore); + // Helper methods (these are public for testing purposes) using ComputationDependencyMap = std::unordered_map + static void + _SampleComputedPrimvarValues( + HdExtComputationPrimvarDescriptorVector const& compPrimvars, + HdSceneDelegate* sceneDelegate, + std::optional> startAndEndTime, + size_t maxSampleCount, + SampledValueStore *computedPrimvarValueStore); + HD_API static ComputationDependencyMap _GenerateDependencyMap( @@ -93,6 +113,7 @@ class HdExtComputationUtils { _ExecuteSampledComputations( HdExtComputationConstPtrVector computations, HdSceneDelegate* sceneDelegate, + std::optional> startAndEndTime, size_t maxSampleCount, SampledValueStore* valueStore); @@ -125,6 +146,42 @@ HdExtComputationUtils::SampleComputedPrimvarValues( size_t maxSampleCount, SampledValueStore *computedPrimvarValueStore ) +{ + _SampleComputedPrimvarValues( + compPrimvars, + sceneDelegate, + /* startAndEndTime = */ std::nullopt, + maxSampleCount, + computedPrimvarValueStore); +} + +template +/*static*/ void +HdExtComputationUtils::SampleComputedPrimvarValues( + HdExtComputationPrimvarDescriptorVector const& compPrimvars, + HdSceneDelegate* sceneDelegate, + float startTime, float endTime, + size_t maxSampleCount, + SampledValueStore *computedPrimvarValueStore +) +{ + _SampleComputedPrimvarValues( + compPrimvars, + sceneDelegate, + { {startTime, endTime }}, + maxSampleCount, + computedPrimvarValueStore); +} + +template +/*static*/ void +HdExtComputationUtils::_SampleComputedPrimvarValues( + HdExtComputationPrimvarDescriptorVector const& compPrimvars, + HdSceneDelegate* sceneDelegate, + std::optional> startAndEndTime, + size_t maxSampleCount, + SampledValueStore *computedPrimvarValueStore +) { HD_TRACE_FUNCTION(); @@ -142,7 +199,9 @@ HdExtComputationUtils::SampleComputedPrimvarValues( // Execution SampledValueStore valueStore; _ExecuteSampledComputations(sortedComputations, sceneDelegate, - maxSampleCount, &valueStore); + startAndEndTime, + maxSampleCount, + &valueStore); // Output extraction for (auto const& pv : compPrimvars) { @@ -156,6 +215,7 @@ template HdExtComputationUtils::_ExecuteSampledComputations( HdExtComputationConstPtrVector computations, HdSceneDelegate* sceneDelegate, + std::optional> startAndEndTime, size_t maxSampleCount, SampledValueStore *valueStore ) @@ -175,7 +235,16 @@ HdExtComputationUtils::_ExecuteSampledComputations( std::vector times; for (TfToken const& input : sceneInputNames) { auto &samples = (*valueStore)[input]; - sceneDelegate->SampleExtComputationInput(compId, input, &samples); + if (startAndEndTime) { + sceneDelegate->SampleExtComputationInput( + compId, input, + startAndEndTime->first, startAndEndTime->second, + &samples); + } else { + sceneDelegate->SampleExtComputationInput( + compId, input, + &samples); + } for (size_t i = 0; i < samples.count; ++i) times.push_back(samples.times[i]); diff --git a/pxr/imaging/hd/version.h b/pxr/imaging/hd/version.h index 849fb82d53..d7d6f87b72 100644 --- a/pxr/imaging/hd/version.h +++ b/pxr/imaging/hd/version.h @@ -93,9 +93,10 @@ // 70 -> 71: Add virtual HdRenderDelegate::IsParallelSyncEnabled. // 71 -> 72: Add render index API to batch notices sent by the merging scene // index. -// +// 72 -> 73: Adds HdExtComputationUtils::SampleComputedPrimvarValues with +// startTime and endTime -#define HD_API_VERSION 72 +#define HD_API_VERSION 73 // 1 -> 2: SimpleLighting -> FallbackLighting #define HD_SHADER_API 2 From 982221fa3003abf8d69ecf23f87a9882d6d0d536 Mon Sep 17 00:00:00 2001 From: vverovvero Date: Fri, 9 Aug 2024 20:36:17 -0700 Subject: [PATCH 035/202] Update materialSchema.h ASCII art to match the diagram in Hydra Prim Schema documentation, namely to change "_PbsNetMatStandIn" to "PxrSurface". Also removes 'materialNetwork' as its own box and combines that with the 'ri' box to now read 'ri [materialNetwork for Renderman render context]' (Internal change: 2336427) --- pxr/imaging/hd/materialSchema.h | 73 ++++++++++++++++----------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/pxr/imaging/hd/materialSchema.h b/pxr/imaging/hd/materialSchema.h index cdf79fabee..660004805b 100644 --- a/pxr/imaging/hd/materialSchema.h +++ b/pxr/imaging/hd/materialSchema.h @@ -79,14 +79,16 @@ class HdMaterialSchema : public HdSchema /// \name ASCII Art Diagram /// @{ - /// The following ASCII art is a diagram of the scene index prim - /// "Plastic_Material" of material type. The diagram shows how the two - /// sibling container data sources "materialOverride" and "material" - /// relate to each other. + /// The following diagram depicts an example scene index prim + /// "Plastic_Material". "Plastic_Material" is a scene index prim that has + /// multiple container data sources, like 'material' (HdMaterialSchema) and + /// 'materialOverride' (HdMaterialOverrideSchema). "Plastic_Material" as a + /// scene index prim also has a scene index prim type, which is type + /// 'material'. (See HdPrimTypeTokens). /// Note the following: /// 1. The data flows from left to right. - /// 2. The noodles between "materialOverride" and "interfaceMappings" + /// 2. The lines between "materialOverride" and "interfaceMappings" /// are not true connections and are not backed by the /// MaterialConnection schema. Each item within "materialOverride" /// and "interfaceMappings" is loosely coupled by their matching @@ -102,39 +104,34 @@ class HdMaterialSchema : public HdSchema /// | +-----------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------------------------------+ | /// | | materialOverride | | material | | /// | | +------------------------------+ | | +--------------------------------------------------------------------------------------------------------------------------------------------------+ | | - /// | | | interfaceValues | | | | ri [Renderman render context] | | | - /// | | | | | | | +--------------------------------------------------------------------------------------------------------------------------------------------+ | | | - /// | | | *globalVal = 0.2-------------+-+----+ | | | materialNetwork | | | | - /// | | | | | | | | | +-----------------------+ +--------------------------------------------------------------------------------+ +-------------------+ | | | | - /// | | | *globalSpecularKface = 0.666-+-+-+ | | | | |interfaceMappings | | nodes | |terminals | | | | | - /// | | | | | | | | | | | | | +--------------------+ | | | | | | | - /// | | +------------------------------+ | | +-+--+--+-+*globalVal o-----------+---+ | |"Color_Manipulate" | | +-+-o*surface | | | | | - /// | | | | | | | | | | | |[materialNode] | | | | | | | | | - /// | +-----------------------------------+ +----+--+--+-+*globalSpecularKface o-+-+ | | | | | | | | | | | | - /// | | | | | | | +---+-+-*adjustVal *out+----+ | | +-------------------+ | | | | - /// | | | | +-----------------------+ | | | | | | | | | | | | - /// | | | | | | | +--------------------+ | +-----------------------+ +--------------------+ | | | | | | - /// | | | | | | | | |"MaterialLayer" | |"_PbsNetMatStandIn" | | | | | | | - /// | | | | | | | | |[materialNode] | |[materialNode] | | | | | | | - /// | | | | | | | | | | | | | | | | | | - /// | | | | +-+---+---------------------------+--+--*specularKface *out+--+-o*materialIn *out+-+-+ | | | | - /// | | | | | | | | | | | | | | | | - /// | | | | | | | | *diffuseK = 0.12 | | | | | | | | - /// | | | | | | +----------------------+ | | | +--------------------+ | | | | | - /// | | | | | | |"Color_RetargetLayer" | | | | | | | | | - /// | | | | | | |[materialNode] | +--+-o*someInput_A | | | | | | - /// | | | | | | | | | | | | | | | - /// | | | | +---+-+-*valRemapAmount *out+-----+-o*someInput_B | | | | | | - /// | | | | | | | | | | | | | | - /// | | | | | +----------------------+ +-----------------------+ | | | | | - /// | | | | | | | | | | - /// | | | | | | | | | | - /// | | | | | | | | | | - /// | | | | | | | | | | - /// | | | | +--------------------------------------------------------------------------------+ | | | | - /// | | | | | | | | - /// | | | | | | | | - /// | | | +--------------------------------------------------------------------------------------------------------------------------------------------+ | | | + /// | | | interfaceValues | | | | ri [materialNetwork for Renderman render context] | | | + /// | | | | | | | +-----------------------+ +--------------------------------------------------------------------------------+ +-------------------+ | | | + /// | | | *globalVal = 0.2-------------+-+----+ | | |interfaceMappings | | nodes | |terminals | | | | + /// | | | | | | | | | | | +--------------------+ | | | | | | + /// | | | *globalSpecularKface = 0.666-+-+-+ +-+--+--+-+*globalVal o-----------+---+ | |"Color_Manipulate" | | +-+-o*surface | | | | + /// | | | | | | | | | | | | |[materialNode] | | | | | | | | + /// | | +------------------------------+ | +--+-+--+--+-+*globalSpecularKface o-+-+ | | | | | | | | | | | + /// | | | | | | | | +---+-+-*adjustVal *out+----+ | | +-------------------+ | | | + /// | +-----------------------------------+ | | +-----------------------+ | | | | | | | | | | | + /// | | | | | | +--------------------+ | +-----------------------+ +--------------------+ | | | | | + /// | | | | | | | |"MaterialLayer" | |"PxrSurface" | | | | | | + /// | | | | | | | |[materialNode] | |[materialNode] | | | | | | + /// | | | | | | | | | | | | | | | | + /// | | | +-+---+---------------------------+--+--*specularKface *out+--+-o*materialIn *out+-+-+ | | | + /// | | | | | | | | | | | | | | + /// | | | | | | | *diffuseK = 0.12 | | | | | | | + /// | | | | | +----------------------+ | | | +--------------------+ | | | | + /// | | | | | |"Color_RetargetLayer" | | | | | | | | + /// | | | | | |[materialNode] | +--+-o*someInput_A | | | | | + /// | | | | | | | | | | | | | + /// | | | +---+-+-*valRemapAmount *out+-----+-o*someInput_B | | | | | + /// | | | | | | | | | | | | + /// | | | | +----------------------+ +-----------------------+ | | | | + /// | | | | | | | | + /// | | | | | | | | + /// | | | | | | | | + /// | | | | | | | | + /// | | | +--------------------------------------------------------------------------------+ | | | /// | | | | | | /// | | +--------------------------------------------------------------------------------------------------------------------------------------------------+ | | /// | | | | From 0833d8170735c9b0e10e7441980bd0c856e616cb Mon Sep 17 00:00:00 2001 From: vverovvero Date: Fri, 9 Aug 2024 20:36:53 -0700 Subject: [PATCH 036/202] Update open source documentation with HdSceneIndexPrimMaterial diagram. Also updates the outline for materialNetwork by adding the interfaceMappings member, and adds outline for materialOverride. (Internal change: 2336428) --- extras/imaging/docs/CMakeLists.txt | 1 + ...HdSceneIndexPrimMaterialDiagram.drawio.svg | 4 +++ extras/imaging/docs/hydra_prim_schemas.dox | 31 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 extras/imaging/docs/HdSceneIndexPrimMaterialDiagram.drawio.svg diff --git a/extras/imaging/docs/CMakeLists.txt b/extras/imaging/docs/CMakeLists.txt index 6245a6244d..5713608714 100644 --- a/extras/imaging/docs/CMakeLists.txt +++ b/extras/imaging/docs/CMakeLists.txt @@ -8,6 +8,7 @@ pxr_docs_only_dir(${PXR_PACKAGE} hydra_prim_schemas.dox examples_hydra_getting_started.cpp app_renderer_filters.png + HdSceneIndexPrimMaterialDiagram.drawio.svg hdschema.png legacy_scene_delegate_emulation.png nested_datasources.png diff --git a/extras/imaging/docs/HdSceneIndexPrimMaterialDiagram.drawio.svg b/extras/imaging/docs/HdSceneIndexPrimMaterialDiagram.drawio.svg new file mode 100644 index 0000000000..567b05c3e7 --- /dev/null +++ b/extras/imaging/docs/HdSceneIndexPrimMaterialDiagram.drawio.svg @@ -0,0 +1,4 @@ + + + +
    "Plastic_Material" [scene index prim name]
    "Plastic_Material" [scene index prim name]
    materialOverride
    materialOverride
    interfaceValues

    *globalVal = 0.2

    *globalSpecularKface = 0.666
    interfaceValues...
    material
    material
    ri [materialNetwork for Renderman render context]
    ri [materialNetwork for Renderman render context]
    interfaceMappings

    *globalVal o

    *globalSpecularKface o
    interfaceMappings...
    nodes
    nodes
    "Color_Manipulate" [materialNode]

    *adjustVal
    "Color_Manipulate" [m...
    *out
    *out
    "Color_RetargetLayer" [materialNode]

    *valRemapAmount
    "Color_RetargetLayer"...
    *out
    *out
    "MaterialLayer"  [materialNode]

     *specularKface

     *diffuseK = 0.12

    o*someInput_A

    o*someInput_B
    "MaterialLayer"  [mat...
    *out
    *out
    "PxrSurface" [materialNode]

    o*materialIn
    "PxrSurface" [materia...
    *out
    *out
    terminals

    o*surface
    terminals...
    Text is not SVG - cannot display
    \ No newline at end of file diff --git a/extras/imaging/docs/hydra_prim_schemas.dox b/extras/imaging/docs/hydra_prim_schemas.dox index 823e18f048..20ac1fdede 100644 --- a/extras/imaging/docs/hydra_prim_schemas.dox +++ b/extras/imaging/docs/hydra_prim_schemas.dox @@ -136,8 +136,39 @@ have these. node output providing the material terminal - upstreamNodePath (TfToken) - upstreamNodeOutputName (TfToken) + - interfaceMappings (HdContainerDataSource) + - (HdVectorDataSource) + - (HdMaterialInterfaceMappingsSchema) + - nodePath (TfToken) + - inputName (TfToken) +- materialOverride (HdMaterialOverrideSchema) + - interfaceValues (HdContainerDataSource) + - (HdMaterialNodeParameterSchema) + - value (HdSampledDataSource) + - _Optional_ - colorSpace (TfToken) - primvars (HdPrimvarsSchema) +The following diagram depicts an example scene index prim "Plastic_Material". +"Plastic_Material" is a scene index prim that has multiple container data +sources, like 'material' (HdMaterialSchema) and 'materialOverride' +(HdMaterialOverrideSchema). "Plastic_Material" as a scene index prim also has +a scene index prim type, which is type 'material'. (See HdPrimTypeTokens). + +The diagram intends to show how the two sibling container data sources +"materialOverride" and "material" relate to each other. + +Note the following: +1. The data flows from left to right. +2. The dotted lines between "materialOverride" and "interfaceMappings" are not +true connections and are not backed by the MaterialConnection schema. Each item +within "materialOverride" and "interfaceMappings" is loosely coupled by their +matching names. +3. The connections in the diagram are drawn with an 'o' to indicate the source +where the connection was authored, and these connections are backed by the +MaterialConnection schema. + +\image html HdSceneIndexPrimMaterialDiagram.drawio.svg + Light - material (HdMaterialSchema) - we expect a "light" terminal From ef7bf16c565ffa864466ad696478faf3d1674345 Mon Sep 17 00:00:00 2001 From: jloy Date: Fri, 9 Aug 2024 20:37:09 -0700 Subject: [PATCH 037/202] arch: look for _Fork in the default search order Depending on how libarch is linked, libc may or may not appear later in the search order. When it is earlier in the search order, calling dlsym with RTLD_NEXT does not find _Fork. Because libarch isn't interposing _Fork, finding _Fork in the default search order should be sufficient. (Internal change: 2336512) --- pxr/base/arch/stackTrace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/base/arch/stackTrace.cpp b/pxr/base/arch/stackTrace.cpp index 619edbe39e..b93ec6fda4 100644 --- a/pxr/base/arch/stackTrace.cpp +++ b/pxr/base/arch/stackTrace.cpp @@ -94,7 +94,7 @@ using namespace std; typedef int (*ForkFunc)(void); ForkFunc Arch_nonLockingFork = #if defined(ARCH_OS_LINUX) - (ForkFunc)dlsym(RTLD_NEXT, "_Fork"); + (ForkFunc)dlsym(RTLD_DEFAULT, "_Fork"); #elif defined(ARCH_OS_DARWIN) NULL; #else From 2f9a387e2c7f706977480cdd3b89959cca2b28b0 Mon Sep 17 00:00:00 2001 From: Pixneb Date: Fri, 9 Aug 2024 20:37:49 -0700 Subject: [PATCH 038/202] Serialize loop params even when invalid. (Internal change: 2336534) --- pxr/base/ts/binary.cpp | 2 +- pxr/usd/sdf/fileIO_Common.cpp | 2 +- .../testSdfParsing.testenv/220_splines.sdf | 10 +++++++ .../baseline/220_splines.sdf | 9 +++++++ pxr/usd/usd/testenv/testUsdSplines.py | 27 +++++++++++++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/pxr/base/ts/binary.cpp b/pxr/base/ts/binary.cpp index c8ab0b1d8c..0f053204a4 100644 --- a/pxr/base/ts/binary.cpp +++ b/pxr/base/ts/binary.cpp @@ -148,7 +148,7 @@ void Ts_BinaryDataAccess::GetBinaryData( const Ts_SplineData &data = *(spline._data.get()); const TfType valueType = spline.GetValueType(); - const bool hasLoops = spline.HasInnerLoops(); + const bool hasLoops = (spline.GetInnerLoopParams() != TsLoopParams()); const bool isHermite = (spline.GetCurveType() == TsCurveTypeHermite); // Buffer size: diff --git a/pxr/usd/sdf/fileIO_Common.cpp b/pxr/usd/sdf/fileIO_Common.cpp index 7113e6c4bb..34ea38261e 100644 --- a/pxr/usd/sdf/fileIO_Common.cpp +++ b/pxr/usd/sdf/fileIO_Common.cpp @@ -745,7 +745,7 @@ Sdf_FileIOUtility::WriteSpline( out, indent, "post", spline.GetPostExtrapolation()); // Inner loop params, if present. - if (spline.HasInnerLoops()) { + if (spline.GetInnerLoopParams() != TsLoopParams()) { const TsLoopParams lp = spline.GetInnerLoopParams(); Write(out, indent + 1, "loop: (%s, %s, %d, %d, %s),\n", TfStringify(lp.protoStart).c_str(), diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/220_splines.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/220_splines.sdf index 064096412f..a14469de32 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/220_splines.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/220_splines.sdf @@ -67,3 +67,13 @@ def Xform "Prim4" } } +def Xform "BadLoopParams" +{ + # Loop params are invalid, because no knot at time 5. + # They should still be serialized and read back. + double kwerb.spline = { + loop: (5, 5, 1, 1, 0), + 1: 14, + 2: 22, + } +} diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/220_splines.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/220_splines.sdf index 3d9cdcad60..40303315ba 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/220_splines.sdf +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/220_splines.sdf @@ -67,3 +67,12 @@ def Xform "Prim4" } } +def Xform "BadLoopParams" +{ + double kwerb.spline = { + loop: (5, 5, 1, 1, 0), + 1: 14; pre ws(0, 0); post held, + 2: 22; post held, + } +} + diff --git a/pxr/usd/usd/testenv/testUsdSplines.py b/pxr/usd/usd/testenv/testUsdSplines.py index f0a8795681..f219c4e01e 100644 --- a/pxr/usd/usd/testenv/testUsdSplines.py +++ b/pxr/usd/usd/testenv/testUsdSplines.py @@ -184,6 +184,33 @@ def test_Serialization_ValueTypes(self): self._DoSerializationTest( "ValueTypes.TimeCode", spline, Sdf.ValueTypeNames.TimeCode) + def test_Serialization_Loops(self): + """ + Test serialization of inner loop params. + """ + spline = Ts.Spline() + spline.SetKnot(Ts.Knot( + time = 1, + value = 5, + nextInterp = Ts.InterpCurve, + preTanWidth = 1, + preTanSlope = 1, + postTanWidth = 1, + postTanSlope = 1)) + lp = Ts.LoopParams() + lp.protoStart = 1 + lp.protoEnd = 10 + lp.numPostLoops = 1 + spline.SetInnerLoopParams(lp) + self._DoSerializationTest("Loops.Valid", spline) + + # In this version, there is no knot at the prototype start time, so the + # loop params are invalid. They should be serialized and read back + # anyway. + lp.protoStart = 2 + spline.SetInnerLoopParams(lp) + self._DoSerializationTest("Loops.Invalid", spline) + def _DoLayerOffsetTest(self, case, attrType, timeValued, scale): """ Test writing and reading splines across layer offsets. From b5f381c16f320b02cbd3df0ea5dee2ed491ab1d2 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 9 Aug 2024 20:37:58 -0700 Subject: [PATCH 039/202] hd: Replace stray use of boost::get_pointer (Internal change: 2336555) --- pxr/imaging/hd/filteringSceneIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/imaging/hd/filteringSceneIndex.cpp b/pxr/imaging/hd/filteringSceneIndex.cpp index 4db286e6ec..848927ef90 100644 --- a/pxr/imaging/hd/filteringSceneIndex.cpp +++ b/pxr/imaging/hd/filteringSceneIndex.cpp @@ -15,7 +15,7 @@ HdEncapsulatingSceneIndexBase::Cast(const HdSceneIndexBaseRefPtr &scene) { return dynamic_cast( - boost::get_pointer(scene)); + get_pointer(scene)); } // This is a fallback scene index that we use in case an invalid sceneIndex is From 3bbfc6a78fd242743f14257c527bce77e03f9686 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 9 Aug 2024 20:38:06 -0700 Subject: [PATCH 040/202] tf: Simplify Python wrapping for static tokens Use a lambda instead of a separate functor to avoid needing boost::python::make_function and an explicit function signature. (Internal change: 2336557) --- pxr/base/tf/pyStaticTokens.h | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/pxr/base/tf/pyStaticTokens.h b/pxr/base/tf/pyStaticTokens.h index 5183c46e58..aab5358419 100644 --- a/pxr/base/tf/pyStaticTokens.h +++ b/pxr/base/tf/pyStaticTokens.h @@ -40,34 +40,21 @@ PXR_NAMESPACE_OPEN_SCOPE #define TF_PY_WRAP_PUBLIC_TOKENS_IN_CURRENT_SCOPE(key, seq) \ _TF_PY_TOKENS_WRAP_ATTR_SEQ(key, seq) -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _TfPyWrapStaticToken { -public: - _TfPyWrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - // Private macros to add a single data member. #define _TF_PY_TOKENS_WRAP_ATTR_MEMBER(r, key, name) \ boost::python::scope().attr( \ TF_PP_STRINGIZE(name)) = key->name.GetString(); +// We wrap tokens as Python strings, but simply wrapping the token using +// def_readonly bypasses to-Python conversion, leading to the error +// that there's no Python type for the C++ TfToken type. See: +// https://www.boost.org/doc/libs/release/libs/python/doc/html/faq/why_is_my_automatic_to_python_co.html +// +// So we use add_static_property and wrap a function that performs the +// conversion instead. #define _TF_PY_TOKENS_WRAP_MEMBER(r, key, name) \ .add_static_property(TF_PP_STRINGIZE(name), \ - boost::python::make_function(_TfPyWrapStaticToken((&key->name)), \ - boost::python::return_value_policy< \ - boost::python::return_by_value>(), \ - boost::mpl::vector1())) + +[]() { return key->name.GetString(); }) \ // Private macros to wrap a single element in a sequence. #define _TF_PY_TOKENS_WRAP_ELEMENT(key, elem) \ From aed016eb81730e673aaa494f3b5e708e1a3f8113 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 13 Aug 2024 10:08:31 -0700 Subject: [PATCH 041/202] Adding small blurb to contributing doc page about how Pixar closes PRs after we marge. (Internal change: 2336701) --- docs/contributing_to_usd.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/contributing_to_usd.rst b/docs/contributing_to_usd.rst index b9c1760dcc..5d96be6114 100644 --- a/docs/contributing_to_usd.rst +++ b/docs/contributing_to_usd.rst @@ -283,5 +283,7 @@ GitHub PRs are not landed directly into the GitHub dev branch, but rather into Pixar's internal development tree. We do this to facilitate the automated correctness and performance testing using production assets prior to merging the change. The open source branch is then extracted from Pixar's internal -development tree and pushed to the OpenUSD GitHub dev branch on a -:ref:`regular cadence `. \ No newline at end of file +development tree and pushed to the OpenUSD GitHub **dev** branch on a +:ref:`regular cadence `. Once your PR has been incorporated +internally and the OpenUSD repo dev branch has been updated, Pixar will +automatically close your PR. \ No newline at end of file From 2f497b7999a48ce7846f674f2ea32078709e5058 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 13 Aug 2024 10:08:58 -0700 Subject: [PATCH 042/202] doc that SkelAnimation blendShapes is default only, no timesampled values (Internal change: 2336727) --- pxr/usd/usdSkel/animation.h | 3 ++- pxr/usd/usdSkel/generatedSchema.usda | 3 ++- pxr/usd/usdSkel/schema.usda | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pxr/usd/usdSkel/animation.h b/pxr/usd/usdSkel/animation.h index fa3826debf..9edafe8102 100644 --- a/pxr/usd/usdSkel/animation.h +++ b/pxr/usd/usdSkel/animation.h @@ -240,7 +240,8 @@ class UsdSkelAnimation : public UsdTyped /// Array of tokens identifying which blend shapes this /// animation's data applies to. The tokens for blendShapes correspond to /// the tokens set in the *skel:blendShapes* binding property of the - /// UsdSkelBindingAPI. + /// UsdSkelBindingAPI. Note that blendShapes does not accept time-sampled + /// values. /// /// | || /// | -- | -- | diff --git a/pxr/usd/usdSkel/generatedSchema.usda b/pxr/usd/usdSkel/generatedSchema.usda index bc63f5fad6..171d7bbc66 100644 --- a/pxr/usd/usdSkel/generatedSchema.usda +++ b/pxr/usd/usdSkel/generatedSchema.usda @@ -201,7 +201,8 @@ class SkelAnimation "SkelAnimation" ( doc = """Array of tokens identifying which blend shapes this animation's data applies to. The tokens for blendShapes correspond to the tokens set in the *skel:blendShapes* binding property of the - UsdSkelBindingAPI.""" + UsdSkelBindingAPI. Note that blendShapes does not accept time-sampled + values.""" ) float[] blendShapeWeights ( doc = """Array of weight values for each blend shape. Each weight value diff --git a/pxr/usd/usdSkel/schema.usda b/pxr/usd/usdSkel/schema.usda index 6f1223b6c9..9bfcfb6934 100644 --- a/pxr/usd/usdSkel/schema.usda +++ b/pxr/usd/usdSkel/schema.usda @@ -129,7 +129,8 @@ class SkelAnimation "SkelAnimation" ( doc = """Array of tokens identifying which blend shapes this animation's data applies to. The tokens for blendShapes correspond to the tokens set in the *skel:blendShapes* binding property of the - UsdSkelBindingAPI.""" + UsdSkelBindingAPI. Note that blendShapes does not accept time-sampled + values.""" ) float[] blendShapeWeights ( From eb01ccfa00a06f767053b6216bc47dda0c4c92f6 Mon Sep 17 00:00:00 2001 From: matthewcpp Date: Tue, 13 Aug 2024 10:10:12 -0700 Subject: [PATCH 043/202] This is the first part of a multi-changlist series relating to performance improvements for muting/unmuting layers and adding/removing sublayers and focuses ont he SDF level changes for this effort. SdfLayer::_SetData's logic has been broken out into a new function which is used by the new CreateDiff function noted below. In addition, this logic has been augmented to optionally avoid processing attribute info in order to avoid potential performance hits. SdfLayer::CreateDiff: computes a SdfChangeList containing the minimal edits that would be needed to transform this layer to match the contents of the given layer parameter SdfChangeManager::ExtractLocalChanges: extracts thread-local changes that have been collected for the supplied layer and the internal collection of changes for the layer will be empty (Internal change: 2336797) --- pxr/usd/sdf/changeList.h | 54 +++---- pxr/usd/sdf/changeManager.cpp | 20 +++ pxr/usd/sdf/changeManager.h | 10 ++ pxr/usd/sdf/layer.cpp | 178 +++++++++++++++++---- pxr/usd/sdf/layer.h | 28 ++++ pxr/usd/sdf/testenv/testSdfHardToReach.cpp | 162 +++++++++++++++++++ 6 files changed, 398 insertions(+), 54 deletions(-) diff --git a/pxr/usd/sdf/changeList.h b/pxr/usd/sdf/changeList.h index 4e07718656..e6188e3c5b 100644 --- a/pxr/usd/sdf/changeList.h +++ b/pxr/usd/sdf/changeList.h @@ -48,35 +48,35 @@ class SdfChangeList SubLayerOffset }; - void DidReplaceLayerContent(); - void DidReloadLayerContent(); - void DidChangeLayerResolvedPath(); - void DidChangeLayerIdentifier(const std::string &oldIdentifier); - void DidChangeSublayerPaths(const std::string &subLayerPath, + SDF_API void DidReplaceLayerContent(); + SDF_API void DidReloadLayerContent(); + SDF_API void DidChangeLayerResolvedPath(); + SDF_API void DidChangeLayerIdentifier(const std::string &oldIdentifier); + SDF_API void DidChangeSublayerPaths(const std::string &subLayerPath, SubLayerChangeType changeType); - void DidAddPrim(const SdfPath &primPath, bool inert); - void DidRemovePrim(const SdfPath &primPath, bool inert); - void DidMovePrim(const SdfPath &oldPath, const SdfPath &newPath); - void DidReorderPrims(const SdfPath &parentPath); - void DidChangePrimName(const SdfPath &oldPath, const SdfPath &newPath); - void DidChangePrimVariantSets(const SdfPath &primPath); - void DidChangePrimInheritPaths(const SdfPath &primPath); - void DidChangePrimReferences(const SdfPath &primPath); - void DidChangePrimSpecializes(const SdfPath &primPath); - - void DidAddProperty(const SdfPath &propPath, bool hasOnlyRequiredFields); - void DidRemoveProperty(const SdfPath &propPath, bool hasOnlyRequiredFields); - void DidReorderProperties(const SdfPath &propPath); - void DidChangePropertyName(const SdfPath &oldPath, const SdfPath &newPath); - - void DidChangeAttributeTimeSamples(const SdfPath &attrPath); - void DidChangeAttributeConnection(const SdfPath &attrPath); - void DidChangeRelationshipTargets(const SdfPath &relPath); - void DidAddTarget(const SdfPath &targetPath); - void DidRemoveTarget(const SdfPath &targetPath); - - void DidChangeInfo(const SdfPath &path, const TfToken &key, + SDF_API void DidAddPrim(const SdfPath &primPath, bool inert); + SDF_API void DidRemovePrim(const SdfPath &primPath, bool inert); + SDF_API void DidMovePrim(const SdfPath &oldPath, const SdfPath &newPath); + SDF_API void DidReorderPrims(const SdfPath &parentPath); + SDF_API void DidChangePrimName(const SdfPath &oldPath, const SdfPath &newPath); + SDF_API void DidChangePrimVariantSets(const SdfPath &primPath); + SDF_API void DidChangePrimInheritPaths(const SdfPath &primPath); + SDF_API void DidChangePrimReferences(const SdfPath &primPath); + SDF_API void DidChangePrimSpecializes(const SdfPath &primPath); + + SDF_API void DidAddProperty(const SdfPath &propPath, bool hasOnlyRequiredFields); + SDF_API void DidRemoveProperty(const SdfPath &propPath, bool hasOnlyRequiredFields); + SDF_API void DidReorderProperties(const SdfPath &propPath); + SDF_API void DidChangePropertyName(const SdfPath &oldPath, const SdfPath &newPath); + + SDF_API void DidChangeAttributeTimeSamples(const SdfPath &attrPath); + SDF_API void DidChangeAttributeConnection(const SdfPath &attrPath); + SDF_API void DidChangeRelationshipTargets(const SdfPath &relPath); + SDF_API void DidAddTarget(const SdfPath &targetPath); + SDF_API void DidRemoveTarget(const SdfPath &targetPath); + + SDF_API void DidChangeInfo(const SdfPath &path, const TfToken &key, VtValue &&oldValue, const VtValue &newValue); /// \struct Entry diff --git a/pxr/usd/sdf/changeManager.cpp b/pxr/usd/sdf/changeManager.cpp index 8d34e6e181..e91c856d55 100644 --- a/pxr/usd/sdf/changeManager.cpp +++ b/pxr/usd/sdf/changeManager.cpp @@ -140,6 +140,26 @@ _InitChangeSerialNumber() { return value; } +SdfChangeList +Sdf_ChangeManager::ExtractLocalChanges( + const SdfLayerHandle &layer) +{ + SdfLayerChangeListVec &layerChanges = _data.local().changes; + SdfChangeList changeList; + + auto result = std::find_if(layerChanges.begin(), layerChanges.end(), + [&layer](const SdfLayerChangeListVec::value_type& item){ + return item.first == layer; + }); + + if (result != layerChanges.end()) { + changeList = std::move((*result).second); + layerChanges.erase(result); + } + + return changeList; +} + void Sdf_ChangeManager::_SendNotices(_Data *data) { diff --git a/pxr/usd/sdf/changeManager.h b/pxr/usd/sdf/changeManager.h index ab193e75e6..c3318b1c45 100644 --- a/pxr/usd/sdf/changeManager.h +++ b/pxr/usd/sdf/changeManager.h @@ -45,6 +45,16 @@ class Sdf_ChangeManager { return TfSingleton::GetInstance(); } + /// Returns the current set of thread local changes that have been + /// collected by the change manager for \p layer. After this + /// function returns, the internal collection of changes for the layer + /// will be empty and no notifications for changes contained in the vector + /// returned by this function will be triggered when the outermost change + /// block goes out of scope. If there are no changes for \p layer the + /// returned changelist will be empty. + SDF_API + SdfChangeList ExtractLocalChanges(const SdfLayerHandle &layer); + // Queue notifications. void DidReplaceLayerContent(const SdfLayerHandle &layer); void DidReloadLayerContent(const SdfLayerHandle &layer); diff --git a/pxr/usd/sdf/layer.cpp b/pxr/usd/sdf/layer.cpp index 1de5a2303d..7404a8774a 100644 --- a/pxr/usd/sdf/layer.cpp +++ b/pxr/usd/sdf/layer.cpp @@ -3931,6 +3931,116 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, return; } + // The delegate functions below, when passed to the processing function + // below will both alter this layer and forward relevant changes + // to SdfChangeManager + + const auto deleteSpecFunc = + [this](auto&&... args) + { + _PrimDeleteSpec(std::forward(args)...); + }; + + const auto createSpecFunc = + [this](auto&&... args) + { + _PrimCreateSpec(std::forward(args)...); + }; + + const auto setFieldFunc = + [this](auto&&... args) + { + _PrimSetField(std::forward(args)...); + }; + + const auto errorFunc = + [this](SdfAuthoringError error, const std::vector &descrs) + { + const char* errorType = + error == SdfAuthoringErrorUnrecognizedSpecType + ? "spec types" + : "fields"; + + TF_ERROR(error, + "Omitted unrecognized %s setting data on " + "@%s@: %s", errorType, GetIdentifier().c_str(), + TfStringJoin(descrs, "; ").c_str()); + }; + + _ProcessIncomingData(newData, newDataSchema, /*processPropertyFields*/ true, + deleteSpecFunc, createSpecFunc, setFieldFunc, errorFunc); + + // Verify that the result matches. + // TODO Enable in debug builds. + if (0) { + TRACE_SCOPE("SdfLayer::_SetData - Verify result"); + TF_VERIFY(_data->Equals(newData)); + } +} + +SdfChangeList +SdfLayer::CreateDiff( + const SdfLayerHandle& layer, + bool processPropertyFields) const +{ + + TRACE_FUNCTION(); + TF_DESCRIBE_SCOPE("Generating a diff changelist"); + + SdfChangeBlock block; + + // The delegate functions below, when passed to the processing function + // below will not alter the layer in any way. They only forward relevant + // changes to SdfChangeManager + + const auto deleteSpecFunc = + [this](const SdfPath &path, bool inert) + { + Sdf_ChangeManager::Get().DidRemoveSpec(_self, path, inert); + }; + + const auto createSpecFunc = + [this](const SdfPath &path, SdfSpecType specType, bool inert) + { + Sdf_ChangeManager::Get().DidAddSpec(_self, path, inert); + }; + + const auto setFieldFunc = + [this](const SdfPath& path, const TfToken& fieldName, + const VtValue& value, VtValue* oldValuePtr) + { + VtValue oldValue = oldValuePtr ? + std::move(*oldValuePtr) : GetField(path, fieldName); + + Sdf_ChangeManager::Get().DidChangeField( + _self, path, fieldName, std::move(oldValue), value); + }; + + const auto errorFunc = + [](auto&&... args) + { + // Errors can be ignored because we are not doing any authoring. + }; + + _ProcessIncomingData(layer->_data, &layer->GetSchema(), processPropertyFields, + deleteSpecFunc, createSpecFunc, setFieldFunc, errorFunc); + + return Sdf_ChangeManager::Get().ExtractLocalChanges(_self); +} + +template +void +SdfLayer::_ProcessIncomingData(const SdfAbstractDataPtr &newData, + const SdfSchemaBase *newDataSchema, + bool processPropertyFields, + const DeleteSpecFunc &deleteSpecFunc, + const CreateSpecFunc &createSpecFunc, + const SetFieldFunc &setFieldFunc, + const ErrorFunc &errorFunc) const +{ + const bool differentSchema = newDataSchema && newDataSchema != &GetSchema(); + // Remove specs that no longer exist or whose required fields changed. { // Collect specs to delete, ordered by namespace. @@ -3966,22 +4076,29 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, TF_REVERSE_FOR_ALL(i, specsToDelete.paths) { const SdfPath &path = *i; - std::vector fields = ListFields(path); + const bool processFields = + path.IsPropertyPath() ? processPropertyFields : true; - SdfSpecType specType = _data->GetSpecType(path); - const SdfSchema::SpecDefinition* specDefinition = - GetSchema().GetSpecDefinition(specType); + if (processFields) { + std::vector fields = ListFields(path); - TF_FOR_ALL(field, fields) { - if (!specDefinition->IsRequiredField(*field)) - _PrimSetField(path, *field, VtValue()); + SdfSpecType specType = _data->GetSpecType(path); + const SdfSchema::SpecDefinition* specDefinition = + GetSchema().GetSpecDefinition(specType); + + TF_FOR_ALL(field, fields) { + if (!specDefinition->IsRequiredField(*field)) { + setFieldFunc( + path, *field, VtValue(), /* oldValue */ nullptr); + } + } } // Since we are deleting bottom up, we should only ever be // considering prims which do not have children to determine // inertness - _PrimDeleteSpec(*i, _IsInert(*i, true /*ignoreChildren*/, - true /* requiredFieldOnlyPropertiesAreInert */)); + deleteSpecFunc(path, _IsInert(path, true /*ignoreChildren*/, + true /* requiredFieldOnlyPropertiesAreInert */)); } } @@ -4054,7 +4171,7 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, } } else { - _PrimCreateSpec(path, specType, inert); + createSpecFunc(path, specType, inert); } } // If there were unrecognized specTypes, issue an error. @@ -4071,10 +4188,7 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, unrecognizedSpecTypePaths[i].GetAsString().c_str())); } if (!specDescrs.empty()) { - TF_ERROR(SdfAuthoringErrorUnrecognizedSpecType, - "Omitted unrecognized spec types setting data on " - "@%s@: %s", GetIdentifier().c_str(), - TfStringJoin(specDescrs, "; ").c_str()); + errorFunc(SdfAuthoringErrorUnrecognizedSpecType, specDescrs); } } } @@ -4082,14 +4196,22 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, // Update spec fields. { struct _SpecUpdater : public SdfAbstractDataSpecVisitor { - _SpecUpdater(SdfLayer* layer_, - const SdfSchemaBase &newDataSchema_) + _SpecUpdater(const SdfLayer* layer_, + const SdfSchemaBase &newDataSchema_, + const bool processPropertyFields_, + const SetFieldFunc &setFieldFunc_) : layer(layer_) - , newDataSchema(newDataSchema_) {} + , newDataSchema(newDataSchema_) + , processPropertyFields(processPropertyFields_) + , setFieldFunc(setFieldFunc_){} virtual bool VisitSpec( const SdfAbstractData& newData, const SdfPath& path) { + if (!processPropertyFields && path.IsPropertyPath()) { + return true; + } + const TfTokenVector oldFields = layer->ListFields(path); const TfTokenVector newFields = _ListFields(newDataSchema, newData, path); @@ -4112,7 +4234,8 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, // we expect a small max N, around 10. if (std::find(newFields.begin(), newFields.end(), field) == newFields.end()) { - layer->_PrimSetField(path, field, VtValue()); + setFieldFunc( + path, field, VtValue(), /* oldValue */ nullptr); } } @@ -4131,11 +4254,12 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, unrecognizedFields.emplace(field, path); } else { - layer->_PrimSetField(path, field, - newValue, &oldValue); + setFieldFunc( + path, field, newValue, &oldValue); } } } + return true; } @@ -4144,15 +4268,18 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, // Do nothing } - SdfLayer* layer; + const SdfLayer* layer; const SdfSchemaBase &newDataSchema; + const bool processPropertyFields; + const SetFieldFunc &setFieldFunc; std::map unrecognizedFields; }; // If no newDataSchema is supplied, we assume the newData adheres to // this layer's schema. - _SpecUpdater updater( - this, newDataSchema ? *newDataSchema : GetSchema()); + _SpecUpdater updater( this, + newDataSchema ? *newDataSchema : GetSchema(), + processPropertyFields, setFieldFunc); newData->VisitSpecs(&updater); // If there were unrecognized fields, report an error. @@ -4165,10 +4292,7 @@ SdfLayer::_SetData(const SdfAbstractDataPtr &newData, tokenPath.first.GetText(), tokenPath.second.GetAsString().c_str())); } - TF_ERROR(SdfAuthoringErrorUnrecognizedFields, - "Omitted unrecognized fields setting data on @%s@: %s", - GetIdentifier().c_str(), - TfStringJoin(fieldDescrs, "; ").c_str()); + errorFunc(SdfAuthoringErrorUnrecognizedFields, fieldDescrs); } } diff --git a/pxr/usd/sdf/layer.h b/pxr/usd/sdf/layer.h index 3e5fd402ef..dc1901a67c 100644 --- a/pxr/usd/sdf/layer.h +++ b/pxr/usd/sdf/layer.h @@ -41,6 +41,7 @@ PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_PTRS(SdfFileFormat); TF_DECLARE_WEAK_AND_REF_PTRS(SdfLayerStateDelegateBase); +class SdfChangeList; struct Sdf_AssetInfo; /// \class SdfLayer @@ -1634,6 +1635,18 @@ class SdfLayer // @} + /// Returns a \ref SdfChangeList containing the minimal edits that would be + /// needed to transform this layer to match the contents of the given + /// \p layer parameter. If \p processPropertyFields is false, property + /// fields will be ignored during the diff computation. Any differences in + /// fields between properties with the same path in this layer and \p layer + /// will not be captured in the returned SdfChangeList. This can, however, + /// avoid potentially expensive data retrieval operations. + SDF_API + SdfChangeList CreateDiff( + const SdfLayerHandle& layer, + bool processPropertyFields = true) const; + protected: // Private constructor -- use New(), FindOrCreate(), etc. // Precondition: _layerRegistryMutex must be locked. @@ -1880,6 +1893,21 @@ class SdfLayer // invalidation notice. void _AdoptData(const SdfAbstractDataRefPtr &newData); + // Helper function which will process incoming data to this layer in a + // generic way. + // If \p processPropertyFields is false, this method will not + // consider property spec fields. In some cases, this can avoid expensive + // operations which would pull large amounts of data. + template + void _ProcessIncomingData(const SdfAbstractDataPtr &newData, + const SdfSchemaBase *newDataSchema, + bool processPropertyFields, + const DeleteSpecFunc &deleteSpecFunc, + const CreateSpecFunc &createSpecFunc, + const SetFieldFunc &setFieldFunc, + const ErrorFunc &errorFunc) const; + // Set _data to match data, calling other primitive setter methods to // provide fine-grained inverses and notification. If \p data might adhere // to a different schema than this layer's, pass a pointer to it as \p diff --git a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp index f5c2c8402e..ecdc8c9c10 100644 --- a/pxr/usd/sdf/testenv/testSdfHardToReach.cpp +++ b/pxr/usd/sdf/testenv/testSdfHardToReach.cpp @@ -6,6 +6,7 @@ // #include "pxr/pxr.h" #include "pxr/usd/sdf/attributeSpec.h" +#include "pxr/usd/sdf/changeManager.h" #include "pxr/usd/sdf/layer.h" #include "pxr/usd/sdf/notice.h" #include "pxr/usd/sdf/path.h" @@ -16,10 +17,169 @@ #include "pxr/usd/sdf/schema.h" #include +#include #include PXR_NAMESPACE_USING_DIRECTIVE +static void +_TestSdfLayerCreateDiffChangelist() +{ + // Create layers to diff + SdfLayerRefPtr actualLayer = SdfLayer::CreateAnonymous(); + actualLayer->ImportFromString( + R"(#sdf 1.4.32 + over "a"{} + def "b"{} + over "c"{ + int propC = 1 + } + def "r" { + int propR = 1 + } + def "p" { + int propP = 1 + } + )" + ); + + SdfLayerRefPtr diffLayer = SdfLayer::CreateAnonymous(); + diffLayer->ImportFromString( + R"(#sdf 1.4.32 + def "z"{} + def "b"{} + over "c"{ + int propC = 2 + } + def "n" { + int propN = 1 + } + def "p" {} + )"); + + const auto createTestChangelist = [](bool compareValues) { + VtValue value; + SdfChangeList changeList; + + + changeList.DidRemoveProperty(SdfPath("/r.propR"), false); + changeList.DidRemovePrim(SdfPath("/r"), false); + changeList.DidRemoveProperty(SdfPath("/p.propP"), false); + changeList.DidRemovePrim(SdfPath("/a"), true); + changeList.DidAddPrim(SdfPath("/n"), false); + changeList.DidChangeInfo(SdfPath("/n"), SdfFieldKeys->Specifier, + std::move(value), VtValue(SdfSpecifierDef)); + changeList.DidAddProperty(SdfPath("/n.propN"), true); + changeList.DidAddPrim(SdfPath("/z"), false); + changeList.DidChangeInfo(SdfPath("/z"), SdfFieldKeys->Specifier, + std::move(value), VtValue(SdfSpecifierDef)); + + if (compareValues) { + VtValue oldValue(1); + changeList.DidChangeInfo(SdfPath("/r.propR"), SdfFieldKeys->Default, + std::move(oldValue), VtValue()); + changeList.DidChangeInfo(SdfPath("/n.propN"), + SdfFieldKeys->TypeName, std::move(oldValue), VtValue("int")); + changeList.DidChangeInfo(SdfPath("/n.propN"), SdfFieldKeys->Default, + std::move(oldValue), VtValue(1)); + changeList.DidChangeInfo(SdfPath("/n.propN"), SdfFieldKeys->Custom, + std::move(oldValue), VtValue(0)); + changeList.DidChangeInfo(SdfPath("/n.propN"), + SdfFieldKeys->Variability, std::move(oldValue), + VtValue(SdfVariabilityVarying)); + oldValue = VtValue(1); + changeList.DidChangeInfo(SdfPath("/p.propP"), SdfFieldKeys->Default, + std::move(oldValue), VtValue()); + oldValue = VtValue(1); + changeList.DidChangeInfo(SdfPath("/c.propC"), SdfFieldKeys->Default, + std::move(oldValue), VtValue(2)); + } + + return changeList; + }; + + // Copy the layer so we can verify it does not change during the operation + SdfLayerRefPtr expectedLayer = SdfLayer::CreateAnonymous(); + expectedLayer->TransferContent(actualLayer); + + // build the changelist we expect to see when not comparing values + SdfChangeList expectedCl = createTestChangelist(false); + SdfChangeList expectedClValues = createTestChangelist(true); + + + // Ensure that the layer remains unchanged during the process + std::string actualLayerStr, expectedLayerStr; + TF_AXIOM(actualLayer->ExportToString(&actualLayerStr)); + TF_AXIOM(expectedLayer->ExportToString(&expectedLayerStr)); + TF_AXIOM(actualLayerStr == expectedLayerStr); + + SdfChangeList actualCl = actualLayer->CreateDiff(diffLayer, + /*compareFieldValues*/ false); + + SdfChangeList actualClValues = actualLayer->CreateDiff( + diffLayer, /*compareFieldValues*/ true); + + // Ensure that a reasonable changelist is generated + std::ostringstream actualClStr, expectedClStr; + std::ostringstream actualClValuesStr, expectedClValuesStr; + actualClStr << actualCl; + expectedClStr << expectedCl; + actualClValuesStr << actualClValues; + expectedClValuesStr << expectedClValues; + + TF_AXIOM(actualClStr.str() == expectedClStr.str()); + TF_AXIOM(actualClValuesStr.str() == expectedClValuesStr.str()); +} + +static void _TestSdfChangeManagerExtractLocalChanges() +{ + struct Listener : public TfWeakBase + { + void LayersDidChange(const SdfNotice::LayersDidChange& change) + { + invocations += 1; + } + + Listener() + { + _key = TfNotice::Register( + TfCreateWeakPtr(this), &Listener::LayersDidChange ); + } + + ~Listener() + { + TfNotice::Revoke(_key); + } + + TfNotice::Key _key; + size_t invocations = 0; + }; + + SdfLayerRefPtr testLayer = SdfLayer::CreateAnonymous(); + Listener listener; + + // This block should trigger an invocation of the listener + { + SdfChangeBlock block; + SdfCreatePrimInLayer(testLayer, SdfPath("/test1")); + } + + TF_AXIOM(listener.invocations == 1); + + // There should be no additional invocation of the the listener once the + // the block goes out of scope because the changes for the layer have been + // extracted. + { + SdfChangeBlock block; + SdfCreatePrimInLayer(testLayer, SdfPath("/test2")); + SdfChangeList changes = + Sdf_ChangeManager::Get().ExtractLocalChanges(testLayer); + TF_AXIOM(!changes.GetEntryList().empty()); + } + + TF_AXIOM(listener.invocations == 1); +} + static void _TestSdfLayerDictKeyOps() { @@ -554,6 +714,8 @@ _TestSdfMapEditorProxyOperators() int main(int argc, char **argv) { + _TestSdfChangeManagerExtractLocalChanges(); + _TestSdfLayerCreateDiffChangelist(); _TestSdfLayerDictKeyOps(); _TestSdfLayerTimeSampleValueType(); _TestSdfLayerTransferContents(); From 0eabcd59a0a20920dacd5f606473cda7e691a107 Mon Sep 17 00:00:00 2001 From: rajabala Date: Tue, 13 Aug 2024 10:12:57 -0700 Subject: [PATCH 044/202] [usdImaging] Fix typo when handling invalidation for collectionAPI properties. (Internal change: 2336806) --- pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp b/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp index 594457fd24..1c0191f6fa 100644 --- a/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp +++ b/pxr/usdImaging/usdImaging/collectionAPIAdapter.cpp @@ -145,7 +145,7 @@ UsdImagingCollectionAPIAdapter::InvalidateImagingSubprim( } std::string prefix = TfStringPrintf( - "collections:%s:", appliedInstanceName.data()); + "collection:%s:", appliedInstanceName.data()); for (const TfToken &propertyName : properties) { if (TfStringStartsWith(propertyName.GetString(), prefix)) { From e7a8d718c7c113e1c653ee31dc52421f17e09b42 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 13 Aug 2024 13:29:54 -0700 Subject: [PATCH 045/202] python: Initial import of boost::python from boost 1.85.0 This change just brings boost::python into the tree as a starting point for the pxr_boost::python implementation. The src/ and test/ directories are placed next to the public headers since we don't have separate public/private directory hierarchies like boost, but the code itself is unchanged and not included in the build. We use boost 1.85.0 as the starting point even though we're currently on VFX Reference Platform 2022, which specifies boost 1.76.0. This is because later versions of boost are needed for other platforms and versions of Python that OpenUSD supports. For example Python 3.11 requires boost 1.82.0+. (Internal change: 2334040) (Internal change: 2336880) --- LICENSE.txt | 28 + pxr/external/boost/python.hpp | 75 ++ pxr/external/boost/python/arg_from_python.hpp | 76 ++ pxr/external/boost/python/args.hpp | 146 ++++ pxr/external/boost/python/args_fwd.hpp | 52 ++ pxr/external/boost/python/back_reference.hpp | 71 ++ .../boost/python/base_type_traits.hpp | 43 + pxr/external/boost/python/bases.hpp | 50 ++ pxr/external/boost/python/borrowed.hpp | 21 + pxr/external/boost/python/call.hpp | 83 ++ pxr/external/boost/python/call_method.hpp | 83 ++ pxr/external/boost/python/cast.hpp | 105 +++ pxr/external/boost/python/class.hpp | 608 ++++++++++++++ pxr/external/boost/python/class_fwd.hpp | 24 + .../python/converter/arg_from_python.hpp | 335 ++++++++ .../boost/python/converter/arg_to_python.hpp | 257 ++++++ .../python/converter/arg_to_python_base.hpp | 24 + .../converter/as_to_python_function.hpp | 49 ++ .../python/converter/builtin_converters.hpp | 190 +++++ .../python/converter/constructor_function.hpp | 17 + .../converter/context_result_converter.hpp | 17 + .../python/converter/convertible_function.hpp | 14 + .../boost/python/converter/from_python.hpp | 41 + .../boost/python/converter/implicit.hpp | 46 + .../converter/obj_mgr_arg_from_python.hpp | 121 +++ .../boost/python/converter/object_manager.hpp | 156 ++++ .../python/converter/pointer_type_id.hpp | 68 ++ .../python/converter/pyobject_traits.hpp | 46 + .../boost/python/converter/pyobject_type.hpp | 40 + .../python/converter/pytype_function.hpp | 133 +++ .../converter/pytype_object_mgr_traits.hpp | 42 + .../boost/python/converter/registered.hpp | 124 +++ .../python/converter/registered_pointee.hpp | 29 + .../boost/python/converter/registrations.hpp | 99 +++ .../boost/python/converter/registry.hpp | 55 ++ .../python/converter/return_from_python.hpp | 162 ++++ .../converter/rvalue_from_python_data.hpp | 147 ++++ .../python/converter/shared_ptr_deleter.hpp | 22 + .../converter/shared_ptr_from_python.hpp | 69 ++ .../python/converter/shared_ptr_to_python.hpp | 43 + .../converter/to_python_function_type.hpp | 19 + .../boost/python/copy_const_reference.hpp | 43 + .../boost/python/copy_non_const_reference.hpp | 43 + pxr/external/boost/python/data_members.hpp | 311 +++++++ pxr/external/boost/python/def.hpp | 114 +++ pxr/external/boost/python/def_visitor.hpp | 86 ++ .../boost/python/default_call_policies.hpp | 89 ++ .../boost/python/detail/aix_init_module.hpp | 26 + .../boost/python/detail/api_placeholder.hpp | 15 + .../boost/python/detail/borrowed_ptr.hpp | 80 ++ pxr/external/boost/python/detail/caller.hpp | 270 ++++++ pxr/external/boost/python/detail/config.hpp | 134 +++ .../boost/python/detail/construct.hpp | 36 + .../boost/python/detail/convertible.hpp | 38 + .../python/detail/copy_ctor_mutates_rhs.hpp | 21 + .../boost/python/detail/cv_category.hpp | 36 + pxr/external/boost/python/detail/dealloc.hpp | 17 + .../boost/python/detail/decorated_type_id.hpp | 76 ++ .../boost/python/detail/decref_guard.hpp | 21 + .../boost/python/detail/def_helper.hpp | 211 +++++ .../boost/python/detail/def_helper_fwd.hpp | 17 + .../boost/python/detail/defaults_def.hpp | 291 +++++++ .../boost/python/detail/defaults_gen.hpp | 388 +++++++++ .../boost/python/detail/dependent.hpp | 27 + pxr/external/boost/python/detail/destroy.hpp | 63 ++ .../boost/python/detail/enable_if.hpp | 39 + .../boost/python/detail/exception_handler.hpp | 48 ++ .../boost/python/detail/force_instantiate.hpp | 18 + pxr/external/boost/python/detail/if_else.hpp | 81 ++ .../boost/python/detail/indirect_traits.hpp | 13 + pxr/external/boost/python/detail/invoke.hpp | 98 +++ .../boost/python/detail/is_auto_ptr.hpp | 30 + .../boost/python/detail/is_shared_ptr.hpp | 23 + .../boost/python/detail/is_wrapper.hpp | 29 + pxr/external/boost/python/detail/is_xxx.hpp | 13 + .../python/detail/make_keyword_range_fn.hpp | 72 ++ .../boost/python/detail/make_tuple.hpp | 32 + .../boost/python/detail/map_entry.hpp | 43 + .../boost/python/detail/mpl_lambda.hpp | 12 + .../boost/python/detail/msvc_typeinfo.hpp | 84 ++ pxr/external/boost/python/detail/none.hpp | 20 + .../boost/python/detail/not_specified.hpp | 14 + .../detail/nullary_function_adaptor.hpp | 46 + .../boost/python/detail/operator_id.hpp | 63 ++ .../boost/python/detail/overloads_fwd.hpp | 18 + pxr/external/boost/python/detail/pointee.hpp | 35 + pxr/external/boost/python/detail/prefix.hpp | 16 + .../boost/python/detail/preprocessor.hpp | 66 ++ .../boost/python/detail/python22_fixed.h | 152 ++++ .../boost/python/detail/python_type.hpp | 37 + .../boost/python/detail/raw_pyobject.hpp | 32 + .../boost/python/detail/referent_storage.hpp | 45 + pxr/external/boost/python/detail/result.hpp | 133 +++ pxr/external/boost/python/detail/scope.hpp | 16 + pxr/external/boost/python/detail/sfinae.hpp | 13 + .../boost/python/detail/signature.hpp | 106 +++ .../boost/python/detail/string_literal.hpp | 49 ++ pxr/external/boost/python/detail/target.hpp | 86 ++ .../python/detail/translate_exception.hpp | 67 ++ .../boost/python/detail/type_list.hpp | 35 + .../boost/python/detail/type_list_impl.hpp | 57 ++ .../boost/python/detail/type_traits.hpp | 111 +++ .../boost/python/detail/unwind_type.hpp | 172 ++++ .../boost/python/detail/unwrap_type_id.hpp | 31 + .../boost/python/detail/unwrap_wrapper.hpp | 34 + .../boost/python/detail/value_arg.hpp | 26 + .../python/detail/value_is_shared_ptr.hpp | 28 + .../boost/python/detail/value_is_xxx.hpp | 33 + pxr/external/boost/python/detail/void_ptr.hpp | 35 + .../boost/python/detail/void_return.hpp | 42 + .../boost/python/detail/wrap_python.hpp | 252 ++++++ .../boost/python/detail/wrapper_base.hpp | 89 ++ pxr/external/boost/python/dict.hpp | 152 ++++ .../boost/python/docstring_options.hpp | 127 +++ pxr/external/boost/python/enum.hpp | 108 +++ pxr/external/boost/python/errors.hpp | 55 ++ .../boost/python/exception_translator.hpp | 29 + pxr/external/boost/python/exec.hpp | 63 ++ pxr/external/boost/python/extract.hpp | 259 ++++++ pxr/external/boost/python/handle.hpp | 237 ++++++ pxr/external/boost/python/handle_fwd.hpp | 16 + .../boost/python/has_back_reference.hpp | 24 + pxr/external/boost/python/implicit.hpp | 36 + pxr/external/boost/python/import.hpp | 22 + pxr/external/boost/python/init.hpp | 399 +++++++++ pxr/external/boost/python/instance_holder.hpp | 63 ++ pxr/external/boost/python/iterator.hpp | 136 +++ pxr/external/boost/python/list.hpp | 148 ++++ pxr/external/boost/python/long.hpp | 68 ++ .../boost/python/lvalue_from_pytype.hpp | 117 +++ .../boost/python/make_constructor.hpp | 290 +++++++ pxr/external/boost/python/make_function.hpp | 153 ++++ .../boost/python/manage_new_object.hpp | 41 + pxr/external/boost/python/module.hpp | 13 + pxr/external/boost/python/module_init.hpp | 75 ++ pxr/external/boost/python/numpy.hpp | 34 + pxr/external/boost/python/numpy/config.hpp | 85 ++ pxr/external/boost/python/numpy/dtype.hpp | 117 +++ pxr/external/boost/python/numpy/internal.hpp | 36 + .../boost/python/numpy/invoke_matching.hpp | 186 +++++ pxr/external/boost/python/numpy/matrix.hpp | 84 ++ pxr/external/boost/python/numpy/ndarray.hpp | 313 +++++++ .../python/numpy/numpy_object_mgr_traits.hpp | 38 + pxr/external/boost/python/numpy/scalars.hpp | 58 ++ pxr/external/boost/python/numpy/ufunc.hpp | 206 +++++ pxr/external/boost/python/object.hpp | 27 + .../boost/python/object/add_to_namespace.hpp | 23 + pxr/external/boost/python/object/class.hpp | 63 ++ .../boost/python/object/class_detail.hpp | 19 + .../boost/python/object/class_metadata.hpp | 294 +++++++ .../boost/python/object/class_wrapper.hpp | 51 ++ .../boost/python/object/enum_base.hpp | 36 + .../boost/python/object/find_instance.hpp | 21 + pxr/external/boost/python/object/forward.hpp | 94 +++ pxr/external/boost/python/object/function.hpp | 82 ++ .../python/object/function_doc_signature.hpp | 36 + .../boost/python/object/function_handle.hpp | 44 + .../boost/python/object/function_object.hpp | 40 + .../boost/python/object/inheritance.hpp | 131 +++ .../boost/python/object/inheritance_query.hpp | 17 + pxr/external/boost/python/object/instance.hpp | 52 ++ pxr/external/boost/python/object/iterator.hpp | 227 +++++ .../boost/python/object/iterator_core.hpp | 17 + .../boost/python/object/life_support.hpp | 15 + .../boost/python/object/make_holder.hpp | 110 +++ .../boost/python/object/make_instance.hpp | 85 ++ .../boost/python/object/make_ptr_instance.hpp | 76 ++ .../boost/python/object/pickle_support.hpp | 124 +++ .../boost/python/object/pointer_holder.hpp | 227 +++++ .../boost/python/object/py_function.hpp | 180 ++++ .../boost/python/object/stl_iterator_core.hpp | 27 + .../boost/python/object/value_holder.hpp | 166 ++++ .../boost/python/object/value_holder_fwd.hpp | 16 + .../boost/python/object_attributes.hpp | 116 +++ pxr/external/boost/python/object_call.hpp | 23 + pxr/external/boost/python/object_core.hpp | 480 +++++++++++ pxr/external/boost/python/object_fwd.hpp | 18 + pxr/external/boost/python/object_items.hpp | 86 ++ .../boost/python/object_operators.hpp | 136 +++ pxr/external/boost/python/object_protocol.hpp | 90 ++ .../boost/python/object_protocol_core.hpp | 53 ++ pxr/external/boost/python/object_slices.hpp | 146 ++++ .../boost/python/opaque_pointer_converter.hpp | 187 +++++ pxr/external/boost/python/operators.hpp | 374 +++++++++ pxr/external/boost/python/other.hpp | 52 ++ pxr/external/boost/python/overloads.hpp | 13 + pxr/external/boost/python/override.hpp | 144 ++++ pxr/external/boost/python/pointee.hpp | 41 + pxr/external/boost/python/proxy.hpp | 97 +++ pxr/external/boost/python/ptr.hpp | 65 ++ pxr/external/boost/python/pure_virtual.hpp | 124 +++ pxr/external/boost/python/raw_function.hpp | 61 ++ pxr/external/boost/python/refcount.hpp | 43 + .../python/reference_existing_object.hpp | 46 + .../boost/python/register_ptr_to_python.hpp | 31 + pxr/external/boost/python/return_arg.hpp | 109 +++ pxr/external/boost/python/return_by_value.hpp | 30 + .../python/return_internal_reference.hpp | 43 + .../boost/python/return_opaque_pointer.hpp | 47 ++ .../boost/python/return_value_policy.hpp | 21 + pxr/external/boost/python/scope.hpp | 77 ++ pxr/external/boost/python/self.hpp | 33 + pxr/external/boost/python/signature.hpp | 252 ++++++ pxr/external/boost/python/slice.hpp | 276 ++++++ pxr/external/boost/python/slice_nil.hpp | 44 + .../src/converter/arg_to_python_base.cpp | 28 + .../src/converter/builtin_converters.cpp | 592 +++++++++++++ .../python/src/converter/from_python.cpp | 303 +++++++ .../boost/python/src/converter/registry.cpp | 306 +++++++ .../boost/python/src/converter/type_id.cpp | 212 +++++ pxr/external/boost/python/src/dict.cpp | 184 ++++ pxr/external/boost/python/src/errors.cpp | 105 +++ pxr/external/boost/python/src/exec.cpp | 138 +++ pxr/external/boost/python/src/fabscript | 58 ++ pxr/external/boost/python/src/import.cpp | 25 + pxr/external/boost/python/src/list.cpp | 170 ++++ pxr/external/boost/python/src/long.cpp | 39 + pxr/external/boost/python/src/module.cpp | 73 ++ pxr/external/boost/python/src/numpy/dtype.cpp | 220 +++++ .../boost/python/src/numpy/matrix.cpp | 63 ++ .../boost/python/src/numpy/ndarray.cpp | 301 +++++++ pxr/external/boost/python/src/numpy/numpy.cpp | 34 + .../boost/python/src/numpy/scalars.cpp | 36 + pxr/external/boost/python/src/numpy/ufunc.cpp | 65 ++ .../boost/python/src/object/class.cpp | 781 +++++++++++++++++ pxr/external/boost/python/src/object/enum.cpp | 251 ++++++ .../boost/python/src/object/function.cpp | 789 ++++++++++++++++++ .../src/object/function_doc_signature.cpp | 344 ++++++++ .../boost/python/src/object/inheritance.cpp | 496 +++++++++++ .../boost/python/src/object/iterator.cpp | 39 + .../boost/python/src/object/life_support.cpp | 121 +++ .../python/src/object/pickle_support.cpp | 78 ++ .../boost/python/src/object/stl_iterator.cpp | 48 ++ .../boost/python/src/object_operators.cpp | 85 ++ .../boost/python/src/object_protocol.cpp | 197 +++++ pxr/external/boost/python/src/slice.cpp | 37 + pxr/external/boost/python/src/str.cpp | 419 ++++++++++ pxr/external/boost/python/src/tuple.cpp | 35 + pxr/external/boost/python/src/wrapper.cpp | 66 ++ pxr/external/boost/python/ssize_t.hpp | 29 + pxr/external/boost/python/stl_iterator.hpp | 61 ++ pxr/external/boost/python/str.hpp | 422 ++++++++++ .../python/suite/indexing/container_utils.hpp | 57 ++ .../indexing/detail/indexing_suite_detail.hpp | 759 +++++++++++++++++ .../python/suite/indexing/indexing_suite.hpp | 295 +++++++ .../suite/indexing/map_indexing_suite.hpp | 181 ++++ .../suite/indexing/vector_indexing_suite.hpp | 242 ++++++ pxr/external/boost/python/tag.hpp | 18 + pxr/external/boost/python/test/Jamfile | 258 ++++++ .../python/test/a_map_indexing_suite.cpp | 92 ++ .../boost/python/test/aligned_class.cpp | 33 + .../boost/python/test/aligned_class.py | 44 + .../boost/python/test/andreas_beyer.cpp | 61 ++ .../boost/python/test/andreas_beyer.py | 24 + pxr/external/boost/python/test/args.cpp | 99 +++ pxr/external/boost/python/test/args.py | 155 ++++ .../python/test/as_to_python_function.cpp | 13 + pxr/external/boost/python/test/auto_ptr.cpp | 90 ++ pxr/external/boost/python/test/auto_ptr.py | 100 +++ .../boost/python/test/back_reference.cpp | 112 +++ .../boost/python/test/back_reference.py | 37 + pxr/external/boost/python/test/bases.cpp | 62 ++ pxr/external/boost/python/test/ben_scott1.cpp | 54 ++ pxr/external/boost/python/test/ben_scott1.py | 17 + pxr/external/boost/python/test/bienstman1.cpp | 40 + pxr/external/boost/python/test/bienstman1.py | 23 + pxr/external/boost/python/test/bienstman2.cpp | 28 + pxr/external/boost/python/test/bienstman2.py | 20 + pxr/external/boost/python/test/bienstman3.cpp | 26 + pxr/external/boost/python/test/bienstman3.py | 30 + pxr/external/boost/python/test/bienstman4.cpp | 39 + pxr/external/boost/python/test/bienstman4.py | 23 + pxr/external/boost/python/test/bienstman5.cpp | 23 + pxr/external/boost/python/test/bienstman5.py | 21 + .../boost/python/test/boost_shared_ptr.cpp | 20 + .../boost/python/test/boost_shared_ptr.py | 130 +++ pxr/external/boost/python/test/borrowed.cpp | 33 + .../boost/python/test/builtin_converters.cpp | 152 ++++ pxr/external/boost/python/test/callbacks.cpp | 150 ++++ pxr/external/boost/python/test/callbacks.py | 147 ++++ .../boost/python/test/calling_conventions.cpp | 160 ++++ .../boost/python/test/calling_conventions.py | 81 ++ .../python/test/calling_conventions_mf.cpp | 161 ++++ .../python/test/calling_conventions_mf.py | 84 ++ pxr/external/boost/python/test/class.cpp | 28 + pxr/external/boost/python/test/class.py | 40 + pxr/external/boost/python/test/cltree.cpp | 74 ++ .../boost/python/test/complicated.hpp | 38 + .../boost/python/test/const_argument.cpp | 28 + .../boost/python/test/const_argument.py | 23 + .../python/test/copy_ctor_mutates_rhs.cpp | 23 + .../boost/python/test/crossmod_exception.py | 19 + .../python/test/crossmod_exception_a.cpp | 18 + .../python/test/crossmod_exception_b.cpp | 18 + .../boost/python/test/crossmod_opaque.py | 16 + .../boost/python/test/crossmod_opaque_a.cpp | 26 + .../boost/python/test/crossmod_opaque_b.cpp | 26 + .../boost/python/test/data_members.cpp | 132 +++ .../boost/python/test/data_members.py | 215 +++++ pxr/external/boost/python/test/defaults.cpp | 173 ++++ pxr/external/boost/python/test/defaults.py | 140 ++++ .../boost/python/test/destroy_test.cpp | 58 ++ pxr/external/boost/python/test/dict.cpp | 91 ++ pxr/external/boost/python/test/dict.py | 47 ++ pxr/external/boost/python/test/docstring.cpp | 116 +++ pxr/external/boost/python/test/docstring.py | 153 ++++ .../python/test/enable_shared_from_this.cpp | 48 ++ .../python/test/enable_shared_from_this.py | 26 + pxr/external/boost/python/test/enum_ext.cpp | 55 ++ .../python/test/exception_translator.cpp | 28 + .../boost/python/test/exception_translator.py | 27 + pxr/external/boost/python/test/exec.cpp | 197 +++++ pxr/external/boost/python/test/exec.py | 6 + pxr/external/boost/python/test/extract.cpp | 143 ++++ pxr/external/boost/python/test/extract.py | 107 +++ pxr/external/boost/python/test/fabscript | 176 ++++ pxr/external/boost/python/test/if_else.cpp | 44 + pxr/external/boost/python/test/implicit.cpp | 48 ++ pxr/external/boost/python/test/implicit.py | 44 + pxr/external/boost/python/test/import_.cpp | 70 ++ pxr/external/boost/python/test/import_.py | 5 + .../python/test/indirect_traits_test.cpp | 116 +++ pxr/external/boost/python/test/injected.cpp | 39 + pxr/external/boost/python/test/injected.py | 28 + .../boost/python/test/input_iterator.cpp | 48 ++ .../python/test/int_map_indexing_suite.cpp | 16 + pxr/external/boost/python/test/iterator.cpp | 137 +++ pxr/external/boost/python/test/iterator.py | 80 ++ pxr/external/boost/python/test/keywords.cpp | 118 +++ .../boost/python/test/keywords_test.py | 106 +++ pxr/external/boost/python/test/list.cpp | 154 ++++ pxr/external/boost/python/test/list.py | 120 +++ pxr/external/boost/python/test/long.cpp | 63 ++ pxr/external/boost/python/test/long.py | 37 + pxr/external/boost/python/test/m1.cpp | 344 ++++++++ pxr/external/boost/python/test/m2.cpp | 108 +++ .../boost/python/test/map_indexing_suite.cpp | 68 ++ .../boost/python/test/map_indexing_suite.py | 238 ++++++ pxr/external/boost/python/test/minimal.cpp | 16 + pxr/external/boost/python/test/minimal.py | 7 + .../python/test/module_init_exception.cpp | 14 + .../python/test/module_init_exception.py | 12 + .../boost/python/test/module_tail.cpp | 58 ++ .../python/test/multi_arg_constructor.cpp | 27 + .../python/test/multi_arg_constructor.py | 21 + pxr/external/boost/python/test/nested.cpp | 51 ++ pxr/external/boost/python/test/nested.py | 40 + pxr/external/boost/python/test/newtest.py | 206 +++++ .../boost/python/test/numpy/dtype.cpp | 49 ++ pxr/external/boost/python/test/numpy/dtype.py | 63 ++ .../boost/python/test/numpy/indexing.cpp | 28 + .../boost/python/test/numpy/indexing.py | 55 ++ .../boost/python/test/numpy/ndarray.cpp | 51 ++ .../boost/python/test/numpy/ndarray.py | 112 +++ .../boost/python/test/numpy/shapes.cpp | 22 + .../boost/python/test/numpy/shapes.py | 21 + .../boost/python/test/numpy/templates.cpp | 63 ++ .../boost/python/test/numpy/templates.py | 28 + .../boost/python/test/numpy/ufunc.cpp | 36 + pxr/external/boost/python/test/numpy/ufunc.py | 57 ++ pxr/external/boost/python/test/object.cpp | 392 +++++++++ pxr/external/boost/python/test/object.py | 181 ++++ .../boost/python/test/object_fail1.cpp | 11 + .../boost/python/test/object_manager.cpp | 33 + pxr/external/boost/python/test/opaque.cpp | 76 ++ pxr/external/boost/python/test/opaque.py | 87 ++ pxr/external/boost/python/test/operators.cpp | 175 ++++ pxr/external/boost/python/test/operators.py | 102 +++ .../boost/python/test/operators_wrapper.cpp | 42 + .../boost/python/test/operators_wrapper.py | 11 + pxr/external/boost/python/test/pickle1.cpp | 62 ++ pxr/external/boost/python/test/pickle1.py | 41 + pxr/external/boost/python/test/pickle2.cpp | 97 +++ pxr/external/boost/python/test/pickle2.py | 52 ++ pxr/external/boost/python/test/pickle3.cpp | 107 +++ pxr/external/boost/python/test/pickle3.py | 47 ++ pxr/external/boost/python/test/pickle4.cpp | 44 + pxr/external/boost/python/test/pickle4.py | 39 + pxr/external/boost/python/test/pointee.cpp | 34 + .../python/test/pointer_type_id_test.cpp | 43 + .../boost/python/test/pointer_vector.cpp | 52 ++ .../boost/python/test/pointer_vector.py | 31 + .../boost/python/test/polymorphism.cpp | 162 ++++ .../boost/python/test/polymorphism.py | 74 ++ .../boost/python/test/polymorphism2.cpp | 172 ++++ .../boost/python/test/polymorphism2.py | 94 +++ .../python/test/polymorphism2_auto_ptr.cpp | 6 + .../python/test/polymorphism2_auto_ptr.py | 5 + pxr/external/boost/python/test/properties.cpp | 100 +++ pxr/external/boost/python/test/properties.py | 106 +++ pxr/external/boost/python/test/pyrun.py | 7 + .../boost/python/test/pytype_function.cpp | 85 ++ .../boost/python/test/pytype_function.py | 32 + pxr/external/boost/python/test/raw_ctor.cpp | 43 + pxr/external/boost/python/test/raw_ctor.py | 76 ++ .../boost/python/test/raw_pyobject_fail1.cpp | 11 + .../boost/python/test/raw_pyobject_fail2.cpp | 13 + .../boost/python/test/register_ptr.cpp | 55 ++ .../boost/python/test/register_ptr_test.py | 25 + pxr/external/boost/python/test/result.cpp | 111 +++ pxr/external/boost/python/test/return_arg.cpp | 67 ++ pxr/external/boost/python/test/return_arg.py | 27 + .../python/test/select_arg_to_python_test.cpp | 70 ++ .../python/test/select_from_python_test.cpp | 161 ++++ .../boost/python/test/select_holder.cpp | 76 ++ pxr/external/boost/python/test/shared_ptr.cpp | 19 + pxr/external/boost/python/test/shared_ptr.hpp | 206 +++++ pxr/external/boost/python/test/shared_ptr.py | 130 +++ .../boost/python/test/simple_type.hpp | 13 + pxr/external/boost/python/test/slice.cpp | 98 +++ pxr/external/boost/python/test/slice.py | 54 ++ .../boost/python/test/staticmethod.cpp | 48 ++ .../boost/python/test/staticmethod.py | 57 ++ .../boost/python/test/stl_iterator.cpp | 33 + .../boost/python/test/stl_iterator.py | 39 + pxr/external/boost/python/test/str.cpp | 84 ++ pxr/external/boost/python/test/str.py | 55 ++ .../boost/python/test/string_literal.cpp | 42 + .../python/test/test_builtin_converters.py | 307 +++++++ pxr/external/boost/python/test/test_class.hpp | 32 + pxr/external/boost/python/test/test_cltree.py | 43 + pxr/external/boost/python/test/test_enum.py | 85 ++ .../python/test/test_overload_resolution.cpp | 53 ++ .../python/test/test_pointer_adoption.cpp | 125 +++ .../python/test/test_pointer_adoption.py | 93 +++ pxr/external/boost/python/test/tuple.cpp | 33 + pxr/external/boost/python/test/tuple.py | 39 + pxr/external/boost/python/test/upcast.cpp | 19 + .../python/test/vector_indexing_suite.cpp | 62 ++ .../python/test/vector_indexing_suite.py | 370 ++++++++ .../boost/python/test/virtual_functions.cpp | 125 +++ .../boost/python/test/virtual_functions.py | 110 +++ pxr/external/boost/python/test/voidptr.cpp | 43 + pxr/external/boost/python/test/voidptr.py | 54 ++ .../boost/python/test/wrapper_held_type.cpp | 69 ++ .../boost/python/test/wrapper_held_type.py | 34 + .../boost/python/to_python_converter.hpp | 94 +++ .../boost/python/to_python_indirect.hpp | 112 +++ pxr/external/boost/python/to_python_value.hpp | 177 ++++ pxr/external/boost/python/tuple.hpp | 70 ++ pxr/external/boost/python/type_id.hpp | 184 ++++ .../boost/python/with_custodian_and_ward.hpp | 121 +++ pxr/external/boost/python/wrapper.hpp | 35 + 443 files changed, 41854 insertions(+) create mode 100644 pxr/external/boost/python.hpp create mode 100644 pxr/external/boost/python/arg_from_python.hpp create mode 100644 pxr/external/boost/python/args.hpp create mode 100644 pxr/external/boost/python/args_fwd.hpp create mode 100644 pxr/external/boost/python/back_reference.hpp create mode 100644 pxr/external/boost/python/base_type_traits.hpp create mode 100644 pxr/external/boost/python/bases.hpp create mode 100644 pxr/external/boost/python/borrowed.hpp create mode 100644 pxr/external/boost/python/call.hpp create mode 100644 pxr/external/boost/python/call_method.hpp create mode 100644 pxr/external/boost/python/cast.hpp create mode 100644 pxr/external/boost/python/class.hpp create mode 100644 pxr/external/boost/python/class_fwd.hpp create mode 100644 pxr/external/boost/python/converter/arg_from_python.hpp create mode 100644 pxr/external/boost/python/converter/arg_to_python.hpp create mode 100644 pxr/external/boost/python/converter/arg_to_python_base.hpp create mode 100644 pxr/external/boost/python/converter/as_to_python_function.hpp create mode 100644 pxr/external/boost/python/converter/builtin_converters.hpp create mode 100644 pxr/external/boost/python/converter/constructor_function.hpp create mode 100644 pxr/external/boost/python/converter/context_result_converter.hpp create mode 100644 pxr/external/boost/python/converter/convertible_function.hpp create mode 100644 pxr/external/boost/python/converter/from_python.hpp create mode 100644 pxr/external/boost/python/converter/implicit.hpp create mode 100644 pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp create mode 100644 pxr/external/boost/python/converter/object_manager.hpp create mode 100644 pxr/external/boost/python/converter/pointer_type_id.hpp create mode 100644 pxr/external/boost/python/converter/pyobject_traits.hpp create mode 100644 pxr/external/boost/python/converter/pyobject_type.hpp create mode 100644 pxr/external/boost/python/converter/pytype_function.hpp create mode 100644 pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp create mode 100644 pxr/external/boost/python/converter/registered.hpp create mode 100644 pxr/external/boost/python/converter/registered_pointee.hpp create mode 100644 pxr/external/boost/python/converter/registrations.hpp create mode 100644 pxr/external/boost/python/converter/registry.hpp create mode 100644 pxr/external/boost/python/converter/return_from_python.hpp create mode 100644 pxr/external/boost/python/converter/rvalue_from_python_data.hpp create mode 100644 pxr/external/boost/python/converter/shared_ptr_deleter.hpp create mode 100644 pxr/external/boost/python/converter/shared_ptr_from_python.hpp create mode 100644 pxr/external/boost/python/converter/shared_ptr_to_python.hpp create mode 100644 pxr/external/boost/python/converter/to_python_function_type.hpp create mode 100644 pxr/external/boost/python/copy_const_reference.hpp create mode 100644 pxr/external/boost/python/copy_non_const_reference.hpp create mode 100644 pxr/external/boost/python/data_members.hpp create mode 100644 pxr/external/boost/python/def.hpp create mode 100644 pxr/external/boost/python/def_visitor.hpp create mode 100644 pxr/external/boost/python/default_call_policies.hpp create mode 100644 pxr/external/boost/python/detail/aix_init_module.hpp create mode 100644 pxr/external/boost/python/detail/api_placeholder.hpp create mode 100644 pxr/external/boost/python/detail/borrowed_ptr.hpp create mode 100644 pxr/external/boost/python/detail/caller.hpp create mode 100644 pxr/external/boost/python/detail/config.hpp create mode 100644 pxr/external/boost/python/detail/construct.hpp create mode 100644 pxr/external/boost/python/detail/convertible.hpp create mode 100644 pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp create mode 100644 pxr/external/boost/python/detail/cv_category.hpp create mode 100644 pxr/external/boost/python/detail/dealloc.hpp create mode 100644 pxr/external/boost/python/detail/decorated_type_id.hpp create mode 100644 pxr/external/boost/python/detail/decref_guard.hpp create mode 100644 pxr/external/boost/python/detail/def_helper.hpp create mode 100644 pxr/external/boost/python/detail/def_helper_fwd.hpp create mode 100644 pxr/external/boost/python/detail/defaults_def.hpp create mode 100644 pxr/external/boost/python/detail/defaults_gen.hpp create mode 100644 pxr/external/boost/python/detail/dependent.hpp create mode 100644 pxr/external/boost/python/detail/destroy.hpp create mode 100644 pxr/external/boost/python/detail/enable_if.hpp create mode 100644 pxr/external/boost/python/detail/exception_handler.hpp create mode 100644 pxr/external/boost/python/detail/force_instantiate.hpp create mode 100644 pxr/external/boost/python/detail/if_else.hpp create mode 100644 pxr/external/boost/python/detail/indirect_traits.hpp create mode 100644 pxr/external/boost/python/detail/invoke.hpp create mode 100644 pxr/external/boost/python/detail/is_auto_ptr.hpp create mode 100644 pxr/external/boost/python/detail/is_shared_ptr.hpp create mode 100644 pxr/external/boost/python/detail/is_wrapper.hpp create mode 100644 pxr/external/boost/python/detail/is_xxx.hpp create mode 100644 pxr/external/boost/python/detail/make_keyword_range_fn.hpp create mode 100644 pxr/external/boost/python/detail/make_tuple.hpp create mode 100644 pxr/external/boost/python/detail/map_entry.hpp create mode 100644 pxr/external/boost/python/detail/mpl_lambda.hpp create mode 100644 pxr/external/boost/python/detail/msvc_typeinfo.hpp create mode 100644 pxr/external/boost/python/detail/none.hpp create mode 100644 pxr/external/boost/python/detail/not_specified.hpp create mode 100644 pxr/external/boost/python/detail/nullary_function_adaptor.hpp create mode 100644 pxr/external/boost/python/detail/operator_id.hpp create mode 100644 pxr/external/boost/python/detail/overloads_fwd.hpp create mode 100644 pxr/external/boost/python/detail/pointee.hpp create mode 100644 pxr/external/boost/python/detail/prefix.hpp create mode 100644 pxr/external/boost/python/detail/preprocessor.hpp create mode 100644 pxr/external/boost/python/detail/python22_fixed.h create mode 100644 pxr/external/boost/python/detail/python_type.hpp create mode 100644 pxr/external/boost/python/detail/raw_pyobject.hpp create mode 100644 pxr/external/boost/python/detail/referent_storage.hpp create mode 100644 pxr/external/boost/python/detail/result.hpp create mode 100644 pxr/external/boost/python/detail/scope.hpp create mode 100644 pxr/external/boost/python/detail/sfinae.hpp create mode 100644 pxr/external/boost/python/detail/signature.hpp create mode 100644 pxr/external/boost/python/detail/string_literal.hpp create mode 100644 pxr/external/boost/python/detail/target.hpp create mode 100644 pxr/external/boost/python/detail/translate_exception.hpp create mode 100644 pxr/external/boost/python/detail/type_list.hpp create mode 100644 pxr/external/boost/python/detail/type_list_impl.hpp create mode 100644 pxr/external/boost/python/detail/type_traits.hpp create mode 100644 pxr/external/boost/python/detail/unwind_type.hpp create mode 100644 pxr/external/boost/python/detail/unwrap_type_id.hpp create mode 100644 pxr/external/boost/python/detail/unwrap_wrapper.hpp create mode 100644 pxr/external/boost/python/detail/value_arg.hpp create mode 100644 pxr/external/boost/python/detail/value_is_shared_ptr.hpp create mode 100644 pxr/external/boost/python/detail/value_is_xxx.hpp create mode 100644 pxr/external/boost/python/detail/void_ptr.hpp create mode 100644 pxr/external/boost/python/detail/void_return.hpp create mode 100644 pxr/external/boost/python/detail/wrap_python.hpp create mode 100644 pxr/external/boost/python/detail/wrapper_base.hpp create mode 100644 pxr/external/boost/python/dict.hpp create mode 100644 pxr/external/boost/python/docstring_options.hpp create mode 100644 pxr/external/boost/python/enum.hpp create mode 100644 pxr/external/boost/python/errors.hpp create mode 100644 pxr/external/boost/python/exception_translator.hpp create mode 100644 pxr/external/boost/python/exec.hpp create mode 100644 pxr/external/boost/python/extract.hpp create mode 100644 pxr/external/boost/python/handle.hpp create mode 100644 pxr/external/boost/python/handle_fwd.hpp create mode 100644 pxr/external/boost/python/has_back_reference.hpp create mode 100644 pxr/external/boost/python/implicit.hpp create mode 100644 pxr/external/boost/python/import.hpp create mode 100644 pxr/external/boost/python/init.hpp create mode 100644 pxr/external/boost/python/instance_holder.hpp create mode 100644 pxr/external/boost/python/iterator.hpp create mode 100644 pxr/external/boost/python/list.hpp create mode 100644 pxr/external/boost/python/long.hpp create mode 100644 pxr/external/boost/python/lvalue_from_pytype.hpp create mode 100644 pxr/external/boost/python/make_constructor.hpp create mode 100644 pxr/external/boost/python/make_function.hpp create mode 100644 pxr/external/boost/python/manage_new_object.hpp create mode 100644 pxr/external/boost/python/module.hpp create mode 100644 pxr/external/boost/python/module_init.hpp create mode 100644 pxr/external/boost/python/numpy.hpp create mode 100644 pxr/external/boost/python/numpy/config.hpp create mode 100644 pxr/external/boost/python/numpy/dtype.hpp create mode 100644 pxr/external/boost/python/numpy/internal.hpp create mode 100644 pxr/external/boost/python/numpy/invoke_matching.hpp create mode 100644 pxr/external/boost/python/numpy/matrix.hpp create mode 100644 pxr/external/boost/python/numpy/ndarray.hpp create mode 100644 pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp create mode 100644 pxr/external/boost/python/numpy/scalars.hpp create mode 100644 pxr/external/boost/python/numpy/ufunc.hpp create mode 100644 pxr/external/boost/python/object.hpp create mode 100644 pxr/external/boost/python/object/add_to_namespace.hpp create mode 100644 pxr/external/boost/python/object/class.hpp create mode 100644 pxr/external/boost/python/object/class_detail.hpp create mode 100644 pxr/external/boost/python/object/class_metadata.hpp create mode 100644 pxr/external/boost/python/object/class_wrapper.hpp create mode 100644 pxr/external/boost/python/object/enum_base.hpp create mode 100644 pxr/external/boost/python/object/find_instance.hpp create mode 100644 pxr/external/boost/python/object/forward.hpp create mode 100644 pxr/external/boost/python/object/function.hpp create mode 100644 pxr/external/boost/python/object/function_doc_signature.hpp create mode 100644 pxr/external/boost/python/object/function_handle.hpp create mode 100644 pxr/external/boost/python/object/function_object.hpp create mode 100644 pxr/external/boost/python/object/inheritance.hpp create mode 100644 pxr/external/boost/python/object/inheritance_query.hpp create mode 100644 pxr/external/boost/python/object/instance.hpp create mode 100644 pxr/external/boost/python/object/iterator.hpp create mode 100644 pxr/external/boost/python/object/iterator_core.hpp create mode 100644 pxr/external/boost/python/object/life_support.hpp create mode 100644 pxr/external/boost/python/object/make_holder.hpp create mode 100644 pxr/external/boost/python/object/make_instance.hpp create mode 100644 pxr/external/boost/python/object/make_ptr_instance.hpp create mode 100644 pxr/external/boost/python/object/pickle_support.hpp create mode 100644 pxr/external/boost/python/object/pointer_holder.hpp create mode 100644 pxr/external/boost/python/object/py_function.hpp create mode 100644 pxr/external/boost/python/object/stl_iterator_core.hpp create mode 100644 pxr/external/boost/python/object/value_holder.hpp create mode 100644 pxr/external/boost/python/object/value_holder_fwd.hpp create mode 100644 pxr/external/boost/python/object_attributes.hpp create mode 100644 pxr/external/boost/python/object_call.hpp create mode 100644 pxr/external/boost/python/object_core.hpp create mode 100644 pxr/external/boost/python/object_fwd.hpp create mode 100644 pxr/external/boost/python/object_items.hpp create mode 100644 pxr/external/boost/python/object_operators.hpp create mode 100644 pxr/external/boost/python/object_protocol.hpp create mode 100644 pxr/external/boost/python/object_protocol_core.hpp create mode 100644 pxr/external/boost/python/object_slices.hpp create mode 100644 pxr/external/boost/python/opaque_pointer_converter.hpp create mode 100644 pxr/external/boost/python/operators.hpp create mode 100644 pxr/external/boost/python/other.hpp create mode 100644 pxr/external/boost/python/overloads.hpp create mode 100644 pxr/external/boost/python/override.hpp create mode 100644 pxr/external/boost/python/pointee.hpp create mode 100644 pxr/external/boost/python/proxy.hpp create mode 100644 pxr/external/boost/python/ptr.hpp create mode 100644 pxr/external/boost/python/pure_virtual.hpp create mode 100644 pxr/external/boost/python/raw_function.hpp create mode 100644 pxr/external/boost/python/refcount.hpp create mode 100644 pxr/external/boost/python/reference_existing_object.hpp create mode 100644 pxr/external/boost/python/register_ptr_to_python.hpp create mode 100644 pxr/external/boost/python/return_arg.hpp create mode 100644 pxr/external/boost/python/return_by_value.hpp create mode 100644 pxr/external/boost/python/return_internal_reference.hpp create mode 100644 pxr/external/boost/python/return_opaque_pointer.hpp create mode 100644 pxr/external/boost/python/return_value_policy.hpp create mode 100644 pxr/external/boost/python/scope.hpp create mode 100644 pxr/external/boost/python/self.hpp create mode 100644 pxr/external/boost/python/signature.hpp create mode 100644 pxr/external/boost/python/slice.hpp create mode 100644 pxr/external/boost/python/slice_nil.hpp create mode 100644 pxr/external/boost/python/src/converter/arg_to_python_base.cpp create mode 100644 pxr/external/boost/python/src/converter/builtin_converters.cpp create mode 100644 pxr/external/boost/python/src/converter/from_python.cpp create mode 100644 pxr/external/boost/python/src/converter/registry.cpp create mode 100644 pxr/external/boost/python/src/converter/type_id.cpp create mode 100644 pxr/external/boost/python/src/dict.cpp create mode 100644 pxr/external/boost/python/src/errors.cpp create mode 100644 pxr/external/boost/python/src/exec.cpp create mode 100644 pxr/external/boost/python/src/fabscript create mode 100644 pxr/external/boost/python/src/import.cpp create mode 100644 pxr/external/boost/python/src/list.cpp create mode 100644 pxr/external/boost/python/src/long.cpp create mode 100644 pxr/external/boost/python/src/module.cpp create mode 100644 pxr/external/boost/python/src/numpy/dtype.cpp create mode 100644 pxr/external/boost/python/src/numpy/matrix.cpp create mode 100644 pxr/external/boost/python/src/numpy/ndarray.cpp create mode 100644 pxr/external/boost/python/src/numpy/numpy.cpp create mode 100644 pxr/external/boost/python/src/numpy/scalars.cpp create mode 100644 pxr/external/boost/python/src/numpy/ufunc.cpp create mode 100644 pxr/external/boost/python/src/object/class.cpp create mode 100644 pxr/external/boost/python/src/object/enum.cpp create mode 100644 pxr/external/boost/python/src/object/function.cpp create mode 100644 pxr/external/boost/python/src/object/function_doc_signature.cpp create mode 100644 pxr/external/boost/python/src/object/inheritance.cpp create mode 100644 pxr/external/boost/python/src/object/iterator.cpp create mode 100644 pxr/external/boost/python/src/object/life_support.cpp create mode 100644 pxr/external/boost/python/src/object/pickle_support.cpp create mode 100644 pxr/external/boost/python/src/object/stl_iterator.cpp create mode 100644 pxr/external/boost/python/src/object_operators.cpp create mode 100644 pxr/external/boost/python/src/object_protocol.cpp create mode 100644 pxr/external/boost/python/src/slice.cpp create mode 100644 pxr/external/boost/python/src/str.cpp create mode 100644 pxr/external/boost/python/src/tuple.cpp create mode 100644 pxr/external/boost/python/src/wrapper.cpp create mode 100644 pxr/external/boost/python/ssize_t.hpp create mode 100644 pxr/external/boost/python/stl_iterator.hpp create mode 100644 pxr/external/boost/python/str.hpp create mode 100644 pxr/external/boost/python/suite/indexing/container_utils.hpp create mode 100644 pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp create mode 100644 pxr/external/boost/python/suite/indexing/indexing_suite.hpp create mode 100644 pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp create mode 100644 pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp create mode 100644 pxr/external/boost/python/tag.hpp create mode 100644 pxr/external/boost/python/test/Jamfile create mode 100644 pxr/external/boost/python/test/a_map_indexing_suite.cpp create mode 100644 pxr/external/boost/python/test/aligned_class.cpp create mode 100755 pxr/external/boost/python/test/aligned_class.py create mode 100644 pxr/external/boost/python/test/andreas_beyer.cpp create mode 100644 pxr/external/boost/python/test/andreas_beyer.py create mode 100644 pxr/external/boost/python/test/args.cpp create mode 100644 pxr/external/boost/python/test/args.py create mode 100644 pxr/external/boost/python/test/as_to_python_function.cpp create mode 100644 pxr/external/boost/python/test/auto_ptr.cpp create mode 100644 pxr/external/boost/python/test/auto_ptr.py create mode 100644 pxr/external/boost/python/test/back_reference.cpp create mode 100644 pxr/external/boost/python/test/back_reference.py create mode 100644 pxr/external/boost/python/test/bases.cpp create mode 100644 pxr/external/boost/python/test/ben_scott1.cpp create mode 100644 pxr/external/boost/python/test/ben_scott1.py create mode 100644 pxr/external/boost/python/test/bienstman1.cpp create mode 100644 pxr/external/boost/python/test/bienstman1.py create mode 100644 pxr/external/boost/python/test/bienstman2.cpp create mode 100644 pxr/external/boost/python/test/bienstman2.py create mode 100644 pxr/external/boost/python/test/bienstman3.cpp create mode 100644 pxr/external/boost/python/test/bienstman3.py create mode 100644 pxr/external/boost/python/test/bienstman4.cpp create mode 100644 pxr/external/boost/python/test/bienstman4.py create mode 100644 pxr/external/boost/python/test/bienstman5.cpp create mode 100644 pxr/external/boost/python/test/bienstman5.py create mode 100644 pxr/external/boost/python/test/boost_shared_ptr.cpp create mode 100644 pxr/external/boost/python/test/boost_shared_ptr.py create mode 100644 pxr/external/boost/python/test/borrowed.cpp create mode 100644 pxr/external/boost/python/test/builtin_converters.cpp create mode 100644 pxr/external/boost/python/test/callbacks.cpp create mode 100644 pxr/external/boost/python/test/callbacks.py create mode 100644 pxr/external/boost/python/test/calling_conventions.cpp create mode 100644 pxr/external/boost/python/test/calling_conventions.py create mode 100644 pxr/external/boost/python/test/calling_conventions_mf.cpp create mode 100644 pxr/external/boost/python/test/calling_conventions_mf.py create mode 100644 pxr/external/boost/python/test/class.cpp create mode 100644 pxr/external/boost/python/test/class.py create mode 100644 pxr/external/boost/python/test/cltree.cpp create mode 100644 pxr/external/boost/python/test/complicated.hpp create mode 100644 pxr/external/boost/python/test/const_argument.cpp create mode 100644 pxr/external/boost/python/test/const_argument.py create mode 100644 pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp create mode 100644 pxr/external/boost/python/test/crossmod_exception.py create mode 100644 pxr/external/boost/python/test/crossmod_exception_a.cpp create mode 100644 pxr/external/boost/python/test/crossmod_exception_b.cpp create mode 100644 pxr/external/boost/python/test/crossmod_opaque.py create mode 100644 pxr/external/boost/python/test/crossmod_opaque_a.cpp create mode 100644 pxr/external/boost/python/test/crossmod_opaque_b.cpp create mode 100644 pxr/external/boost/python/test/data_members.cpp create mode 100644 pxr/external/boost/python/test/data_members.py create mode 100644 pxr/external/boost/python/test/defaults.cpp create mode 100644 pxr/external/boost/python/test/defaults.py create mode 100644 pxr/external/boost/python/test/destroy_test.cpp create mode 100644 pxr/external/boost/python/test/dict.cpp create mode 100644 pxr/external/boost/python/test/dict.py create mode 100644 pxr/external/boost/python/test/docstring.cpp create mode 100644 pxr/external/boost/python/test/docstring.py create mode 100644 pxr/external/boost/python/test/enable_shared_from_this.cpp create mode 100644 pxr/external/boost/python/test/enable_shared_from_this.py create mode 100644 pxr/external/boost/python/test/enum_ext.cpp create mode 100644 pxr/external/boost/python/test/exception_translator.cpp create mode 100644 pxr/external/boost/python/test/exception_translator.py create mode 100644 pxr/external/boost/python/test/exec.cpp create mode 100644 pxr/external/boost/python/test/exec.py create mode 100644 pxr/external/boost/python/test/extract.cpp create mode 100644 pxr/external/boost/python/test/extract.py create mode 100644 pxr/external/boost/python/test/fabscript create mode 100644 pxr/external/boost/python/test/if_else.cpp create mode 100644 pxr/external/boost/python/test/implicit.cpp create mode 100644 pxr/external/boost/python/test/implicit.py create mode 100644 pxr/external/boost/python/test/import_.cpp create mode 100644 pxr/external/boost/python/test/import_.py create mode 100644 pxr/external/boost/python/test/indirect_traits_test.cpp create mode 100644 pxr/external/boost/python/test/injected.cpp create mode 100644 pxr/external/boost/python/test/injected.py create mode 100644 pxr/external/boost/python/test/input_iterator.cpp create mode 100644 pxr/external/boost/python/test/int_map_indexing_suite.cpp create mode 100644 pxr/external/boost/python/test/iterator.cpp create mode 100644 pxr/external/boost/python/test/iterator.py create mode 100644 pxr/external/boost/python/test/keywords.cpp create mode 100644 pxr/external/boost/python/test/keywords_test.py create mode 100644 pxr/external/boost/python/test/list.cpp create mode 100644 pxr/external/boost/python/test/list.py create mode 100644 pxr/external/boost/python/test/long.cpp create mode 100644 pxr/external/boost/python/test/long.py create mode 100644 pxr/external/boost/python/test/m1.cpp create mode 100644 pxr/external/boost/python/test/m2.cpp create mode 100644 pxr/external/boost/python/test/map_indexing_suite.cpp create mode 100644 pxr/external/boost/python/test/map_indexing_suite.py create mode 100644 pxr/external/boost/python/test/minimal.cpp create mode 100644 pxr/external/boost/python/test/minimal.py create mode 100644 pxr/external/boost/python/test/module_init_exception.cpp create mode 100644 pxr/external/boost/python/test/module_init_exception.py create mode 100644 pxr/external/boost/python/test/module_tail.cpp create mode 100644 pxr/external/boost/python/test/multi_arg_constructor.cpp create mode 100644 pxr/external/boost/python/test/multi_arg_constructor.py create mode 100644 pxr/external/boost/python/test/nested.cpp create mode 100644 pxr/external/boost/python/test/nested.py create mode 100644 pxr/external/boost/python/test/newtest.py create mode 100644 pxr/external/boost/python/test/numpy/dtype.cpp create mode 100644 pxr/external/boost/python/test/numpy/dtype.py create mode 100644 pxr/external/boost/python/test/numpy/indexing.cpp create mode 100644 pxr/external/boost/python/test/numpy/indexing.py create mode 100644 pxr/external/boost/python/test/numpy/ndarray.cpp create mode 100644 pxr/external/boost/python/test/numpy/ndarray.py create mode 100644 pxr/external/boost/python/test/numpy/shapes.cpp create mode 100644 pxr/external/boost/python/test/numpy/shapes.py create mode 100644 pxr/external/boost/python/test/numpy/templates.cpp create mode 100755 pxr/external/boost/python/test/numpy/templates.py create mode 100644 pxr/external/boost/python/test/numpy/ufunc.cpp create mode 100755 pxr/external/boost/python/test/numpy/ufunc.py create mode 100644 pxr/external/boost/python/test/object.cpp create mode 100644 pxr/external/boost/python/test/object.py create mode 100644 pxr/external/boost/python/test/object_fail1.cpp create mode 100644 pxr/external/boost/python/test/object_manager.cpp create mode 100644 pxr/external/boost/python/test/opaque.cpp create mode 100644 pxr/external/boost/python/test/opaque.py create mode 100644 pxr/external/boost/python/test/operators.cpp create mode 100644 pxr/external/boost/python/test/operators.py create mode 100644 pxr/external/boost/python/test/operators_wrapper.cpp create mode 100644 pxr/external/boost/python/test/operators_wrapper.py create mode 100644 pxr/external/boost/python/test/pickle1.cpp create mode 100644 pxr/external/boost/python/test/pickle1.py create mode 100644 pxr/external/boost/python/test/pickle2.cpp create mode 100644 pxr/external/boost/python/test/pickle2.py create mode 100644 pxr/external/boost/python/test/pickle3.cpp create mode 100644 pxr/external/boost/python/test/pickle3.py create mode 100644 pxr/external/boost/python/test/pickle4.cpp create mode 100644 pxr/external/boost/python/test/pickle4.py create mode 100644 pxr/external/boost/python/test/pointee.cpp create mode 100644 pxr/external/boost/python/test/pointer_type_id_test.cpp create mode 100644 pxr/external/boost/python/test/pointer_vector.cpp create mode 100644 pxr/external/boost/python/test/pointer_vector.py create mode 100644 pxr/external/boost/python/test/polymorphism.cpp create mode 100644 pxr/external/boost/python/test/polymorphism.py create mode 100644 pxr/external/boost/python/test/polymorphism2.cpp create mode 100644 pxr/external/boost/python/test/polymorphism2.py create mode 100644 pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp create mode 100644 pxr/external/boost/python/test/polymorphism2_auto_ptr.py create mode 100644 pxr/external/boost/python/test/properties.cpp create mode 100644 pxr/external/boost/python/test/properties.py create mode 100644 pxr/external/boost/python/test/pyrun.py create mode 100644 pxr/external/boost/python/test/pytype_function.cpp create mode 100644 pxr/external/boost/python/test/pytype_function.py create mode 100644 pxr/external/boost/python/test/raw_ctor.cpp create mode 100644 pxr/external/boost/python/test/raw_ctor.py create mode 100644 pxr/external/boost/python/test/raw_pyobject_fail1.cpp create mode 100644 pxr/external/boost/python/test/raw_pyobject_fail2.cpp create mode 100644 pxr/external/boost/python/test/register_ptr.cpp create mode 100644 pxr/external/boost/python/test/register_ptr_test.py create mode 100644 pxr/external/boost/python/test/result.cpp create mode 100644 pxr/external/boost/python/test/return_arg.cpp create mode 100644 pxr/external/boost/python/test/return_arg.py create mode 100644 pxr/external/boost/python/test/select_arg_to_python_test.cpp create mode 100644 pxr/external/boost/python/test/select_from_python_test.cpp create mode 100644 pxr/external/boost/python/test/select_holder.cpp create mode 100644 pxr/external/boost/python/test/shared_ptr.cpp create mode 100644 pxr/external/boost/python/test/shared_ptr.hpp create mode 100644 pxr/external/boost/python/test/shared_ptr.py create mode 100644 pxr/external/boost/python/test/simple_type.hpp create mode 100644 pxr/external/boost/python/test/slice.cpp create mode 100644 pxr/external/boost/python/test/slice.py create mode 100644 pxr/external/boost/python/test/staticmethod.cpp create mode 100644 pxr/external/boost/python/test/staticmethod.py create mode 100644 pxr/external/boost/python/test/stl_iterator.cpp create mode 100644 pxr/external/boost/python/test/stl_iterator.py create mode 100644 pxr/external/boost/python/test/str.cpp create mode 100644 pxr/external/boost/python/test/str.py create mode 100644 pxr/external/boost/python/test/string_literal.cpp create mode 100644 pxr/external/boost/python/test/test_builtin_converters.py create mode 100644 pxr/external/boost/python/test/test_class.hpp create mode 100644 pxr/external/boost/python/test/test_cltree.py create mode 100644 pxr/external/boost/python/test/test_enum.py create mode 100644 pxr/external/boost/python/test/test_overload_resolution.cpp create mode 100644 pxr/external/boost/python/test/test_pointer_adoption.cpp create mode 100644 pxr/external/boost/python/test/test_pointer_adoption.py create mode 100644 pxr/external/boost/python/test/tuple.cpp create mode 100644 pxr/external/boost/python/test/tuple.py create mode 100644 pxr/external/boost/python/test/upcast.cpp create mode 100644 pxr/external/boost/python/test/vector_indexing_suite.cpp create mode 100644 pxr/external/boost/python/test/vector_indexing_suite.py create mode 100644 pxr/external/boost/python/test/virtual_functions.cpp create mode 100644 pxr/external/boost/python/test/virtual_functions.py create mode 100644 pxr/external/boost/python/test/voidptr.cpp create mode 100644 pxr/external/boost/python/test/voidptr.py create mode 100644 pxr/external/boost/python/test/wrapper_held_type.cpp create mode 100644 pxr/external/boost/python/test/wrapper_held_type.py create mode 100644 pxr/external/boost/python/to_python_converter.hpp create mode 100644 pxr/external/boost/python/to_python_indirect.hpp create mode 100644 pxr/external/boost/python/to_python_value.hpp create mode 100644 pxr/external/boost/python/tuple.hpp create mode 100644 pxr/external/boost/python/type_id.hpp create mode 100644 pxr/external/boost/python/with_custodian_and_ward.hpp create mode 100644 pxr/external/boost/python/wrapper.hpp diff --git a/LICENSE.txt b/LICENSE.txt index a2cdda092e..d3bb1fa530 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -850,3 +850,31 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +================================================================ +boost +================================================================ + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/pxr/external/boost/python.hpp b/pxr/external/boost/python.hpp new file mode 100644 index 0000000000..e484034103 --- /dev/null +++ b/pxr/external/boost/python.hpp @@ -0,0 +1,75 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/python for documentation. + +#ifndef PYTHON_DWA2002810_HPP +# define PYTHON_DWA2002810_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +#endif // PYTHON_DWA2002810_HPP diff --git a/pxr/external/boost/python/arg_from_python.hpp b/pxr/external/boost/python/arg_from_python.hpp new file mode 100644 index 0000000000..983726b065 --- /dev/null +++ b/pxr/external/boost/python/arg_from_python.hpp @@ -0,0 +1,76 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ARG_FROM_PYTHON_DWA2002128_HPP +# define ARG_FROM_PYTHON_DWA2002128_HPP + +# include +# include +# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) +# include +#endif + +namespace boost { namespace python { + +template +struct arg_from_python + : converter::select_arg_from_python< +# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) + typename detail::remove_cv::type +# else + T +# endif + >::type +{ + typedef typename converter::select_arg_from_python< +# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(800)) + typename detail::remove_cv::type +# else + T +# endif + >::type base; + + arg_from_python(PyObject*); +}; + +// specialization for PyObject* +template <> +struct arg_from_python +{ + typedef PyObject* result_type; + + arg_from_python(PyObject* p) : m_source(p) {} + bool convertible() const { return true; } + PyObject* operator()() const { return m_source; } + private: + PyObject* m_source; +}; + +template <> +struct arg_from_python +{ + typedef PyObject* const& result_type; + + arg_from_python(PyObject* p) : m_source(p) {} + bool convertible() const { return true; } + PyObject*const& operator()() const { return m_source; } + private: + PyObject* m_source; +}; + +// +// implementations +// +template +inline arg_from_python::arg_from_python(PyObject* source) + : base(source) +{ +} + +}} // namespace boost::python + +#endif // ARG_FROM_PYTHON_DWA2002128_HPP diff --git a/pxr/external/boost/python/args.hpp b/pxr/external/boost/python/args.hpp new file mode 100644 index 0000000000..27731bd8c9 --- /dev/null +++ b/pxr/external/boost/python/args.hpp @@ -0,0 +1,146 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef KEYWORDS_DWA2002323_HPP +# define KEYWORDS_DWA2002323_HPP + +# include + +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +# include +# include + +# include + +# include +# include + +namespace boost { namespace python { + +typedef detail::keywords<1> arg; +typedef arg arg_; // gcc 2.96 workaround + +namespace detail +{ + template + struct keywords_base + { + BOOST_STATIC_CONSTANT(std::size_t, size = nkeywords); + + keyword_range range() const + { + return keyword_range(elements, elements + nkeywords); + } + + keyword elements[nkeywords]; + + keywords + operator,(python::arg const &k) const; + + keywords + operator,(char const *name) const; + }; + + template + struct keywords : keywords_base + { + }; + + template <> + struct keywords<1> : keywords_base<1> + { + explicit keywords(char const *name) + { + elements[0].name = name; + } + + template + python::arg& operator=(T const& value) + { + object z(value); + elements[0].default_value = handle<>(python::borrowed(object(value).ptr())); + return *this; + } + + operator detail::keyword const&() const + { + return elements[0]; + } + }; + + template + inline + keywords + keywords_base::operator,(python::arg const &k) const + { + keywords const& l = *static_cast const*>(this); + python::detail::keywords res; + std::copy(l.elements, l.elements+nkeywords, res.elements); + res.elements[nkeywords] = k.elements[0]; + return res; + } + + template + inline + keywords + keywords_base::operator,(char const *name) const + { + return this->operator,(python::arg(name)); + } + + template + struct is_keywords + { + BOOST_STATIC_CONSTANT(bool, value = false); + }; + + template + struct is_keywords > + { + BOOST_STATIC_CONSTANT(bool, value = true); + }; + template + struct is_reference_to_keywords + { + BOOST_STATIC_CONSTANT(bool, is_ref = detail::is_reference::value); + typedef typename detail::remove_reference::type deref; + typedef typename detail::remove_cv::type key_t; + BOOST_STATIC_CONSTANT(bool, is_key = is_keywords::value); + BOOST_STATIC_CONSTANT(bool, value = (is_ref & is_key)); + + typedef mpl::bool_ type; + BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) + }; +} + +inline detail::keywords<1> args(char const* name) +{ + return detail::keywords<1>(name); +} + +# define BOOST_PYTHON_ASSIGN_NAME(z, n, _) result.elements[n].name = name##n; +# define BOOST_PP_LOCAL_MACRO(n) \ +inline detail::keywords args(BOOST_PP_ENUM_PARAMS_Z(1, n, char const* name)) \ +{ \ + detail::keywords result; \ + BOOST_PP_REPEAT_1(n, BOOST_PYTHON_ASSIGN_NAME, _) \ + return result; \ +} +# define BOOST_PP_LOCAL_LIMITS (2, BOOST_PYTHON_MAX_ARITY) +# include BOOST_PP_LOCAL_ITERATE() + +}} // namespace boost::python + + +# endif // KEYWORDS_DWA2002323_HPP diff --git a/pxr/external/boost/python/args_fwd.hpp b/pxr/external/boost/python/args_fwd.hpp new file mode 100644 index 0000000000..39239461b0 --- /dev/null +++ b/pxr/external/boost/python/args_fwd.hpp @@ -0,0 +1,52 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ARGS_FWD_DWA2002927_HPP +# define ARGS_FWD_DWA2002927_HPP + +# include + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + struct keyword + { + keyword(char const* name_=0) + : name(name_) + {} + + char const* name; + handle<> default_value; + }; + + template struct keywords; + + typedef std::pair keyword_range; + + template <> + struct keywords<0> + { + BOOST_STATIC_CONSTANT(std::size_t, size = 0); + static keyword_range range() { return keyword_range(); } + }; + + namespace error + { + template + struct more_keywords_than_function_arguments + { + typedef char too_many_keywords[keywords > function_args ? -1 : 1]; + }; + } +} + +}} // namespace boost::python + +#endif // ARGS_FWD_DWA2002927_HPP diff --git a/pxr/external/boost/python/back_reference.hpp b/pxr/external/boost/python/back_reference.hpp new file mode 100644 index 0000000000..e68066f7d5 --- /dev/null +++ b/pxr/external/boost/python/back_reference.hpp @@ -0,0 +1,71 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BACK_REFERENCE_DWA2002510_HPP +# define BACK_REFERENCE_DWA2002510_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { + +template +struct back_reference +{ + private: // types + typedef typename detail::dependent::type source_t; + public: + typedef T type; + + back_reference(PyObject*, T); + source_t const& source() const; + T get() const; + private: + source_t m_source; + T m_value; +}; + +template +class is_back_reference +{ + public: + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +class is_back_reference > +{ + public: + BOOST_STATIC_CONSTANT(bool, value = true); +}; + + +// +// implementations +// +template +back_reference::back_reference(PyObject* p, T x) + : m_source(detail::borrowed_reference(p)) + , m_value(x) +{ +} + +template +typename back_reference::source_t const& back_reference::source() const +{ + return m_source; +} + +template +T back_reference::get() const +{ + return m_value; +} + +}} // namespace boost::python + +#endif // BACK_REFERENCE_DWA2002510_HPP diff --git a/pxr/external/boost/python/base_type_traits.hpp b/pxr/external/boost/python/base_type_traits.hpp new file mode 100644 index 0000000000..e1c6a4843f --- /dev/null +++ b/pxr/external/boost/python/base_type_traits.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BASE_TYPE_TRAITS_DWA2002614_HPP +# define BASE_TYPE_TRAITS_DWA2002614_HPP + +# include + +namespace boost { namespace python { + +namespace detail +{ + struct unspecialized {}; +} + +// Derive from unspecialized so we can detect whether traits are +// specialized +template struct base_type_traits + : detail::unspecialized +{}; + +template <> +struct base_type_traits +{ + typedef PyObject type; +}; + +template <> +struct base_type_traits +{ + typedef PyObject type; +}; + +template <> +struct base_type_traits +{ + typedef PyObject type; +}; + +}} // namespace boost::python + +#endif // BASE_TYPE_TRAITS_DWA2002614_HPP diff --git a/pxr/external/boost/python/bases.hpp b/pxr/external/boost/python/bases.hpp new file mode 100644 index 0000000000..efcac3f389 --- /dev/null +++ b/pxr/external/boost/python/bases.hpp @@ -0,0 +1,50 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BASES_DWA2002321_HPP +# define BASES_DWA2002321_HPP + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +# define BOOST_PYTHON_BASE_PARAMS BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, Base) + + // A type list for specifying bases + template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_MAX_BASES, typename Base, mpl::void_) > + struct bases : detail::type_list< BOOST_PYTHON_BASE_PARAMS >::type + {}; + + namespace detail + { + template struct specifies_bases + : mpl::false_ + { + }; + + template < BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, class Base) > + struct specifies_bases< bases< BOOST_PYTHON_BASE_PARAMS > > + : mpl::true_ + { + }; + template > + struct select_bases + : mpl::if_< + specifies_bases + , T + , Prev + > + { + }; + } +# undef BOOST_PYTHON_BASE_PARAMS +}} // namespace boost::python + +#endif // BASES_DWA2002321_HPP diff --git a/pxr/external/boost/python/borrowed.hpp b/pxr/external/boost/python/borrowed.hpp new file mode 100644 index 0000000000..fd2716bfbd --- /dev/null +++ b/pxr/external/boost/python/borrowed.hpp @@ -0,0 +1,21 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BORROWED_DWA2002614_HPP +# define BORROWED_DWA2002614_HPP + +# include +# include + +namespace boost { namespace python { + +template +inline python::detail::borrowed* borrowed(T* p) +{ + return (detail::borrowed*)p; +} + +}} // namespace boost::python + +#endif // BORROWED_DWA2002614_HPP diff --git a/pxr/external/boost/python/call.hpp b/pxr/external/boost/python/call.hpp new file mode 100644 index 0000000000..c057ee9a12 --- /dev/null +++ b/pxr/external/boost/python/call.hpp @@ -0,0 +1,83 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef CALL_DWA2002411_HPP +# define CALL_DWA2002411_HPP + +# include + +# include + +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ + , converter::arg_to_python(a##n).get() + +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET + +}} // namespace boost::python + +# endif // CALL_DWA2002411_HPP + +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, call.hpp) +# endif + +# define N BOOST_PP_ITERATION() + +template < + class R + BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A) + > +typename detail::returnable::type +call(PyObject* callable + BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a) + , boost::type* = 0 + ) +{ + PyObject* const result = + PyObject_CallFunction( + callable + , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) + ); + + // This conversion *must not* be done in the same expression as + // the call, because, in the special case where the result is a + // reference a Python object which was created by converting a C++ + // argument for passing to PyObject_CallFunction, its reference + // count will be 2 until the end of the full expression containing + // the conversion, and that interferes with dangling + // pointer/reference detection. + converter::return_from_python converter; + return converter(result); +} + +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/call_method.hpp b/pxr/external/boost/python/call_method.hpp new file mode 100644 index 0000000000..2f360791d7 --- /dev/null +++ b/pxr/external/boost/python/call_method.hpp @@ -0,0 +1,83 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# ifndef CALL_METHOD_DWA2002411_HPP +# define CALL_METHOD_DWA2002411_HPP + +# include + +# include + +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ + , converter::arg_to_python(a##n).get() + +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET + +}} // namespace boost::python + +# endif // CALL_METHOD_DWA2002411_HPP + +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, call_method.hpp) +# endif + +# define N BOOST_PP_ITERATION() + +template < + class R + BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A) + > +typename detail::returnable::type +call_method(PyObject* self, char const* name + BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a) + , boost::type* = 0 + ) +{ + PyObject* const result = + PyObject_CallMethod( + self + , const_cast(name) + , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) + ); + + // This conversion *must not* be done in the same expression as + // the call, because, in the special case where the result is a + // reference a Python object which was created by converting a C++ + // argument for passing to PyObject_CallFunction, its reference + // count will be 2 until the end of the full expression containing + // the conversion, and that interferes with dangling + // pointer/reference detection. + converter::return_from_python converter; + return converter(result); +} + +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif // BOOST_PP_IS_ITERATING diff --git a/pxr/external/boost/python/cast.hpp b/pxr/external/boost/python/cast.hpp new file mode 100644 index 0000000000..c0dd229e84 --- /dev/null +++ b/pxr/external/boost/python/cast.hpp @@ -0,0 +1,105 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CAST_DWA200269_HPP +# define CAST_DWA200269_HPP + +# include +# include + +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template inline Target* upcast_impl(Source*, Target*); + + template + inline Target* upcast(Source* p, yes_convertible, no_convertible, Target*) + { + return p; + } + + template + inline Target* upcast(Source* p, no_convertible, no_convertible, Target*) + { + typedef typename base_type_traits::type base; + + return detail::upcast_impl((base*)p, (Target*)0); + } + + template + struct upcaster + { + template + static inline T* execute(T* x, T*) { return x; } + }; + + template <> + struct upcaster + { + template + static inline Target* execute(Source* x, Target*) + { + return detail::upcast( + x, detail::convertible::check(x) + , detail::convertible::check((Target*)0) + , (Target*)0); + } + }; + + + template + inline Target* downcast(Source* p, yes_convertible) + { + return static_cast(p); + } + + template + inline Target* downcast(Source* p, no_convertible, boost::type* = 0) + { + typedef typename base_type_traits::type base; + return (Target*)detail::downcast(p, convertible::check((base*)0)); + } + + template + inline void assert_castable(boost::type* = 0) + { + typedef char must_be_a_complete_type[sizeof(T)] BOOST_ATTRIBUTE_UNUSED; + } + + template + inline Target* upcast_impl(Source* x, Target*) + { + typedef typename detail::add_cv::type src_t; + typedef typename detail::add_cv::type target_t; + bool const same = detail::is_same::value; + + return detail::upcaster::execute(x, (Target*)0); + } +} + +template +inline Target* upcast(Source* x, Target* = 0) +{ + detail::assert_castable(); + detail::assert_castable(); + return detail::upcast_impl(x, (Target*)0); + +} + +template +inline Target* downcast(Source* x, Target* = 0) +{ + detail::assert_castable(); + detail::assert_castable(); + return detail::downcast(x, detail::convertible::check((Target*)0)); +} + +}} // namespace boost::python + +#endif // CAST_DWA200269_HPP diff --git a/pxr/external/boost/python/class.hpp b/pxr/external/boost/python/class.hpp new file mode 100644 index 0000000000..77f915ba0a --- /dev/null +++ b/pxr/external/boost/python/class.hpp @@ -0,0 +1,608 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CLASS_DWA200216_HPP +# define CLASS_DWA200216_HPP + +# include + +# include + +# include +# include + +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +# include + +# if BOOST_WORKAROUND(__MWERKS__, <= 0x3004) \ + /* pro9 reintroduced the bug */ \ + || (BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) + +# define BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING 1 + +# endif + +# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +# include +# endif + +namespace boost { namespace python { + +template class def_visitor; + +enum no_init_t { no_init }; + +namespace detail +{ + // This function object is used with mpl::for_each to write the id + // of the type a pointer to which is passed as its 2nd compile-time + // argument. into the iterator pointed to by its runtime argument + struct write_type_id + { + write_type_id(type_info**p) : p(p) {} + + // Here's the runtime behavior + template + void operator()(T*) const + { + *(*p)++ = type_id(); + } + + type_info** p; + }; + + template + struct is_data_member_pointer + : mpl::and_< + detail::is_member_pointer + , mpl::not_ > + > + {}; + +# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , detail::is_data_member_pointer() +# define BOOST_PYTHON_YES_DATA_MEMBER , mpl::true_ +# define BOOST_PYTHON_NO_DATA_MEMBER , mpl::false_ +# elif defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , 0 +# define BOOST_PYTHON_YES_DATA_MEMBER , int +# define BOOST_PYTHON_NO_DATA_MEMBER , ... +# else +# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) +# define BOOST_PYTHON_YES_DATA_MEMBER +# define BOOST_PYTHON_NO_DATA_MEMBER +# endif + + namespace error + { + // + // A meta-assertion mechanism which prints nice error messages and + // backtraces on lots of compilers. Usage: + // + // assertion::failed + // + // where C is an MPL metafunction class + // + + template struct assertion_failed { }; + template struct assertion_ok { typedef C failed; }; + + template + struct assertion + : mpl::if_, assertion_failed >::type + {}; + + // + // Checks for validity of arguments used to define virtual + // functions with default implementations. + // + + template + void not_a_derived_class_member(Default) {} + + template + struct virtual_function_default + { + template + static void + must_be_derived_class_member(Default const&) + { + // https://svn.boost.org/trac/boost/ticket/5803 + //typedef typename assertion > >::failed test0; +# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) + typedef typename assertion >::failed test1 BOOST_ATTRIBUTE_UNUSED; +# endif + typedef typename assertion >::failed test2 BOOST_ATTRIBUTE_UNUSED; + not_a_derived_class_member(Fn()); + } + }; + } +} + +// This is the primary mechanism through which users will expose +// C++ classes to Python. +template < + class W // class being wrapped + , class X1 // = detail::not_specified + , class X2 // = detail::not_specified + , class X3 // = detail::not_specified + > +class class_ : public objects::class_base +{ + public: // types + typedef objects::class_base base; + typedef class_ self; + typedef typename objects::class_metadata metadata; + typedef W wrapped_type; + + private: // types + + // A helper class which will contain an array of id objects to be + // passed to the base class constructor + struct id_vector + { + typedef typename metadata::bases bases; + + id_vector() + { + // Stick the derived class id into the first element of the array + ids[0] = detail::unwrap_type_id((W*)0, (W*)0); + + // Write the rest of the elements into succeeding positions. + type_info* p = ids + 1; + mpl::for_each(detail::write_type_id(&p), (bases*)0, (add_pointer*)0); + } + + BOOST_STATIC_CONSTANT( + std::size_t, size = mpl::size::value + 1); + type_info ids[size]; + }; + friend struct id_vector; + + public: // constructors + + // Construct with the class name, with or without docstring, and default __init__() function + class_(char const* name, char const* doc = 0); + + // Construct with class name, no docstring, and an uncallable __init__ function + class_(char const* name, no_init_t); + + // Construct with class name, docstring, and an uncallable __init__ function + class_(char const* name, char const* doc, no_init_t); + + // Construct with class name and init<> function + template + inline class_(char const* name, init_base const& i) + : base(name, id_vector::size, id_vector().ids) + { + this->initialize(i); + } + + // Construct with class name, docstring and init<> function + template + inline class_(char const* name, char const* doc, init_base const& i) + : base(name, id_vector::size, id_vector().ids, doc) + { + this->initialize(i); + } + + public: // member functions + + // Generic visitation + template + self& def(def_visitor const& visitor) + { + visitor.visit(*this); + return *this; + } + + // Wrap a member function or a non-member function which can take + // a T, T cv&, or T cv* as its first parameter, a callable + // python object, or a generic visitor. + template + self& def(char const* name, F f) + { + this->def_impl( + detail::unwrap_wrapper((W*)0) + , name, f, detail::def_helper(0), &f); + return *this; + } + + template + self& def(char const* name, A1 a1, A2 const& a2) + { + this->def_maybe_overloads(name, a1, a2, &a2); + return *this; + } + + template + self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2) + { + // The arguments are definitely: + // def(name, function, policy, doc_string) + // def(name, function, doc_string, policy) + + this->def_impl( + detail::unwrap_wrapper((W*)0) + , name, fn + , detail::def_helper(a1,a2) + , &fn); + + return *this; + } + + template + self& def(char const* name, Fn fn, A1 const& a1, A2 const& a2, A3 const& a3) + { + this->def_impl( + detail::unwrap_wrapper((W*)0) + , name, fn + , detail::def_helper(a1,a2,a3) + , &fn); + + return *this; + } + + // + // Data member access + // + template + self& def_readonly(char const* name, D const& d, char const* doc=0) + { + return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + } + + template + self& def_readwrite(char const* name, D const& d, char const* doc=0) + { + return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + } + + template + self& def_readonly(char const* name, D& d, char const* doc=0) + { + return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + } + + template + self& def_readwrite(char const* name, D& d, char const* doc=0) + { + return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + } + + // Property creation + template + self& add_property(char const* name, Get fget, char const* docstr = 0) + { + base::add_property(name, this->make_getter(fget), docstr); + return *this; + } + + template + self& add_property(char const* name, Get fget, Set fset, char const* docstr = 0) + { + base::add_property( + name, this->make_getter(fget), this->make_setter(fset), docstr); + return *this; + } + + template + self& add_static_property(char const* name, Get fget) + { + base::add_static_property(name, object(fget)); + return *this; + } + + template + self& add_static_property(char const* name, Get fget, Set fset) + { + base::add_static_property(name, object(fget), object(fset)); + return *this; + } + + template + self& setattr(char const* name, U const& x) + { + this->base::setattr(name, object(x)); + return *this; + } + + // Pickle support + template + self& def_pickle(PickleSuiteType const& x) + { + error_messages::must_be_derived_from_pickle_suite(x); + detail::pickle_suite_finalize::register_( + *this, + &PickleSuiteType::getinitargs, + &PickleSuiteType::getstate, + &PickleSuiteType::setstate, + PickleSuiteType::getstate_manages_dict()); + return *this; + } + + self& enable_pickling() + { + this->base::enable_pickling_(false); + return *this; + } + + self& staticmethod(char const* name) + { + this->make_method_static(name); + return *this; + } + private: // helper functions + + // Builds a method for this class around the given [member] + // function pointer or object, appropriately adjusting the type of + // the first signature argument so that if f is a member of a + // (possibly not wrapped) base class of T, an lvalue argument of + // type T will be required. + // + // @group PropertyHelpers { + template + object make_getter(F f) + { + typedef typename api::is_object_operators::type is_obj_or_proxy; + + return this->make_fn_impl( + detail::unwrap_wrapper((W*)0) + , f, is_obj_or_proxy(), (char*)0, detail::is_data_member_pointer() + ); + } + + template + object make_setter(F f) + { + typedef typename api::is_object_operators::type is_obj_or_proxy; + + return this->make_fn_impl( + detail::unwrap_wrapper((W*)0) + , f, is_obj_or_proxy(), (int*)0, detail::is_data_member_pointer() + ); + } + + template + object make_fn_impl(T*, F const& f, mpl::false_, void*, mpl::false_) + { + return python::make_function(f, default_call_policies(), detail::get_signature(f, (T*)0)); + } + + template + object make_fn_impl(T*, D B::*pm_, mpl::false_, char*, mpl::true_) + { + D T::*pm = pm_; + return python::make_getter(pm); + } + + template + object make_fn_impl(T*, D B::*pm_, mpl::false_, int*, mpl::true_) + { + D T::*pm = pm_; + return python::make_setter(pm); + } + + template + object make_fn_impl(T*, F const& x, mpl::true_, void*, mpl::false_) + { + return x; + } + // } + + template + self& def_readonly_impl( + char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) + { + return this->add_property(name, pm_, doc); + } + + template + self& def_readwrite_impl( + char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) + { + return this->add_property(name, pm_, pm_, doc); + } + + template + self& def_readonly_impl( + char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) + { + return this->add_static_property(name, python::make_getter(d)); + } + + template + self& def_readwrite_impl( + char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) + { + return this->add_static_property(name, python::make_getter(d), python::make_setter(d)); + } + + template + inline void initialize(DefVisitor const& i) + { + metadata::register_(); // set up runtime metadata/conversions + + typedef typename metadata::holder holder; + this->set_instance_size( objects::additional_instance_size::value ); + + this->def(i); + } + + inline void initialize(no_init_t) + { + metadata::register_(); // set up runtime metadata/conversions + this->def_no_init(); + } + + // + // These two overloads discriminate between def() as applied to a + // generic visitor and everything else. + // + // @group def_impl { + template + inline void def_impl( + T* + , char const* name + , LeafVisitor + , Helper const& helper + , def_visitor const* v + ) + { + v->visit(*this, name, helper); + } + + template + inline void def_impl( + T* + , char const* name + , Fn fn + , Helper const& helper + , ... + ) + { + objects::add_to_namespace( + *this + , name + , make_function( + fn + , helper.policies() + , helper.keywords() + , detail::get_signature(fn, (T*)0) + ) + , helper.doc() + ); + + this->def_default(name, fn, helper, mpl::bool_()); + } + // } + + // + // These two overloads handle the definition of default + // implementation overloads for virtual functions. The second one + // handles the case where no default implementation was specified. + // + // @group def_default { + template + inline void def_default( + char const* name + , Fn + , Helper const& helper + , mpl::bool_) + { + detail::error::virtual_function_default::must_be_derived_class_member( + helper.default_implementation()); + + objects::add_to_namespace( + *this, name, + make_function( + helper.default_implementation(), helper.policies(), helper.keywords()) + ); + } + + template + inline void def_default(char const*, Fn, Helper const&, mpl::bool_) + { } + // } + + // + // These two overloads discriminate between def() as applied to + // regular functions and def() as applied to the result of + // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to + // discriminate. + // + // @group def_maybe_overloads { + template + void def_maybe_overloads( + char const* name + , SigT sig + , OverloadsT const& overloads + , detail::overloads_base const*) + + { + // convert sig to a type_list (see detail::get_signature in signature.hpp) + // before calling detail::define_with_defaults. + detail::define_with_defaults( + name, overloads, *this, detail::get_signature(sig)); + } + + template + void def_maybe_overloads( + char const* name + , Fn fn + , A1 const& a1 + , ...) + { + this->def_impl( + detail::unwrap_wrapper((W*)0) + , name + , fn + , detail::def_helper(a1) + , &fn + ); + + } + // } +}; + + +// +// implementations +// + +template +inline class_::class_(char const* name, char const* doc) + : base(name, id_vector::size, id_vector().ids, doc) +{ + this->initialize(init<>()); +// select_holder::assert_default_constructible(); +} + +template +inline class_::class_(char const* name, no_init_t) + : base(name, id_vector::size, id_vector().ids) +{ + this->initialize(no_init); +} + +template +inline class_::class_(char const* name, char const* doc, no_init_t) + : base(name, id_vector::size, id_vector().ids, doc) +{ + this->initialize(no_init); +} + +}} // namespace boost::python + +# undef BOOST_PYTHON_DATA_MEMBER_HELPER +# undef BOOST_PYTHON_YES_DATA_MEMBER +# undef BOOST_PYTHON_NO_DATA_MEMBER +# undef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING + +#endif // CLASS_DWA200216_HPP diff --git a/pxr/external/boost/python/class_fwd.hpp b/pxr/external/boost/python/class_fwd.hpp new file mode 100644 index 0000000000..528e18a1dc --- /dev/null +++ b/pxr/external/boost/python/class_fwd.hpp @@ -0,0 +1,24 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CLASS_FWD_DWA200222_HPP +# define CLASS_FWD_DWA200222_HPP + +# include +# include + +namespace boost { namespace python { + +template < + class T // class being wrapped + // arbitrarily-ordered optional arguments. Full qualification needed for MSVC6 + , class X1 = ::boost::python::detail::not_specified + , class X2 = ::boost::python::detail::not_specified + , class X3 = ::boost::python::detail::not_specified + > +class class_; + +}} // namespace boost::python + +#endif // CLASS_FWD_DWA200222_HPP diff --git a/pxr/external/boost/python/converter/arg_from_python.hpp b/pxr/external/boost/python/converter/arg_from_python.hpp new file mode 100644 index 0000000000..0c0daabc1f --- /dev/null +++ b/pxr/external/boost/python/converter/arg_from_python.hpp @@ -0,0 +1,335 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ARG_FROM_PYTHON_DWA2002127_HPP +# define ARG_FROM_PYTHON_DWA2002127_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python +{ + template struct arg_from_python; +}} + +// This header defines Python->C++ function argument converters, +// parametrized on the argument type. + +namespace boost { namespace python { namespace converter { + +// +// lvalue converters +// +// These require that an lvalue of the type U is stored somewhere in +// the Python object being converted. + +// Used when T == U*const& +template +struct pointer_cref_arg_from_python +{ + typedef T result_type; + + pointer_cref_arg_from_python(PyObject*); + T operator()() const; + bool convertible() const; + + private: // storage for a U* + // needed because not all compilers will let us declare U* as the + // return type of operator() -- we return U*const& instead + typename python::detail::referent_storage::type m_result; +}; + +// Base class for pointer and reference converters +struct arg_lvalue_from_python_base +{ + public: // member functions + arg_lvalue_from_python_base(void* result); + bool convertible() const; + + protected: // member functions + void*const& result() const; + + private: // data members + void* m_result; +}; + +// Used when T == U* +template +struct pointer_arg_from_python : arg_lvalue_from_python_base +{ + typedef T result_type; + + pointer_arg_from_python(PyObject*); + T operator()() const; +}; + +// Used when T == U& and (T != V const& or T == W volatile&) +template +struct reference_arg_from_python : arg_lvalue_from_python_base +{ + typedef T result_type; + + reference_arg_from_python(PyObject*); + T operator()() const; +}; + +// =================== + +// +// rvalue converters +// +// These require only that an object of type T can be created from +// the given Python object, but not that the T object exist +// somewhere in storage. +// + +// Used when T is a plain value (non-pointer, non-reference) type or +// a (non-volatile) const reference to a plain value type. +template +struct arg_rvalue_from_python +{ + typedef typename boost::python::detail::add_lvalue_reference< + T + // We can't add_const here, or it would be impossible to pass + // auto_ptr args from Python to C++ + >::type result_type; + + arg_rvalue_from_python(PyObject*); + bool convertible() const; + +# if _MSC_FULL_VER > 13102196 + typename arg_rvalue_from_python:: +# endif + result_type operator()(); + + private: + rvalue_from_python_data m_data; + PyObject* m_source; +}; + + +// ================== + +// Converts to a (PyObject*,T) bundle, for when you need a reference +// back to the Python object +template +struct back_reference_arg_from_python + : boost::python::arg_from_python +{ + typedef T result_type; + + back_reference_arg_from_python(PyObject*); + T operator()(); + private: + typedef boost::python::arg_from_python base; + PyObject* m_source; +}; + + +// ================== + +template +struct if_2 +{ + typedef typename mpl::eval_if, F>::type type; +}; + +// This metafunction selects the appropriate arg_from_python converter +// type for an argument of type T. +template +struct select_arg_from_python +{ + typedef typename if_2< + is_object_manager + , object_manager_value_arg_from_python + , if_2< + is_reference_to_object_manager + , object_manager_ref_arg_from_python + , if_2< + is_pointer + , pointer_arg_from_python + , if_2< + mpl::and_< + indirect_traits::is_reference_to_pointer + , indirect_traits::is_reference_to_const + , mpl::not_ > + > + , pointer_cref_arg_from_python + , if_2< + mpl::or_< + indirect_traits::is_reference_to_non_const + , indirect_traits::is_reference_to_volatile + > + , reference_arg_from_python + , mpl::if_< + boost::python::is_back_reference + , back_reference_arg_from_python + , arg_rvalue_from_python + > + > + > + > + > + >::type type; +}; + +// ================== + +// +// implementations +// + +// arg_lvalue_from_python_base +// +inline arg_lvalue_from_python_base::arg_lvalue_from_python_base(void* result) + : m_result(result) +{ +} + +inline bool arg_lvalue_from_python_base::convertible() const +{ + return m_result != 0; +} + +inline void*const& arg_lvalue_from_python_base::result() const +{ + return m_result; +} + +// pointer_cref_arg_from_python +// +namespace detail +{ + // null_ptr_reference -- a function returning a reference to a null + // pointer of type U. Needed so that extractors for T*const& can + // convert Python's None. + template + struct null_ptr_owner + { + static T value; + }; + template T null_ptr_owner::value = 0; + + template + inline U& null_ptr_reference(U&(*)()) + { + return null_ptr_owner::value; + } +} + +template +inline pointer_cref_arg_from_python::pointer_cref_arg_from_python(PyObject* p) +{ + // T == U*const&: store a U* in the m_result storage. Nonzero + // indicates success. If find returns nonzero, it's a pointer to + // a U object. + python::detail::write_void_ptr_reference( + m_result.bytes + , p == Py_None ? p : converter::get_lvalue_from_python(p, registered_pointee::converters) + , (T(*)())0); +} + +template +inline bool pointer_cref_arg_from_python::convertible() const +{ + return python::detail::void_ptr_to_reference(m_result.bytes, (T(*)())0) != 0; +} +template +inline T pointer_cref_arg_from_python::operator()() const +{ + return (*(void**)m_result.bytes == Py_None) // None ==> 0 + ? detail::null_ptr_reference((T(*)())0) + // Otherwise, return a U*const& to the m_result storage. + : python::detail::void_ptr_to_reference(m_result.bytes, (T(*)())0); +} + +// pointer_arg_from_python +// +template +inline pointer_arg_from_python::pointer_arg_from_python(PyObject* p) + : arg_lvalue_from_python_base( + p == Py_None ? p : converter::get_lvalue_from_python(p, registered_pointee::converters)) +{ +} + +template +inline T pointer_arg_from_python::operator()() const +{ + return (result() == Py_None) ? 0 : T(result()); +} + +// reference_arg_from_python +// +template +inline reference_arg_from_python::reference_arg_from_python(PyObject* p) + : arg_lvalue_from_python_base(converter::get_lvalue_from_python(p,registered::converters)) +{ +} + +template +inline T reference_arg_from_python::operator()() const +{ + return python::detail::void_ptr_to_reference(result(), (T(*)())0); +} + + +// arg_rvalue_from_python +// +template +inline arg_rvalue_from_python::arg_rvalue_from_python(PyObject* obj) + : m_data(converter::rvalue_from_python_stage1(obj, registered::converters)) + , m_source(obj) +{ +} + +template +inline bool arg_rvalue_from_python::convertible() const +{ + return m_data.stage1.convertible != 0; +} + +template +inline typename arg_rvalue_from_python::result_type +arg_rvalue_from_python::operator()() +{ + if (m_data.stage1.construct != 0) + m_data.stage1.construct(m_source, &m_data.stage1); + + return python::detail::void_ptr_to_reference(m_data.stage1.convertible, (result_type(*)())0); +} + +// back_reference_arg_from_python +// +template +back_reference_arg_from_python::back_reference_arg_from_python(PyObject* x) + : base(x), m_source(x) +{ +} + +template +inline T +back_reference_arg_from_python::operator()() +{ + return T(m_source, base::operator()()); +} + +}}} // namespace boost::python::converter + +#endif // ARG_FROM_PYTHON_DWA2002127_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python.hpp b/pxr/external/boost/python/converter/arg_to_python.hpp new file mode 100644 index 0000000000..bbecae72e5 --- /dev/null +++ b/pxr/external/boost/python/converter/arg_to_python.hpp @@ -0,0 +1,257 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ARG_TO_PYTHON_DWA200265_HPP +# define ARG_TO_PYTHON_DWA200265_HPP + +# include +# include +# include + +# include +# include +# include +# include +// Bring in specializations +# include + +# include + +# include + +# include +# include +# include +# include +# include + +# include + +namespace boost { namespace python { namespace converter { + +template struct is_object_manager; + +namespace detail +{ + template + struct function_arg_to_python : handle<> + { + function_arg_to_python(T const& x); + }; + + template + struct reference_arg_to_python : handle<> + { + reference_arg_to_python(T& x); + private: + static PyObject* get_object(T& x); + }; + + template + struct shared_ptr_arg_to_python : handle<> + { + shared_ptr_arg_to_python(T const& x); + private: + static PyObject* get_object(T& x); + }; + + template + struct value_arg_to_python : arg_to_python_base + { + // Throw an exception if the conversion can't succeed + value_arg_to_python(T const&); + }; + + template + struct pointer_deep_arg_to_python : arg_to_python_base + { + // Throw an exception if the conversion can't succeed + pointer_deep_arg_to_python(Ptr); + }; + + template + struct pointer_shallow_arg_to_python : handle<> + { + // Throw an exception if the conversion can't succeed + pointer_shallow_arg_to_python(Ptr); + private: + static PyObject* get_object(Ptr p); + }; + + // Convert types that manage a Python object to_python + template + struct object_manager_arg_to_python + { + object_manager_arg_to_python(T const& x) : m_src(x) {} + + PyObject* get() const + { + return python::upcast(get_managed_object(m_src, tag)); + } + + private: + T const& m_src; + }; + + template + struct select_arg_to_python + { + typedef typename unwrap_reference::type unwrapped_referent; + typedef typename unwrap_pointer::type unwrapped_ptr; + + typedef typename mpl::if_< + // Special handling for char const[N]; interpret them as char + // const* for the sake of conversion + python::detail::is_string_literal + , arg_to_python + + , typename mpl::if_< + python::detail::value_is_shared_ptr + , shared_ptr_arg_to_python + + , typename mpl::if_< + mpl::or_< + boost::python::detail::is_function + , indirect_traits::is_pointer_to_function + , boost::python::detail::is_member_function_pointer + > + , function_arg_to_python + + , typename mpl::if_< + is_object_manager + , object_manager_arg_to_python + + , typename mpl::if_< + boost::python::detail::is_pointer + , pointer_deep_arg_to_python + + , typename mpl::if_< + is_pointer_wrapper + , pointer_shallow_arg_to_python + + , typename mpl::if_< + is_reference_wrapper + , reference_arg_to_python + , value_arg_to_python + >::type + >::type + >::type + >::type + >::type + >::type + >::type + + type; + }; +} + +template +struct arg_to_python + : detail::select_arg_to_python::type +{ + typedef typename detail::select_arg_to_python::type base; + public: // member functions + // Throw an exception if the conversion can't succeed + arg_to_python(T const& x); +}; + +// +// implementations +// +namespace detail +{ + // reject_raw_object_ptr -- cause a compile-time error if the user + // should pass a raw Python object pointer + using python::detail::yes_convertible; + using python::detail::no_convertible; + using python::detail::unspecialized; + + template struct cannot_convert_raw_PyObject; + + template + struct reject_raw_object_helper + { + static void error(Convertibility) + { + cannot_convert_raw_PyObject::to_python_use_handle_instead(); + } + static void error(...) {} + }; + + template + inline void reject_raw_object_ptr(T*) + { + reject_raw_object_helper::error( + python::detail::convertible::check((T*)0)); + + typedef typename remove_cv::type value_type; + + reject_raw_object_helper::error( + python::detail::convertible::check( + (base_type_traits*)0 + )); + } + // --------- + + template + inline function_arg_to_python::function_arg_to_python(T const& x) + : handle<>(python::objects::make_function_handle(x)) + { + } + + template + inline value_arg_to_python::value_arg_to_python(T const& x) + : arg_to_python_base(&x, registered::converters) + { + } + + template + inline pointer_deep_arg_to_python::pointer_deep_arg_to_python(Ptr x) + : arg_to_python_base(x, registered_pointee::converters) + { + detail::reject_raw_object_ptr((Ptr)0); + } + + template + inline PyObject* reference_arg_to_python::get_object(T& x) + { + to_python_indirect convert; + return convert(x); + } + + template + inline reference_arg_to_python::reference_arg_to_python(T& x) + : handle<>(reference_arg_to_python::get_object(x)) + { + } + + template + inline shared_ptr_arg_to_python::shared_ptr_arg_to_python(T const& x) + : handle<>(shared_ptr_to_python(x)) + { + } + + template + inline pointer_shallow_arg_to_python::pointer_shallow_arg_to_python(Ptr x) + : handle<>(pointer_shallow_arg_to_python::get_object(x)) + { + detail::reject_raw_object_ptr((Ptr)0); + } + + template + inline PyObject* pointer_shallow_arg_to_python::get_object(Ptr x) + { + to_python_indirect convert; + return convert(x); + } +} + +template +inline arg_to_python::arg_to_python(T const& x) + : base(x) +{} + +}}} // namespace boost::python::converter + +#endif // ARG_TO_PYTHON_DWA200265_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python_base.hpp b/pxr/external/boost/python/converter/arg_to_python_base.hpp new file mode 100644 index 0000000000..c66ce9c3e0 --- /dev/null +++ b/pxr/external/boost/python/converter/arg_to_python_base.hpp @@ -0,0 +1,24 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ARG_TO_PYTHON_BASE_DWA200237_HPP +# define ARG_TO_PYTHON_BASE_DWA200237_HPP +# include + +namespace boost { namespace python { namespace converter { + +struct registration; + +namespace detail +{ + struct BOOST_PYTHON_DECL arg_to_python_base + : handle<> + { + arg_to_python_base(void const volatile* source, registration const&); + }; +} + +}}} // namespace boost::python::converter + +#endif // ARG_TO_PYTHON_BASE_DWA200237_HPP diff --git a/pxr/external/boost/python/converter/as_to_python_function.hpp b/pxr/external/boost/python/converter/as_to_python_function.hpp new file mode 100644 index 0000000000..19a3efaafc --- /dev/null +++ b/pxr/external/boost/python/converter/as_to_python_function.hpp @@ -0,0 +1,49 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef AS_TO_PYTHON_FUNCTION_DWA2002121_HPP +# define AS_TO_PYTHON_FUNCTION_DWA2002121_HPP +# include + +namespace boost { namespace python { namespace converter { + +// Given a typesafe to_python conversion function, produces a +// to_python_function_t which can be registered in the usual way. +template +struct as_to_python_function +{ + // Assertion functions used to prevent wrapping of converters + // which take non-const reference parameters. The T* argument in + // the first overload ensures it isn't used in case T is a + // reference. + template + static void convert_function_must_take_value_or_const_reference(U(*)(T), int, T* = 0) {} + template + static void convert_function_must_take_value_or_const_reference(U(*)(T const&), long ...) {} + + static PyObject* convert(void const* x) + { + convert_function_must_take_value_or_const_reference(&ToPython::convert, 1L); + + // Yes, the const_cast below opens a hole in const-correctness, + // but it's needed to convert auto_ptr to python. + // + // How big a hole is it? It allows ToPython::convert() to be + // a function which modifies its argument. The upshot is that + // client converters applied to const objects may invoke + // undefined behavior. The damage, however, is limited by the + // use of the assertion function. Thus, the only way this can + // modify its argument is if T is an auto_ptr-like type. There + // is still a const-correctness hole w.r.t. auto_ptr const, + // but c'est la vie. + return ToPython::convert(*const_cast(static_cast(x))); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const * get_pytype() { return ToPython::get_pytype(); } +#endif +}; + +}}} // namespace boost::python::converter + +#endif // AS_TO_PYTHON_FUNCTION_DWA2002121_HPP diff --git a/pxr/external/boost/python/converter/builtin_converters.hpp b/pxr/external/boost/python/converter/builtin_converters.hpp new file mode 100644 index 0000000000..c2e01c03d3 --- /dev/null +++ b/pxr/external/boost/python/converter/builtin_converters.hpp @@ -0,0 +1,190 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BUILTIN_CONVERTERS_DWA2002124_HPP +# define BUILTIN_CONVERTERS_DWA2002124_HPP +# include +# include +# include +# include +# include +# include +# include +# include + +// Since all we can use to decide how to convert an object to_python +// is its C++ type, there can be only one such converter for each +// type. Therefore, for built-in conversions we can bypass registry +// lookups using explicit specializations of arg_to_python and +// result_to_python. + +namespace boost { namespace python { + +namespace converter +{ + template struct arg_to_python; + BOOST_PYTHON_DECL PyObject* do_return_to_python(char); + BOOST_PYTHON_DECL PyObject* do_return_to_python(char const*); + BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject*); + BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject*); +} + +// Provide specializations of to_python_value +template struct to_python_value; + +namespace detail +{ + // Since there's no registry lookup, always report the existence of + // a converter. + struct builtin_to_python + { + // This information helps make_getter() decide whether to try to + // return an internal reference or not. I don't like it much, + // but it will have to serve for now. + BOOST_STATIC_CONSTANT(bool, uses_registry = false); + }; +} + +// Use expr to create the PyObject corresponding to x +# define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)\ + template <> struct to_python_value \ + : detail::builtin_to_python \ + { \ + inline PyObject* operator()(T const& x) const \ + { \ + return (expr); \ + } \ + inline PyTypeObject const* get_pytype() const \ + { \ + return (pytype); \ + } \ + }; \ + template <> struct to_python_value \ + : detail::builtin_to_python \ + { \ + inline PyObject* operator()(T const& x) const \ + { \ + return (expr); \ + } \ + inline PyTypeObject const* get_pytype() const \ + { \ + return (pytype); \ + } \ + }; + +# define BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T, expr) \ + namespace converter \ + { \ + template <> struct arg_to_python< T > \ + : handle<> \ + { \ + arg_to_python(T const& x) \ + : python::handle<>(expr) {} \ + }; \ + } + +// Specialize argument and return value converters for T using expr +# define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \ + BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T,expr, pytype) \ + BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr) + +// Specialize converters for signed and unsigned T to Python Int +#if PY_VERSION_HEX >= 0x03000000 + +# define BOOST_PYTHON_TO_INT(T) \ + BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyLong_FromLong(x), &PyLong_Type) \ + BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned T, ::PyLong_FromUnsignedLong(x), &PyLong_Type) + +#else + +# define BOOST_PYTHON_TO_INT(T) \ + BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyInt_FromLong(x), &PyInt_Type) \ + BOOST_PYTHON_TO_PYTHON_BY_VALUE( \ + unsigned T \ + , static_cast(x) > static_cast( \ + (std::numeric_limits::max)()) \ + ? ::PyLong_FromUnsignedLong(x) \ + : ::PyInt_FromLong(x), &PyInt_Type) +#endif + +// Bool is not signed. +#if PY_VERSION_HEX >= 0x02030000 +BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyBool_FromLong(x), &PyBool_Type) +#else +BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyInt_FromLong(x), &PyInt_Type) +#endif + +// note: handles signed char and unsigned char, but not char (see below) +BOOST_PYTHON_TO_INT(char) + +BOOST_PYTHON_TO_INT(short) +BOOST_PYTHON_TO_INT(int) +BOOST_PYTHON_TO_INT(long) + +# if defined(_MSC_VER) && defined(_WIN64) && PY_VERSION_HEX < 0x03000000 +/* Under 64-bit Windows std::size_t is "unsigned long long". To avoid + getting a Python long for each std::size_t the value is checked before + the conversion. A std::size_t is converted to a simple Python int + if possible; a Python long appears only if the value is too small or + too large to fit into a simple int. */ +BOOST_PYTHON_TO_PYTHON_BY_VALUE( + signed BOOST_PYTHON_LONG_LONG, + ( x < static_cast( + (std::numeric_limits::min)()) + || x > static_cast( + (std::numeric_limits::max)())) + ? ::PyLong_FromLongLong(x) + : ::PyInt_FromLong(static_cast(x)), &PyInt_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE( + unsigned BOOST_PYTHON_LONG_LONG, + x > static_cast( + (std::numeric_limits::max)()) + ? ::PyLong_FromUnsignedLongLong(x) + : ::PyInt_FromLong(static_cast(x)), &PyInt_Type) +// +# elif defined(HAVE_LONG_LONG) // using Python's macro instead of Boost's + // - we don't seem to get the config right + // all the time. +BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed BOOST_PYTHON_LONG_LONG, ::PyLong_FromLongLong(x), &PyLong_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned BOOST_PYTHON_LONG_LONG, ::PyLong_FromUnsignedLongLong(x), &PyLong_Type) +# endif + +# undef BOOST_TO_PYTHON_INT + +#if PY_VERSION_HEX >= 0x03000000 +BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyUnicode_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyUnicode_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyUnicode_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyUnicode_Type) +#else +BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyString_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyString_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyString_Type) +#endif + +#if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast(x.size())), &PyUnicode_Type) +# endif +BOOST_PYTHON_TO_PYTHON_BY_VALUE(float, ::PyFloat_FromDouble(x), &PyFloat_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(double, ::PyFloat_FromDouble(x), &PyFloat_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(long double, ::PyFloat_FromDouble(x), &PyFloat_Type) +BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(PyObject*, converter::do_return_to_python(x), 0) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) + +# undef BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE +# undef BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE +# undef BOOST_PYTHON_TO_PYTHON_BY_VALUE +# undef BOOST_PYTHON_TO_INT + +namespace converter +{ + + void initialize_builtin_converters(); + +} + +}} // namespace boost::python::converter + +#endif // BUILTIN_CONVERTERS_DWA2002124_HPP diff --git a/pxr/external/boost/python/converter/constructor_function.hpp b/pxr/external/boost/python/converter/constructor_function.hpp new file mode 100644 index 0000000000..814aa7d763 --- /dev/null +++ b/pxr/external/boost/python/converter/constructor_function.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CONSTRUCTOR_FUNCTION_DWA200278_HPP +# define CONSTRUCTOR_FUNCTION_DWA200278_HPP + +namespace boost { namespace python { namespace converter { + +// Declares the type of functions used to construct C++ objects for +// rvalue from_python conversions. +struct rvalue_from_python_stage1_data; +typedef void (*constructor_function)(PyObject* source, rvalue_from_python_stage1_data*); + +}}} // namespace boost::python::converter + +#endif // CONSTRUCTOR_FUNCTION_DWA200278_HPP diff --git a/pxr/external/boost/python/converter/context_result_converter.hpp b/pxr/external/boost/python/converter/context_result_converter.hpp new file mode 100644 index 0000000000..beb7e9f098 --- /dev/null +++ b/pxr/external/boost/python/converter/context_result_converter.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CONTEXT_RESULT_CONVERTER_DWA2003917_HPP +# define CONTEXT_RESULT_CONVERTER_DWA2003917_HPP + +namespace boost { namespace python { namespace converter { + +// A ResultConverter base class used to indicate that this result +// converter should be constructed with the original Python argument +// list. +struct context_result_converter {}; + +}}} // namespace boost::python::converter + +#endif // CONTEXT_RESULT_CONVERTER_DWA2003917_HPP diff --git a/pxr/external/boost/python/converter/convertible_function.hpp b/pxr/external/boost/python/converter/convertible_function.hpp new file mode 100644 index 0000000000..4b29fbb00b --- /dev/null +++ b/pxr/external/boost/python/converter/convertible_function.hpp @@ -0,0 +1,14 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CONVERTIBLE_FUNCTION_DWA200278_HPP +# define CONVERTIBLE_FUNCTION_DWA200278_HPP + +namespace boost { namespace python { namespace converter { + +typedef void* (*convertible_function)(PyObject*); + +}}} // namespace boost::python::converter + +#endif // CONVERTIBLE_FUNCTION_DWA200278_HPP diff --git a/pxr/external/boost/python/converter/from_python.hpp b/pxr/external/boost/python/converter/from_python.hpp new file mode 100644 index 0000000000..b2f24b3519 --- /dev/null +++ b/pxr/external/boost/python/converter/from_python.hpp @@ -0,0 +1,41 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FIND_FROM_PYTHON_DWA2002223_HPP +# define FIND_FROM_PYTHON_DWA2002223_HPP + +# include +# include + +namespace boost { namespace python { namespace converter { + +struct registration; + + +BOOST_PYTHON_DECL void* get_lvalue_from_python( + PyObject* source, registration const&); + +BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( + PyObject* source, registration const&); + +BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( + PyObject* source, registration const&); + +BOOST_PYTHON_DECL void* rvalue_from_python_stage2( + PyObject* source, rvalue_from_python_stage1_data&, registration const&); + +BOOST_PYTHON_DECL void* rvalue_result_from_python( + PyObject*, rvalue_from_python_stage1_data&); + +BOOST_PYTHON_DECL void* reference_result_from_python(PyObject*, registration const&); +BOOST_PYTHON_DECL void* pointer_result_from_python(PyObject*, registration const&); + +BOOST_PYTHON_DECL void void_result_from_python(PyObject*); + +BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject*, registration const&); +BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject*, registration const&); + +}}} // namespace boost::python::converter + +#endif // FIND_FROM_PYTHON_DWA2002223_HPP diff --git a/pxr/external/boost/python/converter/implicit.hpp b/pxr/external/boost/python/converter/implicit.hpp new file mode 100644 index 0000000000..8bbbfd5ac1 --- /dev/null +++ b/pxr/external/boost/python/converter/implicit.hpp @@ -0,0 +1,46 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IMPLICIT_DWA2002326_HPP +# define IMPLICIT_DWA2002326_HPP + +# include +# include +# include + +# include + +namespace boost { namespace python { namespace converter { + +template +struct implicit +{ + static void* convertible(PyObject* obj) + { + // Find a converter which can produce a Source instance from + // obj. The user has told us that Source can be converted to + // Target, and instantiating construct() below, ensures that + // at compile-time. + return implicit_rvalue_convertible_from_python(obj, registered::converters) + ? obj : 0; + } + + static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) + { + void* storage = ((rvalue_from_python_storage*)data)->storage.bytes; + + arg_from_python get_source(obj); + bool convertible = get_source.convertible(); + BOOST_VERIFY(convertible); + + new (storage) Target(get_source()); + + // record successful construction + data->convertible = storage; + } +}; + +}}} // namespace boost::python::converter + +#endif // IMPLICIT_DWA2002326_HPP diff --git a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp new file mode 100644 index 0000000000..5132804082 --- /dev/null +++ b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp @@ -0,0 +1,121 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP +# define OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP + +# include +# include +# include +# include +# include +# include +# include + +// +// arg_from_python converters for Python type wrappers, to be used as +// base classes for specializations. +// +namespace boost { namespace python { namespace converter { + +template +struct object_manager_value_arg_from_python +{ + typedef T result_type; + + object_manager_value_arg_from_python(PyObject*); + bool convertible() const; + T operator()() const; + private: + PyObject* m_source; +}; + +// Used for converting reference-to-object-manager arguments from +// python. The process used here is a little bit odd. Upon +// construction, we build the object manager object in the m_result +// object, *forcing* it to accept the source Python object by casting +// its pointer to detail::borrowed_reference. This is supposed to +// bypass any type checking of the source object. The convertible +// check then extracts the owned object and checks it. If the check +// fails, nothing else in the program ever gets to touch this strange +// "forced" object. +template +struct object_manager_ref_arg_from_python +{ + typedef Ref result_type; + + object_manager_ref_arg_from_python(PyObject*); + bool convertible() const; + Ref operator()() const; + ~object_manager_ref_arg_from_python(); + private: + typename python::detail::referent_storage::type m_result; +}; + +// +// implementations +// + +template +inline object_manager_value_arg_from_python::object_manager_value_arg_from_python(PyObject* x) + : m_source(x) +{ +} + +template +inline bool object_manager_value_arg_from_python::convertible() const +{ + return object_manager_traits::check(m_source); +} + +template +inline T object_manager_value_arg_from_python::operator()() const +{ + return T(python::detail::borrowed_reference(m_source)); +} + +template +inline object_manager_ref_arg_from_python::object_manager_ref_arg_from_python(PyObject* x) +{ +# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243 + // needed for warning suppression + python::detail::borrowed_reference x_ = python::detail::borrowed_reference(x); + python::detail::construct_referent(m_result.bytes, x_); +# else + python::detail::construct_referent(m_result.bytes, (python::detail::borrowed_reference)x); +# endif +} + +template +inline object_manager_ref_arg_from_python::~object_manager_ref_arg_from_python() +{ + python::detail::destroy_referent(this->m_result.bytes); +} + +namespace detail +{ + template + inline bool object_manager_ref_check(T const& x) + { + return object_manager_traits::check(get_managed_object(x, tag)); + } +} + +template +inline bool object_manager_ref_arg_from_python::convertible() const +{ + return detail::object_manager_ref_check( + python::detail::void_ptr_to_reference(this->m_result.bytes, (Ref(*)())0)); +} + +template +inline Ref object_manager_ref_arg_from_python::operator()() const +{ + return python::detail::void_ptr_to_reference( + this->m_result.bytes, (Ref(*)())0); +} + +}}} // namespace boost::python::converter + +#endif // OBJ_MGR_ARG_FROM_PYTHON_DWA2002628_HPP diff --git a/pxr/external/boost/python/converter/object_manager.hpp b/pxr/external/boost/python/converter/object_manager.hpp new file mode 100644 index 0000000000..b2271a7ea2 --- /dev/null +++ b/pxr/external/boost/python/converter/object_manager.hpp @@ -0,0 +1,156 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_MANAGER_DWA2002614_HPP +# define OBJECT_MANAGER_DWA2002614_HPP + +# include +# include +# include +# include +# include +# include +# include + +// Facilities for dealing with types which always manage Python +// objects. Some examples are object, list, str, et. al. Different +// to_python/from_python conversion rules apply here because in +// contrast to other types which are typically embedded inside a +// Python object, these are wrapped around a Python object. For most +// object managers T, a C++ non-const T reference argument does not +// imply the existence of a T lvalue embedded in the corresponding +// Python argument, since mutating member functions on T actually only +// modify the held Python object. +// +// handle is an object manager, though strictly speaking it should +// not be. In other words, even though mutating member functions of +// hanlde actually modify the handle and not the T object, +// handle& arguments of wrapped functions will bind to "rvalues" +// wrapping the actual Python argument, just as with other object +// manager classes. Making an exception for handle is simply not +// worth the trouble. +// +// borrowed cv* is an object manager so that we can use the general +// to_python mechanisms to convert raw Python object pointers to +// python, without the usual semantic problems of using raw pointers. + + +// Object Manager Concept requirements: +// +// T is an Object Manager +// p is a PyObject* +// x is a T +// +// * object_manager_traits::is_specialized == true +// +// * T(detail::borrowed_reference(p)) +// Manages p without checking its type +// +// * get_managed_object(x, boost::python::tag) +// Convertible to PyObject* +// +// Additional requirements if T can be converted from_python: +// +// * T(object_manager_traits::adopt(p)) +// steals a reference to p, or throws a TypeError exception if +// p doesn't have an appropriate type. May assume p is non-null +// +// * X::check(p) +// convertible to bool. True iff T(X::construct(p)) will not +// throw. + +// Forward declarations +// +namespace boost { namespace python +{ + namespace api + { + class object; + } +}} + +namespace boost { namespace python { namespace converter { + + +// Specializations for handle +template +struct handle_object_manager_traits + : pyobject_traits +{ + private: + typedef pyobject_traits base; + + public: + BOOST_STATIC_CONSTANT(bool, is_specialized = true); + + // Initialize with a null_ok pointer for efficiency, bypassing the + // null check since the source is always non-null. + static null_ok* adopt(PyObject* p) + { + return python::allow_null(base::checked_downcast(p)); + } +}; + +template +struct default_object_manager_traits +{ + BOOST_STATIC_CONSTANT( + bool, is_specialized = python::detail::is_borrowed_ptr::value + ); +}; + +template +struct object_manager_traits + : mpl::if_c< + is_handle::value + , handle_object_manager_traits + , default_object_manager_traits + >::type +{ +}; + +// +// Traits for detecting whether a type is an object manager or a +// (cv-qualified) reference to an object manager. +// + +template +struct is_object_manager + : mpl::bool_::is_specialized> +{ +}; + +template +struct is_reference_to_object_manager + : mpl::false_ +{ +}; + +template +struct is_reference_to_object_manager + : is_object_manager +{ +}; + +template +struct is_reference_to_object_manager + : is_object_manager +{ +}; + +template +struct is_reference_to_object_manager + : is_object_manager +{ +}; + +template +struct is_reference_to_object_manager + : is_object_manager +{ +}; + +}}} // namespace boost::python::converter + +#endif // OBJECT_MANAGER_DWA2002614_HPP diff --git a/pxr/external/boost/python/converter/pointer_type_id.hpp b/pxr/external/boost/python/converter/pointer_type_id.hpp new file mode 100644 index 0000000000..49eeda42cb --- /dev/null +++ b/pxr/external/boost/python/converter/pointer_type_id.hpp @@ -0,0 +1,68 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef POINTER_TYPE_ID_DWA2002222_HPP +# define POINTER_TYPE_ID_DWA2002222_HPP + +# include +# include + +namespace boost { namespace python { namespace converter { + +namespace detail +{ + template + struct pointer_typeid_select + { + template + static inline type_info execute(T*(*)() = 0) + { + return type_id(); + } + }; + + template <> + struct pointer_typeid_select + { + template + static inline type_info execute(T* const volatile&(*)() = 0) + { + return type_id(); + } + + template + static inline type_info execute(T*volatile&(*)() = 0) + { + return type_id(); + } + + template + static inline type_info execute(T*const&(*)() = 0) + { + return type_id(); + } + + template + static inline type_info execute(T*&(*)() = 0) + { + return type_id(); + } + }; +} + +// Usage: pointer_type_id() +// +// Returns a type_info associated with the type pointed +// to by T, which may be a pointer or a reference to a pointer. +template +type_info pointer_type_id(T(*)() = 0) +{ + return detail::pointer_typeid_select< + boost::python::detail::is_lvalue_reference::value + >::execute((T(*)())0); +} + +}}} // namespace boost::python::converter + +#endif // POINTER_TYPE_ID_DWA2002222_HPP diff --git a/pxr/external/boost/python/converter/pyobject_traits.hpp b/pxr/external/boost/python/converter/pyobject_traits.hpp new file mode 100644 index 0000000000..43e384af8d --- /dev/null +++ b/pxr/external/boost/python/converter/pyobject_traits.hpp @@ -0,0 +1,46 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PYOBJECT_TRAITS_DWA2002720_HPP +# define PYOBJECT_TRAITS_DWA2002720_HPP + +# include +# include + +namespace boost { namespace python { namespace converter { + +template struct pyobject_traits; + +template <> +struct pyobject_traits +{ + // All objects are convertible to PyObject + static bool check(PyObject*) { return true; } + static PyObject* checked_downcast(PyObject* x) { return x; } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const* get_pytype() { return 0; } +#endif +}; + +// +// Specializations +// + +# define BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(T) \ + template <> struct pyobject_traits \ + : pyobject_type {} + +// This is not an exhaustive list; should be expanded. +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Type); +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(List); +#if PY_VERSION_HEX < 0x03000000 +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Int); +#endif +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Long); +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Dict); +BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Tuple); + +}}} // namespace boost::python::converter + +#endif // PYOBJECT_TRAITS_DWA2002720_HPP diff --git a/pxr/external/boost/python/converter/pyobject_type.hpp b/pxr/external/boost/python/converter/pyobject_type.hpp new file mode 100644 index 0000000000..bde39e8057 --- /dev/null +++ b/pxr/external/boost/python/converter/pyobject_type.hpp @@ -0,0 +1,40 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PYOBJECT_TYPE_DWA2002720_HPP +# define PYOBJECT_TYPE_DWA2002720_HPP + +# include + +namespace boost { namespace python { namespace converter { + +BOOST_PYTHON_DECL inline +PyObject* checked_downcast_impl(PyObject *obj, PyTypeObject *type) +{ + return (PyType_IsSubtype(Py_TYPE(obj), type) ? obj : NULL); +} +// Used as a base class for specializations which need to provide +// Python type checking capability. +template +struct pyobject_type +{ + static bool check(PyObject* x) + { + return ::PyObject_IsInstance(x, (PyObject*)pytype); + } + + static Object* checked_downcast(PyObject* x) + { + return python::downcast( + (checked_downcast_impl)(x, pytype) + ); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const* get_pytype() { return pytype; } +#endif +}; + +}}} // namespace boost::python::converter + +#endif // PYOBJECT_TYPE_DWA2002720_HPP diff --git a/pxr/external/boost/python/converter/pytype_function.hpp b/pxr/external/boost/python/converter/pytype_function.hpp new file mode 100644 index 0000000000..8e0a4e7995 --- /dev/null +++ b/pxr/external/boost/python/converter/pytype_function.hpp @@ -0,0 +1,133 @@ +// Copyright David Abrahams 2002, Nikolay Mladenov 2007. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef WRAP_PYTYPE_NM20070606_HPP +# define WRAP_PYTYPE_NM20070606_HPP + +# include +# include +# include +# include + + +namespace boost { namespace python { + +namespace converter +{ +template +struct wrap_pytype +{ + static PyTypeObject const* get_pytype() + { + return python_type; + } +}; + +typedef PyTypeObject const* (*pytype_function)(); + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + + + +namespace detail +{ +struct unwind_type_id_helper{ + typedef python::type_info result_type; + template + static result_type execute(U* ){ + return python::type_id(); + } +}; + +template +inline python::type_info unwind_type_id_(boost::type* = 0, mpl::false_ * =0) +{ + return boost::python::detail::unwind_type (); +} + +inline python::type_info unwind_type_id_(boost::type* = 0, mpl::true_* =0) +{ + return type_id(); +} + +template +inline python::type_info unwind_type_id(boost::type* p= 0) +{ + return unwind_type_id_(p, (mpl::bool_::value >*)0 ); +} +} + + +template +struct expected_pytype_for_arg +{ + static PyTypeObject const *get_pytype() + { + const converter::registration *r=converter::registry::query( + detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) + ); + return r ? r->expected_from_python_type(): 0; + } +}; + + +template +struct registered_pytype +{ + static PyTypeObject const *get_pytype() + { + const converter::registration *r=converter::registry::query( + detail::unwind_type_id_((boost::type*) 0, (mpl::bool_::value >*)0 ) + ); + return r ? r->m_class_object: 0; + } +}; + + +template +struct registered_pytype_direct +{ + static PyTypeObject const* get_pytype() + { + return registered::converters.m_class_object; + } +}; + +template +struct expected_from_python_type : expected_pytype_for_arg{}; + +template +struct expected_from_python_type_direct +{ + static PyTypeObject const* get_pytype() + { + return registered::converters.expected_from_python_type(); + } +}; + +template +struct to_python_target_type +{ + static PyTypeObject const *get_pytype() + { + const converter::registration *r=converter::registry::query( + detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) + ); + return r ? r->to_python_target_type(): 0; + } +}; + +template +struct to_python_target_type_direct +{ + static PyTypeObject const *get_pytype() + { + return registered::converters.to_python_target_type(); + } +}; +#endif + +}}} // namespace boost::python + +#endif // WRAP_PYTYPE_NM20070606_HPP diff --git a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp new file mode 100644 index 0000000000..8f5b2b7677 --- /dev/null +++ b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp @@ -0,0 +1,42 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP +# define PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace converter { + +// Provide a forward declaration as a convenience for clients, who all +// need it. +template struct object_manager_traits; + +// Derive specializations of object_manager_traits from this class +// when T is an object manager for a particular Python type hierarchy. +// +template +struct pytype_object_manager_traits + : pyobject_type // provides check() +{ + BOOST_STATIC_CONSTANT(bool, is_specialized = true); + static inline python::detail::new_reference adopt(PyObject*); +}; + +// +// implementations +// +template +inline python::detail::new_reference pytype_object_manager_traits::adopt(PyObject* x) +{ + return python::detail::new_reference(python::pytype_check(pytype, x)); +} + +}}} // namespace boost::python::converter + +#endif // PYTYPE_OBJECT_MANAGER_TRAITS_DWA2002716_HPP diff --git a/pxr/external/boost/python/converter/registered.hpp b/pxr/external/boost/python/converter/registered.hpp new file mode 100644 index 0000000000..98013052ec --- /dev/null +++ b/pxr/external/boost/python/converter/registered.hpp @@ -0,0 +1,124 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_converter_registered_hpp_ +#define boost_python_converter_registered_hpp_ + +#include +#include +#include +#include +#include +#include +#include +#if defined(BOOST_PYTHON_TRACE_REGISTRY) \ + || defined(BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) +# include +#endif + +namespace boost { + +// You'll see shared_ptr mentioned in this header because we need to +// note which types are shared_ptrs in their registrations, to +// implement special shared_ptr handling for rvalue conversions. +template class shared_ptr; + +namespace python { namespace converter { + +struct registration; + +namespace detail +{ + template + struct registered_base + { + static registration const& converters; + }; +} + +template +struct registered + : detail::registered_base< + typename boost::python::detail::add_lvalue_reference< + typename boost::python::detail::add_cv::type + >::type + > +{ +}; + +# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) +// collapses a few more types to the same static instance. MSVC7.1 +// fails to strip cv-qualification from array types in typeid. For +// some reason we can't use this collapse there or array converters +// will not be found. +template +struct registered + : registered {}; +# endif + +// +// implementations +// +namespace detail +{ + inline void + register_shared_ptr0(...) + { + } + + template + inline void + register_shared_ptr0(shared_ptr*) + { + registry::lookup_shared_ptr(type_id >()); + } + +#if !defined(BOOST_NO_CXX11_SMART_PTR) + template + inline void + register_shared_ptr0(std::shared_ptr*) + { + registry::lookup_shared_ptr(type_id >()); + } +#endif + + template + inline void + register_shared_ptr1(T const volatile*) + { + detail::register_shared_ptr0((T*)0); + } + + template + inline registration const& + registry_lookup2(T&(*)()) + { + detail::register_shared_ptr1((T*)0); + return registry::lookup(type_id()); + } + + template + inline registration const& + registry_lookup1(type) + { + return registry_lookup2((T(*)())0); + } + + inline registration const& + registry_lookup1(type) + { + detail::register_shared_ptr1((void*)0); + return registry::lookup(type_id()); + } + + template + registration const& registered_base::converters = detail::registry_lookup1(type()); + +} + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/converter/registered_pointee.hpp b/pxr/external/boost/python/converter/registered_pointee.hpp new file mode 100644 index 0000000000..28b2988c7f --- /dev/null +++ b/pxr/external/boost/python/converter/registered_pointee.hpp @@ -0,0 +1,29 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REGISTERED_POINTEE_DWA2002710_HPP +# define REGISTERED_POINTEE_DWA2002710_HPP +# include +# include +# include +# include + +namespace boost { namespace python { namespace converter { + +struct registration; + +template +struct registered_pointee + : registered< + typename boost::python::detail::remove_pointer< + typename boost::python::detail::remove_cv< + typename boost::python::detail::remove_reference::type + >::type + >::type + > +{ +}; +}}} // namespace boost::python::converter + +#endif // REGISTERED_POINTEE_DWA2002710_HPP diff --git a/pxr/external/boost/python/converter/registrations.hpp b/pxr/external/boost/python/converter/registrations.hpp new file mode 100644 index 0000000000..7ef74e8f40 --- /dev/null +++ b/pxr/external/boost/python/converter/registrations.hpp @@ -0,0 +1,99 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REGISTRATIONS_DWA2002223_HPP +# define REGISTRATIONS_DWA2002223_HPP + +# include + +# include + +# include +# include +# include + +# include + +namespace boost { namespace python { namespace converter { + +struct lvalue_from_python_chain +{ + convertible_function convert; + lvalue_from_python_chain* next; +}; + +struct rvalue_from_python_chain +{ + convertible_function convertible; + constructor_function construct; + PyTypeObject const* (*expected_pytype)(); + rvalue_from_python_chain* next; +}; + +struct BOOST_PYTHON_DECL registration +{ + public: // member functions + explicit registration(type_info target, bool is_shared_ptr = false); + ~registration(); + + // Convert the appropriately-typed data to Python + PyObject* to_python(void const volatile*) const; + + // Return the class object, or raise an appropriate Python + // exception if no class has been registered. + PyTypeObject* get_class_object() const; + + // Return common denominator of the python class objects, + // convertable to target. Inspects the m_class_object and the value_chains. + PyTypeObject const* expected_from_python_type() const; + PyTypeObject const* to_python_target_type() const; + + public: // data members. So sue me. + const python::type_info target_type; + + // The chain of eligible from_python converters when an lvalue is required + lvalue_from_python_chain* lvalue_chain; + + // The chain of eligible from_python converters when an rvalue is acceptable + rvalue_from_python_chain* rvalue_chain; + + // The class object associated with this type + PyTypeObject* m_class_object; + + // The unique to_python converter for the associated C++ type. + to_python_function_t m_to_python; + PyTypeObject const* (*m_to_python_target_type)(); + + + // True iff this type is a shared_ptr. Needed for special rvalue + // from_python handling. + const bool is_shared_ptr; + +# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + private: + void operator=(registration); // This is not defined, and just keeps MWCW happy. +# endif +}; + +// +// implementations +// +inline registration::registration(type_info target_type, bool is_shared_ptr) + : target_type(target_type) + , lvalue_chain(0) + , rvalue_chain(0) + , m_class_object(0) + , m_to_python(0) + , m_to_python_target_type(0) + , is_shared_ptr(is_shared_ptr) +{} + +inline bool operator<(registration const& lhs, registration const& rhs) +{ + return lhs.target_type < rhs.target_type; +} + +}}} // namespace boost::python::converter + +#endif // REGISTRATIONS_DWA2002223_HPP diff --git a/pxr/external/boost/python/converter/registry.hpp b/pxr/external/boost/python/converter/registry.hpp new file mode 100644 index 0000000000..368adcc61d --- /dev/null +++ b/pxr/external/boost/python/converter/registry.hpp @@ -0,0 +1,55 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REGISTRY_DWA20011127_HPP +# define REGISTRY_DWA20011127_HPP +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace converter { + +struct registration; + +// This namespace acts as a sort of singleton +namespace registry +{ + // Get the registration corresponding to the type, creating it if necessary + BOOST_PYTHON_DECL registration const& lookup(type_info); + + // Get the registration corresponding to the type, creating it if + // necessary. Use this first when the type is a shared_ptr. + BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info); + + // Return a pointer to the corresponding registration, if one exists + BOOST_PYTHON_DECL registration const* query(type_info); + + BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0); + + // Insert an lvalue from_python converter + BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0); + + // Insert an rvalue from_python converter + BOOST_PYTHON_DECL void insert( + convertible_function + , constructor_function + , type_info + , PyTypeObject const* (*expected_pytype)() = 0 + ); + + // Insert an rvalue from_python converter at the tail of the + // chain. Used for implicit conversions + BOOST_PYTHON_DECL void push_back( + convertible_function + , constructor_function + , type_info + , PyTypeObject const* (*expected_pytype)() = 0 + ); +} + +}}} // namespace boost::python::converter + +#endif // REGISTRY_DWA20011127_HPP diff --git a/pxr/external/boost/python/converter/return_from_python.hpp b/pxr/external/boost/python/converter/return_from_python.hpp new file mode 100644 index 0000000000..a995a2905a --- /dev/null +++ b/pxr/external/boost/python/converter/return_from_python.hpp @@ -0,0 +1,162 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RETURN_FROM_PYTHON_DWA200265_HPP +# define RETURN_FROM_PYTHON_DWA200265_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace converter { + +template struct is_object_manager; + +namespace detail +{ + template + struct return_pointer_from_python + { + typedef T result_type; + T operator()(PyObject*) const; + }; + + template + struct return_reference_from_python + { + typedef T result_type; + T operator()(PyObject*) const; + }; + + template + struct return_rvalue_from_python + { + typedef T result_type; + + return_rvalue_from_python(); + result_type operator()(PyObject*); + private: + rvalue_from_python_data m_data; + }; + + template + struct return_object_manager_from_python + { + typedef T result_type; + result_type operator()(PyObject*) const; + }; + + template + struct select_return_from_python + { + BOOST_STATIC_CONSTANT( + bool, obj_mgr = is_object_manager::value); + + BOOST_STATIC_CONSTANT( + bool, ptr = is_pointer::value); + + BOOST_STATIC_CONSTANT( + bool, ref = is_reference::value); + + typedef typename mpl::if_c< + obj_mgr + , return_object_manager_from_python + , typename mpl::if_c< + ptr + , return_pointer_from_python + , typename mpl::if_c< + ref + , return_reference_from_python + , return_rvalue_from_python + >::type + >::type + >::type type; + }; +} + +template +struct return_from_python + : detail::select_return_from_python::type +{ +}; + +// Specialization as a convenience for call and call_method +template <> +struct return_from_python +{ + typedef python::detail::returnable::type result_type; + + result_type operator()(PyObject* x) const + { + (void_result_from_python)(x); +# ifdef BOOST_NO_VOID_RETURNS + return result_type(); +# endif + } +}; + +// +// Implementations +// +namespace detail +{ + template + inline return_rvalue_from_python::return_rvalue_from_python() + : m_data( + const_cast(®istered::converters) + ) + { + } + + template + inline typename return_rvalue_from_python::result_type + return_rvalue_from_python::operator()(PyObject* obj) + { + // Take possession of the source object here. If the result is in + // fact going to be a copy of an lvalue embedded in the object, + // and we take possession inside rvalue_result_from_python, it + // will be destroyed too early. + handle<> holder(obj); + + return *(T*) + (rvalue_result_from_python)(obj, m_data.stage1); + } + + template + inline T return_reference_from_python::operator()(PyObject* obj) const + { + return python::detail::void_ptr_to_reference( + (reference_result_from_python)(obj, registered::converters) + , (T(*)())0); + } + + template + inline T return_pointer_from_python::operator()(PyObject* obj) const + { + return T( + (pointer_result_from_python)(obj, registered_pointee::converters) + ); + } + + template + inline T return_object_manager_from_python::operator()(PyObject* obj) const + { + return T( + object_manager_traits::adopt(expect_non_null(obj)) + ); + } +} + +}}} // namespace boost::python::converter + +#endif // RETURN_FROM_PYTHON_DWA200265_HPP diff --git a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp new file mode 100644 index 0000000000..d728681b3e --- /dev/null +++ b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp @@ -0,0 +1,147 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FROM_PYTHON_AUX_DATA_DWA2002128_HPP +# define FROM_PYTHON_AUX_DATA_DWA2002128_HPP + +# include +# include +# include +# include +# include +# include +# include + +// Data management for potential rvalue conversions from Python to C++ +// types. When a client requests a conversion to T* or T&, we +// generally require that an object of type T exists in the source +// Python object, and the code here does not apply**. This implements +// conversions which may create new temporaries of type T. The classic +// example is a conversion which converts a Python tuple to a +// std::vector. Since no std::vector lvalue exists in the Python +// object -- it must be created "on-the-fly" by the converter, and +// which must manage the lifetime of the created object. +// +// Note that the client is not precluded from using a registered +// lvalue conversion to T in this case. In other words, we will +// happily accept a Python object which /does/ contain a std::vector +// lvalue, provided an appropriate converter is registered. So, while +// this is an rvalue conversion from the client's point-of-view, the +// converter registry may serve up lvalue or rvalue conversions for +// the target type. +// +// ** C++ argument from_python conversions to T const& are an +// exception to the rule for references: since in C++, const +// references can bind to temporary rvalues, we allow rvalue +// converters to be chosen when the target type is T const& for some +// T. +namespace boost { namespace python { namespace converter { + +// Conversions begin by filling in and returning a copy of this +// structure. The process looks up a converter in the rvalue converter +// registry for the target type. It calls the convertible() function +// of each registered converter, passing the source PyObject* as an +// argument, until a non-null result is returned. This result goes in +// the convertible field, and the converter's construct() function is +// stored in the construct field. +// +// If no appropriate converter is found, conversion fails and the +// convertible field is null. When used in argument conversion for +// wrapped C++ functions, it causes overload resolution to reject the +// current function but not to fail completely. If an exception is +// thrown, overload resolution stops and the exception propagates back +// through the caller. +// +// If an lvalue converter is matched, its convertible() function is +// expected to return a pointer to the stored T object; its +// construct() function will be NULL. The convertible() function of +// rvalue converters may return any non-singular pointer; the actual +// target object will only be available once the converter's +// construct() function is called. +struct rvalue_from_python_stage1_data +{ + void* convertible; + constructor_function construct; +}; + +// Augments rvalue_from_python_stage1_data by adding storage for +// constructing an object of remove_reference::type. The +// construct() function of rvalue converters (stored in m_construct +// above) will cast the rvalue_from_python_stage1_data to an +// appropriate instantiation of this template in order to access that +// storage. +template +struct rvalue_from_python_storage +{ + rvalue_from_python_stage1_data stage1; + + // Storage for the result, in case an rvalue must be constructed + typename python::detail::referent_storage< + typename boost::python::detail::add_lvalue_reference::type + >::type storage; +}; + +// Augments rvalue_from_python_storage with a destructor. If +// stage1.convertible == storage.bytes, it indicates that an object of +// remove_reference::type has been constructed in storage and +// should will be destroyed in ~rvalue_from_python_data(). It is +// crucial that successful rvalue conversions establish this equality +// and that unsuccessful ones do not. +template +struct rvalue_from_python_data : rvalue_from_python_storage +{ +# if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) \ + && (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) \ + && (!defined(__DECCXX_VER) || __DECCXX_VER > 60590014) \ + && !defined(BOOST_PYTHON_SYNOPSIS) /* Synopsis' OpenCXX has trouble parsing this */ + // This must always be a POD struct with m_data its first member. + BOOST_STATIC_ASSERT(BOOST_PYTHON_OFFSETOF(rvalue_from_python_storage,stage1) == 0); +# endif + + // The usual constructor + rvalue_from_python_data(rvalue_from_python_stage1_data const&); + + // This constructor just sets m_convertible -- used by + // implicitly_convertible<> to perform the final step of the + // conversion, where the construct() function is already known. + rvalue_from_python_data(void* convertible); + + // Destroys any object constructed in the storage. + ~rvalue_from_python_data(); + private: + typedef typename boost::python::detail::add_lvalue_reference< + typename boost::python::detail::add_cv::type>::type ref_type; +}; + +// +// Implementataions +// +template +inline rvalue_from_python_data::rvalue_from_python_data(rvalue_from_python_stage1_data const& _stage1) +{ + this->stage1 = _stage1; +} + +template +inline rvalue_from_python_data::rvalue_from_python_data(void* convertible) +{ + this->stage1.convertible = convertible; +} + +template +inline rvalue_from_python_data::~rvalue_from_python_data() +{ + if (this->stage1.convertible == this->storage.bytes) + { + size_t allocated = sizeof(this->storage); + void *ptr = this->storage.bytes; + void *aligned_storage = + ::boost::alignment::align(boost::python::detail::alignment_of::value, 0, ptr, allocated); + python::detail::destroy_referent(aligned_storage); + } +} + +}}} // namespace boost::python::converter + +#endif // FROM_PYTHON_AUX_DATA_DWA2002128_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp new file mode 100644 index 0000000000..926508d00e --- /dev/null +++ b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp @@ -0,0 +1,22 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SHARED_PTR_DELETER_DWA2002121_HPP +# define SHARED_PTR_DELETER_DWA2002121_HPP + +namespace boost { namespace python { namespace converter { + +struct BOOST_PYTHON_DECL shared_ptr_deleter +{ + shared_ptr_deleter(handle<> owner); + ~shared_ptr_deleter(); + + void operator()(void const*); + + handle<> owner; +}; + +}}} // namespace boost::python::converter + +#endif // SHARED_PTR_DELETER_DWA2002121_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp new file mode 100644 index 0000000000..b5c62ba940 --- /dev/null +++ b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp @@ -0,0 +1,69 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_converter_shared_ptr_from_python_hpp_ +#define boost_python_converter_shared_ptr_from_python_hpp_ + +#include +#include +#include +#include +#include +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif +#include +#include + +namespace boost { namespace python { namespace converter { + +template class SP> +struct shared_ptr_from_python +{ + shared_ptr_from_python() + { + converter::registry::insert(&convertible, &construct, type_id >() +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &converter::expected_from_python_type_direct::get_pytype +#endif + ); + } + + private: + static void* convertible(PyObject* p) + { + if (p == Py_None) + return p; + + return converter::get_lvalue_from_python(p, registered::converters); + } + + static void construct(PyObject* source, rvalue_from_python_stage1_data* data) + { + void* const storage = ((converter::rvalue_from_python_storage >*)data)->storage.bytes; + // Deal with the "None" case. + if (data->convertible == source) + new (storage) SP(); + else + { + void *const storage = ((converter::rvalue_from_python_storage >*)data)->storage.bytes; + // Deal with the "None" case. + if (data->convertible == source) + new (storage) SP(); + else + { + SP hold_convertible_ref_count((void*)0, shared_ptr_deleter(handle<>(borrowed(source))) ); + // use aliasing constructor + new (storage) SP(hold_convertible_ref_count, static_cast(data->convertible)); + } + } + data->convertible = storage; + } +}; + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp new file mode 100644 index 0000000000..02649d406e --- /dev/null +++ b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2003. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_converter_shared_ptr_to_python_hpp_ +#define boost_python_converter_shared_ptr_to_python_hpp_ + +#include +#include +#include +#include + +namespace boost { namespace python { namespace converter { + +template +PyObject* shared_ptr_to_python(shared_ptr const& x) +{ + if (!x) + return python::detail::none(); + else if (shared_ptr_deleter* d = boost::get_deleter(x)) + return incref( get_pointer( d->owner ) ); + else + return converter::registered const&>::converters.to_python(&x); +} + +#if !defined(BOOST_NO_CXX11_SMART_PTR) +template +PyObject* shared_ptr_to_python(std::shared_ptr const& x) +{ + if (!x) + return python::detail::none(); + else if (shared_ptr_deleter* d = std::get_deleter(x)) + return incref(get_pointer(d->owner)); + else + return converter::registered const&>::converters.to_python(&x); +} +#endif + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/converter/to_python_function_type.hpp b/pxr/external/boost/python/converter/to_python_function_type.hpp new file mode 100644 index 0000000000..cccd014d68 --- /dev/null +++ b/pxr/external/boost/python/converter/to_python_function_type.hpp @@ -0,0 +1,19 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TO_PYTHON_FUNCTION_TYPE_DWA200236_HPP +# define TO_PYTHON_FUNCTION_TYPE_DWA200236_HPP +# include +# include + +namespace boost { namespace python { namespace converter { + +// The type of stored function pointers which actually do conversion +// by-value. The void* points to the object to be converted, and +// type-safety is preserved through runtime registration. +typedef PyObject* (*to_python_function_t)(void const*); + +}}} // namespace boost::python::converter + +#endif // TO_PYTHON_FUNCTION_TYPE_DWA200236_HPP diff --git a/pxr/external/boost/python/copy_const_reference.hpp b/pxr/external/boost/python/copy_const_reference.hpp new file mode 100644 index 0000000000..55bede136f --- /dev/null +++ b/pxr/external/boost/python/copy_const_reference.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef COPY_CONST_REFERENCE_DWA2002131_HPP +# define COPY_CONST_REFERENCE_DWA2002131_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct copy_const_reference_expects_a_const_reference_return_type +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +template struct to_python_value; + +struct copy_const_reference +{ + template + struct apply + { + typedef typename mpl::if_c< + indirect_traits::is_reference_to_const::value + , to_python_value + , detail::copy_const_reference_expects_a_const_reference_return_type + >::type type; + }; +}; + + +}} // namespace boost::python + +#endif // COPY_CONST_REFERENCE_DWA2002131_HPP diff --git a/pxr/external/boost/python/copy_non_const_reference.hpp b/pxr/external/boost/python/copy_non_const_reference.hpp new file mode 100644 index 0000000000..15fef62d67 --- /dev/null +++ b/pxr/external/boost/python/copy_non_const_reference.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef COPY_NON_CONST_REFERENCE_DWA2002131_HPP +# define COPY_NON_CONST_REFERENCE_DWA2002131_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct copy_non_const_reference_expects_a_non_const_reference_return_type +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +template struct to_python_value; + +struct copy_non_const_reference +{ + template + struct apply + { + typedef typename mpl::if_c< + indirect_traits::is_reference_to_non_const::value + , to_python_value + , detail::copy_non_const_reference_expects_a_non_const_reference_return_type + >::type type; + }; +}; + + +}} // namespace boost::python + +#endif // COPY_NON_CONST_REFERENCE_DWA2002131_HPP diff --git a/pxr/external/boost/python/data_members.hpp b/pxr/external/boost/python/data_members.hpp new file mode 100644 index 0000000000..989f7d7f93 --- /dev/null +++ b/pxr/external/boost/python/data_members.hpp @@ -0,0 +1,311 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DATA_MEMBERS_DWA2002328_HPP +# define DATA_MEMBERS_DWA2002328_HPP + +# include + +# include + +# include +# include +# include +# include + +# include + +# include +# include +# include +# include + +# include +# include +# include + +# include + +namespace boost { namespace python { + +// +// This file defines the make_getter and make_setter function +// families, which are responsible for turning pointers, references, +// and pointers-to-data-members into callable Python objects which +// can be used for attribute access on wrapped classes. +// + +namespace detail +{ + + // A small function object which handles the getting and setting of + // data members. + template + struct member + { + public: + member(Data Class::*which) : m_which(which) {} + + Data& operator()(Class& c) const + { + return c.*m_which; + } + + void operator()(Class& c, typename value_arg::type d) const + { + c.*m_which = d; + } + private: + Data Class::*m_which; + }; + + // A small function object which handles the getting and setting of + // non-member objects. + template + struct datum + { + public: + datum(Data *which) : m_which(which) {} + + Data& operator()() const + { + return *m_which; + } + + void operator()(typename value_arg::type d) const + { + *m_which = d; + } + private: + Data *m_which; + }; + + // + // Helper metafunction for determining the default CallPolicy to use + // for attribute access. If T is a [reference to a] class type X + // whose conversion to python would normally produce a new copy of X + // in a wrapped X class instance (as opposed to types such as + // std::string, which are converted to native Python types, and + // smart pointer types which produce a wrapped class instance of the + // pointee type), to-python conversions will attempt to produce an + // object which refers to the original C++ object, rather than a + // copy. See default_member_getter_policy for rationale. + // + template + struct default_getter_by_ref + : mpl::and_< + mpl::bool_< + to_python_value< + typename value_arg::type + >::uses_registry + > + , indirect_traits::is_reference_to_class< + typename value_arg::type + > + > + { + }; + + // Metafunction computing the default CallPolicy to use for reading + // data members + // + // If it's a regular class type (not an object manager or other + // type for which we have to_python specializations, use + // return_internal_reference so that we can do things like + // x.y.z = 1 + // and get the right result. + template + struct default_member_getter_policy + : mpl::if_< + default_getter_by_ref + , return_internal_reference<> + , return_value_policy + > + {}; + + // Metafunction computing the default CallPolicy to use for reading + // non-member data. + template + struct default_datum_getter_policy + : mpl::if_< + default_getter_by_ref + , return_value_policy + , return_value_policy + > + {}; + + // + // make_getter helper function family -- These helpers to + // boost::python::make_getter are used to dispatch behavior. The + // third argument is a workaround for a CWPro8 partial ordering bug + // with pointers to data members. It should be convertible to + // detail::true_ iff the first argument is a pointer-to-member, and + // detail::false_ otherwise. The fourth argument is for compilers + // which don't support partial ordering at all and should always be + // passed 0L. + + +#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238) + template + inline object make_getter(D& d, P& p, detail::false_, ...); +#endif + + // Handle non-member pointers with policies + template + inline object make_getter(D* d, Policies const& policies, detail::false_, int) + { + return python::make_function( + detail::datum(d), policies, mpl::vector1() + ); + } + + // Handle non-member pointers without policies + template + inline object make_getter(D* d, not_specified, detail::false_, long) + { + typedef typename default_datum_getter_policy::type policies; + return detail::make_getter(d, policies(), detail::false_(), 0); + } + + // Handle pointers-to-members with policies + template + inline object make_getter(D C::*pm, Policies const& policies, detail::true_, int) + { +#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef typename detail::remove_cv::type Class; +#else + typedef C Class; +#endif + return python::make_function( + detail::member(pm) + , policies + , mpl::vector2() + ); + } + + // Handle pointers-to-members without policies + template + inline object make_getter(D C::*pm, not_specified, detail::true_, long) + { + typedef typename default_member_getter_policy::type policies; + return detail::make_getter(pm, policies(), detail::true_(), 0); + } + + // Handle references + template + inline object make_getter(D& d, P& p, detail::false_, ...) + { + // Just dispatch to the handler for pointer types. + return detail::make_getter(&d, p, detail::false_(), 0L); + } + + // + // make_setter helper function family -- These helpers to + // boost::python::make_setter are used to dispatch behavior. The + // third argument is for compilers which don't support partial + // ordering at all and should always be passed 0. + // + + + // Handle non-member pointers + template + inline object make_setter(D* p, Policies const& policies, detail::false_, int) + { + return python::make_function( + detail::datum(p), policies, mpl::vector2() + ); + } + + // Handle pointers-to-members + template + inline object make_setter(D C::*pm, Policies const& policies, detail::true_, int) + { + return python::make_function( + detail::member(pm) + , policies + , mpl::vector3() + ); + } + + // Handle references + template + inline object make_setter(D& x, Policies const& policies, detail::false_, ...) + { + return detail::make_setter(&x, policies, detail::false_(), 0L); + } +} + +// +// make_getter function family -- build a callable object which +// retrieves data through the first argument and is appropriate for +// use as the `get' function in Python properties . The second, +// policies argument, is optional. We need both D& and D const& +// overloads in order be able to handle rvalues. +// +template +inline object make_getter(D& d, Policies const& policies) +{ + return detail::make_getter(d, policies, detail::is_member_pointer(), 0L); +} + +template +inline object make_getter(D const& d, Policies const& policies) +{ + return detail::make_getter(d, policies, detail::is_member_pointer(), 0L); +} + +template +inline object make_getter(D& x) +{ + detail::not_specified policy + = detail::not_specified(); // suppress a SunPro warning + return detail::make_getter(x, policy, detail::is_member_pointer(), 0L); +} + +# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) +template +inline object make_getter(D const& d) +{ + detail::not_specified policy + = detail::not_specified(); // Suppress a SunPro warning + return detail::make_getter(d, policy, detail::is_member_pointer(), 0L); +} +# endif + +// +// make_setter function family -- build a callable object which +// writes data through the first argument and is appropriate for +// use as the `set' function in Python properties . The second, +// policies argument, is optional. We need both D& and D const& +// overloads in order be able to handle rvalues. +// +template +inline object make_setter(D& x, Policies const& policies) +{ + return detail::make_setter(x, policies, detail::is_member_pointer(), 0); +} + +template +inline object make_setter(D const& x, Policies const& policies) +{ + return detail::make_setter(x, policies, detail::is_member_pointer(), 0); +} + +template +inline object make_setter(D& x) +{ + return detail::make_setter(x, default_call_policies(), detail::is_member_pointer(), 0); +} + +# if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) +template +inline object make_setter(D const& x) +{ + return detail::make_setter(x, default_call_policies(), detail::is_member_pointer(), 0); +} +# endif + +}} // namespace boost::python + +#endif // DATA_MEMBERS_DWA2002328_HPP diff --git a/pxr/external/boost/python/def.hpp b/pxr/external/boost/python/def.hpp new file mode 100644 index 0000000000..fe2c65f938 --- /dev/null +++ b/pxr/external/boost/python/def.hpp @@ -0,0 +1,114 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEF_DWA200292_HPP +# define DEF_DWA200292_HPP + +# include + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + namespace error + { + // Compile-time error messages + template struct multiple_functions_passed_to_def; + template <> struct multiple_functions_passed_to_def { typedef char type; }; + } + + // + // def_from_helper -- + // + // Use a def_helper to define a regular wrapped function in the current scope. + template + void def_from_helper( + char const* name, F const& fn, Helper const& helper) + { + // Must not try to use default implementations except with method definitions. + typedef typename error::multiple_functions_passed_to_def< + Helper::has_default_implementation + >::type assertion BOOST_ATTRIBUTE_UNUSED; + + detail::scope_setattr_doc( + name, boost::python::make_function( + fn + , helper.policies() + , helper.keywords()) + , helper.doc() + ); + } + + // + // These two overloads discriminate between def() as applied to + // regular functions and def() as applied to the result of + // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to + // discriminate. + // + template + void + def_maybe_overloads( + char const* name + , Fn fn + , A1 const& a1 + , ...) + { + detail::def_from_helper(name, fn, def_helper(a1)); + } + + template + void def_maybe_overloads( + char const* name + , SigT sig + , StubsT const& stubs + , detail::overloads_base const*) + { + scope current; + + detail::define_with_defaults( + name, stubs, current, detail::get_signature(sig)); + } + + template + object make_function1(T fn, ...) { return make_function(fn); } + + inline + object make_function1(object const& x, object const*) { return x; } +} + +template +void def(char const* name, Fn fn) +{ + detail::scope_setattr_doc(name, detail::make_function1(fn, &fn), 0); +} + +template +void def(char const* name, Arg1T arg1, Arg2T const& arg2) +{ + detail::def_maybe_overloads(name, arg1, arg2, &arg2); +} + +template +void def(char const* name, F f, A1 const& a1, A2 const& a2) +{ + detail::def_from_helper(name, f, detail::def_helper(a1,a2)); +} + +template +void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3) +{ + detail::def_from_helper(name, f, detail::def_helper(a1,a2,a3)); +} + +}} // namespace boost::python + +#endif // DEF_DWA200292_HPP diff --git a/pxr/external/boost/python/def_visitor.hpp b/pxr/external/boost/python/def_visitor.hpp new file mode 100644 index 0000000000..18dd928684 --- /dev/null +++ b/pxr/external/boost/python/def_visitor.hpp @@ -0,0 +1,86 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEF_VISITOR_DWA2003810_HPP +# define DEF_VISITOR_DWA2003810_HPP + +# include +# include + +namespace boost { namespace python { + +template class def_visitor; +template class class_; + +class def_visitor_access +{ +# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \ + || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) + // Tasteless as this may seem, making all members public allows member templates + // to work in the absence of member template friends. + public: +# else + template friend class def_visitor; +# endif + + // unnamed visit, c.f. init<...>, container suites + template + static void visit(V const& v, classT& c) + { + v.derived_visitor().visit(c); + } + + // named visit, c.f. object, pure_virtual + template + static void visit( + V const& v + , classT& c + , char const* name + , OptionalArgs const& options + ) + { + v.derived_visitor().visit(c, name, options); + } + +}; + + +template +class def_visitor +{ + friend class def_visitor_access; + +# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \ + || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551)) + // Tasteless as this may seem, making all members public allows member templates + // to work in the absence of member template friends. + public: +# else + template friend class class_; +# endif + + // unnamed visit, c.f. init<...>, container suites + template + void visit(classT& c) const + { + def_visitor_access::visit(*this, c); + } + + // named visit, c.f. object, pure_virtual + template + void visit(classT& c, char const* name, OptionalArgs const& options) const + { + def_visitor_access::visit(*this, c, name, options); + } + + protected: + DerivedVisitor const& derived_visitor() const + { + return static_cast(*this); + } +}; + +}} // namespace boost::python + +#endif // DEF_VISITOR_DWA2003810_HPP diff --git a/pxr/external/boost/python/default_call_policies.hpp b/pxr/external/boost/python/default_call_policies.hpp new file mode 100644 index 0000000000..c882257348 --- /dev/null +++ b/pxr/external/boost/python/default_call_policies.hpp @@ -0,0 +1,89 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEFAULT_CALL_POLICIES_DWA2002131_HPP +# define DEFAULT_CALL_POLICIES_DWA2002131_HPP + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +template struct to_python_value; + +namespace detail +{ +// for "readable" error messages + template struct specify_a_return_value_policy_to_wrap_functions_returning +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +struct default_result_converter; + +struct default_call_policies +{ + // Ownership of this argument tuple will ultimately be adopted by + // the caller. + template + static bool precall(ArgumentPackage const&) + { + return true; + } + + // Pass the result through + template + static PyObject* postcall(ArgumentPackage const&, PyObject* result) + { + return result; + } + + typedef default_result_converter result_converter; + typedef PyObject* argument_package; + + template + struct extract_return_type : mpl::front + { + }; + +}; + +struct default_result_converter +{ + template + struct apply + { + typedef typename mpl::if_< + mpl::or_, detail::is_reference > + , detail::specify_a_return_value_policy_to_wrap_functions_returning + , boost::python::to_python_value< + typename detail::value_arg::type + > + >::type type; + }; +}; + +// Exceptions for c strings an PyObject*s +template <> +struct default_result_converter::apply +{ + typedef boost::python::to_python_value type; +}; + +template <> +struct default_result_converter::apply +{ + typedef boost::python::to_python_value type; +}; + +}} // namespace boost::python + +#endif // DEFAULT_CALL_POLICIES_DWA2002131_HPP diff --git a/pxr/external/boost/python/detail/aix_init_module.hpp b/pxr/external/boost/python/detail/aix_init_module.hpp new file mode 100644 index 0000000000..9214dbf09b --- /dev/null +++ b/pxr/external/boost/python/detail/aix_init_module.hpp @@ -0,0 +1,26 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef AIX_INIT_MODULE_DWA2002529_HPP +# define AIX_INIT_MODULE_DWA2002529_HPP +# ifdef _AIX +# include +# include +# ifdef __KCC +# include // this works around a problem in KCC 4.0f +# endif + +namespace boost { namespace python { namespace detail { + +extern "C" +{ + typedef PyObject* (*so_load_function)(char*,char*,FILE*); +} + +void aix_init_module(so_load_function, char const* name, void (*init_module)()); + +}}} // namespace boost::python::detail +# endif + +#endif // AIX_INIT_MODULE_DWA2002529_HPP diff --git a/pxr/external/boost/python/detail/api_placeholder.hpp b/pxr/external/boost/python/detail/api_placeholder.hpp new file mode 100644 index 0000000000..5975a13bda --- /dev/null +++ b/pxr/external/boost/python/detail/api_placeholder.hpp @@ -0,0 +1,15 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// DEPRECATED HEADER (2006 Jan 12) +// Provided only for backward compatibility. +// The boost::python::len() function is now defined in object.hpp. + +#ifndef BOOST_PYTHON_API_PLACE_HOLDER_HPP +#define BOOST_PYTHON_API_PLACE_HOLDER_HPP + +#include + +#endif // BOOST_PYTHON_API_PLACE_HOLDER_HPP diff --git a/pxr/external/boost/python/detail/borrowed_ptr.hpp b/pxr/external/boost/python/detail/borrowed_ptr.hpp new file mode 100644 index 0000000000..7d78739ed9 --- /dev/null +++ b/pxr/external/boost/python/detail/borrowed_ptr.hpp @@ -0,0 +1,80 @@ +#ifndef BORROWED_PTR_DWA20020601_HPP +# define BORROWED_PTR_DWA20020601_HPP +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template class borrowed +{ + typedef T type; +}; + +template +struct is_borrowed_ptr +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +# if !defined(__MWERKS__) || __MWERKS__ > 0x3000 +template +struct is_borrowed_ptr*> +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template +struct is_borrowed_ptr const*> +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template +struct is_borrowed_ptr volatile*> +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template +struct is_borrowed_ptr const volatile*> +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; +# else +template +struct is_borrowed +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; +template +struct is_borrowed > +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; +template +struct is_borrowed_ptr + : is_borrowed::type> +{ +}; +# endif + + +} + +template +inline T* get_managed_object(detail::borrowed const volatile* p, tag_t) +{ + return (T*)p; +} + +}} // namespace boost::python::detail + +#endif // #ifndef BORROWED_PTR_DWA20020601_HPP diff --git a/pxr/external/boost/python/detail/caller.hpp b/pxr/external/boost/python/detail/caller.hpp new file mode 100644 index 0000000000..2834d6da99 --- /dev/null +++ b/pxr/external/boost/python/detail/caller.hpp @@ -0,0 +1,270 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef CALLER_DWA20021121_HPP +# define CALLER_DWA20021121_HPP + +# include +# include + +# include + +# include +# include +# include +# include + +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include + +# include + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +inline PyObject* get(mpl::int_, PyObject* const& args_) +{ + return PyTuple_GET_ITEM(args_,N); +} + +inline Py_ssize_t arity(PyObject* const& args_) +{ + return PyTuple_GET_SIZE(args_); +} + +// This "result converter" is really just used as +// a dispatch tag to invoke(...), selecting the appropriate +// implementation +typedef int void_result_to_python; + +// Given a model of CallPolicies and a C++ result type, this +// metafunction selects the appropriate converter to use for +// converting the result to python. +template +struct select_result_converter + : mpl::eval_if< + is_same + , mpl::identity + , mpl::apply1 + > +{ +}; + +template +inline ResultConverter create_result_converter( + ArgPackage const& args_ + , ResultConverter* + , converter::context_result_converter* +) +{ + return ResultConverter(args_); +} + +template +inline ResultConverter create_result_converter( + ArgPackage const& + , ResultConverter* + , ... +) +{ + return ResultConverter(); +} + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +template +struct converter_target_type +{ + static PyTypeObject const *get_pytype() + { + return create_result_converter((PyObject*)0, (ResultConverter *)0, (ResultConverter *)0).get_pytype(); + } +}; + +template < > +struct converter_target_type +{ + static PyTypeObject const *get_pytype() + { + return 0; + } +}; + +// Generation of ret moved from caller_arity::impl::signature to here due to "feature" in MSVC 15.7.2 with /O2 +// which left the ret uninitialized and caused segfaults in Python interpreter. +template const signature_element* get_ret() +{ + typedef BOOST_DEDUCED_TYPENAME Policies::template extract_return_type::type rtype; + typedef typename select_result_converter::type result_converter; + + static const signature_element ret = { + (is_void::value ? "void" : type_id().name()) + , &detail::converter_target_type::get_pytype + , boost::detail::indirect_traits::is_reference_to_non_const::value + }; + + return &ret; +} + +#endif + + +template struct caller_arity; + +template +struct caller; + +# define BOOST_PYTHON_NEXT(init,name,n) \ + typedef BOOST_PP_IF(n,typename mpl::next< BOOST_PP_CAT(name,BOOST_PP_DEC(n)) >::type, init) name##n; + +# define BOOST_PYTHON_ARG_CONVERTER(n) \ + BOOST_PYTHON_NEXT(typename mpl::next::type, arg_iter,n) \ + typedef arg_from_python c_t##n; \ + c_t##n c##n(get(mpl::int_(), inner_args)); \ + if (!c##n.convertible()) \ + return 0; + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY + 1, )) +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_ARG_CONVERTER +# undef BOOST_PYTHON_NEXT + +// A metafunction returning the base class used for caller. +template +struct caller_base_select +{ + enum { arity = mpl::size::value - 1 }; + typedef typename caller_arity::template impl type; +}; + +// A function object type which wraps C++ objects as Python callable +// objects. +// +// Template Arguments: +// +// F - +// the C++ `function object' that will be called. Might +// actually be any data for which an appropriate invoke_tag() can +// be generated. invoke(...) takes care of the actual invocation syntax. +// +// CallPolicies - +// The precall, postcall, and what kind of resultconverter to +// generate for mpl::front::type +// +// Sig - +// The `intended signature' of the function. An MPL sequence +// beginning with a result type and continuing with a list of +// argument types. +template +struct caller + : caller_base_select::type +{ + typedef typename caller_base_select< + F,CallPolicies,Sig + >::type base; + + typedef PyObject* result_type; + + caller(F f, CallPolicies p) : base(f,p) {} + +}; + +}}} // namespace boost::python::detail + +# endif // CALLER_DWA20021121_HPP + +#else + +# define N BOOST_PP_ITERATION() + +template <> +struct caller_arity +{ + template + struct impl + { + impl(F f, Policies p) : m_data(f,p) {} + + PyObject* operator()(PyObject* args_, PyObject*) // eliminate + // this + // trailing + // keyword dict + { + typedef typename mpl::begin::type first; + typedef typename first::type result_t; + typedef typename select_result_converter::type result_converter; + typedef typename Policies::argument_package argument_package; + + argument_package inner_args(args_); + +# if N +# define BOOST_PP_LOCAL_MACRO(i) BOOST_PYTHON_ARG_CONVERTER(i) +# define BOOST_PP_LOCAL_LIMITS (0, N-1) +# include BOOST_PP_LOCAL_ITERATE() +# endif + // all converters have been checked. Now we can do the + // precall part of the policy + if (!m_data.second().precall(inner_args)) + return 0; + + PyObject* result = detail::invoke( + detail::invoke_tag() + , create_result_converter(args_, (result_converter*)0, (result_converter*)0) + , m_data.first() + BOOST_PP_ENUM_TRAILING_PARAMS(N, c) + ); + + return m_data.second().postcall(inner_args, result); + } + + static unsigned min_arity() { return N; } + + static py_func_sig_info signature() + { + const signature_element * sig = detail::signature::elements(); +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + // MSVC 15.7.2, when compiling to /O2 left the static const signature_element ret, + // originally defined here, uninitialized. This in turn led to SegFault in Python interpreter. + // Issue is resolved by moving the generation of ret to separate function in detail namespace (see above). + const signature_element * ret = detail::get_ret(); + + py_func_sig_info res = {sig, ret }; +#else + py_func_sig_info res = {sig, sig }; +#endif + + return res; + } + private: + compressed_pair m_data; + }; +}; + + + +#endif // BOOST_PP_IS_ITERATING + + diff --git a/pxr/external/boost/python/detail/config.hpp b/pxr/external/boost/python/detail/config.hpp new file mode 100644 index 0000000000..8dce9b742e --- /dev/null +++ b/pxr/external/boost/python/detail/config.hpp @@ -0,0 +1,134 @@ +// (C) Copyright David Abrahams 2000. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of Dragon Systems, Inc., in +// producing this work. + +// Revision History: +// 04 Mar 01 Some fixes so it will compile with Intel C++ (Dave Abrahams) + +#ifndef CONFIG_DWA052200_H_ +# define CONFIG_DWA052200_H_ + +# include +# include + +# ifdef BOOST_NO_OPERATORS_IN_NAMESPACE + // A gcc bug forces some symbols into the global namespace +# define BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE +# define BOOST_PYTHON_END_CONVERSION_NAMESPACE +# define BOOST_PYTHON_CONVERSION +# define BOOST_PYTHON_IMPORT_CONVERSION(x) using ::x +# else +# define BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE namespace boost { namespace python { +# define BOOST_PYTHON_END_CONVERSION_NAMESPACE }} // namespace boost::python +# define BOOST_PYTHON_CONVERSION boost::python +# define BOOST_PYTHON_IMPORT_CONVERSION(x) void never_defined() // so we can follow the macro with a ';' +# endif + +# if defined(BOOST_MSVC) + +# pragma warning (disable : 4786) // disable truncated debug symbols +# pragma warning (disable : 4251) // disable exported dll function +# pragma warning (disable : 4800) //'int' : forcing value to bool 'true' or 'false' +# pragma warning (disable : 4275) // non dll-interface class + +# elif defined(__ICL) && __ICL < 600 // Intel C++ 5 + +# pragma warning(disable: 985) // identifier was truncated in debug information + +# endif + +// The STLport puts all of the standard 'C' library names in std (as far as the +// user is concerned), but without it you need a fix if you're using MSVC or +// Intel C++ +# if defined(BOOST_NO_STDC_NAMESPACE) +# define BOOST_CSTD_ +# else +# define BOOST_CSTD_ std +# endif + +/***************************************************************************** + * + * Set up dll import/export options: + * + ****************************************************************************/ + +// backwards compatibility: +#ifdef BOOST_PYTHON_STATIC_LIB +# define BOOST_PYTHON_STATIC_LINK +# elif !defined(BOOST_PYTHON_DYNAMIC_LIB) +# define BOOST_PYTHON_DYNAMIC_LIB +#endif + +#if defined(BOOST_PYTHON_DYNAMIC_LIB) +# if defined(BOOST_SYMBOL_EXPORT) +# if defined(BOOST_PYTHON_SOURCE) +# define BOOST_PYTHON_DECL BOOST_SYMBOL_EXPORT +# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT +# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT +# define BOOST_PYTHON_BUILD_DLL +# else +# define BOOST_PYTHON_DECL BOOST_SYMBOL_IMPORT +# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT +# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT +# endif +# endif +#endif + +#ifndef BOOST_PYTHON_DECL +# define BOOST_PYTHON_DECL +#endif + +#ifndef BOOST_PYTHON_DECL_FORWARD +# define BOOST_PYTHON_DECL_FORWARD +#endif + +#ifndef BOOST_PYTHON_DECL_EXCEPTION +# define BOOST_PYTHON_DECL_EXCEPTION +#endif + +#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) +// Replace broken Tru64/cxx offsetof macro +# define BOOST_PYTHON_OFFSETOF(s_name, s_member) \ + ((size_t)__INTADDR__(&(((s_name *)0)->s_member))) +#else +# define BOOST_PYTHON_OFFSETOF offsetof +#endif + +// enable automatic library variant selection ------------------------------// + +#if !defined(BOOST_PYTHON_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_PYTHON_NO_LIB) +// +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +// +#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_python, PY_MAJOR_VERSION, PY_MINOR_VERSION) +// +// If we're importing code from a dll, then tell auto_link.hpp about it: +// +#ifdef BOOST_PYTHON_DYNAMIC_LIB +# define BOOST_DYN_LINK +#endif +// +// And include the header that does the work: +// +#include +#endif // auto-linking disabled + +#undef BOOST_PYTHON_CONCAT +#undef _BOOST_PYTHON_CONCAT + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#define BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition +#endif + +#if !defined(BOOST_ATTRIBUTE_UNUSED) && defined(__GNUC__) && (__GNUC__ >= 4) +# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) +#endif + +#endif // CONFIG_DWA052200_H_ diff --git a/pxr/external/boost/python/detail/construct.hpp b/pxr/external/boost/python/detail/construct.hpp new file mode 100644 index 0000000000..e69fbc7538 --- /dev/null +++ b/pxr/external/boost/python/detail/construct.hpp @@ -0,0 +1,36 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CONSTRUCT_REFERENCE_DWA2002716_HPP +# define CONSTRUCT_REFERENCE_DWA2002716_HPP + +namespace boost { namespace python { namespace detail { + +template +void construct_pointee(void* storage, Arg& x, T const volatile*) +{ + new (storage) T(x); +} + +template +void construct_referent_impl(void* storage, Arg& x, T&(*)()) +{ + construct_pointee(storage, x, (T*)0); +} + +template +void construct_referent(void* storage, Arg const& x, T(*tag)() = 0) +{ + construct_referent_impl(storage, x, tag); +} + +template +void construct_referent(void* storage, Arg& x, T(*tag)() = 0) +{ + construct_referent_impl(storage, x, tag); +} + +}}} // namespace boost::python::detail + +#endif // CONSTRUCT_REFERENCE_DWA2002716_HPP diff --git a/pxr/external/boost/python/detail/convertible.hpp b/pxr/external/boost/python/detail/convertible.hpp new file mode 100644 index 0000000000..1ff350ec24 --- /dev/null +++ b/pxr/external/boost/python/detail/convertible.hpp @@ -0,0 +1,38 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CONVERTIBLE_DWA2002614_HPP +# define CONVERTIBLE_DWA2002614_HPP + +# if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241 +# include +# include +# endif + +// Supplies a runtime is_convertible check which can be used with tag +// dispatching to work around the Metrowerks Pro7 limitation with boost/std::is_convertible +namespace boost { namespace python { namespace detail { + +typedef char* yes_convertible; +typedef int* no_convertible; + +template +struct convertible +{ +# if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 241 || __EDG_VERSION__ == 238 + static inline no_convertible check(...) { return 0; } + static inline yes_convertible check(Target) { return 0; } +# else + template + static inline typename mpl::if_c< + is_convertible::value + , yes_convertible + , no_convertible + >::type check(X const&) { return 0; } +# endif +}; + +}}} // namespace boost::python::detail + +#endif // CONVERTIBLE_DWA2002614_HPP diff --git a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp new file mode 100644 index 0000000000..4ca8d03911 --- /dev/null +++ b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp @@ -0,0 +1,21 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef COPY_CTOR_MUTATES_RHS_DWA2003219_HPP +# define COPY_CTOR_MUTATES_RHS_DWA2003219_HPP + +#include +#include + +namespace boost { namespace python { namespace detail { + +template +struct copy_ctor_mutates_rhs + : is_auto_ptr +{ +}; + +}}} // namespace boost::python::detail + +#endif // COPY_CTOR_MUTATES_RHS_DWA2003219_HPP diff --git a/pxr/external/boost/python/detail/cv_category.hpp b/pxr/external/boost/python/detail/cv_category.hpp new file mode 100644 index 0000000000..eb5a8eb9da --- /dev/null +++ b/pxr/external/boost/python/detail/cv_category.hpp @@ -0,0 +1,36 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CV_CATEGORY_DWA200222_HPP +# define CV_CATEGORY_DWA200222_HPP +# include + +namespace boost { namespace python { namespace detail { + +template +struct cv_tag +{ + BOOST_STATIC_CONSTANT(bool, is_const = is_const_); + BOOST_STATIC_CONSTANT(bool, is_volatile = is_volatile_); +}; + +typedef cv_tag cv_unqualified; +typedef cv_tag const_; +typedef cv_tag volatile_; +typedef cv_tag const_volatile_; + +template +struct cv_category +{ +// BOOST_STATIC_CONSTANT(bool, c = is_const::value); +// BOOST_STATIC_CONSTANT(bool, v = is_volatile::value); + typedef cv_tag< + is_const::value + , is_volatile::value + > type; +}; + +}}} // namespace boost::python::detail + +#endif // CV_CATEGORY_DWA200222_HPP diff --git a/pxr/external/boost/python/detail/dealloc.hpp b/pxr/external/boost/python/detail/dealloc.hpp new file mode 100644 index 0000000000..ce07926ee1 --- /dev/null +++ b/pxr/external/boost/python/detail/dealloc.hpp @@ -0,0 +1,17 @@ +// Copyright Gottfried Ganßauge 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef BOOST_PYTHON_DETAIL_DEALLOC_HPP_ +# define BOOST_PYTHON_DETAIL_DEALLOC_HPP_ +namespace boost { namespace python { namespace detail { + extern "C" + { + inline void dealloc(PyObject* self) + { + PyObject_Del(self); + } + } +}}} // namespace boost::python::detail +# endif // BOOST_PYTHON_DETAIL_DEALLOC_HPP_ diff --git a/pxr/external/boost/python/detail/decorated_type_id.hpp b/pxr/external/boost/python/detail/decorated_type_id.hpp new file mode 100644 index 0000000000..2596f3104a --- /dev/null +++ b/pxr/external/boost/python/detail/decorated_type_id.hpp @@ -0,0 +1,76 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DECORATED_TYPE_ID_DWA2002517_HPP +# define DECORATED_TYPE_ID_DWA2002517_HPP + +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +struct decorated_type_info : totally_ordered +{ + enum decoration { const_ = 0x1, volatile_ = 0x2, reference = 0x4 }; + + decorated_type_info(type_info, decoration = decoration()); + + inline bool operator<(decorated_type_info const& rhs) const; + inline bool operator==(decorated_type_info const& rhs) const; + + friend BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); + + operator type_info const&() const; + private: // type + typedef type_info base_id_t; + + private: // data members + decoration m_decoration; + base_id_t m_base_type; +}; + +template +inline decorated_type_info decorated_type_id(boost::type* = 0) +{ + return decorated_type_info( + type_id() + , decorated_type_info::decoration( + (is_const::value || indirect_traits::is_reference_to_const::value + ? decorated_type_info::const_ : 0) + | (is_volatile::value || indirect_traits::is_reference_to_volatile::value + ? decorated_type_info::volatile_ : 0) + | (is_reference::value ? decorated_type_info::reference : 0) + ) + ); +} + +inline decorated_type_info::decorated_type_info(type_info base_t, decoration decoration) + : m_decoration(decoration) + , m_base_type(base_t) +{ +} + +inline bool decorated_type_info::operator<(decorated_type_info const& rhs) const +{ + return m_decoration < rhs.m_decoration + || (m_decoration == rhs.m_decoration + && m_base_type < rhs.m_base_type); +} + +inline bool decorated_type_info::operator==(decorated_type_info const& rhs) const +{ + return m_decoration == rhs.m_decoration && m_base_type == rhs.m_base_type; +} + +inline decorated_type_info::operator type_info const&() const +{ + return m_base_type; +} + +BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); + +}}} // namespace boost::python::detail + +#endif // DECORATED_TYPE_ID_DWA2002517_HPP diff --git a/pxr/external/boost/python/detail/decref_guard.hpp b/pxr/external/boost/python/detail/decref_guard.hpp new file mode 100644 index 0000000000..d713e0a604 --- /dev/null +++ b/pxr/external/boost/python/detail/decref_guard.hpp @@ -0,0 +1,21 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DECREF_GUARD_DWA20021220_HPP +# define DECREF_GUARD_DWA20021220_HPP + +namespace boost { namespace python { namespace detail { + +struct decref_guard +{ + decref_guard(PyObject* o) : obj(o) {} + ~decref_guard() { Py_XDECREF(obj); } + void cancel() { obj = 0; } + private: + PyObject* obj; +}; + +}}} // namespace boost::python::detail + +#endif // DECREF_GUARD_DWA20021220_HPP diff --git a/pxr/external/boost/python/detail/def_helper.hpp b/pxr/external/boost/python/detail/def_helper.hpp new file mode 100644 index 0000000000..24f9c5cdb2 --- /dev/null +++ b/pxr/external/boost/python/detail/def_helper.hpp @@ -0,0 +1,211 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEF_HELPER_DWA200287_HPP +# define DEF_HELPER_DWA200287_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +struct default_call_policies; + +namespace detail +{ + // tuple_extract::extract(t) returns the first + // element of a Tuple whose type E satisfies the given Predicate + // applied to add_reference. The Predicate must be an MPL + // metafunction class. + template + struct tuple_extract; + + // Implementation class for when the tuple's head type does not + // satisfy the Predicate + template + struct tuple_extract_impl + { + template + struct apply + { + typedef typename Tuple::head_type result_type; + + static typename Tuple::head_type extract(Tuple const& x) + { + return x.get_head(); + } + }; + }; + + // Implementation specialization for when the tuple's head type + // satisfies the predicate + template <> + struct tuple_extract_impl + { + template + struct apply + { + // recursive application of tuple_extract on the tail of the tuple + typedef tuple_extract next; + typedef typename next::result_type result_type; + + static result_type extract(Tuple const& x) + { + return next::extract(x.get_tail()); + } + }; + }; + + // A metafunction which selects a version of tuple_extract_impl to + // use for the implementation of tuple_extract + template + struct tuple_extract_base_select + { + typedef typename Tuple::head_type head_type; + typedef typename mpl::apply1::type>::type match_t; + BOOST_STATIC_CONSTANT(bool, match = match_t::value); + typedef typename tuple_extract_impl::template apply type; + }; + + template + struct tuple_extract + : tuple_extract_base_select< + Tuple + , typename mpl::lambda::type + >::type + { + }; + + + // + // Specialized extractors for the docstring, keywords, CallPolicies, + // and default implementation of virtual functions + // + + template + struct doc_extract + : tuple_extract< + Tuple + , mpl::not_< + mpl::or_< + indirect_traits::is_reference_to_class + , indirect_traits::is_reference_to_member_function_pointer + > + > + > + { + }; + + template + struct keyword_extract + : tuple_extract > + { + }; + + template + struct policy_extract + : tuple_extract< + Tuple + , mpl::and_< + mpl::not_ > + , indirect_traits::is_reference_to_class + , mpl::not_ > + > + > + { + }; + + template + struct default_implementation_extract + : tuple_extract< + Tuple + , indirect_traits::is_reference_to_member_function_pointer + > + { + }; + + // + // A helper class for decoding the optional arguments to def() + // invocations, which can be supplied in any order and are + // discriminated by their type properties. The template parameters + // are expected to be the types of the actual (optional) arguments + // passed to def(). + // + template + struct def_helper + { + // A tuple type which begins with references to the supplied + // arguments and ends with actual representatives of the default + // types. + typedef boost::tuples::tuple< + T1 const& + , T2 const& + , T3 const& + , T4 const& + , default_call_policies + , detail::keywords<0> + , char const* + , void(not_specified::*)() // A function pointer type which is never an + // appropriate default implementation + > all_t; + + // Constructors; these initialize an member of the tuple type + // shown above. + def_helper(T1 const& a1) : m_all(a1,m_nil,m_nil,m_nil) {} + def_helper(T1 const& a1, T2 const& a2) : m_all(a1,a2,m_nil,m_nil) {} + def_helper(T1 const& a1, T2 const& a2, T3 const& a3) : m_all(a1,a2,a3,m_nil) {} + def_helper(T1 const& a1, T2 const& a2, T3 const& a3, T4 const& a4) : m_all(a1,a2,a3,a4) {} + + private: // types + typedef typename default_implementation_extract::result_type default_implementation_t; + + public: // Constants which can be used for static assertions. + + // Users must not supply a default implementation for non-class + // methods. + BOOST_STATIC_CONSTANT( + bool, has_default_implementation = ( + !is_same::value)); + + public: // Extractor functions which pull the appropriate value out + // of the tuple + char const* doc() const + { + return doc_extract::extract(m_all); + } + + typename keyword_extract::result_type keywords() const + { + return keyword_extract::extract(m_all); + } + + typename policy_extract::result_type policies() const + { + return policy_extract::extract(m_all); + } + + default_implementation_t default_implementation() const + { + return default_implementation_extract::extract(m_all); + } + + private: // data members + all_t m_all; + not_specified m_nil; // for filling in not_specified slots + }; +} + +}} // namespace boost::python::detail + +#endif // DEF_HELPER_DWA200287_HPP diff --git a/pxr/external/boost/python/detail/def_helper_fwd.hpp b/pxr/external/boost/python/detail/def_helper_fwd.hpp new file mode 100644 index 0000000000..31c22e97a3 --- /dev/null +++ b/pxr/external/boost/python/detail/def_helper_fwd.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEF_HELPER_FWD_DWA2003810_HPP +# define DEF_HELPER_FWD_DWA2003810_HPP + +# include + +namespace boost { namespace python { namespace detail { + +template +struct def_helper; + +}}} // namespace boost::python::detail + +#endif // DEF_HELPER_FWD_DWA2003810_HPP diff --git a/pxr/external/boost/python/detail/defaults_def.hpp b/pxr/external/boost/python/detail/defaults_def.hpp new file mode 100644 index 0000000000..a721b76794 --- /dev/null +++ b/pxr/external/boost/python/detail/defaults_def.hpp @@ -0,0 +1,291 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright David Abrahams 2002, Joel de Guzman, 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_PP_IS_ITERATING) + +#ifndef DEFAULTS_DEF_JDG20020811_HPP +#define DEFAULTS_DEF_JDG20020811_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace python { + +struct module; + +namespace objects +{ + struct class_base; +} + +namespace detail +{ + // Called as:: + // + // name_space_def(ns, "func", func, kw, policies, docstring, &ns) + // + // Dispatch to properly add f to namespace ns. + // + // @group define_stub_function helpers { + template + static void name_space_def( + NameSpaceT& name_space + , char const* name + , Func f + , keyword_range const& kw + , CallPolicies const& policies + , char const* doc + , objects::class_base* + ) + { + typedef typename NameSpaceT::wrapped_type wrapped_type; + + objects::add_to_namespace( + name_space, name, + detail::make_keyword_range_function( + f, policies, kw, get_signature(f, (wrapped_type*)0)) + , doc + ); + } + + template + static void name_space_def( + object& name_space + , char const* name + , Func f + , keyword_range const& kw + , CallPolicies const& policies + , char const* doc + , ... + ) + { + scope within(name_space); + + detail::scope_setattr_doc( + name + , detail::make_keyword_range_function(f, policies, kw) + , doc); + } + + // For backward compatibility -- is this obsolete? + template + static void name_space_def( + NameSpaceT& name_space + , char const* name + , Func f + , keyword_range const& kw // ignored + , CallPolicies const& policies + , char const* doc + , module* + ) + { + name_space.def(name, f, policies, doc); + } + // } + + + // Expansions of :: + // + // template + // inline void + // define_stub_function( + // char const* name, OverloadsT s, NameSpaceT& name_space, mpl::int_) + // { + // name_space.def(name, &OverloadsT::func_N); + // } + // + // where N runs from 0 to BOOST_PYTHON_MAX_ARITY. + // + // The set of overloaded functions (define_stub_function) expects: + // + // 1. char const* name: function name that will be visible to python + // 2. OverloadsT: a function overloads struct (see defaults_gen.hpp) + // 3. NameSpaceT& name_space: a python::class_ or python::module instance + // 4. int_t: the Nth overloaded function (OverloadsT::func_N) + // (see defaults_gen.hpp) + // 5. char const* name: doc string + // + // @group define_stub_function { + template + struct define_stub_function {}; + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +#include BOOST_PP_ITERATE() + + // } + + // This helper template struct does the actual recursive + // definition. There's a generic version + // define_with_defaults_helper and a terminal case + // define_with_defaults_helper<0>. The struct and its + // specialization has a sole static member function def that + // expects: + // + // 1. char const* name: function name that will be + // visible to python + // + // 2. OverloadsT: a function overloads struct + // (see defaults_gen.hpp) + // + // 3. NameSpaceT& name_space: a python::class_ or + // python::module instance + // + // 4. char const* name: doc string + // + // The def static member function calls a corresponding + // define_stub_function. The general case recursively calls + // define_with_defaults_helper::def until it reaches the + // terminal case case define_with_defaults_helper<0>. + template + struct define_with_defaults_helper { + + template + static void + def( + char const* name, + StubsT stubs, + keyword_range kw, + CallPolicies const& policies, + NameSpaceT& name_space, + char const* doc) + { + // define the NTH stub function of stubs + define_stub_function::define(name, stubs, kw, policies, name_space, doc); + + if (kw.second > kw.first) + --kw.second; + + // call the next define_with_defaults_helper + define_with_defaults_helper::def(name, stubs, kw, policies, name_space, doc); + } + }; + + template <> + struct define_with_defaults_helper<0> { + + template + static void + def( + char const* name, + StubsT stubs, + keyword_range const& kw, + CallPolicies const& policies, + NameSpaceT& name_space, + char const* doc) + { + // define the Oth stub function of stubs + define_stub_function<0>::define(name, stubs, kw, policies, name_space, doc); + // return + } + }; + + // define_with_defaults + // + // 1. char const* name: function name that will be + // visible to python + // + // 2. OverloadsT: a function overloads struct + // (see defaults_gen.hpp) + // + // 3. CallPolicies& policies: Call policies + // 4. NameSpaceT& name_space: a python::class_ or + // python::module instance + // + // 5. SigT sig: Function signature typelist + // (see defaults_gen.hpp) + // + // 6. char const* name: doc string + // + // This is the main entry point. This function recursively + // defines all stub functions of StubT (see defaults_gen.hpp) in + // NameSpaceT name_space which can be either a python::class_ or + // a python::module. The sig argument is a typelist that + // specifies the return type, the class (for member functions, + // and the arguments. Here are some SigT examples: + // + // int foo(int) mpl::vector + // void bar(int, int) mpl::vector + // void C::foo(int) mpl::vector + // + template + inline void + define_with_defaults( + char const* name, + OverloadsT const& overloads, + NameSpaceT& name_space, + SigT const&) + { + typedef typename mpl::front::type return_type; + typedef typename OverloadsT::void_return_type void_return_type; + typedef typename OverloadsT::non_void_return_type non_void_return_type; + + typedef typename mpl::if_c< + is_same::value + , void_return_type + , non_void_return_type + >::type stubs_type; + + BOOST_STATIC_ASSERT( + (stubs_type::max_args) <= mpl::size::value); + + typedef typename stubs_type::template gen gen_type; + define_with_defaults_helper::def( + name + , gen_type() + , overloads.keywords() + , overloads.call_policies() + , name_space + , overloads.doc_string()); + } + +} // namespace detail + +}} // namespace boost::python + +#endif // DEFAULTS_DEF_JDG20020811_HPP + +#else // defined(BOOST_PP_IS_ITERATING) +// PP vertical iteration code + + +template <> +struct define_stub_function { + template + static void define( + char const* name + , StubsT const& + , keyword_range const& kw + , CallPolicies const& policies + , NameSpaceT& name_space + , char const* doc) + { + detail::name_space_def( + name_space + , name + , &StubsT::BOOST_PP_CAT(func_, BOOST_PP_ITERATION()) + , kw + , policies + , doc + , &name_space); + } +}; + +#endif // !defined(BOOST_PP_IS_ITERATING) diff --git a/pxr/external/boost/python/detail/defaults_gen.hpp b/pxr/external/boost/python/detail/defaults_gen.hpp new file mode 100644 index 0000000000..88beeedb02 --- /dev/null +++ b/pxr/external/boost/python/detail/defaults_gen.hpp @@ -0,0 +1,388 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright David Abrahams 2002, Joel de Guzman, 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +/////////////////////////////////////////////////////////////////////////////// +#ifndef DEFAULTS_GEN_JDG20020807_HPP +#define DEFAULTS_GEN_JDG20020807_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace python { + +namespace detail +{ + // overloads_base is used as a base class for all function + // stubs. This class holds the doc_string of the stubs. + struct overloads_base + { + overloads_base(char const* doc_) + : m_doc(doc_) {} + + overloads_base(char const* doc_, detail::keyword_range const& kw) + : m_doc(doc_), m_keywords(kw) {} + + char const* doc_string() const + { + return m_doc; + } + + detail::keyword_range const& keywords() const + { + return m_keywords; + } + + private: + char const* m_doc; + detail::keyword_range m_keywords; + }; + + // overloads_proxy is generated by the overloads_common operator[] (see + // below). This class holds a user defined call policies of the stubs. + template + struct overloads_proxy + : public overloads_base + { + typedef typename OverloadsT::non_void_return_type non_void_return_type; + typedef typename OverloadsT::void_return_type void_return_type; + + overloads_proxy( + CallPoliciesT const& policies_ + , char const* doc + , keyword_range const& kw + ) + : overloads_base(doc, kw) + , policies(policies_) + {} + + CallPoliciesT + call_policies() const + { + return policies; + } + + CallPoliciesT policies; + }; + + // overloads_common is our default function stubs base class. This + // class returns the default_call_policies in its call_policies() + // member function. It can generate a overloads_proxy however through + // its operator[] + template + struct overloads_common + : public overloads_base + { + overloads_common(char const* doc) + : overloads_base(doc) {} + + overloads_common(char const* doc, keyword_range const& kw) + : overloads_base(doc, kw) {} + + default_call_policies + call_policies() const + { + return default_call_policies(); + } + + template + overloads_proxy + operator[](CallPoliciesT const& policies) const + { + return overloads_proxy( + policies, this->doc_string(), this->keywords()); + } + }; + +}}} // namespace boost::python::detail + + +#define BOOST_PYTHON_TYPEDEF_GEN(z, index, data) \ + typedef typename ::boost::mpl::next::type \ + BOOST_PP_CAT(iter, BOOST_PP_INC(index)); \ + typedef typename ::boost::mpl::deref::type \ + BOOST_PP_CAT(T, index); + +#define BOOST_PYTHON_FUNC_WRAPPER_GEN(z, index, data) \ + static RT BOOST_PP_CAT(func_, \ + BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ + BOOST_PP_ENUM_BINARY_PARAMS_Z( \ + 1, index, T, arg)) \ + { \ + BOOST_PP_TUPLE_ELEM(3, 2, data) \ + BOOST_PP_TUPLE_ELEM(3, 0, data)( \ + BOOST_PP_ENUM_PARAMS( \ + index, \ + arg)); \ + } + +#define BOOST_PYTHON_GEN_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ + struct fstubs_name \ + { \ + BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ + BOOST_STATIC_CONSTANT(int, max_args = n_funcs); \ + \ + template \ + struct gen \ + { \ + typedef typename ::boost::mpl::begin::type rt_iter; \ + typedef typename ::boost::mpl::deref::type RT; \ + typedef typename ::boost::mpl::next::type iter0; \ + \ + BOOST_PP_REPEAT_2ND( \ + n_args, \ + BOOST_PYTHON_TYPEDEF_GEN, \ + 0) \ + \ + BOOST_PP_REPEAT_FROM_TO_2( \ + BOOST_PP_SUB_D(1, n_args, n_dflts), \ + BOOST_PP_INC(n_args), \ + BOOST_PYTHON_FUNC_WRAPPER_GEN, \ + (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ + }; \ + }; \ + +/////////////////////////////////////////////////////////////////////////////// +#define BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN(z, index, data) \ + static RT BOOST_PP_CAT(func_, \ + BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ + ClassT obj BOOST_PP_COMMA_IF(index) \ + BOOST_PP_ENUM_BINARY_PARAMS_Z(1, index, T, arg) \ + ) \ + { \ + BOOST_PP_TUPLE_ELEM(3, 2, data) obj.BOOST_PP_TUPLE_ELEM(3, 0, data)( \ + BOOST_PP_ENUM_PARAMS(index, arg) \ + ); \ + } + +#define BOOST_PYTHON_GEN_MEM_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ + struct fstubs_name \ + { \ + BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ + BOOST_STATIC_CONSTANT(int, max_args = n_funcs + 1); \ + \ + template \ + struct gen \ + { \ + typedef typename ::boost::mpl::begin::type rt_iter; \ + typedef typename ::boost::mpl::deref::type RT; \ + \ + typedef typename ::boost::mpl::next::type class_iter; \ + typedef typename ::boost::mpl::deref::type ClassT; \ + typedef typename ::boost::mpl::next::type iter0; \ + \ + BOOST_PP_REPEAT_2ND( \ + n_args, \ + BOOST_PYTHON_TYPEDEF_GEN, \ + 0) \ + \ + BOOST_PP_REPEAT_FROM_TO_2( \ + BOOST_PP_SUB_D(1, n_args, n_dflts), \ + BOOST_PP_INC(n_args), \ + BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN, \ + (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ + }; \ + }; + +#define BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ + fstubs_name(char const* doc = 0) \ + : ::boost::python::detail::overloads_common(doc) {} \ + template \ + fstubs_name(char const* doc, ::boost::python::detail::keywords const& keywords) \ + : ::boost::python::detail::overloads_common( \ + doc, keywords.range()) \ + { \ + typedef typename ::boost::python::detail:: \ + error::more_keywords_than_function_arguments< \ + N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ + } \ + template \ + fstubs_name(::boost::python::detail::keywords const& keywords, char const* doc = 0) \ + : ::boost::python::detail::overloads_common( \ + doc, keywords.range()) \ + { \ + typedef typename ::boost::python::detail:: \ + error::more_keywords_than_function_arguments< \ + N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ + } + +# if defined(BOOST_NO_VOID_RETURNS) + +# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ + struct fstubs_name \ + : public ::boost::python::detail::overloads_common \ + { \ + BOOST_PYTHON_GEN_FUNCTION( \ + fname, non_void_return_type, n_args, n_dflts, return) \ + BOOST_PYTHON_GEN_FUNCTION( \ + fname, void_return_type, n_args, n_dflts, ;) \ + \ + BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ + }; + +# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ + struct fstubs_name \ + : public ::boost::python::detail::overloads_common \ + { \ + BOOST_PYTHON_GEN_MEM_FUNCTION( \ + fname, non_void_return_type, n_args, n_dflts, return) \ + BOOST_PYTHON_GEN_MEM_FUNCTION( \ + fname, void_return_type, n_args, n_dflts, ;) \ + \ + BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ + }; + +# else // !defined(BOOST_NO_VOID_RETURNS) + +# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ + struct fstubs_name \ + : public ::boost::python::detail::overloads_common \ + { \ + BOOST_PYTHON_GEN_FUNCTION( \ + fname, non_void_return_type, n_args, n_dflts, return) \ + \ + typedef non_void_return_type void_return_type; \ + BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ + }; + + +# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ + struct fstubs_name \ + : public ::boost::python::detail::overloads_common \ + { \ + BOOST_PYTHON_GEN_MEM_FUNCTION( \ + fname, non_void_return_type, n_args, n_dflts, return) \ + \ + typedef non_void_return_type void_return_type; \ + BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ + }; + +# endif // !defined(BOOST_NO_VOID_RETURNS) + +/////////////////////////////////////////////////////////////////////////////// +// +// MAIN MACROS +// +// Given generator_name, fname, min_args and max_args, These macros +// generate function stubs that forward to a function or member function +// named fname. max_args is the arity of the function or member function +// fname. fname can have default arguments. min_args is the minimum +// arity that fname can accept. +// +// There are two versions: +// +// 1. BOOST_PYTHON_FUNCTION_OVERLOADS for free functions +// 2. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS for member functions. +// +// For instance, given a function: +// +// int +// foo(int a, char b = 1, unsigned c = 2, double d = 3) +// { +// return a + b + c + int(d); +// } +// +// The macro invocation: +// +// BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) +// +// Generates this code: +// +// struct foo_stubsNonVoid +// { +// static const int n_funcs = 4; +// static const int max_args = n_funcs; +// +// template +// struct gen +// { +// typedef typename ::boost::mpl::begin::type rt_iter; +// typedef typename rt_iter::type RT; +// typedef typename rt_iter::next iter0; +// typedef typename iter0::type T0; +// typedef typename iter0::next iter1; +// typedef typename iter1::type T1; +// typedef typename iter1::next iter2; +// typedef typename iter2::type T2; +// typedef typename iter2::next iter3; +// typedef typename iter3::type T3; +// typedef typename iter3::next iter4; +// +// static RT func_0(T0 arg0) +// { return foo(arg0); } +// +// static RT func_1(T0 arg0, T1 arg1) +// { return foo(arg0, arg1); } +// +// static RT func_2(T0 arg0, T1 arg1, T2 arg2) +// { return foo(arg0, arg1, arg2); } +// +// static RT func_3(T0 arg0, T1 arg1, T2 arg2, T3 arg3) +// { return foo(arg0, arg1, arg2, arg3); } +// }; +// }; +// +// struct foo_overloads +// : public boost::python::detail::overloads_common +// { +// typedef foo_overloadsNonVoid non_void_return_type; +// typedef foo_overloadsNonVoid void_return_type; +// +// foo_overloads(char const* doc = 0) +// : boost::python::detail::overloads_common(doc) {} +// }; +// +// The typedefs non_void_return_type and void_return_type are +// used to handle compilers that do not support void returns. The +// example above typedefs non_void_return_type and +// void_return_type to foo_overloadsNonVoid. On compilers that do +// not support void returns, there are two versions: +// foo_overloadsNonVoid and foo_overloadsVoid. The "Void" +// version is almost identical to the "NonVoid" version except +// for the return type (void) and the lack of the return keyword. +// +// See the overloads_common above for a description of the +// foo_overloads' base class. +// +/////////////////////////////////////////////////////////////////////////////// +#define BOOST_PYTHON_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ + BOOST_PYTHON_GEN_FUNCTION_STUB( \ + fname, \ + generator_name, \ + max_args, \ + BOOST_PP_SUB_D(1, max_args, min_args)) + +#define BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ + BOOST_PYTHON_GEN_MEM_FUNCTION_STUB( \ + fname, \ + generator_name, \ + max_args, \ + BOOST_PP_SUB_D(1, max_args, min_args)) + +// deprecated macro names (to be removed) +#define BOOST_PYTHON_FUNCTION_GENERATOR BOOST_PYTHON_FUNCTION_OVERLOADS +#define BOOST_PYTHON_MEM_FUN_GENERATOR BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS + +/////////////////////////////////////////////////////////////////////////////// +#endif // DEFAULTS_GEN_JDG20020807_HPP + + diff --git a/pxr/external/boost/python/detail/dependent.hpp b/pxr/external/boost/python/detail/dependent.hpp new file mode 100644 index 0000000000..70392c4d78 --- /dev/null +++ b/pxr/external/boost/python/detail/dependent.hpp @@ -0,0 +1,27 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DEPENDENT_DWA200286_HPP +# define DEPENDENT_DWA200286_HPP + +namespace boost { namespace python { namespace detail { + +// A way to turn a concrete type T into a type dependent on U. This +// keeps conforming compilers (those implementing proper 2-phase +// name lookup for templates) from complaining about incomplete +// types in situations where it would otherwise be inconvenient or +// impossible to re-order code so that all types are defined in time. + +// One such use is when we must return an incomplete T from a member +// function template (which must be defined in the class body to +// keep MSVC happy). +template +struct dependent +{ + typedef T type; +}; + +}}} // namespace boost::python::detail + +#endif // DEPENDENT_DWA200286_HPP diff --git a/pxr/external/boost/python/detail/destroy.hpp b/pxr/external/boost/python/detail/destroy.hpp new file mode 100644 index 0000000000..d35b2b536e --- /dev/null +++ b/pxr/external/boost/python/detail/destroy.hpp @@ -0,0 +1,63 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DESTROY_DWA2002221_HPP +# define DESTROY_DWA2002221_HPP + +# include +# include +namespace boost { namespace python { namespace detail { + +template struct value_destroyer; + +template <> +struct value_destroyer +{ + template + static void execute(T const volatile* p) + { + p->~T(); + } +}; + +template <> +struct value_destroyer +{ + template + static void execute(A*, T const volatile* const first) + { + for (T const volatile* p = first; p != first + sizeof(A)/sizeof(T); ++p) + { + value_destroyer< + is_array::value + >::execute(p); + } + } + + template + static void execute(T const volatile* p) + { + execute(p, *p); + } +}; + +template +inline void destroy_referent_impl(void* p, T& (*)()) +{ + // note: cv-qualification needed for MSVC6 + // must come *before* T for metrowerks + value_destroyer< + (is_array::value) + >::execute((const volatile T*)p); +} + +template +inline void destroy_referent(void* p, T(*)() = 0) +{ + destroy_referent_impl(p, (T(*)())0); +} + +}}} // namespace boost::python::detail + +#endif // DESTROY_DWA2002221_HPP diff --git a/pxr/external/boost/python/detail/enable_if.hpp b/pxr/external/boost/python/detail/enable_if.hpp new file mode 100644 index 0000000000..7a37be121a --- /dev/null +++ b/pxr/external/boost/python/detail/enable_if.hpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef ENABLE_IF_DWA2004722_HPP +# define ENABLE_IF_DWA2004722_HPP + +# include +# include + +#if !defined(BOOST_NO_SFINAE) +# include + +namespace boost { namespace python { namespace detail { + +template +struct enable_if_arg + : enable_if +{}; + +template +struct disable_if_arg + : disable_if +{}; + +template +struct enable_if_ret + : enable_if +{}; + +template +struct disable_if_ret + : disable_if +{}; + +}}} // namespace boost::python::detail + +# endif + +#endif // ENABLE_IF_DWA2004722_HPP diff --git a/pxr/external/boost/python/detail/exception_handler.hpp b/pxr/external/boost/python/detail/exception_handler.hpp new file mode 100644 index 0000000000..fdc9989836 --- /dev/null +++ b/pxr/external/boost/python/detail/exception_handler.hpp @@ -0,0 +1,48 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef EXCEPTION_HANDLER_DWA2002810_HPP +# define EXCEPTION_HANDLER_DWA2002810_HPP + +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +struct exception_handler; + +typedef function2 const&> handler_function; + +struct BOOST_PYTHON_DECL exception_handler +{ + private: // types + + public: + explicit exception_handler(handler_function const& impl); + + inline bool handle(function0 const& f) const; + + bool operator()(function0 const& f) const; + + static exception_handler* chain; + + private: + static exception_handler* tail; + + handler_function m_impl; + exception_handler* m_next; +}; + + +inline bool exception_handler::handle(function0 const& f) const +{ + return this->m_impl(*this, f); +} + +BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f); + +}}} // namespace boost::python::detail + +#endif // EXCEPTION_HANDLER_DWA2002810_HPP diff --git a/pxr/external/boost/python/detail/force_instantiate.hpp b/pxr/external/boost/python/detail/force_instantiate.hpp new file mode 100644 index 0000000000..a8901b2da7 --- /dev/null +++ b/pxr/external/boost/python/detail/force_instantiate.hpp @@ -0,0 +1,18 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FORCE_INSTANTIATE_DWA200265_HPP +# define FORCE_INSTANTIATE_DWA200265_HPP + +namespace boost { namespace python { namespace detail { + +// Allows us to force the argument to be instantiated without +// incurring unused variable warnings + +template +inline void force_instantiate(T const&) {} + +}}} // namespace boost::python::detail + +#endif // FORCE_INSTANTIATE_DWA200265_HPP diff --git a/pxr/external/boost/python/detail/if_else.hpp b/pxr/external/boost/python/detail/if_else.hpp new file mode 100644 index 0000000000..3f505c5edb --- /dev/null +++ b/pxr/external/boost/python/detail/if_else.hpp @@ -0,0 +1,81 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IF_ELSE_DWA2002322_HPP +# define IF_ELSE_DWA2002322_HPP +# include + +namespace boost { namespace python { namespace detail { + +template struct elif_selected; + +template +struct if_selected +{ + template + struct elif : elif_selected + { + }; + + template + struct else_ + { + typedef T type; + }; +}; + +template +struct elif_selected +{ +# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407) + template class then; +# else + template + struct then : if_selected + { + }; +# endif +}; + +# if !(defined(__MWERKS__) && __MWERKS__ <= 0x2407) +template +template +class elif_selected::then : public if_selected +{ +}; +# endif + +template struct if_ +{ + template + struct then : if_selected + { + }; +}; + +struct if_unselected +{ + template struct elif : if_ + { + }; + + template + struct else_ + { + typedef U type; + }; +}; + +template <> +struct if_ +{ + template + struct then : if_unselected + { + }; +}; + +}}} // namespace boost::python::detail + +#endif // IF_ELSE_DWA2002322_HPP diff --git a/pxr/external/boost/python/detail/indirect_traits.hpp b/pxr/external/boost/python/detail/indirect_traits.hpp new file mode 100644 index 0000000000..ce8ba310a2 --- /dev/null +++ b/pxr/external/boost/python/detail/indirect_traits.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef INDIRECT_TRAITS_DWA2004915_HPP +# define INDIRECT_TRAITS_DWA2004915_HPP + +# include + +namespace boost { namespace python { +namespace indirect_traits = boost::detail::indirect_traits; +}} // namespace boost::python::detail + +#endif // INDIRECT_TRAITS_DWA2004915_HPP diff --git a/pxr/external/boost/python/detail/invoke.hpp b/pxr/external/boost/python/detail/invoke.hpp new file mode 100644 index 0000000000..4c5296ff12 --- /dev/null +++ b/pxr/external/boost/python/detail/invoke.hpp @@ -0,0 +1,98 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# ifndef INVOKE_DWA20021122_HPP +# define INVOKE_DWA20021122_HPP + +# include +# include +# include + +# include +# include +# include +# include +# include +# include + +// This file declares a series of overloaded invoke(...) functions, +// used to invoke wrapped C++ function (object)s from Python. Each one +// accepts: +// +// - a tag which identifies the invocation syntax (e.g. member +// functions must be invoked with a different syntax from regular +// functions) +// +// - a pointer to a result converter type, used solely as a way of +// transmitting the type of the result converter to the function (or +// an int, if the return type is void). +// +// - the "function", which may be a function object, a function or +// member function pointer, or a defaulted_virtual_fn. +// +// - The arg_from_python converters for each of the arguments to be +// passed to the function being invoked. + +namespace boost { namespace python { namespace detail { + +// This "result converter" is really just used as a dispatch tag to +// invoke(...), selecting the appropriate implementation +typedef int void_result_to_python; + +template +struct invoke_tag_ {}; + +// A metafunction returning the appropriate tag type for invoking an +// object of type F with return type R. +template +struct invoke_tag + : invoke_tag_< + is_same::value + , is_member_function_pointer::value + > +{ +}; + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +}}} // namespace boost::python::detail + +# endif // INVOKE_DWA20021122_HPP +#else + +# define N BOOST_PP_ITERATION() + +template +inline PyObject* invoke(invoke_tag_, RC const& rc, F& f BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, AC, & ac) ) +{ + return rc(f( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT) )); +} + +template +inline PyObject* invoke(invoke_tag_, RC const&, F& f BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, AC, & ac) ) +{ + f( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT) ); + return none(); +} + +template +inline PyObject* invoke(invoke_tag_, RC const& rc, F& f, TC& tc BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, AC, & ac) ) +{ + return rc( (tc().*f)(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT)) ); +} + +template +inline PyObject* invoke(invoke_tag_, RC const&, F& f, TC& tc BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, AC, & ac) ) +{ + (tc().*f)(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, ac, () BOOST_PP_INTERCEPT)); + return none(); +} + +# undef N + +#endif // BOOST_PP_IS_ITERATING diff --git a/pxr/external/boost/python/detail/is_auto_ptr.hpp b/pxr/external/boost/python/detail/is_auto_ptr.hpp new file mode 100644 index 0000000000..3b8198b8dd --- /dev/null +++ b/pxr/external/boost/python/detail/is_auto_ptr.hpp @@ -0,0 +1,30 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IS_AUTO_PTR_DWA2003224_HPP +# define IS_AUTO_PTR_DWA2003224_HPP + +# ifndef BOOST_NO_AUTO_PTR +# include +# include +# endif + +namespace boost { namespace python { namespace detail { + +# if !defined(BOOST_NO_AUTO_PTR) + +BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) + +# else + +template +struct is_auto_ptr : mpl::false_ +{ +}; + +# endif + +}}} // namespace boost::python::detail + +#endif // IS_AUTO_PTR_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/is_shared_ptr.hpp b/pxr/external/boost/python/detail/is_shared_ptr.hpp new file mode 100644 index 0000000000..383383bc12 --- /dev/null +++ b/pxr/external/boost/python/detail/is_shared_ptr.hpp @@ -0,0 +1,23 @@ +// Copyright David Abrahams 2003. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_detail_is_shared_ptr_hpp_ +#define boost_python_detail_is_shared_ptr_hpp_ + +#include +#include + +namespace boost { namespace python { namespace detail { + +BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1) +#if !defined(BOOST_NO_CXX11_SMART_PTR) +template +struct is_shared_ptr > : std::true_type {}; +#endif + +}}} // namespace boost::python::detail + +#endif diff --git a/pxr/external/boost/python/detail/is_wrapper.hpp b/pxr/external/boost/python/detail/is_wrapper.hpp new file mode 100644 index 0000000000..d7bce7b627 --- /dev/null +++ b/pxr/external/boost/python/detail/is_wrapper.hpp @@ -0,0 +1,29 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef IS_WRAPPER_DWA2004723_HPP +# define IS_WRAPPER_DWA2004723_HPP + +# include +# include + +namespace boost { namespace python { + +template class wrapper; + +namespace detail +{ + typedef char (&is_not_wrapper)[2]; + is_not_wrapper is_wrapper_helper(...); + template + char is_wrapper_helper(wrapper const volatile*); + + // A metafunction returning true iff T is [derived from] wrapper + template + struct is_wrapper + : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)> + {}; + +}}} // namespace boost::python::detail + +#endif // IS_WRAPPER_DWA2004723_HPP diff --git a/pxr/external/boost/python/detail/is_xxx.hpp b/pxr/external/boost/python/detail/is_xxx.hpp new file mode 100644 index 0000000000..9ddfafd3c0 --- /dev/null +++ b/pxr/external/boost/python/detail/is_xxx.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IS_XXX_DWA2003224_HPP +# define IS_XXX_DWA2003224_HPP + +# include + +# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ + BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) + +#endif // IS_XXX_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp new file mode 100644 index 0000000000..c4795cf887 --- /dev/null +++ b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp @@ -0,0 +1,72 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP +# define MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP + +# include +# include + +# include + +# include + + +namespace boost { namespace python { namespace detail { + +// Think of this as a version of make_function without a compile-time +// check that the size of kw is no greater than the expected arity of +// F. This version is needed when defining functions with default +// arguments, because compile-time information about the number of +// keywords is missing for all but the initial function definition. +// +// @group make_keyword_range_function { +template +object make_keyword_range_function( + F f + , Policies const& policies + , keyword_range const& kw) +{ + return detail::make_function_aux( + f, policies, detail::get_signature(f), kw, mpl::int_<0>()); +} + +template +object make_keyword_range_function( + F f + , Policies const& policies + , keyword_range const& kw + , Signature const& sig) +{ + return detail::make_function_aux( + f, policies, sig, kw, mpl::int_<0>()); +} +// } + +// Builds an '__init__' function which inserts the given Holder type +// in a wrapped C++ class instance. ArgList is an MPL type sequence +// describing the C++ argument types to be passed to Holder's +// constructor. +// +// Holder and ArgList are intended to be explicitly specified. +template +object make_keyword_range_constructor( + CallPolicies const& policies // The CallPolicies with which to invoke the Holder's constructor + , detail::keyword_range const& kw // The (possibly empty) set of associated argument keywords + , Holder* = 0 + , ArgList* = 0, Arity* = 0) +{ +#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) + python_class::register_(); +#endif + return detail::make_keyword_range_function( + objects::make_holder + ::template apply::execute + , policies + , kw); +} + +}}} // namespace boost::python::detail + +#endif // MAKE_KEYWORD_RANGE_FN_DWA2002927_HPP diff --git a/pxr/external/boost/python/detail/make_tuple.hpp b/pxr/external/boost/python/detail/make_tuple.hpp new file mode 100644 index 0000000000..57b285be1c --- /dev/null +++ b/pxr/external/boost/python/detail/make_tuple.hpp @@ -0,0 +1,32 @@ +# ifndef BOOST_PYTHON_SYNOPSIS +# // Copyright David Abrahams 2002. +# // Distributed under the Boost Software License, Version 1.0. (See +# // accompanying file LICENSE_1_0.txt or copy at +# // http://www.boost.org/LICENSE_1_0.txt) + +# if !defined(BOOST_PP_IS_ITERATING) +# error Boost.Python - do not include this file! +# endif + +# define N BOOST_PP_ITERATION() + +# define BOOST_PYTHON_MAKE_TUPLE_ARG(z, N, ignored) \ + PyTuple_SET_ITEM( \ + result.ptr() \ + , N \ + , python::incref(python::object(a##N).ptr()) \ + ); + + template + tuple + make_tuple(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)) + { + tuple result((detail::new_reference)::PyTuple_New(N)); + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_MAKE_TUPLE_ARG, _) + return result; + } + +# undef BOOST_PYTHON_MAKE_TUPLE_ARG + +# undef N +# endif // BOOST_PYTHON_SYNOPSIS diff --git a/pxr/external/boost/python/detail/map_entry.hpp b/pxr/external/boost/python/detail/map_entry.hpp new file mode 100644 index 0000000000..8bf1759f9f --- /dev/null +++ b/pxr/external/boost/python/detail/map_entry.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAP_ENTRY_DWA2002118_HPP +# define MAP_ENTRY_DWA2002118_HPP + +namespace boost { namespace python { namespace detail { + +// A trivial type that works well as the value_type of associative +// vector maps +template +struct map_entry +{ + map_entry() {} + map_entry(Key k) : key(k), value() {} + map_entry(Key k, Value v) : key(k), value(v) {} + + bool operator<(map_entry const& rhs) const + { + return this->key < rhs.key; + } + + Key key; + Value value; +}; + +template +bool operator<(map_entry const& e, Key const& k) +{ + return e.key < k; +} + +template +bool operator<(Key const& k, map_entry const& e) +{ + return k < e.key; +} + + +}}} // namespace boost::python::detail + +#endif // MAP_ENTRY_DWA2002118_HPP diff --git a/pxr/external/boost/python/detail/mpl_lambda.hpp b/pxr/external/boost/python/detail/mpl_lambda.hpp new file mode 100644 index 0000000000..a20608e710 --- /dev/null +++ b/pxr/external/boost/python/detail/mpl_lambda.hpp @@ -0,0 +1,12 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MPL_LAMBDA_DWA2002122_HPP +# define MPL_LAMBDA_DWA2002122_HPP + +// this header should go away soon +# include +# define BOOST_PYTHON_MPL_LAMBDA_SUPPORT BOOST_MPL_AUX_LAMBDA_SUPPORT + +#endif // MPL_LAMBDA_DWA2002122_HPP diff --git a/pxr/external/boost/python/detail/msvc_typeinfo.hpp b/pxr/external/boost/python/detail/msvc_typeinfo.hpp new file mode 100644 index 0000000000..bfc84164f0 --- /dev/null +++ b/pxr/external/boost/python/detail/msvc_typeinfo.hpp @@ -0,0 +1,84 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MSVC_TYPEINFO_DWA200222_HPP +# define MSVC_TYPEINFO_DWA200222_HPP + +#include +#include + +// +// Fix for icc's broken typeid() implementation which doesn't strip +// decoration. This fix doesn't handle cv-qualified array types. It +// could probably be done, but I haven't figured it out yet. +// + +// Note: This file is badly named. It initially was MSVC specific, but was +// extended to cover intel too. Now the old version of MSVC is no longer +// supported, but the intel version is still supported. + +# if defined(BOOST_INTEL_CXX_VERSION) && BOOST_INTEL_CXX_VERSION <= 700 + +namespace boost { namespace python { namespace detail { + +typedef std::type_info const& typeinfo; + +template +static typeinfo typeid_nonref(T const volatile*) { return typeid(T); } + +template +inline typeinfo typeid_ref_1(T&(*)()) +{ + return detail::typeid_nonref((T*)0); +} + +// A non-reference +template +inline typeinfo typeid_ref(type*, T&(*)(type)) +{ + return detail::typeid_nonref((T*)0); +} + +// A reference +template +inline typeinfo typeid_ref(type*, ...) +{ + return detail::typeid_ref_1((T(*)())0); +} + +#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) +# define BOOST_PYTT_DECL __cdecl +#else +# define BOOST_PYTT_DECL /**/ +#endif + +template< typename T > T&(* is_ref_tester1(type) )(type) { return 0; } +inline char BOOST_PYTT_DECL is_ref_tester1(...) { return 0; } + +template +inline typeinfo msvc_typeid(boost::type*) +{ + return detail::typeid_ref( + (boost::type*)0, detail::is_ref_tester1(type()) + ); +} + +template <> +inline typeinfo msvc_typeid(boost::type*) +{ + return typeid(void); +} + +# ifndef NDEBUG +inline typeinfo assert_array_typeid_compiles() +{ + return msvc_typeid((boost::type*)0) + , msvc_typeid((boost::type*)0); +} +# endif + +}}} // namespace boost::python::detail + +# endif // BOOST_INTEL_CXX_VERSION +#endif // MSVC_TYPEINFO_DWA200222_HPP diff --git a/pxr/external/boost/python/detail/none.hpp b/pxr/external/boost/python/detail/none.hpp new file mode 100644 index 0000000000..bc3337a234 --- /dev/null +++ b/pxr/external/boost/python/detail/none.hpp @@ -0,0 +1,20 @@ +// (C) Copyright David Abrahams 2000. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of Dragon Systems, Inc., in +// producing this work. + +#ifndef NONE_DWA_052000_H_ +# define NONE_DWA_052000_H_ + +# include + +namespace boost { namespace python { namespace detail { + +inline PyObject* none() { Py_INCREF(Py_None); return Py_None; } + +}}} // namespace boost::python::detail + +#endif // NONE_DWA_052000_H_ diff --git a/pxr/external/boost/python/detail/not_specified.hpp b/pxr/external/boost/python/detail/not_specified.hpp new file mode 100644 index 0000000000..2f7c7ad997 --- /dev/null +++ b/pxr/external/boost/python/detail/not_specified.hpp @@ -0,0 +1,14 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef NOT_SPECIFIED_DWA2002321_HPP +# define NOT_SPECIFIED_DWA2002321_HPP + +namespace boost { namespace python { namespace detail { + + struct not_specified {}; + +}}} // namespace boost::python::detail + +#endif // NOT_SPECIFIED_DWA2002321_HPP diff --git a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp new file mode 100644 index 0000000000..9dcc434f8e --- /dev/null +++ b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp @@ -0,0 +1,46 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP +# define NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +// nullary_function_adaptor -- a class template which ignores its +// arguments and calls a nullary function instead. Used for building +// error-reporting functions, c.f. pure_virtual +template +struct nullary_function_adaptor +{ + nullary_function_adaptor(NullaryFunction fn) + : m_fn(fn) + {} + + void operator()() const { m_fn(); } + +# define BOOST_PP_LOCAL_MACRO(i) \ + template \ + void operator()( \ + BOOST_PP_ENUM_BINARY_PARAMS_Z(1, i, A, const& BOOST_PP_INTERCEPT) \ + ) const \ + { \ + m_fn(); \ + } + +# define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY) +# include BOOST_PP_LOCAL_ITERATE() + + private: + NullaryFunction m_fn; +}; + +}}} // namespace boost::python::detail + +#endif // NULLARY_FUNCTION_ADAPTOR_DWA2003824_HPP diff --git a/pxr/external/boost/python/detail/operator_id.hpp b/pxr/external/boost/python/detail/operator_id.hpp new file mode 100644 index 0000000000..ecfc70f108 --- /dev/null +++ b/pxr/external/boost/python/detail/operator_id.hpp @@ -0,0 +1,63 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OPERATOR_ID_DWA2002531_HPP +# define OPERATOR_ID_DWA2002531_HPP + +namespace boost { namespace python { namespace detail { + +enum operator_id +{ + op_add, + op_sub, + op_mul, + op_div, + op_mod, + op_divmod, + op_pow, + op_lshift, + op_rshift, + op_and, + op_xor, + op_or, + op_neg, + op_pos, + op_abs, + op_invert, + op_int, + op_long, + op_float, + op_str, + op_cmp, + op_gt, + op_ge, + op_lt, + op_le, + op_eq, + op_ne, + op_iadd, + op_isub, + op_imul, + op_idiv, + op_imod, + op_ilshift, + op_irshift, + op_iand, + op_ixor, + op_ior, + op_complex, +#if PY_VERSION_HEX >= 0x03000000 + op_bool, +#else + op_nonzero, +#endif + op_repr +#if PY_VERSION_HEX >= 0x03000000 + ,op_truediv +#endif +}; + +}}} // namespace boost::python::detail + +#endif // OPERATOR_ID_DWA2002531_HPP diff --git a/pxr/external/boost/python/detail/overloads_fwd.hpp b/pxr/external/boost/python/detail/overloads_fwd.hpp new file mode 100644 index 0000000000..4c7fdf292b --- /dev/null +++ b/pxr/external/boost/python/detail/overloads_fwd.hpp @@ -0,0 +1,18 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OVERLOADS_FWD_DWA2002101_HPP +# define OVERLOADS_FWD_DWA2002101_HPP + +namespace boost { namespace python { namespace detail { + +// forward declarations +struct overloads_base; + +template +inline void define_with_defaults(char const* name, OverloadsT const&, NameSpaceT&, SigT const&); + +}}} // namespace boost::python::detail + +#endif // OVERLOADS_FWD_DWA2002101_HPP diff --git a/pxr/external/boost/python/detail/pointee.hpp b/pxr/external/boost/python/detail/pointee.hpp new file mode 100644 index 0000000000..e786b37626 --- /dev/null +++ b/pxr/external/boost/python/detail/pointee.hpp @@ -0,0 +1,35 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef POINTEE_DWA2002323_HPP +# define POINTEE_DWA2002323_HPP + +# include + +namespace boost { namespace python { namespace detail { + +template +struct pointee_impl +{ + template struct apply : remove_pointer {}; +}; + +template <> +struct pointee_impl +{ + template struct apply + { + typedef typename T::element_type type; + }; +}; + +template +struct pointee + : pointee_impl::value>::template apply +{ +}; + +}}} // namespace boost::python::detail + +#endif // POINTEE_DWA2002323_HPP diff --git a/pxr/external/boost/python/detail/prefix.hpp b/pxr/external/boost/python/detail/prefix.hpp new file mode 100644 index 0000000000..8b34ed7701 --- /dev/null +++ b/pxr/external/boost/python/detail/prefix.hpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PREFIX_DWA2003531_HPP +# define PREFIX_DWA2003531_HPP + +// The rule is that must be included before any system +// headers (so it can get control over some awful macros). +// Unfortunately, Boost.Python needs to #include first, at +// least... but this gets us as close as possible. + +# include +# include + +#endif // PREFIX_DWA2003531_HPP diff --git a/pxr/external/boost/python/detail/preprocessor.hpp b/pxr/external/boost/python/detail/preprocessor.hpp new file mode 100644 index 0000000000..2c1b2e84ea --- /dev/null +++ b/pxr/external/boost/python/detail/preprocessor.hpp @@ -0,0 +1,66 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PREPROCESSOR_DWA200247_HPP +# define PREPROCESSOR_DWA200247_HPP + +# include +# include +# include +# include + +// stuff that should be in the preprocessor library + +# define BOOST_PYTHON_APPLY(x) BOOST_PP_CAT(BOOST_PYTHON_APPLY_, x) + +# define BOOST_PYTHON_APPLY_BOOST_PYTHON_ITEM(v) v +# define BOOST_PYTHON_APPLY_BOOST_PYTHON_NIL + +// cv-qualifiers + +# if !defined(__MWERKS__) || __MWERKS__ > 0x2407 +# define BOOST_PYTHON_CV_COUNT 4 +# else +# define BOOST_PYTHON_CV_COUNT 1 +# endif + +# ifndef BOOST_PYTHON_MAX_ARITY +# define BOOST_PYTHON_MAX_ARITY 15 +# endif + +# ifndef BOOST_PYTHON_MAX_BASES +# define BOOST_PYTHON_MAX_BASES 10 +# endif + +# define BOOST_PYTHON_CV_QUALIFIER(i) \ + BOOST_PYTHON_APPLY( \ + BOOST_PP_TUPLE_ELEM(4, i, BOOST_PYTHON_CV_QUALIFIER_I) \ + ) + +# define BOOST_PYTHON_CV_QUALIFIER_I \ + ( \ + BOOST_PYTHON_NIL, \ + BOOST_PYTHON_ITEM(const), \ + BOOST_PYTHON_ITEM(volatile), \ + BOOST_PYTHON_ITEM(const volatile) \ + ) + +// enumerators +# define BOOST_PYTHON_UNARY_ENUM(c, text) BOOST_PP_REPEAT(c, BOOST_PYTHON_UNARY_ENUM_I, text) +# define BOOST_PYTHON_UNARY_ENUM_I(z, n, text) BOOST_PP_COMMA_IF(n) text ## n + +# define BOOST_PYTHON_BINARY_ENUM(c, a, b) BOOST_PP_REPEAT(c, BOOST_PYTHON_BINARY_ENUM_I, (a, b)) +# define BOOST_PYTHON_BINARY_ENUM_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, _), n) + +# define BOOST_PYTHON_ENUM_WITH_DEFAULT(c, text, def) BOOST_PP_REPEAT(c, BOOST_PYTHON_ENUM_WITH_DEFAULT_I, (text, def)) +# define BOOST_PYTHON_ENUM_WITH_DEFAULT_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) = BOOST_PP_TUPLE_ELEM(2, 1, _) + +// fixed text (no commas) +# define BOOST_PYTHON_FIXED(z, n, text) text + +// flags +# define BOOST_PYTHON_FUNCTION_POINTER 0x0001 +# define BOOST_PYTHON_POINTER_TO_MEMBER 0x0002 + +#endif // PREPROCESSOR_DWA200247_HPP diff --git a/pxr/external/boost/python/detail/python22_fixed.h b/pxr/external/boost/python/detail/python22_fixed.h new file mode 100644 index 0000000000..32bf941fef --- /dev/null +++ b/pxr/external/boost/python/detail/python22_fixed.h @@ -0,0 +1,152 @@ +// This file is a modified version of Python 2.2/2.2.1 Python.h. As +// such it is: +// +// Copyright (c) 2001, 2002 Python Software Foundation; All Rights +// Reserved +// +// boostinspect:nolicense (don't complain about the lack of a Boost license) +// +// Changes from the original: +// 1. #includes for Python 2.2.1 +// 2. Provides missing extern "C" wrapper for "iterobject.h" and "descrobject.h". +// + +// Changes marked with "Boost.Python modification" +#ifndef Py_PYTHON_H +#define Py_PYTHON_H +/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ + + +/* Enable compiler features; switching on C lib defines doesn't work + here, because the symbols haven't necessarily been defined yet. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +/* Forcing SUSv2 compatibility still produces problems on some + platforms, True64 and SGI IRIX begin two of them, so for now the + define is switched off. */ +#if 0 +#ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 500 +#endif +#endif + +/* Include nearly all Python header files */ + +#include "patchlevel.h" +#include "pyconfig.h" + +#ifdef HAVE_LIMITS_H +#include +#endif + +/* pyconfig.h may or may not define DL_IMPORT */ +#ifndef DL_IMPORT /* declarations for DLL import/export */ +#define DL_IMPORT(RTYPE) RTYPE +#endif +#ifndef DL_EXPORT /* declarations for DLL import/export */ +#define DL_EXPORT(RTYPE) RTYPE +#endif + +#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) +#define _SGI_MP_SOURCE +#endif + +#include +#ifndef NULL +# error "Python.h requires that stdio.h define NULL." +#endif + +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#if PY_MICRO_VERSION == 1 // Boost.Python modification: emulate Python 2.2 +#ifdef HAVE_UNISTD_H +#include +#endif +#endif // Boost.Python modification: emulate Python 2.2 + +/* CAUTION: Build setups should ensure that NDEBUG is defined on the + * compiler command line when building Python in release mode; else + * assert() calls won't be removed. + */ +#include + +#include "pyport.h" + +#include "pymem.h" + +#include "object.h" +#include "objimpl.h" + +#include "pydebug.h" + +#include "unicodeobject.h" +#include "intobject.h" +#include "longobject.h" +#include "floatobject.h" +#ifndef WITHOUT_COMPLEX +#include "complexobject.h" +#endif +#include "rangeobject.h" +#include "stringobject.h" +#include "bufferobject.h" +#include "tupleobject.h" +#include "listobject.h" +#include "dictobject.h" +#include "methodobject.h" +#include "moduleobject.h" +#include "funcobject.h" +#include "classobject.h" +#include "fileobject.h" +#include "cobject.h" +#include "traceback.h" +#include "sliceobject.h" +#include "cellobject.h" +extern "C" { // Boost.Python modification: provide missing extern "C" +#include "iterobject.h" +#include "descrobject.h" +} // Boost.Python modification: provide missing extern "C" +#include "weakrefobject.h" + +#include "codecs.h" +#include "pyerrors.h" + +#include "pystate.h" + +#include "modsupport.h" +#include "pythonrun.h" +#include "ceval.h" +#include "sysmodule.h" +#include "intrcheck.h" +#include "import.h" + +#include "abstract.h" + +#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) +#define PyArg_NoArgs(v) PyArg_Parse(v, "") + +/* Convert a possibly signed character to a nonnegative int */ +/* XXX This assumes characters are 8 bits wide */ +#ifdef __CHAR_UNSIGNED__ +#define Py_CHARMASK(c) (c) +#else +#define Py_CHARMASK(c) ((c) & 0xff) +#endif + +#include "pyfpe.h" + +/* These definitions must match corresponding definitions in graminit.h. + There's code in compile.c that checks that they are the same. */ +#define Py_single_input 256 +#define Py_file_input 257 +#define Py_eval_input 258 + +#ifdef HAVE_PTH +/* GNU pth user-space thread support */ +#include +#endif +#endif /* !Py_PYTHON_H */ diff --git a/pxr/external/boost/python/detail/python_type.hpp b/pxr/external/boost/python/detail/python_type.hpp new file mode 100644 index 0000000000..f7630c175a --- /dev/null +++ b/pxr/external/boost/python/detail/python_type.hpp @@ -0,0 +1,37 @@ +// Copyright Nikolay Mladenov 2007. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_PYTHON_OBJECT_PYTHON_TYPE_H +#define BOOST_PYTHON_OBJECT_PYTHON_TYPE_H + +#include + +namespace boost {namespace python {namespace detail{ + + +template struct python_class : PyObject +{ + typedef python_class this_type; + + typedef T type; + + static void *converter (PyObject *p){ + return p; + } + + static void register_() + { + static bool first_time = true; + + if ( !first_time ) return; + + first_time = false; + converter::registry::insert(&converter, boost::python::type_id(), &converter::registered_pytype_direct::get_pytype); + } +}; + + +}}} //namespace boost :: python :: detail + +#endif //BOOST_PYTHON_OBJECT_PYTHON_TYPE_H diff --git a/pxr/external/boost/python/detail/raw_pyobject.hpp b/pxr/external/boost/python/detail/raw_pyobject.hpp new file mode 100644 index 0000000000..194409eda4 --- /dev/null +++ b/pxr/external/boost/python/detail/raw_pyobject.hpp @@ -0,0 +1,32 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RAW_PYOBJECT_DWA2002628_HPP +# define RAW_PYOBJECT_DWA2002628_HPP + +namespace boost { namespace python { namespace detail { + +// +// Define some types which we can use to get around the vagaries of +// PyObject*. We will use these to initialize object instances, and +// keep them in namespace detail to make sure they stay out of the +// hands of users. That is much simpler than trying to grant +// friendship to all the appropriate parties. +// + +// New references are normally checked for null +struct new_reference_t; +typedef new_reference_t* new_reference; + +// Borrowed references are assumed to be non-null +struct borrowed_reference_t; +typedef borrowed_reference_t* borrowed_reference; + +// New references which aren't checked for null +struct new_non_null_reference_t; +typedef new_non_null_reference_t* new_non_null_reference; + +}}} // namespace boost::python::detail + +#endif // RAW_PYOBJECT_DWA2002628_HPP diff --git a/pxr/external/boost/python/detail/referent_storage.hpp b/pxr/external/boost/python/detail/referent_storage.hpp new file mode 100644 index 0000000000..f646d2ae1d --- /dev/null +++ b/pxr/external/boost/python/detail/referent_storage.hpp @@ -0,0 +1,45 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REFERENT_STORAGE_DWA200278_HPP +# define REFERENT_STORAGE_DWA200278_HPP +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +struct aligned_storage +{ + union type + { + typename ::boost::aligned_storage::type data; + char bytes[size]; + }; +}; + + // Compute the size of T's referent. We wouldn't need this at all, + // but sizeof() is broken in CodeWarriors <= 8.0 + template struct referent_size; + + + template + struct referent_size + { + BOOST_STATIC_CONSTANT( + std::size_t, value = sizeof(T)); + }; + +// A metafunction returning a POD type which can store U, where T == +// U&. If T is not a reference type, returns a POD which can store T. +template +struct referent_storage +{ + typedef typename aligned_storage::value, alignment_of::value>::type type; +}; + +}}} // namespace boost::python::detail + +#endif // REFERENT_STORAGE_DWA200278_HPP diff --git a/pxr/external/boost/python/detail/result.hpp b/pxr/external/boost/python/detail/result.hpp new file mode 100644 index 0000000000..2390693a88 --- /dev/null +++ b/pxr/external/boost/python/detail/result.hpp @@ -0,0 +1,133 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef RESULT_DWA2002521_HPP +# define RESULT_DWA2002521_HPP + +# include + +# include +# include + +# include + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +// Defines a family of overloaded function which, given x, a function +// pointer, member [function] pointer, or an AdaptableFunction object, +// returns a pointer to type*, where R is the result type of +// invoking the result of bind(x). +// +// In order to work around bugs in deficient compilers, if x might be +// an AdaptableFunction object, you must pass OL as a second argument +// to get this to work portably. + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (4, (0, BOOST_PYTHON_MAX_ARITY, , BOOST_PYTHON_FUNCTION_POINTER)) +# include BOOST_PP_ITERATE() + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (4, (0, BOOST_PYTHON_CV_COUNT - 1, , BOOST_PYTHON_POINTER_TO_MEMBER)) +# include BOOST_PP_ITERATE() + +template +boost::type* result(R (T::*), int = 0) { return 0; } + +# if (defined(__MWERKS__) && __MWERKS__ < 0x3000) +// This code actually works on all implementations, but why use it when we don't have to? +template +struct get_result_type +{ + typedef boost::type type; +}; + +struct void_type +{ + typedef void type; +}; + +template +struct result_result +{ + typedef typename mpl::if_c< + is_class::value + , get_result_type + , void_type + >::type t1; + + typedef typename t1::type* type; +}; + +template +typename result_result::type +result(X const&, short) { return 0; } + +# else // Simpler code for more-capable compilers +template +boost::type* +result(X const&, short = 0) { return 0; } + +# endif + +}}} // namespace boost::python::detail + +# endif // RESULT_DWA2002521_HPP + +/* --------------- function pointers --------------- */ +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, result.hpp(function pointers)) +# endif + +# define N BOOST_PP_ITERATION() + +template +boost::type* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0) +{ + return 0; +} + +# undef N + +/* --------------- pointers-to-members --------------- */ +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER +// Outer over cv-qualifiers + +# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +#elif BOOST_PP_ITERATION_DEPTH() == 2 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, result.hpp(pointers-to-members)) +# endif +// Inner over arities + +# define N BOOST_PP_ITERATION() +# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) + +template +boost::type* result(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0) +{ + return 0; +} + +# undef N +# undef Q + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/detail/scope.hpp b/pxr/external/boost/python/detail/scope.hpp new file mode 100644 index 0000000000..5367bbd35c --- /dev/null +++ b/pxr/external/boost/python/detail/scope.hpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SCOPE_DWA2002927_HPP +# define SCOPE_DWA2002927_HPP + +# include + +namespace boost { namespace python { namespace detail { + +void BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& obj, char const* doc); + +}}} // namespace boost::python::detail + +#endif // SCOPE_DWA2002927_HPP diff --git a/pxr/external/boost/python/detail/sfinae.hpp b/pxr/external/boost/python/detail/sfinae.hpp new file mode 100644 index 0000000000..6281875111 --- /dev/null +++ b/pxr/external/boost/python/detail/sfinae.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef SFINAE_DWA2004723_HPP +# define SFINAE_DWA2004723_HPP + +# include + +# if defined(BOOST_NO_SFINAE) && !defined(BOOST_MSVC) +# define BOOST_PYTHON_NO_SFINAE +# endif + +#endif // SFINAE_DWA2004723_HPP diff --git a/pxr/external/boost/python/detail/signature.hpp b/pxr/external/boost/python/detail/signature.hpp new file mode 100644 index 0000000000..11268b92cf --- /dev/null +++ b/pxr/external/boost/python/detail/signature.hpp @@ -0,0 +1,106 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef SIGNATURE_DWA20021121_HPP +# define SIGNATURE_DWA20021121_HPP + +# include + +# include +# include +# include + +# include +# include + +# include +# include + +namespace boost { namespace python { namespace detail { + +struct signature_element +{ + char const* basename; + converter::pytype_function pytype_f; + bool lvalue; +}; + +struct py_func_sig_info +{ + signature_element const *signature; + signature_element const *ret; +}; + +template struct signature_arity; + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY + 1, )) +# include BOOST_PP_ITERATE() + +// A metafunction returning the base class used for +// +// signature. +// +template +struct signature_base_select +{ + enum { arity = mpl::size::value - 1 }; + typedef typename signature_arity::template impl type; +}; + +template +struct signature + : signature_base_select::type +{ +}; + +}}} // namespace boost::python::detail + +# endif // SIGNATURE_DWA20021121_HPP + +#else + +# define N BOOST_PP_ITERATION() + +template <> +struct signature_arity +{ + template + struct impl + { + static signature_element const* elements() + { + static signature_element const result[N+2] = { + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# define BOOST_PP_LOCAL_MACRO(i) \ + { \ + type_id::type>().name() \ + , &converter::expected_pytype_for_arg::type>::get_pytype \ + , indirect_traits::is_reference_to_non_const::type>::value \ + }, +#else +# define BOOST_PP_LOCAL_MACRO(i) \ + { \ + type_id::type>().name() \ + , 0 \ + , indirect_traits::is_reference_to_non_const::type>::value \ + }, +#endif + +# define BOOST_PP_LOCAL_LIMITS (0, N) +# include BOOST_PP_LOCAL_ITERATE() + {0,0,0} + }; + return result; + } + }; +}; + +#endif // BOOST_PP_IS_ITERATING + + diff --git a/pxr/external/boost/python/detail/string_literal.hpp b/pxr/external/boost/python/detail/string_literal.hpp new file mode 100644 index 0000000000..0961ec7c4e --- /dev/null +++ b/pxr/external/boost/python/detail/string_literal.hpp @@ -0,0 +1,49 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef STRING_LITERAL_DWA2002629_HPP +# define STRING_LITERAL_DWA2002629_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +struct is_string_literal : mpl::false_ +{ +}; + +# if !defined(__MWERKS__) || __MWERKS__ > 0x2407 +template +struct is_string_literal : mpl::true_ +{ +}; + +# if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590040)) \ + || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730) +// This compiler mistakenly gets the type of string literals as char* +// instead of char[NN]. +template <> +struct is_string_literal : mpl::true_ +{ +}; +# endif + +# else + +// CWPro7 has trouble with the array type deduction above +template +struct is_string_literal + : is_same +{ +}; +# endif + +}}} // namespace boost::python::detail + +#endif // STRING_LITERAL_DWA2002629_HPP diff --git a/pxr/external/boost/python/detail/target.hpp b/pxr/external/boost/python/detail/target.hpp new file mode 100644 index 0000000000..137801bb2b --- /dev/null +++ b/pxr/external/boost/python/detail/target.hpp @@ -0,0 +1,86 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef TARGET_DWA2002521_HPP +# define TARGET_DWA2002521_HPP + +# include + +# include + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (4, (0, BOOST_PYTHON_MAX_ARITY, , BOOST_PYTHON_FUNCTION_POINTER)) +# include BOOST_PP_ITERATE() + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (4, (0, BOOST_PYTHON_CV_COUNT - 1, , BOOST_PYTHON_POINTER_TO_MEMBER)) +# include BOOST_PP_ITERATE() + +template +T& (* target(R (T::*)) )() { return 0; } + +}}} // namespace boost::python::detail + +# endif // TARGET_DWA2002521_HPP + +/* --------------- function pointers --------------- */ +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers)) +# endif + +# define N BOOST_PP_ITERATION() + +template +BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )() +{ + return 0; +} + +# undef N + +/* --------------- pointers-to-members --------------- */ +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER +// Outer over cv-qualifiers + +# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +#elif BOOST_PP_ITERATION_DEPTH() == 2 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members)) +# endif +// Inner over arities + +# define N BOOST_PP_ITERATION() +# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) + +template +T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )() +{ + return 0; +} + +# undef N +# undef Q + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/detail/translate_exception.hpp b/pxr/external/boost/python/detail/translate_exception.hpp new file mode 100644 index 0000000000..877db2b2c6 --- /dev/null +++ b/pxr/external/boost/python/detail/translate_exception.hpp @@ -0,0 +1,67 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TRANSLATE_EXCEPTION_TDS20091020_HPP +# define TRANSLATE_EXCEPTION_TDS20091020_HPP + +# include +# include + +# include + +# include + +namespace boost { namespace python { namespace detail { + +// A ternary function object used to translate C++ exceptions of type +// ExceptionType into Python exceptions by invoking an object of type +// Translate. Typically the translate function will be curried with +// boost::bind(). +template +struct translate_exception +{ +// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 +# if defined(__linux__) && defined(__GNUC__) \ + && BOOST_WORKAROUND(__GNUC__, == 3) \ + && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ + && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ + || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) + typedef typename remove_reference< + typename add_const::type + >::type exception_non_ref; +# else + typedef typename add_lvalue_reference< + typename add_const::type + >::type exception_cref; +# endif + + inline bool operator()( + exception_handler const& handler + , function0 const& f + , typename call_traits::param_type translate) const + { + try + { + return handler(f); + } +// workaround for broken gcc that ships with SuSE 9.0 and SuSE 9.1 +# if defined(__linux__) && defined(__GNUC__) \ + && BOOST_WORKAROUND(__GNUC__, == 3) \ + && BOOST_WORKAROUND(__GNUC_MINOR__, == 3) \ + && (BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 1) \ + || BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, == 3)) + catch(exception_non_ref& e) +# else + catch(exception_cref e) +# endif + { + translate(e); + return true; + } + } +}; + +}}} // namespace boost::python::detail + +#endif // TRANSLATE_EXCEPTION_DWA2002810_HPP diff --git a/pxr/external/boost/python/detail/type_list.hpp b/pxr/external/boost/python/detail/type_list.hpp new file mode 100644 index 0000000000..0ad3f63d84 --- /dev/null +++ b/pxr/external/boost/python/detail/type_list.hpp @@ -0,0 +1,35 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TYPE_LIST_DWA2002913_HPP +# define TYPE_LIST_DWA2002913_HPP + +# include +# include +# include + +# if BOOST_PYTHON_MAX_ARITY + 2 > BOOST_PYTHON_MAX_BASES +# define BOOST_PYTHON_LIST_SIZE BOOST_PP_INC(BOOST_PP_INC(BOOST_PYTHON_MAX_ARITY)) +# else +# define BOOST_PYTHON_LIST_SIZE BOOST_PYTHON_MAX_BASES +# endif + +// Compute the MPL vector header to use for lists up to BOOST_PYTHON_LIST_SIZE in length +# if BOOST_PYTHON_LIST_SIZE > 48 +# error Arities above 48 not supported by Boost.Python due to MPL internal limit +# elif BOOST_PYTHON_LIST_SIZE > 38 +# include +# elif BOOST_PYTHON_LIST_SIZE > 28 +# include +# elif BOOST_PYTHON_LIST_SIZE > 18 +# include +# elif BOOST_PYTHON_LIST_SIZE > 8 +# include +# else +# include +# endif + +# include + +#endif // TYPE_LIST_DWA2002913_HPP diff --git a/pxr/external/boost/python/detail/type_list_impl.hpp b/pxr/external/boost/python/detail/type_list_impl.hpp new file mode 100644 index 0000000000..fdcfa85030 --- /dev/null +++ b/pxr/external/boost/python/detail/type_list_impl.hpp @@ -0,0 +1,57 @@ +#ifndef BOOST_PP_IS_ITERATING +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# ifndef TYPE_LIST_IMPL_DWA2002913_HPP +# define TYPE_LIST_IMPL_DWA2002913_HPP + +# include + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +struct type_list + : BOOST_PP_CAT(mpl::vector,BOOST_PYTHON_LIST_SIZE) +{ +}; + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PP_DEC(BOOST_PYTHON_LIST_SIZE), )) +# include BOOST_PP_ITERATE() + + +}}} // namespace boost::python::detail + +# endif // TYPE_LIST_IMPL_DWA2002913_HPP + +#else // BOOST_PP_IS_ITERATING + +# define N BOOST_PP_ITERATION() +# define BOOST_PYTHON_VOID_ARGS BOOST_PP_SUB_D(1,BOOST_PYTHON_LIST_SIZE,N) + +template < + BOOST_PP_ENUM_PARAMS_Z(1, N, class T) + > +struct type_list< + BOOST_PP_ENUM_PARAMS_Z(1, N, T) + BOOST_PP_COMMA_IF(N) + BOOST_PP_ENUM( + BOOST_PYTHON_VOID_ARGS, BOOST_PYTHON_FIXED, mpl::void_) + > + : BOOST_PP_CAT(mpl::vector,N) +{ +}; + +# undef BOOST_PYTHON_VOID_ARGS +# undef N + +#endif // BOOST_PP_IS_ITERATING diff --git a/pxr/external/boost/python/detail/type_traits.hpp b/pxr/external/boost/python/detail/type_traits.hpp new file mode 100644 index 0000000000..fda54c80f2 --- /dev/null +++ b/pxr/external/boost/python/detail/type_traits.hpp @@ -0,0 +1,111 @@ +// Copyright Shreyans Doshi 2017. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP +# define BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP + + +#include +#ifdef BOOST_NO_CXX11_HDR_TYPE_TRAITS +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#else +# include +#endif + +# include +# include +# include + + +namespace boost { namespace python { namespace detail { + +#ifdef BOOST_NO_CXX11_HDR_TYPE_TRAITS + using boost::alignment_of; + using boost::add_const; + using boost::add_cv; + using boost::add_lvalue_reference; + using boost::add_pointer; + + using boost::is_array; + using boost::is_class; + using boost::is_const; + using boost::is_convertible; + using boost::is_enum; + using boost::is_function; + using boost::is_integral; + using boost::is_lvalue_reference; + using boost::is_member_function_pointer; + using boost::is_member_pointer; + using boost::is_pointer; + using boost::is_polymorphic; + using boost::is_reference; + using boost::is_same; + using boost::is_scalar; + using boost::is_union; + using boost::is_void; + using boost::is_volatile; + + using boost::remove_reference; + using boost::remove_pointer; + using boost::remove_cv; + using boost::remove_const; + + using boost::mpl::true_; + using boost::mpl::false_; +#else + using std::alignment_of; + using std::add_const; + using std::add_cv; + using std::add_lvalue_reference; + using std::add_pointer; + + using std::is_array; + using std::is_class; + using std::is_const; + using std::is_convertible; + using std::is_enum; + using std::is_function; + using std::is_integral; + using std::is_lvalue_reference; + using std::is_member_function_pointer; + using std::is_member_pointer; + using std::is_pointer; + using std::is_polymorphic; + using std::is_reference; + using std::is_same; + using std::is_scalar; + using std::is_union; + using std::is_void; + using std::is_volatile; + + using std::remove_reference; + using std::remove_pointer; + using std::remove_cv; + using std::remove_const; + + typedef std::integral_constant true_; + typedef std::integral_constant false_; +#endif + using boost::is_base_and_derived; + using boost::type_with_alignment; + using boost::has_trivial_copy; +}}} // namespace boost::python::detail + + +#endif //BOOST_DETAIL_TYPE_TRAITS_HPP diff --git a/pxr/external/boost/python/detail/unwind_type.hpp b/pxr/external/boost/python/detail/unwind_type.hpp new file mode 100644 index 0000000000..b81bf7c898 --- /dev/null +++ b/pxr/external/boost/python/detail/unwind_type.hpp @@ -0,0 +1,172 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef UNWIND_TYPE_DWA200222_HPP +# define UNWIND_TYPE_DWA200222_HPP + +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +#if (!defined(_MSC_VER) || _MSC_VER >= 1915) +// If forward declared, msvc6.5 does not recognize them as inline. +// However, as of msvc14.15 (_MSC_VER 1915/Visual Studio 15.8.0) name lookup is now consistent with other compilers. +// forward declaration, required (at least) by Tru64 cxx V6.5-042 and msvc14.15 +template +inline typename Generator::result_type +unwind_type(U const& p, Generator* = 0); + +// forward declaration, required (at least) by Tru64 cxx V6.5-042 and msvc14.15 +template +inline typename Generator::result_type +unwind_type(boost::type*p = 0, Generator* = 0); +#endif + +template +inline typename Generator::result_type +unwind_type_cv(U* p, cv_unqualified, Generator* = 0) +{ + return Generator::execute(p); +} + +template +inline typename Generator::result_type +unwind_type_cv(U const* p, const_, Generator* = 0) +{ + return unwind_type(const_cast(p), (Generator*)0); +} + +template +inline typename Generator::result_type +unwind_type_cv(U volatile* p, volatile_, Generator* = 0) +{ + return unwind_type(const_cast(p), (Generator*)0); +} + +template +inline typename Generator::result_type +unwind_type_cv(U const volatile* p, const_volatile_, Generator* = 0) +{ + return unwind_type(const_cast(p), (Generator*)0); +} + +template +inline typename Generator::result_type +unwind_ptr_type(U* p, Generator* = 0) +{ + typedef typename cv_category::type tag; + return unwind_type_cv(p, tag()); +} + +template +struct unwind_helper +{ + template + static typename Generator::result_type + execute(U p, Generator* = 0) + { + return unwind_ptr_type(p, (Generator*)0); + } +}; + +template <> +struct unwind_helper +{ + template + static typename Generator::result_type + execute(U& p, Generator* = 0) + { + return unwind_ptr_type(&p, (Generator*)0); + } +}; + +template +inline typename Generator::result_type +#if (!defined(_MSC_VER) || _MSC_VER >= 1915) +unwind_type(U const& p, Generator*) +#else +unwind_type(U const& p, Generator* = 0) +#endif +{ + return unwind_helper::value>::execute(p, (Generator*)0); +} + +enum { direct_ = 0, pointer_ = 1, reference_ = 2, reference_to_pointer_ = 3 }; +template struct unwind_helper2; + +template <> +struct unwind_helper2 +{ + template + static typename Generator::result_type + execute(U(*)(), Generator* = 0) + { + return unwind_ptr_type((U*)0, (Generator*)0); + } +}; + +template <> +struct unwind_helper2 +{ + template + static typename Generator::result_type + execute(U*(*)(), Generator* = 0) + { + return unwind_ptr_type((U*)0, (Generator*)0); + } +}; + +template <> +struct unwind_helper2 +{ + template + static typename Generator::result_type + execute(U&(*)(), Generator* = 0) + { + return unwind_ptr_type((U*)0, (Generator*)0); + } +}; + +template <> +struct unwind_helper2 +{ + template + static typename Generator::result_type + execute(U&(*)(), Generator* = 0) + { + return unwind_ptr_type(U(0), (Generator*)0); + } +}; + +// Call this one with both template parameters explicitly specified +// and no function arguments: +// +// return unwind_type(); +// +// Doesn't work if T is an array type; we could handle that case, but +// why bother? +template +inline typename Generator::result_type +#if (!defined(_MSC_VER) || _MSC_VER >= 1915) +unwind_type(boost::type*, Generator*) +#else +unwind_type(boost::type*p =0, Generator* =0) +#endif +{ + BOOST_STATIC_CONSTANT(int, indirection + = (is_pointer::value ? pointer_ : 0) + + (indirect_traits::is_reference_to_pointer::value + ? reference_to_pointer_ + : is_lvalue_reference::value + ? reference_ + : 0)); + + return unwind_helper2::execute((U(*)())0,(Generator*)0); +} + +}}} // namespace boost::python::detail + +#endif // UNWIND_TYPE_DWA200222_HPP diff --git a/pxr/external/boost/python/detail/unwrap_type_id.hpp b/pxr/external/boost/python/detail/unwrap_type_id.hpp new file mode 100644 index 0000000000..96c1f53013 --- /dev/null +++ b/pxr/external/boost/python/detail/unwrap_type_id.hpp @@ -0,0 +1,31 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef UNWRAP_TYPE_ID_DWA2004722_HPP +# define UNWRAP_TYPE_ID_DWA2004722_HPP + +# include + +# include + +namespace boost { namespace python { + +template class wrapper; + +namespace detail { + +template +inline type_info unwrap_type_id(T*, ...) +{ + return type_id(); +} + +template +inline type_info unwrap_type_id(U*, wrapper*) +{ + return type_id(); +} + +}}} // namespace boost::python::detail + +#endif // UNWRAP_TYPE_ID_DWA2004722_HPP diff --git a/pxr/external/boost/python/detail/unwrap_wrapper.hpp b/pxr/external/boost/python/detail/unwrap_wrapper.hpp new file mode 100644 index 0000000000..95bc233a72 --- /dev/null +++ b/pxr/external/boost/python/detail/unwrap_wrapper.hpp @@ -0,0 +1,34 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef UNWRAP_WRAPPER_DWA2004723_HPP +# define UNWRAP_WRAPPER_DWA2004723_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +struct unwrap_wrapper_helper +{ + typedef typename T::_wrapper_wrapped_type_ type; +}; + +template +struct unwrap_wrapper_ + : mpl::eval_if,unwrap_wrapper_helper,mpl::identity > +{}; + +template +typename unwrap_wrapper_::type* +unwrap_wrapper(T*) +{ + return 0; +} + +}}} // namespace boost::python::detail + +#endif // UNWRAP_WRAPPER_DWA2004723_HPP diff --git a/pxr/external/boost/python/detail/value_arg.hpp b/pxr/external/boost/python/detail/value_arg.hpp new file mode 100644 index 0000000000..2c938dacca --- /dev/null +++ b/pxr/external/boost/python/detail/value_arg.hpp @@ -0,0 +1,26 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef VALUE_ARG_DWA2004312_HPP +# define VALUE_ARG_DWA2004312_HPP + +# include +# include +# include + +namespace boost { namespace python { namespace detail { + +template +struct value_arg + : mpl::if_< + copy_ctor_mutates_rhs + , T + , typename add_lvalue_reference< + typename add_const::type + >::type + > +{}; + +}}} // namespace boost::python::detail + +#endif // VALUE_ARG_DWA2004312_HPP diff --git a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp new file mode 100644 index 0000000000..53e687f016 --- /dev/null +++ b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp @@ -0,0 +1,28 @@ +// Copyright David Abrahams 2003. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_detail_value_is_shared_ptr_hpp_ +#define boost_python_detail_value_is_shared_ptr_hpp_ + +#include +#include + +namespace boost { namespace python { namespace detail { + +template +struct value_is_shared_ptr +{ + static bool const value = is_shared_ptr + ::type> + ::type> + ::value; + typedef mpl::bool_ type; +}; + +}}} // namespace boost::python::detail + +#endif // VALUE_IS_SHARED_PTR_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/value_is_xxx.hpp b/pxr/external/boost/python/detail/value_is_xxx.hpp new file mode 100644 index 0000000000..e270f89ca3 --- /dev/null +++ b/pxr/external/boost/python/detail/value_is_xxx.hpp @@ -0,0 +1,33 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef VALUE_IS_XXX_DWA2003224_HPP +# define VALUE_IS_XXX_DWA2003224_HPP + +# include +# include +# include + +# include +# include + +namespace boost { namespace python { namespace detail { + +# define BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \ +template \ +struct value_is_##name \ +{ \ + BOOST_PYTHON_IS_XXX_DEF(name,qualified_name,nargs) \ + BOOST_STATIC_CONSTANT(bool, value = is_##name< \ + typename remove_cv< \ + typename remove_reference::type \ + >::type \ + >::value); \ + typedef mpl::bool_ type; \ + \ +}; + +}}} // namespace boost::python::detail + +#endif // VALUE_IS_XXX_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/void_ptr.hpp b/pxr/external/boost/python/detail/void_ptr.hpp new file mode 100644 index 0000000000..5543b23a4a --- /dev/null +++ b/pxr/external/boost/python/detail/void_ptr.hpp @@ -0,0 +1,35 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef VOID_PTR_DWA200239_HPP +# define VOID_PTR_DWA200239_HPP + +# include + +namespace boost { namespace python { namespace detail { + +template +inline U& void_ptr_to_reference(void const volatile* p, U&(*)()) +{ + return *(U*)p; +} + +template +inline void write_void_ptr(void const volatile* storage, void* ptr, T*) +{ + *(T**)storage = (T*)ptr; +} + +// writes U(ptr) into the storage +template +inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U&(*)()) +{ + // stripping CV qualification suppresses warnings on older EDGs + typedef typename remove_cv::type u_stripped; + write_void_ptr(storage, ptr, u_stripped(0)); +} + +}}} // namespace boost::python::detail + +#endif // VOID_PTR_DWA200239_HPP diff --git a/pxr/external/boost/python/detail/void_return.hpp b/pxr/external/boost/python/detail/void_return.hpp new file mode 100644 index 0000000000..30db825177 --- /dev/null +++ b/pxr/external/boost/python/detail/void_return.hpp @@ -0,0 +1,42 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef VOID_RETURN_DWA200274_HPP +# define VOID_RETURN_DWA200274_HPP + +# include + +namespace boost { namespace python { namespace detail { + +struct void_return +{ + void_return() {} + private: + void operator=(void_return const&); +}; + +template +struct returnable +{ + typedef T type; +}; + +# ifdef BOOST_NO_VOID_RETURNS +template <> +struct returnable +{ + typedef void_return type; +}; + +# ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template <> struct returnable : returnable {}; +template <> struct returnable : returnable {}; +template <> struct returnable : returnable {}; +# endif + +# endif // BOOST_NO_VOID_RETURNS + +}}} // namespace boost::python::detail + +#endif // VOID_RETURN_DWA200274_HPP diff --git a/pxr/external/boost/python/detail/wrap_python.hpp b/pxr/external/boost/python/detail/wrap_python.hpp new file mode 100644 index 0000000000..037e4bf2ec --- /dev/null +++ b/pxr/external/boost/python/detail/wrap_python.hpp @@ -0,0 +1,252 @@ +// (C) Copyright David Abrahams 2000. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of Dragon Systems, Inc., in +// producing this work. + +// This file serves as a wrapper around which allows it to be +// compiled with GCC 2.95.2 under Win32 and which disables the default MSVC +// behavior so that a program may be compiled in debug mode without requiring a +// special debugging build of the Python library. + + +// To use the Python debugging library, #define BOOST_DEBUG_PYTHON on the +// compiler command-line. + +// Revision History: +// 05 Mar 01 Suppress warnings under Cygwin with Python 2.0 (Dave Abrahams) +// 04 Mar 01 Rolled in some changes from the Dragon fork (Dave Abrahams) +// 01 Mar 01 define PyObject_INIT() for Python 1.x (Dave Abrahams) + +#ifdef _DEBUG +# ifndef BOOST_DEBUG_PYTHON +# ifdef _MSC_VER + // VC8.0 will complain if system headers are #included both with + // and without _DEBUG defined, so we have to #include all the + // system headers used by pyconfig.h right here. +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# endif +# undef _DEBUG // Don't let Python force the debug library just because we're debugging. +# define DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H +# endif +#endif + +// pyconfig.h defines a macro with hypot name, what breaks libstdc++ math headers +// that Python.h tries to include afterwards. +#if defined(__MINGW32__) +# include +# include +#endif + +# include +# if defined(_SGI_COMPILER_VERSION) && _SGI_COMPILER_VERSION >= 740 +# undef _POSIX_C_SOURCE +# undef _XOPEN_SOURCE +# undef HAVE_STDINT_H // undo Python 2.5.1 define +# endif + +// +// Python's LongObject.h helpfully #defines ULONGLONG_MAX for us, +// which confuses Boost's config +// +#include +#ifndef ULONG_MAX +# define BOOST_PYTHON_ULONG_MAX_UNDEFINED +#endif +#ifndef LONGLONG_MAX +# define BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +#endif +#ifndef ULONGLONG_MAX +# define BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +#endif + +// +// Get ahold of Python's version number +// +#include + +#if PY_MAJOR_VERSION<2 || PY_MAJOR_VERSION==2 && PY_MINOR_VERSION<2 +#error Python 2.2 or higher is required for this version of Boost.Python. +#endif + +// +// Some things we need in order to get Python.h to work with compilers other +// than MSVC on Win32 +// +#if defined(_WIN32) || defined(__CYGWIN__) + +# if defined(__GNUC__) && defined(__CYGWIN__) + +# if defined(__LP64__) +# define SIZEOF_LONG 8 +# else +# define SIZEOF_LONG 4 +# endif + + +# if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 2 + +typedef int pid_t; + +# if defined(__LP64__) +# define WORD_BIT 64 +# else +# define WORD_BIT 32 +# endif +# define hypot _hypot +# include + +# if PY_MAJOR_VERSION < 2 +# define HAVE_CLOCK +# define HAVE_STRFTIME +# define HAVE_STRERROR +# endif + +# define NT_THREADS + +# ifndef NETSCAPE_PI +# define USE_SOCKET +# endif + +# ifdef USE_DL_IMPORT +# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE +# endif + +# ifdef USE_DL_EXPORT +# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE +# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE +# endif + +# define HAVE_LONG_LONG 1 +# define LONG_LONG long long +# endif + +# elif defined(__MWERKS__) + +# ifndef _MSC_VER +# define PY_MSC_VER_DEFINED_FROM_WRAP_PYTHON_H 1 +# define _MSC_VER 900 +# endif + +# undef hypot // undo the evil #define left by Python. + +# elif defined(__BORLANDC__) && !defined(__clang__) +# undef HAVE_HYPOT +# define HAVE_HYPOT 1 +# endif + +#endif // _WIN32 + +#if defined(__GNUC__) +# if defined(__has_warning) +# define BOOST_PYTHON_GCC_HAS_WREGISTER __has_warning("-Wregister") +# else +# define BOOST_PYTHON_GCC_HAS_WREGISTER __GNUC__ >= 7 +# endif +#else +# define BOOST_PYTHON_GCC_HAS_WREGISTER 0 +#endif + +// Python.h header uses `register` keyword until Python 3.4 +#if BOOST_PYTHON_GCC_HAS_WREGISTER +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wregister" +#elif defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 5033) // 'register' is no longer a supported storage class +#endif + +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION == 2 && PY_MICRO_VERSION < 2 +# include +#else +# include +#endif + +#if BOOST_PYTHON_GCC_HAS_WREGISTER +# pragma GCC diagnostic pop +#elif defined(_MSC_VER) +# pragma warning(pop) +#endif +#undef BOOST_PYTHON_GCC_HAS_WREGISTER + +#ifdef BOOST_PYTHON_ULONG_MAX_UNDEFINED +# undef ULONG_MAX +# undef BOOST_PYTHON_ULONG_MAX_UNDEFINED +#endif + +#ifdef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +# undef LONGLONG_MAX +# undef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +#endif + +#ifdef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +# undef ULONGLONG_MAX +# undef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +#endif + +#ifdef PY_MSC_VER_DEFINED_FROM_WRAP_PYTHON_H +# undef _MSC_VER +#endif + +#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H +# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H +# define _DEBUG +# ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H +# undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H +# undef _CRT_NOFORCE_MANIFEST +# endif +#endif + +#if !defined(PY_MAJOR_VERSION) || PY_MAJOR_VERSION < 2 +# define PyObject_INIT(op, typeobj) \ + ( (op)->ob_type = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) +#endif + +// Define Python 3 macros for Python 2.x +#if PY_VERSION_HEX < 0x02060000 + +# define Py_TYPE(o) (((PyObject*)(o))->ob_type) +# define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +# define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) + +# define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, +#endif + +#if PY_VERSION_HEX < 0x030900A4 +# define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) +# define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0) +#endif + + +#ifdef __MWERKS__ +# pragma warn_possunwant off +#elif _MSC_VER +# pragma warning(disable:4786) +#endif + +#if defined(HAVE_LONG_LONG) +# if defined(PY_LONG_LONG) +# define BOOST_PYTHON_LONG_LONG PY_LONG_LONG +# elif defined(LONG_LONG) +# define BOOST_PYTHON_LONG_LONG LONG_LONG +# else +# error "HAVE_LONG_LONG defined but not PY_LONG_LONG or LONG_LONG" +# endif +#endif diff --git a/pxr/external/boost/python/detail/wrapper_base.hpp b/pxr/external/boost/python/detail/wrapper_base.hpp new file mode 100644 index 0000000000..60ac99436e --- /dev/null +++ b/pxr/external/boost/python/detail/wrapper_base.hpp @@ -0,0 +1,89 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef WRAPPER_BASE_DWA2004722_HPP +# define WRAPPER_BASE_DWA2004722_HPP + +# include +# include + +namespace boost { namespace python { + +class override; + +namespace detail +{ + class wrapper_base; + + namespace wrapper_base_ // ADL disabler + { + inline PyObject* get_owner(wrapper_base const volatile& w); + + inline PyObject* + owner_impl(void const volatile* /*x*/, detail::false_) + { + return 0; + } + + template + inline PyObject* + owner_impl(T const volatile* x, detail::true_); + + template + inline PyObject* + owner(T const volatile* x) + { + return wrapper_base_::owner_impl(x,is_polymorphic()); + } + } + + class BOOST_PYTHON_DECL wrapper_base + { + friend void initialize_wrapper(PyObject* self, wrapper_base* w); + friend PyObject* wrapper_base_::get_owner(wrapper_base const volatile& w); + protected: + wrapper_base() : m_self(0) {} + + override get_override( + char const* name, PyTypeObject* class_object) const; + + private: + void detach(); + + private: + PyObject* m_self; + }; + + namespace wrapper_base_ // ADL disabler + { + template + inline PyObject* + owner_impl(T const volatile* x, detail::true_) + { + if (wrapper_base const volatile* w = dynamic_cast(x)) + { + return wrapper_base_::get_owner(*w); + } + return 0; + } + + inline PyObject* get_owner(wrapper_base const volatile& w) + { + return w.m_self; + } + } + + inline void initialize_wrapper(PyObject* self, wrapper_base* w) + { + w->m_self = self; + } + + inline void initialize_wrapper(PyObject* /*self*/, ...) {} + + + +} // namespace detail + +}} // namespace boost::python + +#endif // WRAPPER_BASE_DWA2004722_HPP diff --git a/pxr/external/boost/python/dict.hpp b/pxr/external/boost/python/dict.hpp new file mode 100644 index 0000000000..6fcaf14382 --- /dev/null +++ b/pxr/external/boost/python/dict.hpp @@ -0,0 +1,152 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DICT_20020706_HPP +#define DICT_20020706_HPP + +# include + +#include +#include +#include +#include + +namespace boost { namespace python { + +class dict; + +namespace detail +{ + struct BOOST_PYTHON_DECL dict_base : object + { + // D.clear() -> None. Remove all items from D. + void clear(); + + // D.copy() -> a shallow copy of D + dict copy(); + + // D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None. + object get(object_cref k) const; + + object get(object_cref k, object_cref d) const; + + // D.has_key(k) -> 1 if D has a key k, else 0 + bool has_key(object_cref k) const; + + // D.items() -> list of D's (key, value) pairs, as 2-tuples + list items() const; + + // D.iteritems() -> an iterator over the (key, value) items of D + object iteritems() const; + + // D.iterkeys() -> an iterator over the keys of D + object iterkeys() const; + + // D.itervalues() -> an iterator over the values of D + object itervalues() const; + + // D.keys() -> list of D's keys + list keys() const; + + // D.popitem() -> (k, v), remove and return some (key, value) pair as a + // 2-tuple; but raise KeyError if D is empty + tuple popitem(); + + // D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k) + object setdefault(object_cref k); + + object setdefault(object_cref k, object_cref d); + + // D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k] + void update(object_cref E); + + // D.values() -> list of D's values + list values() const; + + protected: + // dict() -> new empty dictionary. + // dict(mapping) -> new dictionary initialized from a mapping object's + // (key, value) pairs. + // dict(seq) -> new dictionary initialized as if via: + dict_base(); // new dict + explicit dict_base(object_cref data); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict_base, object) + private: + static detail::new_reference call(object const&); + }; +} + +class dict : public detail::dict_base +{ + typedef detail::dict_base base; + public: + // dict() -> new empty dictionary. + // dict(mapping) -> new dictionary initialized from a mapping object's + // (key, value) pairs. + // dict(seq) -> new dictionary initialized as if via: + dict() {} // new dict + + template + explicit dict(T const& data) + : base(object(data)) + { + } + + template + object get(T const& k) const + { + return base::get(object(k)); + } + + template + object get(T1 const& k, T2 const& d) const + { + return base::get(object(k),object(d)); + } + + template + bool has_key(T const& k) const + { + return base::has_key(object(k)); + } + + template + object setdefault(T const& k) + { + return base::setdefault(object(k)); + } + + template + object setdefault(T1 const& k, T2 const& d) + { + return base::setdefault(object(k),object(d)); + } + + template + void update(T const& E) + { + base::update(object(E)); + } + + public: // implementation detail -- for internal use only + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict, base) +}; + +// +// Converter Specializations +// +namespace converter +{ + template <> + struct object_manager_traits + : pytype_object_manager_traits<&PyDict_Type,dict> + { + }; +} + +}} // namespace boost::python + +#endif + diff --git a/pxr/external/boost/python/docstring_options.hpp b/pxr/external/boost/python/docstring_options.hpp new file mode 100644 index 0000000000..1914bd51a5 --- /dev/null +++ b/pxr/external/boost/python/docstring_options.hpp @@ -0,0 +1,127 @@ +// Copyright Ralf W. Grosse-Kunstleve 2006. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef DOCSTRING_OPTIONS_RWGK20060111_HPP +# define DOCSTRING_OPTIONS_RWGK20060111_HPP + +#include + +namespace boost { namespace python { + +// Note: the static data members are defined in object/function.cpp + +class BOOST_PYTHON_DECL docstring_options : boost::noncopyable +{ + public: + docstring_options(bool show_all=true) + { + previous_show_user_defined_ = show_user_defined_; + previous_show_py_signatures_ = show_py_signatures_; + previous_show_cpp_signatures_ = show_cpp_signatures_; + show_user_defined_ = show_all; + show_cpp_signatures_ = show_all; + show_py_signatures_ = show_all; + } + + docstring_options(bool show_user_defined, bool show_signatures) + { + previous_show_user_defined_ = show_user_defined_; + previous_show_cpp_signatures_ = show_cpp_signatures_; + previous_show_py_signatures_ = show_py_signatures_; + show_user_defined_ = show_user_defined; + show_cpp_signatures_ = show_signatures; + show_py_signatures_ = show_signatures; + } + + docstring_options(bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures) + { + previous_show_user_defined_ = show_user_defined_; + previous_show_cpp_signatures_ = show_cpp_signatures_; + previous_show_py_signatures_ = show_py_signatures_; + show_user_defined_ = show_user_defined; + show_cpp_signatures_ = show_cpp_signatures; + show_py_signatures_ = show_py_signatures; + } + + ~docstring_options() + { + show_user_defined_ = previous_show_user_defined_; + show_cpp_signatures_ = previous_show_cpp_signatures_; + show_py_signatures_ = previous_show_py_signatures_; + } + + void + disable_user_defined() { show_user_defined_ = false; } + + void + enable_user_defined() { show_user_defined_ = true; } + + void + disable_py_signatures() + { + show_py_signatures_ = false; + } + + void + enable_py_signatures() + { + show_py_signatures_ = true; + } + + void + disable_cpp_signatures() + { + show_cpp_signatures_ = false; + } + + void + enable_cpp_signatures() + { + show_cpp_signatures_ = true; + } + + void + disable_signatures() + { + show_cpp_signatures_ = false; + show_py_signatures_ = false; + } + + void + enable_signatures() + { + show_cpp_signatures_ = true; + show_py_signatures_ = true; + } + + void + disable_all() + { + show_user_defined_ = false; + show_cpp_signatures_ = false; + show_py_signatures_ = false; + } + + void + enable_all() + { + show_user_defined_ = true; + show_cpp_signatures_ = true; + show_py_signatures_ = true; + } + + friend struct objects::function; + + private: + static volatile bool show_user_defined_; + static volatile bool show_cpp_signatures_; + static volatile bool show_py_signatures_; + bool previous_show_user_defined_; + bool previous_show_cpp_signatures_; + bool previous_show_py_signatures_; +}; + +}} // namespace boost::python + +#endif // DOCSTRING_OPTIONS_RWGK20060111_HPP diff --git a/pxr/external/boost/python/enum.hpp b/pxr/external/boost/python/enum.hpp new file mode 100644 index 0000000000..9631a0edc8 --- /dev/null +++ b/pxr/external/boost/python/enum.hpp @@ -0,0 +1,108 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ENUM_DWA200298_HPP +# define ENUM_DWA200298_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { + +template +struct enum_ : public objects::enum_base +{ + typedef objects::enum_base base; + + // Declare a new enumeration type in the current scope() + enum_(char const* name, char const* doc = 0); + + // Add a new enumeration value with the given name and value. + inline enum_& value(char const* name, T); + + // Add all of the defined enumeration values to the current scope with the + // same names used here. + inline enum_& export_values(); + private: + static PyObject* to_python(void const* x); + static void* convertible_from_python(PyObject* obj); + static void construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data); +}; + +template +inline enum_::enum_(char const* name, char const* doc ) + : base( + name + , &enum_::to_python + , &enum_::convertible_from_python + , &enum_::construct + , type_id() + , doc + ) +{ +} + +// This is the conversion function that gets registered for converting +// these enums to Python. +template +PyObject* enum_::to_python(void const* x) +{ + return base::to_python( + converter::registered::converters.m_class_object + , static_cast(*(T const*)x)); +} + +// +// The following two static functions serve as the elements of an +// rvalue from_python converter for the enumeration type. +// + +// This checks that a given Python object can be converted to the +// enumeration type. +template +void* enum_::convertible_from_python(PyObject* obj) +{ + return PyObject_IsInstance( + obj + , upcast( + converter::registered::converters.m_class_object)) + + ? obj : 0; +} + +// Constructs an instance of the enumeration type in the from_python +// data. +template +void enum_::construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data) +{ +#if PY_VERSION_HEX >= 0x03000000 + T x = static_cast(PyLong_AS_LONG(obj)); +#else + T x = static_cast(PyInt_AS_LONG(obj)); +#endif + void* const storage = ((converter::rvalue_from_python_storage*)data)->storage.bytes; + new (storage) T(x); + data->convertible = storage; +} + +template +inline enum_& enum_::value(char const* name, T x) +{ + this->add_value(name, static_cast(x)); + return *this; +} + +template +inline enum_& enum_::export_values() +{ + this->base::export_values(); + return *this; +} + +}} // namespace boost::python + +#endif // ENUM_DWA200298_HPP diff --git a/pxr/external/boost/python/errors.hpp b/pxr/external/boost/python/errors.hpp new file mode 100644 index 0000000000..1eec6c2fe6 --- /dev/null +++ b/pxr/external/boost/python/errors.hpp @@ -0,0 +1,55 @@ +// (C) Copyright David Abrahams 2000. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of Dragon Systems, Inc., in +// producing this work. + +#ifndef ERRORS_DWA052500_H_ +# define ERRORS_DWA052500_H_ + +# include +# include + +namespace boost { namespace python { + +struct BOOST_PYTHON_DECL error_already_set +{ + virtual ~error_already_set(); +}; + +// Handles exceptions caught just before returning to Python code. +// Returns true iff an exception was caught. +BOOST_PYTHON_DECL bool handle_exception_impl(function0); + +template +bool handle_exception(T f) +{ + return handle_exception_impl(function0(boost::ref(f))); +} + +namespace detail { inline void rethrow() { throw; } } + +inline void handle_exception() +{ + handle_exception(detail::rethrow); +} + +BOOST_PYTHON_DECL void throw_error_already_set(); + +template +inline T* expect_non_null(T* x) +{ + if (x == 0) + throw_error_already_set(); + return x; +} + +// Return source if it is an instance of pytype; throw an appropriate +// exception otherwise. +BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* pytype, PyObject* source); + +}} // namespace boost::python + +#endif // ERRORS_DWA052500_H_ diff --git a/pxr/external/boost/python/exception_translator.hpp b/pxr/external/boost/python/exception_translator.hpp new file mode 100644 index 0000000000..1aa1465bdf --- /dev/null +++ b/pxr/external/boost/python/exception_translator.hpp @@ -0,0 +1,29 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef EXCEPTION_TRANSLATOR_DWA2002810_HPP +# define EXCEPTION_TRANSLATOR_DWA2002810_HPP + +# include + +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +template +void register_exception_translator(Translate translate, boost::type* = 0) +{ + using namespace boost::placeholders; + detail::register_exception_handler( + boost::bind(detail::translate_exception(), _1, _2, translate) + ); +} + +}} // namespace boost::python + +#endif // EXCEPTION_TRANSLATOR_DWA2002810_HPP diff --git a/pxr/external/boost/python/exec.hpp b/pxr/external/boost/python/exec.hpp new file mode 100644 index 0000000000..32a74991a7 --- /dev/null +++ b/pxr/external/boost/python/exec.hpp @@ -0,0 +1,63 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef EXEC_SS20050616_HPP +# define EXEC_SS20050616_HPP + +# include +# include + +namespace boost +{ +namespace python +{ + +// Evaluate python expression from str. +// global and local are the global and local scopes respectively, +// used during evaluation. +object +BOOST_PYTHON_DECL +eval(str string, object global = object(), object local = object()); + +object +BOOST_PYTHON_DECL +eval(char const *string, object global = object(), object local = object()); + +// Execute an individual python statement from str. +// global and local are the global and local scopes respectively, +// used during execution. +object +BOOST_PYTHON_DECL +exec_statement(str string, object global = object(), object local = object()); + +object +BOOST_PYTHON_DECL +exec_statement(char const *string, object global = object(), object local = object()); + +// Execute python source code from str. +// global and local are the global and local scopes respectively, +// used during execution. +object +BOOST_PYTHON_DECL +exec(str string, object global = object(), object local = object()); + +object +BOOST_PYTHON_DECL +exec(char const *string, object global = object(), object local = object()); + +// Execute python source code from file filename. +// global and local are the global and local scopes respectively, +// used during execution. +object +BOOST_PYTHON_DECL +exec_file(str filename, object global = object(), object local = object()); + +object +BOOST_PYTHON_DECL +exec_file(char const *filename, object global = object(), object local = object()); + +} +} + +#endif diff --git a/pxr/external/boost/python/extract.hpp b/pxr/external/boost/python/extract.hpp new file mode 100644 index 0000000000..bfdeb83ce7 --- /dev/null +++ b/pxr/external/boost/python/extract.hpp @@ -0,0 +1,259 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef EXTRACT_DWA200265_HPP +# define EXTRACT_DWA200265_HPP + +# include + +# include +# include +# include +# include +# include + +# include +# include + +# include +# include +# include +# include + +#if BOOST_WORKAROUND(BOOST_INTEL_WIN, <= 900) +# define BOOST_EXTRACT_WORKAROUND () +#else +# define BOOST_EXTRACT_WORKAROUND +#endif + +namespace boost { namespace python { + +namespace api +{ + class object; +} + +namespace converter +{ + template + struct extract_pointer + { + typedef Ptr result_type; + extract_pointer(PyObject*); + + bool check() const; + Ptr operator()() const; + + private: + PyObject* m_source; + void* m_result; + }; + + template + struct extract_reference + { + typedef Ref result_type; + extract_reference(PyObject*); + + bool check() const; + Ref operator()() const; + + private: + PyObject* m_source; + void* m_result; + }; + + template + struct extract_rvalue : private noncopyable + { + typedef typename mpl::if_< + python::detail::copy_ctor_mutates_rhs + , T& + , typename call_traits::param_type + >::type result_type; + + extract_rvalue(PyObject*); + + bool check() const; + result_type operator()() const; + private: + PyObject* m_source; + mutable rvalue_from_python_data m_data; + }; + + template + struct extract_object_manager + { + typedef T result_type; + extract_object_manager(PyObject*); + + bool check() const; + result_type operator()() const; + private: + PyObject* m_source; + }; + + template + struct select_extract + { + BOOST_STATIC_CONSTANT( + bool, obj_mgr = is_object_manager::value); + + BOOST_STATIC_CONSTANT( + bool, ptr = is_pointer::value); + + BOOST_STATIC_CONSTANT( + bool, ref = is_reference::value); + + typedef typename mpl::if_c< + obj_mgr + , extract_object_manager + , typename mpl::if_c< + ptr + , extract_pointer + , typename mpl::if_c< + ref + , extract_reference + , extract_rvalue + >::type + >::type + >::type type; + }; +} + +template +struct extract + : converter::select_extract::type +{ + private: + typedef typename converter::select_extract::type base; + public: + typedef typename base::result_type result_type; + + operator result_type() const + { + return (*this)(); + } + + extract(PyObject*); + extract(api::object const&); +}; + +// +// Implementations +// +template +inline extract::extract(PyObject* o) + : base(o) +{ +} + +template +inline extract::extract(api::object const& o) + : base(o.ptr()) +{ +} + +namespace converter +{ + template + inline extract_rvalue::extract_rvalue(PyObject* x) + : m_source(x) + , m_data( + (rvalue_from_python_stage1)(x, registered::converters) + ) + { + } + + template + inline bool + extract_rvalue::check() const + { + return m_data.stage1.convertible; + } + + template + inline typename extract_rvalue::result_type + extract_rvalue::operator()() const + { + return *(T*)( + // Only do the stage2 conversion once + m_data.stage1.convertible == m_data.storage.bytes + ? m_data.storage.bytes + : (rvalue_from_python_stage2)(m_source, m_data.stage1, registered::converters) + ); + } + + template + inline extract_reference::extract_reference(PyObject* obj) + : m_source(obj) + , m_result( + (get_lvalue_from_python)(obj, registered::converters) + ) + { + } + + template + inline bool extract_reference::check() const + { + return m_result != 0; + } + + template + inline Ref extract_reference::operator()() const + { + if (m_result == 0) + (throw_no_reference_from_python)(m_source, registered::converters); + + return python::detail::void_ptr_to_reference(m_result, (Ref(*)())0); + } + + template + inline extract_pointer::extract_pointer(PyObject* obj) + : m_source(obj) + , m_result( + obj == Py_None ? 0 : (get_lvalue_from_python)(obj, registered_pointee::converters) + ) + { + } + + template + inline bool extract_pointer::check() const + { + return m_source == Py_None || m_result != 0; + } + + template + inline Ptr extract_pointer::operator()() const + { + if (m_result == 0 && m_source != Py_None) + (throw_no_pointer_from_python)(m_source, registered_pointee::converters); + + return Ptr(m_result); + } + + template + inline extract_object_manager::extract_object_manager(PyObject* obj) + : m_source(obj) + { + } + + template + inline bool extract_object_manager::check() const + { + return object_manager_traits::check(m_source); + } + + template + inline T extract_object_manager::operator()() const + { + return T( + object_manager_traits::adopt(python::incref(m_source)) + ); + } +} + +}} // namespace boost::python::converter + +#endif // EXTRACT_DWA200265_HPP diff --git a/pxr/external/boost/python/handle.hpp b/pxr/external/boost/python/handle.hpp new file mode 100644 index 0000000000..ee9a7cd09d --- /dev/null +++ b/pxr/external/boost/python/handle.hpp @@ -0,0 +1,237 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef HANDLE_DWA200269_HPP +# define HANDLE_DWA200269_HPP + +# include + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +template struct null_ok; + +template +inline null_ok* allow_null(T* p) +{ + return (null_ok*)p; +} + +namespace detail +{ + template + inline T* manage_ptr(detail::borrowed >* p, int) + { + return python::xincref((T*)p); + } + + template + inline T* manage_ptr(null_ok >* p, int) + { + return python::xincref((T*)p); + } + + template + inline T* manage_ptr(detail::borrowed* p, long) + { + return python::incref(expect_non_null((T*)p)); + } + + template + inline T* manage_ptr(null_ok* p, long) + { + return (T*)p; + } + + template + inline T* manage_ptr(T* p, ...) + { + return expect_non_null(p); + } +} + +template +class handle +{ + typedef T* (handle::* bool_type )() const; + + public: // types + typedef T element_type; + + public: // member functions + handle(); + ~handle(); + + template + explicit handle(Y* p) + : m_p( + python::upcast( + detail::manage_ptr(p, 0) + ) + ) + { + } + + handle& operator=(handle const& r) + { + python::xdecref(m_p); + m_p = python::xincref(r.m_p); + return *this; + } + + template + handle& operator=(handle const & r) // never throws + { + python::xdecref(m_p); + m_p = python::xincref(python::upcast(r.get())); + return *this; + } + + template + handle(handle const& r) + : m_p(python::xincref(python::upcast(r.get()))) + { + } + + handle(handle const& r) + : m_p(python::xincref(r.m_p)) + { + } + + T* operator-> () const; + T& operator* () const; + T* get() const; + T* release(); + void reset(); + + operator bool_type() const // never throws + { + return m_p ? &handle::get : 0; + } + bool operator! () const; // never throws + + public: // implementation details -- do not touch + // Defining this in the class body suppresses a VC7 link failure + inline handle(detail::borrowed_reference x) + : m_p( + python::incref( + downcast((PyObject*)x) + )) + { + } + + private: // data members + T* m_p; +}; + +#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP +} // namespace python +#endif + +template inline T * get_pointer(python::handle const & p) +{ + return p.get(); +} + +#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP +namespace python { +#else + +// We don't want get_pointer above to hide the others +using boost::get_pointer; + +#endif + +typedef handle type_handle; + +// +// Compile-time introspection +// +template +class is_handle +{ + public: + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +class is_handle > +{ + public: + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +// +// implementations +// +template +inline handle::handle() + : m_p(0) +{ +} + +template +inline handle::~handle() +{ + python::xdecref(m_p); +} + +template +inline T* handle::operator->() const +{ + return m_p; +} + +template +inline T& handle::operator*() const +{ + return *m_p; +} + +template +inline T* handle::get() const +{ + return m_p; +} + +template +inline bool handle::operator!() const +{ + return m_p == 0; +} + +template +inline T* handle::release() +{ + T* result = m_p; + m_p = 0; + return result; +} + +template +inline void handle::reset() +{ + python::xdecref(m_p); + m_p = 0; +} + +// Because get_managed_object must return a non-null PyObject*, we +// return Py_None if the handle is null. +template +inline PyObject* get_managed_object(handle const& h, tag_t) +{ + return h.get() ? python::upcast(h.get()) : Py_None; +} + +}} // namespace boost::python + + +#endif // HANDLE_DWA200269_HPP diff --git a/pxr/external/boost/python/handle_fwd.hpp b/pxr/external/boost/python/handle_fwd.hpp new file mode 100644 index 0000000000..5987ec4fdb --- /dev/null +++ b/pxr/external/boost/python/handle_fwd.hpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef HANDLE_FWD_DWA2002615_HPP +# define HANDLE_FWD_DWA2002615_HPP + +# include + +namespace boost { namespace python { + +template class handle; + +}} // namespace boost::python + +#endif // HANDLE_FWD_DWA2002615_HPP diff --git a/pxr/external/boost/python/has_back_reference.hpp b/pxr/external/boost/python/has_back_reference.hpp new file mode 100644 index 0000000000..67fe24c5cf --- /dev/null +++ b/pxr/external/boost/python/has_back_reference.hpp @@ -0,0 +1,24 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef HAS_BACK_REFERENCE_DWA2002323_HPP +# define HAS_BACK_REFERENCE_DWA2002323_HPP + +# include +# include + +namespace boost { namespace python { + +// traits class which users can specialize to indicate that a class +// contains a back-reference to its owning PyObject* +template +struct has_back_reference + : mpl::false_ +{ +}; + + +}} // namespace boost::python + +#endif // HAS_BACK_REFERENCE_DWA2002323_HPP diff --git a/pxr/external/boost/python/implicit.hpp b/pxr/external/boost/python/implicit.hpp new file mode 100644 index 0000000000..4d01b2fb22 --- /dev/null +++ b/pxr/external/boost/python/implicit.hpp @@ -0,0 +1,36 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IMPLICIT_DWA2002325_HPP +# define IMPLICIT_DWA2002325_HPP + +# include +# include +# include +# include +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif +# include + +namespace boost { namespace python { + +template +void implicitly_convertible(boost::type* = 0, boost::type* = 0) +{ + typedef converter::implicit functions; + + converter::registry::push_back( + &functions::convertible + , &functions::construct + , type_id() +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &converter::expected_from_python_type_direct::get_pytype +#endif + ); +} + +}} // namespace boost::python + +#endif // IMPLICIT_DWA2002325_HPP diff --git a/pxr/external/boost/python/import.hpp b/pxr/external/boost/python/import.hpp new file mode 100644 index 0000000000..45c02a9366 --- /dev/null +++ b/pxr/external/boost/python/import.hpp @@ -0,0 +1,22 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef IMPORT_SS20050624_HPP +# define IMPORT_SS20050624_HPP + +# include +# include + +namespace boost +{ +namespace python +{ + +// Import the named module and return a reference to it. +object BOOST_PYTHON_DECL import(str name); + +} +} + +#endif diff --git a/pxr/external/boost/python/init.hpp b/pxr/external/boost/python/init.hpp new file mode 100644 index 0000000000..0ee763cc26 --- /dev/null +++ b/pxr/external/boost/python/init.hpp @@ -0,0 +1,399 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright David Abrahams 2002, Joel de Guzman, 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +/////////////////////////////////////////////////////////////////////////////// +#ifndef INIT_JDG20020820_HPP +#define INIT_JDG20020820_HPP + +# include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +/////////////////////////////////////////////////////////////////////////////// +#define BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT \ + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( \ + BOOST_PYTHON_MAX_ARITY, \ + class T, \ + mpl::void_) \ + +#define BOOST_PYTHON_OVERLOAD_TYPES \ + BOOST_PP_ENUM_PARAMS_Z(1, \ + BOOST_PYTHON_MAX_ARITY, \ + class T) \ + +#define BOOST_PYTHON_OVERLOAD_ARGS \ + BOOST_PP_ENUM_PARAMS_Z(1, \ + BOOST_PYTHON_MAX_ARITY, \ + T) \ + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace python { + +template +class init; // forward declaration + + +template +struct optional; // forward declaration + +namespace detail +{ + namespace error + { + template + struct more_keywords_than_init_arguments + { + typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1] BOOST_ATTRIBUTE_UNUSED; + }; + } + + // is_optional::value + // + // This metaprogram checks if T is an optional + // + + template + struct is_optional + : mpl::false_ + {}; + + template + struct is_optional > + : mpl::true_ + {}; + + + template + struct define_class_init_helper; + +} // namespace detail + +template +struct init_base : def_visitor +{ + init_base(char const* doc_, detail::keyword_range const& keywords_) + : m_doc(doc_), m_keywords(keywords_) + {} + + init_base(char const* doc_) + : m_doc(doc_) + {} + + DerivedT const& derived() const + { + return *static_cast(this); + } + + char const* doc_string() const + { + return m_doc; + } + + detail::keyword_range const& keywords() const + { + return m_keywords; + } + + static default_call_policies call_policies() + { + return default_call_policies(); + } + + private: + // visit + // + // Defines a set of n_defaults + 1 constructors for its + // class_<...> argument. Each constructor after the first has + // one less argument to its right. Example: + // + // init > + // + // Defines: + // + // __init__(int, char, long, double) + // __init__(int, char, long) + // __init__(int, char) + // __init__(int) + template + void visit(classT& cl) const + { + typedef typename DerivedT::signature signature; + typedef typename DerivedT::n_arguments n_arguments; + typedef typename DerivedT::n_defaults n_defaults; + + detail::define_class_init_helper::apply( + cl + , derived().call_policies() + , signature() + , n_arguments() + , derived().doc_string() + , derived().keywords()); + } + + friend class python::def_visitor_access; + + private: // data members + char const* m_doc; + detail::keyword_range m_keywords; +}; + +template +class init_with_call_policies + : public init_base > +{ + typedef init_base > base; + public: + typedef typename InitT::n_arguments n_arguments; + typedef typename InitT::n_defaults n_defaults; + typedef typename InitT::signature signature; + + init_with_call_policies( + CallPoliciesT const& policies_ + , char const* doc_ + , detail::keyword_range const& keywords + ) + : base(doc_, keywords) + , m_policies(policies_) + {} + + CallPoliciesT const& call_policies() const + { + return this->m_policies; + } + + private: // data members + CallPoliciesT m_policies; +}; + +// +// drop1 is the initial length(S) elements of S +// +namespace detail +{ + template + struct drop1 + : mpl::iterator_range< + typename mpl::begin::type + , typename mpl::prior< + typename mpl::end::type + >::type + > + {}; +} + +template +class init : public init_base > +{ + typedef init_base > base; + public: + typedef init self_t; + + init(char const* doc_ = 0) + : base(doc_) + { + } + + template + init(char const* doc_, detail::keywords const& kw) + : base(doc_, kw.range()) + { + typedef typename detail::error::more_keywords_than_init_arguments< + N, n_arguments::value + 1 + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; + } + + template + init(detail::keywords const& kw, char const* doc_ = 0) + : base(doc_, kw.range()) + { + typedef typename detail::error::more_keywords_than_init_arguments< + N, n_arguments::value + 1 + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; + } + + template + init_with_call_policies + operator[](CallPoliciesT const& policies) const + { + return init_with_call_policies( + policies, this->doc_string(), this->keywords()); + } + + typedef detail::type_list signature_; + + typedef detail::is_optional< + typename mpl::eval_if< + mpl::empty + , mpl::false_ + , mpl::back + >::type + > back_is_optional; + + typedef typename mpl::eval_if< + back_is_optional + , mpl::back + , mpl::vector0<> + >::type optional_args; + + typedef typename mpl::eval_if< + back_is_optional + , mpl::if_< + mpl::empty + , detail::drop1 + , mpl::joint_view< + detail::drop1 + , optional_args + > + > + , signature_ + >::type signature; + + // TODO: static assert to make sure there are no other optional elements + + // Count the number of default args + typedef mpl::size n_defaults; + typedef mpl::size n_arguments; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// optional +// +// optional::type returns a typelist. +// +/////////////////////////////////////////////////////////////////////////////// +template +struct optional + : detail::type_list +{ +}; + +namespace detail +{ + template + inline void def_init_aux( + ClassT& cl + , Signature const& + , NArgs + , CallPoliciesT const& policies + , char const* doc + , detail::keyword_range const& keywords_ + ) + { + cl.def( + "__init__" + , detail::make_keyword_range_constructor( + policies + , keywords_ + , (typename ClassT::metadata::holder*)0 + ) + , doc + ); + } + + /////////////////////////////////////////////////////////////////////////////// + // + // define_class_init_helper::apply + // + // General case + // + // Accepts a class_ and an arguments list. Defines a constructor + // for the class given the arguments and recursively calls + // define_class_init_helper::apply with one fewer argument (the + // rightmost argument is shaved off) + // + /////////////////////////////////////////////////////////////////////////////// + template + struct define_class_init_helper + { + + template + static void apply( + ClassT& cl + , CallPoliciesT const& policies + , Signature const& args + , NArgs + , char const* doc + , detail::keyword_range keywords) + { + detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords); + + if (keywords.second > keywords.first) + --keywords.second; + + typedef typename mpl::prior::type next_nargs; + define_class_init_helper::apply( + cl, policies, Signature(), next_nargs(), doc, keywords); + } + }; + + /////////////////////////////////////////////////////////////////////////////// + // + // define_class_init_helper<0>::apply + // + // Terminal case + // + // Accepts a class_ and an arguments list. Defines a constructor + // for the class given the arguments. + // + /////////////////////////////////////////////////////////////////////////////// + template <> + struct define_class_init_helper<0> { + + template + static void apply( + ClassT& cl + , CallPoliciesT const& policies + , Signature const& args + , NArgs + , char const* doc + , detail::keyword_range const& keywords) + { + detail::def_init_aux(cl, args, NArgs(), policies, doc, keywords); + } + }; +} + +}} // namespace boost::python + +#undef BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT +#undef BOOST_PYTHON_OVERLOAD_TYPES +#undef BOOST_PYTHON_OVERLOAD_ARGS +#undef BOOST_PYTHON_IS_OPTIONAL_VALUE +#undef BOOST_PYTHON_APPEND_TO_INIT + +/////////////////////////////////////////////////////////////////////////////// +#endif // INIT_JDG20020820_HPP + + + + + + + + diff --git a/pxr/external/boost/python/instance_holder.hpp b/pxr/external/boost/python/instance_holder.hpp new file mode 100644 index 0000000000..f4ed1e6608 --- /dev/null +++ b/pxr/external/boost/python/instance_holder.hpp @@ -0,0 +1,63 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef INSTANCE_HOLDER_DWA2002517_HPP +# define INSTANCE_HOLDER_DWA2002517_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { + +// Base class for all holders +struct BOOST_PYTHON_DECL instance_holder : private noncopyable +{ + public: + instance_holder(); + virtual ~instance_holder(); + + // return the next holder in a chain + instance_holder* next() const; + + // When the derived holder actually holds by [smart] pointer and + // null_ptr_only is set, only report that the type is held when + // the pointer is null. This is needed for proper shared_ptr + // support, to prevent holding shared_ptrs from being found when + // converting from python so that we can use the conversion method + // that always holds the Python object. + virtual void* holds(type_info, bool null_ptr_only) = 0; + + void install(PyObject* inst) throw(); + + // These functions should probably be located elsewhere. + + // Allocate storage for an object of the given size at the given + // offset in the Python instance<> object if bytes are available + // there. Otherwise allocate size bytes of heap memory. + static void* allocate(PyObject*, std::size_t offset, std::size_t size, std::size_t alignment = 1); + + // Deallocate storage from the heap if it was not carved out of + // the given Python object by allocate(), above. + static void deallocate(PyObject*, void* storage) throw(); + private: + instance_holder* m_next; +}; + +// This macro is needed for implementation of derived holders +# define BOOST_PYTHON_UNFORWARD(N,ignored) (typename unforward::type)(a##N) + +// +// implementation +// +inline instance_holder* instance_holder::next() const +{ + return m_next; +} + +}} // namespace boost::python + +#endif // INSTANCE_HOLDER_DWA2002517_HPP diff --git a/pxr/external/boost/python/iterator.hpp b/pxr/external/boost/python/iterator.hpp new file mode 100644 index 0000000000..b0ea578959 --- /dev/null +++ b/pxr/external/boost/python/iterator.hpp @@ -0,0 +1,136 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ITERATOR_DWA2002512_HPP +# define ITERATOR_DWA2002512_HPP + +# include + +# include +# include +# include +# include + +# if defined(BOOST_MSVC) && (BOOST_MSVC == 1400) /* +> warning C4180: qualifier applied to function type has no meaning; ignored +Peter Dimov wrote: +This warning is caused by an overload resolution bug in VC8 that cannot be +worked around and will probably not be fixed by MS in the VC8 line. The +problematic overload is only instantiated and never called, and the code +works correctly. */ +# pragma warning(disable: 4180) +# endif + +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + // Adds an additional layer of binding to + // objects::make_iterator(...), which allows us to pass member + // function and member data pointers. + template + inline object make_iterator( + Accessor1 get_start + , Accessor2 get_finish + , NextPolicies next_policies + , Target&(*)() + ) + { + using namespace boost::placeholders; + return objects::make_iterator_function( + boost::protect(boost::bind(get_start, _1)) + , boost::protect(boost::bind(get_finish, _1)) + , next_policies + ); + } + + // Guts of template class iterators<>, below. + template + struct iterators_impl + { + template + struct apply + { + typedef typename T::iterator iterator; + static iterator begin(T& x) { return x.begin(); } + static iterator end(T& x) { return x.end(); } + }; + }; + + template <> + struct iterators_impl + { + template + struct apply + { + typedef typename T::const_iterator iterator; + static iterator begin(T& x) { return x.begin(); } + static iterator end(T& x) { return x.end(); } + }; + }; +} + +// An "ordinary function generator" which contains static begin(x) and +// end(x) functions that invoke T::begin() and T::end(), respectively. +template +struct iterators + : detail::iterators_impl< + detail::is_const::value + >::template apply +{ +}; + +// Create an iterator-building function which uses the given +// accessors. Deduce the Target type from the accessors. The iterator +// returns copies of the inderlying elements. +template +object range(Accessor1 start, Accessor2 finish) +{ + return detail::make_iterator( + start, finish + , objects::default_iterator_call_policies() + , detail::target(start) + ); +} + +// Create an iterator-building function which uses the given accessors +// and next() policies. Deduce the Target type. +template +object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0) +{ + return detail::make_iterator(start, finish, NextPolicies(), detail::target(start)); +} + +// Create an iterator-building function which uses the given accessors +// and next() policies, operating on the given Target type +template +object range(Accessor1 start, Accessor2 finish, NextPolicies* = 0, boost::type* = 0) +{ + // typedef typename add_reference::type target; + return detail::make_iterator(start, finish, NextPolicies(), (Target&(*)())0); +} + +// A Python callable object which produces an iterator traversing +// [x.begin(), x.end()), where x is an instance of the Container +// type. NextPolicies are used as the CallPolicies for the iterator's +// next() function. +template +struct iterator : object +{ + iterator() + : object( + python::range( + &iterators::begin, &iterators::end + )) + { + } +}; + +}} // namespace boost::python + +#endif // ITERATOR_DWA2002512_HPP diff --git a/pxr/external/boost/python/list.hpp b/pxr/external/boost/python/list.hpp new file mode 100644 index 0000000000..0d5e2c8fd9 --- /dev/null +++ b/pxr/external/boost/python/list.hpp @@ -0,0 +1,148 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef LIST_DWA2002627_HPP +# define LIST_DWA2002627_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + struct BOOST_PYTHON_DECL list_base : object + { + void append(object_cref); // append object to end + + ssize_t count(object_cref value) const; // return number of occurrences of value + + void extend(object_cref sequence); // extend list by appending sequence elements + + long index(object_cref value) const; // return index of first occurrence of value + + void insert(ssize_t index, object_cref); // insert object before index + void insert(object const& index, object_cref); + + object pop(); // remove and return item at index (default last) + object pop(ssize_t index); + object pop(object const& index); + + void remove(object_cref value); // remove first occurrence of value + + void reverse(); // reverse *IN PLACE* + + void sort(); // sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1 +#if PY_VERSION_HEX >= 0x03000000 + void sort(args_proxy const &args, + kwds_proxy const &kwds); +#else + void sort(object_cref cmpfunc); +#endif + + protected: + list_base(); // new list + explicit list_base(object_cref sequence); // new list initialized from sequence's items + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list_base, object) + private: + static detail::new_non_null_reference call(object const&); + }; +} + +class list : public detail::list_base +{ + typedef detail::list_base base; + public: + list() {} // new list + + template + explicit list(T const& sequence) + : base(object(sequence)) + { + } + + template + void append(T const& x) + { + base::append(object(x)); + } + + template + ssize_t count(T const& value) const + { + return base::count(object(value)); + } + + template + void extend(T const& x) + { + base::extend(object(x)); + } + + template + long index(T const& x) const + { + return base::index(object(x)); + } + + template + void insert(ssize_t index, T const& x) // insert object before index + { + base::insert(index, object(x)); + } + + template + void insert(object const& index, T const& x) // insert object before index + { + base::insert(index, object(x)); + } + + object pop() { return base::pop(); } + object pop(ssize_t index) { return base::pop(index); } + + template + object pop(T const& index) + { + return base::pop(object(index)); + } + + template + void remove(T const& value) + { + base::remove(object(value)); + } + +#if PY_VERSION_HEX <= 0x03000000 + void sort() { base::sort(); } + + template + void sort(T const& value) + { + base::sort(object(value)); + } +#endif + + public: // implementation detail -- for internal use only + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list, base) +}; + +// +// Converter Specializations +// +namespace converter +{ + template <> + struct object_manager_traits + : pytype_object_manager_traits<&PyList_Type,list> + { + }; +} + +}} // namespace boost::python + +#endif // LIST_DWA2002627_HPP diff --git a/pxr/external/boost/python/long.hpp b/pxr/external/boost/python/long.hpp new file mode 100644 index 0000000000..c15604c91c --- /dev/null +++ b/pxr/external/boost/python/long.hpp @@ -0,0 +1,68 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef LONG_DWA2002627_HPP +# define LONG_DWA2002627_HPP + +# include + +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + struct BOOST_PYTHON_DECL long_base : object + { + protected: + long_base(); // new long_ + explicit long_base(object_cref rhs); + explicit long_base(object_cref rhs, object_cref base); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object) + + private: + static detail::new_reference call(object const&); + static detail::new_reference call(object const&, object const&); + }; +} + +class long_ : public detail::long_base +{ + typedef detail::long_base base; + public: + long_() {} // new long_ + + template + explicit long_(T const& rhs) + : detail::long_base(object(rhs)) + { + } + + template + explicit long_(T const& rhs, U const& base) + : detail::long_base(object(rhs), object(base)) + { + } + + public: // implementation detail -- for internal use only + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base) +}; + +// +// Converter Specializations +// +namespace converter +{ + template <> + struct object_manager_traits + : pytype_object_manager_traits<&PyLong_Type,long_> + { + }; +} + +}} // namespace boost::python + +#endif // LONG_DWA2002627_HPP diff --git a/pxr/external/boost/python/lvalue_from_pytype.hpp b/pxr/external/boost/python/lvalue_from_pytype.hpp new file mode 100644 index 0000000000..59d31b89cf --- /dev/null +++ b/pxr/external/boost/python/lvalue_from_pytype.hpp @@ -0,0 +1,117 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef LVALUE_FROM_PYTYPE_DWA2002130_HPP +# define LVALUE_FROM_PYTYPE_DWA2002130_HPP + +# include +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + // Given a pointer-to-function of 1 parameter returning a reference + // type, return the type_id of the function's return type. + template + inline type_info extractor_type_id(T&(*)(U)) + { + return type_id(); + } + + // A function generator whose static execute() function is an lvalue + // from_python converter using the given Extractor. U is expected to + // be the actual type of the PyObject instance from which the result + // is being extracted. + template + struct normalized_extractor + { + static inline void* execute(PyObject* op) + { + typedef typename add_lvalue_reference::type param; + return &Extractor::execute( + boost::python::detail::void_ptr_to_reference( + op, (param(*)())0 ) + ); + } + }; + + // Given an Extractor type and a pointer to its execute function, + // return a new object whose static execute function does the same + // job but is a conforming lvalue from_python conversion function. + // + // usage: normalize(&Extractor::execute) + template + inline normalized_extractor + normalize(T(*)(U), Extractor* = 0) + { + return normalized_extractor(); + } +} + +// An Extractor which extracts the given member from a Python object +// whose instances are stored as InstanceType. +template +struct extract_member +{ + static MemberType& execute(InstanceType& c) + { + (void)Py_TYPE(&c); // static assertion + return c.*member; + } +}; + +// An Extractor which simply extracts the entire python object +// instance of InstanceType. +template +struct extract_identity +{ + static InstanceType& execute(InstanceType& c) + { + (void)Py_TYPE(&c); // static assertion + return c; + } +}; + +// Registers a from_python conversion which extracts lvalues using +// Extractor's static execute function from Python objects whose type +// object is python_type. +template +struct lvalue_from_pytype +{ + lvalue_from_pytype() + { + converter::registry::insert + ( &extract + , detail::extractor_type_id(&Extractor::execute) +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &get_pytype +#endif + ); + } + private: + static void* extract(PyObject* op) + { + return PyObject_TypeCheck(op, const_cast(python_type)) + ? const_cast( + static_cast( + detail::normalize(&Extractor::execute).execute(op))) + : 0 + ; + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const*get_pytype() { return python_type; } +#endif +}; + +}} // namespace boost::python + +#endif // LVALUE_FROM_PYTYPE_DWA2002130_HPP diff --git a/pxr/external/boost/python/make_constructor.hpp b/pxr/external/boost/python/make_constructor.hpp new file mode 100644 index 0000000000..3ec9ad5f86 --- /dev/null +++ b/pxr/external/boost/python/make_constructor.hpp @@ -0,0 +1,290 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAKE_CONSTRUCTOR_DWA20011221_HPP +# define MAKE_CONSTRUCTOR_DWA20011221_HPP + +# include + +# include +# include +# include + +# include +# include +# include +# include + +# include +# include + +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct install_holder : converter::context_result_converter + { + install_holder(PyObject* args_) + : m_self(PyTuple_GetItem(args_, 0)) {} + + PyObject* operator()(T x) const + { + dispatch(x, is_pointer()); + return none(); + } + + private: + template + void dispatch(U* x, detail::true_) const + { +#if defined(BOOST_NO_CXX11_SMART_PTR) + std::auto_ptr owner(x); + dispatch(owner, detail::false_()); +#else + std::unique_ptr owner(x); + dispatch(std::move(owner), detail::false_()); +#endif + } + + template + void dispatch(Ptr x, detail::false_) const + { + typedef typename pointee::type value_type; + typedef objects::pointer_holder holder; + typedef objects::instance instance_t; + + void* memory = holder::allocate(this->m_self, offsetof(instance_t, storage), sizeof(holder)); + try { +#if defined(BOOST_NO_CXX11_SMART_PTR) + (new (memory) holder(x))->install(this->m_self); +#else + (new (memory) holder(std::move(x)))->install(this->m_self); +#endif + } + catch(...) { + holder::deallocate(this->m_self, memory); + throw; + } + } + + PyObject* m_self; + }; + + struct constructor_result_converter + { + template + struct apply + { + typedef install_holder type; + }; + }; + + template + struct offset_args + { + offset_args(BaseArgs base_) : base(base_) {} + BaseArgs base; + }; + + template + inline PyObject* get(mpl::int_, offset_args const& args_) + { + return get(mpl::int_<(N+Offset::value)>(), args_.base); + } + + template + inline unsigned arity(offset_args const& args_) + { + return arity(args_.base) - Offset::value; + } + + template + struct constructor_policy : BasePolicy_ + { + constructor_policy(BasePolicy_ base) : BasePolicy_(base) {} + + // If the BasePolicy_ supplied a result converter it would be + // ignored; issue an error if it's not the default. + BOOST_MPL_ASSERT_MSG( + (is_same< + typename BasePolicy_::result_converter + , default_result_converter + >::value) + , MAKE_CONSTRUCTOR_SUPPLIES_ITS_OWN_RESULT_CONVERTER_THAT_WOULD_OVERRIDE_YOURS + , (typename BasePolicy_::result_converter) + ); + typedef constructor_result_converter result_converter; + typedef offset_args > argument_package; + }; + + template + struct outer_constructor_signature + { + typedef typename mpl::pop_front::type inner_args; + typedef typename mpl::push_front::type outer_args; + typedef typename mpl::push_front::type type; + }; + + // ETI workaround + template <> + struct outer_constructor_signature + { + typedef int type; + }; + + // + // These helper functions for make_constructor (below) do the raw work + // of constructing a Python object from some invokable entity. See + // for more information about how + // the Sig arguments is used. + // + // @group make_constructor_aux { + template + object make_constructor_aux( + F f // An object that can be invoked by detail::invoke() + , CallPolicies const& p // CallPolicies to use in the invocation + , Sig const& // An MPL sequence of argument types expected by F + ) + { + typedef typename outer_constructor_signature::type outer_signature; + + typedef constructor_policy inner_policy; + + return objects::function_object( + objects::py_function( + detail::caller(f, inner_policy(p)) + , outer_signature() + ) + ); + } + + // As above, except that it accepts argument keywords. NumKeywords + // is used only for a compile-time assertion to make sure the user + // doesn't pass more keywords than the function can accept. To + // disable all checking, pass mpl::int_<0> for NumKeywords. + template + object make_constructor_aux( + F f + , CallPolicies const& p + , Sig const& + , detail::keyword_range const& kw // a [begin,end) pair of iterators over keyword names + , NumKeywords // An MPL integral type wrapper: the size of kw + ) + { + enum { arity = mpl::size::value - 1 }; + + typedef typename detail::error::more_keywords_than_function_arguments< + NumKeywords::value, arity + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; + + typedef typename outer_constructor_signature::type outer_signature; + + typedef constructor_policy inner_policy; + + return objects::function_object( + objects::py_function( + detail::caller(f, inner_policy(p)) + , outer_signature() + ) + , kw + ); + } + // } + + // + // These dispatch functions are used to discriminate between the + // cases when the 3rd argument is keywords or when it is a + // signature. + // + // @group Helpers for make_constructor when called with 3 arguments. { + // + template + object make_constructor_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_) + { + return detail::make_constructor_aux( + f + , policies + , detail::get_signature(f) + , kw.range() + , mpl::int_() + ); + } + + template + object make_constructor_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_) + { + return detail::make_constructor_aux( + f + , policies + , sig + ); + } + // } +} + +// These overloaded functions wrap a function or member function +// pointer as a Python object, using optional CallPolicies, +// Keywords, and/or Signature. @group { +// +template +object make_constructor(F f) +{ + return detail::make_constructor_aux( + f,default_call_policies(), detail::get_signature(f)); +} + +template +object make_constructor(F f, CallPolicies const& policies) +{ + return detail::make_constructor_aux( + f, policies, detail::get_signature(f)); +} + +template +object make_constructor( + F f + , CallPolicies const& policies + , KeywordsOrSignature const& keywords_or_signature) +{ + typedef typename + detail::is_reference_to_keywords::type + is_kw; + + return detail::make_constructor_dispatch( + f + , policies + , keywords_or_signature + , is_kw() + ); +} + +template +object make_constructor( + F f + , CallPolicies const& policies + , Keywords const& kw + , Signature const& sig + ) +{ + return detail::make_constructor_aux( + f + , policies + , sig + , kw.range() + , mpl::int_() + ); +} +// } + +}} + + +#endif // MAKE_CONSTRUCTOR_DWA20011221_HPP diff --git a/pxr/external/boost/python/make_function.hpp b/pxr/external/boost/python/make_function.hpp new file mode 100644 index 0000000000..7dd7c316b3 --- /dev/null +++ b/pxr/external/boost/python/make_function.hpp @@ -0,0 +1,153 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAKE_FUNCTION_DWA20011221_HPP +# define MAKE_FUNCTION_DWA20011221_HPP + +# include + +# include +# include +# include + +# include + +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + // make_function_aux -- + // + // These helper functions for make_function (below) do the raw work + // of constructing a Python object from some invokable entity. See + // for more information about how + // the Sig arguments is used. + template + object make_function_aux( + F f // An object that can be invoked by detail::invoke() + , CallPolicies const& p // CallPolicies to use in the invocation + , Sig const& // An MPL sequence of argument types expected by F + ) + { + return objects::function_object( + detail::caller(f, p) + ); + } + + // As above, except that it accepts argument keywords. NumKeywords + // is used only for a compile-time assertion to make sure the user + // doesn't pass more keywords than the function can accept. To + // disable all checking, pass mpl::int_<0> for NumKeywords. + template + object make_function_aux( + F f + , CallPolicies const& p + , Sig const& + , detail::keyword_range const& kw // a [begin,end) pair of iterators over keyword names + , NumKeywords // An MPL integral type wrapper: the size of kw + ) + { + enum { arity = mpl::size::value - 1 }; + + typedef typename detail::error::more_keywords_than_function_arguments< + NumKeywords::value, arity + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; + + return objects::function_object( + detail::caller(f, p) + , kw); + } + + // Helpers for make_function when called with 3 arguments. These + // dispatch functions are used to discriminate between the cases + // when the 3rd argument is keywords or when it is a signature. + // + // @group { + template + object make_function_dispatch(F f, CallPolicies const& policies, Keywords const& kw, mpl::true_) + { + return detail::make_function_aux( + f + , policies + , detail::get_signature(f) + , kw.range() + , mpl::int_() + ); + } + + template + object make_function_dispatch(F f, CallPolicies const& policies, Signature const& sig, mpl::false_) + { + return detail::make_function_aux( + f + , policies + , sig + ); + } + // } + + } + +// These overloaded functions wrap a function or member function +// pointer as a Python object, using optional CallPolicies, +// Keywords, and/or Signature. +// +// @group { +template +object make_function(F f) +{ + return detail::make_function_aux( + f,default_call_policies(), detail::get_signature(f)); +} + +template +object make_function(F f, CallPolicies const& policies) +{ + return detail::make_function_aux( + f, policies, detail::get_signature(f)); +} + +template +object make_function( + F f + , CallPolicies const& policies + , KeywordsOrSignature const& keywords_or_signature) +{ + typedef typename + detail::is_reference_to_keywords::type + is_kw; + + return detail::make_function_dispatch( + f + , policies + , keywords_or_signature + , is_kw() + ); +} + +template +object make_function( + F f + , CallPolicies const& policies + , Keywords const& kw + , Signature const& sig + ) +{ + return detail::make_function_aux( + f + , policies + , sig + , kw.range() + , mpl::int_() + ); +} +// } + +}} + + +#endif // MAKE_FUNCTION_DWA20011221_HPP diff --git a/pxr/external/boost/python/manage_new_object.hpp b/pxr/external/boost/python/manage_new_object.hpp new file mode 100644 index 0000000000..9ff341c1ac --- /dev/null +++ b/pxr/external/boost/python/manage_new_object.hpp @@ -0,0 +1,41 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MANAGE_NEW_OBJECT_DWA200222_HPP +# define MANAGE_NEW_OBJECT_DWA200222_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct manage_new_object_requires_a_pointer_return_type +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +struct manage_new_object +{ + template + struct apply + { + typedef typename mpl::if_c< + detail::is_pointer::value + , to_python_indirect + , detail::manage_new_object_requires_a_pointer_return_type + >::type type; + }; +}; + +}} // namespace boost::python + +#endif // MANAGE_NEW_OBJECT_DWA200222_HPP diff --git a/pxr/external/boost/python/module.hpp b/pxr/external/boost/python/module.hpp new file mode 100644 index 0000000000..8ad69f5a34 --- /dev/null +++ b/pxr/external/boost/python/module.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MODULE_DWA2001128_HPP +# define MODULE_DWA2001128_HPP + +# include + +# include +# define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT + +#endif // MODULE_DWA20011221_HPP diff --git a/pxr/external/boost/python/module_init.hpp b/pxr/external/boost/python/module_init.hpp new file mode 100644 index 0000000000..7fe5a1c8a2 --- /dev/null +++ b/pxr/external/boost/python/module_init.hpp @@ -0,0 +1,75 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MODULE_INIT_DWA20020722_HPP +# define MODULE_INIT_DWA20020722_HPP + +# include +# include +# include + +# ifndef BOOST_PYTHON_MODULE_INIT + +namespace boost { namespace python { namespace detail { + +# if PY_VERSION_HEX >= 0x03000000 + +BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef&, void(*)()); + +#else + +BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); + +#endif + +}}} + +# if PY_VERSION_HEX >= 0x03000000 + +# define _BOOST_PYTHON_MODULE_INIT(name) \ + PyObject* BOOST_PP_CAT(PyInit_, name)() \ + { \ + static PyModuleDef_Base initial_m_base = { \ + PyObject_HEAD_INIT(NULL) \ + 0, /* m_init */ \ + 0, /* m_index */ \ + 0 /* m_copy */ }; \ + static PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; \ + \ + static struct PyModuleDef moduledef = { \ + initial_m_base, \ + BOOST_PP_STRINGIZE(name), \ + 0, /* m_doc */ \ + -1, /* m_size */ \ + initial_methods, \ + 0, /* m_reload */ \ + 0, /* m_traverse */ \ + 0, /* m_clear */ \ + 0, /* m_free */ \ + }; \ + \ + return boost::python::detail::init_module( \ + moduledef, BOOST_PP_CAT(init_module_, name) ); \ + } \ + void BOOST_PP_CAT(init_module_, name)() + +# else + +# define _BOOST_PYTHON_MODULE_INIT(name) \ + void BOOST_PP_CAT(init,name)() \ +{ \ + boost::python::detail::init_module( \ + BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ +} \ + void BOOST_PP_CAT(init_module_,name)() + +# endif + +# define BOOST_PYTHON_MODULE_INIT(name) \ + void BOOST_PP_CAT(init_module_,name)(); \ +extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name) + +# endif + +#endif // MODULE_INIT_DWA20020722_HPP diff --git a/pxr/external/boost/python/numpy.hpp b/pxr/external/boost/python/numpy.hpp new file mode 100644 index 0000000000..18a6389d51 --- /dev/null +++ b/pxr/external/boost/python/numpy.hpp @@ -0,0 +1,34 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_hpp_ +#define boost_python_numpy_hpp_ + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace python { namespace numpy { + +/** + * @brief Initialize the Numpy C-API + * + * This must be called before using anything in boost.numpy; + * It should probably be the first line inside BOOST_PYTHON_MODULE. + * + * @internal This just calls the Numpy C-API functions "import_array()" + * and "import_ufunc()", and then calls + * dtype::register_scalar_converters(). + */ +BOOST_NUMPY_DECL void initialize(bool register_scalar_converters=true); + +}}} // namespace boost::python::numpy + +#endif diff --git a/pxr/external/boost/python/numpy/config.hpp b/pxr/external/boost/python/numpy/config.hpp new file mode 100644 index 0000000000..f70b94cb3e --- /dev/null +++ b/pxr/external/boost/python/numpy/config.hpp @@ -0,0 +1,85 @@ +// (C) Copyright Samuli-Petrus Korhonen 2017. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of NMR Solutions, Inc., in +// producing this work. + +// Revision History: +// 15 Feb 17 Initial version + +#ifndef CONFIG_NUMPY20170215_H_ +# define CONFIG_NUMPY20170215_H_ + +# include + +/***************************************************************************** + * + * Set up dll import/export options: + * + ****************************************************************************/ + +// backwards compatibility: +#ifdef BOOST_NUMPY_STATIC_LIB +# define BOOST_NUMPY_STATIC_LINK +# elif !defined(BOOST_NUMPY_DYNAMIC_LIB) +# define BOOST_NUMPY_DYNAMIC_LIB +#endif + +#if defined(BOOST_NUMPY_DYNAMIC_LIB) +# if defined(BOOST_SYMBOL_EXPORT) +# if defined(BOOST_NUMPY_SOURCE) +# define BOOST_NUMPY_DECL BOOST_SYMBOL_EXPORT +# define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT +# define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT +# define BOOST_NUMPY_BUILD_DLL +# else +# define BOOST_NUMPY_DECL BOOST_SYMBOL_IMPORT +# define BOOST_NUMPY_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT +# define BOOST_NUMPY_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT +# endif +# endif + +#endif + +#ifndef BOOST_NUMPY_DECL +# define BOOST_NUMPY_DECL +#endif + +#ifndef BOOST_NUMPY_DECL_FORWARD +# define BOOST_NUMPY_DECL_FORWARD +#endif + +#ifndef BOOST_NUMPY_DECL_EXCEPTION +# define BOOST_NUMPY_DECL_EXCEPTION +#endif + +// enable automatic library variant selection ------------------------------// + +#if !defined(BOOST_NUMPY_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_NUMPY_NO_LIB) +// +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +// +#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION) +// +// If we're importing code from a dll, then tell auto_link.hpp about it: +// +#ifdef BOOST_NUMPY_DYNAMIC_LIB +# define BOOST_DYN_LINK +#endif +// +// And include the header that does the work: +// +#include +#endif // auto-linking disabled + +#undef BOOST_PYTHON_CONCAT +#undef _BOOST_PYTHON_CONCAT + +#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION + +#endif // CONFIG_NUMPY20170215_H_ diff --git a/pxr/external/boost/python/numpy/dtype.hpp b/pxr/external/boost/python/numpy/dtype.hpp new file mode 100644 index 0000000000..4673745e57 --- /dev/null +++ b/pxr/external/boost/python/numpy/dtype.hpp @@ -0,0 +1,117 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_dtype_hpp_ +#define boost_python_numpy_dtype_hpp_ + +/** + * @file boost/python/numpy/dtype.hpp + * @brief Object manager for Python's numpy.dtype class. + */ + +#include +#include +#include +#include +#include + +namespace boost { namespace python { namespace numpy { + +/** + * @brief A boost.python "object manager" (subclass of object) for numpy.dtype. + * + * @todo This could have a lot more interesting accessors. + */ +class BOOST_NUMPY_DECL dtype : public object { + static python::detail::new_reference convert(object::object_cref arg, bool align); +public: + + /// @brief Convert an arbitrary Python object to a data-type descriptor object. + template + explicit dtype(T arg, bool align=false) : object(convert(arg, align)) {} + + /** + * @brief Get the built-in numpy dtype associated with the given scalar template type. + * + * This is perhaps the most useful part of the numpy API: it returns the dtype object + * corresponding to a built-in C++ type. This should work for any integer or floating point + * type supported by numpy, and will also work for std::complex if + * sizeof(std::complex) == 2*sizeof(T). + * + * It can also be useful for users to add explicit specializations for POD structs + * that return field-based dtypes. + */ + template static dtype get_builtin(); + + /// @brief Return the size of the data type in bytes. + int get_itemsize() const; + + /** + * @brief Compare two dtypes for equivalence. + * + * This is more permissive than equality tests. For instance, if long and int are the same + * size, the dtypes corresponding to each will be equivalent, but not equal. + */ + friend BOOST_NUMPY_DECL bool equivalent(dtype const & a, dtype const & b); + + /** + * @brief Register from-Python converters for NumPy's built-in array scalar types. + * + * This is usually called automatically by initialize(), and shouldn't be called twice + * (doing so just adds unused converters to the Boost.Python registry). + */ + static void register_scalar_converters(); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dtype, object); + +}; + +BOOST_NUMPY_DECL bool equivalent(dtype const & a, dtype const & b); + +namespace detail +{ + +template dtype get_int_dtype(); + +template dtype get_float_dtype(); + +template dtype get_complex_dtype(); + +template ::value> +struct builtin_dtype; + +template +struct builtin_dtype { + static dtype get() { return get_int_dtype< 8*sizeof(T), boost::is_unsigned::value >(); } +}; + +template <> +struct BOOST_NUMPY_DECL builtin_dtype { + static dtype get(); +}; + +template +struct builtin_dtype { + static dtype get() { return get_float_dtype< 8*sizeof(T) >(); } +}; + +template +struct builtin_dtype< std::complex, false > { + static dtype get() { return get_complex_dtype< 16*sizeof(T) >(); } +}; + +} // namespace detail + +template +inline dtype dtype::get_builtin() { return detail::builtin_dtype::get(); } + +} // namespace boost::python::numpy + +namespace converter { +NUMPY_OBJECT_MANAGER_TRAITS(numpy::dtype); +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/numpy/internal.hpp b/pxr/external/boost/python/numpy/internal.hpp new file mode 100644 index 0000000000..c24718f0ae --- /dev/null +++ b/pxr/external/boost/python/numpy/internal.hpp @@ -0,0 +1,36 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_internal_hpp_ +#define boost_python_numpy_internal_hpp_ + +/** + * @file boost/python/numpy/internal.hpp + * @brief Internal header file to include the Numpy C-API headers. + * + * This should only be included by source files in the boost.numpy library itself. + */ + +#include +#include +#ifdef BOOST_PYTHON_NUMPY_INTERNAL +#define NO_IMPORT_ARRAY +#define NO_IMPORT_UFUNC +#else +#ifndef BOOST_PYTHON_NUMPY_INTERNAL_MAIN +ERROR_internal_hpp_is_for_internal_use_only +#endif +#endif +#define PY_ARRAY_UNIQUE_SYMBOL BOOST_NUMPY_ARRAY_API +#define PY_UFUNC_UNIQUE_SYMBOL BOOST_UFUNC_ARRAY_API +#include +#include +#include + +#define NUMPY_OBJECT_MANAGER_TRAITS_IMPL(pytype,manager) \ + PyTypeObject const * object_manager_traits::get_pytype() { return &pytype; } + +#endif diff --git a/pxr/external/boost/python/numpy/invoke_matching.hpp b/pxr/external/boost/python/numpy/invoke_matching.hpp new file mode 100644 index 0000000000..095ca3a8db --- /dev/null +++ b/pxr/external/boost/python/numpy/invoke_matching.hpp @@ -0,0 +1,186 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_invoke_matching_hpp_ +#define boost_python_numpy_invoke_matching_hpp_ + +/** + * @brief Template invocation based on dtype matching. + */ + +#include +#include +#include + +namespace boost { namespace python { namespace numpy { +namespace detail +{ + +struct BOOST_NUMPY_DECL add_pointer_meta +{ + template + struct apply + { + typedef typename boost::add_pointer::type type; + }; + +}; + +struct BOOST_NUMPY_DECL dtype_template_match_found {}; +struct BOOST_NUMPY_DECL nd_template_match_found {}; + +template +struct dtype_template_invoker +{ + + template + void operator()(T *) const + { + if (dtype::get_builtin() == m_dtype) + { + m_func.Function::template apply(); + throw dtype_template_match_found(); + } + } + + dtype_template_invoker(dtype const & dtype_, Function func) + : m_dtype(dtype_), m_func(func) {} + +private: + dtype const & m_dtype; + Function m_func; +}; + +template +struct dtype_template_invoker< boost::reference_wrapper > +{ + + template + void operator()(T *) const + { + if (dtype::get_builtin() == m_dtype) + { + m_func.Function::template apply(); + throw dtype_template_match_found(); + } + } + + dtype_template_invoker(dtype const & dtype_, Function & func) + : m_dtype(dtype_), m_func(func) {} + +private: + dtype const & m_dtype; + Function & m_func; +}; + +template +struct nd_template_invoker +{ + template + void operator()(boost::mpl::integral_c *) const + { + if (m_nd == N) + { + m_func.Function::template apply(); + throw nd_template_match_found(); + } + } + + nd_template_invoker(int nd, Function func) : m_nd(nd), m_func(func) {} + +private: + int m_nd; + Function m_func; +}; + +template +struct nd_template_invoker< boost::reference_wrapper > +{ + template + void operator()(boost::mpl::integral_c *) const + { + if (m_nd == N) + { + m_func.Function::template apply(); + throw nd_template_match_found(); + } + } + + nd_template_invoker(int nd, Function & func) : m_nd(nd), m_func(func) {} + +private: + int m_nd; + Function & m_func; +}; + +} // namespace boost::python::numpy::detail + +template +void invoke_matching_nd(int nd, Function f) +{ + detail::nd_template_invoker invoker(nd, f); + try { boost::mpl::for_each< Sequence, detail::add_pointer_meta >(invoker);} + catch (detail::nd_template_match_found &) { return;} + PyErr_SetString(PyExc_TypeError, "number of dimensions not found in template list."); + python::throw_error_already_set(); +} + +template +void invoke_matching_dtype(dtype const & dtype_, Function f) +{ + detail::dtype_template_invoker invoker(dtype_, f); + try { boost::mpl::for_each< Sequence, detail::add_pointer_meta >(invoker);} + catch (detail::dtype_template_match_found &) { return;} + PyErr_SetString(PyExc_TypeError, "dtype not found in template list."); + python::throw_error_already_set(); +} + +namespace detail +{ + +template +struct array_template_invoker_wrapper_2 +{ + template + void apply() const { m_func.Function::template apply();} + array_template_invoker_wrapper_2(Function & func) : m_func(func) {} + +private: + Function & m_func; +}; + +template +struct array_template_invoker_wrapper_1 +{ + template + void apply() const { invoke_matching_nd(m_nd, array_template_invoker_wrapper_2(m_func));} + array_template_invoker_wrapper_1(int nd, Function & func) : m_nd(nd), m_func(func) {} + +private: + int m_nd; + Function & m_func; +}; + +template +struct array_template_invoker_wrapper_1< DimSequence, boost::reference_wrapper > + : public array_template_invoker_wrapper_1< DimSequence, Function > +{ + array_template_invoker_wrapper_1(int nd, Function & func) + : array_template_invoker_wrapper_1< DimSequence, Function >(nd, func) {} +}; + +} // namespace boost::python::numpy::detail + +template +void invoke_matching_array(ndarray const & array_, Function f) +{ + detail::array_template_invoker_wrapper_1 wrapper(array_.get_nd(), f); + invoke_matching_dtype(array_.get_dtype(), wrapper); +} + +}}} // namespace boost::python::numpy + +#endif diff --git a/pxr/external/boost/python/numpy/matrix.hpp b/pxr/external/boost/python/numpy/matrix.hpp new file mode 100644 index 0000000000..829f544af5 --- /dev/null +++ b/pxr/external/boost/python/numpy/matrix.hpp @@ -0,0 +1,84 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_matrix_hpp_ +#define boost_python_numpy_matrix_hpp_ + +/** + * @brief Object manager for numpy.matrix. + */ + +#include +#include +#include +#include + + +namespace boost { namespace python { namespace numpy { + +/** + * @brief A boost.python "object manager" (subclass of object) for numpy.matrix. + * + * @internal numpy.matrix is defined in Python, so object_manager_traits::get_pytype() + * is implemented by importing numpy and getting the "matrix" attribute of the module. + * We then just hope that doesn't get destroyed while we need it, because if we put + * a dynamic python object in a static-allocated boost::python::object or handle<>, + * bad things happen when Python shuts down. I think this solution is safe, but I'd + * love to get that confirmed. + */ +class BOOST_NUMPY_DECL matrix : public ndarray +{ + static object construct(object_cref obj, dtype const & dt, bool copy); + static object construct(object_cref obj, bool copy); +public: + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(matrix, ndarray); + + /// @brief Equivalent to "numpy.matrix(obj,dt,copy)" in Python. + explicit matrix(object const & obj, dtype const & dt, bool copy=true) + : ndarray(extract(construct(obj, dt, copy))) {} + + /// @brief Equivalent to "numpy.matrix(obj,copy=copy)" in Python. + explicit matrix(object const & obj, bool copy=true) + : ndarray(extract(construct(obj, copy))) {} + + /// \brief Return a view of the matrix with the given dtype. + matrix view(dtype const & dt) const; + + /// \brief Copy the scalar (deep for all non-object fields). + matrix copy() const; + + /// \brief Transpose the matrix. + matrix transpose() const; + +}; + +/** + * @brief CallPolicies that causes a function that returns a numpy.ndarray to + * return a numpy.matrix instead. + */ +template +struct as_matrix : Base +{ + static PyObject * postcall(PyObject *, PyObject * result) + { + object a = object(handle<>(result)); + numpy::matrix m(a, false); + Py_INCREF(m.ptr()); + return m.ptr(); + } +}; + +} // namespace boost::python::numpy + +namespace converter +{ + +NUMPY_OBJECT_MANAGER_TRAITS(numpy::matrix); + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/numpy/ndarray.hpp b/pxr/external/boost/python/numpy/ndarray.hpp new file mode 100644 index 0000000000..2cb3b509f8 --- /dev/null +++ b/pxr/external/boost/python/numpy/ndarray.hpp @@ -0,0 +1,313 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_ndarray_hpp_ +#define boost_python_numpy_ndarray_hpp_ + +/** + * @brief Object manager and various utilities for numpy.ndarray. + */ + +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace python { namespace numpy { + +/** + * @brief A boost.python "object manager" (subclass of object) for numpy.ndarray. + * + * @todo This could have a lot more functionality (like boost::python::numeric::array). + * Right now all that exists is what was needed to move raw data between C++ and Python. + */ + +class BOOST_NUMPY_DECL ndarray : public object +{ + + /** + * @brief An internal struct that's byte-compatible with PyArrayObject. + * + * This is just a hack to allow inline access to this stuff while hiding numpy/arrayobject.h + * from the user. + */ + struct array_struct + { + PyObject_HEAD + char * data; + int nd; + Py_intptr_t * shape; + Py_intptr_t * strides; + PyObject * base; + PyObject * descr; + int flags; + PyObject * weakreflist; + }; + + /// @brief Return the held Python object as an array_struct. + array_struct * get_struct() const { return reinterpret_cast(this->ptr()); } + +public: + + /** + * @brief Enum to represent (some) of Numpy's internal flags. + * + * These don't match the actual Numpy flag values; we can't get those without including + * numpy/arrayobject.h or copying them directly. That's very unfortunate. + * + * @todo I'm torn about whether this should be an enum. It's very convenient to not + * make these simple integer values for overloading purposes, but the need to + * define every possible combination and custom bitwise operators is ugly. + */ + enum bitflag + { + NONE=0x0, C_CONTIGUOUS=0x1, F_CONTIGUOUS=0x2, V_CONTIGUOUS=0x1|0x2, + ALIGNED=0x4, WRITEABLE=0x8, BEHAVED=0x4|0x8, + CARRAY_RO=0x1|0x4, CARRAY=0x1|0x4|0x8, CARRAY_MIS=0x1|0x8, + FARRAY_RO=0x2|0x4, FARRAY=0x2|0x4|0x8, FARRAY_MIS=0x2|0x8, + UPDATE_ALL=0x1|0x2|0x4, VARRAY=0x1|0x2|0x8, ALL=0x1|0x2|0x4|0x8 + }; + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(ndarray, object); + + /// @brief Return a view of the scalar with the given dtype. + ndarray view(dtype const & dt) const; + + /// @brief Copy the array, cast to a specified type. + ndarray astype(dtype const & dt) const; + + /// @brief Copy the scalar (deep for all non-object fields). + ndarray copy() const; + + /// @brief Return the size of the nth dimension. raises IndexError if k not in [-get_nd() : get_nd()-1 ] + Py_intptr_t shape(int n) const; + + /// @brief Return the stride of the nth dimension. raises IndexError if k not in [-get_nd() : get_nd()-1] + Py_intptr_t strides(int n) const; + + /** + * @brief Return the array's raw data pointer. + * + * This returns char so stride math works properly on it. It's pretty much + * expected that the user will have to reinterpret_cast it. + */ + char * get_data() const { return get_struct()->data; } + + /// @brief Return the array's data-type descriptor object. + dtype get_dtype() const; + + /// @brief Return the object that owns the array's data, or None if the array owns its own data. + object get_base() const; + + /// @brief Set the object that owns the array's data. Use with care. + void set_base(object const & base); + + /// @brief Return the shape of the array as an array of integers (length == get_nd()). + Py_intptr_t const * get_shape() const { return get_struct()->shape; } + + /// @brief Return the stride of the array as an array of integers (length == get_nd()). + Py_intptr_t const * get_strides() const { return get_struct()->strides; } + + /// @brief Return the number of array dimensions. + int get_nd() const { return get_struct()->nd; } + + /// @brief Return the array flags. + bitflag get_flags() const; + + /// @brief Reverse the dimensions of the array. + ndarray transpose() const; + + /// @brief Eliminate any unit-sized dimensions. + ndarray squeeze() const; + + /// @brief Equivalent to self.reshape(*shape) in Python. + ndarray reshape(python::tuple const & shape) const; + + /** + * @brief If the array contains only a single element, return it as an array scalar; otherwise return + * the array. + * + * @internal This is simply a call to PyArray_Return(); + */ + object scalarize() const; +}; + +/** + * @brief Construct a new array with the given shape and data type, with data initialized to zero. + */ +BOOST_NUMPY_DECL ndarray zeros(python::tuple const & shape, dtype const & dt); +BOOST_NUMPY_DECL ndarray zeros(int nd, Py_intptr_t const * shape, dtype const & dt); + +/** + * @brief Construct a new array with the given shape and data type, with data left uninitialized. + */ +BOOST_NUMPY_DECL ndarray empty(python::tuple const & shape, dtype const & dt); +BOOST_NUMPY_DECL ndarray empty(int nd, Py_intptr_t const * shape, dtype const & dt); + +/** + * @brief Construct a new array from an arbitrary Python sequence. + * + * @todo This does't seem to handle ndarray subtypes the same way that "numpy.array" does in Python. + */ +BOOST_NUMPY_DECL ndarray array(object const & obj); +BOOST_NUMPY_DECL ndarray array(object const & obj, dtype const & dt); + +namespace detail +{ + +BOOST_NUMPY_DECL ndarray from_data_impl(void * data, + dtype const & dt, + std::vector const & shape, + std::vector const & strides, + object const & owner, + bool writeable); + +template +ndarray from_data_impl(void * data, + dtype const & dt, + Container shape, + Container strides, + object const & owner, + bool writeable, + typename boost::enable_if< boost::python::detail::is_integral >::type * enabled = NULL) +{ + std::vector shape_(shape.begin(),shape.end()); + std::vector strides_(strides.begin(), strides.end()); + return from_data_impl(data, dt, shape_, strides_, owner, writeable); +} + +BOOST_NUMPY_DECL ndarray from_data_impl(void * data, + dtype const & dt, + object const & shape, + object const & strides, + object const & owner, + bool writeable); + +} // namespace boost::python::numpy::detail + +/** + * @brief Construct a new ndarray object from a raw pointer. + * + * @param[in] data Raw pointer to the first element of the array. + * @param[in] dt Data type descriptor. Often retrieved with dtype::get_builtin(). + * @param[in] shape Shape of the array as STL container of integers; must have begin() and end(). + * @param[in] strides Shape of the array as STL container of integers; must have begin() and end(). + * @param[in] owner An arbitray Python object that owns that data pointer. The array object will + * keep a reference to the object, and decrement it's reference count when the + * array goes out of scope. Pass None at your own peril. + * + * @todo Should probably take ranges of iterators rather than actual container objects. + */ +template +inline ndarray from_data(void * data, + dtype const & dt, + Container shape, + Container strides, + python::object const & owner) +{ + return numpy::detail::from_data_impl(data, dt, shape, strides, owner, true); +} + +/** + * @brief Construct a new ndarray object from a raw pointer. + * + * @param[in] data Raw pointer to the first element of the array. + * @param[in] dt Data type descriptor. Often retrieved with dtype::get_builtin(). + * @param[in] shape Shape of the array as STL container of integers; must have begin() and end(). + * @param[in] strides Shape of the array as STL container of integers; must have begin() and end(). + * @param[in] owner An arbitray Python object that owns that data pointer. The array object will + * keep a reference to the object, and decrement it's reference count when the + * array goes out of scope. Pass None at your own peril. + * + * This overload takes a const void pointer and sets the "writeable" flag of the array to false. + * + * @todo Should probably take ranges of iterators rather than actual container objects. + */ +template +inline ndarray from_data(void const * data, + dtype const & dt, + Container shape, + Container strides, + python::object const & owner) +{ + return numpy::detail::from_data_impl(const_cast(data), dt, shape, strides, owner, false); +} + +/** + * @brief Transform an arbitrary object into a numpy array with the given requirements. + * + * @param[in] obj An arbitrary python object to convert. Arrays that meet the requirements + * will be passed through directly. + * @param[in] dt Data type descriptor. Often retrieved with dtype::get_builtin(). + * @param[in] nd_min Minimum number of dimensions. + * @param[in] nd_max Maximum number of dimensions. + * @param[in] flags Bitwise OR of flags specifying additional requirements. + */ +BOOST_NUMPY_DECL ndarray from_object(object const & obj, + dtype const & dt, + int nd_min, + int nd_max, + ndarray::bitflag flags=ndarray::NONE); + +BOOST_NUMPY_DECL inline ndarray from_object(object const & obj, + dtype const & dt, + int nd, + ndarray::bitflag flags=ndarray::NONE) +{ + return from_object(obj, dt, nd, nd, flags); +} + +BOOST_NUMPY_DECL inline ndarray from_object(object const & obj, + dtype const & dt, + ndarray::bitflag flags=ndarray::NONE) +{ + return from_object(obj, dt, 0, 0, flags); +} + +BOOST_NUMPY_DECL ndarray from_object(object const & obj, + int nd_min, + int nd_max, + ndarray::bitflag flags=ndarray::NONE); + +BOOST_NUMPY_DECL inline ndarray from_object(object const & obj, + int nd, + ndarray::bitflag flags=ndarray::NONE) +{ + return from_object(obj, nd, nd, flags); +} + +BOOST_NUMPY_DECL inline ndarray from_object(object const & obj, + ndarray::bitflag flags=ndarray::NONE) +{ + return from_object(obj, 0, 0, flags); +} + +BOOST_NUMPY_DECL inline ndarray::bitflag operator|(ndarray::bitflag a, + ndarray::bitflag b) +{ + return ndarray::bitflag(int(a) | int(b)); +} + +BOOST_NUMPY_DECL inline ndarray::bitflag operator&(ndarray::bitflag a, + ndarray::bitflag b) +{ + return ndarray::bitflag(int(a) & int(b)); +} + +} // namespace boost::python::numpy + +namespace converter +{ + +NUMPY_OBJECT_MANAGER_TRAITS(numpy::ndarray); + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp new file mode 100644 index 0000000000..a138f4cd52 --- /dev/null +++ b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp @@ -0,0 +1,38 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_numpy_object_mgr_traits_hpp_ +#define boost_python_numpy_numpy_object_mgr_traits_hpp_ + +#include + +/** + * @brief Macro that specializes object_manager_traits by requiring a + * source-file implementation of get_pytype(). + */ + +#define NUMPY_OBJECT_MANAGER_TRAITS(manager) \ +template <> \ +struct BOOST_NUMPY_DECL object_manager_traits \ +{ \ + BOOST_STATIC_CONSTANT(bool, is_specialized = true); \ + static inline python::detail::new_reference adopt(PyObject* x) \ + { \ + return python::detail::new_reference(python::pytype_check((PyTypeObject*)get_pytype(), x)); \ + } \ + static bool check(PyObject* x) \ + { \ + return ::PyObject_IsInstance(x, (PyObject*)get_pytype()); \ + } \ + static manager* checked_downcast(PyObject* x) \ + { \ + return python::downcast((checked_downcast_impl)(x, (PyTypeObject*)get_pytype())); \ + } \ + static PyTypeObject const * get_pytype(); \ +} + +#endif + diff --git a/pxr/external/boost/python/numpy/scalars.hpp b/pxr/external/boost/python/numpy/scalars.hpp new file mode 100644 index 0000000000..c2a83d8253 --- /dev/null +++ b/pxr/external/boost/python/numpy/scalars.hpp @@ -0,0 +1,58 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_scalars_hpp_ +#define boost_python_numpy_scalars_hpp_ + +/** + * @brief Object managers for array scalars (currently only numpy.void is implemented). + */ + +#include +#include +#include + +namespace boost { namespace python { namespace numpy { + +/** + * @brief A boost.python "object manager" (subclass of object) for numpy.void. + * + * @todo This could have a lot more functionality. + */ +class BOOST_NUMPY_DECL void_ : public object +{ + static python::detail::new_reference convert(object_cref arg, bool align); +public: + + /** + * @brief Construct a new array scalar with the given size and void dtype. + * + * Data is initialized to zero. One can create a standalone scalar object + * with a certain dtype "dt" with: + * @code + * void_ scalar = void_(dt.get_itemsize()).view(dt); + * @endcode + */ + explicit void_(Py_ssize_t size); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(void_, object); + + /// @brief Return a view of the scalar with the given dtype. + void_ view(dtype const & dt) const; + + /// @brief Copy the scalar (deep for all non-object fields). + void_ copy() const; + +}; + +} // namespace boost::python::numpy + +namespace converter +{ +NUMPY_OBJECT_MANAGER_TRAITS(numpy::void_); +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/numpy/ufunc.hpp b/pxr/external/boost/python/numpy/ufunc.hpp new file mode 100644 index 0000000000..79d7d262b8 --- /dev/null +++ b/pxr/external/boost/python/numpy/ufunc.hpp @@ -0,0 +1,206 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_numpy_ufunc_hpp_ +#define boost_python_numpy_ufunc_hpp_ + +/** + * @brief Utilities to create ufunc-like broadcasting functions out of C++ functors. + */ + +#include +#include +#include +#include +#include + +namespace boost { namespace python { namespace numpy { + +/** + * @brief A boost.python "object manager" (subclass of object) for PyArray_MultiIter. + * + * multi_iter is a Python object, but a very low-level one. It should generally only be used + * in loops of the form: + * @code + * while (iter.not_done()) { + * ... + * iter.next(); + * } + * @endcode + * + * @todo I can't tell if this type is exposed in Python anywhere; if it is, we should use that name. + * It's more dangerous than most object managers, however - maybe it actually belongs in + * a detail namespace? + */ +class BOOST_NUMPY_DECL multi_iter : public object +{ +public: + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(multi_iter, object); + + /// @brief Increment the iterator. + void next(); + + /// @brief Check if the iterator is at its end. + bool not_done() const; + + /// @brief Return a pointer to the element of the nth broadcasted array. + char * get_data(int n) const; + + /// @brief Return the number of dimensions of the broadcasted array expression. + int get_nd() const; + + /// @brief Return the shape of the broadcasted array expression as an array of integers. + Py_intptr_t const * get_shape() const; + + /// @brief Return the shape of the broadcasted array expression in the nth dimension. + Py_intptr_t shape(int n) const; + +}; + +/// @brief Construct a multi_iter over a single sequence or scalar object. +BOOST_NUMPY_DECL multi_iter make_multi_iter(object const & a1); + +/// @brief Construct a multi_iter by broadcasting two objects. +BOOST_NUMPY_DECL multi_iter make_multi_iter(object const & a1, object const & a2); + +/// @brief Construct a multi_iter by broadcasting three objects. +BOOST_NUMPY_DECL multi_iter make_multi_iter(object const & a1, object const & a2, object const & a3); + +/** + * @brief Helps wrap a C++ functor taking a single scalar argument as a broadcasting ufunc-like + * Python object. + * + * Typical usage looks like this: + * @code + * struct TimesPI + * { + * typedef double argument_type; + * typedef double result_type; + * double operator()(double input) const { return input * M_PI; } + * }; + * + * BOOST_PYTHON_MODULE(example) + * { + * class_< TimesPI >("TimesPI") + * .def("__call__", unary_ufunc::make()); + * } + * @endcode + * + */ +template +struct unary_ufunc +{ + + /** + * @brief A C++ function with object arguments that broadcasts its arguments before + * passing them to the underlying C++ functor. + */ + static object call(TUnaryFunctor & self, object const & input, object const & output) + { + dtype in_dtype = dtype::get_builtin(); + dtype out_dtype = dtype::get_builtin(); + ndarray in_array = from_object(input, in_dtype, ndarray::ALIGNED); + ndarray out_array = ! output.is_none() ? + from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE) + : zeros(in_array.get_nd(), in_array.get_shape(), out_dtype); + multi_iter iter = make_multi_iter(in_array, out_array); + while (iter.not_done()) + { + TArgument * argument = reinterpret_cast(iter.get_data(0)); + TResult * result = reinterpret_cast(iter.get_data(1)); + *result = self(*argument); + iter.next(); + } + return out_array.scalarize(); + } + + /** + * @brief Construct a boost.python function object from call() with reasonable keyword names. + * + * Users will often want to specify their own keyword names with the same signature, but this + * is a convenient shortcut. + */ + static object make() + { + return make_function(call, default_call_policies(), (arg("input"), arg("output")=object())); + } +}; + +/** + * @brief Helps wrap a C++ functor taking a pair of scalar arguments as a broadcasting ufunc-like + * Python object. + * + * Typical usage looks like this: + * @code + * struct CosSum + * { + * typedef double first_argument_type; + * typedef double second_argument_type; + * typedef double result_type; + * double operator()(double input1, double input2) const { return std::cos(input1 + input2); } + * }; + * + * BOOST_PYTHON_MODULE(example) + * { + * class_< CosSum >("CosSum") + * .def("__call__", binary_ufunc::make()); + * } + * @endcode + * + */ +template +struct binary_ufunc +{ + + static object + call(TBinaryFunctor & self, object const & input1, object const & input2, + object const & output) + { + dtype in1_dtype = dtype::get_builtin(); + dtype in2_dtype = dtype::get_builtin(); + dtype out_dtype = dtype::get_builtin(); + ndarray in1_array = from_object(input1, in1_dtype, ndarray::ALIGNED); + ndarray in2_array = from_object(input2, in2_dtype, ndarray::ALIGNED); + multi_iter iter = make_multi_iter(in1_array, in2_array); + ndarray out_array = !output.is_none() + ? from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE) + : zeros(iter.get_nd(), iter.get_shape(), out_dtype); + iter = make_multi_iter(in1_array, in2_array, out_array); + while (iter.not_done()) + { + TArgument1 * argument1 = reinterpret_cast(iter.get_data(0)); + TArgument2 * argument2 = reinterpret_cast(iter.get_data(1)); + TResult * result = reinterpret_cast(iter.get_data(2)); + *result = self(*argument1, *argument2); + iter.next(); + } + return out_array.scalarize(); + } + + static object make() + { + return make_function(call, default_call_policies(), + (arg("input1"), arg("input2"), arg("output")=object())); + } + +}; + +} // namespace boost::python::numpy + +namespace converter +{ + +NUMPY_OBJECT_MANAGER_TRAITS(numpy::multi_iter); + +}}} // namespace boost::python::converter + +#endif diff --git a/pxr/external/boost/python/object.hpp b/pxr/external/boost/python/object.hpp new file mode 100644 index 0000000000..9adec90f64 --- /dev/null +++ b/pxr/external/boost/python/object.hpp @@ -0,0 +1,27 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_DWA2002612_HPP +# define OBJECT_DWA2002612_HPP + +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + + inline ssize_t len(object const& obj) + { + ssize_t result = PyObject_Length(obj.ptr()); + if (PyErr_Occurred()) throw_error_already_set(); + return result; + } + +}} // namespace boost::python + +#endif // OBJECT_DWA2002612_HPP diff --git a/pxr/external/boost/python/object/add_to_namespace.hpp b/pxr/external/boost/python/object/add_to_namespace.hpp new file mode 100644 index 0000000000..9f4167d6d2 --- /dev/null +++ b/pxr/external/boost/python/object/add_to_namespace.hpp @@ -0,0 +1,23 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ADD_TO_NAMESPACE_DWA200286_HPP +# define ADD_TO_NAMESPACE_DWA200286_HPP + +# include + +namespace boost { namespace python { namespace objects { + +// +// A setattr that's "smart" about function overloading (and docstrings). +// +BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute); + +BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute, char const* doc); + +}}} // namespace boost::python::objects + +#endif // ADD_TO_NAMESPACE_DWA200286_HPP diff --git a/pxr/external/boost/python/object/class.hpp b/pxr/external/boost/python/object/class.hpp new file mode 100644 index 0000000000..f57ceda7bd --- /dev/null +++ b/pxr/external/boost/python/object/class.hpp @@ -0,0 +1,63 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CLASS_DWA20011214_HPP +# define CLASS_DWA20011214_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace objects { + +struct BOOST_PYTHON_DECL class_base : python::api::object +{ + // constructor + class_base( + char const* name // The name of the class + + , std::size_t num_types // A list of class_ids. The first is the type + , type_info const*const types // this is wrapping. The rest are the types of + // any bases. + + , char const* doc = 0 // Docstring, if any. + ); + + + // Implementation detail. Hiding this in the private section would + // require use of template friend declarations. + void enable_pickling_(bool getstate_manages_dict); + + protected: + void add_property( + char const* name, object const& fget, char const* docstr); + void add_property(char const* name, + object const& fget, object const& fset, char const* docstr); + + void add_static_property(char const* name, object const& fget); + void add_static_property(char const* name, object const& fget, object const& fset); + + // Retrieve the underlying object + void setattr(char const* name, object const&); + + // Set a special attribute in the class which tells Boost.Python + // to allocate extra bytes for embedded C++ objects in Python + // instances. + void set_instance_size(std::size_t bytes); + + // Set an __init__ function which throws an appropriate exception + // for abstract classes. + void def_no_init(); + + // Effects: + // setattr(self, staticmethod(getattr(self, method_name))) + void make_method_static(const char *method_name); +}; + +}}} // namespace boost::python::objects + +#endif // CLASS_DWA20011214_HPP diff --git a/pxr/external/boost/python/object/class_detail.hpp b/pxr/external/boost/python/object/class_detail.hpp new file mode 100644 index 0000000000..a17a4f4330 --- /dev/null +++ b/pxr/external/boost/python/object/class_detail.hpp @@ -0,0 +1,19 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CLASS_DETAIL_DWA200295_HPP +# define CLASS_DETAIL_DWA200295_HPP + +# include +# include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL type_handle registered_class_object(type_info id); +BOOST_PYTHON_DECL type_handle class_metatype(); +BOOST_PYTHON_DECL type_handle class_type(); + +}}} // namespace boost::python::object + +#endif // CLASS_DETAIL_DWA200295_HPP diff --git a/pxr/external/boost/python/object/class_metadata.hpp b/pxr/external/boost/python/object/class_metadata.hpp new file mode 100644 index 0000000000..06d3f8efa7 --- /dev/null +++ b/pxr/external/boost/python/object/class_metadata.hpp @@ -0,0 +1,294 @@ +// Copyright David Abrahams 2004. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_object_class_metadata_hpp_ +#define boost_python_object_class_metadata_hpp_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL +void copy_class_object(type_info const& src, type_info const& dst); + +// +// Support for registering base/derived relationships +// +template +struct register_base_of +{ + template + inline void operator()(Base*) const + { + BOOST_MPL_ASSERT_NOT((boost::python::detail::is_same)); + + // Register the Base class + register_dynamic_id(); + + // Register the up-cast + register_conversion(false); + + // Register the down-cast, if appropriate. + this->register_downcast((Base*)0, boost::python::detail::is_polymorphic()); + } + + private: + static inline void register_downcast(void*, boost::python::detail::false_) {} + + template + static inline void register_downcast(Base*, boost::python::detail::true_) + { + register_conversion(true); + } + +}; + +// +// Preamble of register_class. Also used for callback classes, which +// need some registration of their own. +// + +template +inline void register_shared_ptr_from_python_and_casts(T*, Bases) +{ + // Constructor performs registration + python::detail::force_instantiate(converter::shared_ptr_from_python()); +#if !defined(BOOST_NO_CXX11_SMART_PTR) + python::detail::force_instantiate(converter::shared_ptr_from_python()); +#endif + + // + // register all up/downcasts here. We're using the alternate + // interface to mpl::for_each to avoid an MSVC 6 bug. + // + register_dynamic_id(); + mpl::for_each(register_base_of(), (Bases*)0, (boost::python::detail::add_pointer*)0); +} + +// +// Helper for choosing the unnamed held_type argument +// +template +struct select_held_type + : mpl::if_< + mpl::or_< + python::detail::specifies_bases + , boost::python::detail::is_same + > + , Prev + , T + > +{ +}; + +template < + class T // class being wrapped + , class X1 // = detail::not_specified + , class X2 // = detail::not_specified + , class X3 // = detail::not_specified +> +struct class_metadata +{ + // + // Calculate the unnamed template arguments + // + + // held_type_arg -- not_specified, [a class derived from] T or a + // smart pointer to [a class derived from] T. Preserving + // not_specified allows us to give class_ a back-reference. + typedef typename select_held_type< + X1 + , typename select_held_type< + X2 + , typename select_held_type< + X3 + , python::detail::not_specified + >::type + >::type + >::type held_type_arg; + + // bases + typedef typename python::detail::select_bases< + X1 + , typename python::detail::select_bases< + X2 + , typename python::detail::select_bases< + X3 + , python::bases<> + >::type + >::type + >::type bases; + + typedef mpl::or_< + boost::python::detail::is_same + , boost::python::detail::is_same + , boost::python::detail::is_same + > is_noncopyable; + + // + // Holder computation. + // + + // Compute the actual type that will be held in the Holder. + typedef typename mpl::if_< + boost::python::detail::is_same, T, held_type_arg + >::type held_type; + + // Determine if the object will be held by value + typedef mpl::bool_::value> use_value_holder; + + // Compute the "wrapped type", that is, if held_type is a smart + // pointer, we're talking about the pointee. + typedef typename mpl::eval_if< + use_value_holder + , mpl::identity + , pointee + >::type wrapped; + + // Determine whether to use a "back-reference holder" + typedef mpl::bool_< + mpl::or_< + has_back_reference + , boost::python::detail::is_same + , is_base_and_derived + >::value + > use_back_reference; + + // Select the holder. + typedef typename mpl::eval_if< + use_back_reference + , mpl::if_< + use_value_holder + , value_holder_back_reference + , pointer_holder_back_reference + > + , mpl::if_< + use_value_holder + , value_holder + , pointer_holder + > + >::type holder; + + inline static void register_() // Register the runtime metadata. + { + class_metadata::register_aux((T*)0); + } + + private: + template + inline static void register_aux(python::wrapper*) + { + typedef typename mpl::not_ >::type use_callback; + class_metadata::register_aux2((T2*)0, use_callback()); + } + + inline static void register_aux(void*) + { + typedef typename is_base_and_derived::type use_callback; + class_metadata::register_aux2((T*)0, use_callback()); + } + + template + inline static void register_aux2(T2*, Callback) + { + objects::register_shared_ptr_from_python_and_casts((T2*)0, bases()); + class_metadata::maybe_register_callback_class((T2*)0, Callback()); + + class_metadata::maybe_register_class_to_python((T2*)0, is_noncopyable()); + + class_metadata::maybe_register_pointer_to_python( + (T2*)0, (use_value_holder*)0, (use_back_reference*)0); + } + + + // + // Support for converting smart pointers to python + // + inline static void maybe_register_pointer_to_python(...) {} + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) + { + objects::copy_class_object(python::type_id(), python::type_id >()); + objects::copy_class_object(python::type_id(), python::type_id >()); + } +#endif + + template + inline static void maybe_register_pointer_to_python(T2*, mpl::false_*, mpl::false_*) + { + python::detail::force_instantiate( + objects::class_value_wrapper< + held_type + , make_ptr_instance > + >() + ); +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + // explicit qualification of type_id makes msvc6 happy + objects::copy_class_object(python::type_id(), python::type_id()); +#endif + } + // + // Support for registering to-python converters + // + inline static void maybe_register_class_to_python(void*, mpl::true_) {} + + + template + inline static void maybe_register_class_to_python(T2*, mpl::false_) + { + python::detail::force_instantiate(class_cref_wrapper >()); +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + // explicit qualification of type_id makes msvc6 happy + objects::copy_class_object(python::type_id(), python::type_id()); +#endif + } + + // + // Support for registering callback classes + // + inline static void maybe_register_callback_class(void*, mpl::false_) {} + + template + inline static void maybe_register_callback_class(T2*, mpl::true_) + { + objects::register_shared_ptr_from_python_and_casts( + (wrapped*)0, mpl::single_view()); + // explicit qualification of type_id makes msvc6 happy + objects::copy_class_object(python::type_id(), python::type_id()); + } +}; + +}}} // namespace boost::python::object + +#endif diff --git a/pxr/external/boost/python/object/class_wrapper.hpp b/pxr/external/boost/python/object/class_wrapper.hpp new file mode 100644 index 0000000000..ffee7457ab --- /dev/null +++ b/pxr/external/boost/python/object/class_wrapper.hpp @@ -0,0 +1,51 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef CLASS_WRAPPER_DWA20011221_HPP +# define CLASS_WRAPPER_DWA20011221_HPP + +# include +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif +# include + +namespace boost { namespace python { namespace objects { + +// +// These two classes adapt the static execute function of a class +// MakeInstance execute() function returning a new PyObject* +// reference. The first one is used for class copy constructors, and +// the second one is used to handle smart pointers. +// + +template +struct class_cref_wrapper + : to_python_converter ,true> +{ + static PyObject* convert(Src const& x) + { + return MakeInstance::execute(boost::ref(x)); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const *get_pytype() { return converter::registered_pytype_direct::get_pytype(); } +#endif +}; + +template +struct class_value_wrapper + : to_python_converter ,true> +{ + static PyObject* convert(Src x) + { + return MakeInstance::execute(x); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const *get_pytype() { return MakeInstance::get_pytype(); } +#endif +}; + +}}} // namespace boost::python::objects + +#endif // CLASS_WRAPPER_DWA20011221_HPP diff --git a/pxr/external/boost/python/object/enum_base.hpp b/pxr/external/boost/python/object/enum_base.hpp new file mode 100644 index 0000000000..be34274226 --- /dev/null +++ b/pxr/external/boost/python/object/enum_base.hpp @@ -0,0 +1,36 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ENUM_BASE_DWA200298_HPP +# define ENUM_BASE_DWA200298_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +struct BOOST_PYTHON_DECL enum_base : python::api::object +{ + protected: + enum_base( + char const* name + , converter::to_python_function_t + , converter::convertible_function + , converter::constructor_function + , type_info + , const char *doc = 0 + ); + + void add_value(char const* name, long value); + void export_values(); + + static PyObject* to_python(PyTypeObject* type, long x); +}; + +}}} // namespace boost::python::object + +#endif // ENUM_BASE_DWA200298_HPP diff --git a/pxr/external/boost/python/object/find_instance.hpp b/pxr/external/boost/python/object/find_instance.hpp new file mode 100644 index 0000000000..3202c1cd15 --- /dev/null +++ b/pxr/external/boost/python/object/find_instance.hpp @@ -0,0 +1,21 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FIND_INSTANCE_DWA2002312_HPP +# define FIND_INSTANCE_DWA2002312_HPP + +# include + +namespace boost { namespace python { namespace objects { + +// Given a type_id, find the instance data which corresponds to it, or +// return 0 in case no such type is held. If null_shared_ptr_only is +// true and the type being sought is a shared_ptr, only find an +// instance if it turns out to be NULL. Needed for shared_ptr rvalue +// from_python support. +BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_shared_ptr_only = false); + +}}} // namespace boost::python::objects + +#endif // FIND_INSTANCE_DWA2002312_HPP diff --git a/pxr/external/boost/python/object/forward.hpp b/pxr/external/boost/python/object/forward.hpp new file mode 100644 index 0000000000..c6515bb55b --- /dev/null +++ b/pxr/external/boost/python/object/forward.hpp @@ -0,0 +1,94 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FORWARD_DWA20011215_HPP +# define FORWARD_DWA20011215_HPP + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +// Very much like boost::reference_wrapper, except that in this +// case T can be a reference already without causing a +// reference-to-reference error. +template +struct reference_to_value +{ + typedef typename boost::python::detail::add_lvalue_reference::type>::type reference; + + reference_to_value(reference x) : m_value(x) {} + reference get() const { return m_value; } + private: + reference m_value; +}; + +// A little metaprogram which selects the type to pass through an +// intermediate forwarding function when the destination argument type +// is T. +template +struct forward + : mpl::if_< + mpl::or_, boost::python::detail::is_scalar > + , T + , reference_to_value + > +{ +}; + +template +struct unforward +{ + typedef typename unwrap_reference::type& type; +}; + +template +struct unforward > +{ + typedef T type; +}; + +template +struct unforward_cref + : python::detail::value_arg< + typename unwrap_reference::type + > +{ +}; + +template +struct unforward_cref > + : boost::python::detail::add_lvalue_reference::type> +{ +}; + + +template +typename reference_to_value::reference +do_unforward(reference_to_value const& x, int) +{ + return x.get(); +} + +template +typename reference_wrapper::type& +do_unforward(reference_wrapper const& x, int) +{ + return x.get(); +} + +template +T const& do_unforward(T const& x, ...) +{ + return x; +} + +}}} // namespace boost::python::objects + +#endif // FORWARD_DWA20011215_HPP diff --git a/pxr/external/boost/python/object/function.hpp b/pxr/external/boost/python/object/function.hpp new file mode 100644 index 0000000000..f29d344820 --- /dev/null +++ b/pxr/external/boost/python/object/function.hpp @@ -0,0 +1,82 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FUNCTION_DWA20011214_HPP +# define FUNCTION_DWA20011214_HPP + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + + +struct BOOST_PYTHON_DECL function : PyObject +{ + function( + py_function const& + , python::detail::keyword const* names_and_defaults + , unsigned num_keywords); + + ~function(); + + PyObject* call(PyObject*, PyObject*) const; + + // Add an attribute to the name_space with the given name. If it is + // a function object (this class), and an existing function is + // already there, add it as an overload. + static void add_to_namespace( + object const& name_space, char const* name, object const& attribute); + + static void add_to_namespace( + object const& name_space, char const* name, object const& attribute, char const* doc); + + object const& doc() const; + void doc(object const& x); + + object const& name() const; + + object const& get_namespace() const { return m_namespace; } + + private: // helper functions + object signature(bool show_return_type=false) const; + object signatures(bool show_return_type=false) const; + void argument_error(PyObject* args, PyObject* keywords) const; + void add_overload(handle const&); + + private: // data members + py_function m_fn; + handle m_overloads; + object m_name; + object m_namespace; + object m_doc; + object m_arg_names; + unsigned m_nkeyword_values; + friend class function_doc_signature_generator; +}; + +// +// implementations +// +inline object const& function::doc() const +{ + return this->m_doc; +} + +inline void function::doc(object const& x) +{ + this->m_doc = x; +} + +inline object const& function::name() const +{ + return this->m_name; +} + +}}} // namespace boost::python::objects + +#endif // FUNCTION_DWA20011214_HPP diff --git a/pxr/external/boost/python/object/function_doc_signature.hpp b/pxr/external/boost/python/object/function_doc_signature.hpp new file mode 100644 index 0000000000..4f00cb385a --- /dev/null +++ b/pxr/external/boost/python/object/function_doc_signature.hpp @@ -0,0 +1,36 @@ +// Copyright Nikolay Mladenov 2007. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FUNCTION_SIGNATURE_20070531_HPP +# define FUNCTION_SIGNATURE_20070531_HPP + +#include +#include +#include +#include + +#include + + +#include + +namespace boost { namespace python { namespace objects { + +class function_doc_signature_generator{ + static const char * py_type_str(const python::detail::signature_element &s); + static bool arity_cmp( function const *f1, function const *f2 ); + static bool are_seq_overloads( function const *f1, function const *f2 , bool check_docs); + static std::vector flatten(function const *f); + static std::vector split_seq_overloads( const std::vector &funcs, bool split_on_doc_change); + static str raw_function_pretty_signature(function const *f, size_t n_overloads, bool cpp_types = false); + static str parameter_string(py_function const &f, size_t n, object arg_names, bool cpp_types); + static str pretty_signature(function const *f, size_t n_overloads, bool cpp_types = false); + +public: + static list function_doc_signatures( function const * f); +}; + +}}}//end of namespace boost::python::objects + +#endif //FUNCTION_SIGNATURE_20070531_HPP diff --git a/pxr/external/boost/python/object/function_handle.hpp b/pxr/external/boost/python/object/function_handle.hpp new file mode 100644 index 0000000000..7edaf2ce3a --- /dev/null +++ b/pxr/external/boost/python/object/function_handle.hpp @@ -0,0 +1,44 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FUNCTION_HANDLE_DWA2002725_HPP +# define FUNCTION_HANDLE_DWA2002725_HPP +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL handle<> function_handle_impl(py_function const& f); + +// Just like function_object, but returns a handle<> instead. Using +// this for arg_to_python<> allows us to break a circular dependency +// between object and arg_to_python. +template +inline handle<> function_handle(F const& f, Signature) +{ + enum { n_arguments = mpl::size::value - 1 }; + + return objects::function_handle_impl( + python::detail::caller< + F,default_call_policies,Signature + >( + f, default_call_policies() + ) + ); +} + +// Just like make_function, but returns a handle<> intead. Same +// reasoning as above. +template +handle<> make_function_handle(F f) +{ + return objects::function_handle(f, python::detail::get_signature(f)); +} + +}}} // namespace boost::python::objects + +#endif // FUNCTION_HANDLE_DWA2002725_HPP diff --git a/pxr/external/boost/python/object/function_object.hpp b/pxr/external/boost/python/object/function_object.hpp new file mode 100644 index 0000000000..eaa079fbe0 --- /dev/null +++ b/pxr/external/boost/python/object/function_object.hpp @@ -0,0 +1,40 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef FUNCTION_OBJECT_DWA2002725_HPP +# define FUNCTION_OBJECT_DWA2002725_HPP +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace objects +{ + BOOST_PYTHON_DECL api::object function_object( + py_function const& f + , python::detail::keyword_range const&); + + BOOST_PYTHON_DECL api::object function_object( + py_function const& f + , python::detail::keyword_range const&); + + BOOST_PYTHON_DECL api::object function_object(py_function const& f); + + // Add an attribute to the name_space with the given name. If it is + // a Boost.Python function object + // (boost/python/object/function.hpp), and an existing function is + // already there, add it as an overload. + BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute); + + BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute, char const* doc); +} + +}} // namespace boost::python::objects + +#endif // FUNCTION_OBJECT_DWA2002725_HPP diff --git a/pxr/external/boost/python/object/inheritance.hpp b/pxr/external/boost/python/object/inheritance.hpp new file mode 100644 index 0000000000..90e56f0c1d --- /dev/null +++ b/pxr/external/boost/python/object/inheritance.hpp @@ -0,0 +1,131 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef INHERITANCE_DWA200216_HPP +# define INHERITANCE_DWA200216_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +typedef type_info class_id; +using python::type_id; + +// Types used to get address and id of most derived type +typedef std::pair dynamic_id_t; +typedef dynamic_id_t (*dynamic_id_function)(void*); + +BOOST_PYTHON_DECL void register_dynamic_id_aux( + class_id static_id, dynamic_id_function get_dynamic_id); + +BOOST_PYTHON_DECL void add_cast( + class_id src_t, class_id dst_t, void* (*cast)(void*), bool is_downcast); + +// +// a generator with an execute() function which, given a source type +// and a pointer to an object of that type, returns its most-derived +// /reachable/ type identifier and object pointer. +// + +// first, the case where T has virtual functions +template +struct polymorphic_id_generator +{ + static dynamic_id_t execute(void* p_) + { + T* p = static_cast(p_); + return std::make_pair(dynamic_cast(p), class_id(typeid(*p))); + } +}; + +// now, the non-polymorphic case. +template +struct non_polymorphic_id_generator +{ + static dynamic_id_t execute(void* p_) + { + return std::make_pair(p_, python::type_id()); + } +}; + +// Now the generalized selector +template +struct dynamic_id_generator + : mpl::if_< + boost::python::detail::is_polymorphic + , boost::python::objects::polymorphic_id_generator + , boost::python::objects::non_polymorphic_id_generator + > +{}; + +// Register the dynamic id function for T with the type-conversion +// system. +template +void register_dynamic_id(T* = 0) +{ + typedef typename dynamic_id_generator::type generator; + register_dynamic_id_aux( + python::type_id(), &generator::execute); +} + +// +// a generator with an execute() function which, given a void* +// pointing to an object of type Source will attempt to convert it to +// an object of type Target. +// + +template +struct dynamic_cast_generator +{ + static void* execute(void* source) + { + return dynamic_cast( + static_cast(source)); + } + +}; + +template +struct implicit_cast_generator +{ + static void* execute(void* source) + { + Target* result = static_cast(source); + return result; + } +}; + +template +struct cast_generator + : mpl::if_< + boost::python::detail::is_base_and_derived + , implicit_cast_generator + , dynamic_cast_generator + > +{ +}; + +template +inline void register_conversion( + bool is_downcast = ::boost::is_base_and_derived::value + // These parameters shouldn't be used; they're an MSVC bug workaround + , Source* = 0, Target* = 0) +{ + typedef typename cast_generator::type generator; + + add_cast( + python::type_id() + , python::type_id() + , &generator::execute + , is_downcast + ); +} + +}}} // namespace boost::python::object + +#endif // INHERITANCE_DWA200216_HPP diff --git a/pxr/external/boost/python/object/inheritance_query.hpp b/pxr/external/boost/python/object/inheritance_query.hpp new file mode 100644 index 0000000000..916e161f29 --- /dev/null +++ b/pxr/external/boost/python/object/inheritance_query.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef INHERITANCE_QUERY_DWA2003520_HPP +# define INHERITANCE_QUERY_DWA2003520_HPP + +# include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL void* find_static_type(void* p, type_info src, type_info dst); +BOOST_PYTHON_DECL void* find_dynamic_type(void* p, type_info src, type_info dst); + +}}} // namespace boost::python::object + +#endif // INHERITANCE_QUERY_DWA2003520_HPP diff --git a/pxr/external/boost/python/object/instance.hpp b/pxr/external/boost/python/object/instance.hpp new file mode 100644 index 0000000000..ee4a6c5822 --- /dev/null +++ b/pxr/external/boost/python/object/instance.hpp @@ -0,0 +1,52 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef INSTANCE_DWA200295_HPP +# define INSTANCE_DWA200295_HPP + +# include +# include +# include + +namespace boost { namespace python +{ + struct instance_holder; +}} // namespace boost::python + +namespace boost { namespace python { namespace objects { + +// Each extension instance will be one of these +template +struct instance +{ + PyObject_VAR_HEAD + PyObject* dict; + PyObject* weakrefs; + instance_holder* objects; + + typedef typename boost::python::detail::type_with_alignment< + boost::python::detail::alignment_of::value + >::type align_t; + + union + { + align_t align; + char bytes[sizeof(Data)]; + } storage; +}; + +template +struct additional_instance_size +{ + typedef instance instance_data; + typedef instance instance_char; + BOOST_STATIC_CONSTANT(std::size_t, + value = sizeof(instance_data) - + BOOST_PYTHON_OFFSETOF(instance_char,storage) + + boost::python::detail::alignment_of::value); +}; + +}}} // namespace boost::python::object + +#endif // INSTANCE_DWA200295_HPP diff --git a/pxr/external/boost/python/object/iterator.hpp b/pxr/external/boost/python/object/iterator.hpp new file mode 100644 index 0000000000..874950365d --- /dev/null +++ b/pxr/external/boost/python/object/iterator.hpp @@ -0,0 +1,227 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ITERATOR_DWA2002510_HPP +# define ITERATOR_DWA2002510_HPP + +# include +# include + +# include +# include +# include +# include +# include + +# include +# include +# include + +# include +# include + +# include + +# include + +# include + +namespace boost { namespace python { namespace objects { + +// CallPolicies for the next() method of iterators. We don't want +// users to have to explicitly specify that the references returned by +// iterators are copied, so we just replace the result_converter from +// the default_iterator_call_policies with a permissive one which +// always copies the result. +typedef return_value_policy default_iterator_call_policies; + +// Instantiations of these are wrapped to produce Python iterators. +template +struct iterator_range +{ + iterator_range(object sequence, Iterator start, Iterator finish); + + typedef std::iterator_traits traits_t; + + struct next + { + typedef typename mpl::if_< + is_reference< + typename traits_t::reference + > + , typename traits_t::reference + , typename traits_t::value_type + >::type result_type; + + result_type + operator()(iterator_range& self) + { + if (self.m_start == self.m_finish) + stop_iteration_error(); + return *self.m_start++; + } + +# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + // CWPro8 has a codegen problem when this is an empty class + int garbage; +# endif + }; + + typedef next next_fn; + + object m_sequence; // Keeps the sequence alive while iterating. + Iterator m_start; + Iterator m_finish; +}; + +namespace detail +{ + // Get a Python class which contains the given iterator and + // policies, creating it if necessary. Requires: NextPolicies is + // default-constructible. + template + object demand_iterator_class(char const* name, Iterator* = 0, NextPolicies const& policies = NextPolicies()) + { + typedef iterator_range range_; + + // Check the registry. If one is already registered, return it. + handle<> class_obj( + objects::registered_class_object(python::type_id())); + + if (class_obj.get() != 0) + return object(class_obj); + + typedef typename range_::next_fn next_fn; + typedef typename next_fn::result_type result_type; + + return class_(name, no_init) + .def("__iter__", identity_function()) + .def( +#if PY_VERSION_HEX >= 0x03000000 + "__next__" +#else + "next" +#endif + , make_function( + next_fn() + , policies + , mpl::vector2() + )); + } + + // A function object which builds an iterator_range. + template < + class Target + , class Iterator + , class Accessor1 + , class Accessor2 + , class NextPolicies + > + struct py_iter_ + { + py_iter_(Accessor1 const& get_start, Accessor2 const& get_finish) + : m_get_start(get_start) + , m_get_finish(get_finish) + {} + + // Extract an object x of the Target type from the first Python + // argument, and invoke get_start(x)/get_finish(x) to produce + // iterators, which are used to construct a new iterator_range<> + // object that gets wrapped into a Python iterator. + iterator_range + operator()(back_reference x) const + { + // Make sure the Python class is instantiated. + detail::demand_iterator_class("iterator", (Iterator*)0, NextPolicies()); + + return iterator_range( + x.source() + , m_get_start(x.get()) + , m_get_finish(x.get()) + ); + } + private: + Accessor1 m_get_start; + Accessor2 m_get_finish; + }; + + template + inline object make_iterator_function( + Accessor1 const& get_start + , Accessor2 const& get_finish + , NextPolicies const& /*next_policies*/ + , Iterator const& (*)() + , boost::type* + , int + ) + { + return make_function( + py_iter_(get_start, get_finish) + , default_call_policies() + , mpl::vector2, back_reference >() + ); + } + + template + inline object make_iterator_function( + Accessor1 const& get_start + , Accessor2 const& get_finish + , NextPolicies const& next_policies + , Iterator& (*)() + , boost::type* + , ...) + { + return make_iterator_function( + get_start + , get_finish + , next_policies + , (Iterator const&(*)())0 + , (boost::type*)0 + , 0 + ); + } + +} + +// Create a Python callable object which accepts a single argument +// convertible to the C++ Target type and returns a Python +// iterator. The Python iterator uses get_start(x) and get_finish(x) +// (where x is an instance of Target) to produce begin and end +// iterators for the range, and an instance of NextPolicies is used as +// CallPolicies for the Python iterator's next() function. +template +inline object make_iterator_function( + Accessor1 const& get_start + , Accessor2 const& get_finish + , NextPolicies const& next_policies + , boost::type* = 0 +) +{ + typedef typename Accessor1::result_type iterator; + typedef typename boost::python::detail::add_const::type iterator_const; + typedef typename boost::python::detail::add_lvalue_reference::type iterator_cref; + + return detail::make_iterator_function( + get_start + , get_finish + , next_policies + , (iterator_cref(*)())0 + , (boost::type*)0 + , 0 + ); +} + +// +// implementation +// +template +inline iterator_range::iterator_range( + object sequence, Iterator start, Iterator finish) + : m_sequence(sequence), m_start(start), m_finish(finish) +{ +} + +}}} // namespace boost::python::objects + +#endif // ITERATOR_DWA2002510_HPP diff --git a/pxr/external/boost/python/object/iterator_core.hpp b/pxr/external/boost/python/object/iterator_core.hpp new file mode 100644 index 0000000000..064accc5a8 --- /dev/null +++ b/pxr/external/boost/python/object/iterator_core.hpp @@ -0,0 +1,17 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ITERATOR_CORE_DWA2002512_HPP +# define ITERATOR_CORE_DWA2002512_HPP + +# include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL object const& identity_function(); +BOOST_PYTHON_DECL void stop_iteration_error(); + +}}} // namespace boost::python::object + +#endif // ITERATOR_CORE_DWA2002512_HPP diff --git a/pxr/external/boost/python/object/life_support.hpp b/pxr/external/boost/python/object/life_support.hpp new file mode 100644 index 0000000000..9a1b16b689 --- /dev/null +++ b/pxr/external/boost/python/object/life_support.hpp @@ -0,0 +1,15 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef LIFE_SUPPORT_DWA200222_HPP +# define LIFE_SUPPORT_DWA200222_HPP +# include + +namespace boost { namespace python { namespace objects { + +BOOST_PYTHON_DECL PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient); + +}}} // namespace boost::python::object + +#endif // LIFE_SUPPORT_DWA200222_HPP diff --git a/pxr/external/boost/python/object/make_holder.hpp b/pxr/external/boost/python/object/make_holder.hpp new file mode 100644 index 0000000000..735e5395ca --- /dev/null +++ b/pxr/external/boost/python/object/make_holder.hpp @@ -0,0 +1,110 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef MAKE_HOLDER_DWA20011215_HPP +# define MAKE_HOLDER_DWA20011215_HPP + +# include + +# include +# include +#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) +# include +#endif + +# include +# include + +# include +# include +# include + +# include +# include +# include +# include +# include + +# include + +namespace boost { namespace python { namespace objects { + +template struct make_holder; + +# define BOOST_PYTHON_DO_FORWARD_ARG(z, index, _) , f##index(a##index) + +// specializations... +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_DO_FORWARD_ARG + +}}} // namespace boost::python::objects + +# endif // MAKE_HOLDER_DWA20011215_HPP + +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, make_holder.hpp) +# endif + +# define N BOOST_PP_ITERATION() + +template <> +struct make_holder +{ + template + struct apply + { +# if N + // Unrolled iteration through each argument type in ArgList, + // choosing the type that will be forwarded on to the holder's + // templated constructor. + typedef typename mpl::begin::type iter0; + +# define BOOST_PP_LOCAL_MACRO(n) \ + typedef typename mpl::deref::type t##n; \ + typedef typename forward::type f##n; \ + typedef typename mpl::next::type \ + BOOST_PP_CAT(iter,BOOST_PP_INC(n)); // Next iterator type + +# define BOOST_PP_LOCAL_LIMITS (0, N-1) +# include BOOST_PP_LOCAL_ITERATE() +# endif + + static void execute( +#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) + boost::python::detail::python_class *p +#else + PyObject *p +#endif + BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(1, N, t, a)) + { + typedef instance instance_t; + + void* memory = Holder::allocate(p, offsetof(instance_t, storage), sizeof(Holder), + boost::python::detail::alignment_of::value); + try { + (new (memory) Holder( + p BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_DO_FORWARD_ARG, nil)))->install(p); + } + catch(...) { + Holder::deallocate(p, memory); + throw; + } + } + }; +}; + +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/object/make_instance.hpp b/pxr/external/boost/python/object/make_instance.hpp new file mode 100644 index 0000000000..713fdc5ecd --- /dev/null +++ b/pxr/external/boost/python/object/make_instance.hpp @@ -0,0 +1,85 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAKE_INSTANCE_DWA200296_HPP +# define MAKE_INSTANCE_DWA200296_HPP + +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +template +struct make_instance_impl +{ + typedef objects::instance instance_t; + + template + static inline PyObject* execute(Arg& x) + { + BOOST_MPL_ASSERT((mpl::or_, + boost::python::detail::is_union >)); + + PyTypeObject* type = Derived::get_class_object(x); + + if (type == 0) + return python::detail::none(); + + PyObject* raw_result = type->tp_alloc( + type, objects::additional_instance_size::value); + + if (raw_result != 0) + { + python::detail::decref_guard protect(raw_result); + + instance_t* instance = (instance_t*)raw_result; + + // construct the new C++ object and install the pointer + // in the Python object. + Holder *holder =Derived::construct(instance->storage.bytes, (PyObject*)instance, x); + holder->install(raw_result); + + // Note the position of the internally-stored Holder, + // for the sake of destruction + const size_t offset = reinterpret_cast(holder) - + reinterpret_cast(instance->storage.bytes) + offsetof(instance_t, storage); + Py_SET_SIZE(instance, offset); + + // Release ownership of the python object + protect.cancel(); + } + return raw_result; + } +}; + + +template +struct make_instance + : make_instance_impl > +{ + template + static inline PyTypeObject* get_class_object(U&) + { + return converter::registered::converters.get_class_object(); + } + + static inline Holder* construct(void* storage, PyObject* instance, reference_wrapper x) + { + size_t allocated = objects::additional_instance_size::value; + void* aligned_storage = ::boost::alignment::align(boost::python::detail::alignment_of::value, + sizeof(Holder), storage, allocated); + return new (aligned_storage) Holder(instance, x); + } +}; + + +}}} // namespace boost::python::object + +#endif // MAKE_INSTANCE_DWA200296_HPP diff --git a/pxr/external/boost/python/object/make_ptr_instance.hpp b/pxr/external/boost/python/object/make_ptr_instance.hpp new file mode 100644 index 0000000000..92412b31fe --- /dev/null +++ b/pxr/external/boost/python/object/make_ptr_instance.hpp @@ -0,0 +1,76 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef MAKE_PTR_INSTANCE_DWA200296_HPP +# define MAKE_PTR_INSTANCE_DWA200296_HPP + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +template +struct make_ptr_instance + : make_instance_impl > +{ + template + static inline Holder* construct(void* storage, PyObject*, Arg& x) + { +#if defined(BOOST_NO_CXX11_SMART_PTR) + return new (storage) Holder(x); +#else + return new (storage) Holder(std::move(x)); +#endif + } + + template + static inline PyTypeObject* get_class_object(Ptr const& x) + { + return get_class_object_impl(get_pointer(x)); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static inline PyTypeObject const* get_pytype() + { + return converter::registered::converters.get_class_object(); + } +#endif + private: + template + static inline PyTypeObject* get_class_object_impl(U const volatile* p) + { + if (p == 0) + return 0; // means "return None". + + PyTypeObject* derived = get_derived_class_object( + BOOST_DEDUCED_TYPENAME boost::python::detail::is_polymorphic::type(), p); + + if (derived) + return derived; + return converter::registered::converters.get_class_object(); + } + + template + static inline PyTypeObject* get_derived_class_object(boost::python::detail::true_, U const volatile* x) + { + converter::registration const* r = converter::registry::query( + type_info(typeid(*x)) + ); + return r ? r->m_class_object : 0; + } + + template + static inline PyTypeObject* get_derived_class_object(boost::python::detail::false_, U*) + { + return 0; + } +}; + + +}}} // namespace boost::python::object + +#endif // MAKE_PTR_INSTANCE_DWA200296_HPP diff --git a/pxr/external/boost/python/object/pickle_support.hpp b/pxr/external/boost/python/object/pickle_support.hpp new file mode 100644 index 0000000000..aa96d655ee --- /dev/null +++ b/pxr/external/boost/python/object/pickle_support.hpp @@ -0,0 +1,124 @@ +// (C) Copyright R.W. Grosse-Kunstleve 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP +# define BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP + +# include + +namespace boost { namespace python { + +namespace api +{ + class object; +} +using api::object; +class tuple; + +BOOST_PYTHON_DECL object const& make_instance_reduce_function(); + +struct pickle_suite; + +namespace error_messages { + + template + struct missing_pickle_suite_function_or_incorrect_signature {}; + + inline void must_be_derived_from_pickle_suite(pickle_suite const&) {} +} + +namespace detail { struct pickle_suite_registration; } + +struct pickle_suite +{ + private: + struct inaccessible {}; + friend struct detail::pickle_suite_registration; + public: + static inaccessible* getinitargs() { return 0; } + static inaccessible* getstate() { return 0; } + static inaccessible* setstate() { return 0; } + static bool getstate_manages_dict() { return false; } +}; + +namespace detail { + + struct pickle_suite_registration + { + typedef pickle_suite::inaccessible inaccessible; + + template + static + void + register_( + Class_& cl, + tuple (*getinitargs_fn)(Tgetinitargs), + inaccessible* (* /*getstate_fn*/)(), + inaccessible* (* /*setstate_fn*/)(), + bool) + { + cl.enable_pickling_(false); + cl.def("__getinitargs__", getinitargs_fn); + } + + template + static + void + register_( + Class_& cl, + inaccessible* (* /*getinitargs_fn*/)(), + Rgetstate (*getstate_fn)(Tgetstate), + void (*setstate_fn)(Tsetstate, Ttuple), + bool getstate_manages_dict) + { + cl.enable_pickling_(getstate_manages_dict); + cl.def("__getstate__", getstate_fn); + cl.def("__setstate__", setstate_fn); + } + + template + static + void + register_( + Class_& cl, + tuple (*getinitargs_fn)(Tgetinitargs), + Rgetstate (*getstate_fn)(Tgetstate), + void (*setstate_fn)(Tsetstate, Ttuple), + bool getstate_manages_dict) + { + cl.enable_pickling_(getstate_manages_dict); + cl.def("__getinitargs__", getinitargs_fn); + cl.def("__getstate__", getstate_fn); + cl.def("__setstate__", setstate_fn); + } + + template + static + void + register_( + Class_&, + ...) + { + typedef typename + error_messages::missing_pickle_suite_function_or_incorrect_signature< + Class_>::error_type error_type BOOST_ATTRIBUTE_UNUSED; + } + }; + + template + struct pickle_suite_finalize + : PickleSuiteType, + pickle_suite_registration + {}; + +} // namespace detail + +}} // namespace boost::python + +#endif // BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP diff --git a/pxr/external/boost/python/object/pointer_holder.hpp b/pxr/external/boost/python/object/pointer_holder.hpp new file mode 100644 index 0000000000..c3b57e833a --- /dev/null +++ b/pxr/external/boost/python/object/pointer_holder.hpp @@ -0,0 +1,227 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef POINTER_HOLDER_DWA20011215_HPP +# define POINTER_HOLDER_DWA20011215_HPP + +# include +# include + +# include +# include +# include + +# include +# include + +# include +# include +# include +# include + + +# include +# include + +# include +# include +# include +# include +# include +# include + +# include + +namespace boost { namespace python { + +template class wrapper; + +}} + + +namespace boost { namespace python { namespace objects { + +#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) + +template +struct pointer_holder : instance_holder +{ + typedef Value value_type; + + pointer_holder(Pointer); + + // Forward construction to the held object + +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, , 1)) +# include BOOST_PP_ITERATE() + + private: // types + + private: // required holder implementation + void* holds(type_info, bool null_ptr_only); + + template + inline void* holds_wrapped(type_info dst_t, wrapper*,T* p) + { + return python::type_id() == dst_t ? p : 0; + } + + inline void* holds_wrapped(type_info, ...) + { + return 0; + } + + private: // data members + Pointer m_p; +}; + +template +struct pointer_holder_back_reference : instance_holder +{ + private: + typedef typename python::pointee::type held_type; + public: + typedef Value value_type; + + // Not sure about this one -- can it work? The source object + // undoubtedly does not carry the correct back reference pointer. + pointer_holder_back_reference(Pointer); + + // Forward construction to the held object +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, , 2)) +# include BOOST_PP_ITERATE() + + private: // required holder implementation + void* holds(type_info, bool null_ptr_only); + + private: // data members + Pointer m_p; +}; + +# undef BOOST_PYTHON_UNFORWARD_LOCAL + +template +inline pointer_holder::pointer_holder(Pointer p) +#if defined(BOOST_NO_CXX11_SMART_PTR) + : m_p(p) +#else + : m_p(std::move(p)) +#endif +{ +} + +template +inline pointer_holder_back_reference::pointer_holder_back_reference(Pointer p) +#if defined(BOOST_NO_CXX11_SMART_PTR) + : m_p(p) +#else + : m_p(std::move(p)) +#endif +{ +} + +template +void* pointer_holder::holds(type_info dst_t, bool null_ptr_only) +{ + typedef typename boost::python::detail::remove_const< Value >::type non_const_value; + + if (dst_t == python::type_id() + && !(null_ptr_only && get_pointer(this->m_p)) + ) + return &this->m_p; + + Value* p0 +# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) + = static_cast( get_pointer(this->m_p) ) +# else + = get_pointer(this->m_p) +# endif + ; + non_const_value* p = const_cast( p0 ); + + if (p == 0) + return 0; + + if (void* wrapped = holds_wrapped(dst_t, p, p)) + return wrapped; + + type_info src_t = python::type_id(); + return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t); +} + +template +void* pointer_holder_back_reference::holds(type_info dst_t, bool null_ptr_only) +{ + if (dst_t == python::type_id() + && !(null_ptr_only && get_pointer(this->m_p)) + ) + return &this->m_p; + + if (!get_pointer(this->m_p)) + return 0; + + Value* p = get_pointer(m_p); + + if (dst_t == python::type_id()) + return p; + + type_info src_t = python::type_id(); + return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t); +} + +}}} // namespace boost::python::objects + +# endif // POINTER_HOLDER_DWA20011215_HPP + +/* --------------- pointer_holder --------------- */ +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, pointer_holder.hpp) +# endif + +# define N BOOST_PP_ITERATION() + +# if (N != 0) + template< BOOST_PP_ENUM_PARAMS_Z(1, N, class A) > +# endif + pointer_holder(PyObject* self BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) + : m_p(new Value( + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + )) + { + python::detail::initialize_wrapper(self, get_pointer(this->m_p)); + } + +# undef N + +/* --------------- pointer_holder_back_reference --------------- */ +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 2 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, pointer_holder.hpp(pointer_holder_back_reference)) +# endif + +# define N BOOST_PP_ITERATION() + +# if (N != 0) + template < BOOST_PP_ENUM_PARAMS_Z(1, N, class A) > +# endif + pointer_holder_back_reference( + PyObject* p BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) + : m_p(new held_type( + p BOOST_PP_COMMA_IF(N) BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + )) + {} + +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/object/py_function.hpp b/pxr/external/boost/python/object/py_function.hpp new file mode 100644 index 0000000000..df2fb44a4f --- /dev/null +++ b/pxr/external/boost/python/object/py_function.hpp @@ -0,0 +1,180 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PY_FUNCTION_DWA200286_HPP +# define PY_FUNCTION_DWA200286_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { namespace objects { + +// This type is used as a "generalized Python callback", wrapping the +// function signature: +// +// PyObject* (PyObject* args, PyObject* keywords) + +struct BOOST_PYTHON_DECL py_function_impl_base +{ + virtual ~py_function_impl_base(); + virtual PyObject* operator()(PyObject*, PyObject*) = 0; + virtual unsigned min_arity() const = 0; + virtual unsigned max_arity() const; + virtual python::detail::py_func_sig_info signature() const = 0; +}; + +template +struct caller_py_function_impl : py_function_impl_base +{ + caller_py_function_impl(Caller const& caller) + : m_caller(caller) + {} + + PyObject* operator()(PyObject* args, PyObject* kw) + { + return m_caller(args, kw); + } + + virtual unsigned min_arity() const + { + return m_caller.min_arity(); + } + + virtual python::detail::py_func_sig_info signature() const + { + return m_caller.signature(); + } + + private: + Caller m_caller; +}; + +template +struct signature_py_function_impl : py_function_impl_base +{ + signature_py_function_impl(Caller const& caller) + : m_caller(caller) + {} + + PyObject* operator()(PyObject* args, PyObject* kw) + { + return m_caller(args, kw); + } + + virtual unsigned min_arity() const + { + return mpl::size::value - 1; + } + + virtual python::detail::py_func_sig_info signature() const + { + python::detail::signature_element const* sig = python::detail::signature::elements(); + python::detail::py_func_sig_info res = {sig, sig}; + return res; + } + + private: + Caller m_caller; +}; + +template +struct full_py_function_impl : py_function_impl_base +{ + full_py_function_impl(Caller const& caller, unsigned min_arity, unsigned max_arity) + : m_caller(caller) + , m_min_arity(min_arity) + , m_max_arity(max_arity > min_arity ? max_arity : min_arity) + {} + + PyObject* operator()(PyObject* args, PyObject* kw) + { + return m_caller(args, kw); + } + + virtual unsigned min_arity() const + { + return m_min_arity; + } + + virtual unsigned max_arity() const + { + return m_max_arity; + } + + virtual python::detail::py_func_sig_info signature() const + { + python::detail::signature_element const* sig = python::detail::signature::elements(); + python::detail::py_func_sig_info res = {sig, sig}; + return res; + } + + private: + Caller m_caller; + unsigned m_min_arity; + unsigned m_max_arity; +}; + +struct py_function +{ + template + py_function(Caller const& caller) + : m_impl(new caller_py_function_impl(caller)) + {} + + template + py_function(Caller const& caller, Sig) + : m_impl(new signature_py_function_impl(caller)) + {} + + template + py_function(Caller const& caller, Sig, int min_arity, int max_arity = 0) + : m_impl(new full_py_function_impl(caller, min_arity, max_arity)) + {} + + py_function(py_function const& rhs) +#if defined(BOOST_NO_CXX11_SMART_PTR) + : m_impl(rhs.m_impl) +#else + : m_impl(std::move(rhs.m_impl)) +#endif + {} + + PyObject* operator()(PyObject* args, PyObject* kw) const + { + return (*m_impl)(args, kw); + } + + unsigned min_arity() const + { + return m_impl->min_arity(); + } + + unsigned max_arity() const + { + return m_impl->max_arity(); + } + + python::detail::signature_element const* signature() const + { + return m_impl->signature().signature; + } + + python::detail::signature_element const& get_return_type() const + { + return *m_impl->signature().ret; + } + + private: +#if defined(BOOST_NO_CXX11_SMART_PTR) + mutable std::auto_ptr m_impl; +#else + mutable std::unique_ptr m_impl; +#endif +}; + +}}} // namespace boost::python::objects + +#endif // PY_FUNCTION_DWA200286_HPP diff --git a/pxr/external/boost/python/object/stl_iterator_core.hpp b/pxr/external/boost/python/object/stl_iterator_core.hpp new file mode 100644 index 0000000000..68e0c2441b --- /dev/null +++ b/pxr/external/boost/python/object/stl_iterator_core.hpp @@ -0,0 +1,27 @@ +// Copyright Eric Niebler 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef STL_ITERATOR_CORE_EAN20051028_HPP +# define STL_ITERATOR_CORE_EAN20051028_HPP + +# include +# include + +namespace boost { namespace python { namespace objects { + +struct BOOST_PYTHON_DECL stl_input_iterator_impl +{ + stl_input_iterator_impl(); + stl_input_iterator_impl(boost::python::object const &ob); + void increment(); + bool equal(stl_input_iterator_impl const &that) const; + boost::python::handle<> const ¤t() const; +private: + boost::python::object it_; + boost::python::handle<> ob_; +}; + +}}} // namespace boost::python::object + +#endif // STL_ITERATOR_CORE_EAN20051028_HPP diff --git a/pxr/external/boost/python/object/value_holder.hpp b/pxr/external/boost/python/object/value_holder.hpp new file mode 100644 index 0000000000..a4e91786d1 --- /dev/null +++ b/pxr/external/boost/python/object/value_holder.hpp @@ -0,0 +1,166 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# ifndef VALUE_HOLDER_DWA20011215_HPP +# define VALUE_HOLDER_DWA20011215_HPP + +# include + +# include +# include +# include + +# include +# include + +# include +# include + +# include +# include +# include +# include +# include + +# include +# include + +# include + +namespace boost { namespace python { namespace objects { + +#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) + +template +struct value_holder : instance_holder +{ + typedef Value held_type; + typedef Value value_type; + + // Forward construction to the held object +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, , 1)) +# include BOOST_PP_ITERATE() + + private: // required holder implementation + void* holds(type_info, bool null_ptr_only); + + template + inline void* holds_wrapped(type_info dst_t, wrapper*,T* p) + { + return python::type_id() == dst_t ? p : 0; + } + + inline void* holds_wrapped(type_info, ...) + { + return 0; + } + private: // data members + Value m_held; +}; + +template +struct value_holder_back_reference : instance_holder +{ + typedef Held held_type; + typedef Value value_type; + + // Forward construction to the held object +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, , 2)) +# include BOOST_PP_ITERATE() + +private: // required holder implementation + void* holds(type_info, bool null_ptr_only); + + private: // data members + Held m_held; +}; + +# undef BOOST_PYTHON_UNFORWARD_LOCAL + +template +void* value_holder::holds(type_info dst_t, bool /*null_ptr_only*/) +{ + if (void* wrapped = holds_wrapped(dst_t, boost::addressof(m_held), boost::addressof(m_held))) + return wrapped; + + type_info src_t = python::type_id(); + return src_t == dst_t ? boost::addressof(m_held) + : find_static_type(boost::addressof(m_held), src_t, dst_t); +} + +template +void* value_holder_back_reference::holds( + type_info dst_t, bool /*null_ptr_only*/) +{ + type_info src_t = python::type_id(); + Value* x = &m_held; + + if (dst_t == src_t) + return x; + else if (dst_t == python::type_id()) + return &m_held; + else + return find_static_type(x, src_t, dst_t); +} + +}}} // namespace boost::python::objects + +# endif // VALUE_HOLDER_DWA20011215_HPP + +// --------------- value_holder --------------- + +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, value_holder.hpp(value_holder)) +# endif + +# define N BOOST_PP_ITERATION() + +# if (N != 0) + template +# endif + value_holder( + PyObject* self BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) + : m_held( + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + ) + { + python::detail::initialize_wrapper(self, boost::addressof(this->m_held)); + } + +# undef N + +// --------------- value_holder_back_reference --------------- + +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 2 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, value_holder.hpp(value_holder_back_reference)) +# endif + +# define N BOOST_PP_ITERATION() + +# if (N != 0) + template +# endif + value_holder_back_reference( + PyObject* p BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) + : m_held( + p BOOST_PP_COMMA_IF(N) + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + ) + { + } + +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif diff --git a/pxr/external/boost/python/object/value_holder_fwd.hpp b/pxr/external/boost/python/object/value_holder_fwd.hpp new file mode 100644 index 0000000000..3454bac426 --- /dev/null +++ b/pxr/external/boost/python/object/value_holder_fwd.hpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef VALUE_HOLDER_FWD_DWA2002311_HPP +# define VALUE_HOLDER_FWD_DWA2002311_HPP + +namespace boost { namespace python { namespace objects { + +struct no_back_reference; + +template struct value_holder_generator; + +}}} // namespace boost::python::object + +#endif // VALUE_HOLDER_FWD_DWA2002311_HPP diff --git a/pxr/external/boost/python/object_attributes.hpp b/pxr/external/boost/python/object_attributes.hpp new file mode 100644 index 0000000000..26d599113f --- /dev/null +++ b/pxr/external/boost/python/object_attributes.hpp @@ -0,0 +1,116 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_ATTRIBUTES_DWA2002615_HPP +# define OBJECT_ATTRIBUTES_DWA2002615_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { namespace api { + +struct const_attribute_policies +{ + typedef char const* key_type; + static object get(object const& target, char const* key); + static object get(object const& target, object const& key); +}; + +struct attribute_policies : const_attribute_policies +{ + static object const& set(object const& target, char const* key, object const& value); + static void del(object const&target, char const* key); +}; + +struct const_objattribute_policies +{ + typedef object const key_type; + static object get(object const& target, object const& key); +}; + +struct objattribute_policies : const_objattribute_policies +{ + static object const& set(object const& target, object const& key, object const& value); + static void del(object const&target, object const& key); +}; + +// +// implementation +// +template +inline object_attribute object_operators::attr(char const* name) +{ + object_cref2 x = *static_cast(this); + return object_attribute(x, name); +} + +template +inline const_object_attribute object_operators::attr(char const* name) const +{ + object_cref2 x = *static_cast(this); + return const_object_attribute(x, name); +} + +template +inline object_objattribute object_operators::attr(object const& name) +{ + object_cref2 x = *static_cast(this); + return object_objattribute(x, name); +} + +template +inline const_object_objattribute object_operators::attr(object const& name) const +{ + object_cref2 x = *static_cast(this); + return const_object_objattribute(x, name); +} + +inline object const_attribute_policies::get(object const& target, char const* key) +{ + return python::getattr(target, key); +} + +inline object const_objattribute_policies::get(object const& target, object const& key) +{ + return python::getattr(target, key); +} + +inline object const& attribute_policies::set( + object const& target + , char const* key + , object const& value) +{ + python::setattr(target, key, value); + return value; +} + +inline object const& objattribute_policies::set( + object const& target + , object const& key + , object const& value) +{ + python::setattr(target, key, value); + return value; +} + +inline void attribute_policies::del( + object const& target + , char const* key) +{ + python::delattr(target, key); +} + +inline void objattribute_policies::del( + object const& target + , object const& key) +{ + python::delattr(target, key); +} + +}}} // namespace boost::python::api + +#endif // OBJECT_ATTRIBUTES_DWA2002615_HPP diff --git a/pxr/external/boost/python/object_call.hpp b/pxr/external/boost/python/object_call.hpp new file mode 100644 index 0000000000..5c4d0f2fbe --- /dev/null +++ b/pxr/external/boost/python/object_call.hpp @@ -0,0 +1,23 @@ +# if !defined(BOOST_PYTHON_SYNOPSIS) +# // Copyright David Abrahams 2002. +# // Distributed under the Boost Software License, Version 1.0. (See +# // accompanying file LICENSE_1_0.txt or copy at +# // http://www.boost.org/LICENSE_1_0.txt) + +# if !defined(BOOST_PP_IS_ITERATING) +# error Boost.Python - do not include this file! +# endif + +# define N BOOST_PP_ITERATION() + + template + typename detail::dependent::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)) const + { + typedef typename detail::dependent::type obj; + U const& self = *static_cast(this); + return call(get_managed_object(self, tag), BOOST_PP_ENUM_PARAMS_Z(1, N, a)); + } + +# undef N +# endif // BOOST_PYTHON_SYNOPSIS diff --git a/pxr/external/boost/python/object_core.hpp b/pxr/external/boost/python/object_core.hpp new file mode 100644 index 0000000000..16480d0d89 --- /dev/null +++ b/pxr/external/boost/python/object_core.hpp @@ -0,0 +1,480 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_CORE_DWA2002615_HPP +# define OBJECT_CORE_DWA2002615_HPP + +# define BOOST_PYTHON_OBJECT_HAS_IS_NONE // added 2010-03-15 by rwgk + +# include + +# include + +# include +# include +# include +# include +# include +# include +# include + +# include +# include + +# include +# include + +# include +# include + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + class kwds_proxy; + class args_proxy; +} + +namespace converter +{ + template struct arg_to_python; +} + +// Put this in an inner namespace so that the generalized operators won't take over +namespace api +{ + +// This file contains the definition of the object class and enough to +// construct/copy it, but not enough to do operations like +// attribute/item access or addition. + + template class proxy; + + struct const_attribute_policies; + struct attribute_policies; + struct const_objattribute_policies; + struct objattribute_policies; + struct const_item_policies; + struct item_policies; + struct const_slice_policies; + struct slice_policies; + class slice_nil; + + typedef proxy const_object_attribute; + typedef proxy object_attribute; + typedef proxy const_object_objattribute; + typedef proxy object_objattribute; + typedef proxy const_object_item; + typedef proxy object_item; + typedef proxy const_object_slice; + typedef proxy object_slice; + + // + // is_proxy -- proxy type detection + // + BOOST_PYTHON_IS_XXX_DEF(proxy, boost::python::api::proxy, 1) + + template struct object_initializer; + + class object; + typedef PyObject* (object::*bool_type)() const; + + template + class object_operators : public def_visitor + { + protected: + typedef object const& object_cref; + public: + // function call + // + object operator()() const; + +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + + detail::args_proxy operator* () const; + object operator()(detail::args_proxy const &args) const; + object operator()(detail::args_proxy const &args, + detail::kwds_proxy const &kwds) const; + + // truth value testing + // + operator bool_type() const; + bool operator!() const; // needed for vc6 + + // Attribute access + // + const_object_attribute attr(char const*) const; + object_attribute attr(char const*); + const_object_objattribute attr(object const&) const; + object_objattribute attr(object const&); + + // Wrap 'in' operator (aka. __contains__) + template + object contains(T const& key) const; + + // item access + // + const_object_item operator[](object_cref) const; + object_item operator[](object_cref); + + template + const_object_item + operator[](T const& key) const; + + template + object_item + operator[](T const& key); + + // slicing + // + const_object_slice slice(object_cref, object_cref) const; + object_slice slice(object_cref, object_cref); + + const_object_slice slice(slice_nil, object_cref) const; + object_slice slice(slice_nil, object_cref); + + const_object_slice slice(object_cref, slice_nil) const; + object_slice slice(object_cref, slice_nil); + + const_object_slice slice(slice_nil, slice_nil) const; + object_slice slice(slice_nil, slice_nil); + + template + const_object_slice + slice(T const& start, V const& end) const; + + template + object_slice + slice(T const& start, V const& end); + + private: // def visitation for adding callable objects as class methods + + template + void visit(ClassT& cl, char const* name, python::detail::def_helper const& helper) const + { + // It's too late to specify anything other than docstrings if + // the callable object is already wrapped. + BOOST_STATIC_ASSERT( + (detail::is_same::value + || detail::is_string_literal::value)); + + objects::add_to_namespace(cl, name, this->derived_visitor(), helper.doc()); + } + + friend class python::def_visitor_access; + + private: + // there is a confirmed CWPro8 codegen bug here. We prevent the + // early destruction of a temporary by binding a named object + // instead. +# if __MWERKS__ < 0x3000 || __MWERKS__ > 0x3003 + typedef object const& object_cref2; +# else + typedef object const object_cref2; +# endif + }; + + + // VC6 and VC7 require this base class in order to generate the + // correct copy constructor for object. We can't define it there + // explicitly or it will complain of ambiguity. + struct object_base : object_operators + { + // copy constructor without NULL checking, for efficiency. + inline object_base(object_base const&); + inline object_base(PyObject* ptr); + + inline object_base& operator=(object_base const& rhs); + inline ~object_base(); + + // Underlying object access -- returns a borrowed reference + inline PyObject* ptr() const; + + inline bool is_none() const; + + private: + PyObject* m_ptr; + }; + + template + struct is_derived + : boost::python::detail::is_convertible< + typename detail::remove_reference::type* + , U const* + > + {}; + + template + typename objects::unforward_cref::type do_unforward_cref(T const& x) + { + return x; + } + + class object; + + template + PyObject* object_base_initializer(T const& x) + { + typedef typename is_derived< + BOOST_DEDUCED_TYPENAME objects::unforward_cref::type + , object + >::type is_obj; + + return object_initializer< + BOOST_DEDUCED_TYPENAME unwrap_reference::type + >::get( + x + , is_obj() + ); + } + + class object : public object_base + { + public: + // default constructor creates a None object + object(); + + // explicit conversion from any C++ object to Python + template + explicit object(T const& x) + : object_base(object_base_initializer(x)) + { + } + + // Throw error_already_set() if the handle is null. + BOOST_PYTHON_DECL explicit object(handle<> const&); + private: + + public: // implementation detail -- for internal use only + explicit object(detail::borrowed_reference); + explicit object(detail::new_reference); + explicit object(detail::new_non_null_reference); + }; + + // Macros for forwarding constructors in classes derived from + // object. Derived classes will usually want these as an + // implementation detail +# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \ + inline explicit derived(::boost::python::detail::borrowed_reference p) \ + : base(p) {} \ + inline explicit derived(::boost::python::detail::new_reference p) \ + : base(p) {} \ + inline explicit derived(::boost::python::detail::new_non_null_reference p) \ + : base(p) {} + + // + // object_initializer -- get the handle to construct the object with, + // based on whether T is a proxy or derived from object + // + template + struct object_initializer_impl + { + static PyObject* + get(object const& x, detail::true_) + { + return python::incref(x.ptr()); + } + + template + static PyObject* + get(T const& x, detail::false_) + { + return python::incref(converter::arg_to_python(x).get()); + } + }; + + template <> + struct object_initializer_impl + { + template + static PyObject* + get(proxy const& x, detail::false_) + { + return python::incref(x.operator object().ptr()); + } + }; + + template <> + struct object_initializer_impl + { + template + static PyObject* + get(T const& x, U) + { + return python::incref(get_managed_object(x, boost::python::tag)); + } + }; + + template <> + struct object_initializer_impl + {}; // empty implementation should cause an error + + template + struct object_initializer : object_initializer_impl< + is_proxy::value + , converter::is_object_manager::value + > + {}; + +} +using api::object; +template struct extract; + +// +// implementation +// + +namespace detail +{ + +class call_proxy +{ +public: + call_proxy(object target) : m_target(target) {} + operator object() const { return m_target;} + + private: + object m_target; +}; + +class kwds_proxy : public call_proxy +{ +public: + kwds_proxy(object o = object()) : call_proxy(o) {} +}; +class args_proxy : public call_proxy +{ +public: + args_proxy(object o) : call_proxy(o) {} + kwds_proxy operator* () const { return kwds_proxy(*this);} +}; +} + +template +detail::args_proxy api::object_operators::operator* () const +{ + object_cref2 x = *static_cast(this); + return boost::python::detail::args_proxy(x); +} + +template +object api::object_operators::operator()(detail::args_proxy const &args) const +{ + U const& self = *static_cast(this); + PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), + args.operator object().ptr(), + 0); + return object(boost::python::detail::new_reference(result)); + +} + +template +object api::object_operators::operator()(detail::args_proxy const &args, + detail::kwds_proxy const &kwds) const +{ + U const& self = *static_cast(this); + PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), + args.operator object().ptr(), + kwds.operator object().ptr()); + return object(boost::python::detail::new_reference(result)); + +} + + +template +template +object api::object_operators::contains(T const& key) const +{ + return this->attr("__contains__")(object(key)); +} + + +inline object::object() + : object_base(python::incref(Py_None)) +{} + +// copy constructor without NULL checking, for efficiency +inline api::object_base::object_base(object_base const& rhs) + : m_ptr(python::incref(rhs.m_ptr)) +{} + +inline api::object_base::object_base(PyObject* p) + : m_ptr(p) +{} + +inline api::object_base& api::object_base::operator=(api::object_base const& rhs) +{ + Py_INCREF(rhs.m_ptr); + Py_DECREF(this->m_ptr); + this->m_ptr = rhs.m_ptr; + return *this; +} + +inline api::object_base::~object_base() +{ + assert( Py_REFCNT(m_ptr) > 0 ); + Py_DECREF(m_ptr); +} + +inline object::object(detail::borrowed_reference p) + : object_base(python::incref((PyObject*)p)) +{} + +inline object::object(detail::new_reference p) + : object_base(expect_non_null((PyObject*)p)) +{} + +inline object::object(detail::new_non_null_reference p) + : object_base((PyObject*)p) +{} + +inline PyObject* api::object_base::ptr() const +{ + return m_ptr; +} + +inline bool api::object_base::is_none() const +{ + return (m_ptr == Py_None); +} + +// +// Converter specialization implementations +// +namespace converter +{ + template struct object_manager_traits; + + template <> + struct object_manager_traits + { + BOOST_STATIC_CONSTANT(bool, is_specialized = true); + static bool check(PyObject*) { return true; } + + static python::detail::new_non_null_reference adopt(PyObject* x) + { + return python::detail::new_non_null_reference(x); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const *get_pytype() {return 0;} +#endif + }; +} + +inline PyObject* get_managed_object(object const& x, tag_t) +{ + return x.ptr(); +} + +}} // namespace boost::python + +# include + +#endif // OBJECT_CORE_DWA2002615_HPP diff --git a/pxr/external/boost/python/object_fwd.hpp b/pxr/external/boost/python/object_fwd.hpp new file mode 100644 index 0000000000..11efcc7075 --- /dev/null +++ b/pxr/external/boost/python/object_fwd.hpp @@ -0,0 +1,18 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_FWD_DWA2002724_HPP +# define OBJECT_FWD_DWA2002724_HPP + +# include + +namespace boost { namespace python { +namespace api +{ + class object; +} +using api::object; +}} // namespace boost::python + +#endif // OBJECT_FWD_DWA2002724_HPP diff --git a/pxr/external/boost/python/object_items.hpp b/pxr/external/boost/python/object_items.hpp new file mode 100644 index 0000000000..b048689a7c --- /dev/null +++ b/pxr/external/boost/python/object_items.hpp @@ -0,0 +1,86 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_ITEMS_DWA2002615_HPP +# define OBJECT_ITEMS_DWA2002615_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { namespace api { + +struct const_item_policies +{ + typedef object key_type; + static object get(object const& target, object const& key); +}; + +struct item_policies : const_item_policies +{ + static object const& set(object const& target, object const& key, object const& value); + static void del(object const& target, object const& key); +}; + +// +// implementation +// +template +inline object_item +object_operators::operator[](object_cref key) +{ + object_cref2 x = *static_cast(this); + return object_item(x, key); +} + +template +inline const_object_item +object_operators::operator[](object_cref key) const +{ + object_cref2 x = *static_cast(this); + return const_object_item(x, key); +} + +template +template +inline const_object_item +object_operators::operator[](T const& key) const +{ + return (*this)[object(key)]; +} + +template +template +inline object_item +object_operators::operator[](T const& key) +{ + return (*this)[object(key)]; +} + +inline object const_item_policies::get(object const& target, object const& key) +{ + return getitem(target, key); +} + +inline object const& item_policies::set( + object const& target + , object const& key + , object const& value) +{ + setitem(target, key, value); + return value; +} + +inline void item_policies::del( + object const& target + , object const& key) +{ + delitem(target, key); +} + +}}} // namespace boost::python::api + +#endif // OBJECT_ITEMS_DWA2002615_HPP diff --git a/pxr/external/boost/python/object_operators.hpp b/pxr/external/boost/python/object_operators.hpp new file mode 100644 index 0000000000..d436bb0144 --- /dev/null +++ b/pxr/external/boost/python/object_operators.hpp @@ -0,0 +1,136 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_OPERATORS_DWA2002617_HPP +# define OBJECT_OPERATORS_DWA2002617_HPP + +# include + +# include +# include +# include +# include + +# include + +namespace boost { namespace python { namespace api { + +template +char is_object_operators_helper(object_operators const*); + +typedef char (&no_type)[2]; +no_type is_object_operators_helper(...); + +template X* make_ptr(); + +template +struct is_object_operators +{ + enum { + value + = (sizeof(api::is_object_operators_helper(api::make_ptr())) + + sizeof(api::is_object_operators_helper(api::make_ptr())) + < 4 + ) + }; + typedef mpl::bool_ type; +}; + +# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE) +template +struct enable_binary + : boost::iterators::enable_if, T> +{}; +# define BOOST_PYTHON_BINARY_RETURN(T) typename enable_binary::type +# else +# define BOOST_PYTHON_BINARY_RETURN(T) T +# endif + +template +object object_operators::operator()() const +{ + object_cref2 f = *static_cast(this); + return call(f.ptr()); +} + + +template +inline +object_operators::operator bool_type() const +{ + object_cref2 x = *static_cast(this); + int is_true = PyObject_IsTrue(x.ptr()); + if (is_true < 0) throw_error_already_set(); + return is_true ? &object::ptr : 0; +} + +template +inline bool +object_operators::operator!() const +{ + object_cref2 x = *static_cast(this); + int is_true = PyObject_IsTrue(x.ptr()); + if (is_true < 0) throw_error_already_set(); + return !is_true; +} + +# define BOOST_PYTHON_COMPARE_OP(op, opid) \ +template \ +BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ +{ \ + return PyObject_RichCompare( \ + object(l).ptr(), object(r).ptr(), opid); \ +} +# undef BOOST_PYTHON_COMPARE_OP + +# define BOOST_PYTHON_BINARY_OPERATOR(op) \ +BOOST_PYTHON_DECL object operator op(object const& l, object const& r); \ +template \ +BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ +{ \ + return object(l) op object(r); \ +} +BOOST_PYTHON_BINARY_OPERATOR(>) +BOOST_PYTHON_BINARY_OPERATOR(>=) +BOOST_PYTHON_BINARY_OPERATOR(<) +BOOST_PYTHON_BINARY_OPERATOR(<=) +BOOST_PYTHON_BINARY_OPERATOR(==) +BOOST_PYTHON_BINARY_OPERATOR(!=) +BOOST_PYTHON_BINARY_OPERATOR(+) +BOOST_PYTHON_BINARY_OPERATOR(-) +BOOST_PYTHON_BINARY_OPERATOR(*) +BOOST_PYTHON_BINARY_OPERATOR(/) +BOOST_PYTHON_BINARY_OPERATOR(%) +BOOST_PYTHON_BINARY_OPERATOR(<<) +BOOST_PYTHON_BINARY_OPERATOR(>>) +BOOST_PYTHON_BINARY_OPERATOR(&) +BOOST_PYTHON_BINARY_OPERATOR(^) +BOOST_PYTHON_BINARY_OPERATOR(|) +# undef BOOST_PYTHON_BINARY_OPERATOR + + +# define BOOST_PYTHON_INPLACE_OPERATOR(op) \ +BOOST_PYTHON_DECL object& operator op(object& l, object const& r); \ +template \ +object& operator op(object& l, R const& r) \ +{ \ + return l op object(r); \ +} +BOOST_PYTHON_INPLACE_OPERATOR(+=) +BOOST_PYTHON_INPLACE_OPERATOR(-=) +BOOST_PYTHON_INPLACE_OPERATOR(*=) +BOOST_PYTHON_INPLACE_OPERATOR(/=) +BOOST_PYTHON_INPLACE_OPERATOR(%=) +BOOST_PYTHON_INPLACE_OPERATOR(<<=) +BOOST_PYTHON_INPLACE_OPERATOR(>>=) +BOOST_PYTHON_INPLACE_OPERATOR(&=) +BOOST_PYTHON_INPLACE_OPERATOR(^=) +BOOST_PYTHON_INPLACE_OPERATOR(|=) +# undef BOOST_PYTHON_INPLACE_OPERATOR + +}}} // namespace boost::python + +#include + +#endif // OBJECT_OPERATORS_DWA2002617_HPP diff --git a/pxr/external/boost/python/object_protocol.hpp b/pxr/external/boost/python/object_protocol.hpp new file mode 100644 index 0000000000..7c1c02830e --- /dev/null +++ b/pxr/external/boost/python/object_protocol.hpp @@ -0,0 +1,90 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_PROTOCOL_DWA2002615_HPP +# define OBJECT_PROTOCOL_DWA2002615_HPP + +# include + +# include +# include + +# include + +namespace boost { namespace python { namespace api { + +# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) +// attempt to use SFINAE to prevent functions accepting T const& from +// coming up as ambiguous with the one taking a char const* when a +// string literal is passed +# define BOOST_PYTHON_NO_ARRAY_ARG(T) , T (*)() = 0 +# else +# define BOOST_PYTHON_NO_ARRAY_ARG(T) +# endif + +template +object getattr(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + return getattr(object(target), object(key)); +} + +template +object getattr(Target const& target, Key const& key, Default const& default_ BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + return getattr(object(target), object(key), object(default_)); +} + + +template +void setattr(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + setattr(target, object(key), object(value)); +} + +template +void delattr(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + delattr(target, object(key)); +} + +template +object getitem(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + return getitem(object(target), object(key)); +} + + +template +void setitem(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + setitem(target, object(key), object(value)); +} + +template +void delitem(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +{ + delitem(target, object(key)); +} + +template +object getslice(Target const& target, Begin const& begin, End const& end) +{ + return getslice(object(target), object(begin), object(end)); +} + +template +void setslice(object const& target, Begin const& begin, End const& end, Value const& value) +{ + setslice(target, object(begin), object(end), object(value)); +} + +template +void delslice(object const& target, Begin const& begin, End const& end) +{ + delslice(target, object(begin), object(end)); +} + +}}} // namespace boost::python::api + +#endif // OBJECT_PROTOCOL_DWA2002615_HPP diff --git a/pxr/external/boost/python/object_protocol_core.hpp b/pxr/external/boost/python/object_protocol_core.hpp new file mode 100644 index 0000000000..a5bd9afcb4 --- /dev/null +++ b/pxr/external/boost/python/object_protocol_core.hpp @@ -0,0 +1,53 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_PROTOCOL_CORE_DWA2002615_HPP +# define OBJECT_PROTOCOL_CORE_DWA2002615_HPP + +# include + +# include + +namespace boost { namespace python { + +namespace api +{ + class object; + + BOOST_PYTHON_DECL object getattr(object const& target, object const& key); + BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_); + BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value); + BOOST_PYTHON_DECL void delattr(object const& target, object const& key); + + // These are defined for efficiency, since attributes are commonly + // accessed through literal strings. + BOOST_PYTHON_DECL object getattr(object const& target, char const* key); + BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_); + BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value); + BOOST_PYTHON_DECL void delattr(object const& target, char const* key); + + BOOST_PYTHON_DECL object getitem(object const& target, object const& key); + BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value); + BOOST_PYTHON_DECL void delitem(object const& target, object const& key); + + BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end); + BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value); + BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end); +} + +using api::getattr; +using api::setattr; +using api::delattr; + +using api::getitem; +using api::setitem; +using api::delitem; + +using api::getslice; +using api::setslice; +using api::delslice; + +}} // namespace boost::python + +#endif // OBJECT_PROTOCOL_CORE_DWA2002615_HPP diff --git a/pxr/external/boost/python/object_slices.hpp b/pxr/external/boost/python/object_slices.hpp new file mode 100644 index 0000000000..6cd3dc2974 --- /dev/null +++ b/pxr/external/boost/python/object_slices.hpp @@ -0,0 +1,146 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OBJECT_SLICES_DWA2002615_HPP +# define OBJECT_SLICES_DWA2002615_HPP + +# include + +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace api { + +struct const_slice_policies +{ + typedef std::pair, handle<> > key_type; + static object get(object const& target, key_type const& key); +}; + +struct slice_policies : const_slice_policies +{ + static object const& set(object const& target, key_type const& key, object const& value); + static void del(object const& target, key_type const& key); +}; + +template +inline slice_policies::key_type slice_key(T x, U y) +{ + return slice_policies::key_type(handle<>(x), handle<>(y)); +} + +// +// implementation +// +template +object_slice +object_operators::slice(object_cref start, object_cref finish) +{ + object_cref2 x = *static_cast(this); + return object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr()))); +} + +template +const_object_slice +object_operators::slice(object_cref start, object_cref finish) const +{ + object_cref2 x = *static_cast(this); + return const_object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr()))); +} + +template +object_slice +object_operators::slice(slice_nil, object_cref finish) +{ + object_cref2 x = *static_cast(this); + return object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr()))); +} + +template +const_object_slice +object_operators::slice(slice_nil, object_cref finish) const +{ + object_cref2 x = *static_cast(this); + return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr()))); +} + +template +object_slice +object_operators::slice(slice_nil, slice_nil) +{ + object_cref2 x = *static_cast(this); + return object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0))); +} + +template +const_object_slice +object_operators::slice(slice_nil, slice_nil) const +{ + object_cref2 x = *static_cast(this); + return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0))); +} + +template +object_slice +object_operators::slice(object_cref start, slice_nil) +{ + object_cref2 x = *static_cast(this); + return object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0))); +} + +template +const_object_slice +object_operators::slice(object_cref start, slice_nil) const +{ + object_cref2 x = *static_cast(this); + return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0))); +} + +template +template +inline const_object_slice +object_operators::slice(T const& start, V const& end) const +{ + return this->slice( + typename slice_bound::type(start) + , typename slice_bound::type(end)); +} + +template +template +inline object_slice +object_operators::slice(T const& start, V const& end) +{ + return this->slice( + typename slice_bound::type(start) + , typename slice_bound::type(end)); +} + +inline object const_slice_policies::get(object const& target, key_type const& key) +{ + return getslice(target, key.first, key.second); +} + +inline object const& slice_policies::set( + object const& target + , key_type const& key + , object const& value) +{ + setslice(target, key.first, key.second, value); + return value; +} + +inline void slice_policies::del( + object const& target + , key_type const& key) +{ + delslice(target, key.first, key.second); +} + +}}} // namespace boost::python::api + +#endif // OBJECT_SLICES_DWA2002615_HPP diff --git a/pxr/external/boost/python/opaque_pointer_converter.hpp b/pxr/external/boost/python/opaque_pointer_converter.hpp new file mode 100644 index 0000000000..120985202b --- /dev/null +++ b/pxr/external/boost/python/opaque_pointer_converter.hpp @@ -0,0 +1,187 @@ +// Copyright Gottfried Ganßauge 2003..2006. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +/* + * Generic Conversion of opaque C++-pointers to a Python-Wrapper. + */ +# ifndef OPAQUE_POINTER_CONVERTER_HPP_ +# define OPAQUE_POINTER_CONVERTER_HPP_ + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include + +# include +# include +# include + +// opaque -- +// +// registers to- and from- python conversions for a type Pointee. +// +// Note: +// In addition you need to define specializations for type_id +// on the type pointed to by Pointer using +// BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) +// +// For an example see libs/python/test/opaque.cpp +// +namespace boost { namespace python { + +template +struct opaque +{ + opaque() + { + if (type_object.tp_name == 0) + { + type_object.tp_name = const_cast(type_id().name()); + if (PyType_Ready (&type_object) < 0) + { + throw error_already_set(); + } + + this->register_self(); + } + } + + static opaque instance; +private: + + static void* extract(PyObject* op) + { + return PyObject_TypeCheck(op, &type_object) + ? static_cast(implicit_cast(op))->x + : 0 + ; + } + + static PyObject* wrap(void const* px) + { + Pointee* x = *static_cast(px); + + if (x == 0) + return detail::none(); + + if ( python_instance *o = PyObject_New(python_instance, &type_object) ) + { + o->x = x; + return static_cast(implicit_cast(o)); + } + else + { + throw error_already_set(); + } + } + + void register_self() + { + converter::registration const *existing = + converter::registry::query (type_id()); + + if ((existing == 0) || (existing->m_to_python == 0)) + { +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + converter::registry::insert(&extract, type_id(), &get_pytype); + converter::registry::insert(&wrap, type_id(), &get_pytype); +#else + converter::registry::insert(&extract, type_id()); + converter::registry::insert(&wrap, type_id()); +#endif + } + } + + struct python_instance + { + PyObject_HEAD + Pointee* x; + }; + + static PyTypeObject type_object; +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + static PyTypeObject const *get_pytype(){return &type_object; } +#endif +}; + +template +opaque opaque::instance; + +template +PyTypeObject opaque::type_object = +{ + PyVarObject_HEAD_INIT(NULL, 0) + 0, + sizeof( BOOST_DEDUCED_TYPENAME opaque::python_instance ), + 0, + ::boost::python::detail::dealloc, + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; +}} // namespace boost::python + +// If you change the below, don't forget to alter the end of type_id.hpp +# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ + namespace boost { namespace python { \ + template<> \ + inline type_info type_id() \ + { \ + return type_info (typeid (Pointee *)); \ + } \ + template<> \ + inline type_info type_id() \ + { \ + return type_info (typeid (Pointee *)); \ + } \ + }} + +# endif // OPAQUE_POINTER_CONVERTER_HPP_ diff --git a/pxr/external/boost/python/operators.hpp b/pxr/external/boost/python/operators.hpp new file mode 100644 index 0000000000..ea2be7b98f --- /dev/null +++ b/pxr/external/boost/python/operators.hpp @@ -0,0 +1,374 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OPERATORS_DWA2002530_HPP +# define OPERATORS_DWA2002530_HPP + +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + // This is essentially the old v1 to_python(). It will be eliminated + // once the public interface for to_python is settled on. + template + PyObject* convert_result(T const& x) + { + return converter::arg_to_python(x).release(); + } + + // Operator implementation template declarations. The nested apply + // declaration here keeps MSVC6 happy. + template struct operator_l + { + template struct apply; + }; + + template struct operator_r + { + template struct apply; + }; + + template struct operator_1 + { + template struct apply; + }; + + // MSVC6 doesn't want us to do this sort of inheritance on a nested + // class template, so we use this layer of indirection to avoid + // ::template<...> on the nested apply functions below + template + struct operator_l_inner + : operator_l::template apply + {}; + + template + struct operator_r_inner + : operator_r::template apply + {}; + + template + struct operator_1_inner + : operator_1::template apply + {}; + + // Define three different binary_op templates which take care of + // these cases: + // self op self + // self op R + // L op self + // + // The inner apply metafunction is used to adjust the operator to + // the class type being defined. Inheritance of the outer class is + // simply used to provide convenient access to the operation's + // name(). + + // self op self + template + struct binary_op : operator_l + { + template + struct apply : operator_l_inner + { + }; + }; + + // self op R + template + struct binary_op_l : operator_l + { + template + struct apply : operator_l_inner + { + }; + }; + + // L op self + template + struct binary_op_r : operator_r + { + template + struct apply : operator_r_inner + { + }; + }; + + template + struct unary_op : operator_1 + { + template + struct apply : operator_1_inner + { + }; + }; + + // This type is what actually gets returned from operators used on + // self_t + template + struct operator_ + : def_visitor > + { + private: + template + void visit(ClassT& cl) const + { + typedef typename mpl::eval_if< + is_same + , mpl::if_< + is_same + , binary_op + , binary_op_l< + id + , BOOST_DEDUCED_TYPENAME unwrap_other::type + > + > + , mpl::if_< + is_same + , unary_op + , binary_op_r< + id + , BOOST_DEDUCED_TYPENAME unwrap_other::type + > + > + >::type generator; + + cl.def( + generator::name() + , &generator::template apply< + BOOST_DEDUCED_TYPENAME ClassT::wrapped_type + >::execute + ); + } + + friend class python::def_visitor_access; + }; +} + +# define BOOST_PYTHON_BINARY_OPERATION(id, rid, expr) \ +namespace detail \ +{ \ + template <> \ + struct operator_l \ + { \ + template \ + struct apply \ + { \ + typedef typename unwrap_wrapper_::type lhs; \ + typedef typename unwrap_wrapper_::type rhs; \ + static PyObject* execute(lhs& l, rhs const& r) \ + { \ + return detail::convert_result(expr); \ + } \ + }; \ + static char const* name() { return "__" #id "__"; } \ + }; \ + \ + template <> \ + struct operator_r \ + { \ + template \ + struct apply \ + { \ + typedef typename unwrap_wrapper_::type lhs; \ + typedef typename unwrap_wrapper_::type rhs; \ + static PyObject* execute(rhs& r, lhs const& l) \ + { \ + return detail::convert_result(expr); \ + } \ + }; \ + static char const* name() { return "__" #rid "__"; } \ + }; \ +} + +# define BOOST_PYTHON_BINARY_OPERATOR(id, rid, op) \ +BOOST_PYTHON_BINARY_OPERATION(id, rid, l op r) \ +namespace self_ns \ +{ \ + template \ + inline detail::operator_ \ + operator op(L const&, R const&) \ + { \ + return detail::operator_(); \ + } \ +} + +BOOST_PYTHON_BINARY_OPERATOR(add, radd, +) +BOOST_PYTHON_BINARY_OPERATOR(sub, rsub, -) +BOOST_PYTHON_BINARY_OPERATOR(mul, rmul, *) +#if PY_VERSION_HEX >= 0x03000000 + BOOST_PYTHON_BINARY_OPERATOR(truediv, rtruediv, /) +#else + BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) +#endif +BOOST_PYTHON_BINARY_OPERATOR(mod, rmod, %) +BOOST_PYTHON_BINARY_OPERATOR(lshift, rlshift, <<) +BOOST_PYTHON_BINARY_OPERATOR(rshift, rrshift, >>) +BOOST_PYTHON_BINARY_OPERATOR(and, rand, &) +BOOST_PYTHON_BINARY_OPERATOR(xor, rxor, ^) +BOOST_PYTHON_BINARY_OPERATOR(or, ror, |) +BOOST_PYTHON_BINARY_OPERATOR(gt, lt, >) +BOOST_PYTHON_BINARY_OPERATOR(ge, le, >=) +BOOST_PYTHON_BINARY_OPERATOR(lt, gt, <) +BOOST_PYTHON_BINARY_OPERATOR(le, ge, <=) +BOOST_PYTHON_BINARY_OPERATOR(eq, eq, ==) +BOOST_PYTHON_BINARY_OPERATOR(ne, ne, !=) +# undef BOOST_PYTHON_BINARY_OPERATOR + +// pow isn't an operator in C++; handle it specially. +BOOST_PYTHON_BINARY_OPERATION(pow, rpow, pow(l,r)) +# undef BOOST_PYTHON_BINARY_OPERATION + +namespace self_ns +{ +# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP + template + inline detail::operator_ + pow(L const&, R const&) + { + return detail::operator_(); + } +# else + // When there's no argument-dependent lookup, we need these + // overloads to handle the case when everything is imported into the + // global namespace. Note that the plain overload below does /not/ + // take const& arguments. This is needed by MSVC6 at least, or it + // complains of ambiguities, since there's no partial ordering. + inline detail::operator_ + pow(self_t, self_t) + { + return detail::operator_(); + } + template + inline detail::operator_ + pow(self_t const&, R const&) + { + return detail::operator_(); + } + template + inline detail::operator_ + pow(L const&, self_t const&) + { + return detail::operator_(); + } +# endif +} + + +# define BOOST_PYTHON_INPLACE_OPERATOR(id, op) \ +namespace detail \ +{ \ + template <> \ + struct operator_l \ + { \ + template \ + struct apply \ + { \ + typedef typename unwrap_wrapper_::type lhs; \ + typedef typename unwrap_wrapper_::type rhs; \ + static PyObject* \ + execute(back_reference l, rhs const& r) \ + { \ + l.get() op r; \ + return python::incref(l.source().ptr()); \ + } \ + }; \ + static char const* name() { return "__" #id "__"; } \ + }; \ +} \ +namespace self_ns \ +{ \ + template \ + inline detail::operator_ \ + operator op(self_t const&, R const&) \ + { \ + return detail::operator_(); \ + } \ +} + +BOOST_PYTHON_INPLACE_OPERATOR(iadd,+=) +BOOST_PYTHON_INPLACE_OPERATOR(isub,-=) +BOOST_PYTHON_INPLACE_OPERATOR(imul,*=) +BOOST_PYTHON_INPLACE_OPERATOR(idiv,/=) +BOOST_PYTHON_INPLACE_OPERATOR(imod,%=) +BOOST_PYTHON_INPLACE_OPERATOR(ilshift,<<=) +BOOST_PYTHON_INPLACE_OPERATOR(irshift,>>=) +BOOST_PYTHON_INPLACE_OPERATOR(iand,&=) +BOOST_PYTHON_INPLACE_OPERATOR(ixor,^=) +BOOST_PYTHON_INPLACE_OPERATOR(ior,|=) + +# define BOOST_PYTHON_UNARY_OPERATOR(id, op, func_name) \ +namespace detail \ +{ \ + template <> \ + struct operator_1 \ + { \ + template \ + struct apply \ + { \ + typedef typename unwrap_wrapper_::type self_t; \ + static PyObject* execute(self_t& x) \ + { \ + return detail::convert_result(op(x)); \ + } \ + }; \ + static char const* name() { return "__" #id "__"; } \ + }; \ +} \ +namespace self_ns \ +{ \ + inline detail::operator_ \ + func_name(self_t const&) \ + { \ + return detail::operator_(); \ + } \ +} +# undef BOOST_PYTHON_INPLACE_OPERATOR + +BOOST_PYTHON_UNARY_OPERATOR(neg, -, operator-) +BOOST_PYTHON_UNARY_OPERATOR(pos, +, operator+) +BOOST_PYTHON_UNARY_OPERATOR(abs, abs, abs) +BOOST_PYTHON_UNARY_OPERATOR(invert, ~, operator~) +#if PY_VERSION_HEX >= 0x03000000 +BOOST_PYTHON_UNARY_OPERATOR(bool, !!, operator!) +#else +BOOST_PYTHON_UNARY_OPERATOR(nonzero, !!, operator!) +#endif +BOOST_PYTHON_UNARY_OPERATOR(int, long, int_) +BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) +BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) +BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex, complex_) +BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast, str) +BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast, repr) +# undef BOOST_PYTHON_UNARY_OPERATOR + +}} // namespace boost::python + +# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP +using boost::python::self_ns::abs; +using boost::python::self_ns::int_; +using boost::python::self_ns::long_; +using boost::python::self_ns::float_; +using boost::python::self_ns::complex_; +using boost::python::self_ns::str; +using boost::python::self_ns::repr; +using boost::python::self_ns::pow; +# endif + +#endif // OPERATORS_DWA2002530_HPP diff --git a/pxr/external/boost/python/other.hpp b/pxr/external/boost/python/other.hpp new file mode 100644 index 0000000000..26ebb426ba --- /dev/null +++ b/pxr/external/boost/python/other.hpp @@ -0,0 +1,52 @@ +#ifndef BOOST_PYTHON_OTHER_HPP +# define BOOST_PYTHON_OTHER_HPP + +# include +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# include + +namespace boost { namespace python { + +template struct other +{ + typedef T type; +}; + +namespace detail +{ + template + class is_other + { + public: + BOOST_STATIC_CONSTANT(bool, value = false); + }; + + template + class is_other > + { + public: + BOOST_STATIC_CONSTANT(bool, value = true); + }; + + template + class unwrap_other + { + public: + typedef T type; + }; + + template + class unwrap_other > + { + public: + typedef T type; + }; +} + +}} // namespace boost::python + +#endif diff --git a/pxr/external/boost/python/overloads.hpp b/pxr/external/boost/python/overloads.hpp new file mode 100644 index 0000000000..e60dc1798e --- /dev/null +++ b/pxr/external/boost/python/overloads.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef OVERLOADS_DWA2002101_HPP +# define OVERLOADS_DWA2002101_HPP + +# include + +# include +# include + +#endif // OVERLOADS_DWA2002101_HPP diff --git a/pxr/external/boost/python/override.hpp b/pxr/external/boost/python/override.hpp new file mode 100644 index 0000000000..b631226fd6 --- /dev/null +++ b/pxr/external/boost/python/override.hpp @@ -0,0 +1,144 @@ +#if !defined(BOOST_PP_IS_ITERATING) + +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef OVERRIDE_DWA2004721_HPP +# define OVERRIDE_DWA2004721_HPP + +# include + +# include + +# include +# include + +# include +# include +# include +# include +# include + +# include + +namespace boost { namespace python { + +class override; + +namespace detail +{ + class wrapper_base; + + // The result of calling a method. + class method_result + { + private: + friend class boost::python::override; + explicit method_result(PyObject* x) + : m_obj(x) + {} + + public: + template + operator T() + { + converter::return_from_python converter; + return converter(m_obj.release()); + } + +# if BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(140050215)) + template + operator T*() + { + converter::return_from_python converter; + return converter(m_obj.release()); + } +# endif + +# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) || BOOST_WORKAROUND(BOOST_INTEL_WIN, >= 900) + // No operator T& +# else + + template + operator T&() const + { + converter::return_from_python converter; + return converter(const_cast&>(m_obj).release()); + } +# endif + + template + T as(type* = 0) + { + converter::return_from_python converter; + return converter(m_obj.release()); + } + + template + T unchecked(type* = 0) + { + return extract(m_obj.get())(); + } + private: + mutable handle<> m_obj; + }; +} + +class override : public object +{ + private: + friend class detail::wrapper_base; + override(handle<> x) + : object(x) + {} + + public: + detail::method_result + operator()() const + { + detail::method_result x( + PyObject_CallFunction( + this->ptr() + , const_cast("()") + )); + return x; + } + +# define BOOST_PYTHON_fast_arg_to_python_get(z, n, _) \ + , converter::arg_to_python(a##n).get() + +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_fast_arg_to_python_get +}; + +}} // namespace boost::python + +#endif // OVERRIDE_DWA2004721_HPP + +#else +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) +# line BOOST_PP_LINE(__LINE__, override.hpp) +# endif + +# define N BOOST_PP_ITERATION() + +template < + BOOST_PP_ENUM_PARAMS_Z(1, N, class A) + > +detail::method_result +operator()( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a) ) const +{ + detail::method_result x( + PyObject_CallFunction( + this->ptr() + , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_fast_arg_to_python_get, nil) + )); + return x; +} + +# undef N +#endif diff --git a/pxr/external/boost/python/pointee.hpp b/pxr/external/boost/python/pointee.hpp new file mode 100644 index 0000000000..7ec01e0824 --- /dev/null +++ b/pxr/external/boost/python/pointee.hpp @@ -0,0 +1,41 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef POINTEE_DWA2002323_HPP +# define POINTEE_DWA2002323_HPP + +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct pointee_impl + { + template struct apply : detail::remove_pointer {}; + }; + + template <> + struct pointee_impl + { + template struct apply + { + typedef typename T::element_type type; + }; + }; +} + +template +struct pointee + : detail::pointee_impl< + detail::is_pointer::value + >::template apply +{ +}; + +}} // namespace boost::python + +#endif // POINTEE_DWA2002323_HPP diff --git a/pxr/external/boost/python/proxy.hpp b/pxr/external/boost/python/proxy.hpp new file mode 100644 index 0000000000..d3331d5676 --- /dev/null +++ b/pxr/external/boost/python/proxy.hpp @@ -0,0 +1,97 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PROXY_DWA2002615_HPP +# define PROXY_DWA2002615_HPP +# include +# include +# include + +namespace boost { namespace python { namespace api { + +template +class proxy : public object_operators > +{ + typedef typename Policies::key_type key_type; + + typedef proxy const& assignment_self; + public: + proxy(object const& target, key_type const& key); + operator object() const; + + // to support a[b] = c[d] + proxy const& operator=(assignment_self) const; + + template + inline proxy const& operator=(T const& rhs) const + { + Policies::set(m_target, m_key, object(rhs)); + return *this; + } + + public: // implementation detail + void del() const; + + private: + object m_target; + key_type m_key; +}; + + +template +inline void del(proxy const& x) +{ + x.del(); +} + +// +// implementation +// + +template +inline proxy::proxy(object const& target, key_type const& key) + : m_target(target), m_key(key) +{} + +template +inline proxy::operator object() const +{ + return Policies::get(m_target, m_key); +} + +// to support a[b] = c[d] +template +inline proxy const& proxy::operator=(typename proxy::assignment_self rhs) const +{ + return *this = python::object(rhs); +} + +# define BOOST_PYTHON_PROXY_INPLACE(op) \ +template \ +proxy const& operator op(proxy const& lhs, R const& rhs) \ +{ \ + object old(lhs); \ + return lhs = (old op rhs); \ +} +BOOST_PYTHON_PROXY_INPLACE(+=) +BOOST_PYTHON_PROXY_INPLACE(-=) +BOOST_PYTHON_PROXY_INPLACE(*=) +BOOST_PYTHON_PROXY_INPLACE(/=) +BOOST_PYTHON_PROXY_INPLACE(%=) +BOOST_PYTHON_PROXY_INPLACE(<<=) +BOOST_PYTHON_PROXY_INPLACE(>>=) +BOOST_PYTHON_PROXY_INPLACE(&=) +BOOST_PYTHON_PROXY_INPLACE(^=) +BOOST_PYTHON_PROXY_INPLACE(|=) +# undef BOOST_PYTHON_PROXY_INPLACE + +template +inline void proxy::del() const +{ + Policies::del(m_target, m_key); +} + +}}} // namespace boost::python::api + +#endif // PROXY_DWA2002615_HPP diff --git a/pxr/external/boost/python/ptr.hpp b/pxr/external/boost/python/ptr.hpp new file mode 100644 index 0000000000..8e97aa4064 --- /dev/null +++ b/pxr/external/boost/python/ptr.hpp @@ -0,0 +1,65 @@ +#ifndef BOOST_PYTHON_PTR_HPP +# define BOOST_PYTHON_PTR_HPP + +# include +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Based on boost/ref.hpp, thus: +// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) +// Copyright (C) 2001 Peter Dimov + +# include +# include + +namespace boost { namespace python { + +template class pointer_wrapper +{ + public: + typedef Ptr type; + + explicit pointer_wrapper(Ptr x): p_(x) {} + operator Ptr() const { return p_; } + Ptr get() const { return p_; } + private: + Ptr p_; +}; + +template +inline pointer_wrapper ptr(T t) +{ + return pointer_wrapper(t); +} + +template +class is_pointer_wrapper + : public mpl::false_ +{ +}; + +template +class is_pointer_wrapper > + : public mpl::true_ +{ +}; + +template +class unwrap_pointer +{ + public: + typedef T type; +}; + +template +class unwrap_pointer > +{ + public: + typedef T type; +}; + +}} // namespace boost::python + +#endif diff --git a/pxr/external/boost/python/pure_virtual.hpp b/pxr/external/boost/python/pure_virtual.hpp new file mode 100644 index 0000000000..58e9aedef1 --- /dev/null +++ b/pxr/external/boost/python/pure_virtual.hpp @@ -0,0 +1,124 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef PURE_VIRTUAL_DWA2003810_HPP +# define PURE_VIRTUAL_DWA2003810_HPP + +# include +# include +# include +# include + +# include + +namespace boost { namespace python { + +namespace detail +{ + // + // @group Helpers for pure_virtual_visitor. { + // + + // Raises a Python RuntimeError reporting that a pure virtual + // function was called. + void BOOST_PYTHON_DECL pure_virtual_called(); + + // Replace the two front elements of S with T1 and T2 + template + struct replace_front2 + { + // Metafunction forwarding seemed to confound vc6 + typedef typename mpl::push_front< + typename mpl::push_front< + typename mpl::pop_front< + typename mpl::pop_front< + S + >::type + >::type + , T2 + >::type + , T1 + >::type type; + }; + + // Given an MPL sequence representing a member function [object] + // signature, returns a new MPL sequence whose return type is + // replaced by void, and whose first argument is replaced by C&. + template + typename replace_front2::type + error_signature(S) + { + typedef typename replace_front2::type r; + return r(); + } + + // + // } + // + + // + // A def_visitor which defines a method as usual, then adds a + // corresponding function which raises a "pure virtual called" + // exception unless it's been overridden. + // + template + struct pure_virtual_visitor + : def_visitor > + { + pure_virtual_visitor(PointerToMemberFunction pmf) + : m_pmf(pmf) + {} + + private: + friend class python::def_visitor_access; + + template + void visit(C_& c, char const* name, Options& options) const + { + // This should probably be a nicer error message + BOOST_STATIC_ASSERT(!Options::has_default_implementation); + + // Add the virtual function dispatcher + c.def( + name + , m_pmf + , options.doc() + , options.keywords() + , options.policies() + ); + + typedef BOOST_DEDUCED_TYPENAME C_::metadata::held_type held_type; + + // Add the default implementation which raises the exception + c.def( + name + , make_function( + detail::nullary_function_adaptor(pure_virtual_called) + , default_call_policies() + , detail::error_signature(detail::get_signature(m_pmf)) + ) + ); + } + + private: // data members + PointerToMemberFunction m_pmf; + }; +} + +// +// Passed a pointer to member function, generates a def_visitor which +// creates a method that only dispatches to Python if the function has +// been overridden, either in C++ or in Python, raising a "pure +// virtual called" exception otherwise. +// +template +detail::pure_virtual_visitor +pure_virtual(PointerToMemberFunction pmf) +{ + return detail::pure_virtual_visitor(pmf); +} + +}} // namespace boost::python + +#endif // PURE_VIRTUAL_DWA2003810_HPP diff --git a/pxr/external/boost/python/raw_function.hpp b/pxr/external/boost/python/raw_function.hpp new file mode 100644 index 0000000000..9d9f6b8b1b --- /dev/null +++ b/pxr/external/boost/python/raw_function.hpp @@ -0,0 +1,61 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RAW_FUNCTION_DWA200336_HPP +# define RAW_FUNCTION_DWA200336_HPP + +# include + +# include +# include +# include +# include + +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct raw_dispatcher + { + raw_dispatcher(F f) : f(f) {} + + PyObject* operator()(PyObject* args, PyObject* keywords) + { + return incref( + object( + f( + tuple(borrowed_reference(args)) + , keywords ? dict(borrowed_reference(keywords)) : dict() + ) + ).ptr() + ); + } + + private: + F f; + }; + + object BOOST_PYTHON_DECL make_raw_function(objects::py_function); +} + +template +object raw_function(F f, std::size_t min_args = 0) +{ + return detail::make_raw_function( + objects::py_function( + detail::raw_dispatcher(f) + , mpl::vector1() + , min_args + , (std::numeric_limits::max)() + ) + ); +} + +}} // namespace boost::python + +#endif // RAW_FUNCTION_DWA200336_HPP diff --git a/pxr/external/boost/python/refcount.hpp b/pxr/external/boost/python/refcount.hpp new file mode 100644 index 0000000000..aa6aa5dbb6 --- /dev/null +++ b/pxr/external/boost/python/refcount.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REFCOUNT_DWA2002615_HPP +# define REFCOUNT_DWA2002615_HPP + +# include +# include + +namespace boost { namespace python { + +template +inline T* incref(T* p) +{ + Py_INCREF(python::upcast(p)); + return p; +} + +template +inline T* xincref(T* p) +{ + Py_XINCREF(python::upcast(p)); + return p; +} + +template +inline void decref(T* p) +{ + assert( Py_REFCNT(python::upcast(p)) > 0 ); + Py_DECREF(python::upcast(p)); +} + +template +inline void xdecref(T* p) +{ + assert( !p || Py_REFCNT(python::upcast(p)) > 0 ); + Py_XDECREF(python::upcast(p)); +} + +}} // namespace boost::python + +#endif // REFCOUNT_DWA2002615_HPP diff --git a/pxr/external/boost/python/reference_existing_object.hpp b/pxr/external/boost/python/reference_existing_object.hpp new file mode 100644 index 0000000000..4c8344070b --- /dev/null +++ b/pxr/external/boost/python/reference_existing_object.hpp @@ -0,0 +1,46 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REFERENCE_EXISTING_OBJECT_DWA200222_HPP +# define REFERENCE_EXISTING_OBJECT_DWA200222_HPP + +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct reference_existing_object_requires_a_pointer_or_reference_return_type +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +template struct to_python_value; + +struct reference_existing_object +{ + template + struct apply + { + BOOST_STATIC_CONSTANT( + bool, ok = detail::is_pointer::value || detail::is_reference::value); + + typedef typename mpl::if_c< + ok + , to_python_indirect + , detail::reference_existing_object_requires_a_pointer_or_reference_return_type + >::type type; + }; +}; + +}} // namespace boost::python + +#endif // REFERENCE_EXISTING_OBJECT_DWA200222_HPP diff --git a/pxr/external/boost/python/register_ptr_to_python.hpp b/pxr/external/boost/python/register_ptr_to_python.hpp new file mode 100644 index 0000000000..d39bd0cf71 --- /dev/null +++ b/pxr/external/boost/python/register_ptr_to_python.hpp @@ -0,0 +1,31 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef REGISTER_PTR_TO_PYTHON_HPP +#define REGISTER_PTR_TO_PYTHON_HPP + +#include +#include +#include + +namespace boost { namespace python { + +template +void register_ptr_to_python() +{ + typedef typename boost::python::pointee

    ::type X; + objects::class_value_wrapper< + P + , objects::make_ptr_instance< + X + , objects::pointer_holder + > + >(); +} + +}} // namespace boost::python + +#endif // REGISTER_PTR_TO_PYTHON_HPP + + diff --git a/pxr/external/boost/python/return_arg.hpp b/pxr/external/boost/python/return_arg.hpp new file mode 100644 index 0000000000..de23993987 --- /dev/null +++ b/pxr/external/boost/python/return_arg.hpp @@ -0,0 +1,109 @@ +// Copyright David Abrahams and Nikolay Mladenov 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RETURN_ARG_DWA2003719_HPP +# define RETURN_ARG_DWA2003719_HPP +# include +# include +# include + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif + +# include + +# include +# include + +# include +# include + +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct return_arg_pos_argument_must_be_positive +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; + + struct return_none + { + template struct apply + { + struct type + { + static bool convertible() + { + return true; + } + + PyObject *operator()( typename value_arg::type ) const + { + return none(); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + PyTypeObject const *get_pytype() const { return converter::expected_pytype_for_arg::get_pytype() ; } +#endif + }; + }; + }; +} + +template < + std::size_t arg_pos=1 + , class Base = default_call_policies +> +struct return_arg : Base +{ + private: + BOOST_STATIC_CONSTANT(bool, legal = arg_pos > 0); + + public: + typedef typename mpl::if_c< + legal + , detail::return_none + , detail::return_arg_pos_argument_must_be_positive + // we could default to the base result_converter in case or + // arg_pos==0 since return arg 0 means return result, but I + // think it is better to issue an error instead, cause it can + // lead to confusions + >::type result_converter; + + template + static PyObject* postcall(ArgumentPackage const& args, PyObject* result) + { + // In case of arg_pos == 0 we could simply return Base::postcall, + // but this is redundant + BOOST_STATIC_ASSERT(arg_pos > 0); + + result = Base::postcall(args,result); + if (!result) + return 0; + Py_DECREF(result); + return incref( detail::get(mpl::int_(),args) ); + } + + template + struct extract_return_type : mpl::at_c + { + }; + +}; + +template < + class Base = default_call_policies + > +struct return_self + : return_arg<1,Base> +{}; + +}} // namespace boost::python + +#endif // RETURN_ARG_DWA2003719_HPP diff --git a/pxr/external/boost/python/return_by_value.hpp b/pxr/external/boost/python/return_by_value.hpp new file mode 100644 index 0000000000..42d7076d17 --- /dev/null +++ b/pxr/external/boost/python/return_by_value.hpp @@ -0,0 +1,30 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BY_VALUE_DWA20021015_HPP +# define BY_VALUE_DWA20021015_HPP + +# include + +# include +# include + +# include + +namespace boost { namespace python { + +struct return_by_value +{ + template + struct apply + { + typedef to_python_value< + typename detail::value_arg::type + > type; + }; +}; + +}} // namespace boost::python + +#endif // BY_VALUE_DWA20021015_HPP diff --git a/pxr/external/boost/python/return_internal_reference.hpp b/pxr/external/boost/python/return_internal_reference.hpp new file mode 100644 index 0000000000..cc60f4422a --- /dev/null +++ b/pxr/external/boost/python/return_internal_reference.hpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RETURN_INTERNAL_REFERENCE_DWA2002131_HPP +# define RETURN_INTERNAL_REFERENCE_DWA2002131_HPP + +# include + +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct return_internal_reference_owner_arg_must_be_greater_than_zero +# if defined(__GNUC__) || defined(__EDG__) + {} +# endif + ; +} + +template +struct return_internal_reference + : with_custodian_and_ward_postcall<0, owner_arg, BasePolicy_> +{ + private: + BOOST_STATIC_CONSTANT(bool, legal = owner_arg > 0); + public: + typedef typename mpl::if_c< + legal + , reference_existing_object + , detail::return_internal_reference_owner_arg_must_be_greater_than_zero + >::type result_converter; +}; + +}} // namespace boost::python + +#endif // RETURN_INTERNAL_REFERENCE_DWA2002131_HPP diff --git a/pxr/external/boost/python/return_opaque_pointer.hpp b/pxr/external/boost/python/return_opaque_pointer.hpp new file mode 100644 index 0000000000..4654e3bd51 --- /dev/null +++ b/pxr/external/boost/python/return_opaque_pointer.hpp @@ -0,0 +1,47 @@ +// Copyright Gottfried Ganßauge 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +/* + * Generic Return value converter generator for opaque C++-pointers + */ +# ifndef RETURN_OPAQUE_POINTER_HPP_ +# define RETURN_OPAQUE_POINTER_HPP_ + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + static void opaque_pointee(Pointee const volatile*) + { + force_instantiate(opaque::instance); + } +} + +struct return_opaque_pointer +{ + template + struct apply + { + BOOST_MPL_ASSERT_MSG( is_pointer::value, RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE, (R)); + + struct type : + boost::python::to_python_value< + typename detail::value_arg::type + > + { + type() { detail::opaque_pointee(R()); } + }; + }; +}; + +}} // namespace boost::python +# endif // RETURN_OPAQUE_POINTER_HPP_ diff --git a/pxr/external/boost/python/return_value_policy.hpp b/pxr/external/boost/python/return_value_policy.hpp new file mode 100644 index 0000000000..9a5fba380b --- /dev/null +++ b/pxr/external/boost/python/return_value_policy.hpp @@ -0,0 +1,21 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef RETURN_VALUE_POLICY_DWA2002131_HPP +# define RETURN_VALUE_POLICY_DWA2002131_HPP + +# include +# include + +namespace boost { namespace python { + +template +struct return_value_policy : BasePolicy_ +{ + typedef ResultConverterGenerator result_converter; +}; + +}} // namespace boost::python + +#endif // RETURN_VALUE_POLICY_DWA2002131_HPP diff --git a/pxr/external/boost/python/scope.hpp b/pxr/external/boost/python/scope.hpp new file mode 100644 index 0000000000..8be3e054e0 --- /dev/null +++ b/pxr/external/boost/python/scope.hpp @@ -0,0 +1,77 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SCOPE_DWA2002724_HPP +# define SCOPE_DWA2002724_HPP + +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + // Making this a namespace-scope variable to avoid Cygwin issues. + // Use a PyObject* to avoid problems with static destruction after Py_Finalize + extern BOOST_PYTHON_DECL PyObject* current_scope; +} + +class scope + : public object +{ + public: + inline scope(scope const&); + inline scope(object const&); + inline scope(); + inline ~scope(); + + private: // data members + PyObject* m_previous_scope; + + private: // unimplemented functions + void operator=(scope const&); +}; + +inline scope::scope(object const& new_scope) + : object(new_scope) + , m_previous_scope(detail::current_scope) +{ + detail::current_scope = python::incref(new_scope.ptr()); +} + +inline scope::scope() + : object(detail::borrowed_reference( + detail::current_scope ? detail::current_scope : Py_None + )) + , m_previous_scope(python::xincref(detail::current_scope)) +{ +} + +inline scope::~scope() +{ + python::xdecref(detail::current_scope); + detail::current_scope = m_previous_scope; +} + +namespace converter +{ + template <> + struct object_manager_traits + : object_manager_traits + { + }; +} + +// Placing this after the specialization above suppresses a CWPro8.3 bug +inline scope::scope(scope const& new_scope) + : object(new_scope) + , m_previous_scope(detail::current_scope) +{ + detail::current_scope = python::incref(new_scope.ptr()); +} + +}} // namespace boost::python + +#endif // SCOPE_DWA2002724_HPP diff --git a/pxr/external/boost/python/self.hpp b/pxr/external/boost/python/self.hpp new file mode 100644 index 0000000000..99ec5b8fbe --- /dev/null +++ b/pxr/external/boost/python/self.hpp @@ -0,0 +1,33 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SELF_DWA2002531_HPP +# define SELF_DWA2002531_HPP + +# include + +namespace boost { namespace python { + +#define BOOST_PYTHON_SELF_IS_CLASS + +// Sink self_t into its own namespace so that we have a safe place to +// put the completely general operator templates which operate on +// it. It is possible to avoid this, but it turns out to be much more +// complicated and finally GCC 2.95.2 chokes on it. +namespace self_ns +{ +# ifndef BOOST_PYTHON_SELF_IS_CLASS + enum self_t { self }; +# else + struct self_t {}; + extern BOOST_PYTHON_DECL self_t self; +# endif +} + +using self_ns::self_t; +using self_ns::self; + +}} // namespace boost::python + +#endif // SELF_DWA2002531_HPP diff --git a/pxr/external/boost/python/signature.hpp b/pxr/external/boost/python/signature.hpp new file mode 100644 index 0000000000..ab4bca390a --- /dev/null +++ b/pxr/external/boost/python/signature.hpp @@ -0,0 +1,252 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright David Abrahams 2002, Joel de Guzman, 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_PP_IS_ITERATING) + +# ifndef SIGNATURE_JDG20020813_HPP +# define SIGNATURE_JDG20020813_HPP + +# include + +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +# define BOOST_PYTHON_LIST_INC(n) \ + BOOST_PP_CAT(mpl::vector, BOOST_PP_INC(n)) + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace python { namespace detail { + +// A metafunction returning C1 if C1 is derived from C2, and C2 +// otherwise +template +struct most_derived +{ + typedef typename mpl::if_< + detail::is_convertible + , C1 + , C2 + >::type type; +}; + +// The following macros generate expansions for:: +// +// template +// inline mpl::vector +// get_signature(RT(BOOST_PYTHON_FN_CC *)(T0...TN), void* = 0) +// { +// return mpl::list(); +// } +// +// where BOOST_PYTHON_FN_CC is a calling convention keyword, can be +// +// empty, for default calling convention +// __cdecl (if BOOST_PYTHON_ENABLE_CDECL is defined) +// __stdcall (if BOOST_PYTHON_ENABLE_STDCALL is defined) +// __fastcall (if BOOST_PYTHON_ENABLE_FASTCALL is defined) +// +// And, for an appropriate assortment of cv-qualifications:: +// +// template +// inline mpl::vector +// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv)) +// { +// return mpl::list(); +// } +// +// template +// inline mpl::vector< +// RT +// , typename most_derived::type& +// , T0...TN +// > +// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv), Target*) +// { +// return mpl::list(); +// } +// +// There are two forms for invoking get_signature:: +// +// get_signature(f) +// +// and :: +// +// get_signature(f,(Target*)0) +// +// These functions extract the return type, class (for member +// functions) and arguments of the input signature and stuff them in +// an mpl type sequence (the calling convention is dropped). +// Note that cv-qualification is dropped from +// the "hidden this" argument of member functions; that is a +// necessary sacrifice to ensure that an lvalue from_python converter +// is used. A pointer is not used so that None will be rejected for +// overload resolution. +// +// The second form of get_signature essentially downcasts the "hidden +// this" argument of member functions to Target, because the function +// may actually be a member of a base class which is not wrapped, and +// in that case conversion from python would fail. +// +// @group { + +// 'default' calling convention + +# define BOOST_PYTHON_FN_CC + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +// __cdecl calling convention + +# if defined(BOOST_PYTHON_ENABLE_CDECL) + +# define BOOST_PYTHON_FN_CC __cdecl +# define BOOST_PYTHON_FN_CC_IS_CDECL + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC +# undef BOOST_PYTHON_FN_CC_IS_CDECL + +# endif // defined(BOOST_PYTHON_ENABLE_CDECL) + +// __stdcall calling convention + +# if defined(BOOST_PYTHON_ENABLE_STDCALL) + +# define BOOST_PYTHON_FN_CC __stdcall + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +# endif // defined(BOOST_PYTHON_ENABLE_STDCALL) + +// __fastcall calling convention + +# if defined(BOOST_PYTHON_ENABLE_FASTCALL) + +# define BOOST_PYTHON_FN_CC __fastcall + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +# endif // defined(BOOST_PYTHON_ENABLE_FASTCALL) + +# undef BOOST_PYTHON_LIST_INC + +// } + +}}} // namespace boost::python::detail + + +# endif // SIGNATURE_JDG20020813_HPP + +// For gcc 4.4 compatability, we must include the +// BOOST_PP_ITERATION_DEPTH test inside an #else clause. +#else // BOOST_PP_IS_ITERATING +#if BOOST_PP_ITERATION_DEPTH() == 1 // defined(BOOST_PP_IS_ITERATING) + +# define N BOOST_PP_ITERATION() + + // as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same + // function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)', + // we don't define it twice +# if !defined(BOOST_PYTHON_FN_CC_IS_CDECL) + +template < + class RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> +inline BOOST_PYTHON_LIST_INC(N)< + RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> +get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0) +{ + return BOOST_PYTHON_LIST_INC(N)< + RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) + >(); +} + +# endif // !defined(BOOST_PYTHON_FN_CC_IS_CDECL) + +# undef N + +# define BOOST_PP_ITERATION_PARAMS_2 \ + (3, (0, 3, )) +# include BOOST_PP_ITERATE() + +#else + +# define N BOOST_PP_RELATIVE_ITERATION(1) +# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_ITERATION()) + +template < + class RT, class ClassT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> +inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> +get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q) +{ + return BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) + >(); +} + +template < + class Target + , class RT + , class ClassT + BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T) +> +inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + RT + , typename most_derived::type& + BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) +> +get_signature( + RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q + , Target* +) +{ + return BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + RT + , BOOST_DEDUCED_TYPENAME most_derived::type& + BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) + >(); +} + +# undef Q +# undef N + +#endif // BOOST_PP_ITERATION_DEPTH() +#endif // !defined(BOOST_PP_IS_ITERATING) diff --git a/pxr/external/boost/python/slice.hpp b/pxr/external/boost/python/slice.hpp new file mode 100644 index 0000000000..80660fab77 --- /dev/null +++ b/pxr/external/boost/python/slice.hpp @@ -0,0 +1,276 @@ +#ifndef BOOST_PYTHON_SLICE_JDB20040105_HPP +#define BOOST_PYTHON_SLICE_JDB20040105_HPP + +// Copyright (c) 2004 Jonathan Brandmeyer +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +#include + +#include +#include + +namespace boost { namespace python { + +namespace detail +{ + class BOOST_PYTHON_DECL slice_base : public object + { + public: + // Get the Python objects associated with the slice. In principle, these + // may be any arbitrary Python type, but in practice they are usually + // integers. If one or more parameter is ommited in the Python expression + // that created this slice, than that parameter is None here, and compares + // equal to a default-constructed boost::python::object. + // If a user-defined type wishes to support slicing, then support for the + // special meaning associated with negative indices is up to the user. + object start() const; + object stop() const; + object step() const; + + protected: + explicit slice_base(PyObject*, PyObject*, PyObject*); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice_base, object) + }; +} + +class slice : public detail::slice_base +{ + typedef detail::slice_base base; + public: + // Equivalent to slice(::) + slice() : base(0,0,0) {} + + // Each argument must be slice_nil, or implicitly convertable to object. + // They should normally be integers. + template + slice( Integer1 start, Integer2 stop) + : base( object(start).ptr(), object(stop).ptr(), 0 ) + {} + + template + slice( Integer1 start, Integer2 stop, Integer3 stride) + : base( object(start).ptr(), object(stop).ptr(), object(stride).ptr() ) + {} + + // The following algorithm is intended to automate the process of + // determining a slice range when you want to fully support negative + // indices and non-singular step sizes. Its functionallity is simmilar to + // PySlice_GetIndicesEx() in the Python/C API, but tailored for C++ users. + // This template returns a slice::range struct that, when used in the + // following iterative loop, will traverse a slice of the function's + // arguments. + // while (start != end) { + // do_foo(...); + // std::advance( start, step); + // } + // do_foo(...); // repeat exactly once more. + + // Arguments: a [begin, end) pair of STL-conforming random-access iterators. + + // Return: slice::range, where start and stop define a _closed_ interval + // that covers at most [begin, end-1] of the provided arguments, and a step + // that is non-zero. + + // Throws: error_already_set() if any of the indices are neither None nor + // integers, or the slice has a step value of zero. + // std::invalid_argument if the resulting range would be empty. Normally, + // you should catch this exception and return an empty sequence of the + // appropriate type. + + // Performance: constant time for random-access iterators. + + // Rationale: + // closed-interval: If an open interval were used, then for a non-singular + // value for step, the required state for the end iterator could be + // beyond the one-past-the-end postion of the specified range. While + // probably harmless, the behavior of STL-conforming iterators is + // undefined in this case. + // exceptions on zero-length range: It is impossible to define a closed + // interval over an empty range, so some other form of error checking + // would have to be used by the user to prevent undefined behavior. In + // the case where the user fails to catch the exception, it will simply + // be translated to Python by the default exception handling mechanisms. + + template + struct range + { + RandomAccessIterator start; + RandomAccessIterator stop; + typename iterator_difference::type step; + }; + + template + slice::range + get_indices( const RandomAccessIterator& begin, + const RandomAccessIterator& end) const + { + // This is based loosely on PySlice_GetIndicesEx(), but it has been + // carefully crafted to ensure that these iterators never fall out of + // the range of the container. + slice::range ret; + + typedef typename iterator_difference::type difference_type; + difference_type max_dist = std::distance(begin, end); + + object slice_start = this->start(); + object slice_stop = this->stop(); + object slice_step = this->step(); + + // Extract the step. + if (slice_step == object()) { + ret.step = 1; + } + else { + ret.step = extract( slice_step); + if (ret.step == 0) { + PyErr_SetString( PyExc_IndexError, "step size cannot be zero."); + throw_error_already_set(); + } + } + + // Setup the start iterator. + if (slice_start == object()) { + if (ret.step < 0) { + ret.start = end; + --ret.start; + } + else + ret.start = begin; + } + else { + difference_type i = extract( slice_start); + if (i >= max_dist && ret.step > 0) + throw std::invalid_argument( "Zero-length slice"); + if (i >= 0) { + ret.start = begin; + BOOST_USING_STD_MIN(); + std::advance( ret.start, min BOOST_PREVENT_MACRO_SUBSTITUTION(i, max_dist-1)); + } + else { + if (i < -max_dist && ret.step < 0) + throw std::invalid_argument( "Zero-length slice"); + ret.start = end; + // Advance start (towards begin) not farther than begin. + std::advance( ret.start, (-i < max_dist) ? i : -max_dist ); + } + } + + // Set up the stop iterator. This one is a little trickier since slices + // define a [) range, and we are returning a [] range. + if (slice_stop == object()) { + if (ret.step < 0) { + ret.stop = begin; + } + else { + ret.stop = end; + std::advance( ret.stop, -1); + } + } + else { + difference_type i = extract(slice_stop); + // First, branch on which direction we are going with this. + if (ret.step < 0) { + if (i+1 >= max_dist || i == -1) + throw std::invalid_argument( "Zero-length slice"); + + if (i >= 0) { + ret.stop = begin; + std::advance( ret.stop, i+1); + } + else { // i is negative, but more negative than -1. + ret.stop = end; + std::advance( ret.stop, (-i < max_dist) ? i : -max_dist); + } + } + else { // stepping forward + if (i == 0 || -i >= max_dist) + throw std::invalid_argument( "Zero-length slice"); + + if (i > 0) { + ret.stop = begin; + std::advance( ret.stop, (std::min)( i-1, max_dist-1)); + } + else { // i is negative, but not more negative than -max_dist + ret.stop = end; + std::advance( ret.stop, i-1); + } + } + } + + // Now the fun part, handling the possibilites surrounding step. + // At this point, step has been initialized, ret.stop, and ret.step + // represent the widest possible range that could be traveled + // (inclusive), and final_dist is the maximum distance covered by the + // slice. + typename iterator_difference::type final_dist = + std::distance( ret.start, ret.stop); + + // First case, if both ret.start and ret.stop are equal, then step + // is irrelevant and we can return here. + if (final_dist == 0) + return ret; + + // Second, if there is a sign mismatch, than the resulting range and + // step size conflict: std::advance( ret.start, ret.step) goes away from + // ret.stop. + if ((final_dist > 0) != (ret.step > 0)) + throw std::invalid_argument( "Zero-length slice."); + + // Finally, if the last step puts us past the end, we move ret.stop + // towards ret.start in the amount of the remainder. + // I don't remember all of the oolies surrounding negative modulii, + // so I am handling each of these cases separately. + if (final_dist < 0) { + difference_type remainder = -final_dist % -ret.step; + std::advance( ret.stop, remainder); + } + else { + difference_type remainder = final_dist % ret.step; + std::advance( ret.stop, -remainder); + } + + return ret; + } + + // Incorrect spelling. DO NOT USE. Only here for backward compatibility. + // Corrected 2011-06-14. + template + slice::range + get_indicies( const RandomAccessIterator& begin, + const RandomAccessIterator& end) const + { + return get_indices(begin, end); + } + + public: + // This declaration, in conjunction with the specialization of + // object_manager_traits<> below, allows C++ functions accepting slice + // arguments to be called from from Python. These constructors should never + // be used in client code. + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice, detail::slice_base) +}; + + +namespace converter { + +template<> +struct object_manager_traits + : pytype_object_manager_traits<&PySlice_Type, slice> +{ +}; + +} // !namesapce converter + +} } // !namespace ::boost::python + + +#endif // !defined BOOST_PYTHON_SLICE_JDB20040105_HPP diff --git a/pxr/external/boost/python/slice_nil.hpp b/pxr/external/boost/python/slice_nil.hpp new file mode 100644 index 0000000000..e911f06801 --- /dev/null +++ b/pxr/external/boost/python/slice_nil.hpp @@ -0,0 +1,44 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SLICE_NIL_DWA2002620_HPP +# define SLICE_NIL_DWA2002620_HPP + +# include +# include + +namespace boost { namespace python { namespace api { + +class slice_nil : public object +{ + public: + slice_nil() : object() {} +}; + +# ifndef _ // Watch out for GNU gettext users, who #define _(x) +static const slice_nil _ = slice_nil(); +# endif + +template +struct slice_bound +{ + typedef object type; +}; + +template <> +struct slice_bound +{ + typedef slice_nil type; +}; + +} + +using api::slice_nil; +# ifndef _ // Watch out for GNU gettext users, who #define _(x) +using api::_; +# endif + +}} // namespace boost::python + +#endif // SLICE_NIL_DWA2002620_HPP diff --git a/pxr/external/boost/python/src/converter/arg_to_python_base.cpp b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp new file mode 100644 index 0000000000..d872314a74 --- /dev/null +++ b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp @@ -0,0 +1,28 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +namespace boost { namespace python { namespace converter { + +namespace detail +{ + arg_to_python_base::arg_to_python_base( + void const volatile* source, registration const& converters) +# if !defined(BOOST_MSVC) || BOOST_MSVC <= 1300 || _MSC_FULL_VER > 13102179 + : handle<> +# else + : m_ptr +# endif + (converters.to_python(source)) + { + } +} + +}}} // namespace boost::python::converter diff --git a/pxr/external/boost/python/src/converter/builtin_converters.cpp b/pxr/external/boost/python/src/converter/builtin_converters.cpp new file mode 100644 index 0000000000..ee2d5b4794 --- /dev/null +++ b/pxr/external/boost/python/src/converter/builtin_converters.cpp @@ -0,0 +1,592 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace boost { namespace python { namespace converter { + +shared_ptr_deleter::shared_ptr_deleter(handle<> owner) + : owner(owner) +{} + +shared_ptr_deleter::~shared_ptr_deleter() {} + +void shared_ptr_deleter::operator()(void const*) +{ + owner.reset(); +} + +namespace +{ + + // An lvalue conversion function which extracts a char const* from a + // Python String. +#if PY_VERSION_HEX < 0x03000000 + void* convert_to_cstring(PyObject* obj) + { + return PyString_Check(obj) ? PyString_AsString(obj) : 0; + } +#elif PY_VERSION_HEX < 0x03070000 + void* convert_to_cstring(PyObject* obj) + { + return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0; + } +#else + void* convert_to_cstring(PyObject* obj) + { + return PyUnicode_Check(obj) ? const_cast(reinterpret_cast(_PyUnicode_AsString(obj))) : 0; + } +#endif + + // Given a target type and a SlotPolicy describing how to perform a + // given conversion, registers from_python converters which use the + // SlotPolicy to extract the type. + template + struct slot_rvalue_from_python + { + public: + slot_rvalue_from_python() + { + registry::insert( + &slot_rvalue_from_python::convertible + , &slot_rvalue_from_python::construct + , type_id() + , &SlotPolicy::get_pytype + ); + } + + private: + static void* convertible(PyObject* obj) + { + unaryfunc* slot = SlotPolicy::get_slot(obj); + return slot && *slot ? slot : 0; + } + + static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) + { + // Get the (intermediate) source object + unaryfunc creator = *static_cast(data->convertible); + handle<> intermediate(creator(obj)); + + // Get the location in which to construct + void* storage = ((rvalue_from_python_storage*)data)->storage.bytes; +# ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4244) +# endif + new (storage) T( SlotPolicy::extract(intermediate.get()) ); + +# ifdef _MSC_VER +# pragma warning(pop) +# endif + // record successful construction + data->convertible = storage; + } + }; + + // identity_unaryfunc/py_object_identity -- manufacture a unaryfunc + // "slot" which just returns its argument. + extern "C" PyObject* identity_unaryfunc(PyObject* x) + { + Py_INCREF(x); + return x; + } + unaryfunc py_object_identity = identity_unaryfunc; + +#if PY_VERSION_HEX >= 0x03000000 + // As in Python 3 there is only one integer type, we can have much + // simplified logic. + // XXX(bhy) maybe the code will work with 2.6 or even 2.5? + struct int_rvalue_from_python_base + { + static unaryfunc* get_slot(PyObject* obj) + { + return PyLong_Check(obj) ? &py_object_identity : 0; + } + static PyTypeObject const* get_pytype() {return &PyLong_Type;} + }; + + template + struct signed_int_rvalue_from_python : int_rvalue_from_python_base + { + static T extract(PyObject* intermediate) + { + long x = PyLong_AsLong(intermediate); + if (PyErr_Occurred()) + throw_error_already_set(); + return numeric_cast(x); + } + }; + + template + struct unsigned_int_rvalue_from_python : int_rvalue_from_python_base + { + static T extract(PyObject* intermediate) + { + unsigned long x = PyLong_AsUnsignedLong(intermediate); + if (PyErr_Occurred()) + throw_error_already_set(); + return numeric_cast(x); + } + }; +#else // PY_VERSION_HEX >= 0x03000000 + // A SlotPolicy for extracting signed integer types from Python objects + struct signed_int_rvalue_from_python_base + { + static unaryfunc* get_slot(PyObject* obj) + { + PyNumberMethods* number_methods = obj->ob_type->tp_as_number; + if (number_methods == 0) + return 0; + + return ( +#if PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) + !PyBool_Check(obj) && +#endif + (PyInt_Check(obj) || PyLong_Check(obj))) + + ? &number_methods->nb_int : 0; + } + static PyTypeObject const* get_pytype() { return &PyInt_Type;} + }; + + template + struct signed_int_rvalue_from_python : signed_int_rvalue_from_python_base + { + static T extract(PyObject* intermediate) + { + long x = PyInt_AsLong(intermediate); + if (PyErr_Occurred()) + throw_error_already_set(); + return numeric_cast(x); + } + }; + + // A SlotPolicy for extracting unsigned integer types from Python objects + struct unsigned_int_rvalue_from_python_base + { + static unaryfunc* get_slot(PyObject* obj) + { + PyNumberMethods* number_methods = obj->ob_type->tp_as_number; + if (number_methods == 0) + return 0; + + return ( +#if PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) + !PyBool_Check(obj) && +#endif + (PyInt_Check(obj) || PyLong_Check(obj))) + ? &py_object_identity : 0; + } + static PyTypeObject const* get_pytype() { return &PyInt_Type;} + }; + + template + struct unsigned_int_rvalue_from_python : unsigned_int_rvalue_from_python_base + { + static T extract(PyObject* intermediate) + { + if (PyLong_Check(intermediate)) { + // PyLong_AsUnsignedLong() checks for negative overflow, so no + // need to check it here. + unsigned long result = PyLong_AsUnsignedLong(intermediate); + if (PyErr_Occurred()) + throw_error_already_set(); + return numeric_cast(result); + } else { + // None of PyInt_AsUnsigned*() functions check for negative + // overflow, so use PyInt_AS_LONG instead and check if number is + // negative, issuing the exception appropriately. + long result = PyInt_AS_LONG(intermediate); + if (PyErr_Occurred()) + throw_error_already_set(); + if (result < 0) { + PyErr_SetString(PyExc_OverflowError, "can't convert negative" + " value to unsigned"); + throw_error_already_set(); + } + return numeric_cast(result); + } + } + }; +#endif // PY_VERSION_HEX >= 0x03000000 + +// Checking Python's macro instead of Boost's - we don't seem to get +// the config right all the time. Furthermore, Python's is defined +// when long long is absent but __int64 is present. + +#ifdef HAVE_LONG_LONG + // A SlotPolicy for extracting long long types from Python objects + + struct long_long_rvalue_from_python_base + { + static unaryfunc* get_slot(PyObject* obj) + { +#if PY_VERSION_HEX >= 0x03000000 + return PyLong_Check(obj) ? &py_object_identity : 0; +#else + PyNumberMethods* number_methods = obj->ob_type->tp_as_number; + if (number_methods == 0) + return 0; + + // Return the identity conversion slot to avoid creating a + // new object. We'll handle that in the extract function + if (PyInt_Check(obj)) + return &number_methods->nb_int; + else if (PyLong_Check(obj)) + return &number_methods->nb_long; + else + return 0; +#endif + } + static PyTypeObject const* get_pytype() { return &PyLong_Type;} + }; + + struct long_long_rvalue_from_python : long_long_rvalue_from_python_base + { + static BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) + { +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(intermediate)) + { + return PyInt_AS_LONG(intermediate); + } + else +#endif + { + BOOST_PYTHON_LONG_LONG result = PyLong_AsLongLong(intermediate); + + if (PyErr_Occurred()) + throw_error_already_set(); + + return result; + } + } + }; + + struct unsigned_long_long_rvalue_from_python : long_long_rvalue_from_python_base + { + static unsigned BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) + { +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(intermediate)) + { + return numeric_cast(PyInt_AS_LONG(intermediate)); + } + else +#endif + { + unsigned BOOST_PYTHON_LONG_LONG result = PyLong_AsUnsignedLongLong(intermediate); + + if (PyErr_Occurred()) + throw_error_already_set(); + + return result; + } + } + }; +#endif + + // A SlotPolicy for extracting bool from a Python object + struct bool_rvalue_from_python + { + static unaryfunc* get_slot(PyObject* obj) + { +#if PY_VERSION_HEX >= 0x03000000 + return obj == Py_None || PyLong_Check(obj) ? &py_object_identity : 0; +#elif PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) + return obj == Py_None || PyBool_Check(obj) ? &py_object_identity : 0; +#else + return obj == Py_None || PyInt_Check(obj) ? &py_object_identity : 0; +#endif + } + + static bool extract(PyObject* intermediate) + { + return PyObject_IsTrue(intermediate); + } + + static PyTypeObject const* get_pytype() + { +#if PY_VERSION_HEX >= 0x02030000 + return &PyBool_Type; +#else + return &PyInt_Type; +#endif + } + }; + + // A SlotPolicy for extracting floating types from Python objects. + struct float_rvalue_from_python + { + static unaryfunc* get_slot(PyObject* obj) + { + PyNumberMethods* number_methods = obj->ob_type->tp_as_number; + if (number_methods == 0) + return 0; + + // For integer types, return the tp_int conversion slot to avoid + // creating a new object. We'll handle that below +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(obj)) + return &number_methods->nb_int; +#endif + + return (PyLong_Check(obj) || PyFloat_Check(obj)) + ? &number_methods->nb_float : 0; + } + + static double extract(PyObject* intermediate) + { +#if PY_VERSION_HEX < 0x03000000 + if (PyInt_Check(intermediate)) + { + return PyInt_AS_LONG(intermediate); + } + else +#endif + { + return PyFloat_AS_DOUBLE(intermediate); + } + } + static PyTypeObject const* get_pytype() { return &PyFloat_Type;} + }; + +#if PY_VERSION_HEX >= 0x03000000 + unaryfunc py_unicode_as_string_unaryfunc = PyUnicode_AsUTF8String; +#endif + + // A SlotPolicy for extracting C++ strings from Python objects. + struct string_rvalue_from_python + { + // If the underlying object is "string-able" this will succeed + static unaryfunc* get_slot(PyObject* obj) + { +#if PY_VERSION_HEX >= 0x03000000 + return (PyUnicode_Check(obj)) ? &py_unicode_as_string_unaryfunc : + PyBytes_Check(obj) ? &py_object_identity : 0; +#else + return (PyString_Check(obj)) ? &obj->ob_type->tp_str : 0; + +#endif + }; + + // Remember that this will be used to construct the result object +#if PY_VERSION_HEX >= 0x03000000 + static std::string extract(PyObject* intermediate) + { + return std::string(PyBytes_AsString(intermediate),PyBytes_Size(intermediate)); + } + static PyTypeObject const* get_pytype() { return &PyUnicode_Type;} +#else + static std::string extract(PyObject* intermediate) + { + return std::string(PyString_AsString(intermediate),PyString_Size(intermediate)); + } + static PyTypeObject const* get_pytype() { return &PyString_Type;} +#endif + }; + +#if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING) + // encode_string_unaryfunc/py_encode_string -- manufacture a unaryfunc + // "slot" which encodes a Python string using the default encoding + extern "C" PyObject* encode_string_unaryfunc(PyObject* x) + { + return PyUnicode_FromEncodedObject( x, 0, 0 ); + } + unaryfunc py_encode_string = encode_string_unaryfunc; + + // A SlotPolicy for extracting C++ strings from Python objects. + struct wstring_rvalue_from_python + { + // If the underlying object is "string-able" this will succeed + static unaryfunc* get_slot(PyObject* obj) + { + return PyUnicode_Check(obj) + ? &py_object_identity +#if PY_VERSION_HEX >= 0x03000000 + : PyBytes_Check(obj) +#else + : PyString_Check(obj) +#endif + ? &py_encode_string + : 0; + }; + + // Remember that this will be used to construct the result object + static std::wstring extract(PyObject* intermediate) + { + // On Windows, with Python >= 3.3, PyObject_Length cannot be used to get + // the size of the wchar_t string, because it will count the number of + // *code points*, but some characters not on the BMP will use two UTF-16 + // *code units* (surrogate pairs). + // This is not a problem on Unix, since wchar_t is 32-bit. +#if defined(_WIN32) && PY_VERSION_HEX >= 0x03030000 + BOOST_STATIC_ASSERT(sizeof(wchar_t) == 2); + + Py_ssize_t size = 0; + wchar_t *buf = PyUnicode_AsWideCharString(intermediate, &size); + if (buf == NULL) { + boost::python::throw_error_already_set(); + } + std::wstring result(buf, size); + PyMem_Free(buf); +#else + std::wstring result(::PyObject_Length(intermediate), L' '); + if (!result.empty()) + { + int err = PyUnicode_AsWideChar( +#if PY_VERSION_HEX < 0x03020000 + (PyUnicodeObject *) +#endif + intermediate + , &result[0] + , result.size()); + + if (err == -1) + throw_error_already_set(); + } +#endif + return result; + } + static PyTypeObject const* get_pytype() { return &PyUnicode_Type;} + }; +#endif + + struct complex_rvalue_from_python + { + static unaryfunc* get_slot(PyObject* obj) + { + if (PyComplex_Check(obj)) + return &py_object_identity; + else + return float_rvalue_from_python::get_slot(obj); + } + + static std::complex extract(PyObject* intermediate) + { + if (PyComplex_Check(intermediate)) + { + return std::complex( + PyComplex_RealAsDouble(intermediate) + , PyComplex_ImagAsDouble(intermediate)); + } +#if PY_VERSION_HEX < 0x03000000 + else if (PyInt_Check(intermediate)) + { + return PyInt_AS_LONG(intermediate); + } +#endif + else + { + return PyFloat_AS_DOUBLE(intermediate); + } + } + static PyTypeObject const* get_pytype() { return &PyComplex_Type;} + }; +} + +BOOST_PYTHON_DECL PyObject* do_return_to_python(char x) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromStringAndSize(&x, 1); +#else + return PyString_FromStringAndSize(&x, 1); +#endif +} + +BOOST_PYTHON_DECL PyObject* do_return_to_python(char const* x) +{ +#if PY_VERSION_HEX >= 0x03000000 + return x ? PyUnicode_FromString(x) : boost::python::detail::none(); +#else + return x ? PyString_FromString(x) : boost::python::detail::none(); +#endif +} + +BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject* x) +{ + return x ? x : boost::python::detail::none(); +} + +BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject* x) +{ + if (x == 0) + return boost::python::detail::none(); + + Py_INCREF(x); + return x; +} + +#define REGISTER_INT_CONVERTERS(signedness, U) \ + slot_rvalue_from_python< \ + signedness U \ + ,signedness##_int_rvalue_from_python \ + >() + +#define REGISTER_INT_CONVERTERS2(U) \ + REGISTER_INT_CONVERTERS(signed, U); \ + REGISTER_INT_CONVERTERS(unsigned, U) + +void initialize_builtin_converters() +{ + // booleans + slot_rvalue_from_python(); + + // integer types + REGISTER_INT_CONVERTERS2(char); + REGISTER_INT_CONVERTERS2(short); + REGISTER_INT_CONVERTERS2(int); + REGISTER_INT_CONVERTERS2(long); + +// using Python's macro instead of Boost's - we don't seem to get the +// config right all the time. +# ifdef HAVE_LONG_LONG + slot_rvalue_from_python(); + slot_rvalue_from_python(); +# endif + + // floating types + slot_rvalue_from_python(); + slot_rvalue_from_python(); + slot_rvalue_from_python(); + + slot_rvalue_from_python,complex_rvalue_from_python>(); + slot_rvalue_from_python,complex_rvalue_from_python>(); + slot_rvalue_from_python,complex_rvalue_from_python>(); + + // Add an lvalue converter for char which gets us char const* +#if PY_VERSION_HEX < 0x03000000 + registry::insert(convert_to_cstring,type_id(),&converter::wrap_pytype<&PyString_Type>::get_pytype); +#else + registry::insert(convert_to_cstring,type_id(),&converter::wrap_pytype<&PyUnicode_Type>::get_pytype); +#endif + + // Register by-value converters to std::string, std::wstring +#if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING) + slot_rvalue_from_python(); +# endif + slot_rvalue_from_python(); + +} + +}}} // namespace boost::python::converter diff --git a/pxr/external/boost/python/src/converter/from_python.cpp b/pxr/external/boost/python/src/converter/from_python.cpp new file mode 100644 index 0000000000..9678be1cb6 --- /dev/null +++ b/pxr/external/boost/python/src/converter/from_python.cpp @@ -0,0 +1,303 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +namespace boost { namespace python { namespace converter { + +// rvalue_from_python_stage1 -- do the first stage of a conversion +// from a Python object to a C++ rvalue. +// +// source - the Python object to be converted +// converters - the registry entry for the target type T +// +// Postcondition: where x is the result, one of: +// +// 1. x.convertible == 0, indicating failure +// +// 2. x.construct == 0, x.convertible is the address of an object of +// type T. Indicates a successful lvalue conversion +// +// 3. where y is of type rvalue_from_python_data, +// x.construct(source, y) constructs an object of type T +// in y.storage.bytes and then sets y.convertible == y.storage.bytes, +// or else throws an exception and has no effect. +BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( + PyObject* source + , registration const& converters) +{ + rvalue_from_python_stage1_data data; + + // First check to see if it's embedded in an extension class + // instance, as a special case. + data.convertible = objects::find_instance_impl(source, converters.target_type, converters.is_shared_ptr); + data.construct = 0; + if (!data.convertible) + { + for (rvalue_from_python_chain const* chain = converters.rvalue_chain; + chain != 0; + chain = chain->next) + { + void* r = chain->convertible(source); + if (r != 0) + { + data.convertible = r; + data.construct = chain->construct; + break; + } + } + } + return data; +} + +// rvalue_result_from_python -- return the address of a C++ object which +// can be used as the result of calling a Python function. +// +// src - the Python object to be converted +// +// data - a reference to the base part of a +// rvalue_from_python_data object, where T is the +// target type of the conversion. +// +// Requires: data.convertible == ®istered::converters +// +BOOST_PYTHON_DECL void* rvalue_result_from_python( + PyObject* src, rvalue_from_python_stage1_data& data) +{ + // Retrieve the registration + // Cast in two steps for less-capable compilers + void const* converters_ = data.convertible; + registration const& converters = *static_cast(converters_); + + // Look for an eligible converter + data = rvalue_from_python_stage1(src, converters); + return rvalue_from_python_stage2(src, data, converters); +} + +BOOST_PYTHON_DECL void* rvalue_from_python_stage2( + PyObject* source, rvalue_from_python_stage1_data& data, registration const& converters) +{ + if (!data.convertible) + { + handle<> msg( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromFormat +#else + ::PyString_FromFormat +#endif + ( + "No registered converter was able to produce a C++ rvalue of type %s from this Python object of type %s" + , converters.target_type.name() + , source->ob_type->tp_name + )); + + PyErr_SetObject(PyExc_TypeError, msg.get()); + throw_error_already_set(); + } + + // If a construct function was registered (i.e. we found an + // rvalue conversion), call it now. + if (data.construct != 0) + data.construct(source, &data); + + // Return the address of the resulting C++ object + return data.convertible; +} + +BOOST_PYTHON_DECL void* get_lvalue_from_python( + PyObject* source + , registration const& converters) +{ + // Check to see if it's embedded in a class instance + void* x = objects::find_instance_impl(source, converters.target_type); + if (x) + return x; + + lvalue_from_python_chain const* chain = converters.lvalue_chain; + for (;chain != 0; chain = chain->next) + { + void* r = chain->convert(source); + if (r != 0) + return r; + } + return 0; +} + +namespace +{ + // Prevent looping in implicit conversions. This could/should be + // much more efficient, but will work for now. + typedef std::vector visited_t; + static visited_t visited; + + inline bool visit(rvalue_from_python_chain const* chain) + { + visited_t::iterator const p = std::lower_bound(visited.begin(), visited.end(), chain); + if (p != visited.end() && *p == chain) + return false; + visited.insert(p, chain); + return true; + } + + // RAII class for managing global visited marks. + struct unvisit + { + unvisit(rvalue_from_python_chain const* chain) + : chain(chain) {} + + ~unvisit() + { + visited_t::iterator const p = std::lower_bound(visited.begin(), visited.end(), chain); + assert(p != visited.end()); + visited.erase(p); + } + private: + rvalue_from_python_chain const* chain; + }; +} + + +BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( + PyObject* source + , registration const& converters) +{ + if (objects::find_instance_impl(source, converters.target_type)) + return true; + + rvalue_from_python_chain const* chain = converters.rvalue_chain; + + if (!visit(chain)) + return false; + + unvisit protect(chain); + + for (;chain != 0; chain = chain->next) + { + if (chain->convertible(source)) + return true; + } + + return false; +} + +namespace +{ + void throw_no_lvalue_from_python(PyObject* source, registration const& converters, char const* ref_type) + { + handle<> msg( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromFormat +#else + ::PyString_FromFormat +#endif + ( + "No registered converter was able to extract a C++ %s to type %s" + " from this Python object of type %s" + , ref_type + , converters.target_type.name() + , source->ob_type->tp_name + )); + + PyErr_SetObject(PyExc_TypeError, msg.get()); + + throw_error_already_set(); + } + + void* lvalue_result_from_python( + PyObject* source + , registration const& converters + , char const* ref_type) + { + handle<> holder(source); + if (source->ob_refcnt <= 1) + { + handle<> msg( +#if PY_VERSION_HEX >= 0x3000000 + ::PyUnicode_FromFormat +#else + ::PyString_FromFormat +#endif + ( + "Attempt to return dangling %s to object of type: %s" + , ref_type + , converters.target_type.name())); + + PyErr_SetObject(PyExc_ReferenceError, msg.get()); + + throw_error_already_set(); + } + + void* result = get_lvalue_from_python(source, converters); + if (!result) + (throw_no_lvalue_from_python)(source, converters, ref_type); + return result; + } + +} + +BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject* source, registration const& converters) +{ + (throw_no_lvalue_from_python)(source, converters, "pointer"); +} + +BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject* source, registration const& converters) +{ + (throw_no_lvalue_from_python)(source, converters, "reference"); +} + +BOOST_PYTHON_DECL void* reference_result_from_python( + PyObject* source + , registration const& converters) +{ + return (lvalue_result_from_python)(source, converters, "reference"); +} + +BOOST_PYTHON_DECL void* pointer_result_from_python( + PyObject* source + , registration const& converters) +{ + if (source == Py_None) + { + Py_DECREF(source); + return 0; + } + return (lvalue_result_from_python)(source, converters, "pointer"); +} + +BOOST_PYTHON_DECL void void_result_from_python(PyObject* o) +{ + Py_DECREF(expect_non_null(o)); +} + +} // namespace boost::python::converter + +BOOST_PYTHON_DECL PyObject* +pytype_check(PyTypeObject* type_, PyObject* source) +{ + if (!PyObject_IsInstance(source, python::upcast(type_))) + { + ::PyErr_Format( + PyExc_TypeError + , "Expecting an object of type %s; got an object of type %s instead" + , type_->tp_name + , source->ob_type->tp_name + ); + throw_error_already_set(); + } + return source; +} + +}} // namespace boost::python diff --git a/pxr/external/boost/python/src/converter/registry.cpp b/pxr/external/boost/python/src/converter/registry.cpp new file mode 100644 index 0000000000..aa20c3f685 --- /dev/null +++ b/pxr/external/boost/python/src/converter/registry.cpp @@ -0,0 +1,306 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) && defined(__GNUC__) \ + && __GNUC__ == 3 && __GNUC_MINOR__ <= 4 && !defined(__APPLE_CC__) +# define BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND +#endif + +#if defined(BOOST_PYTHON_TRACE_REGISTRY) \ + || defined(BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) +# include +#endif + +namespace boost { namespace python { namespace converter { +BOOST_PYTHON_DECL PyTypeObject const* registration::expected_from_python_type() const +{ + if (this->m_class_object != 0) + return this->m_class_object; + + std::set pool; + + for(rvalue_from_python_chain* r = rvalue_chain; r ; r=r->next) + if(r->expected_pytype) + pool.insert(r->expected_pytype()); + + //for now I skip the search for common base + if (pool.size()==1) + return *pool.begin(); + + return 0; + +} + +BOOST_PYTHON_DECL PyTypeObject const* registration::to_python_target_type() const +{ + if (this->m_class_object != 0) + return this->m_class_object; + + if (this->m_to_python_target_type != 0) + return this->m_to_python_target_type(); + + return 0; +} + +BOOST_PYTHON_DECL PyTypeObject* registration::get_class_object() const +{ + if (this->m_class_object == 0) + { + ::PyErr_Format( + PyExc_TypeError + , const_cast("No Python class registered for C++ class %s") + , this->target_type.name()); + + throw_error_already_set(); + } + + return this->m_class_object; +} + +BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source) const +{ + if (this->m_to_python == 0) + { + handle<> msg( +#if PY_VERSION_HEX >= 0x3000000 + ::PyUnicode_FromFormat +#else + ::PyString_FromFormat +#endif + ( + "No to_python (by-value) converter found for C++ type: %s" + , this->target_type.name() + ) + ); + + PyErr_SetObject(PyExc_TypeError, msg.get()); + + throw_error_already_set(); + } + + return source == 0 + ? incref(Py_None) + : this->m_to_python(const_cast(source)); +} + +namespace +{ + template< typename T > + void delete_node( T* node ) + { + if( !!node && !!node->next ) + delete_node( node->next ); + delete node; + } +} + +registration::~registration() +{ + delete_node(lvalue_chain); + delete_node(rvalue_chain); +} + + +namespace // +{ + typedef registration entry; + + typedef std::set registry_t; + +#ifndef BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND + registry_t& entries() + { + static registry_t registry; + +# ifndef BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION + static bool builtin_converters_initialized = false; + if (!builtin_converters_initialized) + { + // Make this true early because registering the builtin + // converters will cause recursion. + builtin_converters_initialized = true; + + initialize_builtin_converters(); + } +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "registry: "; + for (registry_t::iterator p = registry.begin(); p != registry.end(); ++p) + { + std::cout << p->target_type << "; "; + } + std::cout << '\n'; +# endif +# endif + return registry; + } +#else + registry_t& static_registry() + { + static registry_t result; + return result; + } + + bool static_builtin_converters_initialized() + { + static bool result = false; + if (result == false) { + result = true; + std::cout << std::flush; + return false; + } + return true; + } + + registry_t& entries() + { +# ifndef BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION + if (!static_builtin_converters_initialized()) + { + initialize_builtin_converters(); + } +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "registry: "; + for (registry_t::iterator p = static_registry().begin(); p != static_registry().end(); ++p) + { + std::cout << p->target_type << "; "; + } + std::cout << '\n'; +# endif +# endif + return static_registry(); + } +#endif // BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND + + entry* get(type_info type, bool is_shared_ptr = false) + { +# ifdef BOOST_PYTHON_TRACE_REGISTRY + registry_t::iterator p = entries().find(entry(type)); + + std::cout << "looking up " << type << ": " + << (p == entries().end() || p->target_type != type + ? "...NOT found\n" : "...found\n"); +# endif + std::pair pos_ins + = entries().insert(entry(type,is_shared_ptr)); + +# if __MWERKS__ >= 0x3000 + // do a little invariant checking if a change was made + if ( pos_ins.second ) + assert(entries().invariants()); +# endif + return const_cast(&*pos_ins.first); + } +} // namespace + +namespace registry +{ + void insert(to_python_function_t f, type_info source_t, PyTypeObject const* (*to_python_target_type)()) + { +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "inserting to_python " << source_t << "\n"; +# endif + entry* slot = get(source_t); + + assert(slot->m_to_python == 0); // we have a problem otherwise + if (slot->m_to_python != 0) + { + std::string msg = ( + std::string("to-Python converter for ") + + source_t.name() + + " already registered; second conversion method ignored." + ); + + if ( ::PyErr_Warn( NULL, const_cast(msg.c_str()) ) ) + { + throw_error_already_set(); + } + } + slot->m_to_python = f; + slot->m_to_python_target_type = to_python_target_type; + } + + // Insert an lvalue from_python converter + void insert(convertible_function convert, type_info key, PyTypeObject const* (*exp_pytype)()) + { +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "inserting lvalue from_python " << key << "\n"; +# endif + entry* found = get(key); + lvalue_from_python_chain *registration = new lvalue_from_python_chain; + registration->convert = convert; + registration->next = found->lvalue_chain; + found->lvalue_chain = registration; + + insert(convert, 0, key,exp_pytype); + } + + // Insert an rvalue from_python converter + void insert(convertible_function convertible + , constructor_function construct + , type_info key + , PyTypeObject const* (*exp_pytype)()) + { +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "inserting rvalue from_python " << key << "\n"; +# endif + entry* found = get(key); + rvalue_from_python_chain *registration = new rvalue_from_python_chain; + registration->convertible = convertible; + registration->construct = construct; + registration->expected_pytype = exp_pytype; + registration->next = found->rvalue_chain; + found->rvalue_chain = registration; + } + + // Insert an rvalue from_python converter + void push_back(convertible_function convertible + , constructor_function construct + , type_info key + , PyTypeObject const* (*exp_pytype)()) + { +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "push_back rvalue from_python " << key << "\n"; +# endif + rvalue_from_python_chain** found = &get(key)->rvalue_chain; + while (*found != 0) + found = &(*found)->next; + + rvalue_from_python_chain *registration = new rvalue_from_python_chain; + registration->convertible = convertible; + registration->construct = construct; + registration->expected_pytype = exp_pytype; + registration->next = 0; + *found = registration; + } + + registration const& lookup(type_info key) + { + return *get(key); + } + + registration const& lookup_shared_ptr(type_info key) + { + return *get(key, true); + } + + registration const* query(type_info type) + { + registry_t::iterator p = entries().find(entry(type)); +# ifdef BOOST_PYTHON_TRACE_REGISTRY + std::cout << "querying " << type + << (p == entries().end() || p->target_type != type + ? "...NOT found\n" : "...found\n"); +# endif + return (p == entries().end() || p->target_type != type) ? 0 : &*p; + } +} // namespace registry + +}}} // namespace boost::python::converter diff --git a/pxr/external/boost/python/src/converter/type_id.cpp b/pxr/external/boost/python/src/converter/type_id.cpp new file mode 100644 index 0000000000..c6a8bf7a04 --- /dev/null +++ b/pxr/external/boost/python/src/converter/type_id.cpp @@ -0,0 +1,212 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__QNXNTO__) +# include +#else /* defined(__QNXNTO__) */ + +#if !defined(__GNUC__) || __GNUC__ >= 3 || __SGI_STL_PORT || __EDG_VERSION__ +# include +#else +# include +#endif + +# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# if defined(__GNUC__) && __GNUC__ >= 3 + +// http://lists.debian.org/debian-gcc/2003/09/msg00055.html notes +// that, in cxxabi.h of gcc-3.x for x < 4, this type is used before it +// is declared. +# if __GNUC__ == 3 && __GNUC_MINOR__ < 4 +class __class_type_info; +# endif + +# include +# endif +# endif +#endif /* defined(__QNXNTO__) */ + +namespace boost { namespace python { + +# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE + +# if defined(__QNXNTO__) +namespace cxxabi { +extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*); +} +# else /* defined(__QNXNTO__) */ + +# ifdef __GNUC__ +# if __GNUC__ < 3 + +namespace cxxabi = :: ; +extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*); +# else + +namespace cxxabi = ::abi; // GCC 3.1 and later + +# if __GNUC__ == 3 && __GNUC_MINOR__ == 0 +namespace abi +{ + extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*); +} +# endif /* __GNUC__ == 3 && __GNUC_MINOR__ == 0 */ +# endif /* __GNUC__ < 3 */ +# endif /* __GNUC__ */ +# endif /* defined(__QNXNTO__) */ + +namespace +{ + struct compare_first_cstring + { + template + bool operator()(T const& x, T const& y) + { + return std::strcmp(x.first,y.first) < 0; + } + }; + + struct free_mem + { + free_mem(char*p) + : p(p) {} + + ~free_mem() + { + std::free(p); + } + char* p; + }; +} + +bool cxxabi_cxa_demangle_is_broken() +{ + static bool was_tested = false; + static bool is_broken = false; + if (!was_tested) { + int status; + free_mem keeper(cxxabi::__cxa_demangle("b", 0, 0, &status)); + was_tested = true; + if (status == -2 || strcmp(keeper.p, "bool") != 0) { + is_broken = true; + } + } + return is_broken; +} + +namespace detail +{ + BOOST_PYTHON_DECL char const* gcc_demangle(char const* mangled) + { + typedef std::vector< + std::pair + > mangling_map; + + static mangling_map demangler; + mangling_map::iterator p + = std::lower_bound( + demangler.begin(), demangler.end() + , std::make_pair(mangled, (char const*)0) + , compare_first_cstring()); + + if (p == demangler.end() || strcmp(p->first, mangled)) + { + int status; + free_mem keeper( + cxxabi::__cxa_demangle(mangled, 0, 0, &status) + ); + + assert(status != -3); // invalid argument error + + if (status == -1) + { + throw std::bad_alloc(); + } + else + { + char const* demangled + = status == -2 + // Invalid mangled name. Best we can do is to + // return it intact. + ? mangled + : keeper.p; + + // Ult Mundane, 2005 Aug 17 + // Contributed under the Boost Software License, Version 1.0. + // (See accompanying file LICENSE_1_0.txt or copy at + // http://www.boost.org/LICENSE_1_0.txt) + // The __cxa_demangle function is supposed to translate + // builtin types from their one-character mangled names, + // but it doesn't in gcc 3.3.5 and gcc 3.4.x. + if (cxxabi_cxa_demangle_is_broken() + && status == -2 && strlen(mangled) == 1) + { + // list from + // http://www.codesourcery.com/cxx-abi/abi.html + switch (mangled[0]) + { + case 'v': demangled = "void"; break; + case 'w': demangled = "wchar_t"; break; + case 'b': demangled = "bool"; break; + case 'c': demangled = "char"; break; + case 'a': demangled = "signed char"; break; + case 'h': demangled = "unsigned char"; break; + case 's': demangled = "short"; break; + case 't': demangled = "unsigned short"; break; + case 'i': demangled = "int"; break; + case 'j': demangled = "unsigned int"; break; + case 'l': demangled = "long"; break; + case 'm': demangled = "unsigned long"; break; + case 'x': demangled = "long long"; break; + case 'y': demangled = "unsigned long long"; break; + case 'n': demangled = "__int128"; break; + case 'o': demangled = "unsigned __int128"; break; + case 'f': demangled = "float"; break; + case 'd': demangled = "double"; break; + case 'e': demangled = "long double"; break; + case 'g': demangled = "__float128"; break; + case 'z': demangled = "..."; break; + } + } + + p = demangler.insert(p, std::make_pair(mangled, demangled)); + keeper.p = 0; + } + } + + return p->second; + } +} +# endif + +BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, type_info const& x) +{ + return os << x.name(); +} + +namespace detail +{ + BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, detail::decorated_type_info const& x) + { + os << x.m_base_type; + if (x.m_decoration & decorated_type_info::const_) + os << " const"; + if (x.m_decoration & decorated_type_info::volatile_) + os << " volatile"; + if (x.m_decoration & decorated_type_info::reference) + os << "&"; + return os; + } +} +}} // namespace boost::python::converter diff --git a/pxr/external/boost/python/src/dict.cpp b/pxr/external/boost/python/src/dict.cpp new file mode 100644 index 0000000000..77d840d455 --- /dev/null +++ b/pxr/external/boost/python/src/dict.cpp @@ -0,0 +1,184 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include + +namespace boost { namespace python { namespace detail { +namespace +{ + // When returning list objects from methods, it may turn out that the + // derived class is returning something else, perhaps something not + // even derived from list. Since it is generally harmless for a + // Boost.Python wrapper object to hold an object of a different + // type, and because calling list() with an object may in fact + // perform a conversion, the least-bad alternative is to assume that + // we have a Python list object and stuff it into the list result. + list assume_list(object const& o) + { + return list(detail::borrowed_reference(o.ptr())); + } + + // No PyDict_CheckExact; roll our own. + inline bool check_exact(dict_base const* p) + { + return p->ptr()->ob_type == &PyDict_Type; + } +} + +detail::new_reference dict_base::call(object const& arg_) +{ + return (detail::new_reference)PyObject_CallFunction( + (PyObject*)&PyDict_Type, const_cast("(O)"), + arg_.ptr()); +} + +dict_base::dict_base() + : object(detail::new_reference(PyDict_New())) +{} + +dict_base::dict_base(object_cref data) + : object(call(data)) +{} + +void dict_base::clear() +{ + if (check_exact(this)) + PyDict_Clear(this->ptr()); + else + this->attr("clear")(); +} + +dict dict_base::copy() +{ + if (check_exact(this)) + { + return dict(detail::new_reference( + PyDict_Copy(this->ptr()))); + } + else + { + return dict(detail::borrowed_reference( + this->attr("copy")().ptr() + )); + } +} + +object dict_base::get(object_cref k) const +{ + if (check_exact(this)) + { + PyObject* result = PyDict_GetItem(this->ptr(),k.ptr()); + return object(detail::borrowed_reference(result ? result : Py_None)); + } + else + { + return this->attr("get")(k); + } +} + +object dict_base::get(object_cref k, object_cref d) const +{ + return this->attr("get")(k,d); +} + +bool dict_base::has_key(object_cref k) const +{ + return extract(this->contains(k)); +} + +list dict_base::items() const +{ + if (check_exact(this)) + { + return list(detail::new_reference( + PyDict_Items(this->ptr()))); + } + else + { + return assume_list(this->attr("items")()); + } +} + +object dict_base::iteritems() const +{ + return this->attr("iteritems")(); +} + +object dict_base::iterkeys() const +{ + return this->attr("iterkeys")(); +} + +object dict_base::itervalues() const +{ + return this->attr("itervalues")(); +} + +list dict_base::keys() const +{ + if (check_exact(this)) + { + return list(detail::new_reference( + PyDict_Keys(this->ptr()))); + } + else + { + return assume_list(this->attr("keys")()); + } +} + +tuple dict_base::popitem() +{ + return tuple(detail::borrowed_reference( + this->attr("popitem")().ptr() + )); +} + +object dict_base::setdefault(object_cref k) +{ + return this->attr("setdefault")(k); +} + +object dict_base::setdefault(object_cref k, object_cref d) +{ + return this->attr("setdefault")(k,d); +} + +void dict_base::update(object_cref other) +{ + if (check_exact(this)) + { + if (PyDict_Update(this->ptr(),other.ptr()) == -1) + throw_error_already_set(); + } + else + { + this->attr("update")(other); + } +} + +list dict_base::values() const +{ + if (check_exact(this)) + { + return list(detail::new_reference( + PyDict_Values(this->ptr()))); + } + else + { + return assume_list(this->attr("values")()); + } +} + +static struct register_dict_pytype_ptr +{ + register_dict_pytype_ptr() + { + const_cast( + converter::registry::lookup(boost::python::type_id()) + ).m_class_object = &PyDict_Type; + } +}register_dict_pytype_ptr_; + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/errors.cpp b/pxr/external/boost/python/src/errors.cpp new file mode 100644 index 0000000000..34ea22f43e --- /dev/null +++ b/pxr/external/boost/python/src/errors.cpp @@ -0,0 +1,105 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_PYTHON_SOURCE +# define BOOST_PYTHON_SOURCE +#endif + +#include +#include +#include + +namespace boost { namespace python { + +error_already_set::~error_already_set() {} + +// IMPORTANT: this function may only be called from within a catch block! +BOOST_PYTHON_DECL bool handle_exception_impl(function0 f) +{ + try + { + if (detail::exception_handler::chain) + return detail::exception_handler::chain->handle(f); + f(); + return false; + } + catch(const boost::python::error_already_set&) + { + // The python error reporting has already been handled. + } + catch(const std::bad_alloc&) + { + PyErr_NoMemory(); + } + catch(const bad_numeric_cast& x) + { + PyErr_SetString(PyExc_OverflowError, x.what()); + } + catch(const std::out_of_range& x) + { + PyErr_SetString(PyExc_IndexError, x.what()); + } + catch(const std::invalid_argument& x) + { + PyErr_SetString(PyExc_ValueError, x.what()); + } + catch(const std::exception& x) + { + PyErr_SetString(PyExc_RuntimeError, x.what()); + } + catch(...) + { + PyErr_SetString(PyExc_RuntimeError, "unidentifiable C++ exception"); + } + return true; +} + +void BOOST_PYTHON_DECL throw_error_already_set() +{ + throw error_already_set(); +} + +namespace detail { + +bool exception_handler::operator()(function0 const& f) const +{ + if (m_next) + { + return m_next->handle(f); + } + else + { + f(); + return false; + } +} + +exception_handler::exception_handler(handler_function const& impl) + : m_impl(impl) + , m_next(0) +{ + if (chain != 0) + tail->m_next = this; + else + chain = this; + tail = this; +} + +exception_handler* exception_handler::chain; +exception_handler* exception_handler::tail; + +BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f) +{ + // the constructor links the new object into a handler chain, so + // this object isn't actaully leaked (until, of course, the + // interpreter exits). + new exception_handler(f); +} + +} // namespace boost::python::detail + +}} // namespace boost::python + + diff --git a/pxr/external/boost/python/src/exec.cpp b/pxr/external/boost/python/src/exec.cpp new file mode 100644 index 0000000000..7488da1f6d --- /dev/null +++ b/pxr/external/boost/python/src/exec.cpp @@ -0,0 +1,138 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +namespace boost +{ +namespace python +{ + +object BOOST_PYTHON_DECL eval(str string, object global, object local) +{ + return eval(python::extract(string), global, local); +} + +object BOOST_PYTHON_DECL eval(char const *string, object global, object local) +{ + // Set suitable default values for global and local dicts. + if (global.is_none()) + { + if (PyObject *g = PyEval_GetGlobals()) + global = object(detail::borrowed_reference(g)); + else + global = dict(); + } + if (local.is_none()) local = global; + // should be 'char const *' but older python versions don't use 'const' yet. + char *s = const_cast(string); + PyObject* result = PyRun_String(s, Py_eval_input, global.ptr(), local.ptr()); + if (!result) throw_error_already_set(); + return object(detail::new_reference(result)); +} + +object BOOST_PYTHON_DECL exec(str string, object global, object local) +{ + return exec(python::extract(string), global, local); +} + +object BOOST_PYTHON_DECL exec(char const *string, object global, object local) +{ + // Set suitable default values for global and local dicts. + if (global.is_none()) + { + if (PyObject *g = PyEval_GetGlobals()) + global = object(detail::borrowed_reference(g)); + else + global = dict(); + } + if (local.is_none()) local = global; + // should be 'char const *' but older python versions don't use 'const' yet. + char *s = const_cast(string); + PyObject* result = PyRun_String(s, Py_file_input, global.ptr(), local.ptr()); + if (!result) throw_error_already_set(); + return object(detail::new_reference(result)); +} + +object BOOST_PYTHON_DECL exec_statement(str string, object global, object local) +{ + return exec_statement(python::extract(string), global, local); +} + +object BOOST_PYTHON_DECL exec_statement(char const *string, object global, object local) +{ + // Set suitable default values for global and local dicts. + if (global.is_none()) + { + if (PyObject *g = PyEval_GetGlobals()) + global = object(detail::borrowed_reference(g)); + else + global = dict(); + } + if (local.is_none()) local = global; + // should be 'char const *' but older python versions don't use 'const' yet. + char *s = const_cast(string); + PyObject* result = PyRun_String(s, Py_single_input, global.ptr(), local.ptr()); + if (!result) throw_error_already_set(); + return object(detail::new_reference(result)); +} + +// Execute python source code from file filename. +// global and local are the global and local scopes respectively, +// used during execution. +object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) +{ + return exec_file(python::extract(filename), global, local); +} + +object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object local) +{ + // Set suitable default values for global and local dicts. + if (global.is_none()) + { + if (PyObject *g = PyEval_GetGlobals()) + global = object(detail::borrowed_reference(g)); + else + global = dict(); + } + if (local.is_none()) local = global; + // should be 'char const *' but older python versions don't use 'const' yet. + char *f = const_cast(filename); +#if PY_VERSION_HEX >= 0x03010000 + // Let python manage any UTF bits to avoid potential incompatibilities. + PyObject *fo = Py_BuildValue("s", f); + PyObject *fb = Py_None; + PyUnicode_FSConverter(fo, &fb); + char *f_as_uft = PyBytes_AsString(fb); + FILE *fs = fopen(f_as_uft, "r"); + Py_DECREF(fo); + Py_DECREF(fb); +#elif PY_VERSION_HEX >= 0x03000000 + // Let python open the file to avoid potential binary incompatibilities. + PyObject *fo = Py_BuildValue("s", f); + FILE *fs = fopen(fo, "r"); + Py_DECREF(fo); +#else + // Let python open the file to avoid potential binary incompatibilities. + PyObject *pyfile = PyFile_FromString(f, const_cast("r")); + if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file"); + python::handle<> file(pyfile); + FILE *fs = PyFile_AsFile(file.get()); +#endif + PyObject* result = PyRun_File(fs, + f, + Py_file_input, + global.ptr(), local.ptr()); + fclose(fs); + if (!result) throw_error_already_set(); + return object(detail::new_reference(result)); +} + +} // namespace boost::python +} // namespace boost diff --git a/pxr/external/boost/python/src/fabscript b/pxr/external/boost/python/src/fabscript new file mode 100644 index 0000000000..0ebeac6098 --- /dev/null +++ b/pxr/external/boost/python/src/fabscript @@ -0,0 +1,58 @@ +# -*- python -*- +# +# Copyright (c) 2016 Stefan Seefeld +# All rights reserved. +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +from faber.feature import set +from faber.artefacts.library import library +from faber.tools.compiler import define + +root = module('..') + +bpl = library('boost_python' + root.py_suffix, + ['list.cpp', + 'long.cpp', + 'dict.cpp', + 'tuple.cpp', + 'str.cpp', + 'slice.cpp', + 'converter/from_python.cpp', + 'converter/registry.cpp', + 'converter/type_id.cpp', + 'object/enum.cpp', + 'object/class.cpp', + 'object/function.cpp', + 'object/inheritance.cpp', + 'object/life_support.cpp', + 'object/pickle_support.cpp', + 'errors.cpp', + 'module.cpp', + 'converter/builtin_converters.cpp', + 'converter/arg_to_python_base.cpp', + 'object/iterator.cpp', + 'object/stl_iterator.cpp', + 'object_protocol.cpp', + 'object_operators.cpp', + 'wrapper.cpp', + 'import.cpp', + 'exec.cpp', + 'object/function_doc_signature.cpp'], + dependencies=root.config, + features=features + define('BOOST_PYTHON_SOURCE')) + +bnl = library('boost_numpy' + root.py_suffix, + ['numpy/dtype.cpp', + 'numpy/matrix.cpp', + 'numpy/ndarray.cpp', + 'numpy/numpy.cpp', + 'numpy/scalars.cpp', + 'numpy/ufunc.cpp', + bpl], + dependencies=root.config, + features=features + define('BOOST_NUMPY_SOURCE'), + condition=set.define.contains('HAS_NUMPY')) +default = [bpl, bnl] diff --git a/pxr/external/boost/python/src/import.cpp b/pxr/external/boost/python/src/import.cpp new file mode 100644 index 0000000000..0add79eea2 --- /dev/null +++ b/pxr/external/boost/python/src/import.cpp @@ -0,0 +1,25 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +namespace boost +{ +namespace python +{ + +object BOOST_PYTHON_DECL import(str name) +{ + // should be 'char const *' but older python versions don't use 'const' yet. + char *n = python::extract(name); + python::handle<> module(PyImport_ImportModule(n)); + return python::object(module); +} + +} // namespace boost::python +} // namespace boost diff --git a/pxr/external/boost/python/src/list.cpp b/pxr/external/boost/python/src/list.cpp new file mode 100644 index 0000000000..77e616881a --- /dev/null +++ b/pxr/external/boost/python/src/list.cpp @@ -0,0 +1,170 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include + +namespace boost { namespace python { namespace detail { + + +detail::new_non_null_reference list_base::call(object const& arg_) +{ + return (detail::new_non_null_reference) + (expect_non_null)( + PyObject_CallFunction( + (PyObject*)&PyList_Type, const_cast("(O)"), + arg_.ptr())); +} + +list_base::list_base() + : object(detail::new_reference(PyList_New(0))) +{} + +list_base::list_base(object_cref sequence) + : object(list_base::call(sequence)) +{} + +void list_base::append(object_cref x) +{ + if (PyList_CheckExact(this->ptr())) + { + if (PyList_Append(this->ptr(), x.ptr()) == -1) + throw_error_already_set(); + } + else + { + this->attr("append")(x); + } +} + +//long list_base::count(object_cref value) const; + +void list_base::extend(object_cref sequence) +{ + this->attr("extend")(sequence); +} + +long list_base::index(object_cref value) const +{ + object result_obj(this->attr("index")(value)); +#if PY_VERSION_HEX >= 0x03000000 + ssize_t result = PyLong_AsSsize_t(result_obj.ptr()); +#else + long result = PyInt_AsLong(result_obj.ptr()); +#endif + if (result == -1) + throw_error_already_set(); + return result; +} + +void list_base::insert(ssize_t index, object_cref item) +{ + if (PyList_CheckExact(this->ptr())) + { + if (PyList_Insert(this->ptr(), index, item.ptr()) == -1) + throw_error_already_set(); + } + else + { + this->attr("insert")(index, item); + } +} + +void list_base::insert(object const& index, object_cref x) +{ +#if PY_VERSION_HEX >= 0x03000000 + ssize_t index_ = PyLong_AsSsize_t(index.ptr()); +#else + long index_ = PyInt_AsLong(index.ptr()); +#endif + if (index_ == -1 && PyErr_Occurred()) + throw_error_already_set(); + this->insert(index_, x); +} + +object list_base::pop() +{ + return this->attr("pop")(); +} + +object list_base::pop(ssize_t index) +{ + return this->pop(object(index)); +} + +object list_base::pop(object const& index) +{ + return this->attr("pop")(index); +} + +void list_base::remove(object_cref value) +{ + this->attr("remove")(value); +} + +void list_base::reverse() +{ + if (PyList_CheckExact(this->ptr())) + { + if (PyList_Reverse(this->ptr()) == -1) + throw_error_already_set(); + } + else + { + this->attr("reverse")(); + } +} + +void list_base::sort() +{ + if (PyList_CheckExact(this->ptr())) + { + if (PyList_Sort(this->ptr()) == -1) + throw_error_already_set(); + } + else + { + this->attr("sort")(); + } +} + +#if PY_VERSION_HEX >= 0x03000000 +void list_base::sort(args_proxy const &args, + kwds_proxy const &kwds) +{ + this->attr("sort")(args, kwds); +} +#else +void list_base::sort(object_cref cmpfunc) +{ + this->attr("sort")(cmpfunc); +} +#endif + +// For some reason, moving this to the end of the TU suppresses an ICE +// with vc6. +ssize_t list_base::count(object_cref value) const +{ + object result_obj(this->attr("count")(value)); +#if PY_VERSION_HEX >= 0x03000000 + ssize_t result = PyLong_AsSsize_t(result_obj.ptr()); +#else + long result = PyInt_AsLong(result_obj.ptr()); +#endif + if (result == -1) + throw_error_already_set(); + return result; +} + +static struct register_list_pytype_ptr +{ + register_list_pytype_ptr() + { + const_cast( + converter::registry::lookup(boost::python::type_id()) + ).m_class_object = &PyList_Type; + } +}register_list_pytype_ptr_; + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/long.cpp b/pxr/external/boost/python/src/long.cpp new file mode 100644 index 0000000000..6aa2965e83 --- /dev/null +++ b/pxr/external/boost/python/src/long.cpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include + +namespace boost { namespace python { namespace detail { + +new_reference long_base::call(object const& arg_) +{ + return (detail::new_reference)PyObject_CallFunction( + (PyObject*)&PyLong_Type, const_cast("(O)"), + arg_.ptr()); +} + +new_reference long_base::call(object const& arg_, object const& base) +{ + return (detail::new_reference)PyObject_CallFunction( + (PyObject*)&PyLong_Type, const_cast("(OO)"), + arg_.ptr(), base.ptr()); +} + +long_base::long_base() + : object( + detail::new_reference( + PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast("()"))) + ) +{} + +long_base::long_base(object_cref arg) + : object(long_base::call(arg)) +{} + +long_base::long_base(object_cref arg, object_cref base) + : object(long_base::call(arg, base)) +{} + + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/module.cpp b/pxr/external/boost/python/src/module.cpp new file mode 100644 index 0000000000..57675fa2df --- /dev/null +++ b/pxr/external/boost/python/src/module.cpp @@ -0,0 +1,73 @@ +// (C) Copyright David Abrahams 2000. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// The author gratefully acknowleges the support of Dragon Systems, Inc., in +// producing this work. + +#include +#include + +namespace boost { namespace python { namespace detail { + +namespace +{ + PyObject* init_module_in_scope(PyObject* m, void(*init_function)()) + { + if (m != 0) + { + // Create the current module scope + object m_obj(((borrowed_reference_t*)m)); + scope current_module(m_obj); + + if (handle_exception(init_function)) return NULL; + } + + return m; + } +} + +BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char const* doc) +{ + // Use function::add_to_namespace to achieve overloading if + // appropriate. + scope current; + objects::add_to_namespace(current, name, x, doc); +} + +#if PY_VERSION_HEX >= 0x03000000 + +BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef& moduledef, void(*init_function)()) +{ + return init_module_in_scope( + PyModule_Create(&moduledef), + init_function); +} + +#else + +namespace +{ + PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; +} + +BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*init_function)()) +{ + return init_module_in_scope( + Py_InitModule(const_cast(name), initial_methods), + init_function); +} + +#endif + +}}} // namespace boost::python::detail + +namespace boost { namespace python { + +namespace detail +{ + BOOST_PYTHON_DECL PyObject* current_scope = 0; +} + +}} diff --git a/pxr/external/boost/python/src/numpy/dtype.cpp b/pxr/external/boost/python/src/numpy/dtype.cpp new file mode 100644 index 0000000000..88a20a27b5 --- /dev/null +++ b/pxr/external/boost/python/src/numpy/dtype.cpp @@ -0,0 +1,220 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifdef _MSC_VER +#include +#endif +#define BOOST_PYTHON_NUMPY_INTERNAL +#include + +#define DTYPE_FROM_CODE(code) \ + dtype(python::detail::new_reference(reinterpret_cast(PyArray_DescrFromType(code)))) + +#define BUILTIN_INT_DTYPE(bits) \ + template <> struct builtin_int_dtype \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_INT ## bits);} \ + }; \ + template <> struct builtin_int_dtype \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_UINT ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_int_dtype(); \ + template BOOST_NUMPY_DECL dtype get_int_dtype() + +#define BUILTIN_FLOAT_DTYPE(bits) \ + template <> struct builtin_float_dtype \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_FLOAT ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_float_dtype() + +#define BUILTIN_COMPLEX_DTYPE(bits) \ + template <> struct builtin_complex_dtype \ + { \ + static dtype get() { return DTYPE_FROM_CODE(NPY_COMPLEX ## bits);} \ + }; \ + template BOOST_NUMPY_DECL dtype get_complex_dtype() + +namespace boost { namespace python { namespace converter { +NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayDescr_Type, numpy::dtype) +} // namespace boost::python::converter + +namespace numpy { +namespace detail { + +dtype builtin_dtype::get() { return DTYPE_FROM_CODE(NPY_BOOL); } + +template struct builtin_int_dtype; +template struct builtin_float_dtype; +template struct builtin_complex_dtype; + +template dtype get_int_dtype() { + return builtin_int_dtype::get(); +} +template dtype get_float_dtype() { return builtin_float_dtype::get(); } +template dtype get_complex_dtype() { return builtin_complex_dtype::get(); } + +BUILTIN_INT_DTYPE(8); +BUILTIN_INT_DTYPE(16); +BUILTIN_INT_DTYPE(32); +BUILTIN_INT_DTYPE(64); +#ifdef NPY_FLOAT16 +BUILTIN_FLOAT_DTYPE(16); +#endif +BUILTIN_FLOAT_DTYPE(32); +BUILTIN_FLOAT_DTYPE(64); +BUILTIN_COMPLEX_DTYPE(64); +BUILTIN_COMPLEX_DTYPE(128); +#if NPY_BITSOF_LONGDOUBLE > NPY_BITSOF_DOUBLE +template <> struct builtin_float_dtype< NPY_BITSOF_LONGDOUBLE > { + static dtype get() { return DTYPE_FROM_CODE(NPY_LONGDOUBLE); } +}; +template dtype get_float_dtype< NPY_BITSOF_LONGDOUBLE >(); +template <> struct builtin_complex_dtype< 2 * NPY_BITSOF_LONGDOUBLE > { + static dtype get() { return DTYPE_FROM_CODE(NPY_CLONGDOUBLE); } +}; +template dtype get_complex_dtype< 2 * NPY_BITSOF_LONGDOUBLE >(); +#endif + +} // namespace detail + +python::detail::new_reference dtype::convert(object const & arg, bool align) +{ + PyArray_Descr* obj=NULL; + if (align) + { + if (PyArray_DescrAlignConverter(arg.ptr(), &obj) < 0) + throw_error_already_set(); + } + else + { + if (PyArray_DescrConverter(arg.ptr(), &obj) < 0) + throw_error_already_set(); + } + return python::detail::new_reference(reinterpret_cast(obj)); +} + +int dtype::get_itemsize() const { return reinterpret_cast(ptr())->elsize;} + +bool equivalent(dtype const & a, dtype const & b) { + // On Windows x64, the behaviour described on + // http://docs.scipy.org/doc/numpy/reference/c-api.array.html for + // PyArray_EquivTypes unfortunately does not extend as expected: + // "For example, on 32-bit platforms, NPY_LONG and NPY_INT are equivalent". + // This should also hold for 64-bit platforms (and does on Linux), but not + // on Windows. Implement an alternative: +#ifdef _MSC_VER + if (sizeof(long) == sizeof(int) && + // Manually take care of the type equivalence. + ((a == dtype::get_builtin() || a == dtype::get_builtin()) && + (b == dtype::get_builtin() || b == dtype::get_builtin()) || + (a == dtype::get_builtin() || a == dtype::get_builtin()) && + (b == dtype::get_builtin() || b == dtype::get_builtin()))) { + return true; + } else { + return PyArray_EquivTypes( + reinterpret_cast(a.ptr()), + reinterpret_cast(b.ptr()) + ); + } +#else + return PyArray_EquivTypes( + reinterpret_cast(a.ptr()), + reinterpret_cast(b.ptr()) + ); +#endif +} + +namespace +{ + +namespace pyconv = boost::python::converter; + +template +class array_scalar_converter +{ +public: + + static PyTypeObject const * get_pytype() + { + // This implementation depends on the fact that get_builtin returns pointers to objects + // NumPy has declared statically, and that the typeobj member also refers to a static + // object. That means we don't need to do any reference counting. + // In fact, I'm somewhat concerned that increasing the reference count of any of these + // might cause leaks, because I don't think Boost.Python ever decrements it, but it's + // probably a moot point if everything is actually static. + return reinterpret_cast(dtype::get_builtin().ptr())->typeobj; + } + + static void * convertible(PyObject * obj) + { + if (obj->ob_type == get_pytype()) + { + return obj; + } + else + { + dtype dt(python::detail::borrowed_reference(obj->ob_type)); + if (equivalent(dt, dtype::get_builtin())) + { + return obj; + } + } + return 0; + } + + static void convert(PyObject * obj, pyconv::rvalue_from_python_stage1_data* data) + { + void * storage = reinterpret_cast*>(data)->storage.bytes; + // We assume std::complex is a "standard layout" here and elsewhere; not guaranteed by + // C++03 standard, but true in every known implementation (and guaranteed by C++11). + PyArray_ScalarAsCtype(obj, reinterpret_cast(storage)); + data->convertible = storage; + } + + static void declare() + { + pyconv::registry::push_back(&convertible, &convert, python::type_id() +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &get_pytype +#endif + ); + } + +}; + +} // anonymous + +void dtype::register_scalar_converters() +{ + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); +#ifdef _MSC_VER + // Since the npy_(u)int32 types are defined as long types and treated + // as being different from the int32 types, these converters must be declared + // explicitely. + array_scalar_converter::declare(); + array_scalar_converter::declare(); +#endif + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter::declare(); + array_scalar_converter< std::complex >::declare(); + array_scalar_converter< std::complex >::declare(); +#if NPY_BITSOF_LONGDOUBLE > NPY_BITSOF_DOUBLE + array_scalar_converter::declare(); + array_scalar_converter< std::complex >::declare(); +#endif +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/numpy/matrix.cpp b/pxr/external/boost/python/src/numpy/matrix.cpp new file mode 100644 index 0000000000..47d2261637 --- /dev/null +++ b/pxr/external/boost/python/src/numpy/matrix.cpp @@ -0,0 +1,63 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL +#include +#include + +namespace boost { namespace python { namespace numpy +{ +namespace detail +{ +inline object get_matrix_type() +{ + object module = import("numpy"); + return module.attr("matrix"); +} +} // namespace boost::python::numpy::detail +} // namespace boost::python::numpy + +namespace converter +{ + +PyTypeObject const * object_manager_traits::get_pytype() +{ + return reinterpret_cast(numpy::detail::get_matrix_type().ptr()); +} + +} // namespace boost::python::converter + +namespace numpy +{ + +object matrix::construct(object const & obj, dtype const & dt, bool copy) +{ + return numpy::detail::get_matrix_type()(obj, dt, copy); +} + +object matrix::construct(object const & obj, bool copy) +{ + return numpy::detail::get_matrix_type()(obj, object(), copy); +} + +matrix matrix::view(dtype const & dt) const +{ + return matrix(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("view"), const_cast("O"), dt.ptr()))); +} + +matrix matrix::copy() const +{ + return matrix(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("copy"), const_cast("")))); +} + +matrix matrix::transpose() const +{ + return matrix(extract(ndarray::transpose())); +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/numpy/ndarray.cpp b/pxr/external/boost/python/src/numpy/ndarray.cpp new file mode 100644 index 0000000000..af09ecc338 --- /dev/null +++ b/pxr/external/boost/python/src/numpy/ndarray.cpp @@ -0,0 +1,301 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL +#include +#include + +namespace boost { namespace python { +namespace converter +{ +NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArray_Type, numpy::ndarray) +} // namespace boost::python::converter + +namespace numpy +{ +namespace detail +{ + +ndarray::bitflag numpy_to_bitflag(int const f) +{ + ndarray::bitflag r = ndarray::NONE; + if (f & NPY_ARRAY_C_CONTIGUOUS) r = (r | ndarray::C_CONTIGUOUS); + if (f & NPY_ARRAY_F_CONTIGUOUS) r = (r | ndarray::F_CONTIGUOUS); + if (f & NPY_ARRAY_ALIGNED) r = (r | ndarray::ALIGNED); + if (f & NPY_ARRAY_WRITEABLE) r = (r | ndarray::WRITEABLE); + return r; +} + +int bitflag_to_numpy(ndarray::bitflag f) +{ + int r = 0; + if (f & ndarray::C_CONTIGUOUS) r |= NPY_ARRAY_C_CONTIGUOUS; + if (f & ndarray::F_CONTIGUOUS) r |= NPY_ARRAY_F_CONTIGUOUS; + if (f & ndarray::ALIGNED) r |= NPY_ARRAY_ALIGNED; + if (f & ndarray::WRITEABLE) r |= NPY_ARRAY_WRITEABLE; + return r; +} + +bool is_c_contiguous(std::vector const & shape, + std::vector const & strides, + int itemsize) +{ + std::vector::const_reverse_iterator j = strides.rbegin(); + int total = itemsize; + for (std::vector::const_reverse_iterator i = shape.rbegin(); i != shape.rend(); ++i, ++j) + { + if (total != *j) return false; + total *= (*i); + } + return true; +} + +bool is_f_contiguous(std::vector const & shape, + std::vector const & strides, + int itemsize) +{ + std::vector::const_iterator j = strides.begin(); + int total = itemsize; + for (std::vector::const_iterator i = shape.begin(); i != shape.end(); ++i, ++j) + { + if (total != *j) return false; + total *= (*i); + } + return true; +} + +bool is_aligned(std::vector const & strides, + int itemsize) +{ + for (std::vector::const_iterator i = strides.begin(); i != strides.end(); ++i) + { + if (*i % itemsize) return false; + } + return true; +} + +inline PyArray_Descr * incref_dtype(dtype const & dt) +{ + Py_INCREF(dt.ptr()); + return reinterpret_cast(dt.ptr()); +} + +ndarray from_data_impl(void * data, + dtype const & dt, + python::object const & shape, + python::object const & strides, + python::object const & owner, + bool writeable) +{ + std::vector shape_(len(shape)); + std::vector strides_(len(strides)); + if (shape_.size() != strides_.size()) + { + PyErr_SetString(PyExc_ValueError, "Length of shape and strides arrays do not match."); + python::throw_error_already_set(); + } + for (std::size_t i = 0; i < shape_.size(); ++i) + { + shape_[i] = python::extract(shape[i]); + strides_[i] = python::extract(strides[i]); + } + return from_data_impl(data, dt, shape_, strides_, owner, writeable); +} + +ndarray from_data_impl(void * data, + dtype const & dt, + std::vector const & shape, + std::vector const & strides, + python::object const & owner, + bool writeable) +{ + if (shape.size() != strides.size()) + { + PyErr_SetString(PyExc_ValueError, "Length of shape and strides arrays do not match."); + python::throw_error_already_set(); + } + int itemsize = dt.get_itemsize(); + int flags = 0; + if (writeable) flags |= NPY_ARRAY_WRITEABLE; + if (is_c_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_C_CONTIGUOUS; + if (is_f_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_F_CONTIGUOUS; + if (is_aligned(strides, itemsize)) flags |= NPY_ARRAY_ALIGNED; + ndarray r(python::detail::new_reference + (PyArray_NewFromDescr(&PyArray_Type, + incref_dtype(dt), + shape.size(), + const_cast(&shape.front()), + const_cast(&strides.front()), + data, + flags, + NULL))); + r.set_base(owner); + return r; +} + +} // namespace detail + +namespace { + int normalize_index(int n,int nlim) // wraps [-nlim:nlim) into [0:nlim), throw IndexError otherwise + { + if (n<0) + n += nlim; // negative indices work backwards from end + if (n < 0 || n >= nlim) + { + PyErr_SetObject(PyExc_IndexError, Py_None); + throw_error_already_set(); + } + return n; + } +} + +Py_intptr_t ndarray::shape(int n) const +{ + return get_shape()[normalize_index(n,get_nd())]; +} + +Py_intptr_t ndarray::strides(int n) const +{ + return get_strides()[normalize_index(n,get_nd())]; +} + +ndarray ndarray::view(dtype const & dt) const +{ + return ndarray(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("view"), const_cast("O"), dt.ptr()))); +} + +ndarray ndarray::astype(dtype const & dt) const +{ + return ndarray(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("astype"), const_cast("O"), dt.ptr()))); +} + +ndarray ndarray::copy() const +{ + return ndarray(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("copy"), const_cast("")))); +} + +dtype ndarray::get_dtype() const +{ + return dtype(python::detail::borrowed_reference(get_struct()->descr)); +} + +python::object ndarray::get_base() const +{ + if (get_struct()->base == NULL) return object(); + return python::object(python::detail::borrowed_reference(get_struct()->base)); +} + +void ndarray::set_base(object const & base) +{ + Py_XDECREF(get_struct()->base); + if (base.ptr()) + { + Py_INCREF(base.ptr()); + get_struct()->base = base.ptr(); + } + else + { + get_struct()->base = NULL; + } +} + +ndarray::bitflag ndarray::get_flags() const +{ + return numpy::detail::numpy_to_bitflag(get_struct()->flags); +} + +ndarray ndarray::transpose() const +{ + return ndarray(python::detail::new_reference + (PyArray_Transpose(reinterpret_cast(this->ptr()), NULL))); +} + +ndarray ndarray::squeeze() const +{ + return ndarray(python::detail::new_reference + (PyArray_Squeeze(reinterpret_cast(this->ptr())))); +} + +ndarray ndarray::reshape(python::tuple const & shape) const +{ + return ndarray(python::detail::new_reference + (PyArray_Reshape(reinterpret_cast(this->ptr()), shape.ptr()))); +} + +python::object ndarray::scalarize() const +{ + Py_INCREF(ptr()); + return python::object(python::detail::new_reference(PyArray_Return(reinterpret_cast(ptr())))); +} + +ndarray zeros(python::tuple const & shape, dtype const & dt) +{ + int nd = len(shape); + boost::scoped_array dims(new Py_intptr_t[nd]); + for (int n=0; n(shape[n]); + return ndarray(python::detail::new_reference + (PyArray_Zeros(nd, dims.get(), detail::incref_dtype(dt), 0))); +} + +ndarray zeros(int nd, Py_intptr_t const * shape, dtype const & dt) +{ + return ndarray(python::detail::new_reference + (PyArray_Zeros(nd, const_cast(shape), detail::incref_dtype(dt), 0))); +} + +ndarray empty(python::tuple const & shape, dtype const & dt) +{ + int nd = len(shape); + boost::scoped_array dims(new Py_intptr_t[nd]); + for (int n=0; n(shape[n]); + return ndarray(python::detail::new_reference + (PyArray_Empty(nd, dims.get(), detail::incref_dtype(dt), 0))); +} + +ndarray empty(int nd, Py_intptr_t const * shape, dtype const & dt) +{ + return ndarray(python::detail::new_reference + (PyArray_Empty(nd, const_cast(shape), detail::incref_dtype(dt), 0))); +} + +ndarray array(python::object const & obj) +{ + return ndarray(python::detail::new_reference + (PyArray_FromAny(obj.ptr(), NULL, 0, 0, NPY_ARRAY_ENSUREARRAY, NULL))); +} + +ndarray array(python::object const & obj, dtype const & dt) +{ + return ndarray(python::detail::new_reference + (PyArray_FromAny(obj.ptr(), detail::incref_dtype(dt), 0, 0, NPY_ARRAY_ENSUREARRAY, NULL))); +} + +ndarray from_object(python::object const & obj, dtype const & dt, int nd_min, int nd_max, ndarray::bitflag flags) +{ + int requirements = detail::bitflag_to_numpy(flags); + return ndarray(python::detail::new_reference + (PyArray_FromAny(obj.ptr(), + detail::incref_dtype(dt), + nd_min, nd_max, + requirements, + NULL))); +} + +ndarray from_object(python::object const & obj, int nd_min, int nd_max, ndarray::bitflag flags) +{ + int requirements = detail::bitflag_to_numpy(flags); + return ndarray(python::detail::new_reference + (PyArray_FromAny(obj.ptr(), + NULL, + nd_min, nd_max, + requirements, + NULL))); +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/numpy/numpy.cpp b/pxr/external/boost/python/src/numpy/numpy.cpp new file mode 100644 index 0000000000..3ae2295e39 --- /dev/null +++ b/pxr/external/boost/python/src/numpy/numpy.cpp @@ -0,0 +1,34 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL_MAIN +#include +#include + +namespace boost { namespace python { namespace numpy { + +#if PY_MAJOR_VERSION == 2 +static void wrap_import_array() +{ + import_array(); +} +#else +static void * wrap_import_array() +{ + import_array(); + return NULL; +} +#endif + +void initialize(bool register_scalar_converters) +{ + wrap_import_array(); + import_ufunc(); + if (register_scalar_converters) + dtype::register_scalar_converters(); +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/numpy/scalars.cpp b/pxr/external/boost/python/src/numpy/scalars.cpp new file mode 100644 index 0000000000..3947c06f2c --- /dev/null +++ b/pxr/external/boost/python/src/numpy/scalars.cpp @@ -0,0 +1,36 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL +#include + +namespace boost { namespace python { +namespace converter +{ +NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyVoidArrType_Type, numpy::void_) +} // namespace boost::python::converter + +namespace numpy +{ + +void_::void_(Py_ssize_t size) + : object(python::detail::new_reference + (PyObject_CallFunction((PyObject*)&PyVoidArrType_Type, const_cast("i"), size))) +{} + +void_ void_::view(dtype const & dt) const +{ + return void_(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("view"), const_cast("O"), dt.ptr()))); +} + +void_ void_::copy() const +{ + return void_(python::detail::new_reference + (PyObject_CallMethod(this->ptr(), const_cast("copy"), const_cast("")))); +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/numpy/ufunc.cpp b/pxr/external/boost/python/src/numpy/ufunc.cpp new file mode 100644 index 0000000000..173d7213ec --- /dev/null +++ b/pxr/external/boost/python/src/numpy/ufunc.cpp @@ -0,0 +1,65 @@ +// Copyright Jim Bosch 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_PYTHON_NUMPY_INTERNAL +#include +#include + +namespace boost { namespace python { +namespace converter +{ +NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayMultiIter_Type, numpy::multi_iter) +} // namespace boost::python::converter + +namespace numpy +{ + +multi_iter make_multi_iter(object const & a1) +{ + return multi_iter(python::detail::new_reference(PyArray_MultiIterNew(1, a1.ptr()))); +} + + multi_iter make_multi_iter(object const & a1, object const & a2) +{ + return multi_iter(python::detail::new_reference(PyArray_MultiIterNew(2, a1.ptr(), a2.ptr()))); +} + +multi_iter make_multi_iter(object const & a1, object const & a2, object const & a3) +{ + return multi_iter(python::detail::new_reference(PyArray_MultiIterNew(3, a1.ptr(), a2.ptr(), a3.ptr()))); +} + +void multi_iter::next() +{ + PyArray_MultiIter_NEXT(ptr()); +} + +bool multi_iter::not_done() const +{ + return PyArray_MultiIter_NOTDONE(ptr()); +} + +char * multi_iter::get_data(int i) const +{ + return reinterpret_cast(PyArray_MultiIter_DATA(ptr(), i)); +} + +int multi_iter::get_nd() const +{ + return reinterpret_cast(ptr())->nd; +} + +Py_intptr_t const * multi_iter::get_shape() const +{ + return reinterpret_cast(ptr())->dimensions; +} + +Py_intptr_t multi_iter::shape(int n) const +{ + return reinterpret_cast(ptr())->dimensions[n]; +} + +}}} // namespace boost::python::numpy diff --git a/pxr/external/boost/python/src/object/class.cpp b/pxr/external/boost/python/src/object/class.cpp new file mode 100644 index 0000000000..8778b7abcd --- /dev/null +++ b/pxr/external/boost/python/src/object/class.cpp @@ -0,0 +1,781 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include // #including this first is an intel6 workaround +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace python { + +# ifdef BOOST_PYTHON_SELF_IS_CLASS +namespace self_ns +{ + self_t self; +} +# endif + +instance_holder::instance_holder() + : m_next(0) +{ +} + +instance_holder::~instance_holder() +{ +} + +extern "C" +{ + // This is copied from typeobject.c in the Python sources. Even though + // class_metatype_object doesn't set Py_TPFLAGS_HAVE_GC, that bit gets + // filled in by the base class initialization process in + // PyType_Ready(). However, tp_is_gc is *not* copied from the base + // type, making it assume that classes are GC-able even if (like + // class_type_object) they're statically allocated. + static int + type_is_gc(PyTypeObject *python_type) + { + return python_type->tp_flags & Py_TPFLAGS_HEAPTYPE; + } + + // This is also copied from the Python sources. We can't implement + // static_data as a subclass property effectively without it. + typedef struct { + PyObject_HEAD + PyObject *prop_get; + PyObject *prop_set; + PyObject *prop_del; + PyObject *prop_doc; + int getter_doc; + } propertyobject; + + // Copied from Python source and removed the part for setting docstring, + // since we don't have a setter for __doc__ and trying to set it will + // cause the init fail. + static int property_init(PyObject *self, PyObject *args, PyObject *kwds) + { + PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL; + static const char *kwlist[] = {"fget", "fset", "fdel", "doc", 0}; + propertyobject *prop = (propertyobject *)self; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOOO:property", + const_cast(kwlist), &get, &set, &del, &doc)) + return -1; + + if (get == Py_None) + get = NULL; + if (set == Py_None) + set = NULL; + if (del == Py_None) + del = NULL; + + Py_XINCREF(get); + Py_XINCREF(set); + Py_XINCREF(del); + Py_XINCREF(doc); + + prop->prop_get = get; + prop->prop_set = set; + prop->prop_del = del; + prop->prop_doc = doc; + prop->getter_doc = 0; + + return 0; + } + + + static PyObject * + static_data_descr_get(PyObject *self, PyObject * /*obj*/, PyObject * /*type*/) + { + propertyobject *gs = (propertyobject *)self; + + return PyObject_CallFunction(gs->prop_get, const_cast("()")); + } + + static int + static_data_descr_set(PyObject *self, PyObject * /*obj*/, PyObject *value) + { + propertyobject *gs = (propertyobject *)self; + PyObject *func, *res; + + if (value == NULL) + func = gs->prop_del; + else + func = gs->prop_set; + if (func == NULL) { + PyErr_SetString(PyExc_AttributeError, + value == NULL ? + "can't delete attribute" : + "can't set attribute"); + return -1; + } + if (value == NULL) + res = PyObject_CallFunction(func, const_cast("()")); + else + res = PyObject_CallFunction(func, const_cast("(O)"), value); + if (res == NULL) + return -1; + Py_DECREF(res); + return 0; + } +} + +static PyTypeObject static_data_object = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Boost.Python.StaticProperty"), + sizeof(propertyobject), + 0, + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT // | Py_TPFLAGS_HAVE_GC + | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, //&PyProperty_Type, /* tp_base */ + 0, /* tp_dict */ + static_data_descr_get, /* tp_descr_get */ + static_data_descr_set, /* tp_descr_set */ + 0, /* tp_dictoffset */ + property_init, /* tp_init */ + 0, /* tp_alloc */ + 0, // filled in with type_new /* tp_new */ + 0, // filled in with __PyObject_GC_Del /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +namespace objects +{ +#if PY_VERSION_HEX < 0x03000000 + // XXX Not sure why this run into compiling error in Python 3 + extern "C" + { + // This declaration needed due to broken Python 2.2 headers + extern DL_IMPORT(PyTypeObject) PyProperty_Type; + } +#endif + + BOOST_PYTHON_DECL PyObject* static_data() + { + if (static_data_object.tp_dict == 0) + { + Py_SET_TYPE(&static_data_object, &PyType_Type); + static_data_object.tp_base = &PyProperty_Type; + if (PyType_Ready(&static_data_object)) + return 0; + } + return upcast(&static_data_object); + } +} + +extern "C" +{ + // Ordinarily, descriptors have a certain assymetry: you can use + // them to read attributes off the class object they adorn, but + // writing the same attribute on the class object always replaces + // the descriptor in the class __dict__. In order to properly + // represent C++ static data members, we need to allow them to be + // written through the class instance. This function of the + // metaclass makes it possible. + static int + class_setattro(PyObject *obj, PyObject *name, PyObject* value) + { + // Must use "private" Python implementation detail + // _PyType_Lookup instead of PyObject_GetAttr because the + // latter will always end up calling the descr_get function on + // any descriptor it finds; we need the unadulterated + // descriptor here. + PyObject* a = _PyType_Lookup(downcast(obj), name); + + // a is a borrowed reference or 0 + + // If we found a static data descriptor, call it directly to + // force it to set the static data member + if (a != 0 && PyObject_IsInstance(a, objects::static_data())) + return Py_TYPE(a)->tp_descr_set(a, obj, value); + else + return PyType_Type.tp_setattro(obj, name, value); + } +} + +static PyTypeObject class_metatype_object = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Boost.Python.class"), + PyType_Type.tp_basicsize, + 0, + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + class_setattro, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT // | Py_TPFLAGS_HAVE_GC + | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, //&PyType_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, // filled in with type_new /* tp_new */ + 0, // filled in with __PyObject_GC_Del /* tp_free */ + (inquiry)type_is_gc, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +// Install the instance data for a C++ object into a Python instance +// object. +void instance_holder::install(PyObject* self) throw() +{ + assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self)), &class_metatype_object)); + m_next = ((objects::instance<>*)self)->objects; + ((objects::instance<>*)self)->objects = this; +} + + +namespace objects +{ +// Get the metatype object for all extension classes. + BOOST_PYTHON_DECL type_handle class_metatype() + { + if (class_metatype_object.tp_dict == 0) + { + Py_SET_TYPE(&class_metatype_object, &PyType_Type); + class_metatype_object.tp_base = &PyType_Type; + if (PyType_Ready(&class_metatype_object)) + return type_handle(); + } + return type_handle(borrowed(&class_metatype_object)); + } + extern "C" + { + static void instance_dealloc(PyObject* inst) + { + instance<>* kill_me = (instance<>*)inst; + + for (instance_holder* p = kill_me->objects, *next; p != 0; p = next) + { + next = p->next(); + p->~instance_holder(); + instance_holder::deallocate(inst, dynamic_cast(p)); + } + + // Python 2.2.1 won't add weak references automatically when + // tp_itemsize > 0, so we need to manage that + // ourselves. Accordingly, we also have to clean up the + // weakrefs ourselves. + if (kill_me->weakrefs != NULL) + PyObject_ClearWeakRefs(inst); + + Py_XDECREF(kill_me->dict); + + Py_TYPE(inst)->tp_free(inst); + } + + static PyObject * + instance_new(PyTypeObject* type_, PyObject* /*args*/, PyObject* /*kw*/) + { + // Attempt to find the __instance_size__ attribute. If not present, no problem. + PyObject* d = type_->tp_dict; + PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast("__instance_size__")); + + ssize_t instance_size = instance_size_obj ? +#if PY_VERSION_HEX >= 0x03000000 + PyLong_AsSsize_t(instance_size_obj) : 0; +#else + PyInt_AsLong(instance_size_obj) : 0; +#endif + + if (instance_size < 0) + instance_size = 0; + + PyErr_Clear(); // Clear any errors that may have occurred. + + instance<>* result = (instance<>*)type_->tp_alloc(type_, instance_size); + if (result) + { + // Guido says we can use ob_size for any purpose we + // like, so we'll store the total size of the object + // there. A negative number indicates that the extra + // instance memory is not yet allocated to any holders. + Py_SET_SIZE(result,-static_cast(offsetof(instance<>,storage) + instance_size)); + } + return (PyObject*)result; + } + + static PyObject* instance_get_dict(PyObject* op, void*) + { + instance<>* inst = downcast >(op); + if (inst->dict == 0) + inst->dict = PyDict_New(); + return python::xincref(inst->dict); + } + + static int instance_set_dict(PyObject* op, PyObject* dict, void*) + { + instance<>* inst = downcast >(op); + python::xdecref(inst->dict); + inst->dict = python::incref(dict); + return 0; + } + + } + + + static PyGetSetDef instance_getsets[] = { + {const_cast("__dict__"), instance_get_dict, instance_set_dict, NULL, 0}, + {0, 0, 0, 0, 0} + }; + + + static PyMemberDef instance_members[] = { + {const_cast("__weakref__"), T_OBJECT, offsetof(instance<>, weakrefs), 0, 0}, + {0, 0, 0, 0, 0} + }; + + static PyTypeObject class_type_object = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Boost.Python.instance"), + offsetof(instance<>,storage), /* tp_basicsize */ + 1, /* tp_itemsize */ + instance_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT // | Py_TPFLAGS_HAVE_GC + | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(instance<>,weakrefs), /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + instance_members, /* tp_members */ + instance_getsets, /* tp_getset */ + 0, //&PyBaseObject_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + offsetof(instance<>,dict), /* tp_dictoffset */ + 0, /* tp_init */ + PyType_GenericAlloc, /* tp_alloc */ + instance_new, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif + }; + + BOOST_PYTHON_DECL type_handle class_type() + { + if (class_type_object.tp_dict == 0) + { + Py_SET_TYPE(&class_type_object, incref(class_metatype().get())); + class_type_object.tp_base = &PyBaseObject_Type; + if (PyType_Ready(&class_type_object)) + return type_handle(); +// class_type_object.tp_setattro = class_setattro; + } + return type_handle(borrowed(&class_type_object)); + } + + BOOST_PYTHON_DECL void* + find_instance_impl(PyObject* inst, type_info type, bool null_shared_ptr_only) + { + if (!Py_TYPE(Py_TYPE(inst)) || + !PyType_IsSubtype(Py_TYPE(Py_TYPE(inst)), &class_metatype_object)) + return 0; + + instance<>* self = reinterpret_cast*>(inst); + + for (instance_holder* match = self->objects; match != 0; match = match->next()) + { + void* const found = match->holds(type, null_shared_ptr_only); + if (found) + return found; + } + return 0; + } + + object module_prefix() + { + return object( + PyObject_IsInstance(scope().ptr(), upcast(&PyModule_Type)) + ? object(scope().attr("__name__")) + : api::getattr(scope(), "__module__", str()) + ); + } + + namespace + { + // Find a registered class object corresponding to id. Return a + // null handle if no such class is registered. + inline type_handle query_class(type_info id) + { + converter::registration const* p = converter::registry::query(id); + return type_handle( + python::borrowed( + python::allow_null(p ? p->m_class_object : 0)) + ); + } + + // Find a registered class corresponding to id. If not found, + // throw an appropriate exception. + type_handle get_class(type_info id) + { + type_handle result(query_class(id)); + + if (result.get() == 0) + { + object report("extension class wrapper for base class "); + report = report + id.name() + " has not been created yet"; + PyErr_SetObject(PyExc_RuntimeError, report.ptr()); + throw_error_already_set(); + } + return result; + } + + // class_base constructor + // + // name - the name of the new Python class + // + // num_types - one more than the number of declared bases + // + // types - array of python::type_info, the first item + // corresponding to the class being created, and the + // rest corresponding to its declared bases. + // + inline object + new_class(char const* name, std::size_t num_types, type_info const* const types, char const* doc) + { + assert(num_types >= 1); + + // Build a tuple of the base Python type objects. If no bases + // were declared, we'll use our class_type() as the single base + // class. + ssize_t const num_bases = (std::max)(num_types - 1, static_cast(1)); + handle<> bases(PyTuple_New(num_bases)); + + for (ssize_t i = 1; i <= num_bases; ++i) + { + type_handle c = (i >= static_cast(num_types)) ? class_type() : get_class(types[i]); + // PyTuple_SET_ITEM steals this reference + PyTuple_SET_ITEM(bases.get(), static_cast(i - 1), upcast(c.release())); + } + + // Call the class metatype to create a new class + dict d; + + object m = module_prefix(); + if (m) d["__module__"] = m; + + if (doc != 0) + d["__doc__"] = doc; + + object result = object(class_metatype())(name, bases, d); + assert(PyType_IsSubtype(Py_TYPE(result.ptr()), &PyType_Type)); + + if (scope().ptr() != Py_None) + scope().attr(name) = result; + + // For pickle. Will lead to informative error messages if pickling + // is not enabled. + result.attr("__reduce__") = object(make_instance_reduce_function()); + + return result; + } + } + + class_base::class_base( + char const* name, std::size_t num_types, type_info const* const types, char const* doc) + : object(new_class(name, num_types, types, doc)) + { + // Insert the new class object in the registry + converter::registration& converters = const_cast( + converter::registry::lookup(types[0])); + + // Class object is leaked, for now + converters.m_class_object = (PyTypeObject*)incref(this->ptr()); + } + + BOOST_PYTHON_DECL void copy_class_object(type_info const& src, type_info const& dst) + { + converter::registration& dst_converters + = const_cast(converter::registry::lookup(dst)); + + converter::registration const& src_converters = converter::registry::lookup(src); + + dst_converters.m_class_object = src_converters.m_class_object; + } + + void class_base::set_instance_size(std::size_t instance_size) + { + this->attr("__instance_size__") = instance_size; + } + + void class_base::add_property( + char const* name, object const& fget, char const* docstr) + { + object property( + (python::detail::new_reference) + PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast("Osss"), fget.ptr(), (char*)NULL, (char*)NULL, docstr)); + + this->setattr(name, property); + } + + void class_base::add_property( + char const* name, object const& fget, object const& fset, char const* docstr) + { + object property( + (python::detail::new_reference) + PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast("OOss"), fget.ptr(), fset.ptr(), (char*)NULL, docstr)); + + this->setattr(name, property); + } + + void class_base::add_static_property(char const* name, object const& fget) + { + object property( + (python::detail::new_reference) + PyObject_CallFunction(static_data(), const_cast("O"), fget.ptr()) + ); + + this->setattr(name, property); + } + + void class_base::add_static_property(char const* name, object const& fget, object const& fset) + { + object property( + (python::detail::new_reference) + PyObject_CallFunction(static_data(), const_cast("OO"), fget.ptr(), fset.ptr())); + + this->setattr(name, property); + } + + void class_base::setattr(char const* name, object const& x) + { + if (PyObject_SetAttrString(this->ptr(), const_cast(name), x.ptr()) < 0) + throw_error_already_set(); + } + + namespace + { + extern "C" PyObject* no_init(PyObject*, PyObject*) + { + ::PyErr_SetString(::PyExc_RuntimeError, const_cast("This class cannot be instantiated from Python")); + return NULL; + } + static ::PyMethodDef no_init_def = { + const_cast("__init__"), no_init, METH_VARARGS, + const_cast("Raises an exception\n" + "This class cannot be instantiated from Python\n") + }; + } + + void class_base::def_no_init() + { + handle<> f(::PyCFunction_New(&no_init_def, 0)); + this->setattr("__init__", object(f)); + } + + void class_base::enable_pickling_(bool getstate_manages_dict) + { + setattr("__safe_for_unpickling__", object(true)); + + if (getstate_manages_dict) + { + setattr("__getstate_manages_dict__", object(true)); + } + } + + namespace + { + PyObject* callable_check(PyObject* callable) + { + if (PyCallable_Check(expect_non_null(callable))) + return callable; + + ::PyErr_Format( + PyExc_TypeError + , const_cast("staticmethod expects callable object; got an object of type %s, which is not callable") + , Py_TYPE(callable)->tp_name + ); + + throw_error_already_set(); + return 0; + } + } + + void class_base::make_method_static(const char * method_name) + { + PyTypeObject* self = downcast(this->ptr()); + dict d((handle<>(borrowed(self->tp_dict)))); + + object method(d[method_name]); + + this->attr(method_name) = object( + handle<>( + PyStaticMethod_New((callable_check)(method.ptr()) ) + )); + } + + BOOST_PYTHON_DECL type_handle registered_class_object(type_info id) + { + return query_class(id); + } +} // namespace objects + + +typedef unsigned int alignment_marker_t; + +void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset, std::size_t holder_size, std::size_t alignment) +{ + assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self_)), &class_metatype_object)); + objects::instance<>* self = (objects::instance<>*)self_; + + int total_size_needed = holder_offset + holder_size + alignment - 1; + + if (-Py_SIZE(self) >= total_size_needed) + { + // holder_offset should at least point into the variable-sized part + assert(holder_offset >= offsetof(objects::instance<>,storage)); + + size_t allocated = holder_size + alignment; + void* storage = (char*)self + holder_offset; + void* aligned_storage = ::boost::alignment::align(alignment, holder_size, storage, allocated); + + // Record the fact that the storage is occupied, noting where it starts + const size_t offset = reinterpret_cast(aligned_storage) - reinterpret_cast(storage) + holder_offset; + Py_SET_SIZE(self, offset); + return (char*)self + offset; + } + else + { + const size_t base_allocation = sizeof(alignment_marker_t) + holder_size + alignment - 1; + void* const base_storage = PyMem_Malloc(base_allocation); + if (base_storage == 0) + throw std::bad_alloc(); + + const uintptr_t x = reinterpret_cast(base_storage) + sizeof(alignment_marker_t); + //this has problems for x -> max(void *) + //const size_t padding = alignment - ((x + sizeof(alignment_marker_t)) % alignment); + //only works for alignments with alignments of powers of 2, but no edge conditions + const uintptr_t padding = alignment == 1 ? 0 : ( alignment - (x & (alignment - 1)) ); + const size_t aligned_offset = sizeof(alignment_marker_t) + padding; + void* const aligned_storage = (char *)base_storage + aligned_offset; + BOOST_ASSERT((char *) aligned_storage + holder_size <= (char *)base_storage + base_allocation); + alignment_marker_t* const marker_storage = reinterpret_cast((char *)aligned_storage - sizeof(alignment_marker_t)); + *marker_storage = static_cast(padding); + return aligned_storage; + } +} + +void instance_holder::deallocate(PyObject* self_, void* storage) throw() +{ + assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self_)), &class_metatype_object)); + objects::instance<>* self = (objects::instance<>*)self_; + if (storage != (char*)self + Py_SIZE(self)) + { + alignment_marker_t* marker_storage = reinterpret_cast((char *)storage - sizeof(alignment_marker_t)); + void *malloced_storage = (char *) storage - sizeof(alignment_marker_t) - (*marker_storage); + PyMem_Free(malloced_storage); + } +} + +}} // namespace boost::python diff --git a/pxr/external/boost/python/src/object/enum.cpp b/pxr/external/boost/python/src/object/enum.cpp new file mode 100644 index 0000000000..5753b32e07 --- /dev/null +++ b/pxr/external/boost/python/src/object/enum.cpp @@ -0,0 +1,251 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace python { namespace objects { + +struct enum_object +{ +#if PY_VERSION_HEX >= 0x03000000 + PyLongObject base_object; +#else + PyIntObject base_object; +#endif + PyObject* name; +}; + +static PyMemberDef enum_members[] = { + {const_cast("name"), T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0}, + {0, 0, 0, 0, 0} +}; + + +extern "C" +{ + static void + enum_dealloc(enum_object* self) + { + Py_XDECREF(self->name); + Py_TYPE(self)->tp_free((PyObject*)self); + } + + static PyObject* enum_repr(PyObject* self_) + { + PyObject *mod = PyObject_GetAttrString( self_, "__module__"); + object auto_free = object(handle<>(mod)); + enum_object* self = downcast(self_); + if (!self->name) + { + return +#if PY_VERSION_HEX >= 0x03000000 + PyUnicode_FromFormat("%S.%s(%ld)", mod, self_->ob_type->tp_name, PyLong_AsLong(self_)); +#else + PyString_FromFormat("%s.%s(%ld)", PyString_AsString(mod), self_->ob_type->tp_name, PyInt_AS_LONG(self_)); +#endif + } + else + { + PyObject* name = self->name; + if (name == 0) + return 0; + + return +#if PY_VERSION_HEX >= 0x03000000 + PyUnicode_FromFormat("%S.%s.%S", mod, self_->ob_type->tp_name, name); +#else + PyString_FromFormat("%s.%s.%s", + PyString_AsString(mod), self_->ob_type->tp_name, PyString_AsString(name)); +#endif + } + } + + static PyObject* enum_str(PyObject* self_) + { + enum_object* self = downcast(self_); + if (!self->name) + { +#if PY_VERSION_HEX >= 0x03000000 + return PyLong_Type.tp_str(self_); +#else + return PyInt_Type.tp_str(self_); +#endif + } + else + { + return incref(self->name); + } + } +} + +static PyTypeObject enum_type_object = { + PyVarObject_HEAD_INIT(NULL, 0) // &PyType_Type + const_cast("Boost.Python.enum"), + sizeof(enum_object), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) enum_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + enum_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + enum_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT +#if PY_VERSION_HEX < 0x03000000 + | Py_TPFLAGS_CHECKTYPES +#endif + | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + enum_members, /* tp_members */ + 0, /* tp_getset */ + 0, //&PyInt_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +object module_prefix(); + +namespace +{ + object new_enum_type(char const* name, char const *doc) + { + if (enum_type_object.tp_dict == 0) + { + Py_SET_TYPE(&enum_type_object, incref(&PyType_Type)); +#if PY_VERSION_HEX >= 0x03000000 + enum_type_object.tp_base = &PyLong_Type; +#else + enum_type_object.tp_base = &PyInt_Type; +#endif + if (PyType_Ready(&enum_type_object)) + throw_error_already_set(); + } + + type_handle metatype(borrowed(&PyType_Type)); + type_handle base(borrowed(&enum_type_object)); + + // suppress the instance __dict__ in these enum objects. There + // may be a slicker way, but this'll do for now. + dict d; + d["__slots__"] = tuple(); + d["values"] = dict(); + d["names"] = dict(); + + object module_name = module_prefix(); + if (module_name) + d["__module__"] = module_name; + if (doc) + d["__doc__"] = doc; + + object result = (object(metatype))(name, make_tuple(base), d); + + scope().attr(name) = result; + + return result; + } +} + +enum_base::enum_base( + char const* name + , converter::to_python_function_t to_python + , converter::convertible_function convertible + , converter::constructor_function construct + , type_info id + , char const *doc + ) + : object(new_enum_type(name, doc)) +{ + converter::registration& converters + = const_cast( + converter::registry::lookup(id)); + + converters.m_class_object = downcast(this->ptr()); + converter::registry::insert(to_python, id); + converter::registry::insert(convertible, construct, id); +} + +void enum_base::add_value(char const* name_, long value) +{ + // Convert name to Python string + object name(name_); + + // Create a new enum instance by calling the class with a value + object x = (*this)(value); + + // Store the object in the enum class + (*this).attr(name_) = x; + + dict d = extract(this->attr("values"))(); + d[value] = x; + + // Set the name field in the new enum instanec + enum_object* p = downcast(x.ptr()); + Py_XDECREF(p->name); + p->name = incref(name.ptr()); + + dict names_dict = extract(this->attr("names"))(); + names_dict[x.attr("name")] = x; +} + +void enum_base::export_values() +{ + dict d = extract(this->attr("names"))(); + list items = d.items(); + scope current; + + for (unsigned i = 0, max = len(items); i < max; ++i) + api::setattr(current, items[i][0], items[i][1]); + } + +PyObject* enum_base::to_python(PyTypeObject* type_, long x) +{ + object type((type_handle(borrowed(type_)))); + + dict d = extract(type.attr("values"))(); + object v = d.get(x, object()); + return incref( + (v == object() ? type(x) : v).ptr()); +} + +}}} // namespace boost::python::object diff --git a/pxr/external/boost/python/src/object/function.cpp b/pxr/external/boost/python/src/object/function.cpp new file mode 100644 index 0000000000..4adb49453c --- /dev/null +++ b/pxr/external/boost/python/src/object/function.cpp @@ -0,0 +1,789 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES +# include +#endif + +namespace boost { namespace python { + volatile bool docstring_options::show_user_defined_ = true; + volatile bool docstring_options::show_cpp_signatures_ = true; +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + volatile bool docstring_options::show_py_signatures_ = true; +#else + volatile bool docstring_options::show_py_signatures_ = false; +#endif +}} + +namespace boost { namespace python { namespace objects { + +py_function_impl_base::~py_function_impl_base() +{ +} + +unsigned py_function_impl_base::max_arity() const +{ + return this->min_arity(); +} + +extern PyTypeObject function_type; + +function::function( + py_function const& implementation +#if BOOST_WORKAROUND(__EDG_VERSION__, == 245) + , python::detail::keyword const* names_and_defaults +#else + , python::detail::keyword const* const names_and_defaults +#endif + , unsigned num_keywords + ) + : m_fn(implementation) + , m_nkeyword_values(0) +{ + if (names_and_defaults != 0) + { + unsigned int max_arity = m_fn.max_arity(); + unsigned int keyword_offset + = max_arity > num_keywords ? max_arity - num_keywords : 0; + + + ssize_t tuple_size = num_keywords ? max_arity : 0; + m_arg_names = object(handle<>(PyTuple_New(tuple_size))); + + if (num_keywords != 0) + { + for (unsigned j = 0; j < keyword_offset; ++j) + PyTuple_SET_ITEM(m_arg_names.ptr(), j, incref(Py_None)); + } + + for (unsigned i = 0; i < num_keywords; ++i) + { + tuple kv; + + python::detail::keyword const* const p = names_and_defaults + i; + if (p->default_value) + { + kv = make_tuple(p->name, p->default_value); + ++m_nkeyword_values; + } + else + { + kv = make_tuple(p->name); + } + + PyTuple_SET_ITEM( + m_arg_names.ptr() + , i + keyword_offset + , incref(kv.ptr()) + ); + } + } + + PyObject* p = this; + if (Py_TYPE(&function_type) == 0) + { + Py_SET_TYPE(&function_type, &PyType_Type); + ::PyType_Ready(&function_type); + } + + (void)( // warning suppression for GCC + PyObject_INIT(p, &function_type) + ); +} + +function::~function() +{ +} + +PyObject* function::call(PyObject* args, PyObject* keywords) const +{ + std::size_t n_unnamed_actual = PyTuple_GET_SIZE(args); + std::size_t n_keyword_actual = keywords ? PyDict_Size(keywords) : 0; + std::size_t n_actual = n_unnamed_actual + n_keyword_actual; + + function const* f = this; + + // Try overloads looking for a match + do + { + // Check for a plausible number of arguments + unsigned min_arity = f->m_fn.min_arity(); + unsigned max_arity = f->m_fn.max_arity(); + + if (n_actual + f->m_nkeyword_values >= min_arity + && n_actual <= max_arity) + { + // This will be the args that actually get passed + handle<>inner_args(allow_null(borrowed(args))); + + if (n_keyword_actual > 0 // Keyword arguments were supplied + || n_actual < min_arity) // or default keyword values are needed + { + if (f->m_arg_names.is_none()) + { + // this overload doesn't accept keywords + inner_args = handle<>(); + } + else + { + // "all keywords are none" is a special case + // indicating we will accept any number of keyword + // arguments + if (PyTuple_Size(f->m_arg_names.ptr()) == 0) + { + // no argument preprocessing + } + else + { + // build a new arg tuple, will adjust its size later + assert(max_arity <= static_cast(ssize_t_max)); + inner_args = handle<>( + PyTuple_New(static_cast(max_arity))); + + // Fill in the positional arguments + for (std::size_t i = 0; i < n_unnamed_actual; ++i) + PyTuple_SET_ITEM(inner_args.get(), i, incref(PyTuple_GET_ITEM(args, i))); + + // Grab remaining arguments by name from the keyword dictionary + std::size_t n_actual_processed = n_unnamed_actual; + + for (std::size_t arg_pos = n_unnamed_actual; arg_pos < max_arity ; ++arg_pos) + { + // Get the keyword[, value pair] corresponding + PyObject* kv = PyTuple_GET_ITEM(f->m_arg_names.ptr(), arg_pos); + + // If there were any keyword arguments, + // look up the one we need for this + // argument position + PyObject* value = n_keyword_actual + ? PyDict_GetItem(keywords, PyTuple_GET_ITEM(kv, 0)) + : 0; + + if (!value) + { + // Not found; check if there's a default value + if (PyTuple_GET_SIZE(kv) > 1) + value = PyTuple_GET_ITEM(kv, 1); + + if (!value) + { + // still not found; matching fails + PyErr_Clear(); + inner_args = handle<>(); + break; + } + } + else + { + ++n_actual_processed; + } + + PyTuple_SET_ITEM(inner_args.get(), arg_pos, incref(value)); + } + + if (inner_args.get()) + { + //check if we proccessed all the arguments + if(n_actual_processed < n_actual) + inner_args = handle<>(); + } + } + } + } + + // Call the function. Pass keywords in case it's a + // function accepting any number of keywords + PyObject* result = inner_args ? f->m_fn(inner_args.get(), keywords) : 0; + + // If the result is NULL but no error was set, m_fn failed + // the argument-matching test. + + // This assumes that all other error-reporters are + // well-behaved and never return NULL to python without + // setting an error. + if (result != 0 || PyErr_Occurred()) + return result; + } + f = f->m_overloads.get(); + } + while (f); + // None of the overloads matched; time to generate the error message + argument_error(args, keywords); + return 0; +} + +object function::signature(bool show_return_type) const +{ + py_function const& impl = m_fn; + + python::detail::signature_element const* return_type = impl.signature(); + python::detail::signature_element const* s = return_type + 1; + + list formal_params; + if (impl.max_arity() == 0) + formal_params.append("void"); + + for (unsigned n = 0; n < impl.max_arity(); ++n) + { + if (s[n].basename == 0) + { + formal_params.append("..."); + break; + } + + str param(s[n].basename); + if (s[n].lvalue) + param += " {lvalue}"; + + if (m_arg_names) // None or empty tuple will test false + { + object kv(m_arg_names[n]); + if (kv) + { + char const* const fmt = len(kv) > 1 ? " %s=%r" : " %s"; + param += fmt % kv; + } + } + + formal_params.append(param); + } + + if (show_return_type) + return "%s(%s) -> %s" % make_tuple( + m_name, str(", ").join(formal_params), return_type->basename); + return "%s(%s)" % make_tuple( + m_name, str(", ").join(formal_params)); +} + +object function::signatures(bool show_return_type) const +{ + list result; + for (function const* f = this; f; f = f->m_overloads.get()) { + result.append(f->signature(show_return_type)); + } + return result; +} + +void function::argument_error(PyObject* args, PyObject* /*keywords*/) const +{ + static handle<> exception( + PyErr_NewException(const_cast("Boost.Python.ArgumentError"), PyExc_TypeError, 0)); + + object message = "Python argument types in\n %s.%s(" + % make_tuple(this->m_namespace, this->m_name); + + list actual_args; + for (ssize_t i = 0; i < PyTuple_Size(args); ++i) + { + char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name; + actual_args.append(str(name)); + } + message += str(", ").join(actual_args); + message += ")\ndid not match C++ signature:\n "; + message += str("\n ").join(signatures()); + +#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES + std::printf("\n--------\n%s\n--------\n", extract(message)()); +#endif + PyErr_SetObject(exception.get(), message.ptr()); + throw_error_already_set(); +} + +void function::add_overload(handle const& overload_) +{ + function* parent = this; + + while (parent->m_overloads) + parent = parent->m_overloads.get(); + + parent->m_overloads = overload_; + + // If we have no documentation, get the docs from the overload + if (!m_doc) + m_doc = overload_->m_doc; +} + +namespace +{ + char const* const binary_operator_names[] = + { + "add__", + "and__", + "div__", + "divmod__", + "eq__", + "floordiv__", + "ge__", + "gt__", + "le__", + "lshift__", + "lt__", + "mod__", + "mul__", + "ne__", + "or__", + "pow__", + "radd__", + "rand__", + "rdiv__", + "rdivmod__", + "rfloordiv__", + "rlshift__", + "rmod__", + "rmul__", + "ror__", + "rpow__", + "rrshift__", + "rshift__", + "rsub__", + "rtruediv__", + "rxor__", + "sub__", + "truediv__", + "xor__" + }; + + struct less_cstring + { + bool operator()(char const* x, char const* y) const + { + return BOOST_CSTD_::strcmp(x,y) < 0; + } + }; + + inline bool is_binary_operator(char const* name) + { + return name[0] == '_' + && name[1] == '_' + && std::binary_search( + &binary_operator_names[0] + , binary_operator_names + sizeof(binary_operator_names)/sizeof(*binary_operator_names) + , name + 2 + , less_cstring() + ); + } + + // Something for the end of the chain of binary operators + PyObject* not_implemented(PyObject*, PyObject*) + { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + + handle not_implemented_function() + { + + static object keeper( + function_object( + py_function(¬_implemented, mpl::vector1(), 2) + , python::detail::keyword_range()) + ); + return handle(borrowed(downcast(keeper.ptr()))); + } +} + +void function::add_to_namespace( + object const& name_space, char const* name_, object const& attribute) +{ + add_to_namespace(name_space, name_, attribute, 0); +} + +namespace detail +{ + extern char py_signature_tag[]; + extern char cpp_signature_tag[]; +} + +void function::add_to_namespace( + object const& name_space, char const* name_, object const& attribute, char const* doc) +{ + str const name(name_); + PyObject* const ns = name_space.ptr(); + + if (attribute.ptr()->ob_type == &function_type) + { + function* new_func = downcast(attribute.ptr()); + handle<> dict; + +#if PY_VERSION_HEX < 0x03000000 + // Old-style class gone in Python 3 + if (PyClass_Check(ns)) + dict = handle<>(borrowed(((PyClassObject*)ns)->cl_dict)); + else +#endif + if (PyType_Check(ns)) + dict = handle<>(borrowed(((PyTypeObject*)ns)->tp_dict)); + else + dict = handle<>(PyObject_GetAttrString(ns, const_cast("__dict__"))); + + if (dict == 0) + throw_error_already_set(); + + assert(!PyErr_Occurred()); + handle<> existing(allow_null(::PyObject_GetItem(dict.get(), name.ptr()))); + PyErr_Clear(); + + if (existing) + { + if (existing->ob_type == &function_type) + { + new_func->add_overload( + handle( + borrowed( + downcast(existing.get()) + ) + ) + ); + } + else if (existing->ob_type == &PyStaticMethod_Type) + { + char const* name_space_name = extract(name_space.attr("__name__")); + + ::PyErr_Format( + PyExc_RuntimeError + , "Boost.Python - All overloads must be exported " + "before calling \'class_<...>(\"%s\").staticmethod(\"%s\")\'" + , name_space_name + , name_ + ); + throw_error_already_set(); + } + } + else if (is_binary_operator(name_)) + { + // Binary operators need an additional overload which + // returns NotImplemented, so that Python will try the + // __rxxx__ functions on the other operand. We add this + // when no overloads for the operator already exist. + new_func->add_overload(not_implemented_function()); + } + + // A function is named the first time it is added to a namespace. + if (new_func->name().is_none()) + new_func->m_name = name; + + assert(!PyErr_Occurred()); + handle<> name_space_name( + allow_null(::PyObject_GetAttrString(name_space.ptr(), const_cast("__name__")))); + PyErr_Clear(); + + if (name_space_name) + new_func->m_namespace = object(name_space_name); + } + + if (PyObject_SetAttr(ns, name.ptr(), attribute.ptr()) < 0) + throw_error_already_set(); + + object mutable_attribute(attribute); +/* + if (doc != 0 && docstring_options::show_user_defined_) + { + // Accumulate documentation + + if ( + PyObject_HasAttrString(mutable_attribute.ptr(), "__doc__") + && mutable_attribute.attr("__doc__")) + { + mutable_attribute.attr("__doc__") += "\n\n"; + mutable_attribute.attr("__doc__") += doc; + } + else { + mutable_attribute.attr("__doc__") = doc; + } + } + + if (docstring_options::show_signatures_) + { + if ( PyObject_HasAttrString(mutable_attribute.ptr(), "__doc__") + && mutable_attribute.attr("__doc__")) { + mutable_attribute.attr("__doc__") += ( + mutable_attribute.attr("__doc__")[-1] != "\n" ? "\n\n" : "\n"); + } + else { + mutable_attribute.attr("__doc__") = ""; + } + function* f = downcast(attribute.ptr()); + mutable_attribute.attr("__doc__") += str("\n ").join(make_tuple( + "C++ signature:", f->signature(true))); + } + */ + str _doc; + + if (docstring_options::show_py_signatures_) + { + _doc += str(const_cast(detail::py_signature_tag)); + } + if (doc != 0 && docstring_options::show_user_defined_) + _doc += doc; + + if (docstring_options::show_cpp_signatures_) + { + _doc += str(const_cast(detail::cpp_signature_tag)); + } + if(_doc) + { + object mutable_attribute(attribute); + mutable_attribute.attr("__doc__")= _doc; + } +} + +BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute) +{ + function::add_to_namespace(name_space, name, attribute, 0); +} + +BOOST_PYTHON_DECL void add_to_namespace( + object const& name_space, char const* name, object const& attribute, char const* doc) +{ + function::add_to_namespace(name_space, name, attribute, doc); +} + + +namespace +{ + struct bind_return + { + bind_return(PyObject*& result, function const* f, PyObject* args, PyObject* keywords) + : m_result(result) + , m_f(f) + , m_args(args) + , m_keywords(keywords) + {} + + void operator()() const + { + m_result = m_f->call(m_args, m_keywords); + } + + private: + PyObject*& m_result; + function const* m_f; + PyObject* m_args; + PyObject* m_keywords; + }; +} + +extern "C" +{ + // Stolen from Python's funcobject.c + static PyObject * + function_descr_get(PyObject *func, PyObject *obj, PyObject *type_) + { +#if PY_VERSION_HEX >= 0x03000000 + // The implement is different in Python 3 because of the removal of unbound method + if (obj == Py_None || obj == NULL) { + Py_INCREF(func); + return func; + } + return PyMethod_New(func, obj); +#else + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type_); +#endif + } + + static void + function_dealloc(PyObject* p) + { + delete static_cast(p); + } + + static PyObject * + function_call(PyObject *func, PyObject *args, PyObject *kw) + { + PyObject* result = 0; + handle_exception(bind_return(result, static_cast(func), args, kw)); + return result; + } + + // + // Here we're using the function's tp_getset rather than its + // tp_members to set up __doc__ and __name__, because tp_members + // really depends on having a POD object type (it relies on + // offsets). It might make sense to reformulate function as a POD + // at some point, but this is much more expedient. + // + static PyObject* function_get_doc(PyObject* op, void*) + { + function* f = downcast(op); + list signatures = function_doc_signature_generator::function_doc_signatures(f); + if(!signatures) return python::detail::none(); + signatures.reverse(); + return python::incref( str("\n").join(signatures).ptr()); + } + + static int function_set_doc(PyObject* op, PyObject* doc, void*) + { + function* f = downcast(op); + f->doc(doc ? object(python::detail::borrowed_reference(doc)) : object()); + return 0; + } + + static PyObject* function_get_name(PyObject* op, void*) + { + function* f = downcast(op); + if (f->name().is_none()) +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else + return PyString_InternFromString(""); +#endif + else + return python::incref(f->name().ptr()); + } + + // We add a dummy __class__ attribute in order to fool PyDoc into + // treating these as built-in functions and scanning their + // documentation + static PyObject* function_get_class(PyObject* /*op*/, void*) + { + return python::incref(upcast(&PyCFunction_Type)); + } + + static PyObject* function_get_module(PyObject* op, void*) + { + function* f = downcast(op); + object const& ns = f->get_namespace(); + if (!ns.is_none()) { + return python::incref(ns.ptr()); + } + PyErr_SetString( + PyExc_AttributeError, const_cast( + "Boost.Python function __module__ unknown.")); + return 0; + } +} + +static PyGetSetDef function_getsetlist[] = { + {const_cast("__name__"), (getter)function_get_name, 0, 0, 0 }, + {const_cast("func_name"), (getter)function_get_name, 0, 0, 0 }, + {const_cast("__module__"), (getter)function_get_module, 0, 0, 0 }, + {const_cast("func_module"), (getter)function_get_module, 0, 0, 0 }, + {const_cast("__class__"), (getter)function_get_class, 0, 0, 0 }, // see note above + {const_cast("__doc__"), (getter)function_get_doc, (setter)function_set_doc, 0, 0}, + {const_cast("func_doc"), (getter)function_get_doc, (setter)function_set_doc, 0, 0}, + {NULL, 0, 0, 0, 0} /* Sentinel */ +}; + +PyTypeObject function_type = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Boost.Python.function"), + sizeof(function), + 0, + (destructor)function_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, //(reprfunc)func_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + function_call, /* tp_call */ + 0, /* tp_str */ + 0, // PyObject_GenericGetAttr, /* tp_getattro */ + 0, // PyObject_GenericSetAttr, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT /* | Py_TPFLAGS_HAVE_GC */,/* tp_flags */ + 0, /* tp_doc */ + 0, // (traverseproc)func_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, //offsetof(PyFunctionObject, func_weakreflist), /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, // func_memberlist, /* tp_members */ + function_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + function_descr_get, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, //offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +object function_object( + py_function const& f + , python::detail::keyword_range const& keywords) +{ + return python::object( + python::detail::new_non_null_reference( + new function( + f, keywords.first, keywords.second - keywords.first))); +} + +object function_object(py_function const& f) +{ + return function_object(f, python::detail::keyword_range()); +} + + +handle<> function_handle_impl(py_function const& f) +{ + return python::handle<>( + allow_null( + new function(f, 0, 0))); +} + +} // namespace objects + +namespace detail +{ + object BOOST_PYTHON_DECL make_raw_function(objects::py_function f) + { + static keyword k; + + return objects::function_object( + f + , keyword_range(&k,&k)); + } + void BOOST_PYTHON_DECL pure_virtual_called() + { + PyErr_SetString( + PyExc_RuntimeError, const_cast("Pure virtual function called")); + throw_error_already_set(); + } +} + +}} // namespace boost::python diff --git a/pxr/external/boost/python/src/object/function_doc_signature.cpp b/pxr/external/boost/python/src/object/function_doc_signature.cpp new file mode 100644 index 0000000000..41695285ac --- /dev/null +++ b/pxr/external/boost/python/src/object/function_doc_signature.cpp @@ -0,0 +1,344 @@ +// Copyright Nikolay Mladenov 2007. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// boost::python::make_tuple below are for gcc 4.4 -std=c++0x compatibility +// (Intel C++ 10 and 11 with -std=c++0x don't need the full qualification). + +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace boost { namespace python { namespace objects { + + bool function_doc_signature_generator::arity_cmp( function const *f1, function const *f2 ) + { + return f1->m_fn.max_arity() < f2->m_fn.max_arity(); + } + + bool function_doc_signature_generator::are_seq_overloads( function const *f1, function const *f2 , bool check_docs) + { + py_function const & impl1 = f1->m_fn; + py_function const & impl2 = f2->m_fn; + + //the number of parameters differs by 1 + if (impl2.max_arity()-impl1.max_arity() != 1) + return false; + + // if check docs then f1 shold not have docstring or have the same docstring as f2 + if (check_docs && f2->doc() != f1->doc() && f1->doc()) + return false; + + python::detail::signature_element const* s1 = impl1.signature(); + python::detail::signature_element const* s2 = impl2.signature(); + + unsigned size = impl1.max_arity()+1; + + for (unsigned i = 0; i != size; ++i) + { + //check if the argument types are the same + if (s1[i].basename != s2[i].basename) + return false; + + //return type + if (!i) continue; + + //check if the argument default values are the same + bool f1_has_names = bool(f1->m_arg_names); + bool f2_has_names = bool(f2->m_arg_names); + if ( (f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=f1->m_arg_names[i-1]) + || (f1_has_names && !f2_has_names) + || (!f1_has_names && f2_has_names && f2->m_arg_names[i-1]!=python::object()) + ) + return false; + } + return true; + } + + std::vector function_doc_signature_generator::flatten(function const *f) + { + object name = f->name(); + + std::vector res; + + while (f) { + + //this if takes out the not_implemented_function + if (f->name() == name) + res.push_back(f); + + f=f->m_overloads.get(); + } + + //std::sort(res.begin(),res.end(), &arity_cmp); + + return res; + } + std::vector function_doc_signature_generator::split_seq_overloads( const std::vector &funcs, bool split_on_doc_change) + { + std::vector res; + + std::vector::const_iterator fi = funcs.begin(); + + function const * last = *fi; + + while (++fi != funcs.end()){ + + //check if fi starts a new chain of overloads + if (!are_seq_overloads( last, *fi, split_on_doc_change )) + res.push_back(last); + + last = *fi; + } + + if (last) + res.push_back(last); + + return res; + } + + str function_doc_signature_generator::raw_function_pretty_signature(function const *f, size_t n_overloads, bool cpp_types ) + { + str res("object"); + + res = str("%s %s(%s)" % make_tuple( res, f->m_name, str("tuple args, dict kwds")) ); + + return res; + } + + const char * function_doc_signature_generator::py_type_str(const python::detail::signature_element &s) + { + if (s.basename==std::string("void")){ + static const char * none = "None"; + return none; + } + + PyTypeObject const * py_type = s.pytype_f?s.pytype_f():0; + if ( py_type ) + return py_type->tp_name; + else{ + static const char * object = "object"; + return object; + } + } + + str function_doc_signature_generator::parameter_string(py_function const &f, size_t n, object arg_names, bool cpp_types) + { + str param; + + python::detail::signature_element const * s = f.signature(); + if (cpp_types) + { + if(!n) + s = &f.get_return_type(); + if (s[n].basename == 0) + { + return str("..."); + } + + param = str(s[n].basename); + + if (s[n].lvalue) + param += " {lvalue}"; + + } + else + { + if (n) //we are processing an argument and trying to come up with a name for it + { + object kv; + if ( arg_names && (kv = arg_names[n-1]) ) + param = str( " (%s)%s" % make_tuple(py_type_str(s[n]),kv[0]) ); + else + param = str(" (%s)%s%d" % make_tuple(py_type_str(s[n]),"arg", n) ); + } + else //we are processing the return type + param = py_type_str(f.get_return_type()); + } + + //an argument - check for default value and append it + if(n && arg_names) + { + object kv(arg_names[n-1]); + if (kv && len(kv) == 2) + { + param = str("%s=%r" % make_tuple(param, kv[1])); + } + } + return param; + } + + str function_doc_signature_generator::pretty_signature(function const *f, size_t n_overloads, bool cpp_types ) + { + py_function + const& impl = f->m_fn; + ; + + + unsigned arity = impl.max_arity(); + + if(arity == unsigned(-1))// is this the proper raw function test? + { + return raw_function_pretty_signature(f,n_overloads,cpp_types); + } + + list formal_params; + + size_t n_extra_default_args=0; + + for (unsigned n = 0; n <= arity; ++n) + { + str param; + + formal_params.append( + parameter_string(impl, n, f->m_arg_names, cpp_types) + ); + + // find all the arguments with default values preceeding the arity-n_overloads + if (n && f->m_arg_names) + { + object kv(f->m_arg_names[n-1]); + + if (kv && len(kv) == 2) + { + //default argument preceeding the arity-n_overloads + if( n <= arity-n_overloads) + ++n_extra_default_args; + } + else + //argument without default, preceeding the arity-n_overloads + if( n <= arity-n_overloads) + n_extra_default_args = 0; + } + } + + n_overloads+=n_extra_default_args; + + if (!arity && cpp_types) + formal_params.append("void"); + + str ret_type (formal_params.pop(0)); + if (cpp_types ) + { + return str( + "%s %s(%s%s%s%s)" + % boost::python::make_tuple // workaround, see top + ( ret_type + , f->m_name + , str(",").join(formal_params.slice(0,arity-n_overloads)) + , n_overloads ? (n_overloads!=arity?str(" [,"):str("[ ")) : str() + , str(" [,").join(formal_params.slice(arity-n_overloads,arity)) + , std::string(n_overloads,']') + )); + }else{ + return str( + "%s(%s%s%s%s) -> %s" + % boost::python::make_tuple // workaround, see top + ( f->m_name + , str(",").join(formal_params.slice(0,arity-n_overloads)) + , n_overloads ? (n_overloads!=arity?str(" [,"):str("[ ")) : str() + , str(" [,").join(formal_params.slice(arity-n_overloads,arity)) + , std::string(n_overloads,']') + , ret_type + )); + } + + return str( + "%s %s(%s%s%s%s) %s" + % boost::python::make_tuple // workaround, see top + ( cpp_types?ret_type:str("") + , f->m_name + , str(",").join(formal_params.slice(0,arity-n_overloads)) + , n_overloads ? (n_overloads!=arity?str(" [,"):str("[ ")) : str() + , str(" [,").join(formal_params.slice(arity-n_overloads,arity)) + , std::string(n_overloads,']') + , cpp_types?str(""):ret_type + )); + + } + + namespace detail { + char py_signature_tag[] = "PY signature :"; + char cpp_signature_tag[] = "C++ signature :"; + } + + list function_doc_signature_generator::function_doc_signatures( function const * f) + { + list signatures; + std::vector funcs = flatten( f); + std::vector split_funcs = split_seq_overloads( funcs, true); + std::vector::const_iterator sfi=split_funcs.begin(), fi; + size_t n_overloads=0; + for (fi=funcs.begin(); fi!=funcs.end(); ++fi) + { + if(*sfi == *fi){ + if((*fi)->doc()) + { + str func_doc = str((*fi)->doc()); + + int doc_len = len(func_doc); + + bool show_py_signature = doc_len >= int(sizeof(detail::py_signature_tag)/sizeof(char)-1) + && str(detail::py_signature_tag) == func_doc.slice(0, int(sizeof(detail::py_signature_tag)/sizeof(char))-1); + if(show_py_signature) + { + func_doc = str(func_doc.slice(int(sizeof(detail::py_signature_tag)/sizeof(char))-1, _)); + doc_len = len(func_doc); + } + + bool show_cpp_signature = doc_len >= int(sizeof(detail::cpp_signature_tag)/sizeof(char)-1) + && str(detail::cpp_signature_tag) == func_doc.slice( 1-int(sizeof(detail::cpp_signature_tag)/sizeof(char)), _); + + if(show_cpp_signature) + { + func_doc = str(func_doc.slice(_, 1-int(sizeof(detail::cpp_signature_tag)/sizeof(char)))); + doc_len = len(func_doc); + } + + str res="\n"; + str pad = "\n"; + + if(show_py_signature) + { + str sig = pretty_signature(*fi, n_overloads,false); + res+=sig; + if(doc_len || show_cpp_signature )res+=" :"; + pad+= str(" "); + } + + if(doc_len) + { + if(show_py_signature) + res+=pad; + res+= pad.join(func_doc.split("\n")); + } + + if( show_cpp_signature) + { + if(len(res)>1) + res+="\n"+pad; + res+=detail::cpp_signature_tag+pad+" "+pretty_signature(*fi, n_overloads,true); + } + + signatures.append(res); + } + ++sfi; + n_overloads = 0; + }else + ++n_overloads ; + } + + return signatures; + } + + +}}} + diff --git a/pxr/external/boost/python/src/object/inheritance.cpp b/pxr/external/boost/python/src/object/inheritance.cpp new file mode 100644 index 0000000000..a7b3156e41 --- /dev/null +++ b/pxr/external/boost/python/src/object/inheritance.cpp @@ -0,0 +1,496 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#if _MSC_FULL_VER >= 13102171 && _MSC_FULL_VER <= 13102179 +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// Procedure: +// +// The search is a BFS over the space of (type,address) pairs +// guided by the edges of the casting graph whose nodes +// correspond to classes, and whose edges are traversed by +// applying associated cast functions to an address. We use +// vertex distance to the goal node in the cast_graph to rate the +// paths. The vertex distance to any goal node is calculated on +// demand and outdated by the addition of edges to the graph. + +namespace boost { +namespace +{ + enum edge_cast_t { edge_cast = 8010 }; + template inline void unused_variable(const T&) { } +} + +// Install properties +BOOST_INSTALL_PROPERTY(edge, cast); + +namespace +{ + typedef void*(*cast_function)(void*); + + // + // Here we put together the low-level data structures of the + // casting graph representation. + // + typedef python::type_info class_id; + + // represents a graph of available casts + +#if 0 + struct cast_graph + : +#else + typedef +#endif + adjacency_list > > +#if 0 + {}; +#else + cast_graph; +#endif + + typedef cast_graph::vertex_descriptor vertex_t; + typedef cast_graph::edge_descriptor edge_t; + + struct smart_graph + { + typedef std::vector::const_iterator node_distance_map; + + typedef std::pair out_edges_t; + + // Return a map of the distances from any node to the given + // target node + node_distance_map distances_to(vertex_t target) const + { + std::size_t n = num_vertices(m_topology); + if (m_distances.size() != n * n) + { + m_distances.clear(); + m_distances.resize(n * n, (std::numeric_limits::max)()); + m_known_vertices = n; + } + + std::vector::iterator to_target = m_distances.begin() + n * target; + + // this node hasn't been used as a target yet + if (to_target[target] != 0) + { + typedef reverse_graph reverse_cast_graph; + reverse_cast_graph reverse_topology(m_topology); + + to_target[target] = 0; + + breadth_first_search( + reverse_topology, target + , visitor( + make_bfs_visitor( + record_distances( + make_iterator_property_map( + to_target + , get(vertex_index, reverse_topology) +# ifdef BOOST_NO_STD_ITERATOR_TRAITS + , *to_target +# endif + ) + , on_tree_edge() + )))); + } + + return to_target; + } + + cast_graph& topology() { return m_topology; } + cast_graph const& topology() const { return m_topology; } + + smart_graph() + : m_known_vertices(0) + {} + + private: + cast_graph m_topology; + mutable std::vector m_distances; + mutable std::size_t m_known_vertices; + }; + + smart_graph& full_graph() + { + static smart_graph x; + return x; + } + + smart_graph& up_graph() + { + static smart_graph x; + return x; + } + + // + // Our index of class types + // + using boost::python::objects::dynamic_id_function; + typedef tuples::tuple< + class_id // static type + , vertex_t // corresponding vertex + , dynamic_id_function // dynamic_id if polymorphic, or 0 + > + index_entry_interface; + typedef index_entry_interface::inherited index_entry; + enum { ksrc_static_t, kvertex, kdynamic_id }; + + typedef std::vector type_index_t; + + + type_index_t& type_index() + { + static type_index_t x; + return x; + } + + template + struct select1st + { + typedef typename tuples::element<0, Tuple>::type result_type; + + result_type const& operator()(Tuple const& x) const + { + return tuples::get<0>(x); + } + }; + + // map a type to a position in the index + inline type_index_t::iterator type_position(class_id type) + { + using namespace boost::placeholders; + typedef index_entry entry; + + return std::lower_bound( + type_index().begin(), type_index().end() + , boost::make_tuple(type, vertex_t(), dynamic_id_function(0)) + , boost::bind(std::less() + , boost::bind(select1st(), _1) + , boost::bind(select1st(), _2))); + } + + inline index_entry* seek_type(class_id type) + { + type_index_t::iterator p = type_position(type); + if (p == type_index().end() || tuples::get(*p) != type) + return 0; + else + return &*p; + } + + // Get the entry for a type, inserting if necessary + inline type_index_t::iterator demand_type(class_id type) + { + type_index_t::iterator p = type_position(type); + + if (p != type_index().end() && tuples::get(*p) == type) + return p; + + vertex_t v = add_vertex(full_graph().topology()); + vertex_t v2 = add_vertex(up_graph().topology()); + unused_variable(v2); + assert(v == v2); + return type_index().insert(p, boost::make_tuple(type, v, dynamic_id_function(0))); + } + + // Map a two types to a vertex in the graph, inserting if necessary + typedef std::pair + type_index_iterator_pair; + + inline type_index_iterator_pair + demand_types(class_id t1, class_id t2) + { + // be sure there will be no reallocation + type_index().reserve(type_index().size() + 2); + type_index_t::iterator first = demand_type(t1); + type_index_t::iterator second = demand_type(t2); + if (first == second) + ++first; + return std::make_pair(first, second); + } + + struct q_elt + { + q_elt(std::size_t distance + , void* src_address + , vertex_t target + , cast_function cast + ) + : distance(distance) + , src_address(src_address) + , target(target) + , cast(cast) + {} + + std::size_t distance; + void* src_address; + vertex_t target; + cast_function cast; + + bool operator<(q_elt const& rhs) const + { + return distance < rhs.distance; + } + }; + + // Optimization: + // + // Given p, src_t, dst_t + // + // Get a pointer pd to the most-derived object + // if it's polymorphic, dynamic_cast to void* + // otherwise pd = p + // + // Get the most-derived typeid src_td + // + // ptrdiff_t offset = p - pd + // + // Now we can keep a cache, for [src_t, offset, src_td, dst_t] of + // the cast transformation function to use on p and the next src_t + // in the chain. src_td, dst_t don't change throughout this + // process. In order to represent unreachability, when a pair is + // found to be unreachable, we stick a 0-returning "dead-cast" + // function in the cache. + + // This is needed in a few places below + inline void* identity_cast(void* p) + { + return p; + } + + void* search(smart_graph const& g, void* p, vertex_t src, vertex_t dst) + { + // I think this test was thoroughly bogus -- dwa + // If we know there's no path; bail now. + // if (src > g.known_vertices() || dst > g.known_vertices()) + // return 0; + + smart_graph::node_distance_map d(g.distances_to(dst)); + + if (d[src] == (std::numeric_limits::max)()) + return 0; + + typedef property_map::const_type cast_map; + cast_map casts = get(edge_cast, g.topology()); + + typedef std::pair search_state; + typedef std::vector visited_t; + visited_t visited; + std::priority_queue q; + + q.push(q_elt(d[src], p, src, identity_cast)); + while (!q.empty()) + { + q_elt top = q.top(); + q.pop(); + + // Check to see if we have a real state + void* dst_address = top.cast(top.src_address); + if (dst_address == 0) + continue; + + if (top.target == dst) + return dst_address; + + search_state s(top.target,dst_address); + + visited_t::iterator pos = std::lower_bound( + visited.begin(), visited.end(), s); + + // If already visited, continue + if (pos != visited.end() && *pos == s) + continue; + + visited.insert(pos, s); // mark it + + // expand it: + smart_graph::out_edges_t edges = out_edges(s.first, g.topology()); + for (cast_graph::out_edge_iterator p = edges.first + , finish = edges.second + ; p != finish + ; ++p + ) + { + edge_t e = *p; + q.push(q_elt( + d[target(e, g.topology())] + , dst_address + , target(e, g.topology()) + , boost::get(casts, e))); + } + } + return 0; + } + + struct cache_element + { + typedef tuples::tuple< + class_id // source static type + , class_id // target type + , std::ptrdiff_t // offset within source object + , class_id // source dynamic type + >::inherited key_type; + + cache_element(key_type const& k) + : key(k) + , offset(0) + {} + + key_type key; + std::ptrdiff_t offset; + + BOOST_STATIC_CONSTANT( + std::ptrdiff_t, not_found = integer_traits::const_min); + + bool operator<(cache_element const& rhs) const + { + return this->key < rhs.key; + } + + bool unreachable() const + { + return offset == not_found; + } + }; + + enum { kdst_t = ksrc_static_t + 1, koffset, ksrc_dynamic_t }; + typedef std::vector cache_t; + + cache_t& cache() + { + static cache_t x; + return x; + } + + inline void* convert_type(void* const p, class_id src_t, class_id dst_t, bool polymorphic) + { + // Quickly rule out unregistered types + index_entry* src_p = seek_type(src_t); + if (src_p == 0) + return 0; + + index_entry* dst_p = seek_type(dst_t); + if (dst_p == 0) + return 0; + + // Look up the dynamic_id function and call it to get the dynamic + // info + boost::python::objects::dynamic_id_t dynamic_id = polymorphic + ? tuples::get(*src_p)(p) + : std::make_pair(p, src_t); + + // Look in the cache first for a quickie address translation + std::ptrdiff_t offset = (char*)p - (char*)dynamic_id.first; + + cache_element seek(boost::make_tuple(src_t, dst_t, offset, dynamic_id.second)); + cache_t& c = cache(); + cache_t::iterator const cache_pos + = std::lower_bound(c.begin(), c.end(), seek); + + + // if found in the cache, we're done + if (cache_pos != c.end() && cache_pos->key == seek.key) + { + return cache_pos->offset == cache_element::not_found + ? 0 : (char*)p + cache_pos->offset; + } + + // If we are starting at the most-derived type, only look in the up graph + smart_graph const& g = polymorphic && dynamic_id.second != src_t + ? full_graph() : up_graph(); + + void* result = search( + g, p, tuples::get(*src_p) + , tuples::get(*dst_p)); + + // update the cache + c.insert(cache_pos, seek)->offset + = (result == 0) ? cache_element::not_found : (char*)result - (char*)p; + + return result; + } +} + +namespace python { namespace objects { + +BOOST_PYTHON_DECL void* find_dynamic_type(void* p, class_id src_t, class_id dst_t) +{ + return convert_type(p, src_t, dst_t, true); +} + +BOOST_PYTHON_DECL void* find_static_type(void* p, class_id src_t, class_id dst_t) +{ + return convert_type(p, src_t, dst_t, false); +} + +BOOST_PYTHON_DECL void add_cast( + class_id src_t, class_id dst_t, cast_function cast, bool is_downcast) +{ + // adding an edge will invalidate any record of unreachability in + // the cache. + static std::size_t expected_cache_len = 0; + cache_t& c = cache(); + if (c.size() > expected_cache_len) + { + c.erase(std::remove_if( + c.begin(), c.end(), + mem_fn(&cache_element::unreachable)) + , c.end()); + + // If any new cache entries get added, we'll have to do this + // again when the next edge is added + expected_cache_len = c.size(); + } + + type_index_iterator_pair types = demand_types(src_t, dst_t); + vertex_t src = tuples::get(*types.first); + vertex_t dst = tuples::get(*types.second); + + cast_graph* const g[2] = { &up_graph().topology(), &full_graph().topology() }; + + for (cast_graph*const* p = g + (is_downcast ? 1 : 0); p < g + 2; ++p) + { + edge_t e; + bool added; + + tie(e, added) = add_edge(src, dst, **p); + assert(added); + + put(get(edge_cast, **p), e, cast); + put(get(edge_index, **p), e, num_edges(full_graph().topology()) - 1); + } +} + +BOOST_PYTHON_DECL void register_dynamic_id_aux( + class_id static_id, dynamic_id_function get_dynamic_id) +{ + tuples::get(*demand_type(static_id)) = get_dynamic_id; +} + +}}} // namespace boost::python::objects diff --git a/pxr/external/boost/python/src/object/iterator.cpp b/pxr/external/boost/python/src/object/iterator.cpp new file mode 100644 index 0000000000..6b885a982c --- /dev/null +++ b/pxr/external/boost/python/src/object/iterator.cpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +namespace boost { namespace python { namespace objects { + +namespace +{ + PyObject* identity(PyObject* args_, PyObject*) + { + PyObject* x = PyTuple_GET_ITEM(args_,0); + Py_INCREF(x); + return x; + } +} + +BOOST_PYTHON_DECL object const& identity_function() +{ + static object result( + function_object( + py_function(&identity, mpl::vector2()) + ) + ); + return result; +} + +void stop_iteration_error() +{ + PyErr_SetObject(PyExc_StopIteration, Py_None); + throw_error_already_set(); +} + +}}} // namespace boost::python::objects diff --git a/pxr/external/boost/python/src/object/life_support.cpp b/pxr/external/boost/python/src/object/life_support.cpp new file mode 100644 index 0000000000..281c3bffc5 --- /dev/null +++ b/pxr/external/boost/python/src/object/life_support.cpp @@ -0,0 +1,121 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +namespace boost { namespace python { namespace objects { + +struct life_support +{ + PyObject_HEAD + PyObject* patient; +}; + +extern "C" +{ + static void + life_support_dealloc(PyObject* self) + { + Py_XDECREF(((life_support*)self)->patient); + self->ob_type->tp_free(self); + } + + static PyObject * + life_support_call(PyObject *self, PyObject *arg, PyObject * /*kw*/) + { + // Let the patient die now + Py_XDECREF(((life_support*)self)->patient); + ((life_support*)self)->patient = 0; + // Let the weak reference die. This probably kills us. + Py_XDECREF(PyTuple_GET_ITEM(arg, 0)); + return ::boost::python::detail::none(); + } +} + +PyTypeObject life_support_type = { + PyVarObject_HEAD_INIT(NULL, 0)//(&PyType_Type) + const_cast("Boost.Python.life_support"), + sizeof(life_support), + 0, + life_support_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, //(reprfunc)func_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + life_support_call, /* tp_call */ + 0, /* tp_str */ + 0, // PyObject_GenericGetAttr, /* tp_getattro */ + 0, // PyObject_GenericSetAttr, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT /* | Py_TPFLAGS_HAVE_GC */,/* tp_flags */ + 0, /* tp_doc */ + 0, // (traverseproc)func_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, //offsetof(PyLife_SupportObject, func_weakreflist), /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, // func_memberlist, /* tp_members */ + 0, //func_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, //offsetof(PyLife_SupportObject, func_dict), /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient) +{ + if (nurse == Py_None || nurse == patient) + return nurse; + + if (Py_TYPE(&life_support_type) == 0) + { + Py_SET_TYPE(&life_support_type, &PyType_Type); + PyType_Ready(&life_support_type); + } + + life_support* system = PyObject_New(life_support, &life_support_type); + if (!system) + return 0; + + system->patient = 0; + + // We're going to leak this reference, but don't worry; the + // life_support system decrements it when the nurse dies. + PyObject* weakref = PyWeakref_NewRef(nurse, (PyObject*)system); + + // weakref has either taken ownership, or we have to release it + // anyway + Py_DECREF(system); + if (!weakref) + return 0; + + system->patient = patient; + Py_XINCREF(patient); // hang on to the patient until death + return weakref; +} + +}}} // namespace boost::python::objects diff --git a/pxr/external/boost/python/src/object/pickle_support.cpp b/pxr/external/boost/python/src/object/pickle_support.cpp new file mode 100644 index 0000000000..428c07b6ca --- /dev/null +++ b/pxr/external/boost/python/src/object/pickle_support.cpp @@ -0,0 +1,78 @@ +// (C) Copyright R.W. Grosse-Kunstleve 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace python { + +namespace { + + tuple instance_reduce(object instance_obj) + { + list result; + object instance_class(instance_obj.attr("__class__")); + result.append(instance_class); + object none; + if (!getattr(instance_obj, "__safe_for_unpickling__", none)) + { + str type_name(getattr(instance_class, "__name__")); + str module_name(getattr(instance_class, "__module__", object(""))); + if (module_name) + module_name += "."; + + PyErr_SetObject( + PyExc_RuntimeError, + ( "Pickling of \"%s\" instances is not enabled" + " (http://www.boost.org/libs/python/doc/v2/pickle.html)" + % (module_name+type_name)).ptr() + ); + + throw_error_already_set(); + } + object getinitargs = getattr(instance_obj, "__getinitargs__", none); + tuple initargs; + if (!getinitargs.is_none()) { + initargs = tuple(getinitargs()); + } + result.append(initargs); + object getstate = getattr(instance_obj, "__getstate__", none); + object instance_dict = getattr(instance_obj, "__dict__", none); + long len_instance_dict = 0; + if (!instance_dict.is_none()) { + len_instance_dict = len(instance_dict); + } + if (!getstate.is_none()) { + if (len_instance_dict > 0) { + object getstate_manages_dict = getattr( + instance_obj, "__getstate_manages_dict__", none); + if (getstate_manages_dict.is_none()) { + PyErr_SetString(PyExc_RuntimeError, + "Incomplete pickle support" + " (__getstate_manages_dict__ not set)"); + throw_error_already_set(); + } + } + result.append(getstate()); + } + else if (len_instance_dict > 0) { + result.append(instance_dict); + } + return tuple(result); + } + +} // namespace + +object const& make_instance_reduce_function() +{ + static object result(&instance_reduce); + return result; +} + +}} // namespace boost::python diff --git a/pxr/external/boost/python/src/object/stl_iterator.cpp b/pxr/external/boost/python/src/object/stl_iterator.cpp new file mode 100644 index 0000000000..e32d321452 --- /dev/null +++ b/pxr/external/boost/python/src/object/stl_iterator.cpp @@ -0,0 +1,48 @@ +// Copyright Eric Niebler 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Credits: +// Andreas Kl\:ockner for fixing increment() to handle +// error conditions. + +#include +#include +#include + +namespace boost { namespace python { namespace objects +{ + +stl_input_iterator_impl::stl_input_iterator_impl() + : it_() + , ob_() +{ +} + +stl_input_iterator_impl::stl_input_iterator_impl(boost::python::object const &ob) + : it_(ob.attr("__iter__")()) + , ob_() +{ + this->increment(); +} + +void stl_input_iterator_impl::increment() +{ + this->ob_ = boost::python::handle<>( + boost::python::allow_null(PyIter_Next(this->it_.ptr()))); + if (PyErr_Occurred()) + throw boost::python::error_already_set(); +} + +bool stl_input_iterator_impl::equal(stl_input_iterator_impl const &that) const +{ + return !this->ob_ == !that.ob_; +} + +boost::python::handle<> const &stl_input_iterator_impl::current() const +{ + return this->ob_; +} + +}}} // namespace boost::python::objects diff --git a/pxr/external/boost/python/src/object_operators.cpp b/pxr/external/boost/python/src/object_operators.cpp new file mode 100644 index 0000000000..b993245fe9 --- /dev/null +++ b/pxr/external/boost/python/src/object_operators.cpp @@ -0,0 +1,85 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +namespace boost { namespace python { namespace api { + +# define BOOST_PYTHON_COMPARE_OP(op, opid) \ +BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ +{ \ + return object( \ + detail::new_reference( \ + PyObject_RichCompare( \ + l.ptr(), r.ptr(), opid)) \ + ); \ +} +BOOST_PYTHON_COMPARE_OP(>, Py_GT) +BOOST_PYTHON_COMPARE_OP(>=, Py_GE) +BOOST_PYTHON_COMPARE_OP(<, Py_LT) +BOOST_PYTHON_COMPARE_OP(<=, Py_LE) +BOOST_PYTHON_COMPARE_OP(==, Py_EQ) +BOOST_PYTHON_COMPARE_OP(!=, Py_NE) +# undef BOOST_PYTHON_COMPARE_OP + + +#define BOOST_PYTHON_BINARY_OPERATOR(op, name) \ +BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ +{ \ + return object( \ + detail::new_reference( \ + PyNumber_##name(l.ptr(), r.ptr())) \ + ); \ +} + +BOOST_PYTHON_BINARY_OPERATOR(+, Add) +BOOST_PYTHON_BINARY_OPERATOR(-, Subtract) +BOOST_PYTHON_BINARY_OPERATOR(*, Multiply) +#if PY_VERSION_HEX >= 0x03000000 +// We choose FloorDivide instead of TrueDivide to keep the semantic +// conform with C/C++'s '/' operator +BOOST_PYTHON_BINARY_OPERATOR(/, FloorDivide) +#else +BOOST_PYTHON_BINARY_OPERATOR(/, Divide) +#endif +BOOST_PYTHON_BINARY_OPERATOR(%, Remainder) +BOOST_PYTHON_BINARY_OPERATOR(<<, Lshift) +BOOST_PYTHON_BINARY_OPERATOR(>>, Rshift) +BOOST_PYTHON_BINARY_OPERATOR(&, And) +BOOST_PYTHON_BINARY_OPERATOR(^, Xor) +BOOST_PYTHON_BINARY_OPERATOR(|, Or) +#undef BOOST_PYTHON_BINARY_OPERATOR + +#define BOOST_PYTHON_INPLACE_OPERATOR(op, name) \ +BOOST_PYTHON_DECL object& operator op##=(object& l, object const& r) \ +{ \ + return l = object( \ + (detail::new_reference) \ + PyNumber_InPlace##name(l.ptr(), r.ptr())); \ +} + +BOOST_PYTHON_INPLACE_OPERATOR(+, Add) +BOOST_PYTHON_INPLACE_OPERATOR(-, Subtract) +BOOST_PYTHON_INPLACE_OPERATOR(*, Multiply) +#if PY_VERSION_HEX >= 0x03000000 +// Same reason as above for choosing FloorDivide instead of TrueDivide +BOOST_PYTHON_INPLACE_OPERATOR(/, FloorDivide) +#else +BOOST_PYTHON_INPLACE_OPERATOR(/, Divide) +#endif +BOOST_PYTHON_INPLACE_OPERATOR(%, Remainder) +BOOST_PYTHON_INPLACE_OPERATOR(<<, Lshift) +BOOST_PYTHON_INPLACE_OPERATOR(>>, Rshift) +BOOST_PYTHON_INPLACE_OPERATOR(&, And) +BOOST_PYTHON_INPLACE_OPERATOR(^, Xor) +BOOST_PYTHON_INPLACE_OPERATOR(|, Or) +#undef BOOST_PYTHON_INPLACE_OPERATOR + +object::object(handle<> const& x) + : object_base(python::incref(python::expect_non_null(x.get()))) +{} + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/object_protocol.cpp b/pxr/external/boost/python/src/object_protocol.cpp new file mode 100644 index 0000000000..95c8c73ee6 --- /dev/null +++ b/pxr/external/boost/python/src/object_protocol.cpp @@ -0,0 +1,197 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +namespace boost { namespace python { namespace api { + +BOOST_PYTHON_DECL object getattr(object const& target, object const& key) +{ + return object(detail::new_reference(PyObject_GetAttr(target.ptr(), key.ptr()))); +} + +BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_) +{ + PyObject* result = PyObject_GetAttr(target.ptr(), key.ptr()); + if (result == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) + { + PyErr_Clear(); + return default_; + } + return object(detail::new_reference(result)); +} + +BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value) +{ + if (PyObject_SetAttr(target.ptr(), key.ptr(), value.ptr()) == -1) + throw_error_already_set(); +} + +BOOST_PYTHON_DECL void delattr(object const& target, object const& key) +{ + if (PyObject_DelAttr(target.ptr(), key.ptr()) == -1) + throw_error_already_set(); +} + +BOOST_PYTHON_DECL object getattr(object const& target, char const* key) +{ + return object( + detail::new_reference( + PyObject_GetAttrString(target.ptr(), const_cast(key)) + )); +} + +BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_) +{ + PyObject* result = PyObject_GetAttrString(target.ptr(), const_cast(key)); + if (result == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) + { + PyErr_Clear(); + return default_; + } + return object(detail::new_reference(result)); + +} +BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value) +{ + if (PyObject_SetAttrString( + target.ptr(), const_cast(key), value.ptr()) == -1 + ) + { + throw_error_already_set(); + } +} + +BOOST_PYTHON_DECL void delattr(object const& target, char const* key) +{ + if (PyObject_DelAttrString( + target.ptr(), const_cast(key)) == -1 + ) + { + throw_error_already_set(); + } +} + +BOOST_PYTHON_DECL object getitem(object const& target, object const& key) +{ + return object(detail::new_reference( + PyObject_GetItem(target.ptr(), key.ptr()))); +} + +BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value) +{ + if (PyObject_SetItem(target.ptr(), key.ptr(), value.ptr()) == -1) + throw_error_already_set(); +} + +BOOST_PYTHON_DECL void delitem(object const& target, object const& key) +{ + if (PyObject_DelItem(target.ptr(), key.ptr()) == -1) + throw_error_already_set(); +} + +namespace // slicing code copied directly out of the Python implementation +{ + #undef ISINT + #define ISINT(x) ((x) == NULL || PyInt_Check(x) || PyLong_Check(x)) + + static PyObject * + apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */ + { +#if PY_VERSION_HEX < 0x03000000 + PyTypeObject *tp = u->ob_type; + PySequenceMethods *sq = tp->tp_as_sequence; + + if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { + ssize_t ilow = 0, ihigh = ssize_t_max; + if (!_PyEval_SliceIndex(v, &ilow)) + return NULL; + if (!_PyEval_SliceIndex(w, &ihigh)) + return NULL; + return PySequence_GetSlice(u, ilow, ihigh); + } + else +#endif + { + PyObject *slice = PySlice_New(v, w, NULL); + if (slice != NULL) { + PyObject *res = PyObject_GetItem(u, slice); + Py_DECREF(slice); + return res; + } + else + return NULL; + } + } + + static int + assign_slice(PyObject *u, PyObject *v, PyObject *w, PyObject *x) + /* u[v:w] = x */ + { +#if PY_VERSION_HEX < 0x03000000 + PyTypeObject *tp = u->ob_type; + PySequenceMethods *sq = tp->tp_as_sequence; + + if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { + ssize_t ilow = 0, ihigh = ssize_t_max; + if (!_PyEval_SliceIndex(v, &ilow)) + return -1; + if (!_PyEval_SliceIndex(w, &ihigh)) + return -1; + if (x == NULL) + return PySequence_DelSlice(u, ilow, ihigh); + else + return PySequence_SetSlice(u, ilow, ihigh, x); + } + else +#endif + { + PyObject *slice = PySlice_New(v, w, NULL); + if (slice != NULL) { + int res; + if (x != NULL) + res = PyObject_SetItem(u, slice, x); + else + res = PyObject_DelItem(u, slice); + Py_DECREF(slice); + return res; + } + else + return -1; + } + } +} + +BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end) +{ + return object( + detail::new_reference( + apply_slice(target.ptr(), begin.get(), end.get()))); +} + +BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value) +{ + if (assign_slice( + target.ptr(), begin.get(), end.get(), value.ptr()) == -1 + ) + { + throw_error_already_set(); + } +} + +BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end) +{ + if (assign_slice( + target.ptr(), begin.get(), end.get(), 0) == -1 + ) + { + throw_error_already_set(); + } +} + +}}} // namespace boost::python::api diff --git a/pxr/external/boost/python/src/slice.cpp b/pxr/external/boost/python/src/slice.cpp new file mode 100644 index 0000000000..ee55f94846 --- /dev/null +++ b/pxr/external/boost/python/src/slice.cpp @@ -0,0 +1,37 @@ +#include "boost/python/slice.hpp" + +// Copyright (c) 2004 Jonathan Brandmeyer +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + +namespace boost { namespace python { namespace detail { + +slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step) + : object(detail::new_reference( PySlice_New(start, stop, step))) +{ +} + +object +slice_base::start() const +{ + return object( detail::borrowed_reference( + ((PySliceObject*)this->ptr())->start)); +} + +object +slice_base::stop() const +{ + return object( detail::borrowed_reference( + ((PySliceObject*)this->ptr())->stop)); +} + +object +slice_base::step() const +{ + return object( detail::borrowed_reference( + ((PySliceObject*)this->ptr())->step)); +} + +} } } // !namespace boost::python::detail diff --git a/pxr/external/boost/python/src/str.cpp b/pxr/external/boost/python/src/str.cpp new file mode 100644 index 0000000000..5122f7f57f --- /dev/null +++ b/pxr/external/boost/python/src/str.cpp @@ -0,0 +1,419 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +namespace boost { namespace python { namespace detail { + +detail::new_reference str_base::call(object const& arg_) +{ + return (detail::new_reference)PyObject_CallFunction( +#if PY_VERSION_HEX >= 0x03000000 + (PyObject*)&PyUnicode_Type, +#else + (PyObject*)&PyString_Type, +#endif + const_cast("(O)"), + arg_.ptr()); +} + +str_base::str_base() + : object(detail::new_reference( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromString("") +#else + ::PyString_FromString("") +#endif + )) +{} + +str_base::str_base(const char* s) + : object(detail::new_reference( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromString(s) +#else + ::PyString_FromString(s) +#endif + )) +{} + +namespace { + + ssize_t str_size_as_py_ssize_t(std::size_t n) + { + if (n > static_cast(ssize_t_max)) + { + throw std::range_error("str size > ssize_t_max"); + } + return static_cast(n); + } + +} // namespace + +str_base::str_base(char const* start, char const* finish) + : object( + detail::new_reference( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromStringAndSize +#else + ::PyString_FromStringAndSize +#endif + (start, str_size_as_py_ssize_t(finish - start)) + ) + ) +{} + +str_base::str_base(char const* start, std::size_t length) // new str + : object( + detail::new_reference( +#if PY_VERSION_HEX >= 0x03000000 + ::PyUnicode_FromStringAndSize +#else + ::PyString_FromStringAndSize +#endif + ( start, str_size_as_py_ssize_t(length) ) + ) + ) +{} + +str_base::str_base(object_cref other) + : object(str_base::call(other)) +{} + +#define BOOST_PYTHON_FORMAT_OBJECT(z, n, data) "O" +#define BOOST_PYTHON_OBJECT_PTR(z, n, data) , x##n .ptr() + +#define BOOST_PYTHON_DEFINE_STR_METHOD(name, arity) \ +str str_base:: name ( BOOST_PP_ENUM_PARAMS(arity, object_cref x) ) const \ +{ \ + return str(new_reference( \ + expect_non_null( \ + PyObject_CallMethod( \ + this->ptr(), const_cast( #name ), \ + const_cast( \ + "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")") \ + BOOST_PP_REPEAT_1(arity, BOOST_PYTHON_OBJECT_PTR, _))))); \ +} + +BOOST_PYTHON_DEFINE_STR_METHOD(capitalize, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(center, 1) + +long str_base::count(object_cref sub) const +{ + return extract(this->attr("count")(sub)); +} + +long str_base::count(object_cref sub, object_cref start) const +{ + return extract(this->attr("count")(sub,start)); +} + +long str_base::count(object_cref sub, object_cref start, object_cref end) const +{ + return extract(this->attr("count")(sub,start,end)); +} + +#if PY_VERSION_HEX < 0x03000000 +object str_base::decode() const +{ + return this->attr("decode")(); +} + +object str_base::decode(object_cref encoding) const +{ + return this->attr("decode")(encoding); +} + +object str_base::decode(object_cref encoding, object_cref errors) const +{ + return this->attr("decode")(encoding,errors); +} +#endif + +object str_base::encode() const +{ + return this->attr("encode")(); +} + +object str_base::encode(object_cref encoding) const +{ + return this->attr("encode")(encoding); +} + +object str_base::encode(object_cref encoding, object_cref errors) const +{ + return this->attr("encode")(encoding,errors); +} + + +#if PY_VERSION_HEX >= 0x03000000 + #define _BOOST_PYTHON_ASLONG PyLong_AsLong +#else + #define _BOOST_PYTHON_ASLONG PyInt_AsLong +#endif + +bool str_base::endswith(object_cref suffix) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::endswith(object_cref suffix, object_cref start) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::endswith(object_cref suffix, object_cref start, object_cref end) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 1) + +long str_base::find(object_cref sub) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::find(object_cref sub, object_cref start) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::find(object_cref sub, object_cref start, object_cref end) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::index(object_cref sub) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::index(object_cref sub, object_cref start) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::index(object_cref sub, object_cref start, object_cref end) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::isalnum() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("isalnum")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::isalpha() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("isalpha")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::isdigit() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("isdigit")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::islower() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("islower")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::isspace() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("isspace")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::istitle() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("istitle")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::isupper() const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("isupper")().ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +BOOST_PYTHON_DEFINE_STR_METHOD(join, 1) +BOOST_PYTHON_DEFINE_STR_METHOD(ljust, 1) +BOOST_PYTHON_DEFINE_STR_METHOD(lower, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(lstrip, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(replace, 2) +BOOST_PYTHON_DEFINE_STR_METHOD(replace, 3) + +long str_base::rfind(object_cref sub) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::rfind(object_cref sub, object_cref start) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::rfind(object_cref sub, object_cref start, object_cref end) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::rindex(object_cref sub) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::rindex(object_cref sub, object_cref start) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +long str_base::rindex(object_cref sub, object_cref start, object_cref end) const +{ + long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +BOOST_PYTHON_DEFINE_STR_METHOD(rjust, 1) +BOOST_PYTHON_DEFINE_STR_METHOD(rstrip, 0) + +list str_base::split() const +{ + return list(this->attr("split")()); +} + +list str_base::split(object_cref sep) const +{ + return list(this->attr("split")(sep)); +} + +list str_base::split(object_cref sep, object_cref maxsplit) const +{ + return list(this->attr("split")(sep,maxsplit)); +} + +list str_base::splitlines() const +{ + return list(this->attr("splitlines")()); +} + +list str_base::splitlines(object_cref keepends) const +{ + return list(this->attr("splitlines")(keepends)); +} + +bool str_base::startswith(object_cref prefix) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::startswith(object_cref prefix, object_cref start) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +bool str_base::startswith(object_cref prefix, object_cref start, object_cref end) const +{ + bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start,end).ptr()); + if (PyErr_Occurred()) + throw_error_already_set(); + return result; +} + +#undef _BOOST_PYTHON_ASLONG + +BOOST_PYTHON_DEFINE_STR_METHOD(strip, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(swapcase, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(title, 0) +BOOST_PYTHON_DEFINE_STR_METHOD(translate, 1) +BOOST_PYTHON_DEFINE_STR_METHOD(translate, 2) +BOOST_PYTHON_DEFINE_STR_METHOD(upper, 0) + +static struct register_str_pytype_ptr +{ + register_str_pytype_ptr() + { + const_cast( + converter::registry::lookup(boost::python::type_id()) + ) +#if PY_VERSION_HEX >= 0x03000000 + .m_class_object = &PyUnicode_Type; +#else + .m_class_object = &PyString_Type; +#endif + } +}register_str_pytype_ptr_; + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/tuple.cpp b/pxr/external/boost/python/src/tuple.cpp new file mode 100644 index 0000000000..6719713b73 --- /dev/null +++ b/pxr/external/boost/python/src/tuple.cpp @@ -0,0 +1,35 @@ +// Copyright David Abrahams 2004. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include + +namespace boost { namespace python { namespace detail { + +detail::new_reference tuple_base::call(object const& arg_) +{ + return (detail::new_reference)PyObject_CallFunction( + (PyObject*)&PyTuple_Type, const_cast("(O)"), + arg_.ptr()); +} + +tuple_base::tuple_base() + : object(detail::new_reference(PyTuple_New(0))) +{} + +tuple_base::tuple_base(object_cref sequence) + : object(call(sequence)) +{} + +static struct register_tuple_pytype_ptr +{ + register_tuple_pytype_ptr() + { + const_cast( + converter::registry::lookup(boost::python::type_id()) + ).m_class_object = &PyTuple_Type; + } +}register_tuple_pytype_ptr_; + + +}}} // namespace boost::python diff --git a/pxr/external/boost/python/src/wrapper.cpp b/pxr/external/boost/python/src/wrapper.cpp new file mode 100644 index 0000000000..8b1b884769 --- /dev/null +++ b/pxr/external/boost/python/src/wrapper.cpp @@ -0,0 +1,66 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace boost { namespace python { + +namespace detail +{ + override wrapper_base::get_override( + char const* name + , PyTypeObject* class_object + ) const + { + if (this->m_self) + { + if (handle<> m = handle<>( + python::allow_null( + ::PyObject_GetAttrString( + this->m_self, const_cast(name)))) + ) + { + PyObject* borrowed_f = 0; + + if ( + PyMethod_Check(m.get()) + && PyMethod_GET_SELF(m.get()) == this->m_self + && class_object->tp_dict != 0 + ) + { + borrowed_f = ::PyDict_GetItemString( + class_object->tp_dict, const_cast(name)); + + + } + if (borrowed_f != PyMethod_GET_FUNCTION(m.get())) + return override(m); + } + } + return override(handle<>(detail::none())); + } +} + +#if 0 +namespace converter +{ + PyObject* BOOST_PYTHON_DECL do_polymorphic_ref_to_python( + python::detail::wrapper_base const volatile* x, type_info src + ) + { + if (x == 0) + { + ::PyErr_Format( + PyExc_TypeError + , "Attempting to returning pointer or reference to instance of %s\n" + "for which no corresponding Python object exists. Wrap this function" + "with a return return value policy" + ) + } + } + +} +#endif + +}} // namespace boost::python::detail diff --git a/pxr/external/boost/python/ssize_t.hpp b/pxr/external/boost/python/ssize_t.hpp new file mode 100644 index 0000000000..e8a2d92f63 --- /dev/null +++ b/pxr/external/boost/python/ssize_t.hpp @@ -0,0 +1,29 @@ +// Copyright Ralf W. Grosse-Kunstleve & David Abrahams 2006. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP +# define BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP + +# include + +namespace boost { namespace python { + +#if PY_VERSION_HEX >= 0x02050000 + +typedef Py_ssize_t ssize_t; +ssize_t const ssize_t_max = PY_SSIZE_T_MAX; +ssize_t const ssize_t_min = PY_SSIZE_T_MIN; + +#else + +typedef int ssize_t; +ssize_t const ssize_t_max = INT_MAX; +ssize_t const ssize_t_min = INT_MIN; + +#endif + +}} // namespace boost::python + +#endif // BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP diff --git a/pxr/external/boost/python/stl_iterator.hpp b/pxr/external/boost/python/stl_iterator.hpp new file mode 100644 index 0000000000..838954879a --- /dev/null +++ b/pxr/external/boost/python/stl_iterator.hpp @@ -0,0 +1,61 @@ +// Copyright Eric Niebler 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef STL_ITERATOR_EAN20051028_HPP +# define STL_ITERATOR_EAN20051028_HPP + +# include + +# include + +# include + +namespace boost { namespace python +{ + +// An STL input iterator over a python sequence +template +struct stl_input_iterator + : boost::iterator_facade< + stl_input_iterator + , ValueT + , std::input_iterator_tag + , ValueT + > +{ + stl_input_iterator() + : impl_() + { + } + + // ob is the python sequence + stl_input_iterator(boost::python::object const &ob) + : impl_(ob) + { + } + +private: + friend class boost::iterator_core_access; + + void increment() + { + this->impl_.increment(); + } + + ValueT dereference() const + { + return extract(this->impl_.current().get())(); + } + + bool equal(stl_input_iterator const &that) const + { + return this->impl_.equal(that.impl_); + } + + objects::stl_input_iterator_impl impl_; +}; + +}} // namespace boost::python + +#endif // STL_ITERATOR_EAN20051028_HPP diff --git a/pxr/external/boost/python/str.hpp b/pxr/external/boost/python/str.hpp new file mode 100644 index 0000000000..434c8c986c --- /dev/null +++ b/pxr/external/boost/python/str.hpp @@ -0,0 +1,422 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef STR_20020703_HPP +#define STR_20020703_HPP + +# include + +#include +#include +#include + +// disable defines in provided by some system libraries +#undef isspace +#undef islower +#undef isalpha +#undef isdigit +#undef isalnum +#undef isupper + +namespace boost { namespace python { + +class str; + +namespace detail +{ + struct BOOST_PYTHON_DECL str_base : object + { + str capitalize() const; + + str center(object_cref width) const; + + long count(object_cref sub) const; + + long count(object_cref sub, object_cref start) const; + + long count(object_cref sub, object_cref start, object_cref end) const; + +#if PY_VERSION_HEX < 0x03000000 + object decode() const; + object decode(object_cref encoding) const; + + object decode(object_cref encoding, object_cref errors) const; +#endif + + object encode() const; + object encode(object_cref encoding) const; + object encode(object_cref encoding, object_cref errors) const; + + bool endswith(object_cref suffix) const; + + bool endswith(object_cref suffix, object_cref start) const; + bool endswith(object_cref suffix, object_cref start, object_cref end) const; + + str expandtabs() const; + str expandtabs(object_cref tabsize) const; + + long find(object_cref sub) const; + long find(object_cref sub, object_cref start) const; + + long find(object_cref sub, object_cref start, object_cref end) const; + + long index(object_cref sub) const; + + long index(object_cref sub, object_cref start) const; + long index(object_cref sub, object_cref start, object_cref end) const; + + bool isalnum() const; + bool isalpha() const; + bool isdigit() const; + bool islower() const; + bool isspace() const; + bool istitle() const; + bool isupper() const; + + str join(object_cref sequence) const; + + str ljust(object_cref width) const; + str lower() const; + str lstrip() const; + + str replace(object_cref old, object_cref new_) const; + str replace(object_cref old, object_cref new_, object_cref maxsplit) const; + long rfind(object_cref sub) const; + + long rfind(object_cref sub, object_cref start) const; + + long rfind(object_cref sub, object_cref start, object_cref end) const; + long rindex(object_cref sub) const; + long rindex(object_cref sub, object_cref start) const; + + + long rindex(object_cref sub, object_cref start, object_cref end) const; + + str rjust(object_cref width) const; + + str rstrip() const; + + list split() const; + list split(object_cref sep) const; + + list split(object_cref sep, object_cref maxsplit) const; + + + list splitlines() const; + list splitlines(object_cref keepends) const; + + bool startswith(object_cref prefix) const; + + + bool startswith(object_cref prefix, object_cref start) const; + bool startswith(object_cref prefix, object_cref start, object_cref end) const; + + str strip() const; + str swapcase() const; + str title() const; + + str translate(object_cref table) const; + + str translate(object_cref table, object_cref deletechars) const; + + + str upper() const; + + protected: + str_base(); // new str + + str_base(const char* s); // new str + + str_base(char const* start, char const* finish); + + str_base(char const* start, std::size_t length); + + explicit str_base(object_cref other); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str_base, object) + private: + static new_reference call(object const&); + }; +} + + +class str : public detail::str_base +{ + typedef detail::str_base base; + public: + str() {} // new str + + str(const char* s) : base(s) {} // new str + + str(char const* start, char const* finish) // new str + : base(start, finish) + {} + + str(char const* start, std::size_t length) // new str + : base(start, length) + {} + + template + explicit str(T const& other) + : base(object(other)) + { + } + + template + str center(T const& width) const + { + return base::center(object(width)); + } + + template + long count(T const& sub) const + { + return base::count(object(sub)); + } + + template + long count(T1 const& sub,T2 const& start) const + { + return base::count(object(sub), object(start)); + } + + template + long count(T1 const& sub,T2 const& start, T3 const& end) const + { + return base::count(object(sub), object(start), object(end)); + } + +#if PY_VERSION_HEX < 0x03000000 + object decode() const { return base::decode(); } + + template + object decode(T const& encoding) const + { + return base::decode(object(encoding)); + } + + template + object decode(T1 const& encoding, T2 const& errors) const + { + return base::decode(object(encoding),object(errors)); + } +#endif + + object encode() const { return base::encode(); } + + template + object encode(T const& encoding) const + { + return base::encode(object(encoding)); + } + + template + object encode(T1 const& encoding, T2 const& errors) const + { + return base::encode(object(encoding),object(errors)); + } + + template + bool endswith(T const& suffix) const + { + return base::endswith(object(suffix)); + } + + template + bool endswith(T1 const& suffix, T2 const& start) const + { + return base::endswith(object(suffix), object(start)); + } + + template + bool endswith(T1 const& suffix, T2 const& start, T3 const& end) const + { + return base::endswith(object(suffix), object(start), object(end)); + } + + str expandtabs() const { return base::expandtabs(); } + + template + str expandtabs(T const& tabsize) const + { + return base::expandtabs(object(tabsize)); + } + + template + long find(T const& sub) const + { + return base::find(object(sub)); + } + + template + long find(T1 const& sub, T2 const& start) const + { + return base::find(object(sub), object(start)); + } + + template + long find(T1 const& sub, T2 const& start, T3 const& end) const + { + return base::find(object(sub), object(start), object(end)); + } + + template + long index(T const& sub) const + { + return base::index(object(sub)); + } + + template + long index(T1 const& sub, T2 const& start) const + { + return base::index(object(sub), object(start)); + } + + template + long index(T1 const& sub, T2 const& start, T3 const& end) const + { + return base::index(object(sub), object(start), object(end)); + } + + template + str join(T const& sequence) const + { + return base::join(object(sequence)); + } + + template + str ljust(T const& width) const + { + return base::ljust(object(width)); + } + + template + str replace(T1 const& old, T2 const& new_) const + { + return base::replace(object(old),object(new_)); + } + + template + str replace(T1 const& old, T2 const& new_, T3 const& maxsplit) const + { + return base::replace(object(old),object(new_), object(maxsplit)); + } + + template + long rfind(T const& sub) const + { + return base::rfind(object(sub)); + } + + template + long rfind(T1 const& sub, T2 const& start) const + { + return base::rfind(object(sub), object(start)); + } + + template + long rfind(T1 const& sub, T2 const& start, T3 const& end) const + { + return base::rfind(object(sub), object(start), object(end)); + } + + template + long rindex(T const& sub) const + { + return base::rindex(object(sub)); + } + + template + long rindex(T1 const& sub, T2 const& start) const + { + return base::rindex(object(sub), object(start)); + } + + template + long rindex(T1 const& sub, T2 const& start, T3 const& end) const + { + return base::rindex(object(sub), object(start), object(end)); + } + + template + str rjust(T const& width) const + { + return base::rjust(object(width)); + } + + list split() const { return base::split(); } + + template + list split(T const& sep) const + { + return base::split(object(sep)); + } + + template + list split(T1 const& sep, T2 const& maxsplit) const + { + return base::split(object(sep), object(maxsplit)); + } + + list splitlines() const { return base::splitlines(); } + + template + list splitlines(T const& keepends) const + { + return base::splitlines(object(keepends)); + } + + template + bool startswith(T const& prefix) const + { + return base::startswith(object(prefix)); + } + + template + bool startswith(T1 const& prefix, T2 const& start) const + { + return base::startswith(object(prefix), object(start)); + } + + template + bool startswith(T1 const& prefix, T2 const& start, T3 const& end) const + { + return base::startswith(object(prefix), object(start), object(end)); + } + + template + str translate(T const& table) const + { + return base::translate(object(table)); + } + + template + str translate(T1 const& table, T2 const& deletechars) const + { + return base::translate(object(table), object(deletechars)); + } + + public: // implementation detail -- for internal use only + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str, base) +}; + +// +// Converter Specializations +// +namespace converter +{ + template <> + struct object_manager_traits +#if PY_VERSION_HEX >= 0x03000000 + : pytype_object_manager_traits<&PyUnicode_Type,str> +#else + : pytype_object_manager_traits<&PyString_Type,str> +#endif + { + }; +} + +}} // namespace boost::python + +#endif // STR_20020703_HPP diff --git a/pxr/external/boost/python/suite/indexing/container_utils.hpp b/pxr/external/boost/python/suite/indexing/container_utils.hpp new file mode 100644 index 0000000000..72710bb8b0 --- /dev/null +++ b/pxr/external/boost/python/suite/indexing/container_utils.hpp @@ -0,0 +1,57 @@ + +// (C) Copyright Joel de Guzman 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef PY_CONTAINER_UTILS_JDG20038_HPP +# define PY_CONTAINER_UTILS_JDG20038_HPP + +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { namespace container_utils { + + template + void + extend_container(Container& container, object l) + { + typedef typename Container::value_type data_type; + + // l must be iterable + BOOST_FOREACH(object elem, + std::make_pair( + boost::python::stl_input_iterator(l), + boost::python::stl_input_iterator() + )) + { + extract x(elem); + // try if elem is an exact data_type type + if (x.check()) + { + container.push_back(x()); + } + else + { + // try to convert elem to data_type type + extract x(elem); + if (x.check()) + { + container.push_back(x()); + } + else + { + PyErr_SetString(PyExc_TypeError, "Incompatible Data Type"); + throw_error_already_set(); + } + } + } + } + +}}} // namespace boost::python::container_utils + +#endif diff --git a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp new file mode 100644 index 0000000000..eb8b81c0a3 --- /dev/null +++ b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp @@ -0,0 +1,759 @@ +// (C) Copyright Joel de Guzman 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef INDEXING_SUITE_DETAIL_JDG20036_HPP +# define INDEXING_SUITE_DETAIL_JDG20036_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +#include + +namespace boost { namespace python { namespace detail { + +#if defined(NDEBUG) +#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT +#else +#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT check_invariant() +#endif + + template + struct compare_proxy_index + { + // This functor compares a proxy and an index. + // This is used by proxy_group::first_proxy to + // get first proxy with index i. + + template + bool operator()(PyObject* prox, Index i) const + { + typedef typename Proxy::policies_type policies_type; + Proxy& proxy = extract(prox)(); + return policies_type:: + compare_index(proxy.get_container(), proxy.get_index(), i); + } + }; + + // The proxy_group class holds a vector of container element + // proxies. First, what is a container element proxy? A container + // element proxy acts like a smart pointer holding a reference to + // a container and an index (see container_element, for details). + // + // The proxies are held in a vector always sorted by its index. + // Various functions manage the addition, removal and searching + // of proxies from the vector. + // + template + class proxy_group + { + public: + + typedef typename std::vector::const_iterator const_iterator; + typedef typename std::vector::iterator iterator; + typedef typename Proxy::index_type index_type; + typedef typename Proxy::policies_type policies_type; + + iterator + first_proxy(index_type i) + { + // Return the first proxy with index <= i + return boost::detail::lower_bound( + proxies.begin(), proxies.end(), + i, compare_proxy_index()); + } + + void + remove(Proxy& proxy) + { + // Remove a proxy + for (iterator iter = first_proxy(proxy.get_index()); + iter != proxies.end(); ++iter) + { + if (&extract(*iter)() == &proxy) + { + proxies.erase(iter); + break; + } + } + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + void + add(PyObject* prox) + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Add a proxy + proxies.insert( + first_proxy(extract(prox)().get_index()), prox); + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + void + erase(index_type i, mpl::false_) + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Erase the proxy with index i + replace(i, i+1, 0); + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + void + erase(index_type i, mpl::true_) + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Erase the proxy with index i + + iterator iter = first_proxy(i); + extract p(*iter); + + if (iter != proxies.end() && p().get_index() == i) + { + extract p(*iter); + p().detach(); + proxies.erase(iter); + } + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + void + erase(index_type from, index_type to) + { + // note: this cannot be called when container is not sliceable + + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Erase all proxies with indexes from..to + replace(from, to, 0); + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + void + replace( + index_type from, + index_type to, + typename std::vector::size_type len) + { + // note: this cannot be called when container is not sliceable + + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Erase all proxies with indexes from..to. + // Adjust the displaced indexes such that the + // final effect is that we have inserted *len* + // number of proxies in the vacated region. This + // procedure involves adjusting the indexes of + // the proxies. + + iterator left = first_proxy(from); + iterator right = proxies.end(); // we'll adjust this later + + for (iterator iter = left; iter != right; ++iter) + { + if (extract(*iter)().get_index() > to) + { + right = iter; // adjust right + break; + } + extract p(*iter); + p().detach(); + } + + typename std::vector::size_type + offset = left-proxies.begin(); + proxies.erase(left, right); + right = proxies.begin()+offset; + + while (right != proxies.end()) + { + typedef typename Proxy::container_type::difference_type difference_type; + extract p(*right); + p().set_index( + extract(*right)().get_index() + - (difference_type(to) - from - len) + ); + + ++right; + } + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + } + + PyObject* + find(index_type i) + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // Find the proxy with *exact* index i. + // Return 0 (null) if no proxy with the + // given index is found. + iterator iter = first_proxy(i); + if (iter != proxies.end() + && extract(*iter)().get_index() == i) + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + return *iter; + } + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + return 0; + } + + typename std::vector::size_type + size() const + { + BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + // How many proxies are there so far? + return proxies.size(); + } + + private: + +#if !defined(NDEBUG) + void + check_invariant() const + { + for (const_iterator i = proxies.begin(); i != proxies.end(); ++i) + { + if ((*i)->ob_refcnt <= 0) + { + PyErr_SetString(PyExc_RuntimeError, + "Invariant: Proxy vector in an inconsistent state"); + throw_error_already_set(); + } + + if (i+1 != proxies.end()) + { + if (extract(*(i+1))().get_index() == + extract(*(i))().get_index()) + { + PyErr_SetString(PyExc_RuntimeError, + "Invariant: Proxy vector in an inconsistent state (duplicate proxy)"); + throw_error_already_set(); + } + } + } + } +#endif + + std::vector proxies; + }; + + // proxy_links holds a map of Container pointers (keys) + // with proxy_group(s) (data). Various functions manage + // the addition, removal and searching of proxies from + // the map. + // + template + class proxy_links + { + public: + + typedef std::map > links_t; + typedef typename Proxy::index_type index_type; + + void + remove(Proxy& proxy) + { + // Remove a proxy. + typename links_t::iterator r = links.find(&proxy.get_container()); + if (r != links.end()) + { + r->second.remove(proxy); + if (r->second.size() == 0) + links.erase(r); + } + } + + void + add(PyObject* prox, Container& container) + { + // Add a proxy + links[&container].add(prox); + } + + template + void erase(Container& container, index_type i, NoSlice no_slice) + { + // Erase the proxy with index i + typename links_t::iterator r = links.find(&container); + if (r != links.end()) + { + r->second.erase(i, no_slice); + if (r->second.size() == 0) + links.erase(r); + } + } + + void + erase(Container& container, index_type from, index_type to) + { + // Erase all proxies with indexes from..to + typename links_t::iterator r = links.find(&container); + if (r != links.end()) + { + r->second.erase(from, to); + if (r->second.size() == 0) + links.erase(r); + } + } + + void + replace( + Container& container, + index_type from, index_type to, index_type len) + { + // Erase all proxies with indexes from..to. + // Adjust the displaced indexes such that the + // final effect is that we have inserted *len* + // number of proxies in the vacated region. This + // procedure involves adjusting the indexes of + // the proxies. + + typename links_t::iterator r = links.find(&container); + if (r != links.end()) + { + r->second.replace(from, to, len); + if (r->second.size() == 0) + links.erase(r); + } + } + + PyObject* + find(Container& container, index_type i) + { + // Find the proxy with *exact* index i. + // Return 0 (null) if no proxy with the given + // index is found. + typename links_t::iterator r = links.find(&container); + if (r != links.end()) + return r->second.find(i); + return 0; + } + + private: + + links_t links; + }; + + // container_element is our container proxy class. + // This class acts like a smart pointer to a container + // element. The class holds an index and a reference to + // a container. Dereferencing the smart pointer will + // retrieve the nth (index) element from the container. + // + // A container_element can also be detached from the + // container. In such a detached state, the container_element + // holds a copy of the nth (index) element, which it + // returns when dereferenced. + // + template + class container_element + { + public: + + typedef Index index_type; + typedef Container container_type; + typedef typename Policies::data_type element_type; + typedef Policies policies_type; + typedef container_element self_t; + typedef proxy_group links_type; + + container_element(object container, Index index) + : ptr() + , container(container) + , index(index) + { + } + + container_element(container_element const& ce) + : ptr(ce.ptr.get() == 0 ? 0 : new element_type(*ce.ptr.get())) + , container(ce.container) + , index(ce.index) + { + } + + ~container_element() + { + if (!is_detached()) + get_links().remove(*this); + } + + element_type& operator*() const + { + if (is_detached()) + return *get_pointer(ptr); + return Policies::get_item(get_container(), index); + } + + element_type* get() const + { + if (is_detached()) + return get_pointer(ptr); + return &Policies::get_item(get_container(), index); + } + + void + detach() + { + if (!is_detached()) + { + ptr.reset( + new element_type( + Policies::get_item(get_container(), index))); + container = object(); // free container. reset it to None + } + } + + bool + is_detached() const + { + return get_pointer(ptr) != 0; + } + + Container& + get_container() const + { + return extract(container)(); + } + + Index + get_index() const + { + return index; + } + + void + set_index(Index i) + { + index = i; + } + + static proxy_links& + get_links() + { + // All container_element(s) maintain links to + // its container in a global map (see proxy_links). + // This global "links" map is a singleton. + + static proxy_links links; + return links; // singleton + } + + private: + + container_element& operator=(container_element const& ce); + + scoped_ptr ptr; + object container; + Index index; + }; + + template < + class Container + , class DerivedPolicies + , class ContainerElement + , class Index + > + struct no_proxy_helper + { + static void + register_container_element() + { + } + + template + static object + base_get_item_helper(DataType const& p, detail::true_) + { + return object(ptr(p)); + } + + template + static object + base_get_item_helper(DataType const& x, detail::false_) + { + return object(x); + } + + static object + base_get_item_(back_reference const& container, PyObject* i) + { + return base_get_item_helper( + DerivedPolicies::get_item( + container.get(), DerivedPolicies:: + convert_index(container.get(), i)) + , is_pointer() + ); + } + + static void + base_replace_indexes( + Container& /*container*/, Index /*from*/, + Index /*to*/, Index /*n*/) + { + } + + template + static void + base_erase_index( + Container& /*container*/, Index /*i*/, NoSlice /*no_slice*/) + { + } + + static void + base_erase_indexes(Container& /*container*/, Index /*from*/, Index /*to*/) + { + } + }; + + template < + class Container + , class DerivedPolicies + , class ContainerElement + , class Index + > + struct proxy_helper + { + static void + register_container_element() + { + register_ptr_to_python(); + } + + static object + base_get_item_(back_reference const& container, PyObject* i) + { + // Proxy + Index idx = DerivedPolicies::convert_index(container.get(), i); + + if (PyObject* shared = + ContainerElement::get_links().find(container.get(), idx)) + { + handle<> h(python::borrowed(shared)); + return object(h); + } + else + { + object prox(ContainerElement(container.source(), idx)); + ContainerElement:: + get_links().add(prox.ptr(), container.get()); + return prox; + } + } + + static void + base_replace_indexes( + Container& container, Index from, + Index to, Index n) + { + ContainerElement::get_links().replace(container, from, to, n); + } + + template + static void + base_erase_index( + Container& container, Index i, NoSlice no_slice) + { + ContainerElement::get_links().erase(container, i, no_slice); + } + + static void + base_erase_indexes( + Container& container, Index from, Index to) + { + ContainerElement::get_links().erase(container, from, to); + } + }; + + template < + class Container + , class DerivedPolicies + , class ProxyHandler + , class Data + , class Index + > + struct slice_helper + { + static object + base_get_slice(Container& container, PySliceObject* slice) + { + Index from, to; + base_get_slice_data(container, slice, from, to); + return DerivedPolicies::get_slice(container, from, to); + } + + static void + base_get_slice_data( + Container& container, PySliceObject* slice, Index& from_, Index& to_) + { + if (Py_None != slice->step) { + PyErr_SetString( PyExc_IndexError, "slice step size not supported."); + throw_error_already_set(); + } + + Index min_index = DerivedPolicies::get_min_index(container); + Index max_index = DerivedPolicies::get_max_index(container); + + if (Py_None == slice->start) { + from_ = min_index; + } + else { + long from = extract( slice->start); + if (from < 0) // Negative slice index + from += max_index; + if (from < 0) // Clip lower bounds to zero + from = 0; + from_ = boost::numeric_cast(from); + if (from_ > max_index) // Clip upper bounds to max_index. + from_ = max_index; + } + + if (Py_None == slice->stop) { + to_ = max_index; + } + else { + long to = extract( slice->stop); + if (to < 0) + to += max_index; + if (to < 0) + to = 0; + to_ = boost::numeric_cast(to); + if (to_ > max_index) + to_ = max_index; + } + } + + static void + base_set_slice(Container& container, PySliceObject* slice, PyObject* v) + { + Index from, to; + base_get_slice_data(container, slice, from, to); + + extract elem(v); + // try if elem is an exact Data + if (elem.check()) + { + ProxyHandler::base_replace_indexes(container, from, to, 1); + DerivedPolicies::set_slice(container, from, to, elem()); + } + else + { + // try to convert elem to Data + extract elem(v); + if (elem.check()) + { + ProxyHandler::base_replace_indexes(container, from, to, 1); + DerivedPolicies::set_slice(container, from, to, elem()); + } + else + { + // Otherwise, it must be a list or some container + handle<> l_(python::borrowed(v)); + object l(l_); + + std::vector temp; + for (int i = 0; i < l.attr("__len__")(); i++) + { + object elem(l[i]); + extract x(elem); + // try if elem is an exact Data type + if (x.check()) + { + temp.push_back(x()); + } + else + { + // try to convert elem to Data type + extract x(elem); + if (x.check()) + { + temp.push_back(x()); + } + else + { + PyErr_SetString(PyExc_TypeError, + "Invalid sequence element"); + throw_error_already_set(); + } + } + } + + ProxyHandler::base_replace_indexes(container, from, to, + temp.end()-temp.begin()); + DerivedPolicies::set_slice(container, from, to, + temp.begin(), temp.end()); + } + } + } + + static void + base_delete_slice(Container& container, PySliceObject* slice) + { + Index from, to; + base_get_slice_data(container, slice, from, to); + ProxyHandler::base_erase_indexes(container, from, to); + DerivedPolicies::delete_slice(container, from, to); + } + }; + + template < + class Container + , class DerivedPolicies + , class ProxyHandler + , class Data + , class Index + > + struct no_slice_helper + { + static void + slicing_not_suported() + { + PyErr_SetString(PyExc_RuntimeError, "Slicing not supported"); + throw_error_already_set(); + } + + static object + base_get_slice(Container& /*container*/, PySliceObject* /*slice*/) + { + slicing_not_suported(); + return object(); + } + + static void + base_set_slice(Container& /*container*/, PySliceObject* /*slice*/, PyObject* /*v*/) + { + slicing_not_suported(); + } + + static void + base_delete_slice(Container& /*container*/, PySliceObject* /*slice*/) + { + slicing_not_suported(); + } + }; + +#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP +}} // namespace python::detail +#endif + + template + inline typename Policies::data_type* + get_pointer( + python::detail::container_element const& p) + { + // Get the pointer of a container_element smart pointer + return p.get(); + } + +#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP + // Don't hide these other get_pointer overloads + using boost::python::get_pointer; + using boost::get_pointer; +}} // namespace python::detail +#endif + +} // namespace boost + +#endif // INDEXING_SUITE_DETAIL_JDG20036_HPP diff --git a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp new file mode 100644 index 0000000000..3469a2a40f --- /dev/null +++ b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp @@ -0,0 +1,295 @@ +// (C) Copyright Joel de Guzman 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef INDEXING_SUITE_JDG20036_HPP +# define INDEXING_SUITE_JDG20036_HPP + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +namespace boost { namespace python { + + // indexing_suite class. This class is the facade class for + // the management of C++ containers intended to be integrated + // to Python. The objective is make a C++ container look and + // feel and behave exactly as we'd expect a Python container. + // By default indexed elements are returned by proxy. This can be + // disabled by supplying *true* in the NoProxy template parameter. + // + // Derived classes provide the hooks needed by the indexing_suite + // to do its job: + // + // static data_type& + // get_item(Container& container, index_type i); + // + // static object + // get_slice(Container& container, index_type from, index_type to); + // + // static void + // set_item(Container& container, index_type i, data_type const& v); + // + // static void + // set_slice( + // Container& container, index_type from, + // index_type to, data_type const& v + // ); + // + // template + // static void + // set_slice(Container& container, index_type from, + // index_type to, Iter first, Iter last + // ); + // + // static void + // delete_item(Container& container, index_type i); + // + // static void + // delete_slice(Container& container, index_type from, index_type to); + // + // static size_t + // size(Container& container); + // + // template + // static bool + // contains(Container& container, T const& val); + // + // static index_type + // convert_index(Container& container, PyObject* i); + // + // static index_type + // adjust_index(index_type current, index_type from, + // index_type to, size_type len + // ); + // + // Most of these policies are self explanatory. convert_index and + // adjust_index, however, deserves some explanation. + // + // convert_index converts an Python index into a C++ index that the + // container can handle. For instance, negative indexes in Python, by + // convention, indexes from the right (e.g. C[-1] indexes the rightmost + // element in C). convert_index should handle the necessary conversion + // for the C++ container (e.g. convert -1 to C.size()-1). convert_index + // should also be able to convert the type of the index (A dynamic Python + // type) to the actual type that the C++ container expects. + // + // When a container expands or contracts, held indexes to its elements + // must be adjusted to follow the movement of data. For instance, if + // we erase 3 elements, starting from index 0 from a 5 element vector, + // what used to be at index 4 will now be at index 1: + // + // [a][b][c][d][e] ---> [d][e] + // ^ ^ + // 4 1 + // + // adjust_index takes care of the adjustment. Given a current index, + // the function should return the adjusted index when data in the + // container at index from..to is replaced by *len* elements. + // + + template < + class Container + , class DerivedPolicies + , bool NoProxy = false + , bool NoSlice = false + , class Data = typename Container::value_type + , class Index = typename Container::size_type + , class Key = typename Container::value_type + > + class indexing_suite + : public def_visitor< + indexing_suite< + Container + , DerivedPolicies + , NoProxy + , NoSlice + , Data + , Index + , Key + > > + { + private: + + typedef mpl::or_< + mpl::bool_ + , mpl::not_ > + , typename mpl::or_< + detail::is_same + , detail::is_same > + , detail::is_same > + , detail::is_same > >::type> + no_proxy; + + typedef detail::container_element + container_element_t; + + typedef return_internal_reference<> return_policy; + + typedef typename mpl::if_< + no_proxy + , iterator + , iterator >::type + def_iterator; + + typedef typename mpl::if_< + no_proxy + , detail::no_proxy_helper< + Container + , DerivedPolicies + , container_element_t + , Index> + , detail::proxy_helper< + Container + , DerivedPolicies + , container_element_t + , Index> >::type + proxy_handler; + + typedef typename mpl::if_< + mpl::bool_ + , detail::no_slice_helper< + Container + , DerivedPolicies + , proxy_handler + , Data + , Index> + , detail::slice_helper< + Container + , DerivedPolicies + , proxy_handler + , Data + , Index> >::type + slice_handler; + + public: + + template + void visit(Class& cl) const + { + // Hook into the class_ generic visitation .def function + proxy_handler::register_container_element(); + + cl + .def("__len__", base_size) + .def("__setitem__", &base_set_item) + .def("__delitem__", &base_delete_item) + .def("__getitem__", &base_get_item) + .def("__contains__", &base_contains) + .def("__iter__", def_iterator()) + ; + + DerivedPolicies::extension_def(cl); + } + + template + static void + extension_def(Class& cl) + { + // default. + // no more extensions + } + + private: + + static object + base_get_item(back_reference container, PyObject* i) + { + if (PySlice_Check(i)) + return slice_handler::base_get_slice( + container.get(), static_cast(static_cast(i))); + + return proxy_handler::base_get_item_(container, i); + } + + static void + base_set_item(Container& container, PyObject* i, PyObject* v) + { + if (PySlice_Check(i)) + { + slice_handler::base_set_slice(container, + static_cast(static_cast(i)), v); + } + else + { + extract elem(v); + // try if elem is an exact Data + if (elem.check()) + { + DerivedPolicies:: + set_item(container, + DerivedPolicies:: + convert_index(container, i), elem()); + } + else + { + // try to convert elem to Data + extract elem(v); + if (elem.check()) + { + DerivedPolicies:: + set_item(container, + DerivedPolicies:: + convert_index(container, i), elem()); + } + else + { + PyErr_SetString(PyExc_TypeError, "Invalid assignment"); + throw_error_already_set(); + } + } + } + } + + static void + base_delete_item(Container& container, PyObject* i) + { + if (PySlice_Check(i)) + { + slice_handler::base_delete_slice( + container, static_cast(static_cast(i))); + return; + } + + Index index = DerivedPolicies::convert_index(container, i); + proxy_handler::base_erase_index(container, index, mpl::bool_()); + DerivedPolicies::delete_item(container, index); + } + + static size_t + base_size(Container& container) + { + return DerivedPolicies::size(container); + } + + static bool + base_contains(Container& container, PyObject* key) + { + extract x(key); + // try if key is an exact Key type + if (x.check()) + { + return DerivedPolicies::contains(container, x()); + } + else + { + // try to convert key to Key type + extract x(key); + if (x.check()) + return DerivedPolicies::contains(container, x()); + else + return false; + } + } + }; + +}} // namespace boost::python + +#endif // INDEXING_SUITE_JDG20036_HPP diff --git a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp new file mode 100644 index 0000000000..7fbad4cace --- /dev/null +++ b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp @@ -0,0 +1,181 @@ +// (C) Copyright Joel de Guzman 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef MAP_INDEXING_SUITE_JDG20038_HPP +# define MAP_INDEXING_SUITE_JDG20038_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { + + // Forward declaration + template + class map_indexing_suite; + + namespace detail + { + template + class final_map_derived_policies + : public map_indexing_suite > {}; + } + + // The map_indexing_suite class is a predefined indexing_suite derived + // class for wrapping std::map (and std::map like) classes. It provides + // all the policies required by the indexing_suite (see indexing_suite). + // Example usage: + // + // class X {...}; + // + // ... + // + // class_ >("XMap") + // .def(map_indexing_suite >()) + // ; + // + // By default indexed elements are returned by proxy. This can be + // disabled by supplying *true* in the NoProxy template parameter. + // + template < + class Container, + bool NoProxy = false, + class DerivedPolicies + = detail::final_map_derived_policies > + class map_indexing_suite + : public indexing_suite< + Container + , DerivedPolicies + , NoProxy + , true + , typename Container::value_type::second_type + , typename Container::key_type + , typename Container::key_type + > + { + public: + + typedef typename Container::value_type value_type; + typedef typename Container::value_type::second_type data_type; + typedef typename Container::key_type key_type; + typedef typename Container::key_type index_type; + typedef typename Container::size_type size_type; + typedef typename Container::difference_type difference_type; + + template + static void + extension_def(Class& cl) + { + // Wrap the map's element (value_type) + std::string elem_name = "map_indexing_suite_"; + object class_name(cl.attr("__name__")); + extract class_name_extractor(class_name); + elem_name += class_name_extractor(); + elem_name += "_entry"; + + typedef typename mpl::if_< + mpl::and_, mpl::bool_ > + , return_internal_reference<> + , default_call_policies + >::type get_data_return_policy; + + class_(elem_name.c_str()) + .def("__repr__", &DerivedPolicies::print_elem) + .def("data", &DerivedPolicies::get_data, get_data_return_policy()) + .def("key", &DerivedPolicies::get_key) + ; + } + + static object + print_elem(typename Container::value_type const& e) + { + return "(%s, %s)" % python::make_tuple(e.first, e.second); + } + + static + typename mpl::if_< + mpl::and_, mpl::bool_ > + , data_type& + , data_type + >::type + get_data(typename Container::value_type& e) + { + return e.second; + } + + static typename Container::key_type + get_key(typename Container::value_type& e) + { + return e.first; + } + + static data_type& + get_item(Container& container, index_type i_) + { + typename Container::iterator i = container.find(i_); + if (i == container.end()) + { + PyErr_SetString(PyExc_KeyError, "Invalid key"); + throw_error_already_set(); + } + return i->second; + } + + static void + set_item(Container& container, index_type i, data_type const& v) + { + container[i] = v; + } + + static void + delete_item(Container& container, index_type i) + { + container.erase(i); + } + + static size_t + size(Container& container) + { + return container.size(); + } + + static bool + contains(Container& container, key_type const& key) + { + return container.find(key) != container.end(); + } + + static bool + compare_index(Container& container, index_type a, index_type b) + { + return container.key_comp()(a, b); + } + + static index_type + convert_index(Container& /*container*/, PyObject* i_) + { + extract i(i_); + if (i.check()) + { + return i(); + } + else + { + extract i(i_); + if (i.check()) + return i(); + } + + PyErr_SetString(PyExc_TypeError, "Invalid index type"); + throw_error_already_set(); + return index_type(); + } + }; + +}} // namespace boost::python + +#endif // MAP_INDEXING_SUITE_JDG20038_HPP diff --git a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp new file mode 100644 index 0000000000..34c29ecc6f --- /dev/null +++ b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp @@ -0,0 +1,242 @@ +// (C) Copyright Joel de Guzman 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef VECTOR_INDEXING_SUITE_JDG20036_HPP +# define VECTOR_INDEXING_SUITE_JDG20036_HPP + +# include +# include +# include + +namespace boost { namespace python { + + // Forward declaration + template + class vector_indexing_suite; + + namespace detail + { + template + class final_vector_derived_policies + : public vector_indexing_suite > {}; + } + + // The vector_indexing_suite class is a predefined indexing_suite derived + // class for wrapping std::vector (and std::vector like) classes. It provides + // all the policies required by the indexing_suite (see indexing_suite). + // Example usage: + // + // class X {...}; + // + // ... + // + // class_ >("XVec") + // .def(vector_indexing_suite >()) + // ; + // + // By default indexed elements are returned by proxy. This can be + // disabled by supplying *true* in the NoProxy template parameter. + // + template < + class Container, + bool NoProxy = false, + class DerivedPolicies + = detail::final_vector_derived_policies > + class vector_indexing_suite + : public indexing_suite + { + public: + + typedef typename Container::value_type data_type; + typedef typename Container::value_type key_type; + typedef typename Container::size_type index_type; + typedef typename Container::size_type size_type; + typedef typename Container::difference_type difference_type; + + template + static void + extension_def(Class& cl) + { + cl + .def("append", &base_append) + .def("extend", &base_extend) + ; + } + + static + typename mpl::if_< + is_class + , data_type& + , data_type + >::type + get_item(Container& container, index_type i) + { + return container[i]; + } + + static object + get_slice(Container& container, index_type from, index_type to) + { + if (from > to) + return object(Container()); + return object(Container(container.begin()+from, container.begin()+to)); + } + + static void + set_item(Container& container, index_type i, data_type const& v) + { + container[i] = v; + } + + static void + set_slice(Container& container, index_type from, + index_type to, data_type const& v) + { + if (from > to) { + return; + } + else { + container.erase(container.begin()+from, container.begin()+to); + container.insert(container.begin()+from, v); + } + } + + template + static void + set_slice(Container& container, index_type from, + index_type to, Iter first, Iter last) + { + if (from > to) { + container.insert(container.begin()+from, first, last); + } + else { + container.erase(container.begin()+from, container.begin()+to); + container.insert(container.begin()+from, first, last); + } + } + + static void + delete_item(Container& container, index_type i) + { + container.erase(container.begin()+i); + } + + static void + delete_slice(Container& container, index_type from, index_type to) + { + if (from > to) { + // A null-op. + return; + } + container.erase(container.begin()+from, container.begin()+to); + } + + static size_t + size(Container& container) + { + return container.size(); + } + + static bool + contains(Container& container, key_type const& key) + { + return std::find(container.begin(), container.end(), key) + != container.end(); + } + + static index_type + get_min_index(Container& /*container*/) + { + return 0; + } + + static index_type + get_max_index(Container& container) + { + return container.size(); + } + + static bool + compare_index(Container& /*container*/, index_type a, index_type b) + { + return a < b; + } + + static index_type + convert_index(Container& container, PyObject* i_) + { + extract i(i_); + if (i.check()) + { + long index = i(); + if (index < 0) + index += DerivedPolicies::size(container); + if (index >= long(container.size()) || index < 0) + { + PyErr_SetString(PyExc_IndexError, "Index out of range"); + throw_error_already_set(); + } + return index; + } + + PyErr_SetString(PyExc_TypeError, "Invalid index type"); + throw_error_already_set(); + return index_type(); + } + + static void + append(Container& container, data_type const& v) + { + container.push_back(v); + } + + template + static void + extend(Container& container, Iter first, Iter last) + { + container.insert(container.end(), first, last); + } + + private: + + static void + base_append(Container& container, object v) + { + extract elem(v); + // try if elem is an exact Data + if (elem.check()) + { + DerivedPolicies::append(container, elem()); + } + else + { + // try to convert elem to data_type + extract elem(v); + if (elem.check()) + { + DerivedPolicies::append(container, elem()); + } + else + { + PyErr_SetString(PyExc_TypeError, + "Attempting to append an invalid type"); + throw_error_already_set(); + } + } + } + + static void + base_extend(Container& container, object v) + { + std::vector temp; + container_utils::extend_container(temp, v); + DerivedPolicies::extend(container, temp.begin(), temp.end()); + } + }; + +}} // namespace boost::python + +#endif // VECTOR_INDEXING_SUITE_JDG20036_HPP diff --git a/pxr/external/boost/python/tag.hpp b/pxr/external/boost/python/tag.hpp new file mode 100644 index 0000000000..ccff9f1a17 --- /dev/null +++ b/pxr/external/boost/python/tag.hpp @@ -0,0 +1,18 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TAG_DWA2002720_HPP +# define TAG_DWA2002720_HPP + +# include + +namespace boost { namespace python { + +// used only to prevent argument-dependent lookup from finding the +// wrong function in some cases. Cheaper than qualification. +enum tag_t { tag }; + +}} // namespace boost::python + +#endif // TAG_DWA2002720_HPP diff --git a/pxr/external/boost/python/test/Jamfile b/pxr/external/boost/python/test/Jamfile new file mode 100644 index 0000000000..07cbd4c7e5 --- /dev/null +++ b/pxr/external/boost/python/test/Jamfile @@ -0,0 +1,258 @@ +# Copyright David Abrahams 2006. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +import python ; +import os ; +import ../../config/checks/config : requires ; + +lib socket ; + +use-project /boost/python : ../build ; +project /boost/python/test + : requirements + gcc:-Wextra + qnxnto:socket + ; + +local PY = ; +if [ python.configured ] +{ + PY = /python//python ; +} + +rule py-run ( sources * : input-file ? ) +{ + return [ run $(sources) /boost/python//boost_python $(PY) + : # args + : $(input-file) + : #requirements + BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION + + ] ; +} + +rule py-compile ( sources * ) +{ + return [ compile $(sources) /boost/python//boost_python ] ; +} + +rule py-compile-fail ( sources * ) +{ + return [ compile-fail $(sources) /boost/python//boost_python ] ; +} + +rule require-windows ( properties * ) +{ + if ! windows in $(properties) + { + return no ; + } +} + +if [ python.configured ] +{ +test-suite python + : + + [ + run exec.cpp /boost/python//boost_python/static $(PY) + : # program args + : exec.py # input files + : # requirements + : # target-name + ] + + [ + run exec.cpp ../build//boost_python/shared /python//python + : # program args + : exec.py + : # requirements + : exec-dynamic # target-name + ] + +# [ +# run import_.cpp ../build//boost_python /python//python +# : # program args +# : import_.py # input files +# : # requirements +# : # target-name +# ] + +[ +bpl-test crossmod_exception + : crossmod_exception.py crossmod_exception_a.cpp crossmod_exception_b.cpp +] + +[ bpl-test injected ] +[ bpl-test properties ] +[ bpl-test return_arg ] +[ bpl-test staticmethod ] +[ bpl-test boost_shared_ptr ] +[ bpl-test shared_ptr + : # sources + : [ requires cxx11_smart_ptr ] +] +[ bpl-test enable_shared_from_this ] +[ bpl-test andreas_beyer ] +[ bpl-test wrapper_held_type ] + +[ bpl-test polymorphism2_auto_ptr + : polymorphism2_auto_ptr.py polymorphism2.py polymorphism2_auto_ptr.cpp + : [ requires auto_ptr ] +] + +[ bpl-test polymorphism ] +[ bpl-test polymorphism2 ] + +[ bpl-test auto_ptr + : # files + : [ requires auto_ptr ] +] + +[ bpl-test minimal ] +[ bpl-test args ] +[ bpl-test raw_ctor ] +[ bpl-test enum : test_enum.py enum_ext.cpp ] +[ bpl-test exception_translator ] +[ bpl-test pearu1 : test_cltree.py cltree.cpp ] +[ bpl-test try : newtest.py m1.cpp m2.cpp ] +[ bpl-test const_argument ] +[ bpl-test keywords : keywords.cpp keywords_test.py ] + + +[ python-extension builtin_converters_ext : builtin_converters.cpp /boost/python//boost_python ] +[ bpl-test builtin_converters : test_builtin_converters.py builtin_converters_ext ] + + [ bpl-test test_pointer_adoption ] + [ bpl-test operators ] + [ bpl-test operators_wrapper ] + [ bpl-test callbacks ] + [ bpl-test defaults ] + +[ bpl-test object ] +[ bpl-test class ] +[ bpl-test aligned_class ] +[ bpl-test list ] +[ bpl-test long ] +[ bpl-test dict ] +[ bpl-test tuple ] +[ bpl-test str ] +[ bpl-test slice ] + +[ bpl-test virtual_functions ] +[ bpl-test back_reference ] +[ bpl-test implicit ] +[ bpl-test data_members ] + +[ bpl-test ben_scott1 ] + +[ bpl-test bienstman1 ] +[ bpl-test bienstman2 ] +[ bpl-test bienstman3 ] + +[ bpl-test multi_arg_constructor + : # files + : # requirements + # A bug in the Win32 intel compilers causes compilation of one of our + # tests to take forever when debug symbols are enabled. This rule + # turns them off when added to the requirements section + intel-win:off +] + +[ bpl-test iterator : iterator.py iterator.cpp input_iterator.cpp ] + +[ bpl-test stl_iterator : stl_iterator.py stl_iterator.cpp ] + +[ bpl-test extract ] + +[ +bpl-test crossmod_opaque + : crossmod_opaque.py crossmod_opaque_a.cpp crossmod_opaque_b.cpp +] +[ bpl-test opaque ] +[ bpl-test voidptr ] + +[ bpl-test pickle1 ] +[ bpl-test pickle2 ] +[ bpl-test pickle3 ] +[ bpl-test pickle4 ] + +[ bpl-test nested ] + +[ bpl-test docstring ] +[ bpl-test pytype_function ] + +[ bpl-test vector_indexing_suite ] + +[ bpl-test pointer_vector + : # files + : # requirements + # Turn off this test on HP CXX, as the test hangs when executing. + # Whenever the cause for the failure of the polymorphism test is found + # and fixed, this should be retested. + hp_cxx:no ] + +[ python-extension map_indexing_suite_ext + : map_indexing_suite.cpp int_map_indexing_suite.cpp a_map_indexing_suite.cpp + /boost/python//boost_python ] +[ bpl-test + map_indexing_suite : map_indexing_suite.py map_indexing_suite_ext ] + +[ run import_.cpp /boost/python//boost_python $(PY) : : import_.py ] + +# if $(TEST_BIENSTMAN_NON_BUGS) +# { +# bpl-test bienstman4 ; +# bpl-test bienstman5 ; +# } + +[ bpl-test calling_conventions : : @require-windows ] +[ bpl-test calling_conventions_mf : : @require-windows ] + +# --- unit tests of library components --- + +[ compile indirect_traits_test.cpp ] +[ run destroy_test.cpp ] +[ py-run pointer_type_id_test.cpp ] +[ py-run bases.cpp ] +[ run if_else.cpp ] +[ py-run pointee.cpp ] +[ run result.cpp ] + +[ compile string_literal.cpp ] +[ py-compile borrowed.cpp ] +[ py-compile object_manager.cpp ] +[ py-compile copy_ctor_mutates_rhs.cpp ] + +[ py-run upcast.cpp ] + +[ py-compile select_holder.cpp ] + +[ run select_from_python_test.cpp ../src/converter/type_id.cpp + : + : + : BOOST_PYTHON_STATIC_LIB + $(PY) + +] + + [ py-compile select_arg_to_python_test.cpp ] + +[ py-compile-fail ./raw_pyobject_fail1.cpp ] +[ py-compile-fail ./raw_pyobject_fail2.cpp ] +[ py-compile-fail ./as_to_python_function.cpp ] +[ py-compile-fail ./object_fail1.cpp ] + +# --- NumPy tests --- + +[ numpy-test numpy/dtype ] +[ numpy-test numpy/ufunc ] +[ numpy-test numpy/templates ] +[ numpy-test numpy/ndarray ] +[ numpy-test numpy/indexing ] +[ numpy-test numpy/shapes ] + + + ; +} diff --git a/pxr/external/boost/python/test/a_map_indexing_suite.cpp b/pxr/external/boost/python/test/a_map_indexing_suite.cpp new file mode 100644 index 0000000000..07a0a6b977 --- /dev/null +++ b/pxr/external/boost/python/test/a_map_indexing_suite.cpp @@ -0,0 +1,92 @@ +// Copyright Joel de Guzman 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +using namespace boost::python; + +struct A +{ + int value; + A() : value(0){}; + A(int v) : value(v) {}; +}; + +bool operator==(const A& v1, const A& v2) +{ + return (v1.value == v2.value); +} + +struct B +{ + A a; +}; + +// Converter from A to python int +struct AToPython +{ + static PyObject* convert(const A& s) + { + return boost::python::incref(boost::python::object((int)s.value).ptr()); + } +}; + +// Conversion from python int to A +struct AFromPython +{ + AFromPython() + { + boost::python::converter::registry::push_back( + &convertible, + &construct, + boost::python::type_id< A >()); + } + + static void* convertible(PyObject* obj_ptr) + { +#if PY_VERSION_HEX >= 0x03000000 + if (!PyLong_Check(obj_ptr)) return 0; +#else + if (!PyInt_Check(obj_ptr)) return 0; +#endif + return obj_ptr; + } + + static void construct( + PyObject* obj_ptr, + boost::python::converter::rvalue_from_python_stage1_data* data) + { + void* storage = ( + (boost::python::converter::rvalue_from_python_storage< A >*) + data)-> storage.bytes; + +#if PY_VERSION_HEX >= 0x03000000 + new (storage) A((int)PyLong_AsLong(obj_ptr)); +#else + new (storage) A((int)PyInt_AsLong(obj_ptr)); +#endif + data->convertible = storage; + } +}; + +void a_map_indexing_suite() +{ + + to_python_converter< A , AToPython >(); + AFromPython(); + + class_< std::map >("AMap") + .def(map_indexing_suite, true >()) + ; + + class_< B >("B") + .add_property("a", make_getter(&B::a, return_value_policy()), + make_setter(&B::a, return_value_policy())) + ; +} + + diff --git a/pxr/external/boost/python/test/aligned_class.cpp b/pxr/external/boost/python/test/aligned_class.cpp new file mode 100644 index 0000000000..55f0fa3c70 --- /dev/null +++ b/pxr/external/boost/python/test/aligned_class.cpp @@ -0,0 +1,33 @@ +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +struct BOOST_ALIGNMENT(32) X +{ + int x; + BOOST_ALIGNMENT(32) float f; + X(int n, float _f) : x(n), f(_f) + { + BOOST_ASSERT((reinterpret_cast(&f) % 32) == 0); + } +}; + +int x_function(X& x) { return x.x;} +float f_function(X& x) { return x.f;} + +BOOST_PYTHON_MODULE(aligned_class_ext) +{ + class_("X", init()); + def("x_function", x_function); + def("f_function", f_function); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/aligned_class.py b/pxr/external/boost/python/test/aligned_class.py new file mode 100755 index 0000000000..eb27ac1e96 --- /dev/null +++ b/pxr/external/boost/python/test/aligned_class.py @@ -0,0 +1,44 @@ +# Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from aligned_class_ext import * + +Ensure sanity: + + >>> x = X(42, 16) + >>> x_function(x) + 42 + >>> f_function(x) + 16.0 + +Demonstrate extraction in the presence of metaclass changes: + + >>> class MetaX(X.__class__): + ... def __new__(cls, *args): + ... return super(MetaX, cls).__new__(cls, *args) + >>> class XPlusMetatype(X): + ... __metaclass__ = MetaX + >>> x = XPlusMetatype(42, 16) + >>> x_function(x) + 42 + >>> f_function(x) + 16.0 + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/andreas_beyer.cpp b/pxr/external/boost/python/test/andreas_beyer.cpp new file mode 100644 index 0000000000..b28b15660a --- /dev/null +++ b/pxr/external/boost/python/test/andreas_beyer.cpp @@ -0,0 +1,61 @@ +// Copyright David Abrahams 2006. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +using namespace boost; + +class A : public enable_shared_from_this { + public: + A() : val(0) {}; + int val; + typedef shared_ptr A_ptr; + A_ptr self() { + A_ptr self; + self = shared_from_this(); + return self; + } + +}; + +class B { + public: + B() { + a = A::A_ptr(new A()); + } + void set(A::A_ptr _a) { + this->a = _a; + } + A::A_ptr get() { + return a; + } + A::A_ptr a; +}; + +template +void hold_python(shared_ptr& x) +{ + x = python::extract >( python::object(x) ); +} + +A::A_ptr get_b_a(shared_ptr b) +{ + hold_python(b->a); + return b->get(); +} + +BOOST_PYTHON_MODULE(andreas_beyer_ext) { + python::class_ ("A") + .def("self", &A::self) + .def_readwrite("val", &A::val) + ; + python::register_ptr_to_python< A::A_ptr >(); + + python::class_("B") + .def("set", &B::set) +// .def("get", &B::get) + .def("get", get_b_a) + ; +} diff --git a/pxr/external/boost/python/test/andreas_beyer.py b/pxr/external/boost/python/test/andreas_beyer.py new file mode 100644 index 0000000000..0c24969bd5 --- /dev/null +++ b/pxr/external/boost/python/test/andreas_beyer.py @@ -0,0 +1,24 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + >>> from andreas_beyer_ext import * + >>> b=B() + >>> a=b.get() # let b create an A + >>> a2=b.get() + >>> assert id(a) == id(a2) +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/args.cpp b/pxr/external/boost/python/test/args.cpp new file mode 100644 index 0000000000..592a8e5053 --- /dev/null +++ b/pxr/external/boost/python/test/args.cpp @@ -0,0 +1,99 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include "test_class.hpp" +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) +# define make_tuple boost::python::make_tuple +#endif + +tuple f(int x = 1, double y = 4.25, char const* z = "wow") +{ + return make_tuple(x, y, z); +} + +BOOST_PYTHON_FUNCTION_OVERLOADS(f_overloads, f, 0, 3) + +typedef test_class<> Y; + +struct X +{ + X(int a0 = 0, int a1 = 1) : inner0(a0), inner1(a1) {} + tuple f(int x = 1, double y = 4.25, char const* z = "wow") + { + return make_tuple(x, y, z); + } + + Y const& inner(bool n) const { return n ? inner1 : inner0; } + + Y inner0; + Y inner1; +}; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_f_overloads, X::f, 0, 3) + + +tuple raw_func(tuple args, dict kw) +{ + return make_tuple(args, kw); +} + +BOOST_PYTHON_MODULE(args_ext) +{ + def("f", f, (arg("x")=1, arg("y")=4.25, arg("z")="wow") + , "This is f's docstring" + ); + + def("raw", raw_function(raw_func)); + +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 + // MSVC6 gives a fatal error LNK1179: invalid or corrupt file: + // duplicate comdat error if we try to re-use the exact type of f + // here, so substitute long for int. + tuple (*f)(long,double,char const*) = 0; +#endif + def("f1", f, f_overloads("f1's docstring", args("x", "y", "z"))); + def("f2", f, f_overloads(args("x", "y", "z"))); + def("f3", f, f_overloads(args("x", "y", "z"), "f3's docstring")); + + class_("Y", init(args("value"), "Y's docstring")) + .def("value", &Y::value) + .def("raw", raw_function(raw_func)) + ; + + class_("X", "This is X's docstring", init<>(args("self"))) + .def(init >(args("self", "a0", "a1"))) + .def("f", &X::f + , "This is X.f's docstring" + , args("self","x", "y", "z")) + + // Just to prove that all the different argument combinations work + .def("inner0", &X::inner, return_internal_reference<>(), args("self", "n"), "docstring") + .def("inner1", &X::inner, return_internal_reference<>(), "docstring", args("self", "n")) + + .def("inner2", &X::inner, args("self", "n"), return_internal_reference<>(), "docstring") + .def("inner3", &X::inner, "docstring", return_internal_reference<>(), args("self", "n")) + + .def("inner4", &X::inner, args("self", "n"), "docstring", return_internal_reference<>()) + .def("inner5", &X::inner, "docstring", args("self", "n"), return_internal_reference<>()) + + .def("f1", &X::f, X_f_overloads(args("self", "x", "y", "z"))) + .def("f2", &X::f, X_f_overloads(args("self", "x", "y", "z"), "f2's docstring")) + .def("f2", &X::f, X_f_overloads(args("x", "y", "z"), "f2's docstring")) + ; + + def("inner", &X::inner, "docstring", args("self", "n"), return_internal_reference<>()); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/args.py b/pxr/external/boost/python/test/args.py new file mode 100644 index 0000000000..5d89921467 --- /dev/null +++ b/pxr/external/boost/python/test/args.py @@ -0,0 +1,155 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from args_ext import * + +>>> args, kwargs = raw(3, 4, foo = 'bar', baz = 42) +>>> args +(3, 4) +>>> kwargs['foo'] +'bar' +>>> kwargs['baz'] +42 + + Prove that we can handle empty keywords and non-keywords + +>>> raw(3, 4) +((3, 4), {}) + +>>> raw(foo = 'bar') +((), {'foo': 'bar'}) + +>>> f(x= 1, y = 3, z = 'hello') +(1, 3.0, 'hello') + +>>> f(z = 'hello', x = 3, y = 2.5) +(3, 2.5, 'hello') + +>>> f(1, z = 'hi', y = 3) +(1, 3.0, 'hi') + +>>> try: f(1, 2, 'hello', bar = 'baz') +... except TypeError: pass +... else: print('expected an exception: unknown keyword') + + + Exercise the functions using default stubs + +>>> f1(z = 'nix', y = .125, x = 2) +(2, 0.125, 'nix') +>>> f1(y = .125, x = 2) +(2, 0.125, 'wow') +>>> f1(x = 2) +(2, 4.25, 'wow') +>>> f1() +(1, 4.25, 'wow') + +>>> f2(z = 'nix', y = .125, x = 2) +(2, 0.125, 'nix') +>>> f2(y = .125, x = 2) +(2, 0.125, 'wow') +>>> f2(x = 2) +(2, 4.25, 'wow') +>>> f2() +(1, 4.25, 'wow') + +>>> f3(z = 'nix', y = .125, x = 2) +(2, 0.125, 'nix') +>>> f3(y = .125, x = 2) +(2, 0.125, 'wow') +>>> f3(x = 2) +(2, 4.25, 'wow') +>>> f3() +(1, 4.25, 'wow') + + Member function tests + +>>> q = X() +>>> q.f(x= 1, y = 3, z = 'hello') +(1, 3.0, 'hello') + +>>> q.f(z = 'hello', x = 3, y = 2.5) +(3, 2.5, 'hello') + +>>> q.f(1, z = 'hi', y = 3) +(1, 3.0, 'hi') + +>>> try: q.f(1, 2, 'hello', bar = 'baz') +... except TypeError: pass +... else: print('expected an exception: unknown keyword') + + Exercise member functions using default stubs + +>>> q.f1(z = 'nix', y = .125, x = 2) +(2, 0.125, 'nix') +>>> q.f1(y = .125, x = 2) +(2, 0.125, 'wow') +>>> q.f1(x = 2) +(2, 4.25, 'wow') +>>> q.f1() +(1, 4.25, 'wow') +>>> q.f2.__doc__.splitlines()[1] +'f2( (X)self [, (int)x [, (float)y [, (str)z]]]) -> tuple :' + +>>> q.f2.__doc__.splitlines()[2] +" f2's docstring" + +>>> X.f.__doc__.splitlines()[1:5] +['f( (X)self, (int)x, (float)y, (str)z) -> tuple :', " This is X.f's docstring", '', ' C++ signature :'] + +>>> xfuncs = (X.inner0, X.inner1, X.inner2, X.inner3, X.inner4, X.inner5) +>>> for f in xfuncs: +... print(f(q,1).value(), end=' ') +... print(f(q, n = 1).value(), end=' ') +... print(f(q, n = 0).value(), end=' ') +... print(f.__doc__.splitlines()[1:5]) +1 1 0 ['inner0( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] +1 1 0 ['inner1( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] +1 1 0 ['inner2( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] +1 1 0 ['inner3( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] +1 1 0 ['inner4( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] +1 1 0 ['inner5( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] + +>>> x = X(a1 = 44, a0 = 22) +>>> x.inner0(0).value() +22 +>>> x.inner0(1).value() +44 + +>>> x = X(a0 = 7) +>>> x.inner0(0).value() +7 +>>> x.inner0(1).value() +1 + +>>> inner(n = 1, self = q).value() +1 + +>>> y = Y(value = 33) +>>> _, kwargs = y.raw(this = 1, that = 'the other') +>>> kwargs['this'] +1 +>>> kwargs['that'] +'the other' + +""" + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + import args_ext + help(args_ext) + sys.exit(status) diff --git a/pxr/external/boost/python/test/as_to_python_function.cpp b/pxr/external/boost/python/test/as_to_python_function.cpp new file mode 100644 index 0000000000..cc083890a6 --- /dev/null +++ b/pxr/external/boost/python/test/as_to_python_function.cpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +struct hopefully_illegal +{ + static PyObject* convert(int&); +}; + +PyObject* x = boost::python::converter::as_to_python_function::convert(0); diff --git a/pxr/external/boost/python/test/auto_ptr.cpp b/pxr/external/boost/python/test/auto_ptr.cpp new file mode 100644 index 0000000000..0f61e96dc3 --- /dev/null +++ b/pxr/external/boost/python/test/auto_ptr.cpp @@ -0,0 +1,90 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include "test_class.hpp" +#include +#include +#include +#include + +#include + +#include + +using namespace boost::python; + +typedef test_class<> X; + +struct Y : X +{ + Y(int n) : X(n) {}; +}; + +int look(std::auto_ptr const& x) +{ + return (x.get()) ? x->value() : -1; +} + +int steal(std::auto_ptr x) +{ + return x->value(); +} + +int maybe_steal(std::auto_ptr& x, bool doit) +{ + int n = x->value(); + if (doit) + x.release(); + return n; +} + +std::auto_ptr make() +{ + return std::auto_ptr(new X(77)); +} + +std::auto_ptr callback(object f) +{ + std::auto_ptr x(new X(77)); + return call >(f.ptr(), x); +} + +std::auto_ptr extract_(object o) +{ + return extract&>(o) +#if BOOST_MSVC <= 1300 + () +#endif + ; +} + +BOOST_PYTHON_MODULE(auto_ptr_ext) +{ + class_, boost::noncopyable>("X", init()) + .def("value", &X::value) + ; + + class_, bases, boost::noncopyable>("Y", init()) + ; + + // VC6 auto_ptrs do not have converting constructors +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, < 306) + scope().attr("broken_auto_ptr") = 1; +#else + scope().attr("broken_auto_ptr") = 0; + implicitly_convertible, std::auto_ptr >(); +#endif + + def("look", look); + def("steal", steal); + def("maybe_steal", maybe_steal); + def("make", make); + def("callback", callback); + def("extract", extract_); +} + +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/auto_ptr.py b/pxr/external/boost/python/test/auto_ptr.py new file mode 100644 index 0000000000..12e977d062 --- /dev/null +++ b/pxr/external/boost/python/test/auto_ptr.py @@ -0,0 +1,100 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from auto_ptr_ext import * +>>> x = X(42) +>>> x.value() +42 +>>> look(x), look(x) +(42, 42) + +>>> maybe_steal(x, 0) +42 +>>> look(x) +42 + +>>> maybe_steal(x, 1) +42 +>>> broken_auto_ptr and -1 or look(x) +-1 + +>>> x = X(69) +>>> steal(x) +69 +>>> broken_auto_ptr and -1 or look(x) +-1 + +>>> if not broken_auto_ptr: +... try: x.value() +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> x = make() +>>> look(x) +77 + +>>> z = callback(lambda z: z) +>>> z.value() +77 + +>>> extract(x).value() +77 + +# +# Test derived to base conversions +# + +>>> y = Y(42) +>>> y.value() +42 + +>>> try: maybe_steal(y, 0) +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> y.value() +42 + +>>> broken_auto_ptr and 42 or steal(y) +42 + +>>> if not broken_auto_ptr: +... try: y.value() +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> print(look.__doc__.splitlines()[1]) +look( (X)arg1) -> int : + +>>> print(steal.__doc__.splitlines()[1]) +steal( (X)arg1) -> int : + +>>> print(maybe_steal.__doc__.splitlines()[1]) +maybe_steal( (X)arg1, (bool)arg2) -> int : + +>>> print(make.__doc__.splitlines()[1]) +make() -> X : + +>>> print(callback.__doc__.splitlines()[1]) +callback( (object)arg1) -> X : + +>>> print(extract.__doc__.splitlines()[1]) +extract( (object)arg1) -> X : + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/back_reference.cpp b/pxr/external/boost/python/test/back_reference.cpp new file mode 100644 index 0000000000..266ed29125 --- /dev/null +++ b/pxr/external/boost/python/test/back_reference.cpp @@ -0,0 +1,112 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include +#include +#include +#include + +// This test shows that a class can be wrapped "as itself" but also +// acquire a back-reference iff has_back_reference<> is appropriately +// specialized. +using namespace boost::python; + +struct X +{ + explicit X(int x) : x(x), magic(7654321) { ++counter; } + X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; } + virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; } + + void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; } + int value() const { BOOST_ASSERT(magic == 7654321); return x; } + static int count() { return counter; } + private: + void operator=(X const&); + private: + int x; + long magic; + static int counter; +}; + +int X::counter; + +struct Y : X +{ + Y(PyObject* self, int x) : X(x), self(self) {} + Y(PyObject* self, Y const& rhs) : X(rhs), self(self) {} + private: + Y(Y const&); + PyObject* self; +}; + +struct Z : X +{ + Z(PyObject* self, int x) : X(x), self(self) {} + Z(PyObject* self, Z const& rhs) : X(rhs), self(self) {} + private: + Z(Z const&); + PyObject* self; +}; + +Y const& copy_Y(Y const& y) { return y; } +Z const& copy_Z(Z const& z) { return z; } + +namespace boost { namespace python +{ + template <> + struct has_back_reference + : mpl::true_ + { + }; + + template <> + struct has_back_reference + : mpl::true_ + { + }; +}} + +// prove that back_references get initialized with the right PyObject* +object y_identity(back_reference y) +{ + return y.source(); +} + +// prove that back_references contain the right value +bool y_equality(back_reference y1, Y const& y2) +{ + return &y1.get() == &y2; +} + +BOOST_PYTHON_MODULE(back_reference_ext) +{ + def("copy_Y", copy_Y, return_value_policy()); + def("copy_Z", copy_Z, return_value_policy()); + def("x_instances", &X::count); + + class_("Y", init()) + .def("value", &Y::value) + .def("set", &Y::set) + ; + + class_ >("Z", init()) + .def("value", &Z::value) + .def("set", &Z::set) + ; + + def("y_identity", y_identity); + def("y_equality", y_equality); + +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/back_reference.py b/pxr/external/boost/python/test/back_reference.py new file mode 100644 index 0000000000..4a283a3e3e --- /dev/null +++ b/pxr/external/boost/python/test/back_reference.py @@ -0,0 +1,37 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from back_reference_ext import * +>>> y = Y(3) +>>> z = Z(4) +>>> x_instances() +2 +>>> y2 = copy_Y(y) +>>> x_instances() +3 +>>> z2 = copy_Z(z) +>>> x_instances() +4 +>>> assert y_identity(y) is y +>>> y_equality(y, y) +1 + +>>> print(y_identity.__doc__.splitlines()[1]) +y_identity( (Y)arg1) -> object : +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/bases.cpp b/pxr/external/boost/python/test/bases.cpp new file mode 100644 index 0000000000..4e00f5448a --- /dev/null +++ b/pxr/external/boost/python/test/bases.cpp @@ -0,0 +1,62 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +struct A; +struct B; + +template +struct choose_bases + : boost::python::detail::select_bases< + X + , typename boost::python::detail::select_bases< + Y + , typename boost::python::detail::select_bases::type + >::type> +{ + +}; + +int main() +{ + BOOST_STATIC_ASSERT((boost::python::detail::specifies_bases< + boost::python::bases >::value)); + + BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + boost::python::bases& >::value)); + + BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + void* >::value)); + + BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + int >::value)); + + BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + int[5] >::value)); + + typedef boost::python::detail::select_bases< + int + , boost::python::detail::select_bases::type > collected1; + + BOOST_STATIC_ASSERT((boost::python::detail::is_same >::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,boost::python::bases<> >::value)); + + typedef boost::python::detail::select_bases< + int + , boost::python::detail::select_bases< + boost::python::bases + , boost::python::detail::select_bases< + A + >::type + >::type + > collected2; + + BOOST_STATIC_ASSERT((boost::python::detail::is_same >::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same,long>::type,boost::python::bases >::value)); + + return 0; +} diff --git a/pxr/external/boost/python/test/ben_scott1.cpp b/pxr/external/boost/python/test/ben_scott1.cpp new file mode 100644 index 0000000000..5a675e2302 --- /dev/null +++ b/pxr/external/boost/python/test/ben_scott1.cpp @@ -0,0 +1,54 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +using namespace boost::python; +using namespace boost; + +struct Product {}; +typedef shared_ptr ProductPtr; + + +struct Creator +{ + virtual ~Creator() {} + virtual ProductPtr create() = 0; +}; + + +struct Factory +{ + void reg(Creator* c) { mC = c; } + ProductPtr create() + { + std::cout << "Name: " << (typeid(*mC)).name() << std::endl; + return mC->create(); + } + +private: + Creator* mC; +}; + +struct CreatorWrap : public Creator +{ + CreatorWrap(PyObject* self) : mSelf(self) {} + ProductPtr create() { return call_method(mSelf, "create"); } + PyObject* mSelf; +}; + +BOOST_PYTHON_MODULE(ben_scott1_ext) +{ + class_("Product"); + + class_("Creator") + .def("create", &CreatorWrap::create) + ; + + class_("Factory") + .def("reg", &Factory::reg, with_custodian_and_ward<1,2>()) + .def("create", &Factory::create) + ; +} + +#include "../test/module_tail.cpp" diff --git a/pxr/external/boost/python/test/ben_scott1.py b/pxr/external/boost/python/test/ben_scott1.py new file mode 100644 index 0000000000..79130757a3 --- /dev/null +++ b/pxr/external/boost/python/test/ben_scott1.py @@ -0,0 +1,17 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +# This regression test checks that call_method(...) where T is a +# non-reference, non-pointer type that happens to be held inside the +# result object (and thus is found as an lvalue) works. +from ben_scott1_ext import * + +class CreatorImpl(Creator): + def create(self): + return Product() + +factory = Factory() +c = CreatorImpl() +factory.reg(c) + +a = factory.create() diff --git a/pxr/external/boost/python/test/bienstman1.cpp b/pxr/external/boost/python/test/bienstman1.cpp new file mode 100644 index 0000000000..dc00657848 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman1.cpp @@ -0,0 +1,40 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include + +struct A {}; + +struct V +{ + virtual ~V() {}; // silence compiler warningsa + virtual void f() = 0; + + const A* inside() {return &a;} + + A a; +}; + +const A* outside(const V& v) {return &v.a;} + +BOOST_PYTHON_MODULE(bienstman1_ext) +{ + using namespace boost::python; + using boost::shared_ptr; + using boost::python::return_value_policy; + using boost::python::reference_existing_object; + + class_("A"); + + class_("V", no_init) + .def("inside", &V::inside, + return_value_policy()) + .def("outside", outside, + return_value_policy()) + ; +} + diff --git a/pxr/external/boost/python/test/bienstman1.py b/pxr/external/boost/python/test/bienstman1.py new file mode 100644 index 0000000000..16dc47b2d1 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman1.py @@ -0,0 +1,23 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +# Try to reproduce a Numeric interaction bug if Numeric is installed. +>>> from bienstman1_ext import * +>>> try: from Numeric import * +... except: pass +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/bienstman2.cpp b/pxr/external/boost/python/test/bienstman2.cpp new file mode 100644 index 0000000000..10f99923d1 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman2.cpp @@ -0,0 +1,28 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +struct C {}; + +struct D {}; + +struct E +{ + const D fe (const C&) {return D();} + const D fe2(const C&, const C&) {return D();} +}; + +BOOST_PYTHON_MODULE(bienstman2_ext) +{ + using namespace boost::python; + + class_("C"); + class_("D"); + class_("E") + .def("fe", &E::fe) // this compiles. + .def("fe2", &E::fe2) // this doesn't... well, now it does ;-) + ; +} diff --git a/pxr/external/boost/python/test/bienstman2.py b/pxr/external/boost/python/test/bienstman2.py new file mode 100644 index 0000000000..931fae8f74 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman2.py @@ -0,0 +1,20 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> import bienstman2_ext +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/bienstman3.cpp b/pxr/external/boost/python/test/bienstman3.cpp new file mode 100644 index 0000000000..d765b303d6 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman3.cpp @@ -0,0 +1,26 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +struct V +{ + virtual ~V() {}; // silence compiler warningsa + virtual void f() = 0; +}; + +struct B +{ + B(const V&) {} +}; + +BOOST_PYTHON_MODULE(bienstman3_ext) +{ + using namespace boost::python; + + class_("V", no_init); + class_("B", init()); + +} diff --git a/pxr/external/boost/python/test/bienstman3.py b/pxr/external/boost/python/test/bienstman3.py new file mode 100644 index 0000000000..d0d250aea9 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman3.py @@ -0,0 +1,30 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from bienstman3_ext import * + +>>> try: +... V() +... except RuntimeError as x: +... print(x) +... else: +... print('expected an exception') +... +This class cannot be instantiated from Python + +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/bienstman4.cpp b/pxr/external/boost/python/test/bienstman4.cpp new file mode 100644 index 0000000000..34b9e211fb --- /dev/null +++ b/pxr/external/boost/python/test/bienstman4.cpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +struct Type1 {}; + +struct Term {Term(Type1 const&) {} }; + +struct Expression {void add(Term const&) {} }; + +BOOST_PYTHON_MODULE(bienstman4_ext) +{ + using namespace boost::python; + using boost::mpl::list; + + implicitly_convertible(); + + class_("Expression") + .def("add", &Expression::add) + ; + + class_("T1") + ; + + class_("Term", init()) + ; + + Type1 t1; + Expression e; + e.add(t1); +} + diff --git a/pxr/external/boost/python/test/bienstman4.py b/pxr/external/boost/python/test/bienstman4.py new file mode 100644 index 0000000000..eea33ba2a8 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman4.py @@ -0,0 +1,23 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from bienstman4_ext import * +>>> t1 = T1() +>>> e = Expression() +>>> e.add(t1) +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/bienstman5.cpp b/pxr/external/boost/python/test/bienstman5.cpp new file mode 100644 index 0000000000..657dadd121 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman5.cpp @@ -0,0 +1,23 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include + +struct M {M(const std::complex&) {} }; + +BOOST_PYTHON_MODULE(bienstman5_ext) +{ + using namespace boost::python; + + class_("M", init const&>()) + ; +} + + diff --git a/pxr/external/boost/python/test/bienstman5.py b/pxr/external/boost/python/test/bienstman5.py new file mode 100644 index 0000000000..a6735d9422 --- /dev/null +++ b/pxr/external/boost/python/test/bienstman5.py @@ -0,0 +1,21 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from bienstman5_ext import * +>>> m = M(1j) +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/boost_shared_ptr.cpp b/pxr/external/boost/python/test/boost_shared_ptr.cpp new file mode 100644 index 0000000000..57e50aa3c1 --- /dev/null +++ b/pxr/external/boost/python/test/boost_shared_ptr.cpp @@ -0,0 +1,20 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +using boost::shared_ptr; +#define MODULE boost_shared_ptr_ext + +#include "shared_ptr.hpp" +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/boost_shared_ptr.py b/pxr/external/boost/python/test/boost_shared_ptr.py new file mode 100644 index 0000000000..31a2ad3d25 --- /dev/null +++ b/pxr/external/boost/python/test/boost_shared_ptr.py @@ -0,0 +1,130 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from boost_shared_ptr_ext import * + + Test that shared_ptr can be converted to shared_ptr + +>>> Y.store(YYY(42)) + +>>> x = X(17) +>>> null_x = null(x) +>>> null_x # should be None +>>> identity(null_x) # should also be None + +>>> a = New(1) +>>> A.call_f(a) +1 +>>> New(0) + +>>> type(factory(3)) + +>>> type(factory(42)) + + +>>> class P(Z): +... def v(self): +... return -Z.v(self); +... def __del__(self): +... print('bye') +... +>>> p = P(12) +>>> p.value() +12 +>>> p.v() +-12 +>>> look(p) +12 +>>> try: modify(p) +... except TypeError: pass +... else: 'print(expected a TypeError)' +>>> look(None) +-1 +>>> store(p) +>>> del p +>>> Z.get().v() +-12 +>>> Z.count() +1 +>>> Z.look_store() +12 +>>> Z.release() +bye +>>> Z.count() +0 + +>>> z = Z(13) +>>> z.value() +13 +>>> z.v() +13 +>>> try: modify(z) +... except TypeError: pass +... else: 'print(expected a TypeError)' + +>>> Z.get() # should be None +>>> store(z) +>>> assert Z.get() is z # show that deleter introspection works +>>> del z +>>> Z.get().value() +13 +>>> Z.count() +1 +>>> Z.look_store() +13 +>>> Z.release() +>>> Z.count() +0 + +>>> x = X(17) +>>> x.value() +17 +>>> look(x) +17 +>>> try: modify(x) +... except TypeError: pass +... else: 'print(expected a TypeError)' +>>> look(None) +-1 +>>> store(x) +>>> del x +>>> X.count() +1 +>>> X.look_store() +17 +>>> X.release() +>>> X.count() +0 + + +>>> y = Y(19) +>>> y.value() +19 +>>> modify(y) +>>> look(y) +-1 +>>> store(Y(23)) +>>> Y.count() +1 +>>> Y.look_store() +23 +>>> Y.release() +>>> Y.count() +0 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/borrowed.cpp b/pxr/external/boost/python/test/borrowed.cpp new file mode 100644 index 0000000000..2c1bd1b7a0 --- /dev/null +++ b/pxr/external/boost/python/test/borrowed.cpp @@ -0,0 +1,33 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +using namespace boost::python; + +template +void assert_borrowed_ptr(T const&) +{ + BOOST_STATIC_ASSERT(boost::python::detail::is_borrowed_ptr::value); +} + +template +void assert_not_borrowed_ptr(T const&) +{ + BOOST_STATIC_ASSERT(!boost::python::detail::is_borrowed_ptr::value); +} + +int main() +{ + assert_borrowed_ptr(borrowed((PyObject*)0)); + assert_borrowed_ptr(borrowed((PyTypeObject*)0)); + assert_borrowed_ptr((detail::borrowed const*)0); + assert_borrowed_ptr((detail::borrowed volatile*)0); + assert_borrowed_ptr((detail::borrowed const volatile*)0); + assert_not_borrowed_ptr((PyObject*)0); + assert_not_borrowed_ptr(0); + return 0; +} diff --git a/pxr/external/boost/python/test/builtin_converters.cpp b/pxr/external/boost/python/test/builtin_converters.cpp new file mode 100644 index 0000000000..f66e61bd82 --- /dev/null +++ b/pxr/external/boost/python/test/builtin_converters.cpp @@ -0,0 +1,152 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include + +template +struct by_value +{ + static T rewrap(T x) + { + return x; + } + static int size(void) + { + return sizeof(T); + } +}; + +template +struct by_const_reference +{ + static T rewrap(T const& x) + { + return x; + } +}; + +template +struct by_reference +{ + static T rewrap(T& x) + { + return x; + } +}; + +using boost::python::def; +using boost::python::handle; +using boost::python::object; +using boost::python::borrowed; + +// Used to test that arbitrary handle<>s can be returned +handle get_type(handle<> x) +{ + return handle(borrowed(x->ob_type)); +} + +handle<> return_null_handle() +{ + return handle<>(); +} + +char const* rewrap_value_mutable_cstring(char* x) { return x; } + +object identity_(object x) { return x; } + +BOOST_PYTHON_MODULE(builtin_converters_ext) +{ + def("get_type", get_type); + def("return_null_handle", return_null_handle); + +// These methods are used solely for getting some C++ type sizes + def("bool_size", by_value::size); + def("char_size", by_value::size); + def("int_size", by_value::size); + def("short_size", by_value::size); + def("long_size", by_value::size); +#ifdef HAVE_LONG_LONG + def("long_long_size", by_value::size); +#endif + + def("rewrap_value_bool", by_value::rewrap); + def("rewrap_value_char", by_value::rewrap); + def("rewrap_value_signed_char", by_value::rewrap); + def("rewrap_value_unsigned_char", by_value::rewrap); + def("rewrap_value_int", by_value::rewrap); + def("rewrap_value_unsigned_int", by_value::rewrap); + def("rewrap_value_short", by_value::rewrap); + def("rewrap_value_unsigned_short", by_value::rewrap); + def("rewrap_value_long", by_value::rewrap); + def("rewrap_value_unsigned_long", by_value::rewrap); +// using Python's macro instead of Boost's - we don't seem to get the +// config right all the time. +#ifdef HAVE_LONG_LONG + def("rewrap_value_long_long", by_value::rewrap); + def("rewrap_value_unsigned_long_long", by_value::rewrap); +# endif + def("rewrap_value_float", by_value::rewrap); + def("rewrap_value_double", by_value::rewrap); + def("rewrap_value_long_double", by_value::rewrap); + def("rewrap_value_complex_float", by_value >::rewrap); + def("rewrap_value_complex_double", by_value >::rewrap); + def("rewrap_value_complex_long_double", by_value >::rewrap); + def("rewrap_value_wstring", +# if defined(BOOST_NO_STD_WSTRING) || !defined(Py_USING_UNICODE) + identity_ +# else + by_value::rewrap +# endif + ); + def("rewrap_value_string", +# if defined(BOOST_NO_STD_WSTRING) || !defined(Py_USING_UNICODE) + identity_ +# else + by_value::rewrap +# endif + ); + def("rewrap_value_string", by_value::rewrap); + def("rewrap_value_cstring", by_value::rewrap); + def("rewrap_value_handle", by_value >::rewrap); + def("rewrap_value_object", by_value::rewrap); + + // Expose this to illustrate our failings ;-). See test_builtin_converters.py + def("rewrap_value_mutable_cstring", rewrap_value_mutable_cstring); + + + def("rewrap_const_reference_bool", by_const_reference::rewrap); + def("rewrap_const_reference_char", by_const_reference::rewrap); + def("rewrap_const_reference_signed_char", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_char", by_const_reference::rewrap); + def("rewrap_const_reference_int", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_int", by_const_reference::rewrap); + def("rewrap_const_reference_short", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_short", by_const_reference::rewrap); + def("rewrap_const_reference_long", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_long", by_const_reference::rewrap); +// using Python's macro instead of Boost's - we don't seem to get the +// config right all the time. +# ifdef HAVE_LONG_LONG + def("rewrap_const_reference_long_long", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_long_long", by_const_reference::rewrap); +# endif + def("rewrap_const_reference_float", by_const_reference::rewrap); + def("rewrap_const_reference_double", by_const_reference::rewrap); + def("rewrap_const_reference_long_double", by_const_reference::rewrap); + def("rewrap_const_reference_complex_float", by_const_reference >::rewrap); + def("rewrap_const_reference_complex_double", by_const_reference >::rewrap); + def("rewrap_const_reference_complex_long_double", by_const_reference >::rewrap); + def("rewrap_const_reference_string", by_const_reference::rewrap); + def("rewrap_const_reference_cstring", by_const_reference::rewrap); + def("rewrap_const_reference_handle", by_const_reference >::rewrap); + def("rewrap_const_reference_object", by_const_reference::rewrap); + def("rewrap_reference_object", by_reference::rewrap); +} + diff --git a/pxr/external/boost/python/test/callbacks.cpp b/pxr/external/boost/python/test/callbacks.cpp new file mode 100644 index 0000000000..66bd352405 --- /dev/null +++ b/pxr/external/boost/python/test/callbacks.cpp @@ -0,0 +1,150 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +using namespace boost::python; +BOOST_STATIC_ASSERT(converter::is_object_manager >::value); + +int apply_int_int(PyObject* f, int x) +{ + return call(f, x); +} + +void apply_void_int(PyObject* f, int x) +{ + call(f, x); +} + +struct X +{ + explicit X(int x) : x(x), magic(7654321) { ++counter; } + X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; } + ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; } + + void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; } + int value() const { BOOST_ASSERT(magic == 7654321); return x; } + static int count() { return counter; } + private: + void operator=(X const&); + private: + int x; + long magic; + static int counter; +}; + +X apply_X_X(PyObject* f, X x) +{ + return call(f, x); +} + +void apply_void_X_ref(PyObject* f, X& x) +{ + call(f, boost::ref(x)); +} + +X& apply_X_ref_handle(PyObject* f, handle<> obj) +{ + return call(f, obj); +} + +X* apply_X_ptr_handle_cref(PyObject* f, handle<> const& obj) +{ + return call(f, obj); +} + +void apply_void_X_cref(PyObject* f, X const& x) +{ + call(f, boost::cref(x)); +} + +void apply_void_X_ptr(PyObject* f, X* x) +{ + call(f, ptr(x)); +} + +void apply_void_X_deep_ptr(PyObject* f, X* x) +{ + call(f, x); +} + +char const* apply_cstring_cstring(PyObject* f, char const* s) +{ + return call(f, s); +} + +char const* apply_cstring_pyobject(PyObject* f, PyObject* s) +{ + return call(f, borrowed(s)); +} + +char apply_char_char(PyObject* f, char c) +{ + return call(f, c); +} + +char const* apply_to_string_literal(PyObject* f) +{ + return call(f, "hello, world"); +} + +handle<> apply_to_own_type(handle<> x) +{ + // Tests that we can return handle<> from a callback and that we + // can pass arbitrary handle. + return call >(x.get(), type_handle(borrowed(x->ob_type))); +} + +object apply_object_object(PyObject* f, object x) +{ + return call(f, x); +} + +int X::counter; + +BOOST_PYTHON_MODULE(callbacks_ext) +{ + def("apply_object_object", apply_object_object); + def("apply_to_own_type", apply_to_own_type); + def("apply_int_int", apply_int_int); + def("apply_void_int", apply_void_int); + def("apply_X_X", apply_X_X); + def("apply_void_X_ref", apply_void_X_ref); + def("apply_void_X_cref", apply_void_X_cref); + def("apply_void_X_ptr", apply_void_X_ptr); + def("apply_void_X_deep_ptr", apply_void_X_deep_ptr); + + def("apply_X_ptr_handle_cref", apply_X_ptr_handle_cref + , return_value_policy()); + + def("apply_X_ref_handle", apply_X_ref_handle + , return_value_policy()); + + def("apply_cstring_cstring", apply_cstring_cstring); + def("apply_cstring_pyobject", apply_cstring_pyobject); + def("apply_char_char", apply_char_char); + def("apply_to_string_literal", apply_to_string_literal); + + + class_("X", init()) + .def(init()) + .def("value", &X::value) + .def("set", &X::set) + ; + + def("x_count", &X::count); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/callbacks.py b/pxr/external/boost/python/test/callbacks.py new file mode 100644 index 0000000000..cf876a89d5 --- /dev/null +++ b/pxr/external/boost/python/test/callbacks.py @@ -0,0 +1,147 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from callbacks_ext import * + +>>> def double(x): +... return x + x +... +>>> apply_int_int(double, 42) +84 +>>> apply_void_int(double, 42) + +>>> def identity(x): +... return x + +Once we have array conversion support, this test will fail. Er, +succeed: + +>>> try: apply_to_string_literal(identity) +... except ReferenceError: pass # expected +... else: print('expected an exception!') + +>>> try: apply_X_ref_handle(lambda ignored:X(42), None) +... except ReferenceError: pass # expected +... else: print('expected an exception!') + +>>> x = X(42) +>>> x.y = X(7) +>>> apply_X_ref_handle(lambda z:z.y, x).value() +7 + +>>> x = apply_X_X(identity, X(42)) +>>> x.value() +42 +>>> x_count() +1 +>>> del x +>>> x_count() +0 + +>>> def increment(x): +... x.set(x.value() + 1) +... +>>> x = X(42) +>>> apply_void_X_ref(increment, x) +>>> x.value() +43 + +>>> apply_void_X_cref(increment, x) +>>> x.value() # const-ness is not respected, sorry! +44 + +>>> last_x = 1 +>>> def decrement(x): +... global last_x +... last_x = x +... if x is not None: +... x.set(x.value() - 1) + +>>> apply_void_X_ptr(decrement, x) +>>> x.value() +43 +>>> last_x.value() +43 +>>> increment(last_x) +>>> x.value() +44 +>>> last_x.value() +44 + +>>> apply_void_X_ptr(decrement, None) +>>> assert last_x is None +>>> x.value() +44 + +>>> last_x = 1 +>>> apply_void_X_deep_ptr(decrement, None) +>>> assert last_x is None +>>> x.value() +44 + +>>> apply_void_X_deep_ptr(decrement, x) +>>> x.value() +44 +>>> last_x.value() +43 + +>>> y = apply_X_ref_handle(identity, x) +>>> assert y.value() == x.value() +>>> increment(x) +>>> assert y.value() == x.value() + +>>> y = apply_X_ptr_handle_cref(identity, x) +>>> assert y.value() == x.value() +>>> increment(x) +>>> assert y.value() == x.value() + +>>> y = apply_X_ptr_handle_cref(identity, None) +>>> y + +>>> def new_x(ignored): +... return X(666) +... +>>> try: apply_X_ref_handle(new_x, 1) +... except ReferenceError: pass +... else: print('no error') + +>>> try: apply_X_ptr_handle_cref(new_x, 1) +... except ReferenceError: pass +... else: print('no error') + +>>> try: apply_cstring_cstring(identity, 'hello') +... except ReferenceError: pass +... else: print('no error') + +>>> apply_char_char(identity, 'x') +'x' + +>>> apply_cstring_pyobject(identity, 'hello') +'hello' + +>>> apply_cstring_pyobject(identity, None) + + +>>> apply_char_char(identity, 'x') +'x' + +>>> assert apply_to_own_type(identity) is type(identity) + +>>> assert apply_object_object(identity, identity) is identity +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/calling_conventions.cpp b/pxr/external/boost/python/test/calling_conventions.cpp new file mode 100644 index 0000000000..c1c2b5a411 --- /dev/null +++ b/pxr/external/boost/python/test/calling_conventions.cpp @@ -0,0 +1,160 @@ +// +// adapted from bind_stdcall_test.cpp - test for bind.hpp + __stdcall (free functions) +// The purpose of this simple test is to determine if a function can be +// called from Python with the various existing calling conventions +// +// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#if !defined(TEST_INCLUDE_RECURSION) + +#define TEST_INCLUDE_RECURSION + +//------------------------------------------------------------------------------ +// this section is the main body of the test extension module + +#if defined(_WIN32) && !defined(_WIN64) +# define BOOST_PYTHON_ENABLE_CDECL +# define BOOST_PYTHON_ENABLE_STDCALL +# define BOOST_PYTHON_ENABLE_FASTCALL +#endif +#include +#include +#include +using namespace boost::python; + +// first define test functions for every calling convention + +#define TEST_DECLARE_FUNCTIONS + +#define TESTED_CALLING_CONVENTION __cdecl +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __stdcall +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __fastcall +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#undef TEST_DECLARE_FUNCTIONS + +// then create a module wrapping the defined functions for every calling convention + +BOOST_PYTHON_MODULE( calling_conventions_ext ) +{ + +#define TEST_WRAP_FUNCTIONS + +#define TESTED_CALLING_CONVENTION __cdecl +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __stdcall +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __fastcall +#include "calling_conventions.cpp" +#undef TESTED_CALLING_CONVENTION + +#undef TEST_WRAP_FUNCTIONS + +} + +#else // !defined(TEST_INCLUDE_RECURSION) + +//------------------------------------------------------------------------------ +// this section defines the functions to be wrapped + +# if defined(TEST_DECLARE_FUNCTIONS) + +# if !defined(TESTED_CALLING_CONVENTION) +# error "One calling convention must be defined" +# endif // !defined(TESTED_CALLING_CONVENTION) + +namespace BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION) { + + long TESTED_CALLING_CONVENTION f_0() + { + return 17041L; + } + + long TESTED_CALLING_CONVENTION f_1(long a) + { + return a; + } + + long TESTED_CALLING_CONVENTION f_2(long a, long b) + { + return a + 10 * b; + } + + long TESTED_CALLING_CONVENTION f_3(long a, long b, long c) + { + return a + 10 * b + 100 * c; + } + + long TESTED_CALLING_CONVENTION f_4(long a, long b, long c, long d) + { + return a + 10 * b + 100 * c + 1000 * d; + } + + long TESTED_CALLING_CONVENTION f_5(long a, long b, long c, long d, long e) + { + return a + 10 * b + 100 * c + 1000 * d + 10000 * e; + } + + long TESTED_CALLING_CONVENTION f_6(long a, long b, long c, long d, long e, long f) + { + return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f; + } + + long TESTED_CALLING_CONVENTION f_7(long a, long b, long c, long d, long e, long f, long g) + { + return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g; + } + + long TESTED_CALLING_CONVENTION f_8(long a, long b, long c, long d, long e, long f, long g, long h) + { + return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h; + } + + long TESTED_CALLING_CONVENTION f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i) + { + return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i; + } + +} // namespace test##TESTED_CALLING_CONVENTION + +# endif // defined(TEST_DECLARE_FUNCTIONS) + +//------------------------------------------------------------------------------ +// this section wraps the functions + +# if defined(TEST_WRAP_FUNCTIONS) + +# if !defined(TESTED_CALLING_CONVENTION) +# error "One calling convention must be defined" +# endif // !defined(TESTED_CALLING_CONVENTION) + + def("f_0" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_0); + def("f_1" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_1); + def("f_2" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_2); + def("f_3" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_3); + def("f_4" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_4); + def("f_5" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_5); + def("f_6" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_6); + def("f_7" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_7); + def("f_8" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_8); + def("f_9" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION), &BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::f_9); + +# endif // defined(TEST_WRAP_FUNCTIONS) + +#endif // !defined(TEST_INCLUDE_RECURSION) diff --git a/pxr/external/boost/python/test/calling_conventions.py b/pxr/external/boost/python/test/calling_conventions.py new file mode 100644 index 0000000000..c57142448b --- /dev/null +++ b/pxr/external/boost/python/test/calling_conventions.py @@ -0,0 +1,81 @@ +# Copyright Nicolas Lelong, 2010. Distributed under the Boost +# Software License, Version 1.0 (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from calling_conventions_ext import * +>>> f_0__cdecl() +17041 +>>> f_1__cdecl(1) +1 +>>> f_2__cdecl(1, 2) +21 +>>> f_3__cdecl(1, 2, 3) +321 +>>> f_4__cdecl(1, 2, 3, 4) +4321 +>>> f_5__cdecl(1, 2, 3, 4, 5) +54321 +>>> f_6__cdecl(1, 2, 3, 4, 5, 6) +654321 +>>> f_7__cdecl(1, 2, 3, 4, 5, 6, 7) +7654321 +>>> f_8__cdecl(1, 2, 3, 4, 5, 6, 7, 8) +87654321 +>>> f_9__cdecl(1, 2, 3, 4, 5, 6, 7, 8, 9) +987654321 +>>> f_0__stdcall() +17041 +>>> f_1__stdcall(1) +1 +>>> f_2__stdcall(1, 2) +21 +>>> f_3__stdcall(1, 2, 3) +321 +>>> f_4__stdcall(1, 2, 3, 4) +4321 +>>> f_5__stdcall(1, 2, 3, 4, 5) +54321 +>>> f_6__stdcall(1, 2, 3, 4, 5, 6) +654321 +>>> f_7__stdcall(1, 2, 3, 4, 5, 6, 7) +7654321 +>>> f_8__stdcall(1, 2, 3, 4, 5, 6, 7, 8) +87654321 +>>> f_9__stdcall(1, 2, 3, 4, 5, 6, 7, 8, 9) +987654321 +>>> f_0__fastcall() +17041 +>>> f_1__fastcall(1) +1 +>>> f_2__fastcall(1, 2) +21 +>>> f_3__fastcall(1, 2, 3) +321 +>>> f_4__fastcall(1, 2, 3, 4) +4321 +>>> f_5__fastcall(1, 2, 3, 4, 5) +54321 +>>> f_6__fastcall(1, 2, 3, 4, 5, 6) +654321 +>>> f_7__fastcall(1, 2, 3, 4, 5, 6, 7) +7654321 +>>> f_8__fastcall(1, 2, 3, 4, 5, 6, 7, 8) +87654321 +>>> f_9__fastcall(1, 2, 3, 4, 5, 6, 7, 8, 9) +987654321 +""" + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/calling_conventions_mf.cpp b/pxr/external/boost/python/test/calling_conventions_mf.cpp new file mode 100644 index 0000000000..83a97acfef --- /dev/null +++ b/pxr/external/boost/python/test/calling_conventions_mf.cpp @@ -0,0 +1,161 @@ +// +// adapted from bind_stdcall_mf_test.cpp - test for bind.hpp + __stdcall (free functions) +// The purpose of this simple test is to determine if a function can be +// called from Python with the various existing calling conventions +// +// Copyright (c) 2001 Peter Dimov and Multi Media Ltd. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#if !defined(TEST_INCLUDE_RECURSION) + +#define TEST_INCLUDE_RECURSION + +//------------------------------------------------------------------------------ +// this section is the main body of the test extension module + +#if defined(_WIN32) && !defined(_WIN64) +# define BOOST_PYTHON_ENABLE_CDECL +# define BOOST_PYTHON_ENABLE_STDCALL +# define BOOST_PYTHON_ENABLE_FASTCALL +#endif +#include +#include +#include +using namespace boost::python; + +// first define test functions for every calling convention + +#define TEST_DECLARE_FUNCTIONS + +#define TESTED_CALLING_CONVENTION __cdecl +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __stdcall +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __fastcall +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#undef TEST_DECLARE_FUNCTIONS + +// then create a module wrapping the defined functions for every calling convention + +BOOST_PYTHON_MODULE( calling_conventions_mf_ext ) +{ + +#define TEST_WRAP_FUNCTIONS + +#define TESTED_CALLING_CONVENTION __cdecl +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __stdcall +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#define TESTED_CALLING_CONVENTION __fastcall +#include "calling_conventions_mf.cpp" +#undef TESTED_CALLING_CONVENTION + +#undef TEST_WRAP_FUNCTIONS + +} + +#else // !defined(TEST_INCLUDE_RECURSION) + +//------------------------------------------------------------------------------ +// this section defines the functions to be wrapped + +# if defined(TEST_DECLARE_FUNCTIONS) + +# if !defined(TESTED_CALLING_CONVENTION) +# error "One calling convention must be defined" +# endif // !defined(TESTED_CALLING_CONVENTION) + +namespace BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION) { + +struct X +{ + mutable unsigned int hash; + + X(): hash(0) {} + + void TESTED_CALLING_CONVENTION f0() { f1(17); } + void TESTED_CALLING_CONVENTION g0() const { g1(17); } + + void TESTED_CALLING_CONVENTION f1(int a1) { hash = (hash * 17041 + a1) % 32768; } + void TESTED_CALLING_CONVENTION g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; } + + void TESTED_CALLING_CONVENTION f2(int a1, int a2) { f1(a1); f1(a2); } + void TESTED_CALLING_CONVENTION g2(int a1, int a2) const { g1(a1); g1(a2); } + + void TESTED_CALLING_CONVENTION f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); } + void TESTED_CALLING_CONVENTION g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); } + + void TESTED_CALLING_CONVENTION f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); } + void TESTED_CALLING_CONVENTION g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); } + + void TESTED_CALLING_CONVENTION f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); } + void TESTED_CALLING_CONVENTION g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); } + + void TESTED_CALLING_CONVENTION f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); } + void TESTED_CALLING_CONVENTION g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); } + + void TESTED_CALLING_CONVENTION f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); } + void TESTED_CALLING_CONVENTION g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); } + + void TESTED_CALLING_CONVENTION f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); } + void TESTED_CALLING_CONVENTION g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); } +}; + +} // namespace BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION) + +# endif // defined(TEST_DECLARE_FUNCTIONS) + +//------------------------------------------------------------------------------ +// this section wraps the functions + +# if defined(TEST_WRAP_FUNCTIONS) + +# if !defined(TESTED_CALLING_CONVENTION) +# error "One calling convention must be defined" +# endif // !defined(TESTED_CALLING_CONVENTION) + +{ + + typedef BOOST_PP_CAT(test, TESTED_CALLING_CONVENTION)::X X; + + class_("X" BOOST_PP_STRINGIZE(TESTED_CALLING_CONVENTION)) + .def("f0", &X::f0) + .def("g0", &X::g0) + .def("f1", &X::f1) + .def("g1", &X::g1) + .def("f2", &X::f2) + .def("g2", &X::g2) + .def("f3", &X::f3) + .def("g3", &X::g3) + .def("f4", &X::f4) + .def("g4", &X::g4) + .def("f5", &X::f5) + .def("g5", &X::g5) + .def("f6", &X::f6) + .def("g6", &X::g6) + .def("f7", &X::f7) + .def("g7", &X::g7) + .def("f8", &X::f8) + .def("g8", &X::g8) + .def_readonly("hash", &X::hash) + ; + +} + +# endif // defined(TEST_WRAP_FUNCTIONS) + +#endif // !defined(TEST_INCLUDE_RECURSION) diff --git a/pxr/external/boost/python/test/calling_conventions_mf.py b/pxr/external/boost/python/test/calling_conventions_mf.py new file mode 100644 index 0000000000..7e28484b9b --- /dev/null +++ b/pxr/external/boost/python/test/calling_conventions_mf.py @@ -0,0 +1,84 @@ +# Copyright Nicolas Lelong, 2010. Distributed under the Boost +# Software License, Version 1.0 (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from calling_conventions_mf_ext import * +>>> x = X__cdecl() +>>> x.f0() +>>> x.g0() +>>> x.f1(1) +>>> x.g1(1) +>>> x.f2(1, 2) +>>> x.g2(1, 2) +>>> x.f3(1, 2, 3) +>>> x.g3(1, 2, 3) +>>> x.f4(1, 2, 3, 4) +>>> x.g4(1, 2, 3, 4) +>>> x.f5(1, 2, 3, 4, 5) +>>> x.g5(1, 2, 3, 4, 5) +>>> x.f6(1, 2, 3, 4, 5, 6) +>>> x.g6(1, 2, 3, 4, 5, 6) +>>> x.f7(1, 2, 3, 4, 5, 6, 7) +>>> x.g7(1, 2, 3, 4, 5, 6, 7) +>>> x.f8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.g8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.hash +2155 +>>> x = X__stdcall() +>>> x.f0() +>>> x.g0() +>>> x.f1(1) +>>> x.g1(1) +>>> x.f2(1, 2) +>>> x.g2(1, 2) +>>> x.f3(1, 2, 3) +>>> x.g3(1, 2, 3) +>>> x.f4(1, 2, 3, 4) +>>> x.g4(1, 2, 3, 4) +>>> x.f5(1, 2, 3, 4, 5) +>>> x.g5(1, 2, 3, 4, 5) +>>> x.f6(1, 2, 3, 4, 5, 6) +>>> x.g6(1, 2, 3, 4, 5, 6) +>>> x.f7(1, 2, 3, 4, 5, 6, 7) +>>> x.g7(1, 2, 3, 4, 5, 6, 7) +>>> x.f8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.g8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.hash +2155 +>>> x = X__fastcall() +>>> x.f0() +>>> x.g0() +>>> x.f1(1) +>>> x.g1(1) +>>> x.f2(1, 2) +>>> x.g2(1, 2) +>>> x.f3(1, 2, 3) +>>> x.g3(1, 2, 3) +>>> x.f4(1, 2, 3, 4) +>>> x.g4(1, 2, 3, 4) +>>> x.f5(1, 2, 3, 4, 5) +>>> x.g5(1, 2, 3, 4, 5) +>>> x.f6(1, 2, 3, 4, 5, 6) +>>> x.g6(1, 2, 3, 4, 5, 6) +>>> x.f7(1, 2, 3, 4, 5, 6, 7) +>>> x.g7(1, 2, 3, 4, 5, 6, 7) +>>> x.f8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.g8(1, 2, 3, 4, 5, 6, 7, 8) +>>> x.hash +2155 +""" + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/class.cpp b/pxr/external/boost/python/test/class.cpp new file mode 100644 index 0000000000..078bebdf64 --- /dev/null +++ b/pxr/external/boost/python/test/class.cpp @@ -0,0 +1,28 @@ +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include + +using namespace boost::python; + +struct X +{ + int x; + X(int n) : x(n) { } +}; + +int x_function(X& x) +{ return x.x; +} + + +BOOST_PYTHON_MODULE(class_ext) +{ + class_("X", init()); + def("x_function", x_function); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/class.py b/pxr/external/boost/python/test/class.py new file mode 100644 index 0000000000..15594a105b --- /dev/null +++ b/pxr/external/boost/python/test/class.py @@ -0,0 +1,40 @@ +# Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from class_ext import * + +Ensure sanity: + + >>> x = X(42) + >>> x_function(x) + 42 + +Demonstrate extraction in the presence of metaclass changes: + + >>> class MetaX(X.__class__): + ... def __new__(cls, *args): + ... return super(MetaX, cls).__new__(cls, *args) + >>> class XPlusMetatype(X): + ... __metaclass__ = MetaX + >>> x = XPlusMetatype(42) + >>> x_function(x) + 42 + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/cltree.cpp b/pxr/external/boost/python/test/cltree.cpp new file mode 100644 index 0000000000..518ae37fef --- /dev/null +++ b/pxr/external/boost/python/test/cltree.cpp @@ -0,0 +1,74 @@ +// Copyright David Abrahams 2005. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +/* Non-modifiable definitions */ + +class basic { +public: + basic() { name = "cltree.basic"; } + std::string repr() { return name+"()"; } +protected: + std::string name; +}; + +class constant: public basic { +public: + constant() { name = "cltree.constant"; } +}; + +class symbol: public basic { +public: + symbol() { name = "cltree.symbol"; } +}; + +class variable: public basic { +public: + variable() { name = "cltree.variable"; } +}; + +/* EOF: Non-modifiable definitions */ + +class symbol_wrapper: public symbol { +public: + symbol_wrapper(PyObject* /*self*/): symbol() { + name = "cltree.wrapped_symbol"; + } +}; + +class variable_wrapper: public variable { +public: + variable_wrapper(PyObject* /*self*/): variable() { + name = "cltree.wrapped_variable"; + } + + // This constructor is introduced only because cannot use + // boost::noncopyable, see below. + variable_wrapper(PyObject* /*self*/,variable v): variable(v) {} + +}; + +BOOST_PYTHON_MODULE(cltree) +{ + boost::python::class_("basic") + .def("__repr__",&basic::repr) + ; + + boost::python::class_, boost::noncopyable>("constant") + ; + + + boost::python::class_("symbol") + ; + + boost::python::class_, variable_wrapper>("variable") + ; +} + +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/complicated.hpp b/pxr/external/boost/python/test/complicated.hpp new file mode 100644 index 0000000000..5ff19aea0e --- /dev/null +++ b/pxr/external/boost/python/test/complicated.hpp @@ -0,0 +1,38 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef COMPLICATED_DWA20011215_HPP +# define COMPLICATED_DWA20011215_HPP +# include + +# include "simple_type.hpp" + +struct complicated +{ + complicated(simple const&, int = 0); + ~complicated(); + + int get_n() const; + + char* s; + int n; +}; + +inline complicated::complicated(simple const&s, int _n) + : s(s.s), n(_n) +{ + std::cout << "constructing complicated: " << this->s << ", " << _n << std::endl; +} + +inline complicated::~complicated() +{ + std::cout << "destroying complicated: " << this->s << ", " << n << std::endl; +} + +inline int complicated::get_n() const +{ + return n; +} + +#endif // COMPLICATED_DWA20011215_HPP diff --git a/pxr/external/boost/python/test/const_argument.cpp b/pxr/external/boost/python/test/const_argument.cpp new file mode 100644 index 0000000000..279c3dc1ae --- /dev/null +++ b/pxr/external/boost/python/test/const_argument.cpp @@ -0,0 +1,28 @@ +/* Copyright 2004 Jonathan Brandmeyer + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + * The purpose of this test is to determine if a function can be called from + * Python with a const value type as an argument, and whether or not the + * presence of a prototype without the cv-qualifier will work around the + * compiler's bug. + */ +#include +using namespace boost::python; + + +#if BOOST_WORKAROUND(BOOST_MSVC, == 1200) +bool accept_const_arg( object ); +#endif + +bool accept_const_arg( const object ) +{ + return true; +} + + +BOOST_PYTHON_MODULE( const_argument_ext ) +{ + def( "accept_const_arg", accept_const_arg ); +} diff --git a/pxr/external/boost/python/test/const_argument.py b/pxr/external/boost/python/test/const_argument.py new file mode 100644 index 0000000000..1d241953b3 --- /dev/null +++ b/pxr/external/boost/python/test/const_argument.py @@ -0,0 +1,23 @@ +# Copyright Jonathan Brandmeyer, 2004. Distributed under the Boost +# Software License, Version 1.0 (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from const_argument_ext import * +>>> accept_const_arg(1) +1 +""" + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp new file mode 100644 index 0000000000..41eac495e4 --- /dev/null +++ b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp @@ -0,0 +1,23 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include + +struct foo +{ + operator std::auto_ptr&() const; +}; + +int main() +{ + using namespace boost::python::detail; + BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); + BOOST_STATIC_ASSERT(copy_ctor_mutates_rhs >::value); + BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); + BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); + return 0; +} diff --git a/pxr/external/boost/python/test/crossmod_exception.py b/pxr/external/boost/python/test/crossmod_exception.py new file mode 100644 index 0000000000..4820f29e96 --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_exception.py @@ -0,0 +1,19 @@ +# Copyright (C) 2003 Rational Discovery LLC. Distributed under the Boost +# Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy +# at http://www.boost.org/LICENSE_1_0.txt) + +print("running...") + +import crossmod_exception_a +import crossmod_exception_b + +try: + crossmod_exception_b.tossit() +except IndexError: + pass +try: + crossmod_exception_a.tossit() +except IndexError: + pass + +print("Done.") diff --git a/pxr/external/boost/python/test/crossmod_exception_a.cpp b/pxr/external/boost/python/test/crossmod_exception_a.cpp new file mode 100644 index 0000000000..9526129af5 --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_exception_a.cpp @@ -0,0 +1,18 @@ +// Copyright (C) 2003 Rational Discovery LLC +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace python = boost::python; + +void tossit(){ + PyErr_SetString(PyExc_IndexError,"a-blah!"); + throw python::error_already_set(); +} + +BOOST_PYTHON_MODULE(crossmod_exception_a) +{ + python::def("tossit",tossit); +} diff --git a/pxr/external/boost/python/test/crossmod_exception_b.cpp b/pxr/external/boost/python/test/crossmod_exception_b.cpp new file mode 100644 index 0000000000..e2ea491caa --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_exception_b.cpp @@ -0,0 +1,18 @@ +// Copyright (C) 2003 Rational Discovery LLC +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace python = boost::python; + +void tossit(){ + PyErr_SetString(PyExc_IndexError,"b-blah!"); + throw python::error_already_set(); +} + +BOOST_PYTHON_MODULE(crossmod_exception_b) +{ + python::def("tossit",tossit); +} diff --git a/pxr/external/boost/python/test/crossmod_opaque.py b/pxr/external/boost/python/test/crossmod_opaque.py new file mode 100644 index 0000000000..533ac16fe1 --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_opaque.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright Gottfried Ganßauge 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +if __name__ == '__main__': + print("running...") + + import crossmod_opaque_a + import crossmod_opaque_b + + crossmod_opaque_a.get() + crossmod_opaque_b.get() + + print("Done.") diff --git a/pxr/external/boost/python/test/crossmod_opaque_a.cpp b/pxr/external/boost/python/test/crossmod_opaque_a.cpp new file mode 100644 index 0000000000..62ed433111 --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_opaque_a.cpp @@ -0,0 +1,26 @@ +// Copyright Gottfried Ganßauge 2006. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# include +# include +# include +# include + +typedef struct opaque_ *opaque; + +opaque the_op = ((opaque) 0x47110815); + +opaque get() { return the_op; } + +BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) + +namespace bpl = boost::python; + +BOOST_PYTHON_MODULE(crossmod_opaque_a) +{ + bpl::def ( + "get", + &::get, + bpl::return_value_policy()); +} diff --git a/pxr/external/boost/python/test/crossmod_opaque_b.cpp b/pxr/external/boost/python/test/crossmod_opaque_b.cpp new file mode 100644 index 0000000000..3d661339ce --- /dev/null +++ b/pxr/external/boost/python/test/crossmod_opaque_b.cpp @@ -0,0 +1,26 @@ +// Copyright Gottfried Ganßauge 2006. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# include +# include +# include +# include + +typedef struct opaque_ *opaque; + +opaque the_op = ((opaque) 0x47110815); + +opaque get() { return the_op; } + +BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) + +namespace bpl = boost::python; + +BOOST_PYTHON_MODULE(crossmod_opaque_b) +{ + bpl::def ( + "get", + &::get, + bpl::return_value_policy()); +} diff --git a/pxr/external/boost/python/test/data_members.cpp b/pxr/external/boost/python/test/data_members.cpp new file mode 100644 index 0000000000..6d2cc7bd4e --- /dev/null +++ b/pxr/external/boost/python/test/data_members.cpp @@ -0,0 +1,132 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include "test_class.hpp" + +#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245 +# include // works around a KCC intermediate code generation bug +#endif + + +using namespace boost::python; + +typedef test_class<> X; + +struct Y : test_class<1> +{ + Y(int v) : test_class<1>(v) {} + Y& operator=(Y const& rhs) { x = rhs.x; return *this; } + bool q; +}; + +double get_fair_value(X const& x) { return x.value(); } + + +struct VarBase +{ + VarBase(std::string name_) : name(name_) {} + + std::string const name; + std::string get_name1() const { return name; } + +}; + +struct Var : VarBase +{ + Var(std::string name_) : VarBase(name_), value(), name2(name.c_str()), y(6) {} + std::string const& get_name2() const { return name; } + float value; + char const* name2; + Y y; + + static int static1; + static Y static2; +}; + +int Var::static1 = 0; +Y Var::static2(0); + +// Compilability regression tests +namespace boost_python_test +{ + struct trivial + { + trivial() : value(123) {} + double value; + }; + + struct Color3 + { + static const Color3 black; + }; + + const Color3 Color3::black +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + = {} +#endif + ; + + void compilability_test() + { + class_("trivial") + .add_property("property", make_getter(&trivial::value, return_value_policy())) + .def_readonly("readonly", &trivial::value) + ; + + class_< Color3 >("Color3", init< const Color3 & >()) + .def_readonly("BLACK", &Color3::black) // line 17 + ; + } +} + +BOOST_PYTHON_MODULE(data_members_ext) +{ + using namespace boost_python_test; + class_("X", init()) + .def("value", &X::value) + .def("set", &X::set) + .def_readonly("x", &X::x) + .add_property("fair_value", get_fair_value) + ; + + class_("Y", init()) + .def("value", &Y::value) + .def("set", &Y::set) + .def_readwrite("x", &Y::x) + .def_readwrite("q", &Y::q) + ; + + class_("Var", init()) + .def_readonly("name", &Var::name) + .def_readonly("name2", &Var::name2) + .def_readwrite("value", &Var::value) + .def_readonly("y", &Var::y) + + // Test return_by_value for plain values and for + // pointers... return_by_value was implemented as a + // side-effect of implementing data member support, so it made + // sense to add the test here. + .def("get_name1", &Var::get_name1, return_value_policy()) + .def("get_name2", &Var::get_name2, return_value_policy()) + + .add_property("name3", &Var::get_name1) + + // Test static data members + .def_readonly("ro1a", &Var::static1) + .def_readonly("ro1b", Var::static1) + .def_readwrite("rw1a", &Var::static1) + .def_readwrite("rw1b", Var::static1) + + .def_readonly("ro2a", &Var::static2) + .def_readonly("ro2b", Var::static2) + .def_readwrite("rw2a", &Var::static2) + .def_readwrite("rw2b", Var::static2) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/data_members.py b/pxr/external/boost/python/test/data_members.py new file mode 100644 index 0000000000..74b655eb56 --- /dev/null +++ b/pxr/external/boost/python/test/data_members.py @@ -0,0 +1,215 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from data_members_ext import * + + ---- Test static data members --- + +>>> v = Var('slim shady') + +>>> Var.ro2a.x +0 +>>> Var.ro2b.x +0 +>>> Var.rw2a.x +0 +>>> Var.rw2b.x +0 +>>> v.ro2a.x +0 +>>> v.ro2b.x +0 +>>> v.rw2a.x +0 +>>> v.rw2b.x +0 +>>> Var.rw2a.x = 777 +>>> Var.ro2a.x +777 +>>> Var.ro2b.x +777 +>>> Var.rw2a.x +777 +>>> Var.rw2b.x +777 +>>> v.ro2a.x +777 +>>> v.ro2b.x +777 +>>> v.rw2a.x +777 +>>> v.rw2b.x +777 +>>> Var.rw2b = Y(888) + +>>> y = Y(99) +>>> y.q = True +>>> y.q +True +>>> y.q = False +>>> y.q +False + +>>> Var.ro2a.x +888 +>>> Var.ro2b.x +888 +>>> Var.rw2a.x +888 +>>> Var.rw2b.x +888 +>>> v.ro2a.x +888 +>>> v.ro2b.x +888 +>>> v.rw2a.x +888 +>>> v.rw2b.x +888 +>>> v.rw2b.x = 999 +>>> Var.ro2a.x +999 +>>> Var.ro2b.x +999 +>>> Var.rw2a.x +999 +>>> Var.rw2b.x +999 +>>> v.ro2a.x +999 +>>> v.ro2b.x +999 +>>> v.rw2a.x +999 +>>> v.rw2b.x +999 + + +>>> Var.ro1a +0 +>>> Var.ro1b +0 +>>> Var.rw1a +0 +>>> Var.rw1b +0 +>>> v.ro1a +0 +>>> v.ro1b +0 +>>> v.rw1a +0 +>>> v.rw1b +0 +>>> Var.rw1a = 777 +>>> Var.ro1a +777 +>>> Var.ro1b +777 +>>> Var.rw1a +777 +>>> Var.rw1b +777 +>>> v.ro1a +777 +>>> v.ro1b +777 +>>> v.rw1a +777 +>>> v.rw1b +777 +>>> Var.rw1b = 888 +>>> Var.ro1a +888 +>>> Var.ro1b +888 +>>> Var.rw1a +888 +>>> Var.rw1b +888 +>>> v.ro1a +888 +>>> v.ro1b +888 +>>> v.rw1a +888 +>>> v.rw1b +888 +>>> v.rw1b = 999 +>>> Var.ro1a +999 +>>> Var.ro1b +999 +>>> Var.rw1a +999 +>>> Var.rw1b +999 +>>> v.ro1a +999 +>>> v.ro1b +999 +>>> v.rw1a +999 +>>> v.rw1b +999 + + + + ----------------- + +>>> x = X(42) +>>> x.x +42 +>>> try: x.x = 77 +... except AttributeError: pass +... else: print('no error') + +>>> x.fair_value +42.0 +>>> y = Y(69) +>>> y.x +69 +>>> y.x = 77 +>>> y.x +77 + +>>> v = Var("pi") +>>> v.value = 3.14 +>>> v.name +'pi' +>>> v.name2 +'pi' + +>>> v.get_name1() +'pi' + +>>> v.get_name2() +'pi' + +>>> v.y.x +6 +>>> v.y.x = -7 +>>> v.y.x +-7 + +>>> v.name3 +'pi' + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/defaults.cpp b/pxr/external/boost/python/test/defaults.cpp new file mode 100644 index 0000000000..6d87e5d6ee --- /dev/null +++ b/pxr/external/boost/python/test/defaults.cpp @@ -0,0 +1,173 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245 +# include // works around a KCC intermediate code generation bug +#endif + +using namespace boost::python; +namespace bpl = boost::python; + +char const* const format = "int(%s); char(%s); string(%s); double(%s); "; + +/////////////////////////////////////////////////////////////////////////////// +// +// Overloaded functions +// +/////////////////////////////////////////////////////////////////////////////// +object +bar(int a, char b, std::string c, double d) +{ + return format % bpl::make_tuple(a, b, c, d); +} + +object +bar(int a, char b, std::string c) +{ + return format % bpl::make_tuple(a, b, c, 0.0); +} + +object +bar(int a, char b) +{ + return format % bpl::make_tuple(a, b, "default", 0.0); +} + +object +bar(int a) +{ + return format % bpl::make_tuple(a, 'D', "default", 0.0); +} + +BOOST_PYTHON_FUNCTION_OVERLOADS(bar_stubs, bar, 1, 4) + +/////////////////////////////////////////////////////////////////////////////// +// +// Functions with default arguments +// +/////////////////////////////////////////////////////////////////////////////// +object +foo(int a, char b = 'D', std::string c = "default", double d = 0.0) +{ + return format % bpl::make_tuple(a, b, c, d); +} + +BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) + +/////////////////////////////////////////////////////////////////////////////// +// +// Overloaded member functions with default arguments +// +/////////////////////////////////////////////////////////////////////////////// +struct Y { + + Y() {} + + object + get_state() const + { + return format % bpl::make_tuple(a, b, c, d); + } + + int a; char b; std::string c; double d; +}; + + +struct X { + + X() {} + + X(int a, char b = 'D', std::string c = "constructor", double d = 0.0) + : state(format % bpl::make_tuple(a, b, c, d)) + {} + + X(std::string s, bool b) + : state("Got exactly two arguments from constructor: string(%s); bool(%s); " % bpl::make_tuple(s, b*1)) + {} + + object + bar(int a, char b = 'D', std::string c = "default", double d = 0.0) const + { + return format % bpl::make_tuple(a, b, c, d); + } + + Y const& + bar2(int a = 0, char b = 'D', std::string c = "default", double d = 0.0) + { + // tests zero arg member function and return_internal_reference policy + y.a = a; + y.b = b; + y.c = c; + y.d = d; + return y; + } + + object + foo(int a, bool b=false) const + { + return "int(%s); bool(%s); " % bpl::make_tuple(a, b*1); + } + + object + foo(std::string a, bool b=false) const + { + return "string(%s); bool(%s); " % bpl::make_tuple(a, b*1); + } + + object + foo(list a, list b, bool c=false) const + { + return "list(%s); list(%s); bool(%s); " % bpl::make_tuple(a, b, c*1); + } + + object + get_state() const + { + return state; + } + + Y y; + object state; +}; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs, bar, 1, 4) +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs2, bar2, 0, 4) +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_2_stubs, foo, 1, 2) +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_3_stubs, foo, 2, 3) + +/////////////////////////////////////////////////////////////////////////////// + +BOOST_PYTHON_MODULE(defaults_ext) +{ + def("foo", foo, foo_stubs()); + def("bar", (object(*)(int, char, std::string, double))0, bar_stubs()); + + class_("Y", init<>("doc of Y init")) // this should work + .def("get_state", &Y::get_state) + ; + + class_("X",no_init) + + .def(init >("doc of init", args("self", "a", "b", "c", "d"))) + .def(init(args("self", "s", "b"))[default_call_policies()]) // what's a good policy here? + .def("get_state", &X::get_state) + .def("bar", &X::bar, X_bar_stubs()) + .def("bar2", &X::bar2, X_bar_stubs2("doc of X::bar2")[return_internal_reference<>()]) + .def("foo", (object(X::*)(std::string, bool) const)0, X_foo_2_stubs()) + .def("foo", (object(X::*)(int, bool) const)0, X_foo_2_stubs()) + .def("foo", (object(X::*)(list, list, bool) const)0, X_foo_3_stubs()) + ; +} + +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/defaults.py b/pxr/external/boost/python/test/defaults.py new file mode 100644 index 0000000000..cf3cfd38f3 --- /dev/null +++ b/pxr/external/boost/python/test/defaults.py @@ -0,0 +1,140 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from defaults_ext import * +>>> bar(1) +'int(1); char(D); string(default); double(0.0); ' + +>>> bar(2, 'X') +'int(2); char(X); string(default); double(0.0); ' + +>>> bar(3, 'Y', "Hello World") +'int(3); char(Y); string(Hello World); double(0.0); ' + +>>> bar(4, 'Z', "Hi There", 3.3) +'int(4); char(Z); string(Hi There); double(3.3); ' + +>>> foo(1) +'int(1); char(D); string(default); double(0.0); ' + +>>> foo(2, 'X') +'int(2); char(X); string(default); double(0.0); ' + +>>> foo(3, 'Y', "Hello World") +'int(3); char(Y); string(Hello World); double(0.0); ' + +>>> foo(4, 'Z', "Hi There", 3.3) +'int(4); char(Z); string(Hi There); double(3.3); ' + +>>> x = X() +>>> x.bar(1) +'int(1); char(D); string(default); double(0.0); ' + +>>> x.bar(2, 'X') +'int(2); char(X); string(default); double(0.0); ' + +>>> x.bar(3, 'Y', "Hello World") +'int(3); char(Y); string(Hello World); double(0.0); ' + +>>> x.bar(4, 'Z', "Hi There", 3.3) +'int(4); char(Z); string(Hi There); double(3.3); ' + +>>> x.foo(5) +'int(5); bool(0); ' + +>>> x.foo(6, 0) +'int(6); bool(0); ' + +>>> x.foo(7, 1) +'int(7); bool(1); ' + +>>> x.foo("A") +'string(A); bool(0); ' + +>>> x.foo("B", False) +'string(B); bool(0); ' + +>>> x.foo("C", True) +'string(C); bool(1); ' + +>>> x.foo([0,1,2], [2,3,4]) +'list([0, 1, 2]); list([2, 3, 4]); bool(0); ' + +>>> x.foo([0,1,2], [2,3,4], False) +'list([0, 1, 2]); list([2, 3, 4]); bool(0); ' + +>>> x.foo([0,1,2], [2,3,4], True) +'list([0, 1, 2]); list([2, 3, 4]); bool(1); ' + +>>> x = X(1) +>>> x.get_state() +'int(1); char(D); string(constructor); double(0.0); ' + +>>> x = X(1, 'X') +>>> x.get_state() +'int(1); char(X); string(constructor); double(0.0); ' + +>>> x = X(1, 'X', "Yabadabadoo") +>>> x.get_state() +'int(1); char(X); string(Yabadabadoo); double(0.0); ' + +>>> x = X(1, 'X', "Phoenix", 3.65) +>>> x.get_state() +'int(1); char(X); string(Phoenix); double(3.65); ' + +>>> x.bar2().get_state() +'int(0); char(D); string(default); double(0.0); ' + +>>> x.bar2(1).get_state() +'int(1); char(D); string(default); double(0.0); ' + +>>> x.bar2(1, 'K').get_state() +'int(1); char(K); string(default); double(0.0); ' + +>>> x.bar2(1, 'K', "Kim").get_state() +'int(1); char(K); string(Kim); double(0.0); ' + +>>> x.bar2(1, 'K', "Kim", 9.9).get_state() +'int(1); char(K); string(Kim); double(9.9); ' + +>>> x = X("Phoenix", 1) +>>> x.get_state() +'Got exactly two arguments from constructor: string(Phoenix); bool(1); ' + +>>> def selected_doc(obj, *args): +... doc = obj.__doc__.splitlines() +... return "\\n".join(["|"+doc[i] for i in args]) + +>>> print(selected_doc(X.__init__, 1, 2, 4, 7, 9)) +|__init__( (object)self [, (int)a [, (str)b [, (str)c [, (float)d]]]]) -> None : +| doc of init +| C++ signature : +|__init__( (object)self, (str)s, (bool)b) -> None : +| C++ signature : + +>>> print(selected_doc(Y.__init__, 1, 2, 4)) +|__init__( (object)arg1) -> None : +| doc of Y init +| C++ signature : + +>>> print(selected_doc(X.bar2, 1, 2, 4)) +|bar2( (X)arg1 [, (int)arg2 [, (str)arg3 [, (str)arg4 [, (float)arg5]]]]) -> Y : +| doc of X::bar2 +| C++ signature : + +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/destroy_test.cpp b/pxr/external/boost/python/test/destroy_test.cpp new file mode 100644 index 0000000000..57501604b3 --- /dev/null +++ b/pxr/external/boost/python/test/destroy_test.cpp @@ -0,0 +1,58 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include + +#include + +int count; +int marks[] = { + -1 + , -1, -1 + , -1, -1, -1, -1 + , -1 +}; +int* kills = marks; + +struct foo +{ + foo() : n(count++) {} + ~foo() + { + *kills++ = n; + } + int n; + + // This used to cause compiler errors with MSVC 9.0. + foo& operator~(); + foo& T(); +}; + +void assert_destructions(int n) +{ + for (int i = 0; i < n; ++i) + BOOST_TEST(marks[i] == i); + BOOST_TEST(marks[n] == -1); +} + +int main() +{ + assert_destructions(0); + + foo* f1 = new foo; + boost::python::detail::destroy_referent(f1); + assert_destructions(1); + + foo* f2 = new foo[2]; + typedef foo x[2]; + + boost::python::detail::destroy_referent(f2); + assert_destructions(3); + + typedef foo y[2][2]; + x* f3 = new y; + boost::python::detail::destroy_referent(f3); + assert_destructions(7); + + return boost::report_errors(); +} diff --git a/pxr/external/boost/python/test/dict.cpp b/pxr/external/boost/python/test/dict.cpp new file mode 100644 index 0000000000..4f3490a421 --- /dev/null +++ b/pxr/external/boost/python/test/dict.cpp @@ -0,0 +1,91 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +#include +#include +#include +#include +#include + +using namespace boost::python; + +object new_dict() +{ + return dict(); +} + +object data_dict() +{ + dict tmp1; + + dict tmp2; + tmp2["key2"] = "value2"; + tmp1[1] = tmp2; + + tmp1["key1"] = "value1"; + + return tmp1; +} + +object dict_from_sequence(object sequence) +{ + return dict(sequence); +} + +object dict_keys(dict data) +{ + return data.keys(); +} + +object dict_values(dict data) +{ + return data.values(); +} + +object dict_items(dict data) +{ + return data.items(); +} + +void work_with_dict(dict data1, dict data2) +{ + if (!data1.has_key("k1")) { + throw std::runtime_error("dict does not have key 'k1'"); + } + data1.update(data2); +} + +void test_templates(object print) +{ + std::string key = "key"; + + dict tmp; + tmp[1.5] = 13; + print(tmp.get(1.5)); + tmp[1] = "a test string"; + print(tmp.get(1)); + print(tmp.get(44)); + print(tmp); + print(tmp.get(2,"default")); + print(tmp.setdefault(3,"default")); + + BOOST_ASSERT(!tmp.has_key(key)); +} + +BOOST_PYTHON_MODULE(dict_ext) +{ + def("new_dict", new_dict); + def("data_dict", data_dict); + def("dict_keys", dict_keys); + def("dict_values", dict_values); + def("dict_items", dict_items); + def("dict_from_sequence", dict_from_sequence); + def("work_with_dict", work_with_dict); + def("test_templates", test_templates); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/dict.py b/pxr/external/boost/python/test/dict.py new file mode 100644 index 0000000000..9b1149ae60 --- /dev/null +++ b/pxr/external/boost/python/test/dict.py @@ -0,0 +1,47 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from dict_ext import * +>>> def printer(*args): +... for x in args: print(x, end='') +... print('') +... +>>> print(new_dict()) +{} +>>> print(data_dict()) +{1: {'key2': 'value2'}, 'key1': 'value1'} +>>> tmp = data_dict() +>>> print(dict_keys(tmp)) +[1, 'key1'] +>>> print(dict_values(tmp)) +[{'key2': 'value2'}, 'value1'] +>>> print(dict_items(tmp)) +[(1, {'key2': 'value2'}), ('key1', 'value1')] +>>> print(dict_from_sequence([(1,1),(2,2),(3,3)])) +{1: 1, 2: 2, 3: 3} +>>> test_templates(printer) #doctest: +NORMALIZE_WHITESPACE +13 +a test string +None +{1.5: 13, 1: 'a test string'} +default +default +""" + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/docstring.cpp b/pxr/external/boost/python/test/docstring.cpp new file mode 100644 index 0000000000..c6cc0252b0 --- /dev/null +++ b/pxr/external/boost/python/test/docstring.cpp @@ -0,0 +1,116 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include "test_class.hpp" + +// Just use math.h here; trying to use std::pow() causes too much +// trouble for non-conforming compilers and libraries. +#include + +using namespace boost::python; + +typedef test_class<> X; + +X* create(int x) +{ + return new X(x); +} + +unsigned long fact(unsigned long n) +{ + return n <= 1 ? n : n * fact(n - 1); +} + +BOOST_PYTHON_MODULE(docstring_ext) +{ + scope().attr("__doc__") = + "A simple test module for documentation strings\n" + "Exercised by docstring.py" + ; + + class_("X", + "A simple class wrapper around a C++ int\n" + "includes some error-checking" + + , init( + "this is the __init__ function\n" + "its documentation has two lines." + , args("self", "value") + ) + + ) + .def("value", &X::value, + "gets the value of the object" + , args("self")) + .def( "value", &X::value, + "also gets the value of the object" + , args("self")) + ; + + def("create", create, return_value_policy(), + "creates a new X object", args("value")); + + def("fact", fact, "compute the factorial", args("n")); + + { + docstring_options doc_options; + doc_options.disable_user_defined(); + def("fact_usr_off_1", fact, "usr off 1", args("n")); + doc_options.enable_user_defined(); + def("fact_usr_on_1", fact, "usr on 1", args("n")); + doc_options.disable_user_defined(); + def("fact_usr_off_2", fact, "usr off 2", args("n")); + } + def("fact_usr_on_2", fact, "usr on 2", args("n")); + + { + docstring_options doc_options(true, false); + def("fact_sig_off_1", fact, "sig off 1", args("n")); + doc_options.enable_signatures(); + def("fact_sig_on_1", fact, "sig on 1", args("n")); + doc_options.disable_signatures(); + def("fact_sig_off_2", fact, "sig off 2", args("n")); + } + def("fact_sig_on_2", fact, "sig on 2", args("n")); + + { + docstring_options doc_options(false); + def("fact_usr_off_sig_off_1", fact, "usr off sig off 1", args("n")); + { + docstring_options nested_doc_options; + def("fact_usr_on_sig_on_1", fact, "usr on sig on 1", args("n")); + nested_doc_options.disable_all(); + nested_doc_options.enable_user_defined(); + def("fact_usr_on_sig_off_1", fact, "usr on sig off 1", args("n")); + nested_doc_options.enable_all(); + def("fact_usr_on_sig_on_2", fact, "usr on sig on 2", args("n")); + } + def("fact_usr_off_sig_off_2", fact, "usr off sig off 2", args("n")); + } + + { + docstring_options doc_options(true); + doc_options.disable_cpp_signatures(); + def("fact_usr_on_psig_on_csig_off_1", fact, "usr on psig on csig off 1", args("n")); + doc_options.enable_cpp_signatures(); + doc_options.disable_py_signatures(); + def("fact_usr_on_psig_off_csig_on_1", fact, "usr on psig off csig on 1", args("n")); + doc_options.enable_py_signatures(); + doc_options.disable_user_defined(); + doc_options.disable_cpp_signatures(); + def("fact_usr_off_psig_on_csig_off_1", fact, "usr off psig on csig off 1", args("n")); + doc_options.enable_cpp_signatures(); + doc_options.disable_py_signatures(); + def("fact_usr_off_psig_off_csig_on_1", fact, "usr off psig off csig on 1", args("n")); + } +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/docstring.py b/pxr/external/boost/python/test/docstring.py new file mode 100644 index 0000000000..2727bd6d5e --- /dev/null +++ b/pxr/external/boost/python/test/docstring.py @@ -0,0 +1,153 @@ +# Copyright David Abrahams & Ralf W. Grosse-Kunsteve 2004-2006. +# Distributed under the Boost Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from docstring_ext import * + +>>> def selected_doc(obj, *args): +... doc = obj.__doc__.splitlines() +... return "\\n".join(["|"+doc[i] for i in args]) + +>>> print(selected_doc(X.__init__, 1, 2, 3, 4, 5)) +|__init__( (object)self, (int)value) -> None : +| this is the __init__ function +| its documentation has two lines. +| +| C++ signature : + +>>> print(selected_doc(X.value, 1, 2, 4, 7, 8, 10)) +|value( (X)self) -> int : +| gets the value of the object +| C++ signature : +|value( (X)self) -> int : +| also gets the value of the object +| C++ signature : + +>>> print(selected_doc(create, 1, 2, 3, 4)) +|create( (int)value) -> X : +| creates a new X object +| +| C++ signature : + +>>> print(selected_doc(fact, 1, 2, 3, 4)) +|fact( (int)n) -> int : +| compute the factorial +| +| C++ signature : + +>>> len(fact_usr_off_1.__doc__.splitlines()) +5 +>>> print(selected_doc(fact_usr_off_1, 1, 3)) +|fact_usr_off_1( (int)n) -> int : +| C++ signature : +>>> len(fact_usr_on_1.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_usr_on_1, 1, 2, 4)) +|fact_usr_on_1( (int)n) -> int : +| usr on 1 +| C++ signature : +>>> len(fact_usr_off_2.__doc__.splitlines()) +5 +>>> print(selected_doc(fact_usr_off_2, 1, 3)) +|fact_usr_off_2( (int)n) -> int : +| C++ signature : +>>> len(fact_usr_on_2.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_usr_on_2, 1, 2, 4)) +|fact_usr_on_2( (int)n) -> int : +| usr on 2 +| C++ signature : + + +>>> len(fact_sig_off_1.__doc__.splitlines()) +2 +>>> print(selected_doc(fact_sig_off_1, 1)) +|sig off 1 +>>> len(fact_sig_on_1.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_sig_on_1, 1, 2, 4)) +|fact_sig_on_1( (int)n) -> int : +| sig on 1 +| C++ signature : + +>>> len(fact_sig_off_2.__doc__.splitlines()) +2 +>>> print(selected_doc(fact_sig_off_2, 1)) +|sig off 2 +>>> len(fact_sig_on_2.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_sig_on_2, 1, 2, 4)) +|fact_sig_on_2( (int)n) -> int : +| sig on 2 +| C++ signature : + + +>>> print(fact_usr_off_sig_off_1.__doc__) +None +>>> len(fact_usr_on_sig_on_1.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_usr_on_sig_on_1, 1, 2, 4)) +|fact_usr_on_sig_on_1( (int)n) -> int : +| usr on sig on 1 +| C++ signature : + +>>> len(fact_usr_on_sig_off_1.__doc__.splitlines()) +2 +>>> print(selected_doc(fact_usr_on_sig_off_1, 1)) +|usr on sig off 1 +>>> len(fact_usr_on_sig_on_2.__doc__.splitlines()) +6 +>>> print(selected_doc(fact_usr_on_sig_on_2, 1, 2, 4)) +|fact_usr_on_sig_on_2( (int)n) -> int : +| usr on sig on 2 +| C++ signature : + +>>> print(selected_doc(fact_usr_on_psig_on_csig_off_1, 1, 2)) +|fact_usr_on_psig_on_csig_off_1( (int)n) -> int : +| usr on psig on csig off 1 + +>>> print(selected_doc(fact_usr_on_psig_off_csig_on_1, 1, 3)) +|usr on psig off csig on 1 +|C++ signature : + +>>> print(fact_usr_off_psig_on_csig_off_1.__doc__.splitlines()[1]) +fact_usr_off_psig_on_csig_off_1( (int)n) -> int + +>>> print(selected_doc(fact_usr_off_psig_off_csig_on_1,1)) +|C++ signature : + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + + import docstring_ext + + result = doctest.testmod(sys.modules.get(__name__)) + + import pydoc + import re + docmodule = lambda m: re.sub(".\10", "", pydoc.text.docmodule(m)) + try: + print('printing module help:') + print(docmodule(docstring_ext)) + except object as x: + print('********* failed **********') + print(x) + result = list(result) + result[0] += 1 + return tuple(result) + + return result + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/enable_shared_from_this.cpp b/pxr/external/boost/python/test/enable_shared_from_this.cpp new file mode 100644 index 0000000000..c246284a16 --- /dev/null +++ b/pxr/external/boost/python/test/enable_shared_from_this.cpp @@ -0,0 +1,48 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include "test_class.hpp" + +#include + +using namespace boost::python; +using boost::shared_ptr; + +class Test; +typedef shared_ptr TestPtr; + +class Test : public boost::enable_shared_from_this { +public: + static TestPtr construct() { + return TestPtr(new Test); + } + + void act() { + TestPtr kungFuDeathGrip(shared_from_this()); + } + + void take(TestPtr t) { + } +}; + +BOOST_PYTHON_MODULE(enable_shared_from_this_ext) +{ + class_("Test") + .def("construct", &Test::construct).staticmethod("construct") + .def("act", &Test::act) + .def("take", &Test::take) + ; +} + +#include "module_tail.cpp" + + diff --git a/pxr/external/boost/python/test/enable_shared_from_this.py b/pxr/external/boost/python/test/enable_shared_from_this.py new file mode 100644 index 0000000000..d7ac7a9999 --- /dev/null +++ b/pxr/external/boost/python/test/enable_shared_from_this.py @@ -0,0 +1,26 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from enable_shared_from_this_ext import * + +>>> x = Test.construct() +>>> x.take(x) +>>> x.act() +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + diff --git a/pxr/external/boost/python/test/enum_ext.cpp b/pxr/external/boost/python/test/enum_ext.cpp new file mode 100644 index 0000000000..74224f1d77 --- /dev/null +++ b/pxr/external/boost/python/test/enum_ext.cpp @@ -0,0 +1,55 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) +#include +# include +#endif +using namespace boost::python; + +enum color { red = 1, green = 2, blue = 4, blood = 1 }; + +#if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) +namespace boost // Pro7 has a hard time detecting enums +{ + template <> struct boost::python::detail::is_enum : boost::mpl::true_ {}; +} +#endif + +color identity_(color x) { return x; } + +struct colorized { + colorized() : x(red) {} + color x; +}; + +BOOST_PYTHON_MODULE(enum_ext) +{ + enum_("color") + .value("red", red) + .value("green", green) + .value("blue", blue) + .value("blood", blood) + .export_values() + ; + + def("identity", identity_); + +#if BOOST_WORKAROUND(__MWERKS__, <=0x2407) + color colorized::*px = &colorized::x; + class_("colorized") + .def_readwrite("x", px) + ; +#else + class_("colorized") + .def_readwrite("x", &colorized::x) + ; +#endif +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/exception_translator.cpp b/pxr/external/boost/python/test/exception_translator.cpp new file mode 100644 index 0000000000..1e91c9296f --- /dev/null +++ b/pxr/external/boost/python/test/exception_translator.cpp @@ -0,0 +1,28 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +struct error {}; + +void translate(error const& /*e*/) +{ + PyErr_SetString(PyExc_RuntimeError, "!!!error!!!"); +} + +void throw_error() +{ + throw error(); + +} + +BOOST_PYTHON_MODULE(exception_translator_ext) +{ + using namespace boost::python; + register_exception_translator(&translate); + + def("throw_error", throw_error); +} + diff --git a/pxr/external/boost/python/test/exception_translator.py b/pxr/external/boost/python/test/exception_translator.py new file mode 100644 index 0000000000..1d80aba3a2 --- /dev/null +++ b/pxr/external/boost/python/test/exception_translator.py @@ -0,0 +1,27 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from exception_translator_ext import * +>>> try: +... throw_error(); +... except RuntimeError as x: +... print(x) +... else: +... print('Expected a RuntimeError!') +!!!error!!! +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/exec.cpp b/pxr/external/boost/python/test/exec.cpp new file mode 100644 index 0000000000..72ff571bd6 --- /dev/null +++ b/pxr/external/boost/python/test/exec.cpp @@ -0,0 +1,197 @@ +// Copyright Stefan Seefeld 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include + + +namespace python = boost::python; + +// An abstract base class +class Base : public boost::noncopyable +{ +public: + virtual ~Base() {}; + virtual std::string hello() = 0; +}; + +// C++ derived class +class CppDerived : public Base +{ +public: + virtual ~CppDerived() {} + virtual std::string hello() { return "Hello from C++!";} +}; + +// Familiar Boost.Python wrapper class for Base +struct BaseWrap : Base, python::wrapper +{ + virtual std::string hello() + { +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + // workaround for VC++ 6.x or 7.0, see + // http://boost.org/libs/python/doc/tutorial/doc/html/python/exposing.html#python.class_virtual_functions + return python::call(this->get_override("hello").ptr()); +#else + return this->get_override("hello")(); +#endif + } +}; + +// Pack the Base class wrapper into a module +BOOST_PYTHON_MODULE(embedded_hello) +{ + python::class_ base("Base"); +} + + +void eval_test() +{ + python::object result = python::eval("'abcdefg'.upper()"); + std::string value = python::extract(result) BOOST_EXTRACT_WORKAROUND; + BOOST_TEST(value == "ABCDEFG"); +} + +void exec_test() +{ + // Retrieve the main module + python::object main = python::import("__main__"); + + // Retrieve the main module's namespace + python::object global(main.attr("__dict__")); + + // Define the derived class in Python. + python::object result = python::exec( + "from embedded_hello import * \n" + "class PythonDerived(Base): \n" + " def hello(self): \n" + " return 'Hello from Python!' \n", + global, global); + + python::object PythonDerived = global["PythonDerived"]; + + // Creating and using instances of the C++ class is as easy as always. + CppDerived cpp; + BOOST_TEST(cpp.hello() == "Hello from C++!"); + + // But now creating and using instances of the Python class is almost + // as easy! + python::object py_base = PythonDerived(); + Base& py = python::extract(py_base) BOOST_EXTRACT_WORKAROUND; + + // Make sure the right 'hello' method is called. + BOOST_TEST(py.hello() == "Hello from Python!"); +} + +void exec_file_test(std::string const &script) +{ + // Run a python script in an empty environment. + python::dict global; + python::object result = python::exec_file(script.c_str(), global, global); + + // Extract an object the script stored in the global dictionary. + BOOST_TEST(python::extract(global["number"]) == 42); +} + +void exec_test_error() +{ + // Execute a statement that raises a python exception. + python::dict global; + python::object result = python::exec("print(unknown) \n", global, global); +} + +void exercise_embedding_html() +{ + using namespace boost::python; + /* code from: libs/python/doc/tutorial/doc/tutorial.qbk + (generates libs/python/doc/tutorial/doc/html/python/embedding.html) + */ + object main_module = import("__main__"); + object main_namespace = main_module.attr("__dict__"); + + object ignored = exec("hello = file('hello.txt', 'w')\n" + "hello.write('Hello world!')\n" + "hello.close()", + main_namespace); +} + +void check_pyerr(bool pyerr_expected=false) +{ + if (PyErr_Occurred()) + { + if (!pyerr_expected) { + BOOST_ERROR("Python Error detected"); + PyErr_Print(); + } + else { + PyErr_Clear(); + } + } + else + { + BOOST_ERROR("A C++ exception was thrown for which " + "there was no exception handler registered."); + } +} + +int main(int argc, char **argv) +{ + BOOST_TEST(argc == 2 || argc == 3); + std::string script = argv[1]; + + // Register the module with the interpreter + if (PyImport_AppendInittab(const_cast("embedded_hello"), +#if PY_VERSION_HEX >= 0x03000000 + PyInit_embedded_hello +#else + initembedded_hello +#endif + ) == -1) + { + BOOST_ERROR("Failed to add embedded_hello to the interpreter's " + "builtin modules"); + } + + // Initialize the interpreter + Py_Initialize(); + + if (python::handle_exception(eval_test)) { + check_pyerr(); + } + else if(python::handle_exception(exec_test)) { + check_pyerr(); + } + else if (python::handle_exception(boost::bind(exec_file_test, script))) { + check_pyerr(); + } + + if (python::handle_exception(exec_test_error)) + { + check_pyerr(/*pyerr_expected*/ true); + } + else + { + BOOST_ERROR("Python exception expected, but not seen."); + } + + if (argc > 2) { + // The main purpose is to test compilation. Since this test generates + // a file and I (rwgk) am uncertain about the side-effects, run it only + // if explicitly requested. + exercise_embedding_html(); + } + + // Boost.Python doesn't support Py_Finalize yet. + // Py_Finalize(); + return boost::report_errors(); +} + +// Including this file makes sure +// that on Windows, any crashes (e.g. null pointer dereferences) invoke +// the debugger immediately, rather than being translated into structured +// exceptions that can interfere with debugging. +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/exec.py b/pxr/external/boost/python/test/exec.py new file mode 100644 index 0000000000..c7bf28f350 --- /dev/null +++ b/pxr/external/boost/python/test/exec.py @@ -0,0 +1,6 @@ +# Copyright Stefan Seefeld 2006. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +if 1: + number = 42 diff --git a/pxr/external/boost/python/test/extract.cpp b/pxr/external/boost/python/test/extract.cpp new file mode 100644 index 0000000000..40584a0777 --- /dev/null +++ b/pxr/external/boost/python/test/extract.cpp @@ -0,0 +1,143 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include +#include "test_class.hpp" + +using namespace boost::python; + +typedef test_class<> X; + +bool extract_bool(object x) { return extract(x); } + +boost::python::list extract_list(object x) +{ + extract get_list((x)); + + // Make sure we always have the right idea about whether it's a list + bool is_list_1 = get_list.check(); + bool is_list_2 = PyObject_IsInstance(x.ptr(), (PyObject*)&PyList_Type); + if (is_list_1 != is_list_2) { + throw std::runtime_error("is_list_1 == is_list_2 failure."); + } + return get_list(); +} + +char const* extract_cstring(object x) +{ + return extract(x); +} + +std::string extract_string(object x) +{ + std::string s = extract(x); + return s; +} + +std::string const& extract_string_cref(object x) +{ +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 +# pragma warning(push) +# pragma warning(disable:4172) // msvc lies about returning a reference to temporary +#elif defined(_MSC_VER) && defined(__ICL) && __ICL <= 900 +# pragma warning(push) +# pragma warning(disable:473) // intel/win32 does too +#endif + + return extract(x); + +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(_MSC_VER) && defined(__ICL) && __ICL <= 800 +# pragma warning(pop) +#endif +} + +X extract_X(object x) +{ + return extract(x); +} + +X* extract_X_ptr(object x) { return extract(x); } + +X& extract_X_ref(object x) +{ + extract get_x(x); + return get_x; +} + +int double_X(object n) +{ + extract x(n); + return x().value() + x().value(); +} + +bool check_bool(object x) { return extract(x).check(); } +bool check_list(object x) { return extract(x).check(); } +bool check_cstring(object x) { return extract(x).check(); } +bool check_string(object x) { return extract(x).check(); } +bool check_string_cref(object x) { return extract(x).check(); } +bool check_X(object x) { return extract(x).check(); } +bool check_X_ptr(object x) { return extract(x).check(); } +bool check_X_ref(object x) { return extract(x).check(); } + +std::string x_rep(X const& x) +{ + return "X(" + boost::lexical_cast(x.value()) + ")"; +} + +BOOST_PYTHON_MODULE(extract_ext) +{ + implicitly_convertible(); + + def("extract_bool", extract_bool); + def("extract_list", extract_list); + def("extract_cstring", extract_cstring); + def("extract_string", extract_string); + def("extract_string_cref", extract_string_cref, return_value_policy()); + def("extract_X", extract_X); + def("extract_X_ptr", extract_X_ptr, return_value_policy()); + def("extract_X_ref", extract_X_ref, return_value_policy()); + + def("check_bool", check_bool); + def("check_list", check_list); + def("check_cstring", check_cstring); + def("check_string", check_string); + def("check_string_cref", check_string_cref); + def("check_X", check_X); + def("check_X_ptr", check_X_ptr); + def("check_X_ref", check_X_ref); + + def("double_X", double_X); + + def("count_Xs", &X::count); + ; + + object x_class( + class_("X", init()) + .def( "__repr__", x_rep)); + + // Instantiate an X object through the Python interface + object x_obj = x_class(3); + + // Get the C++ object out of the Python object + X const& x = extract(x_obj); + if (x.value() != 3) { + throw std::runtime_error("x.value() == 3 failure."); + } +} + + +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/extract.py b/pxr/external/boost/python/test/extract.py new file mode 100644 index 0000000000..feda93a1d5 --- /dev/null +++ b/pxr/external/boost/python/test/extract.py @@ -0,0 +1,107 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + >>> from extract_ext import * + +Just about anything has a truth value in Python + + >>> assert check_bool(None) + >>> extract_bool(None) + 0 + + >>> assert check_bool(2) + >>> extract_bool(2) + 1 + + >>> assert not check_bool('') + +Check that object manager types work properly. These are a different +case because they wrap Python objects instead of being wrapped by them. + + >>> assert not check_list(2) + >>> try: x = extract_list(2) + ... except TypeError as x: + ... if str(x) != 'Expecting an object of type list; got an object of type int instead': + ... print(x) + ... else: + ... print('expected an exception, got', x, 'instead') + +Can't extract a list from a tuple. Use list(x) to convert a sequence +to a list: + + >>> assert not check_list((1, 2, 3)) + >>> assert check_list([1, 2, 3]) + >>> extract_list([1, 2, 3]) + [1, 2, 3] + +Can get a char const* from a Python string: + + >>> assert check_cstring('hello') + >>> extract_cstring('hello') + 'hello' + +Can't get a char const* from a Python int: + + >>> assert not check_cstring(1) + >>> try: x = extract_cstring(1) + ... except TypeError: pass + ... else: + ... print('expected an exception, got', x, 'instead') + +Extract an std::string (class) rvalue from a native Python type + + >>> assert check_string('hello') + >>> extract_string('hello') + 'hello' + +Constant references are not treated as rvalues for the purposes of +extract: + + >>> assert not check_string_cref('hello') + +We can extract lvalues where appropriate: + + >>> x = X(42) + >>> check_X(x) + 1 + >>> extract_X(x) + X(42) + + >>> check_X_ptr(x) + 1 + >>> extract_X_ptr(x) + X(42) + >>> extract_X_ref(x) + X(42) + +Demonstrate that double-extraction of an rvalue works, and all created +copies of the object are destroyed: + + >>> n = count_Xs() + >>> double_X(333) + 666 + >>> count_Xs() - n + 0 + +General check for cleanliness: + + >>> del x + >>> count_Xs() + 0 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/fabscript b/pxr/external/boost/python/test/fabscript new file mode 100644 index 0000000000..d4d7ead83b --- /dev/null +++ b/pxr/external/boost/python/test/fabscript @@ -0,0 +1,176 @@ +# -*- python -*- +# +# Copyright (c) 2016 Stefan Seefeld +# All rights reserved. +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +from faber import platform +from faber.feature import set +from faber.tools.compiler import runpath +from faber.tools.python import python, pythonpath +from faber.artefacts.object import object +from faber.artefacts.binary import binary +from faber.artefacts.python import extension +from faber.test import test, report, fail + +src = module('..src') + +python_libs=python.instance().libs +features |= runpath(src.bpl.path, base='') + +def extension_test(name, exts=[], script=None, numpy=False, + features=features, condition=None): + """Create a Python extension test `name`. + Arguments: + * name: the name of the test. + * exts: extensions to be compiled, if none are given. + * script: the test script to execute, .py if none is given. + * numpy: if true, add boost_numpy to sources + * features: pre-defined features + * condition: any condition under which to run the test + Return: + * the test artefact""" + + features=features.copy() + extensions = [] + libs = [src.bnl, src.bpl] if numpy else [src.bpl] + for ext in exts or [name]: + if type(ext) is str: # build from a single source file + ext_name = ext if ext != name else ext + '_ext' + sources = [ext + '.cpp'] + else: # build from a list of source files + ext_name = ext[0] if ext[0] != name else ext[0] + '_ext' + sources = [source + '.cpp' for source in ext] + ext = extension(ext_name, sources + libs, features=features) + features |= pythonpath(ext.path, base='') + extensions.append(ext) + if not script: + script = name+'.py' + return test(name, script, run=python.run, dependencies=extensions, + features=features, condition=condition) + +tests = [] +for t in [('injected',), + ('properties',), + ('return_arg',), + ('staticmethod',), + ('boost_shared_ptr',), + ('enable_shared_from_this',), + ('andreas_beyer',), + ('polymorphism',), + ('polymorphism2',), + ('wrapper_held_type',), + ('minimal',), + ('args',), + ('raw_ctor',), + ('exception_translator',), + ('module_init_exception',), + ('test_enum', ['enum_ext']), + ('test_cltree', ['cltree']), + ('newtest', ['m1', 'm2']), + ('const_argument',), + ('keywords_test', ['keywords']), + ('test_pointer_adoption',), + ('operators',), + ('operators_wrapper',), + ('callbacks',), + ('defaults',), + ('object',), + ('class',), + ('aligned_class',), + ('list',), + ('long',), + ('dict',), + ('tuple',), + ('str',), + ('slice',), + ('virtual_functions',), + ('back_reference',), + ('implicit',), + ('data_members',), + ('ben_scott1',), + ('bienstman1',), + ('bienstman2',), + ('bienstman3',), + ('multi_arg_constructor',), + ('iterator', ['iterator', 'input_iterator']), + ('stl_iterator',), + ('extract',), + ('crossmod_opaque', ['crossmod_opaque_a', 'crossmod_opaque_b']), + ('opaque',), + ('voidptr',), + ('pickle1',), + ('pickle2',), + ('pickle3',), + ('pickle4',), + ('nested',), + ('docstring',), + ('pytype_function',), + ('vector_indexing_suite',), + ('pointer_vector',), + ('builtin_converters', [], 'test_builtin_converters.py'), + ('map_indexing_suite', + [['map_indexing_suite', 'int_map_indexing_suite', 'a_map_indexing_suite']])]: + tests.append(extension_test(*t)) + +tests.append(extension_test('shared_ptr', + condition=set.define.contains('HAS_CXX11'))) +tests.append(extension_test('polymorphism2_auto_ptr', + condition=set.define.contains('HAS_CXX11').not_())) +tests.append(extension_test('auto_ptr', + condition=set.define.contains('HAS_CXX11'))) + +import_ = binary('import_', ['import_.cpp', src.bpl], features=features|python_libs) +if platform.os == 'Windows': + command = """set PATH=$(runpath);%PATH% +$(>[0]) $(>[1])""" +else: + command = 'LD_LIBRARY_PATH=$(runpath) $(>[0]) $(>[1])' + +tests.append(test('import', [import_, 'import_.py'], + run=action('run', command), + features=features)) + +tests.append(extension_test('calling_conventions', + condition=platform.os == 'Windows')) +tests.append(extension_test('calling_conventions_mf', + condition=platform.os == 'Windows')) + +for t in ['destroy_test', + 'pointer_type_id_test', + 'bases', + 'pointee', + 'if_else', + 'pointee', + 'result', + 'upcast', + 'select_from_python_test']: + tests.append(test(t, binary(t, [t + '.cpp', src.bpl], features=features), features=features, run=True)) +for t in ['indirect_traits_test', + 'string_literal', + 'borrowed', + 'object_manager', + 'copy_ctor_mutates_rhs', + 'select_holder', + 'select_arg_to_python_test']: + tests.append(test(t, object(t, [t + '.cpp'], features=features))) + +for t in ['raw_pyobject_fail1', + 'raw_pyobject_fail2', + 'as_to_python_function', + 'object_fail1']: + tests.append(test(t, object(t, [t + '.cpp'], features=features), expected=fail)) + +for t in ['numpy/dtype', + 'numpy/ufunc', + 'numpy/templates', + 'numpy/ndarray', + 'numpy/indexing', + 'numpy/shapes']: + tests.append(extension_test(t, numpy=True, + condition=set.define.contains('HAS_NUMPY'))) + +default = report('report', tests, fail_on_failures=True) diff --git a/pxr/external/boost/python/test/if_else.cpp b/pxr/external/boost/python/test/if_else.cpp new file mode 100644 index 0000000000..60cc53192d --- /dev/null +++ b/pxr/external/boost/python/test/if_else.cpp @@ -0,0 +1,44 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + + typedef char c1; + typedef char c2[2]; + typedef char c3[3]; + typedef char c4[4]; + +template +struct choose +{ + typedef typename boost::python::detail::if_< + (sizeof(c1) == size) + >::template then< + c1 + >::template elif< + (sizeof(c2) == size) + >::template then< + c2 + >::template elif< + (sizeof(c3) == size) + >::template then< + c3 + >::template elif< + (sizeof(c4) == size) + >::template then< + c4 + >::template else_::type type; +}; + +int main() +{ + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c1>::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c2>::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c3>::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c4>::value)); + BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,void*>::value)); + return 0; +} diff --git a/pxr/external/boost/python/test/implicit.cpp b/pxr/external/boost/python/test/implicit.cpp new file mode 100644 index 0000000000..a1bae59e86 --- /dev/null +++ b/pxr/external/boost/python/test/implicit.cpp @@ -0,0 +1,48 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include "test_class.hpp" + +using namespace boost::python; + +typedef test_class<> X; + +int x_value(X const& x) +{ + return x.value(); +} + +X make_x(int n) { return X(n); } + + +// foo/bar -- a regression for a vc7 bug workaround +struct bar {}; +struct foo +{ + virtual ~foo() {}; // silence compiler warnings + virtual void f() = 0; + operator bar() const { return bar(); } +}; + +BOOST_PYTHON_MODULE(implicit_ext) +{ + implicitly_convertible(); + implicitly_convertible(); + + def("x_value", x_value); + def("make_x", make_x); + + class_("X", init()) + .def("value", &X::value) + .def("set", &X::set) + ; + + implicitly_convertible(); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/implicit.py b/pxr/external/boost/python/test/implicit.py new file mode 100644 index 0000000000..f2aa3e1d36 --- /dev/null +++ b/pxr/external/boost/python/test/implicit.py @@ -0,0 +1,44 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from implicit_ext import * +>>> x_value(X(42)) +42 +>>> x_value(42) +42 +>>> x = make_x(X(42)) +>>> x.value() +42 +>>> try: make_x('fool') +... except TypeError: pass +... else: print('no error') + +>>> print(x_value.__doc__.splitlines()[1]) +x_value( (X)arg1) -> int : + +>>> print(make_x.__doc__.splitlines()[1]) +make_x( (object)arg1) -> X : + +>>> print(X.value.__doc__.splitlines()[1]) +value( (X)arg1) -> int : + +>>> print(X.set.__doc__.splitlines()[1]) +set( (X)arg1, (object)arg2) -> None : + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/import_.cpp b/pxr/external/boost/python/test/import_.cpp new file mode 100644 index 0000000000..8e03d9b448 --- /dev/null +++ b/pxr/external/boost/python/test/import_.cpp @@ -0,0 +1,70 @@ +// Copyright Stefan Seefeld 2007. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include +#include +#include + +namespace bpl = boost::python; + +void import_test(char const *py_file_path) +{ + // Retrieve the main module + bpl::object main = bpl::import("__main__"); + + // Retrieve the main module's namespace + bpl::object global(main.attr("__dict__")); + + // Inject search path for import_ module + + bpl::str script( + "import sys, os.path\n" + "path = os.path.dirname(%r)\n" + "sys.path.insert(0, path)" + % bpl::str(py_file_path)); + + bpl::object result = bpl::exec(script, global, global); + + // Retrieve the main module + bpl::object import_ = bpl::import("import_"); + int value = bpl::extract(import_.attr("value")) BOOST_EXTRACT_WORKAROUND; + std::cout << value << std::endl; + BOOST_TEST(value == 42); +} + +int main(int argc, char **argv) +{ + BOOST_TEST(argc == 2); + + // Initialize the interpreter + Py_Initialize(); + + if (bpl::handle_exception(boost::bind(import_test,argv[1]))) + { + if (PyErr_Occurred()) + { + BOOST_ERROR("Python Error detected"); + PyErr_Print(); + } + else + { + BOOST_ERROR("A C++ exception was thrown for which " + "there was no exception handler registered."); + } + } + + // Boost.Python doesn't support Py_Finalize yet. + // Py_Finalize(); + return boost::report_errors(); +} + +// Including this file makes sure +// that on Windows, any crashes (e.g. null pointer dereferences) invoke +// the debugger immediately, rather than being translated into structured +// exceptions that can interfere with debugging. +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/import_.py b/pxr/external/boost/python/test/import_.py new file mode 100644 index 0000000000..48de6e5ecb --- /dev/null +++ b/pxr/external/boost/python/test/import_.py @@ -0,0 +1,5 @@ +# Copyright Stefan Seefeld 2007. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +value = 42 diff --git a/pxr/external/boost/python/test/indirect_traits_test.cpp b/pxr/external/boost/python/test/indirect_traits_test.cpp new file mode 100644 index 0000000000..da4cc24569 --- /dev/null +++ b/pxr/external/boost/python/test/indirect_traits_test.cpp @@ -0,0 +1,116 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +//#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include +#include +#include +#include + +//#define print(expr) printf("%s ==> %s\n", #expr, expr) + +// not all the compilers can handle an incomplete class type here. +struct X {}; + +using namespace boost::python::indirect_traits; + +typedef void (X::*pmf)(); + +BOOST_MPL_ASSERT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_function)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT((is_reference_to_function_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_function_pointer)); + +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); +BOOST_MPL_ASSERT_NOT((is_reference_to_pointer)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT((is_reference_to_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_const)); + +BOOST_MPL_ASSERT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); +BOOST_MPL_ASSERT_NOT((is_reference_to_non_const)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT((is_reference_to_volatile)); +BOOST_MPL_ASSERT((is_reference_to_volatile)); + +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); +BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); + +namespace tt = boost::python::indirect_traits; + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); +BOOST_MPL_ASSERT((tt::is_reference_to_class)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); + +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT_NOT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); +BOOST_MPL_ASSERT((is_pointer_to_class)); + +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); +BOOST_MPL_ASSERT_NOT((tt::is_reference_to_member_function_pointer)); + diff --git a/pxr/external/boost/python/test/injected.cpp b/pxr/external/boost/python/test/injected.cpp new file mode 100644 index 0000000000..73e1e14baa --- /dev/null +++ b/pxr/external/boost/python/test/injected.cpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include "test_class.hpp" +#include +#include +#include +#include + +using namespace boost::python; + +typedef test_class<> X; + +X* empty() { return new X(1000); } + +std::auto_ptr sum(int a, int b) { return std::auto_ptr(new X(a+b)); } + +boost::shared_ptr product(int a, int b, int c) +{ + return boost::shared_ptr(new X(a*b*c)); +} + +BOOST_PYTHON_MODULE(injected_ext) +{ + class_("X", init()) + .def("__init__", make_constructor(empty)) + .def("__init__", make_constructor(sum)) + .def("__init__", make_constructor(product + , default_call_policies() + , ( arg_("a"), arg_("b"), arg_("c")) + ), + "this is product's docstring") + .def("value", &X::value) + ; +} diff --git a/pxr/external/boost/python/test/injected.py b/pxr/external/boost/python/test/injected.py new file mode 100644 index 0000000000..c502150483 --- /dev/null +++ b/pxr/external/boost/python/test/injected.py @@ -0,0 +1,28 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from injected_ext import * +>>> X(3,5).value() - (3+5) +0 +>>> X(a=3,b=5,c=7).value() - (3*5*7) +0 +>>> X().value() +1000 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + diff --git a/pxr/external/boost/python/test/input_iterator.cpp b/pxr/external/boost/python/test/input_iterator.cpp new file mode 100644 index 0000000000..70b994186f --- /dev/null +++ b/pxr/external/boost/python/test/input_iterator.cpp @@ -0,0 +1,48 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +typedef std::list list_int; + +// Prove that we can handle InputIterators which return rvalues. +struct doubler +{ + typedef int result_type; + int operator()(int x) const { return x * 2; } +}; + +typedef boost::transform_iterator doubling_iterator; +typedef std::pair list_range2; + +list_range2 range2(list_int& x) +{ + return list_range2( + boost::make_transform_iterator(x.begin(), doubler()) + , boost::make_transform_iterator(x.end(), doubler())); +} + +// We do this in a separate module from iterators_ext (iterators.cpp) +// to work around an MSVC6 linker bug, which causes it to complain +// about a "duplicate comdat" if the input iterator is instantiated in +// the same module with the others. +BOOST_PYTHON_MODULE(input_iterator) +{ + def("range2", &::range2); + + class_("list_range2") + // We can wrap InputIterators which return by-value + .def("__iter__" + , range(&list_range2::first, &list_range2::second)) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/int_map_indexing_suite.cpp b/pxr/external/boost/python/test/int_map_indexing_suite.cpp new file mode 100644 index 0000000000..3978501314 --- /dev/null +++ b/pxr/external/boost/python/test/int_map_indexing_suite.cpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +void int_map_indexing_suite() +{ + using namespace boost::python; + + // Compile check only... + class_ >("IntMap") + .def(map_indexing_suite >()) + ; +} diff --git a/pxr/external/boost/python/test/iterator.cpp b/pxr/external/boost/python/test/iterator.cpp new file mode 100644 index 0000000000..458ba29268 --- /dev/null +++ b/pxr/external/boost/python/test/iterator.cpp @@ -0,0 +1,137 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +typedef std::list list_int; +typedef std::list list_list; + + +void push_back(list_int& x, int y) +{ + x.push_back(y); +} + +void push_list_back(list_list& x, list_int const& y) +{ + x.push_back(y); +} + +int back(list_int& x) +{ + return x.back(); +} + +typedef std::pair list_range; + +struct list_range2 : list_range +{ + list_int::iterator& begin() { return this->first; } + list_int::iterator& end() { return this->second; } +}; + +list_range range(list_int& x) +{ + return list_range(x.begin(), x.end()); +} + +struct two_lists +{ + two_lists() + { + int primes[] = { 2, 3, 5, 7, 11, 13 }; + std::copy(primes, primes + sizeof(primes)/sizeof(*primes), std::back_inserter(one)); + int evens[] = { 2, 4, 6, 8, 10, 12 }; + std::copy(evens, evens + sizeof(evens)/sizeof(*evens), std::back_inserter(two)); + } + + struct two_start + { + typedef list_int::iterator result_type; + result_type operator()(two_lists& ll) const { return ll.two.begin(); } + }; + friend struct two_start; + + list_int::iterator one_begin() { return one.begin(); } + list_int::iterator two_begin() { return two.begin(); } + + list_int::iterator one_end() { return one.end(); } + list_int::iterator two_end() { return two.end(); } + +private: + list_int one; + list_int two; +}; + +BOOST_PYTHON_MODULE(iterator_ext) +{ + using boost::python::iterator; // gcc 2.96 bug workaround + def("range", &::range); + + class_("list_int") + .def("push_back", push_back) + .def("back", back) + .def("__iter__", iterator()) + ; + + class_("list_range") + + // We can specify data members + .def("__iter__" + , range(&list_range::first, &list_range::second)) + ; + + // No runtime tests for this one yet + class_("list_range2") + + // We can specify member functions returning a non-const reference + .def("__iter__", range(&list_range2::begin, &list_range2::end)) + ; + + class_("two_lists") + + // We can spcify member functions + .add_property( + "primes" + , range(&two_lists::one_begin, &two_lists::one_end)) + + // Prove that we can explicitly specify call policies + .add_property( + "evens" + , range >( + &two_lists::two_begin, &two_lists::two_end)) + + // Prove that we can specify call policies and target + .add_property( + "twosies" + , range, two_lists>( + // And we can use adaptable function objects when + // partial specialization is available. +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + two_lists::two_start() +# else + &two_lists::two_begin +# endif + , &two_lists::two_end)) + ; + + class_("list_list") + .def("push_back", push_list_back) + .def("__iter__", iterator >()) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/iterator.py b/pxr/external/boost/python/test/iterator.py new file mode 100644 index 0000000000..0d75100a09 --- /dev/null +++ b/pxr/external/boost/python/test/iterator.py @@ -0,0 +1,80 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from iterator_ext import * +>>> from input_iterator import * +>>> x = list_int() +>>> x.push_back(1) +>>> x.back() +1 +>>> x.push_back(3) +>>> x.push_back(5) +>>> for y in x: +... print(y) +1 +3 +5 +>>> z = range(x) +>>> for y in z: +... print(y) +1 +3 +5 + + Range2 wraps a transform_iterator which doubles the elements it + traverses. This proves we can wrap input iterators + +>>> z2 = range2(x) +>>> for y in z2: +... print(y) +2 +6 +10 + +>>> l2 = two_lists() +>>> for y in l2.primes: +... print(y) +2 +3 +5 +7 +11 +13 +>>> for y in l2.evens: +... print(y) +2 +4 +6 +8 +10 +12 +>>> ll = list_list() +>>> ll.push_back(x) +>>> x.push_back(7) +>>> ll.push_back(x) +>>> for a in ll: #doctest: +NORMALIZE_WHITESPACE +... for b in a: +... print(b, end=' ') +... print('') +... +1 3 5 +1 3 5 7 +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/keywords.cpp b/pxr/external/boost/python/test/keywords.cpp new file mode 100644 index 0000000000..39bac0627b --- /dev/null +++ b/pxr/external/boost/python/test/keywords.cpp @@ -0,0 +1,118 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include + +struct Foo +{ + Foo( + int a = 0 + , double b = 0 + , const std::string &n = std::string() + ) : + a_(a) + , b_(b) + , n_(n) + {} + + void set(int a=0, double b=0, const std::string &n=std::string()) + { + a_ = a; + b_ = b; + n_ = n; + } + + int geta() const { return a_; } + + double getb() const { return b_; } + + std::string getn() const { return n_; } + +private: + int a_; + double b_; + std::string n_; +}; + +struct Bar +{ + Bar( + int a = 0 + , double b = 0 + , const std::string &n = std::string() + ) : + a_(a) + , b_(b) + , n_(n) + {} + + void set(int a=0, double b=0, const std::string &n=std::string()) + { + a_ = a; + b_ = b; + n_ = n; + } + + void seta(int a) + { + a_ = a; + } + + int geta() const { return a_; } + + double getb() const { return b_; } + + std::string getn() const { return n_; } + +private: + int a_; + double b_; + std::string n_; +}; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(bar_set, Bar::set, 0,3) + +using namespace boost::python; +BOOST_PYTHON_MODULE(keywords) +{ +#if BOOST_WORKAROUND(__GNUC__, == 2) + using boost::python::arg; +#endif + + class_( + "Foo" + , init( + ( arg("a") = 0 + , arg("b") = 0.0 + , arg("n") = std::string() + ) + )) + + .def("set", &Foo::set, (arg("a") = 0, arg("b") = 0.0, arg("n") = std::string()) ) + + .def("set2", &Foo::set, (arg("a"), "b", "n") ) + + .def("a", &Foo::geta) + .def("b", &Foo::getb) + .def("n", &Foo::getn) + ; + + class_("Bar" + , init >() + ) + .def("set", &Bar::set, bar_set()) + .def("set2", &Bar::set, bar_set("set2's docstring")) + .def("seta", &Bar::seta, arg("a")) + + .def("a", &Bar::geta) + .def("b", &Bar::getb) + .def("n", &Bar::getn) + ; + +} + + + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/keywords_test.py b/pxr/external/boost/python/test/keywords_test.py new file mode 100644 index 0000000000..bac7d17c1f --- /dev/null +++ b/pxr/external/boost/python/test/keywords_test.py @@ -0,0 +1,106 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from keywords import * +>>> f = Foo() +>>> f.a(), f.b(), f.n() +(0, 0.0, '') +>>> f = Foo(1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f = Foo(1,1.0) +>>> f.a(), f.b(), f.n() +(1, 1.0, '') +>>> f = Foo(1,1.0,"1") +>>> f.a(), f.b(), f.n() +(1, 1.0, '1') +>>> f = Foo(a=1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f = Foo(b=1) +>>> f.a(), f.b(), f.n() +(0, 1.0, '') +>>> f = Foo(n="1") +>>> f.a(), f.b(), f.n() +(0, 0.0, '1') +>>> f = Foo(1,n="1") +>>> f.a(), f.b(), f.n() +(1, 0.0, '1') +>>> f.set() +>>> f.a(), f.b(), f.n() +(0, 0.0, '') +>>> f.set(1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f.set(1,1.0) +>>> f.a(), f.b(), f.n() +(1, 1.0, '') +>>> f.set(1,1.0,"1") +>>> f.a(), f.b(), f.n() +(1, 1.0, '1') +>>> f.set(a=1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f.set(b=1) +>>> f.a(), f.b(), f.n() +(0, 1.0, '') +>>> f.set(n="1") +>>> f.a(), f.b(), f.n() +(0, 0.0, '1') +>>> f.set(1,n="1") +>>> f.a(), f.b(), f.n() +(1, 0.0, '1') +>>> f.set2(b=2.0,n="2",a=2) +>>> f.a(), f.b(), f.n() +(2, 2.0, '2') + +# lets see how badly we've broken the 'regular' functions +>>> f = Bar() +>>> f.a(), f.b(), f.n() +(0, 0.0, '') +>>> f = Bar(1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f = Bar(1,1.0) +>>> f.a(), f.b(), f.n() +(1, 1.0, '') +>>> f = Bar(1,1.0,"1") +>>> f.a(), f.b(), f.n() +(1, 1.0, '1') +>>> f.set() +>>> f.a(), f.b(), f.n() +(0, 0.0, '') +>>> f.set(1) +>>> f.a(), f.b(), f.n() +(1, 0.0, '') +>>> f.set(1,1.0) +>>> f.a(), f.b(), f.n() +(1, 1.0, '') +>>> f.set(1,1.0,"1") +>>> f.a(), f.b(), f.n() +(1, 1.0, '1') +>>> f.set2.__doc__.splitlines()[1] +'set2( (Bar)arg1 [, (int)arg2 [, (float)arg3 [, (str)arg4]]]) -> None :' +>>> f.set2.__doc__.splitlines()[2] +" set2's docstring" +''' + + + + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + diff --git a/pxr/external/boost/python/test/list.cpp b/pxr/external/boost/python/test/list.cpp new file mode 100644 index 0000000000..3e9fcbe66f --- /dev/null +++ b/pxr/external/boost/python/test/list.cpp @@ -0,0 +1,154 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include +#include "test_class.hpp" + +using namespace boost::python; + +object new_list() +{ + return list(); +} + +list listify(object x) +{ + return list(x); +} + +object listify_string(char const* s) +{ + return list(s); +} + +std::string x_rep(test_class<> const& x) +{ + return "X(" + boost::lexical_cast(x.value()) + ")"; +} + +object apply_object_list(object f, list x) +{ + return f(x); +} + +list apply_list_list(object f, list x) +{ + return call(f.ptr(), x); +} + +void append_object(list& x, object y) +{ + x.append(y); +} + +void append_list(list& x, list const& y) +{ + x.append(y); +} + +typedef test_class<> X; + +int notcmp(object const& x, object const& y) +{ + return y < x ? -1 : y > x ? 1 : 0; +} + +void exercise(list x, object y, object print) +{ + x.append(y); + x.append(5); + x.append(X(3)); + + print("after append:"); + print(x); + + print("number of", y, "instances:", x.count(y)); + + print("number of 5s:", x.count(5)); + + x.extend("xyz"); + print("after extend:"); + print(x); + print("index of", y, "is:", x.index(y)); + print("index of 'l' is:", x.index("l")); + + x.insert(4, 666); + print("after inserting 666:"); + print(x); + print("inserting with object as index:"); + x.insert(x[x.index(5)], "---"); + print(x); + + print("popping..."); + x.pop(); + print(x); + x.pop(x[x.index(5)]); + print(x); + x.pop(x.index(5)); + print(x); + + print("removing", y); + x.remove(y); + print(x); + print("removing", 666); + x.remove(666); + print(x); + + print("reversing..."); + x.reverse(); + print(x); + + print("sorted:"); + x.pop(2); // make sorting predictable + x.pop(2); // remove [1,2] so the list is sortable in py3k + x.sort(); + print(x); + + print("reverse sorted:"); +#if PY_VERSION_HEX >= 0x03000000 + x.sort(*tuple(), **dict(make_tuple(make_tuple("reverse", true)))); +#else + x.sort(¬cmp); +#endif + print(x); + + list w; + w.append(5); + w.append(6); + w += "hi"; + BOOST_ASSERT(w[0] == 5); + BOOST_ASSERT(w[1] == 6); + BOOST_ASSERT(w[2] == 'h'); + BOOST_ASSERT(w[3] == 'i'); +} + +BOOST_PYTHON_MODULE(list_ext) +{ + def("new_list", new_list); + def("listify", listify); + def("listify_string", listify_string); + def("apply_object_list", apply_object_list); + def("apply_list_list", apply_list_list); + + def("append_object", append_object); + def("append_list", append_list); + + def("exercise", exercise); + + class_("X", init()) + .def( "__repr__", x_rep) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/list.py b/pxr/external/boost/python/test/list.py new file mode 100644 index 0000000000..f6cf87096f --- /dev/null +++ b/pxr/external/boost/python/test/list.py @@ -0,0 +1,120 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from list_ext import * + +>>> new_list() +[] + +>>> listify((1,2,3)) +[1, 2, 3] + +>>> letters = listify_string('hello') +>>> letters +['h', 'e', 'l', 'l', 'o'] + +>>> X(22) +X(22) + +>>> def identity(x): +... return x +>>> assert apply_object_list(identity, letters) is letters + + 5 is not convertible to a list + +>>> try: result = apply_object_list(identity, 5) +... except TypeError: pass +... else: print('expected an exception, got', result, 'instead') + +>>> assert apply_list_list(identity, letters) is letters + + 5 is not convertible to a list as a return value + +>>> try: result = apply_list_list(len, letters) +... except TypeError: pass +... else: print('expected an exception, got', result, 'instead') + +>>> append_object(letters, '.') +>>> letters +['h', 'e', 'l', 'l', 'o', '.'] + + tuples do not automatically convert to lists when passed as arguments + +>>> try: append_list(letters, (1,2)) +... except TypeError: pass +... else: print('expected an exception') + +>>> append_list(letters, [1,2]) +>>> letters +['h', 'e', 'l', 'l', 'o', '.', [1, 2]] + + Check that subclass functions are properly called + +>>> class mylist(list): +... def append(self, o): +... list.append(self, o) +... if not hasattr(self, 'nappends'): +... self.nappends = 1 +... else: +... self.nappends += 1 +... +>>> l2 = mylist() +>>> append_object(l2, 'hello') +>>> append_object(l2, 'world') +>>> l2 +['hello', 'world'] +>>> l2.nappends +2 + +>>> def printer(*args): +... for x in args: print( x,) +... print('') +... + +>>> y = X(42) +>>> exercise(letters, y, printer) #doctest: +NORMALIZE_WHITESPACE +after append: +['h', 'e', 'l', 'l', 'o', '.', [1, 2], X(42), 5, X(3)] +number of X(42) instances: 1 +number of 5s: 1 +after extend: +['h', 'e', 'l', 'l', 'o', '.', [1, 2], X(42), 5, X(3), 'x', 'y', 'z'] +index of X(42) is: 7 +index of 'l' is: 2 +after inserting 666: +['h', 'e', 'l', 'l', 666, 'o', '.', [1, 2], X(42), 5, X(3), 'x', 'y', 'z'] +inserting with object as index: +['h', 'e', 'l', 'l', 666, '---', 'o', '.', [1, 2], X(42), 5, X(3), 'x', 'y', 'z'] +popping... +['h', 'e', 'l', 'l', 666, '---', 'o', '.', [1, 2], X(42), 5, X(3), 'x', 'y'] +['h', 'e', 'l', 'l', 666, 'o', '.', [1, 2], X(42), 5, X(3), 'x', 'y'] +['h', 'e', 'l', 'l', 666, 'o', '.', [1, 2], X(42), X(3), 'x', 'y'] +removing X(42) +['h', 'e', 'l', 'l', 666, 'o', '.', [1, 2], X(3), 'x', 'y'] +removing 666 +['h', 'e', 'l', 'l', 'o', '.', [1, 2], X(3), 'x', 'y'] +reversing... +['y', 'x', X(3), [1, 2], '.', 'o', 'l', 'l', 'e', 'h'] +sorted: +['.', 'e', 'h', 'l', 'l', 'o', 'x', 'y'] +reverse sorted: +['y', 'x', 'o', 'l', 'l', 'h', 'e', '.'] +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/long.cpp b/pxr/external/boost/python/test/long.cpp new file mode 100644 index 0000000000..61e4518ff0 --- /dev/null +++ b/pxr/external/boost/python/test/long.cpp @@ -0,0 +1,63 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +using namespace boost::python; + +object new_long() +{ + return long_(); +} + +long_ longify(object x) +{ + return long_(x); +} + +object longify_string(char const* s) +{ + return long_(s); +} + +char const* is_long1(long_& x) +{ + long_ y = x; + x += 50; + BOOST_ASSERT(x == y + 50); + return "yes"; +} + +int is_long2(char const*) +{ + return 0; +} + +// tests for accepting objects (and derived classes) in constructors +// from "Milind Patil" + +struct Y +{ + Y(boost::python::long_) {} +}; + +BOOST_PYTHON_MODULE(long_ext) +{ + def("new_long", new_long); + def("longify", longify); + def("longify_string", longify_string); + def("is_long", is_long1); + def("is_long", is_long2); + + class_< Y >("Y", init< boost::python::long_ >()) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/long.py b/pxr/external/boost/python/test/long.py new file mode 100644 index 0000000000..157dc57aa9 --- /dev/null +++ b/pxr/external/boost/python/test/long.py @@ -0,0 +1,37 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from long_ext import * +>>> print(new_long()) +0 +>>> print(longify(42)) +42 +>>> print(longify_string('300')) +300 +>>> is_long(long(20)) +'yes' +>>> is_long('20') +0 + +>>> x = Y(long(4294967295)) +''' + +import sys +if (sys.version_info.major >= 3): + long = int + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/m1.cpp b/pxr/external/boost/python/test/m1.cpp new file mode 100644 index 0000000000..a873bc35d2 --- /dev/null +++ b/pxr/external/boost/python/test/m1.cpp @@ -0,0 +1,344 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "simple_type.hpp" +#include "complicated.hpp" + +// Declare some straightforward extension types +extern "C" void +dealloc(PyObject* self) +{ + PyObject_Del(self); +} + +// Noddy is a type we got from one of the Python sample files +struct NoddyObject : PyObject +{ + int x; +}; + +PyTypeObject NoddyType = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Noddy"), + sizeof(NoddyObject), + 0, + dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +// Create a Noddy containing 42 +PyObject* new_noddy() +{ + NoddyObject* noddy = PyObject_New(NoddyObject, &NoddyType); + noddy->x = 42; + return (PyObject*)noddy; +} + +// Simple is a wrapper around a struct simple, which just contains a char* +struct SimpleObject +{ + PyObject_HEAD + simple x; +}; + +struct extract_simple_object +{ + static simple& execute(SimpleObject& o) { return o.x; } +}; + +PyTypeObject SimpleType = { + PyVarObject_HEAD_INIT(NULL, 0) + const_cast("Simple"), + sizeof(SimpleObject), + 0, + dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#if PYTHON_API_VERSION >= 1012 + 0 /* tp_del */ +#endif +}; + +// Create a Simple containing "hello, world" +PyObject* new_simple() +{ + SimpleObject* simple = PyObject_New(SimpleObject, &SimpleType); + simple->x.s = const_cast("hello, world"); + return (PyObject*)simple; +} + +// +// Declare some wrappers/unwrappers to test the low-level conversion +// mechanism. +// +using boost::python::to_python_converter; + +// Wrap a simple by copying it into a Simple +struct simple_to_python + : to_python_converter + //, boost::python::converter::wrap_pytype<&SimpleType> +{ + static PyObject* convert(simple const& x) + { + SimpleObject* p = PyObject_New(SimpleObject, &SimpleType); + p->x = x; + return (PyObject*)p; + } + static PyTypeObject const *get_pytype(){return &SimpleType; } +}; + +struct int_from_noddy +{ + static int& execute(NoddyObject& p) + { + return p.x; + } +}; + +// +// Some C++ functions to expose to Python +// + +// Returns the length of s's held string +int f(simple const& s) +{ + return strlen(s.s); +} + +int f_mutable_ref(simple& s) +{ + return strlen(s.s); +} + +int f_mutable_ptr(simple* s) +{ + return strlen(s->s); +} + +int f_const_ptr(simple const* s) +{ + return strlen(s->s); +} + +int f2(SimpleObject const& s) +{ + return strlen(s.x.s); +} + +// A trivial passthru function for simple objects +simple const& g(simple const& x) +{ + return x; +} + +struct A +{ + A() : x(0) {} + virtual ~A() {} + char const* name() { return "A"; } + int x; +}; + +struct B : A +{ + B() : x(1) {} + static char const* name(B*) { return "B"; } + int x; +}; + +struct C : A +{ + C() : x(2) {} + char const* name() { return "C"; } + virtual ~C() {} + int x; +}; + +struct D : B, C +{ + D() : x(3) {} + char const* name() { return "D"; } + int x; +}; + +A take_a(A const& a) { return a; } +B take_b(B& b) { return b; } +C take_c(C* c) { return *c; } +D take_d(D* const& d) { return *d; } + +D take_d_shared_ptr(boost::shared_ptr d) { return *d; } + +boost::shared_ptr d_factory() { return boost::shared_ptr(new D); } + +struct Unregistered {}; +Unregistered make_unregistered(int) { return Unregistered(); } + +Unregistered* make_unregistered2(int) { return new Unregistered; } + +BOOST_PYTHON_MODULE(m1) +{ + using namespace boost::python; + using boost::shared_ptr; + + simple_to_python(); + + lvalue_from_pytype(); + + lvalue_from_pytype< +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // doesn't support non-type member pointer parameters + extract_member +#else + extract_simple_object +#endif + , &SimpleType + >(); + + lvalue_from_pytype,&SimpleType>(); + + def("new_noddy", new_noddy); + def("new_simple", new_simple); + + def("make_unregistered", make_unregistered); + def("make_unregistered2", make_unregistered2, return_value_policy()); + + // Expose f() in all its variations + def("f", f); + def("f_mutable_ref", f_mutable_ref); + def("f_mutable_ptr", f_mutable_ptr); + def("f_const_ptr", f_const_ptr); + + def("f2", f2); + + // Expose g() + def("g", g , return_value_policy() + ); + + def("take_a", take_a); + def("take_b", take_b); + def("take_c", take_c); + def("take_d", take_d); + + + def("take_d_shared_ptr", take_d_shared_ptr); + def("d_factory", d_factory); + + class_ >("A") + .def("name", &A::name) + ; + + // sequence points don't ensure that "A" is constructed before "B" + // or "C" below if we make them part of the same chain + class_ >("B") + .def("name", &B::name) + ; + + class_ >("C") + .def("name", &C::name) + ; + + class_ >("D") + .def("name", &D::name) + ; + + class_("complicated", + init()) + .def(init()) + .def("get_n", &complicated::get_n) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/m2.cpp b/pxr/external/boost/python/test/m2.cpp new file mode 100644 index 0000000000..5bcdea6043 --- /dev/null +++ b/pxr/external/boost/python/test/m2.cpp @@ -0,0 +1,108 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// This module exercises the converters exposed in m1 at a low level +// by exposing raw Python extension functions that use wrap<> and +// unwrap<> objects. +#include +#include +#include +#include +#include +#include "simple_type.hpp" + +#if PY_VERSION_HEX >= 0x03000000 +# define PyString_FromString PyUnicode_FromString +# define PyInt_FromLong PyLong_FromLong +#endif + +// Get a simple (by value) from the argument, and return the +// string it holds. +PyObject* unwrap_simple(simple x) +{ + return PyString_FromString(x.s); +} + +// Likewise, but demands that its possible to get a non-const +// reference to the simple. +PyObject* unwrap_simple_ref(simple& x) +{ + return PyString_FromString(x.s); +} + +// Likewise, with a const reference to the simple object. +PyObject* unwrap_simple_const_ref(simple const& x) +{ + return PyString_FromString(x.s); +} + +// Get an int (by value) from the argument, and convert it to a +// Python Int. +PyObject* unwrap_int(int x) +{ + return PyInt_FromLong(x); +} + +// Get a non-const reference to an int from the argument +PyObject* unwrap_int_ref(int& x) +{ + return PyInt_FromLong(x); +} + +// Get a const reference to an int from the argument. +PyObject* unwrap_int_const_ref(int const& x) +{ + return PyInt_FromLong(x); +} + +#if PY_VERSION_HEX >= 0x03000000 +# undef PyString_FromString +# undef PyInt_FromLong +#endif + +// rewrap extracts a T from the argument, then converts the T back +// to a PyObject* and returns it. +template +struct rewrap +{ + static T f(T x) { return x; } +}; + +BOOST_PYTHON_MODULE(m2) +{ + using boost::python::return_value_policy; + using boost::python::copy_const_reference; + using boost::python::copy_non_const_reference; + using boost::python::def; + + def("unwrap_int", unwrap_int); + def("unwrap_int_ref", unwrap_int_ref); + def("unwrap_int_const_ref", unwrap_int_const_ref); + def("unwrap_simple", unwrap_simple); + def("unwrap_simple_ref", unwrap_simple_ref); + def("unwrap_simple_const_ref", unwrap_simple_const_ref); + + def("wrap_int", &rewrap::f); + + def("wrap_int_ref", &rewrap::f + , return_value_policy() + ); + + def("wrap_int_const_ref", &rewrap::f + , return_value_policy() + ); + + def("wrap_simple", &rewrap::f); + + def("wrap_simple_ref", &rewrap::f + , return_value_policy() + ); + + def("wrap_simple_const_ref", &rewrap::f + , return_value_policy() + ); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/map_indexing_suite.cpp b/pxr/external/boost/python/test/map_indexing_suite.cpp new file mode 100644 index 0000000000..b8771cf41c --- /dev/null +++ b/pxr/external/boost/python/test/map_indexing_suite.cpp @@ -0,0 +1,68 @@ +// Copyright Joel de Guzman 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +using namespace boost::python; + +struct X // a container element +{ + std::string s; + X():s("default") {} + X(std::string s):s(s) {} + std::string repr() const { return s; } + void reset() { s = "reset"; } + void foo() { s = "foo"; } + bool operator==(X const& x) const { return s == x.s; } + bool operator!=(X const& x) const { return s != x.s; } +}; + +std::string x_value(X const& x) +{ + return "gotya " + x.s; +} + + +BOOST_PYTHON_MODULE(map_indexing_suite_ext) +{ + class_("X") + .def(init<>()) + .def(init()) + .def(init()) + .def("__repr__", &X::repr) + .def("reset", &X::reset) + .def("foo", &X::foo) + ; + + def("x_value", x_value); + implicitly_convertible(); + + class_ >("XMap") + .def(map_indexing_suite >()) + ; + + void int_map_indexing_suite(); // moved to int_map_indexing_suite.cpp to + int_map_indexing_suite(); // avoid MSVC 6/7 internal structure overflow + +#if 0 + // Compile check only... + class_ >("IntMap") + .def(map_indexing_suite >()) + ; +#endif + + // Some more.. + class_ > >("TestMap") + .def(map_indexing_suite >, true>()) + ; + + void a_map_indexing_suite(); // moved to a_map_indexing_suite.cpp to + a_map_indexing_suite(); // avoid MSVC 6/7 internal structure overflow + +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/map_indexing_suite.py b/pxr/external/boost/python/test/map_indexing_suite.py new file mode 100644 index 0000000000..e772bb53f9 --- /dev/null +++ b/pxr/external/boost/python/test/map_indexing_suite.py @@ -0,0 +1,238 @@ +# Copyright Joel de Guzman 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + +##################################################################### +# Check an object that we will use as container element +##################################################################### + +>>> from map_indexing_suite_ext import * +>>> assert "map_indexing_suite_IntMap_entry" in dir() +>>> assert "map_indexing_suite_TestMap_entry" in dir() +>>> assert "map_indexing_suite_XMap_entry" in dir() +>>> assert "map_indexing_suite_AMap_entry" in dir() +>>> x = X('hi') +>>> x +hi +>>> x.reset() # a member function that modifies X +>>> x +reset +>>> x.foo() # another member function that modifies X +>>> x +foo + +# test that a string is implicitly convertible +# to an X +>>> x_value('bochi bochi') +'gotya bochi bochi' + +##################################################################### +# Iteration +##################################################################### +>>> def print_xmap(xmap): +... s = '[ ' +... for x in xmap: +... s += repr(x) +... s += ' ' +... s += ']' +... print(s) + +##################################################################### +# Setting (adding entries) +##################################################################### +>>> xm = XMap() +>>> xm['joel'] = 'apple' +>>> xm['tenji'] = 'orange' +>>> xm['mariel'] = 'grape' +>>> xm['tutit'] = 'banana' +>>> xm['kim'] = 'kiwi' + +>>> print_xmap(xm) +[ (joel, apple) (kim, kiwi) (mariel, grape) (tenji, orange) (tutit, banana) ] + +##################################################################### +# Changing an entry +##################################################################### +>>> xm['joel'] = 'pineapple' +>>> print_xmap(xm) +[ (joel, pineapple) (kim, kiwi) (mariel, grape) (tenji, orange) (tutit, banana) ] + +##################################################################### +# Deleting an entry +##################################################################### +>>> del xm['joel'] +>>> print_xmap(xm) +[ (kim, kiwi) (mariel, grape) (tenji, orange) (tutit, banana) ] + +##################################################################### +# adding an entry +##################################################################### +>>> xm['joel'] = 'apple' +>>> print_xmap(xm) +[ (joel, apple) (kim, kiwi) (mariel, grape) (tenji, orange) (tutit, banana) ] + +##################################################################### +# Indexing +##################################################################### +>>> len(xm) +5 +>>> xm['joel'] +apple +>>> xm['tenji'] +orange +>>> xm['mariel'] +grape +>>> xm['tutit'] +banana +>>> xm['kim'] +kiwi + +##################################################################### +# Calling a mutating function of a container element +##################################################################### +>>> xm['joel'].reset() +>>> xm['joel'] +reset + +##################################################################### +# Copying a container element +##################################################################### +>>> x = X(xm['mariel']) +>>> x +grape +>>> x.foo() +>>> x +foo +>>> xm['mariel'] # should not be changed to 'foo' +grape + +##################################################################### +# Referencing a container element +##################################################################### +>>> x = xm['mariel'] +>>> x +grape +>>> x.foo() +>>> x +foo +>>> xm['mariel'] # should be changed to 'foo' +foo + +>>> xm['mariel'] = 'grape' # take it back +>>> xm['joel'] = 'apple' # take it back + +##################################################################### +# Contains +##################################################################### +>>> assert 'joel' in xm +>>> assert 'mariel' in xm +>>> assert 'tenji' in xm +>>> assert 'tutit' in xm +>>> assert 'kim' in xm +>>> assert not 'X' in xm +>>> assert not 12345 in xm + +##################################################################### +# Some references to the container elements +##################################################################### + +>>> z0 = xm['joel'] +>>> z1 = xm['mariel'] +>>> z2 = xm['tenji'] +>>> z3 = xm['tutit'] +>>> z4 = xm['kim'] + +>>> z0 # proxy +apple +>>> z1 # proxy +grape +>>> z2 # proxy +orange +>>> z3 # proxy +banana +>>> z4 # proxy +kiwi + +##################################################################### +# Delete some container element +##################################################################### + +>>> del xm['tenji'] +>>> print_xmap(xm) +[ (joel, apple) (kim, kiwi) (mariel, grape) (tutit, banana) ] + +>>> del xm['tutit'] +>>> print_xmap(xm) +[ (joel, apple) (kim, kiwi) (mariel, grape) ] + +##################################################################### +# Show that the references are still valid +##################################################################### +>>> z0 # proxy +apple +>>> z1 # proxy +grape +>>> z2 # proxy detached +orange +>>> z3 # proxy detached +banana +>>> z4 # proxy +kiwi + +##################################################################### +# Show that iteration allows mutable access to the elements +##################################################################### +>>> for x in xm: +... x.data().reset() +>>> print_xmap(xm) +[ (joel, reset) (kim, reset) (mariel, reset) ] + +##################################################################### +# Some more... +##################################################################### + +>>> tm = TestMap() +>>> tm["joel"] = X("aaa") +>>> tm["kimpo"] = X("bbb") +>>> print_xmap(tm) +[ (joel, aaa) (kimpo, bbb) ] +>>> for el in tm: #doctest: +NORMALIZE_WHITESPACE +... print(el.key(), end=' ') +... dom = el.data() +joel kimpo + +##################################################################### +# Test custom converter... +##################################################################### + +>>> am = AMap() +>>> am[3] = 4 +>>> am[3] +4 +>>> for i in am: +... i.data() +4 + +##################################################################### +# END.... +##################################################################### + +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argxm = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print('running...') + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/minimal.cpp b/pxr/external/boost/python/test/minimal.cpp new file mode 100644 index 0000000000..5efee26bcd --- /dev/null +++ b/pxr/external/boost/python/test/minimal.cpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include + +#if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245 +# include // works around a KCC intermediate code generation bug +#endif + +BOOST_PYTHON_MODULE(minimal_ext) +{ +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/minimal.py b/pxr/external/boost/python/test/minimal.py new file mode 100644 index 0000000000..ee75e3705b --- /dev/null +++ b/pxr/external/boost/python/test/minimal.py @@ -0,0 +1,7 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +print("IMPORTING minimal_ext") +import minimal_ext +print("DONE IMPORTING minimal_ext") + diff --git a/pxr/external/boost/python/test/module_init_exception.cpp b/pxr/external/boost/python/test/module_init_exception.cpp new file mode 100644 index 0000000000..d8cec57d3a --- /dev/null +++ b/pxr/external/boost/python/test/module_init_exception.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2003 Rational Discovery LLC +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +using namespace boost::python; + +BOOST_PYTHON_MODULE(module_init_exception_ext) +{ + throw std::runtime_error("Module init failed"); +} diff --git a/pxr/external/boost/python/test/module_init_exception.py b/pxr/external/boost/python/test/module_init_exception.py new file mode 100644 index 0000000000..3da53e1956 --- /dev/null +++ b/pxr/external/boost/python/test/module_init_exception.py @@ -0,0 +1,12 @@ +# Copyright (C) 2003 Rational Discovery LLC. Distributed under the Boost +# Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy +# at http://www.boost.org/LICENSE_1_0.txt) + +print("running...") + +try: + import module_init_exception_ext +except RuntimeError as e: + print(e) + +print("Done.") diff --git a/pxr/external/boost/python/test/module_tail.cpp b/pxr/external/boost/python/test/module_tail.cpp new file mode 100644 index 0000000000..f9cdca1898 --- /dev/null +++ b/pxr/external/boost/python/test/module_tail.cpp @@ -0,0 +1,58 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if defined(_WIN32) +# ifdef __MWERKS__ +# pragma ANSI_strict off +# endif +# include +# ifdef __MWERKS__ +# pragma ANSI_strict reset +# endif + +# ifdef _MSC_VER +# include // for _set_se_translator() +# pragma warning(push) +# pragma warning(disable:4297) +# pragma warning(disable:4535) +extern "C" void straight_to_debugger(unsigned int, EXCEPTION_POINTERS*) +{ + throw; +} +extern "C" void (*old_translator)(unsigned, EXCEPTION_POINTERS*) + = _set_se_translator(straight_to_debugger); +# pragma warning(pop) +# endif + +#endif // _WIN32 + +#include +#include +#include +struct test_failure : std::exception +{ + test_failure(char const* expr, char const* /*function*/, char const* file, unsigned line) + : msg(file + boost::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr) + {} + + ~test_failure() throw() {} + + char const* what() const throw() + { + return boost::python::extract(msg)(); + } + + boost::python::str msg; +}; + +namespace boost +{ + +void assertion_failed(char const * expr, char const * function, char const * file, long line) +{ + throw ::test_failure(expr,function, file, line); +} + +} // namespace boost diff --git a/pxr/external/boost/python/test/multi_arg_constructor.cpp b/pxr/external/boost/python/test/multi_arg_constructor.cpp new file mode 100644 index 0000000000..7d49bb5567 --- /dev/null +++ b/pxr/external/boost/python/test/multi_arg_constructor.cpp @@ -0,0 +1,27 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +struct A +{ + A(const double, const double, const double, const double, const double + , const double, const double + , const double, const double + ) {} +}; + +BOOST_PYTHON_MODULE(multi_arg_constructor_ext) +{ + using namespace boost::python; + + class_( + "A" + , init() + ) + ; + +} + diff --git a/pxr/external/boost/python/test/multi_arg_constructor.py b/pxr/external/boost/python/test/multi_arg_constructor.py new file mode 100644 index 0000000000..5d8b4a516c --- /dev/null +++ b/pxr/external/boost/python/test/multi_arg_constructor.py @@ -0,0 +1,21 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from multi_arg_constructor_ext import * +>>> a = A(1.0, 2, 3, 4, 5, 6, 7.0, 8.1, 9.3) +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/nested.cpp b/pxr/external/boost/python/test/nested.cpp new file mode 100644 index 0000000000..de656d2b8b --- /dev/null +++ b/pxr/external/boost/python/test/nested.cpp @@ -0,0 +1,51 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include "test_class.hpp" +#if __GNUC__ != 2 +# include +#else +# include +#endif + +typedef test_class<> X; +typedef test_class<1> Y; + +std::ostream& operator<<(std::ostream& s, X const& x) +{ + return s << x.value(); +} + +std::ostream& operator<<(std::ostream& s, Y const& x) +{ + return s << x.value(); +} + + +BOOST_PYTHON_MODULE(nested_ext) +{ + using namespace boost::python; + + // Establish X as the current scope. + scope x_class + = class_("X", init()) + .def(str(self)) + ; + + + // Y will now be defined in the current scope + class_("Y", init()) + .def(str(self)) + ; +} + + +#include "module_tail.cpp" + + + diff --git a/pxr/external/boost/python/test/nested.py b/pxr/external/boost/python/test/nested.py new file mode 100644 index 0000000000..720790173c --- /dev/null +++ b/pxr/external/boost/python/test/nested.py @@ -0,0 +1,40 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + >>> from nested_ext import * + + >>> X + + + >>> X.__module__ + 'nested_ext' + + >>> X.__name__ + 'X' + + >>> X.Y + + + >>> X.Y.__module__ + 'nested_ext' + + >>> X.Y.__name__ + 'Y' + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/newtest.py b/pxr/external/boost/python/test/newtest.py new file mode 100644 index 0000000000..b878d51924 --- /dev/null +++ b/pxr/external/boost/python/test/newtest.py @@ -0,0 +1,206 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from m1 import * + +>>> from m2 import * + + Prove that we get an appropriate error from trying to return a type + for which we have no registered to_python converter + +>>> def check_unregistered(f, msgprefix): +... try: +... f(1) +... except TypeError as x: +... if not str(x).startswith(msgprefix): +... print(str(x)) +... else: +... print('expected a TypeError') +... +>>> check_unregistered(make_unregistered, 'No to_python (by-value) converter found for C++ type') +>>> check_unregistered(make_unregistered2, 'No Python class registered for C++ class') + +>>> n = new_noddy() +>>> s = new_simple() +>>> unwrap_int(n) +42 +>>> unwrap_int_ref(n) +42 +>>> unwrap_int_const_ref(n) +42 +>>> unwrap_simple(s) +'hello, world' +>>> unwrap_simple_ref(s) +'hello, world' +>>> unwrap_simple_const_ref(s) +'hello, world' +>>> unwrap_int(5) +5 + +Can't get a non-const reference to a built-in integer object +>>> try: +... unwrap_int_ref(7) +... except: pass +... else: print('no exception') + +>>> unwrap_int_const_ref(9) +9 + +>>> wrap_int(n) +42 + +try: wrap_int_ref(n) +... except: pass +... else: print('no exception') + +>>> wrap_int_const_ref(n) +42 + +>>> unwrap_simple_ref(wrap_simple(s)) +'hello, world' + +>>> unwrap_simple_ref(wrap_simple_ref(s)) +'hello, world' + +>>> unwrap_simple_ref(wrap_simple_const_ref(s)) +'hello, world' + +>>> f(s) +12 + +>>> unwrap_simple(g(s)) +'hello, world' + +>>> f(g(s)) +12 + +>>> f_mutable_ref(g(s)) +12 + +>>> f_const_ptr(g(s)) +12 + +>>> f_mutable_ptr(g(s)) +12 + +>>> f2(g(s)) +12 + +Create an extension class which wraps "complicated" (init1 and get_n) +are a complicated constructor and member function, respectively. + +>>> c1 = complicated(s, 99) +>>> c1.get_n() +99 +>>> c2 = complicated(s) +>>> c2.get_n() +0 + + a quick regression test for a bug where None could be converted + to the target of any member function. To see it, we need to + access the __dict__ directly, to bypass the type check supplied + by the Method property which wraps the method when accessed as an + attribute. + +>>> try: A.__dict__['name'](None) +... except TypeError: pass +... else: print('expected an exception!') + + +>>> a = A() +>>> b = B() +>>> c = C() +>>> d = D() + + +>>> take_a(a).name() +'A' + +>>> try: +... take_b(a) +... except: pass +... else: print('no exception') + +>>> try: +... take_c(a) +... except: pass +... else: print('no exception') + +>>> try: +... take_d(a) +... except: pass +... else: print('no exception') + +------ +>>> take_a(b).name() +'A' + +>>> take_b(b).name() +'B' + +>>> try: +... take_c(b) +... except: pass +... else: print('no exception') + +>>> try: +... take_d(b) +... except: pass +... else: print('no exception') + +------- +>>> take_a(c).name() +'A' + +>>> try: +... take_b(c) +... except: pass +... else: print('no exception') + +>>> take_c(c).name() +'C' + +>>> try: +... take_d(c) +... except: pass +... else: print('no exception') + +------- +>>> take_a(d).name() +'A' +>>> take_b(d).name() +'B' +>>> take_c(d).name() +'C' +>>> take_d(d).name() +'D' + +>>> take_d_shared_ptr(d).name() +'D' + +>>> d_as_a = d_factory() +>>> dd = take_d(d_as_a) +>>> dd.name() +'D' +>>> print(g.__doc__.splitlines()[1]) +g( (Simple)arg1) -> Simple : + +""" + +def run(args = None): + + import sys + import doctest + + if args is not None: + sys.argv = args + + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/numpy/dtype.cpp b/pxr/external/boost/python/test/numpy/dtype.cpp new file mode 100644 index 0000000000..3a011a25e2 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/dtype.cpp @@ -0,0 +1,49 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +template +np::dtype accept(T) { + return np::dtype::get_builtin(); +} + +BOOST_PYTHON_MODULE(dtype_ext) +{ + np::initialize(); + // wrap dtype equivalence test, since it isn't available in Python API. + p::def("equivalent", np::equivalent); + // integers, by number of bits + p::def("accept_int8", accept); + p::def("accept_uint8", accept); + p::def("accept_int16", accept); + p::def("accept_uint16", accept); + p::def("accept_int32", accept); + p::def("accept_uint32", accept); + p::def("accept_int64", accept); + p::def("accept_uint64", accept); + // integers, by C name according to NumPy + p::def("accept_bool_", accept); + p::def("accept_byte", accept); + p::def("accept_ubyte", accept); + p::def("accept_short", accept); + p::def("accept_ushort", accept); + p::def("accept_intc", accept); + p::def("accept_uintc", accept); + // floats and complex + p::def("accept_float32", accept); + p::def("accept_complex64", accept< std::complex >); + p::def("accept_float64", accept); + p::def("accept_complex128", accept< std::complex >); + if (sizeof(long double) > sizeof(double)) { + p::def("accept_longdouble", accept); + p::def("accept_clongdouble", accept< std::complex >); + } +} diff --git a/pxr/external/boost/python/test/numpy/dtype.py b/pxr/external/boost/python/test/numpy/dtype.py new file mode 100644 index 0000000000..a27ee0f55d --- /dev/null +++ b/pxr/external/boost/python/test/numpy/dtype.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import dtype_ext +import unittest +import numpy +import sys +if (sys.version_info.major >= 3): + long = int + +class DtypeTestCase(unittest.TestCase): + + def assertEquivalent(self, a, b): + return self.assert_(dtype_ext.equivalent(a, b), "%r is not equivalent to %r") + + def testIntegers(self): + for bits in (8, 16, 32, 64): + s = getattr(numpy, "int%d" % bits) + u = getattr(numpy, "uint%d" % bits) + fs = getattr(dtype_ext, "accept_int%d" % bits) + fu = getattr(dtype_ext, "accept_uint%d" % bits) + self.assertEquivalent(fs(s(1)), numpy.dtype(s)) + self.assertEquivalent(fu(u(1)), numpy.dtype(u)) + # these should just use the regular Boost.Python converters + self.assertEquivalent(fs(True), numpy.dtype(s)) + self.assertEquivalent(fu(True), numpy.dtype(u)) + self.assertEquivalent(fs(int(1)), numpy.dtype(s)) + self.assertEquivalent(fu(int(1)), numpy.dtype(u)) + self.assertEquivalent(fs(long(1)), numpy.dtype(s)) + self.assertEquivalent(fu(long(1)), numpy.dtype(u)) + for name in ("bool_", "byte", "ubyte", "short", "ushort", "intc", "uintc"): + t = getattr(numpy, name) + ft = getattr(dtype_ext, "accept_%s" % name) + self.assertEquivalent(ft(t(1)), numpy.dtype(t)) + # these should just use the regular Boost.Python converters + self.assertEquivalent(ft(True), numpy.dtype(t)) + if name != "bool_": + self.assertEquivalent(ft(int(1)), numpy.dtype(t)) + self.assertEquivalent(ft(long(1)), numpy.dtype(t)) + + + def testFloats(self): + f = numpy.float32 + c = numpy.complex64 + self.assertEquivalent(dtype_ext.accept_float32(f(numpy.pi)), numpy.dtype(f)) + self.assertEquivalent(dtype_ext.accept_complex64(c(1+2j)), numpy.dtype(c)) + f = numpy.float64 + c = numpy.complex128 + self.assertEquivalent(dtype_ext.accept_float64(f(numpy.pi)), numpy.dtype(f)) + self.assertEquivalent(dtype_ext.accept_complex128(c(1+2j)), numpy.dtype(c)) + if hasattr(numpy, "longdouble") and hasattr(dtype_ext, "accept_longdouble"): + f = numpy.longdouble + c = numpy.clongdouble + self.assertEquivalent(dtype_ext.accept_longdouble(f(numpy.pi)), numpy.dtype(f)) + self.assertEquivalent(dtype_ext.accept_clongdouble(c(1+2j)), numpy.dtype(c)) + + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/numpy/indexing.cpp b/pxr/external/boost/python/test/numpy/indexing.cpp new file mode 100644 index 0000000000..f3cc457178 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/indexing.cpp @@ -0,0 +1,28 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +p::object single(np::ndarray ndarr, int i) { return ndarr[i];} +p::object slice(np::ndarray ndarr, p::slice sl) { return ndarr[sl];} +p::object indexarray(np::ndarray ndarr, np::ndarray d1) { return ndarr[d1];} +p::object indexarray_2d(np::ndarray ndarr, np::ndarray d1,np::ndarray d2) { return ndarr[p::make_tuple(d1,d2)];} +p::object indexslice(np::ndarray ndarr, np::ndarray d1, p::slice sl) { return ndarr[p::make_tuple(d1, sl)];} + +BOOST_PYTHON_MODULE(indexing_ext) +{ + np::initialize(); + p::def("single", single); + p::def("slice", slice); + p::def("indexarray", indexarray); + p::def("indexarray", indexarray_2d); + p::def("indexslice", indexslice); + +} diff --git a/pxr/external/boost/python/test/numpy/indexing.py b/pxr/external/boost/python/test/numpy/indexing.py new file mode 100644 index 0000000000..ebd9dcbabb --- /dev/null +++ b/pxr/external/boost/python/test/numpy/indexing.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import unittest +import numpy +import indexing_ext + +class TestIndexing(unittest.TestCase): + + def testSingle(self): + x = numpy.arange(0,10) + for i in range(0,10): + numpy.testing.assert_equal(indexing_ext.single(x,i), i) + for i in range(-10,0): + numpy.testing.assert_equal(indexing_ext.single(x,i),10+i) + + def testSlice(self): + x = numpy.arange(0,10) + sl = slice(3,8) + b = [3,4,5,6,7] + numpy.testing.assert_equal(indexing_ext.slice(x,sl), b) + + def testStepSlice(self): + x = numpy.arange(0,10) + sl = slice(3,8,2) + b = [3,5,7] + numpy.testing.assert_equal(indexing_ext.slice(x,sl), b) + + def testIndex(self): + x = numpy.arange(0,10) + chk = numpy.array([3,4,5,6]) + numpy.testing.assert_equal(indexing_ext.indexarray(x,chk),chk) + chk = numpy.array([[0,1],[2,3]]) + numpy.testing.assert_equal(indexing_ext.indexarray(x,chk),chk) + x = numpy.arange(9).reshape(3,3) + y = numpy.array([0,1]) + z = numpy.array([0,2]) + chk = numpy.array([0,5]) + numpy.testing.assert_equal(indexing_ext.indexarray(x,y,z),chk) + x = numpy.arange(0,10) + b = x>4 + chk = numpy.array([5,6,7,8,9]) + numpy.testing.assert_equal(indexing_ext.indexarray(x,b),chk) + x = numpy.arange(9).reshape(3,3) + b = numpy.array([0,2]) + sl = slice(0,3) + chk = numpy.array([[0,1,2],[6,7,8]]) + numpy.testing.assert_equal(indexing_ext.indexslice(x,b,sl),chk) + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/numpy/ndarray.cpp b/pxr/external/boost/python/test/numpy/ndarray.cpp new file mode 100644 index 0000000000..75a1010435 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/ndarray.cpp @@ -0,0 +1,51 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +np::ndarray zeros(p::tuple shape, np::dtype dt) { return np::zeros(shape, dt);} +np::ndarray array2(p::object obj, np::dtype dt) { return np::array(obj,dt);} +np::ndarray array1(p::object obj) { return np::array(obj);} +np::ndarray empty1(p::tuple shape, np::dtype dt) { return np::empty(shape,dt);} + +np::ndarray c_empty(p::tuple shape, np::dtype dt) +{ + // convert 'shape' to a C array so we can test the corresponding + // version of the constructor + unsigned len = p::len(shape); + Py_intptr_t *c_shape = new Py_intptr_t[len]; + for (unsigned i = 0; i != len; ++i) + c_shape[i] = p::extract(shape[i]); + np::ndarray result = np::empty(len, c_shape, dt); + delete [] c_shape; + return result; +} + +np::ndarray transpose(np::ndarray arr) { return arr.transpose();} +np::ndarray squeeze(np::ndarray arr) { return arr.squeeze();} +np::ndarray reshape(np::ndarray arr,p::tuple tup) { return arr.reshape(tup);} + +Py_intptr_t shape_index(np::ndarray arr,int k) { return arr.shape(k); } +Py_intptr_t strides_index(np::ndarray arr,int k) { return arr.strides(k); } + +BOOST_PYTHON_MODULE(ndarray_ext) +{ + np::initialize(); + p::def("zeros", zeros); + p::def("zeros_matrix", zeros, np::as_matrix<>()); + p::def("array", array2); + p::def("array", array1); + p::def("empty", empty1); + p::def("c_empty", c_empty); + p::def("transpose", transpose); + p::def("squeeze", squeeze); + p::def("reshape", reshape); + p::def("shape_index", shape_index); + p::def("strides_index", strides_index); +} diff --git a/pxr/external/boost/python/test/numpy/ndarray.py b/pxr/external/boost/python/test/numpy/ndarray.py new file mode 100644 index 0000000000..2acc384a52 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/ndarray.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import ndarray_ext +import unittest +import numpy + +class TestNdarray(unittest.TestCase): + + def testNdzeros(self): + for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + v = numpy.zeros(60, dtype=dtp) + dt = numpy.dtype(dtp) + for shape in ((60,),(6,10),(4,3,5),(2,2,3,5)): + a1 = ndarray_ext.zeros(shape,dt) + a2 = v.reshape(a1.shape) + self.assertEqual(shape,a1.shape) + self.assert_((a1 == a2).all()) + + def testNdzeros_matrix(self): + for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + dt = numpy.dtype(dtp) + shape = (6, 10) + a1 = ndarray_ext.zeros_matrix(shape, dt) + a2 = numpy.matrix(numpy.zeros(shape, dtype=dtp)) + self.assertEqual(shape,a1.shape) + self.assert_((a1 == a2).all()) + self.assertEqual(type(a1), type(a2)) + + def testNdarray(self): + a = range(0,60) + for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + v = numpy.array(a, dtype=dtp) + dt = numpy.dtype(dtp) + a1 = ndarray_ext.array(a) + a2 = ndarray_ext.array(a,dt) + self.assert_((a1 == v).all()) + self.assert_((a2 == v).all()) + for shape in ((60,),(6,10),(4,3,5),(2,2,3,5)): + a1 = a1.reshape(shape) + self.assertEqual(shape,a1.shape) + a2 = a2.reshape(shape) + self.assertEqual(shape,a2.shape) + + def testNdempty(self): + for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + dt = numpy.dtype(dtp) + for shape in ((60,),(6,10),(4,3,5),(2,2,3,5)): + a1 = ndarray_ext.empty(shape,dt) + a2 = ndarray_ext.c_empty(shape,dt) + self.assertEqual(shape,a1.shape) + self.assertEqual(shape,a2.shape) + + def testTranspose(self): + for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + dt = numpy.dtype(dtp) + for shape in ((6,10),(4,3,5),(2,2,3,5)): + a1 = numpy.empty(shape,dt) + a2 = a1.transpose() + a1 = ndarray_ext.transpose(a1) + self.assertEqual(a1.shape,a2.shape) + + def testSqueeze(self): + a1 = numpy.array([[[3,4,5]]]) + a2 = a1.squeeze() + a1 = ndarray_ext.squeeze(a1) + self.assertEqual(a1.shape,a2.shape) + + def testReshape(self): + a1 = numpy.empty((2,2)) + a2 = ndarray_ext.reshape(a1,(1,4)) + self.assertEqual(a2.shape,(1,4)) + + def testShapeIndex(self): + a = numpy.arange(24) + a.shape = (1,2,3,4) + def shape_check(i): + print(i) + self.assertEqual(ndarray_ext.shape_index(a,i) ,a.shape[i] ) + for i in range(4): + shape_check(i) + for i in range(-1,-5,-1): + shape_check(i) + try: + ndarray_ext.shape_index(a,4) # out of bounds -- should raise IndexError + self.assertTrue(False) + except IndexError: + pass + + def testStridesIndex(self): + a = numpy.arange(24) + a.shape = (1,2,3,4) + def strides_check(i): + print(i) + self.assertEqual(ndarray_ext.strides_index(a,i) ,a.strides[i] ) + for i in range(4): + strides_check(i) + for i in range(-1,-5,-1): + strides_check(i) + try: + ndarray_ext.strides_index(a,4) # out of bounds -- should raise IndexError + self.assertTrue(False) + except IndexError: + pass + + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/numpy/shapes.cpp b/pxr/external/boost/python/test/numpy/shapes.cpp new file mode 100644 index 0000000000..a245df155c --- /dev/null +++ b/pxr/external/boost/python/test/numpy/shapes.cpp @@ -0,0 +1,22 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +np::ndarray reshape(np::ndarray old_array, p::tuple shape) +{ + np::ndarray local_shape = old_array.reshape(shape); + return local_shape; +} + +BOOST_PYTHON_MODULE(shapes_ext) +{ + np::initialize(); + p::def("reshape", reshape); +} diff --git a/pxr/external/boost/python/test/numpy/shapes.py b/pxr/external/boost/python/test/numpy/shapes.py new file mode 100644 index 0000000000..d0a0099ca6 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/shapes.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import shapes_ext +import unittest +import numpy + +class TestShapes(unittest.TestCase): + + def testShapes(self): + a1 = numpy.array([(0,1),(2,3)]) + a1_shape = (1,4) + a1 = shapes_ext.reshape(a1,a1_shape) + self.assertEqual(a1_shape,a1.shape) + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/numpy/templates.cpp b/pxr/external/boost/python/test/numpy/templates.cpp new file mode 100644 index 0000000000..83de6bd2f0 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/templates.cpp @@ -0,0 +1,63 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +struct ArrayFiller +{ + + typedef boost::mpl::vector< short, int, float, std::complex > TypeSequence; + typedef boost::mpl::vector_c< int, 1, 2 > DimSequence; + + explicit ArrayFiller(np::ndarray const & arg) : argument(arg) {} + + template + void apply() const + { + if (N == 1) + { + char * p = argument.get_data(); + int stride = argument.strides(0); + int size = argument.shape(0); + for (int n = 0; n != size; ++n, p += stride) + *reinterpret_cast(p) = static_cast(n); + } + else + { + char * row_p = argument.get_data(); + int row_stride = argument.strides(0); + int col_stride = argument.strides(1); + int rows = argument.shape(0); + int cols = argument.shape(1); + int i = 0; + for (int n = 0; n != rows; ++n, row_p += row_stride) + { + char * col_p = row_p; + for (int m = 0; m != cols; ++i, ++m, col_p += col_stride) + *reinterpret_cast(col_p) = static_cast(i); + } + } + } + + np::ndarray argument; +}; + +void fill(np::ndarray const & arg) +{ + ArrayFiller filler(arg); + np::invoke_matching_array(arg, filler); +} + +BOOST_PYTHON_MODULE(templates_ext) +{ + np::initialize(); + p::def("fill", fill); +} diff --git a/pxr/external/boost/python/test/numpy/templates.py b/pxr/external/boost/python/test/numpy/templates.py new file mode 100755 index 0000000000..8290b13a07 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/templates.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import templates_ext +import unittest +import numpy + +class TestTemplates(unittest.TestCase): + + def testTemplates(self): + for dtype in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128): + v = numpy.arange(12, dtype=dtype) + for shape in ((12,), (4, 3), (2, 6)): + a1 = numpy.zeros(shape, dtype=dtype) + a2 = v.reshape(a1.shape) + templates_ext.fill(a1) + self.assert_((a1 == a2).all()) + a1 = numpy.zeros((12,), dtype=numpy.float64) + self.assertRaises(TypeError, templates_ext.fill, a1) + a1 = numpy.zeros((12,2,3), dtype=numpy.float32) + self.assertRaises(TypeError, templates_ext.fill, a1) + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/numpy/ufunc.cpp b/pxr/external/boost/python/test/numpy/ufunc.cpp new file mode 100644 index 0000000000..3a9d43cbbe --- /dev/null +++ b/pxr/external/boost/python/test/numpy/ufunc.cpp @@ -0,0 +1,36 @@ +// Copyright Jim Bosch & Ankit Daftery 2010-2012. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +namespace p = boost::python; +namespace np = boost::python::numpy; + +struct UnaryCallable +{ + typedef double argument_type; + typedef double result_type; + + double operator()(double r) const { return r * 2;} +}; + +struct BinaryCallable +{ + typedef double first_argument_type; + typedef double second_argument_type; + typedef double result_type; + + double operator()(double a, double b) const { return a * 2 + b * 3;} +}; + +BOOST_PYTHON_MODULE(ufunc_ext) +{ + np::initialize(); + p::class_("UnaryCallable") + .def("__call__", np::unary_ufunc::make()); + p::class_< BinaryCallable>("BinaryCallable") + .def("__call__", np::binary_ufunc::make()); +} diff --git a/pxr/external/boost/python/test/numpy/ufunc.py b/pxr/external/boost/python/test/numpy/ufunc.py new file mode 100755 index 0000000000..e820121ee1 --- /dev/null +++ b/pxr/external/boost/python/test/numpy/ufunc.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Copyright Jim Bosch & Ankit Daftery 2010-2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import ufunc_ext +import unittest +import numpy +from numpy.testing.utils import assert_array_almost_equal + +class TestUnary(unittest.TestCase): + + def testScalar(self): + f = ufunc_ext.UnaryCallable() + assert_array_almost_equal(f(1.0), 2.0) + assert_array_almost_equal(f(3.0), 6.0) + + def testArray(self): + f = ufunc_ext.UnaryCallable() + a = numpy.arange(5, dtype=float) + b = f(a) + assert_array_almost_equal(b, a*2.0) + c = numpy.zeros(5, dtype=float) + d = f(a,output=c) + self.assert_(c is d) + assert_array_almost_equal(d, a*2.0) + + def testList(self): + f = ufunc_ext.UnaryCallable() + a = range(5) + b = f(a) + assert_array_almost_equal(b/2.0, a) + +class TestBinary(unittest.TestCase): + + def testScalar(self): + f = ufunc_ext.BinaryCallable() + assert_array_almost_equal(f(1.0, 3.0), 11.0) + assert_array_almost_equal(f(3.0, 2.0), 12.0) + + def testArray(self): + f = ufunc_ext.BinaryCallable() + a = numpy.random.randn(5) + b = numpy.random.randn(5) + assert_array_almost_equal(f(a,b), (a*2+b*3)) + c = numpy.zeros(5, dtype=float) + d = f(a,b,output=c) + self.assert_(c is d) + assert_array_almost_equal(d, a*2 + b*3) + assert_array_almost_equal(f(a, 2.0), a*2 + 6.0) + assert_array_almost_equal(f(1.0, b), 2.0 + b*3) + + +if __name__=="__main__": + unittest.main() diff --git a/pxr/external/boost/python/test/object.cpp b/pxr/external/boost/python/test/object.cpp new file mode 100644 index 0000000000..b1f015187c --- /dev/null +++ b/pxr/external/boost/python/test/object.cpp @@ -0,0 +1,392 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include + +using namespace boost::python; + +class NotCopyable +{ +} not_copyable; + +object ref_to_noncopyable() +{ + return object(boost::ref(not_copyable)); +} + +object call_object_3(object f) +{ + return f(3); +} + +object message() +{ + return object("hello, world!"); +} + +object number() +{ + return object(42); +} + +object obj_getattr(object x, char const* name) +{ + return x.attr(name); +} + +object obj_objgetattr(object x, object const& name) +{ + return x.attr(name); +} + +object obj_const_getattr(object const& x, char const* name) +{ + return x.attr(name); +} + +object obj_const_objgetattr(object const& x, object const& name) +{ + return x.attr(name); +} + +void obj_setattr(object x, char const* name, object value) +{ + x.attr(name) = value; +} + +void obj_objsetattr(object x, object const& name, object value) +{ + x.attr(name) = value; +} + +void obj_setattr42(object x, char const* name) +{ + x.attr(name) = 42; +} + +void obj_objsetattr42(object x, object const& name) +{ + x.attr(name) = 42; +} + +void obj_moveattr(object& x, char const* src, char const* dst) +{ + x.attr(dst) = x.attr(src); +} + +void obj_objmoveattr(object& x, object const& src, object const& dst) +{ + x.attr(dst) = x.attr(src); +} + +void obj_delattr(object x, char const* name) +{ + x.attr(name).del(); +} + +void obj_objdelattr(object x, object const& name) +{ + x.attr(name).del(); +} + +object obj_getitem(object x, object key) +{ + return x[key]; +} + +object obj_getitem3(object x) +{ + return x[3]; +} + +object obj_const_getitem(object const& x, object key) +{ + return x[key]; +} + +void obj_setitem(object x, object key, object value) +{ + x[key] = value; +} + +void obj_setitem42(object x, object key) +{ + x[key] = 42; +} + +void obj_moveitem(object& x, object src, object dst) +{ + x[dst] = x[src]; +} + +void obj_moveitem2(object const& x_src, object k_src, object& x_dst, object k_dst) +{ + x_dst[k_dst] = x_src[k_src]; +} + +bool test(object y) +{ + return y; +} + +bool test_not(object y) +{ + return !y; +} + +bool test_attr(object y, char* name) +{ + return y.attr(name); +} + +bool test_objattr(object y, object& name) +{ + return y.attr(name); +} + +bool test_not_attr(object y, char* name) +{ + return !y.attr(name); +} + +bool test_not_objattr(object y, object& name) +{ + return !y.attr(name); +} + +bool test_item(object y, object key) +{ + return y[key]; +} + +bool test_not_item(object y, object key) +{ + return !y[key]; +} + +bool check_string_slice() +{ + object s("hello, world"); + + if (s.slice(_,-3) != "hello, wo") + return false; + + if (s.slice(-3,_) != "rld") + return false; + + if (s.slice(_,_) != s) + return false; + + if (", " != s.slice(5,7)) + return false; + + return s.slice(2,-1).slice(1,-1) == "lo, wor"; +} + +object test_call(object c, object args, object kwds) +{ + return c(*args, **kwds); +} + +bool check_binary_operators() +{ + int y; + + object x(3); + +#define TEST_BINARY(op) \ + for (y = 1; y < 6; ++y) \ + { \ + if ((x op y) != (3 op y)) \ + return false; \ + } \ + for (y = 1; y < 6; ++y) \ + { \ + if ((y op x) != (y op 3)) \ + return false; \ + } \ + for (y = 1; y < 6; ++y) \ + { \ + object oy(y); \ + if ((oy op x) != (oy op 3)) \ + return false; \ + } + TEST_BINARY(>) + TEST_BINARY(>=) + TEST_BINARY(<) + TEST_BINARY(<=) + TEST_BINARY(==) + TEST_BINARY(!=) + + TEST_BINARY(+) + TEST_BINARY(-) + TEST_BINARY(*) + TEST_BINARY(/) + TEST_BINARY(%) + TEST_BINARY(<<) + TEST_BINARY(>>) + TEST_BINARY(&) + TEST_BINARY(^) + TEST_BINARY(|) + return true; +} + +bool check_inplace(object l, object o) +{ + int y; +#define TEST_INPLACE(op) \ + for (y = 1; y < 6; ++y) \ + { \ + object x(666); \ + x op##= y; \ + if (x != (666 op y)) \ + return false; \ + } \ + for (y = 1; y < 6; ++y) \ + { \ + object x(666); \ + x op##= object(y); \ + if (!(x == (666 op y))) \ + return false; \ + } + TEST_INPLACE(+) + TEST_INPLACE(-) + TEST_INPLACE(*) + TEST_INPLACE(/) + TEST_INPLACE(%) + TEST_INPLACE(<<) + TEST_INPLACE(>>) + TEST_INPLACE(&) + TEST_INPLACE(^) + TEST_INPLACE(|) + + l += l; + for (y = 0; y < 6; ++y) + { + if (l[y] != y % 3) + return false; + } + +#define TEST_ITEM_INPLACE(index, op, n, r1, r2) \ + l[index] op##= n; \ + if (l[index] != r1) \ + return false; \ + l[index] op##= object(n); \ + if (!(l[index] == r2)) \ + return false; + + TEST_ITEM_INPLACE(0,+,7,7,14) + TEST_ITEM_INPLACE(1,-,2,-1,-3) + TEST_ITEM_INPLACE(2,*,3,6,18) + TEST_ITEM_INPLACE(2,/,2,9,4) + TEST_ITEM_INPLACE(0,%,4,2,2) + l[0] += 1; + TEST_ITEM_INPLACE(0,<<,2,12,48) + TEST_ITEM_INPLACE(0,>>,1,24,12) + l[4] = 15; + TEST_ITEM_INPLACE(4,&,(16+4+1),5,5) + TEST_ITEM_INPLACE(0,^,1,13,12) + TEST_ITEM_INPLACE(0,|,1,13,13) + + o.attr("x0") = 0; + o.attr("x1") = 1; + o.attr("x2") = 2; + o.attr("x3") = 0; + o.attr("x4") = 1; + +#define TEST_ATTR_INPLACE(index, op, n, r1, r2) \ + o.attr("x" #index) op##= n; \ + if (o.attr("x" #index) != r1) \ + return false; \ + o.attr("x" #index) op##= object(n); \ + if (o.attr("x" #index) != r2) \ + return false; + + TEST_ATTR_INPLACE(0,+,7,7,14) + TEST_ATTR_INPLACE(1,-,2,-1,-3) + TEST_ATTR_INPLACE(2,*,3,6,18) + TEST_ATTR_INPLACE(2,/,2,9,4) + TEST_ATTR_INPLACE(0,%,4,2,2) + o.attr("x0") += 1; + TEST_ATTR_INPLACE(0,<<,2,12,48) + TEST_ATTR_INPLACE(0,>>,1,24,12) + o.attr("x4") = 15; + TEST_ATTR_INPLACE(4,&,(16+4+1),5,5) + TEST_ATTR_INPLACE(0,^,1,13,12) + TEST_ATTR_INPLACE(0,|,1,13,13) + + if (l[0] != o.attr("x0")) + return false; + if (l[1] != o.attr("x1")) + return false; + if (l[2] != o.attr("x2")) + return false; + if (l[3] != o.attr("x3")) + return false; + if (l[4] != o.attr("x4")) + return false; + + // set item 5 to be a list, by calling l.__class__ + l[5] = l.attr("__class__")(); + // append an element + l[5].attr("append")(2); + // Check its value + if (l[5][0] != 2) + return false; + + return true; +} + +BOOST_PYTHON_MODULE(object_ext) +{ + class_("NotCopyable", no_init); + + def("ref_to_noncopyable", ref_to_noncopyable); + def("call_object_3", call_object_3); + def("message", message); + def("number", number); + + def("obj_getattr", obj_getattr); + def("obj_objgetattr", obj_objgetattr); + def("obj_const_getattr", obj_const_getattr); + def("obj_const_objgetattr", obj_const_objgetattr); + def("obj_setattr", obj_setattr); + def("obj_objsetattr", obj_objsetattr); + def("obj_setattr42", obj_setattr42); + def("obj_objsetattr42", obj_objsetattr42); + def("obj_moveattr", obj_moveattr); + def("obj_objmoveattr", obj_objmoveattr); + def("obj_delattr", obj_delattr); + def("obj_objdelattr", obj_objdelattr); + + def("obj_getitem", obj_getitem); + def("obj_getitem3", obj_getitem); + def("obj_const_getitem", obj_const_getitem); + def("obj_setitem", obj_setitem); + def("obj_setitem42", obj_setitem42); + def("obj_moveitem", obj_moveitem); + def("obj_moveitem2", obj_moveitem2); + + def("test", test); + def("test_not", test_not); + + def("test_attr", test_attr); + def("test_objattr", test_objattr); + def("test_not_attr", test_not_attr); + def("test_not_objattr", test_not_objattr); + + def("test_item", test_item); + def("test_not_item", test_not_item); + + def("test_call", test_call); + def("check_binary_operators", check_binary_operators); + def("check_inplace", check_inplace); + def("check_string_slice", check_string_slice); + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/object.py b/pxr/external/boost/python/test/object.py new file mode 100644 index 0000000000..cf6c2de0c5 --- /dev/null +++ b/pxr/external/boost/python/test/object.py @@ -0,0 +1,181 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from object_ext import * + +>>> type(ref_to_noncopyable()) + + +>>> def print1(x): +... print(x) +>>> call_object_3(print1) +3 +>>> message() +'hello, world!' +>>> number() +42 + +>>> test('hi') +1 +>>> test(None) +0 +>>> test_not('hi') +0 +>>> test_not(0) +1 + + Attributes + +>>> class X: pass +... +>>> x = X() + +>>> try: obj_getattr(x, 'foo') +... except AttributeError: pass +... else: print('expected an exception') +>>> try: obj_objgetattr(x, 'objfoo') +... except AttributeError: pass +... else: print('expected an exception') + +>>> obj_setattr(x, 'foo', 1) +>>> x.foo +1 +>>> obj_objsetattr(x, 'objfoo', 1) +>>> try:obj_objsetattr(x, 1) +... except TypeError: pass +... else: print('expected an exception') +>>> x.objfoo +1 +>>> obj_getattr(x, 'foo') +1 +>>> obj_objgetattr(x, 'objfoo') +1 +>>> try:obj_objgetattr(x, 1) +... except TypeError: pass +... else: print('expected an exception') +>>> obj_const_getattr(x, 'foo') +1 +>>> obj_const_objgetattr(x, 'objfoo') +1 +>>> obj_setattr42(x, 'foo') +>>> x.foo +42 +>>> obj_objsetattr42(x, 'objfoo') +>>> x.objfoo +42 +>>> obj_moveattr(x, 'foo', 'bar') +>>> x.bar +42 +>>> obj_objmoveattr(x, 'objfoo', 'objbar') +>>> x.objbar +42 +>>> test_attr(x, 'foo') +1 +>>> test_objattr(x, 'objfoo') +1 +>>> test_not_attr(x, 'foo') +0 +>>> test_not_objattr(x, 'objfoo') +0 +>>> x.foo = None +>>> test_attr(x, 'foo') +0 +>>> x.objfoo = None +>>> test_objattr(x, 'objfoo') +0 +>>> test_not_attr(x, 'foo') +1 +>>> test_not_objattr(x, 'objfoo') +1 +>>> obj_delattr(x, 'foo') +>>> obj_objdelattr(x, 'objfoo') +>>> try:obj_delattr(x, 'foo') +... except AttributeError: pass +... else: print('expected an exception') +>>> try:obj_objdelattr(x, 'objfoo') +... except AttributeError: pass +... else: print('expected an exception') + + Items + +>>> d = {} +>>> obj_setitem(d, 'foo', 1) +>>> d['foo'] +1 +>>> obj_getitem(d, 'foo') +1 +>>> obj_const_getitem(d, 'foo') +1 +>>> obj_setitem42(d, 'foo') +>>> obj_getitem(d, 'foo') +42 +>>> d['foo'] +42 +>>> obj_moveitem(d, 'foo', 'bar') +>>> d['bar'] +42 +>>> obj_moveitem2(d, 'bar', d, 'baz') +>>> d['baz'] +42 +>>> test_item(d, 'foo') +1 +>>> test_not_item(d, 'foo') +0 +>>> d['foo'] = None +>>> test_item(d, 'foo') +0 +>>> test_not_item(d, 'foo') +1 + + Slices + +>>> assert check_string_slice() + + Operators + +>>> def print_args(*args, **kwds): +... print(args, kwds) +>>> test_call(print_args, (0, 1, 2, 3), {'a':'A'}) +(0, 1, 2, 3) {'a': 'A'} + + +>>> assert check_binary_operators() + +>>> class X: pass +... +>>> assert check_inplace(list(range(3)), X()) + + + Now make sure that object is actually managing reference counts + +>>> import weakref +>>> class Z: pass +... +>>> z = Z() +>>> def death(r): print('death') +... +>>> r = weakref.ref(z, death) +>>> z.foo = 1 +>>> obj_getattr(z, 'foo') +1 +>>> del z +death +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/object_fail1.cpp b/pxr/external/boost/python/test/object_fail1.cpp new file mode 100644 index 0000000000..6bb2eda5c1 --- /dev/null +++ b/pxr/external/boost/python/test/object_fail1.cpp @@ -0,0 +1,11 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include + +int f(boost::python::object const& x) +{ + x._("hello") = 1; + return 0; +} diff --git a/pxr/external/boost/python/test/object_manager.cpp b/pxr/external/boost/python/test/object_manager.cpp new file mode 100644 index 0000000000..e3608c1f1d --- /dev/null +++ b/pxr/external/boost/python/test/object_manager.cpp @@ -0,0 +1,33 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include + +using namespace boost::python; +using namespace boost::python::converter; + +struct X {}; + +int main() +{ + BOOST_STATIC_ASSERT(is_object_manager >::value); + BOOST_STATIC_ASSERT(!is_object_manager::value); + BOOST_STATIC_ASSERT(!is_object_manager::value); + + BOOST_STATIC_ASSERT(is_reference_to_object_manager&>::value); + BOOST_STATIC_ASSERT(is_reference_to_object_manager const&>::value); + BOOST_STATIC_ASSERT(is_reference_to_object_manager volatile&>::value); + BOOST_STATIC_ASSERT(is_reference_to_object_manager const volatile&>::value); + + BOOST_STATIC_ASSERT(!is_reference_to_object_manager >::value); + BOOST_STATIC_ASSERT(!is_reference_to_object_manager::value); + BOOST_STATIC_ASSERT(!is_reference_to_object_manager::value); + BOOST_STATIC_ASSERT(!is_reference_to_object_manager::value); + + return 0; +} + diff --git a/pxr/external/boost/python/test/opaque.cpp b/pxr/external/boost/python/test/opaque.cpp new file mode 100644 index 0000000000..f15e9458f4 --- /dev/null +++ b/pxr/external/boost/python/test/opaque.cpp @@ -0,0 +1,76 @@ +// Copyright David Abrahams and Gottfried Ganssauge 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +# include +# include +# include +# include + +typedef struct opaque_ *opaque; +typedef struct opaque2_ *opaque2; + +opaque the_op = ((opaque) 0x47110815); +opaque2 the_op2 = ((opaque2) 0x08154711); + +opaque get() { return the_op; } + +void use(opaque op) +{ + if (op != the_op) + throw std::runtime_error (std::string ("failed")); +} + +int useany(opaque op) +{ + return op ? 1 : 0; +} + +opaque getnull() +{ + return 0; +} + +void failuse (opaque op) +{ + if (op == the_op) + throw std::runtime_error (std::string ("success")); +} + +opaque2 get2 () { return the_op2; } + +void use2 (opaque2 op) +{ + if (op != the_op2) + throw std::runtime_error (std::string ("failed")); +} + +void failuse2 (opaque2 op) +{ + if (op == the_op2) + throw std::runtime_error (std::string ("success")); +} + +BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) +BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque2_) + +namespace bpl = boost::python; + +BOOST_PYTHON_MODULE(opaque_ext) +{ + bpl::def ( + "get", &::get, bpl::return_value_policy()); + bpl::def ("use", &::use); + bpl::def ("useany", &::useany); + bpl::def ("getnull", &::getnull, bpl::return_value_policy()); + bpl::def ("failuse", &::failuse); + + bpl::def ( + "get2", + &::get2, + bpl::return_value_policy()); + bpl::def ("use2", &::use2); + bpl::def ("failuse2", &::failuse2); +} + +# include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/opaque.py b/pxr/external/boost/python/test/opaque.py new file mode 100644 index 0000000000..9f5663723d --- /dev/null +++ b/pxr/external/boost/python/test/opaque.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +# Copyright Gottfried Ganßauge 2003..2006. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + +""" +>>> from opaque_ext import * + + + Check for correct conversion + +>>> use(get()) + + Check that None is converted to a NULL opaque pointer + +>>> useany(get()) +1 +>>> useany(None) +0 + + Check that we don't lose type information by converting NULL + opaque pointers to None + +>>> assert getnull() is None +>>> useany(getnull()) +0 + +>>> failuse(get()) +Traceback (most recent call last): + ... +RuntimeError: success + + Check that there is no conversion from integers ... + +>>> try: use(0) +... except TypeError: pass +... else: print('expected a TypeError') + + ... and from strings to opaque objects + +>>> try: use("") +... except TypeError: pass +... else: print('expected a TypeError') + + Now check the same for another opaque pointer type + +>>> use2(get2()) +>>> failuse2(get2()) +Traceback (most recent call last): + ... +RuntimeError: success +>>> try: use2(0) +... except TypeError: pass +... else: print('expected a TypeError') +>>> try: use2("") +... except TypeError: pass +... else: print('expected a TypeError') + + Check that opaque types are distinct + +>>> try: use(get2()) +... except TypeError: pass +... else: print('expected a TypeError') +>>> try: use2(get()) +... except TypeError: pass +... else: print('expected a TypeError') + + This used to result in a segmentation violation + +>>> type(get()) != type (get2()) +1 +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/operators.cpp b/pxr/external/boost/python/test/operators.cpp new file mode 100644 index 0000000000..c58f2b005f --- /dev/null +++ b/pxr/external/boost/python/test/operators.cpp @@ -0,0 +1,175 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include "test_class.hpp" +#include +#include +#include +#include +//#include +// Just use math.h here; trying to use std::pow() causes too much +// trouble for non-conforming compilers and libraries. +#include + +#if __GNUC__ != 2 +# include +#else +# include +#endif + +using namespace boost::python; + + +using namespace boost::python; + +struct X : test_class<> +{ + typedef test_class<> base_t; + + X(int x) : base_t(x) {} + X const operator+(X const& r) const { return X(value() + r.value()); } + +// typedef int (X::*safe_bool)() const; +// operator safe_bool() const { return value() != 0 ? &X::value : 0; } +}; + +X operator-(X const& l, X const& r) { return X(l.value() - r.value()); } +X operator-(int l, X const& r) { return X(l - r.value()); } +X operator-(X const& l, int r) { return X(l.value() - r); } + +X operator-(X const& x) { return X(-x.value()); } + +X& operator-=(X& l, X const& r) { l.set(l.value() - r.value()); return l; } + +bool operator<(X const& x, X const& y) { return x.value() < y.value(); } +bool operator<(X const& x, int y) { return x.value() < y; } +bool operator<(int x, X const& y) { return x < y.value(); } + +X abs(X x) { return X(x.value() < 0 ? -x.value() : x.value()); } + +X pow(X x, int y) +{ + return X(int(pow(double(x.value()), double(y)))); +} + +X pow(X x, X y) +{ + return X(int(pow(double(x.value()), double(y.value())))); +} + +int pow(int x, X y) +{ + return int(pow(double(x), double(y.value()))); +} + +std::ostream& operator<<(std::ostream& s, X const& x) +{ + return s << x.value(); +} + +struct number + : boost::integer_arithmetic +{ + explicit number(long x_) : x(x_) {} + operator long() const { return x; } + + template + number& operator+=(T const& rhs) + { x += rhs; return *this; } + + template + number& operator-=(T const& rhs) + { x -= rhs; return *this; } + + template + number& operator*=(T const& rhs) + { x *= rhs; return *this; } + + template + number& operator/=(T const& rhs) + { x /= rhs; return *this; } + + template + number& operator%=(T const& rhs) + { x %= rhs; return *this; } + + long x; +}; + +BOOST_PYTHON_MODULE(operators_ext) +{ + class_("X", init()) + .def("value", &X::value) + .def(self + self) + .def(self - self) + .def(self - int()) + .def(other() - self) + .def(-self) + .def(self < other()) + .def(self < self) + .def(1 < self) + .def(self -= self) + + .def(abs(self)) + .def(str(self)) + + .def(pow(self,self)) + .def(pow(self,int())) + .def(pow(int(),self)) + .def( + !self + // "not self" is legal here but causes friction on a few + // nonconforming compilers; it's cute because it looks + // like python, but doing it here doesn't prove much and + // just causes tests to fail or complicated workarounds to + // be enacted. + ) + ; + + class_("number", init()) + // interoperate with self + .def(self += self) + .def(self + self) + .def(self -= self) + .def(self - self) + .def(self *= self) + .def(self * self) + .def(self /= self) + .def(self / self) + .def(self %= self) + .def(self % self) + + // Convert to Python int + .def(int_(self)) + + // interoperate with long + .def(self += long()) + .def(self + long()) + .def(long() + self) + .def(self -= long()) + .def(self - long()) + .def(long() - self) + .def(self *= long()) + .def(self * long()) + .def(long() * self) + .def(self /= long()) + .def(self / long()) + .def(long() / self) + .def(self %= long()) + .def(self % long()) + .def(long() % self) + ; + + class_ >("Z", init()) + .def(int_(self)) + .def(float_(self)) + .def(complex_(self)) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/operators.py b/pxr/external/boost/python/test/operators.py new file mode 100644 index 0000000000..5b369803c6 --- /dev/null +++ b/pxr/external/boost/python/test/operators.py @@ -0,0 +1,102 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from operators_ext import * + + Check __nonzero__ support + +>>> assert X(2) +>>> assert not X(0) + + ---- + +>>> x = X(42) +>>> x.value() +42 +>>> y = x - X(5) +>>> y.value() +37 +>>> y = x - 4 +>>> y.value() +38 +>>> y = 3 - x +>>> y.value() +-39 +>>> (-y).value() +39 + +>>> (x + y).value() +3 + +>>> abs(y).value() +39 + +>>> x < 10 +0 +>>> x < 43 +1 + +>>> 10 < x +1 +>>> 43 < x +0 + +>>> x < y +0 +>>> y < x +1 + + ------ +>>> x > 10 +1 +>>> x > 43 +0 + +>>> 10 > x +0 +>>> 43 > x +1 + +>>> x > y +1 +>>> y > x +0 + +>>> y = x - 5 +>>> x -= y +>>> x.value() +5 +>>> str(x) +'5' + +>>> z = Z(10) +>>> int(z) +10 +>>> float(z) +10.0 +>>> complex(z) +(10+0j) + +>>> pow(2,x) +32 +>>> pow(x,2).value() +25 +>>> pow(X(2),x).value() +32 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/operators_wrapper.cpp b/pxr/external/boost/python/test/operators_wrapper.cpp new file mode 100644 index 0000000000..12f30048d0 --- /dev/null +++ b/pxr/external/boost/python/test/operators_wrapper.cpp @@ -0,0 +1,42 @@ +#include "boost/python.hpp" +#include + +struct vector +{ + virtual ~vector() {} + + vector operator+( const vector& ) const + { return vector(); } + + vector& operator+=( const vector& ) + { return *this; } + + vector operator-() const + { return *this; } +}; + +struct dvector : vector +{}; + +using namespace boost::python; + +struct vector_wrapper + : vector, wrapper< vector > +{ + vector_wrapper(vector const&) {} + vector_wrapper() {} +}; + +BOOST_PYTHON_MODULE( operators_wrapper_ext ) +{ + class_< vector_wrapper >( "vector" ) + .def( self + self ) + .def( self += self ) + .def( -self ) + ; + + scope().attr("v") = vector(); + std::auto_ptr dp(new dvector); + register_ptr_to_python< std::auto_ptr >(); + scope().attr("d") = dp; +} diff --git a/pxr/external/boost/python/test/operators_wrapper.py b/pxr/external/boost/python/test/operators_wrapper.py new file mode 100644 index 0000000000..6c889b0a39 --- /dev/null +++ b/pxr/external/boost/python/test/operators_wrapper.py @@ -0,0 +1,11 @@ +from operators_wrapper_ext import * + +class D2(vector): pass +d2 = D2() + +for lhs in (v,d,d2): + -lhs + for rhs in (v,d,d2): + lhs + rhs + lhs += rhs + diff --git a/pxr/external/boost/python/test/pickle1.cpp b/pxr/external/boost/python/test/pickle1.cpp new file mode 100644 index 0000000000..cc4ad67952 --- /dev/null +++ b/pxr/external/boost/python/test/pickle1.cpp @@ -0,0 +1,62 @@ +// Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + This example shows how to make an Extension Class "pickleable". + + The world class below can be fully restored by passing the + appropriate argument to the constructor. Therefore it is sufficient + to define the pickle interface method __getinitargs__. + + For more information refer to boost/libs/python/doc/pickle.html. + */ + +#include +#include +#include +#include + +#include + +namespace boost_python_test { + + // A friendly class. + class world + { + private: + std::string country; + public: + world(const std::string& _country) { + this->country = _country; + } + std::string greet() const { return "Hello from " + country + "!"; } + std::string get_country() const { return country; } + }; + + struct world_pickle_suite : boost::python::pickle_suite + { + static + boost::python::tuple + getinitargs(const world& w) + { + return boost::python::make_tuple(w.get_country()); + } + }; + + // To support test of "pickling not enabled" error message. + struct noop {}; +} + +BOOST_PYTHON_MODULE(pickle1_ext) +{ + using namespace boost::python; + using namespace boost_python_test; + class_("world", init()) + .def("greet", &world::greet) + .def_pickle(world_pickle_suite()) + ; + + // To support test of "pickling not enabled" error message. + class_("noop"); +} diff --git a/pxr/external/boost/python/test/pickle1.py b/pxr/external/boost/python/test/pickle1.py new file mode 100644 index 0000000000..b8f4efd9b0 --- /dev/null +++ b/pxr/external/boost/python/test/pickle1.py @@ -0,0 +1,41 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +r'''>>> import pickle1_ext + >>> import pickle + >>> pickle1_ext.world.__module__ + 'pickle1_ext' + >>> pickle1_ext.world.__safe_for_unpickling__ + 1 + >>> pickle1_ext.world.__name__ + 'world' + >>> pickle1_ext.world('Hello').__reduce__() + (, ('Hello',)) + >>> wd = pickle1_ext.world('California') + >>> pstr = pickle.dumps(wd) + >>> wl = pickle.loads(pstr) + >>> print(wd.greet()) + Hello from California! + >>> print(wl.greet()) + Hello from California! + + >>> noop = pickle1_ext.noop() + >>> try: pickle.dumps(noop) + ... except RuntimeError as e: print(str(e)[:55]) + Pickling of "pickle1_ext.noop" instances is not enabled +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/pickle2.cpp b/pxr/external/boost/python/test/pickle2.cpp new file mode 100644 index 0000000000..c9610946e4 --- /dev/null +++ b/pxr/external/boost/python/test/pickle2.cpp @@ -0,0 +1,97 @@ +// Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + This example shows how to make an Extension Class "pickleable". + + The world class below contains member data (secret_number) that + cannot be restored by any of the constructors. Therefore it is + necessary to provide the __getstate__/__setstate__ pair of pickle + interface methods. + + For simplicity, the __dict__ is not included in the result of + __getstate__. This is not generally recommended, but a valid + approach if it is anticipated that the object's __dict__ will + always be empty. Note that safety guards are provided to catch + the cases where this assumption is not true. + + pickle3.cpp shows how to include the object's __dict__ in the + result of __getstate__. + + For more information refer to boost/libs/python/doc/pickle.html. + */ + +#include +#include +#include +#include +#include + +namespace boost_python_test { + + // A friendly class. + class world + { + public: + world(const std::string& _country) : secret_number(0) { + this->country = _country; + } + std::string greet() const { return "Hello from " + country + "!"; } + std::string get_country() const { return country; } + void set_secret_number(int number) { secret_number = number; } + int get_secret_number() const { return secret_number; } + private: + std::string country; + int secret_number; + }; + + struct world_pickle_suite : boost::python::pickle_suite + { + static + boost::python::tuple + getinitargs(const world& w) + { + return boost::python::make_tuple(w.get_country()); + } + + static + boost::python::tuple + getstate(const world& w) + { + return boost::python::make_tuple(w.get_secret_number()); + } + + static + void + setstate(world& w, boost::python::tuple state) + { + using namespace boost::python; + if (len(state) != 1) + { + PyErr_SetObject(PyExc_ValueError, + ("expected 1-item tuple in call to __setstate__; got %s" + % state).ptr() + ); + throw_error_already_set(); + } + + long number = extract(state[0]); + if (number != 42) + w.set_secret_number(number); + } + }; + +} + +BOOST_PYTHON_MODULE(pickle2_ext) +{ + using namespace boost_python_test; + boost::python::class_( + "world", boost::python::init()) + .def("greet", &world::greet) + .def("get_secret_number", &world::get_secret_number) + .def("set_secret_number", &world::set_secret_number) + .def_pickle(world_pickle_suite()) + ; +} diff --git a/pxr/external/boost/python/test/pickle2.py b/pxr/external/boost/python/test/pickle2.py new file mode 100644 index 0000000000..4c11ef3a85 --- /dev/null +++ b/pxr/external/boost/python/test/pickle2.py @@ -0,0 +1,52 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +r'''>>> import pickle2_ext + >>> import pickle + >>> pickle2_ext.world.__module__ + 'pickle2_ext' + >>> pickle2_ext.world.__safe_for_unpickling__ + 1 + >>> pickle2_ext.world.__name__ + 'world' + >>> pickle2_ext.world('Hello').__reduce__() + (, ('Hello',), (0,)) + >>> for number in (24, 42): + ... wd = pickle2_ext.world('California') + ... wd.set_secret_number(number) + ... pstr = pickle.dumps(wd) + ... wl = pickle.loads(pstr) + ... print(wd.greet(), wd.get_secret_number()) + ... print(wl.greet(), wl.get_secret_number()) + Hello from California! 24 + Hello from California! 24 + Hello from California! 42 + Hello from California! 0 + +# Now show that the __dict__ is not taken care of. + >>> wd = pickle2_ext.world('California') + >>> wd.x = 1 + >>> wd.__dict__ + {'x': 1} + >>> try: pstr = pickle.dumps(wd) + ... except RuntimeError as err: print(err) + ... + Incomplete pickle support (__getstate_manages_dict__ not set) +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/pickle3.cpp b/pxr/external/boost/python/test/pickle3.cpp new file mode 100644 index 0000000000..7afe2dbfa8 --- /dev/null +++ b/pxr/external/boost/python/test/pickle3.cpp @@ -0,0 +1,107 @@ +// Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + This example shows how to make an Extension Class "pickleable". + + The world class below contains member data (secret_number) that + cannot be restored by any of the constructors. Therefore it is + necessary to provide the __getstate__/__setstate__ pair of pickle + interface methods. + + The object's __dict__ is included in the result of __getstate__. + This requires more code (compare with pickle2.cpp), but is + unavoidable if the object's __dict__ is not always empty. + + For more information refer to boost/libs/python/doc/pickle.html. + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace boost_python_test { + + // A friendly class. + class world + { + public: + world(const std::string& _country) : secret_number(0) { + this->country = _country; + } + std::string greet() const { return "Hello from " + country + "!"; } + std::string get_country() const { return country; } + void set_secret_number(int number) { secret_number = number; } + int get_secret_number() const { return secret_number; } + private: + std::string country; + int secret_number; + }; + + struct world_pickle_suite : boost::python::pickle_suite + { + static + boost::python::tuple + getinitargs(const world& w) + { + return boost::python::make_tuple(w.get_country()); + } + + static + boost::python::tuple + getstate(boost::python::object w_obj) + { + world const& w = boost::python::extract(w_obj)(); + + return boost::python::make_tuple( + w_obj.attr("__dict__"), + w.get_secret_number()); + } + + static + void + setstate(boost::python::object w_obj, boost::python::tuple state) + { + using namespace boost::python; + world& w = extract(w_obj)(); + + if (len(state) != 2) + { + PyErr_SetObject(PyExc_ValueError, + ("expected 2-item tuple in call to __setstate__; got %s" + % state).ptr() + ); + throw_error_already_set(); + } + + // restore the object's __dict__ + dict d = extract(w_obj.attr("__dict__"))(); + d.update(state[0]); + + // restore the internal state of the C++ object + long number = extract(state[1]); + if (number != 42) + w.set_secret_number(number); + } + + static bool getstate_manages_dict() { return true; } + }; + +} + +BOOST_PYTHON_MODULE(pickle3_ext) +{ + using namespace boost_python_test; + boost::python::class_( + "world", boost::python::init()) + .def("greet", &world::greet) + .def("get_secret_number", &world::get_secret_number) + .def("set_secret_number", &world::set_secret_number) + .def_pickle(world_pickle_suite()) + ; +} diff --git a/pxr/external/boost/python/test/pickle3.py b/pxr/external/boost/python/test/pickle3.py new file mode 100644 index 0000000000..391e3d00f1 --- /dev/null +++ b/pxr/external/boost/python/test/pickle3.py @@ -0,0 +1,47 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +r'''>>> import pickle3_ext + >>> import pickle + >>> pickle3_ext.world.__module__ + 'pickle3_ext' + >>> pickle3_ext.world.__safe_for_unpickling__ + 1 + >>> pickle3_ext.world.__getstate_manages_dict__ + 1 + >>> pickle3_ext.world.__name__ + 'world' + >>> pickle3_ext.world('Hello').__reduce__() + (, ('Hello',), ({}, 0)) + >>> for number in (24, 42): + ... wd = pickle3_ext.world('California') + ... wd.set_secret_number(number) + ... wd.x = 2 * number + ... wd.y = 'y' * number + ... wd.z = 3. * number + ... pstr = pickle.dumps(wd) + ... wl = pickle.loads(pstr) + ... print(wd.greet(), wd.get_secret_number(), wd.x, wd.y, wd.z) + ... print(wl.greet(), wl.get_secret_number(), wl.x, wl.y, wl.z) + Hello from California! 24 48 yyyyyyyyyyyyyyyyyyyyyyyy 72.0 + Hello from California! 24 48 yyyyyyyyyyyyyyyyyyyyyyyy 72.0 + Hello from California! 42 84 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 126.0 + Hello from California! 0 84 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 126.0 +''' + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/pickle4.cpp b/pxr/external/boost/python/test/pickle4.cpp new file mode 100644 index 0000000000..1374cc7dc2 --- /dev/null +++ b/pxr/external/boost/python/test/pickle4.cpp @@ -0,0 +1,44 @@ +// Copyright Ralf W. Grosse-Kunstleve 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +/* + This example shows how to enable pickling without using the + pickle_suite. The pickling interface (__getinitargs__) is + implemented in Python. + + For more information refer to boost/libs/python/doc/pickle.html. + */ + +#include +#include + +#include + +namespace boost_python_test { + + // A friendly class. + class world + { + private: + std::string country; + public: + world(const std::string& _country) { + this->country = _country; + } + std::string greet() const { return "Hello from " + country + "!"; } + std::string get_country() const { return country; } + }; + +} + +BOOST_PYTHON_MODULE(pickle4_ext) +{ + using namespace boost::python; + using namespace boost_python_test; + class_("world", init()) + .enable_pickling() + .def("greet", &world::greet) + .def("get_country", &world::get_country) + ; +} diff --git a/pxr/external/boost/python/test/pickle4.py b/pxr/external/boost/python/test/pickle4.py new file mode 100644 index 0000000000..be813bbb13 --- /dev/null +++ b/pxr/external/boost/python/test/pickle4.py @@ -0,0 +1,39 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +r'''>>> import pickle4_ext + >>> import pickle + >>> def world_getinitargs(self): + ... return (self.get_country(),) + >>> pickle4_ext.world.__getinitargs__ = world_getinitargs + >>> pickle4_ext.world.__module__ + 'pickle4_ext' + >>> pickle4_ext.world.__safe_for_unpickling__ + 1 + >>> pickle4_ext.world.__name__ + 'world' + >>> pickle4_ext.world('Hello').__reduce__() + (, ('Hello',)) + >>> wd = pickle4_ext.world('California') + >>> pstr = pickle.dumps(wd) + >>> wl = pickle.loads(pstr) + >>> print(wd.greet()) + Hello from California! + >>> print(wl.greet()) + Hello from California! +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/pointee.cpp b/pxr/external/boost/python/test/pointee.cpp new file mode 100644 index 0000000000..2aa5dc3d88 --- /dev/null +++ b/pxr/external/boost/python/test/pointee.cpp @@ -0,0 +1,34 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include + +struct A; + +int main() +{ + BOOST_STATIC_ASSERT( + (boost::python::detail::is_same< + boost::python::pointee >::type + , char** + >::value)); + + BOOST_STATIC_ASSERT( + (boost::python::detail::is_same< + boost::python::pointee >::type + , A>::value)); + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + BOOST_STATIC_ASSERT( + (boost::python::detail::is_same< + boost::python::pointee::type + , char + >::value)); +#endif + return 0; +} diff --git a/pxr/external/boost/python/test/pointer_type_id_test.cpp b/pxr/external/boost/python/test/pointer_type_id_test.cpp new file mode 100644 index 0000000000..02e168c7e3 --- /dev/null +++ b/pxr/external/boost/python/test/pointer_type_id_test.cpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include + +#include +#include + +int main() +{ + using namespace boost::python::converter; + + boost::python::type_info x + = boost::python::type_id(); + + + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + BOOST_TEST(pointer_type_id() == x); + + return boost::report_errors(); +} diff --git a/pxr/external/boost/python/test/pointer_vector.cpp b/pxr/external/boost/python/test/pointer_vector.cpp new file mode 100644 index 0000000000..08cd486193 --- /dev/null +++ b/pxr/external/boost/python/test/pointer_vector.cpp @@ -0,0 +1,52 @@ +// Copyright Joel de Guzman 2005-2006. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +using namespace boost::python; + +class Abstract +{ +public: + virtual ~Abstract() {}; // silence compiler warningsa + virtual std::string f() =0; +}; + +class Concrete1 : public Abstract +{ +public: + virtual std::string f() { return "harru"; } +}; + +typedef std::vector ListOfObjects; + +class DoesSomething +{ +public: + DoesSomething() {} + + ListOfObjects returnList() + { + ListOfObjects lst; + lst.push_back(new Concrete1()); return lst; + } +}; + +BOOST_PYTHON_MODULE(pointer_vector_ext) +{ +class_("Abstract", no_init) + .def("f", &Abstract::f) + ; + +class_("ListOfObjects") + .def( vector_indexing_suite() ) + ; + +class_("DoesSomething") + .def("returnList", &DoesSomething::returnList) + ; +} + + diff --git a/pxr/external/boost/python/test/pointer_vector.py b/pxr/external/boost/python/test/pointer_vector.py new file mode 100644 index 0000000000..234eff2c0b --- /dev/null +++ b/pxr/external/boost/python/test/pointer_vector.py @@ -0,0 +1,31 @@ +# Copyright Joel de Guzman 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + +>>> import pointer_vector_ext +>>> d = pointer_vector_ext.DoesSomething() +>>> lst = d.returnList() +>>> lst[0].f(); +'harru' + +''' + + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print('running...') + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + + + diff --git a/pxr/external/boost/python/test/polymorphism.cpp b/pxr/external/boost/python/test/polymorphism.cpp new file mode 100644 index 0000000000..02713ae266 --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism.cpp @@ -0,0 +1,162 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +struct Callback +{ + Callback(PyObject* o) : mSelf(o) {} + PyObject* mSelf; +}; + +struct P +{ + virtual ~P(){} + virtual std::string f() = 0; + std::string g() { return "P::g()"; } +}; + +struct PCallback : P, Callback +{ + PCallback (PyObject* self) : Callback(self) {} + + std::string f() + { + return call_method(mSelf, "f"); + } +}; + +struct Q : virtual P +{ + std::string f() { return "Q::f()"; } +}; + +struct A +{ + virtual ~A(){} + virtual std::string f() { return "A::f()"; } +}; + +struct ACallback : A, Callback +{ + ACallback (PyObject* self) : Callback(self) {} + + + std::string f() + { + return call_method(mSelf, "f"); + } + + std::string default_f() + { + return A::f(); + } +}; + +struct B : A +{ + virtual std::string f() { return "B::f()"; } +}; + +struct C : A +{ + virtual std::string f() { return "C::f()"; } +}; + +struct D : A +{ + virtual std::string f() { return "D::f()"; } + std::string g() { return "D::g()"; } +}; + +struct DCallback : D, Callback +{ + DCallback (PyObject* self) : Callback(self) {} + + std::string f() + { + return call_method(mSelf, "f"); + } + + std::string default_f() + { + return A::f(); + } +}; + + +A& getBCppObj () +{ + static B b; + return b; +} + +std::string call_f(A& a) { return a.f(); } + +A* factory(unsigned choice) +{ + switch (choice % 3) + { + case 0: return new A; + break; + case 1: return new B; + break; + default: return new C; + break; + } +} + +C& getCCppObj () +{ + static C c; + return c; +} + +A* pass_a(A* x) { return x; } + +BOOST_PYTHON_MODULE_INIT(polymorphism_ext) +{ + class_("A") + .def("f", &A::f, &ACallback::default_f) + ; + + def("getBCppObj", getBCppObj, return_value_policy()); + + class_,boost::noncopyable>("C") + .def("f", &C::f) + ; + + class_,DCallback,boost::noncopyable>("D") + .def("f", &D::f, &DCallback::default_f) + .def("g", &D::g) + ; + + def("pass_a", &pass_a, return_internal_reference<>()); + + def("getCCppObj", getCCppObj, return_value_policy()); + + def("factory", factory, return_value_policy()); + + def("call_f", call_f); + + class_("P") + .def("f", pure_virtual(&P::f)) + ; + + class_ >("Q") + .def("g", &P::g) // make sure virtual inheritance doesn't interfere + ; +} + +//#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/polymorphism.py b/pxr/external/boost/python/test/polymorphism.py new file mode 100644 index 0000000000..e3c66ea279 --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism.py @@ -0,0 +1,74 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +import unittest +from polymorphism_ext import * + +class PolymorphTest(unittest.TestCase): + + def testReturnCpp(self): + + # Python Created Object With Same Id As + # Cpp Created B Object + # b = B(872) + + # Get Reference To Cpp Created B Object + a = getBCppObj() + + # Python Created B Object and Cpp B Object + # Should have same result by calling f() + self.assertEqual ('B::f()', a.f()) + self.assertEqual ('B::f()', call_f(a)) + self.assertEqual ('A::f()', call_f(A())) + + def test_references(self): + # B is not exposed to Python + a = getBCppObj() + self.assertEqual(type(a), A) + + # C is exposed to Python + c = getCCppObj() + self.assertEqual(type(c), C) + + def test_factory(self): + self.assertEqual(type(factory(0)), A) + self.assertEqual(type(factory(1)), A) + self.assertEqual(type(factory(2)), C) + + def test_return_py(self): + + class X(A): + def f(self): + return 'X.f' + + x = X() + + self.assertEqual ('X.f', x.f()) + self.assertEqual ('X.f', call_f(x)) + + def test_wrapper_downcast(self): + a = pass_a(D()) + self.assertEqual('D::g()', a.g()) + + def test_pure_virtual(self): + p = P() + self.assertRaises(RuntimeError, p.f) + + q = Q() + self.assertEqual ('Q::f()', q.f()) + + class R(P): + def f(self): + return 'R.f' + + r = R() + self.assertEqual ('R.f', r.f()) + + +if __name__ == "__main__": + + # remove the option which upsets unittest + import sys + sys.argv = [ x for x in sys.argv if x != '--broken-auto-ptr' ] + + unittest.main() diff --git a/pxr/external/boost/python/test/polymorphism2.cpp b/pxr/external/boost/python/test/polymorphism2.cpp new file mode 100644 index 0000000000..8aefbc3af3 --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism2.cpp @@ -0,0 +1,172 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef HELD_BY_AUTO_PTR +# define HELD_PTR(X) , std::auto_ptr< X > +#else +# define HELD_PTR(X) +#endif + +using namespace boost::python; + +struct P +{ + virtual ~P(){} + virtual char const* f() = 0; + char const* g() { return "P::g()"; } +}; + +struct PCallback : P, wrapper

    +{ + char const* f() + { +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + return call(this->get_override("f").ptr()); +#else + return this->get_override("f")(); +#endif + } +}; + +struct Q : virtual P +{ + char const* f() { return "Q::f()"; } +}; + +struct A +{ + virtual ~A(){} + virtual char const* f() { return "A::f()"; } +}; + +struct ACallback : A, wrapper +{ + char const* f() + { + if (override f = this->get_override("f")) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + return call(f.ptr()); +#else + return f(); +#endif + + return A::f(); + } + + char const* default_f() { return this->A::f(); } +}; + +struct B : A +{ + virtual char const* f() { return "B::f()"; } +}; + +struct C : A +{ + virtual char const* f() { return "C::f()"; } +}; + +struct D : A +{ + virtual char const* f() { return "D::f()"; } + char const* g() { return "D::g()"; } +}; + +struct DCallback : D, wrapper +{ + char const* f() + { + if (override f = this->get_override("f")) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + return call(f.ptr()); +#else + return f(); +#endif + //else + return D::f(); + } +}; + + +A& getBCppObj () +{ + static B b; + return b; +} + +char const* call_f(A& a) { return a.f(); } + +A* factory(unsigned choice) +{ + switch (choice % 3) + { + case 0: return new A; + break; + case 1: return new B; + break; + default: return new C; + break; + } +} + +C& getCCppObj () +{ + static C c; + return c; +} + +A* pass_a(A* x) { return x; } + +#ifdef HELD_BY_AUTO_PTR +BOOST_PYTHON_MODULE_INIT(polymorphism2_auto_ptr_ext) +#else +BOOST_PYTHON_MODULE_INIT(polymorphism2_ext) +#endif +{ + class_("A") + .def("f", &A::f, &ACallback::default_f) + ; + + def("getBCppObj", getBCppObj, return_value_policy()); + + class_,boost::noncopyable>("C") + .def("f", &C::f) + ; + + class_,boost::noncopyable>("D") + .def("f", &D::f) + .def("g", &D::g) + ; + + def("pass_a", &pass_a, return_internal_reference<>()); + + def("getCCppObj", getCCppObj, return_value_policy()); + + def("factory", factory, return_value_policy()); + + def("call_f", call_f); + + class_("P") + .def("f", pure_virtual(&P::f)) + ; + + class_ >("Q") + .def("g", &P::g) // make sure virtual inheritance doesn't interfere + ; +} + +//#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/polymorphism2.py b/pxr/external/boost/python/test/polymorphism2.py new file mode 100644 index 0000000000..cf7384fab8 --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism2.py @@ -0,0 +1,94 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +import unittest +import sys + +class PolymorphTest(unittest.TestCase): + + def testReturnCpp(self): + + # Python Created Object With Same Id As + # Cpp Created B Object + # b = B(872) + + # Get Reference To Cpp Created B Object + a = getBCppObj() + + # Python Created B Object and Cpp B Object + # Should have same result by calling f() + self.assertEqual ('B::f()', a.f()) + self.assertEqual ('B::f()', call_f(a)) + self.assertEqual ('A::f()', call_f(A())) + + def test_references(self): + # B is not exposed to Python + a = getBCppObj() + self.assertEqual(type(a), A) + + # C is exposed to Python + c = getCCppObj() + self.assertEqual(type(c), C) + + def test_factory(self): + self.assertEqual(type(factory(0)), A) + self.assertEqual(type(factory(1)), A) + self.assertEqual(type(factory(2)), C) + + def test_return_py(self): + + class X(A): + def f(self): + return 'X.f' + + x = X() + + self.assertEqual ('X.f', x.f()) + self.assertEqual ('X.f', call_f(x)) + + def test_self_default(self): + + class X(A): + def f(self): + return 'X.f() -> ' + A.f(self) + + x = X() + + self.assertEqual ('X.f() -> A::f()', x.f()) + + # This one properly raises the "dangling reference" exception + # self.failUnlessEqual ('X.f() -> A::f()', call_f(x)) + + def test_wrapper_downcast(self): + a = pass_a(D()) + self.assertEqual('D::g()', a.g()) + + def test_pure_virtual(self): + p = P() + self.assertRaises(RuntimeError, p.f) + + q = Q() + self.assertEqual ('Q::f()', q.f()) + + class R(P): + def f(self): + return 'R.f' + + r = R() + self.assertEqual ('R.f', r.f()) + + +def test(): + # remove the option that upsets unittest + import sys + sys.argv = [ x for x in sys.argv if x != '--broken-auto-ptr' ] + unittest.main() + +# This nasty hack basically says that if we're loaded by another module, we'll +# be testing polymorphism2_auto_ptr_ext instead of polymorphism2_ext. +if __name__ == "__main__": + from polymorphism2_ext import * + test() +else: + from polymorphism2_auto_ptr_ext import * + diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp b/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp new file mode 100644 index 0000000000..8cd5ef2471 --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp @@ -0,0 +1,6 @@ +// Copyright David Abrahams 2005. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#define HELD_BY_AUTO_PTR +#include "polymorphism2.cpp" diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.py b/pxr/external/boost/python/test/polymorphism2_auto_ptr.py new file mode 100644 index 0000000000..88cf664abd --- /dev/null +++ b/pxr/external/boost/python/test/polymorphism2_auto_ptr.py @@ -0,0 +1,5 @@ +# Copyright David Abrahams 2005. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +import polymorphism2 +polymorphism2.test() diff --git a/pxr/external/boost/python/test/properties.cpp b/pxr/external/boost/python/test/properties.cpp new file mode 100644 index 0000000000..d338beb915 --- /dev/null +++ b/pxr/external/boost/python/test/properties.cpp @@ -0,0 +1,100 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include + +using namespace boost::python; + +namespace test { + +// Hmm. return_internal_reference<>() wants to wrap a real class. +class ret_type +{ + public: + ret_type() : i(42.5) {} + double i; +}; + +class crash_me +{ + private: + ret_type i; + public: + ret_type& get_i() { return i; } +}; + +} + +struct X +{ + X( int value ) : m_value( value ) + { ++s_count; } + + X( const X &other ) : m_value( other.m_value ) + { ++s_count; } + + ~X() + { --s_count; } + + int get_value() const + { return m_value; } + + void set_value(int new_value) + { m_value = new_value; } + + static int get_instance_count() + { return s_count; } + + int m_value; + + static int s_count; +}; + +int X::s_count = 0; + +int get_X_instance_count() +{ return X::get_instance_count(); } + + + +BOOST_PYTHON_MODULE(properties_ext) +{ + typedef return_value_policy return_by_value_t; + typedef return_internal_reference<> return_by_internal_reference_t; + class_("X", init() ) + //defining read only property + .add_property( "value_r", &X::get_value ) + .add_property( "value_r_ds", &X::get_value, "value_r_ds is read-only") + //defining read \ write property + .add_property( "value_rw", &X::get_value, &X::set_value ) + .add_property( "value_rw_ds", &X::get_value, &X::set_value, + "value_rw_ds is read-write") + //defining read \ write property using make_getter and make_setter + .add_property( "value_direct", + make_getter( &X::m_value, return_by_value_t() ), + make_setter( &X::m_value, return_by_internal_reference_t() ) ) + //defining read only property for static member + .add_static_property( "instance_count", &X::get_instance_count ) + //defining read \ write property for static member using make_getter and make_setter + .add_static_property( "instance_count_direct", + make_getter( &X::s_count, return_by_value_t() ), + make_setter( &X::s_count, return_by_internal_reference_t() ) ) + //defining class property using a global function + .add_static_property( "instance_count_injected", &get_X_instance_count ); + + + class_< test::ret_type>( "ret_type") + .add_property( "i", &test::ret_type::i, &test::ret_type::i) + ; + + class_< test::crash_me> crash_me_wrapper( "crash_me"); + + crash_me_wrapper + .def( "get_i", &test::crash_me::get_i , return_internal_reference<>()) + ; + + crash_me_wrapper.add_property( "i", crash_me_wrapper.attr("get_i")); + +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/properties.py b/pxr/external/boost/python/test/properties.py new file mode 100644 index 0000000000..1bc7a624ba --- /dev/null +++ b/pxr/external/boost/python/test/properties.py @@ -0,0 +1,106 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +This is test module for properties. + +>>> r = properties.ret_type() +>>> r.i = 22.5 +>>> r.i +22.5 +>>> c = properties.crash_me() +>>> c.i.i +42.5 + +>>> X = properties.X + +>>> x1 = X(1) + +value read only +>>> x1.value_r +1 + +value read - write +>>> x1.value_rw +1 + +value direct access +>>> x1.value_direct +1 + +class instance count read - only +>>> X.instance_count +1 + +class instance count direct +>>> X.instance_count_direct +1 + +class instance count injected +>>> X.instance_count_injected +1 + +class instance count from object +>>> x1.instance_count +1 + +class instance count from object +>>> x1.instance_count_direct +1 + +class instance count from object: +>>> x1.instance_count_injected +1 + +as expected you can't assign new value to read only property +>>> x1.value_r = 2 +Traceback (most recent call last): + File "properties.py", line 49, in ? + x1.value_r = 2 +AttributeError: can't set attribute + +setting value_rw to 2. value_direct: +>>> x1.value_rw = 2 +>>> x1.value_rw +2 + +setting value_direct to 3. value_direct: +>>> x1.value_direct = 3 +>>> x1.value_direct +3 + +>>> assert x1.value_r == 3 + +>>> x2 = X(2) + +after creating second intstance of X instances count is 2 +>>> x2.instance_count +2 + +>>> del x2 +>>> assert x1.instance_count == 1 + +>>> assert properties.X.value_r_ds.__doc__ == "value_r_ds is read-only" + +>>> assert properties.X.value_rw_ds.__doc__ == "value_rw_ds is read-write" + +""" + +#import sys; sys.path.append(r'P:\Actimize4.0\smart_const\py_smart_const___Win32_Debug') +import properties_ext as properties + + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/pyrun.py b/pxr/external/boost/python/test/pyrun.py new file mode 100644 index 0000000000..d330773eae --- /dev/null +++ b/pxr/external/boost/python/test/pyrun.py @@ -0,0 +1,7 @@ +import sys + +pythonpath = sys.argv[1] +scriptfile = sys.argv[2] +sys.argv = sys.argv[2:] +sys.path.append(pythonpath) +exec(compile(open(scriptfile).read(), scriptfile, 'exec')) diff --git a/pxr/external/boost/python/test/pytype_function.cpp b/pxr/external/boost/python/test/pytype_function.cpp new file mode 100644 index 0000000000..46cce19e65 --- /dev/null +++ b/pxr/external/boost/python/test/pytype_function.cpp @@ -0,0 +1,85 @@ +// Copyright Joel de Guzman 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +using namespace boost::python; + +struct A +{ +}; + +struct B +{ + A a; + B(const A& a_):a(a_){} +}; + +// Converter from A to python int +struct BToPython +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + : converter::to_python_target_type //inherits get_pytype +#endif +{ + static PyObject* convert(const B& b) + { + return boost::python::incref(boost::python::object(b.a).ptr()); + } +}; + +// Conversion from python int to A +struct BFromPython +{ + BFromPython() + { + boost::python::converter::registry::push_back( + &convertible, + &construct, + boost::python::type_id< B >() +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &converter::expected_from_python_type::get_pytype//convertible to A can be converted to B +#endif + ); + } + + static void* convertible(PyObject* obj_ptr) + { + extract ex(obj_ptr); + if (!ex.check()) return 0; + return obj_ptr; + } + + static void construct( + PyObject* obj_ptr, + boost::python::converter::rvalue_from_python_stage1_data* data) + { + void* storage = ( + (boost::python::converter::rvalue_from_python_storage< B >*)data)-> storage.bytes; + + extract ex(obj_ptr); + new (storage) B(ex()); + data->convertible = storage; + } +}; + + +B func(const B& b) { return b ; } + + +BOOST_PYTHON_MODULE(pytype_function_ext) +{ + to_python_converter< B , BToPython,true >(); //has get_pytype + BFromPython(); + + class_("A") ; + + def("func", &func); + +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/pytype_function.py b/pxr/external/boost/python/test/pytype_function.py new file mode 100644 index 0000000000..a7101fb996 --- /dev/null +++ b/pxr/external/boost/python/test/pytype_function.py @@ -0,0 +1,32 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from pytype_function_ext import * + +>>> print(func.__doc__.splitlines()[1]) +func( (A)arg1) -> A : + +>>> print(func.__module__) +pytype_function_ext + +>>> print(func.__name__) +func +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + + + diff --git a/pxr/external/boost/python/test/raw_ctor.cpp b/pxr/external/boost/python/test/raw_ctor.cpp new file mode 100644 index 0000000000..a825ae0195 --- /dev/null +++ b/pxr/external/boost/python/test/raw_ctor.cpp @@ -0,0 +1,43 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +class Foo +{ + public: + Foo(tuple args, dict kw) + : args(args), kw(kw) {} + + tuple args; + dict kw; +}; + +object init_foo(tuple args, dict kw) +{ + tuple rest(args.slice(1,_)); + return args[0].attr("__init__")(rest, kw); +} + +BOOST_PYTHON_MODULE(raw_ctor_ext) +{ + // using no_init postpones defining __init__ function until after + // raw_function for proper overload resolution order, since later + // defs get higher priority. + class_("Foo", no_init) + .def("__init__", raw_function(&init_foo)) + .def(init()) + .def_readwrite("args", &Foo::args) + .def_readwrite("kw", &Foo::kw) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/raw_ctor.py b/pxr/external/boost/python/test/raw_ctor.py new file mode 100644 index 0000000000..1e9a9192a4 --- /dev/null +++ b/pxr/external/boost/python/test/raw_ctor.py @@ -0,0 +1,76 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> 'importing' +'importing' +>>> from raw_ctor_ext import * +>>> 'imported' +'imported' +>>> import sys +>>> sys.stdout.flush() +>>> f = Foo(1, 2, 'a', bar = 3, baz = 4) +>>> f.args +(1, 2, 'a') +>>> sorted(f.kw.items()) +[('bar', 3), ('baz', 4)] +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pxr/external/boost/python/test/raw_pyobject_fail1.cpp b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp new file mode 100644 index 0000000000..f9dd54bc3a --- /dev/null +++ b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp @@ -0,0 +1,11 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include + +int main() +{ + boost::python::converter::arg_to_python x(0); + return 0; +} diff --git a/pxr/external/boost/python/test/raw_pyobject_fail2.cpp b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp new file mode 100644 index 0000000000..62c57ae74e --- /dev/null +++ b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include + +struct X : PyObject {}; + +int main() +{ + boost::python::converter::arg_to_python x(0); + return 0; +} diff --git a/pxr/external/boost/python/test/register_ptr.cpp b/pxr/external/boost/python/test/register_ptr.cpp new file mode 100644 index 0000000000..6cd4d7856e --- /dev/null +++ b/pxr/external/boost/python/test/register_ptr.cpp @@ -0,0 +1,55 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +using namespace boost; +using namespace python; + +struct A +{ + virtual int f() { return 0; } +}; + +shared_ptr New() { return shared_ptr( new A() ); } + +int Call( const shared_ptr & a ) +{ + return a->f(); +} + +int Fail( shared_ptr & a ) +{ + return a->f(); +} + +struct A_Wrapper: A +{ + A_Wrapper(PyObject* self_): self(self_) {} + A_Wrapper(PyObject* self_, const A& a): self(self_), A(a) {} + + int f() + { + return call_method(self, "f"); + } + + int default_f() + { + return A::f(); + } + + PyObject* self; +}; + +BOOST_PYTHON_MODULE(register_ptr) +{ + class_("A") + .def("f", &A::f, &A_Wrapper::default_f) + ; + register_ptr_to_python< shared_ptr >(); + def("New", &New); + def("Call", &Call); + def("Fail", &Fail); +} diff --git a/pxr/external/boost/python/test/register_ptr_test.py b/pxr/external/boost/python/test/register_ptr_test.py new file mode 100644 index 0000000000..674e5572fe --- /dev/null +++ b/pxr/external/boost/python/test/register_ptr_test.py @@ -0,0 +1,25 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +import unittest +from register_ptr import * + +class RegisterPtrTest(unittest.TestCase): + + def testIt(self): + + class B(A): + def f(self): + return 10 + + a = New() # this must work + b = B() + self.assertEqual(Call(a), 0) + self.assertEqual(Call(b), 10) + def fails(): + Fail(A()) + self.assertRaises(TypeError, fails) + self.assertEqual(Fail(a), 0) # ok, since a is held by shared_ptr + +if __name__ == '__main__': + unittest.main() diff --git a/pxr/external/boost/python/test/result.cpp b/pxr/external/boost/python/test/result.cpp new file mode 100644 index 0000000000..d5f43cc3d4 --- /dev/null +++ b/pxr/external/boost/python/test/result.cpp @@ -0,0 +1,111 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +using boost::python::detail::result; +using boost::type; + +void expect_int(type*) {} +void expect_string(type*) {} + +struct X {}; + +int main() +{ + // Test the usage which works for functions, member functions, and data members + expect_int( + result((int(*)())0) + ); + + expect_int( + result((int(*)(char))0) + ); + + expect_int( + result((int(X::*)())0) + ); + + expect_int( + result((int(X::*)(char))0) + ); + + expect_int( + result((int(X::*))0) + ); + + expect_string( + result((char*(*)())0) + ); + + expect_string( + result((char*(*)(char))0) + ); + + expect_string( + result((char*(X::*)())0) + ); + + expect_string( + result((char*(X::*)(char))0) + ); + + expect_string( + result((char*(X::*))0) + ); + + // Show that we can use the general version that works for + // AdaptableFunctions + expect_int( + result((int(*)())0,0) + ); + + expect_int( + result((int(*)(char))0,0) + ); + + expect_int( + result((int(X::*)())0,0) + ); + + expect_int( + result((int(X::*)(char))0,0) + ); + + expect_int( + result((int(X::*))0,0) + ); + + expect_int( + result(std::plus(),0) + ); + + expect_string( + result((char*(*)())0,0) + ); + + expect_string( + result((char*(*)(char))0,0) + ); + + expect_string( + result((char*(X::*)())0,0) + ); + + expect_string( + result((char*(X::*)(char))0,0) + ); + + expect_string( + result((char*(X::*))0,0) + ); + + expect_string( + result(std::plus(),0) + ); + + return 0; +} diff --git a/pxr/external/boost/python/test/return_arg.cpp b/pxr/external/boost/python/test/return_arg.cpp new file mode 100644 index 0000000000..d8d3c1ddb7 --- /dev/null +++ b/pxr/external/boost/python/test/return_arg.cpp @@ -0,0 +1,67 @@ +// Copyright David Abrahams and Nikolay Mladenov 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +struct Widget +{ + Widget() + : sensitive_(true) + {} + + bool get_sensitive() const + { + return sensitive_; + } + + void set_sensitive(bool s) + { + this->sensitive_ = s; + } + + private: + bool sensitive_; +}; + +struct Label : Widget +{ + Label() {} + + std::string get_label() const + { + return label_; + } + + void set_label(const std::string &l) + { + label_ = l; + } + + private: + std::string label_; +}; + +void return_arg_f(boost::python::object) {} + +using namespace boost::python; +BOOST_PYTHON_MODULE(return_arg_ext) +{ + class_("Widget") + .def("sensitive", &Widget::get_sensitive) + .def("sensitive", &Widget::set_sensitive, return_self<>()) + ; + + class_ >("Label") + .def("label", &Label::get_label)//,return_arg<0>()) //error(s) + .def("label", &Label::set_label, return_self<>()) + ; + + def("return_arg", return_arg_f, return_arg<1>()); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/return_arg.py b/pxr/external/boost/python/test/return_arg.py new file mode 100644 index 0000000000..e66a0b8d93 --- /dev/null +++ b/pxr/external/boost/python/test/return_arg.py @@ -0,0 +1,27 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from return_arg_ext import * +>>> l1=Label() +>>> assert l1 is l1.label("bar") +>>> assert l1 is l1.label("bar").sensitive(0) +>>> assert l1.label("foo").sensitive(0) is l1.sensitive(1).label("bar") +>>> assert return_arg is return_arg(return_arg) + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/select_arg_to_python_test.cpp b/pxr/external/boost/python/test/select_arg_to_python_test.cpp new file mode 100644 index 0000000000..c5faace36e --- /dev/null +++ b/pxr/external/boost/python/test/select_arg_to_python_test.cpp @@ -0,0 +1,70 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include + +// gcc 2.95.x and MIPSpro 7.3.1.3 linker seem to demand this definition +#if ((defined(__GNUC__) && __GNUC__ < 3)) \ + || (defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) +namespace boost { namespace python { +BOOST_PYTHON_DECL bool handle_exception_impl(function0) +{ + return true; +} +}} +#endif + +int result; + +#define ASSERT_SAME(T1,T2) assert_same< T1,T2 >() + +template +void assert_same(U* = 0, T* = 0) +{ + BOOST_STATIC_ASSERT((boost::is_same::value)); + +} + + +int main() +{ + using namespace boost::python::converter::detail; + using namespace boost::python::converter; + using namespace boost::python; + using namespace boost; + + + ASSERT_SAME( + select_arg_to_python::type, value_arg_to_python + ); + + ASSERT_SAME( + select_arg_to_python >::type, reference_arg_to_python + ); + + ASSERT_SAME( + select_arg_to_python >::type, pointer_shallow_arg_to_python + ); + + ASSERT_SAME( + select_arg_to_python::type, pointer_deep_arg_to_python + ); + + ASSERT_SAME( + select_arg_to_python >::type, object_manager_arg_to_python > + ); + + ASSERT_SAME( + select_arg_to_python::type, object_manager_arg_to_python + ); + + ASSERT_SAME( + select_arg_to_python::type, arg_to_python + ); + + return result; +} diff --git a/pxr/external/boost/python/test/select_from_python_test.cpp b/pxr/external/boost/python/test/select_from_python_test.cpp new file mode 100644 index 0000000000..bb60962a37 --- /dev/null +++ b/pxr/external/boost/python/test/select_from_python_test.cpp @@ -0,0 +1,161 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include + +// gcc 2.95.x, MIPSpro 7.3.1.3 and IBM XL for Linux linker seem to demand this definition +#if (defined(__GNUC__) && (__GNUC__ < 3)) \ + || (defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) \ + || (defined(__IBMCPP__) && defined(__linux__)) +namespace boost { namespace python { +BOOST_PYTHON_DECL bool handle_exception_impl(function0) +{ + return true; +} +}} +#endif + +int result; + +#define ASSERT_SAME(T1,T2) \ + if (!is_same< T1, T2 >::value) { \ + std::cout << "*********************\n"; \ + std::cout << python::type_id< T1 >() << " != " << python::type_id< T2 >() << "\n"; \ + std::cout << "*********************\n"; \ + result = 1; \ + } + +int main() +{ + using namespace boost::python::converter; + using namespace boost; + + + ASSERT_SAME( + select_arg_from_python::type, arg_rvalue_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, arg_rvalue_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, arg_rvalue_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, arg_rvalue_from_python + ); + + + + ASSERT_SAME( + select_arg_from_python::type, pointer_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_arg_from_python + ); + + + + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, arg_rvalue_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + + + ASSERT_SAME( + select_arg_from_python::type, pointer_cref_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_cref_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_cref_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, pointer_cref_arg_from_python + ); + + + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + + ASSERT_SAME( + select_arg_from_python::type, reference_arg_from_python + ); + return result; +} diff --git a/pxr/external/boost/python/test/select_holder.cpp b/pxr/external/boost/python/test/select_holder.cpp new file mode 100644 index 0000000000..8650bd06a0 --- /dev/null +++ b/pxr/external/boost/python/test/select_holder.cpp @@ -0,0 +1,76 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include +#include +#include + +struct BR {}; + +struct Base {}; +struct Derived : Base {}; + +namespace boost { namespace python +{ + // specialization + template <> + struct has_back_reference
    + : mpl::true_ + { + }; +}} // namespace boost::python + +template +void assert_same(U* = 0, T* = 0) +{ + BOOST_STATIC_ASSERT((boost::python::detail::is_same::value)); + +} + +template +void assert_holder(T* = 0, Held* = 0, Holder* = 0) +{ + using namespace boost::python::detail; + using namespace boost::python::objects; + + typedef typename class_metadata< + T,Held,not_specified,not_specified + >::holder h; + + assert_same( + (h*)0 + ); +} + +int test_main(int, char * []) +{ + using namespace boost::python::detail; + using namespace boost::python::objects; + + assert_holder >(); + + assert_holder >(); + assert_holder >(); + assert_holder >(); + + assert_holder >(); + + assert_holder + ,pointer_holder,Base> >(); + + assert_holder + ,pointer_holder_back_reference,Base> >(); + + assert_holder + ,pointer_holder_back_reference,BR> > (); + + return 0; +} + diff --git a/pxr/external/boost/python/test/shared_ptr.cpp b/pxr/external/boost/python/test/shared_ptr.cpp new file mode 100644 index 0000000000..f72e6f0297 --- /dev/null +++ b/pxr/external/boost/python/test/shared_ptr.cpp @@ -0,0 +1,19 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +using std::shared_ptr; +#define MODULE shared_ptr_ext + +#include "shared_ptr.hpp" +#include "module_tail.cpp" + diff --git a/pxr/external/boost/python/test/shared_ptr.hpp b/pxr/external/boost/python/test/shared_ptr.hpp new file mode 100644 index 0000000000..9f9a4b69e3 --- /dev/null +++ b/pxr/external/boost/python/test/shared_ptr.hpp @@ -0,0 +1,206 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "test_class.hpp" + +using namespace boost::python; + +typedef test_class<> X; +typedef test_class<1> Y; + +template +struct functions +{ + static int look(shared_ptr const& x) + { + return (x.get()) ? x->value() : -1; + } + + static void store(shared_ptr x) + { + storage = x; + } + + static void release_store() + { + store(shared_ptr()); + } + + static void modify(shared_ptr& x) + { + x.reset(); + } + + static shared_ptr get() { return storage; } + static shared_ptr &get1() { return storage; } + + static int look_store() + { + return look(get()); + } + + template + static void expose(C const& c) + { + def("look", &look); + def("store", &store); + def("modify", &modify); + def("identity", &identity); + def("null", &null); + + const_cast(c) + .def("look", &look) + .staticmethod("look") + .def("store", &store) + .staticmethod("store") + .def("modify", &modify) + .staticmethod("modify") + .def("look_store", &look_store) + .staticmethod("look_store") + .def("identity", &identity) + .staticmethod("identity") + .def("null", &null) + .staticmethod("null") + .def("get1", &get1, return_internal_reference<>()) + .staticmethod("get1") + .def("get", &get) + .staticmethod("get") + .def("count", &T::count) + .staticmethod("count") + .def("release", &release_store) + .staticmethod("release") + ; + } + + static shared_ptr identity(shared_ptr x) { return x; } + static shared_ptr null(T const&) { return shared_ptr(); } + + + static shared_ptr storage; +}; + +template shared_ptr functions::storage; + +struct Z : test_class<2> +{ + Z(int x) : test_class<2>(x) {} + virtual int v() { return this->value(); } +}; + +struct ZWrap : Z +{ + ZWrap(PyObject* self, int x) + : Z(x), m_self(self) {} + + + virtual int v() { return call_method(m_self, "v"); } + int default_v() { return Z::v(); } + + + PyObject* m_self; +}; + +struct YY : Y +{ + YY(int n) : Y(n) {} +}; + +struct YYY : Y +{ + YYY(int n) : Y(n) {} +}; + +shared_ptr factory(int n) +{ + return shared_ptr(n < 42 ? new Y(n) : new YY(n)); +} + +// regressions from Nicodemus + struct A + { + virtual ~A() {}; // silence compiler warnings + virtual int f() = 0; + static int call_f(shared_ptr& a) { return a->f(); } + }; + + struct B: A + { + int f() { return 1; } + }; + + shared_ptr New(bool make) + { + return shared_ptr( make ? new B() : 0 ); + } + + struct A_Wrapper: A + { + A_Wrapper(PyObject* self_): + A(), self(self_) {} + + int f() { + return call_method< int >(self, "f"); + } + + PyObject* self; + }; + +// ------ + +// from Neal Becker + +struct Test { + shared_ptr x; +}; +// ------ + + +BOOST_PYTHON_MODULE(MODULE) +{ + class_, boost::noncopyable>("A") + .def("call_f", &A::call_f) + .staticmethod("call_f") + ; + + // This is the ugliness required to register a to-python converter + // for shared_ptr. + objects::class_value_wrapper< + shared_ptr + , objects::make_ptr_instance,A> > + >(); + + def("New", &New); + + def("factory", factory); + + functions::expose( + class_("X", init()) + .def("value", &X::value) + ); + + functions::expose( + class_ >("Y", init()) + .def("value", &Y::value) + ); + + class_, boost::noncopyable>("YY", init()) + ; + + class_, bases >("YYY", init()) + ; + + functions::expose( + class_("Z", init()) + .def("value", &Z::value) + .def("v", &Z::v, &ZWrap::default_v) + ); + +// from Neal Becker + class_ ("Test") + .def_readonly ("x", &Test::x, "x") + ; +// ------ +} diff --git a/pxr/external/boost/python/test/shared_ptr.py b/pxr/external/boost/python/test/shared_ptr.py new file mode 100644 index 0000000000..d250ae7eca --- /dev/null +++ b/pxr/external/boost/python/test/shared_ptr.py @@ -0,0 +1,130 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from shared_ptr_ext import * + + Test that shared_ptr can be converted to shared_ptr + +>>> Y.store(YYY(42)) + +>>> x = X(17) +>>> null_x = null(x) +>>> null_x # should be None +>>> identity(null_x) # should also be None + +>>> a = New(1) +>>> A.call_f(a) +1 +>>> New(0) + +>>> type(factory(3)) + +>>> type(factory(42)) + + +>>> class P(Z): +... def v(self): +... return -Z.v(self); +... def __del__(self): +... print('bye') +... +>>> p = P(12) +>>> p.value() +12 +>>> p.v() +-12 +>>> look(p) +12 +>>> try: modify(p) +... except TypeError: pass +... else: 'print(expected a TypeError)' +>>> look(None) +-1 +>>> store(p) +>>> del p +>>> Z.get().v() +-12 +>>> Z.count() +1 +>>> Z.look_store() +12 +>>> Z.release() +bye +>>> Z.count() +0 + +>>> z = Z(13) +>>> z.value() +13 +>>> z.v() +13 +>>> try: modify(z) +... except TypeError: pass +... else: 'print(expected a TypeError)' + +>>> Z.get() # should be None +>>> store(z) +>>> assert Z.get() is z # show that deleter introspection works +>>> del z +>>> Z.get().value() +13 +>>> Z.count() +1 +>>> Z.look_store() +13 +>>> Z.release() +>>> Z.count() +0 + +>>> x = X(17) +>>> x.value() +17 +>>> look(x) +17 +>>> try: modify(x) +... except TypeError: pass +... else: 'print(expected a TypeError)' +>>> look(None) +-1 +>>> store(x) +>>> del x +>>> X.count() +1 +>>> X.look_store() +17 +>>> X.release() +>>> X.count() +0 + + +>>> y = Y(19) +>>> y.value() +19 +>>> modify(y) +>>> look(y) +-1 +>>> store(Y(23)) +>>> Y.count() +1 +>>> Y.look_store() +23 +>>> Y.release() +>>> Y.count() +0 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/simple_type.hpp b/pxr/external/boost/python/test/simple_type.hpp new file mode 100644 index 0000000000..d1314ff97f --- /dev/null +++ b/pxr/external/boost/python/test/simple_type.hpp @@ -0,0 +1,13 @@ +// Copyright David Abrahams 2001. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef SIMPLE_TYPE_DWA2001128_HPP +# define SIMPLE_TYPE_DWA2001128_HPP + +struct simple +{ + char* s; +}; + +#endif // SIMPLE_TYPE_DWA2001128_HPP diff --git a/pxr/external/boost/python/test/slice.cpp b/pxr/external/boost/python/test/slice.cpp new file mode 100644 index 0000000000..b1b965fa10 --- /dev/null +++ b/pxr/external/boost/python/test/slice.cpp @@ -0,0 +1,98 @@ +#include +#include +#include +#include + +// Copyright (c) 2004 Jonathan Brandmeyer +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +using namespace boost::python; + +#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) +# define make_tuple boost::python::make_tuple +#endif + +// These checks are only valid under Python 2.3 +// (rich slicing wasn't supported for builtins under Python 2.2) +bool check_string_rich_slice() +{ + object s("hello, world"); + + // default slice + if (s[slice()] != "hello, world") + return false; + + // simple reverse + if (s[slice(_,_,-1)] != "dlrow ,olleh") + return false; + + // reverse with mixed-sign offsets + if (s[slice(-6,1,-1)] != " ,oll") + return false; + + // all of the object.cpp check_string_slice() checks should work + // with the form that omits the step argument. + if (s[slice(_,-3)] != "hello, wo") + return false; + if (s[slice(-3,_)] != "rld") + return false; + if (", " != s[slice(5,7)]) + return false; + + return s[slice(2,-1)][slice(1,-1)] == "lo, wor"; +} + +// Tried to get more info into the error message (actual array +// contents) but Numeric complains that treating an array as a boolean +// value doesn't make any sense. +#define ASSERT_EQUAL( e1, e2 ) \ + if (!all((e1) == (e2))) \ + return "assertion failed: " #e1 " == " #e2 "\nLHS:\n%s\nRHS:\n%s" % make_tuple(e1,e2); \ +else + +// Verify functions accepting a slice argument can be called +bool accept_slice( slice) { return true; } + +#if BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND( BOOST_INTEL_WIN, == 710) +int check_slice_get_indices(slice index); +#endif +int check_slice_get_indices( +#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) + const +#endif + slice index) +{ + // A vector of integers from [-5, 5]. + std::vector coll(11); + typedef std::vector::iterator coll_iterator; + + for (coll_iterator i = coll.begin(); i != coll.end(); ++i) { + *i = i - coll.begin() - 5; + } + + slice::range::iterator> bounds; + try { + bounds = index.get_indices(coll.begin(), coll.end()); + } + catch (std::invalid_argument) { + return 0; + } + int sum = 0; + while (bounds.start != bounds.stop) { + sum += *bounds.start; + std::advance( bounds.start, bounds.step); + } + sum += *bounds.start; + return sum; +} + + +BOOST_PYTHON_MODULE(slice_ext) +{ + def( "accept_slice", accept_slice); + def( "check_string_rich_slice", check_string_rich_slice); + def( "check_slice_get_indices", check_slice_get_indices); +} diff --git a/pxr/external/boost/python/test/slice.py b/pxr/external/boost/python/test/slice.py new file mode 100644 index 0000000000..c58bbc0299 --- /dev/null +++ b/pxr/external/boost/python/test/slice.py @@ -0,0 +1,54 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from slice_ext import * +>>> accept_slice(slice(1, None, (1,2))) +1 +>>> try: +... accept_slice(list((1,2))) +... print("test failed") +... except: +... print("test passed") +... +test passed +>>> import sys +>>> if sys.version_info[0] == 2 and sys.version_info[1] >= 3: +... check_string_rich_slice() +... elif sys.version_info[0] > 2: +... check_string_rich_slice() +... else: +... print(1) +... +1 +>>> check_slice_get_indices( slice(None)) +0 +>>> check_slice_get_indices( slice(2,-2)) +0 +>>> check_slice_get_indices( slice(2, None, 2)) +5 +>>> check_slice_get_indices( slice(2, None, -1)) +-12 +>>> check_slice_get_indices( slice( 20, None)) +0 +>>> check_slice_get_indices( slice( -2, -5, -2)) +6 +""" + +# Performs an affirmative and negative argument resolution check. +# checks the operation of extended slicing in new strings (Python 2.3 only). + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/staticmethod.cpp b/pxr/external/boost/python/test/staticmethod.cpp new file mode 100644 index 0000000000..dcd75ca828 --- /dev/null +++ b/pxr/external/boost/python/test/staticmethod.cpp @@ -0,0 +1,48 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +using namespace boost::python; + +struct X +{ + explicit X(int x) : x(x), magic(7654321) { ++counter; } + X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; } + virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; } + + void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; } + int value() const { BOOST_ASSERT(magic == 7654321); return x; } + static int count() { return counter; } + private: + void operator=(X const&); + private: + int x; + long magic; + static int counter; +}; +int X::counter; +int getXmagic(){return 7654321;} + +BOOST_PYTHON_MODULE(staticmethod_ext) +{ + class_("X", init()) + .def("value", &X::value) + .def("set", &X::set) + .def("count", &X::count) + .staticmethod("count") + .def("magic", &getXmagic) + .staticmethod("magic") + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/staticmethod.py b/pxr/external/boost/python/test/staticmethod.py new file mode 100644 index 0000000000..3dd355b133 --- /dev/null +++ b/pxr/external/boost/python/test/staticmethod.py @@ -0,0 +1,57 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from staticmethod_ext import * + +>>> class X1(X): +... pass + + +>>> x = X(16) +>>> x1 = X1(17) + + + +>>> x1.count() +2 + +>>> x.count() +2 + +>>> X1.count() +2 + +>>> X.count() +2 + + +>>> x1.magic() +7654321 + +>>> x.magic() +7654321 + +>>> X1.magic() +7654321 + +>>> X.magic() +7654321 + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/stl_iterator.cpp b/pxr/external/boost/python/test/stl_iterator.cpp new file mode 100644 index 0000000000..409e0da84b --- /dev/null +++ b/pxr/external/boost/python/test/stl_iterator.cpp @@ -0,0 +1,33 @@ +// Copyright Eric Niebler 2005. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include + +using namespace boost::python; + +typedef std::list list_int; + +void assign(list_int& x, object const& y) +{ + stl_input_iterator begin(y), end; + x.clear(); + for( ; begin != end; ++begin) + x.push_back(*begin); +} + +BOOST_PYTHON_MODULE(stl_iterator_ext) +{ + using boost::python::iterator; // gcc 2.96 bug workaround + + class_("list_int") + .def("assign", assign) + .def("__iter__", iterator()) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/stl_iterator.py b/pxr/external/boost/python/test/stl_iterator.py new file mode 100644 index 0000000000..4743ed632a --- /dev/null +++ b/pxr/external/boost/python/test/stl_iterator.py @@ -0,0 +1,39 @@ +# Copyright Eric Niebler 2005. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from stl_iterator_ext import * +>>> x = list_int() +>>> x.assign(iter([1,2,3,4,5])) +>>> for y in x: +... print(y) +1 +2 +3 +4 +5 +>>> def generator(): +... yield 1 +... yield 2 +... raise RuntimeError("oops") +>>> try: +... x.assign(iter(generator())) +... print("NOT OK") +... except RuntimeError: +... print("OK") +OK +''' +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/str.cpp b/pxr/external/boost/python/test/str.cpp new file mode 100644 index 0000000000..0505b250ae --- /dev/null +++ b/pxr/external/boost/python/test/str.cpp @@ -0,0 +1,84 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +#include + +#include +#include +#include +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +using namespace boost::python; + +object convert_to_string(object data) +{ + return str(data); +} + +void work_with_string(object print) +{ + str data("this is a demo string"); + print(data.split(" ")); + print(data.split(" ",3)); + print(str("<->").join(data.split(" "))); + print(data.capitalize()); + print('[' + data.center(30) + ']'); + print(data.count("t")); +#if PY_VERSION_HEX < 0x03000000 + print(data.encode("utf-8")); + print(data.decode("utf-8")); +#else + print(data.encode("utf-8").attr("decode")("utf-8")); + print(data.encode("utf-8").attr("decode")("utf-8")); +#endif + + BOOST_ASSERT(!data.endswith("xx")); + BOOST_ASSERT(!data.startswith("test")); + + print(data.splitlines()); + print(data.strip()); + print(data.swapcase()); + print(data.title()); + + print("find"); + print(data.find("demo")); + print(data.find("demo"),3,5); + print(data.find(std::string("demo"))); + print(data.find(std::string("demo"),9)); + + print("expandtabs"); + str tabstr("\t\ttab\tdemo\t!"); + print(tabstr.expandtabs()); + print(tabstr.expandtabs(4)); + print(tabstr.expandtabs(7L)); + + print("operators"); + print( str("part1") + str("part2") ); +// print( str("a test string").slice(3,_) ); +// print( str("another test")[5] ); + + print(data.replace("demo",std::string("blabla"))); + print(data.rfind("i",5)); + print(data.rindex("i",5)); + + BOOST_ASSERT(!data.startswith("asdf")); + BOOST_ASSERT(!data.endswith("asdf")); + + print(data.translate(str('a')*256)); + + + bool tmp = data.isalnum() || data.isalpha() || data.isdigit() || data.islower() || + data.isspace() || data.istitle() || data.isupper(); + (void)tmp; // ignored. +} + + +BOOST_PYTHON_MODULE(str_ext) +{ + def("convert_to_string",convert_to_string); + def("work_with_string",work_with_string); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/str.py b/pxr/external/boost/python/test/str.py new file mode 100644 index 0000000000..bfb4994959 --- /dev/null +++ b/pxr/external/boost/python/test/str.py @@ -0,0 +1,55 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from str_ext import * +>>> def printer(*args): +... for x in args: print(x, end=' ') +... print('') +... +>>> work_with_string(printer) #doctest: +NORMALIZE_WHITESPACE +['this', 'is', 'a', 'demo', 'string'] +['this', 'is', 'a', 'demo string'] +this<->is<->a<->demo<->string +This is a demo string +[ this is a demo string ] +2 +this is a demo string +this is a demo string +['this is a demo string'] +this is a demo string +THIS IS A DEMO STRING +This Is A Demo String +find +10 +10 3 5 +10 +10 +expandtabs + tab demo ! + tab demo ! + tab demo ! +operators +part1part2 +this is a blabla string +18 +18 +aaaaaaaaaaaaaaaaaaaaa +""" + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/string_literal.cpp b/pxr/external/boost/python/test/string_literal.cpp new file mode 100644 index 0000000000..7a349d6c26 --- /dev/null +++ b/pxr/external/boost/python/test/string_literal.cpp @@ -0,0 +1,42 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include +//#include + +#include +#include + +using namespace boost::python::detail; + + +template +void expect_string_literal(T const&) +{ + BOOST_STATIC_ASSERT(is_string_literal::value); +} + +int main() +{ + expect_string_literal("hello"); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(is_string_literal::value); + BOOST_STATIC_ASSERT(is_string_literal::value); + + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + BOOST_STATIC_ASSERT(!is_string_literal::value); + return boost::report_errors(); +} diff --git a/pxr/external/boost/python/test/test_builtin_converters.py b/pxr/external/boost/python/test/test_builtin_converters.py new file mode 100644 index 0000000000..0f1b4ded75 --- /dev/null +++ b/pxr/external/boost/python/test/test_builtin_converters.py @@ -0,0 +1,307 @@ +# -*- coding: utf-8 -*- +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +r""" +>>> from builtin_converters_ext import * + +# Provide values for integer converter tests +>>> def _signed_values(s): +... base = 2 ** (8 * s - 1) +... return [[-base, -1, 1, base - 1], [-base - 1, base]] +>>> def _unsigned_values(s): +... base = 2 ** (8 * s) +... return [[1, base - 1], [long(-1), -1, base]] + +# Wrappers to simplify tests +>>> def should_pass(method, values): +... result = list(map(method, values[0])) +... if result != values[0]: +... print("Got %s but expected %s" % (result, values[0])) +>>> def test_overflow(method, values): +... for v in values[1]: +... try: method(v) +... except OverflowError: pass +... else: print("OverflowError expected") + +# Synthesize idendity functions in case long long not supported +>>> if not 'rewrap_value_long_long' in dir(): +... def rewrap_value_long_long(x): return long(x) +... def rewrap_value_unsigned_long_long(x): return long(x) +... def rewrap_const_reference_long_long(x): return long(x) +... def rewrap_const_reference_unsigned_long_long(x): return long(x) +>>> if not 'long_long_size' in dir(): +... def long_long_size(): return long_size() + +>>> try: bool_exists = bool +... except: pass +... else: +... rewrap_value_bool(True) +... rewrap_value_bool(False) +True +False + +>>> rewrap_value_bool(None) +0 +>>> rewrap_value_bool(0) +0 +>>> rewrap_value_bool(33) +1 +>>> rewrap_value_char('x') +'x' + + Note that there's currently silent truncation of strings passed to + char arguments. + +>>> rewrap_value_char('xy') +'x' +>>> rewrap_value_signed_char(42) +42 +>>> rewrap_value_unsigned_char(42) +42 +>>> rewrap_value_int(42) +42 +>>> rewrap_value_unsigned_int(42) +42 +>>> rewrap_value_short(42) +42 +>>> rewrap_value_unsigned_short(42) +42 +>>> rewrap_value_long(42) +42 +>>> rewrap_value_unsigned_long(42) +42 + + test unsigned long values which don't fit in a signed long. + strip any 'L' characters in case the platform has > 32 bit longs + +>>> hex(rewrap_value_unsigned_long(long(0x80000001))).replace('L','') +'0x80000001' + +>>> rewrap_value_long_long(42) == 42 +True +>>> rewrap_value_unsigned_long_long(42) == 42 +True + + show that we have range checking. + +>>> should_pass(rewrap_value_signed_char, _signed_values(char_size())) +>>> should_pass(rewrap_value_short, _signed_values(short_size())) +>>> should_pass(rewrap_value_int, _signed_values(int_size())) +>>> should_pass(rewrap_value_long, _signed_values(long_size())) +>>> should_pass(rewrap_value_long_long, _signed_values(long_long_size())) + +>>> should_pass(rewrap_value_unsigned_char, _unsigned_values(char_size())) +>>> should_pass(rewrap_value_unsigned_short, _unsigned_values(short_size())) +>>> should_pass(rewrap_value_unsigned_int, _unsigned_values(int_size())) +>>> should_pass(rewrap_value_unsigned_long, _unsigned_values(long_size())) +>>> should_pass(rewrap_value_unsigned_long_long, +... _unsigned_values(long_long_size())) + +>>> test_overflow(rewrap_value_signed_char, _signed_values(char_size())) +>>> test_overflow(rewrap_value_short, _signed_values(short_size())) +>>> test_overflow(rewrap_value_int, _signed_values(int_size())) +>>> test_overflow(rewrap_value_long, _signed_values(long_size())) +>>> test_overflow(rewrap_value_long_long, _signed_values(long_long_size())) + +>>> test_overflow(rewrap_value_unsigned_char, _unsigned_values(char_size())) +>>> test_overflow(rewrap_value_unsigned_short, _unsigned_values(short_size())) +>>> test_overflow(rewrap_value_unsigned_int, _unsigned_values(int_size())) +>>> test_overflow(rewrap_value_unsigned_long, _unsigned_values(long_size())) + +# Exceptionally for PyLong_AsUnsignedLongLong(), a negative value raises +# TypeError on Python versions prior to 2.7 +>>> for v in _unsigned_values(long_long_size())[1]: +... try: rewrap_value_unsigned_long_long(v) +... except (OverflowError, TypeError): pass +... else: print("OverflowError or TypeError expected") + +>>> assert abs(rewrap_value_float(4.2) - 4.2) < .000001 +>>> rewrap_value_double(4.2) - 4.2 +0.0 +>>> rewrap_value_long_double(4.2) - 4.2 +0.0 + +>>> assert abs(rewrap_value_complex_float(4+.2j) - (4+.2j)) < .000001 +>>> assert abs(rewrap_value_complex_double(4+.2j) - (4+.2j)) < .000001 +>>> assert abs(rewrap_value_complex_long_double(4+.2j) - (4+.2j)) < .000001 + +>>> rewrap_value_cstring('hello, world') +'hello, world' +>>> rewrap_value_string('yo, wassup?') +'yo, wassup?' + +>>> print(rewrap_value_wstring(u'yo, wassup?')) +yo, wassup? + + test that overloading on unicode works: + +>>> print(rewrap_value_string(u'yo, wassup?')) +yo, wassup? + + wrap strings with embedded nulls: + +>>> rewrap_value_string('yo,\0wassup?') +'yo,\x00wassup?' + +>>> rewrap_value_handle(1) +1 +>>> x = 'hi' +>>> assert rewrap_value_handle(x) is x +>>> assert rewrap_value_object(x) is x + + Note that we can currently get a mutable pointer into an immutable + Python string: + +>>> rewrap_value_mutable_cstring('hello, world') +'hello, world' + +>>> rewrap_const_reference_bool(None) +0 +>>> rewrap_const_reference_bool(0) +0 + +>>> try: rewrap_const_reference_bool('yes') +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> rewrap_const_reference_char('x') +'x' + + Note that there's currently silent truncation of strings passed to + char arguments. + +>>> rewrap_const_reference_char('xy') +'x' +>>> rewrap_const_reference_signed_char(42) +42 +>>> rewrap_const_reference_unsigned_char(42) +42 +>>> rewrap_const_reference_int(42) +42 +>>> rewrap_const_reference_unsigned_int(42) +42 +>>> rewrap_const_reference_short(42) +42 +>>> rewrap_const_reference_unsigned_short(42) +42 +>>> rewrap_const_reference_long(42) +42 +>>> rewrap_const_reference_unsigned_long(42) +42 +>>> rewrap_const_reference_long_long(42) == 42 +True +>>> rewrap_const_reference_unsigned_long_long(42) == 42 +True + + +>>> assert abs(rewrap_const_reference_float(4.2) - 4.2) < .000001 +>>> rewrap_const_reference_double(4.2) - 4.2 +0.0 +>>> rewrap_const_reference_long_double(4.2) - 4.2 +0.0 + +>>> assert abs(rewrap_const_reference_complex_float(4+.2j) - (4+.2j)) < .000001 +>>> assert abs(rewrap_const_reference_complex_double(4+.2j) - (4+.2j)) < .000001 +>>> assert abs(rewrap_const_reference_complex_long_double(4+.2j) - (4+.2j)) < .000001 + +>>> rewrap_const_reference_cstring('hello, world') +'hello, world' +>>> rewrap_const_reference_string('yo, wassup?') +'yo, wassup?' + +>>> rewrap_const_reference_handle(1) +1 +>>> x = 'hi' +>>> assert rewrap_const_reference_handle(x) is x +>>> assert rewrap_const_reference_object(x) is x +>>> assert rewrap_reference_object(x) is x + + +Check that None <==> NULL + +>>> rewrap_const_reference_cstring(None) + +But None cannot be converted to a string object: + +>>> try: rewrap_const_reference_string(None) +... except TypeError: pass +... else: print('expected a TypeError exception') + +Now check implicit conversions between floating/integer types + +>>> rewrap_const_reference_float(42) +42.0 + +>>> rewrap_const_reference_float(long(42)) +42.0 + +>>> try: rewrap_const_reference_int(42.0) +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> rewrap_value_float(42) +42.0 + +>>> try: rewrap_value_int(42.0) +... except TypeError: pass +... else: print('expected a TypeError exception') + +Check that classic classes also work + +>>> class FortyTwo: +... def __int__(self): +... return 42 +... def __float__(self): +... return 42.0 +... def __complex__(self): +... return complex(4+.2j) +... def __str__(self): +... return '42' + +>>> try: rewrap_const_reference_float(FortyTwo()) +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> try: rewrap_value_int(FortyTwo()) +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> try: rewrap_const_reference_string(FortyTwo()) +... except TypeError: pass +... else: print('expected a TypeError exception') + +>>> try: rewrap_value_complex_double(FortyTwo()) +... except TypeError: pass +... else: print('expected a TypeError exception') + +# show that arbitrary handle instantiations can be returned +>>> assert get_type(1) is type(1) + +>>> assert return_null_handle() is None +""" + +import sys +if (sys.version_info.major >= 3): + long = int + +def run(args = None): + import sys + import doctest + import builtin_converters_ext + + if 'rewrap_value_long_long' in dir(builtin_converters_ext): + print('LONG_LONG supported, testing...') + else: + print('LONG_LONG not supported, skipping those tests...') + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/test_class.hpp b/pxr/external/boost/python/test/test_class.hpp new file mode 100644 index 0000000000..a9324e9c47 --- /dev/null +++ b/pxr/external/boost/python/test/test_class.hpp @@ -0,0 +1,32 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TEST_CLASS_DWA2002326_HPP +# define TEST_CLASS_DWA2002326_HPP +# include + +template +struct test_class +{ + explicit test_class(int x) : x(x), magic(7654321 + n) { ++counter; } + test_class(test_class const& rhs) : x(rhs.x), magic(7654321 + n) { ++counter; } + virtual ~test_class() { BOOST_ASSERT(magic == 7654321 + n); magic = 6666666; x = 9999; --counter; } + + void set(int _x) { BOOST_ASSERT(magic == 7654321 + n); this->x = _x; } + int value() const { BOOST_ASSERT(magic == 7654321 + n); return x; } + operator int() const { return x; } + static int count() { return counter; } + + int x; + long magic; + static int counter; + + private: + void operator=(test_class const&); +}; + +template +int test_class::counter; + +#endif // TEST_CLASS_DWA2002326_HPP diff --git a/pxr/external/boost/python/test/test_cltree.py b/pxr/external/boost/python/test/test_cltree.py new file mode 100644 index 0000000000..2127b7cdb6 --- /dev/null +++ b/pxr/external/boost/python/test/test_cltree.py @@ -0,0 +1,43 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#!/usr/bin/env python + +from cltree import basic,symbol,constant,variable + +b = basic() +c = constant() +s = symbol() +v = variable() + +assert isinstance(b,basic) +assert not isinstance(b,symbol) +assert not isinstance(b,constant) +assert not isinstance(b,variable) + +assert isinstance(c,basic) +assert isinstance(c,constant) +assert not isinstance(c,symbol) +assert not isinstance(c,variable) + +assert not isinstance(s,basic) +assert isinstance(s,symbol) +assert not isinstance(s,constant) +assert not isinstance(s,variable) + +assert isinstance(v,basic) +assert not isinstance(v,symbol) +assert not isinstance(v,constant) +assert isinstance(v,variable) + +print('b=',b) +assert repr(b)=='cltree.basic()' +print('s=',s) +assert repr(s)!='cltree.wrapped_symbol()' # because not isinstance(s,basic) +print('c=',c) +assert repr(c)=='cltree.constant()' +print('v=',v) +assert repr(v)=='cltree.wrapped_variable()' + + +print('ok') diff --git a/pxr/external/boost/python/test/test_enum.py b/pxr/external/boost/python/test/test_enum.py new file mode 100644 index 0000000000..e4ad70bd5b --- /dev/null +++ b/pxr/external/boost/python/test/test_enum.py @@ -0,0 +1,85 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from enum_ext import * + +>>> identity(color.red) # in case of duplicated enums it always take the last enum +enum_ext.color.blood + +>>> identity(color.green) +enum_ext.color.green + +>>> identity(color.blue) +enum_ext.color.blue + +>>> identity(color(1)) # in case of duplicated enums it always take the last enum +enum_ext.color.blood + +>>> identity(color(2)) +enum_ext.color.green + +>>> identity(color(3)) +enum_ext.color(3) + +>>> identity(color(4)) +enum_ext.color.blue + + --- check export to scope --- + +>>> identity(red) +enum_ext.color.blood + +>>> identity(green) +enum_ext.color.green + +>>> identity(blue) +enum_ext.color.blue + +>>> try: identity(1) +... except TypeError: pass +... else: print('expected a TypeError') + +>>> c = colorized() +>>> c.x +enum_ext.color.blood +>>> c.x = green +>>> c.x +enum_ext.color.green +>>> red == blood +True +>>> red == green +False +>>> hash(red) == hash(blood) +True +>>> hash(red) == hash(green) +False +''' + +# pickling of enums only works with Python 2.3 or higher +exercise_pickling = ''' +>>> import pickle +>>> p = pickle.dumps(color.green, pickle.HIGHEST_PROTOCOL) +>>> l = pickle.loads(p) +>>> identity(l) +enum_ext.color.green +''' + +def run(args = None): + import sys + import doctest + import pickle + + if args is not None: + sys.argv = args + self = sys.modules.get(__name__) + if (hasattr(pickle, "HIGHEST_PROTOCOL")): + self.__doc__ += exercise_pickling + return doctest.testmod(self) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/test_overload_resolution.cpp b/pxr/external/boost/python/test/test_overload_resolution.cpp new file mode 100644 index 0000000000..e15bcc6a73 --- /dev/null +++ b/pxr/external/boost/python/test/test_overload_resolution.cpp @@ -0,0 +1,53 @@ +// Copyright Troy D. Straszheim 2009 +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// example that shows problems with overloading and automatic conversion. +// if you call one of the below functions from python with bool/int/double, +// you'll see that the overload called is first match, not best match. +// See overload matching in luabind for an example of how to do this better. +// +// see this mail: +// http://mail.python.org/pipermail/cplusplus-sig/2009-March/014362.html +// +// This test isn't called by the cmake/jamfiles. For future use. +// +#include +#include +#include +#include +#include +#include +#include + +using boost::python::def; +using boost::python::handle; +using boost::python::object; +using boost::python::borrowed; + +std::string takes_bool(bool b) { return "bool"; } +std::string takes_int(int b) { return "int"; } +std::string takes_double(double b) { return "double"; } + + +BOOST_PYTHON_MODULE(overload_resolution) +{ + def("bid", takes_bool); + def("bid", takes_int); + def("bid", takes_double); + + def("dib", takes_double); + def("dib", takes_int); + def("dib", takes_bool); + + def("idb", takes_int); + def("idb", takes_double); + def("idb", takes_bool); + + def("bdi", takes_bool); + def("bdi", takes_double); + def("bdi", takes_int); +} + diff --git a/pxr/external/boost/python/test/test_pointer_adoption.cpp b/pxr/external/boost/python/test/test_pointer_adoption.cpp new file mode 100644 index 0000000000..a4e14af5d2 --- /dev/null +++ b/pxr/external/boost/python/test/test_pointer_adoption.cpp @@ -0,0 +1,125 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#include +#include +#include +#include +#include +#include + +using namespace boost::python; + +int a_instances = 0; + +int num_a_instances() { return a_instances; } + +struct inner +{ + inner(std::string const& s) + : s(s) + {} + + void change(std::string const& new_s) + { + this->s = new_s; + } + + std::string s; +}; + +struct Base +{ + virtual ~Base() {} +}; + +struct A : Base +{ + A(std::string const& s) + : x(s) + { + ++a_instances; + } + + ~A() + { + --a_instances; + } + + std::string content() const + { + return x.s; + } + + inner& get_inner() + { + return x; + } + + inner x; +}; + +struct B +{ + B() : x(0) {} + B(A* x_) : x(x_) {} + + inner const* adopt(A* _x) { this->x = _x; return &_x->get_inner(); } + + std::string a_content() + { + return x ? x->content() : std::string("empty"); + } + + A* x; +}; + + +A* create(std::string const& s) +{ + return new A(s); +} + +A* as_A(Base* b) +{ + return dynamic_cast(b); +} + +BOOST_PYTHON_MODULE(test_pointer_adoption_ext) +{ + def("num_a_instances", num_a_instances); + + // Specify the manage_new_object return policy to take + // ownership of create's result + def("create", create, return_value_policy()); + + def("as_A", as_A, return_internal_reference<>()); + + class_("Base") + ; + + class_ >("A", no_init) + .def("content", &A::content) + .def("get_inner", &A::get_inner, return_internal_reference<>()) + ; + + class_("inner", no_init) + .def("change", &inner::change) + ; + + class_("B") + .def(init()[with_custodian_and_ward_postcall<1,2>()]) + + .def("adopt", &B::adopt + // Adopt returns a pointer referring to a subobject of its 2nd argument (1st being "self") + , return_internal_reference<2 + // Meanwhile, self holds a reference to the 2nd argument. + , with_custodian_and_ward<1,2> >() + ) + + .def("a_content", &B::a_content) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/test_pointer_adoption.py b/pxr/external/boost/python/test/test_pointer_adoption.py new file mode 100644 index 0000000000..0fdf3b98e9 --- /dev/null +++ b/pxr/external/boost/python/test/test_pointer_adoption.py @@ -0,0 +1,93 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from test_pointer_adoption_ext import * + +>>> num_a_instances() +0 + +>>> a = create('dynamically allocated') +>>> num_a_instances() +1 + +>>> a.content() +'dynamically allocated' + +>>> innards = a.get_inner() +>>> innards.change('with an exposed reference') +>>> a.content() +'with an exposed reference' + +# The a instance should be kept alive... +>>> a = None +>>> num_a_instances() +1 + +# ...until we're done with its innards +>>> innards = None +>>> num_a_instances() +0 + +>>> b = B() +>>> a = create('another') +>>> b.a_content() +'empty' +>>> innards = b.adopt(a); +>>> b.a_content() +'another' +>>> num_a_instances() +1 +>>> del a # innards and b are both holding a reference +>>> num_a_instances() +1 +>>> innards.change('yet another') +>>> b.a_content() +'yet another' + +>>> del innards +>>> num_a_instances() # b still owns a reference to a +1 +>>> del b +>>> num_a_instances() +0 + +Test call policies for constructors here + +>>> a = create('second a') +>>> num_a_instances() +1 +>>> b = B(a) +>>> num_a_instances() +1 +>>> a.content() +'second a' + +>>> del a +>>> num_a_instances() +1 +>>> b.a_content() +'second a' + +>>> del b +>>> num_a_instances() +0 + +>>> assert as_A(create('dynalloc')) is not None +>>> base = Base() +>>> assert as_A(base) is None +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/tuple.cpp b/pxr/external/boost/python/test/tuple.cpp new file mode 100644 index 0000000000..d48e91d881 --- /dev/null +++ b/pxr/external/boost/python/test/tuple.cpp @@ -0,0 +1,33 @@ +// Copyright David Abrahams 2005. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +using namespace boost::python; + +object convert_to_tuple(object data) +{ + return tuple(data); +} + +void test_operators(tuple t1, tuple t2, object print) +{ + print(t1 + t2); +} + +tuple mktuple0() { return make_tuple(); } +tuple mktuple1(int x) { return make_tuple(x); } +tuple mktuple2(char const* a1, int x) { return make_tuple(a1, x); } + +BOOST_PYTHON_MODULE(tuple_ext) +{ + def("convert_to_tuple",convert_to_tuple); + def("test_operators",test_operators); + def("make_tuple", mktuple0); + def("make_tuple", mktuple1); + def("make_tuple", mktuple2); +} diff --git a/pxr/external/boost/python/test/tuple.py b/pxr/external/boost/python/test/tuple.py new file mode 100644 index 0000000000..e2cd5eb179 --- /dev/null +++ b/pxr/external/boost/python/test/tuple.py @@ -0,0 +1,39 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +""" +>>> from tuple_ext import * +>>> def printer(*args): +... for x in args: print(x,) +... print('') +... +>>> print(convert_to_tuple("this is a test string")) +('t', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', ' ', 's', 't', 'r', 'i', 'n', 'g') +>>> t1 = convert_to_tuple("this is") +>>> t2 = (1,2,3,4) +>>> test_operators(t1,t2,printer) #doctest: +NORMALIZE_WHITESPACE +('t', 'h', 'i', 's', ' ', 'i', 's', 1, 2, 3, 4) +>>> make_tuple() +() +>>> make_tuple(42) +(42,) +>>> make_tuple('hello', 42) +('hello', 42) +""" + +from __future__ import print_function + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/upcast.cpp b/pxr/external/boost/python/test/upcast.cpp new file mode 100644 index 0000000000..255429f168 --- /dev/null +++ b/pxr/external/boost/python/test/upcast.cpp @@ -0,0 +1,19 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +struct X { long x; }; +struct Y : X, PyObject {}; + +int main() +{ + PyTypeObject o; + Y y; + BOOST_TEST(&Py_REFCNT(boost::python::upcast(&o)) == &Py_REFCNT(&o)); + BOOST_TEST(&Py_REFCNT(boost::python::upcast(&y)) == &Py_REFCNT(&y)); + return boost::report_errors(); +} diff --git a/pxr/external/boost/python/test/vector_indexing_suite.cpp b/pxr/external/boost/python/test/vector_indexing_suite.cpp new file mode 100644 index 0000000000..0f9cd74cae --- /dev/null +++ b/pxr/external/boost/python/test/vector_indexing_suite.cpp @@ -0,0 +1,62 @@ +// Copyright Joel de Guzman 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +using namespace boost::python; + +struct X // a container element +{ + std::string s; + X():s("default") {} + X(std::string s):s(s) {} + std::string repr() const { return s; } + void reset() { s = "reset"; } + void foo() { s = "foo"; } + bool operator==(X const& x) const { return s == x.s; } + bool operator!=(X const& x) const { return s != x.s; } +}; + +std::string x_value(X const& x) +{ + return "gotya " + x.s; +} + +BOOST_PYTHON_MODULE(vector_indexing_suite_ext) +{ + class_("X") + .def(init<>()) + .def(init()) + .def(init()) + .def("__repr__", &X::repr) + .def("reset", &X::reset) + .def("foo", &X::foo) + ; + + def("x_value", x_value); + implicitly_convertible(); + + class_ >("XVec") + .def(vector_indexing_suite >()) + ; + + // Compile check only... + class_ >("FloatVec") + .def(vector_indexing_suite >()) + ; + + // Compile check only... + class_ >("BoolVec") + .def(vector_indexing_suite >()) + ; + + // vector of strings + class_ >("StringVec") + .def(vector_indexing_suite >()) + ; +} + diff --git a/pxr/external/boost/python/test/vector_indexing_suite.py b/pxr/external/boost/python/test/vector_indexing_suite.py new file mode 100644 index 0000000000..478cd01516 --- /dev/null +++ b/pxr/external/boost/python/test/vector_indexing_suite.py @@ -0,0 +1,370 @@ +# Copyright Joel de Guzman 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' + +##################################################################### +# Check an object that we will use as container element +##################################################################### + +>>> from vector_indexing_suite_ext import * +>>> x = X('hi') +>>> x +hi +>>> x.reset() # a member function that modifies X +>>> x +reset +>>> x.foo() # another member function that modifies X +>>> x +foo + +# test that a string is implicitly convertible +# to an X +>>> x_value('bochi bochi') +'gotya bochi bochi' + +##################################################################### +# Iteration +##################################################################### +>>> def print_xvec(xvec): +... s = '[ ' +... for x in xvec: +... s += repr(x) +... s += ' ' +... s += ']' +... print(s) + +##################################################################### +# Replace all the contents using slice syntax +##################################################################### + +>>> v = XVec() +>>> v[:] = [X('a'),X('b'),X('c'),X('d'),X('e')] +>>> print_xvec(v) +[ a b c d e ] + +##################################################################### +# Indexing +##################################################################### +>>> len(v) +5 +>>> v[0] +a +>>> v[1] +b +>>> v[2] +c +>>> v[3] +d +>>> v[4] +e +>>> v[-1] +e +>>> v[-2] +d +>>> v[-3] +c +>>> v[-4] +b +>>> v[-5] +a + +##################################################################### +# Deleting an element +##################################################################### + +>>> del v[0] +>>> v[0] = 'yaba' # must do implicit conversion +>>> print_xvec(v) +[ yaba c d e ] + +##################################################################### +# Calling a mutating function of a container element +##################################################################### +>>> v[3].reset() +>>> v[3] +reset + +##################################################################### +# Copying a container element +##################################################################### +>>> x = X(v[3]) +>>> x +reset +>>> x.foo() +>>> x +foo +>>> v[3] # should not be changed to 'foo' +reset + +##################################################################### +# Referencing a container element +##################################################################### +>>> x = v[3] +>>> x +reset +>>> x.foo() +>>> x +foo +>>> v[3] # should be changed to 'foo' +foo + +##################################################################### +# Slice +##################################################################### + +>>> sl = v[0:2] +>>> print_xvec(sl) +[ yaba c ] +>>> sl[0].reset() +>>> sl[0] +reset + +##################################################################### +# Reset the container again +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # perform implicit conversion to X +>>> print_xvec(v) +[ a b c d e ] + +##################################################################### +# Slice: replace [1:3] with an element +##################################################################### +>>> v[1:3] = X('z') +>>> print_xvec(v) +[ a z d e ] + +##################################################################### +# Slice: replace [0:2] with a list +##################################################################### +>>> v[0:2] = ['1','2','3','4'] # perform implicit conversion to X +>>> print_xvec(v) +[ 1 2 3 4 d e ] + +##################################################################### +# Slice: delete [3:4] +##################################################################### +>>> del v[3:4] +>>> print_xvec(v) +[ 1 2 3 d e ] + +##################################################################### +# Slice: set [3:] to a list +##################################################################### +>>> v[3:] = [X('trailing'), X('stuff')] # a list +>>> print_xvec(v) +[ 1 2 3 trailing stuff ] + +##################################################################### +# Slice: delete [:3] +##################################################################### +>>> del v[:3] +>>> print_xvec(v) +[ trailing stuff ] + +##################################################################### +# Slice: insert a tuple to [0:0] +##################################################################### +>>> v[0:0] = ('leading','stuff') # can also be a tuple +>>> print_xvec(v) +[ leading stuff trailing stuff ] + +##################################################################### +# Reset the container again +##################################################################### +>>> v[:] = ['a','b','c','d','e'] + +##################################################################### +# Some references to the container elements +##################################################################### +>>> z0 = v[0] +>>> z1 = v[1] +>>> z2 = v[2] +>>> z3 = v[3] +>>> z4 = v[4] + +>>> z0 # proxy +a +>>> z1 # proxy +b +>>> z2 # proxy +c +>>> z3 # proxy +d +>>> z4 # proxy +e + +##################################################################### +# Delete a container element +##################################################################### + +>>> del v[2] +>>> print_xvec(v) +[ a b d e ] + +##################################################################### +# Show that the references are still valid +##################################################################### +>>> z0 # proxy +a +>>> z1 # proxy +b +>>> z2 # proxy detached +c +>>> z3 # proxy index adjusted +d +>>> z4 # proxy index adjusted +e + +##################################################################### +# Delete all container elements +##################################################################### +>>> del v[:] +>>> print_xvec(v) +[ ] + +##################################################################### +# Show that the references are still valid +##################################################################### +>>> z0 # proxy detached +a +>>> z1 # proxy detached +b +>>> z2 # proxy detached +c +>>> z3 # proxy detached +d +>>> z4 # proxy detached +e + +##################################################################### +# Reset the container again +##################################################################### +>>> v[:] = ['a','b','c','d','e'] + +##################################################################### +# renew the references to the container elements +##################################################################### +>>> z0 = v[0] +>>> z1 = v[1] +>>> z2 = v[2] +>>> z3 = v[3] +>>> z4 = v[4] + +>>> z0 # proxy +a +>>> z1 # proxy +b +>>> z2 # proxy +c +>>> z3 # proxy +d +>>> z4 # proxy +e + +##################################################################### +# Set [2:4] to a list such that there will be more elements +##################################################################### +>>> v[2:4] = ['x','y','v'] +>>> print_xvec(v) +[ a b x y v e ] + +##################################################################### +# Show that the references are still valid +##################################################################### +>>> z0 # proxy +a +>>> z1 # proxy +b +>>> z2 # proxy detached +c +>>> z3 # proxy detached +d +>>> z4 # proxy index adjusted +e + +##################################################################### +# Contains +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again + +>>> assert 'a' in v +>>> assert 'b' in v +>>> assert 'c' in v +>>> assert 'd' in v +>>> assert 'e' in v +>>> assert not 'X' in v +>>> assert not 12345 in v + +##################################################################### +# Show that iteration allows mutable access to the elements +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again +>>> for x in v: +... x.reset() +>>> print_xvec(v) +[ reset reset reset reset reset ] + +##################################################################### +# append +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again +>>> v.append('f') +>>> print_xvec(v) +[ a b c d e f ] + +##################################################################### +# extend +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again +>>> v.extend(['f','g','h','i','j']) +>>> print_xvec(v) +[ a b c d e f g h i j ] + +##################################################################### +# extend using a generator expression +##################################################################### +>>> v[:] = ['a','b','c','d','e'] # reset again +>>> def generator(): +... addlist = ['f','g','h','i','j'] +... for i in addlist: +... if i != 'g': +... yield i +>>> v.extend(generator()) +>>> print_xvec(v) +[ a b c d e f h i j ] + +##################################################################### +# vector of strings +##################################################################### +>>> sv = StringVec() +>>> sv.append('a') +>>> print(sv[0]) +a + +##################################################################### +# END.... +##################################################################### + +''' + + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print('running...') + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + + + + + diff --git a/pxr/external/boost/python/test/virtual_functions.cpp b/pxr/external/boost/python/test/virtual_functions.cpp new file mode 100644 index 0000000000..774b11b121 --- /dev/null +++ b/pxr/external/boost/python/test/virtual_functions.cpp @@ -0,0 +1,125 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_ENABLE_ASSERT_HANDLER +#include + +using namespace boost::python; + +struct X +{ + explicit X(int x) : x(x), magic(7654321) { ++counter; } + X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; } + virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; } + + void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; } + int value() const { BOOST_ASSERT(magic == 7654321); return x; } + static int count() { return counter; } + private: + void operator=(X const&); + private: + int x; + long magic; + static int counter; +}; + +struct Y : X +{ + Y(int x) : X(x) {}; +}; + +struct abstract : X +{ + abstract(int x) : X(x) {}; + int call_f(Y const& y) { return f(y); } + virtual int f(Y const& y) = 0; + abstract& call_g(Y const& y) { return g(y); } + virtual abstract& g(Y const& y) = 0; +}; + +struct concrete : X +{ + concrete(int x) : X(x) {}; + int call_f(Y const& y) { return f(y); } + virtual int f(Y const& y) { set(y.value()); return y.value(); } +}; + +struct abstract_callback : abstract +{ + abstract_callback(PyObject* p, int x) + : abstract(x), self(p) + {} + + int f(Y const& y) + { + return call_method(self, "f", boost::ref(y)); + } + + abstract& g(Y const& y) + { + return call_method(self, "g", boost::ref(y)); + } + + PyObject* self; +}; + +struct concrete_callback : concrete +{ + concrete_callback(PyObject* p, int x) + : concrete(x), self(p) + {} + + concrete_callback(PyObject* p, concrete const& x) + : concrete(x), self(p) + {} + + int f(Y const& y) + { + return call_method(self, "f", boost::ref(y)); + } + + int f_impl(Y const& y) + { + return this->concrete::f(y); + } + + PyObject* self; +}; + +int X::counter; + +BOOST_PYTHON_MODULE(virtual_functions_ext) +{ + class_("concrete", init()) + .def("value", &concrete::value) + .def("set", &concrete::set) + .def("call_f", &concrete::call_f) + .def("f", &concrete_callback::f_impl) + ; + + class_("abstract", init()) + + .def("value", &abstract::value) + .def("call_f", &abstract::call_f) + .def("call_g", &abstract::call_g, return_internal_reference<>()) + .def("set", &abstract::set) + ; + + class_("Y", init()) + .def("value", &Y::value) + .def("set", &Y::set) + ; +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/virtual_functions.py b/pxr/external/boost/python/test/virtual_functions.py new file mode 100644 index 0000000000..cba21edd62 --- /dev/null +++ b/pxr/external/boost/python/test/virtual_functions.py @@ -0,0 +1,110 @@ +# Copyright David Abrahams 2004. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from virtual_functions_ext import * + +>>> class C1(concrete): +... def f(self, y): +... return concrete.f(self, Y(-y.value())) + +>>> class C2(concrete): +... pass + +>>> class A1(abstract): +... def f(self, y): +... return y.value() * 2 +... def g(self, y): +... return self + +>>> class A2(abstract): +... pass + + +>>> y1 = Y(16) +>>> y2 = Y(17) + + + +# +# Test abstract with f,g overridden +# +>>> a1 = A1(42) +>>> a1.value() +42 + +# Call f,g indirectly from C++ +>>> a1.call_f(y1) +32 +>>> assert type(a1.call_g(y1)) is abstract + +# Call f directly from Python +>>> a1.f(y2) +34 + +# +# Test abstract with f not overridden +# +>>> a2 = A2(42) +>>> a2.value() +42 + +# Call f indirectly from C++ +>>> try: a2.call_f(y1) +... except AttributeError: pass +... else: print('no exception') + +# Call f directly from Python +>>> try: a2.call_f(y2) +... except AttributeError: pass +... else: print('no exception') + +############# Concrete Tests ############ + +# +# Test concrete with f overridden +# +>>> c1 = C1(42) +>>> c1.value() +42 + +# Call f indirectly from C++ +>>> c1.call_f(y1) +-16 + +# Call f directly from Python +>>> c1.f(y2) +-17 + +# +# Test concrete with f not overridden +# +>>> c2 = C2(42) +>>> c2.value() +42 + +# Call f indirectly from C++ +>>> c2.call_f(y1) +16 + +# Call f directly from Python +>>> c2.f(y2) +17 + + +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/voidptr.cpp b/pxr/external/boost/python/test/voidptr.cpp new file mode 100644 index 0000000000..82e412beaa --- /dev/null +++ b/pxr/external/boost/python/test/voidptr.cpp @@ -0,0 +1,43 @@ +// Copyright Niall Douglas 2005. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +# include +# include +# include +# include + +static void *test=(void *) 78; + +void *get() +{ + return test; +} + +void *getnull() +{ + return 0; +} + +void use(void *a) +{ + if(a!=test) + throw std::runtime_error(std::string("failed")); +} + +int useany(void *a) +{ + return a ? 1 : 0; +} + + +namespace bpl = boost::python; + +BOOST_PYTHON_MODULE(voidptr_ext) +{ + bpl::def("get", &::get, bpl::return_value_policy()); + bpl::def("getnull", &::getnull, bpl::return_value_policy()); + bpl::def("use", &::use); + bpl::def("useany", &::useany); +} diff --git a/pxr/external/boost/python/test/voidptr.py b/pxr/external/boost/python/test/voidptr.py new file mode 100644 index 0000000000..0e189c9655 --- /dev/null +++ b/pxr/external/boost/python/test/voidptr.py @@ -0,0 +1,54 @@ +# Copyright Niall Douglas 2005. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + + +""" +>>> from voidptr_ext import * + + + Check for correct conversion + +>>> use(get()) + + Check that None is converted to a NULL void pointer + +>>> useany(get()) +1 +>>> useany(None) +0 + + Check that we don't lose type information by converting NULL + opaque pointers to None + +>>> assert getnull() is None +>>> useany(getnull()) +0 + + Check that there is no conversion from integers ... + +>>> try: use(0) +... except TypeError: pass +... else: print('expected a TypeError') + + ... and from strings to opaque objects + +>>> try: use("") +... except TypeError: pass +... else: print('expected a TypeError') +""" +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) diff --git a/pxr/external/boost/python/test/wrapper_held_type.cpp b/pxr/external/boost/python/test/wrapper_held_type.cpp new file mode 100644 index 0000000000..e99422796e --- /dev/null +++ b/pxr/external/boost/python/test/wrapper_held_type.cpp @@ -0,0 +1,69 @@ +// Copyright David Abrahams 2005. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +#include + +struct data +{ + virtual ~data() {}; // silence compiler warnings + virtual int id() const + { + return 42; + } +}; + +std::auto_ptr create_data() +{ + return std::auto_ptr( new data ); +} + +void do_nothing( std::auto_ptr& ){} + + +namespace bp = boost::python; + +struct data_wrapper : data, bp::wrapper< data > +{ + data_wrapper(data const & arg ) + : data( arg ) + , bp::wrapper< data >() + {} + + data_wrapper() + : data() + , bp::wrapper< data >() + {} + + virtual int id() const + { + if( bp::override id = this->get_override( "id" ) ) + return bp::call(id.ptr()); // id(); + else + return data::id( ); + } + + virtual int default_id( ) const + { + return this->data::id( ); + } + +}; + +BOOST_PYTHON_MODULE(wrapper_held_type_ext) +{ + bp::class_< data_wrapper, std::auto_ptr< data > >( "data" ) + .def( "id", &data::id, &::data_wrapper::default_id ); + + bp::def( "do_nothing", &do_nothing ); + bp::def( "create_data", &create_data ); +} + +#include "module_tail.cpp" diff --git a/pxr/external/boost/python/test/wrapper_held_type.py b/pxr/external/boost/python/test/wrapper_held_type.py new file mode 100644 index 0000000000..ff1bd1d245 --- /dev/null +++ b/pxr/external/boost/python/test/wrapper_held_type.py @@ -0,0 +1,34 @@ +# Copyright David Abrahams 2005. Distributed under the Boost +# Software License, Version 1.0. (See accompanying +# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +''' +>>> from wrapper_held_type_ext import * +>>> d = data() +>>> print(d.id()) +42 +>>> do_nothing( d ) +>>> print(d.id()) +42 +>>> d = create_data() +>>> print(d.id()) +42 +>>> do_nothing( d ) +>>> print(d.id()) +42 +''' + +def run(args = None): + import sys + import doctest + + if args is not None: + sys.argv = args + return doctest.testmod(sys.modules.get(__name__)) + +if __name__ == '__main__': + print("running...") + import sys + status = run()[0] + if (status == 0): print("Done.") + sys.exit(status) + diff --git a/pxr/external/boost/python/to_python_converter.hpp b/pxr/external/boost/python/to_python_converter.hpp new file mode 100644 index 0000000000..4391b6dce9 --- /dev/null +++ b/pxr/external/boost/python/to_python_converter.hpp @@ -0,0 +1,94 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TO_PYTHON_CONVERTER_DWA200221_HPP +# define TO_PYTHON_CONVERTER_DWA200221_HPP + +# include + +# include +# include +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif +# include + +namespace boost { namespace python { + +#if 0 //get_pytype member detection +namespace detail +{ + typedef char yes_type; + typedef struct {char a[2]; } no_type; + template struct test_get_pytype1 { }; + template struct test_get_pytype2 { }; + + template yes_type tester(test_get_pytype1<&T::get_pytype>*); + + template yes_type tester(test_get_pytype2<&T::get_pytype>*); + + template no_type tester(...); + + template + struct test_get_pytype_base + { + BOOST_STATIC_CONSTANT(bool, value= (sizeof(detail::tester(0)) == sizeof(yes_type))); + }; + + template + struct test_get_pytype : boost::mpl::bool_::value> + { + }; + +} +#endif + +template < class T, class Conversion, bool has_get_pytype=false > +struct to_python_converter +{ +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + typedef boost::mpl::bool_ HasGetPytype; + + static PyTypeObject const* get_pytype_1(boost::mpl::true_ *) + { + return Conversion::get_pytype(); + } + + static PyTypeObject const* get_pytype_1(boost::mpl::false_ *) + { + return 0; + } + static PyTypeObject const* get_pytype_impl() + { + return get_pytype_1((HasGetPytype*)0); + } +#endif + + to_python_converter(); +}; + +// +// implementation +// + +template +to_python_converter::to_python_converter() +{ + typedef converter::as_to_python_function< + T, Conversion + > normalized; + + converter::registry::insert( + &normalized::convert + , type_id() +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + , &get_pytype_impl +#endif + ); +} + +}} // namespace boost::python + +#endif // TO_PYTHON_CONVERTER_DWA200221_HPP + diff --git a/pxr/external/boost/python/to_python_indirect.hpp b/pxr/external/boost/python/to_python_indirect.hpp new file mode 100644 index 0000000000..0a19aca5ff --- /dev/null +++ b/pxr/external/boost/python/to_python_indirect.hpp @@ -0,0 +1,112 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TO_PYTHON_INDIRECT_DWA200221_HPP +# define TO_PYTHON_INDIRECT_DWA200221_HPP + +# include + +# include +# include + +# include + +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +# include +#endif + +# include + +# include + +# if defined(__ICL) && __ICL < 600 +# include +# else +# include +# endif + +namespace boost { namespace python { + +template +struct to_python_indirect +{ + template + inline PyObject* + operator()(U const& ref) const + { + return this->execute(const_cast(ref), detail::is_pointer()); + } +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + inline PyTypeObject const* + get_pytype()const + { + return converter::registered_pytype::get_pytype(); + } +#endif + private: + template + inline PyObject* execute(U* ptr, detail::true_) const + { + // No special NULL treatment for references + if (ptr == 0) + return python::detail::none(); + else + return this->execute(*ptr, detail::false_()); + } + + template + inline PyObject* execute(U const& x, detail::false_) const + { + U* const p = &const_cast(x); + if (detail::is_polymorphic::value) + { + if (PyObject* o = detail::wrapper_base_::owner(p)) + return incref(o); + } + return MakeHolder::execute(p); + } +}; + +// +// implementations +// +namespace detail +{ + struct make_owning_holder + { + template + static PyObject* execute(T* p) + { + // can't use auto_ptr with Intel 5 and VC6 Dinkum library + // for some reason. We get link errors against the auto_ptr + // copy constructor. +# if defined(__ICL) && __ICL < 600 + typedef boost::shared_ptr smart_pointer; +# elif defined(BOOST_NO_CXX11_SMART_PTR) + typedef std::auto_ptr smart_pointer; +# else + typedef std::unique_ptr smart_pointer; +# endif + typedef objects::pointer_holder holder_t; + + smart_pointer ptr(const_cast(p)); + return objects::make_ptr_instance::execute(ptr); + } + }; + + struct make_reference_holder + { + template + static PyObject* execute(T* p) + { + typedef objects::pointer_holder holder_t; + T* q = const_cast(p); + return objects::make_ptr_instance::execute(q); + } + }; +} + +}} // namespace boost::python + +#endif // TO_PYTHON_INDIRECT_DWA200221_HPP diff --git a/pxr/external/boost/python/to_python_value.hpp b/pxr/external/boost/python/to_python_value.hpp new file mode 100644 index 0000000000..b6ec0135ba --- /dev/null +++ b/pxr/external/boost/python/to_python_value.hpp @@ -0,0 +1,177 @@ +// Copyright David Abrahams 2002. +// Copyright Stefan Seefeld 2016. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef boost_python_to_python_value_hpp_ +#define boost_python_to_python_value_hpp_ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace boost { namespace python { + +namespace detail +{ +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + +template +struct object_manager_get_pytype +{ + template + static PyTypeObject const* get( U& (*)() =0) + { + return converter::object_manager_traits::get_pytype(); + } +}; + +template <> +struct object_manager_get_pytype +{ + template + static PyTypeObject const* get( U const& (*)() =0) + { + return converter::object_manager_traits::get_pytype(); + } +}; + +#endif + + template + struct object_manager_to_python_value + { + typedef typename value_arg::type argument_type; + + PyObject* operator()(argument_type) const; +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + typedef boost::mpl::bool_::value> is_t_handle; + typedef boost::detail::indirect_traits::is_reference_to_const is_t_const; + PyTypeObject const* get_pytype() const { + return get_pytype_aux((is_t_handle*)0); + } + + inline static PyTypeObject const* get_pytype_aux(mpl::true_*) {return converter::object_manager_traits::get_pytype();} + + inline static PyTypeObject const* get_pytype_aux(mpl::false_* ) + { + return object_manager_get_pytype::get((T(*)())0); + } + +#endif + + // This information helps make_getter() decide whether to try to + // return an internal reference or not. I don't like it much, + // but it will have to serve for now. + BOOST_STATIC_CONSTANT(bool, uses_registry = false); + }; + + + template + struct registry_to_python_value + { + typedef typename value_arg::type argument_type; + + PyObject* operator()(argument_type) const; +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + PyTypeObject const* get_pytype() const {return converter::registered::converters.to_python_target_type();} +#endif + + // This information helps make_getter() decide whether to try to + // return an internal reference or not. I don't like it much, + // but it will have to serve for now. + BOOST_STATIC_CONSTANT(bool, uses_registry = true); + }; + + template + struct shared_ptr_to_python_value + { + typedef typename value_arg::type argument_type; + + PyObject* operator()(argument_type) const; +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + PyTypeObject const* get_pytype() const {return get_pytype((boost::type*)0);} +#endif + // This information helps make_getter() decide whether to try to + // return an internal reference or not. I don't like it much, + // but it will have to serve for now. + BOOST_STATIC_CONSTANT(bool, uses_registry = false); + private: +#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + template + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + template + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} +# if !defined(BOOST_NO_CXX11_SMART_PTR) + template + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + template + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} +# endif +#endif + }; +} + +template +struct to_python_value + : mpl::if_< + detail::value_is_shared_ptr + , detail::shared_ptr_to_python_value + , typename mpl::if_< + mpl::or_< + converter::is_object_manager + , converter::is_reference_to_object_manager + > + , detail::object_manager_to_python_value + , detail::registry_to_python_value + >::type + >::type +{ +}; + +// +// implementation +// +namespace detail +{ + template + inline PyObject* registry_to_python_value::operator()(argument_type x) const + { + return converter::registered::converters.to_python(&x); + } + + template + inline PyObject* object_manager_to_python_value::operator()(argument_type x) const + { + return python::upcast( + python::xincref( + get_managed_object(x, tag)) + ); + } + + template + inline PyObject* shared_ptr_to_python_value::operator()(argument_type x) const + { + return converter::shared_ptr_to_python(x); + } +} + +}} // namespace boost::python + +#endif diff --git a/pxr/external/boost/python/tuple.hpp b/pxr/external/boost/python/tuple.hpp new file mode 100644 index 0000000000..babfb63f1e --- /dev/null +++ b/pxr/external/boost/python/tuple.hpp @@ -0,0 +1,70 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TUPLE_20020706_HPP +#define TUPLE_20020706_HPP + +# include + +#include +#include +#include +#include + +namespace boost { namespace python { + +namespace detail +{ + struct BOOST_PYTHON_DECL tuple_base : object + { + protected: + tuple_base(); + tuple_base(object_cref sequence); + + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple_base, object) + + private: + static detail::new_reference call(object const&); + }; +} + +class tuple : public detail::tuple_base +{ + typedef detail::tuple_base base; + public: + tuple() {} + + template + explicit tuple(T const& sequence) + : base(object(sequence)) + { + } + + public: // implementation detail -- for internal use only + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple, base) +}; + +// +// Converter Specializations // $$$ JDG $$$ moved here to prevent +// // G++ bug complaining specialization + // provided after instantiation +namespace converter +{ + template <> + struct object_manager_traits + : pytype_object_manager_traits<&PyTuple_Type,tuple> + { + }; +} + +// for completeness +inline tuple make_tuple() { return tuple(); } + +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, )) +# include BOOST_PP_ITERATE() + +}} // namespace boost::python + +#endif + diff --git a/pxr/external/boost/python/type_id.hpp b/pxr/external/boost/python/type_id.hpp new file mode 100644 index 0000000000..601601c311 --- /dev/null +++ b/pxr/external/boost/python/type_id.hpp @@ -0,0 +1,184 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef TYPE_ID_DWA2002517_HPP +# define TYPE_ID_DWA2002517_HPP + +# include + +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# if defined(__GNUC__) \ + && !defined(__EDG_VERSION__) +# define BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# endif +# endif + +namespace boost { namespace python { + +// for this compiler at least, cross-shared-library type_info +// comparisons don't work, so use typeid(x).name() instead. It's not +// yet clear what the best default strategy is. +# if defined(__GNUC__) \ + || defined(_AIX) \ + || ( defined(__sgi) && defined(__host_mips)) \ + || (defined(__hpux) && defined(__HP_aCC)) \ + || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) +# define BOOST_PYTHON_TYPE_ID_NAME +# endif + +#ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +// Runtime detection of broken cxxabi::__cxa_demangle versions, +// to avoid #ifdef clutter. +bool cxxabi_cxa_demangle_is_broken(); +#define BOOST_PYTHON_HAVE_CXXABI_CXA_DEMANGLE_IS_BROKEN +#endif + +// type ids which represent the same information as std::type_info +// (i.e. the top-level reference and cv-qualifiers are stripped), but +// which works across shared libraries. +struct type_info : private totally_ordered +{ + inline type_info(std::type_info const& = typeid(void)); + + inline bool operator<(type_info const& rhs) const; + inline bool operator==(type_info const& rhs) const; + + char const* name() const; + friend BOOST_PYTHON_DECL std::ostream& operator<<( + std::ostream&, type_info const&); + + private: // data members +# ifdef BOOST_PYTHON_TYPE_ID_NAME + typedef char const* base_id_t; +# else + typedef std::type_info const* base_id_t; +# endif + + base_id_t m_base_type; +}; + + +// This macro is obsolete. Port away and remove. +# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) + +template +inline type_info type_id() +{ + return type_info( +# if !defined(_MSC_VER) \ + || !BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) + typeid(T) +# else // strip the decoration which Intel mistakenly leaves in + python::detail::msvc_typeid((boost::type*)0) +# endif + ); +} + +# if (defined(__EDG_VERSION__) && __EDG_VERSION__ < 245) \ + || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 744) +// Older EDG-based compilers seems to mistakenly distinguish "int" from +// "signed int", etc., but only in typeid() expressions. However +// though int == signed int, the "signed" decoration is propagated +// down into template instantiations. Explicit specialization stops +// that from taking hold. + +# define BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \ +template <> \ +inline type_info type_id() \ +{ \ + return type_info(typeid(T)); \ +} + +BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(short) +BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(int) +BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long) +// using Python's macro instead of Boost's - we don't seem to get the +// config right all the time. +# ifdef HAVE_LONG_LONG +BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long long) +# endif +# undef BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID +# endif + +// +inline type_info::type_info(std::type_info const& id) + : m_base_type( +# ifdef BOOST_PYTHON_TYPE_ID_NAME + id.name() +# else + &id +# endif + ) +{ +} + +inline bool type_info::operator<(type_info const& rhs) const +{ +# ifdef BOOST_PYTHON_TYPE_ID_NAME + return std::strcmp(m_base_type, rhs.m_base_type) < 0; +# else + return m_base_type->before(*rhs.m_base_type); +# endif +} + +inline bool type_info::operator==(type_info const& rhs) const +{ +# ifdef BOOST_PYTHON_TYPE_ID_NAME + return !std::strcmp(m_base_type, rhs.m_base_type); +# else + return *m_base_type == *rhs.m_base_type; +# endif +} + +# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +namespace detail +{ + BOOST_PYTHON_DECL char const* gcc_demangle(char const*); +} +# endif + +inline char const* type_info::name() const +{ + char const* raw_name + = m_base_type +# ifndef BOOST_PYTHON_TYPE_ID_NAME + ->name() +# endif + ; + +# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE + return detail::gcc_demangle(raw_name); +# else + return raw_name; +# endif +} + + +BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, type_info const&); + +template<> +inline type_info type_id() +{ + return type_info (typeid (void *)); +} +# ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template<> +inline type_info type_id() +{ + return type_info (typeid (void *)); +} +# endif + +}} // namespace boost::python + +#endif // TYPE_ID_DWA2002517_HPP diff --git a/pxr/external/boost/python/with_custodian_and_ward.hpp b/pxr/external/boost/python/with_custodian_and_ward.hpp new file mode 100644 index 0000000000..3431c6f22c --- /dev/null +++ b/pxr/external/boost/python/with_custodian_and_ward.hpp @@ -0,0 +1,121 @@ +// Copyright David Abrahams 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP +# define WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP + +# include + +# include +# include +# include + +namespace boost { namespace python { + +namespace detail +{ + template + struct get_prev + { + template + static PyObject* execute(ArgumentPackage const& args, PyObject* = 0) + { + int const pre_n = static_cast(N) - 1; // separate line is gcc-2.96 workaround + return detail::get(mpl::int_(), args); + } + }; + template <> + struct get_prev<0> + { + template + static PyObject* execute(ArgumentPackage const&, PyObject* zeroth) + { + return zeroth; + } + }; +} +template < + std::size_t custodian + , std::size_t ward + , class BasePolicy_ = default_call_policies +> +struct with_custodian_and_ward : BasePolicy_ +{ + BOOST_STATIC_ASSERT(custodian != ward); + BOOST_STATIC_ASSERT(custodian > 0); + BOOST_STATIC_ASSERT(ward > 0); + + template + static bool precall(ArgumentPackage const& args_) + { + unsigned arity_ = detail::arity(args_); + if (custodian > arity_ || ward > arity_) + { + PyErr_SetString( + PyExc_IndexError + , "boost::python::with_custodian_and_ward: argument index out of range" + ); + return false; + } + + PyObject* patient = detail::get_prev::execute(args_); + PyObject* nurse = detail::get_prev::execute(args_); + + PyObject* life_support = python::objects::make_nurse_and_patient(nurse, patient); + if (life_support == 0) + return false; + + bool result = BasePolicy_::precall(args_); + + if (!result) { + Py_DECREF(life_support); + } + + return result; + } +}; + +template +struct with_custodian_and_ward_postcall : BasePolicy_ +{ + BOOST_STATIC_ASSERT(custodian != ward); + + template + static PyObject* postcall(ArgumentPackage const& args_, PyObject* result) + { + std::size_t arity_ = detail::arity(args_); + // check if either custodian or ward exceeds the arity + // (this weird formulation avoids "always false" warnings + // for arity_ = 0) + if ( (std::max)(custodian, ward) > arity_ ) + { + PyErr_SetString( + PyExc_IndexError + , "boost::python::with_custodian_and_ward_postcall: argument index out of range" + ); + return 0; + } + + PyObject* patient = detail::get_prev::execute(args_, result); + PyObject* nurse = detail::get_prev::execute(args_, result); + + if (nurse == 0) return 0; + + result = BasePolicy_::postcall(args_, result); + if (result == 0) + return 0; + + if (python::objects::make_nurse_and_patient(nurse, patient) == 0) + { + Py_XDECREF(result); + return 0; + } + return result; + } +}; + + +}} // namespace boost::python + +#endif // WITH_CUSTODIAN_AND_WARD_DWA2002131_HPP diff --git a/pxr/external/boost/python/wrapper.hpp b/pxr/external/boost/python/wrapper.hpp new file mode 100644 index 0000000000..166c8e2327 --- /dev/null +++ b/pxr/external/boost/python/wrapper.hpp @@ -0,0 +1,35 @@ +// Copyright David Abrahams 2004. Distributed under the Boost +// Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef WRAPPER_DWA2004720_HPP +# define WRAPPER_DWA2004720_HPP + +# include +# include +# include +# include + +namespace boost { namespace python { + +template +class wrapper : public detail::wrapper_base +{ + public: + // Do not touch this implementation detail! + typedef T _wrapper_wrapped_type_; + + protected: + override get_override(char const* name) const + { + typedef detail::wrapper_base base; + converter::registration const& r + = converter::registered::converters; + PyTypeObject* type = r.get_class_object(); + + return this->base::get_override(name, type); + } +}; + +}} // namespace boost::python + +#endif // WRAPPER_DWA2004720_HPP From faf48be177f6d1adac5eafe418ba7b4988904ad1 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 13 Aug 2024 13:33:58 -0700 Subject: [PATCH 046/202] python: Add open-source license to embedded boost::python (Internal change: 2336135) --- pxr/external/boost/python.hpp | 5 +++++ pxr/external/boost/python/arg_from_python.hpp | 5 +++++ pxr/external/boost/python/args.hpp | 5 +++++ pxr/external/boost/python/args_fwd.hpp | 5 +++++ pxr/external/boost/python/back_reference.hpp | 5 +++++ pxr/external/boost/python/base_type_traits.hpp | 5 +++++ pxr/external/boost/python/bases.hpp | 5 +++++ pxr/external/boost/python/borrowed.hpp | 5 +++++ pxr/external/boost/python/call.hpp | 5 +++++ pxr/external/boost/python/call_method.hpp | 5 +++++ pxr/external/boost/python/cast.hpp | 5 +++++ pxr/external/boost/python/class.hpp | 5 +++++ pxr/external/boost/python/class_fwd.hpp | 5 +++++ pxr/external/boost/python/converter/arg_from_python.hpp | 5 +++++ pxr/external/boost/python/converter/arg_to_python.hpp | 5 +++++ pxr/external/boost/python/converter/arg_to_python_base.hpp | 5 +++++ .../boost/python/converter/as_to_python_function.hpp | 5 +++++ pxr/external/boost/python/converter/builtin_converters.hpp | 5 +++++ pxr/external/boost/python/converter/constructor_function.hpp | 5 +++++ .../boost/python/converter/context_result_converter.hpp | 5 +++++ pxr/external/boost/python/converter/convertible_function.hpp | 5 +++++ pxr/external/boost/python/converter/from_python.hpp | 5 +++++ pxr/external/boost/python/converter/implicit.hpp | 5 +++++ .../boost/python/converter/obj_mgr_arg_from_python.hpp | 5 +++++ pxr/external/boost/python/converter/object_manager.hpp | 5 +++++ pxr/external/boost/python/converter/pointer_type_id.hpp | 5 +++++ pxr/external/boost/python/converter/pyobject_traits.hpp | 5 +++++ pxr/external/boost/python/converter/pyobject_type.hpp | 5 +++++ pxr/external/boost/python/converter/pytype_function.hpp | 5 +++++ .../boost/python/converter/pytype_object_mgr_traits.hpp | 5 +++++ pxr/external/boost/python/converter/registered.hpp | 5 +++++ pxr/external/boost/python/converter/registered_pointee.hpp | 5 +++++ pxr/external/boost/python/converter/registrations.hpp | 5 +++++ pxr/external/boost/python/converter/registry.hpp | 5 +++++ pxr/external/boost/python/converter/return_from_python.hpp | 5 +++++ .../boost/python/converter/rvalue_from_python_data.hpp | 5 +++++ pxr/external/boost/python/converter/shared_ptr_deleter.hpp | 5 +++++ .../boost/python/converter/shared_ptr_from_python.hpp | 5 +++++ pxr/external/boost/python/converter/shared_ptr_to_python.hpp | 5 +++++ .../boost/python/converter/to_python_function_type.hpp | 5 +++++ pxr/external/boost/python/copy_const_reference.hpp | 5 +++++ pxr/external/boost/python/copy_non_const_reference.hpp | 5 +++++ pxr/external/boost/python/data_members.hpp | 5 +++++ pxr/external/boost/python/def.hpp | 5 +++++ pxr/external/boost/python/def_visitor.hpp | 5 +++++ pxr/external/boost/python/default_call_policies.hpp | 5 +++++ pxr/external/boost/python/detail/aix_init_module.hpp | 5 +++++ pxr/external/boost/python/detail/api_placeholder.hpp | 5 +++++ pxr/external/boost/python/detail/borrowed_ptr.hpp | 5 +++++ pxr/external/boost/python/detail/caller.hpp | 5 +++++ pxr/external/boost/python/detail/config.hpp | 5 +++++ pxr/external/boost/python/detail/construct.hpp | 5 +++++ pxr/external/boost/python/detail/convertible.hpp | 5 +++++ pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp | 5 +++++ pxr/external/boost/python/detail/cv_category.hpp | 5 +++++ pxr/external/boost/python/detail/dealloc.hpp | 5 +++++ pxr/external/boost/python/detail/decorated_type_id.hpp | 5 +++++ pxr/external/boost/python/detail/decref_guard.hpp | 5 +++++ pxr/external/boost/python/detail/def_helper.hpp | 5 +++++ pxr/external/boost/python/detail/def_helper_fwd.hpp | 5 +++++ pxr/external/boost/python/detail/defaults_def.hpp | 4 ++++ pxr/external/boost/python/detail/defaults_gen.hpp | 4 ++++ pxr/external/boost/python/detail/dependent.hpp | 5 +++++ pxr/external/boost/python/detail/destroy.hpp | 5 +++++ pxr/external/boost/python/detail/enable_if.hpp | 5 +++++ pxr/external/boost/python/detail/exception_handler.hpp | 5 +++++ pxr/external/boost/python/detail/force_instantiate.hpp | 5 +++++ pxr/external/boost/python/detail/if_else.hpp | 5 +++++ pxr/external/boost/python/detail/indirect_traits.hpp | 5 +++++ pxr/external/boost/python/detail/invoke.hpp | 5 +++++ pxr/external/boost/python/detail/is_auto_ptr.hpp | 5 +++++ pxr/external/boost/python/detail/is_shared_ptr.hpp | 5 +++++ pxr/external/boost/python/detail/is_wrapper.hpp | 5 +++++ pxr/external/boost/python/detail/is_xxx.hpp | 5 +++++ pxr/external/boost/python/detail/make_keyword_range_fn.hpp | 5 +++++ pxr/external/boost/python/detail/make_tuple.hpp | 5 +++++ pxr/external/boost/python/detail/map_entry.hpp | 5 +++++ pxr/external/boost/python/detail/mpl_lambda.hpp | 5 +++++ pxr/external/boost/python/detail/msvc_typeinfo.hpp | 5 +++++ pxr/external/boost/python/detail/none.hpp | 5 +++++ pxr/external/boost/python/detail/not_specified.hpp | 5 +++++ .../boost/python/detail/nullary_function_adaptor.hpp | 5 +++++ pxr/external/boost/python/detail/operator_id.hpp | 5 +++++ pxr/external/boost/python/detail/overloads_fwd.hpp | 5 +++++ pxr/external/boost/python/detail/pointee.hpp | 5 +++++ pxr/external/boost/python/detail/prefix.hpp | 5 +++++ pxr/external/boost/python/detail/preprocessor.hpp | 5 +++++ pxr/external/boost/python/detail/python_type.hpp | 5 +++++ pxr/external/boost/python/detail/raw_pyobject.hpp | 5 +++++ pxr/external/boost/python/detail/referent_storage.hpp | 5 +++++ pxr/external/boost/python/detail/result.hpp | 5 +++++ pxr/external/boost/python/detail/scope.hpp | 5 +++++ pxr/external/boost/python/detail/sfinae.hpp | 5 +++++ pxr/external/boost/python/detail/signature.hpp | 5 +++++ pxr/external/boost/python/detail/string_literal.hpp | 5 +++++ pxr/external/boost/python/detail/target.hpp | 5 +++++ pxr/external/boost/python/detail/translate_exception.hpp | 5 +++++ pxr/external/boost/python/detail/type_list.hpp | 5 +++++ pxr/external/boost/python/detail/type_list_impl.hpp | 5 +++++ pxr/external/boost/python/detail/type_traits.hpp | 5 +++++ pxr/external/boost/python/detail/unwind_type.hpp | 5 +++++ pxr/external/boost/python/detail/unwrap_type_id.hpp | 5 +++++ pxr/external/boost/python/detail/unwrap_wrapper.hpp | 5 +++++ pxr/external/boost/python/detail/value_arg.hpp | 5 +++++ pxr/external/boost/python/detail/value_is_shared_ptr.hpp | 5 +++++ pxr/external/boost/python/detail/value_is_xxx.hpp | 5 +++++ pxr/external/boost/python/detail/void_ptr.hpp | 5 +++++ pxr/external/boost/python/detail/void_return.hpp | 5 +++++ pxr/external/boost/python/detail/wrap_python.hpp | 5 +++++ pxr/external/boost/python/detail/wrapper_base.hpp | 5 +++++ pxr/external/boost/python/dict.hpp | 5 +++++ pxr/external/boost/python/docstring_options.hpp | 5 +++++ pxr/external/boost/python/enum.hpp | 5 +++++ pxr/external/boost/python/errors.hpp | 5 +++++ pxr/external/boost/python/exception_translator.hpp | 5 +++++ pxr/external/boost/python/exec.hpp | 5 +++++ pxr/external/boost/python/extract.hpp | 5 +++++ pxr/external/boost/python/handle.hpp | 5 +++++ pxr/external/boost/python/handle_fwd.hpp | 5 +++++ pxr/external/boost/python/has_back_reference.hpp | 5 +++++ pxr/external/boost/python/implicit.hpp | 5 +++++ pxr/external/boost/python/import.hpp | 5 +++++ pxr/external/boost/python/init.hpp | 4 ++++ pxr/external/boost/python/instance_holder.hpp | 5 +++++ pxr/external/boost/python/iterator.hpp | 5 +++++ pxr/external/boost/python/list.hpp | 5 +++++ pxr/external/boost/python/long.hpp | 5 +++++ pxr/external/boost/python/lvalue_from_pytype.hpp | 5 +++++ pxr/external/boost/python/make_constructor.hpp | 5 +++++ pxr/external/boost/python/make_function.hpp | 5 +++++ pxr/external/boost/python/manage_new_object.hpp | 5 +++++ pxr/external/boost/python/module.hpp | 5 +++++ pxr/external/boost/python/module_init.hpp | 5 +++++ pxr/external/boost/python/numpy.hpp | 5 +++++ pxr/external/boost/python/numpy/config.hpp | 5 +++++ pxr/external/boost/python/numpy/dtype.hpp | 5 +++++ pxr/external/boost/python/numpy/internal.hpp | 5 +++++ pxr/external/boost/python/numpy/invoke_matching.hpp | 5 +++++ pxr/external/boost/python/numpy/matrix.hpp | 5 +++++ pxr/external/boost/python/numpy/ndarray.hpp | 5 +++++ pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp | 5 +++++ pxr/external/boost/python/numpy/scalars.hpp | 5 +++++ pxr/external/boost/python/numpy/ufunc.hpp | 5 +++++ pxr/external/boost/python/object.hpp | 5 +++++ pxr/external/boost/python/object/add_to_namespace.hpp | 5 +++++ pxr/external/boost/python/object/class.hpp | 5 +++++ pxr/external/boost/python/object/class_detail.hpp | 5 +++++ pxr/external/boost/python/object/class_metadata.hpp | 5 +++++ pxr/external/boost/python/object/class_wrapper.hpp | 5 +++++ pxr/external/boost/python/object/enum_base.hpp | 5 +++++ pxr/external/boost/python/object/find_instance.hpp | 5 +++++ pxr/external/boost/python/object/forward.hpp | 5 +++++ pxr/external/boost/python/object/function.hpp | 5 +++++ pxr/external/boost/python/object/function_doc_signature.hpp | 5 +++++ pxr/external/boost/python/object/function_handle.hpp | 5 +++++ pxr/external/boost/python/object/function_object.hpp | 5 +++++ pxr/external/boost/python/object/inheritance.hpp | 5 +++++ pxr/external/boost/python/object/inheritance_query.hpp | 5 +++++ pxr/external/boost/python/object/instance.hpp | 5 +++++ pxr/external/boost/python/object/iterator.hpp | 5 +++++ pxr/external/boost/python/object/iterator_core.hpp | 5 +++++ pxr/external/boost/python/object/life_support.hpp | 5 +++++ pxr/external/boost/python/object/make_holder.hpp | 5 +++++ pxr/external/boost/python/object/make_instance.hpp | 5 +++++ pxr/external/boost/python/object/make_ptr_instance.hpp | 5 +++++ pxr/external/boost/python/object/pickle_support.hpp | 5 +++++ pxr/external/boost/python/object/pointer_holder.hpp | 5 +++++ pxr/external/boost/python/object/py_function.hpp | 5 +++++ pxr/external/boost/python/object/stl_iterator_core.hpp | 5 +++++ pxr/external/boost/python/object/value_holder.hpp | 5 +++++ pxr/external/boost/python/object/value_holder_fwd.hpp | 5 +++++ pxr/external/boost/python/object_attributes.hpp | 5 +++++ pxr/external/boost/python/object_call.hpp | 5 +++++ pxr/external/boost/python/object_core.hpp | 5 +++++ pxr/external/boost/python/object_fwd.hpp | 5 +++++ pxr/external/boost/python/object_items.hpp | 5 +++++ pxr/external/boost/python/object_operators.hpp | 5 +++++ pxr/external/boost/python/object_protocol.hpp | 5 +++++ pxr/external/boost/python/object_protocol_core.hpp | 5 +++++ pxr/external/boost/python/object_slices.hpp | 5 +++++ pxr/external/boost/python/opaque_pointer_converter.hpp | 5 +++++ pxr/external/boost/python/operators.hpp | 5 +++++ pxr/external/boost/python/other.hpp | 5 +++++ pxr/external/boost/python/overloads.hpp | 5 +++++ pxr/external/boost/python/override.hpp | 5 +++++ pxr/external/boost/python/pointee.hpp | 5 +++++ pxr/external/boost/python/proxy.hpp | 5 +++++ pxr/external/boost/python/ptr.hpp | 5 +++++ pxr/external/boost/python/pure_virtual.hpp | 5 +++++ pxr/external/boost/python/raw_function.hpp | 5 +++++ pxr/external/boost/python/refcount.hpp | 5 +++++ pxr/external/boost/python/reference_existing_object.hpp | 5 +++++ pxr/external/boost/python/register_ptr_to_python.hpp | 5 +++++ pxr/external/boost/python/return_arg.hpp | 5 +++++ pxr/external/boost/python/return_by_value.hpp | 5 +++++ pxr/external/boost/python/return_internal_reference.hpp | 5 +++++ pxr/external/boost/python/return_opaque_pointer.hpp | 5 +++++ pxr/external/boost/python/return_value_policy.hpp | 5 +++++ pxr/external/boost/python/scope.hpp | 5 +++++ pxr/external/boost/python/self.hpp | 5 +++++ pxr/external/boost/python/signature.hpp | 4 ++++ pxr/external/boost/python/slice.hpp | 5 +++++ pxr/external/boost/python/slice_nil.hpp | 5 +++++ .../boost/python/src/converter/arg_to_python_base.cpp | 5 +++++ .../boost/python/src/converter/builtin_converters.cpp | 5 +++++ pxr/external/boost/python/src/converter/from_python.cpp | 5 +++++ pxr/external/boost/python/src/converter/registry.cpp | 5 +++++ pxr/external/boost/python/src/converter/type_id.cpp | 5 +++++ pxr/external/boost/python/src/dict.cpp | 5 +++++ pxr/external/boost/python/src/errors.cpp | 5 +++++ pxr/external/boost/python/src/exec.cpp | 5 +++++ pxr/external/boost/python/src/import.cpp | 5 +++++ pxr/external/boost/python/src/list.cpp | 5 +++++ pxr/external/boost/python/src/long.cpp | 5 +++++ pxr/external/boost/python/src/module.cpp | 5 +++++ pxr/external/boost/python/src/numpy/dtype.cpp | 5 +++++ pxr/external/boost/python/src/numpy/matrix.cpp | 5 +++++ pxr/external/boost/python/src/numpy/ndarray.cpp | 5 +++++ pxr/external/boost/python/src/numpy/numpy.cpp | 5 +++++ pxr/external/boost/python/src/numpy/scalars.cpp | 5 +++++ pxr/external/boost/python/src/numpy/ufunc.cpp | 5 +++++ pxr/external/boost/python/src/object/class.cpp | 5 +++++ pxr/external/boost/python/src/object/enum.cpp | 5 +++++ pxr/external/boost/python/src/object/function.cpp | 5 +++++ .../boost/python/src/object/function_doc_signature.cpp | 5 +++++ pxr/external/boost/python/src/object/inheritance.cpp | 5 +++++ pxr/external/boost/python/src/object/iterator.cpp | 5 +++++ pxr/external/boost/python/src/object/life_support.cpp | 5 +++++ pxr/external/boost/python/src/object/pickle_support.cpp | 5 +++++ pxr/external/boost/python/src/object/stl_iterator.cpp | 5 +++++ pxr/external/boost/python/src/object_operators.cpp | 5 +++++ pxr/external/boost/python/src/object_protocol.cpp | 5 +++++ pxr/external/boost/python/src/slice.cpp | 5 +++++ pxr/external/boost/python/src/str.cpp | 5 +++++ pxr/external/boost/python/src/tuple.cpp | 5 +++++ pxr/external/boost/python/src/wrapper.cpp | 5 +++++ pxr/external/boost/python/ssize_t.hpp | 5 +++++ pxr/external/boost/python/stl_iterator.hpp | 5 +++++ pxr/external/boost/python/str.hpp | 5 +++++ pxr/external/boost/python/suite/indexing/container_utils.hpp | 5 +++++ .../python/suite/indexing/detail/indexing_suite_detail.hpp | 5 +++++ pxr/external/boost/python/suite/indexing/indexing_suite.hpp | 5 +++++ .../boost/python/suite/indexing/map_indexing_suite.hpp | 5 +++++ .../boost/python/suite/indexing/vector_indexing_suite.hpp | 5 +++++ pxr/external/boost/python/tag.hpp | 5 +++++ pxr/external/boost/python/test/a_map_indexing_suite.cpp | 5 +++++ pxr/external/boost/python/test/aligned_class.cpp | 5 +++++ pxr/external/boost/python/test/aligned_class.py | 5 +++++ pxr/external/boost/python/test/andreas_beyer.cpp | 5 +++++ pxr/external/boost/python/test/andreas_beyer.py | 5 +++++ pxr/external/boost/python/test/args.cpp | 5 +++++ pxr/external/boost/python/test/args.py | 5 +++++ pxr/external/boost/python/test/as_to_python_function.cpp | 5 +++++ pxr/external/boost/python/test/auto_ptr.cpp | 5 +++++ pxr/external/boost/python/test/auto_ptr.py | 5 +++++ pxr/external/boost/python/test/back_reference.cpp | 5 +++++ pxr/external/boost/python/test/back_reference.py | 5 +++++ pxr/external/boost/python/test/bases.cpp | 5 +++++ pxr/external/boost/python/test/ben_scott1.cpp | 5 +++++ pxr/external/boost/python/test/ben_scott1.py | 5 +++++ pxr/external/boost/python/test/bienstman1.cpp | 5 +++++ pxr/external/boost/python/test/bienstman1.py | 5 +++++ pxr/external/boost/python/test/bienstman2.cpp | 5 +++++ pxr/external/boost/python/test/bienstman2.py | 5 +++++ pxr/external/boost/python/test/bienstman3.cpp | 5 +++++ pxr/external/boost/python/test/bienstman3.py | 5 +++++ pxr/external/boost/python/test/bienstman4.cpp | 5 +++++ pxr/external/boost/python/test/bienstman4.py | 5 +++++ pxr/external/boost/python/test/bienstman5.cpp | 5 +++++ pxr/external/boost/python/test/bienstman5.py | 5 +++++ pxr/external/boost/python/test/boost_shared_ptr.cpp | 5 +++++ pxr/external/boost/python/test/boost_shared_ptr.py | 5 +++++ pxr/external/boost/python/test/borrowed.cpp | 5 +++++ pxr/external/boost/python/test/builtin_converters.cpp | 5 +++++ pxr/external/boost/python/test/callbacks.cpp | 5 +++++ pxr/external/boost/python/test/callbacks.py | 5 +++++ pxr/external/boost/python/test/calling_conventions.cpp | 5 ++++- pxr/external/boost/python/test/calling_conventions.py | 5 +++++ pxr/external/boost/python/test/calling_conventions_mf.cpp | 4 ++++ pxr/external/boost/python/test/calling_conventions_mf.py | 5 +++++ pxr/external/boost/python/test/class.cpp | 5 +++++ pxr/external/boost/python/test/class.py | 5 +++++ pxr/external/boost/python/test/cltree.cpp | 5 +++++ pxr/external/boost/python/test/complicated.hpp | 5 +++++ pxr/external/boost/python/test/const_argument.cpp | 5 +++++ pxr/external/boost/python/test/const_argument.py | 5 +++++ pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp | 5 +++++ pxr/external/boost/python/test/crossmod_exception.py | 5 +++++ pxr/external/boost/python/test/crossmod_exception_a.cpp | 5 +++++ pxr/external/boost/python/test/crossmod_exception_b.cpp | 5 +++++ pxr/external/boost/python/test/crossmod_opaque.py | 5 +++++ pxr/external/boost/python/test/crossmod_opaque_a.cpp | 5 +++++ pxr/external/boost/python/test/crossmod_opaque_b.cpp | 5 +++++ pxr/external/boost/python/test/data_members.cpp | 5 +++++ pxr/external/boost/python/test/data_members.py | 5 +++++ pxr/external/boost/python/test/defaults.cpp | 5 +++++ pxr/external/boost/python/test/defaults.py | 5 +++++ pxr/external/boost/python/test/destroy_test.cpp | 5 +++++ pxr/external/boost/python/test/dict.cpp | 5 +++++ pxr/external/boost/python/test/dict.py | 5 +++++ pxr/external/boost/python/test/docstring.cpp | 5 +++++ pxr/external/boost/python/test/docstring.py | 5 +++++ pxr/external/boost/python/test/enable_shared_from_this.cpp | 5 +++++ pxr/external/boost/python/test/enable_shared_from_this.py | 5 +++++ pxr/external/boost/python/test/enum_ext.cpp | 5 +++++ pxr/external/boost/python/test/exception_translator.cpp | 5 +++++ pxr/external/boost/python/test/exception_translator.py | 5 +++++ pxr/external/boost/python/test/exec.cpp | 5 +++++ pxr/external/boost/python/test/exec.py | 5 +++++ pxr/external/boost/python/test/extract.cpp | 5 +++++ pxr/external/boost/python/test/extract.py | 5 +++++ pxr/external/boost/python/test/if_else.cpp | 5 +++++ pxr/external/boost/python/test/implicit.cpp | 5 +++++ pxr/external/boost/python/test/implicit.py | 5 +++++ pxr/external/boost/python/test/import_.cpp | 5 +++++ pxr/external/boost/python/test/import_.py | 5 +++++ pxr/external/boost/python/test/indirect_traits_test.cpp | 5 +++++ pxr/external/boost/python/test/injected.cpp | 5 +++++ pxr/external/boost/python/test/injected.py | 5 +++++ pxr/external/boost/python/test/input_iterator.cpp | 5 +++++ pxr/external/boost/python/test/int_map_indexing_suite.cpp | 5 +++++ pxr/external/boost/python/test/iterator.cpp | 5 +++++ pxr/external/boost/python/test/iterator.py | 5 +++++ pxr/external/boost/python/test/keywords.cpp | 5 +++++ pxr/external/boost/python/test/keywords_test.py | 5 +++++ pxr/external/boost/python/test/list.cpp | 5 +++++ pxr/external/boost/python/test/list.py | 5 +++++ pxr/external/boost/python/test/long.cpp | 5 +++++ pxr/external/boost/python/test/long.py | 5 +++++ pxr/external/boost/python/test/m1.cpp | 5 +++++ pxr/external/boost/python/test/m2.cpp | 5 +++++ pxr/external/boost/python/test/map_indexing_suite.cpp | 5 +++++ pxr/external/boost/python/test/map_indexing_suite.py | 5 +++++ pxr/external/boost/python/test/minimal.cpp | 5 +++++ pxr/external/boost/python/test/minimal.py | 5 +++++ pxr/external/boost/python/test/module_init_exception.cpp | 5 +++++ pxr/external/boost/python/test/module_init_exception.py | 5 +++++ pxr/external/boost/python/test/module_tail.cpp | 5 +++++ pxr/external/boost/python/test/multi_arg_constructor.cpp | 5 +++++ pxr/external/boost/python/test/multi_arg_constructor.py | 5 +++++ pxr/external/boost/python/test/nested.cpp | 5 +++++ pxr/external/boost/python/test/nested.py | 5 +++++ pxr/external/boost/python/test/newtest.py | 5 +++++ pxr/external/boost/python/test/numpy/dtype.cpp | 5 +++++ pxr/external/boost/python/test/numpy/dtype.py | 5 +++++ pxr/external/boost/python/test/numpy/indexing.cpp | 5 +++++ pxr/external/boost/python/test/numpy/indexing.py | 5 +++++ pxr/external/boost/python/test/numpy/ndarray.cpp | 5 +++++ pxr/external/boost/python/test/numpy/ndarray.py | 5 +++++ pxr/external/boost/python/test/numpy/shapes.cpp | 5 +++++ pxr/external/boost/python/test/numpy/shapes.py | 5 +++++ pxr/external/boost/python/test/numpy/templates.cpp | 5 +++++ pxr/external/boost/python/test/numpy/templates.py | 5 +++++ pxr/external/boost/python/test/numpy/ufunc.cpp | 5 +++++ pxr/external/boost/python/test/numpy/ufunc.py | 5 +++++ pxr/external/boost/python/test/object.cpp | 5 +++++ pxr/external/boost/python/test/object.py | 5 +++++ pxr/external/boost/python/test/object_fail1.cpp | 5 +++++ pxr/external/boost/python/test/object_manager.cpp | 5 +++++ pxr/external/boost/python/test/opaque.cpp | 5 +++++ pxr/external/boost/python/test/opaque.py | 5 +++++ pxr/external/boost/python/test/operators.cpp | 5 +++++ pxr/external/boost/python/test/operators.py | 5 +++++ pxr/external/boost/python/test/operators_wrapper.cpp | 5 +++++ pxr/external/boost/python/test/operators_wrapper.py | 5 +++++ pxr/external/boost/python/test/pickle1.cpp | 5 +++++ pxr/external/boost/python/test/pickle1.py | 5 +++++ pxr/external/boost/python/test/pickle2.cpp | 5 +++++ pxr/external/boost/python/test/pickle2.py | 5 +++++ pxr/external/boost/python/test/pickle3.cpp | 5 +++++ pxr/external/boost/python/test/pickle3.py | 5 +++++ pxr/external/boost/python/test/pickle4.cpp | 5 +++++ pxr/external/boost/python/test/pickle4.py | 5 +++++ pxr/external/boost/python/test/pointee.cpp | 5 +++++ pxr/external/boost/python/test/pointer_type_id_test.cpp | 5 +++++ pxr/external/boost/python/test/pointer_vector.cpp | 5 +++++ pxr/external/boost/python/test/pointer_vector.py | 5 +++++ pxr/external/boost/python/test/polymorphism.cpp | 5 +++++ pxr/external/boost/python/test/polymorphism.py | 5 +++++ pxr/external/boost/python/test/polymorphism2.cpp | 5 +++++ pxr/external/boost/python/test/polymorphism2.py | 5 +++++ pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp | 5 +++++ pxr/external/boost/python/test/polymorphism2_auto_ptr.py | 5 +++++ pxr/external/boost/python/test/properties.cpp | 5 +++++ pxr/external/boost/python/test/properties.py | 5 +++++ pxr/external/boost/python/test/pyrun.py | 5 +++++ pxr/external/boost/python/test/pytype_function.cpp | 5 +++++ pxr/external/boost/python/test/pytype_function.py | 5 +++++ pxr/external/boost/python/test/raw_ctor.cpp | 5 +++++ pxr/external/boost/python/test/raw_ctor.py | 5 +++++ pxr/external/boost/python/test/raw_pyobject_fail1.cpp | 5 +++++ pxr/external/boost/python/test/raw_pyobject_fail2.cpp | 5 +++++ pxr/external/boost/python/test/register_ptr.cpp | 5 +++++ pxr/external/boost/python/test/register_ptr_test.py | 5 +++++ pxr/external/boost/python/test/result.cpp | 5 +++++ pxr/external/boost/python/test/return_arg.cpp | 5 +++++ pxr/external/boost/python/test/return_arg.py | 5 +++++ pxr/external/boost/python/test/select_arg_to_python_test.cpp | 5 +++++ pxr/external/boost/python/test/select_from_python_test.cpp | 5 +++++ pxr/external/boost/python/test/select_holder.cpp | 5 +++++ pxr/external/boost/python/test/shared_ptr.cpp | 5 +++++ pxr/external/boost/python/test/shared_ptr.hpp | 5 +++++ pxr/external/boost/python/test/shared_ptr.py | 5 +++++ pxr/external/boost/python/test/simple_type.hpp | 5 +++++ pxr/external/boost/python/test/slice.cpp | 5 +++++ pxr/external/boost/python/test/slice.py | 5 +++++ pxr/external/boost/python/test/staticmethod.cpp | 5 +++++ pxr/external/boost/python/test/staticmethod.py | 5 +++++ pxr/external/boost/python/test/stl_iterator.cpp | 5 +++++ pxr/external/boost/python/test/stl_iterator.py | 5 +++++ pxr/external/boost/python/test/str.cpp | 5 +++++ pxr/external/boost/python/test/str.py | 5 +++++ pxr/external/boost/python/test/string_literal.cpp | 5 +++++ pxr/external/boost/python/test/test_builtin_converters.py | 5 +++++ pxr/external/boost/python/test/test_class.hpp | 5 +++++ pxr/external/boost/python/test/test_cltree.py | 5 +++++ pxr/external/boost/python/test/test_enum.py | 5 +++++ pxr/external/boost/python/test/test_overload_resolution.cpp | 5 +++++ pxr/external/boost/python/test/test_pointer_adoption.cpp | 5 +++++ pxr/external/boost/python/test/test_pointer_adoption.py | 5 +++++ pxr/external/boost/python/test/tuple.cpp | 5 +++++ pxr/external/boost/python/test/tuple.py | 5 +++++ pxr/external/boost/python/test/upcast.cpp | 5 +++++ pxr/external/boost/python/test/vector_indexing_suite.cpp | 5 +++++ pxr/external/boost/python/test/vector_indexing_suite.py | 5 +++++ pxr/external/boost/python/test/virtual_functions.cpp | 5 +++++ pxr/external/boost/python/test/virtual_functions.py | 5 +++++ pxr/external/boost/python/test/voidptr.cpp | 5 +++++ pxr/external/boost/python/test/voidptr.py | 5 +++++ pxr/external/boost/python/test/wrapper_held_type.cpp | 5 +++++ pxr/external/boost/python/test/wrapper_held_type.py | 5 +++++ pxr/external/boost/python/to_python_converter.hpp | 5 +++++ pxr/external/boost/python/to_python_indirect.hpp | 5 +++++ pxr/external/boost/python/to_python_value.hpp | 5 +++++ pxr/external/boost/python/tuple.hpp | 5 +++++ pxr/external/boost/python/type_id.hpp | 5 +++++ pxr/external/boost/python/with_custodian_and_ward.hpp | 5 +++++ pxr/external/boost/python/wrapper.hpp | 5 +++++ 438 files changed, 2184 insertions(+), 1 deletion(-) diff --git a/pxr/external/boost/python.hpp b/pxr/external/boost/python.hpp index e484034103..cd8fe4414c 100644 --- a/pxr/external/boost/python.hpp +++ b/pxr/external/boost/python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/arg_from_python.hpp b/pxr/external/boost/python/arg_from_python.hpp index 983726b065..e859d807bd 100644 --- a/pxr/external/boost/python/arg_from_python.hpp +++ b/pxr/external/boost/python/arg_from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/args.hpp b/pxr/external/boost/python/args.hpp index 27731bd8c9..5edd082d53 100644 --- a/pxr/external/boost/python/args.hpp +++ b/pxr/external/boost/python/args.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/args_fwd.hpp b/pxr/external/boost/python/args_fwd.hpp index 39239461b0..eac63e0571 100644 --- a/pxr/external/boost/python/args_fwd.hpp +++ b/pxr/external/boost/python/args_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/back_reference.hpp b/pxr/external/boost/python/back_reference.hpp index e68066f7d5..8e86b5200f 100644 --- a/pxr/external/boost/python/back_reference.hpp +++ b/pxr/external/boost/python/back_reference.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/base_type_traits.hpp b/pxr/external/boost/python/base_type_traits.hpp index e1c6a4843f..82c06dc269 100644 --- a/pxr/external/boost/python/base_type_traits.hpp +++ b/pxr/external/boost/python/base_type_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/bases.hpp b/pxr/external/boost/python/bases.hpp index efcac3f389..713655a499 100644 --- a/pxr/external/boost/python/bases.hpp +++ b/pxr/external/boost/python/bases.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/borrowed.hpp b/pxr/external/boost/python/borrowed.hpp index fd2716bfbd..aeafe48a35 100644 --- a/pxr/external/boost/python/borrowed.hpp +++ b/pxr/external/boost/python/borrowed.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/call.hpp b/pxr/external/boost/python/call.hpp index c057ee9a12..6bd062786b 100644 --- a/pxr/external/boost/python/call.hpp +++ b/pxr/external/boost/python/call.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/call_method.hpp b/pxr/external/boost/python/call_method.hpp index 2f360791d7..d92fd882f9 100644 --- a/pxr/external/boost/python/call_method.hpp +++ b/pxr/external/boost/python/call_method.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/cast.hpp b/pxr/external/boost/python/cast.hpp index c0dd229e84..3fb3aee8aa 100644 --- a/pxr/external/boost/python/cast.hpp +++ b/pxr/external/boost/python/cast.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/class.hpp b/pxr/external/boost/python/class.hpp index 77f915ba0a..e0a9dfa02e 100644 --- a/pxr/external/boost/python/class.hpp +++ b/pxr/external/boost/python/class.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/class_fwd.hpp b/pxr/external/boost/python/class_fwd.hpp index 528e18a1dc..0d4fba2e64 100644 --- a/pxr/external/boost/python/class_fwd.hpp +++ b/pxr/external/boost/python/class_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/arg_from_python.hpp b/pxr/external/boost/python/converter/arg_from_python.hpp index 0c0daabc1f..be5a4804a5 100644 --- a/pxr/external/boost/python/converter/arg_from_python.hpp +++ b/pxr/external/boost/python/converter/arg_from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/arg_to_python.hpp b/pxr/external/boost/python/converter/arg_to_python.hpp index bbecae72e5..575ddfec40 100644 --- a/pxr/external/boost/python/converter/arg_to_python.hpp +++ b/pxr/external/boost/python/converter/arg_to_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/arg_to_python_base.hpp b/pxr/external/boost/python/converter/arg_to_python_base.hpp index c66ce9c3e0..b339f3ff9a 100644 --- a/pxr/external/boost/python/converter/arg_to_python_base.hpp +++ b/pxr/external/boost/python/converter/arg_to_python_base.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/as_to_python_function.hpp b/pxr/external/boost/python/converter/as_to_python_function.hpp index 19a3efaafc..718f318190 100644 --- a/pxr/external/boost/python/converter/as_to_python_function.hpp +++ b/pxr/external/boost/python/converter/as_to_python_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/builtin_converters.hpp b/pxr/external/boost/python/converter/builtin_converters.hpp index c2e01c03d3..5f2b50773e 100644 --- a/pxr/external/boost/python/converter/builtin_converters.hpp +++ b/pxr/external/boost/python/converter/builtin_converters.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/constructor_function.hpp b/pxr/external/boost/python/converter/constructor_function.hpp index 814aa7d763..fc450bf385 100644 --- a/pxr/external/boost/python/converter/constructor_function.hpp +++ b/pxr/external/boost/python/converter/constructor_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/context_result_converter.hpp b/pxr/external/boost/python/converter/context_result_converter.hpp index beb7e9f098..62064a6276 100644 --- a/pxr/external/boost/python/converter/context_result_converter.hpp +++ b/pxr/external/boost/python/converter/context_result_converter.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/convertible_function.hpp b/pxr/external/boost/python/converter/convertible_function.hpp index 4b29fbb00b..f6cd9c189c 100644 --- a/pxr/external/boost/python/converter/convertible_function.hpp +++ b/pxr/external/boost/python/converter/convertible_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/from_python.hpp b/pxr/external/boost/python/converter/from_python.hpp index b2f24b3519..64de6694f1 100644 --- a/pxr/external/boost/python/converter/from_python.hpp +++ b/pxr/external/boost/python/converter/from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/implicit.hpp b/pxr/external/boost/python/converter/implicit.hpp index 8bbbfd5ac1..c1242392d8 100644 --- a/pxr/external/boost/python/converter/implicit.hpp +++ b/pxr/external/boost/python/converter/implicit.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp index 5132804082..c21c5656b7 100644 --- a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp +++ b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/object_manager.hpp b/pxr/external/boost/python/converter/object_manager.hpp index b2271a7ea2..7aa29700df 100644 --- a/pxr/external/boost/python/converter/object_manager.hpp +++ b/pxr/external/boost/python/converter/object_manager.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/pointer_type_id.hpp b/pxr/external/boost/python/converter/pointer_type_id.hpp index 49eeda42cb..897450b5a7 100644 --- a/pxr/external/boost/python/converter/pointer_type_id.hpp +++ b/pxr/external/boost/python/converter/pointer_type_id.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/pyobject_traits.hpp b/pxr/external/boost/python/converter/pyobject_traits.hpp index 43e384af8d..8716d8b1f3 100644 --- a/pxr/external/boost/python/converter/pyobject_traits.hpp +++ b/pxr/external/boost/python/converter/pyobject_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/pyobject_type.hpp b/pxr/external/boost/python/converter/pyobject_type.hpp index bde39e8057..b6739bc958 100644 --- a/pxr/external/boost/python/converter/pyobject_type.hpp +++ b/pxr/external/boost/python/converter/pyobject_type.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/pytype_function.hpp b/pxr/external/boost/python/converter/pytype_function.hpp index 8e0a4e7995..8ddaccdcfe 100644 --- a/pxr/external/boost/python/converter/pytype_function.hpp +++ b/pxr/external/boost/python/converter/pytype_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002, Nikolay Mladenov 2007. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp index 8f5b2b7677..19a68f5a1e 100644 --- a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp +++ b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/registered.hpp b/pxr/external/boost/python/converter/registered.hpp index 98013052ec..24b336de47 100644 --- a/pxr/external/boost/python/converter/registered.hpp +++ b/pxr/external/boost/python/converter/registered.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/converter/registered_pointee.hpp b/pxr/external/boost/python/converter/registered_pointee.hpp index 28b2988c7f..45967ec066 100644 --- a/pxr/external/boost/python/converter/registered_pointee.hpp +++ b/pxr/external/boost/python/converter/registered_pointee.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/registrations.hpp b/pxr/external/boost/python/converter/registrations.hpp index 7ef74e8f40..db6186d49b 100644 --- a/pxr/external/boost/python/converter/registrations.hpp +++ b/pxr/external/boost/python/converter/registrations.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/registry.hpp b/pxr/external/boost/python/converter/registry.hpp index 368adcc61d..bcba5f1952 100644 --- a/pxr/external/boost/python/converter/registry.hpp +++ b/pxr/external/boost/python/converter/registry.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/return_from_python.hpp b/pxr/external/boost/python/converter/return_from_python.hpp index a995a2905a..f9cf672933 100644 --- a/pxr/external/boost/python/converter/return_from_python.hpp +++ b/pxr/external/boost/python/converter/return_from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp index d728681b3e..c1ca86baf9 100644 --- a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp +++ b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp index 926508d00e..b2ae004420 100644 --- a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp index b5c62ba940..1279e3bde0 100644 --- a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp index 02649d406e..ee28ae7bb4 100644 --- a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/converter/to_python_function_type.hpp b/pxr/external/boost/python/converter/to_python_function_type.hpp index cccd014d68..fbe331b03a 100644 --- a/pxr/external/boost/python/converter/to_python_function_type.hpp +++ b/pxr/external/boost/python/converter/to_python_function_type.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/copy_const_reference.hpp b/pxr/external/boost/python/copy_const_reference.hpp index 55bede136f..ff5b764a26 100644 --- a/pxr/external/boost/python/copy_const_reference.hpp +++ b/pxr/external/boost/python/copy_const_reference.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/copy_non_const_reference.hpp b/pxr/external/boost/python/copy_non_const_reference.hpp index 15fef62d67..c798613b67 100644 --- a/pxr/external/boost/python/copy_non_const_reference.hpp +++ b/pxr/external/boost/python/copy_non_const_reference.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/data_members.hpp b/pxr/external/boost/python/data_members.hpp index 989f7d7f93..848d650994 100644 --- a/pxr/external/boost/python/data_members.hpp +++ b/pxr/external/boost/python/data_members.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/def.hpp b/pxr/external/boost/python/def.hpp index fe2c65f938..b5196b86e4 100644 --- a/pxr/external/boost/python/def.hpp +++ b/pxr/external/boost/python/def.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/def_visitor.hpp b/pxr/external/boost/python/def_visitor.hpp index 18dd928684..02ea2378e4 100644 --- a/pxr/external/boost/python/def_visitor.hpp +++ b/pxr/external/boost/python/def_visitor.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/default_call_policies.hpp b/pxr/external/boost/python/default_call_policies.hpp index c882257348..1771e0849d 100644 --- a/pxr/external/boost/python/default_call_policies.hpp +++ b/pxr/external/boost/python/default_call_policies.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/aix_init_module.hpp b/pxr/external/boost/python/detail/aix_init_module.hpp index 9214dbf09b..ab27ffef58 100644 --- a/pxr/external/boost/python/detail/aix_init_module.hpp +++ b/pxr/external/boost/python/detail/aix_init_module.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/api_placeholder.hpp b/pxr/external/boost/python/detail/api_placeholder.hpp index 5975a13bda..484851830e 100644 --- a/pxr/external/boost/python/detail/api_placeholder.hpp +++ b/pxr/external/boost/python/detail/api_placeholder.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/borrowed_ptr.hpp b/pxr/external/boost/python/detail/borrowed_ptr.hpp index 7d78739ed9..faf2c32597 100644 --- a/pxr/external/boost/python/detail/borrowed_ptr.hpp +++ b/pxr/external/boost/python/detail/borrowed_ptr.hpp @@ -1,5 +1,10 @@ #ifndef BORROWED_PTR_DWA20020601_HPP # define BORROWED_PTR_DWA20020601_HPP +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/caller.hpp b/pxr/external/boost/python/detail/caller.hpp index 2834d6da99..83531b4d1d 100644 --- a/pxr/external/boost/python/detail/caller.hpp +++ b/pxr/external/boost/python/detail/caller.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/config.hpp b/pxr/external/boost/python/detail/config.hpp index 8dce9b742e..c3f3ae9614 100644 --- a/pxr/external/boost/python/detail/config.hpp +++ b/pxr/external/boost/python/detail/config.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/construct.hpp b/pxr/external/boost/python/detail/construct.hpp index e69fbc7538..7f3ab8e2aa 100644 --- a/pxr/external/boost/python/detail/construct.hpp +++ b/pxr/external/boost/python/detail/construct.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/convertible.hpp b/pxr/external/boost/python/detail/convertible.hpp index 1ff350ec24..0d4d421669 100644 --- a/pxr/external/boost/python/detail/convertible.hpp +++ b/pxr/external/boost/python/detail/convertible.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp index 4ca8d03911..cbdb5371a9 100644 --- a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp +++ b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/cv_category.hpp b/pxr/external/boost/python/detail/cv_category.hpp index eb5a8eb9da..51c151e6e9 100644 --- a/pxr/external/boost/python/detail/cv_category.hpp +++ b/pxr/external/boost/python/detail/cv_category.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/dealloc.hpp b/pxr/external/boost/python/detail/dealloc.hpp index ce07926ee1..e6195f7274 100644 --- a/pxr/external/boost/python/detail/dealloc.hpp +++ b/pxr/external/boost/python/detail/dealloc.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Gottfried Ganßauge 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/decorated_type_id.hpp b/pxr/external/boost/python/detail/decorated_type_id.hpp index 2596f3104a..42cd7ddb12 100644 --- a/pxr/external/boost/python/detail/decorated_type_id.hpp +++ b/pxr/external/boost/python/detail/decorated_type_id.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/decref_guard.hpp b/pxr/external/boost/python/detail/decref_guard.hpp index d713e0a604..55c471a1da 100644 --- a/pxr/external/boost/python/detail/decref_guard.hpp +++ b/pxr/external/boost/python/detail/decref_guard.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/def_helper.hpp b/pxr/external/boost/python/detail/def_helper.hpp index 24f9c5cdb2..6ebc7508f1 100644 --- a/pxr/external/boost/python/detail/def_helper.hpp +++ b/pxr/external/boost/python/detail/def_helper.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/def_helper_fwd.hpp b/pxr/external/boost/python/detail/def_helper_fwd.hpp index 31c22e97a3..3c2397115e 100644 --- a/pxr/external/boost/python/detail/def_helper_fwd.hpp +++ b/pxr/external/boost/python/detail/def_helper_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/defaults_def.hpp b/pxr/external/boost/python/detail/defaults_def.hpp index a721b76794..24218db5a7 100644 --- a/pxr/external/boost/python/detail/defaults_def.hpp +++ b/pxr/external/boost/python/detail/defaults_def.hpp @@ -1,5 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002, Joel de Guzman, 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/defaults_gen.hpp b/pxr/external/boost/python/detail/defaults_gen.hpp index 88beeedb02..db255579da 100644 --- a/pxr/external/boost/python/detail/defaults_gen.hpp +++ b/pxr/external/boost/python/detail/defaults_gen.hpp @@ -1,5 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002, Joel de Guzman, 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/dependent.hpp b/pxr/external/boost/python/detail/dependent.hpp index 70392c4d78..e2bc1fff35 100644 --- a/pxr/external/boost/python/detail/dependent.hpp +++ b/pxr/external/boost/python/detail/dependent.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/destroy.hpp b/pxr/external/boost/python/detail/destroy.hpp index d35b2b536e..e981c8b77b 100644 --- a/pxr/external/boost/python/detail/destroy.hpp +++ b/pxr/external/boost/python/detail/destroy.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/enable_if.hpp b/pxr/external/boost/python/detail/enable_if.hpp index 7a37be121a..2b2836a5e9 100644 --- a/pxr/external/boost/python/detail/enable_if.hpp +++ b/pxr/external/boost/python/detail/enable_if.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/exception_handler.hpp b/pxr/external/boost/python/detail/exception_handler.hpp index fdc9989836..c46ff22d6e 100644 --- a/pxr/external/boost/python/detail/exception_handler.hpp +++ b/pxr/external/boost/python/detail/exception_handler.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/force_instantiate.hpp b/pxr/external/boost/python/detail/force_instantiate.hpp index a8901b2da7..61064eac0d 100644 --- a/pxr/external/boost/python/detail/force_instantiate.hpp +++ b/pxr/external/boost/python/detail/force_instantiate.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/if_else.hpp b/pxr/external/boost/python/detail/if_else.hpp index 3f505c5edb..a7588e65d0 100644 --- a/pxr/external/boost/python/detail/if_else.hpp +++ b/pxr/external/boost/python/detail/if_else.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/indirect_traits.hpp b/pxr/external/boost/python/detail/indirect_traits.hpp index ce8ba310a2..aed7f9b501 100644 --- a/pxr/external/boost/python/detail/indirect_traits.hpp +++ b/pxr/external/boost/python/detail/indirect_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/invoke.hpp b/pxr/external/boost/python/detail/invoke.hpp index 4c5296ff12..a0876b1552 100644 --- a/pxr/external/boost/python/detail/invoke.hpp +++ b/pxr/external/boost/python/detail/invoke.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/is_auto_ptr.hpp b/pxr/external/boost/python/detail/is_auto_ptr.hpp index 3b8198b8dd..2f7b50883d 100644 --- a/pxr/external/boost/python/detail/is_auto_ptr.hpp +++ b/pxr/external/boost/python/detail/is_auto_ptr.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/is_shared_ptr.hpp b/pxr/external/boost/python/detail/is_shared_ptr.hpp index 383383bc12..dffd29a858 100644 --- a/pxr/external/boost/python/detail/is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/is_shared_ptr.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/detail/is_wrapper.hpp b/pxr/external/boost/python/detail/is_wrapper.hpp index d7bce7b627..cec77c99bf 100644 --- a/pxr/external/boost/python/detail/is_wrapper.hpp +++ b/pxr/external/boost/python/detail/is_wrapper.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/is_xxx.hpp b/pxr/external/boost/python/detail/is_xxx.hpp index 9ddfafd3c0..7c072aa9f8 100644 --- a/pxr/external/boost/python/detail/is_xxx.hpp +++ b/pxr/external/boost/python/detail/is_xxx.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp index c4795cf887..8e3cc577d4 100644 --- a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp +++ b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/make_tuple.hpp b/pxr/external/boost/python/detail/make_tuple.hpp index 57b285be1c..6888a177e8 100644 --- a/pxr/external/boost/python/detail/make_tuple.hpp +++ b/pxr/external/boost/python/detail/make_tuple.hpp @@ -1,4 +1,9 @@ # ifndef BOOST_PYTHON_SYNOPSIS +# // +# // Copyright 2024 Pixar +# // Licensed under the terms set forth in the LICENSE.txt file available at +# // https://openusd.org/license. +# // # // Copyright David Abrahams 2002. # // Distributed under the Boost Software License, Version 1.0. (See # // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/map_entry.hpp b/pxr/external/boost/python/detail/map_entry.hpp index 8bf1759f9f..c7844f9151 100644 --- a/pxr/external/boost/python/detail/map_entry.hpp +++ b/pxr/external/boost/python/detail/map_entry.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/mpl_lambda.hpp b/pxr/external/boost/python/detail/mpl_lambda.hpp index a20608e710..81a00757fe 100644 --- a/pxr/external/boost/python/detail/mpl_lambda.hpp +++ b/pxr/external/boost/python/detail/mpl_lambda.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/msvc_typeinfo.hpp b/pxr/external/boost/python/detail/msvc_typeinfo.hpp index bfc84164f0..d0c3e48996 100644 --- a/pxr/external/boost/python/detail/msvc_typeinfo.hpp +++ b/pxr/external/boost/python/detail/msvc_typeinfo.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/none.hpp b/pxr/external/boost/python/detail/none.hpp index bc3337a234..e35c339e3a 100644 --- a/pxr/external/boost/python/detail/none.hpp +++ b/pxr/external/boost/python/detail/none.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/not_specified.hpp b/pxr/external/boost/python/detail/not_specified.hpp index 2f7c7ad997..333027b605 100644 --- a/pxr/external/boost/python/detail/not_specified.hpp +++ b/pxr/external/boost/python/detail/not_specified.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp index 9dcc434f8e..a6c3be89df 100644 --- a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp +++ b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/operator_id.hpp b/pxr/external/boost/python/detail/operator_id.hpp index ecfc70f108..e1c5b2b356 100644 --- a/pxr/external/boost/python/detail/operator_id.hpp +++ b/pxr/external/boost/python/detail/operator_id.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/overloads_fwd.hpp b/pxr/external/boost/python/detail/overloads_fwd.hpp index 4c7fdf292b..b0368339b3 100644 --- a/pxr/external/boost/python/detail/overloads_fwd.hpp +++ b/pxr/external/boost/python/detail/overloads_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/pointee.hpp b/pxr/external/boost/python/detail/pointee.hpp index e786b37626..290199d236 100644 --- a/pxr/external/boost/python/detail/pointee.hpp +++ b/pxr/external/boost/python/detail/pointee.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/prefix.hpp b/pxr/external/boost/python/detail/prefix.hpp index 8b34ed7701..995b077ccc 100644 --- a/pxr/external/boost/python/detail/prefix.hpp +++ b/pxr/external/boost/python/detail/prefix.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/preprocessor.hpp b/pxr/external/boost/python/detail/preprocessor.hpp index 2c1b2e84ea..f8a0d4b9a6 100644 --- a/pxr/external/boost/python/detail/preprocessor.hpp +++ b/pxr/external/boost/python/detail/preprocessor.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/python_type.hpp b/pxr/external/boost/python/detail/python_type.hpp index f7630c175a..0b4e896626 100644 --- a/pxr/external/boost/python/detail/python_type.hpp +++ b/pxr/external/boost/python/detail/python_type.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Nikolay Mladenov 2007. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/raw_pyobject.hpp b/pxr/external/boost/python/detail/raw_pyobject.hpp index 194409eda4..daea83f3e2 100644 --- a/pxr/external/boost/python/detail/raw_pyobject.hpp +++ b/pxr/external/boost/python/detail/raw_pyobject.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/referent_storage.hpp b/pxr/external/boost/python/detail/referent_storage.hpp index f646d2ae1d..247024ca51 100644 --- a/pxr/external/boost/python/detail/referent_storage.hpp +++ b/pxr/external/boost/python/detail/referent_storage.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/result.hpp b/pxr/external/boost/python/detail/result.hpp index 2390693a88..22ad9b9fd4 100644 --- a/pxr/external/boost/python/detail/result.hpp +++ b/pxr/external/boost/python/detail/result.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/scope.hpp b/pxr/external/boost/python/detail/scope.hpp index 5367bbd35c..450e6066cb 100644 --- a/pxr/external/boost/python/detail/scope.hpp +++ b/pxr/external/boost/python/detail/scope.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/sfinae.hpp b/pxr/external/boost/python/detail/sfinae.hpp index 6281875111..fc1e0e6bfb 100644 --- a/pxr/external/boost/python/detail/sfinae.hpp +++ b/pxr/external/boost/python/detail/sfinae.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/signature.hpp b/pxr/external/boost/python/detail/signature.hpp index 11268b92cf..48a998dc2b 100644 --- a/pxr/external/boost/python/detail/signature.hpp +++ b/pxr/external/boost/python/detail/signature.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/string_literal.hpp b/pxr/external/boost/python/detail/string_literal.hpp index 0961ec7c4e..981ccea22c 100644 --- a/pxr/external/boost/python/detail/string_literal.hpp +++ b/pxr/external/boost/python/detail/string_literal.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/target.hpp b/pxr/external/boost/python/detail/target.hpp index 137801bb2b..2572674667 100644 --- a/pxr/external/boost/python/detail/target.hpp +++ b/pxr/external/boost/python/detail/target.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/translate_exception.hpp b/pxr/external/boost/python/detail/translate_exception.hpp index 877db2b2c6..a79f0d94db 100644 --- a/pxr/external/boost/python/detail/translate_exception.hpp +++ b/pxr/external/boost/python/detail/translate_exception.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/type_list.hpp b/pxr/external/boost/python/detail/type_list.hpp index 0ad3f63d84..d1b148f12e 100644 --- a/pxr/external/boost/python/detail/type_list.hpp +++ b/pxr/external/boost/python/detail/type_list.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/type_list_impl.hpp b/pxr/external/boost/python/detail/type_list_impl.hpp index fdcfa85030..7c239be0c2 100644 --- a/pxr/external/boost/python/detail/type_list_impl.hpp +++ b/pxr/external/boost/python/detail/type_list_impl.hpp @@ -1,4 +1,9 @@ #ifndef BOOST_PP_IS_ITERATING +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/type_traits.hpp b/pxr/external/boost/python/detail/type_traits.hpp index fda54c80f2..84e01faf1f 100644 --- a/pxr/external/boost/python/detail/type_traits.hpp +++ b/pxr/external/boost/python/detail/type_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Shreyans Doshi 2017. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/unwind_type.hpp b/pxr/external/boost/python/detail/unwind_type.hpp index b81bf7c898..95231a6c4e 100644 --- a/pxr/external/boost/python/detail/unwind_type.hpp +++ b/pxr/external/boost/python/detail/unwind_type.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/unwrap_type_id.hpp b/pxr/external/boost/python/detail/unwrap_type_id.hpp index 96c1f53013..4f7685b036 100644 --- a/pxr/external/boost/python/detail/unwrap_type_id.hpp +++ b/pxr/external/boost/python/detail/unwrap_type_id.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/unwrap_wrapper.hpp b/pxr/external/boost/python/detail/unwrap_wrapper.hpp index 95bc233a72..c3c15f1c57 100644 --- a/pxr/external/boost/python/detail/unwrap_wrapper.hpp +++ b/pxr/external/boost/python/detail/unwrap_wrapper.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/value_arg.hpp b/pxr/external/boost/python/detail/value_arg.hpp index 2c938dacca..9ebe2a21b5 100644 --- a/pxr/external/boost/python/detail/value_arg.hpp +++ b/pxr/external/boost/python/detail/value_arg.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp index 53e687f016..c572030e66 100644 --- a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/detail/value_is_xxx.hpp b/pxr/external/boost/python/detail/value_is_xxx.hpp index e270f89ca3..eb79242137 100644 --- a/pxr/external/boost/python/detail/value_is_xxx.hpp +++ b/pxr/external/boost/python/detail/value_is_xxx.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/void_ptr.hpp b/pxr/external/boost/python/detail/void_ptr.hpp index 5543b23a4a..4e2b489941 100644 --- a/pxr/external/boost/python/detail/void_ptr.hpp +++ b/pxr/external/boost/python/detail/void_ptr.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/void_return.hpp b/pxr/external/boost/python/detail/void_return.hpp index 30db825177..bebd3bc013 100644 --- a/pxr/external/boost/python/detail/void_return.hpp +++ b/pxr/external/boost/python/detail/void_return.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/wrap_python.hpp b/pxr/external/boost/python/detail/wrap_python.hpp index 037e4bf2ec..0ae0e41344 100644 --- a/pxr/external/boost/python/detail/wrap_python.hpp +++ b/pxr/external/boost/python/detail/wrap_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/detail/wrapper_base.hpp b/pxr/external/boost/python/detail/wrapper_base.hpp index 60ac99436e..463d2bd7cb 100644 --- a/pxr/external/boost/python/detail/wrapper_base.hpp +++ b/pxr/external/boost/python/detail/wrapper_base.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/dict.hpp b/pxr/external/boost/python/dict.hpp index 6fcaf14382..ce766762d9 100644 --- a/pxr/external/boost/python/dict.hpp +++ b/pxr/external/boost/python/dict.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/docstring_options.hpp b/pxr/external/boost/python/docstring_options.hpp index 1914bd51a5..1929b436aa 100644 --- a/pxr/external/boost/python/docstring_options.hpp +++ b/pxr/external/boost/python/docstring_options.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve 2006. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/enum.hpp b/pxr/external/boost/python/enum.hpp index 9631a0edc8..2f4f8b6c93 100644 --- a/pxr/external/boost/python/enum.hpp +++ b/pxr/external/boost/python/enum.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/errors.hpp b/pxr/external/boost/python/errors.hpp index 1eec6c2fe6..6f76fe4f55 100644 --- a/pxr/external/boost/python/errors.hpp +++ b/pxr/external/boost/python/errors.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/exception_translator.hpp b/pxr/external/boost/python/exception_translator.hpp index 1aa1465bdf..fda49737df 100644 --- a/pxr/external/boost/python/exception_translator.hpp +++ b/pxr/external/boost/python/exception_translator.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/exec.hpp b/pxr/external/boost/python/exec.hpp index 32a74991a7..f8bc28dee2 100644 --- a/pxr/external/boost/python/exec.hpp +++ b/pxr/external/boost/python/exec.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/extract.hpp b/pxr/external/boost/python/extract.hpp index bfdeb83ce7..ff3090d017 100644 --- a/pxr/external/boost/python/extract.hpp +++ b/pxr/external/boost/python/extract.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/handle.hpp b/pxr/external/boost/python/handle.hpp index ee9a7cd09d..836ee66643 100644 --- a/pxr/external/boost/python/handle.hpp +++ b/pxr/external/boost/python/handle.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/handle_fwd.hpp b/pxr/external/boost/python/handle_fwd.hpp index 5987ec4fdb..ffc4cdce52 100644 --- a/pxr/external/boost/python/handle_fwd.hpp +++ b/pxr/external/boost/python/handle_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/has_back_reference.hpp b/pxr/external/boost/python/has_back_reference.hpp index 67fe24c5cf..c5cf51c8fa 100644 --- a/pxr/external/boost/python/has_back_reference.hpp +++ b/pxr/external/boost/python/has_back_reference.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/implicit.hpp b/pxr/external/boost/python/implicit.hpp index 4d01b2fb22..23eb688ed0 100644 --- a/pxr/external/boost/python/implicit.hpp +++ b/pxr/external/boost/python/implicit.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/import.hpp b/pxr/external/boost/python/import.hpp index 45c02a9366..3decd15901 100644 --- a/pxr/external/boost/python/import.hpp +++ b/pxr/external/boost/python/import.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/init.hpp b/pxr/external/boost/python/init.hpp index 0ee763cc26..1addd4a782 100644 --- a/pxr/external/boost/python/init.hpp +++ b/pxr/external/boost/python/init.hpp @@ -1,5 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002, Joel de Guzman, 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/instance_holder.hpp b/pxr/external/boost/python/instance_holder.hpp index f4ed1e6608..bfa9f7ffc2 100644 --- a/pxr/external/boost/python/instance_holder.hpp +++ b/pxr/external/boost/python/instance_holder.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/iterator.hpp b/pxr/external/boost/python/iterator.hpp index b0ea578959..ad93330685 100644 --- a/pxr/external/boost/python/iterator.hpp +++ b/pxr/external/boost/python/iterator.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/list.hpp b/pxr/external/boost/python/list.hpp index 0d5e2c8fd9..51b7bdd8e3 100644 --- a/pxr/external/boost/python/list.hpp +++ b/pxr/external/boost/python/list.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/long.hpp b/pxr/external/boost/python/long.hpp index c15604c91c..af3b834c31 100644 --- a/pxr/external/boost/python/long.hpp +++ b/pxr/external/boost/python/long.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/lvalue_from_pytype.hpp b/pxr/external/boost/python/lvalue_from_pytype.hpp index 59d31b89cf..164381e913 100644 --- a/pxr/external/boost/python/lvalue_from_pytype.hpp +++ b/pxr/external/boost/python/lvalue_from_pytype.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/make_constructor.hpp b/pxr/external/boost/python/make_constructor.hpp index 3ec9ad5f86..5db8185bd2 100644 --- a/pxr/external/boost/python/make_constructor.hpp +++ b/pxr/external/boost/python/make_constructor.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/make_function.hpp b/pxr/external/boost/python/make_function.hpp index 7dd7c316b3..2bddaf4e6f 100644 --- a/pxr/external/boost/python/make_function.hpp +++ b/pxr/external/boost/python/make_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/manage_new_object.hpp b/pxr/external/boost/python/manage_new_object.hpp index 9ff341c1ac..94f6dd35a3 100644 --- a/pxr/external/boost/python/manage_new_object.hpp +++ b/pxr/external/boost/python/manage_new_object.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/module.hpp b/pxr/external/boost/python/module.hpp index 8ad69f5a34..1360f44429 100644 --- a/pxr/external/boost/python/module.hpp +++ b/pxr/external/boost/python/module.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/module_init.hpp b/pxr/external/boost/python/module_init.hpp index 7fe5a1c8a2..8033c47908 100644 --- a/pxr/external/boost/python/module_init.hpp +++ b/pxr/external/boost/python/module_init.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/numpy.hpp b/pxr/external/boost/python/numpy.hpp index 18a6389d51..1eb96115c3 100644 --- a/pxr/external/boost/python/numpy.hpp +++ b/pxr/external/boost/python/numpy.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/config.hpp b/pxr/external/boost/python/numpy/config.hpp index f70b94cb3e..5d55032261 100644 --- a/pxr/external/boost/python/numpy/config.hpp +++ b/pxr/external/boost/python/numpy/config.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Samuli-Petrus Korhonen 2017. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/numpy/dtype.hpp b/pxr/external/boost/python/numpy/dtype.hpp index 4673745e57..0cf6bfe2ac 100644 --- a/pxr/external/boost/python/numpy/dtype.hpp +++ b/pxr/external/boost/python/numpy/dtype.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/internal.hpp b/pxr/external/boost/python/numpy/internal.hpp index c24718f0ae..33dc313458 100644 --- a/pxr/external/boost/python/numpy/internal.hpp +++ b/pxr/external/boost/python/numpy/internal.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/invoke_matching.hpp b/pxr/external/boost/python/numpy/invoke_matching.hpp index 095ca3a8db..816130f713 100644 --- a/pxr/external/boost/python/numpy/invoke_matching.hpp +++ b/pxr/external/boost/python/numpy/invoke_matching.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/matrix.hpp b/pxr/external/boost/python/numpy/matrix.hpp index 829f544af5..ff6a977cac 100644 --- a/pxr/external/boost/python/numpy/matrix.hpp +++ b/pxr/external/boost/python/numpy/matrix.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/ndarray.hpp b/pxr/external/boost/python/numpy/ndarray.hpp index 2cb3b509f8..8416bffaef 100644 --- a/pxr/external/boost/python/numpy/ndarray.hpp +++ b/pxr/external/boost/python/numpy/ndarray.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp index a138f4cd52..6513ce9590 100644 --- a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp +++ b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/scalars.hpp b/pxr/external/boost/python/numpy/scalars.hpp index c2a83d8253..1b5e8c51b5 100644 --- a/pxr/external/boost/python/numpy/scalars.hpp +++ b/pxr/external/boost/python/numpy/scalars.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/numpy/ufunc.hpp b/pxr/external/boost/python/numpy/ufunc.hpp index 79d7d262b8..919e2acc14 100644 --- a/pxr/external/boost/python/numpy/ufunc.hpp +++ b/pxr/external/boost/python/numpy/ufunc.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/object.hpp b/pxr/external/boost/python/object.hpp index 9adec90f64..65d2429692 100644 --- a/pxr/external/boost/python/object.hpp +++ b/pxr/external/boost/python/object.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/add_to_namespace.hpp b/pxr/external/boost/python/object/add_to_namespace.hpp index 9f4167d6d2..d44d701cea 100644 --- a/pxr/external/boost/python/object/add_to_namespace.hpp +++ b/pxr/external/boost/python/object/add_to_namespace.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/class.hpp b/pxr/external/boost/python/object/class.hpp index f57ceda7bd..128c77c2da 100644 --- a/pxr/external/boost/python/object/class.hpp +++ b/pxr/external/boost/python/object/class.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/class_detail.hpp b/pxr/external/boost/python/object/class_detail.hpp index a17a4f4330..3f54a04249 100644 --- a/pxr/external/boost/python/object/class_detail.hpp +++ b/pxr/external/boost/python/object/class_detail.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/class_metadata.hpp b/pxr/external/boost/python/object/class_metadata.hpp index 06d3f8efa7..9b58315ea8 100644 --- a/pxr/external/boost/python/object/class_metadata.hpp +++ b/pxr/external/boost/python/object/class_metadata.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/object/class_wrapper.hpp b/pxr/external/boost/python/object/class_wrapper.hpp index ffee7457ab..d6d0e4ccbd 100644 --- a/pxr/external/boost/python/object/class_wrapper.hpp +++ b/pxr/external/boost/python/object/class_wrapper.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/enum_base.hpp b/pxr/external/boost/python/object/enum_base.hpp index be34274226..06b7709259 100644 --- a/pxr/external/boost/python/object/enum_base.hpp +++ b/pxr/external/boost/python/object/enum_base.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/find_instance.hpp b/pxr/external/boost/python/object/find_instance.hpp index 3202c1cd15..31bea1a7ad 100644 --- a/pxr/external/boost/python/object/find_instance.hpp +++ b/pxr/external/boost/python/object/find_instance.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/forward.hpp b/pxr/external/boost/python/object/forward.hpp index c6515bb55b..307a3d10e7 100644 --- a/pxr/external/boost/python/object/forward.hpp +++ b/pxr/external/boost/python/object/forward.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/function.hpp b/pxr/external/boost/python/object/function.hpp index f29d344820..aeedd5a74b 100644 --- a/pxr/external/boost/python/object/function.hpp +++ b/pxr/external/boost/python/object/function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/function_doc_signature.hpp b/pxr/external/boost/python/object/function_doc_signature.hpp index 4f00cb385a..07628a3cba 100644 --- a/pxr/external/boost/python/object/function_doc_signature.hpp +++ b/pxr/external/boost/python/object/function_doc_signature.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Nikolay Mladenov 2007. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/function_handle.hpp b/pxr/external/boost/python/object/function_handle.hpp index 7edaf2ce3a..f949e090f8 100644 --- a/pxr/external/boost/python/object/function_handle.hpp +++ b/pxr/external/boost/python/object/function_handle.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/function_object.hpp b/pxr/external/boost/python/object/function_object.hpp index eaa079fbe0..407b570efc 100644 --- a/pxr/external/boost/python/object/function_object.hpp +++ b/pxr/external/boost/python/object/function_object.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/inheritance.hpp b/pxr/external/boost/python/object/inheritance.hpp index 90e56f0c1d..e31ec4076e 100644 --- a/pxr/external/boost/python/object/inheritance.hpp +++ b/pxr/external/boost/python/object/inheritance.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/inheritance_query.hpp b/pxr/external/boost/python/object/inheritance_query.hpp index 916e161f29..76b2ee26c4 100644 --- a/pxr/external/boost/python/object/inheritance_query.hpp +++ b/pxr/external/boost/python/object/inheritance_query.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/instance.hpp b/pxr/external/boost/python/object/instance.hpp index ee4a6c5822..1ed9d57a99 100644 --- a/pxr/external/boost/python/object/instance.hpp +++ b/pxr/external/boost/python/object/instance.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/iterator.hpp b/pxr/external/boost/python/object/iterator.hpp index 874950365d..8a1036a357 100644 --- a/pxr/external/boost/python/object/iterator.hpp +++ b/pxr/external/boost/python/object/iterator.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/iterator_core.hpp b/pxr/external/boost/python/object/iterator_core.hpp index 064accc5a8..682233d16f 100644 --- a/pxr/external/boost/python/object/iterator_core.hpp +++ b/pxr/external/boost/python/object/iterator_core.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/life_support.hpp b/pxr/external/boost/python/object/life_support.hpp index 9a1b16b689..ad60f8f3a1 100644 --- a/pxr/external/boost/python/object/life_support.hpp +++ b/pxr/external/boost/python/object/life_support.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/make_holder.hpp b/pxr/external/boost/python/object/make_holder.hpp index 735e5395ca..83ecc3d557 100644 --- a/pxr/external/boost/python/object/make_holder.hpp +++ b/pxr/external/boost/python/object/make_holder.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/make_instance.hpp b/pxr/external/boost/python/object/make_instance.hpp index 713fdc5ecd..350776436c 100644 --- a/pxr/external/boost/python/object/make_instance.hpp +++ b/pxr/external/boost/python/object/make_instance.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/make_ptr_instance.hpp b/pxr/external/boost/python/object/make_ptr_instance.hpp index 92412b31fe..55df4cfd18 100644 --- a/pxr/external/boost/python/object/make_ptr_instance.hpp +++ b/pxr/external/boost/python/object/make_ptr_instance.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/pickle_support.hpp b/pxr/external/boost/python/object/pickle_support.hpp index aa96d655ee..52bd837d76 100644 --- a/pxr/external/boost/python/object/pickle_support.hpp +++ b/pxr/external/boost/python/object/pickle_support.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright R.W. Grosse-Kunstleve 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/pointer_holder.hpp b/pxr/external/boost/python/object/pointer_holder.hpp index c3b57e833a..51d67cb54f 100644 --- a/pxr/external/boost/python/object/pointer_holder.hpp +++ b/pxr/external/boost/python/object/pointer_holder.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/py_function.hpp b/pxr/external/boost/python/object/py_function.hpp index df2fb44a4f..e89ad69c3a 100644 --- a/pxr/external/boost/python/object/py_function.hpp +++ b/pxr/external/boost/python/object/py_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/stl_iterator_core.hpp b/pxr/external/boost/python/object/stl_iterator_core.hpp index 68e0c2441b..fa046a16f7 100644 --- a/pxr/external/boost/python/object/stl_iterator_core.hpp +++ b/pxr/external/boost/python/object/stl_iterator_core.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Eric Niebler 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/value_holder.hpp b/pxr/external/boost/python/object/value_holder.hpp index a4e91786d1..15911e1d2d 100644 --- a/pxr/external/boost/python/object/value_holder.hpp +++ b/pxr/external/boost/python/object/value_holder.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object/value_holder_fwd.hpp b/pxr/external/boost/python/object/value_holder_fwd.hpp index 3454bac426..d6490eb13c 100644 --- a/pxr/external/boost/python/object/value_holder_fwd.hpp +++ b/pxr/external/boost/python/object/value_holder_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_attributes.hpp b/pxr/external/boost/python/object_attributes.hpp index 26d599113f..becae707de 100644 --- a/pxr/external/boost/python/object_attributes.hpp +++ b/pxr/external/boost/python/object_attributes.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_call.hpp b/pxr/external/boost/python/object_call.hpp index 5c4d0f2fbe..65937d5d97 100644 --- a/pxr/external/boost/python/object_call.hpp +++ b/pxr/external/boost/python/object_call.hpp @@ -1,4 +1,9 @@ # if !defined(BOOST_PYTHON_SYNOPSIS) +# // +# // Copyright 2024 Pixar +# // Licensed under the terms set forth in the LICENSE.txt file available at +# // https://openusd.org/license. +# // # // Copyright David Abrahams 2002. # // Distributed under the Boost Software License, Version 1.0. (See # // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_core.hpp b/pxr/external/boost/python/object_core.hpp index 16480d0d89..259ff35966 100644 --- a/pxr/external/boost/python/object_core.hpp +++ b/pxr/external/boost/python/object_core.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_fwd.hpp b/pxr/external/boost/python/object_fwd.hpp index 11efcc7075..218a1f7c04 100644 --- a/pxr/external/boost/python/object_fwd.hpp +++ b/pxr/external/boost/python/object_fwd.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_items.hpp b/pxr/external/boost/python/object_items.hpp index b048689a7c..3e7a237214 100644 --- a/pxr/external/boost/python/object_items.hpp +++ b/pxr/external/boost/python/object_items.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_operators.hpp b/pxr/external/boost/python/object_operators.hpp index d436bb0144..b559721de8 100644 --- a/pxr/external/boost/python/object_operators.hpp +++ b/pxr/external/boost/python/object_operators.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_protocol.hpp b/pxr/external/boost/python/object_protocol.hpp index 7c1c02830e..b0187e4bd4 100644 --- a/pxr/external/boost/python/object_protocol.hpp +++ b/pxr/external/boost/python/object_protocol.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_protocol_core.hpp b/pxr/external/boost/python/object_protocol_core.hpp index a5bd9afcb4..66a9da752e 100644 --- a/pxr/external/boost/python/object_protocol_core.hpp +++ b/pxr/external/boost/python/object_protocol_core.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/object_slices.hpp b/pxr/external/boost/python/object_slices.hpp index 6cd3dc2974..6a30bd2c33 100644 --- a/pxr/external/boost/python/object_slices.hpp +++ b/pxr/external/boost/python/object_slices.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/opaque_pointer_converter.hpp b/pxr/external/boost/python/opaque_pointer_converter.hpp index 120985202b..d0b369162d 100644 --- a/pxr/external/boost/python/opaque_pointer_converter.hpp +++ b/pxr/external/boost/python/opaque_pointer_converter.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Gottfried Ganßauge 2003..2006. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/operators.hpp b/pxr/external/boost/python/operators.hpp index ea2be7b98f..e2aa1e8ffc 100644 --- a/pxr/external/boost/python/operators.hpp +++ b/pxr/external/boost/python/operators.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/other.hpp b/pxr/external/boost/python/other.hpp index 26ebb426ba..27d931d06e 100644 --- a/pxr/external/boost/python/other.hpp +++ b/pxr/external/boost/python/other.hpp @@ -2,6 +2,11 @@ # define BOOST_PYTHON_OTHER_HPP # include +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/overloads.hpp b/pxr/external/boost/python/overloads.hpp index e60dc1798e..7b7dd0dad1 100644 --- a/pxr/external/boost/python/overloads.hpp +++ b/pxr/external/boost/python/overloads.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/override.hpp b/pxr/external/boost/python/override.hpp index b631226fd6..4967b20671 100644 --- a/pxr/external/boost/python/override.hpp +++ b/pxr/external/boost/python/override.hpp @@ -1,5 +1,10 @@ #if !defined(BOOST_PP_IS_ITERATING) +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/pointee.hpp b/pxr/external/boost/python/pointee.hpp index 7ec01e0824..376222314a 100644 --- a/pxr/external/boost/python/pointee.hpp +++ b/pxr/external/boost/python/pointee.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/proxy.hpp b/pxr/external/boost/python/proxy.hpp index d3331d5676..76b0af0238 100644 --- a/pxr/external/boost/python/proxy.hpp +++ b/pxr/external/boost/python/proxy.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/ptr.hpp b/pxr/external/boost/python/ptr.hpp index 8e97aa4064..e1d49f449f 100644 --- a/pxr/external/boost/python/ptr.hpp +++ b/pxr/external/boost/python/ptr.hpp @@ -2,6 +2,11 @@ # define BOOST_PYTHON_PTR_HPP # include +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/pure_virtual.hpp b/pxr/external/boost/python/pure_virtual.hpp index 58e9aedef1..b53d88588f 100644 --- a/pxr/external/boost/python/pure_virtual.hpp +++ b/pxr/external/boost/python/pure_virtual.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/raw_function.hpp b/pxr/external/boost/python/raw_function.hpp index 9d9f6b8b1b..cdfb4982e8 100644 --- a/pxr/external/boost/python/raw_function.hpp +++ b/pxr/external/boost/python/raw_function.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/refcount.hpp b/pxr/external/boost/python/refcount.hpp index aa6aa5dbb6..9ae15bad66 100644 --- a/pxr/external/boost/python/refcount.hpp +++ b/pxr/external/boost/python/refcount.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/reference_existing_object.hpp b/pxr/external/boost/python/reference_existing_object.hpp index 4c8344070b..c3a0b765d7 100644 --- a/pxr/external/boost/python/reference_existing_object.hpp +++ b/pxr/external/boost/python/reference_existing_object.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/register_ptr_to_python.hpp b/pxr/external/boost/python/register_ptr_to_python.hpp index d39bd0cf71..44ded5b304 100644 --- a/pxr/external/boost/python/register_ptr_to_python.hpp +++ b/pxr/external/boost/python/register_ptr_to_python.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/return_arg.hpp b/pxr/external/boost/python/return_arg.hpp index de23993987..8af62f43fd 100644 --- a/pxr/external/boost/python/return_arg.hpp +++ b/pxr/external/boost/python/return_arg.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams and Nikolay Mladenov 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/return_by_value.hpp b/pxr/external/boost/python/return_by_value.hpp index 42d7076d17..6059954eda 100644 --- a/pxr/external/boost/python/return_by_value.hpp +++ b/pxr/external/boost/python/return_by_value.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/return_internal_reference.hpp b/pxr/external/boost/python/return_internal_reference.hpp index cc60f4422a..a2c659e3d1 100644 --- a/pxr/external/boost/python/return_internal_reference.hpp +++ b/pxr/external/boost/python/return_internal_reference.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/return_opaque_pointer.hpp b/pxr/external/boost/python/return_opaque_pointer.hpp index 4654e3bd51..efad6c0725 100644 --- a/pxr/external/boost/python/return_opaque_pointer.hpp +++ b/pxr/external/boost/python/return_opaque_pointer.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Gottfried Ganßauge 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/return_value_policy.hpp b/pxr/external/boost/python/return_value_policy.hpp index 9a5fba380b..ae110aeb43 100644 --- a/pxr/external/boost/python/return_value_policy.hpp +++ b/pxr/external/boost/python/return_value_policy.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/scope.hpp b/pxr/external/boost/python/scope.hpp index 8be3e054e0..cfac89e3af 100644 --- a/pxr/external/boost/python/scope.hpp +++ b/pxr/external/boost/python/scope.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/self.hpp b/pxr/external/boost/python/self.hpp index 99ec5b8fbe..6cff2cce09 100644 --- a/pxr/external/boost/python/self.hpp +++ b/pxr/external/boost/python/self.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/signature.hpp b/pxr/external/boost/python/signature.hpp index ab4bca390a..10bfdd647f 100644 --- a/pxr/external/boost/python/signature.hpp +++ b/pxr/external/boost/python/signature.hpp @@ -1,5 +1,9 @@ /////////////////////////////////////////////////////////////////////////////// // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002, Joel de Guzman, 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/slice.hpp b/pxr/external/boost/python/slice.hpp index 80660fab77..cc73b1d0dd 100644 --- a/pxr/external/boost/python/slice.hpp +++ b/pxr/external/boost/python/slice.hpp @@ -1,6 +1,11 @@ #ifndef BOOST_PYTHON_SLICE_JDB20040105_HPP #define BOOST_PYTHON_SLICE_JDB20040105_HPP +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (c) 2004 Jonathan Brandmeyer // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file diff --git a/pxr/external/boost/python/slice_nil.hpp b/pxr/external/boost/python/slice_nil.hpp index e911f06801..b9cc45b067 100644 --- a/pxr/external/boost/python/slice_nil.hpp +++ b/pxr/external/boost/python/slice_nil.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/converter/arg_to_python_base.cpp b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp index d872314a74..ce2b34d4b5 100644 --- a/pxr/external/boost/python/src/converter/arg_to_python_base.cpp +++ b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/converter/builtin_converters.cpp b/pxr/external/boost/python/src/converter/builtin_converters.cpp index ee2d5b4794..b05512adc4 100644 --- a/pxr/external/boost/python/src/converter/builtin_converters.cpp +++ b/pxr/external/boost/python/src/converter/builtin_converters.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/converter/from_python.cpp b/pxr/external/boost/python/src/converter/from_python.cpp index 9678be1cb6..9e092188af 100644 --- a/pxr/external/boost/python/src/converter/from_python.cpp +++ b/pxr/external/boost/python/src/converter/from_python.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/converter/registry.cpp b/pxr/external/boost/python/src/converter/registry.cpp index aa20c3f685..bd035f8087 100644 --- a/pxr/external/boost/python/src/converter/registry.cpp +++ b/pxr/external/boost/python/src/converter/registry.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/converter/type_id.cpp b/pxr/external/boost/python/src/converter/type_id.cpp index c6a8bf7a04..e5c27b00df 100644 --- a/pxr/external/boost/python/src/converter/type_id.cpp +++ b/pxr/external/boost/python/src/converter/type_id.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/dict.cpp b/pxr/external/boost/python/src/dict.cpp index 77d840d455..e82174536b 100644 --- a/pxr/external/boost/python/src/dict.cpp +++ b/pxr/external/boost/python/src/dict.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/src/errors.cpp b/pxr/external/boost/python/src/errors.cpp index 34ea22f43e..ae1fe797f1 100644 --- a/pxr/external/boost/python/src/errors.cpp +++ b/pxr/external/boost/python/src/errors.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/exec.cpp b/pxr/external/boost/python/src/exec.cpp index 7488da1f6d..de61de1b5c 100644 --- a/pxr/external/boost/python/src/exec.cpp +++ b/pxr/external/boost/python/src/exec.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/import.cpp b/pxr/external/boost/python/src/import.cpp index 0add79eea2..1ba0669abf 100644 --- a/pxr/external/boost/python/src/import.cpp +++ b/pxr/external/boost/python/src/import.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/list.cpp b/pxr/external/boost/python/src/list.cpp index 77e616881a..684881eb50 100644 --- a/pxr/external/boost/python/src/list.cpp +++ b/pxr/external/boost/python/src/list.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/long.cpp b/pxr/external/boost/python/src/long.cpp index 6aa2965e83..f605985c89 100644 --- a/pxr/external/boost/python/src/long.cpp +++ b/pxr/external/boost/python/src/long.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/module.cpp b/pxr/external/boost/python/src/module.cpp index 57675fa2df..73c052f860 100644 --- a/pxr/external/boost/python/src/module.cpp +++ b/pxr/external/boost/python/src/module.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/numpy/dtype.cpp b/pxr/external/boost/python/src/numpy/dtype.cpp index 88a20a27b5..8814992d16 100644 --- a/pxr/external/boost/python/src/numpy/dtype.cpp +++ b/pxr/external/boost/python/src/numpy/dtype.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/numpy/matrix.cpp b/pxr/external/boost/python/src/numpy/matrix.cpp index 47d2261637..80b186ad3f 100644 --- a/pxr/external/boost/python/src/numpy/matrix.cpp +++ b/pxr/external/boost/python/src/numpy/matrix.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/numpy/ndarray.cpp b/pxr/external/boost/python/src/numpy/ndarray.cpp index af09ecc338..99f9af30f0 100644 --- a/pxr/external/boost/python/src/numpy/ndarray.cpp +++ b/pxr/external/boost/python/src/numpy/ndarray.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/numpy/numpy.cpp b/pxr/external/boost/python/src/numpy/numpy.cpp index 3ae2295e39..bd3af0cf43 100644 --- a/pxr/external/boost/python/src/numpy/numpy.cpp +++ b/pxr/external/boost/python/src/numpy/numpy.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/numpy/scalars.cpp b/pxr/external/boost/python/src/numpy/scalars.cpp index 3947c06f2c..7268bf3805 100644 --- a/pxr/external/boost/python/src/numpy/scalars.cpp +++ b/pxr/external/boost/python/src/numpy/scalars.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/numpy/ufunc.cpp b/pxr/external/boost/python/src/numpy/ufunc.cpp index 173d7213ec..0be1aba724 100644 --- a/pxr/external/boost/python/src/numpy/ufunc.cpp +++ b/pxr/external/boost/python/src/numpy/ufunc.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/src/object/class.cpp b/pxr/external/boost/python/src/object/class.cpp index 8778b7abcd..eadbf29092 100644 --- a/pxr/external/boost/python/src/object/class.cpp +++ b/pxr/external/boost/python/src/object/class.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/enum.cpp b/pxr/external/boost/python/src/object/enum.cpp index 5753b32e07..eb23319f79 100644 --- a/pxr/external/boost/python/src/object/enum.cpp +++ b/pxr/external/boost/python/src/object/enum.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/function.cpp b/pxr/external/boost/python/src/object/function.cpp index 4adb49453c..61a87d7b1b 100644 --- a/pxr/external/boost/python/src/object/function.cpp +++ b/pxr/external/boost/python/src/object/function.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/function_doc_signature.cpp b/pxr/external/boost/python/src/object/function_doc_signature.cpp index 41695285ac..c22368b952 100644 --- a/pxr/external/boost/python/src/object/function_doc_signature.cpp +++ b/pxr/external/boost/python/src/object/function_doc_signature.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Nikolay Mladenov 2007. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/inheritance.cpp b/pxr/external/boost/python/src/object/inheritance.cpp index a7b3156e41..3367296157 100644 --- a/pxr/external/boost/python/src/object/inheritance.cpp +++ b/pxr/external/boost/python/src/object/inheritance.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/iterator.cpp b/pxr/external/boost/python/src/object/iterator.cpp index 6b885a982c..2e4ff7b155 100644 --- a/pxr/external/boost/python/src/object/iterator.cpp +++ b/pxr/external/boost/python/src/object/iterator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/life_support.cpp b/pxr/external/boost/python/src/object/life_support.cpp index 281c3bffc5..6754457cf8 100644 --- a/pxr/external/boost/python/src/object/life_support.cpp +++ b/pxr/external/boost/python/src/object/life_support.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/pickle_support.cpp b/pxr/external/boost/python/src/object/pickle_support.cpp index 428c07b6ca..1fa3895c23 100644 --- a/pxr/external/boost/python/src/object/pickle_support.cpp +++ b/pxr/external/boost/python/src/object/pickle_support.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright R.W. Grosse-Kunstleve 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object/stl_iterator.cpp b/pxr/external/boost/python/src/object/stl_iterator.cpp index e32d321452..da8b77604c 100644 --- a/pxr/external/boost/python/src/object/stl_iterator.cpp +++ b/pxr/external/boost/python/src/object/stl_iterator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Eric Niebler 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object_operators.cpp b/pxr/external/boost/python/src/object_operators.cpp index b993245fe9..e31e42b681 100644 --- a/pxr/external/boost/python/src/object_operators.cpp +++ b/pxr/external/boost/python/src/object_operators.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/object_protocol.cpp b/pxr/external/boost/python/src/object_protocol.cpp index 95c8c73ee6..e85d16655a 100644 --- a/pxr/external/boost/python/src/object_protocol.cpp +++ b/pxr/external/boost/python/src/object_protocol.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/slice.cpp b/pxr/external/boost/python/src/slice.cpp index ee55f94846..1a769fa50d 100644 --- a/pxr/external/boost/python/src/slice.cpp +++ b/pxr/external/boost/python/src/slice.cpp @@ -1,5 +1,10 @@ #include "boost/python/slice.hpp" +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (c) 2004 Jonathan Brandmeyer // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file diff --git a/pxr/external/boost/python/src/str.cpp b/pxr/external/boost/python/src/str.cpp index 5122f7f57f..63954ca8bc 100644 --- a/pxr/external/boost/python/src/str.cpp +++ b/pxr/external/boost/python/src/str.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/src/tuple.cpp b/pxr/external/boost/python/src/tuple.cpp index 6719713b73..f1f38a37a4 100644 --- a/pxr/external/boost/python/src/tuple.cpp +++ b/pxr/external/boost/python/src/tuple.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/src/wrapper.cpp b/pxr/external/boost/python/src/wrapper.cpp index 8b1b884769..75d5421e7d 100644 --- a/pxr/external/boost/python/src/wrapper.cpp +++ b/pxr/external/boost/python/src/wrapper.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/ssize_t.hpp b/pxr/external/boost/python/ssize_t.hpp index e8a2d92f63..99ce20e5b7 100644 --- a/pxr/external/boost/python/ssize_t.hpp +++ b/pxr/external/boost/python/ssize_t.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve & David Abrahams 2006. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/stl_iterator.hpp b/pxr/external/boost/python/stl_iterator.hpp index 838954879a..03b6ead903 100644 --- a/pxr/external/boost/python/stl_iterator.hpp +++ b/pxr/external/boost/python/stl_iterator.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Eric Niebler 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/str.hpp b/pxr/external/boost/python/str.hpp index 434c8c986c..8202bf7c82 100644 --- a/pxr/external/boost/python/str.hpp +++ b/pxr/external/boost/python/str.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/suite/indexing/container_utils.hpp b/pxr/external/boost/python/suite/indexing/container_utils.hpp index 72710bb8b0..fca45a0fcc 100644 --- a/pxr/external/boost/python/suite/indexing/container_utils.hpp +++ b/pxr/external/boost/python/suite/indexing/container_utils.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Joel de Guzman 2003. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp index eb8b81c0a3..11ef8eb652 100644 --- a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp +++ b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Joel de Guzman 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp index 3469a2a40f..b4d044130b 100644 --- a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Joel de Guzman 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp index 7fbad4cace..4e0b6454da 100644 --- a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Joel de Guzman 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp index 34c29ecc6f..be8e546462 100644 --- a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // (C) Copyright Joel de Guzman 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/tag.hpp b/pxr/external/boost/python/tag.hpp index ccff9f1a17..8d946326ca 100644 --- a/pxr/external/boost/python/tag.hpp +++ b/pxr/external/boost/python/tag.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/a_map_indexing_suite.cpp b/pxr/external/boost/python/test/a_map_indexing_suite.cpp index 07a0a6b977..b76d5010fa 100644 --- a/pxr/external/boost/python/test/a_map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/a_map_indexing_suite.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Joel de Guzman 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/aligned_class.cpp b/pxr/external/boost/python/test/aligned_class.cpp index 55f0fa3c70..f794195c4a 100644 --- a/pxr/external/boost/python/test/aligned_class.cpp +++ b/pxr/external/boost/python/test/aligned_class.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/aligned_class.py b/pxr/external/boost/python/test/aligned_class.py index eb27ac1e96..0a12899bb2 100755 --- a/pxr/external/boost/python/test/aligned_class.py +++ b/pxr/external/boost/python/test/aligned_class.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/andreas_beyer.cpp b/pxr/external/boost/python/test/andreas_beyer.cpp index b28b15660a..e4bb9e9535 100644 --- a/pxr/external/boost/python/test/andreas_beyer.cpp +++ b/pxr/external/boost/python/test/andreas_beyer.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2006. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/andreas_beyer.py b/pxr/external/boost/python/test/andreas_beyer.py index 0c24969bd5..8ab4370227 100644 --- a/pxr/external/boost/python/test/andreas_beyer.py +++ b/pxr/external/boost/python/test/andreas_beyer.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/args.cpp b/pxr/external/boost/python/test/args.cpp index 592a8e5053..b56354ee2b 100644 --- a/pxr/external/boost/python/test/args.cpp +++ b/pxr/external/boost/python/test/args.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/args.py b/pxr/external/boost/python/test/args.py index 5d89921467..8c8a06a512 100644 --- a/pxr/external/boost/python/test/args.py +++ b/pxr/external/boost/python/test/args.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/as_to_python_function.cpp b/pxr/external/boost/python/test/as_to_python_function.cpp index cc083890a6..4780114f50 100644 --- a/pxr/external/boost/python/test/as_to_python_function.cpp +++ b/pxr/external/boost/python/test/as_to_python_function.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/auto_ptr.cpp b/pxr/external/boost/python/test/auto_ptr.cpp index 0f61e96dc3..93375b9b1a 100644 --- a/pxr/external/boost/python/test/auto_ptr.cpp +++ b/pxr/external/boost/python/test/auto_ptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/auto_ptr.py b/pxr/external/boost/python/test/auto_ptr.py index 12e977d062..7e76ff93d1 100644 --- a/pxr/external/boost/python/test/auto_ptr.py +++ b/pxr/external/boost/python/test/auto_ptr.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/back_reference.cpp b/pxr/external/boost/python/test/back_reference.cpp index 266ed29125..f6b7a61b8c 100644 --- a/pxr/external/boost/python/test/back_reference.cpp +++ b/pxr/external/boost/python/test/back_reference.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/back_reference.py b/pxr/external/boost/python/test/back_reference.py index 4a283a3e3e..f5437c87d0 100644 --- a/pxr/external/boost/python/test/back_reference.py +++ b/pxr/external/boost/python/test/back_reference.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bases.cpp b/pxr/external/boost/python/test/bases.cpp index 4e00f5448a..15e055cada 100644 --- a/pxr/external/boost/python/test/bases.cpp +++ b/pxr/external/boost/python/test/bases.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/ben_scott1.cpp b/pxr/external/boost/python/test/ben_scott1.cpp index 5a675e2302..fdac01e008 100644 --- a/pxr/external/boost/python/test/ben_scott1.cpp +++ b/pxr/external/boost/python/test/ben_scott1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/ben_scott1.py b/pxr/external/boost/python/test/ben_scott1.py index 79130757a3..cfe69a39e5 100644 --- a/pxr/external/boost/python/test/ben_scott1.py +++ b/pxr/external/boost/python/test/ben_scott1.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman1.cpp b/pxr/external/boost/python/test/bienstman1.cpp index dc00657848..8d3f5ab32c 100644 --- a/pxr/external/boost/python/test/bienstman1.cpp +++ b/pxr/external/boost/python/test/bienstman1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman1.py b/pxr/external/boost/python/test/bienstman1.py index 16dc47b2d1..ca10c3bfdf 100644 --- a/pxr/external/boost/python/test/bienstman1.py +++ b/pxr/external/boost/python/test/bienstman1.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman2.cpp b/pxr/external/boost/python/test/bienstman2.cpp index 10f99923d1..bece9acd98 100644 --- a/pxr/external/boost/python/test/bienstman2.cpp +++ b/pxr/external/boost/python/test/bienstman2.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman2.py b/pxr/external/boost/python/test/bienstman2.py index 931fae8f74..e706a4d000 100644 --- a/pxr/external/boost/python/test/bienstman2.py +++ b/pxr/external/boost/python/test/bienstman2.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman3.cpp b/pxr/external/boost/python/test/bienstman3.cpp index d765b303d6..b859191a43 100644 --- a/pxr/external/boost/python/test/bienstman3.cpp +++ b/pxr/external/boost/python/test/bienstman3.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman3.py b/pxr/external/boost/python/test/bienstman3.py index d0d250aea9..a5634e364a 100644 --- a/pxr/external/boost/python/test/bienstman3.py +++ b/pxr/external/boost/python/test/bienstman3.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman4.cpp b/pxr/external/boost/python/test/bienstman4.cpp index 34b9e211fb..e183862d7d 100644 --- a/pxr/external/boost/python/test/bienstman4.cpp +++ b/pxr/external/boost/python/test/bienstman4.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/bienstman4.py b/pxr/external/boost/python/test/bienstman4.py index eea33ba2a8..a7c6a5289f 100644 --- a/pxr/external/boost/python/test/bienstman4.py +++ b/pxr/external/boost/python/test/bienstman4.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/bienstman5.cpp b/pxr/external/boost/python/test/bienstman5.cpp index 657dadd121..bf9898ac8e 100644 --- a/pxr/external/boost/python/test/bienstman5.cpp +++ b/pxr/external/boost/python/test/bienstman5.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/bienstman5.py b/pxr/external/boost/python/test/bienstman5.py index a6735d9422..63e820a682 100644 --- a/pxr/external/boost/python/test/bienstman5.py +++ b/pxr/external/boost/python/test/bienstman5.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/boost_shared_ptr.cpp b/pxr/external/boost/python/test/boost_shared_ptr.cpp index 57e50aa3c1..b7c39332b7 100644 --- a/pxr/external/boost/python/test/boost_shared_ptr.cpp +++ b/pxr/external/boost/python/test/boost_shared_ptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/test/boost_shared_ptr.py b/pxr/external/boost/python/test/boost_shared_ptr.py index 31a2ad3d25..5fd946d703 100644 --- a/pxr/external/boost/python/test/boost_shared_ptr.py +++ b/pxr/external/boost/python/test/boost_shared_ptr.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/borrowed.cpp b/pxr/external/boost/python/test/borrowed.cpp index 2c1bd1b7a0..4a7bf3e0b0 100644 --- a/pxr/external/boost/python/test/borrowed.cpp +++ b/pxr/external/boost/python/test/borrowed.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/builtin_converters.cpp b/pxr/external/boost/python/test/builtin_converters.cpp index f66e61bd82..a846f03579 100644 --- a/pxr/external/boost/python/test/builtin_converters.cpp +++ b/pxr/external/boost/python/test/builtin_converters.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/callbacks.cpp b/pxr/external/boost/python/test/callbacks.cpp index 66bd352405..82ca7ee0b1 100644 --- a/pxr/external/boost/python/test/callbacks.cpp +++ b/pxr/external/boost/python/test/callbacks.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/callbacks.py b/pxr/external/boost/python/test/callbacks.py index cf876a89d5..e543cbbad6 100644 --- a/pxr/external/boost/python/test/callbacks.py +++ b/pxr/external/boost/python/test/callbacks.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/calling_conventions.cpp b/pxr/external/boost/python/test/calling_conventions.cpp index c1c2b5a411..607d2f6970 100644 --- a/pxr/external/boost/python/test/calling_conventions.cpp +++ b/pxr/external/boost/python/test/calling_conventions.cpp @@ -1,8 +1,11 @@ -// // adapted from bind_stdcall_test.cpp - test for bind.hpp + __stdcall (free functions) // The purpose of this simple test is to determine if a function can be // called from Python with the various existing calling conventions // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (c) 2001 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/test/calling_conventions.py b/pxr/external/boost/python/test/calling_conventions.py index c57142448b..81c3bd47d9 100644 --- a/pxr/external/boost/python/test/calling_conventions.py +++ b/pxr/external/boost/python/test/calling_conventions.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Nicolas Lelong, 2010. Distributed under the Boost # Software License, Version 1.0 (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/calling_conventions_mf.cpp b/pxr/external/boost/python/test/calling_conventions_mf.cpp index 83a97acfef..23803cbe0c 100644 --- a/pxr/external/boost/python/test/calling_conventions_mf.cpp +++ b/pxr/external/boost/python/test/calling_conventions_mf.cpp @@ -3,6 +3,10 @@ // The purpose of this simple test is to determine if a function can be // called from Python with the various existing calling conventions // +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (c) 2001 Peter Dimov and Multi Media Ltd. // // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/test/calling_conventions_mf.py b/pxr/external/boost/python/test/calling_conventions_mf.py index 7e28484b9b..8e56d82aa8 100644 --- a/pxr/external/boost/python/test/calling_conventions_mf.py +++ b/pxr/external/boost/python/test/calling_conventions_mf.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Nicolas Lelong, 2010. Distributed under the Boost # Software License, Version 1.0 (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/class.cpp b/pxr/external/boost/python/test/class.cpp index 078bebdf64..4dd299764b 100644 --- a/pxr/external/boost/python/test/class.cpp +++ b/pxr/external/boost/python/test/class.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/class.py b/pxr/external/boost/python/test/class.py index 15594a105b..7125a933dd 100644 --- a/pxr/external/boost/python/test/class.py +++ b/pxr/external/boost/python/test/class.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/cltree.cpp b/pxr/external/boost/python/test/cltree.cpp index 518ae37fef..30737ab2fa 100644 --- a/pxr/external/boost/python/test/cltree.cpp +++ b/pxr/external/boost/python/test/cltree.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2005. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/complicated.hpp b/pxr/external/boost/python/test/complicated.hpp index 5ff19aea0e..028793ab17 100644 --- a/pxr/external/boost/python/test/complicated.hpp +++ b/pxr/external/boost/python/test/complicated.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/const_argument.cpp b/pxr/external/boost/python/test/const_argument.cpp index 279c3dc1ae..19b1fa50f8 100644 --- a/pxr/external/boost/python/test/const_argument.cpp +++ b/pxr/external/boost/python/test/const_argument.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// /* Copyright 2004 Jonathan Brandmeyer * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file diff --git a/pxr/external/boost/python/test/const_argument.py b/pxr/external/boost/python/test/const_argument.py index 1d241953b3..8c825cfa62 100644 --- a/pxr/external/boost/python/test/const_argument.py +++ b/pxr/external/boost/python/test/const_argument.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jonathan Brandmeyer, 2004. Distributed under the Boost # Software License, Version 1.0 (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp index 41eac495e4..b24124e9a7 100644 --- a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp +++ b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/crossmod_exception.py b/pxr/external/boost/python/test/crossmod_exception.py index 4820f29e96..ca10be963f 100644 --- a/pxr/external/boost/python/test/crossmod_exception.py +++ b/pxr/external/boost/python/test/crossmod_exception.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright (C) 2003 Rational Discovery LLC. Distributed under the Boost # Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy # at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/crossmod_exception_a.cpp b/pxr/external/boost/python/test/crossmod_exception_a.cpp index 9526129af5..4f32013a6e 100644 --- a/pxr/external/boost/python/test/crossmod_exception_a.cpp +++ b/pxr/external/boost/python/test/crossmod_exception_a.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (C) 2003 Rational Discovery LLC // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/crossmod_exception_b.cpp b/pxr/external/boost/python/test/crossmod_exception_b.cpp index e2ea491caa..3fc8ab0bd5 100644 --- a/pxr/external/boost/python/test/crossmod_exception_b.cpp +++ b/pxr/external/boost/python/test/crossmod_exception_b.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (C) 2003 Rational Discovery LLC // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/crossmod_opaque.py b/pxr/external/boost/python/test/crossmod_opaque.py index 533ac16fe1..b7f119999f 100644 --- a/pxr/external/boost/python/test/crossmod_opaque.py +++ b/pxr/external/boost/python/test/crossmod_opaque.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Gottfried Ganßauge 2006. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/crossmod_opaque_a.cpp b/pxr/external/boost/python/test/crossmod_opaque_a.cpp index 62ed433111..d6ede375d5 100644 --- a/pxr/external/boost/python/test/crossmod_opaque_a.cpp +++ b/pxr/external/boost/python/test/crossmod_opaque_a.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Gottfried Ganßauge 2006. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/crossmod_opaque_b.cpp b/pxr/external/boost/python/test/crossmod_opaque_b.cpp index 3d661339ce..dad5e07d8f 100644 --- a/pxr/external/boost/python/test/crossmod_opaque_b.cpp +++ b/pxr/external/boost/python/test/crossmod_opaque_b.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Gottfried Ganßauge 2006. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/data_members.cpp b/pxr/external/boost/python/test/data_members.cpp index 6d2cc7bd4e..8b5c34fc3b 100644 --- a/pxr/external/boost/python/test/data_members.cpp +++ b/pxr/external/boost/python/test/data_members.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/data_members.py b/pxr/external/boost/python/test/data_members.py index 74b655eb56..ea1f874fdd 100644 --- a/pxr/external/boost/python/test/data_members.py +++ b/pxr/external/boost/python/test/data_members.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/defaults.cpp b/pxr/external/boost/python/test/defaults.cpp index 6d87e5d6ee..fcdd7b77cf 100644 --- a/pxr/external/boost/python/test/defaults.cpp +++ b/pxr/external/boost/python/test/defaults.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/defaults.py b/pxr/external/boost/python/test/defaults.py index cf3cfd38f3..1517dab52a 100644 --- a/pxr/external/boost/python/test/defaults.py +++ b/pxr/external/boost/python/test/defaults.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/destroy_test.cpp b/pxr/external/boost/python/test/destroy_test.cpp index 57501604b3..660967490a 100644 --- a/pxr/external/boost/python/test/destroy_test.cpp +++ b/pxr/external/boost/python/test/destroy_test.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/dict.cpp b/pxr/external/boost/python/test/dict.cpp index 4f3490a421..762d5e71d3 100644 --- a/pxr/external/boost/python/test/dict.cpp +++ b/pxr/external/boost/python/test/dict.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/dict.py b/pxr/external/boost/python/test/dict.py index 9b1149ae60..575bd9f6d1 100644 --- a/pxr/external/boost/python/test/dict.py +++ b/pxr/external/boost/python/test/dict.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/docstring.cpp b/pxr/external/boost/python/test/docstring.cpp index c6cc0252b0..fc947e6643 100644 --- a/pxr/external/boost/python/test/docstring.cpp +++ b/pxr/external/boost/python/test/docstring.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/docstring.py b/pxr/external/boost/python/test/docstring.py index 2727bd6d5e..57202aafc7 100644 --- a/pxr/external/boost/python/test/docstring.py +++ b/pxr/external/boost/python/test/docstring.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams & Ralf W. Grosse-Kunsteve 2004-2006. # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/enable_shared_from_this.cpp b/pxr/external/boost/python/test/enable_shared_from_this.cpp index c246284a16..62239b5a39 100644 --- a/pxr/external/boost/python/test/enable_shared_from_this.cpp +++ b/pxr/external/boost/python/test/enable_shared_from_this.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/enable_shared_from_this.py b/pxr/external/boost/python/test/enable_shared_from_this.py index d7ac7a9999..fbf734cb69 100644 --- a/pxr/external/boost/python/test/enable_shared_from_this.py +++ b/pxr/external/boost/python/test/enable_shared_from_this.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/enum_ext.cpp b/pxr/external/boost/python/test/enum_ext.cpp index 74224f1d77..81282297fc 100644 --- a/pxr/external/boost/python/test/enum_ext.cpp +++ b/pxr/external/boost/python/test/enum_ext.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/exception_translator.cpp b/pxr/external/boost/python/test/exception_translator.cpp index 1e91c9296f..4bf02bb201 100644 --- a/pxr/external/boost/python/test/exception_translator.cpp +++ b/pxr/external/boost/python/test/exception_translator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/exception_translator.py b/pxr/external/boost/python/test/exception_translator.py index 1d80aba3a2..677d7bbd61 100644 --- a/pxr/external/boost/python/test/exception_translator.py +++ b/pxr/external/boost/python/test/exception_translator.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/exec.cpp b/pxr/external/boost/python/test/exec.cpp index 72ff571bd6..9b15d90ec6 100644 --- a/pxr/external/boost/python/test/exec.cpp +++ b/pxr/external/boost/python/test/exec.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/exec.py b/pxr/external/boost/python/test/exec.py index c7bf28f350..00bdf5350b 100644 --- a/pxr/external/boost/python/test/exec.py +++ b/pxr/external/boost/python/test/exec.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Stefan Seefeld 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/extract.cpp b/pxr/external/boost/python/test/extract.cpp index 40584a0777..87c6487a6d 100644 --- a/pxr/external/boost/python/test/extract.cpp +++ b/pxr/external/boost/python/test/extract.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/extract.py b/pxr/external/boost/python/test/extract.py index feda93a1d5..b4f42b6ad0 100644 --- a/pxr/external/boost/python/test/extract.py +++ b/pxr/external/boost/python/test/extract.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/if_else.cpp b/pxr/external/boost/python/test/if_else.cpp index 60cc53192d..9e104aecc1 100644 --- a/pxr/external/boost/python/test/if_else.cpp +++ b/pxr/external/boost/python/test/if_else.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/implicit.cpp b/pxr/external/boost/python/test/implicit.cpp index a1bae59e86..3711df07cb 100644 --- a/pxr/external/boost/python/test/implicit.cpp +++ b/pxr/external/boost/python/test/implicit.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/implicit.py b/pxr/external/boost/python/test/implicit.py index f2aa3e1d36..aff9e57e6f 100644 --- a/pxr/external/boost/python/test/implicit.py +++ b/pxr/external/boost/python/test/implicit.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/import_.cpp b/pxr/external/boost/python/test/import_.cpp index 8e03d9b448..06e9e78769 100644 --- a/pxr/external/boost/python/test/import_.cpp +++ b/pxr/external/boost/python/test/import_.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Stefan Seefeld 2007. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/import_.py b/pxr/external/boost/python/test/import_.py index 48de6e5ecb..b86a8627df 100644 --- a/pxr/external/boost/python/test/import_.py +++ b/pxr/external/boost/python/test/import_.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Stefan Seefeld 2007. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/indirect_traits_test.cpp b/pxr/external/boost/python/test/indirect_traits_test.cpp index da4cc24569..6a0c64ffee 100644 --- a/pxr/external/boost/python/test/indirect_traits_test.cpp +++ b/pxr/external/boost/python/test/indirect_traits_test.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/injected.cpp b/pxr/external/boost/python/test/injected.cpp index 73e1e14baa..34fbf4fb57 100644 --- a/pxr/external/boost/python/test/injected.cpp +++ b/pxr/external/boost/python/test/injected.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/injected.py b/pxr/external/boost/python/test/injected.py index c502150483..188586039e 100644 --- a/pxr/external/boost/python/test/injected.py +++ b/pxr/external/boost/python/test/injected.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/input_iterator.cpp b/pxr/external/boost/python/test/input_iterator.cpp index 70b994186f..113acafc65 100644 --- a/pxr/external/boost/python/test/input_iterator.cpp +++ b/pxr/external/boost/python/test/input_iterator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/int_map_indexing_suite.cpp b/pxr/external/boost/python/test/int_map_indexing_suite.cpp index 3978501314..1a73f76117 100644 --- a/pxr/external/boost/python/test/int_map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/int_map_indexing_suite.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/iterator.cpp b/pxr/external/boost/python/test/iterator.cpp index 458ba29268..d8b95fb29e 100644 --- a/pxr/external/boost/python/test/iterator.cpp +++ b/pxr/external/boost/python/test/iterator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/iterator.py b/pxr/external/boost/python/test/iterator.py index 0d75100a09..cb99366fe6 100644 --- a/pxr/external/boost/python/test/iterator.py +++ b/pxr/external/boost/python/test/iterator.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/keywords.cpp b/pxr/external/boost/python/test/keywords.cpp index 39bac0627b..7e6acc50ba 100644 --- a/pxr/external/boost/python/test/keywords.cpp +++ b/pxr/external/boost/python/test/keywords.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/keywords_test.py b/pxr/external/boost/python/test/keywords_test.py index bac7d17c1f..af39767bdd 100644 --- a/pxr/external/boost/python/test/keywords_test.py +++ b/pxr/external/boost/python/test/keywords_test.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/list.cpp b/pxr/external/boost/python/test/list.cpp index 3e9fcbe66f..c52bf03ad6 100644 --- a/pxr/external/boost/python/test/list.cpp +++ b/pxr/external/boost/python/test/list.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/list.py b/pxr/external/boost/python/test/list.py index f6cf87096f..513f0589e1 100644 --- a/pxr/external/boost/python/test/list.py +++ b/pxr/external/boost/python/test/list.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/long.cpp b/pxr/external/boost/python/test/long.cpp index 61e4518ff0..b8b817597c 100644 --- a/pxr/external/boost/python/test/long.cpp +++ b/pxr/external/boost/python/test/long.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/long.py b/pxr/external/boost/python/test/long.py index 157dc57aa9..8eda3cc33c 100644 --- a/pxr/external/boost/python/test/long.py +++ b/pxr/external/boost/python/test/long.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/m1.cpp b/pxr/external/boost/python/test/m1.cpp index a873bc35d2..fbb7bb026c 100644 --- a/pxr/external/boost/python/test/m1.cpp +++ b/pxr/external/boost/python/test/m1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/m2.cpp b/pxr/external/boost/python/test/m2.cpp index 5bcdea6043..c70d3919e9 100644 --- a/pxr/external/boost/python/test/m2.cpp +++ b/pxr/external/boost/python/test/m2.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/map_indexing_suite.cpp b/pxr/external/boost/python/test/map_indexing_suite.cpp index b8771cf41c..d236a6521f 100644 --- a/pxr/external/boost/python/test/map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/map_indexing_suite.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Joel de Guzman 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/map_indexing_suite.py b/pxr/external/boost/python/test/map_indexing_suite.py index e772bb53f9..91e981e536 100644 --- a/pxr/external/boost/python/test/map_indexing_suite.py +++ b/pxr/external/boost/python/test/map_indexing_suite.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Joel de Guzman 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/minimal.cpp b/pxr/external/boost/python/test/minimal.cpp index 5efee26bcd..c8a4ab7ab0 100644 --- a/pxr/external/boost/python/test/minimal.cpp +++ b/pxr/external/boost/python/test/minimal.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/minimal.py b/pxr/external/boost/python/test/minimal.py index ee75e3705b..e1afaf0f5c 100644 --- a/pxr/external/boost/python/test/minimal.py +++ b/pxr/external/boost/python/test/minimal.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/module_init_exception.cpp b/pxr/external/boost/python/test/module_init_exception.cpp index d8cec57d3a..5318b46c3d 100644 --- a/pxr/external/boost/python/test/module_init_exception.cpp +++ b/pxr/external/boost/python/test/module_init_exception.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (C) 2003 Rational Discovery LLC // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/module_init_exception.py b/pxr/external/boost/python/test/module_init_exception.py index 3da53e1956..9cbd7e7bda 100644 --- a/pxr/external/boost/python/test/module_init_exception.py +++ b/pxr/external/boost/python/test/module_init_exception.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright (C) 2003 Rational Discovery LLC. Distributed under the Boost # Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy # at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/module_tail.cpp b/pxr/external/boost/python/test/module_tail.cpp index f9cdca1898..72257bb136 100644 --- a/pxr/external/boost/python/test/module_tail.cpp +++ b/pxr/external/boost/python/test/module_tail.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/multi_arg_constructor.cpp b/pxr/external/boost/python/test/multi_arg_constructor.cpp index 7d49bb5567..5d1222fc05 100644 --- a/pxr/external/boost/python/test/multi_arg_constructor.cpp +++ b/pxr/external/boost/python/test/multi_arg_constructor.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/multi_arg_constructor.py b/pxr/external/boost/python/test/multi_arg_constructor.py index 5d8b4a516c..22dbdfc811 100644 --- a/pxr/external/boost/python/test/multi_arg_constructor.py +++ b/pxr/external/boost/python/test/multi_arg_constructor.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/nested.cpp b/pxr/external/boost/python/test/nested.cpp index de656d2b8b..9410128e52 100644 --- a/pxr/external/boost/python/test/nested.cpp +++ b/pxr/external/boost/python/test/nested.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/nested.py b/pxr/external/boost/python/test/nested.py index 720790173c..824c825452 100644 --- a/pxr/external/boost/python/test/nested.py +++ b/pxr/external/boost/python/test/nested.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/newtest.py b/pxr/external/boost/python/test/newtest.py index b878d51924..96439f0df5 100644 --- a/pxr/external/boost/python/test/newtest.py +++ b/pxr/external/boost/python/test/newtest.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/numpy/dtype.cpp b/pxr/external/boost/python/test/numpy/dtype.cpp index 3a011a25e2..80698e08f7 100644 --- a/pxr/external/boost/python/test/numpy/dtype.cpp +++ b/pxr/external/boost/python/test/numpy/dtype.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/dtype.py b/pxr/external/boost/python/test/numpy/dtype.py index a27ee0f55d..82251544ad 100644 --- a/pxr/external/boost/python/test/numpy/dtype.py +++ b/pxr/external/boost/python/test/numpy/dtype.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/numpy/indexing.cpp b/pxr/external/boost/python/test/numpy/indexing.cpp index f3cc457178..08c52453c5 100644 --- a/pxr/external/boost/python/test/numpy/indexing.cpp +++ b/pxr/external/boost/python/test/numpy/indexing.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/indexing.py b/pxr/external/boost/python/test/numpy/indexing.py index ebd9dcbabb..2b41c8bff0 100644 --- a/pxr/external/boost/python/test/numpy/indexing.py +++ b/pxr/external/boost/python/test/numpy/indexing.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/numpy/ndarray.cpp b/pxr/external/boost/python/test/numpy/ndarray.cpp index 75a1010435..11b75e3bf7 100644 --- a/pxr/external/boost/python/test/numpy/ndarray.cpp +++ b/pxr/external/boost/python/test/numpy/ndarray.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/ndarray.py b/pxr/external/boost/python/test/numpy/ndarray.py index 2acc384a52..a03635973e 100644 --- a/pxr/external/boost/python/test/numpy/ndarray.py +++ b/pxr/external/boost/python/test/numpy/ndarray.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/numpy/shapes.cpp b/pxr/external/boost/python/test/numpy/shapes.cpp index a245df155c..31f944059a 100644 --- a/pxr/external/boost/python/test/numpy/shapes.cpp +++ b/pxr/external/boost/python/test/numpy/shapes.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/shapes.py b/pxr/external/boost/python/test/numpy/shapes.py index d0a0099ca6..13c62b0196 100644 --- a/pxr/external/boost/python/test/numpy/shapes.py +++ b/pxr/external/boost/python/test/numpy/shapes.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/numpy/templates.cpp b/pxr/external/boost/python/test/numpy/templates.cpp index 83de6bd2f0..2129ac9938 100644 --- a/pxr/external/boost/python/test/numpy/templates.cpp +++ b/pxr/external/boost/python/test/numpy/templates.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/templates.py b/pxr/external/boost/python/test/numpy/templates.py index 8290b13a07..0e8c0844f8 100755 --- a/pxr/external/boost/python/test/numpy/templates.py +++ b/pxr/external/boost/python/test/numpy/templates.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/numpy/ufunc.cpp b/pxr/external/boost/python/test/numpy/ufunc.cpp index 3a9d43cbbe..ec9f604754 100644 --- a/pxr/external/boost/python/test/numpy/ufunc.cpp +++ b/pxr/external/boost/python/test/numpy/ufunc.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Jim Bosch & Ankit Daftery 2010-2012. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. diff --git a/pxr/external/boost/python/test/numpy/ufunc.py b/pxr/external/boost/python/test/numpy/ufunc.py index e820121ee1..23e40d1423 100755 --- a/pxr/external/boost/python/test/numpy/ufunc.py +++ b/pxr/external/boost/python/test/numpy/ufunc.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/object.cpp b/pxr/external/boost/python/test/object.cpp index b1f015187c..6ad705fe7f 100644 --- a/pxr/external/boost/python/test/object.cpp +++ b/pxr/external/boost/python/test/object.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/object.py b/pxr/external/boost/python/test/object.py index cf6c2de0c5..2e7a574bbb 100644 --- a/pxr/external/boost/python/test/object.py +++ b/pxr/external/boost/python/test/object.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/object_fail1.cpp b/pxr/external/boost/python/test/object_fail1.cpp index 6bb2eda5c1..9e0dfa5668 100644 --- a/pxr/external/boost/python/test/object_fail1.cpp +++ b/pxr/external/boost/python/test/object_fail1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/object_manager.cpp b/pxr/external/boost/python/test/object_manager.cpp index e3608c1f1d..24fedbbb1c 100644 --- a/pxr/external/boost/python/test/object_manager.cpp +++ b/pxr/external/boost/python/test/object_manager.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/opaque.cpp b/pxr/external/boost/python/test/opaque.cpp index f15e9458f4..14d8a36326 100644 --- a/pxr/external/boost/python/test/opaque.cpp +++ b/pxr/external/boost/python/test/opaque.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams and Gottfried Ganssauge 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/opaque.py b/pxr/external/boost/python/test/opaque.py index 9f5663723d..c9a6216841 100644 --- a/pxr/external/boost/python/test/opaque.py +++ b/pxr/external/boost/python/test/opaque.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Gottfried Ganßauge 2003..2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/operators.cpp b/pxr/external/boost/python/test/operators.cpp index c58f2b005f..3134e0d4ab 100644 --- a/pxr/external/boost/python/test/operators.cpp +++ b/pxr/external/boost/python/test/operators.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/operators.py b/pxr/external/boost/python/test/operators.py index 5b369803c6..4ab7691720 100644 --- a/pxr/external/boost/python/test/operators.py +++ b/pxr/external/boost/python/test/operators.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/operators_wrapper.cpp b/pxr/external/boost/python/test/operators_wrapper.cpp index 12f30048d0..9e18b89adf 100644 --- a/pxr/external/boost/python/test/operators_wrapper.cpp +++ b/pxr/external/boost/python/test/operators_wrapper.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// #include "boost/python.hpp" #include diff --git a/pxr/external/boost/python/test/operators_wrapper.py b/pxr/external/boost/python/test/operators_wrapper.py index 6c889b0a39..84c4e084a2 100644 --- a/pxr/external/boost/python/test/operators_wrapper.py +++ b/pxr/external/boost/python/test/operators_wrapper.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# from operators_wrapper_ext import * class D2(vector): pass diff --git a/pxr/external/boost/python/test/pickle1.cpp b/pxr/external/boost/python/test/pickle1.cpp index cc4ad67952..c99c62c0cc 100644 --- a/pxr/external/boost/python/test/pickle1.cpp +++ b/pxr/external/boost/python/test/pickle1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle1.py b/pxr/external/boost/python/test/pickle1.py index b8f4efd9b0..e47705a861 100644 --- a/pxr/external/boost/python/test/pickle1.py +++ b/pxr/external/boost/python/test/pickle1.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle2.cpp b/pxr/external/boost/python/test/pickle2.cpp index c9610946e4..e20fe82a3c 100644 --- a/pxr/external/boost/python/test/pickle2.cpp +++ b/pxr/external/boost/python/test/pickle2.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle2.py b/pxr/external/boost/python/test/pickle2.py index 4c11ef3a85..c8ca1af7e4 100644 --- a/pxr/external/boost/python/test/pickle2.py +++ b/pxr/external/boost/python/test/pickle2.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle3.cpp b/pxr/external/boost/python/test/pickle3.cpp index 7afe2dbfa8..6fcd1ad2fe 100644 --- a/pxr/external/boost/python/test/pickle3.cpp +++ b/pxr/external/boost/python/test/pickle3.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve 2002-2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle3.py b/pxr/external/boost/python/test/pickle3.py index 391e3d00f1..56429a8a85 100644 --- a/pxr/external/boost/python/test/pickle3.py +++ b/pxr/external/boost/python/test/pickle3.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle4.cpp b/pxr/external/boost/python/test/pickle4.cpp index 1374cc7dc2..6a8b0de33e 100644 --- a/pxr/external/boost/python/test/pickle4.cpp +++ b/pxr/external/boost/python/test/pickle4.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Ralf W. Grosse-Kunstleve 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pickle4.py b/pxr/external/boost/python/test/pickle4.py index be813bbb13..72bb6b6c3a 100644 --- a/pxr/external/boost/python/test/pickle4.py +++ b/pxr/external/boost/python/test/pickle4.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pointee.cpp b/pxr/external/boost/python/test/pointee.cpp index 2aa5dc3d88..6474d1d5f8 100644 --- a/pxr/external/boost/python/test/pointee.cpp +++ b/pxr/external/boost/python/test/pointee.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/pointer_type_id_test.cpp b/pxr/external/boost/python/test/pointer_type_id_test.cpp index 02e168c7e3..3df8bc9afe 100644 --- a/pxr/external/boost/python/test/pointer_type_id_test.cpp +++ b/pxr/external/boost/python/test/pointer_type_id_test.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pointer_vector.cpp b/pxr/external/boost/python/test/pointer_vector.cpp index 08cd486193..c2b840d581 100644 --- a/pxr/external/boost/python/test/pointer_vector.cpp +++ b/pxr/external/boost/python/test/pointer_vector.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Joel de Guzman 2005-2006. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pointer_vector.py b/pxr/external/boost/python/test/pointer_vector.py index 234eff2c0b..9e43b11cbf 100644 --- a/pxr/external/boost/python/test/pointer_vector.py +++ b/pxr/external/boost/python/test/pointer_vector.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Joel de Guzman 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/polymorphism.cpp b/pxr/external/boost/python/test/polymorphism.cpp index 02713ae266..04a21be8df 100644 --- a/pxr/external/boost/python/test/polymorphism.cpp +++ b/pxr/external/boost/python/test/polymorphism.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/polymorphism.py b/pxr/external/boost/python/test/polymorphism.py index e3c66ea279..c9462348e9 100644 --- a/pxr/external/boost/python/test/polymorphism.py +++ b/pxr/external/boost/python/test/polymorphism.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/polymorphism2.cpp b/pxr/external/boost/python/test/polymorphism2.cpp index 8aefbc3af3..d0f6ea27af 100644 --- a/pxr/external/boost/python/test/polymorphism2.cpp +++ b/pxr/external/boost/python/test/polymorphism2.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/polymorphism2.py b/pxr/external/boost/python/test/polymorphism2.py index cf7384fab8..c604f001d7 100644 --- a/pxr/external/boost/python/test/polymorphism2.py +++ b/pxr/external/boost/python/test/polymorphism2.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp b/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp index 8cd5ef2471..c5cfc21a0c 100644 --- a/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp +++ b/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2005. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.py b/pxr/external/boost/python/test/polymorphism2_auto_ptr.py index 88cf664abd..c56915e094 100644 --- a/pxr/external/boost/python/test/polymorphism2_auto_ptr.py +++ b/pxr/external/boost/python/test/polymorphism2_auto_ptr.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2005. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/properties.cpp b/pxr/external/boost/python/test/properties.cpp index d338beb915..a6c6d20b2a 100644 --- a/pxr/external/boost/python/test/properties.cpp +++ b/pxr/external/boost/python/test/properties.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/properties.py b/pxr/external/boost/python/test/properties.py index 1bc7a624ba..cb456e7f7e 100644 --- a/pxr/external/boost/python/test/properties.py +++ b/pxr/external/boost/python/test/properties.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pyrun.py b/pxr/external/boost/python/test/pyrun.py index d330773eae..2c54a9bbbb 100644 --- a/pxr/external/boost/python/test/pyrun.py +++ b/pxr/external/boost/python/test/pyrun.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# import sys pythonpath = sys.argv[1] diff --git a/pxr/external/boost/python/test/pytype_function.cpp b/pxr/external/boost/python/test/pytype_function.cpp index 46cce19e65..636e2bb9ab 100644 --- a/pxr/external/boost/python/test/pytype_function.cpp +++ b/pxr/external/boost/python/test/pytype_function.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Joel de Guzman 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/pytype_function.py b/pxr/external/boost/python/test/pytype_function.py index a7101fb996..20d9e616d1 100644 --- a/pxr/external/boost/python/test/pytype_function.py +++ b/pxr/external/boost/python/test/pytype_function.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/raw_ctor.cpp b/pxr/external/boost/python/test/raw_ctor.cpp index a825ae0195..6ab3681da2 100644 --- a/pxr/external/boost/python/test/raw_ctor.cpp +++ b/pxr/external/boost/python/test/raw_ctor.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/raw_ctor.py b/pxr/external/boost/python/test/raw_ctor.py index 1e9a9192a4..1dfce33b5f 100644 --- a/pxr/external/boost/python/test/raw_ctor.py +++ b/pxr/external/boost/python/test/raw_ctor.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/raw_pyobject_fail1.cpp b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp index f9dd54bc3a..2afdeb96f0 100644 --- a/pxr/external/boost/python/test/raw_pyobject_fail1.cpp +++ b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/raw_pyobject_fail2.cpp b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp index 62c57ae74e..eaa15576e0 100644 --- a/pxr/external/boost/python/test/raw_pyobject_fail2.cpp +++ b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/register_ptr.cpp b/pxr/external/boost/python/test/register_ptr.cpp index 6cd4d7856e..2e345effe5 100644 --- a/pxr/external/boost/python/test/register_ptr.cpp +++ b/pxr/external/boost/python/test/register_ptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/register_ptr_test.py b/pxr/external/boost/python/test/register_ptr_test.py index 674e5572fe..d644b42d84 100644 --- a/pxr/external/boost/python/test/register_ptr_test.py +++ b/pxr/external/boost/python/test/register_ptr_test.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/result.cpp b/pxr/external/boost/python/test/result.cpp index d5f43cc3d4..82c63700a8 100644 --- a/pxr/external/boost/python/test/result.cpp +++ b/pxr/external/boost/python/test/result.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/return_arg.cpp b/pxr/external/boost/python/test/return_arg.cpp index d8d3c1ddb7..9ad9dcf520 100644 --- a/pxr/external/boost/python/test/return_arg.cpp +++ b/pxr/external/boost/python/test/return_arg.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams and Nikolay Mladenov 2003. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/return_arg.py b/pxr/external/boost/python/test/return_arg.py index e66a0b8d93..a44fd88ac9 100644 --- a/pxr/external/boost/python/test/return_arg.py +++ b/pxr/external/boost/python/test/return_arg.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/select_arg_to_python_test.cpp b/pxr/external/boost/python/test/select_arg_to_python_test.cpp index c5faace36e..4ab7ce86cd 100644 --- a/pxr/external/boost/python/test/select_arg_to_python_test.cpp +++ b/pxr/external/boost/python/test/select_arg_to_python_test.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/select_from_python_test.cpp b/pxr/external/boost/python/test/select_from_python_test.cpp index bb60962a37..4fde4c5675 100644 --- a/pxr/external/boost/python/test/select_from_python_test.cpp +++ b/pxr/external/boost/python/test/select_from_python_test.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/select_holder.cpp b/pxr/external/boost/python/test/select_holder.cpp index 8650bd06a0..a13191f8e9 100644 --- a/pxr/external/boost/python/test/select_holder.cpp +++ b/pxr/external/boost/python/test/select_holder.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/shared_ptr.cpp b/pxr/external/boost/python/test/shared_ptr.cpp index f72e6f0297..983a1473b6 100644 --- a/pxr/external/boost/python/test/shared_ptr.cpp +++ b/pxr/external/boost/python/test/shared_ptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/test/shared_ptr.hpp b/pxr/external/boost/python/test/shared_ptr.hpp index 9f9a4b69e3..7ad2ac7228 100644 --- a/pxr/external/boost/python/test/shared_ptr.hpp +++ b/pxr/external/boost/python/test/shared_ptr.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/test/shared_ptr.py b/pxr/external/boost/python/test/shared_ptr.py index d250ae7eca..d091199633 100644 --- a/pxr/external/boost/python/test/shared_ptr.py +++ b/pxr/external/boost/python/test/shared_ptr.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/simple_type.hpp b/pxr/external/boost/python/test/simple_type.hpp index d1314ff97f..da70099074 100644 --- a/pxr/external/boost/python/test/simple_type.hpp +++ b/pxr/external/boost/python/test/simple_type.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2001. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/slice.cpp b/pxr/external/boost/python/test/slice.cpp index b1b965fa10..6ba26e62d8 100644 --- a/pxr/external/boost/python/test/slice.cpp +++ b/pxr/external/boost/python/test/slice.cpp @@ -3,6 +3,11 @@ #include #include +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright (c) 2004 Jonathan Brandmeyer // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file diff --git a/pxr/external/boost/python/test/slice.py b/pxr/external/boost/python/test/slice.py index c58bbc0299..e45b804cc1 100644 --- a/pxr/external/boost/python/test/slice.py +++ b/pxr/external/boost/python/test/slice.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/staticmethod.cpp b/pxr/external/boost/python/test/staticmethod.cpp index dcd75ca828..e97c671eb6 100644 --- a/pxr/external/boost/python/test/staticmethod.cpp +++ b/pxr/external/boost/python/test/staticmethod.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/staticmethod.py b/pxr/external/boost/python/test/staticmethod.py index 3dd355b133..464374c3c9 100644 --- a/pxr/external/boost/python/test/staticmethod.py +++ b/pxr/external/boost/python/test/staticmethod.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/stl_iterator.cpp b/pxr/external/boost/python/test/stl_iterator.cpp index 409e0da84b..f6179bb42c 100644 --- a/pxr/external/boost/python/test/stl_iterator.cpp +++ b/pxr/external/boost/python/test/stl_iterator.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Eric Niebler 2005. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/stl_iterator.py b/pxr/external/boost/python/test/stl_iterator.py index 4743ed632a..dc7f558f3a 100644 --- a/pxr/external/boost/python/test/stl_iterator.py +++ b/pxr/external/boost/python/test/stl_iterator.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Eric Niebler 2005. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/str.cpp b/pxr/external/boost/python/test/str.cpp index 0505b250ae..3a1a7a3721 100644 --- a/pxr/external/boost/python/test/str.cpp +++ b/pxr/external/boost/python/test/str.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/str.py b/pxr/external/boost/python/test/str.py index bfb4994959..76240ec9e8 100644 --- a/pxr/external/boost/python/test/str.py +++ b/pxr/external/boost/python/test/str.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/string_literal.cpp b/pxr/external/boost/python/test/string_literal.cpp index 7a349d6c26..4d71c08a6c 100644 --- a/pxr/external/boost/python/test/string_literal.cpp +++ b/pxr/external/boost/python/test/string_literal.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/test_builtin_converters.py b/pxr/external/boost/python/test/test_builtin_converters.py index 0f1b4ded75..c6632cf293 100644 --- a/pxr/external/boost/python/test/test_builtin_converters.py +++ b/pxr/external/boost/python/test/test_builtin_converters.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/test_class.hpp b/pxr/external/boost/python/test/test_class.hpp index a9324e9c47..0edce14c5a 100644 --- a/pxr/external/boost/python/test/test_class.hpp +++ b/pxr/external/boost/python/test/test_class.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/test_cltree.py b/pxr/external/boost/python/test/test_cltree.py index 2127b7cdb6..49f4deee8c 100644 --- a/pxr/external/boost/python/test/test_cltree.py +++ b/pxr/external/boost/python/test/test_cltree.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/test_enum.py b/pxr/external/boost/python/test/test_enum.py index e4ad70bd5b..3cc052bf13 100644 --- a/pxr/external/boost/python/test/test_enum.py +++ b/pxr/external/boost/python/test/test_enum.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/test_overload_resolution.cpp b/pxr/external/boost/python/test/test_overload_resolution.cpp index e15bcc6a73..2b31c7f2e8 100644 --- a/pxr/external/boost/python/test/test_overload_resolution.cpp +++ b/pxr/external/boost/python/test/test_overload_resolution.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Troy D. Straszheim 2009 // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/test_pointer_adoption.cpp b/pxr/external/boost/python/test/test_pointer_adoption.cpp index a4e14af5d2..01b7e83561 100644 --- a/pxr/external/boost/python/test/test_pointer_adoption.cpp +++ b/pxr/external/boost/python/test/test_pointer_adoption.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/test_pointer_adoption.py b/pxr/external/boost/python/test/test_pointer_adoption.py index 0fdf3b98e9..4704c9f375 100644 --- a/pxr/external/boost/python/test/test_pointer_adoption.py +++ b/pxr/external/boost/python/test/test_pointer_adoption.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/tuple.cpp b/pxr/external/boost/python/test/tuple.cpp index d48e91d881..1885dd27de 100644 --- a/pxr/external/boost/python/test/tuple.cpp +++ b/pxr/external/boost/python/test/tuple.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2005. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/tuple.py b/pxr/external/boost/python/test/tuple.py index e2cd5eb179..954e8570b8 100644 --- a/pxr/external/boost/python/test/tuple.py +++ b/pxr/external/boost/python/test/tuple.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/upcast.cpp b/pxr/external/boost/python/test/upcast.cpp index 255429f168..32ac600250 100644 --- a/pxr/external/boost/python/test/upcast.cpp +++ b/pxr/external/boost/python/test/upcast.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/vector_indexing_suite.cpp b/pxr/external/boost/python/test/vector_indexing_suite.cpp index 0f9cd74cae..6b585685e6 100644 --- a/pxr/external/boost/python/test/vector_indexing_suite.cpp +++ b/pxr/external/boost/python/test/vector_indexing_suite.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Joel de Guzman 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/vector_indexing_suite.py b/pxr/external/boost/python/test/vector_indexing_suite.py index 478cd01516..f958951a83 100644 --- a/pxr/external/boost/python/test/vector_indexing_suite.py +++ b/pxr/external/boost/python/test/vector_indexing_suite.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Joel de Guzman 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/virtual_functions.cpp b/pxr/external/boost/python/test/virtual_functions.cpp index 774b11b121..08918bb3ac 100644 --- a/pxr/external/boost/python/test/virtual_functions.cpp +++ b/pxr/external/boost/python/test/virtual_functions.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/virtual_functions.py b/pxr/external/boost/python/test/virtual_functions.py index cba21edd62..3630f74f1a 100644 --- a/pxr/external/boost/python/test/virtual_functions.py +++ b/pxr/external/boost/python/test/virtual_functions.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/voidptr.cpp b/pxr/external/boost/python/test/voidptr.cpp index 82e412beaa..4a5c5f5365 100644 --- a/pxr/external/boost/python/test/voidptr.cpp +++ b/pxr/external/boost/python/test/voidptr.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright Niall Douglas 2005. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/voidptr.py b/pxr/external/boost/python/test/voidptr.py index 0e189c9655..ccd3c3de95 100644 --- a/pxr/external/boost/python/test/voidptr.py +++ b/pxr/external/boost/python/test/voidptr.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright Niall Douglas 2005. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/test/wrapper_held_type.cpp b/pxr/external/boost/python/test/wrapper_held_type.cpp index e99422796e..a9d9cb0e52 100644 --- a/pxr/external/boost/python/test/wrapper_held_type.cpp +++ b/pxr/external/boost/python/test/wrapper_held_type.cpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2005. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/test/wrapper_held_type.py b/pxr/external/boost/python/test/wrapper_held_type.py index ff1bd1d245..d78a24b63f 100644 --- a/pxr/external/boost/python/test/wrapper_held_type.py +++ b/pxr/external/boost/python/test/wrapper_held_type.py @@ -1,3 +1,8 @@ +# +# Copyright 2024 Pixar +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. +# # Copyright David Abrahams 2005. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/pxr/external/boost/python/to_python_converter.hpp b/pxr/external/boost/python/to_python_converter.hpp index 4391b6dce9..d07ffd17df 100644 --- a/pxr/external/boost/python/to_python_converter.hpp +++ b/pxr/external/boost/python/to_python_converter.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/to_python_indirect.hpp b/pxr/external/boost/python/to_python_indirect.hpp index 0a19aca5ff..18260b0e4d 100644 --- a/pxr/external/boost/python/to_python_indirect.hpp +++ b/pxr/external/boost/python/to_python_indirect.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/to_python_value.hpp b/pxr/external/boost/python/to_python_value.hpp index b6ec0135ba..b525949491 100644 --- a/pxr/external/boost/python/to_python_value.hpp +++ b/pxr/external/boost/python/to_python_value.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Copyright Stefan Seefeld 2016. // Distributed under the Boost Software License, Version 1.0. (See diff --git a/pxr/external/boost/python/tuple.hpp b/pxr/external/boost/python/tuple.hpp index babfb63f1e..143bf4fd89 100644 --- a/pxr/external/boost/python/tuple.hpp +++ b/pxr/external/boost/python/tuple.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/type_id.hpp b/pxr/external/boost/python/type_id.hpp index 601601c311..d3379e34bc 100644 --- a/pxr/external/boost/python/type_id.hpp +++ b/pxr/external/boost/python/type_id.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/with_custodian_and_ward.hpp b/pxr/external/boost/python/with_custodian_and_ward.hpp index 3431c6f22c..906be6a50b 100644 --- a/pxr/external/boost/python/with_custodian_and_ward.hpp +++ b/pxr/external/boost/python/with_custodian_and_ward.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2002. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/pxr/external/boost/python/wrapper.hpp b/pxr/external/boost/python/wrapper.hpp index 166c8e2327..829f8d8b2d 100644 --- a/pxr/external/boost/python/wrapper.hpp +++ b/pxr/external/boost/python/wrapper.hpp @@ -1,3 +1,8 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) From 6c1e62d12c70c6285ace477fbb50b6caea9668a3 Mon Sep 17 00:00:00 2001 From: blevin Date: Wed, 14 Aug 2024 21:25:15 -0700 Subject: [PATCH 047/202] Add UsdGeomPlane support in Hydra2 scene index: - Hd plane schema, matching UsdGeomPlane - GeomUtil tessellation & test - Hdsi implicit surface resolver support - UsdImging plane adapter support - Update Storm, Prman, and Embree render delegates to request plane tesselation from implicit surface resolver (Internal change: 2336957) --- pxr/imaging/geomUtil/CMakeLists.txt | 4 +- pxr/imaging/geomUtil/planeMeshGenerator.cpp | 68 ++++++ pxr/imaging/geomUtil/planeMeshGenerator.h | 82 +++++++ .../geomUtil/testenv/testMeshGenerators.cpp | 23 ++ .../baseline/generatedMeshes_closed.txt | 14 ++ .../baseline/generatedMeshes_open.txt | 14 ++ .../geomUtil/wrapPlaneMeshGenerator.cpp | 54 +++++ pxr/imaging/hd/CMakeLists.txt | 1 + pxr/imaging/hd/hdSchemaDefs.py | 18 ++ pxr/imaging/hd/planeSchema.cpp | 194 +++++++++++++++++ pxr/imaging/hd/planeSchema.h | 175 +++++++++++++++ pxr/imaging/hd/tokens.h | 1 + .../hdSt/implicitSurfaceSceneIndexPlugin.cpp | 3 +- .../hdsi/implicitSurfaceSceneIndex.cpp | 202 +++++++++++++++++- pxr/imaging/hdsi/implicitSurfaceSceneIndex.h | 1 + .../implicitSurfaceSceneIndexPlugin.cpp | 3 +- pxr/usdImaging/usdImaging/planeAdapter.cpp | 53 +++++ pxr/usdImaging/usdImaging/planeAdapter.h | 29 +++ .../implicitSurfaceSceneIndexPlugin.cpp | 10 +- .../implicitSurfaceSceneIndexPlugin.cpp | 10 +- 20 files changed, 947 insertions(+), 12 deletions(-) create mode 100644 pxr/imaging/geomUtil/planeMeshGenerator.cpp create mode 100644 pxr/imaging/geomUtil/planeMeshGenerator.h create mode 100644 pxr/imaging/geomUtil/wrapPlaneMeshGenerator.cpp create mode 100644 pxr/imaging/hd/planeSchema.cpp create mode 100644 pxr/imaging/hd/planeSchema.h diff --git a/pxr/imaging/geomUtil/CMakeLists.txt b/pxr/imaging/geomUtil/CMakeLists.txt index 0c1fefab9d..060ff3b6e5 100644 --- a/pxr/imaging/geomUtil/CMakeLists.txt +++ b/pxr/imaging/geomUtil/CMakeLists.txt @@ -15,6 +15,7 @@ pxr_library(geomUtil cuboidMeshGenerator cylinderMeshGenerator meshGeneratorBase + planeMeshGenerator sphereMeshGenerator PYTHON_CPPFILES @@ -29,6 +30,7 @@ pxr_library(geomUtil wrapConeMeshGenerator.cpp wrapCuboidMeshGenerator.cpp wrapCylinderMeshGenerator.cpp + wrapPlaneMeshGenerator.cpp wrapSphereMeshGenerator.cpp PYMODULE_FILES @@ -54,4 +56,4 @@ pxr_install_test_dir( pxr_register_test(testMeshGenerators COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testMeshGenerators" DIFF_COMPARE generatedMeshes_closed.txt generatedMeshes_open.txt -) \ No newline at end of file +) diff --git a/pxr/imaging/geomUtil/planeMeshGenerator.cpp b/pxr/imaging/geomUtil/planeMeshGenerator.cpp new file mode 100644 index 0000000000..e7b45d4050 --- /dev/null +++ b/pxr/imaging/geomUtil/planeMeshGenerator.cpp @@ -0,0 +1,68 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/imaging/geomUtil/planeMeshGenerator.h" + +#include "pxr/imaging/pxOsd/meshTopology.h" +#include "pxr/imaging/pxOsd/tokens.h" + +#include "pxr/base/vt/types.h" + +PXR_NAMESPACE_OPEN_SCOPE + + +// static +size_t +GeomUtilPlaneMeshGenerator::ComputeNumPoints() +{ + return 4; +} + +// static +PxOsdMeshTopology +GeomUtilPlaneMeshGenerator::GenerateTopology() +{ + // These never vary, we might as well share a single copy via VtArray. + static const VtIntArray countsArray{ 4 }; + static const VtIntArray indicesArray{ 0, 1, 2, 3 }; + return PxOsdMeshTopology( + PxOsdOpenSubdivTokens->bilinear, + PxOsdOpenSubdivTokens->rightHanded, + countsArray, indicesArray); +} + +// static +template +void +GeomUtilPlaneMeshGenerator::_GeneratePointsImpl( + const typename PointType::ScalarType xLength, + const typename PointType::ScalarType yLength, + const _PointWriter& ptWriter) +{ + using ScalarType = typename PointType::ScalarType; + + const ScalarType x = 0.5 * xLength; + const ScalarType y = 0.5 * yLength; + + ptWriter.Write(PointType( x, y, 0)); + ptWriter.Write(PointType(-x, y, 0)); + ptWriter.Write(PointType(-x, -y, 0)); + ptWriter.Write(PointType( x, -y, 0)); +} + +// Force-instantiate _GeneratePointsImpl for the supported point types. Only +// these instantiations will ever be needed due to the SFINAE machinery on the +// calling method template (the public GeneratePoints, in the header). +template GEOMUTIL_API void GeomUtilPlaneMeshGenerator::_GeneratePointsImpl( + const float, const float, + const GeomUtilPlaneMeshGenerator::_PointWriter&); + +template GEOMUTIL_API void GeomUtilPlaneMeshGenerator::_GeneratePointsImpl( + const double, const double, + const GeomUtilPlaneMeshGenerator::_PointWriter&); + + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/geomUtil/planeMeshGenerator.h b/pxr/imaging/geomUtil/planeMeshGenerator.h new file mode 100644 index 0000000000..8d5dbd916a --- /dev/null +++ b/pxr/imaging/geomUtil/planeMeshGenerator.h @@ -0,0 +1,82 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_IMAGING_GEOM_UTIL_PLANE_MESH_GENERATOR_H +#define PXR_IMAGING_GEOM_UTIL_PLANE_MESH_GENERATOR_H + +#include "pxr/imaging/geomUtil/api.h" +#include "pxr/imaging/geomUtil/meshGeneratorBase.h" + +#include "pxr/pxr.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class GfMatrix4d; +class PxOsdMeshTopology; + +/// This class provides an implementation for generating topology and point +/// positions on a rectangular Plane given the dimensions along the X and Y +/// axes. The generated Plane is centered at the origin. +/// +/// An optional transform may be provided to GeneratePoints to orient the +/// Plane as necessary. +/// +/// Usage: +/// \code{.cpp} +/// +/// const size_t numPoints = +/// GeomUtilPlaneMeshGenerator::ComputeNumPoints(); +/// const float w = 5, l = 4; +/// +/// MyPointContainer points(numPoints); +/// +/// GeomUtilPlaneMeshGenerator::GeneratePoints( +/// points.begin(), w, l); +/// +/// \endcode +/// +class GeomUtilPlaneMeshGenerator final + : public GeomUtilMeshGeneratorBase +{ +public: + GEOMUTIL_API + static size_t ComputeNumPoints(); + + GEOMUTIL_API + static PxOsdMeshTopology GenerateTopology(); + + template::type> + static void GeneratePoints( + PointIterType iter, + const ScalarType xLength, + const ScalarType yLength, + const GfMatrix4d* framePtr = nullptr) + { + using PointType = + typename std::iterator_traits::value_type; + + _GeneratePointsImpl(xLength, yLength, + framePtr ? _PointWriter(iter, framePtr) + : _PointWriter(iter)); + } + + using GeomUtilMeshGeneratorBase::GeneratePoints; + +private: + + template + static void _GeneratePointsImpl( + const typename PointType::ScalarType xLength, + const typename PointType::ScalarType yLength, + const _PointWriter& ptWriter); +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_GEOM_UTIL_PLANE_MESH_GENERATOR_H diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp b/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp index 2729994a4a..7b20b7d77e 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp @@ -11,6 +11,7 @@ #include "pxr/imaging/geomUtil/coneMeshGenerator.h" #include "pxr/imaging/geomUtil/cuboidMeshGenerator.h" #include "pxr/imaging/geomUtil/cylinderMeshGenerator.h" +#include "pxr/imaging/geomUtil/planeMeshGenerator.h" #include "pxr/imaging/geomUtil/sphereMeshGenerator.h" #include "pxr/imaging/pxOsd/meshTopology.h" @@ -205,6 +206,28 @@ static bool TestTopologyAndPointGeneration( _LogFooter(out); } + { + _LogHeader("6. Plane", out); + + using MeshGen = GeomUtilPlaneMeshGenerator; + + const float width = 4.0; + const float length = 3.0; + + out << "width = " << width << std::endl << std::endl; + out << "length = " << length << std::endl << std::endl; + + const PxOsdMeshTopology topology = MeshGen::GenerateTopology(); + + const size_t numPoints = MeshGen::ComputeNumPoints(); + VtVec3fArray points(numPoints); + MeshGen::GeneratePoints(points.begin(), width, length); + + _Log(topology, points, out); + + _LogFooter(out); + } + return true; } diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt index f614a5b0ce..a1a1aa6cb2 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt @@ -58,3 +58,17 @@ Points: +6. Plane +-------- +width = 4 + +length = 3 + +Topology: + (rightHanded, bilinear, ([4]), ([0, 1, 2, 3]), ([])) + +Points: + [(2, 1.5, 0), (-2, 1.5, 0), (-2, -1.5, 0), (2, -1.5, 0)] + + + diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt index ee96ae0962..946a193ed1 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt @@ -58,3 +58,17 @@ Points: +6. Plane +-------- +width = 4 + +length = 3 + +Topology: + (rightHanded, bilinear, ([4]), ([0, 1, 2, 3]), ([])) + +Points: + [(2, 1.5, 0), (-2, 1.5, 0), (-2, -1.5, 0), (2, -1.5, 0)] + + + diff --git a/pxr/imaging/geomUtil/wrapPlaneMeshGenerator.cpp b/pxr/imaging/geomUtil/wrapPlaneMeshGenerator.cpp new file mode 100644 index 0000000000..f7fe402699 --- /dev/null +++ b/pxr/imaging/geomUtil/wrapPlaneMeshGenerator.cpp @@ -0,0 +1,54 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/imaging/geomUtil/planeMeshGenerator.h" + +#include "pxr/imaging/pxOsd/meshTopology.h" + +#include "pxr/base/vt/types.h" + +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +static VtVec3fArray +_WrapGeneratePoints( + const float xLength, + const float yLength) +{ + const size_t numPoints = + GeomUtilPlaneMeshGenerator::ComputeNumPoints(); + if (numPoints == 0) { + return VtVec3fArray(); + } + + VtVec3fArray points(numPoints); + GeomUtilPlaneMeshGenerator::GeneratePoints( + points.begin(), xLength, yLength); + + return points; +} + +void wrapPlaneMeshGenerator() +{ + using This = GeomUtilPlaneMeshGenerator; + + // Note: These are only "classes" for name scoping, and are uninstantiable; + // hence no need to bother declaring bases. + class_("PlaneMeshGenerator", no_init) + + .def("ComputeNumPoints", &This::ComputeNumPoints) + .staticmethod("ComputeNumPoints") + + .def("GenerateTopology", &This::GenerateTopology) + .staticmethod("GenerateTopology") + + .def("GeneratePoints", &_WrapGeneratePoints) + .staticmethod("GeneratePoints") + ; +} diff --git a/pxr/imaging/hd/CMakeLists.txt b/pxr/imaging/hd/CMakeLists.txt index 096bf9c55f..6a256b62b2 100644 --- a/pxr/imaging/hd/CMakeLists.txt +++ b/pxr/imaging/hd/CMakeLists.txt @@ -130,6 +130,7 @@ pxr_library(hd nurbsPatchTrimCurveSchema overlayContainerDataSource perfLog + planeSchema pluginRenderDelegateUniqueHandle points prefixingSceneIndex diff --git a/pxr/imaging/hd/hdSchemaDefs.py b/pxr/imaging/hd/hdSchemaDefs.py index c4457471b2..6ac19ddf99 100644 --- a/pxr/imaging/hd/hdSchemaDefs.py +++ b/pxr/imaging/hd/hdSchemaDefs.py @@ -1261,6 +1261,24 @@ ], ), + + #-------------------------------------------------------------------------- + # plane + dict( + SCHEMA_NAME = 'Plane', + SCHEMA_TOKEN = 'plane', + ADD_DEFAULT_LOCATOR = True, + MEMBERS = [ + ('doubleSided', T_BOOL, {}), + ('axis', T_TOKEN, {}), + ('length', T_DOUBLE, {}), + ('width', T_DOUBLE, {}), + ], + + STATIC_TOKEN_DATASOURCE_BUILDERS = [ + ('axis', ['X', 'Y', 'Z']), + ], + ), #-------------------------------------------------------------------------- # primOrigin diff --git a/pxr/imaging/hd/planeSchema.cpp b/pxr/imaging/hd/planeSchema.cpp new file mode 100644 index 0000000000..ac929bb51e --- /dev/null +++ b/pxr/imaging/hd/planeSchema.cpp @@ -0,0 +1,194 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#include "pxr/imaging/hd/planeSchema.h" + +#include "pxr/imaging/hd/retainedDataSource.h" + +#include "pxr/base/trace/trace.h" + +// --(BEGIN CUSTOM CODE: Includes)-- +// --(END CUSTOM CODE: Includes)-- + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEFINE_PUBLIC_TOKENS(HdPlaneSchemaTokens, + HD_PLANE_SCHEMA_TOKENS); + +// --(BEGIN CUSTOM CODE: Schema Methods)-- +// --(END CUSTOM CODE: Schema Methods)-- + +HdBoolDataSourceHandle +HdPlaneSchema::GetDoubleSided() const +{ + return _GetTypedDataSource( + HdPlaneSchemaTokens->doubleSided); +} + +HdTokenDataSourceHandle +HdPlaneSchema::GetAxis() const +{ + return _GetTypedDataSource( + HdPlaneSchemaTokens->axis); +} + +HdDoubleDataSourceHandle +HdPlaneSchema::GetLength() const +{ + return _GetTypedDataSource( + HdPlaneSchemaTokens->length); +} + +HdDoubleDataSourceHandle +HdPlaneSchema::GetWidth() const +{ + return _GetTypedDataSource( + HdPlaneSchemaTokens->width); +} + +/*static*/ +HdContainerDataSourceHandle +HdPlaneSchema::BuildRetained( + const HdBoolDataSourceHandle &doubleSided, + const HdTokenDataSourceHandle &axis, + const HdDoubleDataSourceHandle &length, + const HdDoubleDataSourceHandle &width +) +{ + TfToken _names[4]; + HdDataSourceBaseHandle _values[4]; + + size_t _count = 0; + + if (doubleSided) { + _names[_count] = HdPlaneSchemaTokens->doubleSided; + _values[_count++] = doubleSided; + } + + if (axis) { + _names[_count] = HdPlaneSchemaTokens->axis; + _values[_count++] = axis; + } + + if (length) { + _names[_count] = HdPlaneSchemaTokens->length; + _values[_count++] = length; + } + + if (width) { + _names[_count] = HdPlaneSchemaTokens->width; + _values[_count++] = width; + } + return HdRetainedContainerDataSource::New(_count, _names, _values); +} + +HdPlaneSchema::Builder & +HdPlaneSchema::Builder::SetDoubleSided( + const HdBoolDataSourceHandle &doubleSided) +{ + _doubleSided = doubleSided; + return *this; +} + +HdPlaneSchema::Builder & +HdPlaneSchema::Builder::SetAxis( + const HdTokenDataSourceHandle &axis) +{ + _axis = axis; + return *this; +} + +HdPlaneSchema::Builder & +HdPlaneSchema::Builder::SetLength( + const HdDoubleDataSourceHandle &length) +{ + _length = length; + return *this; +} + +HdPlaneSchema::Builder & +HdPlaneSchema::Builder::SetWidth( + const HdDoubleDataSourceHandle &width) +{ + _width = width; + return *this; +} + +HdContainerDataSourceHandle +HdPlaneSchema::Builder::Build() +{ + return HdPlaneSchema::BuildRetained( + _doubleSided, + _axis, + _length, + _width + ); +} + +/*static*/ +HdPlaneSchema +HdPlaneSchema::GetFromParent( + const HdContainerDataSourceHandle &fromParentContainer) +{ + return HdPlaneSchema( + fromParentContainer + ? HdContainerDataSource::Cast(fromParentContainer->Get( + HdPlaneSchemaTokens->plane)) + : nullptr); +} + +/*static*/ +const TfToken & +HdPlaneSchema::GetSchemaToken() +{ + return HdPlaneSchemaTokens->plane; +} + +/*static*/ +const HdDataSourceLocator & +HdPlaneSchema::GetDefaultLocator() +{ + static const HdDataSourceLocator locator(GetSchemaToken()); + return locator; +} + +/*static*/ +HdTokenDataSourceHandle +HdPlaneSchema::BuildAxisDataSource( + const TfToken &axis) +{ + + if (axis == HdPlaneSchemaTokens->X) { + static const HdRetainedTypedSampledDataSource::Handle ds = + HdRetainedTypedSampledDataSource::New(axis); + return ds; + } + if (axis == HdPlaneSchemaTokens->Y) { + static const HdRetainedTypedSampledDataSource::Handle ds = + HdRetainedTypedSampledDataSource::New(axis); + return ds; + } + if (axis == HdPlaneSchemaTokens->Z) { + static const HdRetainedTypedSampledDataSource::Handle ds = + HdRetainedTypedSampledDataSource::New(axis); + return ds; + } + // fallback for unknown token + return HdRetainedTypedSampledDataSource::New(axis); +} + +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/pxr/imaging/hd/planeSchema.h b/pxr/imaging/hd/planeSchema.h new file mode 100644 index 0000000000..8253370282 --- /dev/null +++ b/pxr/imaging/hd/planeSchema.h @@ -0,0 +1,175 @@ +// +// Copyright 2023 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +//////////////////////////////////////////////////////////////////////// + +/* ************************************************************************** */ +/* ** ** */ +/* ** This file is generated by a script. ** */ +/* ** ** */ +/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */ +/* ** Edit hdSchemaDefs.py instead to make changes. ** */ +/* ** ** */ +/* ************************************************************************** */ + +#ifndef PXR_IMAGING_HD_PLANE_SCHEMA_H +#define PXR_IMAGING_HD_PLANE_SCHEMA_H + +/// \file + +#include "pxr/imaging/hd/api.h" + +#include "pxr/imaging/hd/schema.h" + +// --(BEGIN CUSTOM CODE: Includes)-- +// --(END CUSTOM CODE: Includes)-- + +PXR_NAMESPACE_OPEN_SCOPE + +// --(BEGIN CUSTOM CODE: Declares)-- +// --(END CUSTOM CODE: Declares)-- + +#define HD_PLANE_SCHEMA_TOKENS \ + (plane) \ + (doubleSided) \ + (axis) \ + (length) \ + (width) \ + (X) \ + (Y) \ + (Z) \ + +TF_DECLARE_PUBLIC_TOKENS(HdPlaneSchemaTokens, HD_API, + HD_PLANE_SCHEMA_TOKENS); + +//----------------------------------------------------------------------------- + + +class HdPlaneSchema : public HdSchema +{ +public: + /// \name Schema retrieval + /// @{ + + HdPlaneSchema(HdContainerDataSourceHandle container) + : HdSchema(container) {} + + /// Retrieves a container data source with the schema's default name token + /// "plane" from the parent container and constructs a + /// HdPlaneSchema instance. + /// Because the requested container data source may not exist, the result + /// should be checked with IsDefined() or a bool comparison before use. + HD_API + static HdPlaneSchema GetFromParent( + const HdContainerDataSourceHandle &fromParentContainer); + + /// @} + +// --(BEGIN CUSTOM CODE: Schema Methods)-- +// --(END CUSTOM CODE: Schema Methods)-- + + /// \name Member accessor + /// @{ + + HD_API + HdBoolDataSourceHandle GetDoubleSided() const; + + HD_API + HdTokenDataSourceHandle GetAxis() const; + + HD_API + HdDoubleDataSourceHandle GetLength() const; + + HD_API + HdDoubleDataSourceHandle GetWidth() const; + + /// @} + + /// \name Schema location + /// @{ + + /// Returns a token where the container representing this schema is found in + /// a container by default. + HD_API + static const TfToken &GetSchemaToken(); + + /// Returns an HdDataSourceLocator (relative to the prim-level data source) + /// where the container representing this schema is found by default. + HD_API + static const HdDataSourceLocator &GetDefaultLocator(); + + /// @} + + /// \name Schema construction + /// @{ + + /// \deprecated Use Builder instead. + /// + /// Builds a container data source which includes the provided child data + /// sources. Parameters with nullptr values are excluded. This is a + /// low-level interface. For cases in which it's desired to define + /// the container with a sparse set of child fields, the Builder class + /// is often more convenient and readable. + HD_API + static HdContainerDataSourceHandle + BuildRetained( + const HdBoolDataSourceHandle &doubleSided, + const HdTokenDataSourceHandle &axis, + const HdDoubleDataSourceHandle &length, + const HdDoubleDataSourceHandle &width + ); + + /// \class HdPlaneSchema::Builder + /// + /// Utility class for setting sparse sets of child data source fields to be + /// filled as arguments into BuildRetained. Because all setter methods + /// return a reference to the instance, this can be used in the "builder + /// pattern" form. + class Builder + { + public: + HD_API + Builder &SetDoubleSided( + const HdBoolDataSourceHandle &doubleSided); + HD_API + Builder &SetAxis( + const HdTokenDataSourceHandle &axis); + HD_API + Builder &SetLength( + const HdDoubleDataSourceHandle &length); + HD_API + Builder &SetWidth( + const HdDoubleDataSourceHandle &width); + + /// Returns a container data source containing the members set thus far. + HD_API + HdContainerDataSourceHandle Build(); + + private: + HdBoolDataSourceHandle _doubleSided; + HdTokenDataSourceHandle _axis; + HdDoubleDataSourceHandle _length; + HdDoubleDataSourceHandle _width; + + }; + + /// Returns token data source for use as axis value. + /// + /// The following values will be stored statically and reused for future + /// calls: + /// - HdPlaneSchemaTokens->X + /// - HdPlaneSchemaTokens->Y + /// - HdPlaneSchemaTokens->Z + HD_API + static HdTokenDataSourceHandle BuildAxisDataSource( + const TfToken &axis); + + /// @} +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif \ No newline at end of file diff --git a/pxr/imaging/hd/tokens.h b/pxr/imaging/hd/tokens.h index 3b85717a2c..06eb28fdec 100644 --- a/pxr/imaging/hd/tokens.h +++ b/pxr/imaging/hd/tokens.h @@ -275,6 +275,7 @@ PXR_NAMESPACE_OPEN_SCOPE (nurbsPatch) \ (basisCurves) \ (nurbsCurves) \ + (plane) \ (points) \ (sphere) \ (volume) \ diff --git a/pxr/imaging/hdSt/implicitSurfaceSceneIndexPlugin.cpp b/pxr/imaging/hdSt/implicitSurfaceSceneIndexPlugin.cpp index 0cdd89dec2..3df1c5a151 100644 --- a/pxr/imaging/hdSt/implicitSurfaceSceneIndexPlugin.cpp +++ b/pxr/imaging/hdSt/implicitSurfaceSceneIndexPlugin.cpp @@ -41,7 +41,8 @@ TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) HdPrimTypeTokens->cube, toMeshSrc, HdPrimTypeTokens->cone, toMeshSrc, HdPrimTypeTokens->cylinder, toMeshSrc, - HdPrimTypeTokens->capsule, toMeshSrc); + HdPrimTypeTokens->capsule, toMeshSrc, + HdPrimTypeTokens->plane, toMeshSrc); HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _pluginDisplayName, diff --git a/pxr/imaging/hdsi/implicitSurfaceSceneIndex.cpp b/pxr/imaging/hdsi/implicitSurfaceSceneIndex.cpp index 18a29a4444..d0c59c301f 100644 --- a/pxr/imaging/hdsi/implicitSurfaceSceneIndex.cpp +++ b/pxr/imaging/hdsi/implicitSurfaceSceneIndex.cpp @@ -10,6 +10,7 @@ #include "pxr/imaging/geomUtil/coneMeshGenerator.h" #include "pxr/imaging/geomUtil/cuboidMeshGenerator.h" #include "pxr/imaging/geomUtil/cylinderMeshGenerator.h" +#include "pxr/imaging/geomUtil/planeMeshGenerator.h" #include "pxr/imaging/geomUtil/sphereMeshGenerator.h" #include "pxr/imaging/pxOsd/meshTopology.h" @@ -24,6 +25,7 @@ #include "pxr/imaging/hd/meshSchema.h" #include "pxr/imaging/hd/meshTopologySchema.h" #include "pxr/imaging/hd/overlayContainerDataSource.h" +#include "pxr/imaging/hd/planeSchema.h" #include "pxr/imaging/hd/primvarSchema.h" #include "pxr/imaging/hd/primvarsSchema.h" #include "pxr/imaging/hd/retainedDataSource.h" @@ -1323,6 +1325,193 @@ _ComputePrimDataSource( /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// +// Plane + +namespace _PlaneToMesh +{ + +HdContainerDataSourceHandle +_ComputeMeshDataSource(const HdContainerDataSourceHandle &primDataSource) +{ + const PxOsdMeshTopology topology = + GeomUtilPlaneMeshGenerator::GenerateTopology(); + + const HdDataSourceLocator doubleSidedLocator = + HdPlaneSchema::GetDefaultLocator().Append( + HdPlaneSchemaTokens->doubleSided); + HdBoolDataSourceHandle doubleSidedDs = + HdBoolDataSource::Cast( + HdContainerDataSource::Get(primDataSource, doubleSidedLocator)); + + return + HdMeshSchema::Builder() + .SetTopology( + HdMeshTopologySchema::Builder() + .SetFaceVertexCounts( + HdRetainedTypedSampledDataSource::New( + topology.GetFaceVertexCounts())) + .SetFaceVertexIndices( + HdRetainedTypedSampledDataSource::New( + topology.GetFaceVertexIndices())) + .SetOrientation( + HdRetainedTypedSampledDataSource::New( + HdMeshTopologySchemaTokens->rightHanded)) + .Build()) + .SetSubdivisionScheme( + HdRetainedTypedSampledDataSource::New( + topology.GetScheme())) + .SetDoubleSided(doubleSidedDs) + .Build(); +} + +class _PointsDataSource : public HdVec3fArrayDataSource +{ +public: + HD_DECLARE_DATASOURCE(_PointsDataSource); + + VtValue GetValue(const Time shutterOffset) override { + return VtValue(GetTypedValue(shutterOffset)); + } + + VtVec3fArray GetTypedValue(const Time shutterOffset) override { + const GfMatrix4d basis = _GetBasis(_GetAxis(shutterOffset)); + const size_t numPoints = + GeomUtilPlaneMeshGenerator::ComputeNumPoints(); + VtVec3fArray points(numPoints); + + GeomUtilPlaneMeshGenerator::GeneratePoints( + points.begin(), + _GetWidth(shutterOffset), + _GetLength(shutterOffset), + &basis + ); + + return points; + } + + bool GetContributingSampleTimesForInterval( + const Time startTime, + const Time endTime, + std::vectorMODELVIEW transform in OpenGL parlance) -/// will transform the world such that the camera is at the origin, looking -/// down the -Z axis, with +Y as the up axis, and +X pointing to the right. -/// This describes a __right handed coordinate system__. +/// (i.e. UsdGeomGetStageUpAxis()). 'camXform' positions the camera in the +/// world, and the inverse transforms the world such that the camera is at the +/// origin, looking down the -Z axis, with +Y as the up axis, and +X pointing to +/// the right. This describes a __right handed coordinate system__. /// /// \section UsdGeom_CameraUnits Units of Measure for Camera Properties /// diff --git a/pxr/usd/usdGeom/generatedSchema.usda b/pxr/usd/usdGeom/generatedSchema.usda index 8a81813d20..c891690c7a 100644 --- a/pxr/usd/usdGeom/generatedSchema.usda +++ b/pxr/usd/usdGeom/generatedSchema.usda @@ -4173,11 +4173,10 @@ class Camera "Camera" ( \\endcode \\note Cameras in USD are always \"Y up\", regardless of the stage's orientation - (i.e. UsdGeomGetStageUpAxis()). This means that the inverse of - 'camXform' (the VIEW half of the MODELVIEW transform in OpenGL parlance) - will transform the world such that the camera is at the origin, looking - down the -Z axis, with +Y as the up axis, and +X pointing to the right. - This describes a __right handed coordinate system__. + (i.e. UsdGeomGetStageUpAxis()). 'camXform' positions the camera in the + world, and the inverse transforms the world such that the camera is at the + origin, looking down the -Z axis, with +Y as the up axis, and +X pointing to + the right. This describes a __right handed coordinate system__. Units of Measure for Camera Properties diff --git a/pxr/usd/usdGeom/schema.usda b/pxr/usd/usdGeom/schema.usda index 583d8c8cd6..ed5dd80b1f 100644 --- a/pxr/usd/usdGeom/schema.usda +++ b/pxr/usd/usdGeom/schema.usda @@ -2272,11 +2272,10 @@ class Camera "Camera" ( \\endcode \\note Cameras in USD are always "Y up", regardless of the stage's orientation - (i.e. UsdGeomGetStageUpAxis()). This means that the inverse of - 'camXform' (the VIEW half of the MODELVIEW transform in OpenGL parlance) - will transform the world such that the camera is at the origin, looking - down the -Z axis, with +Y as the up axis, and +X pointing to the right. - This describes a __right handed coordinate system__. + (i.e. UsdGeomGetStageUpAxis()). 'camXform' positions the camera in the + world, and the inverse transforms the world such that the camera is at the + origin, looking down the -Z axis, with +Y as the up axis, and +X pointing to + the right. This describes a __right handed coordinate system__. \\section UsdGeom_CameraUnits Units of Measure for Camera Properties From 1e9bb603ff2912c65ea3a5a6f8ab9bac7db197b8 Mon Sep 17 00:00:00 2001 From: florianz Date: Wed, 14 Aug 2024 21:41:04 -0700 Subject: [PATCH 055/202] Adding GfSmoothStep() and GfSmoothRamp() to gf. (Internal change: 2337106) (Internal change: 2337287) --- pxr/base/gf/math.cpp | 87 +++++++++++++++++++++ pxr/base/gf/math.h | 124 ++++++++++++++++++++++++++++++ pxr/base/gf/testenv/testGfMath.py | 8 ++ pxr/base/gf/wrapMath.cpp | 4 + 4 files changed, 223 insertions(+) diff --git a/pxr/base/gf/math.cpp b/pxr/base/gf/math.cpp index 220df9fcb8..3a6f6b3a23 100644 --- a/pxr/base/gf/math.cpp +++ b/pxr/base/gf/math.cpp @@ -30,4 +30,91 @@ GfMod(float a, float b) return c; } +double +GfSmoothStep(double min, double max, double val, double slope0, double slope1) +{ + // Implements standard hermite formulation: + // p(h) = (2h^3 - 3h^2 + 1)p0 + (h^3 - 2h^2 + h)m0 + + // (-2h^3 + 3h^2)p1 + (h^3 - h^2)m1; + if (val >= max) return 1.0; + if (val < min) return 0.0; + + // Note due to above, if here, max != min + double dv = max - min; + + double h = ((val - min) / (max - min)); + + double h2 = h * h; + double h3 = h2 * h; + + // p1 term + double v = -2.0 * h3 + 3.0 * h2; + + // p0 is always zero + + if (slope0 != 0.0) { + // normalize the slope + slope0 /= dv; + v += (h3 - 2 * h2 + h) * slope0; + } + + if (slope1 != 0.0) { + // normalize the slope + slope1 /= dv; + v += (h3 - h2) * slope1; + } + + return v; +} + +double +GfGSmoothRamp(double t, double a0, double a1, double b0, double b1, double s0, + double s1, double wid0, double wid1) +{ + double dx, dy, x, d0, d1, wnorm, w0, w1, y; + + // change variables to x in [0,1] and y in [0,1] + dy = b1 - b0; + dx = a1 - a0; + if (dy == 0 || dx==0) { + y = 0.0; + } + else { + x = (t - a0)/dx; + d0 = s0*dx/dy; + d1 = s1*dx/dy; + + // make sure shoulder widths don't sum to more than 1 + wnorm = 1./ GfMax(1.0, wid0 + wid1); + w0 = wid0 * wnorm; + w1 = wid1 * wnorm; + + // compute y + if (x <= 0.0) + y = 0.0; + else if (x >= 1.0) + y = 1.0; + else { + double xr = 2.0 - w0 - w1; + double a = (2.0 - w1*d1 + (w1 - 2.0)*d0)/(2.0 * xr); + double b = (2.0 - w0*d0 + (w0 - 2.0)*d1)/(2.0 * xr); + if (x < w0) + y = a*x*x/w0 + d0*x; + else if (x > 1.0 - w1) { + double omx = 1.0 - x; + y = 1.0 - (b * omx * omx/w1) - (d1 * omx); + } + else { + double ya = (a * w0) + (d0 * w0); + double da = 2.0 * a + d0; + y = ya + (x - w0)*da; + } + } + } + + // map y back to Y and return. Note: analytically y is always in + // [0,1], but numerically it might have noise so clamp it. + return GfClamp(y, 0.0, 1.0) * dy + b0; +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/base/gf/math.h b/pxr/base/gf/math.h index 1d4a2ac4f2..b66a7a1a74 100644 --- a/pxr/base/gf/math.h +++ b/pxr/base/gf/math.h @@ -38,6 +38,130 @@ inline double GfDegreesToRadians(double degrees) { return degrees * (M_PI / 180.0); } +/// Smooth step function using a cubic hermite blend. +/// \ingroup group_gf_BasicMath +/// +/// Returns 0 if \p val <= \p min, and 1 if \p val >= \p max. +/// As \p val varies between \p min and \p max, the return value smoothly +/// varies from 0 to 1 using a cubic hermite blend, with given slopes at the +/// min and max points. The slopes are in the space that min and max are in. +GF_API +double GfSmoothStep(double min, double max, double val, + double slope0 = 0.0, double slope1 = 0.0); + +/// Smooth Step with independently controllable shoulders +/// \ingroup group_gf_BasicMath +/// +/// Based on an idea and different implementation by Rob Cook. See his +/// notes attached at the end. +/// +/// I (whorfin) extended this to have independently controllable shoulders at +/// either end, and to specify shoulders directly in the domain of the curve. +/// Rob's derivation frankly confused me, so I proceeded slightly differently. +/// This derivation has more degrees of freedom but is the same order, so some +/// tricks must be done. +/// +/// Summary: This function is similar to "smoothstep" except that instead of +/// using a Hermite curve, the interpolation is done with a linear ramp with +/// smooth shoulders (i.e., C1 = continuous first derivatives). +/// +/// Conceptually, it's a line with variable C1 zero-slope junctures. +/// +/// Additionally, w0 + w1 <= 1. Otherwise, the curves will take up +/// more space than is available, and "that would be bad". +/// +/// A value of 0 for w0 and w1 gives a pure linear ramp. +/// A reasonable value for a symmetric smooth ramp is .2 for w0 and w1. +/// this means that the middle 60% of the ramp is linear, and the left +/// 20% and right 20% are the transition into and out of the linear ramp. +/// +/// The ramp looks like this: +///
    +///                              smooth ********** <-result = 1
    +///                                  ***|
    +///                                **   |
    +///                               * |   |
    +///                      linear  *  |   |
    +///                             *   |   |
    +///                            *    |   |
    +///                   smooth **     |   tmax = end of ramp
    +///                       *** |     |
    +///    result=0 -> *******    |     tmax - w1*(tmax-tmin) = end of linear region
    +///                      |    |
    +///                      |    tmin + w0*(tmax-tmin) = start of linear region
    +///                      |
    +///                      tmin = start of ramp
    +/// 
    +/// Derivation: +/// +/// We're going to splice parabolas onto both ends for the "0 slope smooth" +/// connectors. So we therefore constrain the parabolic sections to have +/// a given width and given slope (the slope of the connecting line segment) +/// at the "w" edge. +/// +/// We'll first derive the equations for the parabolic splicing segment, +/// expressed at the origin (but generalizable by flipping). +/// +/// Given: +///
    +///  f(t) = a t� + b t + c
    +///  f(0) = 0
    +///  f'(0) = 0
    +///  f(w) = y    At the "w" edge of the shoulder, value is y
    +///  f'(w) = s   ...what is the slope there? s...
    +///
    +///  -->
    +///      c = 0
    +///      b = 0
    +///      a = � s/w
    +///      y = � w s
    +///  -->
    +///      g(t,w,s) = � s t� / w   # Our parabolic segment
    +/// 
    +/// +/// Now, in our desired composite curve, the slope is the same at +/// both endpoints (since they're connected by a line). +/// This slope is (1-y0-y1)/(1-w0-w1) [from simple geometry]. +/// +/// More formally, let's express the constraints +/// Given: +///
    +///  y(w,s) = w s /2
    +///  s = ( 1 - y(w0, s) - y(w1, s) ) / (1 - w0 - w1)
    +///
    +///  -->
    +///      s(w0,w1) = 2 / (2 - w0 - w1)
    +/// 
    +/// +/// So now we're done; we splice these two together and connect +/// with a line. +/// +/// The domain and range of this function is [0,1] +///
    +///      f(t, w0, w1) =
    +///              g(t, w0, s(w0,w1))      t1-w1
    +///
    +///          s(w0,w1) t - y(w0, s(w0,w1))    w0 <= t <= 1-w1
    +/// 
    +/// +/// Expanding and collecting terms gives us the result expressed in the +/// code below. We also generalize to tmin/tmax form, in keeping with +/// smoothstep. This simply involves reranging to [0,1] on input. +/// +/// @param tmin where the ramp starts +/// @param tmax where the ramp ends (must be > tmin) +/// @param t location to evaluate in this call +/// @param w0 size of the first smooth section as a fraction of +/// the size of the ramp (tmax-tmin). This value must +/// be in the range 0-1. +/// @param w1 size of the second smooth section as a fraction of +/// the size of the ramp (tmax-tmin). This value must +/// be in the range 0-1. +GF_API +double GfSmoothRamp(double tmin, double tmax, double t, double w0, double w1); + /// Returns the inner product of \c x with itself: specifically, \c x*x. /// Defined for \c int, \c float, \c double, and all \c GfVec types. /// \ingroup group_gf_BasicMath diff --git a/pxr/base/gf/testenv/testGfMath.py b/pxr/base/gf/testenv/testGfMath.py index b3cc13bfc5..f7e62de13c 100644 --- a/pxr/base/gf/testenv/testGfMath.py +++ b/pxr/base/gf/testenv/testGfMath.py @@ -22,6 +22,14 @@ def _AssertListIsClose(self, first, second, delta=1e-6): for (f,s) in zip(first, second): self.assertAlmostEqual(f, s, delta=delta) + def test_SmoothStep(self): + t1 = SmoothStep(0, 1, .25) + t2 = SmoothStep(0, 1, .75) + self.assertEqual(0, SmoothStep(0, 1, 0)) + self.assertEqual(1, SmoothStep(0, 1, 1)) + self.assertEqual(0.5, SmoothStep(0, 1, 0.5)) + self.assertTrue(t1 > 0 and t1 < .5 and t2 > .5 and t2 < 1) + def test_HalfRoundTrip(self): from pxr.Gf import _HalfRoundTrip self.assertEqual(1.0, _HalfRoundTrip(1.0)) diff --git a/pxr/base/gf/wrapMath.cpp b/pxr/base/gf/wrapMath.cpp index 49aa99a98c..4991db74fc 100644 --- a/pxr/base/gf/wrapMath.cpp +++ b/pxr/base/gf/wrapMath.cpp @@ -33,6 +33,10 @@ void wrapMath() def("RadiansToDegrees", GfRadiansToDegrees); def("DegreesToRadians", GfDegreesToRadians); + def("SmoothStep", GfSmoothStep, + (arg("slope0") = 0.0, + arg("slope1") = 0.0)); + def("Sqr", GfSqr); def("Sqr", GfSqr); From b4aaa1f074d9b675e3bac43a68dbda5d2be0e851 Mon Sep 17 00:00:00 2001 From: adamrwoodbury Date: Fri, 16 Aug 2024 11:25:33 -0700 Subject: [PATCH 056/202] Slight updates to docs on schema property overrides and underrides. (Internal change: 2337182) --- pxr/usd/usd/docs/generatingSchemas.md | 45 ++++++++++++++++----------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/pxr/usd/usd/docs/generatingSchemas.md b/pxr/usd/usd/docs/generatingSchemas.md index b4c47ed04e..4cda4555a6 100644 --- a/pxr/usd/usd/docs/generatingSchemas.md +++ b/pxr/usd/usd/docs/generatingSchemas.md @@ -398,15 +398,20 @@ This applied API strength order is invoked recursively, in a depth first expansion, because **all schema types can introduce built-in schemas and can cause additional auto applied schemas to be applied**. -For properties that are defined by more than one of the included schema, -fields for which the strongest property definition does *not* express an opinion, -**may** be composed from weaker API schema definitions if the following -conditions are met: -- The property type of the stronger and weaker property definitions match. Specifically, - the property definitions must both be attributes or both be relationships, and if they - are attributes, their type names must be exactly the same. -- The field is in the set of _allowed composable fields_ which currently includes only - _default_ and _hidden_. We may expand the set of allowed composable fields in the future. +### API schema property underrides {#Usd_APISchemaPropertyUnderride} + +For properties that are defined by more than one of the included schemas, fields +for which the strongest property definition does *not* express an opinion, +**may** be composed from weaker API schema definitions (i.e., the weaker +definition may act as an _API schema underride_) if the following conditions are +met: +- The property types of the stronger and weaker property definitions + match. Specifically, the property definitions must both be attributes or both + be relationships, and if they are attributes, their type names must be exactly + the same. +- The field is in the set of _allowed composable fields_, which currently + includes only _default_ and _hidden_. We may expand the set of allowed + composable fields in the future. ### API schema property overrides {#Usd_APISchemaPropertyOverride} @@ -471,13 +476,14 @@ There are some limitations to how API schema override properties can be used: is an attribute, the type name (int, float, color3f, etc.) of the attribute. Any API schema property overrides that do not conform to the underlying property type are ignored. Note that the variability of an API schema override - property is allowed to be different than the defined property but the override's - variability will be ignored. - -2. API schema override properties are currently only resolved when generating the - static \ref UsdPrimDefinition "prim definitions" for registered IsA and applied - API schema types in the schema registry. "Dangling overrides" are not retained - which means they cannot be used by an IsA schema to provide overrides to + property is allowed to be different than the defined property but the + override's variability will be ignored. + +2. API schema property overrides are currently only resolved when generating the + static \ref UsdPrimDefinition "prim definitions" for registered IsA and + applied API schema types in the schema registry. "Dangling overrides" are not + retained which means they cannot be used by an IsA schema (or by builtin or + auto-apply schemas included by an IsA schema) to provide overrides to properties from authored API schemas applied in scene description. 3. API schema property overrides only apply to the properties defined by API @@ -490,9 +496,10 @@ There are some limitations to how API schema override properties can be used: included by "C") and vice versa. Note that API schema property overrides are specific to overriding properties -from built-in API schemas and do not apply to overriding properties via schema -inheritance. This is because schema properties always sparsely compose via -class inheritance during schema generation so no specification is necessary. +from built-in API schemas and do not apply to overriding properties via typed +schema inheritance. This is because schema properties always sparsely compose +via class inheritance during schema generation so no override specification is +necessary. ## Schema Code Generation {#Usd_SchemaCodeGeneration} From d523d0e753808e36bc93efca4ea387e118678ece Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Fri, 16 Aug 2024 11:31:24 -0700 Subject: [PATCH 057/202] Storm draw target: tracking the version of the active draw target set in HdStRenderParam rather than the change tracker so that clients do not need to know about this implementation of detail of storm. (Internal change: 2337198) --- pxr/imaging/hdSt/drawTarget.cpp | 10 ++++++++++ pxr/imaging/hdSt/drawTarget.h | 3 ++- pxr/imaging/hdSt/renderParam.cpp | 12 ++++++++++++ pxr/imaging/hdSt/renderParam.h | 12 ++++++++++++ pxr/imaging/hdx/drawTargetTask.cpp | 13 ++++++++----- pxr/imaging/hdx/unitTestDelegate.cpp | 7 ------- 6 files changed, 44 insertions(+), 13 deletions(-) diff --git a/pxr/imaging/hdSt/drawTarget.cpp b/pxr/imaging/hdSt/drawTarget.cpp index 1eb6e1d815..da6da48fa5 100644 --- a/pxr/imaging/hdSt/drawTarget.cpp +++ b/pxr/imaging/hdSt/drawTarget.cpp @@ -6,6 +6,7 @@ // #include "pxr/imaging/hdSt/drawTarget.h" +#include "pxr/imaging/hdSt/renderParam.h" #include "pxr/imaging/hd/sceneDelegate.h" PXR_NAMESPACE_OPEN_SCOPE @@ -45,6 +46,9 @@ HdStDrawTarget::Sync(HdSceneDelegate *sceneDelegate, // Optional attribute. _enabled = vtValue.GetWithDefault(true); + + static_cast(renderParam) + ->MarkActiveDrawTargetSetDirty(); } if (bits & DirtyDTCamera) { @@ -142,5 +146,11 @@ HdStDrawTarget::GetDrawTargets(HdRenderIndex* const renderIndex, } } +void +HdStDrawTarget::Finalize(HdRenderParam * const renderParam) +{ + static_cast(renderParam)->MarkActiveDrawTargetSetDirty(); +} + PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/hdSt/drawTarget.h b/pxr/imaging/hdSt/drawTarget.h index 8443fe814d..8a13882969 100644 --- a/pxr/imaging/hdSt/drawTarget.h +++ b/pxr/imaging/hdSt/drawTarget.h @@ -25,7 +25,6 @@ PXR_NAMESPACE_OPEN_SCOPE #define HDST_DRAW_TARGET_TOKENS \ (camera) \ (collection) \ - (drawTargetSet) \ (enable) \ (resolution) \ (aovBindings) \ @@ -112,6 +111,8 @@ class HdStDrawTarget : public HdSprim return _resolution; } + void Finalize(HdRenderParam *) override; + private: bool _enabled; GfVec2i _resolution; diff --git a/pxr/imaging/hdSt/renderParam.cpp b/pxr/imaging/hdSt/renderParam.cpp index 2f6617b040..1c5ecef8f3 100644 --- a/pxr/imaging/hdSt/renderParam.cpp +++ b/pxr/imaging/hdSt/renderParam.cpp @@ -13,6 +13,7 @@ HdStRenderParam::HdStRenderParam() : _drawBatchesVersion(1) , _materialTagsVersion(1) , _geomSubsetDrawItemsVersion(1) + , _activeDrawTargetSetVersion(1) , _needsGarbageCollection(false) { } @@ -165,5 +166,16 @@ HdStRenderParam::_HasTag( return it->second > 0; } +void +HdStRenderParam::MarkActiveDrawTargetSetDirty() +{ + ++_activeDrawTargetSetVersion; +} + +unsigned int +HdStRenderParam::GetActiveDrawTargetSetVersion() const +{ + return _activeDrawTargetSetVersion.load(std::memory_order_relaxed); +} PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/hdSt/renderParam.h b/pxr/imaging/hdSt/renderParam.h index 711e7be7f5..99a35ed3ba 100644 --- a/pxr/imaging/hdSt/renderParam.h +++ b/pxr/imaging/hdSt/renderParam.h @@ -92,6 +92,17 @@ class HdStRenderParam final : public HdRenderParam HDST_API void DecreaseRenderTagCount(const TfToken &renderTag); + // ---------------------------------------------------------------------- // + /// Draw targets. + // ---------------------------------------------------------------------- // + /// Marks all draw targets dirty, meaning that clients that keep track of + /// the set of active draw targets needs to refresh that set. + HDST_API + void MarkActiveDrawTargetSetDirty(); + + HDST_API + unsigned int GetActiveDrawTargetSetVersion() const; + // ---------------------------------------------------------------------- // /// Garbage collection tracking // ---------------------------------------------------------------------- // @@ -124,6 +135,7 @@ class HdStRenderParam final : public HdRenderParam std::atomic_uint _drawBatchesVersion; std::atomic_uint _materialTagsVersion; std::atomic_uint _geomSubsetDrawItemsVersion; + std::atomic_uint _activeDrawTargetSetVersion; bool _needsGarbageCollection; // Doesn't need to be atomic since parallel // sync might only set it (and not clear). diff --git a/pxr/imaging/hdx/drawTargetTask.cpp b/pxr/imaging/hdx/drawTargetTask.cpp index 4545404be7..a9ec346661 100644 --- a/pxr/imaging/hdx/drawTargetTask.cpp +++ b/pxr/imaging/hdx/drawTargetTask.cpp @@ -13,6 +13,7 @@ #include "pxr/imaging/hdx/tokens.h" #include "pxr/imaging/hdx/debugCodes.h" #include "pxr/imaging/hdSt/drawTarget.h" +#include "pxr/imaging/hdSt/renderParam.h" #include "pxr/imaging/hdSt/renderPass.h" #include "pxr/imaging/hdSt/renderPassState.h" #include "pxr/imaging/hdSt/simpleLightingShader.h" @@ -441,14 +442,16 @@ HdxDrawTargetTask::Sync(HdSceneDelegate* delegate, } HdRenderIndex &renderIndex = delegate->GetRenderIndex(); - const HdChangeTracker& changeTracker = renderIndex.GetChangeTracker(); - const unsigned drawTargetVersion - = changeTracker.GetStateVersion(HdStDrawTargetTokens->drawTargetSet); + const HdStRenderParam * const renderParam = + static_cast( + renderIndex.GetRenderDelegate()->GetRenderParam()); + const unsigned int drawTargetSetVersion = + renderParam->GetActiveDrawTargetSetVersion(); - if (_currentDrawTargetSetVersion != drawTargetVersion) { + if (_currentDrawTargetSetVersion != drawTargetSetVersion) { _renderPassesInfo = _ComputeRenderPassInfos(&renderIndex); - _currentDrawTargetSetVersion = drawTargetVersion; + _currentDrawTargetSetVersion = drawTargetSetVersion; } ///---------------------- diff --git a/pxr/imaging/hdx/unitTestDelegate.cpp b/pxr/imaging/hdx/unitTestDelegate.cpp index 67d965decd..5c37f02de5 100644 --- a/pxr/imaging/hdx/unitTestDelegate.cpp +++ b/pxr/imaging/hdx/unitTestDelegate.cpp @@ -116,10 +116,6 @@ Hdx_UnitTestDelegate::Hdx_UnitTestDelegate(HdRenderIndex *index, GfFrustum frustum; frustum.SetPosition(GfVec3d(0, 0, 3)); SetCamera(frustum.ComputeViewMatrix(), frustum.ComputeProjectionMatrix()); - - // Add draw target state tracking support. - GetRenderIndex().GetChangeTracker().AddState( - HdStDrawTargetTokens->drawTargetSet); } void @@ -354,9 +350,6 @@ Hdx_UnitTestDelegate::AddDrawTarget(SdfPath const &id) cache[HdStDrawTargetTokens->collection] = VtValue(HdRprimCollection(HdTokens->geometry, HdReprSelector(HdReprTokens->hull))); - - GetRenderIndex().GetChangeTracker().MarkStateDirty( - HdStDrawTargetTokens->drawTargetSet); } void From 1a64ac81cf064f57056050bb63b408ce5ffabbda Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Fri, 16 Aug 2024 11:35:44 -0700 Subject: [PATCH 058/202] hdPrman: Making sure we are sampling the camera transform after we have computed the shutter interval. (Internal change: 2337206) --- .../renderman-25/plugin/hdPrman/camera.cpp | 24 +++++++++++-------- .../renderman-26/plugin/hdPrman/camera.cpp | 24 +++++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/camera.cpp b/third_party/renderman-25/plugin/hdPrman/camera.cpp index b3d59e05b4..f73e4b3b51 100644 --- a/third_party/renderman-25/plugin/hdPrman/camera.cpp +++ b/third_party/renderman-25/plugin/hdPrman/camera.cpp @@ -94,16 +94,6 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, // Save state of dirtyBits before HdCamera::Sync clears them. const HdDirtyBits bits = *dirtyBits; - if (bits & DirtyTransform) { - sceneDelegate->SampleTransform( - id, -#if HD_API_VERSION >= 68 - param->GetShutterInterval()[0], - param->GetShutterInterval()[1], -#endif - &_sampleXforms); - } - if (bits & AllDirty) { param->GetCameraContext().MarkCameraInvalid(id); } @@ -184,6 +174,20 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, } } + if (bits & DirtyTransform) { + // Do SampleTranform last. + // + // This is because it needs the shutter interval which is computed above. + // + sceneDelegate->SampleTransform( + id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &_sampleXforms); + } + // XXX: Should we flip the proj matrix (RHS vs LHS) as well here? // We don't need to clear the dirty bits since HdCamera::Sync always clears diff --git a/third_party/renderman-26/plugin/hdPrman/camera.cpp b/third_party/renderman-26/plugin/hdPrman/camera.cpp index b3d59e05b4..f73e4b3b51 100644 --- a/third_party/renderman-26/plugin/hdPrman/camera.cpp +++ b/third_party/renderman-26/plugin/hdPrman/camera.cpp @@ -94,16 +94,6 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, // Save state of dirtyBits before HdCamera::Sync clears them. const HdDirtyBits bits = *dirtyBits; - if (bits & DirtyTransform) { - sceneDelegate->SampleTransform( - id, -#if HD_API_VERSION >= 68 - param->GetShutterInterval()[0], - param->GetShutterInterval()[1], -#endif - &_sampleXforms); - } - if (bits & AllDirty) { param->GetCameraContext().MarkCameraInvalid(id); } @@ -184,6 +174,20 @@ HdPrmanCamera::Sync(HdSceneDelegate *sceneDelegate, } } + if (bits & DirtyTransform) { + // Do SampleTranform last. + // + // This is because it needs the shutter interval which is computed above. + // + sceneDelegate->SampleTransform( + id, +#if HD_API_VERSION >= 68 + param->GetShutterInterval()[0], + param->GetShutterInterval()[1], +#endif + &_sampleXforms); + } + // XXX: Should we flip the proj matrix (RHS vs LHS) as well here? // We don't need to clear the dirty bits since HdCamera::Sync always clears From aa7a26d6bced766f4c4ccb5ecc713d47c3036efc Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Fri, 16 Aug 2024 12:18:36 -0700 Subject: [PATCH 059/202] Add applied API schema data to the usdview "Meta Data" tab Fixes #1431 (Internal change: 2337223) --- .../testUsdviewMetadatatabSelect/test.usda | 12 +++++ .../testUsdviewMetadatatabSelect.py | 48 ++++++++++++++++++- pxr/usdImaging/usdviewq/appController.py | 8 ++++ 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/test.usda b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/test.usda index 566e3c7c37..1bfacda570 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/test.usda +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/test.usda @@ -73,3 +73,15 @@ def Sphere "otherSphere" { def Sphere "otherOtherScope" { float x = 444.4 } + +def RectLight "Light" +{ + float inputs:exposure = 3 + float inputs:focus = 1 + float inputs:height = 2 + float inputs:intensity = 1 + float inputs:width = 9 + double3 xformOp:rotateXYZ = (-60, 31.5, 0) + double3 xformOp:translate = (3.6, 11.4, 6) + token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ"] +} \ No newline at end of file diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py index ea225d73e7..0ec88809cc 100644 --- a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py +++ b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewMetadatatabSelect/testUsdviewMetadatatabSelect.py @@ -5,6 +5,14 @@ # Licensed under the terms set forth in the LICENSE.txt file available at # https://openusd.org/license. +from pxr import Usd, UsdLux +from pxr.UsdUtils.constantsGroup import ConstantsGroup +from pxr.Usdviewq.qt import QtWidgets + +class MetadataKeys(ConstantsGroup): + APPLIED_API_SCHEMAS_FIELD = "[applied API schemas]" + AUTHORED_API_SCHEMAS_FIELD = 'apiSchemas' + def _testSelectionChangeScrollPosition(appController): # A test to ensure changing the selection in the metadata # tab view does not affect the current scroll position in @@ -52,7 +60,44 @@ def _testBasic(appController): inspectorView.setCurrentIndex(3) appController._mainWindow.repaint() assert inspectorView.tabText(inspectorView.currentIndex()) == 'Composition' - + +def _testAPISchemaMetadata(appController): + inspectorView = appController._ui.propertyInspector + inspectorView.setCurrentIndex(1) + appController._ui.primViewLineEdit.setText('RectLight') + appController._primViewFindNext() + appController._mainWindow.repaint() + assert inspectorView.tabText(inspectorView.currentIndex()) == 'Meta Data' + + metadataTable = inspectorView.currentWidget().findChildren( + QtWidgets.QTableWidget)[0] + + reg = Usd.SchemaRegistry() + primDef = reg.FindConcretePrimDefinition("RectLight") + originalAppliedSchemas = primDef.GetAppliedAPISchemas() + + for i in range(0, metadataTable.rowCount()): + fieldName = str(metadataTable.item(i, 0).text()) + value = str(metadataTable.item(i, 1).text()) + if fieldName == MetadataKeys.APPLIED_API_SCHEMAS_FIELD: + assert all(str(s) in value for s in originalAppliedSchemas) + + prim = appController._dataModel.selection.getFocusPrim() + UsdLux.MeshLightAPI.Apply(prim) + appController._mainWindow.repaint() + apiDef = reg.FindAppliedAPIPrimDefinition("MeshLightAPI") + additionalAppliedSchemas = primDef.GetAppliedAPISchemas() + + for i in range(0, metadataTable.rowCount()): + fieldName = str(metadataTable.item(i, 0).text()) + value = str(metadataTable.item(i, 1).text()) + if fieldName == MetadataKeys.APPLIED_API_SCHEMAS_FIELD: + assert all(str(s) in value for s in originalAppliedSchemas) + assert all(str(s) in value for s in additionalAppliedSchemas) + assert "MeshLightAPI" in value + elif fieldName == MetadataKeys.AUTHORED_API_SCHEMAS_FIELD: + assert "MeshLightAPI" in value + def testUsdviewInputFunction(appController): # select our initial elements(prim and property). appController._ui.primViewLineEdit.setText('Implicits') @@ -67,3 +112,4 @@ def testUsdviewInputFunction(appController): _testBasic(appController) _testSelectionChangeScrollPosition(appController) + _testAPISchemaMetadata(appController) diff --git a/pxr/usdImaging/usdviewq/appController.py b/pxr/usdImaging/usdviewq/appController.py index 29a622b151..c058e67e53 100644 --- a/pxr/usdImaging/usdviewq/appController.py +++ b/pxr/usdImaging/usdviewq/appController.py @@ -4317,6 +4317,14 @@ def populateMetadataTable(key, val, rowIndex): else "Unknown" populateMetadataTable("[object type]", object_type, rowIndex) rowIndex += 1 + + # Represent applied API schemas + if type(obj) is Usd.Prim: + populateMetadataTable("[applied API schemas]", + str(obj.GetAppliedSchemas()), + rowIndex) + rowIndex += 1 + populateMetadataTable("[path]", str(obj.GetPath()), rowIndex) rowIndex += 1 From f41c8b7d55c7ca0908bb301998a2983b7d966dfb Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Fri, 16 Aug 2024 12:20:02 -0700 Subject: [PATCH 060/202] Add frame step size to saved user state in usdview (Internal change: 2337235) --- pxr/usdImaging/usdviewq/appController.py | 6 ++++++ pxr/usdImaging/usdviewq/viewSettingsDataModel.py | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/pxr/usdImaging/usdviewq/appController.py b/pxr/usdImaging/usdviewq/appController.py index c058e67e53..30b9d8658f 100644 --- a/pxr/usdImaging/usdviewq/appController.py +++ b/pxr/usdImaging/usdviewq/appController.py @@ -2147,6 +2147,7 @@ def _rangeBeginChanged(self): def _stepSizeChanged(self): value = float(self._ui.stepSize.text()) + self._dataModel.viewSettings.stepSize = value if value != self.step: self.step = value self._UpdateTimeSamples(resetStageDataOnly=False) @@ -5274,6 +5275,7 @@ def _refreshViewMenubar(self): self._refreshHUDMenu() self._refreshShowPrimMenu() self._refreshRedrawOnScrub() + self._refreshStepSize() self._refreshRolloverPrimInfoMenu() self._refreshSelectionHighlightingMenu() self._refreshSelectionHighlightColorMenu() @@ -5411,6 +5413,10 @@ def _refreshRedrawOnScrub(self): self._ui.redrawOnScrub.setChecked( self._dataModel.viewSettings.redrawOnScrub) + def _refreshStepSize(self): + stepSize = self._dataModel.viewSettings.stepSize + self._ui.stepSize.setText(str(stepSize)) + def _refreshRolloverPrimInfoMenu(self): self._ui.actionRollover_Prim_Info.setChecked( self._dataModel.viewSettings.rolloverPrimInfo) diff --git a/pxr/usdImaging/usdviewq/viewSettingsDataModel.py b/pxr/usdImaging/usdviewq/viewSettingsDataModel.py index f7db5d6c01..f0493e4e8a 100644 --- a/pxr/usdImaging/usdviewq/viewSettingsDataModel.py +++ b/pxr/usdImaging/usdviewq/viewSettingsDataModel.py @@ -126,6 +126,7 @@ def __init__(self, rootDataModel, parent): self._defaultMaterialAmbient = self.stateProperty("defaultMaterialAmbient", default=DEFAULT_AMBIENT) self._defaultMaterialSpecular = self.stateProperty("defaultMaterialSpecular", default=DEFAULT_SPECULAR) self._redrawOnScrub = self.stateProperty("redrawOnScrub", default=True) + self._stepSize = self.stateProperty("stepSize", default=1.0) self._renderMode = self.stateProperty("renderMode", default=RenderModes.SMOOTH_SHADED) self._freeCameraFOV = self.stateProperty("freeCameraFOV", default=60.0) self._freeCameraAspect = self.stateProperty("freeCameraAspect", default=1.0) @@ -208,6 +209,7 @@ def onSaveState(self, state): state["defaultMaterialAmbient"] = self._defaultMaterialAmbient state["defaultMaterialSpecular"] = self._defaultMaterialSpecular state["redrawOnScrub"] = self._redrawOnScrub + state["stepSize"] = self._stepSize state["renderMode"] = self._renderMode state["freeCameraFOV"] = self._freeCameraFOV freeCameraOverrideNear = self._freeCameraOverrideNear @@ -806,6 +808,15 @@ def redrawOnScrub(self): def redrawOnScrub(self, value): self._redrawOnScrub = value + @property + def stepSize(self): + return self._stepSize + + @stepSize.setter + @visibleViewSetting + def stepSize(self, value): + self._stepSize = value + @property def freeCamera(self): return self._freeCamera From a7f77424298ae11a62ba0d410c2b7b13c7a1a792 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 16 Aug 2024 12:21:05 -0700 Subject: [PATCH 061/202] cmake: Rename "python" custom target to prevent collisions The build system current uses the "python" target to collect Python module dependencies for internal bookkeeping. This has been renamed to "python_modules" to more clearly reflect its purpose and avoid conflicts with a future change that will introduce a "python" library. (Internal change: 2337278) (Internal change: 2337281) --- cmake/macros/Private.cmake | 6 +++--- cmake/macros/Public.cmake | 16 ++++++++-------- pxr/base/tf/CMakeLists.txt | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake index 48fe107dd7..b7ae4e40da 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake @@ -224,7 +224,7 @@ function(_install_python LIBRARY_NAME) add_custom_target(${LIBRARY_NAME}_pythonfiles DEPENDS ${files_copied} ) - add_dependencies(python ${LIBRARY_NAME}_pythonfiles) + add_dependencies(python_modules ${LIBRARY_NAME}_pythonfiles) _get_folder("_python" folder) set_target_properties(${LIBRARY_NAME}_pythonfiles @@ -330,7 +330,7 @@ function(_install_pyside_ui_files LIBRARY_NAME) add_custom_target(${LIBRARY_NAME}_pysideuifiles DEPENDS ${uiFiles} ) - add_dependencies(python ${LIBRARY_NAME}_pythonfiles) + add_dependencies(python_modules ${LIBRARY_NAME}_pythonfiles) _get_folder("_pysideuifiles" folder) set_target_properties( @@ -991,7 +991,7 @@ function(_pxr_python_module NAME) SHARED ${args_CPPFILES} ) - add_dependencies(python ${LIBRARY_NAME}) + add_dependencies(python_modules ${LIBRARY_NAME}) if(args_PYTHON_FILES) add_dependencies(${LIBRARY_NAME} ${LIBRARY_NAME}_pythonfiles) endif() diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake index 9f3d358377..80ec4301bb 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -76,7 +76,7 @@ function(pxr_python_bin BIN_NAME) ) # If we can't build Python modules then do nothing. - if(NOT TARGET python) + if(NOT TARGET python_modules) message(STATUS "Skipping Python program ${BIN_NAME}, Python modules required") return() endif() @@ -141,7 +141,7 @@ function(pxr_python_bin BIN_NAME) add_custom_target(${BIN_NAME}_script DEPENDS ${outputs} ${pb_DEPENDENCIES} ) - add_dependencies(python ${BIN_NAME}_script) + add_dependencies(python_modules ${BIN_NAME}_script) _get_folder("" folder) set_target_properties(${BIN_NAME}_script @@ -388,7 +388,7 @@ endfunction() # pxr_setup_python function (pxr_create_test_module MODULE_NAME) # If we can't build Python modules then do nothing. - if(NOT TARGET python) + if(NOT TARGET python_modules) return() endif() @@ -573,7 +573,7 @@ endfunction() # pxr_build_test function(pxr_test_scripts) # If we can't build Python modules then do nothing. - if(NOT TARGET python) + if(NOT TARGET python_modules) return() endif() @@ -666,7 +666,7 @@ function(pxr_register_test TEST_NAME) endif() endif() - if(NOT TARGET python) + if(NOT TARGET python_modules) # Implicit requirement. Python modules require shared USD # libraries. If the test runs python it's certainly going # to load USD modules. If the test uses C++ to load USD @@ -1030,9 +1030,9 @@ function(pxr_toplevel_prologue) endif() # Create a target for targets that require Python. Each should add - # itself as a dependency to the "python" target. + # itself as a dependency to the "python_modules" target. if(TARGET shared_libs AND PXR_ENABLE_PYTHON_SUPPORT) - add_custom_target(python ALL) + add_custom_target(python_modules ALL) endif() endfunction() # pxr_toplevel_prologue @@ -1317,4 +1317,4 @@ function(pxr_docs_only_dir NAME) ${args_DOXYGEN_FILES} ) endif() -endfunction() # pxr_docs_only_dir \ No newline at end of file +endfunction() # pxr_docs_only_dir diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt index b236184c47..8bbb062145 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -18,7 +18,7 @@ function(add_py_dll_link_test) # early return if python target is not built! (No python build enabled or # doing a static build, etc) - if (NOT TARGET python) + if (NOT TARGET python_modules) return() endif() @@ -60,7 +60,7 @@ function(add_py_dll_link_test) add_library(testTfPyDllLinkModule SHARED "testenv/testTfPyDllLinkModule.c" ) - add_dependencies(python testTfPyDllLinkModule) + add_dependencies(python_modules testTfPyDllLinkModule) set(module_name testTfPyDllLinkModule) if (PXR_USE_DEBUG_PYTHON) From a38a8aa1ca697045bea6dc7af0be0ec911597100 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 17 Aug 2024 10:15:54 -0400 Subject: [PATCH 062/202] fix: various updates from PR comments - fixed indentation - fixed misnamed validators in comments - use .empty() instead of size() > 0 - fix usd/plugInfo.json - remove test print statement --- pxr/usd/usd/plugInfo.json | 2 +- .../testenv/testUsdUtilsValidators.cpp | 6 +- pxr/usd/usdUtils/validators.cpp | 112 +++++++++--------- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/pxr/usd/usd/plugInfo.json b/pxr/usd/usd/plugInfo.json index 6361699429..016a8898c3 100644 --- a/pxr/usd/usd/plugInfo.json +++ b/pxr/usd/usd/plugInfo.json @@ -148,7 +148,7 @@ "Validators": { "CompositionErrorTest": { "doc": "Validator aims at providing all composition errors, which were generated while composing the stage." - }, + }, "keywords": [ "UsdCoreValidators" ] diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 2c926ecacf..8dd2317497 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -13,12 +13,12 @@ void TestUsdUsdzValidators() { // This should be updated with every new validator added with - // UsdUsdzValidators keyword. + // UsdUtilsValidators keyword. UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); UsdValidatorMetadataVector metadata = registry.GetValidatorMetadataForKeyword( UsdUtilsValidatorKeywordTokens->UsdUtilsValidators); - // Since other validators can be registered with a UsdUsdzValidators + // Since other validators can be registered with a UsdUtilsValidators // keyword, our validators registered in usd are a subset of the entire // set. std::set validatorMetadataNameSet; @@ -90,5 +90,5 @@ main() TestUsdUsdzValidators(); TestPackageEncapsulationValidator(); - std::cout << "OK\n"; + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index 545644f1b4..250cf08b60 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -15,74 +15,74 @@ PXR_NAMESPACE_OPEN_SCOPE - static - UsdValidationErrorVector - _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { - UsdValidationErrorVector errors; +static +UsdValidationErrorVector +_PackageEncapsulationValidator(const UsdStagePtr& usdStage) { + UsdValidationErrorVector errors; - const SdfLayerRefPtr& rootLayer = usdStage->GetRootLayer(); - const bool isPackage = [](const SdfLayerHandle& layer){ - return layer->GetFileFormat()->IsPackage() || ArIsPackageRelativePath(layer->GetIdentifier()); - }(rootLayer); + const SdfLayerRefPtr& rootLayer = usdStage->GetRootLayer(); + const bool isPackage = [](const SdfLayerHandle& layer){ + return layer->GetFileFormat()->IsPackage() || ArIsPackageRelativePath(layer->GetIdentifier()); + }(rootLayer); - if (!isPackage){ - return errors; - } + if (!isPackage){ + return errors; + } - std::vector> layers; - std::vector> assets, unresolvedPaths; - const SdfAssetPath& path = SdfAssetPath(rootLayer->GetIdentifier()); + std::vector> layers; + std::vector> assets, unresolvedPaths; + const SdfAssetPath& path = SdfAssetPath(rootLayer->GetIdentifier()); - UsdUtilsComputeAllDependencies(path, &layers, &assets, - &unresolvedPaths, nullptr); + UsdUtilsComputeAllDependencies(path, &layers, &assets, + &unresolvedPaths, nullptr); - const std::string& realPath = rootLayer->GetRealPath(); - const std::string& packagePath = ArIsPackageRelativePath(rootLayer->GetIdentifier()) ? - ArSplitPackageRelativePathOuter(realPath).first : - realPath; + const std::string& realPath = rootLayer->GetRealPath(); + const std::string& packagePath = ArIsPackageRelativePath(rootLayer->GetIdentifier()) ? + ArSplitPackageRelativePathOuter(realPath).first : + realPath; - if (packagePath.length() > 0) { - for (const SdfLayerRefPtr& subLayer : layers) { - const std::string& realPath = subLayer->GetRealPath(); - if (!TfStringStartsWith(realPath, packagePath)) { - errors.emplace_back( - UsdValidationErrorType::Error, - UsdValidationErrorSites{ - UsdValidationErrorSite(rootLayer, - subLayer->GetDefaultPrimAsPath()) - }, - TfStringPrintf(("Found loaded layer '%s' that " - "does not belong to the package '%s'."), - subLayer->GetIdentifier().c_str(), packagePath.c_str()) - ); - } + if (!packagePath.empty()) { + for (const SdfLayerRefPtr& subLayer : layers) { + const std::string& realPath = subLayer->GetRealPath(); + if (!TfStringStartsWith(realPath, packagePath)) { + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(rootLayer, + subLayer->GetDefaultPrimAsPath()) + }, + TfStringPrintf(("Found loaded layer '%s' that " + "does not belong to the package '%s'."), + subLayer->GetIdentifier().c_str(), packagePath.c_str()) + ); } + } - for (const std::string& asset : assets) { - if (!TfStringStartsWith(asset, packagePath)) { - errors.emplace_back( - UsdValidationErrorType::Error, - UsdValidationErrorSites{ - UsdValidationErrorSite(rootLayer, - SdfPath(asset)) - }, - TfStringPrintf(("Found asset reference '%s' that " - "does not belong to the package '%s'."), - asset.c_str(), packagePath.c_str()) - ); - } + for (const std::string& asset : assets) { + if (!TfStringStartsWith(asset, packagePath)) { + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(rootLayer, + SdfPath(asset)) + }, + TfStringPrintf(("Found asset reference '%s' that " + "does not belong to the package '%s'."), + asset.c_str(), packagePath.c_str()) + ); } } - - return errors; } - TF_REGISTRY_FUNCTION(UsdValidationRegistry) - { - UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); - registry.RegisterPluginValidator( - UsdUtilsValidatorNameTokens->packageEncapsulationValidator, _PackageEncapsulationValidator); - } + return errors; +} + +TF_REGISTRY_FUNCTION(UsdValidationRegistry) +{ + UsdValidationRegistry& registry = UsdValidationRegistry::GetInstance(); + registry.RegisterPluginValidator( + UsdUtilsValidatorNameTokens->packageEncapsulationValidator, _PackageEncapsulationValidator); +} PXR_NAMESPACE_CLOSE_SCOPE From 2ef05c1f5eea869e1fcb4b880c69887c67699212 Mon Sep 17 00:00:00 2001 From: Roggie Zhang Date: Mon, 19 Aug 2024 10:59:24 +0800 Subject: [PATCH 063/202] Use getter/setter to access keywords and schemeTypes --- .../usd/testenv/testUsdValidatorMetadata.py | 24 +++++++++---------- pxr/usd/usd/wrapValidator.cpp | 8 +++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py index d35bde59e1..4d56cd3082 100644 --- a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py +++ b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py @@ -23,8 +23,8 @@ def _verify_metadata( ): self.assertEqual(metadata.name, name) self.assertEqual(metadata.doc, doc) - self.assertEqual(metadata.keywords, keywords) - self.assertEqual(metadata.schemaTypes, schemaTypes) + self.assertEqual(metadata.GetKeywords(), keywords) + self.assertEqual(metadata.GetSchemaTypes(), schemaTypes) self.assertEqual(metadata.plugin, plugin) self.assertEqual(metadata.isSuite, isSuite) @@ -112,26 +112,26 @@ def test_metadata_doc_getter_and_setter(self): def test_metadata_keywords_getter_and_setter(self): metadata = Usd.ValidatorMetadata() for keywords in [["keyword1"], ["keyword2"]]: - metadata.keywords = keywords - self.assertEqual(metadata.keywords, keywords) + metadata.SetKeywords(keywords) + self.assertEqual(metadata.GetKeywords(), keywords) # Invalid type with self.assertRaises(Exception): - metadata.keywords = 123 + metadata.SetKeywords(123) with self.assertRaises(Exception): - metadata.keywords = "123" + metadata.SetKeywords("123") def test_metadata_schemaTypes_getter_and_setter(self): metadata = Usd.ValidatorMetadata() for schema_types in [["PrimType1"], ["PrimType2"]]: - metadata.schemaTypes = schema_types - self.assertEqual(metadata.schemaTypes, schema_types) + metadata.SetSchemaTypes(schema_types) + self.assertEqual(metadata.GetSchemaTypes(), schema_types) # Invalid type with self.assertRaises(Exception): - metadata.keywords = 123 + metadata.SetKeywords(123) with self.assertRaises(Exception): - metadata.keywords = "123" + metadata.SetKeywords("123") def test_metadata_plugin_getter_and_setter(self): all_plugins = Plug.Registry().GetAllPlugins() @@ -142,7 +142,7 @@ def test_metadata_plugin_getter_and_setter(self): # Invalid type with self.assertRaises(Exception): - metadata.keywords = 123 + metadata.SetKeywords(123) def test_metadata_is_suite_getter_and_setter(self): metadata = Usd.ValidatorMetadata() @@ -152,7 +152,7 @@ def test_metadata_is_suite_getter_and_setter(self): # Invalid type with self.assertRaises(Exception): - metadata.keywords = "123" + metadata.SetKeywords("123") if __name__ == "__main__": diff --git a/pxr/usd/usd/wrapValidator.cpp b/pxr/usd/usd/wrapValidator.cpp index 3e4ed3385b..13bc630e21 100644 --- a/pxr/usd/usd/wrapValidator.cpp +++ b/pxr/usd/usd/wrapValidator.cpp @@ -97,10 +97,10 @@ void wrapUsdValidator() arg("isSuite") = false))) .add_property("name", &_GetMetadataName, &_SetMetadataName) .add_property("plugin", &_GetMetadataPlugin, &_SetMetadataPlugin) - .add_property("keywords", make_function( - &_GetMetadataKeywords, return_value_policy()), _SetMetadataKeywords) + .def("GetKeywords", &_GetMetadataKeywords, return_value_policy()) + .def("SetKeywords", &_SetMetadataKeywords) .def_readwrite("doc", &UsdValidatorMetadata::doc) - .add_property("schemaTypes", make_function( - &_GetMetadataSchemaTypes, return_value_policy()), _SetMetadataSchemaTypes) + .def("GetSchemaTypes", &_GetMetadataSchemaTypes, return_value_policy()) + .def("SetSchemaTypes", &_SetMetadataSchemaTypes) .def_readwrite("isSuite", &UsdValidatorMetadata::isSuite); } From 06be835bc36007f546b8a75a56a0a93578c3e6ab Mon Sep 17 00:00:00 2001 From: Roggie Zhang Date: Tue, 20 Aug 2024 13:03:25 +0800 Subject: [PATCH 064/202] Make property bindings of UsdValidatorMetadata immutable --- .../usd/testenv/testUsdValidatorMetadata.py | 61 ++++------------- pxr/usd/usd/wrapValidator.cpp | 66 +++---------------- 2 files changed, 24 insertions(+), 103 deletions(-) diff --git a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py index 4d56cd3082..e349705d18 100644 --- a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py +++ b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py @@ -23,8 +23,8 @@ def _verify_metadata( ): self.assertEqual(metadata.name, name) self.assertEqual(metadata.doc, doc) - self.assertEqual(metadata.GetKeywords(), keywords) - self.assertEqual(metadata.GetSchemaTypes(), schemaTypes) + self.assertEqual(metadata.keywords, keywords) + self.assertEqual(metadata.schemaTypes, schemaTypes) self.assertEqual(metadata.plugin, plugin) self.assertEqual(metadata.isSuite, isSuite) @@ -89,70 +89,37 @@ def test_create_metadata_with_invalid_keyword_args(self): with self.assertRaises(Exception): Usd.ValidatorMetadata(**args) - def test_metadata_name_getter_and_setter(self): + def test_metadata_name_immutable(self): metadata = Usd.ValidatorMetadata() - for name in ["validator1", "validator2"]: - metadata.name = name - self.assertEqual(metadata.name, name) - - # Invalid type with self.assertRaises(Exception): - metadata.name = 123 + metadata.name = "test" - def test_metadata_doc_getter_and_setter(self): + def test_metadata_doc_immutable(self): metadata = Usd.ValidatorMetadata() - for doc in ["doc1", "doc2"]: - metadata.doc = doc - self.assertEqual(metadata.doc, doc) - - # Invalid type with self.assertRaises(Exception): - metadata.doc = 123 + metadata.doc = "doc" - def test_metadata_keywords_getter_and_setter(self): + def test_metadata_keywords_immutable(self): metadata = Usd.ValidatorMetadata() - for keywords in [["keyword1"], ["keyword2"]]: - metadata.SetKeywords(keywords) - self.assertEqual(metadata.GetKeywords(), keywords) - - # Invalid type - with self.assertRaises(Exception): - metadata.SetKeywords(123) with self.assertRaises(Exception): - metadata.SetKeywords("123") + metadata.keywords = ["keywords"] - def test_metadata_schemaTypes_getter_and_setter(self): + def test_metadata_schemaTypes_immutable(self): metadata = Usd.ValidatorMetadata() - for schema_types in [["PrimType1"], ["PrimType2"]]: - metadata.SetSchemaTypes(schema_types) - self.assertEqual(metadata.GetSchemaTypes(), schema_types) - - # Invalid type - with self.assertRaises(Exception): - metadata.SetKeywords(123) with self.assertRaises(Exception): - metadata.SetKeywords("123") + metadata.schemaTypes = "PrimType1" - def test_metadata_plugin_getter_and_setter(self): + def test_metadata_plugin_immutable(self): all_plugins = Plug.Registry().GetAllPlugins() expected_plugin = all_plugins[0] if all_plugins else None metadata = Usd.ValidatorMetadata() - metadata.plugin = expected_plugin - self.assertEqual(metadata.plugin, expected_plugin) - - # Invalid type with self.assertRaises(Exception): - metadata.SetKeywords(123) + metadata.plugin = expected_plugin - def test_metadata_is_suite_getter_and_setter(self): + def test_metadata_is_suite_immutable(self): metadata = Usd.ValidatorMetadata() - for suite in [True, False]: - metadata.isSuite = suite - self.assertEqual(metadata.isSuite, suite) - - # Invalid type with self.assertRaises(Exception): - metadata.SetKeywords("123") + metadata.isSuite = True if __name__ == "__main__": diff --git a/pxr/usd/usd/wrapValidator.cpp b/pxr/usd/usd/wrapValidator.cpp index 13bc630e21..8080aaf0de 100644 --- a/pxr/usd/usd/wrapValidator.cpp +++ b/pxr/usd/usd/wrapValidator.cpp @@ -35,54 +35,6 @@ namespace return new UsdValidatorMetadata{name, plugin, keywords, doc, schemaTypes, isSuite}; } - TfToken - _GetMetadataName(const UsdValidatorMetadata &metadata) - { - return metadata.name; - } - - void - _SetMetadataName(UsdValidatorMetadata &metadata, const TfToken &name) - { - metadata.name = name; - } - - TfTokenVector - _GetMetadataKeywords(const UsdValidatorMetadata &metadata) - { - return metadata.keywords; - } - - void - _SetMetadataKeywords(UsdValidatorMetadata &metadata, const TfTokenVector &keywords) - { - metadata.keywords = keywords; - } - - TfTokenVector - _GetMetadataSchemaTypes(const UsdValidatorMetadata &metadata) - { - return metadata.schemaTypes; - } - - void - _SetMetadataSchemaTypes(UsdValidatorMetadata &metadata, const TfTokenVector &schemaTypes) - { - metadata.schemaTypes = schemaTypes; - } - - PlugPluginPtr - _GetMetadataPlugin(const UsdValidatorMetadata &metadata) - { - return metadata.pluginPtr; - } - - void - _SetMetadataPlugin(UsdValidatorMetadata &metadata, const PlugPluginPtr &plugin) - { - metadata.pluginPtr = plugin; - } - } // anonymous namespace void wrapUsdValidator() @@ -95,12 +47,14 @@ void wrapUsdValidator() arg("doc") = TfToken(), arg("schemaTypes") = TfTokenVector(), arg("isSuite") = false))) - .add_property("name", &_GetMetadataName, &_SetMetadataName) - .add_property("plugin", &_GetMetadataPlugin, &_SetMetadataPlugin) - .def("GetKeywords", &_GetMetadataKeywords, return_value_policy()) - .def("SetKeywords", &_SetMetadataKeywords) - .def_readwrite("doc", &UsdValidatorMetadata::doc) - .def("GetSchemaTypes", &_GetMetadataSchemaTypes, return_value_policy()) - .def("SetSchemaTypes", &_SetMetadataSchemaTypes) - .def_readwrite("isSuite", &UsdValidatorMetadata::isSuite); + .add_property("name", make_getter( + &UsdValidatorMetadata::name, return_value_policy())) + .add_property("plugin", make_getter( + &UsdValidatorMetadata::pluginPtr, return_value_policy())) + .add_property("keywords", make_getter( + &UsdValidatorMetadata::keywords, return_value_policy())) + .def_readonly("doc", &UsdValidatorMetadata::doc) + .add_property("schemaTypes", make_getter( + &UsdValidatorMetadata::schemaTypes, return_value_policy())) + .def_readonly("isSuite", &UsdValidatorMetadata::isSuite); } From 9c4d57746b749ff848b6af3aa72ab6c6d153b50f Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Tue, 20 Aug 2024 09:09:10 -0700 Subject: [PATCH 065/202] Speed up NdrRegistry initialization functions by running node discovery for each plugin in parallel. (Internal change: 2337307) --- pxr/usd/ndr/registry.cpp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pxr/usd/ndr/registry.cpp b/pxr/usd/ndr/registry.cpp index 5996bc82c9..8d2c211a02 100644 --- a/pxr/usd/ndr/registry.cpp +++ b/pxr/usd/ndr/registry.cpp @@ -990,11 +990,32 @@ NdrRegistry::_InstantiateParserPlugins( void NdrRegistry::_RunDiscoveryPlugins(const DiscoveryPluginRefPtrVec& discoveryPlugins) { - std::lock_guard drLock(_discoveryResultMutex); + size_t num_plugins = discoveryPlugins.size(); + std::vector results_vec(num_plugins); + + // Discover nodes in parallel. Following the pattern in GetNodesByFamily, + // pre-emptively release the Python GIL here to avoid + // deadlocks since the code running in the worker threads may call into + // Python and try to take the GIL when discovering nodes. We also need + // to use scoped parallelism to ensure we don't pick up other tasks + // during the call to WorkParallelForN that may reenter this function + // and also deadlock. + TF_PY_ALLOW_THREADS_IN_SCOPE(); + + WorkWithScopedParallelism([&]() { + WorkParallelForN( + num_plugins, + [&](size_t start, size_t end) { + for (size_t i = start; i < end; i++) { + results_vec[i] = discoveryPlugins[i]->DiscoverNodes( + _DiscoveryContext(*this)); + } + }); + } + ); - for (const NdrDiscoveryPluginRefPtr& dp : discoveryPlugins) { - NdrNodeDiscoveryResultVec results = - dp->DiscoverNodes(_DiscoveryContext(*this)); + std::lock_guard drLock(_discoveryResultMutex); + for (NdrNodeDiscoveryResultVec &results : results_vec) { for (NdrNodeDiscoveryResult &dr : results) { _AddDiscoveryResultNoLock(std::move(dr)); } From a1c07a390d1e626117bd28829f641462f643ad2c Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 20 Aug 2024 09:09:36 -0700 Subject: [PATCH 066/202] cmake: Centralize addition of Python-related dependencies The cmake helper pxr_library function now adds dependencies on Python and boost::python if the library contains any Python-related code. Individual libraries no longer need to explicitly specify these dependencies, which had previously been done inconsistently anyway. Note that the boost::python dependency was removed in a few cases where it technically ought to be specified -- for example, in tests that directly use boost::python. This doesn't really hurt anything since these tests will pick up the dependency transitively, and it will make it easier to change the boost::python dependency to something else later. (Internal change: 2337314) --- cmake/macros/Public.cmake | 15 ++++++++++++++- pxr/base/plug/CMakeLists.txt | 2 -- pxr/base/tf/CMakeLists.txt | 7 ------- pxr/base/trace/CMakeLists.txt | 2 -- pxr/base/ts/CMakeLists.txt | 3 +-- pxr/base/vt/CMakeLists.txt | 2 -- pxr/imaging/glf/CMakeLists.txt | 12 ------------ pxr/imaging/pxOsd/CMakeLists.txt | 1 - pxr/usd/ar/CMakeLists.txt | 2 -- pxr/usd/ndr/CMakeLists.txt | 4 ---- pxr/usd/pcp/CMakeLists.txt | 2 -- pxr/usd/sdf/CMakeLists.txt | 2 -- pxr/usd/sdr/CMakeLists.txt | 4 ---- pxr/usd/usd/CMakeLists.txt | 2 -- pxr/usd/usdGeom/CMakeLists.txt | 2 -- pxr/usd/usdPhysics/CMakeLists.txt | 4 +--- pxr/usd/usdRi/CMakeLists.txt | 4 ---- pxr/usd/usdSkel/CMakeLists.txt | 2 -- pxr/usd/usdUtils/CMakeLists.txt | 3 --- pxr/usdImaging/usdAppUtils/CMakeLists.txt | 4 ---- pxr/usdImaging/usdImagingGL/CMakeLists.txt | 4 ---- pxr/usdImaging/usdviewq/CMakeLists.txt | 4 ---- 22 files changed, 16 insertions(+), 71 deletions(-) diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake index 80ec4301bb..294532545a 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -242,20 +242,31 @@ function(pxr_library NAME) # If python support is enabled, merge the python specific categories # with the more general before setting up compilation. if(PXR_ENABLE_PYTHON_SUPPORT) + set(libraryRequiresPython 0) if(args_PYTHON_PUBLIC_CLASSES) list(APPEND args_PUBLIC_CLASSES ${args_PYTHON_PUBLIC_CLASSES}) + set(libraryRequiresPython 1) endif() if(args_PYTHON_PUBLIC_HEADERS) list(APPEND args_PUBLIC_HEADERS ${args_PYTHON_PUBLIC_HEADERS}) + set(libraryRequiresPython 1) endif() if(args_PYTHON_PRIVATE_CLASSES) list(APPEND args_PRIVATE_CLASSES ${args_PYTHON_PRIVATE_CLASSES}) + set(libraryRequiresPython 1) endif() if(args_PYTHON_PRIVATE_HEADERS) list(APPEND args_PRIVATE_HEADERS ${args_PYTHON_PRIVATE_HEADERS}) + set(libraryRequiresPython 1) endif() if(args_PYTHON_CPPFILES) list(APPEND args_CPPFILES ${args_PYTHON_CPPFILES}) + set(libraryRequiresPython 1) + endif() + + if(libraryRequiresPython) + list(APPEND args_LIBRARIES ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARY}) + list(APPEND args_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) endif() endif() @@ -336,13 +347,15 @@ function(pxr_library NAME) ) if(PXR_ENABLE_PYTHON_SUPPORT AND (args_PYMODULE_CPPFILES OR args_PYMODULE_FILES OR args_PYSIDE_UI_FILES)) + list(APPEND pythonModuleIncludeDirs ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) + _pxr_python_module( ${NAME} WRAPPED_LIB_INSTALL_PREFIX "${libInstallPrefix}" PYTHON_FILES ${args_PYMODULE_FILES} PYSIDE_UI_FILES ${args_PYSIDE_UI_FILES} CPPFILES ${args_PYMODULE_CPPFILES} - INCLUDE_DIRS ${args_INCLUDE_DIRS} + INCLUDE_DIRS "${args_INCLUDE_DIRS};${pythonModuleIncludeDirs}" PRECOMPILED_HEADERS ${pch} PRECOMPILED_HEADER_NAME ${args_PRECOMPILED_HEADER_NAME} ) diff --git a/pxr/base/plug/CMakeLists.txt b/pxr/base/plug/CMakeLists.txt index ac6942516c..6d4c74ce0a 100644 --- a/pxr/base/plug/CMakeLists.txt +++ b/pxr/base/plug/CMakeLists.txt @@ -8,11 +8,9 @@ pxr_library(plug js trace work - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt index 8bbb062145..a4a6cff4f8 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -114,13 +114,9 @@ pxr_library(tf LIBRARIES arch ${WINLIBS} - ${PYTHON_LIBRARIES} - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${PYTHON_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES @@ -361,7 +357,6 @@ if(PXR_ENABLE_PYTHON_SUPPORT) pxr_build_test(testTfPyFunction LIBRARIES tf - ${Boost_PYTHON_LIBRARY} CPPFILES testenv/testTfPyFunction.cpp ) @@ -383,7 +378,6 @@ if(PXR_ENABLE_PYTHON_SUPPORT) pxr_build_test(testTfPyLock LIBRARIES tf - ${Boost_PYTHON_LIBRARY} CPPFILES testenv/testTfPyLock.cpp ) @@ -391,7 +385,6 @@ if(PXR_ENABLE_PYTHON_SUPPORT) pxr_build_test(testTfPyResultConversions LIBRARIES tf - ${Boost_PYTHON_LIBRARY} CPPFILES testenv/testTfPyResultConversions.cpp ) diff --git a/pxr/base/trace/CMakeLists.txt b/pxr/base/trace/CMakeLists.txt index db302e077a..beb04c5609 100644 --- a/pxr/base/trace/CMakeLists.txt +++ b/pxr/base/trace/CMakeLists.txt @@ -6,11 +6,9 @@ pxr_library(trace arch js tf - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/base/ts/CMakeLists.txt b/pxr/base/ts/CMakeLists.txt index 5ab9d454bd..9cef2ee561 100644 --- a/pxr/base/ts/CMakeLists.txt +++ b/pxr/base/ts/CMakeLists.txt @@ -5,11 +5,10 @@ set(libs vt gf tf - ${Boost_PYTHON_LIBRARY} ) set(include - ${Boost_INCLUDE_DIRS} + "" ) set(classes diff --git a/pxr/base/vt/CMakeLists.txt b/pxr/base/vt/CMakeLists.txt index 87fb59a762..c332494c31 100644 --- a/pxr/base/vt/CMakeLists.txt +++ b/pxr/base/vt/CMakeLists.txt @@ -7,11 +7,9 @@ pxr_library(vt tf gf trace - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/imaging/glf/CMakeLists.txt b/pxr/imaging/glf/CMakeLists.txt index 6a90806549..46fd1cee5b 100644 --- a/pxr/imaging/glf/CMakeLists.txt +++ b/pxr/imaging/glf/CMakeLists.txt @@ -12,9 +12,6 @@ if (X11_FOUND) list(APPEND optionalPublicClasses testGLContext) endif() -set(optionalLibs "") -set(optionalIncludeDirs "") - pxr_library(glf LIBRARIES ar @@ -27,14 +24,8 @@ pxr_library(glf tf trace sdf - ${Boost_PYTHON_LIBRARY} OpenGL::GL ${X11_LIBRARIES} - ${optionalLibs} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} - ${optionalIncludeDirs} PUBLIC_CLASSES bindingMap @@ -60,9 +51,6 @@ pxr_library(glf PUBLIC_HEADERS api.h - CPPFILES - ${optionalCppFiles} - PYTHON_CPPFILES moduleDeps.cpp diff --git a/pxr/imaging/pxOsd/CMakeLists.txt b/pxr/imaging/pxOsd/CMakeLists.txt index 46f02889ac..37ac08e48d 100644 --- a/pxr/imaging/pxOsd/CMakeLists.txt +++ b/pxr/imaging/pxOsd/CMakeLists.txt @@ -7,7 +7,6 @@ pxr_library(pxOsd gf vt ${OPENSUBDIV_OSDCPU_LIBRARY} - ${Boost_PYTHON_LIBRARY} INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR} diff --git a/pxr/usd/ar/CMakeLists.txt b/pxr/usd/ar/CMakeLists.txt index fcf1aa4489..fb3a49f665 100644 --- a/pxr/usd/ar/CMakeLists.txt +++ b/pxr/usd/ar/CMakeLists.txt @@ -8,11 +8,9 @@ pxr_library(ar tf plug vt - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usd/ndr/CMakeLists.txt b/pxr/usd/ndr/CMakeLists.txt index 07de60ec88..877a15a288 100644 --- a/pxr/usd/ndr/CMakeLists.txt +++ b/pxr/usd/ndr/CMakeLists.txt @@ -9,10 +9,6 @@ pxr_library(ndr work ar sdf - ${Boost_PYTHON_LIBRARY} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} PUBLIC_CLASSES debugCodes diff --git a/pxr/usd/pcp/CMakeLists.txt b/pxr/usd/pcp/CMakeLists.txt index 2626e6022c..013779244a 100644 --- a/pxr/usd/pcp/CMakeLists.txt +++ b/pxr/usd/pcp/CMakeLists.txt @@ -9,11 +9,9 @@ pxr_library(pcp sdf work ar - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_HEADERS diff --git a/pxr/usd/sdf/CMakeLists.txt b/pxr/usd/sdf/CMakeLists.txt index 8f09038ddb..2086a9bf38 100644 --- a/pxr/usd/sdf/CMakeLists.txt +++ b/pxr/usd/sdf/CMakeLists.txt @@ -12,11 +12,9 @@ pxr_library(sdf vt work ar - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usd/sdr/CMakeLists.txt b/pxr/usd/sdr/CMakeLists.txt index f45f5796f2..923e8801fe 100644 --- a/pxr/usd/sdr/CMakeLists.txt +++ b/pxr/usd/sdr/CMakeLists.txt @@ -8,10 +8,6 @@ pxr_library(sdr ar ndr sdf - ${Boost_PYTHON_LIBRARY} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} PUBLIC_HEADERS api.h diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index 26981d78b4..2e482c9f9c 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -14,11 +14,9 @@ pxr_library(usd ts vt work - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usd/usdGeom/CMakeLists.txt b/pxr/usd/usdGeom/CMakeLists.txt index 5edbc3335a..081a7e923b 100644 --- a/pxr/usd/usdGeom/CMakeLists.txt +++ b/pxr/usd/usdGeom/CMakeLists.txt @@ -11,11 +11,9 @@ pxr_library(usdGeom trace usd work - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usd/usdPhysics/CMakeLists.txt b/pxr/usd/usdPhysics/CMakeLists.txt index 403a3dfe2d..ba044eef81 100644 --- a/pxr/usd/usdPhysics/CMakeLists.txt +++ b/pxr/usd/usdPhysics/CMakeLists.txt @@ -12,11 +12,9 @@ pxr_library(usdPhysics usdGeom usdShade work - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES @@ -110,4 +108,4 @@ pxr_register_test(testUsdPhysicsCollisionGroupAPI PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdPhysicsCollisionGroupAPI" EXPECTED_RETURN_CODE 0 -) \ No newline at end of file +) diff --git a/pxr/usd/usdRi/CMakeLists.txt b/pxr/usd/usdRi/CMakeLists.txt index 208d12e526..df65ffff99 100644 --- a/pxr/usd/usdRi/CMakeLists.txt +++ b/pxr/usd/usdRi/CMakeLists.txt @@ -9,10 +9,6 @@ pxr_library(usdRi usd usdShade usdGeom - ${Boost_PYTHON_LIBRARY} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} PUBLIC_CLASSES materialAPI diff --git a/pxr/usd/usdSkel/CMakeLists.txt b/pxr/usd/usdSkel/CMakeLists.txt index d1a0a1ed9c..33a65ad5ca 100644 --- a/pxr/usd/usdSkel/CMakeLists.txt +++ b/pxr/usd/usdSkel/CMakeLists.txt @@ -12,11 +12,9 @@ pxr_library(usdSkel sdf usd usdGeom - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usd/usdUtils/CMakeLists.txt b/pxr/usd/usdUtils/CMakeLists.txt index 65c96bd366..a12f591bfd 100644 --- a/pxr/usd/usdUtils/CMakeLists.txt +++ b/pxr/usd/usdUtils/CMakeLists.txt @@ -10,14 +10,11 @@ pxr_library(usdUtils usd usdGeom usdShade - ${Boost_PYTHON_LIBRARY} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} - PUBLIC_CLASSES authoring coalescingDiagnosticDelegate diff --git a/pxr/usdImaging/usdAppUtils/CMakeLists.txt b/pxr/usdImaging/usdAppUtils/CMakeLists.txt index dbeef54efd..6325cfe8d3 100644 --- a/pxr/usdImaging/usdAppUtils/CMakeLists.txt +++ b/pxr/usdImaging/usdAppUtils/CMakeLists.txt @@ -17,10 +17,6 @@ pxr_library(usdAppUtils usd usdGeom usdImagingGL - ${Boost_PYTHON_LIBRARY} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} PUBLIC_HEADERS api.h diff --git a/pxr/usdImaging/usdImagingGL/CMakeLists.txt b/pxr/usdImaging/usdImagingGL/CMakeLists.txt index f710b3e157..4c483b71c2 100644 --- a/pxr/usdImaging/usdImagingGL/CMakeLists.txt +++ b/pxr/usdImaging/usdImagingGL/CMakeLists.txt @@ -31,13 +31,9 @@ pxr_library(usdImagingGL usdShade usdImaging ar - ${Boost_PYTHON_LIBRARY} - ${PYTHON_LIBRARIES} ${TBB_tbb_LIBRARY} INCLUDE_DIRS - ${PYTHON_INCLUDE_PATH} - ${PYTHON_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES diff --git a/pxr/usdImaging/usdviewq/CMakeLists.txt b/pxr/usdImaging/usdviewq/CMakeLists.txt index 63b172b00a..dcc4b3cd6b 100644 --- a/pxr/usdImaging/usdviewq/CMakeLists.txt +++ b/pxr/usdImaging/usdviewq/CMakeLists.txt @@ -11,10 +11,6 @@ pxr_library(usdviewq usd usdGeom hd - ${Boost_PYTHON_LIBRARY} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} PUBLIC_CLASSES hydraObserver From 5c980df745488fe353bc6682fbf69dbcee92c056 Mon Sep 17 00:00:00 2001 From: florianz Date: Tue, 20 Aug 2024 09:10:23 -0700 Subject: [PATCH 067/202] Moving TfBits and TfCompressedBits to pxr/base/tf. (Internal change: 2337346) --- pxr/base/tf/CMakeLists.txt | 10 + pxr/base/tf/bits.cpp | 460 ++++++ pxr/base/tf/bits.h | 1078 +++++++++++++ pxr/base/tf/compressedBits.cpp | 287 ++++ pxr/base/tf/compressedBits.h | 1962 ++++++++++++++++++++++++ pxr/base/tf/testenv/bits.cpp | 191 +++ pxr/base/tf/testenv/compressedBits.cpp | 1302 ++++++++++++++++ 7 files changed, 5290 insertions(+) create mode 100644 pxr/base/tf/bits.cpp create mode 100644 pxr/base/tf/bits.h create mode 100644 pxr/base/tf/compressedBits.cpp create mode 100644 pxr/base/tf/compressedBits.h create mode 100644 pxr/base/tf/testenv/bits.cpp create mode 100644 pxr/base/tf/testenv/compressedBits.cpp diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt index a4a6cff4f8..306419493d 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -124,7 +124,9 @@ pxr_library(tf anyWeakPtr atomicOfstreamWrapper bigRWMutex + bits bitUtils + compressedBits debug debugNotice denseHashMap @@ -439,7 +441,9 @@ pxr_build_test(testTf testenv/main.cpp testenv/anyUniquePtr.cpp testenv/atomicOfstreamWrapper.cpp + testenv/bits.cpp testenv/bitUtils.cpp + testenv/compressedBits.cpp testenv/debug.cpp testenv/denseHashMap.cpp testenv/delegate.cpp @@ -542,9 +546,15 @@ pxr_register_test(TfAnyUniquePtr pxr_register_test(TfAtomicOfstreamWrapper COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testTf TfAtomicOfstreamWrapper" ) +pxr_register_test(TfBits + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testTf TfBits" +) pxr_register_test(TfBitUtils COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testTf TfBitUtils" ) +pxr_register_test(TfCompressedBits + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testTf TfCompressedBits" +) pxr_register_test(TfDl COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testTf TfDl" ) diff --git a/pxr/base/tf/bits.cpp b/pxr/base/tf/bits.cpp new file mode 100644 index 0000000000..6a97ae995d --- /dev/null +++ b/pxr/base/tf/bits.cpp @@ -0,0 +1,460 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/base/tf/bits.h" +#include "pxr/base/tf/tf.h" + +#include "pxr/base/arch/hash.h" + +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +// XXX:optimization Instead of always leaving the trailing bits to zero, we +// could let the first trailing bit (we might need to allocate +// one more word due to this), be 1. This "guard bit" can +// then be used to make FindNextSet() faster. + +// Note that the 64-bit array holding the bits can have unused bits at the end. +// By definition, these bits always needs to be kept at 0. + +size_t +TfBits::_CountNumSet() const +{ + // Accumulate number of set bits in a local variable (this makes the + // compiler generate better code since it does not have to repeatedly + // read/store the contents of a member variable). + size_t numSet = 0; + + // Limit the range of words we're looking at. + size_t firstSet = GetFirstSet(); + size_t lastSet = GetLastSet(); + size_t offset = firstSet >> 6; + size_t numWords = (firstSet < _num) ? (lastSet >> 6) + 1 - offset : 0; + + uint64_t *p = _bits + offset; + + // Loop over all words in the range. + for(size_t n=numWords; n>0; n--) + { + // On both gcc and clang, with the appropriate instruction set + // enabled, bitset::count compiles down to popcntq. + numSet += std::bitset<64>(*p++).count(); + } + + return numSet; +} + +size_t +TfBits::_FindNextSet(size_t index, size_t startBit) const +{ + for(size_t w=index>>6; w<_numWords; w++) + { + if (uint64_t bits = _bits[w]) + for(size_t i=startBit; i<64; i++) + if (bits & (1UL << i)) + { + // Note: Since we round up the # bits to fit an + // integer # of words, we need to check if we + // read too far... + + size_t bit = i + (w << 6); + + return (bit >= _num) ? _num : bit; + } + + startBit = 0; + } + + return _num; +} + +size_t +TfBits::_FindPrevSet(size_t index, size_t startBit) const +{ + for(int w=index>>6; w>=0; w--) + { + if (uint64_t bits = _bits[w]) + for(int i=startBit; i>=0; i--) + if (bits & (1UL << i)) + { + // Note: Since we round up the # bits to fit an + // integer # of words, we need to check if we + // read too far... + + return i + (w << 6); + } + + startBit = 63; + } + + return _num; +} + +size_t +TfBits::_FindNextUnset(size_t index, size_t startBit) const +{ + for(size_t w=index>>6; w<_numWords; w++) + { + // Note: We're operating on the flipped bits here... + if (uint64_t bits = ~_bits[w]) + for(size_t i=startBit; i<64; i++) + if (bits & (1UL << i)) + { + // Note: Since we round up the # bits to fit an + // integer # of words, we need to check if we + // read too far... + + size_t bit = i + (w << 6); + + return (bit >= _num) ? _num : bit; + } + + startBit = 0; + } + + return _num; +} + +size_t +TfBits::GetHash() const +{ + size_t firstSet = GetFirstSet(); + size_t lastSet = GetLastSet(); + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + uint64_t *p0 = _bits + offset; + + if (firstSet == _num) { + return firstSet; + } + + // Use firstSet as the seed. + return ArchHash((const char *)p0, numWords * sizeof(uint64_t), firstSet); +} + +bool +TfBits::operator==(const TfBits &rhs) const +{ + // Early bail out. + if (this == &rhs) + return true; + + // If the number of bits is different, they can't be equal. + if (_num != rhs._num) + return false; + + // XXX:optimization: Faster to always cache _numSet? + + // Check if we can do an early out based on the number of set bits. + const size_t numSet = _numSet.Load(); + if (numSet != size_t(-1)) { + const size_t rhsNumSet = rhs._numSet.Load(); + if (rhsNumSet != size_t(-1)) { + + // If the number of set bits is different, they can't be equal. + if (numSet != rhsNumSet) + return false; + + // Order doesn't matter if all bits are set or cleared and the # of + // set bits is the same... + if (numSet == 0 || numSet == _num) + return true; + } + } + + // Limit the comparison to where we have bits set. + size_t firstSet = GetFirstSet(); + size_t lastSet = GetLastSet(); + size_t rhsFirstSet = rhs.GetFirstSet(); + size_t rhsLastSet = rhs.GetLastSet(); + + if (firstSet != rhsFirstSet || lastSet != rhsLastSet) + return false; + + // Are any of the sets empty? + if (firstSet == _num || rhsFirstSet == _num) + return firstSet == rhsFirstSet; + + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + // Have to compare the bits. + + // This only works because we are careful to keep the trailing bits unset. + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + if (*p0 != *p1) + return false; + + p0++; + p1++; + } + + return true; +} + +TfBits & +TfBits::operator&=(const TfBits &rhs) +{ + // Early bail out. + if (this == &rhs) + return *this; + + TF_AXIOM(_num == rhs._num); + + // Limit the bit operations to where we have bits set in the first of + // the two sets (we only remove bits). + size_t firstSet = GetFirstSet(); + size_t lastSet = GetLastSet(); + + // Nothing to do if we already have no bits set. + if (firstSet < _num) + { + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + *p0 &= *p1; + p0++; + p1++; + } + + // Note: All lhs & rhs trailing bits are 0, so no trailing bits get set. + _numSet .Store(-1); + _firstSet.Store(FindNextSet(firstSet)); + _lastSet .Store(FindPrevSet(lastSet)); + } + + return *this; +} + +TfBits & +TfBits::operator|=(const TfBits &rhs) +{ + if (TF_VERIFY(_num == rhs._num)) + _Or(rhs); + + return *this; +} + +void +TfBits::_Or(const TfBits &rhs) +{ + // Early bail out. + if (this == &rhs) + return; + + // Limit the bit operations to where we have bits set in the second of + // the two sets (we only add bits that are set in the second set). + size_t rhsFirstSet = rhs.GetFirstSet(); + + // Nothing to do if rhs has no bits set. + if (rhsFirstSet < rhs._num) + { + size_t rhsLastSet = rhs.GetLastSet(); + size_t lhsFirstSet = GetFirstSet(); + size_t lhsLastSet = GetLastSet(); + + // Compute the first and last set bits for the result (note that we + // only do the or operation on the range where we have rhs bits set). + size_t firstSet = TfMin(lhsFirstSet, rhsFirstSet); + size_t lastSet = (lhsLastSet < _num) ? + TfMax(lhsLastSet, rhsLastSet) : rhsLastSet; + + // Early out for the case that rhs is contained in lhs (note that + // we do not bother to cache _numSet, if it is not cached we simply + // skip this early check). + if (_numSet.Load() == lastSet - firstSet + 1 && + firstSet == lhsFirstSet && lastSet == lhsLastSet) + return; + + size_t offset = rhsFirstSet >> 6; + size_t numWords = (rhsLastSet >> 6) + 1 - offset; + + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + *p0 |= *p1; + p0++; + p1++; + } + + // Note: All lhs & rhs trailing bits are 0, so no trailing bits get set. + _numSet .Store(-1); + _firstSet.Store(firstSet); + _lastSet .Store(lastSet); + } +} + +void +TfBits::OrSubset(const TfBits &rhs) +{ + if (TF_VERIFY(_num >= rhs._num)) + _Or(rhs); +} + +TfBits & +TfBits::operator^=(const TfBits &rhs) +{ + TF_AXIOM(_num == rhs._num); + + // Limit the bit operations to where we have bits set in either of + // the two sets. + size_t i0 = GetFirstSet(); + size_t i1 = rhs.GetFirstSet(); + + // Nothing to do if rhs has no bits set. + if (i1 < _num) + { + size_t firstSet = TfMin(i0, i1); + size_t lastSet = (i0 < _num) ? + TfMax(GetLastSet(), rhs.GetLastSet()) : rhs.GetLastSet(); + + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + *p0 ^= *p1; + p0++; + p1++; + } + + // Note: All lhs & rhs trailing bits are 0, so no trailing bits get set. + _numSet .Store(-1); + _firstSet.Store(FindNextSet(firstSet)); + _lastSet .Store(FindPrevSet(lastSet)); + } + + return *this; +} + +TfBits & +TfBits::operator-=(const TfBits &rhs) +{ + TF_AXIOM(_num == rhs._num); + + // Limit the bit operations to where we have bits set in both of + // the two sets. + size_t lhsFirstSet = GetFirstSet(); + size_t lhsLastSet = GetLastSet(); + + size_t i0 = lhsFirstSet; + size_t i1 = rhs.GetFirstSet(); + size_t firstSet = TfMax(i0, i1); + size_t lastSet = TfMin(lhsLastSet, rhs.GetLastSet()); + + // Nothing to do if either set has not bits set, or they do not overlap. + if (i0 < _num && i1 < _num && firstSet <= lastSet) + { + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + *p0 &= ~*p1; + p0++; + p1++; + } + + // Note: All lhs & rhs trailing bits are 0, so no trailing bits get set. + _numSet .Store(-1); + _firstSet.Store(FindNextSet(lhsFirstSet)); + _lastSet .Store(FindPrevSet(lhsLastSet)); + } + + return *this; +} + +TfBits & +TfBits::Complement() +{ + uint64_t *p = _bits; + + for(size_t i=_numWords; i>0; i--) + { + *p = ~*p; + p++; + } + + // Note: Need to keep unused bits at 0. + _ClearTrailingBits(); + + const size_t numSet = _numSet.Load(); + if (numSet != size_t(-1)) + _numSet.Store(_num - numSet); + _firstSet.Store(-1); + _lastSet .Store(-1); + + return *this; +} + +void +TfBits::_ClearTrailingBits() +{ + // Find the total number of words. + if (_numWords && (_num & 63)) + { + // Mask out the bits we're not using so that they don't end up in the + // count. + size_t numUsedBitsInLastWord = 64 - ((_numWords << 6) - _num); + TF_AXIOM(numUsedBitsInLastWord > 0 && numUsedBitsInLastWord <= 63); + + // Zero out the unused bits so that they don't show up in the counts. + _bits[_numWords - 1] &= (1UL << numUsedBitsInLastWord) - 1; + } +} + +std::string +TfBits::GetAsStringLeftToRight() const +{ + std::string res; + + for(size_t i=0; i<_num; ++i) + res.push_back('0' + IsSet(i)); + + return res; +} + +std::string +TfBits::GetAsStringRightToLeft() const +{ + std::string res; + + for(int64_t i=_num-1; i>=0; --i) + res.push_back('0' + IsSet(i)); + + return res; +} + + +std::ostream & +operator<<(std::ostream &out, const TfBits & bits) +{ + out << bits.GetAsStringLeftToRight(); + return out; +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/base/tf/bits.h b/pxr/base/tf/bits.h new file mode 100644 index 0000000000..df652d8c10 --- /dev/null +++ b/pxr/base/tf/bits.h @@ -0,0 +1,1078 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_BASE_TF_BITS_H +#define PXR_BASE_TF_BITS_H + +#include "pxr/base/arch/hints.h" +#include "pxr/base/tf/api.h" +#include "pxr/base/tf/hash.h" +#include "pxr/base/tf/tf.h" +#include "pxr/base/tf/hash.h" +#include "pxr/base/tf/diagnostic.h" +#include "pxr/base/tf/iterator.h" + +#include +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// \class TfBits +/// +/// \brief Fast bit array that keeps track of the number of bits set and +/// can find the next set in a timely manner. +/// +/// Note about thread safety in this class: +/// +/// TfBits supports only the most basic thread safety guarantee: multiple +/// threads may safely call const methods concurrently. A thread must not +/// invoke any non-const method on a TfBits object while any other thread is +/// accessing it. +/// +/// There are certain members in this class that are mutable and modified in +/// const methods. However, since they are updated without being read and +/// all threads would update them with the same values in the case of a race +/// condition, the worst thing that can happen is redundant computation. +/// +/// Successive access to these members will result in read only access +/// patterns. +/// +/// All occurances are marked. +/// +class TfBits +{ +public: + + // View and iterator modes: All bits, all set bits, all unset bits. + enum Mode { All, AllSet, AllUnset }; + + /// Hash for TfBits. + /// + /// This hash is linear in time as it considers all the bits between + /// first set and last set. If you need a faster hash, see FastHash, + /// it may be suitable for your needs. + /// + struct Hash { + size_t operator()(TfBits const &bits) const { + return bits.GetHash(); + } + }; + + /// A hash functor for TfBits that is faster than Hash. + /// + /// This hash uses the number of bits in total, the number of bits + /// set, the first set and last set to compute the hash. + /// + struct FastHash { + size_t operator()(TfBits const &bits) const { + return TfHash::Combine( + bits.GetSize(), + bits.GetFirstSet(), + bits.GetLastSet(), + bits.GetNumSet()); + } + }; + + + /// Constructs a fixed size bit array, clears all bits. + /// + explicit TfBits(size_t num=0) + { + _bits = NULL; + _numWords = 0; + Resize(num); + ClearAll(); + } + + /// Constructs a fixed size bit array, with a range of bits set. + /// + TfBits(size_t num, size_t first, size_t last) + { + _bits = NULL; + _numWords = 0; + Resize(num); + + if (num == 0) { + ClearAll(); + } else if (first == 0 && last >= (num - 1)) { + SetAll(); + } else { + ClearAll(); + for (size_t i = first; i <= last; ++i) + Set(i); + } + } + + /// Copy-constructs a fixed size bit array. + /// + TfBits(const TfBits &rhs) + { + _num = rhs._num; + _numSet .Store(rhs._numSet.Load()); + _firstSet .Store(rhs._firstSet.Load()); + _lastSet .Store(rhs._lastSet.Load()); + _numWords = rhs._numWords; + _bits = _Alloc(_numWords); + + // This loop turns out to be faster than a memcpy. + for (size_t i = 0; i < _numWords; ++i) + _bits[i] = rhs._bits[i]; + } + + /// Move constructor. + /// + TfBits(TfBits &&rhs) : TfBits(0) + { + Swap(rhs); + } + + /// Destructor + /// + ~TfBits() + { + _Free(_bits, _numWords); + } + + /// Assignment operator + /// + TfBits &operator=(const TfBits &rhs) + { + // Early bail out. + if (this == &rhs) { + return *this; + } + + // Avoid free-ing and reallocing if we have the same size + if (_numWords != rhs._numWords) { + _Free(_bits, _numWords); + _bits = _Alloc(rhs._numWords); + } + + _num = rhs._num; + _numSet .Store(rhs._numSet.Load()); + _firstSet .Store(rhs._firstSet.Load()); + _lastSet .Store(rhs._lastSet.Load()); + _numWords = rhs._numWords; + + // This loop turns out to be faster than a memcpy. + for (size_t i = 0; i < _numWords; ++i) + _bits[i] = rhs._bits[i]; + + return (*this); + } + + /// Move assignment operator. + /// + TfBits &operator=(TfBits &&rhs) + { + if (this == &rhs) + return *this; + + Swap(rhs); + + return *this; + } + + /// Resizes the bit array, however, the bits are left uninitialized. + /// So you most likely want to call ClearAll(); or SetAll();. + /// + void Resize(size_t num) + { + if (_bits && _num == num) + return; + + _Free(_bits, _numWords); + + _num = num; + _numSet .Store(-1); + _firstSet .Store(-1); + _lastSet .Store(-1); + _numWords = (num + 63) >> 6; + _bits = _Alloc(_numWords); + + // By definition, the unused, trailing bits always needs to be + // initialized to 0 and all operations can assume they are 0. + + if (_numWords) + _bits[_numWords - 1] = 0; + } + + /// Resizes the size of the bit array while keeping the content. + /// + void ResizeKeepContent(size_t num) + { + if (num == _num) + return; + + //XXX: We could try to be fancy and not re-allocate in certain cases. + TfBits temp(num); + + // Figure out how much to copy. + size_t numWordsToCopy = TfMin(temp._numWords, _numWords); + + for(size_t i=0; i= rhs.GetSize(). This is more efficient than + /// padding \p rhs to the correct size beforehand. + /// + TF_API + void OrSubset(const TfBits &rhs); + + /// Provides a fast swap. + /// + void Swap(TfBits &rhs) + { + if (this == &rhs) + return; + + std::swap(_num, rhs._num); + + // Because Swap is a mutating operation, we do not require atomic + // updates to the set-bits members. + _numSet.NonAtomicSwap(rhs._numSet); + _firstSet.NonAtomicSwap(rhs._firstSet); + _lastSet.NonAtomicSwap(rhs._lastSet); + + if (_numWords == 1 && rhs._numWords == 1) { + + // Both sides use inline storage. + // + // We can just swap the inline data. Both _bits & rhs._bits will + // already point their respective inline storage. + + std::swap(_inlineData, rhs._inlineData); + + } else if (_numWords == 1) { + + // 'this' uses inline storage; 'rhs' uses heap-allocated storage. + // + // Transfer rhs's heap-allocated data to ourself and copy our inline + // data to rhs. We leave our _inlineData unchanged as it is now + // essentially garbage. + + _bits = rhs._bits; + rhs._inlineData = _inlineData; + rhs._bits = &rhs._inlineData; + + } else if (rhs._numWords == 1) { + + // 'rhs' uses inline storage; 'this' uses heap-allocated storage. + // + // Transfer our heap-allocated data to rhs and copy rhs's inline + // data to our inline storage. We leave rhs._inlineData unchanged + // as it is now essentially garbage. + + rhs._bits = _bits; + _inlineData = rhs._inlineData; + _bits = &_inlineData; + + } else { + + // Both sides use heap-allocated storage. + // + // We can just swap the _bits pointers and ignore _inlineData. + + std::swap(_bits, rhs._bits); + + } + + // Swap _numWords only after swapping data. Otherwise, reasoning about + // whose _bits & _inlineData to update gets confusing. + std::swap(_numWords, rhs._numWords); + } + + // Swap overload for unqualified calls in generic code. + // + friend void swap(TfBits &lhs, TfBits &rhs) { + lhs.Swap(rhs); + } + + /// Clears all bits to zero. + /// + void ClearAll() + { + memset(_bits, 0x00, _numWords << 3); + _numSet.Store(0); + _firstSet.Store(_num); + _lastSet.Store(_num); + } + + /// Sets all bits to one. + /// + void SetAll() + { + memset(_bits, 0xff, _numWords << 3); + _numSet.Store(_num); + _firstSet.Store(0); + _lastSet.Store(_num > 0 ? _num-1 : 0); + + // Clear out unused bits... + _ClearTrailingBits(); + } + + /// Clears bit # index to zero. + /// + void Clear(size_t index) + { + TF_AXIOM(index < _num); + + uint64_t mask = 1UL << (index & 63); + + if (_bits[index >> 6] & mask) + { + const size_t numSet = _numSet.Load(); + TF_AXIOM(numSet == size_t(-1) || numSet > 0); + + if (numSet != size_t(-1)) + _numSet.Decrement(); + if (index == _firstSet.Load()) + _firstSet.Store(-1); + if (index == _lastSet.Load()) + _lastSet.Store(-1); + + _bits[index >> 6] ^= mask; + } + } + + /// Sets bit # index to one. + /// + void Set(size_t index) + { + TF_AXIOM(index < _num); + + uint64_t mask = 1UL << (index & 63); + + if (!(_bits[index >> 6] & mask)) + { + const size_t numSet = _numSet.Load(); + TF_AXIOM(numSet == size_t(-1) || numSet < _num); + + if (numSet != size_t(-1)) + _numSet.Increment(); + if (index < _firstSet.Load()) + _firstSet.Store(index); + const size_t lastSet = _lastSet.Load(); + if (index > lastSet || lastSet == _num) + _lastSet.Store(index); + + _bits[index >> 6] |= mask; + } + } + + /// Assigns val to bit # index. + /// + void Assign(size_t index, bool val) + { + if (val) + Set(index); + else + Clear(index); + } + + /// Returns true, if bit # index is set. + /// + bool IsSet(size_t index) const + { + TF_AXIOM(index < _num); + + return _bits[index >> 6] & (1UL << (index & 63)); + } + + /// Finds the next set bit that has a higher or equal index than index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + size_t FindNextSet(size_t index) const + { + if (ARCH_UNLIKELY(index >= _num)) { + return _num; + } + + size_t startBit = index & 63; + + // Early out for bit set... + if (_bits[index >> 6] & (1UL << startBit)) + return index; + + return _FindNextSet(index, startBit); + } + + /// Finds the prev set bit that has a lower or equal index than index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + size_t FindPrevSet(size_t index) const + { + if (ARCH_UNLIKELY(index >= _num)) { + return _num; + } + + size_t startBit = index & 63; + + // Early out for bit set... + if (_bits[index >> 6] & (1UL << startBit)) + return index; + + return _FindPrevSet(index, startBit); + } + + /// Finds the next unset bit that has a higher or equal index than index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + size_t FindNextUnset(size_t index) const + { + if (ARCH_UNLIKELY(index >= _num)) { + return _num; + } + + size_t startBit = index & 63; + + // Early out for bit set... + if (!(_bits[index >> 6] & (1UL << startBit))) + return index; + + return _FindNextUnset(index, startBit); + } + + /// Returns the size of the bit array, ie. the # of bits it can hold. + /// + size_t GetSize() const + { + return _num; + } + + /// Returns \c true if this bit array is empty, i.e. it is of size zero. + /// + bool IsEmpty() const + { + return _num == 0; + } + + /// Returns the index of the first bit set in the bit array. If no bits + /// are set, the return value is 'GetSize()'. + /// + size_t GetFirstSet() const + { + // See comment at top of this file on why this is thread safe. + size_t firstSet = _firstSet.Load(); + if (firstSet == size_t(-1)) { + firstSet = FindNextSet(0); + _firstSet.Store(firstSet); + } + + return firstSet; + } + + /// Returns the index of the last bit set in the bit array. If no bits + /// are set, the return value is 'GetSize()'. + /// + size_t GetLastSet() const + { + // See comment at top of this file on why this is thread safe. + size_t lastSet = _lastSet.Load(); + if (lastSet == size_t(-1)) { + // Also works if _num is 0. + lastSet = FindPrevSet(_num-1); + _lastSet.Store(lastSet); + } + + return lastSet; + } + + /// Returns the number of bits currently set in this array. + /// + size_t GetNumSet() const + { + // See comment at top of this file on why this is thread safe. + size_t numSet = _numSet.Load(); + if (numSet == size_t(-1)) { + numSet = _CountNumSet(); + _numSet.Store(numSet); + } + + return numSet; + } + + /// Returns true, if all the bits in this bit array are set. + /// + bool AreAllSet() const + { + // Note that "not IsAnyUnset();" is not cached because FindNextUnset(0); + // isn't. Therefore we use GetNumSet() which is cached. + return GetNumSet() == GetSize(); + } + + /// Returns true, if all the bits in this bit array are unset. + /// + bool AreAllUnset() const + { + return !IsAnySet(); + } + + /// Returns true, if there is at least a single set bit. + /// + bool IsAnySet() const + { + return GetFirstSet() < GetSize(); + } + + /// Returns true, if there is at least a single unset bit. + /// + bool IsAnyUnset() const + { + return !AreAllSet(); + } + + /// Returns true if the set bits in this bit array are contiguous. + /// + /// Note: This returns false if there are no set bits. + /// + bool AreContiguouslySet() const + { + return GetNumSet() == GetLastSet() - GetFirstSet() + 1; + } + + /// Returns the amount of memory this object holds on to. + /// + size_t GetAllocatedSize() const + { + size_t memUsed = sizeof(TfBits); + + // Note that up to 64 bits are inlined, cf. _Alloc(); + if (_numWords > 1) + memUsed += _numWords << 3; + + return memUsed; + } + + /// Returns a hash for this instance. + /// + TF_API + size_t GetHash() const; + + /// Returns a string representing the bits for debugging with bits + /// ordered from left to right with increasing indices. + /// + TF_API + std::string GetAsStringLeftToRight() const; + + /// Returns a string representing the bits for debugging with bits + /// ordered from right to left with increasing indices. + /// + TF_API + std::string GetAsStringRightToLeft() const; + + /// \name Operators + /// @{ + + /// Returns true if this == \p rhs. + /// + TF_API + bool operator==(const TfBits &rhs) const; + + /// Returns true if this != \p rhs. + /// + bool operator!=(const TfBits &rhs) const + { + return !(*this == rhs); + } + + /// Ands these bits with the \p rhs bits. + /// + /// The resulting bit set is the intersection of the two bit sets. + /// + TF_API + TfBits &operator&=(const TfBits &rhs); + + /// Returns these bits and'ed with \p rhs. + /// + TfBits operator&(const TfBits &rhs) const + { + TfBits r(*this); + r &= rhs; + return r; + } + + /// Ors these bits with the \p rhs bits. + /// + /// The resulting bit set is the union of the two bit sets. + /// + TF_API + TfBits &operator|=(const TfBits &rhs); + + /// Returns these bits or'ed with \p rhs. + /// + TfBits operator|(const TfBits &rhs) const + { + TfBits r(*this); + r |= rhs; + return r; + } + + /// Xors these bits with the \p rhs bits. + /// + /// The resulting bit set is the union of the two bit sets minus the + /// intersection of the two bit sets. + /// + TF_API + TfBits &operator^=(const TfBits &rhs); + + /// Returns these bits xor'ed with \p rhs. + /// + TfBits operator^(const TfBits &rhs) const + { + TfBits r(*this); + r ^= rhs; + return r; + } + + /// Removes all bits in the \p rhs bits from these bits. + /// + /// The resulting bit set is the asymmetric set difference of + /// the two bit sets. + /// + TF_API + TfBits &operator-=(const TfBits &rhs); + + /// Flips all bits. + /// + /// The resulting bit set is the complement of this bit set. + /// + TF_API + TfBits &Complement(); + + /// Returns bit at \p index. + /// + bool operator[](size_t index) const + { + return IsSet(index); + } + + /// @} + + + /// Returns true if the result of the intersection with \p rhs would be + /// non-zero. + /// + /// This method can be used for efficiency because it doesn't perform + /// the full AND operation on a copy, and it can return early. + /// + bool HasNonEmptyIntersection(const TfBits &rhs) const + { + TF_AXIOM(_num == rhs._num); + + // Limit the bit operations to where we have bits set in both of + // the two sets. + size_t firstSet = GetFirstSet(); + size_t rhsFirstSet = rhs.GetFirstSet(); + + // Nothing to compare if either set is empty. + if (firstSet < _num && rhsFirstSet < _num) + { + firstSet = TfMax(firstSet, rhsFirstSet); + size_t lastSet = TfMin(GetLastSet(), rhs.GetLastSet()); + + if (firstSet <= lastSet) + { + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + // Have to compare the bits. + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + // Note: This assumes trailing bits in last word to be zero. + if (uint64_t word = *p0) + if (word & *p1) + return true; + p0++; + p1++; + } + } + } + + return false; + } + + /// Returns true if the result of an asymmetric set different is non-zero. + /// This is the equivalent to computing: + /// return (this - rhs).GetNumSet() != 0 + /// but avoids creating temporary copies. + /// + bool HasNonEmptyDifference(const TfBits &rhs) const + { + TF_AXIOM(_num == rhs._num); + + // Limit the bit operations to where we have bits set in the first set. + size_t firstSet = GetFirstSet(); + + // The difference is empty if the first set is empty. + if (firstSet < _num) + { + size_t lastSet = GetLastSet(); + size_t rhsFirstSet = rhs.GetFirstSet(); + size_t rhsLastSet = rhs.GetLastSet(); + + // Check for trivial non-empty difference (we know that the first + // set is not empty). + if (firstSet < rhsFirstSet || lastSet > rhsLastSet || + firstSet > rhsLastSet || lastSet < rhsFirstSet || + GetNumSet() > rhs.GetNumSet()) + return true; + + size_t offset = firstSet >> 6; + size_t numWords = (lastSet >> 6) + 1 - offset; + + // Have to compare the bits. + uint64_t *p0 = _bits + offset; + uint64_t *p1 = rhs._bits + offset; + + for(size_t n=numWords; n>0; n--) + { + // Note: This assumes trailing bits in last word to be the same. + if (uint64_t word = *p0) + if (word & ~*p1) + return true; + p0++; + p1++; + } + } + + return false; + } + + /// Returns true if this bit array contains \p rhs by computing: + /// (rhs - this).GetNumSet() == 0. + /// + /// Ie. it will return true if all bits of \p rhs are also set in this. + /// + bool Contains(const TfBits &rhs) const + { + return !rhs.HasNonEmptyDifference(*this); + } + + /// Iterator support. + /// + template + class View + { + public: + class const_iterator + { + public: + using iterator_category = std::forward_iterator_tag; + using value_type = const size_t; + using reference = const size_t &; + using pointer = const size_t *; + using difference_type = const size_t; + + const_iterator() + : _bits(NULL), _index(0) {} + + reference operator*() const { return dereference(); } + pointer operator->() const { return &(dereference()); } + + const_iterator& operator++() { + increment(); + return *this; + } + + const_iterator operator++(int) { + const_iterator r(*this); + increment(); + return r; + } + + bool operator==(const const_iterator& rhs) const { + return equal(rhs); + } + + bool operator!=(const const_iterator& rhs) const { + return !equal(rhs); + } + + private: + + friend class View; + + // Ctor. + const_iterator( + const TfBits *bits, size_t index) + : _bits(bits), _index(index) {} + + bool equal(const const_iterator &rhs) const { + return _bits == rhs._bits && _index == rhs._index; + } + + void increment() { + ++_index; + + if (mode == AllSet) + _index = _bits->FindNextSet(_index); + else if (mode == AllUnset) + _index = _bits->FindNextUnset(_index); + } + + const size_t &dereference() const { + return _index; + } + + private: + + // The bits being iterated over. + const TfBits *_bits; + + // The index. + size_t _index; + }; + + // Support for TF_FOR_ALL. + typedef const_iterator iterator; + + const_iterator begin() const { + size_t start = 0; + if (mode == AllSet) + start = _bits->GetFirstSet(); + else if (mode == AllUnset) + start = _bits->FindNextUnset(0); + + return const_iterator(_bits, start); + } + + const_iterator end() const { + return const_iterator(_bits, _bits->GetSize()); + } + + /// Return true, if the view is empty. + /// + bool IsEmpty() const { + return begin() == end(); + } + + private: + + // The TfBits can create new views. + friend class TfBits; + + // Ctor. + View(const TfBits *bits) + : _bits(bits) {} + + const TfBits *_bits; + }; + + using AllView = View; + using AllSetView = View; + using AllUnsetView = View; + + /// Returns an iteratable view for the bits that steps over all bits. + /// + AllView GetAllView() const { + return AllView(this); + } + + /// Returns an iteratable view for the bits that steps over all set bits. + /// + AllSetView GetAllSetView() const { + return AllSetView(this); + } + + /// Returns an iteratable view for the bits that steps over all unset bits. + /// + AllUnsetView GetAllUnsetView() const { + return AllUnsetView(this); + } + +// ----------------------------------------------------------------------------- + +private: + + // This counts the number of set bits. + TF_API + size_t _CountNumSet() const; + + // This is a helper method for FindNextSet so that we don't have to inline + // the whole method. This gives us the best compromise for speed and code + // size. + TF_API + size_t _FindNextSet(size_t index, size_t startBit) const; + + // This is a helper method for FindPrevSet so that we don't have to inline + // the whole method. This gives us the best compromise for speed and code + // size. + TF_API + size_t _FindPrevSet(size_t index, size_t startBit) const; + + // This is a helper method for FindNextUnset so that we don't have to inline + // the whole method. This gives us the best compromise for speed and code + // size. + TF_API + size_t _FindNextUnset(size_t index, size_t startBit) const; + + // This is a helper method that clear out unused bits in the last word of + // the bit array. + TF_API + void _ClearTrailingBits(); + + // Helper that performs the or operation on these bits where rhs must have + // same or less # of bits. + TF_API + void _Or(const TfBits &rhs); + + // Allocates the bits array with \p numWords words. + // If \p numWords is 0, NULL is returned. If \p numWords is 1, inline + // data will be used (to avoid an extra malloc). + // Returned memory must be freed with _Free(). + + uint64_t *_Alloc(size_t numWords) + { + if (!numWords) + return NULL; + + if (numWords == 1) + return &_inlineData; + + return new uint64_t[numWords]; + } + + // Frees data allocated with _Alloc(). + static void _Free(uint64_t *data, size_t numWords) + { + if (numWords > 1) + delete [] data; + } + +private: + + // # of bits in this array. + size_t _num; + + // Wrapper class for lazily-initialized size_t members. + // + // These members only require relaxed ordering and we want to avoid + // unintentionally scribbling mfence all over the place with the + // sequentially consistent std::atomic operator=(size_t). + class _RelaxedAtomicSize_t + { + public: + _RelaxedAtomicSize_t() + : _n{} + {} + + explicit _RelaxedAtomicSize_t(size_t n) + : _n{n} + {} + + void Increment() { + _n.fetch_add(1, std::memory_order_relaxed); + } + + void Decrement() { + _n.fetch_sub(1, std::memory_order_relaxed); + } + + size_t Load() const { + return _n.load(std::memory_order_relaxed); + } + + void Store(size_t n) { + _n.store(n, std::memory_order_relaxed); + } + + // Note, it's not possible to do an atomic swap of two memory + // locations. Provide a non-atomic swap operation to be used when + // no concurrent operations may be taking place. See TfBits::Swap. + void NonAtomicSwap(_RelaxedAtomicSize_t &other) { + const size_t n = _n.load(std::memory_order_relaxed); + const size_t o = other._n.load(std::memory_order_relaxed); + _n.store(o, std::memory_order_relaxed); + other._n.store(n, std::memory_order_relaxed); + } + + private: + std::atomic _n; + }; + + // See comment at top of this file on why the usage of _numSet, _firstSet + // and _lastSet is thread safe. + + // # of bits set in this array (set to size_t(-1) when invalid). + mutable _RelaxedAtomicSize_t _numSet; + + // Cached first and last set bits (set to size_t(-1) when invalid). + mutable _RelaxedAtomicSize_t _firstSet; + mutable _RelaxedAtomicSize_t _lastSet; + + // Size in uint64_t of the bits array. + size_t _numWords; + + // Pointer to the actual data. + uint64_t *_bits; + + // Data used if _num <= 64. + uint64_t _inlineData; +}; + +// Specialize this template so TfIterator knows to retain a copy when iterating. +template<> +struct Tf_ShouldIterateOverCopy< TfBits::AllView > : + std::true_type +{ +}; + +template<> +struct Tf_ShouldIterateOverCopy< TfBits::AllSetView > : + std::true_type +{ +}; + +template<> +struct Tf_ShouldIterateOverCopy< TfBits::AllUnsetView > : + std::true_type +{ +}; + +//! \brief Output a TfBits, as a stream of 0s and 1s. +// \ingroup group_tf_DebuggingOutput +TF_API std::ostream & operator<<(std::ostream &out, const TfBits & bits); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/base/tf/compressedBits.cpp b/pxr/base/tf/compressedBits.cpp new file mode 100644 index 0000000000..a410556559 --- /dev/null +++ b/pxr/base/tf/compressedBits.cpp @@ -0,0 +1,287 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/base/tf/compressedBits.h" +#include "pxr/base/tf/bits.h" + +#include "pxr/base/arch/hash.h" +#include "pxr/base/tf/stringUtils.h" + +#include + +PXR_NAMESPACE_OPEN_SCOPE + +TfCompressedBits::TfCompressedBits(const TfBits &bits) : + _num(bits.GetSize()) +{ + if (bits.GetSize() == 0) { + _runningBit = 0; + _platforms.PushBack(0); + return; + } + + bool set = bits.IsSet(0); + _runningBit = set ? 1 : 0; + + size_t i = 0; + while (i < bits.GetSize()) { + size_t next = set ? + bits.FindNextUnset(i + 1) : + bits.FindNextSet(i + 1); + + _platforms.PushBack(next - i); + + set = !set; + i = next; + } +} + +size_t +TfCompressedBits::GetHash() const +{ + if (_num == 0) { + return 0; + } + + // Hash the running bit and number of platforms. + uint64_t seed = TfHash::Combine( + _runningBit, + _platforms.GetNum()); + + // Hash all the platform data. + return ArchHash64( + (const char*)&(_platforms[0]), + _platforms.GetNum() * sizeof(_WordType), + seed); +} + +std::string +TfCompressedBits::GetAsStringLeftToRight() const +{ + std::string res; + + uint8_t bit = _runningBit; + for (size_t i = 0; i < _platforms.GetNum(); ++i) { + for (size_t j = 0; j < _platforms[i]; ++j) { + res.push_back('0' + bit); + } + bit = 1 - bit; + } + + return res; +} + +std::string +TfCompressedBits::GetAsStringRightToLeft() const +{ + std::string res; + + uint8_t bit = _runningBit; + if ((_platforms.GetNum() & 1) == 0) { + bit = 1 - bit; + } + + for (int i = _platforms.GetNum() - 1; i >= 0; --i) { + for (size_t j = 0; j < _platforms[i]; ++j) { + res.push_back('0' + bit); + } + bit = 1 - bit; + } + + return res; +} + +std::string +TfCompressedBits::GetAsRLEString() const +{ + std::string res; + + // If the length of the mask is <= 4 bits we just print them left to + // right. This makes a lot of the simple unit tests much easier to + // read. + if (_num == 0) { + return res; + } else if (_num <= 4) { + return GetAsStringLeftToRight(); + } + + uint8_t bit = _runningBit; + res = TfIntToString(bit) + "x" + TfIntToString(_platforms[0]); + bit = 1 - bit; + + for (size_t i = 1; i < _platforms.GetNum(); ++i) { + res.push_back('-'); + res += TfIntToString(bit); + res.push_back('x'); + res += TfIntToString(_platforms[i]); + bit = 1 - bit; + } + + return res; +} + +static bool +_IsWhiteSpace(const char c) +{ + // These characters are considered whitespace in the string representation + // of a compressed bitset. + return c == ' ' || c == '\n' || c == '\r' || c == '\t'; +} + +static std::vector +_TokenizeRLEString(const std::string &source) +{ + // There are two types of token delimiters, and we toggle between the two. + // We first expect a 'x' delimiter, followed by a '-' delimiter, followed + // by another 'x', and so forth. + const std::array delimiters = { 'x', '-' }; + uint32_t nextDelimiterIdx = 0; + + // The resulting tokens. A platform is comprised of two tokens, a bit value + // (either zero or one), followed by a platform length. + std::vector tokens(1, 0); + + // Iterate over the source string and build a vector of tokens for the + // platforms representing the bitset. + for (const char c : source) { + + // Digits encode the integer value of the current token. + if (c >= '0' && c <= '9') { + const uint32_t digit = c - '0'; + tokens.back() = tokens.back() * 10 + digit; + } + + // Whitespace is ignored entirely. + else if (_IsWhiteSpace(c)) { + continue; + } + + // Delimiters constitute the beginning of a new token, but the next + // expected delimiter is toggled between 'x' and '-'. + else if (c == delimiters[nextDelimiterIdx]) { + nextDelimiterIdx = (nextDelimiterIdx + 1) % delimiters.size(); + tokens.push_back(0); + } + + // Reset the resulting vector of tokens and break the loop, if an + // unexpected character is encountered. This could be a non-digit, non- + // whitespace character, or an unexpected delimiter. + else { + tokens.clear(); + break; + } + } + + return tokens; +} + +static TfCompressedBits +_FromRLETokens(const std::vector &tokens) +{ + // The number of tokens must be even, because each platform is comprised of + // two tokens: A bit value (zero or one), and a platform length. + if (tokens.size() & 1) { + return TfCompressedBits(); + } + + // Iterate over the tokens in pairs, extract the bit value and platform + // length, and append a new platform to the resulting bitset. + TfCompressedBits result; + for (size_t i = 0; i < tokens.size(); i += 2) { + const uint32_t bit = tokens[i]; + const uint32_t length = tokens[i + 1]; + + // In order to be a valid representation, the bit value must be zero or + // one, and the platform length must be greater than 0. + if (bit > 1 || length == 0) { + return TfCompressedBits(); + } + + result.Append(length, bit); + } + + return result; +} + +static TfCompressedBits +_FromBinaryRepresentation(const std::string &source) +{ + TfCompressedBits result; + + // Iterate over the string and treat it as a binary representation, i.e. a + // string of zeros and ones. + for (const char c : source) { + + // Zeros and ones will be appended to the bitset. + if (c == '0' || c == '1') { + const bool bit = c - '0'; + result.Append(1, bit); + } + + // White space will be ignored entirely. + else if (_IsWhiteSpace(c)) { + continue; + } + + // Any other character is unexpected and constitutes an invalid + // representation. + else { + return TfCompressedBits(); + } + } + + return result; +} + +TfCompressedBits +TfCompressedBits::FromString(const std::string &source) +{ + TfCompressedBits result; + + // Assume the string is a RLE representation of the bits. Let's tokenize it + // (i.e. interleaved pairs of platform value bits, and platform lengths.) + std::vector tokens = _TokenizeRLEString(source); + + // If no tokens have been found, the source string is considered an empty + // representation. + if (tokens.empty()) { + return result; + } + + // Build a compressed bitset from the RLE tokens. + result = _FromRLETokens(tokens); + + // If this returns an empty bitset, maybe the string is encoded as a binary + // representation, i.e. a string of zeros and ones. + if (result.GetSize() == 0) { + result = _FromBinaryRepresentation(source); + } + + // Return the result from the conversion, or an empty representation if + // the conversion failed, due to an invalid string representation. + return result; +} + +void +TfCompressedBits::Decompress(TfBits *bits) const +{ + bits->Resize(_num); + bits->ClearAll(); + + size_t bitIndex = 0; + bool bitValue = _runningBit == 1; + for (size_t i = 0; i < _platforms.GetNum(); ++i) { + _WordType numBits = _platforms[i]; + for (_WordType j = 0; j < numBits; ++j) { + bits->Assign(bitIndex, bitValue); + ++bitIndex; + } + bitValue = !bitValue; + } +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/base/tf/compressedBits.h b/pxr/base/tf/compressedBits.h new file mode 100644 index 0000000000..3b0be6d654 --- /dev/null +++ b/pxr/base/tf/compressedBits.h @@ -0,0 +1,1962 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_BASE_TF_COMPRESSED_BITS_H +#define PXR_BASE_TF_COMPRESSED_BITS_H + +#include "pxr/base/arch/align.h" +#include "pxr/base/tf/api.h" +#include "pxr/base/tf/diagnostic.h" +#include "pxr/base/tf/hash.h" +#include "pxr/base/tf/iterator.h" +#include "pxr/base/tf/staticData.h" + +#include +#include +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// Forward Declarations +/// +class TfBits; + +/// \class TfCompressedBits +/// +/// \brief Fast, compressed bit array which is capable of performing logical +/// operations without first decompressing the internal data representation. +/// +/// The internal data compression is based on a form of RLE, where words are +/// used to indicate the number of bits set to the same value. Each subsequent +/// word denotes that the bit value has changed and a "runningBit" is set +/// internally, in order to denote the bit value for the first word. +/// +/// Internally, a bitset like this: +/// +/// 111000101000 +/// +/// Will be represented as: +/// +/// 1 331113 +/// +/// i.e., the running bit is '1', and there are 3 of those, followed by 3 +/// zeroes, followed by 1 one, followed by 1 zero, followed by 1 one, followed +/// by three zeroes. Each word is called a "platform". +/// +/// Compressed bits are very fast when used for logical operations (conjugate, +/// and, or, xor, etc.), and when iterated over. Contains and Overlaps are also +/// very fast. The representation is lightweight in memory and hence very cache +/// efficient. +/// +/// Whenever indexing, setting and resetting of seemingly random bits is a +/// requirement, however, TfBits will perform better, since finding a specific +/// bit requires a linear search. +/// +class TfCompressedBits +{ +private: + // Type of one word stored in the word array + typedef uint32_t _WordType; + + // Lightweight, re-allocating array type optimized for native, word data. + // + // Note, this is not a std::vector, because we really want a container, + // which is optimized for native types, allowing fast memcpy capabilities, + // and providing local storage optimizations. + class _WordArray + { + public: + static const uint32_t LOCAL_SIZE = 6; + + _WordArray() : + _data(_local), + _numAllocated(LOCAL_SIZE), + _num(0) {} + + _WordArray(const _WordArray &rhs) : + _data(_local), + _numAllocated(LOCAL_SIZE), + _num(rhs._num) { + _Duplicate(rhs); + } + + ~_WordArray() { + _Deallocate(); + } + + _WordArray& operator=(const _WordArray &rhs) { + if (this == &rhs) { + return *this; + } + + _Duplicate(rhs); + return *this; + } + + // Clear all words + void Clear() { + _num = 0; + } + + // Add a word (may cause re-allocation) + void PushBack(_WordType value) { + // Reallocate? + if (_num >= _numAllocated) { + _Reallocate(); + } + + // PushBack + _data[_num] = value; + ++_num; + } + + // Remove a word + void PopBack() { + --_num; + } + + // Remove multiple words + void PopBackNum(uint32_t popNum) { + _num -= popNum; + } + + // Move this representation into rhs. This representation will be + // invalid after this operation. + void MoveInto(_WordArray &rhs) { + rhs._numAllocated = _numAllocated; + rhs._num = _num; + + rhs._Deallocate(); + + // If the data is stored locally, copy it + if (_IsStoredLocally()) { + // The compiler will unroll this loop, making this faster + // than memcpy! + for (size_t i = 0; i < LOCAL_SIZE; ++i) { + rhs._data[i] = _data[i]; + } + } + + // Otherwise, just assign pointers + else { + rhs._data = _data; + + // Set our pointer back to local, so we won't deallocate the + // storage, which is now owned by rhs. + _data = _local; + _numAllocated = LOCAL_SIZE; + } + } + + // Swap two representations + void Swap(_WordArray &rhs) { + if (!_IsStoredLocally() && !rhs._IsStoredLocally()) { + std::swap(_data, rhs._data); + std::swap(_numAllocated, rhs._numAllocated); + std::swap(_num, rhs._num); + } else { + // Fall back to a copy. This could be optimized. + std::swap(*this, rhs); + } + } + + // Index operator + _WordType &operator[](size_t index) { + return _data[index]; + } + + const _WordType &operator[](size_t index) const { + return _data[index]; + } + + // Returns the number of words stored (not allocated) + uint32_t GetNum() const { + return _num; + } + + // Return the number of allocated words + uint32_t GetNumAllocated() const { + return _numAllocated; + } + + // Return a pointer to the first word + const _WordType *Begin() const { + return _data; + } + + // Return a pointer one past the end of the array. + const _WordType *End() const { + return _data + _num; + } + + // Returns the first word + _WordType &Front() { + return _data[0]; + } + + const _WordType &Front() const { + return _data[0]; + } + + // Returns the last word + _WordType &Back() { + return _data[_num - 1]; + } + + const _WordType &Back() const { + return _data[_num - 1]; + } + + private: + bool _IsStoredLocally() const { + return _data == _local; + } + + void _Deallocate() { + if (!_IsStoredLocally()) { + delete[] _data; + _data = _local; + } + } + + void _Duplicate(const _WordArray &rhs) { + if (rhs._num > 0) { + if (_numAllocated < rhs._num) { + _Deallocate(); + _data = new _WordType[rhs._numAllocated]; + _numAllocated = rhs._numAllocated; + } + + if (rhs._IsStoredLocally()) { + // The compiler will unroll this loop, making this faster + // than memcpy! + for (size_t i = 0; i < LOCAL_SIZE; ++i) { + _data[i] = rhs._data[i]; + } + } else { + memcpy(_data, rhs._data, sizeof(_WordType) * rhs._num); + } + } + + _num = rhs._num; + } + + void _Reallocate() { + _numAllocated <<= 1; + _WordType *newData = new _WordType[_numAllocated]; + memcpy(newData, _data, sizeof(_WordType) * _num); + _Deallocate(); + _data = newData; + } + + // Pointer to the data + _WordType *_data; + + // Local storage optimization + _WordType _local[LOCAL_SIZE]; + + // Number of words allocated + uint32_t _numAllocated; + + // Number of words stored + uint32_t _num; + }; + +public: + + // View and iterator modes: All bits, all set bits, all unset bits, + // platforms (iterator provides platform size and value) + enum class Mode { All, AllSet, AllUnset, Platforms }; + + /// Hash for TfCompressedBits. + /// + /// This hash is linear in time as it considers all the words between. + /// If you need a constant-time hash, see FastHash, it may be suitable for + /// your needs. + /// + struct Hash { + size_t operator()(const TfCompressedBits &bits) const { + return bits.GetHash(); + } + }; + + /// A hash functor for TfCompressedBits that is faster than Hash. + /// + /// This hash can be computed in constant time because it only uses a + /// fixed subset of data: the number of bits in total, the running bit, + /// the number of words and the first cache line of words. + /// + struct FastHash { + size_t operator()(const TfCompressedBits &bits) const { + if (bits.GetSize() == 0) { + return 0; + } + + // Hash the running bit and number of platforms. + size_t hash = TfHash::Combine( + bits.GetSize(), + bits._runningBit, + bits._platforms.GetNum()); + + // Hash a single cache line of platform data. + const uint32_t n = std::min( + bits._platforms.GetNum(), + ARCH_CACHE_LINE_SIZE / sizeof(uint32_t)); + for (uint32_t i = 0; i < n; ++i) { + hash = TfHash::Combine(hash, bits._platforms[i]); + } + + return hash; + } + }; + + /// Constructs a fixed size bit array, clears all bits. + /// + explicit TfCompressedBits(size_t num = 0) : + _num(num), + _runningBit(0) { + _platforms.PushBack(num); + } + + /// Constructs a fixed size bit array, with a range of bits set. + /// + explicit TfCompressedBits(size_t num, size_t first, size_t last) : + _num(num), + _runningBit(0) { + + // Empty bitset + if (num == 0) { + _platforms.PushBack(0); + return; + } + + // Range error (clear the whole bitset): + if (!TF_VERIFY(first < num && last < num && first <= last)) { + _platforms.PushBack(num); + return; + } + + size_t trailingZeroes = 0; + const size_t range = last - first + 1; + if (first == 0) { + _runningBit = 1; + _platforms.PushBack(range); + trailingZeroes = num - range; + } else { + _platforms.PushBack(first); + _platforms.PushBack(range); + trailingZeroes = num - last - 1; + } + + // Only push trailing zeroes, if there are any. Otherwise the + // _platforms array will be in an inconsistent state (containing + // platforms of size 0, when _num != 0). + if (trailingZeroes != 0) { + _platforms.PushBack(trailingZeroes); + } + } + + /// Copy-constructs a fixed size bit array. + /// + TfCompressedBits(const TfCompressedBits &rhs) : + _platforms(rhs._platforms), + _num(rhs._num), + _runningBit(rhs._runningBit) {} + + /// Copy-construct a fixed sized bit array, from the complement of the + /// \p rhs bitset. + /// + enum ComplementTagType { ComplementTag }; + TfCompressedBits(const TfCompressedBits &rhs, ComplementTagType) : + _platforms(rhs._platforms), + _num(rhs._num), + _runningBit(1 - rhs._runningBit) { + if (_num == 0) { + _runningBit = 0; + } + } + + /// Construct a TfCompressedBits array from a TfBits array. + /// + TF_API + explicit TfCompressedBits(const TfBits &bits); + + /// Move Constructor + /// + TfCompressedBits(TfCompressedBits &&rhs) : + _num(rhs._num), + _runningBit(rhs._runningBit) { + rhs._platforms.MoveInto(_platforms); + rhs._platforms.Clear(); + rhs._num = 0; + rhs._runningBit = 0; + } + + /// Destructor + /// + ~TfCompressedBits() {} + + /// Assignment operator + /// + TfCompressedBits &operator=(const TfCompressedBits &rhs) { + if (this == &rhs) { + return *this; + } + + _platforms = rhs._platforms; + _num = rhs._num; + _runningBit = rhs._runningBit; + + return *this; + } + + /// Move assignment operator. + /// + TfCompressedBits &operator=(TfCompressedBits &&rhs) { + if (this == &rhs) { + return *this; + } + + _num = rhs._num; + _runningBit = rhs._runningBit; + rhs._platforms.MoveInto(_platforms); + rhs._platforms.Clear(); + rhs._num = 0; + rhs._runningBit = 0; + + return *this; + } + + /// Resize the bitset, while keeping the contents, unless trimmed. + /// + void ResizeKeepContents(size_t num) { + if (_num == num) { + return; + } + + // Reduce size to 0 + if (num == 0) { + _platforms.Clear(); + _platforms.PushBack(0); + _runningBit = 0; + _num = 0; + return; + } + + // Grow + if (_num < num) { + if ((1u - _runningBit) == (_platforms.GetNum() & 1u)) { + _platforms.Back() += (num - _num); + } else { + _platforms.PushBack(num - _num); + } + } + + // Shrink + else if (_num > num) { + uint32_t diff = _num - num; + while (_platforms.Back() <= diff) { + diff -= _platforms.Back(); + _platforms.PopBack(); + } + _platforms.Back() -= diff; + } + + _num = num; + } + + /// Provides a fast swap. + /// + void Swap(TfCompressedBits &rhs) { + std::swap(_num, rhs._num); + std::swap(_runningBit, rhs._runningBit); + _platforms.Swap(rhs._platforms); + } + + /// Clears all bits to zero. + /// + void ClearAll() { + if (_num <= 0 || (_runningBit == 0 && _platforms.GetNum() == 1)) { + return; + } + + _runningBit = 0; + _platforms.Clear(); + _platforms.PushBack(_num); + } + + /// Sets all bits to one. + /// + void SetAll() { + if (_num <= 0 || (_runningBit == 1 && _platforms.GetNum() == 1)) { + return; + } + + _runningBit = 1; + _platforms.Clear(); + _platforms.PushBack(_num); + } + + /// Clears bit # index to zero. + /// + /// Note: This is a slow operation on TfCompressedBits! + /// + void Clear(size_t index) { + if (!TF_VERIFY(index < _num)) { + return; + } + + TfCompressedBits tmp(_num, index, index); + tmp.Complement(); + *this &= tmp; + } + + /// Sets bit # index to zero. + /// + /// Note: This is a slow operation on TfCompressedBits! + /// + void Set(size_t index) { + if (!TF_VERIFY(index < _num)) { + return; + } + + TfCompressedBits tmp(_num, index, index); + *this |= tmp; + } + + /// Sets the bit within the range of first and last. + /// + /// Note: This is a slow operation on TfCompressedBits! + /// + void SetRange(size_t first, size_t last) { + // Range constructor does error checking + TfCompressedBits tmp(_num, first, last); + *this |= tmp; + } + + /// Append a number of bits with the given \p value to this bitset. + /// This also increases the size of the bitset by the number of bits added. + /// + void Append(size_t num, bool value) { + if (num == 0) { + return; + } + + if (_num == 0) { + _platforms[0] = num; + _runningBit = value; + _num = num; + return; + } + + const bool lastValue = _runningBit == (_platforms.GetNum() & 1); + if (value == lastValue) { + _platforms.Back() += num; + } else { + _platforms.PushBack(num); + } + + _num += num; + } + + /// Assigns val to bit # index. + /// + void Assign(size_t index, bool value) { + if (value) { + Set(index); + } else { + Clear(index); + } + } + + /// Shift this bitset a given number of \p bits to the right, and extend to + /// the left with zeroes. + /// + void ShiftRight(size_t bits) { + if (_num == 0 || bits == 0) { + return; + } + + // If the running bit is 0, just increment the first word (num zeroes) + if (_runningBit == 0) { + _platforms.Front() += bits; + } + + // If the running bit is 1, shift all the _platforms to the right and + // flip the running bit. Set the first platform (num zeroes) to the + // number of bits shifted. + else { + _runningBit = 0; + _platforms.PushBack(0); + for (size_t i = _platforms.GetNum() - 1; i > 0; --i) { + _platforms[i] = _platforms[i - 1]; + } + _platforms[0] = bits; + } + + // Now trim the _platforms on the right + while (_platforms.Back() <= bits) { + bits -= _platforms.Back(); + _platforms.PopBack(); + } + _platforms.Back() -= bits; + } + + /// Shift this bitset a given number of \p bits to the left, and extend the + /// right with zeroes. + /// + void ShiftLeft(size_t bits) { + if (_num == 0 || bits == 0) { + return; + } + + // How many platforms to trim on the left? + size_t trimBits = bits; + size_t platformIndex = 0; + while (platformIndex < _platforms.GetNum() && + _platforms[platformIndex] <= trimBits) { + trimBits -= _platforms[platformIndex]; + ++platformIndex; + } + + // Reduce the size of the first platform or, if the shift clears the + // whole bitset, remove all platforms. + if (platformIndex < _platforms.GetNum()) { + _platforms[platformIndex] -= trimBits; + } else { + _platforms.Clear(); + _runningBit = 0; + platformIndex = 0; + } + + // Are there any platforms to be trimmed on the left? + if (platformIndex > 0) { + // Shift the platforms to the left, by the number of + // platforms trimmed + const size_t last = _platforms.GetNum() - platformIndex; + for (size_t i = 0; i < last; ++i) { + _platforms[i] = _platforms[i + platformIndex]; + } + _platforms.PopBackNum(platformIndex); + + // Flip the running bit, if necessary + if (platformIndex & 1) { + _runningBit = 1 - _runningBit; + } + } + + // Extend on the right, by adding zeros, if the last platform + // is zeros ... + if ((1u - _runningBit) == (_platforms.GetNum() & 1u)) { + _platforms.Back() += bits; + return; + } + + // ... or adding a new platform with zeros, if the last platform + // is ones + _platforms.PushBack(std::min<_WordType>(_num, bits)); + } + + /// Returns true, if bit # index is set. + /// + /// Note: This is a slow operation on TfCompressedBits. + /// Please, use an iterator if possible. Iterators are fast! + /// + bool IsSet(size_t index) const { + if (!TF_VERIFY(index < _num)) { + return false; + } + + size_t platformIndex, bitCount; + return _LinearSearch(index, &platformIndex, &bitCount) == 1; + } + + /// Returns the index of the n-th bit set in this bit set. + /// + /// This function counts the set bits up to the \p nth bit, and returns + /// the index of that n-th set bit. If there are less than \p nth bits set, + /// returns GetSize(). + /// + /// Note: This operation is slower than using an iterator. For forward or + /// reverse iteration, use the iterator instead. + /// + size_t FindNthSet(size_t nth) const { + size_t index = 0; + size_t count = 0; + uint8_t bit = _runningBit; + + // Iterate over all platforms to find the nth set bit using a running + // count of set bits, and an up-to-date index into the bitset. + for (size_t i = 0; i < _platforms.GetNum(); ++i) { + const _WordType platform = _platforms[i]; + + // Since bit toggles between 1 and 0 for every iteration of the + // loop, using it in a conditional guarantees a misprediction every + // time. Doing the multiplication instead is cheap and doesn't + // change the result of the conditional until we find the right + // index. + if (((count + platform) * bit) > nth) { + return index + (nth - count); + } + + index += platform; + count += (platform * bit); + bit = 1 - bit; + } + + // Less than nth bits are set, so return the size. + return _num; + } + + /// Find the next bit set that is higher or equal to index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + /// Note: This is a slow operation on TfCompressedBits. + /// Please, use an iterator if possible. Iterators are fast! + /// + size_t FindNextSet(size_t index) const + { + if (index >= _num) { + return _num; + } + + size_t platformIndex, bitCount; + const uint8_t bit = _LinearSearch(index, &platformIndex, &bitCount); + + if (bit == 1) { + return index; + } + + return bitCount; + } + + /// Finds the next unset bit that has a higher or equal index than index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + /// Note: This is a slow operation on TfCompressedBits. + /// Please, use an iterator if possible. Iterators are fast! + /// + size_t FindPrevSet(size_t index) const + { + if (index >= _num) { + return _num; + } + + size_t platformIndex, bitCount; + const uint8_t bit = _LinearSearch(index, &platformIndex, &bitCount); + + if (bit == 1) { + return index; + } + + const size_t first = bitCount - _platforms[platformIndex]; + if (first > 0) { + return first - 1; + } + + return _num; + } + + /// Finds the next unset bit that has a higher or equal index than index. + /// If no more set bits are found, index returns 'GetSize()'. + /// + /// Note: This is a slow operation on TfCompressedBits. + /// Please, use an iterator if possible. Iterators are fast! + /// + size_t FindNextUnset(size_t index) const + { + if (index >= _num) { + return _num; + } + + size_t platformIndex, bitCount; + const uint8_t bit = _LinearSearch(index, &platformIndex, &bitCount); + + if (bit == 0) { + return index; + } + + return bitCount; + } + + /// Count the bits set, and also return the largest gap between bits. + /// + void Count(size_t *numSet, size_t *maxGap) const { + const uint32_t lastIndex = _platforms.GetNum() - 1; + uint32_t num = 0; + uint32_t max = 0; + uint8_t bit = _runningBit; + for (size_t i = 0; i < _platforms.GetNum(); ++i) { + // Accumulate set bits. + if (bit == 1) { + num += _platforms[i]; + } + // Don't account the leading and trailing zeros as gaps. + else if (i > 0 && i < lastIndex) { + max = std::max(max, _platforms[i]); + } + bit = 1 - bit; + } + *numSet = num; + *maxGap = max; + } + + /// Returns the size of the bit array, ie. the # of bits it can hold. + /// + size_t GetSize() const { + return _num; + } + + /// Returns \c true if this bit array is empty, i.e. it is of size zero. + /// + bool IsEmpty() const { + return _num == 0; + } + + /// Returns the index of the first bit set in the bit array. If no bits + /// are set, the return value is 'GetSize()'. + /// + size_t GetFirstSet() const { + if (_num == 0 || _runningBit == 1) { + return 0; + } + + return _platforms.Front(); + } + + /// Returns the index of the last bit set in the bit array. If no bits + /// are set, the return value is 'GetSize()'. + /// + size_t GetLastSet() const { + // Zero size or all zeros case + if (_num == 0 || (_runningBit == 0 && _platforms.GetNum() == 1)) { + return _num; + } + + // If _runningBit == 1 and number of words is odd or + // _runningBit == 0 and number of words is even + if (_runningBit == (_platforms.GetNum() & 1)) { + return _num - 1; + } + + return _num - 1 - _platforms.Back(); + } + + /// Returns the number of bits currently set in this array. + /// + size_t GetNumSet() const { + size_t numSet = 0; + for (size_t i = 1 - _runningBit; i < _platforms.GetNum(); i += 2) { + numSet += _platforms[i]; + } + return numSet; + } + + /// Returns the number of platforms (zeros or ones) in this bitset. + /// + size_t GetNumPlatforms() const { + if (_num == 0) { + return 0; + } + + return _platforms.GetNum(); + } + + /// Returns the number of set (ones) platforms in this bitset. + /// + size_t GetNumSetPlatforms() const { + if (_num == 0) { + return 0; + } + + const uint32_t numP = _platforms.GetNum(); + return (numP / 2) + (numP & _runningBit); + } + + /// Returns the number of unset (zeros) platforms in this bitset. + /// + size_t GetNumUnsetPlatforms() const { + if (_num == 0) { + return 0; + } + + const uint32_t numP = _platforms.GetNum(); + return (numP / 2) + (numP & (1 - _runningBit)); + } + + /// Returns true, if all the bits in this bit array are set. + /// + bool AreAllSet() const { + return _num == 0 || (_runningBit == 1 && _platforms.GetNum() == 1); + } + + /// Returns true, if all the bits in this bit array are unset. + /// + bool AreAllUnset() const { + return !IsAnySet(); + } + + /// Returns true, if there is at least a single set bit. + /// + bool IsAnySet() const { + return _num > 0 && (_runningBit == 1 || _platforms.GetNum() > 1); + } + + /// Returns true, if there is at least a single unset bit. + /// + bool IsAnyUnset() const { + return _num > 0 && (_runningBit == 0 || _platforms.GetNum() > 1); + } + + /// Returns true if the set bits in this bit array are contiguous. + /// + /// Note: This returns false if there are no set bits. + /// + bool AreContiguouslySet() const { + const uint32_t numP = _platforms.GetNum(); + return + _num > 0 && numP <= 3 && + (numP == 2 || + (_runningBit == 1 && numP == 1) || + (_runningBit == 0 && numP == 3)); + } + + /// Returns the amount of memory this object holds on to. + /// + size_t GetAllocatedSize() const + { + size_t size = sizeof(TfCompressedBits); + if (_platforms.GetNumAllocated() > _WordArray::LOCAL_SIZE) { + size += sizeof(_WordType) * _platforms.GetNumAllocated(); + } + return size; + } + + /// Returns a hash for this instance. + /// + TF_API + size_t GetHash() const; + + /// Returns a string representing the bits for debugging with bits + /// ordered from left to right with increasing indices. + /// + TF_API + std::string GetAsStringLeftToRight() const; + + /// Returns a string representing the bits for debugging with bits + /// ordered from right to left with increasing indices. + /// + TF_API + std::string GetAsStringRightToLeft() const; + + /// Returns a string representing the bits for debugging with bits + /// represented in run-length encoding form. + /// + TF_API + std::string GetAsRLEString() const; + + /// Returns a bitset constructed from the supplied string representation. + /// + /// The string representation can be either a RLE encoded bitset, such as + /// '1x5-0x5-1x100', or a string of zeros and ones, such as '1111100000'. + /// Note that whitespace anywhere in the string representation is ignored. + /// + /// Any character other than whitespace, a digit, 'x' or '-' in the string + /// representation is considered invalid. Invalid string representations + /// will return an empty bitset. + /// An empty string representation (or a string purely comprised of + /// whitespace), however, is considered a valid representation describing + /// an empty bitset. + /// + TF_API + static TfCompressedBits FromString(const std::string &source); + + /// \name Operators + /// @{ + + /// Returns true if this == \p rhs. + /// + bool operator==(const TfCompressedBits &rhs) const { + if (this == &rhs || (_num == 0 && rhs._num == 0)) { + return true; + } + + // Fast comparisons, first + if (_num == rhs._num && + _runningBit == rhs._runningBit && + _platforms.GetNum() == rhs._platforms.GetNum()) { + + // Worst case, scenario: Must compare every word + for (size_t i = 0; i < _platforms.GetNum(); ++i) { + // Early bailout, if two words don't match + if (_platforms[i] != rhs._platforms[i]) { + return false; + } + } + + // All words match + return true; + } + + // Early comparison failed + return false; + } + + /// Returns true if this != \p rhs. + /// + bool operator!=(const TfCompressedBits &rhs) const { + return !(*this == rhs); + } + + /// Ands these bits with the \p rhs bits. + /// + /// The resulting bit set is the intersection of the two bit sets. + /// + TfCompressedBits &operator&=(const TfCompressedBits &rhs) { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return *this; + } + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhs._platforms.GetNum(); + const uint8_t bitA = _runningBit; + const uint8_t bitB = rhs._runningBit; + + // Early bailout: This is all zeroes or all ones + if (numA == 1) { + if (bitA == 0) { + return *this; + } + + _runningBit = bitB; + _platforms = rhs._platforms; + return *this; + } + + // Early bailout: Rhs is all zeroes or all ones + if (numB == 1) { + if (bitB == 1) { + return *this; + } + + ClearAll(); + return *this; + } + + // Early bailout: No bits will overlap, if sets are disjoint + if (_AreBoundsDisjoint(rhs)) { + ClearAll(); + return *this; + } + + return _Logical<_And>(bitB, rhs._platforms); + } + + /// Returns these bits and'ed with \p rhs. + /// + TfCompressedBits operator&(const TfCompressedBits &rhs) const { + TfCompressedBits r(*this); + r &= rhs; + return r; + } + + /// Ors these bits with the \p rhs bits. + /// + /// The resulting bit set is the union of the two bit sets. + /// + TfCompressedBits &operator|=(const TfCompressedBits &rhs) { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return *this; + } + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhs._platforms.GetNum(); + const uint8_t bitA = _runningBit; + const uint8_t bitB = rhs._runningBit; + + // Early bailout: This is all zeroes or all ones + if (numA == 1) { + if (bitA == 1) { + return *this; + } + + _runningBit = bitB; + _platforms = rhs._platforms; + return *this; + } + + // Early bailout: Rhs is all zeroes or all ones + if (numB == 1) { + if (bitB == 0) { + return *this; + } + + SetAll(); + return *this; + } + + // If this set already contains all the bits in rhs, there is no + // point in proceeding with the full logical OR. Note, that although + // this operation needs to look at all the platforms, it only performs + // reads from memory, which makes it faster than the logical OR. If + // this check fails, the data is already prefetched and ready to be + // consumed by the logical OR. + if (Contains(rhs)) { + return *this; + } + + return _Logical<_Or>(bitB, rhs._platforms); + } + + /// Returns these bits or'ed with the \p rhs. + /// + TfCompressedBits operator|(const TfCompressedBits &rhs) const { + TfCompressedBits r(*this); + r |= rhs; + return r; + } + + /// Xors these bits with the \p rhs bits. + /// + /// The resulting bit set is the union of the two bit sets minus the + /// intersection of the two bit sets. + /// + TfCompressedBits &operator^=(const TfCompressedBits &rhs) { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return *this; + } + + // Early bailout: This is all zeroes + if (AreAllUnset()) { + *this = rhs; + return *this; + } + + // Early bailout: Rhs is all zeroes + if (rhs.AreAllUnset()) { + return *this; + } + + return _Logical<_Xor>(rhs._runningBit, rhs._platforms); + } + + /// Returns these bits xor'ed with \p rhs. + /// + TfCompressedBits operator^(const TfCompressedBits &rhs) const { + TfCompressedBits r(*this); + r ^= rhs; + return r; + } + + /// Removes all bits in the \p rhs bits from these bits. + /// + /// The resulting bit set is the asymmetric set difference of + /// the two bit sets. + /// + TfCompressedBits &operator-=(const TfCompressedBits &rhs) { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return *this; + } + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhs._platforms.GetNum(); + const uint8_t bitA = _runningBit; + const uint8_t bitB = rhs._runningBit; + + // Early bailout: This is all zeroes or all ones + if (numA == 1) { + if (bitA == 0) { + return *this; + } + + _runningBit = 1 - bitB; + _platforms = rhs._platforms; + return *this; + } + + // Early bailout: Rhs is all zeroes or all ones + if (numB == 1) { + if (bitB == 0) { + return *this; + } + + ClearAll(); + return *this; + } + + // Early bailout: No bits will be subtracted, if sets are disjoint. + // Note, that although this operation needs to look at all the + // platforms, it only performs reads from memory, which makes it faster + // than the logical AND. If this check fails, the data is already + // prefetched and ready to be consumed by the logical AND. + if (_AreBoundsDisjoint(rhs) || !HasNonEmptyIntersection(rhs)) { + return *this; + } + + return _Logical<_And>(1 - bitB, rhs._platforms); + } + + /// Returns bits with all the bits in \p rhs removed from these bits. + /// + TfCompressedBits operator-(const TfCompressedBits &rhs) const { + TfCompressedBits r(*this); + r -= rhs; + return r; + } + + /// Flips all bits. + /// + /// The resulting bit set is the complement of this bit set. + /// + TfCompressedBits &Complement() { + if (_num != 0) { + _runningBit = 1 - _runningBit; + } + return *this; + } + + /// Returns bit at \p index. + /// + /// Note: This is a slow operation on TfCompressedBits! + /// + bool operator[](size_t index) const { + return IsSet(index); + } + + /// Shifts to the right (see ShiftRight) + /// + TfCompressedBits &operator>>=(size_t bits) { + ShiftRight(bits); + return *this; + } + + /// Returns bits shifted to the right. + /// + TfCompressedBits operator>>(size_t bits) const { + TfCompressedBits r(*this); + r >>= bits; + return r; + } + + /// Shifts to the left (see ShiftLeft) + /// + TfCompressedBits &operator<<=(size_t bits) { + ShiftLeft(bits); + return *this; + } + + /// Returns bits shifted to the left. + /// + TfCompressedBits operator<<(size_t bits) const { + TfCompressedBits r(*this); + r <<= bits; + return r; + } + + /// @} + + + /// Returns true if the result of the intersection with \p rhs would be + /// non-zero. + /// + /// This method can be used for efficiency because it doesn't perform + /// the full AND operation on a copy, and it can return early. + /// + bool HasNonEmptyIntersection(const TfCompressedBits &rhs) const { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return false; + } + + uint8_t bitA = _runningBit; + uint8_t bitB = rhs._runningBit; + if (bitA & bitB) { + return true; + } + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhs._platforms.GetNum(); + if (numA == 1) { + if (bitA == 0) { + return false; + } + + return rhs.IsAnySet(); + } + + if (numB == 1) { + if (bitB == 0) { + return false; + } + + return IsAnySet(); + } + + // We can bail out early if the ranges of set bits do not overlap + if (_AreBoundsDisjoint(rhs)) { + return false; + } + + return _HasLogical<_And>(bitB, rhs._platforms); + } + + /// Returns true if the result of an asymmetric set different is non-zero. + /// This is the equivalent to computing: + /// return (this - rhs).GetNumSet() != 0 + /// but avoids creating temporary copies. + /// + bool HasNonEmptyDifference(const TfCompressedBits &rhs) const { + if (!TF_VERIFY(_num == rhs._num) || + _num == 0 || rhs._num == 0) { + return false; + } + + uint8_t bitA = _runningBit; + uint8_t bitB = rhs._runningBit; + if (bitA && !bitB) { + return true; + } + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhs._platforms.GetNum(); + if (numA == 1) { + if (bitA == 0) { + return false; + } + + return rhs.IsAnyUnset(); + } + + if (numB == 1) { + if (bitB == 0) { + return IsAnySet(); + } + + return false; + } + + // We can bail out early, if the ranges of set bits do not overlap. + // Check the first set bits first, because checking for the last set + // bit is more expensive. + const size_t firstSet = GetFirstSet(); + const size_t rhsFirstSet = rhs.GetFirstSet(); + if (firstSet < rhsFirstSet) { + return true; + } + + // If we still haven't bailed out yet, check the last set bit. + const size_t lastSet = GetLastSet(); + const size_t rhsLastSet = rhs.GetLastSet(); + if (lastSet > rhsLastSet || + firstSet > rhsLastSet || + lastSet < rhsFirstSet) { + return true; + } + + return _HasLogical<_And>(1 - bitB, rhs._platforms); + } + + /// Returns true if this bit array contains \p rhs by computing: + /// (rhs - this).GetNumSet() == 0. + /// + /// Ie. it will return true if all bits of \p rhs are also set in this. + /// + bool Contains(const TfCompressedBits &rhs) const { + return !rhs.HasNonEmptyDifference(*this); + } + + /// Returns an empty TfBits. + /// + static const TfCompressedBits &GetEmpty() { + static TfStaticData emptyBits; + return *emptyBits; + } + + /// Decompress the bits into a TfBits array. + /// + TF_API + void Decompress(TfBits *bits) const; + + /// Iterator support. + /// + template + class View; + + /// Returns an iteratable view for the bits that steps over all bits. + /// + typedef View AllView; + inline AllView GetAllView() const; + + /// Returns an iteratable view for the bits that steps over all set bits. + /// + typedef View AllSetView; + inline AllSetView GetAllSetView() const; + + /// Returns an iteratable view for the bits that steps over all unset bits. + /// + typedef View AllUnsetView; + inline AllUnsetView GetAllUnsetView() const; + + /// Returns an iteratable view for the bits that steps over all platforms. + /// + typedef View PlatformsView; + inline PlatformsView GetPlatformsView() const; + +private: + // Functor for logical operation: AND + struct _And { + inline uint8_t operator() (uint8_t a, uint8_t b) { + return a & b; + } + }; + + // Functor for logical operation: OR + struct _Or { + inline uint8_t operator() (uint8_t a, uint8_t b) { + return a | b; + } + }; + + // Functor for logical operation: XOR + struct _Xor { + inline uint8_t operator() (uint8_t a, uint8_t b) { + return a ^ b; + } + }; + + // This method performs a logical operation on the passed in running bit + // and word array. OP denotes a functor implementing the logical operation. + // The idea is that the compiler will be smart enough to inline the + // operation, without actually having to call the function. + template < class OP > TfCompressedBits & + _Logical(uint8_t rhsRunningBit, const _WordArray &rhsPlatforms) { + OP op; + + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhsPlatforms.GetNum(); + uint8_t bitA = _runningBit; + uint8_t bitB = rhsRunningBit; + + uint8_t b = op(bitA, bitB); + _WordArray result; + _runningBit = b; + + size_t indexA = 0; + size_t indexB = 0; + _WordType platformA = _platforms[indexA]; + _WordType platformB = rhsPlatforms[indexB]; + + uint32_t newTotal = 0; + _WordType newPlatform = 0; + + while (true) { + if (platformA < platformB) { + newTotal += platformA; + newPlatform += platformA; + bitA = 1 - bitA; + + // Commit the new platform + const uint8_t newBit = op(bitA, bitB); + if (newBit != b) { + result.PushBack(newPlatform); + newPlatform = 0; + b = newBit; + } + + // Move on to the next platform + ++indexA; + platformB = platformB - platformA; + if (indexA == numA) { + platformA = _num - newTotal; + } else if (indexA < numA) { + platformA = _platforms[indexA]; + } + + } else if (platformA > platformB) { + newTotal += platformB; + newPlatform += platformB; + bitB = 1 - bitB; + + // Commit the new platform + const uint8_t newBit = op(bitA, bitB); + if (newBit != b) { + result.PushBack(newPlatform); + newPlatform = 0; + b = newBit; + } + + // Move on to the next platform + ++indexB; + platformA = platformA - platformB; + if (indexB == numB) { + platformB = _num - newTotal; + } else if(indexB < numB) { + platformB = rhsPlatforms[indexB]; + } + + } else { + newTotal += platformA; + newPlatform += platformA; + bitA = 1 - bitA; + bitB = 1 - bitB; + + // Commit the new platform + const uint8_t newBit = op(bitA, bitB); + if (newBit != b || newTotal >= _num) { + result.PushBack(newPlatform); + newPlatform = 0; + b = newBit; + } + + if (newTotal >= _num) + break; + + // Move on to the next platforms + ++indexA; + if (indexA == numA) { + platformA = _num - newTotal; + } else if (indexA < numA) { + platformA = _platforms[indexA]; + } + + ++indexB; + if (indexB == numB) { + platformB = _num - newTotal; + } else if (indexB < numB) { + platformB = rhsPlatforms[indexB]; + } + } + } + + result.MoveInto(_platforms); + return *this; + } + + // Performs a logical operation, but breaks out and returns true, as soon + // as the logical operation returns true. If the logical operation never + // returns true, false is returned. + template < class OP > bool + _HasLogical(uint8_t rhsRunningBit, const _WordArray &rhsPlatforms) const { + OP op; + + uint8_t bitA = _runningBit; + uint8_t bitB = rhsRunningBit; + const uint32_t numA = _platforms.GetNum(); + const uint32_t numB = rhsPlatforms.GetNum(); + + size_t indexA = 0; + size_t indexB = 0; + _WordType sumPlatformA = _platforms[indexA]; + _WordType sumPlatformB = rhsPlatforms[indexB]; + while (indexA < numA && indexB < numB) { + if (op(bitA, bitB)) { + return true; + } + + if (sumPlatformA < sumPlatformB) { + bitA = 1 - bitA; + ++indexA; + sumPlatformA += _platforms[indexA]; + + } else if (sumPlatformA > sumPlatformB) { + bitB = 1 - bitB; + ++indexB; + sumPlatformB += rhsPlatforms[indexB]; + + } else { + bitA = 1 - bitA; + bitB = 1 - bitB; + ++indexA; + ++indexB; + + if (indexA >= numA || indexB >= numB) { + return false; + } + + sumPlatformA += _platforms[indexA]; + sumPlatformB += rhsPlatforms[indexB]; + } + } + + return false; + } + + // Do a liner search for the bit index, returning its bit value. + // Also returns the index of that bit in the word array, as well as the + // bitCount denoting the number of bits counted up until the range that + // terminates the current word, the index is found in. + uint8_t _LinearSearch( + size_t index, size_t *platformIndex, size_t *bitCount) const { + uint8_t bit = _runningBit; + size_t count = 0; + size_t i; + + for (i = 0; i < _platforms.GetNum(); ++i) { + count += _platforms[i]; + if (count > index) { + break; + } + bit = 1 - bit; + } + + *platformIndex = i; + *bitCount = count; + return bit; + } + + // Returns true if this bit array's bounds are disjoint from the bounds + // of the rhs bit array. The two are considered disjoint if the last bit + // set of array A is at a lower index than the first bit set on array B + // (or vice versa). + // Note, that the bit arrays may still be disjoint, even if this method + // returns false, but if this method returns true, the bit arrays are + // guaranteed to be disjoint. This is basically a very cheap early out for + // the Overlaps() method. + bool _AreBoundsDisjoint(const TfCompressedBits &rhs) const { + return + GetLastSet() < rhs.GetFirstSet() || + GetFirstSet() > rhs.GetLastSet(); + } + + // The word array, storing the bit platforms. + _WordArray _platforms; + + // The size of this bit array in number of bits. + uint32_t _num; + + // The value of the running bit, indicating what the bit value of the first + // word is. + uint8_t _runningBit; + +}; + +template +class TfCompressedBits::View +{ +public: + class const_iterator + { + public: + using iterator_category = std::forward_iterator_tag; + using value_type = const uint32_t; + using reference = const uint32_t &; + using pointer = const uint32_t *; + using difference_type = const uint32_t; + + const_iterator() : + _bits(nullptr), + _platformIndex(0), + _bitIndex(0), + _bitCounter(0), + _value(0) + {} + + reference operator*() const { return dereference(); } + pointer operator->() const { return &(dereference()); } + + const_iterator& operator++() { + increment(); + return *this; + } + + const_iterator operator++(int) { + const_iterator r(*this); + increment(); + return r; + } + + bool operator==(const const_iterator& rhs) const { + return equal(rhs); + } + + bool operator!=(const const_iterator& rhs) const { + return !equal(rhs); + } + + bool IsSet() const { + return _value == 1; + } + + bool IsAtEnd() const { + if (!_bits) { + return true; + } + return _bitIndex >= _bits->GetSize(); + } + + private: + friend class View; + + const_iterator( + const TfCompressedBits *bits, + uint32_t platformIndex, + uint32_t bitIndex, + uint8_t value) : + _bits(bits), + _platformIndex(platformIndex), + _bitIndex(bitIndex), + _bitCounter(0), + _value(value) + {} + + bool equal(const const_iterator &rhs) const { + return _bits == rhs._bits && _bitIndex == rhs._bitIndex; + } + + void increment() { + // Note, this looks like quite a bit of logic, but mode is a + // compile time constant. The compiler to the rescue! + if (!_bits) { + return; + } + + // Increment bit index + ++_bitIndex; + + // Increment bit counter (counting the current word) + ++_bitCounter; + + // If the bit counter surpasses the current word, + // skip ahead to the next word + if (_bitCounter >= _bits->_platforms[_platformIndex]) { + + // If the iterator mode is not All, look at + // every other word + const uint32_t numP = + _bits->_platforms.GetNum(); + if ((mode == Mode::AllSet || mode == Mode::AllUnset) && + (_platformIndex + 1) < numP) { + _bitIndex += _bits->_platforms[_platformIndex + 1]; + _platformIndex += 2; + } + + // Otherwise, look at every word and toggle + // the value bit + else { + ++_platformIndex; + _value = 1 - _value; + } + + // Reset the bit counter + _bitCounter = 0; + } + } + + const uint32_t &dereference() const { + return _bitIndex; + } + + const TfCompressedBits *_bits; + uint32_t _platformIndex; + uint32_t _bitIndex; + uint32_t _bitCounter; + uint8_t _value; + }; + + // Support for TF_FOR_ALL. + typedef const_iterator iterator; + + const_iterator begin() const { + const uint8_t bit = _bits->_runningBit; + + // Skip ahead one word, if looking at AllSet/AllUnset and the + // first word describes an unset/set platform of bits + if ((mode == Mode::AllSet && bit == 0) || + (mode == Mode::AllUnset && bit == 1)) { + return const_iterator(_bits, 1, _bits->_platforms[0], 1 - bit); + } + + return const_iterator(_bits, 0, 0, bit); + } + + const_iterator end() const { + return const_iterator(_bits, 0, _bits->GetSize(), 0); + } + + /// Return true, if the view is empty. + /// + bool IsEmpty() const { + return begin() == end(); + } + +private: + + // The TfCompressedBits can create new views. + friend class TfCompressedBits; + + // Ctor. + View(const TfCompressedBits *bits) : + _bits(bits) + {} + + const TfCompressedBits *_bits; +}; + +// Specialize the platform view because its iterators are much simpler than +// the per-bit views. +template <> +class TfCompressedBits::View +{ +public: + class const_iterator + { + public: + using iterator_category = std::forward_iterator_tag; + using value_type = const uint32_t; + using reference = const uint32_t &; + using pointer = const uint32_t *; + using difference_type = const uint32_t; + + const_iterator() : + _platform(nullptr), + _bitIndex(0), + _value(0) + {} + + reference operator*() const { return dereference(); } + pointer operator->() const { return &(dereference()); } + + const_iterator& operator++() { + increment(); + return *this; + } + + const_iterator operator++(int) { + const_iterator r(*this); + increment(); + return r; + } + + bool operator==(const const_iterator& rhs) const { + return equal(rhs); + } + + bool operator!=(const const_iterator& rhs) const { + return !equal(rhs); + } + + bool IsSet() const { + return _value == 1; + } + + uint32_t GetPlatformSize() const { + return *_platform; + } + + private: + friend class View; + + const_iterator( + const uint32_t *platform, + uint8_t value) + : _platform(platform) + , _bitIndex(0) + , _value(value) + {} + + bool equal(const const_iterator &rhs) const { + return _platform == rhs._platform; + } + + void increment() { + _bitIndex += *_platform; + ++_platform; + _value = 1 - _value; + } + + const uint32_t &dereference() const { + return _bitIndex; + } + + const uint32_t *_platform; + uint32_t _bitIndex; + uint8_t _value; + }; + + const_iterator begin() const { + return const_iterator(_bits->_platforms.Begin(), _bits->_runningBit); + } + + const_iterator end() const { + return const_iterator(_bits->_platforms.End(), 0); + } + + /// Return true, if the view is empty. + /// + bool IsEmpty() const { + return begin() == end(); + } + +private: + + // The TfCompressedBits can create new views. + friend class TfCompressedBits; + + // Ctor. + View(const TfCompressedBits *bits) : + _bits(bits) + {} + + const TfCompressedBits *_bits; +}; + +TfCompressedBits::AllView +TfCompressedBits::GetAllView() const +{ + return View(this); +} + +TfCompressedBits::AllSetView +TfCompressedBits::GetAllSetView() const +{ + return View(this); +} + +TfCompressedBits::AllUnsetView +TfCompressedBits::GetAllUnsetView() const +{ + return View(this); +} + +TfCompressedBits::PlatformsView +TfCompressedBits::GetPlatformsView() const +{ + return View(this); +} + +// Specializing, so TfIterator knows to retain a copy when iterating. +template<> +struct Tf_ShouldIterateOverCopy : + std::true_type +{}; + +template<> +struct Tf_ShouldIterateOverCopy : + std::true_type +{}; + +template<> +struct Tf_ShouldIterateOverCopy : + std::true_type +{}; + +//! \brief Output a TfBits, as a stream of 0s and 1s. +// \ingroup group_tf_DebuggingOutput +inline std::ostream& +operator<<(std::ostream &out, const TfCompressedBits &bits) { + out << bits.GetAsStringLeftToRight(); + return out; +} + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/base/tf/testenv/bits.cpp b/pxr/base/tf/testenv/bits.cpp new file mode 100644 index 0000000000..e9fe03d3a4 --- /dev/null +++ b/pxr/base/tf/testenv/bits.cpp @@ -0,0 +1,191 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/base/tf/bits.h" +#include "pxr/base/tf/regTest.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +static void +TestSwap( + const TfBits & a, TfBits & b) +{ + // Make copies of a & b so we can test swapping in both directions. + TfBits a1(a), a2(a), b1(b), b2(b); + + b1.Swap(a1); + TF_AXIOM(a1 == b); + TF_AXIOM(b1 == a); + + a2.Swap(b2); + TF_AXIOM(a2 == b); + TF_AXIOM(b2 == a); + + // Swap back + b1.Swap(a1); + TF_AXIOM(a1 == a); + TF_AXIOM(b1 == b); + + a2.Swap(b2); + TF_AXIOM(a2 == a); + TF_AXIOM(b2 == b); +} + +static bool +Test_TfBits() +{ + std::cout + << "Testing TfBits...\n" + << "sizeof(TfBits) = " << sizeof(TfBits) << "\n"; + + TfBits b(4); + + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 0); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(b.AreAllUnset()); + TF_AXIOM(!b.AreContiguouslySet()); + + // Test setting a single bit. + b.Set(0); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 1); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.AreContiguouslySet()); + + TF_AXIOM(b.GetAsStringLeftToRight() == "1000"); + TF_AXIOM(b.GetAsStringRightToLeft() == "0001"); + + // Test resize /w keeping content. + b.ResizeKeepContent(8); + TF_AXIOM(b.GetSize() == 8); + TF_AXIOM(b.GetNumSet() == 1); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.AreContiguouslySet()); + + TF_AXIOM(b.GetAsStringLeftToRight() == "10000000"); + TF_AXIOM(b.GetAsStringRightToLeft() == "00000001"); + + // Test resize /w keeping content. + b.ResizeKeepContent(2); + TF_AXIOM(b.GetSize() == 2); + TF_AXIOM(b.GetNumSet() == 1); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.AreContiguouslySet()); + + TF_AXIOM(b.GetAsStringLeftToRight() == "10"); + TF_AXIOM(b.GetAsStringRightToLeft() == "01"); + + { + // Testing Assign() API + TfBits a(4); + a.ClearAll(); + a.Set(1); + TF_AXIOM(a.GetAsStringLeftToRight() == "0100"); + + a.Assign(2, true); + TF_AXIOM(a.GetAsStringLeftToRight() == "0110"); + TF_AXIOM(a.GetNumSet() == 2); + TF_AXIOM(a.GetFirstSet() == 1); + TF_AXIOM(a.GetLastSet() == 2); + + a.Assign(2, false); + TF_AXIOM(a.GetAsStringLeftToRight() == "0100"); + TF_AXIOM(a.GetNumSet() == 1); + TF_AXIOM(a.GetFirstSet() == 1); + TF_AXIOM(a.GetLastSet() == 1); + + a.Assign(3, false); + TF_AXIOM(a.GetAsStringLeftToRight() == "0100"); + TF_AXIOM(a.GetNumSet() == 1); + TF_AXIOM(a.GetFirstSet() == 1); + TF_AXIOM(a.GetLastSet() == 1); + + TfBits t; + t.Resize(12); + t.ClearAll(); + t.Assign(1, true); + t.Assign(2, true); + TF_AXIOM(t.GetAsStringLeftToRight() == "011000000000"); + t.Assign(4, false); + t.Assign(5, true); + TF_AXIOM(t.GetAsStringLeftToRight() == "011001000000"); + TF_AXIOM(t.GetNumSet() == 3); + TF_AXIOM(t.GetFirstSet() == 1); + TF_AXIOM(t.GetLastSet() == 5); + } + + { + // Test resizing bug: GetFirstSet() won't work after ResizeKeepContent(). + b.Resize(0); + TF_AXIOM(b.GetFirstSet() == 0); + b.ResizeKeepContent(4); + b.Assign(3, true); + TF_AXIOM(b.GetFirstSet() == 3); + } + + { + // Test basic iterator views. + b.Assign(1, true); + TF_AXIOM(b.GetAsStringLeftToRight() == "0101"); + + size_t c=0; + TF_FOR_ALL(i, b.GetAllView()) + c += *i; + TF_AXIOM(c == 6); + + c=0; + TF_FOR_ALL(i, b.GetAllSetView()) + c += *i; + TF_AXIOM(c == 4); + + c=0; + TF_FOR_ALL(i, b.GetAllUnsetView()) + c += *i; + TF_AXIOM(c == 2); + } + + // Testing Swap + { + // 'a' & 'b' are both small enough to both use inline bits storage. + TfBits a(4), b(2); + a.Set(0); + b.Set(1); + + TestSwap(a, b); + } + { + // 'a' & 'b' are both large enough to both use heap allocated bits + // storage. + TfBits a(2048), b(1024); + a.Set(0); + b.Set(512); + + TestSwap(a, b); + } + { + // 'a' uses inline bits storage, 'b' uses heap allocated storage. + TfBits a(4), b(1024); + a.Set(0); + b.Set(512); + + TestSwap(a, b); + } + + //XXX: Needs more testing. + + std::cout << "... success!\n\n"; + + return true; +} +TF_ADD_REGTEST(TfBits); + diff --git a/pxr/base/tf/testenv/compressedBits.cpp b/pxr/base/tf/testenv/compressedBits.cpp new file mode 100644 index 0000000000..c92ff53188 --- /dev/null +++ b/pxr/base/tf/testenv/compressedBits.cpp @@ -0,0 +1,1302 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/base/tf/bits.h" +#include "pxr/base/tf/compressedBits.h" +#include "pxr/base/tf/regTest.h" +#include "pxr/base/tf/stopwatch.h" +#include "pxr/base/tf/iterator.h" + +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +// This verifies that the TfBits and TfCompressedBits APIs remain compatible +static void +Test_TfCompressedBits_VerifyEquality( + const TfBits &a, + const TfCompressedBits &b) +{ + // Verify that the TfBits and TfCompressedBits APIs return equal values + TF_AXIOM(a.GetSize() == b.GetSize()); + TF_AXIOM(a.GetFirstSet() == b.GetFirstSet()); + TF_AXIOM(a.GetLastSet() == b.GetLastSet()); + TF_AXIOM(a.GetNumSet() == b.GetNumSet()); + TF_AXIOM(a.AreAllSet() == b.AreAllSet()); + TF_AXIOM(a.AreAllUnset() == b.AreAllUnset()); + TF_AXIOM(a.IsAnySet() == b.IsAnySet()); + TF_AXIOM(a.IsAnyUnset() == b.IsAnyUnset()); + TF_AXIOM(a.AreContiguouslySet() == b.AreContiguouslySet()); + TF_AXIOM(a.GetAsStringLeftToRight() == b.GetAsStringLeftToRight()); + + // Value equality + for (size_t i = 0; i < a.GetSize(); ++i) { + TF_AXIOM(a.IsSet(i) == b.IsSet(i)); + } +} + +// This verifies that the TfBits and TfCompressedBits APIs remain compatible, +// and that converting between the two representations results in equal values +static void +Test_TfCompressedBits_VerifyEqualityWithConversion( + const TfBits &a, + const TfCompressedBits &b) +{ + Test_TfCompressedBits_VerifyEquality(a, b); + + TfCompressedBits c = TfCompressedBits(a); + Test_TfCompressedBits_VerifyEquality(a, c); + + TfBits d; + b.Decompress(&d); + Test_TfCompressedBits_VerifyEquality(d, b); +} + +static bool +Test_TfCompressedBits() +{ + std::cout + << "Testing TfCompressedBits...\n" + << "sizeof(TfCompressedBits) = " << sizeof(TfCompressedBits) << "\n"; + + // Basic API tests + { + TfCompressedBits b(4); + + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 0); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(b.AreAllUnset()); + TF_AXIOM(!b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(!b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == b.GetSize()); + TF_AXIOM(b.GetLastSet() == b.GetSize()); + + // Test setting a single bit. + b.Set(0); + TF_AXIOM(b.IsSet(0)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 1); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 0); + TF_AXIOM(b.GetLastSet() == 0); + TF_AXIOM(b.GetAsStringLeftToRight() == "1000"); + TF_AXIOM(b.GetAsStringRightToLeft() == "0001"); + + // Test setting a second bit + b.Set(2); + TF_AXIOM(b.IsSet(0)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 2); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(!b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 0); + TF_AXIOM(b.GetLastSet() == 2); + TF_AXIOM(b.GetAsStringLeftToRight() == "1010"); + TF_AXIOM(b.GetAsStringRightToLeft() == "0101"); + + // Test setting a third bit + b.Assign(1, true); + TF_AXIOM(b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 3); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 0); + TF_AXIOM(b.GetLastSet() == 2); + TF_AXIOM(b.GetAsStringLeftToRight() == "1110"); + TF_AXIOM(b.GetAsStringRightToLeft() == "0111"); + + // Test setting all bits + b.SetAll(); + TF_AXIOM(b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 4); + TF_AXIOM(b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(!b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 0); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "1111"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1111"); + + // Test unsetting a bit + b.Assign(0, false); + TF_AXIOM(!b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 3); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 1); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1110"); + + // Test unsetting another bit + b.Clear(2); + TF_AXIOM(!b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(!b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 2); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(!b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 1); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0101"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1010"); + + // Test unsetting all bits + b.ClearAll(); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 0); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(b.AreAllUnset()); + TF_AXIOM(!b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(!b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == b.GetSize()); + TF_AXIOM(b.GetLastSet() == b.GetSize()); + TF_AXIOM(b.GetAsStringLeftToRight() == "0000"); + TF_AXIOM(b.GetAsStringRightToLeft() == "0000"); + + // Test setting a range of bits + b.SetRange(1, 3); + TF_AXIOM(!b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 3); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 1); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1110"); + + // Set a bit that's already set + b.Set(1); + TF_AXIOM(!b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 3); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 1); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1110"); + + // Clear a bit that's already cleared + b.Clear(0); + TF_AXIOM(!b.IsSet(0)); + TF_AXIOM(b.IsSet(1)); + TF_AXIOM(b.IsSet(2)); + TF_AXIOM(b.IsSet(3)); + TF_AXIOM(b.GetSize() == 4); + TF_AXIOM(b.GetNumSet() == 3); + TF_AXIOM(!b.AreAllSet()); + TF_AXIOM(!b.AreAllUnset()); + TF_AXIOM(b.IsAnySet()); + TF_AXIOM(b.IsAnyUnset()); + TF_AXIOM(b.AreContiguouslySet()); + TF_AXIOM(b.GetFirstSet() == 1); + TF_AXIOM(b.GetLastSet() == 3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.GetAsStringRightToLeft() == "1110"); + + // Append bits + TfCompressedBits c; + TF_AXIOM(c.GetSize() == 0); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == ""); + + c.Append(2, false); + TF_AXIOM(c.GetSize() == 2); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == "00"); + + c.Append(1, false); + TF_AXIOM(c.GetSize() == 3); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == "000"); + + c.Append(2, true); + TF_AXIOM(c.GetSize() == 5); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "00011"); + + c.Append(1, true); + TF_AXIOM(c.GetSize() == 6); + TF_AXIOM(c.GetNumSet() == 3); + TF_AXIOM(c.GetAsStringLeftToRight() == "000111"); + + c.Append(3, false); + TF_AXIOM(c.GetSize() == 9); + TF_AXIOM(c.GetNumSet() == 3); + TF_AXIOM(c.GetAsStringLeftToRight() == "000111000"); + + c = TfCompressedBits(); + TF_AXIOM(c.GetSize() == 0); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == ""); + + c.Append(3, true); + TF_AXIOM(c.GetSize() == 3); + TF_AXIOM(c.GetNumSet() == 3); + TF_AXIOM(c.GetAsStringLeftToRight() == "111"); + + TfCompressedBits d(3); + d.SetAll(); + TF_AXIOM(c == d); + } + + // Basic logic operations + { + TfCompressedBits a(4); + a.SetAll(); + + TfCompressedBits b(4); + + // AND + { + TfCompressedBits c(4); + c = a & b; + TF_AXIOM(c.AreAllUnset()); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == "0000"); + + c.Set(0); + c.Set(1); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "1100"); + + c &= a; + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "1100"); + + TfCompressedBits d(a); + d.Clear(0); + d.Clear(2); + TF_AXIOM(d.GetNumSet() == 2); + TF_AXIOM(d.GetAsStringLeftToRight() == "0101"); + + c.Set(3); + TF_AXIOM(c.GetNumSet() == 3); + TF_AXIOM(c.GetAsStringLeftToRight() == "1101"); + + d &= c; + TF_AXIOM(d.GetNumSet() == 2); + TF_AXIOM(d.GetAsStringLeftToRight() == "0101"); + } + + // OR + { + TfCompressedBits c(4); + c = a | b; + TF_AXIOM(c.AreAllSet()); + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + c.Clear(0); + c.Clear(1); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "0011"); + + c |= a; + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + TfCompressedBits d(a); + d.Clear(0); + d.Clear(2); + TF_AXIOM(d.GetNumSet() == 2); + TF_AXIOM(d.GetAsStringLeftToRight() == "0101"); + + c.Clear(0); + c.Clear(3); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "0110"); + + d |= c; + TF_AXIOM(d.GetNumSet() == 3); + TF_AXIOM(d.GetAsStringLeftToRight() == "0111"); + } + + // XOR + { + TfCompressedBits c(4); + c = a ^ b; + TF_AXIOM(c.AreAllSet()); + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + c.Clear(0); + c.Clear(1); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "0011"); + + c ^= a; + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "1100"); + } + + // Complement + { + TfCompressedBits c(4); + a.Complement(); + c = a; + TF_AXIOM(c.AreAllUnset()); + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == "0000"); + + b.Complement(); + c = b; + TF_AXIOM(c.AreAllSet()); + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + c.Clear(0); + c.Clear(2); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "0101"); + + c.Complement(); + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "1010"); + } + + // Subtraction + { + TfCompressedBits c(4); + c.SetAll(); + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + TfCompressedBits d(4); + d.ClearAll(); + TF_AXIOM(d.GetNumSet() == 0); + TF_AXIOM(d.GetAsStringLeftToRight() == "0000"); + + c -= d; + TF_AXIOM(c.GetNumSet() == 4); + TF_AXIOM(c.GetAsStringLeftToRight() == "1111"); + + d -= c; + TF_AXIOM(d.GetNumSet() == 0); + TF_AXIOM(d.GetAsStringLeftToRight() == "0000"); + + d.Set(0); + TF_AXIOM(d.GetNumSet() == 1); + TF_AXIOM(d.GetAsStringLeftToRight() == "1000"); + + d -= c; + TF_AXIOM(d.GetNumSet() == 0); + TF_AXIOM(d.GetAsStringLeftToRight() == "0000"); + + d.Set(0); + d.Set(2); + TF_AXIOM(d.GetNumSet() == 2); + TF_AXIOM(d.GetAsStringLeftToRight() == "1010"); + + d -= c; + TF_AXIOM(d.GetNumSet() == 0); + TF_AXIOM(d.GetAsStringLeftToRight() == "0000"); + + d.Set(0); + d.Set(3); + TF_AXIOM(d.GetNumSet() == 2); + TF_AXIOM(d.GetAsStringLeftToRight() == "1001"); + + c -= d; + TF_AXIOM(c.GetNumSet() == 2); + TF_AXIOM(c.GetAsStringLeftToRight() == "0110"); + + d.SetAll(); + c -= d; + TF_AXIOM(c.GetNumSet() == 0); + TF_AXIOM(c.GetAsStringLeftToRight() == "0000"); + } + + + // Extra logic operations, compared against TfBits. + { + auto cc = TF_CALL_CONTEXT; + unsigned seed = std::time(0); + srand(seed); + + printf("Random seed is %u -- to debug, hard code this value around " + "line %zu in %s\n", seed, cc.GetLine(), cc.GetFile()); + + auto verifyEqual = [](char const *expr, + TfBits const &bits, + TfCompressedBits const &cbits) { + TF_VERIFY(bits.GetAsStringLeftToRight() == + cbits.GetAsStringLeftToRight(), + "%s -- bits: %s != compressed bits: %s", + expr, + bits.GetAsStringLeftToRight().c_str(), + cbits.GetAsStringLeftToRight().c_str()); + }; + + auto checkBits = [&verifyEqual]() { + TfBits a, b; + TfCompressedBits ca, cb; + size_t sz = rand() % 128; + if (sz == 0) { + sz = 1; + } + int nSets = rand() % sz; + a = TfBits(sz); + b = TfBits(sz); + ca = TfCompressedBits(sz); + cb = TfCompressedBits(sz); + for (int i = 0; i != nSets; ++i) { + int index = rand() % sz; + a.Set(index); + ca.Set(index); + verifyEqual("set1", a, ca); + index = rand() % sz; + b.Set(index); + cb.Set(index); + verifyEqual("set2", b, cb); + + verifyEqual("complement1", a.Complement(), ca.Complement()); + verifyEqual("complement2", a.Complement(), ca.Complement()); + verifyEqual("complement3", b.Complement(), cb.Complement()); + verifyEqual("complement4", b.Complement(), cb.Complement()); + + verifyEqual("bitor1", a | b, ca | cb); + verifyEqual("bitand1", a & b, ca & cb); + verifyEqual("bitxor1", a ^ b, ca ^ cb); + verifyEqual("bitsub1", a & TfBits(b).Complement(), ca - cb); + + verifyEqual("bitor2", a |= b, ca |= cb); + verifyEqual("bitand2", a &= b, ca &= cb); + verifyEqual("bitxor2", a ^= b, ca ^= cb); + verifyEqual("bitsub2", a -= b, ca -= cb); + + TF_VERIFY(a.Contains(b) == ca.Contains(cb)); + TF_VERIFY(a.HasNonEmptyDifference(b) == + ca.HasNonEmptyDifference(cb)); + TF_VERIFY(a.HasNonEmptyIntersection(b) == + ca.HasNonEmptyIntersection(cb)); + + TF_VERIFY(a.GetFirstSet() == ca.GetFirstSet(), + "a = %s, ca = %s", + a.GetAsStringLeftToRight().c_str(), + ca.GetAsStringLeftToRight().c_str()); + TF_VERIFY(b.GetFirstSet() == cb.GetFirstSet(), + "b = %s, cb = %s", + b.GetAsStringLeftToRight().c_str(), + cb.GetAsStringLeftToRight().c_str()); + + TF_VERIFY(a.GetLastSet() == ca.GetLastSet(), + "a = %s, ca = %s", + a.GetAsStringLeftToRight().c_str(), + ca.GetAsStringLeftToRight().c_str()); + TF_VERIFY(b.GetLastSet() == cb.GetLastSet(), + "b = %s, cb = %s", + b.GetAsStringLeftToRight().c_str(), + cb.GetAsStringLeftToRight().c_str()); + + TF_VERIFY(a.GetNumSet() == ca.GetNumSet(), + "a = %s, ca = %s", + a.GetAsStringLeftToRight().c_str(), + ca.GetAsStringLeftToRight().c_str()); + TF_VERIFY(b.GetNumSet() == cb.GetNumSet(), + "b = %s, cb = %s", + b.GetAsStringLeftToRight().c_str(), + cb.GetAsStringLeftToRight().c_str()); + } + }; + + // Do randomized testing for 2 seconds. + TfStopwatch runTimer; + while (runTimer.GetSeconds() < 2.0) { + runTimer.Start(); + checkBits(); + runTimer.Stop(); + } + } + + } + + // Contains and Overlaps + { + TfCompressedBits a(4); + a.SetRange(1, 3); + TF_AXIOM(a.GetAsStringLeftToRight() == "0111"); + + // Contains + TfCompressedBits b(4); + b.Set(0); + TF_AXIOM(b.GetAsStringLeftToRight() == "1000"); + TF_AXIOM(b.HasNonEmptyDifference(a)); + + b.Set(1); + TF_AXIOM(b.GetAsStringLeftToRight() == "1100"); + TF_AXIOM(b.HasNonEmptyDifference(a)); + + b.Set(2); + TF_AXIOM(b.GetAsStringLeftToRight() == "1110"); + TF_AXIOM(b.HasNonEmptyDifference(a)); + + b.Clear(0); + TF_AXIOM(b.GetAsStringLeftToRight() == "0110"); + TF_AXIOM(!b.HasNonEmptyDifference(a)); + + b.Clear(1); + TF_AXIOM(b.GetAsStringLeftToRight() == "0010"); + TF_AXIOM(!b.HasNonEmptyDifference(a)); + + b.Clear(2); + TF_AXIOM(b.GetAsStringLeftToRight() == "0000"); + TF_AXIOM(!b.HasNonEmptyDifference(a)); + + a.Clear(3); + b.Set(3); + TF_AXIOM(a.GetAsStringLeftToRight() == "0110"); + TF_AXIOM(b.GetAsStringLeftToRight() == "0001"); + TF_AXIOM(b.HasNonEmptyDifference(a)); + + // Overlaps + TF_AXIOM(!b.HasNonEmptyIntersection(a)); + + a.Set(3); + TF_AXIOM(a.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.HasNonEmptyIntersection(a)); + + b.Clear(3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0000"); + TF_AXIOM(!b.HasNonEmptyIntersection(a)); + + b.Set(2); + TF_AXIOM(b.GetAsStringLeftToRight() == "0010"); + TF_AXIOM(b.HasNonEmptyIntersection(a)); + + b.Set(1); + TF_AXIOM(b.GetAsStringLeftToRight() == "0110"); + TF_AXIOM(b.HasNonEmptyIntersection(a)); + + b.Set(3); + TF_AXIOM(b.GetAsStringLeftToRight() == "0111"); + TF_AXIOM(b.HasNonEmptyIntersection(a)); + + TfCompressedBits c(4); + c.Set(0); + TF_AXIOM(c.GetAsStringLeftToRight() == "1000"); + TF_AXIOM(!b.HasNonEmptyIntersection(c)); + } + + // Grow and shrink word counts. This should also grow/shrink across + // the local storage optimization threshold. + { + TfCompressedBits a(10); + TF_AXIOM(a.GetNumSet() == 0); + TF_AXIOM(a.GetAsStringLeftToRight() == "0000000000"); + TF_AXIOM(a.GetNumPlatforms() == 1); + TF_AXIOM(a.GetNumSetPlatforms() == 0); + TF_AXIOM(a.GetNumUnsetPlatforms() == 1); + + // Set every other bit, to create a lot of words / platforms + a.Set(0); + TF_AXIOM(a.GetNumSet() == 1); + TF_AXIOM(a.GetAsStringLeftToRight() == "1000000000"); + TF_AXIOM(a.GetNumPlatforms() == 2); + TF_AXIOM(a.GetNumSetPlatforms() == 1); + TF_AXIOM(a.GetNumUnsetPlatforms() == 1); + + a.Set(2); + TF_AXIOM(a.GetNumSet() == 2); + TF_AXIOM(a.GetAsStringLeftToRight() == "1010000000"); + TF_AXIOM(a.GetNumPlatforms() == 4); + TF_AXIOM(a.GetNumSetPlatforms() == 2); + TF_AXIOM(a.GetNumUnsetPlatforms() == 2); + + a.Set(4); + TF_AXIOM(a.GetNumSet() == 3); + TF_AXIOM(a.GetAsStringLeftToRight() == "1010100000"); + TF_AXIOM(a.GetNumPlatforms() == 6); + TF_AXIOM(a.GetNumSetPlatforms() == 3); + TF_AXIOM(a.GetNumUnsetPlatforms() == 3); + + a.Set(6); + TF_AXIOM(a.GetNumSet() == 4); + TF_AXIOM(a.GetAsStringLeftToRight() == "1010101000"); + TF_AXIOM(a.GetNumPlatforms() == 8); + TF_AXIOM(a.GetNumSetPlatforms() == 4); + TF_AXIOM(a.GetNumUnsetPlatforms() == 4); + + a.Set(8); + TF_AXIOM(a.GetNumSet() == 5); + TF_AXIOM(a.GetAsStringLeftToRight() == "1010101010"); + TF_AXIOM(a.GetNumPlatforms() == 10); + TF_AXIOM(a.GetNumSetPlatforms() == 5); + TF_AXIOM(a.GetNumUnsetPlatforms() == 5); + + // Set ever other bit to consolidate words / platforms + a.Set(1); + TF_AXIOM(a.GetNumSet() == 6); + TF_AXIOM(a.GetAsStringLeftToRight() == "1110101010"); + TF_AXIOM(a.GetNumPlatforms() == 8); + TF_AXIOM(a.GetNumSetPlatforms() == 4); + TF_AXIOM(a.GetNumUnsetPlatforms() == 4); + + a.Set(3); + TF_AXIOM(a.GetNumSet() == 7); + TF_AXIOM(a.GetAsStringLeftToRight() == "1111101010"); + TF_AXIOM(a.GetNumPlatforms() == 6); + TF_AXIOM(a.GetNumSetPlatforms() == 3); + TF_AXIOM(a.GetNumUnsetPlatforms() == 3); + + a.Set(5); + TF_AXIOM(a.GetNumSet() == 8); + TF_AXIOM(a.GetAsStringLeftToRight() == "1111111010"); + TF_AXIOM(a.GetNumPlatforms() == 4); + TF_AXIOM(a.GetNumSetPlatforms() == 2); + TF_AXIOM(a.GetNumUnsetPlatforms() == 2); + + a.Set(7); + TF_AXIOM(a.GetNumSet() == 9); + TF_AXIOM(a.GetAsStringLeftToRight() == "1111111110"); + TF_AXIOM(a.GetNumPlatforms() == 2); + TF_AXIOM(a.GetNumSetPlatforms() == 1); + TF_AXIOM(a.GetNumUnsetPlatforms() == 1); + + a.Set(9); + TF_AXIOM(a.GetNumSet() == 10); + TF_AXIOM(a.GetAsStringLeftToRight() == "1111111111"); + TF_AXIOM(a.GetNumPlatforms() == 1); + TF_AXIOM(a.GetNumSetPlatforms() == 1); + TF_AXIOM(a.GetNumUnsetPlatforms() == 0); + } + + // Iterators + { + TfCompressedBits c(8); + c.Set(1); + c.Set(2); + c.Set(3); + c.Set(6); + c.Set(7); + TF_AXIOM(c.GetNumSet() == 5); + TF_AXIOM(c.GetAsStringLeftToRight() == "01110011"); + TF_AXIOM(c.GetFirstSet() == 1); + TF_AXIOM(c.GetLastSet() == 7); + TF_AXIOM(c.IsAnySet()); + TF_AXIOM(c.IsAnyUnset()); + TF_AXIOM(!c.AreAllSet()); + TF_AXIOM(!c.AreAllUnset()); + TF_AXIOM(!c.AreContiguouslySet()); + + size_t numSet = c.GetNumSet(); + TF_AXIOM(numSet == 5); + + // Verify inidividual values + TF_AXIOM(!c.IsSet(0)); + TF_AXIOM(c.IsSet(1)); + TF_AXIOM(c.IsSet(2)); + TF_AXIOM(c.IsSet(3)); + TF_AXIOM(!c.IsSet(4)); + TF_AXIOM(!c.IsSet(5)); + TF_AXIOM(c.IsSet(6)); + TF_AXIOM(c.IsSet(7)); + + // All + { + size_t count = 0; + size_t accumIndices = 0; + size_t accumValues = 0; + TfCompressedBits::AllView v = c.GetAllView(); + TF_FOR_ALL (it, v) { + ++count; + std::cout << " " << *it; + accumIndices += *it; + accumValues += it.base().IsSet(); + } + TF_AXIOM(count == 8); + TF_AXIOM(accumIndices == 28); + TF_AXIOM(accumValues == 5); + std::cout << "\n"; + } + + // All Set + { + size_t count = 0; + size_t accumIndices = 0; + size_t accumValues = 0; + TfCompressedBits::AllSetView v = c.GetAllSetView(); + TF_FOR_ALL (it, v) { + ++count; + std::cout << " " << *it; + accumIndices += *it; + accumValues += it.base().IsSet(); + } + TF_AXIOM(count == 5); + TF_AXIOM(accumIndices == 19); + TF_AXIOM(accumValues == 5); + std::cout << "\n"; + } + + // All Unset + { + size_t count = 0; + size_t accumIndices = 0; + size_t accumValues = 0; + TfCompressedBits::AllUnsetView v = c.GetAllUnsetView(); + TF_FOR_ALL (it, v) { + ++count; + std::cout << " " << *it; + accumIndices += *it; + accumValues += it.base().IsSet(); + } + TF_AXIOM(count == 3); + TF_AXIOM(accumIndices == 9); + TF_AXIOM(accumValues == 0); + std::cout << "\n"; + } + + // All Platforms + { + size_t count = 0; + size_t accumIndices = 0; + size_t accumValues = 0; + size_t accumPlatformSize = 0; + TfCompressedBits::PlatformsView v = c.GetPlatformsView(); + for (TfCompressedBits::PlatformsView::const_iterator + it=v.begin(), e=v.end(); it != e; ++it) { + ++count; + std::cout << " " << *it; + accumIndices += *it; + accumValues += it.IsSet(); + accumPlatformSize += it.GetPlatformSize(); + } + TF_AXIOM(count == 4); + TF_AXIOM(accumIndices == 11); + TF_AXIOM(accumValues == 2); + TF_AXIOM(accumPlatformSize == 8); + std::cout << "\n"; + } + + // Empty mask + { + TfCompressedBits d(8); + TfCompressedBits::AllSetView vd = d.GetAllSetView(); + TF_AXIOM(vd.begin().IsAtEnd()); + TF_AXIOM(vd.begin() == vd.end()); + + TfCompressedBits e; + TfCompressedBits::AllSetView ve = e.GetAllSetView(); + TF_AXIOM(ve.begin().IsAtEnd()); + TF_AXIOM(ve.begin() == ve.end()); + } + + // All ones mask + { + TfCompressedBits d(8); + d.SetAll(); + TfCompressedBits::AllSetView vd = d.GetAllSetView(); + TF_AXIOM(!vd.begin().IsAtEnd()); + TF_AXIOM(vd.begin() != vd.end()); + size_t count = 0; + TF_FOR_ALL (it, vd) { + ++count; + } + TF_AXIOM(count == 8); + + TfCompressedBits e(1); + e.SetAll(); + TfCompressedBits::AllSetView ve = e.GetAllSetView(); + TF_AXIOM(!ve.begin().IsAtEnd()); + TF_AXIOM(ve.begin() != ve.end()); + count = 0; + TF_FOR_ALL (it, ve) { + ++count; + } + TF_AXIOM(count == 1); + } + + // Default-constructed iterators are (sadly) required to report + // IsAtEnd(). + { + TfCompressedBits::AllView::const_iterator i1; + TfCompressedBits::AllSetView::const_iterator i2; + TfCompressedBits::AllUnsetView::const_iterator i3; + TF_AXIOM(i1.IsAtEnd()); + TF_AXIOM(i2.IsAtEnd()); + TF_AXIOM(i3.IsAtEnd()); + } + + // FindNextSet and Friends + // XXX: Deprecated API - would like to remove + { + size_t accumIndices = 0; + size_t i = c.GetFirstSet(); + while (i < c.GetSize()) { + accumIndices += i; + i = c.FindNextSet(i + 1); + } + TF_AXIOM(accumIndices == 19); + + accumIndices = 0; + i = c.GetLastSet(); + while (i < c.GetSize()) { + accumIndices += i; + if (i < 1) { + break; + } + i = c.FindPrevSet(i - 1); + } + TF_AXIOM(accumIndices == 19); + + accumIndices = 0; + i = 0; + while (i < c.GetSize()) { + accumIndices += i; + i = c.FindNextUnset(i + 1); + } + TF_AXIOM(accumIndices == 9); + } + + // Find n-th set + { + // 01110011 + TF_AXIOM(c.FindNthSet(0) == 1); + TF_AXIOM(c.FindNthSet(1) == 2); + TF_AXIOM(c.FindNthSet(2) == 3); + TF_AXIOM(c.FindNthSet(3) == 6); + TF_AXIOM(c.FindNthSet(4) == 7); + TF_AXIOM(c.FindNthSet(5) == c.GetSize()); + TF_AXIOM(c.FindNthSet(6) == c.GetSize()); + TF_AXIOM(c.FindNthSet(100) == c.GetSize()); + + // 10001100 + TfCompressedBits ic(c); + ic.Complement(); + TF_AXIOM(ic.FindNthSet(0) == 0); + TF_AXIOM(ic.FindNthSet(1) == 4); + TF_AXIOM(ic.FindNthSet(2) == 5); + TF_AXIOM(ic.FindNthSet(3) == ic.GetSize()); + TF_AXIOM(ic.FindNthSet(4) == ic.GetSize()); + TF_AXIOM(ic.FindNthSet(100) == ic.GetSize()); + + // 1111 + TfCompressedBits ac(4); + ac.SetAll(); + TF_AXIOM(ac.FindNthSet(0) == 0); + TF_AXIOM(ac.FindNthSet(1) == 1); + TF_AXIOM(ac.FindNthSet(2) == 2); + TF_AXIOM(ac.FindNthSet(3) == 3); + TF_AXIOM(ac.FindNthSet(4) == ac.GetSize()); + TF_AXIOM(ac.FindNthSet(100) == ac.GetSize()); + + // 0000 + TfCompressedBits nc(4); + TF_AXIOM(nc.FindNthSet(0) == nc.GetSize()); + TF_AXIOM(nc.FindNthSet(1) == nc.GetSize()); + TF_AXIOM(nc.FindNthSet(2) == nc.GetSize()); + TF_AXIOM(nc.FindNthSet(3) == nc.GetSize()); + TF_AXIOM(nc.FindNthSet(4) == nc.GetSize()); + TF_AXIOM(nc.FindNthSet(100) == nc.GetSize()); + } + } + + // Compress / Decompress + { + TfBits c(10); + c.Set(1); + c.Set(2); + c.Set(6); + c.Set(7); + c.Set(8); + TF_AXIOM(c.GetAsStringLeftToRight() == "0110001110"); + + TfCompressedBits cc = TfCompressedBits(c); + TF_AXIOM(cc.GetAsStringLeftToRight() == "0110001110"); + + size_t numSet = cc.GetNumSet(); + TF_AXIOM(numSet == 5); + + c.Complement(); + TF_AXIOM(c.GetAsStringLeftToRight() == "1001110001"); + + cc = TfCompressedBits(c); + TF_AXIOM(cc.GetAsStringLeftToRight() == "1001110001"); + + TfBits d; + cc.Decompress(&d); + TF_AXIOM(d.GetAsStringLeftToRight() == "1001110001"); + + // 1x1 and 1x0 masks + TfBits e(1); + c.ClearAll(); + TF_AXIOM(e.GetAsStringLeftToRight() == "0"); + + cc = TfCompressedBits(e); + TF_AXIOM(cc.GetSize() == 1); + TF_AXIOM(cc.GetNumSet() == 0); + TF_AXIOM(!cc.IsSet(0)); + TF_AXIOM(cc.GetAsStringLeftToRight() == "0"); + + e.SetAll(); + TF_AXIOM(e.GetAsStringLeftToRight() == "1"); + + cc = TfCompressedBits(e); + TF_AXIOM(cc.GetSize() == 1); + TF_AXIOM(cc.GetNumSet() == 1); + TF_AXIOM(cc.IsSet(0)); + TF_AXIOM(cc.GetAsStringLeftToRight() == "1"); + } + + // Shift + { + size_t numSet; + + // Right + TfCompressedBits c(8); + c.Set(2); + c.Set(3); + c.Set(4); + c.Set(6); + TF_AXIOM(c.GetAsStringLeftToRight() == "00111010"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftRight(0); + TF_AXIOM(c.GetAsStringLeftToRight() == "00111010"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftRight(1); + TF_AXIOM(c.GetAsStringLeftToRight() == "00011101"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftRight(1); + TF_AXIOM(c.GetAsStringLeftToRight() == "00001110"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 3); + + c.ShiftRight(2); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000011"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 2); + + c.ShiftRight(5); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.Set(0); + c.Set(1); + c.Set(2); + c.Set(3); + c.Set(6); + c.Set(7); + TF_AXIOM(c.GetAsStringLeftToRight() == "11110011"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 6); + + c.ShiftRight(3); + TF_AXIOM(c.GetAsStringLeftToRight() == "00011110"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftRight(3); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000011"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 2); + + c.ShiftRight(2); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.Complement(); + TF_AXIOM(c.GetAsStringLeftToRight() == "11111111"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 8); + + c.ShiftRight(4); + TF_AXIOM(c.GetAsStringLeftToRight() == "00001111"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftRight(100); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.ShiftRight(100); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + // Left + c.ClearAll(); + c.Set(2); + c.Set(3); + c.Set(4); + c.Set(6); + TF_AXIOM(c.GetAsStringLeftToRight() == "00111010"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftLeft(0); + TF_AXIOM(c.GetAsStringLeftToRight() == "00111010"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftLeft(1); + TF_AXIOM(c.GetAsStringLeftToRight() == "01110100"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftLeft(1); + TF_AXIOM(c.GetAsStringLeftToRight() == "11101000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftLeft(2); + TF_AXIOM(c.GetAsStringLeftToRight() == "10100000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 2); + + c.ShiftLeft(5); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.Set(0); + c.Set(1); + c.Set(2); + c.Set(3); + c.Set(6); + c.Set(7); + TF_AXIOM(c.GetAsStringLeftToRight() == "11110011"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 6); + + c.ShiftLeft(3); + TF_AXIOM(c.GetAsStringLeftToRight() == "10011000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 3); + + c.ShiftLeft(3); + TF_AXIOM(c.GetAsStringLeftToRight() == "11000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 2); + + c.ShiftLeft(2); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.Complement(); + TF_AXIOM(c.GetAsStringLeftToRight() == "11111111"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 8); + + c.ShiftLeft(4); + TF_AXIOM(c.GetAsStringLeftToRight() == "11110000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 4); + + c.ShiftLeft(100); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + + c.ShiftLeft(100); + TF_AXIOM(c.GetAsStringLeftToRight() == "00000000"); + numSet = c.GetNumSet(); + TF_AXIOM(numSet == 0); + } + + // Resizing + { + TfCompressedBits b(6); + b.Set(0); + b.Set(1); + b.Set(4); + TF_AXIOM(b.GetAsStringLeftToRight() == "110010"); + + b.ResizeKeepContents(6); + TF_AXIOM(b.GetAsStringLeftToRight() == "110010"); + + b.ResizeKeepContents(10); + TF_AXIOM(b.GetAsStringLeftToRight() == "1100100000"); + + b.ResizeKeepContents(6); + TF_AXIOM(b.GetAsStringLeftToRight() == "110010"); + + b.ResizeKeepContents(2); + TF_AXIOM(b.GetAsStringLeftToRight() == "11"); + + b.ResizeKeepContents(1); + TF_AXIOM(b.GetAsStringLeftToRight() == "1"); + + b.ResizeKeepContents(0); + TF_AXIOM(b.GetSize() == 0); + TF_AXIOM(b.GetNumSet() == 0); + } + + // TfBits API compatibility + { + TfBits a(0); + TfCompressedBits b(0); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a.SetAll(); + b.SetAll(); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a = TfBits(1); + b = TfCompressedBits(1); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a.SetAll(); + b.SetAll(); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a = TfBits(4); + b = TfCompressedBits(4); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a.SetAll(); + b.SetAll(); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a.Clear(0); + a.Clear(3); + b.Clear(0); + b.Clear(3); + a.SetAll(); + b.SetAll(); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + + a.Complement(); + b.Complement(); + Test_TfCompressedBits_VerifyEqualityWithConversion(a, b); + } + + // Testing against a bug where TfCompressedBits was left in an internally + // inconsistent state: The platforms array would contain zeroes, when _num + // was unequal zero. + { + TfCompressedBits a(4); + a.SetRange(0, 3); + + TfCompressedBits b(4); + b.SetAll(); + + TF_AXIOM(a == b); + + a.ClearAll(); + a.SetRange(2, 3); + b.Clear(0); + b.Clear(1); + TF_AXIOM(a == b); + } + + // Test building a TfCompressedBits from a string representation. + { + TfCompressedBits c = TfCompressedBits::FromString("0x5-1x5-0x5"); + TF_AXIOM(c.GetAsStringLeftToRight() == "000001111100000"); + TF_AXIOM(c.GetAsRLEString() == "0x5-1x5-0x5"); + + c = TfCompressedBits::FromString(" 0x5 - 1x5 - 0 x 5 "); + TF_AXIOM(c.GetAsStringLeftToRight() == "000001111100000"); + TF_AXIOM(c.GetAsRLEString() == "0x5-1x5-0x5"); + + c = TfCompressedBits::FromString("000001111100000"); + TF_AXIOM(c.GetAsStringLeftToRight() == "000001111100000"); + TF_AXIOM(c.GetAsRLEString() == "0x5-1x5-0x5"); + + c = TfCompressedBits::FromString("00000 11111 000 00"); + TF_AXIOM(c.GetAsStringLeftToRight() == "000001111100000"); + TF_AXIOM(c.GetAsRLEString() == "0x5-1x5-0x5"); + + c = TfCompressedBits::FromString("0x15"); + TF_AXIOM(c.GetAsStringLeftToRight() == "000000000000000"); + TF_AXIOM(c.GetAsRLEString() == "0x15"); + + c = TfCompressedBits::FromString("1x15"); + TF_AXIOM(c.GetAsStringLeftToRight() == "111111111111111"); + TF_AXIOM(c.GetAsRLEString() == "1x15"); + + // Invalid string formulations + c = TfCompressedBits::FromString("3x15"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("1x0"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("0x5x1"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("0x5-1"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("0-5x1"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("foo bar"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("1x15 foo"); + TF_AXIOM(c.GetSize() == 0); + + c = TfCompressedBits::FromString("000001111122222"); + TF_AXIOM(c.GetSize() == 0); + } + + std::cout << "... success!\n\n"; + + return true; +} + +TF_ADD_REGTEST(TfCompressedBits); From cba89a3abe16e188fcf3e800ea908169f2731f4d Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 20 Aug 2024 09:12:27 -0700 Subject: [PATCH 068/202] Update github PR template (Internal change: 2337474) --- .github/pull_request_template.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b43d3fadf0..c3cd324aaa 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,17 @@ ### Description of Change(s) +### Link to proposal ([if applicable](https://openusd.org/release/contributing_to_usd.html#step-1-get-consensus-for-major-changes)) + ### Fixes Issue(s) -- - -- [ ] I have verified that all unit tests pass with the proposed changes - -- [ ] I have submitted a signed Contributor License Agreement +### Checklist + +[ ] I have followed the [coding conventions](https://openusd.org/release/api/_page__coding__guidelines.html) + +[ ] I have added unit tests that exercise this functionality (Reference: +[testing guidelines](https://openusd.org/release/api/_page__testing__guidelines.html)) + +[ ] I have verified that all unit tests pass with the proposed changes + +[ ] I have submitted a signed Contributor License Agreement (Reference: +[Contributor License Agreement instructions](https://openusd.org/release/contributing_to_usd.html#contributor-license-agreement)) From c527aad6283424a4d8e0313619926405e8ae3906 Mon Sep 17 00:00:00 2001 From: rajabala Date: Tue, 20 Aug 2024 09:12:41 -0700 Subject: [PATCH 069/202] [hdGp] Don't cook procedurals during scene queries. Fixes a subtle bug when GetChildPrimPaths(procPrimPath) is called before the added notices for the procedural are sent/processed. In this scenario, the added notices for generated prims weren't being sent at all (even though the procedural was being cooked again in response to the added notice) causing the generated prims to not show up. It also makes the behavior in GetPrim and GetChildPrimPaths consistent in that we don't cook the procedural in either of these scene query methods. When queried with an uncooked procedural prim path or a not-yet-generated child prim path (e.g. notice-less traversal), we simply return the input scene's result. (Internal change: 2337499) --- ...enerativeProceduralResolvingSceneIndex.cpp | 71 +++++++++---------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/pxr/imaging/hdGp/generativeProceduralResolvingSceneIndex.cpp b/pxr/imaging/hdGp/generativeProceduralResolvingSceneIndex.cpp index d29c8d460c..306ffade92 100644 --- a/pxr/imaging/hdGp/generativeProceduralResolvingSceneIndex.cpp +++ b/pxr/imaging/hdGp/generativeProceduralResolvingSceneIndex.cpp @@ -33,6 +33,8 @@ HdGpGenerativeProceduralResolvingSceneIndex:: , _targetPrimTypeName(HdGpGenerativeProceduralTokens->generativeProcedural) , _attemptAsync(false) { + // XXX The input scene may not be empty. We should traverse it to find any + // targeted procedurals and cook them. } HdGpGenerativeProceduralResolvingSceneIndex:: @@ -43,6 +45,8 @@ HdGpGenerativeProceduralResolvingSceneIndex:: , _targetPrimTypeName(targetPrimTypeName) , _attemptAsync(false) { + // XXX The input scene may not be empty. We should traverse it to find any + // targeted procedurals and cook them. } /* virtual */ @@ -50,14 +54,14 @@ HdSceneIndexPrim HdGpGenerativeProceduralResolvingSceneIndex::GetPrim( const SdfPath &primPath) const { - + // Cooking of procedurals is driven by notices. + // Don't cook the procedural in response to scene queries. + // const auto it = _generatedPrims.find(primPath); if (it != _generatedPrims.end()) { if (_ProcEntry *procEntry = it->second.responsibleProc.load()) { // need to exclude prim-level deal itself from the returned value - - if (std::shared_ptr proc = procEntry->proc) { return proc->GetChildPrim( @@ -68,10 +72,7 @@ HdGpGenerativeProceduralResolvingSceneIndex::GetPrim( HdSceneIndexPrim prim = _GetInputSceneIndex()->GetPrim(primPath); if (prim.primType == _targetPrimTypeName) { - // TODO? confirm it's cooked? - //_Notices notices; - //_UpdateProcedural(primPath, false, ¬ices); - + // XXX Add schema to reflect status of the procedural (cooked/uncooked)? prim.primType = HdGpGenerativeProceduralTokens->resolvedGenerativeProcedural; } @@ -110,43 +111,35 @@ HdGpGenerativeProceduralResolvingSceneIndex::GetChildPrimPaths( SdfPathVector inputResult = _GetInputSceneIndex()->GetChildPrimPaths(primPath); - // Check to see if the requested path already exists as a prim managed by - // a procedural. Look up what the procedural added and potentially combine - // with what might be present on the input scene. + // Cooking of procedurals is driven by notices. + // Don't cook the procedural in response to scene queries. + // + // First, check if this is a procedural prim that we've cooked. + // + _ProcEntryMap::iterator procIt = _procedurals.find(primPath); + if (procIt != _procedurals.end()) { + _ProcEntry &procEntry = procIt->second; + std::unique_lock cookLock(procEntry.cookMutex); + const auto chIt = procEntry.childHierarchy.find(primPath); + if (chIt != procEntry.childHierarchy.end()) { + _CombinePathArrays(chIt->second, &inputResult); + } + return inputResult; + } + + // Check to see if the requested path already exists as a generated + // prim managed by a procedural. Look up what the procedural added and + // potentially combine with what might be present on the input scene. // - // XXX: This doesn't cause a procedural to be run at an ancestor path -- - // so we'd expect a notice-less traversal case to have already called - // GetChildPrimPaths with the parent procedural. The overhead of - // ensuring that happens for every scope outweighs the unlikely - // possibility of incorrect results for a speculative query without - // hitting any of the existing triggers. const auto it = _generatedPrims.find(primPath); if (it != _generatedPrims.end()) { if (_ProcEntry *procEntry = it->second.responsibleProc.load()) { std::unique_lock cookLock(procEntry->cookMutex); const auto chIt = procEntry->childHierarchy.find(primPath); if (chIt != procEntry->childHierarchy.end()) { - _CombinePathArrays(chIt->second, &inputResult); - return inputResult; - } - } - } - - HdSceneIndexPrim prim = _GetInputSceneIndex()->GetPrim(primPath); - if (prim.primType == _targetPrimTypeName) { - _Notices notices; - - // cook if necessary to find child prim paths. Do not forward notices - // as use of this API implies a non-notice-driven traversal. - if (_ProcEntry *procEntry = - _UpdateProcedural(primPath, false, ¬ices)) { - - std::unique_lock cookLock(procEntry->cookMutex); - const auto hIt = procEntry->childHierarchy.find(primPath); - if (hIt != procEntry->childHierarchy.end()) { - _CombinePathArrays(hIt->second, &inputResult); } + return inputResult; } } @@ -906,10 +899,10 @@ HdGpGenerativeProceduralResolvingSceneIndex::_SystemMessage( _attemptAsync = true; } return; - } else { - if (messageType != HdSystemMessageTokens->asyncPoll) { - return; - } + } + + if (messageType != HdSystemMessageTokens->asyncPoll) { + return; } _Notices notices; From f2b69a7903ed184645bb3c8992d7fb4bfe0bfa3e Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 20 Aug 2024 09:14:59 -0700 Subject: [PATCH 070/202] usd: Simplify Python wrapping for generated static tokens in schemas This is essentially the same as change 2336557, but must be done separately because static tokens in schema libraries don't use the typical static token functionality from Tf. (Internal change: 2337508) --- .../examples/usdSchemaExamples/wrapTokens.cpp | 52 +-- pxr/usd/usd/codegenTemplates/wrapTokens.cpp | 36 +- .../baseline/basic/wrapTokens.cpp | 342 +++++++------- .../headerTerminatorString/wrapTokens.cpp | 82 ++-- .../baseline/namespace/wrapTokens.cpp | 82 ++-- .../baseline/nestedNamespace/wrapTokens.cpp | 82 ++-- .../useLiteralIdentifier/wrapTokens.cpp | 76 +-- pxr/usd/usd/wrapTokens.cpp | 74 +-- pxr/usd/usdGeom/wrapTokens.cpp | 438 ++++++++---------- pxr/usd/usdHydra/wrapTokens.cpp | 94 ++-- pxr/usd/usdLux/wrapTokens.cpp | 200 ++++---- pxr/usd/usdMedia/wrapTokens.cpp | 76 +-- pxr/usd/usdPhysics/wrapTokens.cpp | 210 ++++----- pxr/usd/usdProc/wrapTokens.cpp | 38 +- pxr/usd/usdRender/wrapTokens.cpp | 130 ++---- pxr/usd/usdRi/wrapTokens.cpp | 72 +-- pxr/usd/usdShade/wrapTokens.cpp | 110 ++--- pxr/usd/usdSkel/wrapTokens.cpp | 92 ++-- pxr/usd/usdUI/wrapTokens.cpp | 66 +-- pxr/usd/usdVol/wrapTokens.cpp | 118 ++--- 20 files changed, 935 insertions(+), 1535 deletions(-) diff --git a/extras/usd/examples/usdSchemaExamples/wrapTokens.cpp b/extras/usd/examples/usdSchemaExamples/wrapTokens.cpp index 5ced1826e2..3833eef737 100644 --- a/extras/usd/examples/usdSchemaExamples/wrapTokens.cpp +++ b/extras/usd/examples/usdSchemaExamples/wrapTokens.cpp @@ -10,50 +10,20 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdSchemaExamplesTokens->name.GetString(); }); void wrapUsdSchemaExamplesTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "complexString", UsdSchemaExamplesTokens->complexString); - _AddToken(cls, "intAttr", UsdSchemaExamplesTokens->intAttr); - _AddToken(cls, "paramsMass", UsdSchemaExamplesTokens->paramsMass); - _AddToken(cls, "paramsVelocity", UsdSchemaExamplesTokens->paramsVelocity); - _AddToken(cls, "paramsVolume", UsdSchemaExamplesTokens->paramsVolume); - _AddToken(cls, "target", UsdSchemaExamplesTokens->target); - _AddToken(cls, "ComplexPrim", UsdSchemaExamplesTokens->ComplexPrim); - _AddToken(cls, "ParamsAPI", UsdSchemaExamplesTokens->ParamsAPI); - _AddToken(cls, "SimplePrim", UsdSchemaExamplesTokens->SimplePrim); + _ADD_TOKEN(cls, complexString); + _ADD_TOKEN(cls, intAttr); + _ADD_TOKEN(cls, paramsMass); + _ADD_TOKEN(cls, paramsVelocity); + _ADD_TOKEN(cls, paramsVolume); + _ADD_TOKEN(cls, target); + _ADD_TOKEN(cls, ComplexPrim); + _ADD_TOKEN(cls, ParamsAPI); + _ADD_TOKEN(cls, SimplePrim); } diff --git a/pxr/usd/usd/codegenTemplates/wrapTokens.cpp b/pxr/usd/usd/codegenTemplates/wrapTokens.cpp index 035d22dcad..0ea2043089 100644 --- a/pxr/usd/usd/codegenTemplates/wrapTokens.cpp +++ b/pxr/usd/usd/codegenTemplates/wrapTokens.cpp @@ -12,44 +12,14 @@ {{ namespaceUsing }} {% endif %} -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return {{ tokensPrefix }}Tokens->name.GetString(); }); void wrap{{ tokensPrefix }}Tokens() { boost::python::class_<{{ tokensPrefix }}TokensType, boost::noncopyable> cls("Tokens", boost::python::no_init); {% for token in tokens %} - _AddToken(cls, "{{ token.id }}", {{ tokensPrefix }}Tokens->{{ token.id }}); + _ADD_TOKEN(cls, {{ token.id }}); {% endfor %} } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp index 60abefd25e..4c2552d34a 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/basic/wrapTokens.cpp @@ -10,195 +10,165 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdContrivedTokens->name.GetString(); }); void wrapUsdContrivedTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "asset", UsdContrivedTokens->asset); - _AddToken(cls, "assetArray", UsdContrivedTokens->assetArray); - _AddToken(cls, "attrWithoutGeneratedAccessorAPI", UsdContrivedTokens->attrWithoutGeneratedAccessorAPI); - _AddToken(cls, "binding", UsdContrivedTokens->binding); - _AddToken(cls, "bool_", UsdContrivedTokens->bool_); - _AddToken(cls, "boolArray", UsdContrivedTokens->boolArray); - _AddToken(cls, "color3d", UsdContrivedTokens->color3d); - _AddToken(cls, "color3dArray", UsdContrivedTokens->color3dArray); - _AddToken(cls, "color3f", UsdContrivedTokens->color3f); - _AddToken(cls, "color3fArray", UsdContrivedTokens->color3fArray); - _AddToken(cls, "color3h", UsdContrivedTokens->color3h); - _AddToken(cls, "color3hArray", UsdContrivedTokens->color3hArray); - _AddToken(cls, "color4d", UsdContrivedTokens->color4d); - _AddToken(cls, "color4dArray", UsdContrivedTokens->color4dArray); - _AddToken(cls, "color4f", UsdContrivedTokens->color4f); - _AddToken(cls, "color4fArray", UsdContrivedTokens->color4fArray); - _AddToken(cls, "color4h", UsdContrivedTokens->color4h); - _AddToken(cls, "color4hArray", UsdContrivedTokens->color4hArray); - _AddToken(cls, "cornerIndices", UsdContrivedTokens->cornerIndices); - _AddToken(cls, "cornerSharpnesses", UsdContrivedTokens->cornerSharpnesses); - _AddToken(cls, "creaseLengths", UsdContrivedTokens->creaseLengths); - _AddToken(cls, "double2", UsdContrivedTokens->double2); - _AddToken(cls, "double2Array", UsdContrivedTokens->double2Array); - _AddToken(cls, "double3", UsdContrivedTokens->double3); - _AddToken(cls, "double3Array", UsdContrivedTokens->double3Array); - _AddToken(cls, "double4", UsdContrivedTokens->double4); - _AddToken(cls, "double4Array", UsdContrivedTokens->double4Array); - _AddToken(cls, "double_", UsdContrivedTokens->double_); - _AddToken(cls, "doubleArray", UsdContrivedTokens->doubleArray); - _AddToken(cls, "float2", UsdContrivedTokens->float2); - _AddToken(cls, "float2Array", UsdContrivedTokens->float2Array); - _AddToken(cls, "float3", UsdContrivedTokens->float3); - _AddToken(cls, "float3Array", UsdContrivedTokens->float3Array); - _AddToken(cls, "float4", UsdContrivedTokens->float4); - _AddToken(cls, "float4Array", UsdContrivedTokens->float4Array); - _AddToken(cls, "float_", UsdContrivedTokens->float_); - _AddToken(cls, "floatArray", UsdContrivedTokens->floatArray); - _AddToken(cls, "frame4d", UsdContrivedTokens->frame4d); - _AddToken(cls, "frame4dArray", UsdContrivedTokens->frame4dArray); - _AddToken(cls, "half", UsdContrivedTokens->half); - _AddToken(cls, "half2", UsdContrivedTokens->half2); - _AddToken(cls, "half2Array", UsdContrivedTokens->half2Array); - _AddToken(cls, "half3", UsdContrivedTokens->half3); - _AddToken(cls, "half3Array", UsdContrivedTokens->half3Array); - _AddToken(cls, "half4", UsdContrivedTokens->half4); - _AddToken(cls, "half4Array", UsdContrivedTokens->half4Array); - _AddToken(cls, "halfArray", UsdContrivedTokens->halfArray); - _AddToken(cls, "holeIndices", UsdContrivedTokens->holeIndices); - _AddToken(cls, "int2", UsdContrivedTokens->int2); - _AddToken(cls, "int2Array", UsdContrivedTokens->int2Array); - _AddToken(cls, "int3", UsdContrivedTokens->int3); - _AddToken(cls, "int3Array", UsdContrivedTokens->int3Array); - _AddToken(cls, "int4", UsdContrivedTokens->int4); - _AddToken(cls, "int4Array", UsdContrivedTokens->int4Array); - _AddToken(cls, "int64", UsdContrivedTokens->int64); - _AddToken(cls, "int64Array", UsdContrivedTokens->int64Array); - _AddToken(cls, "int_", UsdContrivedTokens->int_); - _AddToken(cls, "intArray", UsdContrivedTokens->intArray); - _AddToken(cls, "justDefault", UsdContrivedTokens->justDefault); - _AddToken(cls, "libraryToken1", UsdContrivedTokens->libraryToken1); - _AddToken(cls, "libraryToken2", UsdContrivedTokens->libraryToken2); - _AddToken(cls, "matrix2d", UsdContrivedTokens->matrix2d); - _AddToken(cls, "matrix2dArray", UsdContrivedTokens->matrix2dArray); - _AddToken(cls, "matrix3d", UsdContrivedTokens->matrix3d); - _AddToken(cls, "matrix3dArray", UsdContrivedTokens->matrix3dArray); - _AddToken(cls, "matrix4d", UsdContrivedTokens->matrix4d); - _AddToken(cls, "matrix4dArray", UsdContrivedTokens->matrix4dArray); - _AddToken(cls, "myDouble", UsdContrivedTokens->myDouble); - _AddToken(cls, "myUniformBool", UsdContrivedTokens->myUniformBool); - _AddToken(cls, "myVaryingToken", UsdContrivedTokens->myVaryingToken); - _AddToken(cls, "myVaryingTokenArray", UsdContrivedTokens->myVaryingTokenArray); - _AddToken(cls, "myVecfArray", UsdContrivedTokens->myVecfArray); - _AddToken(cls, "namespacedProperty", UsdContrivedTokens->namespacedProperty); - _AddToken(cls, "newToken", UsdContrivedTokens->newToken); - _AddToken(cls, "normal3d", UsdContrivedTokens->normal3d); - _AddToken(cls, "normal3dArray", UsdContrivedTokens->normal3dArray); - _AddToken(cls, "normal3f", UsdContrivedTokens->normal3f); - _AddToken(cls, "normal3fArray", UsdContrivedTokens->normal3fArray); - _AddToken(cls, "normal3h", UsdContrivedTokens->normal3h); - _AddToken(cls, "normal3hArray", UsdContrivedTokens->normal3hArray); - _AddToken(cls, "overrideBaseFalseDerivedFalse", UsdContrivedTokens->overrideBaseFalseDerivedFalse); - _AddToken(cls, "overrideBaseFalseDerivedNone", UsdContrivedTokens->overrideBaseFalseDerivedNone); - _AddToken(cls, "overrideBaseNoneDerivedFalse", UsdContrivedTokens->overrideBaseNoneDerivedFalse); - _AddToken(cls, "overrideBaseTrueDerivedFalse", UsdContrivedTokens->overrideBaseTrueDerivedFalse); - _AddToken(cls, "overrideBaseTrueDerivedNone", UsdContrivedTokens->overrideBaseTrueDerivedNone); - _AddToken(cls, "overrideBaseTrueDerivedTrue", UsdContrivedTokens->overrideBaseTrueDerivedTrue); - _AddToken(cls, "pivotPosition", UsdContrivedTokens->pivotPosition); - _AddToken(cls, "point3d", UsdContrivedTokens->point3d); - _AddToken(cls, "point3dArray", UsdContrivedTokens->point3dArray); - _AddToken(cls, "point3f", UsdContrivedTokens->point3f); - _AddToken(cls, "point3fArray", UsdContrivedTokens->point3fArray); - _AddToken(cls, "point3h", UsdContrivedTokens->point3h); - _AddToken(cls, "point3hArray", UsdContrivedTokens->point3hArray); - _AddToken(cls, "quatd", UsdContrivedTokens->quatd); - _AddToken(cls, "quatdArray", UsdContrivedTokens->quatdArray); - _AddToken(cls, "quatf", UsdContrivedTokens->quatf); - _AddToken(cls, "quatfArray", UsdContrivedTokens->quatfArray); - _AddToken(cls, "quath", UsdContrivedTokens->quath); - _AddToken(cls, "quathArray", UsdContrivedTokens->quathArray); - _AddToken(cls, "relCanShareApiNameWithAttr", UsdContrivedTokens->relCanShareApiNameWithAttr); - _AddToken(cls, "riStatementsAttributesUserGofur_GeomOnHairdensity", UsdContrivedTokens->riStatementsAttributesUserGofur_GeomOnHairdensity); - _AddToken(cls, "schemaToken1", UsdContrivedTokens->schemaToken1); - _AddToken(cls, "schemaToken2", UsdContrivedTokens->schemaToken2); - _AddToken(cls, "string", UsdContrivedTokens->string); - _AddToken(cls, "stringArray", UsdContrivedTokens->stringArray); - _AddToken(cls, "temp", UsdContrivedTokens->temp); - _AddToken(cls, "test", UsdContrivedTokens->test); - _AddToken(cls, "test_MultipleApplyTemplate_", UsdContrivedTokens->test_MultipleApplyTemplate_); - _AddToken(cls, "test_MultipleApplyTemplate_TestAttrOne", UsdContrivedTokens->test_MultipleApplyTemplate_TestAttrOne); - _AddToken(cls, "test_MultipleApplyTemplate_TestAttrTwo", UsdContrivedTokens->test_MultipleApplyTemplate_TestAttrTwo); - _AddToken(cls, "testingAsset", UsdContrivedTokens->testingAsset); - _AddToken(cls, "testNewVersion", UsdContrivedTokens->testNewVersion); - _AddToken(cls, "testNewVersion_MultipleApplyTemplate_TestAttrOne", UsdContrivedTokens->testNewVersion_MultipleApplyTemplate_TestAttrOne); - _AddToken(cls, "testNewVersion_MultipleApplyTemplate_TestAttrTwo", UsdContrivedTokens->testNewVersion_MultipleApplyTemplate_TestAttrTwo); - _AddToken(cls, "testo", UsdContrivedTokens->testo); - _AddToken(cls, "testo_MultipleApplyTemplate_", UsdContrivedTokens->testo_MultipleApplyTemplate_); - _AddToken(cls, "testo_MultipleApplyTemplate_TestAttrOne", UsdContrivedTokens->testo_MultipleApplyTemplate_TestAttrOne); - _AddToken(cls, "testo_MultipleApplyTemplate_TestAttrTwo", UsdContrivedTokens->testo_MultipleApplyTemplate_TestAttrTwo); - _AddToken(cls, "token", UsdContrivedTokens->token); - _AddToken(cls, "tokenArray", UsdContrivedTokens->tokenArray); - _AddToken(cls, "transform", UsdContrivedTokens->transform); - _AddToken(cls, "uchar", UsdContrivedTokens->uchar); - _AddToken(cls, "ucharArray", UsdContrivedTokens->ucharArray); - _AddToken(cls, "uint", UsdContrivedTokens->uint); - _AddToken(cls, "uint64", UsdContrivedTokens->uint64); - _AddToken(cls, "uint64Array", UsdContrivedTokens->uint64Array); - _AddToken(cls, "uintArray", UsdContrivedTokens->uintArray); - _AddToken(cls, "VariableTokenAllowed1", UsdContrivedTokens->VariableTokenAllowed1); - _AddToken(cls, "VariableTokenAllowed2", UsdContrivedTokens->VariableTokenAllowed2); - _AddToken(cls, "VariableTokenAllowed_3_", UsdContrivedTokens->VariableTokenAllowed_3_); - _AddToken(cls, "VariableTokenArrayAllowed1", UsdContrivedTokens->VariableTokenArrayAllowed1); - _AddToken(cls, "VariableTokenArrayAllowed2", UsdContrivedTokens->VariableTokenArrayAllowed2); - _AddToken(cls, "VariableTokenArrayAllowed_3_", UsdContrivedTokens->VariableTokenArrayAllowed_3_); - _AddToken(cls, "VariableTokenDefault", UsdContrivedTokens->VariableTokenDefault); - _AddToken(cls, "vector3d", UsdContrivedTokens->vector3d); - _AddToken(cls, "vector3dArray", UsdContrivedTokens->vector3dArray); - _AddToken(cls, "vector3f", UsdContrivedTokens->vector3f); - _AddToken(cls, "vector3fArray", UsdContrivedTokens->vector3fArray); - _AddToken(cls, "vector3h", UsdContrivedTokens->vector3h); - _AddToken(cls, "vector3hArray", UsdContrivedTokens->vector3hArray); - _AddToken(cls, "Base", UsdContrivedTokens->Base); - _AddToken(cls, "Derived", UsdContrivedTokens->Derived); - _AddToken(cls, "DerivedNonAppliedAPI", UsdContrivedTokens->DerivedNonAppliedAPI); - _AddToken(cls, "EmptyMultipleApplyAPI", UsdContrivedTokens->EmptyMultipleApplyAPI); - _AddToken(cls, "MultipleApplyAPI", UsdContrivedTokens->MultipleApplyAPI); - _AddToken(cls, "MultipleApplyAPI_1", UsdContrivedTokens->MultipleApplyAPI_1); - _AddToken(cls, "NonAppliedAPI", UsdContrivedTokens->NonAppliedAPI); - _AddToken(cls, "PublicMultipleApplyAPI", UsdContrivedTokens->PublicMultipleApplyAPI); - _AddToken(cls, "SingleApplyAPI", UsdContrivedTokens->SingleApplyAPI); - _AddToken(cls, "SingleApplyAPI_1", UsdContrivedTokens->SingleApplyAPI_1); - _AddToken(cls, "TestNoVersion0", UsdContrivedTokens->TestNoVersion0); - _AddToken(cls, "TestNoVersion0_2", UsdContrivedTokens->TestNoVersion0_2); - _AddToken(cls, "TestPxHairman", UsdContrivedTokens->TestPxHairman); - _AddToken(cls, "TestPxHairman_1", UsdContrivedTokens->TestPxHairman_1); + _ADD_TOKEN(cls, asset); + _ADD_TOKEN(cls, assetArray); + _ADD_TOKEN(cls, attrWithoutGeneratedAccessorAPI); + _ADD_TOKEN(cls, binding); + _ADD_TOKEN(cls, bool_); + _ADD_TOKEN(cls, boolArray); + _ADD_TOKEN(cls, color3d); + _ADD_TOKEN(cls, color3dArray); + _ADD_TOKEN(cls, color3f); + _ADD_TOKEN(cls, color3fArray); + _ADD_TOKEN(cls, color3h); + _ADD_TOKEN(cls, color3hArray); + _ADD_TOKEN(cls, color4d); + _ADD_TOKEN(cls, color4dArray); + _ADD_TOKEN(cls, color4f); + _ADD_TOKEN(cls, color4fArray); + _ADD_TOKEN(cls, color4h); + _ADD_TOKEN(cls, color4hArray); + _ADD_TOKEN(cls, cornerIndices); + _ADD_TOKEN(cls, cornerSharpnesses); + _ADD_TOKEN(cls, creaseLengths); + _ADD_TOKEN(cls, double2); + _ADD_TOKEN(cls, double2Array); + _ADD_TOKEN(cls, double3); + _ADD_TOKEN(cls, double3Array); + _ADD_TOKEN(cls, double4); + _ADD_TOKEN(cls, double4Array); + _ADD_TOKEN(cls, double_); + _ADD_TOKEN(cls, doubleArray); + _ADD_TOKEN(cls, float2); + _ADD_TOKEN(cls, float2Array); + _ADD_TOKEN(cls, float3); + _ADD_TOKEN(cls, float3Array); + _ADD_TOKEN(cls, float4); + _ADD_TOKEN(cls, float4Array); + _ADD_TOKEN(cls, float_); + _ADD_TOKEN(cls, floatArray); + _ADD_TOKEN(cls, frame4d); + _ADD_TOKEN(cls, frame4dArray); + _ADD_TOKEN(cls, half); + _ADD_TOKEN(cls, half2); + _ADD_TOKEN(cls, half2Array); + _ADD_TOKEN(cls, half3); + _ADD_TOKEN(cls, half3Array); + _ADD_TOKEN(cls, half4); + _ADD_TOKEN(cls, half4Array); + _ADD_TOKEN(cls, halfArray); + _ADD_TOKEN(cls, holeIndices); + _ADD_TOKEN(cls, int2); + _ADD_TOKEN(cls, int2Array); + _ADD_TOKEN(cls, int3); + _ADD_TOKEN(cls, int3Array); + _ADD_TOKEN(cls, int4); + _ADD_TOKEN(cls, int4Array); + _ADD_TOKEN(cls, int64); + _ADD_TOKEN(cls, int64Array); + _ADD_TOKEN(cls, int_); + _ADD_TOKEN(cls, intArray); + _ADD_TOKEN(cls, justDefault); + _ADD_TOKEN(cls, libraryToken1); + _ADD_TOKEN(cls, libraryToken2); + _ADD_TOKEN(cls, matrix2d); + _ADD_TOKEN(cls, matrix2dArray); + _ADD_TOKEN(cls, matrix3d); + _ADD_TOKEN(cls, matrix3dArray); + _ADD_TOKEN(cls, matrix4d); + _ADD_TOKEN(cls, matrix4dArray); + _ADD_TOKEN(cls, myDouble); + _ADD_TOKEN(cls, myUniformBool); + _ADD_TOKEN(cls, myVaryingToken); + _ADD_TOKEN(cls, myVaryingTokenArray); + _ADD_TOKEN(cls, myVecfArray); + _ADD_TOKEN(cls, namespacedProperty); + _ADD_TOKEN(cls, newToken); + _ADD_TOKEN(cls, normal3d); + _ADD_TOKEN(cls, normal3dArray); + _ADD_TOKEN(cls, normal3f); + _ADD_TOKEN(cls, normal3fArray); + _ADD_TOKEN(cls, normal3h); + _ADD_TOKEN(cls, normal3hArray); + _ADD_TOKEN(cls, overrideBaseFalseDerivedFalse); + _ADD_TOKEN(cls, overrideBaseFalseDerivedNone); + _ADD_TOKEN(cls, overrideBaseNoneDerivedFalse); + _ADD_TOKEN(cls, overrideBaseTrueDerivedFalse); + _ADD_TOKEN(cls, overrideBaseTrueDerivedNone); + _ADD_TOKEN(cls, overrideBaseTrueDerivedTrue); + _ADD_TOKEN(cls, pivotPosition); + _ADD_TOKEN(cls, point3d); + _ADD_TOKEN(cls, point3dArray); + _ADD_TOKEN(cls, point3f); + _ADD_TOKEN(cls, point3fArray); + _ADD_TOKEN(cls, point3h); + _ADD_TOKEN(cls, point3hArray); + _ADD_TOKEN(cls, quatd); + _ADD_TOKEN(cls, quatdArray); + _ADD_TOKEN(cls, quatf); + _ADD_TOKEN(cls, quatfArray); + _ADD_TOKEN(cls, quath); + _ADD_TOKEN(cls, quathArray); + _ADD_TOKEN(cls, relCanShareApiNameWithAttr); + _ADD_TOKEN(cls, riStatementsAttributesUserGofur_GeomOnHairdensity); + _ADD_TOKEN(cls, schemaToken1); + _ADD_TOKEN(cls, schemaToken2); + _ADD_TOKEN(cls, string); + _ADD_TOKEN(cls, stringArray); + _ADD_TOKEN(cls, temp); + _ADD_TOKEN(cls, test); + _ADD_TOKEN(cls, test_MultipleApplyTemplate_); + _ADD_TOKEN(cls, test_MultipleApplyTemplate_TestAttrOne); + _ADD_TOKEN(cls, test_MultipleApplyTemplate_TestAttrTwo); + _ADD_TOKEN(cls, testingAsset); + _ADD_TOKEN(cls, testNewVersion); + _ADD_TOKEN(cls, testNewVersion_MultipleApplyTemplate_TestAttrOne); + _ADD_TOKEN(cls, testNewVersion_MultipleApplyTemplate_TestAttrTwo); + _ADD_TOKEN(cls, testo); + _ADD_TOKEN(cls, testo_MultipleApplyTemplate_); + _ADD_TOKEN(cls, testo_MultipleApplyTemplate_TestAttrOne); + _ADD_TOKEN(cls, testo_MultipleApplyTemplate_TestAttrTwo); + _ADD_TOKEN(cls, token); + _ADD_TOKEN(cls, tokenArray); + _ADD_TOKEN(cls, transform); + _ADD_TOKEN(cls, uchar); + _ADD_TOKEN(cls, ucharArray); + _ADD_TOKEN(cls, uint); + _ADD_TOKEN(cls, uint64); + _ADD_TOKEN(cls, uint64Array); + _ADD_TOKEN(cls, uintArray); + _ADD_TOKEN(cls, VariableTokenAllowed1); + _ADD_TOKEN(cls, VariableTokenAllowed2); + _ADD_TOKEN(cls, VariableTokenAllowed_3_); + _ADD_TOKEN(cls, VariableTokenArrayAllowed1); + _ADD_TOKEN(cls, VariableTokenArrayAllowed2); + _ADD_TOKEN(cls, VariableTokenArrayAllowed_3_); + _ADD_TOKEN(cls, VariableTokenDefault); + _ADD_TOKEN(cls, vector3d); + _ADD_TOKEN(cls, vector3dArray); + _ADD_TOKEN(cls, vector3f); + _ADD_TOKEN(cls, vector3fArray); + _ADD_TOKEN(cls, vector3h); + _ADD_TOKEN(cls, vector3hArray); + _ADD_TOKEN(cls, Base); + _ADD_TOKEN(cls, Derived); + _ADD_TOKEN(cls, DerivedNonAppliedAPI); + _ADD_TOKEN(cls, EmptyMultipleApplyAPI); + _ADD_TOKEN(cls, MultipleApplyAPI); + _ADD_TOKEN(cls, MultipleApplyAPI_1); + _ADD_TOKEN(cls, NonAppliedAPI); + _ADD_TOKEN(cls, PublicMultipleApplyAPI); + _ADD_TOKEN(cls, SingleApplyAPI); + _ADD_TOKEN(cls, SingleApplyAPI_1); + _ADD_TOKEN(cls, TestNoVersion0); + _ADD_TOKEN(cls, TestNoVersion0_2); + _ADD_TOKEN(cls, TestPxHairman); + _ADD_TOKEN(cls, TestPxHairman_1); } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp index 4cfd9d6a22..f5fd946078 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/headerTerminatorString/wrapTokens.cpp @@ -10,65 +10,35 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdContrivedTokens->name.GetString(); }); void wrapUsdContrivedTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "libraryToken1", UsdContrivedTokens->libraryToken1); - _AddToken(cls, "libraryToken2", UsdContrivedTokens->libraryToken2); - _AddToken(cls, "myColorFloat", UsdContrivedTokens->myColorFloat); - _AddToken(cls, "myDouble", UsdContrivedTokens->myDouble); - _AddToken(cls, "myFloat", UsdContrivedTokens->myFloat); - _AddToken(cls, "myNormals", UsdContrivedTokens->myNormals); - _AddToken(cls, "myPoints", UsdContrivedTokens->myPoints); - _AddToken(cls, "myVaryingToken", UsdContrivedTokens->myVaryingToken); - _AddToken(cls, "myVaryingTokenArray", UsdContrivedTokens->myVaryingTokenArray); - _AddToken(cls, "myVelocities", UsdContrivedTokens->myVelocities); - _AddToken(cls, "testAttrOne", UsdContrivedTokens->testAttrOne); - _AddToken(cls, "testAttrTwo", UsdContrivedTokens->testAttrTwo); - _AddToken(cls, "unsignedChar", UsdContrivedTokens->unsignedChar); - _AddToken(cls, "unsignedInt", UsdContrivedTokens->unsignedInt); - _AddToken(cls, "unsignedInt64Array", UsdContrivedTokens->unsignedInt64Array); - _AddToken(cls, "VariableTokenAllowed1", UsdContrivedTokens->VariableTokenAllowed1); - _AddToken(cls, "VariableTokenAllowed2", UsdContrivedTokens->VariableTokenAllowed2); - _AddToken(cls, "VariableTokenAllowed_3_", UsdContrivedTokens->VariableTokenAllowed_3_); - _AddToken(cls, "VariableTokenArrayAllowed1", UsdContrivedTokens->VariableTokenArrayAllowed1); - _AddToken(cls, "VariableTokenArrayAllowed2", UsdContrivedTokens->VariableTokenArrayAllowed2); - _AddToken(cls, "VariableTokenArrayAllowed_3_", UsdContrivedTokens->VariableTokenArrayAllowed_3_); - _AddToken(cls, "VariableTokenDefault", UsdContrivedTokens->VariableTokenDefault); - _AddToken(cls, "Base", UsdContrivedTokens->Base); - _AddToken(cls, "SingleApplyAPI", UsdContrivedTokens->SingleApplyAPI); + _ADD_TOKEN(cls, libraryToken1); + _ADD_TOKEN(cls, libraryToken2); + _ADD_TOKEN(cls, myColorFloat); + _ADD_TOKEN(cls, myDouble); + _ADD_TOKEN(cls, myFloat); + _ADD_TOKEN(cls, myNormals); + _ADD_TOKEN(cls, myPoints); + _ADD_TOKEN(cls, myVaryingToken); + _ADD_TOKEN(cls, myVaryingTokenArray); + _ADD_TOKEN(cls, myVelocities); + _ADD_TOKEN(cls, testAttrOne); + _ADD_TOKEN(cls, testAttrTwo); + _ADD_TOKEN(cls, unsignedChar); + _ADD_TOKEN(cls, unsignedInt); + _ADD_TOKEN(cls, unsignedInt64Array); + _ADD_TOKEN(cls, VariableTokenAllowed1); + _ADD_TOKEN(cls, VariableTokenAllowed2); + _ADD_TOKEN(cls, VariableTokenAllowed_3_); + _ADD_TOKEN(cls, VariableTokenArrayAllowed1); + _ADD_TOKEN(cls, VariableTokenArrayAllowed2); + _ADD_TOKEN(cls, VariableTokenArrayAllowed_3_); + _ADD_TOKEN(cls, VariableTokenDefault); + _ADD_TOKEN(cls, Base); + _ADD_TOKEN(cls, SingleApplyAPI); } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp index 12893f0c25..ad6c597caf 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/namespace/wrapTokens.cpp @@ -10,65 +10,35 @@ using namespace foo; -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdContrivedTokens->name.GetString(); }); void wrapUsdContrivedTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "libraryToken1", UsdContrivedTokens->libraryToken1); - _AddToken(cls, "libraryToken2", UsdContrivedTokens->libraryToken2); - _AddToken(cls, "myColorFloat", UsdContrivedTokens->myColorFloat); - _AddToken(cls, "myDouble", UsdContrivedTokens->myDouble); - _AddToken(cls, "myFloat", UsdContrivedTokens->myFloat); - _AddToken(cls, "myNormals", UsdContrivedTokens->myNormals); - _AddToken(cls, "myPoints", UsdContrivedTokens->myPoints); - _AddToken(cls, "myVaryingToken", UsdContrivedTokens->myVaryingToken); - _AddToken(cls, "myVaryingTokenArray", UsdContrivedTokens->myVaryingTokenArray); - _AddToken(cls, "myVelocities", UsdContrivedTokens->myVelocities); - _AddToken(cls, "testAttrOne", UsdContrivedTokens->testAttrOne); - _AddToken(cls, "testAttrTwo", UsdContrivedTokens->testAttrTwo); - _AddToken(cls, "unsignedChar", UsdContrivedTokens->unsignedChar); - _AddToken(cls, "unsignedInt", UsdContrivedTokens->unsignedInt); - _AddToken(cls, "unsignedInt64Array", UsdContrivedTokens->unsignedInt64Array); - _AddToken(cls, "VariableTokenAllowed1", UsdContrivedTokens->VariableTokenAllowed1); - _AddToken(cls, "VariableTokenAllowed2", UsdContrivedTokens->VariableTokenAllowed2); - _AddToken(cls, "VariableTokenAllowed_3_", UsdContrivedTokens->VariableTokenAllowed_3_); - _AddToken(cls, "VariableTokenArrayAllowed1", UsdContrivedTokens->VariableTokenArrayAllowed1); - _AddToken(cls, "VariableTokenArrayAllowed2", UsdContrivedTokens->VariableTokenArrayAllowed2); - _AddToken(cls, "VariableTokenArrayAllowed_3_", UsdContrivedTokens->VariableTokenArrayAllowed_3_); - _AddToken(cls, "VariableTokenDefault", UsdContrivedTokens->VariableTokenDefault); - _AddToken(cls, "Base", UsdContrivedTokens->Base); - _AddToken(cls, "SingleApplyAPI", UsdContrivedTokens->SingleApplyAPI); + _ADD_TOKEN(cls, libraryToken1); + _ADD_TOKEN(cls, libraryToken2); + _ADD_TOKEN(cls, myColorFloat); + _ADD_TOKEN(cls, myDouble); + _ADD_TOKEN(cls, myFloat); + _ADD_TOKEN(cls, myNormals); + _ADD_TOKEN(cls, myPoints); + _ADD_TOKEN(cls, myVaryingToken); + _ADD_TOKEN(cls, myVaryingTokenArray); + _ADD_TOKEN(cls, myVelocities); + _ADD_TOKEN(cls, testAttrOne); + _ADD_TOKEN(cls, testAttrTwo); + _ADD_TOKEN(cls, unsignedChar); + _ADD_TOKEN(cls, unsignedInt); + _ADD_TOKEN(cls, unsignedInt64Array); + _ADD_TOKEN(cls, VariableTokenAllowed1); + _ADD_TOKEN(cls, VariableTokenAllowed2); + _ADD_TOKEN(cls, VariableTokenAllowed_3_); + _ADD_TOKEN(cls, VariableTokenArrayAllowed1); + _ADD_TOKEN(cls, VariableTokenArrayAllowed2); + _ADD_TOKEN(cls, VariableTokenArrayAllowed_3_); + _ADD_TOKEN(cls, VariableTokenDefault); + _ADD_TOKEN(cls, Base); + _ADD_TOKEN(cls, SingleApplyAPI); } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp index 917102007c..63f7e83094 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/nestedNamespace/wrapTokens.cpp @@ -10,65 +10,35 @@ using namespace foo::bar::baz; -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdContrivedTokens->name.GetString(); }); void wrapUsdContrivedTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "libraryToken1", UsdContrivedTokens->libraryToken1); - _AddToken(cls, "libraryToken2", UsdContrivedTokens->libraryToken2); - _AddToken(cls, "myColorFloat", UsdContrivedTokens->myColorFloat); - _AddToken(cls, "myDouble", UsdContrivedTokens->myDouble); - _AddToken(cls, "myFloat", UsdContrivedTokens->myFloat); - _AddToken(cls, "myNormals", UsdContrivedTokens->myNormals); - _AddToken(cls, "myPoints", UsdContrivedTokens->myPoints); - _AddToken(cls, "myVaryingToken", UsdContrivedTokens->myVaryingToken); - _AddToken(cls, "myVaryingTokenArray", UsdContrivedTokens->myVaryingTokenArray); - _AddToken(cls, "myVelocities", UsdContrivedTokens->myVelocities); - _AddToken(cls, "testAttrOne", UsdContrivedTokens->testAttrOne); - _AddToken(cls, "testAttrTwo", UsdContrivedTokens->testAttrTwo); - _AddToken(cls, "unsignedChar", UsdContrivedTokens->unsignedChar); - _AddToken(cls, "unsignedInt", UsdContrivedTokens->unsignedInt); - _AddToken(cls, "unsignedInt64Array", UsdContrivedTokens->unsignedInt64Array); - _AddToken(cls, "VariableTokenAllowed1", UsdContrivedTokens->VariableTokenAllowed1); - _AddToken(cls, "VariableTokenAllowed2", UsdContrivedTokens->VariableTokenAllowed2); - _AddToken(cls, "VariableTokenAllowed_3_", UsdContrivedTokens->VariableTokenAllowed_3_); - _AddToken(cls, "VariableTokenArrayAllowed1", UsdContrivedTokens->VariableTokenArrayAllowed1); - _AddToken(cls, "VariableTokenArrayAllowed2", UsdContrivedTokens->VariableTokenArrayAllowed2); - _AddToken(cls, "VariableTokenArrayAllowed_3_", UsdContrivedTokens->VariableTokenArrayAllowed_3_); - _AddToken(cls, "VariableTokenDefault", UsdContrivedTokens->VariableTokenDefault); - _AddToken(cls, "Base", UsdContrivedTokens->Base); - _AddToken(cls, "SingleApplyAPI", UsdContrivedTokens->SingleApplyAPI); + _ADD_TOKEN(cls, libraryToken1); + _ADD_TOKEN(cls, libraryToken2); + _ADD_TOKEN(cls, myColorFloat); + _ADD_TOKEN(cls, myDouble); + _ADD_TOKEN(cls, myFloat); + _ADD_TOKEN(cls, myNormals); + _ADD_TOKEN(cls, myPoints); + _ADD_TOKEN(cls, myVaryingToken); + _ADD_TOKEN(cls, myVaryingTokenArray); + _ADD_TOKEN(cls, myVelocities); + _ADD_TOKEN(cls, testAttrOne); + _ADD_TOKEN(cls, testAttrTwo); + _ADD_TOKEN(cls, unsignedChar); + _ADD_TOKEN(cls, unsignedInt); + _ADD_TOKEN(cls, unsignedInt64Array); + _ADD_TOKEN(cls, VariableTokenAllowed1); + _ADD_TOKEN(cls, VariableTokenAllowed2); + _ADD_TOKEN(cls, VariableTokenAllowed_3_); + _ADD_TOKEN(cls, VariableTokenArrayAllowed1); + _ADD_TOKEN(cls, VariableTokenArrayAllowed2); + _ADD_TOKEN(cls, VariableTokenArrayAllowed_3_); + _ADD_TOKEN(cls, VariableTokenDefault); + _ADD_TOKEN(cls, Base); + _ADD_TOKEN(cls, SingleApplyAPI); } diff --git a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp index e7b2c75414..b0a207f76d 100644 --- a/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp +++ b/pxr/usd/usd/testenv/testUsdGenSchema/baseline/useLiteralIdentifier/wrapTokens.cpp @@ -10,62 +10,32 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdContrivedTokens->name.GetString(); }); void wrapUsdContrivedTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "libraryToken1", UsdContrivedTokens->libraryToken1); - _AddToken(cls, "libraryToken2", UsdContrivedTokens->libraryToken2); - _AddToken(cls, "myColorFloat", UsdContrivedTokens->myColorFloat); - _AddToken(cls, "myDouble", UsdContrivedTokens->myDouble); - _AddToken(cls, "myFloat", UsdContrivedTokens->myFloat); - _AddToken(cls, "myNormals", UsdContrivedTokens->myNormals); - _AddToken(cls, "myPoints", UsdContrivedTokens->myPoints); - _AddToken(cls, "myVaryingToken", UsdContrivedTokens->myVaryingToken); - _AddToken(cls, "myVaryingTokenArray", UsdContrivedTokens->myVaryingTokenArray); - _AddToken(cls, "myVelocities", UsdContrivedTokens->myVelocities); - _AddToken(cls, "unsignedChar", UsdContrivedTokens->unsignedChar); - _AddToken(cls, "unsignedInt", UsdContrivedTokens->unsignedInt); - _AddToken(cls, "unsignedInt64Array", UsdContrivedTokens->unsignedInt64Array); - _AddToken(cls, "variableTokenAllowed1", UsdContrivedTokens->variableTokenAllowed1); - _AddToken(cls, "variableTokenAllowed2", UsdContrivedTokens->variableTokenAllowed2); - _AddToken(cls, "variableTokenAllowed3", UsdContrivedTokens->variableTokenAllowed3); - _AddToken(cls, "variableTokenArrayAllowed1", UsdContrivedTokens->variableTokenArrayAllowed1); - _AddToken(cls, "variableTokenArrayAllowed2", UsdContrivedTokens->variableTokenArrayAllowed2); - _AddToken(cls, "variableTokenArrayAllowed3", UsdContrivedTokens->variableTokenArrayAllowed3); - _AddToken(cls, "variableTokenDefault", UsdContrivedTokens->variableTokenDefault); - _AddToken(cls, "Base", UsdContrivedTokens->Base); + _ADD_TOKEN(cls, libraryToken1); + _ADD_TOKEN(cls, libraryToken2); + _ADD_TOKEN(cls, myColorFloat); + _ADD_TOKEN(cls, myDouble); + _ADD_TOKEN(cls, myFloat); + _ADD_TOKEN(cls, myNormals); + _ADD_TOKEN(cls, myPoints); + _ADD_TOKEN(cls, myVaryingToken); + _ADD_TOKEN(cls, myVaryingTokenArray); + _ADD_TOKEN(cls, myVelocities); + _ADD_TOKEN(cls, unsignedChar); + _ADD_TOKEN(cls, unsignedInt); + _ADD_TOKEN(cls, unsignedInt64Array); + _ADD_TOKEN(cls, variableTokenAllowed1); + _ADD_TOKEN(cls, variableTokenAllowed2); + _ADD_TOKEN(cls, variableTokenAllowed3); + _ADD_TOKEN(cls, variableTokenArrayAllowed1); + _ADD_TOKEN(cls, variableTokenArrayAllowed2); + _ADD_TOKEN(cls, variableTokenArrayAllowed3); + _ADD_TOKEN(cls, variableTokenDefault); + _ADD_TOKEN(cls, Base); } diff --git a/pxr/usd/usd/wrapTokens.cpp b/pxr/usd/usd/wrapTokens.cpp index e0c405f861..5c8ab2aaee 100644 --- a/pxr/usd/usd/wrapTokens.cpp +++ b/pxr/usd/usd/wrapTokens.cpp @@ -10,61 +10,31 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdTokens->name.GetString(); }); void wrapUsdTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "apiSchemas", UsdTokens->apiSchemas); - _AddToken(cls, "clips", UsdTokens->clips); - _AddToken(cls, "clipSets", UsdTokens->clipSets); - _AddToken(cls, "collection", UsdTokens->collection); - _AddToken(cls, "collection_MultipleApplyTemplate_", UsdTokens->collection_MultipleApplyTemplate_); - _AddToken(cls, "collection_MultipleApplyTemplate_Excludes", UsdTokens->collection_MultipleApplyTemplate_Excludes); - _AddToken(cls, "collection_MultipleApplyTemplate_ExpansionRule", UsdTokens->collection_MultipleApplyTemplate_ExpansionRule); - _AddToken(cls, "collection_MultipleApplyTemplate_IncludeRoot", UsdTokens->collection_MultipleApplyTemplate_IncludeRoot); - _AddToken(cls, "collection_MultipleApplyTemplate_Includes", UsdTokens->collection_MultipleApplyTemplate_Includes); - _AddToken(cls, "collection_MultipleApplyTemplate_MembershipExpression", UsdTokens->collection_MultipleApplyTemplate_MembershipExpression); - _AddToken(cls, "exclude", UsdTokens->exclude); - _AddToken(cls, "expandPrims", UsdTokens->expandPrims); - _AddToken(cls, "expandPrimsAndProperties", UsdTokens->expandPrimsAndProperties); - _AddToken(cls, "explicitOnly", UsdTokens->explicitOnly); - _AddToken(cls, "fallbackPrimTypes", UsdTokens->fallbackPrimTypes); - _AddToken(cls, "APISchemaBase", UsdTokens->APISchemaBase); - _AddToken(cls, "ClipsAPI", UsdTokens->ClipsAPI); - _AddToken(cls, "CollectionAPI", UsdTokens->CollectionAPI); - _AddToken(cls, "ModelAPI", UsdTokens->ModelAPI); - _AddToken(cls, "Typed", UsdTokens->Typed); + _ADD_TOKEN(cls, apiSchemas); + _ADD_TOKEN(cls, clips); + _ADD_TOKEN(cls, clipSets); + _ADD_TOKEN(cls, collection); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_Excludes); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_ExpansionRule); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_IncludeRoot); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_Includes); + _ADD_TOKEN(cls, collection_MultipleApplyTemplate_MembershipExpression); + _ADD_TOKEN(cls, exclude); + _ADD_TOKEN(cls, expandPrims); + _ADD_TOKEN(cls, expandPrimsAndProperties); + _ADD_TOKEN(cls, explicitOnly); + _ADD_TOKEN(cls, fallbackPrimTypes); + _ADD_TOKEN(cls, APISchemaBase); + _ADD_TOKEN(cls, ClipsAPI); + _ADD_TOKEN(cls, CollectionAPI); + _ADD_TOKEN(cls, ModelAPI); + _ADD_TOKEN(cls, Typed); } diff --git a/pxr/usd/usdGeom/wrapTokens.cpp b/pxr/usd/usdGeom/wrapTokens.cpp index 8f54b9396a..b20d8f6445 100644 --- a/pxr/usd/usdGeom/wrapTokens.cpp +++ b/pxr/usd/usdGeom/wrapTokens.cpp @@ -10,243 +10,213 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdGeomTokens->name.GetString(); }); void wrapUsdGeomTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "accelerations", UsdGeomTokens->accelerations); - _AddToken(cls, "all", UsdGeomTokens->all); - _AddToken(cls, "angularVelocities", UsdGeomTokens->angularVelocities); - _AddToken(cls, "axis", UsdGeomTokens->axis); - _AddToken(cls, "basis", UsdGeomTokens->basis); - _AddToken(cls, "bezier", UsdGeomTokens->bezier); - _AddToken(cls, "bilinear", UsdGeomTokens->bilinear); - _AddToken(cls, "boundaries", UsdGeomTokens->boundaries); - _AddToken(cls, "bounds", UsdGeomTokens->bounds); - _AddToken(cls, "box", UsdGeomTokens->box); - _AddToken(cls, "bspline", UsdGeomTokens->bspline); - _AddToken(cls, "cards", UsdGeomTokens->cards); - _AddToken(cls, "catmullClark", UsdGeomTokens->catmullClark); - _AddToken(cls, "catmullRom", UsdGeomTokens->catmullRom); - _AddToken(cls, "clippingPlanes", UsdGeomTokens->clippingPlanes); - _AddToken(cls, "clippingRange", UsdGeomTokens->clippingRange); - _AddToken(cls, "closed", UsdGeomTokens->closed); - _AddToken(cls, "constant", UsdGeomTokens->constant); - _AddToken(cls, "cornerIndices", UsdGeomTokens->cornerIndices); - _AddToken(cls, "cornerSharpnesses", UsdGeomTokens->cornerSharpnesses); - _AddToken(cls, "cornersOnly", UsdGeomTokens->cornersOnly); - _AddToken(cls, "cornersPlus1", UsdGeomTokens->cornersPlus1); - _AddToken(cls, "cornersPlus2", UsdGeomTokens->cornersPlus2); - _AddToken(cls, "creaseIndices", UsdGeomTokens->creaseIndices); - _AddToken(cls, "creaseLengths", UsdGeomTokens->creaseLengths); - _AddToken(cls, "creaseSharpnesses", UsdGeomTokens->creaseSharpnesses); - _AddToken(cls, "cross", UsdGeomTokens->cross); - _AddToken(cls, "cubic", UsdGeomTokens->cubic); - _AddToken(cls, "curveVertexCounts", UsdGeomTokens->curveVertexCounts); - _AddToken(cls, "default_", UsdGeomTokens->default_); - _AddToken(cls, "doubleSided", UsdGeomTokens->doubleSided); - _AddToken(cls, "edge", UsdGeomTokens->edge); - _AddToken(cls, "edgeAndCorner", UsdGeomTokens->edgeAndCorner); - _AddToken(cls, "edgeOnly", UsdGeomTokens->edgeOnly); - _AddToken(cls, "elementSize", UsdGeomTokens->elementSize); - _AddToken(cls, "elementType", UsdGeomTokens->elementType); - _AddToken(cls, "exposure", UsdGeomTokens->exposure); - _AddToken(cls, "extent", UsdGeomTokens->extent); - _AddToken(cls, "extentsHint", UsdGeomTokens->extentsHint); - _AddToken(cls, "face", UsdGeomTokens->face); - _AddToken(cls, "faceVarying", UsdGeomTokens->faceVarying); - _AddToken(cls, "faceVaryingLinearInterpolation", UsdGeomTokens->faceVaryingLinearInterpolation); - _AddToken(cls, "faceVertexCounts", UsdGeomTokens->faceVertexCounts); - _AddToken(cls, "faceVertexIndices", UsdGeomTokens->faceVertexIndices); - _AddToken(cls, "familyName", UsdGeomTokens->familyName); - _AddToken(cls, "focalLength", UsdGeomTokens->focalLength); - _AddToken(cls, "focusDistance", UsdGeomTokens->focusDistance); - _AddToken(cls, "fromTexture", UsdGeomTokens->fromTexture); - _AddToken(cls, "fStop", UsdGeomTokens->fStop); - _AddToken(cls, "guide", UsdGeomTokens->guide); - _AddToken(cls, "guideVisibility", UsdGeomTokens->guideVisibility); - _AddToken(cls, "height", UsdGeomTokens->height); - _AddToken(cls, "hermite", UsdGeomTokens->hermite); - _AddToken(cls, "holeIndices", UsdGeomTokens->holeIndices); - _AddToken(cls, "horizontalAperture", UsdGeomTokens->horizontalAperture); - _AddToken(cls, "horizontalApertureOffset", UsdGeomTokens->horizontalApertureOffset); - _AddToken(cls, "ids", UsdGeomTokens->ids); - _AddToken(cls, "inactiveIds", UsdGeomTokens->inactiveIds); - _AddToken(cls, "indices", UsdGeomTokens->indices); - _AddToken(cls, "inherited", UsdGeomTokens->inherited); - _AddToken(cls, "interpolateBoundary", UsdGeomTokens->interpolateBoundary); - _AddToken(cls, "interpolation", UsdGeomTokens->interpolation); - _AddToken(cls, "invisible", UsdGeomTokens->invisible); - _AddToken(cls, "invisibleIds", UsdGeomTokens->invisibleIds); - _AddToken(cls, "knots", UsdGeomTokens->knots); - _AddToken(cls, "left", UsdGeomTokens->left); - _AddToken(cls, "leftHanded", UsdGeomTokens->leftHanded); - _AddToken(cls, "length", UsdGeomTokens->length); - _AddToken(cls, "linear", UsdGeomTokens->linear); - _AddToken(cls, "loop", UsdGeomTokens->loop); - _AddToken(cls, "metersPerUnit", UsdGeomTokens->metersPerUnit); - _AddToken(cls, "modelApplyDrawMode", UsdGeomTokens->modelApplyDrawMode); - _AddToken(cls, "modelCardGeometry", UsdGeomTokens->modelCardGeometry); - _AddToken(cls, "modelCardTextureXNeg", UsdGeomTokens->modelCardTextureXNeg); - _AddToken(cls, "modelCardTextureXPos", UsdGeomTokens->modelCardTextureXPos); - _AddToken(cls, "modelCardTextureYNeg", UsdGeomTokens->modelCardTextureYNeg); - _AddToken(cls, "modelCardTextureYPos", UsdGeomTokens->modelCardTextureYPos); - _AddToken(cls, "modelCardTextureZNeg", UsdGeomTokens->modelCardTextureZNeg); - _AddToken(cls, "modelCardTextureZPos", UsdGeomTokens->modelCardTextureZPos); - _AddToken(cls, "modelDrawMode", UsdGeomTokens->modelDrawMode); - _AddToken(cls, "modelDrawModeColor", UsdGeomTokens->modelDrawModeColor); - _AddToken(cls, "mono", UsdGeomTokens->mono); - _AddToken(cls, "motionBlurScale", UsdGeomTokens->motionBlurScale); - _AddToken(cls, "motionNonlinearSampleCount", UsdGeomTokens->motionNonlinearSampleCount); - _AddToken(cls, "motionVelocityScale", UsdGeomTokens->motionVelocityScale); - _AddToken(cls, "none", UsdGeomTokens->none); - _AddToken(cls, "nonOverlapping", UsdGeomTokens->nonOverlapping); - _AddToken(cls, "nonperiodic", UsdGeomTokens->nonperiodic); - _AddToken(cls, "normals", UsdGeomTokens->normals); - _AddToken(cls, "open", UsdGeomTokens->open); - _AddToken(cls, "order", UsdGeomTokens->order); - _AddToken(cls, "orientation", UsdGeomTokens->orientation); - _AddToken(cls, "orientations", UsdGeomTokens->orientations); - _AddToken(cls, "orientationsf", UsdGeomTokens->orientationsf); - _AddToken(cls, "origin", UsdGeomTokens->origin); - _AddToken(cls, "orthographic", UsdGeomTokens->orthographic); - _AddToken(cls, "partition", UsdGeomTokens->partition); - _AddToken(cls, "periodic", UsdGeomTokens->periodic); - _AddToken(cls, "perspective", UsdGeomTokens->perspective); - _AddToken(cls, "pinned", UsdGeomTokens->pinned); - _AddToken(cls, "pivot", UsdGeomTokens->pivot); - _AddToken(cls, "point", UsdGeomTokens->point); - _AddToken(cls, "points", UsdGeomTokens->points); - _AddToken(cls, "pointWeights", UsdGeomTokens->pointWeights); - _AddToken(cls, "positions", UsdGeomTokens->positions); - _AddToken(cls, "power", UsdGeomTokens->power); - _AddToken(cls, "primvarsDisplayColor", UsdGeomTokens->primvarsDisplayColor); - _AddToken(cls, "primvarsDisplayOpacity", UsdGeomTokens->primvarsDisplayOpacity); - _AddToken(cls, "projection", UsdGeomTokens->projection); - _AddToken(cls, "protoIndices", UsdGeomTokens->protoIndices); - _AddToken(cls, "prototypes", UsdGeomTokens->prototypes); - _AddToken(cls, "proxy", UsdGeomTokens->proxy); - _AddToken(cls, "proxyPrim", UsdGeomTokens->proxyPrim); - _AddToken(cls, "proxyVisibility", UsdGeomTokens->proxyVisibility); - _AddToken(cls, "purpose", UsdGeomTokens->purpose); - _AddToken(cls, "radius", UsdGeomTokens->radius); - _AddToken(cls, "radiusBottom", UsdGeomTokens->radiusBottom); - _AddToken(cls, "radiusTop", UsdGeomTokens->radiusTop); - _AddToken(cls, "ranges", UsdGeomTokens->ranges); - _AddToken(cls, "render", UsdGeomTokens->render); - _AddToken(cls, "renderVisibility", UsdGeomTokens->renderVisibility); - _AddToken(cls, "right", UsdGeomTokens->right); - _AddToken(cls, "rightHanded", UsdGeomTokens->rightHanded); - _AddToken(cls, "scales", UsdGeomTokens->scales); - _AddToken(cls, "segment", UsdGeomTokens->segment); - _AddToken(cls, "shutterClose", UsdGeomTokens->shutterClose); - _AddToken(cls, "shutterOpen", UsdGeomTokens->shutterOpen); - _AddToken(cls, "size", UsdGeomTokens->size); - _AddToken(cls, "smooth", UsdGeomTokens->smooth); - _AddToken(cls, "stereoRole", UsdGeomTokens->stereoRole); - _AddToken(cls, "subdivisionScheme", UsdGeomTokens->subdivisionScheme); - _AddToken(cls, "surfaceFaceVertexIndices", UsdGeomTokens->surfaceFaceVertexIndices); - _AddToken(cls, "tangents", UsdGeomTokens->tangents); - _AddToken(cls, "tetrahedron", UsdGeomTokens->tetrahedron); - _AddToken(cls, "tetVertexIndices", UsdGeomTokens->tetVertexIndices); - _AddToken(cls, "triangleSubdivisionRule", UsdGeomTokens->triangleSubdivisionRule); - _AddToken(cls, "trimCurveCounts", UsdGeomTokens->trimCurveCounts); - _AddToken(cls, "trimCurveKnots", UsdGeomTokens->trimCurveKnots); - _AddToken(cls, "trimCurveOrders", UsdGeomTokens->trimCurveOrders); - _AddToken(cls, "trimCurvePoints", UsdGeomTokens->trimCurvePoints); - _AddToken(cls, "trimCurveRanges", UsdGeomTokens->trimCurveRanges); - _AddToken(cls, "trimCurveVertexCounts", UsdGeomTokens->trimCurveVertexCounts); - _AddToken(cls, "type", UsdGeomTokens->type); - _AddToken(cls, "uForm", UsdGeomTokens->uForm); - _AddToken(cls, "uKnots", UsdGeomTokens->uKnots); - _AddToken(cls, "unauthoredValuesIndex", UsdGeomTokens->unauthoredValuesIndex); - _AddToken(cls, "uniform", UsdGeomTokens->uniform); - _AddToken(cls, "unrestricted", UsdGeomTokens->unrestricted); - _AddToken(cls, "uOrder", UsdGeomTokens->uOrder); - _AddToken(cls, "upAxis", UsdGeomTokens->upAxis); - _AddToken(cls, "uRange", UsdGeomTokens->uRange); - _AddToken(cls, "uVertexCount", UsdGeomTokens->uVertexCount); - _AddToken(cls, "varying", UsdGeomTokens->varying); - _AddToken(cls, "velocities", UsdGeomTokens->velocities); - _AddToken(cls, "vertex", UsdGeomTokens->vertex); - _AddToken(cls, "verticalAperture", UsdGeomTokens->verticalAperture); - _AddToken(cls, "verticalApertureOffset", UsdGeomTokens->verticalApertureOffset); - _AddToken(cls, "vForm", UsdGeomTokens->vForm); - _AddToken(cls, "visibility", UsdGeomTokens->visibility); - _AddToken(cls, "visible", UsdGeomTokens->visible); - _AddToken(cls, "vKnots", UsdGeomTokens->vKnots); - _AddToken(cls, "vOrder", UsdGeomTokens->vOrder); - _AddToken(cls, "vRange", UsdGeomTokens->vRange); - _AddToken(cls, "vVertexCount", UsdGeomTokens->vVertexCount); - _AddToken(cls, "width", UsdGeomTokens->width); - _AddToken(cls, "widths", UsdGeomTokens->widths); - _AddToken(cls, "wrap", UsdGeomTokens->wrap); - _AddToken(cls, "x", UsdGeomTokens->x); - _AddToken(cls, "xformOpOrder", UsdGeomTokens->xformOpOrder); - _AddToken(cls, "y", UsdGeomTokens->y); - _AddToken(cls, "z", UsdGeomTokens->z); - _AddToken(cls, "BasisCurves", UsdGeomTokens->BasisCurves); - _AddToken(cls, "Boundable", UsdGeomTokens->Boundable); - _AddToken(cls, "Camera", UsdGeomTokens->Camera); - _AddToken(cls, "Capsule", UsdGeomTokens->Capsule); - _AddToken(cls, "Capsule_1", UsdGeomTokens->Capsule_1); - _AddToken(cls, "Cone", UsdGeomTokens->Cone); - _AddToken(cls, "Cube", UsdGeomTokens->Cube); - _AddToken(cls, "Curves", UsdGeomTokens->Curves); - _AddToken(cls, "Cylinder", UsdGeomTokens->Cylinder); - _AddToken(cls, "Cylinder_1", UsdGeomTokens->Cylinder_1); - _AddToken(cls, "GeomModelAPI", UsdGeomTokens->GeomModelAPI); - _AddToken(cls, "GeomSubset", UsdGeomTokens->GeomSubset); - _AddToken(cls, "Gprim", UsdGeomTokens->Gprim); - _AddToken(cls, "HermiteCurves", UsdGeomTokens->HermiteCurves); - _AddToken(cls, "Imageable", UsdGeomTokens->Imageable); - _AddToken(cls, "Mesh", UsdGeomTokens->Mesh); - _AddToken(cls, "MotionAPI", UsdGeomTokens->MotionAPI); - _AddToken(cls, "NurbsCurves", UsdGeomTokens->NurbsCurves); - _AddToken(cls, "NurbsPatch", UsdGeomTokens->NurbsPatch); - _AddToken(cls, "Plane", UsdGeomTokens->Plane); - _AddToken(cls, "PointBased", UsdGeomTokens->PointBased); - _AddToken(cls, "PointInstancer", UsdGeomTokens->PointInstancer); - _AddToken(cls, "Points", UsdGeomTokens->Points); - _AddToken(cls, "PrimvarsAPI", UsdGeomTokens->PrimvarsAPI); - _AddToken(cls, "Scope", UsdGeomTokens->Scope); - _AddToken(cls, "Sphere", UsdGeomTokens->Sphere); - _AddToken(cls, "TetMesh", UsdGeomTokens->TetMesh); - _AddToken(cls, "VisibilityAPI", UsdGeomTokens->VisibilityAPI); - _AddToken(cls, "Xform", UsdGeomTokens->Xform); - _AddToken(cls, "Xformable", UsdGeomTokens->Xformable); - _AddToken(cls, "XformCommonAPI", UsdGeomTokens->XformCommonAPI); + _ADD_TOKEN(cls, accelerations); + _ADD_TOKEN(cls, all); + _ADD_TOKEN(cls, angularVelocities); + _ADD_TOKEN(cls, axis); + _ADD_TOKEN(cls, basis); + _ADD_TOKEN(cls, bezier); + _ADD_TOKEN(cls, bilinear); + _ADD_TOKEN(cls, boundaries); + _ADD_TOKEN(cls, bounds); + _ADD_TOKEN(cls, box); + _ADD_TOKEN(cls, bspline); + _ADD_TOKEN(cls, cards); + _ADD_TOKEN(cls, catmullClark); + _ADD_TOKEN(cls, catmullRom); + _ADD_TOKEN(cls, clippingPlanes); + _ADD_TOKEN(cls, clippingRange); + _ADD_TOKEN(cls, closed); + _ADD_TOKEN(cls, constant); + _ADD_TOKEN(cls, cornerIndices); + _ADD_TOKEN(cls, cornerSharpnesses); + _ADD_TOKEN(cls, cornersOnly); + _ADD_TOKEN(cls, cornersPlus1); + _ADD_TOKEN(cls, cornersPlus2); + _ADD_TOKEN(cls, creaseIndices); + _ADD_TOKEN(cls, creaseLengths); + _ADD_TOKEN(cls, creaseSharpnesses); + _ADD_TOKEN(cls, cross); + _ADD_TOKEN(cls, cubic); + _ADD_TOKEN(cls, curveVertexCounts); + _ADD_TOKEN(cls, default_); + _ADD_TOKEN(cls, doubleSided); + _ADD_TOKEN(cls, edge); + _ADD_TOKEN(cls, edgeAndCorner); + _ADD_TOKEN(cls, edgeOnly); + _ADD_TOKEN(cls, elementSize); + _ADD_TOKEN(cls, elementType); + _ADD_TOKEN(cls, exposure); + _ADD_TOKEN(cls, extent); + _ADD_TOKEN(cls, extentsHint); + _ADD_TOKEN(cls, face); + _ADD_TOKEN(cls, faceVarying); + _ADD_TOKEN(cls, faceVaryingLinearInterpolation); + _ADD_TOKEN(cls, faceVertexCounts); + _ADD_TOKEN(cls, faceVertexIndices); + _ADD_TOKEN(cls, familyName); + _ADD_TOKEN(cls, focalLength); + _ADD_TOKEN(cls, focusDistance); + _ADD_TOKEN(cls, fromTexture); + _ADD_TOKEN(cls, fStop); + _ADD_TOKEN(cls, guide); + _ADD_TOKEN(cls, guideVisibility); + _ADD_TOKEN(cls, height); + _ADD_TOKEN(cls, hermite); + _ADD_TOKEN(cls, holeIndices); + _ADD_TOKEN(cls, horizontalAperture); + _ADD_TOKEN(cls, horizontalApertureOffset); + _ADD_TOKEN(cls, ids); + _ADD_TOKEN(cls, inactiveIds); + _ADD_TOKEN(cls, indices); + _ADD_TOKEN(cls, inherited); + _ADD_TOKEN(cls, interpolateBoundary); + _ADD_TOKEN(cls, interpolation); + _ADD_TOKEN(cls, invisible); + _ADD_TOKEN(cls, invisibleIds); + _ADD_TOKEN(cls, knots); + _ADD_TOKEN(cls, left); + _ADD_TOKEN(cls, leftHanded); + _ADD_TOKEN(cls, length); + _ADD_TOKEN(cls, linear); + _ADD_TOKEN(cls, loop); + _ADD_TOKEN(cls, metersPerUnit); + _ADD_TOKEN(cls, modelApplyDrawMode); + _ADD_TOKEN(cls, modelCardGeometry); + _ADD_TOKEN(cls, modelCardTextureXNeg); + _ADD_TOKEN(cls, modelCardTextureXPos); + _ADD_TOKEN(cls, modelCardTextureYNeg); + _ADD_TOKEN(cls, modelCardTextureYPos); + _ADD_TOKEN(cls, modelCardTextureZNeg); + _ADD_TOKEN(cls, modelCardTextureZPos); + _ADD_TOKEN(cls, modelDrawMode); + _ADD_TOKEN(cls, modelDrawModeColor); + _ADD_TOKEN(cls, mono); + _ADD_TOKEN(cls, motionBlurScale); + _ADD_TOKEN(cls, motionNonlinearSampleCount); + _ADD_TOKEN(cls, motionVelocityScale); + _ADD_TOKEN(cls, none); + _ADD_TOKEN(cls, nonOverlapping); + _ADD_TOKEN(cls, nonperiodic); + _ADD_TOKEN(cls, normals); + _ADD_TOKEN(cls, open); + _ADD_TOKEN(cls, order); + _ADD_TOKEN(cls, orientation); + _ADD_TOKEN(cls, orientations); + _ADD_TOKEN(cls, orientationsf); + _ADD_TOKEN(cls, origin); + _ADD_TOKEN(cls, orthographic); + _ADD_TOKEN(cls, partition); + _ADD_TOKEN(cls, periodic); + _ADD_TOKEN(cls, perspective); + _ADD_TOKEN(cls, pinned); + _ADD_TOKEN(cls, pivot); + _ADD_TOKEN(cls, point); + _ADD_TOKEN(cls, points); + _ADD_TOKEN(cls, pointWeights); + _ADD_TOKEN(cls, positions); + _ADD_TOKEN(cls, power); + _ADD_TOKEN(cls, primvarsDisplayColor); + _ADD_TOKEN(cls, primvarsDisplayOpacity); + _ADD_TOKEN(cls, projection); + _ADD_TOKEN(cls, protoIndices); + _ADD_TOKEN(cls, prototypes); + _ADD_TOKEN(cls, proxy); + _ADD_TOKEN(cls, proxyPrim); + _ADD_TOKEN(cls, proxyVisibility); + _ADD_TOKEN(cls, purpose); + _ADD_TOKEN(cls, radius); + _ADD_TOKEN(cls, radiusBottom); + _ADD_TOKEN(cls, radiusTop); + _ADD_TOKEN(cls, ranges); + _ADD_TOKEN(cls, render); + _ADD_TOKEN(cls, renderVisibility); + _ADD_TOKEN(cls, right); + _ADD_TOKEN(cls, rightHanded); + _ADD_TOKEN(cls, scales); + _ADD_TOKEN(cls, segment); + _ADD_TOKEN(cls, shutterClose); + _ADD_TOKEN(cls, shutterOpen); + _ADD_TOKEN(cls, size); + _ADD_TOKEN(cls, smooth); + _ADD_TOKEN(cls, stereoRole); + _ADD_TOKEN(cls, subdivisionScheme); + _ADD_TOKEN(cls, surfaceFaceVertexIndices); + _ADD_TOKEN(cls, tangents); + _ADD_TOKEN(cls, tetrahedron); + _ADD_TOKEN(cls, tetVertexIndices); + _ADD_TOKEN(cls, triangleSubdivisionRule); + _ADD_TOKEN(cls, trimCurveCounts); + _ADD_TOKEN(cls, trimCurveKnots); + _ADD_TOKEN(cls, trimCurveOrders); + _ADD_TOKEN(cls, trimCurvePoints); + _ADD_TOKEN(cls, trimCurveRanges); + _ADD_TOKEN(cls, trimCurveVertexCounts); + _ADD_TOKEN(cls, type); + _ADD_TOKEN(cls, uForm); + _ADD_TOKEN(cls, uKnots); + _ADD_TOKEN(cls, unauthoredValuesIndex); + _ADD_TOKEN(cls, uniform); + _ADD_TOKEN(cls, unrestricted); + _ADD_TOKEN(cls, uOrder); + _ADD_TOKEN(cls, upAxis); + _ADD_TOKEN(cls, uRange); + _ADD_TOKEN(cls, uVertexCount); + _ADD_TOKEN(cls, varying); + _ADD_TOKEN(cls, velocities); + _ADD_TOKEN(cls, vertex); + _ADD_TOKEN(cls, verticalAperture); + _ADD_TOKEN(cls, verticalApertureOffset); + _ADD_TOKEN(cls, vForm); + _ADD_TOKEN(cls, visibility); + _ADD_TOKEN(cls, visible); + _ADD_TOKEN(cls, vKnots); + _ADD_TOKEN(cls, vOrder); + _ADD_TOKEN(cls, vRange); + _ADD_TOKEN(cls, vVertexCount); + _ADD_TOKEN(cls, width); + _ADD_TOKEN(cls, widths); + _ADD_TOKEN(cls, wrap); + _ADD_TOKEN(cls, x); + _ADD_TOKEN(cls, xformOpOrder); + _ADD_TOKEN(cls, y); + _ADD_TOKEN(cls, z); + _ADD_TOKEN(cls, BasisCurves); + _ADD_TOKEN(cls, Boundable); + _ADD_TOKEN(cls, Camera); + _ADD_TOKEN(cls, Capsule); + _ADD_TOKEN(cls, Capsule_1); + _ADD_TOKEN(cls, Cone); + _ADD_TOKEN(cls, Cube); + _ADD_TOKEN(cls, Curves); + _ADD_TOKEN(cls, Cylinder); + _ADD_TOKEN(cls, Cylinder_1); + _ADD_TOKEN(cls, GeomModelAPI); + _ADD_TOKEN(cls, GeomSubset); + _ADD_TOKEN(cls, Gprim); + _ADD_TOKEN(cls, HermiteCurves); + _ADD_TOKEN(cls, Imageable); + _ADD_TOKEN(cls, Mesh); + _ADD_TOKEN(cls, MotionAPI); + _ADD_TOKEN(cls, NurbsCurves); + _ADD_TOKEN(cls, NurbsPatch); + _ADD_TOKEN(cls, Plane); + _ADD_TOKEN(cls, PointBased); + _ADD_TOKEN(cls, PointInstancer); + _ADD_TOKEN(cls, Points); + _ADD_TOKEN(cls, PrimvarsAPI); + _ADD_TOKEN(cls, Scope); + _ADD_TOKEN(cls, Sphere); + _ADD_TOKEN(cls, TetMesh); + _ADD_TOKEN(cls, VisibilityAPI); + _ADD_TOKEN(cls, Xform); + _ADD_TOKEN(cls, Xformable); + _ADD_TOKEN(cls, XformCommonAPI); } diff --git a/pxr/usd/usdHydra/wrapTokens.cpp b/pxr/usd/usdHydra/wrapTokens.cpp index c8f7fa2e4a..db4c91de80 100644 --- a/pxr/usd/usdHydra/wrapTokens.cpp +++ b/pxr/usd/usdHydra/wrapTokens.cpp @@ -10,71 +10,41 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdHydraTokens->name.GetString(); }); void wrapUsdHydraTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "black", UsdHydraTokens->black); - _AddToken(cls, "clamp", UsdHydraTokens->clamp); - _AddToken(cls, "displayLookBxdf", UsdHydraTokens->displayLookBxdf); - _AddToken(cls, "faceIndex", UsdHydraTokens->faceIndex); - _AddToken(cls, "faceOffset", UsdHydraTokens->faceOffset); - _AddToken(cls, "frame", UsdHydraTokens->frame); - _AddToken(cls, "HwPrimvar_1", UsdHydraTokens->HwPrimvar_1); - _AddToken(cls, "HwPtexTexture_1", UsdHydraTokens->HwPtexTexture_1); - _AddToken(cls, "HwUvTexture_1", UsdHydraTokens->HwUvTexture_1); - _AddToken(cls, "hydraGenerativeProcedural", UsdHydraTokens->hydraGenerativeProcedural); - _AddToken(cls, "infoFilename", UsdHydraTokens->infoFilename); - _AddToken(cls, "infoVarname", UsdHydraTokens->infoVarname); - _AddToken(cls, "linear", UsdHydraTokens->linear); - _AddToken(cls, "linearMipmapLinear", UsdHydraTokens->linearMipmapLinear); - _AddToken(cls, "linearMipmapNearest", UsdHydraTokens->linearMipmapNearest); - _AddToken(cls, "magFilter", UsdHydraTokens->magFilter); - _AddToken(cls, "minFilter", UsdHydraTokens->minFilter); - _AddToken(cls, "mirror", UsdHydraTokens->mirror); - _AddToken(cls, "nearest", UsdHydraTokens->nearest); - _AddToken(cls, "nearestMipmapLinear", UsdHydraTokens->nearestMipmapLinear); - _AddToken(cls, "nearestMipmapNearest", UsdHydraTokens->nearestMipmapNearest); - _AddToken(cls, "primvarsHdGpProceduralType", UsdHydraTokens->primvarsHdGpProceduralType); - _AddToken(cls, "proceduralSystem", UsdHydraTokens->proceduralSystem); - _AddToken(cls, "repeat", UsdHydraTokens->repeat); - _AddToken(cls, "textureMemory", UsdHydraTokens->textureMemory); - _AddToken(cls, "useMetadata", UsdHydraTokens->useMetadata); - _AddToken(cls, "uv", UsdHydraTokens->uv); - _AddToken(cls, "wrapS", UsdHydraTokens->wrapS); - _AddToken(cls, "wrapT", UsdHydraTokens->wrapT); - _AddToken(cls, "HydraGenerativeProceduralAPI", UsdHydraTokens->HydraGenerativeProceduralAPI); + _ADD_TOKEN(cls, black); + _ADD_TOKEN(cls, clamp); + _ADD_TOKEN(cls, displayLookBxdf); + _ADD_TOKEN(cls, faceIndex); + _ADD_TOKEN(cls, faceOffset); + _ADD_TOKEN(cls, frame); + _ADD_TOKEN(cls, HwPrimvar_1); + _ADD_TOKEN(cls, HwPtexTexture_1); + _ADD_TOKEN(cls, HwUvTexture_1); + _ADD_TOKEN(cls, hydraGenerativeProcedural); + _ADD_TOKEN(cls, infoFilename); + _ADD_TOKEN(cls, infoVarname); + _ADD_TOKEN(cls, linear); + _ADD_TOKEN(cls, linearMipmapLinear); + _ADD_TOKEN(cls, linearMipmapNearest); + _ADD_TOKEN(cls, magFilter); + _ADD_TOKEN(cls, minFilter); + _ADD_TOKEN(cls, mirror); + _ADD_TOKEN(cls, nearest); + _ADD_TOKEN(cls, nearestMipmapLinear); + _ADD_TOKEN(cls, nearestMipmapNearest); + _ADD_TOKEN(cls, primvarsHdGpProceduralType); + _ADD_TOKEN(cls, proceduralSystem); + _ADD_TOKEN(cls, repeat); + _ADD_TOKEN(cls, textureMemory); + _ADD_TOKEN(cls, useMetadata); + _ADD_TOKEN(cls, uv); + _ADD_TOKEN(cls, wrapS); + _ADD_TOKEN(cls, wrapT); + _ADD_TOKEN(cls, HydraGenerativeProceduralAPI); } diff --git a/pxr/usd/usdLux/wrapTokens.cpp b/pxr/usd/usdLux/wrapTokens.cpp index ddbc3393bc..85755fdf17 100644 --- a/pxr/usd/usdLux/wrapTokens.cpp +++ b/pxr/usd/usdLux/wrapTokens.cpp @@ -10,124 +10,94 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdLuxTokens->name.GetString(); }); void wrapUsdLuxTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "angular", UsdLuxTokens->angular); - _AddToken(cls, "automatic", UsdLuxTokens->automatic); - _AddToken(cls, "collectionFilterLinkIncludeRoot", UsdLuxTokens->collectionFilterLinkIncludeRoot); - _AddToken(cls, "collectionLightLinkIncludeRoot", UsdLuxTokens->collectionLightLinkIncludeRoot); - _AddToken(cls, "collectionShadowLinkIncludeRoot", UsdLuxTokens->collectionShadowLinkIncludeRoot); - _AddToken(cls, "consumeAndContinue", UsdLuxTokens->consumeAndContinue); - _AddToken(cls, "consumeAndHalt", UsdLuxTokens->consumeAndHalt); - _AddToken(cls, "cubeMapVerticalCross", UsdLuxTokens->cubeMapVerticalCross); - _AddToken(cls, "filterLink", UsdLuxTokens->filterLink); - _AddToken(cls, "geometry", UsdLuxTokens->geometry); - _AddToken(cls, "guideRadius", UsdLuxTokens->guideRadius); - _AddToken(cls, "ignore", UsdLuxTokens->ignore); - _AddToken(cls, "independent", UsdLuxTokens->independent); - _AddToken(cls, "inputsAngle", UsdLuxTokens->inputsAngle); - _AddToken(cls, "inputsColor", UsdLuxTokens->inputsColor); - _AddToken(cls, "inputsColorTemperature", UsdLuxTokens->inputsColorTemperature); - _AddToken(cls, "inputsDiffuse", UsdLuxTokens->inputsDiffuse); - _AddToken(cls, "inputsEnableColorTemperature", UsdLuxTokens->inputsEnableColorTemperature); - _AddToken(cls, "inputsExposure", UsdLuxTokens->inputsExposure); - _AddToken(cls, "inputsHeight", UsdLuxTokens->inputsHeight); - _AddToken(cls, "inputsIntensity", UsdLuxTokens->inputsIntensity); - _AddToken(cls, "inputsLength", UsdLuxTokens->inputsLength); - _AddToken(cls, "inputsNormalize", UsdLuxTokens->inputsNormalize); - _AddToken(cls, "inputsRadius", UsdLuxTokens->inputsRadius); - _AddToken(cls, "inputsShadowColor", UsdLuxTokens->inputsShadowColor); - _AddToken(cls, "inputsShadowDistance", UsdLuxTokens->inputsShadowDistance); - _AddToken(cls, "inputsShadowEnable", UsdLuxTokens->inputsShadowEnable); - _AddToken(cls, "inputsShadowFalloff", UsdLuxTokens->inputsShadowFalloff); - _AddToken(cls, "inputsShadowFalloffGamma", UsdLuxTokens->inputsShadowFalloffGamma); - _AddToken(cls, "inputsShapingConeAngle", UsdLuxTokens->inputsShapingConeAngle); - _AddToken(cls, "inputsShapingConeSoftness", UsdLuxTokens->inputsShapingConeSoftness); - _AddToken(cls, "inputsShapingFocus", UsdLuxTokens->inputsShapingFocus); - _AddToken(cls, "inputsShapingFocusTint", UsdLuxTokens->inputsShapingFocusTint); - _AddToken(cls, "inputsShapingIesAngleScale", UsdLuxTokens->inputsShapingIesAngleScale); - _AddToken(cls, "inputsShapingIesFile", UsdLuxTokens->inputsShapingIesFile); - _AddToken(cls, "inputsShapingIesNormalize", UsdLuxTokens->inputsShapingIesNormalize); - _AddToken(cls, "inputsSpecular", UsdLuxTokens->inputsSpecular); - _AddToken(cls, "inputsTextureFile", UsdLuxTokens->inputsTextureFile); - _AddToken(cls, "inputsTextureFormat", UsdLuxTokens->inputsTextureFormat); - _AddToken(cls, "inputsWidth", UsdLuxTokens->inputsWidth); - _AddToken(cls, "latlong", UsdLuxTokens->latlong); - _AddToken(cls, "lightFilters", UsdLuxTokens->lightFilters); - _AddToken(cls, "lightFilterShaderId", UsdLuxTokens->lightFilterShaderId); - _AddToken(cls, "lightLink", UsdLuxTokens->lightLink); - _AddToken(cls, "lightList", UsdLuxTokens->lightList); - _AddToken(cls, "lightListCacheBehavior", UsdLuxTokens->lightListCacheBehavior); - _AddToken(cls, "lightMaterialSyncMode", UsdLuxTokens->lightMaterialSyncMode); - _AddToken(cls, "lightShaderId", UsdLuxTokens->lightShaderId); - _AddToken(cls, "materialGlowTintsLight", UsdLuxTokens->materialGlowTintsLight); - _AddToken(cls, "MeshLight", UsdLuxTokens->MeshLight); - _AddToken(cls, "mirroredBall", UsdLuxTokens->mirroredBall); - _AddToken(cls, "noMaterialResponse", UsdLuxTokens->noMaterialResponse); - _AddToken(cls, "orientToStageUpAxis", UsdLuxTokens->orientToStageUpAxis); - _AddToken(cls, "poleAxis", UsdLuxTokens->poleAxis); - _AddToken(cls, "portals", UsdLuxTokens->portals); - _AddToken(cls, "scene", UsdLuxTokens->scene); - _AddToken(cls, "shadowLink", UsdLuxTokens->shadowLink); - _AddToken(cls, "treatAsLine", UsdLuxTokens->treatAsLine); - _AddToken(cls, "treatAsPoint", UsdLuxTokens->treatAsPoint); - _AddToken(cls, "VolumeLight", UsdLuxTokens->VolumeLight); - _AddToken(cls, "Y", UsdLuxTokens->Y); - _AddToken(cls, "Z", UsdLuxTokens->Z); - _AddToken(cls, "BoundableLightBase", UsdLuxTokens->BoundableLightBase); - _AddToken(cls, "CylinderLight", UsdLuxTokens->CylinderLight); - _AddToken(cls, "DiskLight", UsdLuxTokens->DiskLight); - _AddToken(cls, "DistantLight", UsdLuxTokens->DistantLight); - _AddToken(cls, "DomeLight", UsdLuxTokens->DomeLight); - _AddToken(cls, "DomeLight_1", UsdLuxTokens->DomeLight_1); - _AddToken(cls, "GeometryLight", UsdLuxTokens->GeometryLight); - _AddToken(cls, "LightAPI", UsdLuxTokens->LightAPI); - _AddToken(cls, "LightFilter", UsdLuxTokens->LightFilter); - _AddToken(cls, "LightListAPI", UsdLuxTokens->LightListAPI); - _AddToken(cls, "ListAPI", UsdLuxTokens->ListAPI); - _AddToken(cls, "MeshLightAPI", UsdLuxTokens->MeshLightAPI); - _AddToken(cls, "NonboundableLightBase", UsdLuxTokens->NonboundableLightBase); - _AddToken(cls, "PluginLight", UsdLuxTokens->PluginLight); - _AddToken(cls, "PluginLightFilter", UsdLuxTokens->PluginLightFilter); - _AddToken(cls, "PortalLight", UsdLuxTokens->PortalLight); - _AddToken(cls, "RectLight", UsdLuxTokens->RectLight); - _AddToken(cls, "ShadowAPI", UsdLuxTokens->ShadowAPI); - _AddToken(cls, "ShapingAPI", UsdLuxTokens->ShapingAPI); - _AddToken(cls, "SphereLight", UsdLuxTokens->SphereLight); - _AddToken(cls, "VolumeLightAPI", UsdLuxTokens->VolumeLightAPI); + _ADD_TOKEN(cls, angular); + _ADD_TOKEN(cls, automatic); + _ADD_TOKEN(cls, collectionFilterLinkIncludeRoot); + _ADD_TOKEN(cls, collectionLightLinkIncludeRoot); + _ADD_TOKEN(cls, collectionShadowLinkIncludeRoot); + _ADD_TOKEN(cls, consumeAndContinue); + _ADD_TOKEN(cls, consumeAndHalt); + _ADD_TOKEN(cls, cubeMapVerticalCross); + _ADD_TOKEN(cls, filterLink); + _ADD_TOKEN(cls, geometry); + _ADD_TOKEN(cls, guideRadius); + _ADD_TOKEN(cls, ignore); + _ADD_TOKEN(cls, independent); + _ADD_TOKEN(cls, inputsAngle); + _ADD_TOKEN(cls, inputsColor); + _ADD_TOKEN(cls, inputsColorTemperature); + _ADD_TOKEN(cls, inputsDiffuse); + _ADD_TOKEN(cls, inputsEnableColorTemperature); + _ADD_TOKEN(cls, inputsExposure); + _ADD_TOKEN(cls, inputsHeight); + _ADD_TOKEN(cls, inputsIntensity); + _ADD_TOKEN(cls, inputsLength); + _ADD_TOKEN(cls, inputsNormalize); + _ADD_TOKEN(cls, inputsRadius); + _ADD_TOKEN(cls, inputsShadowColor); + _ADD_TOKEN(cls, inputsShadowDistance); + _ADD_TOKEN(cls, inputsShadowEnable); + _ADD_TOKEN(cls, inputsShadowFalloff); + _ADD_TOKEN(cls, inputsShadowFalloffGamma); + _ADD_TOKEN(cls, inputsShapingConeAngle); + _ADD_TOKEN(cls, inputsShapingConeSoftness); + _ADD_TOKEN(cls, inputsShapingFocus); + _ADD_TOKEN(cls, inputsShapingFocusTint); + _ADD_TOKEN(cls, inputsShapingIesAngleScale); + _ADD_TOKEN(cls, inputsShapingIesFile); + _ADD_TOKEN(cls, inputsShapingIesNormalize); + _ADD_TOKEN(cls, inputsSpecular); + _ADD_TOKEN(cls, inputsTextureFile); + _ADD_TOKEN(cls, inputsTextureFormat); + _ADD_TOKEN(cls, inputsWidth); + _ADD_TOKEN(cls, latlong); + _ADD_TOKEN(cls, lightFilters); + _ADD_TOKEN(cls, lightFilterShaderId); + _ADD_TOKEN(cls, lightLink); + _ADD_TOKEN(cls, lightList); + _ADD_TOKEN(cls, lightListCacheBehavior); + _ADD_TOKEN(cls, lightMaterialSyncMode); + _ADD_TOKEN(cls, lightShaderId); + _ADD_TOKEN(cls, materialGlowTintsLight); + _ADD_TOKEN(cls, MeshLight); + _ADD_TOKEN(cls, mirroredBall); + _ADD_TOKEN(cls, noMaterialResponse); + _ADD_TOKEN(cls, orientToStageUpAxis); + _ADD_TOKEN(cls, poleAxis); + _ADD_TOKEN(cls, portals); + _ADD_TOKEN(cls, scene); + _ADD_TOKEN(cls, shadowLink); + _ADD_TOKEN(cls, treatAsLine); + _ADD_TOKEN(cls, treatAsPoint); + _ADD_TOKEN(cls, VolumeLight); + _ADD_TOKEN(cls, Y); + _ADD_TOKEN(cls, Z); + _ADD_TOKEN(cls, BoundableLightBase); + _ADD_TOKEN(cls, CylinderLight); + _ADD_TOKEN(cls, DiskLight); + _ADD_TOKEN(cls, DistantLight); + _ADD_TOKEN(cls, DomeLight); + _ADD_TOKEN(cls, DomeLight_1); + _ADD_TOKEN(cls, GeometryLight); + _ADD_TOKEN(cls, LightAPI); + _ADD_TOKEN(cls, LightFilter); + _ADD_TOKEN(cls, LightListAPI); + _ADD_TOKEN(cls, ListAPI); + _ADD_TOKEN(cls, MeshLightAPI); + _ADD_TOKEN(cls, NonboundableLightBase); + _ADD_TOKEN(cls, PluginLight); + _ADD_TOKEN(cls, PluginLightFilter); + _ADD_TOKEN(cls, PortalLight); + _ADD_TOKEN(cls, RectLight); + _ADD_TOKEN(cls, ShadowAPI); + _ADD_TOKEN(cls, ShapingAPI); + _ADD_TOKEN(cls, SphereLight); + _ADD_TOKEN(cls, VolumeLightAPI); } diff --git a/pxr/usd/usdMedia/wrapTokens.cpp b/pxr/usd/usdMedia/wrapTokens.cpp index 2b7cce3dad..89ebb11522 100644 --- a/pxr/usd/usdMedia/wrapTokens.cpp +++ b/pxr/usd/usdMedia/wrapTokens.cpp @@ -10,62 +10,32 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdMediaTokens->name.GetString(); }); void wrapUsdMediaTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "auralMode", UsdMediaTokens->auralMode); - _AddToken(cls, "defaultImage", UsdMediaTokens->defaultImage); - _AddToken(cls, "endTime", UsdMediaTokens->endTime); - _AddToken(cls, "filePath", UsdMediaTokens->filePath); - _AddToken(cls, "gain", UsdMediaTokens->gain); - _AddToken(cls, "loopFromStage", UsdMediaTokens->loopFromStage); - _AddToken(cls, "loopFromStart", UsdMediaTokens->loopFromStart); - _AddToken(cls, "loopFromStartToEnd", UsdMediaTokens->loopFromStartToEnd); - _AddToken(cls, "mediaOffset", UsdMediaTokens->mediaOffset); - _AddToken(cls, "nonSpatial", UsdMediaTokens->nonSpatial); - _AddToken(cls, "onceFromStart", UsdMediaTokens->onceFromStart); - _AddToken(cls, "onceFromStartToEnd", UsdMediaTokens->onceFromStartToEnd); - _AddToken(cls, "playbackMode", UsdMediaTokens->playbackMode); - _AddToken(cls, "previews", UsdMediaTokens->previews); - _AddToken(cls, "previewThumbnails", UsdMediaTokens->previewThumbnails); - _AddToken(cls, "previewThumbnailsDefault", UsdMediaTokens->previewThumbnailsDefault); - _AddToken(cls, "spatial", UsdMediaTokens->spatial); - _AddToken(cls, "startTime", UsdMediaTokens->startTime); - _AddToken(cls, "thumbnails", UsdMediaTokens->thumbnails); - _AddToken(cls, "AssetPreviewsAPI", UsdMediaTokens->AssetPreviewsAPI); - _AddToken(cls, "SpatialAudio", UsdMediaTokens->SpatialAudio); + _ADD_TOKEN(cls, auralMode); + _ADD_TOKEN(cls, defaultImage); + _ADD_TOKEN(cls, endTime); + _ADD_TOKEN(cls, filePath); + _ADD_TOKEN(cls, gain); + _ADD_TOKEN(cls, loopFromStage); + _ADD_TOKEN(cls, loopFromStart); + _ADD_TOKEN(cls, loopFromStartToEnd); + _ADD_TOKEN(cls, mediaOffset); + _ADD_TOKEN(cls, nonSpatial); + _ADD_TOKEN(cls, onceFromStart); + _ADD_TOKEN(cls, onceFromStartToEnd); + _ADD_TOKEN(cls, playbackMode); + _ADD_TOKEN(cls, previews); + _ADD_TOKEN(cls, previewThumbnails); + _ADD_TOKEN(cls, previewThumbnailsDefault); + _ADD_TOKEN(cls, spatial); + _ADD_TOKEN(cls, startTime); + _ADD_TOKEN(cls, thumbnails); + _ADD_TOKEN(cls, AssetPreviewsAPI); + _ADD_TOKEN(cls, SpatialAudio); } diff --git a/pxr/usd/usdPhysics/wrapTokens.cpp b/pxr/usd/usdPhysics/wrapTokens.cpp index 5b89894e87..94df139187 100644 --- a/pxr/usd/usdPhysics/wrapTokens.cpp +++ b/pxr/usd/usdPhysics/wrapTokens.cpp @@ -10,129 +10,99 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdPhysicsTokens->name.GetString(); }); void wrapUsdPhysicsTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "acceleration", UsdPhysicsTokens->acceleration); - _AddToken(cls, "angular", UsdPhysicsTokens->angular); - _AddToken(cls, "boundingCube", UsdPhysicsTokens->boundingCube); - _AddToken(cls, "boundingSphere", UsdPhysicsTokens->boundingSphere); - _AddToken(cls, "colliders", UsdPhysicsTokens->colliders); - _AddToken(cls, "convexDecomposition", UsdPhysicsTokens->convexDecomposition); - _AddToken(cls, "convexHull", UsdPhysicsTokens->convexHull); - _AddToken(cls, "distance", UsdPhysicsTokens->distance); - _AddToken(cls, "drive", UsdPhysicsTokens->drive); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsDamping", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsDamping); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsMaxForce", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsMaxForce); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsStiffness", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsStiffness); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsTargetPosition", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsTargetPosition); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsTargetVelocity", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsTargetVelocity); - _AddToken(cls, "drive_MultipleApplyTemplate_PhysicsType", UsdPhysicsTokens->drive_MultipleApplyTemplate_PhysicsType); - _AddToken(cls, "force", UsdPhysicsTokens->force); - _AddToken(cls, "kilogramsPerUnit", UsdPhysicsTokens->kilogramsPerUnit); - _AddToken(cls, "limit", UsdPhysicsTokens->limit); - _AddToken(cls, "limit_MultipleApplyTemplate_PhysicsHigh", UsdPhysicsTokens->limit_MultipleApplyTemplate_PhysicsHigh); - _AddToken(cls, "limit_MultipleApplyTemplate_PhysicsLow", UsdPhysicsTokens->limit_MultipleApplyTemplate_PhysicsLow); - _AddToken(cls, "linear", UsdPhysicsTokens->linear); - _AddToken(cls, "meshSimplification", UsdPhysicsTokens->meshSimplification); - _AddToken(cls, "none", UsdPhysicsTokens->none); - _AddToken(cls, "physicsAngularVelocity", UsdPhysicsTokens->physicsAngularVelocity); - _AddToken(cls, "physicsApproximation", UsdPhysicsTokens->physicsApproximation); - _AddToken(cls, "physicsAxis", UsdPhysicsTokens->physicsAxis); - _AddToken(cls, "physicsBody0", UsdPhysicsTokens->physicsBody0); - _AddToken(cls, "physicsBody1", UsdPhysicsTokens->physicsBody1); - _AddToken(cls, "physicsBreakForce", UsdPhysicsTokens->physicsBreakForce); - _AddToken(cls, "physicsBreakTorque", UsdPhysicsTokens->physicsBreakTorque); - _AddToken(cls, "physicsCenterOfMass", UsdPhysicsTokens->physicsCenterOfMass); - _AddToken(cls, "physicsCollisionEnabled", UsdPhysicsTokens->physicsCollisionEnabled); - _AddToken(cls, "physicsConeAngle0Limit", UsdPhysicsTokens->physicsConeAngle0Limit); - _AddToken(cls, "physicsConeAngle1Limit", UsdPhysicsTokens->physicsConeAngle1Limit); - _AddToken(cls, "physicsDensity", UsdPhysicsTokens->physicsDensity); - _AddToken(cls, "physicsDiagonalInertia", UsdPhysicsTokens->physicsDiagonalInertia); - _AddToken(cls, "physicsDynamicFriction", UsdPhysicsTokens->physicsDynamicFriction); - _AddToken(cls, "physicsExcludeFromArticulation", UsdPhysicsTokens->physicsExcludeFromArticulation); - _AddToken(cls, "physicsFilteredGroups", UsdPhysicsTokens->physicsFilteredGroups); - _AddToken(cls, "physicsFilteredPairs", UsdPhysicsTokens->physicsFilteredPairs); - _AddToken(cls, "physicsGravityDirection", UsdPhysicsTokens->physicsGravityDirection); - _AddToken(cls, "physicsGravityMagnitude", UsdPhysicsTokens->physicsGravityMagnitude); - _AddToken(cls, "physicsInvertFilteredGroups", UsdPhysicsTokens->physicsInvertFilteredGroups); - _AddToken(cls, "physicsJointEnabled", UsdPhysicsTokens->physicsJointEnabled); - _AddToken(cls, "physicsKinematicEnabled", UsdPhysicsTokens->physicsKinematicEnabled); - _AddToken(cls, "physicsLocalPos0", UsdPhysicsTokens->physicsLocalPos0); - _AddToken(cls, "physicsLocalPos1", UsdPhysicsTokens->physicsLocalPos1); - _AddToken(cls, "physicsLocalRot0", UsdPhysicsTokens->physicsLocalRot0); - _AddToken(cls, "physicsLocalRot1", UsdPhysicsTokens->physicsLocalRot1); - _AddToken(cls, "physicsLowerLimit", UsdPhysicsTokens->physicsLowerLimit); - _AddToken(cls, "physicsMass", UsdPhysicsTokens->physicsMass); - _AddToken(cls, "physicsMaxDistance", UsdPhysicsTokens->physicsMaxDistance); - _AddToken(cls, "physicsMergeGroup", UsdPhysicsTokens->physicsMergeGroup); - _AddToken(cls, "physicsMinDistance", UsdPhysicsTokens->physicsMinDistance); - _AddToken(cls, "physicsPrincipalAxes", UsdPhysicsTokens->physicsPrincipalAxes); - _AddToken(cls, "physicsRestitution", UsdPhysicsTokens->physicsRestitution); - _AddToken(cls, "physicsRigidBodyEnabled", UsdPhysicsTokens->physicsRigidBodyEnabled); - _AddToken(cls, "physicsSimulationOwner", UsdPhysicsTokens->physicsSimulationOwner); - _AddToken(cls, "physicsStartsAsleep", UsdPhysicsTokens->physicsStartsAsleep); - _AddToken(cls, "physicsStaticFriction", UsdPhysicsTokens->physicsStaticFriction); - _AddToken(cls, "physicsUpperLimit", UsdPhysicsTokens->physicsUpperLimit); - _AddToken(cls, "physicsVelocity", UsdPhysicsTokens->physicsVelocity); - _AddToken(cls, "rotX", UsdPhysicsTokens->rotX); - _AddToken(cls, "rotY", UsdPhysicsTokens->rotY); - _AddToken(cls, "rotZ", UsdPhysicsTokens->rotZ); - _AddToken(cls, "transX", UsdPhysicsTokens->transX); - _AddToken(cls, "transY", UsdPhysicsTokens->transY); - _AddToken(cls, "transZ", UsdPhysicsTokens->transZ); - _AddToken(cls, "x", UsdPhysicsTokens->x); - _AddToken(cls, "y", UsdPhysicsTokens->y); - _AddToken(cls, "z", UsdPhysicsTokens->z); - _AddToken(cls, "PhysicsArticulationRootAPI", UsdPhysicsTokens->PhysicsArticulationRootAPI); - _AddToken(cls, "PhysicsCollisionAPI", UsdPhysicsTokens->PhysicsCollisionAPI); - _AddToken(cls, "PhysicsCollisionGroup", UsdPhysicsTokens->PhysicsCollisionGroup); - _AddToken(cls, "PhysicsDistanceJoint", UsdPhysicsTokens->PhysicsDistanceJoint); - _AddToken(cls, "PhysicsDriveAPI", UsdPhysicsTokens->PhysicsDriveAPI); - _AddToken(cls, "PhysicsFilteredPairsAPI", UsdPhysicsTokens->PhysicsFilteredPairsAPI); - _AddToken(cls, "PhysicsFixedJoint", UsdPhysicsTokens->PhysicsFixedJoint); - _AddToken(cls, "PhysicsJoint", UsdPhysicsTokens->PhysicsJoint); - _AddToken(cls, "PhysicsLimitAPI", UsdPhysicsTokens->PhysicsLimitAPI); - _AddToken(cls, "PhysicsMassAPI", UsdPhysicsTokens->PhysicsMassAPI); - _AddToken(cls, "PhysicsMaterialAPI", UsdPhysicsTokens->PhysicsMaterialAPI); - _AddToken(cls, "PhysicsMeshCollisionAPI", UsdPhysicsTokens->PhysicsMeshCollisionAPI); - _AddToken(cls, "PhysicsPrismaticJoint", UsdPhysicsTokens->PhysicsPrismaticJoint); - _AddToken(cls, "PhysicsRevoluteJoint", UsdPhysicsTokens->PhysicsRevoluteJoint); - _AddToken(cls, "PhysicsRigidBodyAPI", UsdPhysicsTokens->PhysicsRigidBodyAPI); - _AddToken(cls, "PhysicsScene", UsdPhysicsTokens->PhysicsScene); - _AddToken(cls, "PhysicsSphericalJoint", UsdPhysicsTokens->PhysicsSphericalJoint); + _ADD_TOKEN(cls, acceleration); + _ADD_TOKEN(cls, angular); + _ADD_TOKEN(cls, boundingCube); + _ADD_TOKEN(cls, boundingSphere); + _ADD_TOKEN(cls, colliders); + _ADD_TOKEN(cls, convexDecomposition); + _ADD_TOKEN(cls, convexHull); + _ADD_TOKEN(cls, distance); + _ADD_TOKEN(cls, drive); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsDamping); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsMaxForce); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsStiffness); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsTargetPosition); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsTargetVelocity); + _ADD_TOKEN(cls, drive_MultipleApplyTemplate_PhysicsType); + _ADD_TOKEN(cls, force); + _ADD_TOKEN(cls, kilogramsPerUnit); + _ADD_TOKEN(cls, limit); + _ADD_TOKEN(cls, limit_MultipleApplyTemplate_PhysicsHigh); + _ADD_TOKEN(cls, limit_MultipleApplyTemplate_PhysicsLow); + _ADD_TOKEN(cls, linear); + _ADD_TOKEN(cls, meshSimplification); + _ADD_TOKEN(cls, none); + _ADD_TOKEN(cls, physicsAngularVelocity); + _ADD_TOKEN(cls, physicsApproximation); + _ADD_TOKEN(cls, physicsAxis); + _ADD_TOKEN(cls, physicsBody0); + _ADD_TOKEN(cls, physicsBody1); + _ADD_TOKEN(cls, physicsBreakForce); + _ADD_TOKEN(cls, physicsBreakTorque); + _ADD_TOKEN(cls, physicsCenterOfMass); + _ADD_TOKEN(cls, physicsCollisionEnabled); + _ADD_TOKEN(cls, physicsConeAngle0Limit); + _ADD_TOKEN(cls, physicsConeAngle1Limit); + _ADD_TOKEN(cls, physicsDensity); + _ADD_TOKEN(cls, physicsDiagonalInertia); + _ADD_TOKEN(cls, physicsDynamicFriction); + _ADD_TOKEN(cls, physicsExcludeFromArticulation); + _ADD_TOKEN(cls, physicsFilteredGroups); + _ADD_TOKEN(cls, physicsFilteredPairs); + _ADD_TOKEN(cls, physicsGravityDirection); + _ADD_TOKEN(cls, physicsGravityMagnitude); + _ADD_TOKEN(cls, physicsInvertFilteredGroups); + _ADD_TOKEN(cls, physicsJointEnabled); + _ADD_TOKEN(cls, physicsKinematicEnabled); + _ADD_TOKEN(cls, physicsLocalPos0); + _ADD_TOKEN(cls, physicsLocalPos1); + _ADD_TOKEN(cls, physicsLocalRot0); + _ADD_TOKEN(cls, physicsLocalRot1); + _ADD_TOKEN(cls, physicsLowerLimit); + _ADD_TOKEN(cls, physicsMass); + _ADD_TOKEN(cls, physicsMaxDistance); + _ADD_TOKEN(cls, physicsMergeGroup); + _ADD_TOKEN(cls, physicsMinDistance); + _ADD_TOKEN(cls, physicsPrincipalAxes); + _ADD_TOKEN(cls, physicsRestitution); + _ADD_TOKEN(cls, physicsRigidBodyEnabled); + _ADD_TOKEN(cls, physicsSimulationOwner); + _ADD_TOKEN(cls, physicsStartsAsleep); + _ADD_TOKEN(cls, physicsStaticFriction); + _ADD_TOKEN(cls, physicsUpperLimit); + _ADD_TOKEN(cls, physicsVelocity); + _ADD_TOKEN(cls, rotX); + _ADD_TOKEN(cls, rotY); + _ADD_TOKEN(cls, rotZ); + _ADD_TOKEN(cls, transX); + _ADD_TOKEN(cls, transY); + _ADD_TOKEN(cls, transZ); + _ADD_TOKEN(cls, x); + _ADD_TOKEN(cls, y); + _ADD_TOKEN(cls, z); + _ADD_TOKEN(cls, PhysicsArticulationRootAPI); + _ADD_TOKEN(cls, PhysicsCollisionAPI); + _ADD_TOKEN(cls, PhysicsCollisionGroup); + _ADD_TOKEN(cls, PhysicsDistanceJoint); + _ADD_TOKEN(cls, PhysicsDriveAPI); + _ADD_TOKEN(cls, PhysicsFilteredPairsAPI); + _ADD_TOKEN(cls, PhysicsFixedJoint); + _ADD_TOKEN(cls, PhysicsJoint); + _ADD_TOKEN(cls, PhysicsLimitAPI); + _ADD_TOKEN(cls, PhysicsMassAPI); + _ADD_TOKEN(cls, PhysicsMaterialAPI); + _ADD_TOKEN(cls, PhysicsMeshCollisionAPI); + _ADD_TOKEN(cls, PhysicsPrismaticJoint); + _ADD_TOKEN(cls, PhysicsRevoluteJoint); + _ADD_TOKEN(cls, PhysicsRigidBodyAPI); + _ADD_TOKEN(cls, PhysicsScene); + _ADD_TOKEN(cls, PhysicsSphericalJoint); } diff --git a/pxr/usd/usdProc/wrapTokens.cpp b/pxr/usd/usdProc/wrapTokens.cpp index 8e51b7a072..4b7bc6d23e 100644 --- a/pxr/usd/usdProc/wrapTokens.cpp +++ b/pxr/usd/usdProc/wrapTokens.cpp @@ -10,43 +10,13 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdProcTokens->name.GetString(); }); void wrapUsdProcTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "proceduralSystem", UsdProcTokens->proceduralSystem); - _AddToken(cls, "GenerativeProcedural", UsdProcTokens->GenerativeProcedural); + _ADD_TOKEN(cls, proceduralSystem); + _ADD_TOKEN(cls, GenerativeProcedural); } diff --git a/pxr/usd/usdRender/wrapTokens.cpp b/pxr/usd/usdRender/wrapTokens.cpp index fa7cda3889..17bf5e53ec 100644 --- a/pxr/usd/usdRender/wrapTokens.cpp +++ b/pxr/usd/usdRender/wrapTokens.cpp @@ -10,89 +10,59 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdRenderTokens->name.GetString(); }); void wrapUsdRenderTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "adjustApertureHeight", UsdRenderTokens->adjustApertureHeight); - _AddToken(cls, "adjustApertureWidth", UsdRenderTokens->adjustApertureWidth); - _AddToken(cls, "adjustPixelAspectRatio", UsdRenderTokens->adjustPixelAspectRatio); - _AddToken(cls, "aspectRatioConformPolicy", UsdRenderTokens->aspectRatioConformPolicy); - _AddToken(cls, "camera", UsdRenderTokens->camera); - _AddToken(cls, "collectionRenderVisibilityIncludeRoot", UsdRenderTokens->collectionRenderVisibilityIncludeRoot); - _AddToken(cls, "color3f", UsdRenderTokens->color3f); - _AddToken(cls, "command", UsdRenderTokens->command); - _AddToken(cls, "cropAperture", UsdRenderTokens->cropAperture); - _AddToken(cls, "dataType", UsdRenderTokens->dataType); - _AddToken(cls, "dataWindowNDC", UsdRenderTokens->dataWindowNDC); - _AddToken(cls, "deepRaster", UsdRenderTokens->deepRaster); - _AddToken(cls, "denoiseEnable", UsdRenderTokens->denoiseEnable); - _AddToken(cls, "denoisePass", UsdRenderTokens->denoisePass); - _AddToken(cls, "disableDepthOfField", UsdRenderTokens->disableDepthOfField); - _AddToken(cls, "disableMotionBlur", UsdRenderTokens->disableMotionBlur); - _AddToken(cls, "expandAperture", UsdRenderTokens->expandAperture); - _AddToken(cls, "fileName", UsdRenderTokens->fileName); - _AddToken(cls, "full", UsdRenderTokens->full); - _AddToken(cls, "includedPurposes", UsdRenderTokens->includedPurposes); - _AddToken(cls, "inputPasses", UsdRenderTokens->inputPasses); - _AddToken(cls, "instantaneousShutter", UsdRenderTokens->instantaneousShutter); - _AddToken(cls, "intrinsic", UsdRenderTokens->intrinsic); - _AddToken(cls, "lpe", UsdRenderTokens->lpe); - _AddToken(cls, "materialBindingPurposes", UsdRenderTokens->materialBindingPurposes); - _AddToken(cls, "orderedVars", UsdRenderTokens->orderedVars); - _AddToken(cls, "passType", UsdRenderTokens->passType); - _AddToken(cls, "pixelAspectRatio", UsdRenderTokens->pixelAspectRatio); - _AddToken(cls, "preview", UsdRenderTokens->preview); - _AddToken(cls, "primvar", UsdRenderTokens->primvar); - _AddToken(cls, "productName", UsdRenderTokens->productName); - _AddToken(cls, "products", UsdRenderTokens->products); - _AddToken(cls, "productType", UsdRenderTokens->productType); - _AddToken(cls, "raster", UsdRenderTokens->raster); - _AddToken(cls, "raw", UsdRenderTokens->raw); - _AddToken(cls, "renderingColorSpace", UsdRenderTokens->renderingColorSpace); - _AddToken(cls, "renderSettingsPrimPath", UsdRenderTokens->renderSettingsPrimPath); - _AddToken(cls, "renderSource", UsdRenderTokens->renderSource); - _AddToken(cls, "renderVisibility", UsdRenderTokens->renderVisibility); - _AddToken(cls, "resolution", UsdRenderTokens->resolution); - _AddToken(cls, "sourceName", UsdRenderTokens->sourceName); - _AddToken(cls, "sourceType", UsdRenderTokens->sourceType); - _AddToken(cls, "RenderDenoisePass", UsdRenderTokens->RenderDenoisePass); - _AddToken(cls, "RenderPass", UsdRenderTokens->RenderPass); - _AddToken(cls, "RenderProduct", UsdRenderTokens->RenderProduct); - _AddToken(cls, "RenderSettings", UsdRenderTokens->RenderSettings); - _AddToken(cls, "RenderSettingsBase", UsdRenderTokens->RenderSettingsBase); - _AddToken(cls, "RenderVar", UsdRenderTokens->RenderVar); + _ADD_TOKEN(cls, adjustApertureHeight); + _ADD_TOKEN(cls, adjustApertureWidth); + _ADD_TOKEN(cls, adjustPixelAspectRatio); + _ADD_TOKEN(cls, aspectRatioConformPolicy); + _ADD_TOKEN(cls, camera); + _ADD_TOKEN(cls, collectionRenderVisibilityIncludeRoot); + _ADD_TOKEN(cls, color3f); + _ADD_TOKEN(cls, command); + _ADD_TOKEN(cls, cropAperture); + _ADD_TOKEN(cls, dataType); + _ADD_TOKEN(cls, dataWindowNDC); + _ADD_TOKEN(cls, deepRaster); + _ADD_TOKEN(cls, denoiseEnable); + _ADD_TOKEN(cls, denoisePass); + _ADD_TOKEN(cls, disableDepthOfField); + _ADD_TOKEN(cls, disableMotionBlur); + _ADD_TOKEN(cls, expandAperture); + _ADD_TOKEN(cls, fileName); + _ADD_TOKEN(cls, full); + _ADD_TOKEN(cls, includedPurposes); + _ADD_TOKEN(cls, inputPasses); + _ADD_TOKEN(cls, instantaneousShutter); + _ADD_TOKEN(cls, intrinsic); + _ADD_TOKEN(cls, lpe); + _ADD_TOKEN(cls, materialBindingPurposes); + _ADD_TOKEN(cls, orderedVars); + _ADD_TOKEN(cls, passType); + _ADD_TOKEN(cls, pixelAspectRatio); + _ADD_TOKEN(cls, preview); + _ADD_TOKEN(cls, primvar); + _ADD_TOKEN(cls, productName); + _ADD_TOKEN(cls, products); + _ADD_TOKEN(cls, productType); + _ADD_TOKEN(cls, raster); + _ADD_TOKEN(cls, raw); + _ADD_TOKEN(cls, renderingColorSpace); + _ADD_TOKEN(cls, renderSettingsPrimPath); + _ADD_TOKEN(cls, renderSource); + _ADD_TOKEN(cls, renderVisibility); + _ADD_TOKEN(cls, resolution); + _ADD_TOKEN(cls, sourceName); + _ADD_TOKEN(cls, sourceType); + _ADD_TOKEN(cls, RenderDenoisePass); + _ADD_TOKEN(cls, RenderPass); + _ADD_TOKEN(cls, RenderProduct); + _ADD_TOKEN(cls, RenderSettings); + _ADD_TOKEN(cls, RenderSettingsBase); + _ADD_TOKEN(cls, RenderVar); } diff --git a/pxr/usd/usdRi/wrapTokens.cpp b/pxr/usd/usdRi/wrapTokens.cpp index 20f82a9977..3783680ee8 100644 --- a/pxr/usd/usdRi/wrapTokens.cpp +++ b/pxr/usd/usdRi/wrapTokens.cpp @@ -10,60 +10,30 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdRiTokens->name.GetString(); }); void wrapUsdRiTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "bspline", UsdRiTokens->bspline); - _AddToken(cls, "cameraVisibility", UsdRiTokens->cameraVisibility); - _AddToken(cls, "catmullRom", UsdRiTokens->catmullRom); - _AddToken(cls, "collectionCameraVisibilityIncludeRoot", UsdRiTokens->collectionCameraVisibilityIncludeRoot); - _AddToken(cls, "constant", UsdRiTokens->constant); - _AddToken(cls, "interpolation", UsdRiTokens->interpolation); - _AddToken(cls, "linear", UsdRiTokens->linear); - _AddToken(cls, "matte", UsdRiTokens->matte); - _AddToken(cls, "outputsRiDisplacement", UsdRiTokens->outputsRiDisplacement); - _AddToken(cls, "outputsRiSurface", UsdRiTokens->outputsRiSurface); - _AddToken(cls, "outputsRiVolume", UsdRiTokens->outputsRiVolume); - _AddToken(cls, "positions", UsdRiTokens->positions); - _AddToken(cls, "renderContext", UsdRiTokens->renderContext); - _AddToken(cls, "spline", UsdRiTokens->spline); - _AddToken(cls, "values", UsdRiTokens->values); - _AddToken(cls, "RiMaterialAPI", UsdRiTokens->RiMaterialAPI); - _AddToken(cls, "RiRenderPassAPI", UsdRiTokens->RiRenderPassAPI); - _AddToken(cls, "RiSplineAPI", UsdRiTokens->RiSplineAPI); - _AddToken(cls, "StatementsAPI", UsdRiTokens->StatementsAPI); + _ADD_TOKEN(cls, bspline); + _ADD_TOKEN(cls, cameraVisibility); + _ADD_TOKEN(cls, catmullRom); + _ADD_TOKEN(cls, collectionCameraVisibilityIncludeRoot); + _ADD_TOKEN(cls, constant); + _ADD_TOKEN(cls, interpolation); + _ADD_TOKEN(cls, linear); + _ADD_TOKEN(cls, matte); + _ADD_TOKEN(cls, outputsRiDisplacement); + _ADD_TOKEN(cls, outputsRiSurface); + _ADD_TOKEN(cls, outputsRiVolume); + _ADD_TOKEN(cls, positions); + _ADD_TOKEN(cls, renderContext); + _ADD_TOKEN(cls, spline); + _ADD_TOKEN(cls, values); + _ADD_TOKEN(cls, RiMaterialAPI); + _ADD_TOKEN(cls, RiRenderPassAPI); + _ADD_TOKEN(cls, RiSplineAPI); + _ADD_TOKEN(cls, StatementsAPI); } diff --git a/pxr/usd/usdShade/wrapTokens.cpp b/pxr/usd/usdShade/wrapTokens.cpp index d8c6da61b0..ab39e0065f 100644 --- a/pxr/usd/usdShade/wrapTokens.cpp +++ b/pxr/usd/usdShade/wrapTokens.cpp @@ -10,79 +10,49 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdShadeTokens->name.GetString(); }); void wrapUsdShadeTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "allPurpose", UsdShadeTokens->allPurpose); - _AddToken(cls, "bindMaterialAs", UsdShadeTokens->bindMaterialAs); - _AddToken(cls, "coordSys", UsdShadeTokens->coordSys); - _AddToken(cls, "coordSys_MultipleApplyTemplate_Binding", UsdShadeTokens->coordSys_MultipleApplyTemplate_Binding); - _AddToken(cls, "displacement", UsdShadeTokens->displacement); - _AddToken(cls, "fallbackStrength", UsdShadeTokens->fallbackStrength); - _AddToken(cls, "full", UsdShadeTokens->full); - _AddToken(cls, "id", UsdShadeTokens->id); - _AddToken(cls, "infoId", UsdShadeTokens->infoId); - _AddToken(cls, "infoImplementationSource", UsdShadeTokens->infoImplementationSource); - _AddToken(cls, "inputs", UsdShadeTokens->inputs); - _AddToken(cls, "interfaceOnly", UsdShadeTokens->interfaceOnly); - _AddToken(cls, "materialBind", UsdShadeTokens->materialBind); - _AddToken(cls, "materialBinding", UsdShadeTokens->materialBinding); - _AddToken(cls, "materialBindingCollection", UsdShadeTokens->materialBindingCollection); - _AddToken(cls, "materialVariant", UsdShadeTokens->materialVariant); - _AddToken(cls, "outputs", UsdShadeTokens->outputs); - _AddToken(cls, "outputsDisplacement", UsdShadeTokens->outputsDisplacement); - _AddToken(cls, "outputsSurface", UsdShadeTokens->outputsSurface); - _AddToken(cls, "outputsVolume", UsdShadeTokens->outputsVolume); - _AddToken(cls, "preview", UsdShadeTokens->preview); - _AddToken(cls, "sdrMetadata", UsdShadeTokens->sdrMetadata); - _AddToken(cls, "sourceAsset", UsdShadeTokens->sourceAsset); - _AddToken(cls, "sourceCode", UsdShadeTokens->sourceCode); - _AddToken(cls, "strongerThanDescendants", UsdShadeTokens->strongerThanDescendants); - _AddToken(cls, "subIdentifier", UsdShadeTokens->subIdentifier); - _AddToken(cls, "surface", UsdShadeTokens->surface); - _AddToken(cls, "universalRenderContext", UsdShadeTokens->universalRenderContext); - _AddToken(cls, "universalSourceType", UsdShadeTokens->universalSourceType); - _AddToken(cls, "volume", UsdShadeTokens->volume); - _AddToken(cls, "weakerThanDescendants", UsdShadeTokens->weakerThanDescendants); - _AddToken(cls, "ConnectableAPI", UsdShadeTokens->ConnectableAPI); - _AddToken(cls, "CoordSysAPI", UsdShadeTokens->CoordSysAPI); - _AddToken(cls, "Material", UsdShadeTokens->Material); - _AddToken(cls, "MaterialBindingAPI", UsdShadeTokens->MaterialBindingAPI); - _AddToken(cls, "NodeDefAPI", UsdShadeTokens->NodeDefAPI); - _AddToken(cls, "NodeGraph", UsdShadeTokens->NodeGraph); - _AddToken(cls, "Shader", UsdShadeTokens->Shader); + _ADD_TOKEN(cls, allPurpose); + _ADD_TOKEN(cls, bindMaterialAs); + _ADD_TOKEN(cls, coordSys); + _ADD_TOKEN(cls, coordSys_MultipleApplyTemplate_Binding); + _ADD_TOKEN(cls, displacement); + _ADD_TOKEN(cls, fallbackStrength); + _ADD_TOKEN(cls, full); + _ADD_TOKEN(cls, id); + _ADD_TOKEN(cls, infoId); + _ADD_TOKEN(cls, infoImplementationSource); + _ADD_TOKEN(cls, inputs); + _ADD_TOKEN(cls, interfaceOnly); + _ADD_TOKEN(cls, materialBind); + _ADD_TOKEN(cls, materialBinding); + _ADD_TOKEN(cls, materialBindingCollection); + _ADD_TOKEN(cls, materialVariant); + _ADD_TOKEN(cls, outputs); + _ADD_TOKEN(cls, outputsDisplacement); + _ADD_TOKEN(cls, outputsSurface); + _ADD_TOKEN(cls, outputsVolume); + _ADD_TOKEN(cls, preview); + _ADD_TOKEN(cls, sdrMetadata); + _ADD_TOKEN(cls, sourceAsset); + _ADD_TOKEN(cls, sourceCode); + _ADD_TOKEN(cls, strongerThanDescendants); + _ADD_TOKEN(cls, subIdentifier); + _ADD_TOKEN(cls, surface); + _ADD_TOKEN(cls, universalRenderContext); + _ADD_TOKEN(cls, universalSourceType); + _ADD_TOKEN(cls, volume); + _ADD_TOKEN(cls, weakerThanDescendants); + _ADD_TOKEN(cls, ConnectableAPI); + _ADD_TOKEN(cls, CoordSysAPI); + _ADD_TOKEN(cls, Material); + _ADD_TOKEN(cls, MaterialBindingAPI); + _ADD_TOKEN(cls, NodeDefAPI); + _ADD_TOKEN(cls, NodeGraph); + _ADD_TOKEN(cls, Shader); } diff --git a/pxr/usd/usdSkel/wrapTokens.cpp b/pxr/usd/usdSkel/wrapTokens.cpp index 23caa62093..66a76a7de5 100644 --- a/pxr/usd/usdSkel/wrapTokens.cpp +++ b/pxr/usd/usdSkel/wrapTokens.cpp @@ -10,70 +10,40 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdSkelTokens->name.GetString(); }); void wrapUsdSkelTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "bindTransforms", UsdSkelTokens->bindTransforms); - _AddToken(cls, "blendShapes", UsdSkelTokens->blendShapes); - _AddToken(cls, "blendShapeWeights", UsdSkelTokens->blendShapeWeights); - _AddToken(cls, "classicLinear", UsdSkelTokens->classicLinear); - _AddToken(cls, "dualQuaternion", UsdSkelTokens->dualQuaternion); - _AddToken(cls, "jointNames", UsdSkelTokens->jointNames); - _AddToken(cls, "joints", UsdSkelTokens->joints); - _AddToken(cls, "normalOffsets", UsdSkelTokens->normalOffsets); - _AddToken(cls, "offsets", UsdSkelTokens->offsets); - _AddToken(cls, "pointIndices", UsdSkelTokens->pointIndices); - _AddToken(cls, "primvarsSkelGeomBindTransform", UsdSkelTokens->primvarsSkelGeomBindTransform); - _AddToken(cls, "primvarsSkelJointIndices", UsdSkelTokens->primvarsSkelJointIndices); - _AddToken(cls, "primvarsSkelJointWeights", UsdSkelTokens->primvarsSkelJointWeights); - _AddToken(cls, "primvarsSkelSkinningMethod", UsdSkelTokens->primvarsSkelSkinningMethod); - _AddToken(cls, "restTransforms", UsdSkelTokens->restTransforms); - _AddToken(cls, "rotations", UsdSkelTokens->rotations); - _AddToken(cls, "scales", UsdSkelTokens->scales); - _AddToken(cls, "skelAnimationSource", UsdSkelTokens->skelAnimationSource); - _AddToken(cls, "skelBlendShapes", UsdSkelTokens->skelBlendShapes); - _AddToken(cls, "skelBlendShapeTargets", UsdSkelTokens->skelBlendShapeTargets); - _AddToken(cls, "skelJoints", UsdSkelTokens->skelJoints); - _AddToken(cls, "skelSkeleton", UsdSkelTokens->skelSkeleton); - _AddToken(cls, "translations", UsdSkelTokens->translations); - _AddToken(cls, "weight", UsdSkelTokens->weight); - _AddToken(cls, "BlendShape", UsdSkelTokens->BlendShape); - _AddToken(cls, "SkelAnimation", UsdSkelTokens->SkelAnimation); - _AddToken(cls, "SkelBindingAPI", UsdSkelTokens->SkelBindingAPI); - _AddToken(cls, "Skeleton", UsdSkelTokens->Skeleton); - _AddToken(cls, "SkelRoot", UsdSkelTokens->SkelRoot); + _ADD_TOKEN(cls, bindTransforms); + _ADD_TOKEN(cls, blendShapes); + _ADD_TOKEN(cls, blendShapeWeights); + _ADD_TOKEN(cls, classicLinear); + _ADD_TOKEN(cls, dualQuaternion); + _ADD_TOKEN(cls, jointNames); + _ADD_TOKEN(cls, joints); + _ADD_TOKEN(cls, normalOffsets); + _ADD_TOKEN(cls, offsets); + _ADD_TOKEN(cls, pointIndices); + _ADD_TOKEN(cls, primvarsSkelGeomBindTransform); + _ADD_TOKEN(cls, primvarsSkelJointIndices); + _ADD_TOKEN(cls, primvarsSkelJointWeights); + _ADD_TOKEN(cls, primvarsSkelSkinningMethod); + _ADD_TOKEN(cls, restTransforms); + _ADD_TOKEN(cls, rotations); + _ADD_TOKEN(cls, scales); + _ADD_TOKEN(cls, skelAnimationSource); + _ADD_TOKEN(cls, skelBlendShapes); + _ADD_TOKEN(cls, skelBlendShapeTargets); + _ADD_TOKEN(cls, skelJoints); + _ADD_TOKEN(cls, skelSkeleton); + _ADD_TOKEN(cls, translations); + _ADD_TOKEN(cls, weight); + _ADD_TOKEN(cls, BlendShape); + _ADD_TOKEN(cls, SkelAnimation); + _ADD_TOKEN(cls, SkelBindingAPI); + _ADD_TOKEN(cls, Skeleton); + _ADD_TOKEN(cls, SkelRoot); } diff --git a/pxr/usd/usdUI/wrapTokens.cpp b/pxr/usd/usdUI/wrapTokens.cpp index 78aec70d68..7059bfa00d 100644 --- a/pxr/usd/usdUI/wrapTokens.cpp +++ b/pxr/usd/usdUI/wrapTokens.cpp @@ -10,57 +10,27 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdUITokens->name.GetString(); }); void wrapUsdUITokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "closed", UsdUITokens->closed); - _AddToken(cls, "minimized", UsdUITokens->minimized); - _AddToken(cls, "open", UsdUITokens->open); - _AddToken(cls, "uiDescription", UsdUITokens->uiDescription); - _AddToken(cls, "uiDisplayGroup", UsdUITokens->uiDisplayGroup); - _AddToken(cls, "uiDisplayName", UsdUITokens->uiDisplayName); - _AddToken(cls, "uiNodegraphNodeDisplayColor", UsdUITokens->uiNodegraphNodeDisplayColor); - _AddToken(cls, "uiNodegraphNodeDocURI", UsdUITokens->uiNodegraphNodeDocURI); - _AddToken(cls, "uiNodegraphNodeExpansionState", UsdUITokens->uiNodegraphNodeExpansionState); - _AddToken(cls, "uiNodegraphNodeIcon", UsdUITokens->uiNodegraphNodeIcon); - _AddToken(cls, "uiNodegraphNodePos", UsdUITokens->uiNodegraphNodePos); - _AddToken(cls, "uiNodegraphNodeSize", UsdUITokens->uiNodegraphNodeSize); - _AddToken(cls, "uiNodegraphNodeStackingOrder", UsdUITokens->uiNodegraphNodeStackingOrder); - _AddToken(cls, "Backdrop", UsdUITokens->Backdrop); - _AddToken(cls, "NodeGraphNodeAPI", UsdUITokens->NodeGraphNodeAPI); - _AddToken(cls, "SceneGraphPrimAPI", UsdUITokens->SceneGraphPrimAPI); + _ADD_TOKEN(cls, closed); + _ADD_TOKEN(cls, minimized); + _ADD_TOKEN(cls, open); + _ADD_TOKEN(cls, uiDescription); + _ADD_TOKEN(cls, uiDisplayGroup); + _ADD_TOKEN(cls, uiDisplayName); + _ADD_TOKEN(cls, uiNodegraphNodeDisplayColor); + _ADD_TOKEN(cls, uiNodegraphNodeDocURI); + _ADD_TOKEN(cls, uiNodegraphNodeExpansionState); + _ADD_TOKEN(cls, uiNodegraphNodeIcon); + _ADD_TOKEN(cls, uiNodegraphNodePos); + _ADD_TOKEN(cls, uiNodegraphNodeSize); + _ADD_TOKEN(cls, uiNodegraphNodeStackingOrder); + _ADD_TOKEN(cls, Backdrop); + _ADD_TOKEN(cls, NodeGraphNodeAPI); + _ADD_TOKEN(cls, SceneGraphPrimAPI); } diff --git a/pxr/usd/usdVol/wrapTokens.cpp b/pxr/usd/usdVol/wrapTokens.cpp index 94975a4404..b97aab721b 100644 --- a/pxr/usd/usdVol/wrapTokens.cpp +++ b/pxr/usd/usdVol/wrapTokens.cpp @@ -10,83 +10,53 @@ PXR_NAMESPACE_USING_DIRECTIVE -namespace { - -// Helper to return a static token as a string. We wrap tokens as Python -// strings and for some reason simply wrapping the token using def_readonly -// bypasses to-Python conversion, leading to the error that there's no -// Python type for the C++ TfToken type. So we wrap this functor instead. -class _WrapStaticToken { -public: - _WrapStaticToken(const TfToken* token) : _token(token) { } - - std::string operator()() const - { - return _token->GetString(); - } - -private: - const TfToken* _token; -}; - -template -void -_AddToken(T& cls, const char* name, const TfToken& token) -{ - cls.add_static_property(name, - boost::python::make_function( - _WrapStaticToken(&token), - boost::python::return_value_policy< - boost::python::return_by_value>(), - boost::mpl::vector1())); -} - -} // anonymous +#define _ADD_TOKEN(cls, name) \ + cls.add_static_property(#name, +[]() { return UsdVolTokens->name.GetString(); }); void wrapUsdVolTokens() { boost::python::class_ cls("Tokens", boost::python::no_init); - _AddToken(cls, "bool_", UsdVolTokens->bool_); - _AddToken(cls, "Color", UsdVolTokens->Color); - _AddToken(cls, "double2", UsdVolTokens->double2); - _AddToken(cls, "double3", UsdVolTokens->double3); - _AddToken(cls, "double_", UsdVolTokens->double_); - _AddToken(cls, "field", UsdVolTokens->field); - _AddToken(cls, "fieldClass", UsdVolTokens->fieldClass); - _AddToken(cls, "fieldDataType", UsdVolTokens->fieldDataType); - _AddToken(cls, "fieldIndex", UsdVolTokens->fieldIndex); - _AddToken(cls, "fieldName", UsdVolTokens->fieldName); - _AddToken(cls, "fieldPurpose", UsdVolTokens->fieldPurpose); - _AddToken(cls, "filePath", UsdVolTokens->filePath); - _AddToken(cls, "float2", UsdVolTokens->float2); - _AddToken(cls, "float3", UsdVolTokens->float3); - _AddToken(cls, "float_", UsdVolTokens->float_); - _AddToken(cls, "fogVolume", UsdVolTokens->fogVolume); - _AddToken(cls, "half", UsdVolTokens->half); - _AddToken(cls, "half2", UsdVolTokens->half2); - _AddToken(cls, "half3", UsdVolTokens->half3); - _AddToken(cls, "int2", UsdVolTokens->int2); - _AddToken(cls, "int3", UsdVolTokens->int3); - _AddToken(cls, "int64", UsdVolTokens->int64); - _AddToken(cls, "int_", UsdVolTokens->int_); - _AddToken(cls, "levelSet", UsdVolTokens->levelSet); - _AddToken(cls, "mask", UsdVolTokens->mask); - _AddToken(cls, "matrix3d", UsdVolTokens->matrix3d); - _AddToken(cls, "matrix4d", UsdVolTokens->matrix4d); - _AddToken(cls, "None_", UsdVolTokens->None_); - _AddToken(cls, "Normal", UsdVolTokens->Normal); - _AddToken(cls, "Point", UsdVolTokens->Point); - _AddToken(cls, "quatd", UsdVolTokens->quatd); - _AddToken(cls, "staggered", UsdVolTokens->staggered); - _AddToken(cls, "string", UsdVolTokens->string); - _AddToken(cls, "uint", UsdVolTokens->uint); - _AddToken(cls, "unknown", UsdVolTokens->unknown); - _AddToken(cls, "Vector", UsdVolTokens->Vector); - _AddToken(cls, "vectorDataRoleHint", UsdVolTokens->vectorDataRoleHint); - _AddToken(cls, "Field3DAsset", UsdVolTokens->Field3DAsset); - _AddToken(cls, "FieldAsset", UsdVolTokens->FieldAsset); - _AddToken(cls, "FieldBase", UsdVolTokens->FieldBase); - _AddToken(cls, "OpenVDBAsset", UsdVolTokens->OpenVDBAsset); - _AddToken(cls, "Volume", UsdVolTokens->Volume); + _ADD_TOKEN(cls, bool_); + _ADD_TOKEN(cls, Color); + _ADD_TOKEN(cls, double2); + _ADD_TOKEN(cls, double3); + _ADD_TOKEN(cls, double_); + _ADD_TOKEN(cls, field); + _ADD_TOKEN(cls, fieldClass); + _ADD_TOKEN(cls, fieldDataType); + _ADD_TOKEN(cls, fieldIndex); + _ADD_TOKEN(cls, fieldName); + _ADD_TOKEN(cls, fieldPurpose); + _ADD_TOKEN(cls, filePath); + _ADD_TOKEN(cls, float2); + _ADD_TOKEN(cls, float3); + _ADD_TOKEN(cls, float_); + _ADD_TOKEN(cls, fogVolume); + _ADD_TOKEN(cls, half); + _ADD_TOKEN(cls, half2); + _ADD_TOKEN(cls, half3); + _ADD_TOKEN(cls, int2); + _ADD_TOKEN(cls, int3); + _ADD_TOKEN(cls, int64); + _ADD_TOKEN(cls, int_); + _ADD_TOKEN(cls, levelSet); + _ADD_TOKEN(cls, mask); + _ADD_TOKEN(cls, matrix3d); + _ADD_TOKEN(cls, matrix4d); + _ADD_TOKEN(cls, None_); + _ADD_TOKEN(cls, Normal); + _ADD_TOKEN(cls, Point); + _ADD_TOKEN(cls, quatd); + _ADD_TOKEN(cls, staggered); + _ADD_TOKEN(cls, string); + _ADD_TOKEN(cls, uint); + _ADD_TOKEN(cls, unknown); + _ADD_TOKEN(cls, Vector); + _ADD_TOKEN(cls, vectorDataRoleHint); + _ADD_TOKEN(cls, Field3DAsset); + _ADD_TOKEN(cls, FieldAsset); + _ADD_TOKEN(cls, FieldBase); + _ADD_TOKEN(cls, OpenVDBAsset); + _ADD_TOKEN(cls, Volume); } From efba2fb129678a6e34b2a70ca2a2d66b1b47f1b0 Mon Sep 17 00:00:00 2001 From: unhyperbolic Date: Tue, 20 Aug 2024 09:17:02 -0700 Subject: [PATCH 071/202] hdPrman: making sure that riley globals scene index is running late, e.g., after receipes modifying render setting prims have been resolved. Also changing coord sys scene index priority to make sure the dependency forwarding scene index is running last. (Internal change: 2337541) --- .../plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp | 2 +- .../plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp | 2 +- .../plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp | 2 +- .../plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp index e64ea31731..c2d2f5970f 100644 --- a/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp @@ -28,7 +28,7 @@ TF_REGISTRY_FUNCTION(TfType) TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) { - const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1000; + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 900; HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _pluginDisplayName, diff --git a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp index 8717d72564..bde26db9f9 100644 --- a/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp @@ -30,7 +30,7 @@ TF_REGISTRY_FUNCTION(TfType) TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) { - const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1; + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 950; HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _rendererDisplayName, diff --git a/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp index e64ea31731..c2d2f5970f 100644 --- a/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp +++ b/third_party/renderman-26/plugin/hdPrman/coordSysPrimSceneIndexPlugin.cpp @@ -28,7 +28,7 @@ TF_REGISTRY_FUNCTION(TfType) TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) { - const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1000; + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 900; HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _pluginDisplayName, diff --git a/third_party/renderman-26/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp index 8717d72564..bde26db9f9 100644 --- a/third_party/renderman-26/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp +++ b/third_party/renderman-26/plugin/hdPrman/rileyGlobalsSceneIndexPlugin.cpp @@ -30,7 +30,7 @@ TF_REGISTRY_FUNCTION(TfType) TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) { - const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1; + const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 950; HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer( _rendererDisplayName, From ccfbc0f46de6483d7d414f3f88969bfcf340b836 Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 20 Aug 2024 09:17:40 -0700 Subject: [PATCH 072/202] python: Workaround distcc build issues with boost distcc's pump mode fails for headers that use file iteration via BOOST_PP_ITERATE when the iterated file is different than the iterating file where BOOST_PP_ITERATE is invoked. In this case, distcc fails to send the iterated file to the build machine, leading to "File not found" errors during compilation. Per https://github.com/distcc/distcc/issues/16 this appears to be a long-standing known issue. boost::python has two headers that run into this issue. As a workaround, we add a direct include of the iterated file surrounded by a (helpfully pre-existing) define that elides the contents of that file. This gets distcc to recognize that it needs to send the iterated file to the build machine without having any other effect. This is a temporary workaround; future changes will remove the use of BOOST_PP_ITERATE altogether. (Internal change: 2337543) --- pxr/external/boost/python/object_core.hpp | 5 +++++ pxr/external/boost/python/tuple.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pxr/external/boost/python/object_core.hpp b/pxr/external/boost/python/object_core.hpp index c2f912f2c3..7c0b027ffc 100644 --- a/pxr/external/boost/python/object_core.hpp +++ b/pxr/external/boost/python/object_core.hpp @@ -38,6 +38,11 @@ # include "pxr/external/boost/python/detail/def_helper_fwd.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" +// XXX: Workaround for distcc issues with BOOST_PP_ITERATE +# define BOOST_PYTHON_SYNOPSIS +# include "pxr/external/boost/python/object_call.hpp" +# undef BOOST_PYTHON_SYNOPSIS + namespace boost { namespace python { namespace detail diff --git a/pxr/external/boost/python/tuple.hpp b/pxr/external/boost/python/tuple.hpp index 6dd4851585..4488acea59 100644 --- a/pxr/external/boost/python/tuple.hpp +++ b/pxr/external/boost/python/tuple.hpp @@ -17,6 +17,11 @@ #include #include +// XXX: Workaround for distcc issues with BOOST_PP_ITERATE +# define BOOST_PYTHON_SYNOPSIS +# include "pxr/external/boost/python/detail/make_tuple.hpp" +# undef BOOST_PYTHON_SYNOPSIS + namespace boost { namespace python { namespace detail From 8f53b211f1149d24f5b2ca8b253446c2008df646 Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 20 Aug 2024 09:19:34 -0700 Subject: [PATCH 073/202] python: Accommodate BOOST_PYTHON_NO_PY_SIGNATURES in tests Update tests that compare the output of help(...) to explicitly enable Python docstrings, so they don't fail when built with BOOST_PYTHON_NO_PY_SIGNATURES defined. This is primarily needed because the cmake build globally defines this symbol in cmake/defaults/CXXDefaults.cmake and there isn't a clean way to undefine it for certain libraries. We should be able to remove that global define when we start using our own Python binding library throughout OpenUSD. Because of that, it seemed better to make these tests resilient to this symbol being defined instead of trying to untangle the build. (Internal change: 2337544) --- pxr/external/boost/python/test/args.cpp | 13 +++++++++++++ pxr/external/boost/python/test/auto_ptr.cpp | 12 ++++++++++++ pxr/external/boost/python/test/back_reference.cpp | 13 +++++++++++++ pxr/external/boost/python/test/defaults.cpp | 12 ++++++++++++ pxr/external/boost/python/test/docstring.cpp | 12 ++++++++++++ pxr/external/boost/python/test/implicit.cpp | 13 +++++++++++++ pxr/external/boost/python/test/keywords.cpp | 12 ++++++++++++ pxr/external/boost/python/test/m1.cpp | 11 +++++++++++ pxr/external/boost/python/test/m2.cpp | 13 +++++++++++++ pxr/external/boost/python/test/pytype_function.cpp | 12 ++++++++++++ 10 files changed, 123 insertions(+) diff --git a/pxr/external/boost/python/test/args.cpp b/pxr/external/boost/python/test/args.cpp index b55e92a19b..d760d00504 100644 --- a/pxr/external/boost/python/test/args.cpp +++ b/pxr/external/boost/python/test/args.cpp @@ -7,9 +7,16 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/module.hpp" #include "test_class.hpp" #include "pxr/external/boost/python/def.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/args.hpp" #include "pxr/external/boost/python/tuple.hpp" #include "pxr/external/boost/python/class.hpp" @@ -56,6 +63,12 @@ tuple raw_func(tuple args, dict kw) BOOST_PYTHON_MODULE(args_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + def("f", f, (arg("x")=1, arg("y")=4.25, arg("z")="wow") , "This is f's docstring" ); diff --git a/pxr/external/boost/python/test/auto_ptr.cpp b/pxr/external/boost/python/test/auto_ptr.cpp index 48c60ca8e3..94fef2aa2c 100644 --- a/pxr/external/boost/python/test/auto_ptr.cpp +++ b/pxr/external/boost/python/test/auto_ptr.cpp @@ -8,9 +8,15 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/module.hpp" #include "test_class.hpp" #include "pxr/external/boost/python/class.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/implicit.hpp" @@ -68,6 +74,12 @@ std::auto_ptr extract_(object o) BOOST_PYTHON_MODULE(auto_ptr_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + class_, boost::noncopyable>("X", init()) .def("value", &X::value) ; diff --git a/pxr/external/boost/python/test/back_reference.cpp b/pxr/external/boost/python/test/back_reference.cpp index de3c71846a..b2f4c8bee5 100644 --- a/pxr/external/boost/python/test/back_reference.cpp +++ b/pxr/external/boost/python/test/back_reference.cpp @@ -7,7 +7,14 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/class.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/has_back_reference.hpp" @@ -95,6 +102,12 @@ bool y_equality(back_reference y1, Y const& y2) BOOST_PYTHON_MODULE(back_reference_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + def("copy_Y", copy_Y, return_value_policy()); def("copy_Z", copy_Z, return_value_policy()); def("x_instances", &X::count); diff --git a/pxr/external/boost/python/test/defaults.cpp b/pxr/external/boost/python/test/defaults.cpp index eb0e90ff89..e0e346c12e 100644 --- a/pxr/external/boost/python/test/defaults.cpp +++ b/pxr/external/boost/python/test/defaults.cpp @@ -8,9 +8,15 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/class.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/tuple.hpp" #include "pxr/external/boost/python/list.hpp" #include "pxr/external/boost/python/overloads.hpp" @@ -154,6 +160,12 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_3_stubs, foo, 2, 3) BOOST_PYTHON_MODULE(defaults_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + def("foo", foo, foo_stubs()); def("bar", (object(*)(int, char, std::string, double))0, bar_stubs()); diff --git a/pxr/external/boost/python/test/docstring.cpp b/pxr/external/boost/python/test/docstring.cpp index df8e9fd9ba..55847cc67a 100644 --- a/pxr/external/boost/python/test/docstring.cpp +++ b/pxr/external/boost/python/test/docstring.cpp @@ -7,6 +7,12 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/operators.hpp" #include "pxr/external/boost/python/class.hpp" #include "pxr/external/boost/python/module.hpp" @@ -36,6 +42,12 @@ unsigned long fact(unsigned long n) BOOST_PYTHON_MODULE(docstring_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + scope().attr("__doc__") = "A simple test module for documentation strings\n" "Exercised by docstring.py" diff --git a/pxr/external/boost/python/test/implicit.cpp b/pxr/external/boost/python/test/implicit.cpp index c5fb6753b0..f55f80f0b4 100644 --- a/pxr/external/boost/python/test/implicit.cpp +++ b/pxr/external/boost/python/test/implicit.cpp @@ -7,7 +7,14 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/class.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/implicit.hpp" #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/def.hpp" @@ -36,6 +43,12 @@ struct foo BOOST_PYTHON_MODULE(implicit_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + implicitly_convertible(); implicitly_convertible(); diff --git a/pxr/external/boost/python/test/keywords.cpp b/pxr/external/boost/python/test/keywords.cpp index 25f7f567f2..b79f867642 100644 --- a/pxr/external/boost/python/test/keywords.cpp +++ b/pxr/external/boost/python/test/keywords.cpp @@ -7,6 +7,12 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python.hpp" #include @@ -82,6 +88,12 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(bar_set, Bar::set, 0,3) using namespace boost::python; BOOST_PYTHON_MODULE(keywords) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + #if BOOST_WORKAROUND(__GNUC__, == 2) using boost::python::arg; #endif diff --git a/pxr/external/boost/python/test/m1.cpp b/pxr/external/boost/python/test/m1.cpp index 17f5e976e0..663188c595 100644 --- a/pxr/external/boost/python/test/m1.cpp +++ b/pxr/external/boost/python/test/m1.cpp @@ -8,8 +8,13 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/def.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/class.hpp" #include "pxr/external/boost/python/lvalue_from_pytype.hpp" @@ -278,6 +283,12 @@ BOOST_PYTHON_MODULE(m1) { using namespace boost::python; using boost::shared_ptr; + + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); simple_to_python(); diff --git a/pxr/external/boost/python/test/m2.cpp b/pxr/external/boost/python/test/m2.cpp index df2dc53cb1..99a805d125 100644 --- a/pxr/external/boost/python/test/m2.cpp +++ b/pxr/external/boost/python/test/m2.cpp @@ -8,11 +8,17 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + // This module exercises the converters exposed in m1 at a low level // by exposing raw Python extension functions that use wrap<> and // unwrap<> objects. #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/def.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/copy_non_const_reference.hpp" #include "pxr/external/boost/python/copy_const_reference.hpp" #include "pxr/external/boost/python/return_value_policy.hpp" @@ -81,6 +87,13 @@ BOOST_PYTHON_MODULE(m2) using boost::python::copy_const_reference; using boost::python::copy_non_const_reference; using boost::python::def; + using boost::python::docstring_options; + + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); def("unwrap_int", unwrap_int); def("unwrap_int_ref", unwrap_int_ref); diff --git a/pxr/external/boost/python/test/pytype_function.cpp b/pxr/external/boost/python/test/pytype_function.cpp index 52a03169aa..f132d0c2b7 100644 --- a/pxr/external/boost/python/test/pytype_function.cpp +++ b/pxr/external/boost/python/test/pytype_function.cpp @@ -7,8 +7,14 @@ // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// boost::python will generate simplified docstrings that break the associated +// test unless we undefine it before including any headers. +#undef BOOST_PYTHON_NO_PY_SIGNATURES + #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/def.hpp" +#include "pxr/external/boost/python/docstring_options.hpp" #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/to_python_converter.hpp" #include "pxr/external/boost/python/class.hpp" @@ -78,6 +84,12 @@ B func(const B& b) { return b ; } BOOST_PYTHON_MODULE(pytype_function_ext) { + // Explicitly enable Python signatures in docstrings in case boost::python + // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // signatures by default. + docstring_options doc_options; + doc_options.enable_py_signatures(); + to_python_converter< B , BToPython,true >(); //has get_pytype BFromPython(); From 3647be2bd3ec272c794adce43f6f1e5a3ae4b72d Mon Sep 17 00:00:00 2001 From: jloy Date: Tue, 20 Aug 2024 09:21:05 -0700 Subject: [PATCH 074/202] gf: Fix incorrect integration of GfSmoothRamp (Internal change: 2337646) --- pxr/base/gf/math.cpp | 61 +++++++++++++------------------------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/pxr/base/gf/math.cpp b/pxr/base/gf/math.cpp index 3a6f6b3a23..ca638f16c6 100644 --- a/pxr/base/gf/math.cpp +++ b/pxr/base/gf/math.cpp @@ -68,53 +68,28 @@ GfSmoothStep(double min, double max, double val, double slope0, double slope1) } double -GfGSmoothRamp(double t, double a0, double a1, double b0, double b1, double s0, - double s1, double wid0, double wid1) +GfSmoothRamp(double tmin, double tmax, double t, double w0, double w1) { - double dx, dy, x, d0, d1, wnorm, w0, w1, y; - - // change variables to x in [0,1] and y in [0,1] - dy = b1 - b0; - dx = a1 - a0; - if (dy == 0 || dx==0) { - y = 0.0; + if (t <= tmin) { + return 0.0; } - else { - x = (t - a0)/dx; - d0 = s0*dx/dy; - d1 = s1*dx/dy; - - // make sure shoulder widths don't sum to more than 1 - wnorm = 1./ GfMax(1.0, wid0 + wid1); - w0 = wid0 * wnorm; - w1 = wid1 * wnorm; - - // compute y - if (x <= 0.0) - y = 0.0; - else if (x >= 1.0) - y = 1.0; - else { - double xr = 2.0 - w0 - w1; - double a = (2.0 - w1*d1 + (w1 - 2.0)*d0)/(2.0 * xr); - double b = (2.0 - w0*d0 + (w0 - 2.0)*d1)/(2.0 * xr); - if (x < w0) - y = a*x*x/w0 + d0*x; - else if (x > 1.0 - w1) { - double omx = 1.0 - x; - y = 1.0 - (b * omx * omx/w1) - (d1 * omx); - } - else { - double ya = (a * w0) + (d0 * w0); - double da = 2.0 * a + d0; - y = ya + (x - w0)*da; - } - } + + if (t >= tmax) { + return 1.0; + } + + double x = (t-tmin)/(tmax-tmin); + double xr = 2.0 - w0 - w1; + + if (x < w0) { + return (x*x)/(w0 * xr); + } + + if (x > (1.0 - w1) ) { + return (1.0 - ((1.0 - x) * (1.0 - x))/ (w1 * xr)); } - // map y back to Y and return. Note: analytically y is always in - // [0,1], but numerically it might have noise so clamp it. - return GfClamp(y, 0.0, 1.0) * dy + b0; + return (2.0 * x - w0)/xr; } PXR_NAMESPACE_CLOSE_SCOPE From c567f0b93acc1728b253d05532cc5f353d881059 Mon Sep 17 00:00:00 2001 From: florianz Date: Tue, 20 Aug 2024 09:22:12 -0700 Subject: [PATCH 075/202] Fixes a truncation issue from implicit conversion of integers with the wrong integer literal types in TfBits. This previously failed on Windows because UL is at least 4 byte sized, whereas on POSIX it is guaranteed to be at least 8 byte sized. Using the macro constants instead to make this more readable and less error-prone. (Internal change: 2337651) --- pxr/base/tf/bits.cpp | 8 ++++---- pxr/base/tf/bits.h | 13 +++++++------ pxr/base/tf/compressedBits.h | 8 +++++--- pxr/base/tf/testenv/compressedBits.cpp | 7 +++++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/pxr/base/tf/bits.cpp b/pxr/base/tf/bits.cpp index 6a97ae995d..02001a0550 100644 --- a/pxr/base/tf/bits.cpp +++ b/pxr/base/tf/bits.cpp @@ -57,7 +57,7 @@ TfBits::_FindNextSet(size_t index, size_t startBit) const { if (uint64_t bits = _bits[w]) for(size_t i=startBit; i<64; i++) - if (bits & (1UL << i)) + if (bits & (UINT64_C(1) << i)) { // Note: Since we round up the # bits to fit an // integer # of words, we need to check if we @@ -81,7 +81,7 @@ TfBits::_FindPrevSet(size_t index, size_t startBit) const { if (uint64_t bits = _bits[w]) for(int i=startBit; i>=0; i--) - if (bits & (1UL << i)) + if (bits & (UINT64_C(1) << i)) { // Note: Since we round up the # bits to fit an // integer # of words, we need to check if we @@ -104,7 +104,7 @@ TfBits::_FindNextUnset(size_t index, size_t startBit) const // Note: We're operating on the flipped bits here... if (uint64_t bits = ~_bits[w]) for(size_t i=startBit; i<64; i++) - if (bits & (1UL << i)) + if (bits & (UINT64_C(1) << i)) { // Note: Since we round up the # bits to fit an // integer # of words, we need to check if we @@ -423,7 +423,7 @@ TfBits::_ClearTrailingBits() TF_AXIOM(numUsedBitsInLastWord > 0 && numUsedBitsInLastWord <= 63); // Zero out the unused bits so that they don't show up in the counts. - _bits[_numWords - 1] &= (1UL << numUsedBitsInLastWord) - 1; + _bits[_numWords - 1] &= (UINT64_C(1) << numUsedBitsInLastWord) - 1; } } diff --git a/pxr/base/tf/bits.h b/pxr/base/tf/bits.h index df652d8c10..7d7cf67876 100644 --- a/pxr/base/tf/bits.h +++ b/pxr/base/tf/bits.h @@ -16,6 +16,7 @@ #include "pxr/base/tf/iterator.h" #include +#include #include #include #include @@ -353,7 +354,7 @@ class TfBits { TF_AXIOM(index < _num); - uint64_t mask = 1UL << (index & 63); + uint64_t mask = UINT64_C(1) << (index & 63); if (_bits[index >> 6] & mask) { @@ -377,7 +378,7 @@ class TfBits { TF_AXIOM(index < _num); - uint64_t mask = 1UL << (index & 63); + uint64_t mask = UINT64_C(1) << (index & 63); if (!(_bits[index >> 6] & mask)) { @@ -412,7 +413,7 @@ class TfBits { TF_AXIOM(index < _num); - return _bits[index >> 6] & (1UL << (index & 63)); + return _bits[index >> 6] & (UINT64_C(1) << (index & 63)); } /// Finds the next set bit that has a higher or equal index than index. @@ -427,7 +428,7 @@ class TfBits size_t startBit = index & 63; // Early out for bit set... - if (_bits[index >> 6] & (1UL << startBit)) + if (_bits[index >> 6] & (UINT64_C(1) << startBit)) return index; return _FindNextSet(index, startBit); @@ -445,7 +446,7 @@ class TfBits size_t startBit = index & 63; // Early out for bit set... - if (_bits[index >> 6] & (1UL << startBit)) + if (_bits[index >> 6] & (UINT64_C(1) << startBit)) return index; return _FindPrevSet(index, startBit); @@ -463,7 +464,7 @@ class TfBits size_t startBit = index & 63; // Early out for bit set... - if (!(_bits[index >> 6] & (1UL << startBit))) + if (!(_bits[index >> 6] & (UINT64_C(1) << startBit))) return index; return _FindNextUnset(index, startBit); diff --git a/pxr/base/tf/compressedBits.h b/pxr/base/tf/compressedBits.h index 3b0be6d654..c16d52397e 100644 --- a/pxr/base/tf/compressedBits.h +++ b/pxr/base/tf/compressedBits.h @@ -15,7 +15,7 @@ #include "pxr/base/tf/staticData.h" #include -#include +#include #include #include #include @@ -450,7 +450,8 @@ class TfCompressedBits // Grow if (_num < num) { - if ((1u - _runningBit) == (_platforms.GetNum() & 1u)) { + if ((UINT32_C(1) - _runningBit) == + (_platforms.GetNum() & UINT32_C(1))) { _platforms.Back() += (num - _num); } else { _platforms.PushBack(num - _num); @@ -652,7 +653,8 @@ class TfCompressedBits // Extend on the right, by adding zeros, if the last platform // is zeros ... - if ((1u - _runningBit) == (_platforms.GetNum() & 1u)) { + if ((UINT32_C(1) - _runningBit) == + (_platforms.GetNum() & UINT32_C(1))) { _platforms.Back() += bits; return; } diff --git a/pxr/base/tf/testenv/compressedBits.cpp b/pxr/base/tf/testenv/compressedBits.cpp index c92ff53188..89bd34e3bd 100644 --- a/pxr/base/tf/testenv/compressedBits.cpp +++ b/pxr/base/tf/testenv/compressedBits.cpp @@ -493,6 +493,10 @@ Test_TfCompressedBits() b = TfBits(sz); ca = TfCompressedBits(sz); cb = TfCompressedBits(sz); + + verifyEqual("clear1", a, ca); + verifyEqual("clear2", b, cb); + for (int i = 0; i != nSets; ++i) { int index = rand() % sz; a.Set(index); @@ -550,6 +554,9 @@ Test_TfCompressedBits() "b = %s, cb = %s", b.GetAsStringLeftToRight().c_str(), cb.GetAsStringLeftToRight().c_str()); + + verifyEqual("equal1", a, ca); + verifyEqual("equal2", b, cb); } }; From a048ccd5f37f7ca06c56ee0f91c97e57481a1332 Mon Sep 17 00:00:00 2001 From: Roggie Zhang Date: Fri, 16 Aug 2024 14:18:48 +0800 Subject: [PATCH 076/202] Add python binding for UsdValidationError --- pxr/usd/usd/CMakeLists.txt | 8 + pxr/usd/usd/module.cpp | 1 + pxr/usd/usd/testenv/testUsdValidationError.py | 210 ++++++++++++++++++ pxr/usd/usd/wrapValidationError.cpp | 54 +++++ 4 files changed, 273 insertions(+) create mode 100644 pxr/usd/usd/testenv/testUsdValidationError.py create mode 100644 pxr/usd/usd/wrapValidationError.cpp diff --git a/pxr/usd/usd/CMakeLists.txt b/pxr/usd/usd/CMakeLists.txt index b2a0404b91..5f6301fb16 100644 --- a/pxr/usd/usd/CMakeLists.txt +++ b/pxr/usd/usd/CMakeLists.txt @@ -158,6 +158,7 @@ pxr_library(usd wrapTyped.cpp wrapUsdFileFormat.cpp wrapUtils.cpp + wrapValidationError.cpp wrapValidator.cpp wrapVariantSets.cpp wrapVersion.cpp @@ -273,6 +274,7 @@ pxr_test_scripts( testenv/testUsdTimeSamples.py testenv/testUsdTimeValueAuthoring.py testenv/testUsdUsdzFileFormat.py + testenv/testUsdValidationError.py testenv/testUsdValidatorMetadata.py testenv/testUsdValueClips.py testenv/testUsdVariantEditing.py @@ -1340,3 +1342,9 @@ pxr_register_test(testUsdValidatorMetadata COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdValidatorMetadata" EXPECTED_RETURN_CODE 0 ) + +pxr_register_test(testUsdValidationError + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdValidationError" + EXPECTED_RETURN_CODE 0 +) diff --git a/pxr/usd/usd/module.cpp b/pxr/usd/usd/module.cpp index b57bacf049..897c47ea5f 100644 --- a/pxr/usd/usd/module.cpp +++ b/pxr/usd/usd/module.cpp @@ -38,6 +38,7 @@ TF_WRAP_MODULE TF_WRAP(UsdSpecializes); TF_WRAP(UsdPrimRange); TF_WRAP(UsdVariantSets); + TF_WRAP(UsdValidationError); TF_WRAP(UsdValidator); // SchemaBase, APISchemaBase and subclasses. diff --git a/pxr/usd/usd/testenv/testUsdValidationError.py b/pxr/usd/usd/testenv/testUsdValidationError.py new file mode 100644 index 0000000000..3ec6423b98 --- /dev/null +++ b/pxr/usd/usd/testenv/testUsdValidationError.py @@ -0,0 +1,210 @@ +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license. + +import unittest + +from pxr import Plug, Sdf, Usd + + +class TestUsdValidationError(unittest.TestCase): + def test_create_default_error_site(self): + errorSite = Usd.ValidationErrorSite() + self.assertFalse(errorSite.IsValid()) + self.assertFalse(errorSite.IsValidSpecInLayer()) + self.assertFalse(errorSite.IsPrim()) + self.assertFalse(errorSite.IsProperty()) + self.assertFalse(errorSite.GetPropertySpec()) + self.assertFalse(errorSite.GetPrimSpec()) + self.assertFalse(errorSite.GetProperty()) + self.assertFalse(errorSite.GetPrim()) + self.assertFalse(errorSite.GetLayer()) + self.assertFalse(errorSite.GetStage()) + + def _verify_error_site_with_layer(self, errorSite: Usd.ValidationErrorSite, layer: Sdf.Layer, objectPath: Sdf.Path): + self.assertTrue(errorSite.IsValid()) + self.assertTrue(errorSite.IsValidSpecInLayer()) + self.assertFalse(errorSite.IsPrim()) + self.assertFalse(errorSite.IsProperty()) + expected_property_spec = layer.GetPropertyAtPath(objectPath) if objectPath.IsPropertyPath() else None + self.assertEqual(errorSite.GetPropertySpec(), expected_property_spec) + expected_prim_spec = layer.GetPrimAtPath(objectPath) if objectPath.IsPrimPath() else None + self.assertEqual(errorSite.GetPrimSpec(), expected_prim_spec) + self.assertFalse(errorSite.GetProperty()) + self.assertFalse(errorSite.GetPrim()) + self.assertEqual(errorSite.GetLayer(), layer) + self.assertFalse(errorSite.GetStage()) + + def test_create_error_site_with_layer_and_prim_spec(self): + stage = Usd.Stage.CreateInMemory() + test_prim_path = Sdf.Path("/test") + stage.DefinePrim(test_prim_path, "Xform") + errorSite = Usd.ValidationErrorSite(stage.GetRootLayer(), test_prim_path) + self._verify_error_site_with_layer(errorSite, stage.GetRootLayer(), test_prim_path) + + def test_create_error_site_with_layer_and_property_spec(self): + stage = Usd.Stage.CreateInMemory() + test_prim_path = Sdf.Path("/test") + test_prim = stage.DefinePrim(test_prim_path, "Xform") + test_attr = test_prim.CreateAttribute("attr", Sdf.ValueTypeNames.Int) + test_attr_path = test_attr.GetPath() + errorSite = Usd.ValidationErrorSite(stage.GetRootLayer(), test_attr_path) + self._verify_error_site_with_layer(errorSite, stage.GetRootLayer(), test_attr_path) + + def _verify_error_site_with_stage(self, errorSite: Usd.ValidationErrorSite, stage: Usd.Stage, objectPath: Sdf.Path): + self.assertTrue(errorSite.IsValid()) + self.assertFalse(errorSite.IsValidSpecInLayer()) + self.assertEqual(errorSite.IsPrim(), objectPath.IsPrimPath()) + self.assertEqual(errorSite.IsProperty(), objectPath.IsPropertyPath()) + self.assertFalse(errorSite.GetPropertySpec()) + self.assertFalse(errorSite.GetPrimSpec()) + expected_property = stage.GetPropertyAtPath(objectPath) if objectPath.IsPropertyPath() else Usd.Property() + self.assertEqual(errorSite.GetProperty(), expected_property) + expected_prim = stage.GetPrimAtPath(objectPath) if objectPath.IsPrimPath() else Usd.Prim() + self.assertEqual(errorSite.GetPrim(), expected_prim) + self.assertFalse(errorSite.GetLayer()) + self.assertEqual(errorSite.GetStage(), stage) + + def _verify_error_site_with_stage_and_layer(self, errorSite: Usd.ValidationErrorSite, stage: Usd.Stage, layer: Sdf.Layer, objectPath: Sdf.Path): + self.assertTrue(errorSite.IsValid()) + self.assertTrue(errorSite.IsValidSpecInLayer()) + self.assertEqual(errorSite.IsPrim(), objectPath.IsPrimPath()) + self.assertEqual(errorSite.IsProperty(), objectPath.IsPropertyPath()) + + expected_property_spec = layer.GetPropertyAtPath(objectPath) if objectPath.IsPropertyPath() else None + self.assertEqual(expected_property_spec, errorSite.GetPropertySpec()) + expected_prim_spec = layer.GetPrimAtPath(objectPath) if objectPath.IsPrimPath() else None + self.assertEqual(expected_prim_spec, errorSite.GetPrimSpec()) + expected_property = stage.GetPropertyAtPath(objectPath) if objectPath.IsPropertyPath() else Usd.Property() + self.assertEqual(expected_property, errorSite.GetProperty()) + expected_prim = stage.GetPrimAtPath(objectPath) if objectPath.IsPrimPath() else Usd.Prim() + self.assertEqual(expected_prim, errorSite.GetPrim()) + + self.assertEqual(errorSite.GetLayer(), layer) + self.assertEqual(errorSite.GetStage(), stage) + + def test_create_error_site_with_stage_and_prim(self): + stage = Usd.Stage.CreateInMemory() + test_prim_path = Sdf.Path("/test") + stage.DefinePrim(test_prim_path, "Xform") + errorSite = Usd.ValidationErrorSite(stage, test_prim_path) + self._verify_error_site_with_stage(errorSite, stage, test_prim_path) + + # With layer also + errorSite = Usd.ValidationErrorSite(stage, test_prim_path, stage.GetRootLayer()) + self._verify_error_site_with_stage_and_layer(errorSite, stage, stage.GetRootLayer(), test_prim_path) + + def test_create_error_site_with_stage_and_property(self): + stage = Usd.Stage.CreateInMemory() + test_prim_path = Sdf.Path("/test") + test_prim = stage.DefinePrim(test_prim_path, "Xform") + test_attr = test_prim.CreateAttribute("attr", Sdf.ValueTypeNames.Int) + test_attr_path = test_attr.GetPath() + errorSite = Usd.ValidationErrorSite(stage, test_attr_path) + self._verify_error_site_with_stage(errorSite, stage, test_attr_path) + + # With layer also + errorSite = Usd.ValidationErrorSite(stage, test_attr_path, stage.GetRootLayer()) + self._verify_error_site_with_stage_and_layer(errorSite, stage, stage.GetRootLayer(), test_attr_path) + + def test_create_error_site_with_invalid_args(self): + stage = Usd.Stage.CreateInMemory() + test_prim_path = Sdf.Path("/test") + stage.DefinePrim(test_prim_path, "Xform") + errors = { + "Wrong Stage Type": { + "stage": "wrong stage", + "layer": stage.GetRootLayer(), + "objectPath": test_prim_path + }, + "Wrong Layer Type": { + "stage": stage, + "layer": "wrong layer", + "objectPath": test_prim_path + }, + "Wrong Path Type": { + "stage": stage, + "layer": stage.GetRootLayer(), + "objectPath": 123 + }, + } + + for error_category, args in errors.items(): + with self.subTest(errorType=error_category): + with self.assertRaises(Exception): + Usd.ValidationErrorSite(**args) + + def _verify_validation_error(self, error, errorType=Usd.ValidationErrorType.None_, errorSites=[], errorMessage=""): + self.assertEqual(error.GetType(), errorType) + self.assertEqual(error.GetSites(), errorSites) + self.assertEqual(error.GetMessage(), errorMessage) + if errorType != Usd.ValidationErrorType.None_: + self.assertTrue(error.GetErrorAsString()) + self.assertFalse(error.HasNoError()) + else: + self.assertFalse(error.GetErrorAsString()) + self.assertTrue(error.HasNoError()) + + def test_create_default_validation_error(self): + validation_error = Usd.ValidationError() + self._verify_validation_error(validation_error) + + def test_create_validation_error_with_keyword_args(self): + errors = [ + { + "errorType": Usd.ValidationErrorType.None_, + "errorSites": [], + "errorMessage": "" + }, + { + "errorType": Usd.ValidationErrorType.Error, + "errorSites": [Usd.ValidationErrorSite()], + "errorMessage": "This is an error." + }, + { + "errorType": Usd.ValidationErrorType.Warn, + "errorSites": [Usd.ValidationErrorSite()], + "errorMessage": "This is a warning." + }, + { + "errorType": Usd.ValidationErrorType.Info, + "errorSites": [Usd.ValidationErrorSite(), Usd.ValidationErrorSite()], + "errorMessage": "This is an info." + }, + ] + + for error in errors: + with self.subTest(errorType=error["errorType"]): + validation_error = Usd.ValidationError(**error) + self._verify_validation_error(validation_error, **error) + + def test_create_validation_error_with_invalid_args(self): + errors = { + "Wrong Error Type": { + "errorType": "wrong_type", + "errorSites": [], + "errorMessage": "" + }, + "Wrong Sites Type": { + "errorType": Usd.ValidationErrorType.None_, + "errorSites": "wong_type", + "errorMessage": "" + }, + "Wrong Message Type": { + "errorType": Usd.ValidationErrorType.None_, + "errorSites": [], + "errorMessage": 123 + }, + } + + for error_category, error in errors.items(): + with self.subTest(errorType=error_category): + with self.assertRaises(Exception): + Usd.ValidationError(**error) + + +if __name__ == "__main__": + unittest.main() diff --git a/pxr/usd/usd/wrapValidationError.cpp b/pxr/usd/usd/wrapValidationError.cpp new file mode 100644 index 0000000000..792882f6ec --- /dev/null +++ b/pxr/usd/usd/wrapValidationError.cpp @@ -0,0 +1,54 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/pxr.h" +#include "pxr/usd/usd/validationError.h" +#include "pxr/usd/usd/validator.h" + +#include "pxr/base/tf/pyContainerConversions.h" +#include "pxr/base/tf/pyEnum.h" +#include "pxr/base/tf/pyPtrHelpers.h" +#include "pxr/base/tf/pyResultConversions.h" + +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +void wrapUsdValidationError() +{ + TfPyWrapEnum("ValidationErrorType"); + + class_("ValidationErrorSite", no_init) + .def(init<>()) + .def(init(args("layer", "objectPath"))) + .def(init((arg("stage"), arg("objectPath"), arg("layer") = SdfLayerHandle{}))) + .def("IsValid", &UsdValidationErrorSite::IsValid) + .def("IsValidSpecInLayer", &UsdValidationErrorSite::IsValidSpecInLayer) + .def("IsPrim", &UsdValidationErrorSite::IsPrim) + .def("IsProperty", &UsdValidationErrorSite::IsProperty) + .def("GetPropertySpec", &UsdValidationErrorSite::GetPropertySpec) + .def("GetPrimSpec", &UsdValidationErrorSite::GetPrimSpec) + .def("GetLayer", &UsdValidationErrorSite::GetLayer, return_value_policy()) + .def("GetStage", &UsdValidationErrorSite::GetStage, return_value_policy()) + .def("GetPrim", &UsdValidationErrorSite::GetPrim) + .def("GetProperty", &UsdValidationErrorSite::GetProperty) + .def(self == self) + .def(self != self); + + TfPyRegisterStlSequencesFromPython(); + class_("ValidationError", no_init) + .def(init<>()) + .def(init(args("errorType", "errorSites", "errorMessage"))) + .def(self == self) + .def(self != self) + .def("GetType", &UsdValidationError::GetType) + .def("GetSites", make_function(&UsdValidationError::GetSites, return_value_policy())) + .def("GetMessage", &UsdValidationError::GetMessage, return_value_policy()) + .def("GetErrorAsString", &UsdValidationError::GetErrorAsString) + .def("HasNoError", &UsdValidationError::HasNoError); +} From 27c760f8a0e628ae88ac24b43c70052b0baf06a3 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2024 10:52:29 -0400 Subject: [PATCH 077/202] fix: various PR comment related fixes - instead of using a FQP for the failure condition, changed to using a relative path that was not actually included, making verifying error messages easier - used better typing where possible - remove the word 'loaded' from error message - fixed indenting in CMakeLists.txt --- pxr/usd/usdUtils/CMakeLists.txt | 4 +-- .../badRoot.usda | 4 +-- .../{0 => excludedDirectory}/image.jpg | Bin .../{0 => excludedDirectory}/layer.usda | 0 .../fail.usdz | Bin 5075 -> 5207 bytes .../goodRoot.usda | 4 +-- .../includedDirectory/image.jpg | Bin 0 -> 4233 bytes .../includedDirectory/layer.usda | 6 +++++ .../pass.usdz | Bin 4983 -> 5207 bytes .../testenv/testUsdUtilsValidators.cpp | 25 +++++++++--------- pxr/usd/usdUtils/validators.cpp | 4 +-- 11 files changed, 27 insertions(+), 20 deletions(-) rename pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/{0 => excludedDirectory}/image.jpg (100%) rename pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/{0 => excludedDirectory}/layer.usda (100%) create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/image.jpg create mode 100644 pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda diff --git a/pxr/usd/usdUtils/CMakeLists.txt b/pxr/usd/usdUtils/CMakeLists.txt index 1f1e797d35..9468e45b10 100644 --- a/pxr/usd/usdUtils/CMakeLists.txt +++ b/pxr/usd/usdUtils/CMakeLists.txt @@ -310,8 +310,8 @@ pxr_install_test_dir( ) pxr_install_test_dir( - SRC testenv/testUsdUtilsPackageEncapsulation - DEST testUsdUtilsPackageEncapsulation + SRC testenv/testUsdUtilsPackageEncapsulation + DEST testUsdUtilsPackageEncapsulation ) pxr_register_test(testUsdUtilsAuthoring diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda index 770cf276c7..b44a9065a5 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda @@ -7,12 +7,12 @@ def Xform "Root" ( kind = "group" - references = @/Users/andrewbeers/libs/usd-2408-dev/tests/ctest/testUsdUtilsPackageEncapsulation/0/layer.usda@ + references = @excludedDirectory/layer.usda@ ) { def Cube "MyCube" { } - asset file = @/Users/andrewbeers/libs/usd-2408-dev/tests/ctest/testUsdUtilsPackageEncapsulation/0/image.jpg@ + asset file = @excludedDirectory/image.jpg@ } \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/image.jpg b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/image.jpg similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/image.jpg rename to pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/image.jpg diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/layer.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/layer.usda similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/0/layer.usda rename to pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/layer.usda diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz index e86c598d37dec61cece36acb8b08ad055fdd91de..0b8dbfbbce838bb09885611373af44204bb605da 100644 GIT binary patch delta 399 zcmcbteqBR6z?+$civa|FhloW^IBz6I3zB(_Of0`*!=bl{qNN=Shh#Uqoy3pqPr za|_7J5a0szFkzQX))VG&#O5-XF$@fzLf8z#aHm*+H!B-R7c&qh11-M?)W^U80FZ}j A$p8QV delta 458 zcmcbvaamnFz?+$civa|tO=gKa@0lvl!N|bSF;RR&uzqN9YEiL%VqQv7YI#yBh@F#} zRIFcGoT6)FVql@0l3J!;l3H9+te*^`!0gcCl+cpQoZ^7Q5f v-~=!z4N&ZxyiQmm5Sw){EkKtFfi$65j*txSW@Q8Mn1S# + references = @includedDirectory/layer.usda@ ) { def Cube "MyCube" { } - asset file = @0/image.jpg@ + asset file = @includedDirectory/image.jpg@ } \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/image.jpg b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/image.jpg new file mode 100644 index 0000000000000000000000000000000000000000..995743ce148a12bc316d1d0920cda63cf347a6fc GIT binary patch literal 4233 zcmb_fcU)7++MZKVNq{7PfRxY?1nC5j5<&}zbP#(;0)!G`0*Kg^MFm$B6%nlHs;Fy0 zrL7eUwpFoVU(iKCSr-d-&7A~^_uIejcYpUy=Dg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36;Om#VGJ60Uro8(vp0fbq literal 0 HcmV?d00001 diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda new file mode 100644 index 0000000000..2f94b858cf --- /dev/null +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda @@ -0,0 +1,6 @@ +#usda 1.0 + +def "Layer" ( +) +{ +} \ No newline at end of file diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz index 46e8e41d178fe83538d588fcc3a6ba7293c2d595..9acb1372cba496ac47599574deca130ace45f353 100644 GIT binary patch delta 401 zcmeyac3ndvz?+$civa|Tn&OgKl$u23st8a}q04i}Xs1Qxe-GErFV?COU9U_7YOyL-onz3Lz&4Y_0)$ x8UkE^UMB3e$?Jr89I-hKW()&^rw}%SFdQlt;LXYg(!~sf$w15R0rfF30089eYM1~3 delta 303 zcmcbv@m)PgE0e=+BQl3$&HK#n-4Hf7ElfZs%7t$h?D~w4Z=JOyg;=% ziIu5EdZooFiEWacleY<(@S!?k@(&>=18mj+O@IOwMh0|C1x1V|8whg+VzU#bje&tv b2&56k1qjIiZ&o%Cj~N7kHpBrHGcW)ET24Vz diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 8dd2317497..af792568c9 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -47,24 +47,25 @@ TestPackageEncapsulationValidator() TF_AXIOM(validator); - const std::string testAssetDirectory = ArchGetCwd() + "/ctest/testUsdUtilsPackageEncapsulation/"; - - // Load the pre-created usdz stage with fully qualified paths to both a reference and an asset - const UsdStageRefPtr& stage = UsdStage::Open(testAssetDirectory + "fail.usdz"); + // Load the pre-created usdz stage with paths to a layer and asset that are not included in the package, but exist + const UsdStageRefPtr& stage = UsdStage::Open("testUsdUtilsPackageEncapsulation/fail.usdz"); UsdValidationErrorVector errors = validator->Validate(stage); // Verify both the layer & asset errors are present TF_AXIOM(errors.size() == 2); - const std::string& errorLayer = (testAssetDirectory + "0/layer.usda"); - const std::string& rootLayer = testAssetDirectory + "fail.usdz"; - const std::string& errorAsset = testAssetDirectory + "0/image.jpg"; + + const std::string& realRootPath = stage->GetRootLayer()->GetRealPath(); + const std::string& rootDirectory = realRootPath.substr(0, realRootPath.find_last_of("/") + 1); + + const std::string& errorLayer = rootDirectory + "excludedDirectory/layer.usda"; + const std::string& errorAsset = rootDirectory + "excludedDirectory/image.jpg"; std::vector expectedErrorMessages = { - TfStringPrintf(("Found loaded layer '%s' that does not belong to the package '%s'."), - errorLayer.c_str(), rootLayer.c_str()), + TfStringPrintf(("Found layer '%s' that does not belong to the package '%s'."), + errorLayer.c_str(), realRootPath.c_str()), TfStringPrintf(("Found asset reference '%s' that does not belong to the package '%s'."), - errorAsset.c_str(), rootLayer.c_str()) + errorAsset.c_str(), realRootPath.c_str()) }; for (size_t i = 0; i < errors.size(); ++i) @@ -75,8 +76,8 @@ TestPackageEncapsulationValidator() TF_AXIOM(errors[i].GetMessage() == expectedErrorMessages[i]); } - // Load the pre-created usdz stage with relative paths to both a reference and an asset. - const UsdStageRefPtr &passStage = UsdStage::Open(testAssetDirectory + "pass.usdz"); + // Load the pre-created usdz stage with relative paths to both a reference and an asset that are included in the package. + const UsdStageRefPtr& passStage = UsdStage::Open("testUsdUtilsPackageEncapsulation/pass.usdz"); errors = validator->Validate(passStage); diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index 250cf08b60..e6e03f366a 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -29,7 +29,7 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { return errors; } - std::vector> layers; + SdfLayerRefPtrVector layers; std::vector> assets, unresolvedPaths; const SdfAssetPath& path = SdfAssetPath(rootLayer->GetIdentifier()); @@ -51,7 +51,7 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { UsdValidationErrorSite(rootLayer, subLayer->GetDefaultPrimAsPath()) }, - TfStringPrintf(("Found loaded layer '%s' that " + TfStringPrintf(("Found layer '%s' that " "does not belong to the package '%s'."), subLayer->GetIdentifier().c_str(), packagePath.c_str()) ); From 513b726a2821e85b1ac455fa78961cfec675033c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2024 11:02:36 -0400 Subject: [PATCH 078/202] fix: do not include in-memory layers - in-memory layers will not have a real path, exclude them in this validator --- pxr/usd/usdUtils/validators.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index e6e03f366a..b62d80b103 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -44,7 +44,9 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { if (!packagePath.empty()) { for (const SdfLayerRefPtr& subLayer : layers) { const std::string& realPath = subLayer->GetRealPath(); - if (!TfStringStartsWith(realPath, packagePath)) { + + // Make sure the realPath exists, as the validator should not consider in-memory layers + if (!realPath.empty() && !TfStringStartsWith(realPath, packagePath)) { errors.emplace_back( UsdValidationErrorType::Error, UsdValidationErrorSites{ From 2aae68cf8b32576f5a4bda02111e792c8448141e Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2024 12:55:34 -0400 Subject: [PATCH 079/202] refactor: fix long lines of code - adjust all lines of code such that they are no wider than column 80 --- .../testenv/testUsdUtilsValidators.cpp | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index af792568c9..45c066490b 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -4,8 +4,6 @@ #include "pxr/usd/usd/validationRegistry.h" #include "pxr/base/arch/systemInfo.h" -#include - PXR_NAMESPACE_USING_DIRECTIVE static @@ -47,8 +45,10 @@ TestPackageEncapsulationValidator() TF_AXIOM(validator); - // Load the pre-created usdz stage with paths to a layer and asset that are not included in the package, but exist - const UsdStageRefPtr& stage = UsdStage::Open("testUsdUtilsPackageEncapsulation/fail.usdz"); + // Load the pre-created usdz stage with paths to a layer and asset + // that are not included in the package, but exist + const UsdStageRefPtr& stage = UsdStage::Open( + "testUsdUtilsPackageEncapsulation/fail.usdz"); UsdValidationErrorVector errors = validator->Validate(stage); @@ -56,15 +56,20 @@ TestPackageEncapsulationValidator() TF_AXIOM(errors.size() == 2); const std::string& realRootPath = stage->GetRootLayer()->GetRealPath(); - const std::string& rootDirectory = realRootPath.substr(0, realRootPath.find_last_of("/") + 1); + const std::string& rootDirectory = realRootPath + .substr(0, realRootPath.find_last_of("/") + 1); - const std::string& errorLayer = rootDirectory + "excludedDirectory/layer.usda"; - const std::string& errorAsset = rootDirectory + "excludedDirectory/image.jpg"; + const std::string& errorLayer = rootDirectory + "excludedDirectory" + "/layer.usda"; + const std::string& errorAsset = rootDirectory + "excludedDirectory" + "/image.jpg"; std::vector expectedErrorMessages = { - TfStringPrintf(("Found layer '%s' that does not belong to the package '%s'."), + TfStringPrintf(("Found layer '%s' that does not belong to the" + " package '%s'."), errorLayer.c_str(), realRootPath.c_str()), - TfStringPrintf(("Found asset reference '%s' that does not belong to the package '%s'."), + TfStringPrintf(("Found asset reference '%s' that does not belong" + " to the package '%s'."), errorAsset.c_str(), realRootPath.c_str()) }; @@ -76,8 +81,10 @@ TestPackageEncapsulationValidator() TF_AXIOM(errors[i].GetMessage() == expectedErrorMessages[i]); } - // Load the pre-created usdz stage with relative paths to both a reference and an asset that are included in the package. - const UsdStageRefPtr& passStage = UsdStage::Open("testUsdUtilsPackageEncapsulation/pass.usdz"); + // Load the pre-created usdz stage with relative paths to both a reference + // and an asset that are included in the package. + const UsdStageRefPtr& passStage = UsdStage::Open( + "testUsdUtilsPackageEncapsulation/pass.usdz"); errors = validator->Validate(passStage); From 0ea0c96e3177e4a63bf944d99c0a5ee4e0d5d2d5 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2024 13:44:17 -0400 Subject: [PATCH 080/202] refactor: make skipping session layers clearer --- pxr/usd/usdUtils/validators.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index b62d80b103..1463f5df0f 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -45,8 +45,13 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { for (const SdfLayerRefPtr& subLayer : layers) { const std::string& realPath = subLayer->GetRealPath(); - // Make sure the realPath exists, as the validator should not consider in-memory layers - if (!realPath.empty() && !TfStringStartsWith(realPath, packagePath)) { + // We don't want to validate in-memory or session layers + // since these layers will not have a real path, we skip here + if (realPath.empty()){ + continue; + } + + if (!TfStringStartsWith(realPath, packagePath)) { errors.emplace_back( UsdValidationErrorType::Error, UsdValidationErrorSites{ From 94c9a84a1898db48607592c8a7bcd2cd7bc0cfa3 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2024 18:01:38 -0400 Subject: [PATCH 081/202] refactor: various fixes based on PR comments - added a successful test to verify 0 errors - reduced nesting in validation code - added comments in from the complianceChecker code - removed checking TypeName as the code that required that check has been fixed - updated ancestor check code to be more clear --- .../testenv/testUsdShadeValidators.cpp | 6 +- pxr/usd/usdShade/validators.cpp | 106 ++++++++++-------- 2 files changed, 65 insertions(+), 47 deletions(-) diff --git a/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp index 06141828be..170e377c7a 100644 --- a/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp +++ b/pxr/usd/usdShade/testenv/testUsdShadeValidators.cpp @@ -424,7 +424,7 @@ TestUsdShadeConnectableValidator() // Create a Material > Shader > Shader hierarchy UsdShadeMaterial::Define(usdStage, SdfPath("/RootMaterial")); - UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Shader")); + const UsdShadeShader& topShader = UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Shader")); const UsdShadeShader& insideShader = UsdShadeShader::Define(usdStage, SdfPath("/RootMaterial/Shader/InsideShader")); // Verify error that does not allow a connectable to be parented by non-container connectable @@ -440,6 +440,10 @@ TestUsdShadeConnectableValidator() "Connectable Shader cannot reside under a non-Container Connectable Shader"; TF_AXIOM(errors[0].GetMessage() == expectedErrorMsg); + // Verify the first Shader is valid + errors = validator->Validate(topShader.GetPrim()); + TF_AXIOM(errors.size() == 0); + // Create a Material > Scope > Shader hierarchy usdStage->RemovePrim(SdfPath("/RootMaterial/Shader/InsideShader")); usdStage->RemovePrim(SdfPath("/RootMaterial/Shader")); diff --git a/pxr/usd/usdShade/validators.cpp b/pxr/usd/usdShade/validators.cpp index 5cead9d5a9..7e185cec27 100644 --- a/pxr/usd/usdShade/validators.cpp +++ b/pxr/usd/usdShade/validators.cpp @@ -34,61 +34,75 @@ static UsdValidationErrorVector _ConnectableValidator(const UsdPrim& usdPrim) { - UsdValidationErrorVector errors; + const UsdShadeConnectableAPI& connectable = + UsdShadeConnectableAPI(usdPrim); - const UsdShadeConnectableAPI& connectable = UsdShadeConnectableAPI(usdPrim); + if (!connectable){ + return {}; + } - if (!usdPrim.GetTypeName().IsEmpty() && connectable) { - const UsdPrim& parentPrim = usdPrim.GetParent(); + const UsdPrim& parentPrim = usdPrim.GetParent(); - if (parentPrim && !parentPrim.IsPseudoRoot()) { - UsdShadeConnectableAPI parentConnectable = UsdShadeConnectableAPI(parentPrim); - if (parentPrim.GetTypeName().IsEmpty()){ - parentConnectable = UsdShadeConnectableAPI(); - } + if (!parentPrim || parentPrim.IsPseudoRoot()){ + return {}; + } - if (parentConnectable && !parentConnectable.IsContainer()) { + UsdShadeConnectableAPI parentConnectable = + UsdShadeConnectableAPI(parentPrim); + UsdValidationErrorVector errors; + if (parentConnectable && !parentConnectable.IsContainer()) { + // It is a violation of the UsdShade OM which enforces + // encapsulation of connectable prims under a Container-type + // connectable prim. + errors.emplace_back( + UsdValidationErrorType::Error, + UsdValidationErrorSites{ + UsdValidationErrorSite(usdPrim.GetStage(), + usdPrim.GetPath()) + }, + TfStringPrintf("Connectable %s <%s> cannot reside " + "under a non-Container Connectable %s", + usdPrim.GetTypeName().GetText(), + usdPrim.GetPath().GetText(), + parentPrim.GetTypeName().GetText())); + } + else if (!parentConnectable) { + std::function verifyValidAncestor = + [&](const UsdPrim& currentAncestor) -> void { + if (!currentAncestor || currentAncestor.IsPseudoRoot()) { + return; + } + const UsdShadeConnectableAPI& ancestorConnectable = + UsdShadeConnectableAPI(currentAncestor); + if (ancestorConnectable) { + // it's only OK to have a non-connectable parent if all + // the rest of your ancestors are also non-connectable. + // The error message we give is targeted at the most common + // infraction, using Scope or other grouping prims inside + // a Container like a Material errors.emplace_back( UsdValidationErrorType::Error, - UsdValidationErrorSites{ + UsdValidationErrorSites { UsdValidationErrorSite(usdPrim.GetStage(), - usdPrim.GetPath()) + usdPrim.GetPath()) }, - TfStringPrintf("Connectable %s <%s> cannot reside " - "under a non-Container Connectable %s", - usdPrim.GetTypeName().GetText(), - usdPrim.GetPath().GetText(), - parentPrim.GetTypeName().GetText())); + TfStringPrintf("Connectable %s <%s> can only have" + " Connectable Container ancestors" + " up to %s ancestor <%s>, but its" + " parent %s is a %s.", + usdPrim.GetTypeName().GetText(), + usdPrim.GetPath().GetText(), + currentAncestor.GetTypeName().GetText(), + currentAncestor.GetPath().GetText(), + parentPrim.GetName().GetText(), + parentPrim.GetTypeName().GetText())); + return; } - else if (!parentConnectable) { - UsdPrim currentAncestor = parentPrim.GetParent(); - while(currentAncestor && !currentAncestor.IsPseudoRoot()) { - if (!currentAncestor.GetTypeName().IsEmpty()) { - const UsdShadeConnectableAPI& ancestorConnectable = UsdShadeConnectableAPI(currentAncestor); - if (ancestorConnectable) { - errors.emplace_back( - UsdValidationErrorType::Error, - UsdValidationErrorSites { - UsdValidationErrorSite(usdPrim.GetStage(), - usdPrim.GetPath()) - }, - TfStringPrintf("Connectable %s <%s> can only have" - " Connectable Container ancestors" - " up to %s ancestor <%s>, but its" - " parent %s is a %s.", - usdPrim.GetTypeName().GetText(), - usdPrim.GetPath().GetText(), - currentAncestor.GetTypeName().GetText(), - currentAncestor.GetPath().GetText(), - parentPrim.GetName().GetText(), - parentPrim.GetTypeName().GetText())); - break; - } - } - currentAncestor = currentAncestor.GetParent(); - } - } - } + + verifyValidAncestor(currentAncestor.GetParent()); + }; + + verifyValidAncestor(parentPrim.GetParent()); } return errors; From 9a9153608f1f9db06ab97a9cb06200e225a57bd9 Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Thu, 22 Aug 2024 16:11:35 -0700 Subject: [PATCH 082/202] [usdLux] UsdLuxCylinderLight - bounds computation puts length along x axis, to match documentation --- pxr/usd/usdLux/cylinderLight.cpp | 2 +- pxr/usd/usdLux/testenv/testUsdLuxLight.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pxr/usd/usdLux/cylinderLight.cpp b/pxr/usd/usdLux/cylinderLight.cpp index 9de2f0d388..f0be1227d5 100644 --- a/pxr/usd/usdLux/cylinderLight.cpp +++ b/pxr/usd/usdLux/cylinderLight.cpp @@ -190,7 +190,7 @@ _ComputeLocalExtent(const float radius, VtVec3fArray *extent) { extent->resize(2); - (*extent)[1] = GfVec3f(radius, radius, length * 0.5f); + (*extent)[1] = GfVec3f(length * 0.5f, radius, radius); (*extent)[0] = -(*extent)[1]; return true; } diff --git a/pxr/usd/usdLux/testenv/testUsdLuxLight.py b/pxr/usd/usdLux/testenv/testUsdLuxLight.py index cd3c9e44c1..5b69b98f1d 100644 --- a/pxr/usd/usdLux/testenv/testUsdLuxLight.py +++ b/pxr/usd/usdLux/testenv/testUsdLuxLight.py @@ -374,7 +374,7 @@ def _VerifyExtentAndBBox(light, expectedExtent): cylLight.CreateRadiusAttr(4.0) cylLight.CreateLengthAttr(10.0) - _VerifyExtentAndBBox(cylLight, [(-4.0, -4.0, -5.0), (4.0, 4.0, 5.0)]) + _VerifyExtentAndBBox(cylLight, [(-5.0, -4.0, -4.0), (5.0, 4.0, 4.0)]) sphereLight.CreateRadiusAttr(3.0) _VerifyExtentAndBBox(sphereLight, [(-3.0, -3.0, -3.0), (3.0, 3.0, 3.0)]) From d06d4153f93f239d7301cffce24d57527a736661 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Fri, 23 Aug 2024 12:53:00 -0700 Subject: [PATCH 083/202] Fixing a bug where ancestral relocates that should be elided were not being elided which can result in tripped verifies, crashes, and infinite loops when an ancestral variant selection is involved. The issue was partially caused by the fact that we could still process ancestral relocates arcs on nodes that have been elided because of another relocates arc. This was because originally ancestral node subtrees without specs would be marked for culling immediately but we'd still have to check them for relocates that would "uncull" them since relocates don't appear as specs on the site itself. So we'd always process relocates on any ancestral node regardless of whether it was culled or not resulting in sometimes processing relocates on nodes that have been elided. But changes were made to prim index node culling in 24.05 such that the culling of nodes for lack of specs was changed to happen at the end of the prim index building instead of during, making the additional allowance for processing relocates on "marked as culled" ancestral nodes unnecessary. Additionally in 24.05, we changed how we process ancestral variant selections for computed subtree arcs (of which relocates arcs are always computed subtree arcs) such that the variants are delayed to be processed after the subtree is added. This combined with the fact that the culling behavior no longer goes back to uncull ancestor nodes when a new arc is added and that we could still process culled relocates arcs, led to cases where an unculled ancestral variant arc could be added under a relocates under a culled node. And this ends up tripping a TF_VERIFY in prim index finalization (and later a crash or hang if the a child of that prim index is computed) where we expect to never find an unculled node under a culled node. With all this said the fix is to just never evaluate relocates on culled nodes since we now know they will always be truly culled (and not just ancestral nodes with no specs). I've added a museum test case that demonstrates the correct behavior that would fail due to the TF_VERIFY without the change to primIndex. (Internal change: 2337691) --- pxr/usd/pcp/CMakeLists.txt | 12 ++ pxr/usd/pcp/primIndex.cpp | 14 +- .../ElidedAncestralRelocates/base.sdf | 53 ++++++ .../ElidedAncestralRelocates/root.sdf | 53 ++++++ ...sitionResults_ElidedAncestralRelocates.txt | 180 ++++++++++++++++++ 5 files changed, 307 insertions(+), 5 deletions(-) create mode 100644 pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/base.sdf create mode 100644 pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/root.sdf create mode 100644 pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/baseline/compositionResults_ElidedAncestralRelocates.txt diff --git a/pxr/usd/pcp/CMakeLists.txt b/pxr/usd/pcp/CMakeLists.txt index 013779244a..f0a2cccc70 100644 --- a/pxr/usd/pcp/CMakeLists.txt +++ b/pxr/usd/pcp/CMakeLists.txt @@ -465,6 +465,11 @@ pxr_install_test_dir( DEST testPcpMuseum_BasicSpecializesAndVariants ) +pxr_install_test_dir( + SRC testenv/testPcpMuseum_ElidedAncestralRelocates.testenv + DEST testPcpMuseum_ElidedAncestralRelocates +) + pxr_install_test_dir( SRC testenv/testPcpMuseum_ExpressionsInPayloads.testenv DEST testPcpMuseum_ExpressionsInPayloads @@ -1211,6 +1216,13 @@ pxr_register_test(testPcpMuseum_BasicSpecializesAndVariants DIFF_COMPARE compositionResults_BasicSpecializesAndVariants.txt ) +pxr_register_test(testPcpMuseum_ElidedAncestralRelocates + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testPcpCompositionResults --usd ElidedAncestralRelocates/root.sdf" + STDOUT_REDIRECT compositionResults_ElidedAncestralRelocates.txt + DIFF_COMPARE compositionResults_ElidedAncestralRelocates.txt +) + pxr_register_test(testPcpMuseum_ExpressionsInPayloads PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testPcpCompositionResults --usd ExpressionsInPayloads/root.sdf" diff --git a/pxr/usd/pcp/primIndex.cpp b/pxr/usd/pcp/primIndex.cpp index e845b56e6e..12308cc14a 100644 --- a/pxr/usd/pcp/primIndex.cpp +++ b/pxr/usd/pcp/primIndex.cpp @@ -2763,11 +2763,15 @@ _EvalNodeRelocations( Pcp_FormatSite(node.GetSite()).c_str()); // Unlike other tasks, we skip processing if this node can't contribute - // specs, but only if this node was introduced at this level at namespace. - // This additional check is needed because a descendant node might not - // have any specs and thus be marked as culled, but still have relocates - // that affect that node. - if (!node.CanContributeSpecs() && node.GetDepthBelowIntroduction() == 0) { + // specs. + // + // Note that this check relies on the fact that descendant nodes without any + // specs are not marked as culled until we're done building the prim index, + // as nodes without specs can still have relocates that affect that node. + // This fact makes sure that we are only skipping nodes that are truly + // culled for reasons such as being elided due to another relocates node + // that throws away ancestral opinions. + if (!node.CanContributeSpecs()) { return; } diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/base.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/base.sdf new file mode 100644 index 0000000000..a77b7a56f5 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/base.sdf @@ -0,0 +1,53 @@ +#sdf 1.4.32 + +def Scope "Rigs" { + def Scope "CharRig" ( + doc = """This rig scope is here to introduce an ancestral variant arc to + the Collision and Colliders prims that will be relocated in the root layer. + Ancestral variant arcs, and how the prim indexing implementation processes + them is important to the providing the condition that caused the prim + indexing failures that this museum case is demonstrating the fix for.""" + + prepend variantSets = ["rigVariant"] + variants = { + string rigVariant = "default" + } + ) { + variantSet "rigVariant" = { + "default" { + def "CollisionRig" { + def "Collision" { + } + + def "Colliders" { + } + } + } + } + } + + def Scope "CharBaseRig" ( + doc = """This rig scope is an exact copy of the above CharRig scope and + is used to prove that relocates on nodes that were elided due to a stronger + relocates node do not get added to prim index.""" + + prepend variantSets = ["rigVariant"] + variants = { + string rigVariant = "default" + } + ) { + variantSet "rigVariant" = { + "default" { + def "CollisionRig" { + def "Collision" { + } + + def "Colliders" { + } + } + } + } + } + + over "Anim" {} +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/root.sdf b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/root.sdf new file mode 100644 index 0000000000..4937b79660 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/ElidedAncestralRelocates/root.sdf @@ -0,0 +1,53 @@ +#sdf 1.4.32 +( + """ + This museum case demonstrates and verifies that relocates on ancestral nodes that + have been elided (due to another relocates) are properly elided too. The core + of this museum case are the relocations to /CharBase/Anim/Collision and + /Char/Anim/Collision which, prior to the change associated with this museum case + and when combined with the ancestral variants in base.sdf, would cause prim index + build failures for /Char/Anim/Collision. The relocates to <.../Colliders> are an + extra check against a prior existing crash when computing namespace children of + the previously bad /Char/Anim/Collision prim index. + """ + relocates = { + : , + : , + : , + : , + } +) + +def Scope "CharBase" ( + references = @base.sdf@ +) { + over "Anim" { + over "Collision" ( + doc = """This prim will have opinions from the + /CharBase/CharBaseRig/CollisionRig/Collision relocate which + brings in opinions from + /Rigs/CharBaseRig{rigVariant=default}CollisionRig/Collision""" + ) { + } + } +} + +def Scope "Char" ( + references = +) { + over "Anim" { + over "Collision" ( + doc = """This prim will have opinions from the + /Char/CharRig/CollisionRig/Collision relocate which brings + in /Rigs/CharRig{rigVariant=default}CollisionRig/Collision. + But it will NOT have any opinions from /CharBase/Anim/Collsion + because that is an ancestral reference opinion that is elided + by the relocates. And because that ancestral reference is + elided that means that the relocates arc to + /CharBase/Anim/Collision is also elided (or more specifically, + never processed) for this prim index which is what this museum + case is intended to demonstrate and verify.""" + ) { + } + } +} \ No newline at end of file diff --git a/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/baseline/compositionResults_ElidedAncestralRelocates.txt b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/baseline/compositionResults_ElidedAncestralRelocates.txt new file mode 100644 index 0000000000..2471d963d3 --- /dev/null +++ b/pxr/usd/pcp/testenv/testPcpMuseum_ElidedAncestralRelocates.testenv/baseline/compositionResults_ElidedAncestralRelocates.txt @@ -0,0 +1,180 @@ +Loading @ElidedAncestralRelocates/root.sdf@ + +------------------------------------------------------------------------ +Layer Stack: + root.sdf + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /CharBase + base.sdf /Rigs + +Child names: + ['CharRig', 'CharBaseRig', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig + base.sdf /Rigs/CharRig{rigVariant=default} + +Variant Selections: + {rigVariant = default} + +Child names: + ['CollisionRig'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig + +Child names: + ['Collision', 'Colliders'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig/Collision + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig/Colliders + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharBaseRig + base.sdf /Rigs/CharBaseRig{rigVariant=default} + +Variant Selections: + {rigVariant = default} + +Child names: + ['CollisionRig'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharBaseRig{rigVariant=default}CollisionRig + +Prohibited child names: + ['Colliders', 'Collision'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /CharBase/Anim + base.sdf /Rigs/Anim + +Child names: + ['Collision'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /CharBase/Anim/Collision + base.sdf /Rigs/CharBaseRig{rigVariant=default}CollisionRig/Collision + +Child names: + ['Colliders'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharBaseRig{rigVariant=default}CollisionRig/Colliders + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char + root.sdf /CharBase + base.sdf /Rigs + +Child names: + ['CharRig', 'CharBaseRig', 'Anim'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig + base.sdf /Rigs/CharRig{rigVariant=default} + +Variant Selections: + {rigVariant = default} + +Child names: + ['CollisionRig'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig + +Prohibited child names: + ['Colliders', 'Collision'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharBaseRig + base.sdf /Rigs/CharBaseRig{rigVariant=default} + +Variant Selections: + {rigVariant = default} + +Child names: + ['CollisionRig'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharBaseRig{rigVariant=default}CollisionRig + +Prohibited child names: + ['Colliders', 'Collision'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Anim + root.sdf /CharBase/Anim + base.sdf /Rigs/Anim + +Child names: + ['Collision'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + root.sdf /Char/Anim/Collision + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig/Collision + +Child names: + ['Colliders'] + +------------------------------------------------------------------------ +Results for composing + +Prim Stack: + base.sdf /Rigs/CharRig{rigVariant=default}CollisionRig/Colliders + From 58ee8261a4de8a15ca64a88ffa340d6292d293b7 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:53:32 -0700 Subject: [PATCH 084/202] python: Fix catch-value warning in test/slice.cpp This warning was emitted because the test was catching std::invalid_argument by value and would cause strict builds to fail. (Internal change: 2337741) --- pxr/external/boost/python/test/slice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/external/boost/python/test/slice.cpp b/pxr/external/boost/python/test/slice.cpp index 0a50559f22..47f603e7b7 100644 --- a/pxr/external/boost/python/test/slice.cpp +++ b/pxr/external/boost/python/test/slice.cpp @@ -82,7 +82,7 @@ int check_slice_get_indices( try { bounds = index.get_indices(coll.begin(), coll.end()); } - catch (std::invalid_argument) { + catch (std::invalid_argument const&) { return 0; } int sum = 0; From 769e586344f2471cded1a5ba9b9fe1f0ca7d5ecc Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:54:13 -0700 Subject: [PATCH 085/202] tf: Remove support for boost::optional from TfPyOptional These Python conversions are unnecessary since we no longer use boost::optional anywhere in OpenUSD. (Internal change: 2337759) --- pxr/base/tf/pyOptional.h | 5 -- pxr/base/tf/testenv/testTfPyOptional.py | 62 ++++++++++++------------- pxr/base/tf/wrapTestTfPyOptional.cpp | 45 ------------------ 3 files changed, 29 insertions(+), 83 deletions(-) diff --git a/pxr/base/tf/pyOptional.h b/pxr/base/tf/pyOptional.h index e40a143c45..4421d42c22 100644 --- a/pxr/base/tf/pyOptional.h +++ b/pxr/base/tf/pyOptional.h @@ -12,7 +12,6 @@ #include "pxr/pxr.h" #include "pxr/base/tf/pyUtils.h" -#include #include #include #include @@ -101,10 +100,6 @@ struct python_optional std::optional, optional_to_python>, optional_from_python>>(); - register_python_conversion< - boost::optional, - optional_to_python>, - optional_from_python>>(); } }; diff --git a/pxr/base/tf/testenv/testTfPyOptional.py b/pxr/base/tf/testenv/testTfPyOptional.py index 35e6a94481..8a9a87ec77 100644 --- a/pxr/base/tf/testenv/testTfPyOptional.py +++ b/pxr/base/tf/testenv/testTfPyOptional.py @@ -9,7 +9,6 @@ from pxr import Tf import unittest -TestBoost = Tf.Tf_TestPyOptionalBoost TestStd = Tf.Tf_TestPyOptionalStd maxint = (2 ** 31) - 1 @@ -17,43 +16,40 @@ class TestTfPyOptional(unittest.TestCase): def test_OptionalArgs(self): - for testKind in (TestBoost, TestStd): - self.assertEqual(testKind.TakesOptional(), (None, None)) - self.assertEqual(testKind.TakesOptional(None), (None, None)) - self.assertEqual(testKind.TakesOptional(None, None), (None, None)) - self.assertEqual(testKind.TakesOptional('abc', None), ('abc', None)) - self.assertEqual(testKind.TakesOptional(None, []), (None, [])) - self.assertEqual(testKind.TakesOptional(None, ['a', 'b', 'c']), (None, ['a','b','c'])) - self.assertEqual(testKind.TakesOptional('', []), ('', [])) - self.assertEqual(testKind.TakesOptional('abc', ['a', 'b', 'c']), ('abc', ['a','b','c'])) + self.assertEqual(TestStd.TakesOptional(), (None, None)) + self.assertEqual(TestStd.TakesOptional(None), (None, None)) + self.assertEqual(TestStd.TakesOptional(None, None), (None, None)) + self.assertEqual(TestStd.TakesOptional('abc', None), ('abc', None)) + self.assertEqual(TestStd.TakesOptional(None, []), (None, [])) + self.assertEqual(TestStd.TakesOptional(None, ['a', 'b', 'c']), (None, ['a','b','c'])) + self.assertEqual(TestStd.TakesOptional('', []), ('', [])) + self.assertEqual(TestStd.TakesOptional('abc', ['a', 'b', 'c']), ('abc', ['a','b','c'])) def test_OptionalReturns(self): - for testKind in (TestBoost, TestStd): - self.assertEqual(testKind.TestOptionalString(None), None) - self.assertEqual(testKind.TestOptionalStringVector(['string', 'list']), ['string', 'list']) - self.assertEqual(testKind.TestOptionalString('string'), 'string') - self.assertEqual(testKind.TestOptionalDouble(7e-7), 7e-7) - self.assertEqual(testKind.TestOptionalDouble(-7e-7), -7e-7) - self.assertAlmostEqual(testKind.TestOptionalFloat(7e-7), 7e-7) - self.assertAlmostEqual(testKind.TestOptionalFloat(7e-7), 7e-7) - self.assertEqual(testKind.TestOptionalLong(-maxint - 1), -maxint - 1) - self.assertEqual(testKind.TestOptionalULong(maxint + 1), maxint + 1) - self.assertEqual(testKind.TestOptionalInt(-7), -7) - self.assertEqual(testKind.TestOptionalUInt(7), 7) - self.assertEqual(testKind.TestOptionalChar('c'), 'c') - self.assertEqual(testKind.TestOptionalUChar(63), 63) + self.assertEqual(TestStd.TestOptionalString(None), None) + self.assertEqual(TestStd.TestOptionalStringVector(['string', 'list']), ['string', 'list']) + self.assertEqual(TestStd.TestOptionalString('string'), 'string') + self.assertEqual(TestStd.TestOptionalDouble(7e-7), 7e-7) + self.assertEqual(TestStd.TestOptionalDouble(-7e-7), -7e-7) + self.assertAlmostEqual(TestStd.TestOptionalFloat(7e-7), 7e-7) + self.assertAlmostEqual(TestStd.TestOptionalFloat(7e-7), 7e-7) + self.assertEqual(TestStd.TestOptionalLong(-maxint - 1), -maxint - 1) + self.assertEqual(TestStd.TestOptionalULong(maxint + 1), maxint + 1) + self.assertEqual(TestStd.TestOptionalInt(-7), -7) + self.assertEqual(TestStd.TestOptionalUInt(7), 7) + self.assertEqual(TestStd.TestOptionalChar('c'), 'c') + self.assertEqual(TestStd.TestOptionalUChar(63), 63) def test_OptionalBadArgs(self): # Boost throws a Boost.Python.ArgumentError - for testKind in (TestBoost, TestStd): - with self.assertRaises(Exception): - testKind.TestOptionalString(43) - with self.assertRaises(Exception): - testKind.TestOptionalInt(sys.maxsize + 1) - with self.assertRaises(Exception): - testKind.TestOptionalUInt(-7) - with self.assertRaises(Exception): - testKind.TestOptionalLong(10e10) + with self.assertRaises(Exception): + TestStd.TestOptionalString(43) + with self.assertRaises(Exception): + TestStd.TestOptionalInt(sys.maxsize + 1) + with self.assertRaises(Exception): + TestStd.TestOptionalUInt(-7) + with self.assertRaises(Exception): + TestStd.TestOptionalLong(10e10) if __name__ == '__main__': diff --git a/pxr/base/tf/wrapTestTfPyOptional.cpp b/pxr/base/tf/wrapTestTfPyOptional.cpp index aecdbd38ed..83dd953f52 100644 --- a/pxr/base/tf/wrapTestTfPyOptional.cpp +++ b/pxr/base/tf/wrapTestTfPyOptional.cpp @@ -55,57 +55,12 @@ _TestOptional( return opt; } -struct Tf_TestPyOptionalBoost { }; struct Tf_TestPyOptionalStd { }; } // anonymous namespace void wrapTf_TestTfPyOptional() { - class_("Tf_TestPyOptionalBoost") - .def("TakesOptional", _TakesOptional, - ( arg("optString") = boost::optional(), - arg("optStrvec") = boost::optional >() )) - .staticmethod("TakesOptional") - - .def("TestOptionalStringVector", - _TestOptional >) - .staticmethod("TestOptionalStringVector") - .def("TestOptionalString", - _TestOptional) - .staticmethod("TestOptionalString") - .def("TestOptionalDouble", - _TestOptional) - .staticmethod("TestOptionalDouble") - .def("TestOptionalFloat", - _TestOptional) - .staticmethod("TestOptionalFloat") - .def("TestOptionalLong", - _TestOptional) - .staticmethod("TestOptionalLong") - .def("TestOptionalULong", - _TestOptional) - .staticmethod("TestOptionalULong") - .def("TestOptionalInt", - _TestOptional) - .staticmethod("TestOptionalInt") - .def("TestOptionalUInt", - _TestOptional) - .staticmethod("TestOptionalUInt") - .def("TestOptionalShort", - _TestOptional) - .staticmethod("TestOptionalShort") - .def("TestOptionalUShort", - _TestOptional) - .staticmethod("TestOptionalUShort") - .def("TestOptionalChar", - _TestOptional) - .staticmethod("TestOptionalChar") - .def("TestOptionalUChar", - _TestOptional) - .staticmethod("TestOptionalUChar") - ; - class_("Tf_TestPyOptionalStd") .def("TakesOptional", _TakesOptional, ( arg("optString") = std::optional(), From 1a30e7b82b7c9e301e6f7429b6b74d4191a7f0ac Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:54:36 -0700 Subject: [PATCH 086/202] hdPrman: Replace use of boost::hash_combine with TfHash (Internal change: 2337760) --- .../renderman-25/plugin/hdPrman/material.cpp | 27 +++++++------------ .../portalLightResolvingSceneIndexPlugin.cpp | 11 ++++---- .../renderman-26/plugin/hdPrman/material.cpp | 27 +++++++------------ .../portalLightResolvingSceneIndexPlugin.cpp | 11 ++++---- 4 files changed, 30 insertions(+), 46 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/material.cpp b/third_party/renderman-25/plugin/hdPrman/material.cpp index 92e7b86ba2..ab678f32a2 100644 --- a/third_party/renderman-25/plugin/hdPrman/material.cpp +++ b/third_party/renderman-25/plugin/hdPrman/material.cpp @@ -11,6 +11,7 @@ #include "pxr/base/gf/vec3f.h" #include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/hash.h" #include "pxr/base/tf/getenv.h" #include "pxr/base/tf/envSetting.h" #include "pxr/base/tf/scopeDescription.h" @@ -26,7 +27,6 @@ #include "pxr/usd/sdr/shaderNode.h" #include "pxr/usd/sdr/shaderProperty.h" #include "pxr/usd/sdr/registry.h" -#include PXR_NAMESPACE_OPEN_SCOPE @@ -60,29 +60,22 @@ TF_MAKE_STATIC_DATA(NdrTokenVec, _sourceTypes) { struct _HashMaterial { size_t operator()(const HdMaterialNetwork2 &mat) const { - size_t v=0; - for (TfToken const& primvarName: mat.primvars) { - boost::hash_combine(v, primvarName.Hash()); - } + size_t v = TfHash()(mat.primvars); for (auto const& node: mat.nodes) { - boost::hash_combine(v, node.first.GetHash()); - boost::hash_combine(v, node.second.nodeTypeId.Hash()); - for (auto const& param: node.second.parameters) { - boost::hash_combine(v, param.first.Hash()); - boost::hash_combine(v, param.second.GetHash()); - } + v = TfHash::Combine(v, + node.first, node.second.nodeTypeId, node.second.parameters); for (auto const& input: node.second.inputConnections) { - boost::hash_combine(v, input.first.Hash()); + v = TfHash::Combine(v, input.first); for (auto const& conn: input.second) { - boost::hash_combine(v, conn.upstreamNode.GetHash()); - boost::hash_combine(v, conn.upstreamOutputName.Hash()); + v = TfHash::Combine( + v, conn.upstreamNode, conn.upstreamOutputName); } } } for (auto const& term: mat.terminals) { - boost::hash_combine(v, term.first.Hash()); - boost::hash_combine(v, term.second.upstreamNode.GetHash()); - boost::hash_combine(v, term.second.upstreamOutputName.Hash()); + v = TfHash::Combine(v, + term.first, + term.second.upstreamNode, term.second.upstreamOutputName); } return v; } diff --git a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp index 8753940cc3..3aff6f806d 100644 --- a/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp +++ b/third_party/renderman-25/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp @@ -8,6 +8,7 @@ #include "pxr/base/gf/rotation.h" #include "pxr/base/gf/vec3f.h" +#include "pxr/base/tf/hash.h" #include "pxr/base/tf/staticTokens.h" #include "pxr/imaging/hd/dataSource.h" #include "pxr/imaging/hd/dataSourceMaterialNetworkInterface.h" @@ -24,8 +25,6 @@ #include "pxr/imaging/hd/xformSchema.h" #include "pxr/usd/sdf/assetPath.h" -#include - #include #include #include @@ -163,10 +162,10 @@ _GetPortalName( const GfMatrix4d& domeXform, const GfMatrix4d& portalXform) { - size_t hashValue = 0; - boost::hash_combine(hashValue, domeColorMap); - boost::hash_combine(hashValue, domeXform.ExtractRotation()); - boost::hash_combine(hashValue, portalXform.ExtractRotation()); + size_t hashValue = TfHash::Combine( + domeColorMap, + domeXform.ExtractRotation(), + portalXform.ExtractRotation()); return std::to_string(hashValue); } diff --git a/third_party/renderman-26/plugin/hdPrman/material.cpp b/third_party/renderman-26/plugin/hdPrman/material.cpp index 92e7b86ba2..ab678f32a2 100644 --- a/third_party/renderman-26/plugin/hdPrman/material.cpp +++ b/third_party/renderman-26/plugin/hdPrman/material.cpp @@ -11,6 +11,7 @@ #include "pxr/base/gf/vec3f.h" #include "pxr/usd/sdf/types.h" +#include "pxr/base/tf/hash.h" #include "pxr/base/tf/getenv.h" #include "pxr/base/tf/envSetting.h" #include "pxr/base/tf/scopeDescription.h" @@ -26,7 +27,6 @@ #include "pxr/usd/sdr/shaderNode.h" #include "pxr/usd/sdr/shaderProperty.h" #include "pxr/usd/sdr/registry.h" -#include PXR_NAMESPACE_OPEN_SCOPE @@ -60,29 +60,22 @@ TF_MAKE_STATIC_DATA(NdrTokenVec, _sourceTypes) { struct _HashMaterial { size_t operator()(const HdMaterialNetwork2 &mat) const { - size_t v=0; - for (TfToken const& primvarName: mat.primvars) { - boost::hash_combine(v, primvarName.Hash()); - } + size_t v = TfHash()(mat.primvars); for (auto const& node: mat.nodes) { - boost::hash_combine(v, node.first.GetHash()); - boost::hash_combine(v, node.second.nodeTypeId.Hash()); - for (auto const& param: node.second.parameters) { - boost::hash_combine(v, param.first.Hash()); - boost::hash_combine(v, param.second.GetHash()); - } + v = TfHash::Combine(v, + node.first, node.second.nodeTypeId, node.second.parameters); for (auto const& input: node.second.inputConnections) { - boost::hash_combine(v, input.first.Hash()); + v = TfHash::Combine(v, input.first); for (auto const& conn: input.second) { - boost::hash_combine(v, conn.upstreamNode.GetHash()); - boost::hash_combine(v, conn.upstreamOutputName.Hash()); + v = TfHash::Combine( + v, conn.upstreamNode, conn.upstreamOutputName); } } } for (auto const& term: mat.terminals) { - boost::hash_combine(v, term.first.Hash()); - boost::hash_combine(v, term.second.upstreamNode.GetHash()); - boost::hash_combine(v, term.second.upstreamOutputName.Hash()); + v = TfHash::Combine(v, + term.first, + term.second.upstreamNode, term.second.upstreamOutputName); } return v; } diff --git a/third_party/renderman-26/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp b/third_party/renderman-26/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp index 8753940cc3..3aff6f806d 100644 --- a/third_party/renderman-26/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp +++ b/third_party/renderman-26/plugin/hdPrman/portalLightResolvingSceneIndexPlugin.cpp @@ -8,6 +8,7 @@ #include "pxr/base/gf/rotation.h" #include "pxr/base/gf/vec3f.h" +#include "pxr/base/tf/hash.h" #include "pxr/base/tf/staticTokens.h" #include "pxr/imaging/hd/dataSource.h" #include "pxr/imaging/hd/dataSourceMaterialNetworkInterface.h" @@ -24,8 +25,6 @@ #include "pxr/imaging/hd/xformSchema.h" #include "pxr/usd/sdf/assetPath.h" -#include - #include #include #include @@ -163,10 +162,10 @@ _GetPortalName( const GfMatrix4d& domeXform, const GfMatrix4d& portalXform) { - size_t hashValue = 0; - boost::hash_combine(hashValue, domeColorMap); - boost::hash_combine(hashValue, domeXform.ExtractRotation()); - boost::hash_combine(hashValue, portalXform.ExtractRotation()); + size_t hashValue = TfHash::Combine( + domeColorMap, + domeXform.ExtractRotation(), + portalXform.ExtractRotation()); return std::to_string(hashValue); } From 2a6a4bc34d545a8e9d98763ae3789754e0e5a620 Mon Sep 17 00:00:00 2001 From: ohjay Date: Fri, 23 Aug 2024 12:54:56 -0700 Subject: [PATCH 087/202] Filter out empty render products in hdPrman. Attempting to render a product without vars seems to lead to a crash in RenderMan. If there are no vars, we now avoid calling Render(). (Internal change: 2337800) --- third_party/renderman-25/plugin/hdPrman/renderSettings.cpp | 6 ++++++ third_party/renderman-26/plugin/hdPrman/renderSettings.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp b/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp index 3505cf6c24..897fd36762 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderSettings.cpp @@ -366,6 +366,12 @@ HdPrman_RenderSettings::UpdateAndRender( for (size_t prodIdx = 0; prodIdx < numProducts; prodIdx++) { auto const &product = GetRenderProducts().at(prodIdx); + if (product.renderVars.empty()) { + TF_WARN("--- Skipping empty render product %s ...\n", + product.name.GetText()); + continue; + } + TF_DEBUG(HDPRMAN_RENDER_PASS).Msg( "--- Processing render product %s ...\n", product.name.GetText()); diff --git a/third_party/renderman-26/plugin/hdPrman/renderSettings.cpp b/third_party/renderman-26/plugin/hdPrman/renderSettings.cpp index 3505cf6c24..897fd36762 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderSettings.cpp +++ b/third_party/renderman-26/plugin/hdPrman/renderSettings.cpp @@ -366,6 +366,12 @@ HdPrman_RenderSettings::UpdateAndRender( for (size_t prodIdx = 0; prodIdx < numProducts; prodIdx++) { auto const &product = GetRenderProducts().at(prodIdx); + if (product.renderVars.empty()) { + TF_WARN("--- Skipping empty render product %s ...\n", + product.name.GetText()); + continue; + } + TF_DEBUG(HDPRMAN_RENDER_PASS).Msg( "--- Processing render product %s ...\n", product.name.GetText()); From c596d0a16add617664e499525d3ae5f60248e604 Mon Sep 17 00:00:00 2001 From: blevin Date: Fri, 23 Aug 2024 12:56:03 -0700 Subject: [PATCH 088/202] [HdPrman] Fix update of time-varying primvars in scene index mode. We must include DirtyPrimvars in our mask of dirty flags that trigger a geometry prototype update, in order to handle non-instance-attribute primvars. (Internal change: 2337886) --- third_party/renderman-25/plugin/hdPrman/gprim.h | 16 +++++++++++----- third_party/renderman-26/plugin/hdPrman/gprim.h | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/gprim.h b/third_party/renderman-25/plugin/hdPrman/gprim.h index cea94ddbe2..78e850a370 100644 --- a/third_party/renderman-25/plugin/hdPrman/gprim.h +++ b/third_party/renderman-25/plugin/hdPrman/gprim.h @@ -218,7 +218,8 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, HdChangeTracker::DirtyPoints | HdChangeTracker::DirtyNormals | HdChangeTracker::DirtyWidths | - HdChangeTracker::DirtyTopology; + HdChangeTracker::DirtyTopology | + HdChangeTracker::DirtyPrimvar; // Hydra dirty bits corresponding to prman instance attributes. See prman // docs at https://rmanwiki.pixar.com/display/REN24/Instance+Attributes. @@ -232,6 +233,11 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, HdChangeTracker::DirtyCategories | HdChangeTracker::DirtyPrimvar; + // These two bitmasks intersect, so we check them against dirtyBits + // prior to clearing either mask. + const bool prmanProtoAttrBitsWereSet(*dirtyBits & prmanProtoAttrBits); + const bool prmanInstAttrBitsWereSet(*dirtyBits & prmanInstAttrBits); + // // Create or modify Riley geometry prototype(s). // @@ -273,7 +279,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, riley::UserId( stats::AddDataLocation(primPath.GetText()).GetValue()), primType, dispId, primvars); - } else if (*dirtyBits & prmanProtoAttrBits) { + } else if (prmanProtoAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryPrototype"); riley->ModifyGeometryPrototype(primType, _prototypeIds[0], &dispId, &primvars); @@ -321,7 +327,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, riley::UserId( stats::AddDataLocation(subsetPath.GetText()).GetValue()), primType, dispId, primvars); - } else if (*dirtyBits & prmanProtoAttrBits) { + } else if (prmanProtoAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryPrototype"); riley->ModifyGeometryPrototype(primType, prototypeId, &subsetDispId, &primvars); @@ -415,7 +421,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, stats::AddDataLocation(subsetPath->GetText()).GetValue()), riley::GeometryPrototypeId::InvalidId(), prototypeId, instanceMaterialId, coordSysList, xform, finalAttrs); - } else if (*dirtyBits & prmanInstAttrBits) { + } else if (prmanInstAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryInstance"); riley->ModifyGeometryInstance( riley::GeometryPrototypeId::InvalidId(), @@ -424,7 +430,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, } } *dirtyBits &= ~prmanInstAttrBits; - } else if ((*dirtyBits & prmanInstAttrBits) + } else if (prmanInstAttrBitsWereSet || HdChangeTracker::IsInstancerDirty(*dirtyBits, instancerId)) { // This gprim is a prototype of a hydra instancer. (It is not itself an // instancer because it is a gprim.) The riley geometry prototypes have diff --git a/third_party/renderman-26/plugin/hdPrman/gprim.h b/third_party/renderman-26/plugin/hdPrman/gprim.h index cea94ddbe2..78e850a370 100644 --- a/third_party/renderman-26/plugin/hdPrman/gprim.h +++ b/third_party/renderman-26/plugin/hdPrman/gprim.h @@ -218,7 +218,8 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, HdChangeTracker::DirtyPoints | HdChangeTracker::DirtyNormals | HdChangeTracker::DirtyWidths | - HdChangeTracker::DirtyTopology; + HdChangeTracker::DirtyTopology | + HdChangeTracker::DirtyPrimvar; // Hydra dirty bits corresponding to prman instance attributes. See prman // docs at https://rmanwiki.pixar.com/display/REN24/Instance+Attributes. @@ -232,6 +233,11 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, HdChangeTracker::DirtyCategories | HdChangeTracker::DirtyPrimvar; + // These two bitmasks intersect, so we check them against dirtyBits + // prior to clearing either mask. + const bool prmanProtoAttrBitsWereSet(*dirtyBits & prmanProtoAttrBits); + const bool prmanInstAttrBitsWereSet(*dirtyBits & prmanInstAttrBits); + // // Create or modify Riley geometry prototype(s). // @@ -273,7 +279,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, riley::UserId( stats::AddDataLocation(primPath.GetText()).GetValue()), primType, dispId, primvars); - } else if (*dirtyBits & prmanProtoAttrBits) { + } else if (prmanProtoAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryPrototype"); riley->ModifyGeometryPrototype(primType, _prototypeIds[0], &dispId, &primvars); @@ -321,7 +327,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, riley::UserId( stats::AddDataLocation(subsetPath.GetText()).GetValue()), primType, dispId, primvars); - } else if (*dirtyBits & prmanProtoAttrBits) { + } else if (prmanProtoAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryPrototype"); riley->ModifyGeometryPrototype(primType, prototypeId, &subsetDispId, &primvars); @@ -415,7 +421,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, stats::AddDataLocation(subsetPath->GetText()).GetValue()), riley::GeometryPrototypeId::InvalidId(), prototypeId, instanceMaterialId, coordSysList, xform, finalAttrs); - } else if (*dirtyBits & prmanInstAttrBits) { + } else if (prmanInstAttrBitsWereSet) { TRACE_SCOPE("riley::ModifyGeometryInstance"); riley->ModifyGeometryInstance( riley::GeometryPrototypeId::InvalidId(), @@ -424,7 +430,7 @@ HdPrman_Gprim::Sync(HdSceneDelegate* sceneDelegate, } } *dirtyBits &= ~prmanInstAttrBits; - } else if ((*dirtyBits & prmanInstAttrBits) + } else if (prmanInstAttrBitsWereSet || HdChangeTracker::IsInstancerDirty(*dirtyBits, instancerId)) { // This gprim is a prototype of a hydra instancer. (It is not itself an // instancer because it is a gprim.) The riley geometry prototypes have From 450fd606ca0b735bd6f8af5f72bc992682a75c24 Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Fri, 23 Aug 2024 12:56:20 -0700 Subject: [PATCH 089/202] A small cleanup which removes 1 doc generation warning. (Internal change: 2337936) --- docs/usdfaq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usdfaq.rst b/docs/usdfaq.rst index 0bde721d62..0dcd79a07c 100644 --- a/docs/usdfaq.rst +++ b/docs/usdfaq.rst @@ -694,7 +694,7 @@ Build and Runtime Issues ======================== How do I use the ``TF_DEBUG`` mechanism? -#################################### +######################################## The ``TF_DEBUG`` mechanism is a powerful tool for debugging USD applications. It allows you to enable and disable debugging output at runtime, and to control From 4ee675f832eea2bc957dea430f4e887c8367efd5 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:56:30 -0700 Subject: [PATCH 090/202] vt: Replace boost::optional with std::optional in VtArrayFromPyBuffer (Internal change: 2337943) --- pxr/base/vt/arrayPyBuffer.cpp | 6 +++--- pxr/base/vt/arrayPyBuffer.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pxr/base/vt/arrayPyBuffer.cpp b/pxr/base/vt/arrayPyBuffer.cpp index 1e98068b13..b5a665620e 100644 --- a/pxr/base/vt/arrayPyBuffer.cpp +++ b/pxr/base/vt/arrayPyBuffer.cpp @@ -519,18 +519,18 @@ Vt_WrapArrayFromBuffer(TfPyObjWrapper const &obj) } // anon template -boost::optional > +std::optional > VtArrayFromPyBuffer(TfPyObjWrapper const &obj, std::string *err) { VtArray array; - boost::optional > result; + std::optional > result; if (Vt_ArrayFromBuffer(obj, &array, err)) result = array; return result; } #define INSTANTIATE(unused, elem) \ -template boost::optional > \ +template std::optional > \ VtArrayFromPyBuffer(TfPyObjWrapper const &obj, string *err); TF_PP_SEQ_FOR_EACH(INSTANTIATE, ~, VT_ARRAY_PYBUFFER_TYPES) #undef INSTANTIATE diff --git a/pxr/base/vt/arrayPyBuffer.h b/pxr/base/vt/arrayPyBuffer.h index 56abdc0ceb..07446d95e0 100644 --- a/pxr/base/vt/arrayPyBuffer.h +++ b/pxr/base/vt/arrayPyBuffer.h @@ -12,7 +12,7 @@ #include "pxr/base/vt/array.h" #include "pxr/base/tf/pyObjWrapper.h" -#include +#include PXR_NAMESPACE_OPEN_SCOPE @@ -23,7 +23,7 @@ PXR_NAMESPACE_OPEN_SCOPE /// explanatory message in case of conversion failure. This function may be /// invoked for VtArray where T is one of VT_ARRAY_PYBUFFER_TYPES. template -boost::optional > +std::optional > VtArrayFromPyBuffer(TfPyObjWrapper const &obj, std::string *err=nullptr); /// The set of types for which it's valid to call VtArrayFromPyBuffer(). From 38c0e311e33b3120a2d0160a3a2f5ff6b617d669 Mon Sep 17 00:00:00 2001 From: klucknav Date: Fri, 23 Aug 2024 12:56:48 -0700 Subject: [PATCH 091/202] Fix divide by zero error in MaterialX Shader MaterialX lights have a different struct and only define lights in terms of color and intensity instead of having ambient, diffuse and specular colors. These colors that we get in the shader essentially are pre-multiplied by the intensity color so we approximate the intensity with the max value of the diffuse color channels, and adjust the light color by dividing the diffuse color by that approximated intensity value. This breaks down when there is one light that only has ambient light meaning we calculate the intensity to be 0 and then the light as being 0/0.. As a result the entire object with this material is black. This change guards the calculation of the adjusted light color to make sure we do not divide by zero. (Internal change: 2337962) --- pxr/imaging/hdSt/materialXShaderGen.cpp | 4 +++- .../baseline/shadergen_SScopper.out | 4 +++- .../baseline/shadergen_SSdefault.out | 4 +++- .../baseline/shadergen_SSmarble.out | 4 +++- .../baseline/shadergen_SStextured.out | 4 +++- .../baseline/shadergen_SStextured_bindless.out | 4 +++- .../baseline/shadergen_UsdPSdefault.out | 4 +++- .../baseline/shadergen_UsdPSglass.out | 4 +++- .../baseline/shadergen_UsdPStextured.out | 4 +++- .../baseline/shadergen_texcoord.out | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/pxr/imaging/hdSt/materialXShaderGen.cpp b/pxr/imaging/hdSt/materialXShaderGen.cpp index 30674b5219..3de8ae9872 100644 --- a/pxr/imaging/hdSt/materialXShaderGen.cpp +++ b/pxr/imaging/hdSt/materialXShaderGen.cpp @@ -77,7 +77,9 @@ R"(#if NUM_LIGHTS > 0 // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - $lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + $lightData[u_numActiveLightSources].color = lightColor; $lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SScopper.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SScopper.out index d3d2f80bb4..293e97d25d 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SScopper.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SScopper.out @@ -237,7 +237,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSdefault.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSdefault.out index 4e1ca7551e..6e00379dd0 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSdefault.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSdefault.out @@ -237,7 +237,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSmarble.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSmarble.out index 835ce4f9ca..7c8e3f32a2 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSmarble.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SSmarble.out @@ -262,7 +262,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured.out index c9dc647158..8db11fbf6f 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured.out @@ -287,7 +287,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured_bindless.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured_bindless.out index f551319bbb..1f828f1dc8 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured_bindless.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_SStextured_bindless.out @@ -290,7 +290,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSdefault.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSdefault.out index c40288f4a4..184143842f 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSdefault.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSdefault.out @@ -187,7 +187,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSglass.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSglass.out index 027325ce18..0fa3ad960a 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSglass.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPSglass.out @@ -188,7 +188,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPStextured.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPStextured.out index 4b6b2c580a..cf1733aabe 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPStextured.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_UsdPStextured.out @@ -236,7 +236,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation diff --git a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_texcoord.out b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_texcoord.out index db5084e54a..2c8c34ea4a 100644 --- a/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_texcoord.out +++ b/pxr/imaging/hdSt/testenv/testHdStMaterialXShaderGen/baseline/shadergen_texcoord.out @@ -203,7 +203,9 @@ void mxInit(vec4 Peye, vec3 Neye) // Note: in Storm, diffuse = lightColor * intensity; float intensity = max( max(light.diffuse.r, light.diffuse.g), light.diffuse.b); - u_lightData[u_numActiveLightSources].color = light.diffuse.rgb/intensity; + vec3 lightColor = (intensity == 0.0) + ? light.diffuse.rgb : light.diffuse.rgb/intensity; + u_lightData[u_numActiveLightSources].color = lightColor; u_lightData[u_numActiveLightSources].intensity = intensity; // Attenuation From 15451e6e032622ae509432e98707cf3fe6d50cc9 Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Fri, 23 Aug 2024 12:57:08 -0700 Subject: [PATCH 092/202] Method name coding convention changes (Internal change: 2338029) --- .../usd/testenv/testUsdValidatorMetadata.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py index e349705d18..fb7b7c927a 100644 --- a/pxr/usd/usd/testenv/testUsdValidatorMetadata.py +++ b/pxr/usd/usd/testenv/testUsdValidatorMetadata.py @@ -9,9 +9,8 @@ from pxr import Plug, Sdf, Usd - class TestUsdValidatorMetadata(unittest.TestCase): - def _verify_metadata( + def _VerifyMetadata( self, metadata: Usd.ValidatorMetadata, name="", @@ -28,11 +27,11 @@ def _verify_metadata( self.assertEqual(metadata.plugin, plugin) self.assertEqual(metadata.isSuite, isSuite) - def test_create_default_metadata(self): + def test_CreateDefaultMetadata(self): metadata = Usd.ValidatorMetadata() - self._verify_metadata(metadata) + self._VerifyMetadata(metadata) - def test_create_metadata_with_valid_keyword_args(self): + def test_CreateMetadataWithValidKeywordArgs(self): all_plugins = Plug.Registry().GetAllPlugins() expected_plugin = all_plugins[0] if all_plugins else None valid_metadatas = [ @@ -60,9 +59,9 @@ def test_create_metadata_with_valid_keyword_args(self): for args in valid_metadatas: with self.subTest(name=args["name"]): metadata = Usd.ValidatorMetadata(**args) - self._verify_metadata(metadata, **args) + self._VerifyMetadata(metadata, **args) - def test_create_metadata_with_invalid_keyword_args(self): + def test_CreateMetadataWithInvalidKeywordArgs(self): invalid_metadatas = { "Wrong Name Type": { "name": 123 @@ -89,34 +88,34 @@ def test_create_metadata_with_invalid_keyword_args(self): with self.assertRaises(Exception): Usd.ValidatorMetadata(**args) - def test_metadata_name_immutable(self): + def test_MetadataNameImmutable(self): metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.name = "test" - def test_metadata_doc_immutable(self): + def test_MetadataDocImmutable(self): metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.doc = "doc" - def test_metadata_keywords_immutable(self): + def test_MetadataKeywordsImmutable(self): metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.keywords = ["keywords"] - def test_metadata_schemaTypes_immutable(self): + def test_MetadataSchemaTypesImmutable(self): metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.schemaTypes = "PrimType1" - def test_metadata_plugin_immutable(self): + def test_MetadataPluginImmutable(self): all_plugins = Plug.Registry().GetAllPlugins() expected_plugin = all_plugins[0] if all_plugins else None metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.plugin = expected_plugin - def test_metadata_is_suite_immutable(self): + def test_MetadataIsSuiteImmutable(self): metadata = Usd.ValidatorMetadata() with self.assertRaises(Exception): metadata.isSuite = True From 42268e3d84583dcf99f388934a7daa83da6ae138 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:57:21 -0700 Subject: [PATCH 093/202] python: Remove support for std::auto_ptr std::auto_ptr was removed in C++17 and is no longer provided on Visual Studio 2019 and Xcode. I'm removing this support entirely instead of maintaining support, since OpenUSD is on C++17 and trying to detect when std::auto_ptr happens to be available is not worthwhile. (Internal change: 2338032) --- .../boost/python/detail/is_auto_ptr.hpp | 15 +-- .../boost/python/make_constructor.hpp | 9 -- .../boost/python/object/py_function.hpp | 4 - pxr/external/boost/python/test/auto_ptr.cpp | 107 ------------------ pxr/external/boost/python/test/auto_ptr.py | 105 ----------------- .../boost/python/test/back_reference.cpp | 2 +- .../python/test/copy_ctor_mutates_rhs.cpp | 7 -- pxr/external/boost/python/test/injected.cpp | 2 +- .../boost/python/test/operators_wrapper.cpp | 4 +- pxr/external/boost/python/test/pointee.cpp | 6 - .../boost/python/test/polymorphism2.cpp | 18 +-- .../boost/python/test/polymorphism2.py | 4 - .../python/test/polymorphism2_auto_ptr.cpp | 11 -- .../python/test/polymorphism2_auto_ptr.py | 10 -- .../boost/python/test/select_holder.cpp | 9 -- .../boost/python/test/wrapper_held_type.cpp | 8 +- .../boost/python/to_python_indirect.hpp | 9 -- 17 files changed, 14 insertions(+), 316 deletions(-) delete mode 100644 pxr/external/boost/python/test/auto_ptr.cpp delete mode 100644 pxr/external/boost/python/test/auto_ptr.py delete mode 100644 pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp delete mode 100644 pxr/external/boost/python/test/polymorphism2_auto_ptr.py diff --git a/pxr/external/boost/python/detail/is_auto_ptr.hpp b/pxr/external/boost/python/detail/is_auto_ptr.hpp index 000c590357..7022ce435b 100644 --- a/pxr/external/boost/python/detail/is_auto_ptr.hpp +++ b/pxr/external/boost/python/detail/is_auto_ptr.hpp @@ -10,26 +10,15 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP -# ifndef BOOST_NO_AUTO_PTR -# include "pxr/external/boost/python/detail/is_xxx.hpp" -# include -# endif +#include namespace boost { namespace python { namespace detail { -# if !defined(BOOST_NO_AUTO_PTR) - -BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) - -# else - template -struct is_auto_ptr : mpl::false_ +struct is_auto_ptr : std::false_type { }; -# endif - }}} // namespace boost::python::detail #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP diff --git a/pxr/external/boost/python/make_constructor.hpp b/pxr/external/boost/python/make_constructor.hpp index 05ff4010ae..29fad8a52f 100644 --- a/pxr/external/boost/python/make_constructor.hpp +++ b/pxr/external/boost/python/make_constructor.hpp @@ -50,13 +50,8 @@ namespace detail template void dispatch(U* x, detail::true_) const { -#if defined(BOOST_NO_CXX11_SMART_PTR) - std::auto_ptr owner(x); - dispatch(owner, detail::false_()); -#else std::unique_ptr owner(x); dispatch(std::move(owner), detail::false_()); -#endif } template @@ -68,11 +63,7 @@ namespace detail void* memory = holder::allocate(this->m_self, offsetof(instance_t, storage), sizeof(holder)); try { -#if defined(BOOST_NO_CXX11_SMART_PTR) - (new (memory) holder(x))->install(this->m_self); -#else (new (memory) holder(std::move(x)))->install(this->m_self); -#endif } catch(...) { holder::deallocate(this->m_self, memory); diff --git a/pxr/external/boost/python/object/py_function.hpp b/pxr/external/boost/python/object/py_function.hpp index 9e02eaefe1..bedd5467b1 100644 --- a/pxr/external/boost/python/object/py_function.hpp +++ b/pxr/external/boost/python/object/py_function.hpp @@ -173,11 +173,7 @@ struct py_function } private: -#if defined(BOOST_NO_CXX11_SMART_PTR) - mutable std::auto_ptr m_impl; -#else mutable std::unique_ptr m_impl; -#endif }; }}} // namespace boost::python::objects diff --git a/pxr/external/boost/python/test/auto_ptr.cpp b/pxr/external/boost/python/test/auto_ptr.cpp deleted file mode 100644 index 94fef2aa2c..0000000000 --- a/pxr/external/boost/python/test/auto_ptr.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// Copyright 2024 Pixar -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// -// Copyright David Abrahams 2002. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, -// boost::python will generate simplified docstrings that break the associated -// test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES - -#include "pxr/external/boost/python/module.hpp" -#include "test_class.hpp" -#include "pxr/external/boost/python/class.hpp" -#include "pxr/external/boost/python/docstring_options.hpp" -#include "pxr/external/boost/python/extract.hpp" -#include "pxr/external/boost/python/def.hpp" -#include "pxr/external/boost/python/implicit.hpp" - -#include - -#include - -using namespace boost::python; - -typedef test_class<> X; - -struct Y : X -{ - Y(int n) : X(n) {}; -}; - -int look(std::auto_ptr const& x) -{ - return (x.get()) ? x->value() : -1; -} - -int steal(std::auto_ptr x) -{ - return x->value(); -} - -int maybe_steal(std::auto_ptr& x, bool doit) -{ - int n = x->value(); - if (doit) - x.release(); - return n; -} - -std::auto_ptr make() -{ - return std::auto_ptr(new X(77)); -} - -std::auto_ptr callback(object f) -{ - std::auto_ptr x(new X(77)); - return call >(f.ptr(), x); -} - -std::auto_ptr extract_(object o) -{ - return extract&>(o) -#if BOOST_MSVC <= 1300 - () -#endif - ; -} - -BOOST_PYTHON_MODULE(auto_ptr_ext) -{ - // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those - // signatures by default. - docstring_options doc_options; - doc_options.enable_py_signatures(); - - class_, boost::noncopyable>("X", init()) - .def("value", &X::value) - ; - - class_, bases, boost::noncopyable>("Y", init()) - ; - - // VC6 auto_ptrs do not have converting constructors -#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, < 306) - scope().attr("broken_auto_ptr") = 1; -#else - scope().attr("broken_auto_ptr") = 0; - implicitly_convertible, std::auto_ptr >(); -#endif - - def("look", look); - def("steal", steal); - def("maybe_steal", maybe_steal); - def("make", make); - def("callback", callback); - def("extract", extract_); -} - -#include "module_tail.cpp" - diff --git a/pxr/external/boost/python/test/auto_ptr.py b/pxr/external/boost/python/test/auto_ptr.py deleted file mode 100644 index 7e76ff93d1..0000000000 --- a/pxr/external/boost/python/test/auto_ptr.py +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright 2024 Pixar -# Licensed under the terms set forth in the LICENSE.txt file available at -# https://openusd.org/license. -# -# Copyright David Abrahams 2004. Distributed under the Boost -# Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -''' ->>> from auto_ptr_ext import * ->>> x = X(42) ->>> x.value() -42 ->>> look(x), look(x) -(42, 42) - ->>> maybe_steal(x, 0) -42 ->>> look(x) -42 - ->>> maybe_steal(x, 1) -42 ->>> broken_auto_ptr and -1 or look(x) --1 - ->>> x = X(69) ->>> steal(x) -69 ->>> broken_auto_ptr and -1 or look(x) --1 - ->>> if not broken_auto_ptr: -... try: x.value() -... except TypeError: pass -... else: print('expected a TypeError exception') - ->>> x = make() ->>> look(x) -77 - ->>> z = callback(lambda z: z) ->>> z.value() -77 - ->>> extract(x).value() -77 - -# -# Test derived to base conversions -# - ->>> y = Y(42) ->>> y.value() -42 - ->>> try: maybe_steal(y, 0) -... except TypeError: pass -... else: print('expected a TypeError exception') - ->>> y.value() -42 - ->>> broken_auto_ptr and 42 or steal(y) -42 - ->>> if not broken_auto_ptr: -... try: y.value() -... except TypeError: pass -... else: print('expected a TypeError exception') - ->>> print(look.__doc__.splitlines()[1]) -look( (X)arg1) -> int : - ->>> print(steal.__doc__.splitlines()[1]) -steal( (X)arg1) -> int : - ->>> print(maybe_steal.__doc__.splitlines()[1]) -maybe_steal( (X)arg1, (bool)arg2) -> int : - ->>> print(make.__doc__.splitlines()[1]) -make() -> X : - ->>> print(callback.__doc__.splitlines()[1]) -callback( (object)arg1) -> X : - ->>> print(extract.__doc__.splitlines()[1]) -extract( (object)arg1) -> X : - -''' - -def run(args = None): - import sys - import doctest - - if args is not None: - sys.argv = args - return doctest.testmod(sys.modules.get(__name__)) - -if __name__ == '__main__': - print("running...") - import sys - status = run()[0] - if (status == 0): print("Done.") - sys.exit(status) diff --git a/pxr/external/boost/python/test/back_reference.cpp b/pxr/external/boost/python/test/back_reference.cpp index b2f4c8bee5..422ca34ba9 100644 --- a/pxr/external/boost/python/test/back_reference.cpp +++ b/pxr/external/boost/python/test/back_reference.cpp @@ -117,7 +117,7 @@ BOOST_PYTHON_MODULE(back_reference_ext) .def("set", &Y::set) ; - class_ >("Z", init()) + class_ >("Z", init()) .def("value", &Z::value) .def("set", &Z::set) ; diff --git a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp index 2d64ff1819..7eb0d3cf78 100644 --- a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp +++ b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp @@ -12,17 +12,10 @@ #include #include -struct foo -{ - operator std::auto_ptr&() const; -}; - int main() { using namespace boost::python::detail; BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); - BOOST_STATIC_ASSERT(copy_ctor_mutates_rhs >::value); BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); - BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); return 0; } diff --git a/pxr/external/boost/python/test/injected.cpp b/pxr/external/boost/python/test/injected.cpp index 00dc030fdc..cf0f6f9645 100644 --- a/pxr/external/boost/python/test/injected.cpp +++ b/pxr/external/boost/python/test/injected.cpp @@ -22,7 +22,7 @@ typedef test_class<> X; X* empty() { return new X(1000); } -std::auto_ptr sum(int a, int b) { return std::auto_ptr(new X(a+b)); } +std::shared_ptr sum(int a, int b) { return std::shared_ptr(new X(a+b)); } boost::shared_ptr product(int a, int b, int c) { diff --git a/pxr/external/boost/python/test/operators_wrapper.cpp b/pxr/external/boost/python/test/operators_wrapper.cpp index 57d3ed815f..acb54d5db4 100644 --- a/pxr/external/boost/python/test/operators_wrapper.cpp +++ b/pxr/external/boost/python/test/operators_wrapper.cpp @@ -41,7 +41,7 @@ BOOST_PYTHON_MODULE( operators_wrapper_ext ) ; scope().attr("v") = vector(); - std::auto_ptr dp(new dvector); - register_ptr_to_python< std::auto_ptr >(); + std::shared_ptr dp(new dvector); + register_ptr_to_python< std::shared_ptr >(); scope().attr("d") = dp; } diff --git a/pxr/external/boost/python/test/pointee.cpp b/pxr/external/boost/python/test/pointee.cpp index 69485f9890..deaa24b8a7 100644 --- a/pxr/external/boost/python/test/pointee.cpp +++ b/pxr/external/boost/python/test/pointee.cpp @@ -17,12 +17,6 @@ struct A; int main() { - BOOST_STATIC_ASSERT( - (boost::python::detail::is_same< - boost::python::pointee >::type - , char** - >::value)); - BOOST_STATIC_ASSERT( (boost::python::detail::is_same< boost::python::pointee >::type diff --git a/pxr/external/boost/python/test/polymorphism2.cpp b/pxr/external/boost/python/test/polymorphism2.cpp index d124ebda70..524e73e519 100644 --- a/pxr/external/boost/python/test/polymorphism2.cpp +++ b/pxr/external/boost/python/test/polymorphism2.cpp @@ -20,12 +20,6 @@ #include -#ifdef HELD_BY_AUTO_PTR -# define HELD_PTR(X) , std::auto_ptr< X > -#else -# define HELD_PTR(X) -#endif - using namespace boost::python; struct P @@ -136,23 +130,19 @@ C& getCCppObj () A* pass_a(A* x) { return x; } -#ifdef HELD_BY_AUTO_PTR -BOOST_PYTHON_MODULE_INIT(polymorphism2_auto_ptr_ext) -#else BOOST_PYTHON_MODULE_INIT(polymorphism2_ext) -#endif { - class_("A") + class_("A") .def("f", &A::f, &ACallback::default_f) ; def("getBCppObj", getBCppObj, return_value_policy()); - class_,boost::noncopyable>("C") + class_,boost::noncopyable>("C") .def("f", &C::f) ; - class_,boost::noncopyable>("D") + class_,boost::noncopyable>("D") .def("f", &D::f) .def("g", &D::g) ; @@ -169,7 +159,7 @@ BOOST_PYTHON_MODULE_INIT(polymorphism2_ext) .def("f", pure_virtual(&P::f)) ; - class_ >("Q") + class_ >("Q") .def("g", &P::g) // make sure virtual inheritance doesn't interfere ; } diff --git a/pxr/external/boost/python/test/polymorphism2.py b/pxr/external/boost/python/test/polymorphism2.py index c604f001d7..cb3d289c4a 100644 --- a/pxr/external/boost/python/test/polymorphism2.py +++ b/pxr/external/boost/python/test/polymorphism2.py @@ -89,11 +89,7 @@ def test(): sys.argv = [ x for x in sys.argv if x != '--broken-auto-ptr' ] unittest.main() -# This nasty hack basically says that if we're loaded by another module, we'll -# be testing polymorphism2_auto_ptr_ext instead of polymorphism2_ext. if __name__ == "__main__": from polymorphism2_ext import * test() -else: - from polymorphism2_auto_ptr_ext import * diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp b/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp deleted file mode 100644 index c5cfc21a0c..0000000000 --- a/pxr/external/boost/python/test/polymorphism2_auto_ptr.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// -// Copyright 2024 Pixar -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// -// Copyright David Abrahams 2005. Distributed under the Boost -// Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#define HELD_BY_AUTO_PTR -#include "polymorphism2.cpp" diff --git a/pxr/external/boost/python/test/polymorphism2_auto_ptr.py b/pxr/external/boost/python/test/polymorphism2_auto_ptr.py deleted file mode 100644 index c56915e094..0000000000 --- a/pxr/external/boost/python/test/polymorphism2_auto_ptr.py +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright 2024 Pixar -# Licensed under the terms set forth in the LICENSE.txt file available at -# https://openusd.org/license. -# -# Copyright David Abrahams 2005. Distributed under the Boost -# Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -import polymorphism2 -polymorphism2.test() diff --git a/pxr/external/boost/python/test/select_holder.cpp b/pxr/external/boost/python/test/select_holder.cpp index 8a22913bc3..77ca55f477 100644 --- a/pxr/external/boost/python/test/select_holder.cpp +++ b/pxr/external/boost/python/test/select_holder.cpp @@ -67,15 +67,6 @@ int test_main(int, char * []) assert_holder >(); - assert_holder - ,pointer_holder,Base> >(); - - assert_holder - ,pointer_holder_back_reference,Base> >(); - - assert_holder - ,pointer_holder_back_reference,BR> > (); - return 0; } diff --git a/pxr/external/boost/python/test/wrapper_held_type.cpp b/pxr/external/boost/python/test/wrapper_held_type.cpp index 53a38e1c93..e9c8639ab9 100644 --- a/pxr/external/boost/python/test/wrapper_held_type.cpp +++ b/pxr/external/boost/python/test/wrapper_held_type.cpp @@ -25,12 +25,12 @@ struct data } }; -std::auto_ptr create_data() +std::shared_ptr create_data() { - return std::auto_ptr( new data ); + return std::shared_ptr( new data ); } -void do_nothing( std::auto_ptr& ){} +void do_nothing( std::shared_ptr& ){} namespace bp = boost::python; @@ -64,7 +64,7 @@ struct data_wrapper : data, bp::wrapper< data > BOOST_PYTHON_MODULE(wrapper_held_type_ext) { - bp::class_< data_wrapper, std::auto_ptr< data > >( "data" ) + bp::class_< data_wrapper, std::shared_ptr< data > >( "data" ) .def( "id", &data::id, &::data_wrapper::default_id ); bp::def( "do_nothing", &do_nothing ); diff --git a/pxr/external/boost/python/to_python_indirect.hpp b/pxr/external/boost/python/to_python_indirect.hpp index 96353b7515..4def299ecc 100644 --- a/pxr/external/boost/python/to_python_indirect.hpp +++ b/pxr/external/boost/python/to_python_indirect.hpp @@ -83,16 +83,7 @@ namespace detail template static PyObject* execute(T* p) { - // can't use auto_ptr with Intel 5 and VC6 Dinkum library - // for some reason. We get link errors against the auto_ptr - // copy constructor. -# if defined(__ICL) && __ICL < 600 - typedef boost::shared_ptr smart_pointer; -# elif defined(BOOST_NO_CXX11_SMART_PTR) - typedef std::auto_ptr smart_pointer; -# else typedef std::unique_ptr smart_pointer; -# endif typedef objects::pointer_holder holder_t; smart_pointer ptr(const_cast(p)); From 4d7f8edc0b922ebc7828cd3a2fae18208dae938b Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 12:57:34 -0700 Subject: [PATCH 094/202] cmake: Add public helper function for setting rpaths on a target Future changes will update clients in Public.cmake and Private.cmake to use this helper instead of directly calling the individual rpath utilities. (Internal change: 2338111) --- cmake/macros/Public.cmake | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake index 294532545a..3951c51364 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -207,6 +207,7 @@ endfunction() function(pxr_library NAME) set(options DISABLE_PRECOMPILED_HEADERS + IS_SCHEMA_LIBRARY ) set(oneValueArgs TYPE @@ -270,6 +271,36 @@ function(pxr_library NAME) endif() endif() + # If this is a schema library, add schema classes + if (args_IS_SCHEMA_LIBRARY) + set(filePath "generatedClasses.txt") + + # Register a dependency so that cmake will regenerate the build + # system if generatedClasses.txt changes + set_property( + DIRECTORY + APPEND + PROPERTY CMAKE_CONFIGURE_DEPENDS + ${filePath} + ) + + # Read public classes + file(STRINGS ${filePath} publicClasses REGEX "^[^#]") + list(FILTER publicClasses EXCLUDE REGEX "(\.cpp)+") + + # Read wrapClasses + file (STRINGS ${filePath} wrapClasses REGEX "(\.cpp)+") + + # Append schema classes and wrap files + list(APPEND args_PUBLIC_CLASSES ${publicClasses}) + list(APPEND args_PYMODULE_CPPFILES ${wrapClasses}) + + # Add schema resource files + list(APPEND args_RESOURCE_FILES "generatedSchema.usda") + list(APPEND args_RESOURCE_FILES "schema.usda:${NAME}/schema.usda") + list(APPEND args_RESOURCE_FILES "plugInfo.json") + endif() + # Collect libraries. if(NOT args_TYPE STREQUAL "PLUGIN") get_property(help CACHE PXR_ALL_LIBS PROPERTY HELPSTRING) @@ -1331,3 +1362,21 @@ function(pxr_docs_only_dir NAME) ) endif() endfunction() # pxr_docs_only_dir + +# Sets rpaths for the specified TARGET to the given RPATHS. The target's +# runtime destination directory is given by ORIGIN. If ORIGIN is not +# absolute it is assumed to be relative to CMAKE_INSTALL_PREFIX. +function(pxr_set_rpaths_for_target TARGET) + set(oneValueArgs ORIGIN) + set(multiValueArgs RPATHS) + cmake_parse_arguments(args "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + _pxr_init_rpath(rpath ${args_ORIGIN}) + + foreach(path IN LISTS args_RPATHS) + _pxr_add_rpath(rpath ${path}) + endforeach() + + _pxr_install_rpath(rpath ${TARGET}) + +endfunction() # pxr_set_rpaths_for_target From a52521a0a94dc8ad2bf4049167d3f41712d19c6d Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Fri, 23 Aug 2024 13:52:14 -0700 Subject: [PATCH 095/202] squash with 4d7f8edc0b922ebc7828cd3a2fae18208dae938b --- cmake/macros/Public.cmake | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake index 3951c51364..a794bbf3d9 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -207,7 +207,6 @@ endfunction() function(pxr_library NAME) set(options DISABLE_PRECOMPILED_HEADERS - IS_SCHEMA_LIBRARY ) set(oneValueArgs TYPE @@ -271,36 +270,6 @@ function(pxr_library NAME) endif() endif() - # If this is a schema library, add schema classes - if (args_IS_SCHEMA_LIBRARY) - set(filePath "generatedClasses.txt") - - # Register a dependency so that cmake will regenerate the build - # system if generatedClasses.txt changes - set_property( - DIRECTORY - APPEND - PROPERTY CMAKE_CONFIGURE_DEPENDS - ${filePath} - ) - - # Read public classes - file(STRINGS ${filePath} publicClasses REGEX "^[^#]") - list(FILTER publicClasses EXCLUDE REGEX "(\.cpp)+") - - # Read wrapClasses - file (STRINGS ${filePath} wrapClasses REGEX "(\.cpp)+") - - # Append schema classes and wrap files - list(APPEND args_PUBLIC_CLASSES ${publicClasses}) - list(APPEND args_PYMODULE_CPPFILES ${wrapClasses}) - - # Add schema resource files - list(APPEND args_RESOURCE_FILES "generatedSchema.usda") - list(APPEND args_RESOURCE_FILES "schema.usda:${NAME}/schema.usda") - list(APPEND args_RESOURCE_FILES "plugInfo.json") - endif() - # Collect libraries. if(NOT args_TYPE STREQUAL "PLUGIN") get_property(help CACHE PXR_ALL_LIBS PROPERTY HELPSTRING) From 6bd7c3b509a7d8b2de4e574e4100de6f8cf55db3 Mon Sep 17 00:00:00 2001 From: sunyab Date: Fri, 23 Aug 2024 13:00:47 -0700 Subject: [PATCH 096/202] python: Enable builds and tests At the moment, this library is the same as boost::python with just the minimal changes necessary to accommodate its inclusion in the source tree and to get builds and tests passing on all platforms. Note that this library is not being used anywhere yet. - Added CMakeLists.txt to build pxr/external/boost/python along with the boost::python unit tests. - Modified test/pyrun.py script used by boost::python's tests to accommodate our build/install structure. - Disabled unit tests related to the return_opaque_pointer return value policy on Windows. This functionality appears to have pre-existing issues on Windows that causes errors when loading the associated Python modules. I was able to reproduce these errors using a standard boost::python build as well. We don't use this in OpenUSD, so disabling these tests seem fine in the meantime. (Internal change: 2338298) --- pxr/CMakeLists.txt | 1 + pxr/external/CMakeLists.txt | 1 + pxr/external/boost/CMakeLists.txt | 30 ++ pxr/external/boost/build-workaround.cpp | 13 + pxr/external/boost/python/CMakeLists.txt | 603 +++++++++++++++++++++++ pxr/external/boost/python/test/pyrun.py | 28 +- 6 files changed, 673 insertions(+), 3 deletions(-) create mode 100644 pxr/external/CMakeLists.txt create mode 100644 pxr/external/boost/CMakeLists.txt create mode 100644 pxr/external/boost/build-workaround.cpp create mode 100644 pxr/external/boost/python/CMakeLists.txt diff --git a/pxr/CMakeLists.txt b/pxr/CMakeLists.txt index 00cafd3d98..9a1476305a 100644 --- a/pxr/CMakeLists.txt +++ b/pxr/CMakeLists.txt @@ -1,5 +1,6 @@ pxr_core_prologue() +add_subdirectory(external) add_subdirectory(base) add_subdirectory(usd) diff --git a/pxr/external/CMakeLists.txt b/pxr/external/CMakeLists.txt new file mode 100644 index 0000000000..8e7d1975f0 --- /dev/null +++ b/pxr/external/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(boost) diff --git a/pxr/external/boost/CMakeLists.txt b/pxr/external/boost/CMakeLists.txt new file mode 100644 index 0000000000..0cb914e393 --- /dev/null +++ b/pxr/external/boost/CMakeLists.txt @@ -0,0 +1,30 @@ +set(PXR_PREFIX pxr/external) +set(PXR_PACKAGE boost) + +# This subdirectory currently only contains Python-related +# libraries, so skip it entirely if Python support is disabled. +if (NOT PXR_ENABLE_PYTHON_SUPPORT OR NOT TARGET python_modules) + return() +endif() + +pxr_library(boost + PUBLIC_HEADERS + python.hpp + + CPPFILES + # Workaround lack of build support for header-only libs. + build-workaround.cpp + + DISABLE_PRECOMPILED_HEADERS +) + +# Ensure symbol in build-workaround.cpp is exported on Windows, +# otherwise the build will error out at link time because no +# .lib file will be generated. Using this setting is OK because +# we only expect there to be one exportable symbol in this library. +set_target_properties(boost + PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS TRUE +) + +add_subdirectory(python) diff --git a/pxr/external/boost/build-workaround.cpp b/pxr/external/boost/build-workaround.cpp new file mode 100644 index 0000000000..23288e50dd --- /dev/null +++ b/pxr/external/boost/build-workaround.cpp @@ -0,0 +1,13 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +// This is required since our build does not currently support header-only +// libraries. Without this the headers install okay, but other libs that try to +// use this library will fail to link. By adding this, an "empty" .so gets +// built and other libs can link it. + +int __pxr_boost_workaround__; diff --git a/pxr/external/boost/python/CMakeLists.txt b/pxr/external/boost/python/CMakeLists.txt new file mode 100644 index 0000000000..d7d0a2798d --- /dev/null +++ b/pxr/external/boost/python/CMakeLists.txt @@ -0,0 +1,603 @@ +set(PXR_PREFIX pxr/external/boost) +set(PXR_PACKAGE python) + +# XXX: +# Elide this library in monolithic builds for now. Otherwise, we'll +# get multiple symbol definitions because the build will embed this +# library *and* link against boost::python. We should be able to +# remove this when the rest of the build solely links against this +# library. +if (PXR_BUILD_MONOLITHIC) + return() +endif() + +pxr_library(python + LIBRARIES + boost + Python3::Python + + INCLUDE_DIRS + # Ideally we'd use the modern Boost::boost or Boost::headers + # targets in the LIBRARIES list above. However, Boost::boost + # doesn't publish INTERFACE_INCLUDE_DIRECTORIES, which breaks + # _pxr_target_link_libraries in monolithic builds, and + # Boost::headers is only available in CMake 3.15+. + ${Boost_INCLUDE_DIRS} + + PUBLIC_HEADERS + arg_from_python.hpp + args.hpp + args_fwd.hpp + back_reference.hpp + base_type_traits.hpp + bases.hpp + borrowed.hpp + call.hpp + call_method.hpp + cast.hpp + class.hpp + class_fwd.hpp + converter/arg_from_python.hpp + converter/arg_to_python.hpp + converter/arg_to_python_base.hpp + converter/as_to_python_function.hpp + converter/builtin_converters.hpp + converter/constructor_function.hpp + converter/context_result_converter.hpp + converter/convertible_function.hpp + converter/from_python.hpp + converter/implicit.hpp + converter/obj_mgr_arg_from_python.hpp + converter/object_manager.hpp + converter/pointer_type_id.hpp + converter/pyobject_traits.hpp + converter/pyobject_type.hpp + converter/pytype_function.hpp + converter/pytype_object_mgr_traits.hpp + converter/registered.hpp + converter/registered_pointee.hpp + converter/registrations.hpp + converter/registry.hpp + converter/return_from_python.hpp + converter/rvalue_from_python_data.hpp + converter/shared_ptr_deleter.hpp + converter/shared_ptr_from_python.hpp + converter/shared_ptr_to_python.hpp + converter/to_python_function_type.hpp + copy_const_reference.hpp + copy_non_const_reference.hpp + data_members.hpp + def.hpp + def_visitor.hpp + default_call_policies.hpp + detail/aix_init_module.hpp + detail/api_placeholder.hpp + detail/borrowed_ptr.hpp + detail/caller.hpp + detail/config.hpp + detail/construct.hpp + detail/convertible.hpp + detail/copy_ctor_mutates_rhs.hpp + detail/cv_category.hpp + detail/dealloc.hpp + detail/decorated_type_id.hpp + detail/decref_guard.hpp + detail/def_helper.hpp + detail/def_helper_fwd.hpp + detail/defaults_def.hpp + detail/defaults_gen.hpp + detail/dependent.hpp + detail/destroy.hpp + detail/enable_if.hpp + detail/exception_handler.hpp + detail/force_instantiate.hpp + detail/if_else.hpp + detail/indirect_traits.hpp + detail/invoke.hpp + detail/is_auto_ptr.hpp + detail/is_shared_ptr.hpp + detail/is_wrapper.hpp + detail/is_xxx.hpp + detail/make_keyword_range_fn.hpp + detail/make_tuple.hpp + detail/map_entry.hpp + detail/mpl_lambda.hpp + detail/msvc_typeinfo.hpp + detail/none.hpp + detail/not_specified.hpp + detail/nullary_function_adaptor.hpp + detail/operator_id.hpp + detail/overloads_fwd.hpp + detail/pointee.hpp + detail/prefix.hpp + detail/preprocessor.hpp + detail/python_type.hpp + detail/raw_pyobject.hpp + detail/referent_storage.hpp + detail/result.hpp + detail/scope.hpp + detail/sfinae.hpp + detail/signature.hpp + detail/string_literal.hpp + detail/target.hpp + detail/translate_exception.hpp + detail/type_list.hpp + detail/type_list_impl.hpp + detail/type_traits.hpp + detail/unwind_type.hpp + detail/unwrap_type_id.hpp + detail/unwrap_wrapper.hpp + detail/value_arg.hpp + detail/value_is_shared_ptr.hpp + detail/value_is_xxx.hpp + detail/void_ptr.hpp + detail/void_return.hpp + detail/wrap_python.hpp + detail/wrapper_base.hpp + dict.hpp + docstring_options.hpp + enum.hpp + errors.hpp + exception_translator.hpp + exec.hpp + extract.hpp + handle.hpp + handle_fwd.hpp + has_back_reference.hpp + implicit.hpp + import.hpp + init.hpp + instance_holder.hpp + iterator.hpp + list.hpp + long.hpp + lvalue_from_pytype.hpp + make_constructor.hpp + make_function.hpp + manage_new_object.hpp + module.hpp + module_init.hpp + object/add_to_namespace.hpp + object/class.hpp + object/class_detail.hpp + object/class_metadata.hpp + object/class_wrapper.hpp + object/enum_base.hpp + object/find_instance.hpp + object/forward.hpp + object/function.hpp + object/function_doc_signature.hpp + object/function_handle.hpp + object/function_object.hpp + object/inheritance.hpp + object/inheritance_query.hpp + object/instance.hpp + object/iterator.hpp + object/iterator_core.hpp + object/life_support.hpp + object/make_holder.hpp + object/make_instance.hpp + object/make_ptr_instance.hpp + object/pickle_support.hpp + object/pointer_holder.hpp + object/py_function.hpp + object/stl_iterator_core.hpp + object/value_holder.hpp + object/value_holder_fwd.hpp + object.hpp + object_attributes.hpp + object_call.hpp + object_core.hpp + object_fwd.hpp + object_items.hpp + object_operators.hpp + object_protocol.hpp + object_protocol_core.hpp + object_slices.hpp + opaque_pointer_converter.hpp + operators.hpp + other.hpp + overloads.hpp + override.hpp + pointee.hpp + proxy.hpp + ptr.hpp + pure_virtual.hpp + raw_function.hpp + refcount.hpp + reference_existing_object.hpp + register_ptr_to_python.hpp + return_arg.hpp + return_by_value.hpp + return_internal_reference.hpp + return_opaque_pointer.hpp + return_value_policy.hpp + scope.hpp + self.hpp + signature.hpp + slice.hpp + slice_nil.hpp + ssize_t.hpp + stl_iterator.hpp + str.hpp + suite/indexing/container_utils.hpp + suite/indexing/detail/indexing_suite_detail.hpp + suite/indexing/indexing_suite.hpp + suite/indexing/map_indexing_suite.hpp + suite/indexing/vector_indexing_suite.hpp + tag.hpp + to_python_converter.hpp + to_python_indirect.hpp + to_python_value.hpp + tuple.hpp + type_id.hpp + with_custodian_and_ward.hpp + wrapper.hpp + + # These source files are for boost::python's numpy extension. + # We do not build these because we don't use this extension + # and don't want to add a numpy dependency to the build. + # + # numpy/config.hpp + # numpy/dtype.hpp + # numpy/internal.hpp + # numpy/invoke_matching.hpp + # numpy/matrix.hpp + # numpy/ndarray.hpp + # numpy/numpy_object_mgr_traits.hpp + # numpy/scalars.hpp + # numpy/ufunc.hpp + # numpy.hpp + + CPPFILES + src/converter/arg_to_python_base.cpp + src/converter/builtin_converters.cpp + src/converter/from_python.cpp + src/converter/registry.cpp + src/converter/type_id.cpp + src/dict.cpp + src/errors.cpp + src/exec.cpp + src/import.cpp + src/list.cpp + src/long.cpp + src/module.cpp + src/object/class.cpp + src/object/enum.cpp + src/object/function.cpp + src/object/function_doc_signature.cpp + src/object/inheritance.cpp + src/object/iterator.cpp + src/object/life_support.cpp + src/object/pickle_support.cpp + src/object/stl_iterator.cpp + src/object_operators.cpp + src/object_protocol.cpp + src/slice.cpp + src/str.cpp + src/tuple.cpp + src/wrapper.cpp + + # These source files are for boost::python's numpy extension. + # We do not build these because we don't use this extension + # and don't want to add a numpy dependency to the build. + # + # src/numpy/dtype.cpp + # src/numpy/matrix.cpp + # src/numpy/ndarray.cpp + # src/numpy/numpy.cpp + # src/numpy/scalars.cpp + # src/numpy/ufunc.cpp + + DISABLE_PRECOMPILED_HEADERS +) + +# Add BOOST_PYTHON_SOURCE when building this library to ensure symbols +# decorated with BOOST_PYTHON_DECL are exported. +target_compile_definitions(python + PRIVATE BOOST_PYTHON_SOURCE) + +#### +# Helper functions for unit tests +#### + +function(boost_python_cpp_target TARGET_NAME) + set(options IS_LIBRARY) + cmake_parse_arguments(opts "${options}" "" "" ${ARGN}) + + if (opts_IS_LIBRARY) + add_library(${TARGET_NAME} SHARED) + set(destination "tests/lib") + else() + add_executable(${TARGET_NAME}) + set(destination "tests") + endif() + + target_link_libraries(${TARGET_NAME} python) + target_include_directories(${TARGET_NAME} + PRIVATE $ + ) + + # Setup RPATH so our python library under CMAKE_INSTALL_PREFIX is + # found at runtime. + pxr_set_rpaths_for_target(${TARGET_NAME} + ORIGIN ${destination} + RPATHS "${CMAKE_INSTALL_PREFIX}/lib" + ) + + install( + TARGETS ${TARGET_NAME} + DESTINATION ${destination} + ) +endfunction() + +function(boost_python_test_module TEST_NAME) + set(oneValueArgs MODULE_NAME) + set(multiValueArgs MODULE_CPPFILES) + cmake_parse_arguments(module "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT module_MODULE_NAME) + set(module_MODULE_NAME "${TEST_NAME}_ext") + endif() + + if (NOT module_MODULE_CPPFILES) + set(module_MODULE_CPPFILES "test/${TEST_NAME}.cpp") + endif() + + boost_python_cpp_target(${module_MODULE_NAME} IS_LIBRARY) + target_sources(${module_MODULE_NAME} PRIVATE ${module_MODULE_CPPFILES}) + + # Python modules must be suffixed with .pyd on Windows and .so on Linux/Mac + if(WIN32) + set(suffix ".pyd") + else() + set(suffix ".so") + endif() + + set_target_properties(${module_MODULE_NAME} + PROPERTIES + # Python modules must not have any prefixes like "lib" + PREFIX "" + SUFFIX ${suffix} + ) +endfunction() # boost_python_test_module + +function(boost_python_cpp_test_lib TEST_NAME) + set(lib "${TEST_NAME}") + set(cppfiles "test/${TEST_NAME}.cpp") + + boost_python_cpp_target(${lib} IS_LIBRARY) + target_sources(${lib} PRIVATE ${cppfiles}) +endfunction() # boost_python_cpp_test_lib + +function(boost_python_test TEST_NAME) + set(oneValueArgs SCRIPT) + cmake_parse_arguments(test "" "${oneValueArgs}" "" ${ARGN}) + + if (NOT test_SCRIPT) + set(test_SCRIPT "test/${TEST_NAME}.py") + endif() + + get_filename_component(installed_script "${test_SCRIPT}" NAME_WE) + + boost_python_test_module(${TEST_NAME} ${ARGN}) + pxr_test_scripts("${test_SCRIPT}") + pxr_register_test("python_${TEST_NAME}" + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/pyrun ${installed_script}" + ) +endfunction() # boost_python_test + +function(boost_python_cpp_test TEST_NAME) + set(multiValueArgs CPPFILES COMMAND_ARGS) + cmake_parse_arguments(test "" "" "${multiValueArgs}" ${ARGN}) + + set(program "${TEST_NAME}") + + if (NOT test_CPPFILES) + set(test_CPPFILES "test/${TEST_NAME}.cpp") + endif() + + boost_python_cpp_target(${program}) + target_sources(${program} PRIVATE ${test_CPPFILES}) + + pxr_register_test("python_${TEST_NAME}" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/${program} ${test_COMMAND_ARGS}" + ) +endfunction() # boost_python_cpp_test + +#### +# Unit tests from boost::python +# These test definitions are ported from test/Jamfile +#### + +pxr_test_scripts( + test/pyrun.py +) + +boost_python_test("injected") +boost_python_test("properties") +boost_python_test("return_arg") +boost_python_test("staticmethod") +boost_python_test("boost_shared_ptr") +boost_python_test("shared_ptr") +boost_python_test("enable_shared_from_this") +boost_python_test("andreas_beyer") +boost_python_test("wrapper_held_type") + +boost_python_test("polymorphism") +boost_python_test("polymorphism2") +boost_python_test("minimal") +boost_python_test("args") +boost_python_test("raw_ctor") + +boost_python_test("enum" + SCRIPT "test/test_enum.py" + MODULE_CPPFILES "test/enum_ext.cpp" +) + +boost_python_test("exception_translator") + +boost_python_test("pearu1" + SCRIPT "test/test_cltree.py" + MODULE_NAME "cltree" + MODULE_CPPFILES "test/cltree.cpp" +) + +boost_python_test("try" + SCRIPT "test/newtest.py" + MODULE_NAME "m1" + MODULE_CPPFILES "test/m1.cpp" +) +boost_python_test_module("try" + MODULE_NAME "m2" + MODULE_CPPFILES "test/m2.cpp" +) + +boost_python_test("const_argument") + +boost_python_test("keywords" + SCRIPT "test/keywords_test.py" + MODULE_NAME "keywords" + MODULE_CPPFILES "test/keywords.cpp" +) + +boost_python_test("builtin_converters" + SCRIPT "test/test_builtin_converters.py" + MODULE_CPPFILES "test/builtin_converters.cpp" +) + +boost_python_test("test_pointer_adoption") +boost_python_test("operators") +boost_python_test("operators_wrapper") +boost_python_test("callbacks") +boost_python_test("defaults") +boost_python_test("object") +boost_python_test("class") +boost_python_test("aligned_class") +boost_python_test("list") +boost_python_test("long") +boost_python_test("dict") +boost_python_test("tuple") +boost_python_test("str") +boost_python_test("slice") +boost_python_test("virtual_functions") +boost_python_test("back_reference") +boost_python_test("implicit") +boost_python_test("data_members") +boost_python_test("ben_scott1") +boost_python_test("bienstman1") +boost_python_test("bienstman2") +boost_python_test("bienstman3") +boost_python_test("multi_arg_constructor") + +boost_python_test("iterator") +boost_python_test_module("iterator" + MODULE_NAME "input_iterator" + MODULE_CPPFILES "test/input_iterator.cpp" +) + +boost_python_test("stl_iterator") +boost_python_test("extract") + +# XXX: +# On Windows the return_opaque_pointer return policy exercised by these +# tests causes an error when loading the Python module: +# +# DLL load failed: A dynamic link library (DLL) initialization routine failed. +# +# This appears to be a pre-existing issue in boost::python. These tests are +# disabled for now. + +if (NOT WIN32) + boost_python_test("crossmod_opaque" + MODULE_NAME "crossmod_opaque_a" + MODULE_CPPFILES "test/crossmod_opaque_a.cpp" + ) + boost_python_test_module("crossmod_opaque" + MODULE_NAME "crossmod_opaque_b" + MODULE_CPPFILES "test/crossmod_opaque_b.cpp" + ) + + boost_python_test("opaque") + boost_python_test("voidptr") +endif() + +boost_python_test("pickle1") +boost_python_test("pickle2") +boost_python_test("pickle3") +boost_python_test("pickle4") +boost_python_test("nested") +boost_python_test("docstring") +boost_python_test("pytype_function") +boost_python_test("vector_indexing_suite") +boost_python_test("pointer_vector") + +boost_python_test("map_indexing_suite" + MODULE_CPPFILES + "test/map_indexing_suite.cpp" + "test/int_map_indexing_suite.cpp" + "test/a_map_indexing_suite.cpp" +) + +# These tests are disabled since we don't build the numpy extensions. +# boost_python_test("numpy/dtype") +# boost_python_test("numpy/ufunc") +# boost_python_test("numpy/templates") +# boost_python_test("numpy/ndarray") +# boost_python_test("numpy/indexing") +# boost_python_test("numpy/shapes") + +boost_python_cpp_test("exec" + COMMAND_ARGS "${CMAKE_INSTALL_PREFIX}/tests/exec.py" +) +install( + FILES "test/exec.py" + DESTINATION "tests" +) + +boost_python_cpp_test("import_" + COMMAND_ARGS "${CMAKE_INSTALL_PREFIX}/tests/import_.py" +) +install( + FILES "test/import_.py" + DESTINATION "tests" +) + +boost_python_cpp_test_lib("indirect_traits_test") +boost_python_cpp_test("destroy_test") +boost_python_cpp_test("pointer_type_id_test") +boost_python_cpp_test("bases") +boost_python_cpp_test("if_else") +boost_python_cpp_test("pointee") +boost_python_cpp_test("result") +boost_python_cpp_test_lib("string_literal") +boost_python_cpp_test_lib("borrowed") +boost_python_cpp_test_lib("object_manager") +boost_python_cpp_test_lib("copy_ctor_mutates_rhs") +boost_python_cpp_test("upcast") +boost_python_cpp_test_lib("select_holder") + +# select_from_python_test requires compiling in a source file from +# the library itself. However, we need to avoid this in monolithic +# builds. In that case, the library we built above will be an archive +# library that includes the associated object file; if we include it +# here, we'll run into duplicate symbol errors at link time. +# +# Because we're compiling in this extra source file, we need to set +# BOOST_PYTHON_STATIC_LIB to ensure the symbols from that file +# aren't set to be exported, which will cause conflicts with +# the header files that say they should be imported. +if (NOT PXR_BUILD_MONOLITHIC) + set(extracppfiles "src/converter/type_id.cpp") +endif() + +boost_python_cpp_test("select_from_python_test" + CPPFILES + "test/select_from_python_test.cpp" + ${extracppfiles} +) +target_compile_definitions(select_from_python_test + PRIVATE BOOST_PYTHON_STATIC_LIB) + +boost_python_cpp_test_lib("select_arg_to_python_test") diff --git a/pxr/external/boost/python/test/pyrun.py b/pxr/external/boost/python/test/pyrun.py index 2c54a9bbbb..79f946c189 100644 --- a/pxr/external/boost/python/test/pyrun.py +++ b/pxr/external/boost/python/test/pyrun.py @@ -1,12 +1,34 @@ +#!/pythonsubst # # Copyright 2024 Pixar # Licensed under the terms set forth in the LICENSE.txt file available at # https://openusd.org/license. # +import os +import platform import sys -pythonpath = sys.argv[1] -scriptfile = sys.argv[2] -sys.argv = sys.argv[2:] +# On Windows and Python 3.8+ we need to manually update the DLL search +# path to include PATH manually. See WindowsImportWrapper in tf/__init__.py +# for more details. +if sys.version_info >= (3, 8) and platform.system() == "Windows": + import_paths = os.getenv('PXR_USD_WINDOWS_DLL_PATH') + if import_paths is None: + import_paths = os.getenv('PATH', '') + + for path in reversed(import_paths.split(os.pathsep)): + # Calling add_dll_directory raises an exception if paths don't + # exist, or if you pass in dot + if os.path.exists(path) and path != '.': + abs_path = os.path.abspath(path) + os.add_dll_directory(abs_path) + +# Test scripts are installed next to ourself, while the corresponding +# Python modules are in the "lib" subdirectory. +testsDir = os.path.dirname(os.path.abspath(__file__)) + +pythonpath = os.path.join(testsDir, "lib") +scriptfile = os.path.join(testsDir, sys.argv[1]) +sys.argv = sys.argv[1:] sys.path.append(pythonpath) exec(compile(open(scriptfile).read(), scriptfile, 'exec')) From 6d3b7c77c0508bb63292f8eecf0df1d7b90d1329 Mon Sep 17 00:00:00 2001 From: rajabala Date: Fri, 23 Aug 2024 13:01:56 -0700 Subject: [PATCH 097/202] [hdsi] Light linking improvements. - Separate cache update and invalidation processing by queueing dirty state during notice processing. - Compute the unioned dirty expression for evaluation over prims in the scene index. This ensures that we evaluate the path expression at most once per notice callback. The earlier version evaluated each dirty expression over prims in the scene index, which is expensive! - Various readability improvements. On a test shot with ~19K prims with ~20 lights using 4 unique expressions, the time spent for processing added notices reduced from 2700 ms to 390 ms. (Internal change: 2338308) --- pxr/imaging/hdsi/lightLinkingSceneIndex.cpp | 483 +++++++++++--------- 1 file changed, 276 insertions(+), 207 deletions(-) diff --git a/pxr/imaging/hdsi/lightLinkingSceneIndex.cpp b/pxr/imaging/hdsi/lightLinkingSceneIndex.cpp index 359afe16be..d6b58e60c9 100644 --- a/pxr/imaging/hdsi/lightLinkingSceneIndex.cpp +++ b/pxr/imaging/hdsi/lightLinkingSceneIndex.cpp @@ -23,21 +23,26 @@ #include "pxr/base/tf/debug.h" #include "pxr/base/trace/trace.h" +#include #include +#include PXR_NAMESPACE_OPEN_SCOPE TF_DEBUG_CODES( HDSI_LIGHT_LINK_COLLECTION_CACHE, + HDSI_LIGHT_LINK_INVALIDATION, HDSI_LIGHT_LINK_VERBOSE ); TF_REGISTRY_FUNCTION(TfDebug) { TF_DEBUG_ENVIRONMENT_SYMBOL(HDSI_LIGHT_LINK_COLLECTION_CACHE, - "Log cache update operations and invalidations."); + "Log cache update operations."); + TF_DEBUG_ENVIRONMENT_SYMBOL(HDSI_LIGHT_LINK_INVALIDATION, + "Log invalidation of prims."); TF_DEBUG_ENVIRONMENT_SYMBOL(HDSI_LIGHT_LINK_VERBOSE, - "Log notice processing for lights and light filters."); + "Enable additional logging."); } TF_DEFINE_PUBLIC_TOKENS(HdsiLightLinkingSceneIndexTokens, @@ -48,13 +53,30 @@ TF_DEFINE_PRIVATE_TOKENS( ((groupPrefix, "group_")) ); -static bool -_LogDebugMsg() +namespace { + +// A collection is identified by the prim path and the collection name token. +// Since the prim path is unique, we're guaranteed a unique ID for each +// collection. +using _CollectionId = std::pair; +using _CollectionIdSet = + std::unordered_set<_CollectionId, TfHash>; + +inline _CollectionId +_MakeCollectionId(const SdfPath &primPath, const TfToken &colName) +{ + return {primPath, colName}; +} + +std::string +_ToStr(const _CollectionId &id) { - return TfDebug::IsEnabled(HDSI_LIGHT_LINK_COLLECTION_CACHE) || - TfDebug::IsEnabled(HDSI_LIGHT_LINK_VERBOSE); + const auto &[path, token] = id; + return path.GetString() + "." + token.GetString(); } +} // anon + /////////////////////////////////////////////////////////////////////////////// // // HdsiLightLinkingSceneIndex_Impl @@ -64,14 +86,14 @@ _LogDebugMsg() namespace HdsiLightLinkingSceneIndex_Impl { -// Cache of light linking collections discovered on light and light filter -// prims that tracks the correspondence of collection paths, their membership -// expressions and the category ID assigned to each unique expression. -// -// Collections that have the same membership expression are assigned the same -// category ID. For efficiency, trivial expressions that include -// all prims in the scene are not tracked by the cache. -// +/// Cache of light linking collections discovered on light and light filter +/// prims that tracks the correspondence of collection paths, their membership +/// expressions and the category ID assigned to each unique expression. +/// +/// Collections that have the same membership expression are assigned the same +/// category ID. For efficiency, trivial expressions that include +/// all prims in the scene are not tracked by the cache. +/// struct _Cache { public: @@ -83,134 +105,106 @@ struct _Cache : _si(inputSceneIndex) {} - // Updates tables and adds invalidation notices when processing a new - // collection or when its expression has changed. - // - void UpdateCollection( + /// Updates tables and dirty state for the provided collection and + /// expression. + /// + void ProcessCollection( const SdfPath &primPath, const TfToken &collectionName, - const SdfPathExpression &expr, - HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) + const SdfPathExpression &expr) { TRACE_FUNCTION(); - const SdfPath collectionPath = - _MakeCollectionPath(primPath, collectionName); + const _CollectionId collectionId = + _MakeCollectionId(primPath, collectionName); - // Have we seen this collection before? - const auto pathIdEntry = _collectionPathToId.find(collectionPath); + const auto colIdEntry = _collectionIdToCategoryId.find(collectionId); const bool collectionExists = - (pathIdEntry != _collectionPathToId.end()); - + (colIdEntry != _collectionIdToCategoryId.end()); + if (collectionExists) { // Yes, we have. Has the expression changed? - const auto &id = pathIdEntry->second; - if (!TF_VERIFY(!id.IsEmpty())) { + const auto &categoryId = colIdEntry->second; + if (!TF_VERIFY(!categoryId.IsEmpty())) { return; } - const auto idExprEntry = _idToExpr.find(id); - if (!TF_VERIFY(idExprEntry != _idToExpr.end())) { + const auto idExprEntry = _categoryIdToExpr.find(categoryId); + if (!TF_VERIFY(idExprEntry != _categoryIdToExpr.end())) { return; } - const auto &curExpr = idExprEntry->second; + const auto &oldExpr = idExprEntry->second; - if (curExpr == expr) { + if (oldExpr == expr) { TF_DEBUG(HDSI_LIGHT_LINK_VERBOSE).Msg( - "* UpdateCollection -- Membership expression for %s has " + "* ProcessCollection -- Membership expression for %s has " "not changed (%s).\n", - collectionPath.GetText(), expr.GetText().c_str()); + _ToStr(collectionId).c_str(), expr.GetText().c_str()); return; } - } - // Two possibilities here: - // 1. Collection exists and expression has changed. The new expression - // may be trivial. - // - // 2. We're processing the collection for the first time. It may be - // trivial. While _PrimsAdded short circuits trivial expressions, - // _PrimsDirtied doesn't. - // - if (collectionExists) { - // Remove the collection from all tables. This in turn adds - // invalidation notices for affected targets. - _RemoveCollection(collectionPath, dirtiedEntries); + // Expression has changed.Remove table entries for the existing + // collection and queue invalidation. + _RemoveCollection( + collectionId, _InvalidationType::DirtyTargetsAndCollection); + + _dirtyState.push_back({oldExpr, collectionId}); - // Notify the light to re-query its category ID. - _InvalidateLight(primPath, collectionName, dirtiedEntries); } if (IsTrivial(expr)) { - // Nothing more to do. Trivial collection's are not tracked. TF_DEBUG(HDSI_LIGHT_LINK_VERBOSE).Msg( - "* UpdateCollection -- Expression for %s is trivial.\n", - collectionPath.GetText()); + "* ProcessCollection -- Expression for %s is trivial.\n", + _ToStr(collectionId).c_str()); return; } // Have we seen this expression before? - auto & [id, eval] = _exprToIdAndEval[expr]; - const bool isNewExpr = id.IsEmpty(); + auto & [categoryId, eval] = _exprToCategoryIdAndEval[expr]; + const bool isNewExpr = categoryId.IsEmpty(); if (isNewExpr) { // Nope. Assign a category ID and ... - id = _GetNewCategoryId(); - _idToExpr[id] = expr; - - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( - "* UpdateCollection -- Assigned ID %s for collection %s " - "(expression = %s).\n", - id.GetText(), collectionPath.GetText(), expr.GetText().c_str()); - } + categoryId = _GetNewCategoryId(); + _categoryIdToExpr[categoryId] = expr; + + TF_DEBUG(HDSI_LIGHT_LINK_COLLECTION_CACHE).Msg( + "* ProcessCollection -- Assigned ID %s for collection %s" + "(expression = %s).\n", categoryId.GetText(), + _ToStr(collectionId).c_str(), expr.GetText().c_str()); // ... create evaluator. eval = _MakePathExpressionEvaluator(expr); } else { - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( - "* UpdateCollection -- Using shared ID %s for collection %s.\n", - id.GetText(), collectionPath.GetText()); - } + TF_DEBUG(HDSI_LIGHT_LINK_COLLECTION_CACHE).Msg( + "* ProcessCollection -- Using shared ID %s for collection %s." + "\n", categoryId.GetText(), _ToStr(collectionId).c_str()); } - _collectionPathToId[collectionPath] = id; - _idToCollectionPaths[id].insert(collectionPath); - - // The categories on the targets don't change when using a shared ID. - // We still conservatively invalidate the targets to give them a chance - // to process any changes to internal lighting state. - // This is necessary for e.g. in hdPrman to update the - // lighting_subset & lightfilter_subset attributes on geometry. - // We do a similar conservative invalidation in _RemoveCollection. - const SdfPathVector targets = _ComputeAllMatches(eval); - _InvalidateCategoriesOnTargets(targets, dirtiedEntries); + _collectionIdToCategoryId[collectionId] = categoryId; + _categoryIdToCollectionIds[categoryId].insert(collectionId); - // If the collection existed, we pushed a dirty notice for the light - // above. - if (!collectionExists) { - _InvalidateLight(primPath, collectionName, dirtiedEntries); - } + _dirtyState.push_back({expr, collectionId}); } - // See _RemoveCollection. + /// Updates the various tables to remove any reference to \p collectionId. + /// Updates dirty state to invalidate the targets for the removed + /// collection. + /// void RemoveCollection( const SdfPath &primPath, - const TfToken &collectionName, - HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) + const TfToken &collectionName) { - const SdfPath collectionPath = - _MakeCollectionPath(primPath, collectionName); - - _RemoveCollection(collectionPath, dirtiedEntries); + _RemoveCollection( + _MakeCollectionId(primPath, collectionName), + _InvalidationType::DirtyTargets); } - // Returns the categories that `primPath` belongs to. - // XXX Support is currently limited to non-instanced geometry prims. - // + /// Returns the categories that \p primPath belongs to. + /// XXX Support is currently limited to non-instanced geometry prims. + /// TfTokenVector ComputeCategoriesForPrimPath( const SdfPath &primPath) const @@ -224,37 +218,114 @@ struct _Cache // waterfall results). // TfTokenVector categories; - for (const auto & [expr, idAndEval] : _exprToIdAndEval) { - if (idAndEval.eval.Match(primPath)) { - categories.push_back(idAndEval.id); + for (const auto & [expr, idAndEval] : _exprToCategoryIdAndEval) { + const auto &[categoryId, eval] = idAndEval; + if (eval.Match(primPath)) { + categories.push_back(categoryId); } } return categories; } - // Returns true and updates `id` if the cache has an entry for the given - // collection on the light or light filter prim. - // Returns false otherwise (trivial collections). - // + /// Returns true and updates \p categoryId if the cache has an entry for + /// the provided collection. + /// Returns false otherwise (for trivial or untracked collections). + /// bool GetCategoryIdForLightLinkingCollection( const SdfPath &primPath, const TfToken &collectionName, - TfToken *id) + TfToken *categoryId) { - const SdfPath colPath = _MakeCollectionPath(primPath, collectionName); - const auto pathIdEntry = _collectionPathToId.find(colPath); - if (pathIdEntry != _collectionPathToId.end()) { - *id = pathIdEntry->second; + const auto entry = _collectionIdToCategoryId.find( + _MakeCollectionId(primPath, collectionName)); + + if (entry != _collectionIdToCategoryId.end()) { + *categoryId = entry->second; return true; } - // Collection entry doesn't exist. This is likely because the collection - // is trivial, but also the case when the collection doesn't exist. return false; } + /// Processes the queued dirty state and updates \p dirtiedEntries to + /// invalidate targeted prims and/or lights. + /// + void + InvalidatePrimsAndClearDirtyState( + HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) + { + if (!dirtiedEntries) { + TF_CODING_ERROR("Null dirty notice vector provided\n"); + return; + } + + if (_dirtyState.empty()) { + return; + } + + TRACE_FUNCTION(); + + // Gather the set of unique expressions and collections to invalidate. + // XXX For now, we conservatively invalidate the union of all queued + // expressions. + // We can consult the tables to skip expressions in certain + // scenarios. + // - The lightLink collection on N lights have the same category + // id. We edit the lightLink expression on one of the lights to + // the trivial expression '//'. + // We don't need to evaluate the expression to invalidate the + // targets in this scenario since their categories are unaffected. + // + // - The lightLink collection on light A shares the same category + // id as the shadowLink collection on light B. If we edit the + // lightLink expression, we shouldn't need to invalidate the + // targets since the category id is still relevant to them. + // + // However, geometry prims in PRMan use a dedicated attribute + // "lighting:subset", which needs to be updated in this scenario. + // So, it is possibly renderer dependent and should perhaps be + // a configurable thing on the scene index at some point. + // + using _ExprSet = std::unordered_set<_Expr, TfHash>; + _ExprSet exprs; + _CollectionIdSet collectionIds; + + for (const auto &[expr, optColId] : _dirtyState) { + exprs.insert(expr); + + if (optColId) { + collectionIds.insert(*optColId); + } + } + + // Evaluating an expression over a scene index can be expensive if + // several prims need to be traversed. + // Compute the unioned expression to evaluate (and thus traverse) + // just the once. + // + SdfPathExpression combinedExpr; + for (const auto &expr : exprs) { + combinedExpr = SdfPathExpression::MakeOp( + SdfPathExpression::Union, combinedExpr, expr); + } + TF_DEBUG(HDSI_LIGHT_LINK_INVALIDATION).Msg( + "Combined expression from %zu dirty expressions: %s\n", + exprs.size(), combinedExpr.GetText().c_str()); + + const auto eval = _MakePathExpressionEvaluator(combinedExpr); + SdfPathVector targets = _ComputeAllMatches(eval); + _InvalidateCategoriesOnTargets(targets, dirtiedEntries); + _InvalidateLights(collectionIds, dirtiedEntries); + + _dirtyState.clear(); + } + + /// Returns whether the provided expression is trivial meaning that all + /// prims in the scene are targeted (illumniated or cast shadows for + /// light linking). + /// static bool IsTrivial(const SdfPathExpression &expr) { @@ -268,21 +339,20 @@ struct _Cache } private: - // Updates the various tables to remove any reference to `collectionPath`. - // Adds notices to `dirtiedEntries` to invalidate the categories on - // prims targeted by the collection. - // - // Note: The light/light filter isn't invalidated here. We do this - // only in UpdateCollection if necessary. - // For prim removals, we don't need to invalidate the prim since it - // is being removed. - // + enum class _InvalidationType { + DirtyTargets, + DirtyTargetsAndCollection + }; + + /// Updates the various tables to remove any reference to \p collectionId. + /// Updates the dirty state if \p invalidateTargets is true. + /// void _RemoveCollection( - const SdfPath &collectionPath, - HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) + const _CollectionId &collectionId, + _InvalidationType invalidationType) { - const auto pathIdEntry = _collectionPathToId.find(collectionPath); - if (pathIdEntry == _collectionPathToId.end()) { + const auto colIdEntry = _collectionIdToCategoryId.find(collectionId); + if (colIdEntry == _collectionIdToCategoryId.end()) { // Nothing to do. The collection was never added, either because // it didn't exist, or because it was trivial. return; @@ -290,65 +360,63 @@ struct _Cache TRACE_FUNCTION(); - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( + TF_DEBUG(HDSI_LIGHT_LINK_COLLECTION_CACHE).Msg( "* RemoveCollection %s -- \n" " * Removing cache entries referencing the collection.\n", - collectionPath.GetText()); - } + _ToStr(collectionId).c_str()); - TfToken id = pathIdEntry->second; - if (!TF_VERIFY(!id.IsEmpty())) { + TfToken categoryId = colIdEntry->second; + if (!TF_VERIFY(!categoryId.IsEmpty())) { return; } - _collectionPathToId.erase(pathIdEntry); + _collectionIdToCategoryId.erase(colIdEntry); - auto idPathsEntry = _idToCollectionPaths.find(id); - if (!TF_VERIFY(idPathsEntry != _idToCollectionPaths.end())) { + auto idPathsEntry = _categoryIdToCollectionIds.find(categoryId); + if (!TF_VERIFY(idPathsEntry != _categoryIdToCollectionIds.end())) { return; } auto &collectionsUsingId = idPathsEntry->second; - collectionsUsingId.erase(collectionPath); + collectionsUsingId.erase(collectionId); // Check if the category ID is being shared by other collections. const bool sharingId = !collectionsUsingId.empty(); - // XXX If the ID is being shared, the categories on targeted prims - // don't change, but we invalidate them nonetheless. - // See note in _UpdateCollection. - const auto idExprEntry = _idToExpr.find(id); - if (!TF_VERIFY(idExprEntry != _idToExpr.end())) { + const auto idExprEntry = _categoryIdToExpr.find(categoryId); + if (!TF_VERIFY(idExprEntry != _categoryIdToExpr.end())) { return; } const auto expr = idExprEntry->second; - const auto exprIdEvalEntry = _exprToIdAndEval.find(expr); - if (!TF_VERIFY(exprIdEvalEntry != _exprToIdAndEval.end())) { + const auto exprIdEvalEntry = _exprToCategoryIdAndEval.find(expr); + if (!TF_VERIFY(exprIdEvalEntry != _exprToCategoryIdAndEval.end())) { return; } - auto &eval = exprIdEvalEntry->second.eval; - const SdfPathVector targets = _ComputeAllMatches(eval); - _InvalidateCategoriesOnTargets(targets, dirtiedEntries); - if (sharingId) { TF_DEBUG(HDSI_LIGHT_LINK_VERBOSE).Msg( " * Id (%s) for collection %s is still being used by %zu " - "other collections.\n", id.GetText(), collectionPath.GetText(), - collectionsUsingId.size()); + "other collections.\n", categoryId.GetText(), + _ToStr(collectionId).c_str(), collectionsUsingId.size()); } else { - // Remove reference to `id` from tables. - // - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( + // Remove reference to the categoryId from tables. + TF_DEBUG(HDSI_LIGHT_LINK_COLLECTION_CACHE).Msg( " * Removing cache entries referencing Id (%s).\n", - id.GetText()); - } + categoryId.GetText()); + + _categoryIdToCollectionIds.erase(idPathsEntry); + _categoryIdToExpr.erase(idExprEntry); + _exprToCategoryIdAndEval.erase(exprIdEvalEntry); + } - _idToCollectionPaths.erase(idPathsEntry); - _idToExpr.erase(idExprEntry); - _exprToIdAndEval.erase(exprIdEvalEntry); + switch (invalidationType) { + case _InvalidationType::DirtyTargets: + _dirtyState.push_back({expr, {}}); + break; + case _InvalidationType::DirtyTargetsAndCollection: + _dirtyState.push_back({expr, collectionId}); + break; + // Skip default case to get a compile-time error for unhandled values. } } @@ -372,11 +440,9 @@ struct _Cache const SdfPathVector &targets, HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) { - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( + TF_DEBUG(HDSI_LIGHT_LINK_INVALIDATION).Msg( " * Invalidating categories on %zu targets ....\n", targets.size()); - } for (const auto targetPath : targets) { dirtiedEntries->push_back( @@ -386,24 +452,32 @@ struct _Cache } void - _InvalidateLight( - const SdfPath &primPath, - const TfToken &collectionName, + _InvalidateLights( + const _CollectionIdSet &collectionIds, HdSceneIndexObserver::DirtiedPrimEntries *dirtiedEntries) { - if (_LogDebugMsg()) { - TfDebug::Helper().Msg( - " * Invalidating category ID for %s:%s....\n", - primPath.GetText(), collectionName.GetText()); - } + TF_DEBUG(HDSI_LIGHT_LINK_INVALIDATION).Msg( + " * Invalidating category ID for %zu collections...\n", + collectionIds.size()); + + for (const auto &collectionId : collectionIds) { + const auto &[primPath, collectionName] = collectionId; - dirtiedEntries->push_back( - HdSceneIndexObserver::DirtiedPrimEntry( - primPath, - HdLightSchema::GetDefaultLocator().Append(collectionName))); + // XXX Currently, light linking collections are bundled under + // HdLightSchema with the collection name as the key + // and categoryId as value. + dirtiedEntries->push_back( + HdSceneIndexObserver::DirtiedPrimEntry( + primPath, + HdLightSchema::GetDefaultLocator().Append(collectionName))); + + TF_DEBUG(HDSI_LIGHT_LINK_VERBOSE).Msg( + " - Invalidating category ID for %s.\n", + _ToStr(collectionId).c_str()); + } } - SdfPathVector + static SdfPathVector _ComputeAllMatches(const _Eval &eval) { constexpr auto matchKind = @@ -430,22 +504,13 @@ struct _Cache _si, expr, HdGetCollectionPredicateLibrary()); } - static SdfPath - _MakeCollectionPath( - const SdfPath &primPath, - const TfToken &collectionName) - { - return primPath.AppendProperty(collectionName); - } - private: const HdSceneIndexBaseRefPtr _si; - struct _CategoryIdAndEval - { - _CategoryId id; - _Eval eval; - }; + // ------------------------------------------------------------------------- + // Tables + // + using _CategoryIdAndEval = std::pair<_CategoryId, _Eval>; // Lookup the category ID and evaluator for a given expression. // @@ -462,19 +527,30 @@ struct _Cache // For each collection path (of the form primPath.collectionName), lookup // the assigned category ID. // - using _CollectionPathToCategoryIdMap = - std::unordered_map; + using _CollectionIdToCategoryIdMap = + std::unordered_map<_CollectionId, _CategoryId, TfHash>; // If several collections have the same membership expression, we share // the assigned category ID amongst them. This map tracks that association. // - using _CategoryIdToCollectionPathsMap - = std::unordered_map<_CategoryId, SdfPathSet, TfHash>; + using _CategoryIdToCollectionIds + = std::unordered_map<_CategoryId, _CollectionIdSet, TfHash>; + + _ExprToCategoryIdAndEvalMap _exprToCategoryIdAndEval; + _CategoryIdToExprMap _categoryIdToExpr; + _CollectionIdToCategoryIdMap _collectionIdToCategoryId; + _CategoryIdToCollectionIds _categoryIdToCollectionIds; + + // ------------------------------------------------------------------------- + // Dirty state + // + using _OptionalCollectionId = std::optional<_CollectionId>; + using _DirtyEntry = std::pair<_Expr, _OptionalCollectionId>; + using _DirtyState = std::vector<_DirtyEntry>; + + _DirtyState _dirtyState; - _ExprToCategoryIdAndEvalMap _exprToIdAndEval; - _CategoryIdToExprMap _idToExpr; - _CollectionPathToCategoryIdMap _collectionPathToId; - _CategoryIdToCollectionPathsMap _idToCollectionPaths; + // ------------------------------------------------------------------------- // Suffix used when computing the next group (category) ID. size_t _groupIdx = 0; @@ -821,9 +897,6 @@ static const VtArray GEOMETRY_PRIM_TYPES = { HdRprimTypeTokens->allTokens.end() }; -// XXX hd/tokens.h doesn't have a separate list of light types. -// Perhaps, we should add one and reference that here? -// static const VtArray LIGHT_PRIM_TYPES = { HdLightTypeTokens->allTokens.begin(), HdLightTypeTokens->allTokens.end(), @@ -941,14 +1014,15 @@ HdsiLightLinkingSceneIndex::_PrimsAdded( // The prim is no longer a light/light filter. for (const TfToken &colName : _GetAllLinkingCollectionNames()) { - _cache->RemoveCollection( - entry.primPath, colName, &dirtiedEntries); + _cache->RemoveCollection(entry.primPath, colName); } _lightAndFilterPrimPaths.erase(it); } } + _cache->InvalidatePrimsAndClearDirtyState(&dirtiedEntries); + _SendPrimsAdded(entries); _SendPrimsDirtied(dirtiedEntries); } @@ -986,11 +1060,7 @@ HdsiLightLinkingSceneIndex::_ProcessAddedLightOrFilter( continue; } - _cache->UpdateCollection( - entry.primPath, - colName, - expr, - dirtiedEntries); + _cache->ProcessCollection(entry.primPath, colName, expr); } } } @@ -1029,14 +1099,15 @@ HdsiLightLinkingSceneIndex::_PrimsRemoved( // loop over only the relevant collections. // for (const TfToken &colName : _GetAllLinkingCollectionNames()) { - _cache->RemoveCollection( - trackedPrimPath, colName, &dirtiedEntries); + _cache->RemoveCollection(trackedPrimPath, colName); } } _lightAndFilterPrimPaths.erase(begin, end); } + _cache->InvalidatePrimsAndClearDirtyState(&dirtiedEntries); + _SendPrimsRemoved(entries); _SendPrimsDirtied(dirtiedEntries); } @@ -1112,11 +1183,7 @@ HdsiLightLinkingSceneIndex::_PrimsDirtied( const SdfPathExpression expr = exprDs->GetTypedValue(0.0); - _cache->UpdateCollection( - primPath, - collectionName, - expr, - &newEntries); + _cache->ProcessCollection(primPath, collectionName, expr); } else { // XXX Issue warning? We do always expect a value @@ -1126,6 +1193,8 @@ HdsiLightLinkingSceneIndex::_PrimsDirtied( } } + _cache->InvalidatePrimsAndClearDirtyState(&newEntries); + _SendPrimsDirtied(entries); _SendPrimsDirtied(newEntries); } From bb16f98f1ab5b0d926b4d63802b25e1e0579dd81 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 25 Aug 2024 19:36:17 -0400 Subject: [PATCH 098/202] fix: various PR comment fixes - changed test asset folder name to match the name of the cpp file - updated error message to use "referenced" to describe the layers - updated variable naming - updated the way to verify the error messages in the test, utilizing std::filesystem --- pxr/usd/usdUtils/CMakeLists.txt | 4 +-- .../testenv/testUsdUtilsValidators.cpp | 23 +++++++++--------- .../badRoot.usda | 0 .../excludedDirectory/image.jpg | Bin .../excludedDirectory/layer.usda | 0 .../fail.usdz | Bin .../goodRoot.usda | 0 .../includedDirectory/image.jpg | Bin .../includedDirectory/layer.usda | 0 .../pass.usdz | Bin pxr/usd/usdUtils/validators.cpp | 10 ++++---- 11 files changed, 19 insertions(+), 18 deletions(-) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/badRoot.usda (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/excludedDirectory/image.jpg (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/excludedDirectory/layer.usda (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/fail.usdz (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/goodRoot.usda (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/includedDirectory/image.jpg (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/includedDirectory/layer.usda (100%) rename pxr/usd/usdUtils/testenv/{testUsdUtilsPackageEncapsulation => testUsdUtilsValidators}/pass.usdz (100%) diff --git a/pxr/usd/usdUtils/CMakeLists.txt b/pxr/usd/usdUtils/CMakeLists.txt index 9468e45b10..a29f566b37 100644 --- a/pxr/usd/usdUtils/CMakeLists.txt +++ b/pxr/usd/usdUtils/CMakeLists.txt @@ -310,8 +310,8 @@ pxr_install_test_dir( ) pxr_install_test_dir( - SRC testenv/testUsdUtilsPackageEncapsulation - DEST testUsdUtilsPackageEncapsulation + SRC testenv/testUsdUtilsValidators + DEST testUsdUtilsValidators ) pxr_register_test(testUsdUtilsAuthoring diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 45c066490b..1839a43bb8 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -4,6 +4,7 @@ #include "pxr/usd/usd/validationRegistry.h" #include "pxr/base/arch/systemInfo.h" +#include PXR_NAMESPACE_USING_DIRECTIVE static @@ -47,8 +48,7 @@ TestPackageEncapsulationValidator() // Load the pre-created usdz stage with paths to a layer and asset // that are not included in the package, but exist - const UsdStageRefPtr& stage = UsdStage::Open( - "testUsdUtilsPackageEncapsulation/fail.usdz"); + const UsdStageRefPtr& stage = UsdStage::Open("fail.usdz"); UsdValidationErrorVector errors = validator->Validate(stage); @@ -56,16 +56,18 @@ TestPackageEncapsulationValidator() TF_AXIOM(errors.size() == 2); const std::string& realRootPath = stage->GetRootLayer()->GetRealPath(); - const std::string& rootDirectory = realRootPath - .substr(0, realRootPath.find_last_of("/") + 1); - const std::string& errorLayer = rootDirectory + "excludedDirectory" - "/layer.usda"; - const std::string& errorAsset = rootDirectory + "excludedDirectory" - "/image.jpg"; + std::filesystem::path rootPath(realRootPath); + + const std::string& errorLayer = rootPath.parent_path() + .append("excludedDirectory") + .append("layer.usda"); + const std::string& errorAsset = rootPath.parent_path() + .append("excludedDirectory") + .append("image.jpg"); std::vector expectedErrorMessages = { - TfStringPrintf(("Found layer '%s' that does not belong to the" + TfStringPrintf(("Found referenced layer '%s' that does not belong to the" " package '%s'."), errorLayer.c_str(), realRootPath.c_str()), TfStringPrintf(("Found asset reference '%s' that does not belong" @@ -83,8 +85,7 @@ TestPackageEncapsulationValidator() // Load the pre-created usdz stage with relative paths to both a reference // and an asset that are included in the package. - const UsdStageRefPtr& passStage = UsdStage::Open( - "testUsdUtilsPackageEncapsulation/pass.usdz"); + const UsdStageRefPtr& passStage = UsdStage::Open("pass.usdz"); errors = validator->Validate(passStage); diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/badRoot.usda similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/badRoot.usda rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/badRoot.usda diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/image.jpg b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/excludedDirectory/image.jpg similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/image.jpg rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/excludedDirectory/image.jpg diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/layer.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/excludedDirectory/layer.usda similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/excludedDirectory/layer.usda rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/excludedDirectory/layer.usda diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/fail.usdz similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/fail.usdz rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/fail.usdz diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/goodRoot.usda similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/goodRoot.usda rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/goodRoot.usda diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/image.jpg b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/includedDirectory/image.jpg similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/image.jpg rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/includedDirectory/image.jpg diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/includedDirectory/layer.usda similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/includedDirectory/layer.usda rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/includedDirectory/layer.usda diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators/pass.usdz similarity index 100% rename from pxr/usd/usdUtils/testenv/testUsdUtilsPackageEncapsulation/pass.usdz rename to pxr/usd/usdUtils/testenv/testUsdUtilsValidators/pass.usdz diff --git a/pxr/usd/usdUtils/validators.cpp b/pxr/usd/usdUtils/validators.cpp index 1463f5df0f..5c4b3f24df 100644 --- a/pxr/usd/usdUtils/validators.cpp +++ b/pxr/usd/usdUtils/validators.cpp @@ -42,8 +42,8 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { realPath; if (!packagePath.empty()) { - for (const SdfLayerRefPtr& subLayer : layers) { - const std::string& realPath = subLayer->GetRealPath(); + for (const SdfLayerRefPtr& referencedLayer : layers) { + const std::string& realPath = referencedLayer->GetRealPath(); // We don't want to validate in-memory or session layers // since these layers will not have a real path, we skip here @@ -56,11 +56,11 @@ _PackageEncapsulationValidator(const UsdStagePtr& usdStage) { UsdValidationErrorType::Error, UsdValidationErrorSites{ UsdValidationErrorSite(rootLayer, - subLayer->GetDefaultPrimAsPath()) + referencedLayer->GetDefaultPrimAsPath()) }, - TfStringPrintf(("Found layer '%s' that " + TfStringPrintf(("Found referenced layer '%s' that " "does not belong to the package '%s'."), - subLayer->GetIdentifier().c_str(), packagePath.c_str()) + referencedLayer->GetIdentifier().c_str(), packagePath.c_str()) ); } } From 6c910869030d9f7e7224c557515524635761cc58 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 26 Aug 2024 09:08:42 -0400 Subject: [PATCH 099/202] fix: use Tf where possible for pathing - avoid GetRealPath and use TfGetAbsPath instead - concat with TfStringCatPaths, instead of with std::filesystem functions --- .../testenv/testUsdUtilsValidators.cpp | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 1839a43bb8..2b3e66762e 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -3,8 +3,8 @@ #include "pxr/usd/usdUtils/validatorTokens.h" #include "pxr/usd/usd/validationRegistry.h" #include "pxr/base/arch/systemInfo.h" +#include "pxr/base/tf/pathUtils.h" -#include PXR_NAMESPACE_USING_DIRECTIVE static @@ -55,24 +55,21 @@ TestPackageEncapsulationValidator() // Verify both the layer & asset errors are present TF_AXIOM(errors.size() == 2); - const std::string& realRootPath = stage->GetRootLayer()->GetRealPath(); - - std::filesystem::path rootPath(realRootPath); - - const std::string& errorLayer = rootPath.parent_path() - .append("excludedDirectory") - .append("layer.usda"); - const std::string& errorAsset = rootPath.parent_path() - .append("excludedDirectory") - .append("image.jpg"); + const std::string& absoluteUsdzPath = TfAbsPath( + stage->GetRootLayer()->GetIdentifier()); + const std::string& usdzRootDirectory = TfGetPathName(absoluteUsdzPath); + const std::string& errorLayer = TfStringCatPaths( + usdzRootDirectory, "excludedDirectory/layer.usda"); + const std::string& errorAsset = TfStringCatPaths( + usdzRootDirectory, "excludedDirectory/image.jpg"); std::vector expectedErrorMessages = { - TfStringPrintf(("Found referenced layer '%s' that does not belong to the" - " package '%s'."), - errorLayer.c_str(), realRootPath.c_str()), + TfStringPrintf(("Found referenced layer '%s' that does not " + "belong to the package '%s'."), + errorLayer.c_str(), absoluteUsdzPath.c_str()), TfStringPrintf(("Found asset reference '%s' that does not belong" " to the package '%s'."), - errorAsset.c_str(), realRootPath.c_str()) + errorAsset.c_str(), absoluteUsdzPath.c_str()) }; for (size_t i = 0; i < errors.size(); ++i) From 65a1bbb4702b8983fc1f6091833c1e75c397c330 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Mon, 26 Aug 2024 15:10:15 -0700 Subject: [PATCH 100/202] Moving DenoisePass settings from a prim to an api schema (Internal change: 2338367) (Internal change: 2338376) --- pxr/usd/usdRender/CMakeLists.txt | 2 - pxr/usd/usdRender/denoisePass.cpp | 112 ------------------ pxr/usd/usdRender/denoisePass.h | 157 ------------------------- pxr/usd/usdRender/generatedSchema.usda | 20 ---- pxr/usd/usdRender/module.cpp | 1 - pxr/usd/usdRender/pass.cpp | 13 -- pxr/usd/usdRender/pass.h | 16 --- pxr/usd/usdRender/plugInfo.json | 10 -- pxr/usd/usdRender/schema.usda | 25 ---- pxr/usd/usdRender/tokens.cpp | 4 - pxr/usd/usdRender/tokens.h | 8 -- pxr/usd/usdRender/wrapDenoisePass.cpp | 107 ----------------- pxr/usd/usdRender/wrapPass.cpp | 5 - pxr/usd/usdRender/wrapTokens.cpp | 2 - 14 files changed, 482 deletions(-) delete mode 100644 pxr/usd/usdRender/denoisePass.cpp delete mode 100644 pxr/usd/usdRender/denoisePass.h delete mode 100644 pxr/usd/usdRender/wrapDenoisePass.cpp diff --git a/pxr/usd/usdRender/CMakeLists.txt b/pxr/usd/usdRender/CMakeLists.txt index 243729f102..ee681772a1 100644 --- a/pxr/usd/usdRender/CMakeLists.txt +++ b/pxr/usd/usdRender/CMakeLists.txt @@ -10,7 +10,6 @@ pxr_library(usdRender usdShade PUBLIC_CLASSES - denoisePass pass product settings @@ -27,7 +26,6 @@ pxr_library(usdRender PYMODULE_CPPFILES module.cpp - wrapDenoisePass.cpp wrapPass.cpp wrapProduct.cpp wrapSettingsBase.cpp diff --git a/pxr/usd/usdRender/denoisePass.cpp b/pxr/usd/usdRender/denoisePass.cpp deleted file mode 100644 index 652af858e9..0000000000 --- a/pxr/usd/usdRender/denoisePass.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// -#include "pxr/usd/usdRender/denoisePass.h" -#include "pxr/usd/usd/schemaRegistry.h" -#include "pxr/usd/usd/typed.h" - -#include "pxr/usd/sdf/types.h" -#include "pxr/usd/sdf/assetPath.h" - -PXR_NAMESPACE_OPEN_SCOPE - -// Register the schema with the TfType system. -TF_REGISTRY_FUNCTION(TfType) -{ - TfType::Define >(); - - // Register the usd prim typename as an alias under UsdSchemaBase. This - // enables one to call - // TfType::Find().FindDerivedByName("RenderDenoisePass") - // to find TfType, which is how IsA queries are - // answered. - TfType::AddAlias("RenderDenoisePass"); -} - -/* virtual */ -UsdRenderDenoisePass::~UsdRenderDenoisePass() -{ -} - -/* static */ -UsdRenderDenoisePass -UsdRenderDenoisePass::Get(const UsdStagePtr &stage, const SdfPath &path) -{ - if (!stage) { - TF_CODING_ERROR("Invalid stage"); - return UsdRenderDenoisePass(); - } - return UsdRenderDenoisePass(stage->GetPrimAtPath(path)); -} - -/* static */ -UsdRenderDenoisePass -UsdRenderDenoisePass::Define( - const UsdStagePtr &stage, const SdfPath &path) -{ - static TfToken usdPrimTypeName("RenderDenoisePass"); - if (!stage) { - TF_CODING_ERROR("Invalid stage"); - return UsdRenderDenoisePass(); - } - return UsdRenderDenoisePass( - stage->DefinePrim(path, usdPrimTypeName)); -} - -/* virtual */ -UsdSchemaKind UsdRenderDenoisePass::_GetSchemaKind() const -{ - return UsdRenderDenoisePass::schemaKind; -} - -/* static */ -const TfType & -UsdRenderDenoisePass::_GetStaticTfType() -{ - static TfType tfType = TfType::Find(); - return tfType; -} - -/* static */ -bool -UsdRenderDenoisePass::_IsTypedSchema() -{ - static bool isTyped = _GetStaticTfType().IsA(); - return isTyped; -} - -/* virtual */ -const TfType & -UsdRenderDenoisePass::_GetTfType() const -{ - return _GetStaticTfType(); -} - -/*static*/ -const TfTokenVector& -UsdRenderDenoisePass::GetSchemaAttributeNames(bool includeInherited) -{ - static TfTokenVector localNames; - static TfTokenVector allNames = - UsdTyped::GetSchemaAttributeNames(true); - - if (includeInherited) - return allNames; - else - return localNames; -} - -PXR_NAMESPACE_CLOSE_SCOPE - -// ===================================================================== // -// Feel free to add custom code below this line. It will be preserved by -// the code generator. -// -// Just remember to wrap code in the appropriate delimiters: -// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'. -// ===================================================================== // -// --(BEGIN CUSTOM CODE)-- diff --git a/pxr/usd/usdRender/denoisePass.h b/pxr/usd/usdRender/denoisePass.h deleted file mode 100644 index 26cde762c5..0000000000 --- a/pxr/usd/usdRender/denoisePass.h +++ /dev/null @@ -1,157 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// -#ifndef USDRENDER_GENERATED_DENOISEPASS_H -#define USDRENDER_GENERATED_DENOISEPASS_H - -/// \file usdRender/denoisePass.h - -#include "pxr/pxr.h" -#include "pxr/usd/usdRender/api.h" -#include "pxr/usd/usd/typed.h" -#include "pxr/usd/usd/prim.h" -#include "pxr/usd/usd/stage.h" - -#include "pxr/base/vt/value.h" - -#include "pxr/base/gf/vec3d.h" -#include "pxr/base/gf/vec3f.h" -#include "pxr/base/gf/matrix4d.h" - -#include "pxr/base/tf/token.h" -#include "pxr/base/tf/type.h" - -PXR_NAMESPACE_OPEN_SCOPE - -class SdfAssetPath; - -// -------------------------------------------------------------------------- // -// RENDERDENOISEPASS // -// -------------------------------------------------------------------------- // - -/// \class UsdRenderDenoisePass -/// -/// A RenderDenoisePass generates renders via a denoising process. -/// This may be the same renderer that a pipeline uses for UsdRender, -/// or may be a separate one. Notably, a RenderDenoisePass requires -/// another Pass to be present for it to operate. The denoising process -/// itself is not generative, and requires images inputs to operate. -/// -/// As denoising integration varies so widely across pipelines, all -/// implementation details are left to pipeline-specific prims -/// that inherit from RenderDenoisePass. -/// -/// -class UsdRenderDenoisePass : public UsdTyped -{ -public: - /// Compile time constant representing what kind of schema this class is. - /// - /// \sa UsdSchemaKind - static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped; - - /// Construct a UsdRenderDenoisePass on UsdPrim \p prim . - /// Equivalent to UsdRenderDenoisePass::Get(prim.GetStage(), prim.GetPath()) - /// for a \em valid \p prim, but will not immediately throw an error for - /// an invalid \p prim - explicit UsdRenderDenoisePass(const UsdPrim& prim=UsdPrim()) - : UsdTyped(prim) - { - } - - /// Construct a UsdRenderDenoisePass on the prim held by \p schemaObj . - /// Should be preferred over UsdRenderDenoisePass(schemaObj.GetPrim()), - /// as it preserves SchemaBase state. - explicit UsdRenderDenoisePass(const UsdSchemaBase& schemaObj) - : UsdTyped(schemaObj) - { - } - - /// Destructor. - USDRENDER_API - virtual ~UsdRenderDenoisePass(); - - /// Return a vector of names of all pre-declared attributes for this schema - /// class and all its ancestor classes. Does not include attributes that - /// may be authored by custom/extended methods of the schemas involved. - USDRENDER_API - static const TfTokenVector & - GetSchemaAttributeNames(bool includeInherited=true); - - /// Return a UsdRenderDenoisePass holding the prim adhering to this - /// schema at \p path on \p stage. If no prim exists at \p path on - /// \p stage, or if the prim at that path does not adhere to this schema, - /// return an invalid schema object. This is shorthand for the following: - /// - /// \code - /// UsdRenderDenoisePass(stage->GetPrimAtPath(path)); - /// \endcode - /// - USDRENDER_API - static UsdRenderDenoisePass - Get(const UsdStagePtr &stage, const SdfPath &path); - - /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path - /// is defined (according to UsdPrim::IsDefined()) on this stage. - /// - /// If a prim adhering to this schema at \p path is already defined on this - /// stage, return that prim. Otherwise author an \a SdfPrimSpec with - /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for - /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s - /// with \p specifier == \a SdfSpecifierDef and empty typeName at the - /// current EditTarget for any nonexistent, or existing but not \a Defined - /// ancestors. - /// - /// The given \a path must be an absolute prim path that does not contain - /// any variant selections. - /// - /// If it is impossible to author any of the necessary PrimSpecs, (for - /// example, in case \a path cannot map to the current UsdEditTarget's - /// namespace) issue an error and return an invalid \a UsdPrim. - /// - /// Note that this method may return a defined prim whose typeName does not - /// specify this schema class, in case a stronger typeName opinion overrides - /// the opinion at the current EditTarget. - /// - USDRENDER_API - static UsdRenderDenoisePass - Define(const UsdStagePtr &stage, const SdfPath &path); - -protected: - /// Returns the kind of schema this class belongs to. - /// - /// \sa UsdSchemaKind - USDRENDER_API - UsdSchemaKind _GetSchemaKind() const override; - -private: - // needs to invoke _GetStaticTfType. - friend class UsdSchemaRegistry; - USDRENDER_API - static const TfType &_GetStaticTfType(); - - static bool _IsTypedSchema(); - - // override SchemaBase virtuals. - USDRENDER_API - const TfType &_GetTfType() const override; - -public: - // ===================================================================== // - // Feel free to add custom code below this line, it will be preserved by - // the code generator. - // - // Just remember to: - // - Close the class declaration with }; - // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE - // - Close the include guard with #endif - // ===================================================================== // - // --(BEGIN CUSTOM CODE)-- -}; - -PXR_NAMESPACE_CLOSE_SCOPE - -#endif diff --git a/pxr/usd/usdRender/generatedSchema.usda b/pxr/usd/usdRender/generatedSchema.usda index 781b67b7e9..0ae7525ec2 100644 --- a/pxr/usd/usdRender/generatedSchema.usda +++ b/pxr/usd/usdRender/generatedSchema.usda @@ -487,11 +487,6 @@ class RenderPass "RenderPass" ( uniform bool denoise:enable = 0 ( doc = "When True, this Pass pass should be denoised." ) - rel denoise:pass ( - doc = """The The UsdRenderDenoisePass prim from which to - source denoise settings. - """ - ) uniform asset fileName ( doc = """The asset that contains the rendering prims or other information needed to render this pass. @@ -544,18 +539,3 @@ class RenderPass "RenderPass" ( ) } -class RenderDenoisePass "RenderDenoisePass" ( - doc = """A RenderDenoisePass generates renders via a denoising process. - This may be the same renderer that a pipeline uses for UsdRender, - or may be a separate one. Notably, a RenderDenoisePass requires - another Pass to be present for it to operate. The denoising process - itself is not generative, and requires images inputs to operate. - - As denoising integration varies so widely across pipelines, all - implementation details are left to pipeline-specific prims - that inherit from RenderDenoisePass. - """ -) -{ -} - diff --git a/pxr/usd/usdRender/module.cpp b/pxr/usd/usdRender/module.cpp index a06fc1819d..74534957e4 100644 --- a/pxr/usd/usdRender/module.cpp +++ b/pxr/usd/usdRender/module.cpp @@ -17,5 +17,4 @@ TF_WRAP_MODULE TF_WRAP(UsdRenderVar); TF_WRAP(UsdRenderTokens); TF_WRAP(UsdRenderPass); - TF_WRAP(UsdRenderDenoisePass); } diff --git a/pxr/usd/usdRender/pass.cpp b/pxr/usd/usdRender/pass.cpp index 3f9ecef158..6cdbc3b95b 100644 --- a/pxr/usd/usdRender/pass.cpp +++ b/pxr/usd/usdRender/pass.cpp @@ -180,19 +180,6 @@ UsdRenderPass::CreateInputPassesRel() const /* custom = */ false); } -UsdRelationship -UsdRenderPass::GetDenoisePassRel() const -{ - return GetPrim().GetRelationship(UsdRenderTokens->denoisePass); -} - -UsdRelationship -UsdRenderPass::CreateDenoisePassRel() const -{ - return GetPrim().CreateRelationship(UsdRenderTokens->denoisePass, - /* custom = */ false); -} - namespace { static inline TfTokenVector _ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right) diff --git a/pxr/usd/usdRender/pass.h b/pxr/usd/usdRender/pass.h index e56a829066..04f336e3ef 100644 --- a/pxr/usd/usdRender/pass.h +++ b/pxr/usd/usdRender/pass.h @@ -374,22 +374,6 @@ class UsdRenderPass : public UsdTyped USDRENDER_API UsdRelationship CreateInputPassesRel() const; -public: - // --------------------------------------------------------------------- // - // DENOISEPASS - // --------------------------------------------------------------------- // - /// The The UsdRenderDenoisePass prim from which to - /// source denoise settings. - /// - /// - USDRENDER_API - UsdRelationship GetDenoisePassRel() const; - - /// See GetDenoisePassRel(), and also - /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create - USDRENDER_API - UsdRelationship CreateDenoisePassRel() const; - public: // ===================================================================== // // Feel free to add custom code below this line, it will be preserved by diff --git a/pxr/usd/usdRender/plugInfo.json b/pxr/usd/usdRender/plugInfo.json index 2de1f5df38..54ac51b67b 100644 --- a/pxr/usd/usdRender/plugInfo.json +++ b/pxr/usd/usdRender/plugInfo.json @@ -13,16 +13,6 @@ } }, "Types": { - "UsdRenderDenoisePass": { - "alias": { - "UsdSchemaBase": "RenderDenoisePass" - }, - "autoGenerated": true, - "bases": [ - "UsdTyped" - ], - "schemaKind": "concreteTyped" - }, "UsdRenderPass": { "alias": { "UsdSchemaBase": "RenderPass" diff --git a/pxr/usd/usdRender/schema.usda b/pxr/usd/usdRender/schema.usda index 7f0fddfa55..aab399649f 100644 --- a/pxr/usd/usdRender/schema.usda +++ b/pxr/usd/usdRender/schema.usda @@ -410,34 +410,9 @@ class RenderPass "RenderPass" ( doc = """When True, this Pass pass should be denoised.""" ) - rel denoise:pass ( - doc = """The The UsdRenderDenoisePass prim from which to - source denoise settings. - """ - ) - uniform bool collection:renderVisibility:includeRoot = 1 ( customData = { bool apiSchemaOverride = true } ) } - - -class RenderDenoisePass "RenderDenoisePass" ( - inherits = - doc = """A RenderDenoisePass generates renders via a denoising process. - This may be the same renderer that a pipeline uses for UsdRender, - or may be a separate one. Notably, a RenderDenoisePass requires - another Pass to be present for it to operate. The denoising process - itself is not generative, and requires images inputs to operate. - - As denoising integration varies so widely across pipelines, all - implementation details are left to pipeline-specific prims - that inherit from RenderDenoisePass. - """ - customData = { - string className = "DenoisePass" - } -) { -} diff --git a/pxr/usd/usdRender/tokens.cpp b/pxr/usd/usdRender/tokens.cpp index c6d9b3b286..c5e8699c2b 100644 --- a/pxr/usd/usdRender/tokens.cpp +++ b/pxr/usd/usdRender/tokens.cpp @@ -22,7 +22,6 @@ UsdRenderTokensType::UsdRenderTokensType() : dataWindowNDC("dataWindowNDC", TfToken::Immortal), deepRaster("deepRaster", TfToken::Immortal), denoiseEnable("denoise:enable", TfToken::Immortal), - denoisePass("denoise:pass", TfToken::Immortal), disableDepthOfField("disableDepthOfField", TfToken::Immortal), disableMotionBlur("disableMotionBlur", TfToken::Immortal), expandAperture("expandAperture", TfToken::Immortal), @@ -51,7 +50,6 @@ UsdRenderTokensType::UsdRenderTokensType() : resolution("resolution", TfToken::Immortal), sourceName("sourceName", TfToken::Immortal), sourceType("sourceType", TfToken::Immortal), - RenderDenoisePass("RenderDenoisePass", TfToken::Immortal), RenderPass("RenderPass", TfToken::Immortal), RenderProduct("RenderProduct", TfToken::Immortal), RenderSettings("RenderSettings", TfToken::Immortal), @@ -71,7 +69,6 @@ UsdRenderTokensType::UsdRenderTokensType() : dataWindowNDC, deepRaster, denoiseEnable, - denoisePass, disableDepthOfField, disableMotionBlur, expandAperture, @@ -100,7 +97,6 @@ UsdRenderTokensType::UsdRenderTokensType() : resolution, sourceName, sourceType, - RenderDenoisePass, RenderPass, RenderProduct, RenderSettings, diff --git a/pxr/usd/usdRender/tokens.h b/pxr/usd/usdRender/tokens.h index 86994164ab..6d43f64c7a 100644 --- a/pxr/usd/usdRender/tokens.h +++ b/pxr/usd/usdRender/tokens.h @@ -97,10 +97,6 @@ struct UsdRenderTokensType { /// /// UsdRenderPass const TfToken denoiseEnable; - /// \brief "denoise:pass" - /// - /// UsdRenderPass - const TfToken denoisePass; /// \brief "disableDepthOfField" /// /// UsdRenderSettingsBase @@ -213,10 +209,6 @@ struct UsdRenderTokensType { /// /// UsdRenderVar const TfToken sourceType; - /// \brief "RenderDenoisePass" - /// - /// Schema identifer and family for UsdRenderDenoisePass - const TfToken RenderDenoisePass; /// \brief "RenderPass" /// /// Schema identifer and family for UsdRenderPass diff --git a/pxr/usd/usdRender/wrapDenoisePass.cpp b/pxr/usd/usdRender/wrapDenoisePass.cpp deleted file mode 100644 index bbee508165..0000000000 --- a/pxr/usd/usdRender/wrapDenoisePass.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// Copyright 2016 Pixar -// -// Licensed under the terms set forth in the LICENSE.txt file available at -// https://openusd.org/license. -// -#include "pxr/usd/usdRender/denoisePass.h" -#include "pxr/usd/usd/schemaBase.h" - -#include "pxr/usd/sdf/primSpec.h" - -#include "pxr/usd/usd/pyConversions.h" -#include "pxr/base/tf/pyContainerConversions.h" -#include "pxr/base/tf/pyResultConversions.h" -#include "pxr/base/tf/pyUtils.h" -#include "pxr/base/tf/wrapTypeHelpers.h" - -#include - -#include - -using namespace boost::python; - -PXR_NAMESPACE_USING_DIRECTIVE - -namespace { - -#define WRAP_CUSTOM \ - template static void _CustomWrapCode(Cls &_class) - -// fwd decl. -WRAP_CUSTOM; - - -static std::string -_Repr(const UsdRenderDenoisePass &self) -{ - std::string primRepr = TfPyRepr(self.GetPrim()); - return TfStringPrintf( - "UsdRender.DenoisePass(%s)", - primRepr.c_str()); -} - -} // anonymous namespace - -void wrapUsdRenderDenoisePass() -{ - typedef UsdRenderDenoisePass This; - - class_ > - cls("DenoisePass"); - - cls - .def(init(arg("prim"))) - .def(init(arg("schemaObj"))) - .def(TfTypePythonClass()) - - .def("Get", &This::Get, (arg("stage"), arg("path"))) - .staticmethod("Get") - - .def("Define", &This::Define, (arg("stage"), arg("path"))) - .staticmethod("Define") - - .def("GetSchemaAttributeNames", - &This::GetSchemaAttributeNames, - arg("includeInherited")=true, - return_value_policy()) - .staticmethod("GetSchemaAttributeNames") - - .def("_GetStaticTfType", (TfType const &(*)()) TfType::Find, - return_value_policy()) - .staticmethod("_GetStaticTfType") - - .def(!self) - - - .def("__repr__", ::_Repr) - ; - - _CustomWrapCode(cls); -} - -// ===================================================================== // -// Feel free to add custom code below this line, it will be preserved by -// the code generator. The entry point for your custom code should look -// minimally like the following: -// -// WRAP_CUSTOM { -// _class -// .def("MyCustomMethod", ...) -// ; -// } -// -// Of course any other ancillary or support code may be provided. -// -// Just remember to wrap code in the appropriate delimiters: -// 'namespace {', '}'. -// -// ===================================================================== // -// --(BEGIN CUSTOM CODE)-- - -namespace { - -WRAP_CUSTOM { -} - -} diff --git a/pxr/usd/usdRender/wrapPass.cpp b/pxr/usd/usdRender/wrapPass.cpp index 8ae83beff5..983d86656e 100644 --- a/pxr/usd/usdRender/wrapPass.cpp +++ b/pxr/usd/usdRender/wrapPass.cpp @@ -140,11 +140,6 @@ void wrapUsdRenderPass() &This::GetInputPassesRel) .def("CreateInputPassesRel", &This::CreateInputPassesRel) - - .def("GetDenoisePassRel", - &This::GetDenoisePassRel) - .def("CreateDenoisePassRel", - &This::CreateDenoisePassRel) .def("__repr__", ::_Repr) ; diff --git a/pxr/usd/usdRender/wrapTokens.cpp b/pxr/usd/usdRender/wrapTokens.cpp index 17bf5e53ec..2068f127c4 100644 --- a/pxr/usd/usdRender/wrapTokens.cpp +++ b/pxr/usd/usdRender/wrapTokens.cpp @@ -30,7 +30,6 @@ void wrapUsdRenderTokens() _ADD_TOKEN(cls, dataWindowNDC); _ADD_TOKEN(cls, deepRaster); _ADD_TOKEN(cls, denoiseEnable); - _ADD_TOKEN(cls, denoisePass); _ADD_TOKEN(cls, disableDepthOfField); _ADD_TOKEN(cls, disableMotionBlur); _ADD_TOKEN(cls, expandAperture); @@ -59,7 +58,6 @@ void wrapUsdRenderTokens() _ADD_TOKEN(cls, resolution); _ADD_TOKEN(cls, sourceName); _ADD_TOKEN(cls, sourceType); - _ADD_TOKEN(cls, RenderDenoisePass); _ADD_TOKEN(cls, RenderPass); _ADD_TOKEN(cls, RenderProduct); _ADD_TOKEN(cls, RenderSettings); From 98d79154cfdd411886d700ad4a4c087c7b8f9283 Mon Sep 17 00:00:00 2001 From: michaeljefferies Date: Mon, 26 Aug 2024 15:10:39 -0700 Subject: [PATCH 101/202] This change adds a utility class for generating Disk shaped meshes - GeomUtilDiskMeshGenerator. I also noticed that module.cpp was missing TF_WRAP for PlaneMeshGenerator so I added that as well. (Internal change: 2338397) --- pxr/imaging/geomUtil/CMakeLists.txt | 2 + pxr/imaging/geomUtil/diskMeshGenerator.cpp | 97 ++++++++++++++++ pxr/imaging/geomUtil/diskMeshGenerator.h | 107 ++++++++++++++++++ pxr/imaging/geomUtil/meshGeneratorBase.cpp | 5 - pxr/imaging/geomUtil/module.cpp | 2 + .../geomUtil/testenv/testMeshGenerators.cpp | 33 ++++++ .../baseline/generatedMeshes_closed.txt | 12 ++ .../baseline/generatedMeshes_open.txt | 12 ++ .../geomUtil/wrapDiskMeshGenerator.cpp | 54 +++++++++ 9 files changed, 319 insertions(+), 5 deletions(-) create mode 100644 pxr/imaging/geomUtil/diskMeshGenerator.cpp create mode 100644 pxr/imaging/geomUtil/diskMeshGenerator.h create mode 100644 pxr/imaging/geomUtil/wrapDiskMeshGenerator.cpp diff --git a/pxr/imaging/geomUtil/CMakeLists.txt b/pxr/imaging/geomUtil/CMakeLists.txt index 060ff3b6e5..932e3bc76c 100644 --- a/pxr/imaging/geomUtil/CMakeLists.txt +++ b/pxr/imaging/geomUtil/CMakeLists.txt @@ -14,6 +14,7 @@ pxr_library(geomUtil coneMeshGenerator cuboidMeshGenerator cylinderMeshGenerator + diskMeshGenerator meshGeneratorBase planeMeshGenerator sphereMeshGenerator @@ -30,6 +31,7 @@ pxr_library(geomUtil wrapConeMeshGenerator.cpp wrapCuboidMeshGenerator.cpp wrapCylinderMeshGenerator.cpp + wrapDiskMeshGenerator.cpp wrapPlaneMeshGenerator.cpp wrapSphereMeshGenerator.cpp diff --git a/pxr/imaging/geomUtil/diskMeshGenerator.cpp b/pxr/imaging/geomUtil/diskMeshGenerator.cpp new file mode 100644 index 0000000000..e78a1094e7 --- /dev/null +++ b/pxr/imaging/geomUtil/diskMeshGenerator.cpp @@ -0,0 +1,97 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/imaging/geomUtil/diskMeshGenerator.h" + +#include "pxr/imaging/pxOsd/meshTopology.h" +#include "pxr/imaging/pxOsd/tokens.h" + +#include "pxr/base/arch/math.h" +#include "pxr/base/vt/types.h" + +#include +#include +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + + +// static +size_t +GeomUtilDiskMeshGenerator::ComputeNumPoints( + const size_t numRadial, + const bool closedSweep) +{ + if (numRadial < minNumRadial) { + return 0; + } + + return _ComputeNumCappedQuadTopologyPoints( + numRadial, + /* numQuadStrips = */ 0, + /* bottomCapStyle = */ CapStyleNone, + /* topCapStyle = */ CapStyleSeparateEdge, + closedSweep); +} + +// static +PxOsdMeshTopology +GeomUtilDiskMeshGenerator::GenerateTopology( + const size_t numRadial, + const bool closedSweep) +{ + if (numRadial < minNumRadial) { + return PxOsdMeshTopology(); + } + + return _GenerateCappedQuadTopology( + numRadial, + /* numQuadStrips = */ 0, + /* bottomCapStyle = */ CapStyleNone, + /* topCapStyle = */ CapStyleSeparateEdge, + closedSweep); +} + +// static +template +void +GeomUtilDiskMeshGenerator::_GeneratePointsImpl( + const size_t numRadial, + const typename PointType::ScalarType radius, + const typename PointType::ScalarType sweepDegrees, + const _PointWriter& ptWriter) +{ + using ScalarType = typename PointType::ScalarType; + + if (numRadial < minNumRadial) { + return; + } + + // Construct a circular arc of unit radius in the XY plane. + const std::vector> ringXY = + _GenerateUnitArcXY(numRadial, sweepDegrees); + + // A ring for the outer edge. + ptWriter.WriteArc(radius, ringXY, 0.0); + + // Center point: + ptWriter.Write(PointType(0.0, 0.0, 0.0)); +} + +// Force-instantiate _GeneratePointsImpl for the supported point types. Only +// these instantiations will ever be needed due to the SFINAE machinery on the +// calling method template (the public GeneratePoints, in the header). +template GEOMUTIL_API void GeomUtilDiskMeshGenerator::_GeneratePointsImpl( + const size_t, const float, const float, + const GeomUtilDiskMeshGenerator::_PointWriter&); + +template GEOMUTIL_API void GeomUtilDiskMeshGenerator::_GeneratePointsImpl( + const size_t, const double, const double, + const GeomUtilDiskMeshGenerator::_PointWriter&); + + +PXR_NAMESPACE_CLOSE_SCOPE \ No newline at end of file diff --git a/pxr/imaging/geomUtil/diskMeshGenerator.h b/pxr/imaging/geomUtil/diskMeshGenerator.h new file mode 100644 index 0000000000..b5d13d4b0c --- /dev/null +++ b/pxr/imaging/geomUtil/diskMeshGenerator.h @@ -0,0 +1,107 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_IMAGING_GEOM_UTIL_DISK_MESH_GENERATOR_H +#define PXR_IMAGING_GEOM_UTIL_DISK_MESH_GENERATOR_H + +#include "pxr/imaging/geomUtil/api.h" +#include "pxr/imaging/geomUtil/meshGeneratorBase.h" + +#include "pxr/pxr.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class GfMatrix4d; +class PxOsdMeshTopology; + +/// This class provides an implementation for generating topology and point +/// positions on a circular Disk given the radius with numRadial segments. +/// The generated Disk is centered at the origin. +/// +/// An optional transform may be provided to GeneratePoints to orient the +/// Disk as necessary. +/// +/// Usage: +/// \code{.cpp} +/// +/// const size_t numRadial = 8; +/// const size_t numPoints = +/// GeomUtilDiskMeshGenerator::ComputeNumPoints(numRadial); +/// const float radius = 6; +/// +/// MyPointContainer points(numPoints); +/// +/// GeomUtilDiskMeshGenerator::GeneratePoints( +/// points.begin(), numRadial, radius); +/// +/// \endcode +/// +class GeomUtilDiskMeshGenerator final + : public GeomUtilMeshGeneratorBase +{ +public: + static constexpr size_t minNumRadial = 3; + + GEOMUTIL_API + static size_t ComputeNumPoints( + const size_t numRadial, + const bool closedSweep = true); + + GEOMUTIL_API + static PxOsdMeshTopology GenerateTopology( + const size_t numRadial, + const bool closedSweep = true); + + template::type> + static void GeneratePoints( + PointIterType iter, + const size_t numRadial, + const ScalarType radius, + const GfMatrix4d* framePtr = nullptr) + { + constexpr ScalarType sweep = 360; + + GeneratePoints(iter, numRadial, + radius, sweep, framePtr); + } + + template::type> + static void GeneratePoints( + PointIterType iter, + const size_t numRadial, + const ScalarType radius, + const ScalarType sweepDegrees, + const GfMatrix4d* framePtr = nullptr) + { + using PointType = + typename std::iterator_traits::value_type; + + _GeneratePointsImpl(numRadial, radius, sweepDegrees, + framePtr ? _PointWriter(iter, framePtr) + : _PointWriter(iter)); + } + + using GeomUtilMeshGeneratorBase::GeneratePoints; + +private: + + template + static void _GeneratePointsImpl( + const size_t numRadial, + const typename PointType::ScalarType radius, + const typename PointType::ScalarType sweepDegrees, + const _PointWriter& ptWriter); +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_GEOM_UTIL_DISK_MESH_GENERATOR_H diff --git a/pxr/imaging/geomUtil/meshGeneratorBase.cpp b/pxr/imaging/geomUtil/meshGeneratorBase.cpp index 71db8677e0..1c22579da7 100644 --- a/pxr/imaging/geomUtil/meshGeneratorBase.cpp +++ b/pxr/imaging/geomUtil/meshGeneratorBase.cpp @@ -24,11 +24,6 @@ GeomUtilMeshGeneratorBase::_GenerateCappedQuadTopology( const GeomUtilMeshGeneratorBase::_CapStyle topCapStyle, const bool closedSweep) { - if (numRadial < 3) { - TF_CODING_ERROR("Invalid topology requested."); - return PxOsdMeshTopology(); - } - const size_t numTriStrips = (bottomCapStyle != CapStyleNone) + (topCapStyle != CapStyleNone); const size_t numTris = numTriStrips * numRadial; diff --git a/pxr/imaging/geomUtil/module.cpp b/pxr/imaging/geomUtil/module.cpp index de568b2db2..301d49e577 100644 --- a/pxr/imaging/geomUtil/module.cpp +++ b/pxr/imaging/geomUtil/module.cpp @@ -15,5 +15,7 @@ TF_WRAP_MODULE TF_WRAP(ConeMeshGenerator); TF_WRAP(CuboidMeshGenerator); TF_WRAP(CylinderMeshGenerator); + TF_WRAP(DiskMeshGenerator); + TF_WRAP(PlaneMeshGenerator); TF_WRAP(SphereMeshGenerator); } diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp b/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp index a09cd7a203..ccf558f563 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators.cpp @@ -11,6 +11,7 @@ #include "pxr/imaging/geomUtil/coneMeshGenerator.h" #include "pxr/imaging/geomUtil/cuboidMeshGenerator.h" #include "pxr/imaging/geomUtil/cylinderMeshGenerator.h" +#include "pxr/imaging/geomUtil/diskMeshGenerator.h" #include "pxr/imaging/geomUtil/planeMeshGenerator.h" #include "pxr/imaging/geomUtil/sphereMeshGenerator.h" #include "pxr/imaging/pxOsd/meshTopology.h" @@ -300,6 +301,38 @@ static bool TestTopologyAndPointGeneration( _LogFooter(out); } + { + _LogHeader("9. Disk", out); + + using MeshGen = GeomUtilDiskMeshGenerator; + + const size_t numRadial = 10; + const float radius = 0.5; + + out << "radius = " << radius + << ", sweep = " << sweep + << std::endl << std::endl; + + const PxOsdMeshTopology topology = + MeshGen::GenerateTopology(numRadial, closedSweep); + + const size_t numPoints = + MeshGen::ComputeNumPoints(numRadial, closedSweep); + VtVec3fArray points(numPoints); + if (closedSweep) { + MeshGen::GeneratePoints( + points.begin(), numRadial, radius); + + } else { + MeshGen::GeneratePoints( + points.begin(), numRadial, radius, sweep); + } + + _Log(topology, points, out); + + _LogFooter(out); + } + return true; } diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt index 526a071705..62aebaa5c7 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_closed.txt @@ -96,3 +96,15 @@ Points: +9. Disk +------- +radius = 0.5, sweep = 360 + +Topology: + (rightHanded, catmullClark, ([3, 3, 3, 3, 3, 3, 3, 3, 3, 3]), ([10, 11, 20, 11, 12, 20, 12, 13, 20, 13, 14, 20, 14, 15, 20, 15, 16, 20, 16, 17, 20, 17, 18, 20, 18, 19, 20, 19, 10, 20]), ([])) + +Points: + [(0.5, 0, 0), (0.4045085, 0.29389262, 0), (0.15450849, 0.47552827, 0), (-0.15450858, 0.47552824, 0), (-0.40450853, 0.2938926, 0), (-0.5, -4.371139e-8, 0), (-0.40450838, -0.29389277, 0), (-0.15450855, -0.47552824, 0), (0.15450856, -0.47552824, 0), (0.40450847, -0.29389265, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)] + + + diff --git a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt index 5da29dcd93..87090ed473 100644 --- a/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt +++ b/pxr/imaging/geomUtil/testenv/testMeshGenerators/baseline/generatedMeshes_open.txt @@ -96,3 +96,15 @@ Points: +9. Disk +------- +radius = 0.5, sweep = 120 + +Topology: + (rightHanded, catmullClark, ([3, 3, 3, 3, 3, 3, 3, 3, 3, 3]), ([11, 12, 22, 12, 13, 22, 13, 14, 22, 14, 15, 22, 15, 16, 22, 16, 17, 22, 17, 18, 22, 18, 19, 22, 19, 20, 22, 20, 21, 22]), ([])) + +Points: + [(0.5, 0, 0), (0.4890738, 0.10395585, 0), (0.4567727, 0.20336832, 0), (0.4045085, 0.29389262, 0), (0.33456528, 0.37157243, 0), (0.24999999, 0.43301272, 0), (0.15450849, 0.47552827, 0), (0.05226421, 0.49726096, 0), (-0.052264255, 0.49726096, 0), (-0.15450852, 0.47552824, 0), (-0.25000003, 0.4330127, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)] + + + diff --git a/pxr/imaging/geomUtil/wrapDiskMeshGenerator.cpp b/pxr/imaging/geomUtil/wrapDiskMeshGenerator.cpp new file mode 100644 index 0000000000..c4f5e1ceb5 --- /dev/null +++ b/pxr/imaging/geomUtil/wrapDiskMeshGenerator.cpp @@ -0,0 +1,54 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/imaging/geomUtil/diskMeshGenerator.h" + +#include "pxr/imaging/pxOsd/meshTopology.h" + +#include "pxr/base/vt/types.h" + +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +static VtVec3fArray +_WrapGeneratePoints( + const size_t numRadial, + const float radius) +{ + const size_t numPoints = + GeomUtilDiskMeshGenerator::ComputeNumPoints(numRadial); + if (numPoints == 0) { + return VtVec3fArray(); + } + + VtVec3fArray points(numPoints); + GeomUtilDiskMeshGenerator::GeneratePoints( + points.begin(), numRadial, radius); + + return points; +} + +void wrapDiskMeshGenerator() +{ + using This = GeomUtilDiskMeshGenerator; + + // Note: These are only "classes" for name scoping, and are uninstantiable; + // hence no need to bother declaring bases. + class_("DiskMeshGenerator", no_init) + + .def("ComputeNumPoints", &This::ComputeNumPoints) + .staticmethod("ComputeNumPoints") + + .def("GenerateTopology", &This::GenerateTopology) + .staticmethod("GenerateTopology") + + .def("GeneratePoints", &_WrapGeneratePoints) + .staticmethod("GeneratePoints") + ; +} From 30c7934c847e37ec0e7f4289efc642852c84a6b4 Mon Sep 17 00:00:00 2001 From: meshula Date: Mon, 26 Aug 2024 15:18:55 -0700 Subject: [PATCH 102/202] Add python bindings to GfColor and GfColorSpace (Internal change: 2338443) --- pxr/base/gf/CMakeLists.txt | 15 ++- pxr/base/gf/module.cpp | 2 + .../{testGfColor.cpp => testGfColorCpp.cpp} | 0 pxr/base/gf/testenv/testGfColorPy.py | 99 +++++++++++++++++++ pxr/base/gf/wrapColor.cpp | 58 +++++++++++ pxr/base/gf/wrapColorSpace.cpp | 59 +++++++++++ 6 files changed, 229 insertions(+), 4 deletions(-) rename pxr/base/gf/testenv/{testGfColor.cpp => testGfColorCpp.cpp} (100%) create mode 100644 pxr/base/gf/testenv/testGfColorPy.py create mode 100644 pxr/base/gf/wrapColor.cpp create mode 100644 pxr/base/gf/wrapColorSpace.cpp diff --git a/pxr/base/gf/CMakeLists.txt b/pxr/base/gf/CMakeLists.txt index b98922bf47..aa515ab818 100644 --- a/pxr/base/gf/CMakeLists.txt +++ b/pxr/base/gf/CMakeLists.txt @@ -95,6 +95,8 @@ pxr_library(gf module.cpp wrapBBox3d.cpp wrapCamera.cpp + wrapColor.cpp + wrapColorSpace.cpp wrapDualQuatd.cpp wrapDualQuatf.cpp wrapDualQuath.cpp @@ -178,16 +180,17 @@ pxr_build_test(testGfHardToReach testenv/testGfHardToReach.cpp ) -pxr_build_test(testGfColor +pxr_build_test(testGfColorCpp LIBRARIES gf CPPFILES - testenv/testGfColor.cpp + testenv/testGfColorCpp.cpp ) pxr_test_scripts( testenv/testGfBBox3d.py testenv/testGfCamera.py + testenv/testGfColorPy.py testenv/testGfDecomposeRotation.py testenv/testGfDualQuaternion.py testenv/testGfFrustum.py @@ -214,8 +217,12 @@ pxr_register_test(testGfBBox3d PYTHON COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testGfBBox3d" ) -pxr_register_test(testGfColor - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testGfColor" +pxr_register_test(testGfColorPy + PYTHON + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testGfColorPy" +) +pxr_register_test(testGfColorCpp + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testGfColorCpp" ) pxr_register_test(testGfDecomposeRotation PYTHON diff --git a/pxr/base/gf/module.cpp b/pxr/base/gf/module.cpp index ab8d7fec54..14eb9254c0 100644 --- a/pxr/base/gf/module.cpp +++ b/pxr/base/gf/module.cpp @@ -13,6 +13,8 @@ PXR_NAMESPACE_USING_DIRECTIVE TF_WRAP_MODULE { TF_WRAP( BBox3d ); + TF_WRAP( Color ); + TF_WRAP( ColorSpace ); TF_WRAP( DualQuatd ); TF_WRAP( DualQuatf ); TF_WRAP( DualQuath ); diff --git a/pxr/base/gf/testenv/testGfColor.cpp b/pxr/base/gf/testenv/testGfColorCpp.cpp similarity index 100% rename from pxr/base/gf/testenv/testGfColor.cpp rename to pxr/base/gf/testenv/testGfColorCpp.cpp diff --git a/pxr/base/gf/testenv/testGfColorPy.py b/pxr/base/gf/testenv/testGfColorPy.py new file mode 100644 index 0000000000..df748bd8d5 --- /dev/null +++ b/pxr/base/gf/testenv/testGfColorPy.py @@ -0,0 +1,99 @@ +#!/pxrpythonsubst +# +# Copyright 2024 Pixar +# +# Licensed under the terms set forth in the LICENSE.txt file available at +# https://openusd.org/license/. +# + +import unittest +from pxr import Gf + +def colorApproxEq(c1, c2): + return Gf.IsClose(c1.GetRGB(), c2.GetRGB(), 1e-5) + +class TestGfColor(unittest.TestCase): + def setUp(self): + self.csSRGB = Gf.ColorSpace(Gf.ColorSpaceNames.SRGB) + self.csLinearSRGB = Gf.ColorSpace(Gf.ColorSpaceNames.LinearSRGB) + self.csLinearRec709 = Gf.ColorSpace(Gf.ColorSpaceNames.LinearRec709) + self.csG22Rec709 = Gf.ColorSpace(Gf.ColorSpaceNames.G22Rec709) + self.csAp0 = Gf.ColorSpace(Gf.ColorSpaceNames.LinearAP0) + self.csSRGBP3 = Gf.ColorSpace(Gf.ColorSpaceNames.SRGBDisplayP3) + self.csLinearRec2020 = Gf.ColorSpace(Gf.ColorSpaceNames.LinearRec2020) + self.csIdentity = Gf.ColorSpace(Gf.ColorSpaceNames.Identity) + + self.mauveLinear = Gf.Color(Gf.Vec3f(0.5, 0.25, 0.125), self.csLinearRec709) + self.mauveGamma = Gf.Color(self.mauveLinear, self.csG22Rec709) + + def test_Repr(self): + c = Gf.Color() + self.assertEqual(c, eval(repr(c))) + cs = Gf.ColorSpace("identity") + self.assertEqual(cs, eval(repr(cs))) + + def test_DefaultConstruction(self): + c = Gf.Color() + self.assertEqual(c.GetColorSpace(), self.csLinearRec709) + self.assertEqual(c.GetRGB(), Gf.Vec3f(0, 0, 0)) + + def test_ConstructionWithColorSpace(self): + c = Gf.Color(self.csSRGB) + self.assertEqual(c.GetColorSpace(), self.csSRGB) + self.assertEqual(c.GetRGB(), Gf.Vec3f(0, 0, 0)) + + def test_ConstructionWithColorSpaceAndRgb(self): + c = Gf.Color(Gf.Vec3f(0.5, 0.5, 0.5), self.csSRGB) + self.assertEqual(c.GetColorSpace(), self.csSRGB) + self.assertEqual(c.GetRGB(), Gf.Vec3f(0.5, 0.5, 0.5)) + + def test_EotfCurveLinear(self): + c1 = Gf.Color(self.mauveLinear, self.csSRGB) # convert linear to SRGB + c2 = Gf.Color(c1, self.csLinearSRGB) + self.assertTrue(Gf.IsClose(self.mauveLinear, c2, 1e-5)) + c3 = Gf.Color(c2, self.csSRGB) + self.assertTrue(Gf.IsClose(c1, c3, 1e-5)) + + def test_RoundTrippingToRec2020(self): + c1 = Gf.Color(self.mauveLinear, self.csLinearRec2020) + c2 = Gf.Color(c1, self.csLinearSRGB) + self.assertTrue(Gf.IsClose(self.mauveLinear, c2, 1e-5)) + + def test_ConstructionWithConversion(self): + colG22Rec709 = Gf.Color(self.mauveLinear, self.csG22Rec709) + self.assertTrue(Gf.IsClose(colG22Rec709, self.mauveGamma, 1e-5)) + colLinRec709 = Gf.Color(colG22Rec709, self.csLinearRec709) + self.assertTrue(Gf.IsClose(colLinRec709, self.mauveLinear, 1e-5)) + + self.assertEqual(colG22Rec709.GetColorSpace(), self.csG22Rec709) + self.assertEqual(colLinRec709.GetColorSpace(), self.csLinearRec709) + + colSRGB_2 = Gf.Color(colLinRec709, self.csSRGB) + colAp0 = Gf.Color(colSRGB_2, self.csAp0) + colSRGB_3 = Gf.Color(colAp0, self.csSRGB) + col_SRGBP3 = Gf.Color(colSRGB_3, self.csSRGBP3) + colLinRec709_2 = Gf.Color(col_SRGBP3, self.csLinearRec709) + self.assertTrue(Gf.IsClose(colLinRec709_2, colLinRec709, 1e-5)) + + def test_MoveConstructor(self): + c1 = Gf.Color(Gf.Vec3f(0.5, 0.25, 0.125), self.csAp0) + c2 = Gf.Color(c1) # Python doesn't have move semantics, but this tests copying + self.assertEqual(c2.GetColorSpace(), self.csAp0) + self.assertTrue(Gf.IsClose(c2.GetRGB(), Gf.Vec3f(0.5, 0.25, 0.125), 1e-5)) + + def test_CopyAssignment(self): + c1 = Gf.Color(Gf.Vec3f(0.5, 0.25, 0.125), self.csAp0) + c2 = Gf.Color() + c2 = c1 + self.assertEqual(c2.GetColorSpace(), self.csAp0) + self.assertTrue(Gf.IsClose(c2.GetRGB(), Gf.Vec3f(0.5, 0.25, 0.125), 1e-5)) + + def test_Comparison(self): + c1 = Gf.Color(Gf.Vec3f(0.5, 0.25, 0.125), self.csAp0) + c2 = Gf.Color(Gf.Vec3f(0.5, 0.25, 0.125), self.csAp0) + self.assertTrue(Gf.IsClose(c1, c2, 1e-5)) + self.assertEqual(c1.GetColorSpace(), c2.GetColorSpace()) + self.assertTrue(colorApproxEq(c1, c2)) + +if __name__ == '__main__': + unittest.main() diff --git a/pxr/base/gf/wrapColor.cpp b/pxr/base/gf/wrapColor.cpp new file mode 100644 index 0000000000..a1e9d84c63 --- /dev/null +++ b/pxr/base/gf/wrapColor.cpp @@ -0,0 +1,58 @@ +/// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/base/gf/color.h" +#include "pxr/base/gf/vec3f.h" +#include "pxr/base/gf/colorSpace.h" +#include "pxr/base/tf/pyUtils.h" +#include "pxr/base/tf/stringUtils.h" +#include +#include +#include +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +namespace { + +std::string __repr__(GfColor const &self) +{ + return TF_PY_REPR_PREFIX + + TfStringPrintf("Color(%s, %s)", + TfPyRepr(self.GetRGB()).c_str(), + TfPyRepr(self.GetColorSpace()).c_str()); +} + +} + +void wrapColor() +{ + class_("Color", + "A class representing a color, supporting different " + "color spaces.") + .def(init<>()) + .def(init()) + .def(init()) + .def(init()) + .def(init()) + .def("__repr__", &__repr__) + .def("SetFromPlanckianLocus", &GfColor::SetFromPlanckianLocus, + (arg("kelvin"), arg("luminance"))) + .def("GetRGB", &GfColor::GetRGB) + .def("GetColorSpace", &GfColor::GetColorSpace) + .def(self == self) + .def(self != self) + ; + + def("IsClose", + (bool (*)(const GfColor &v1, const GfColor &v2, double)) GfIsClose, + (arg("v1"), arg("v2"), arg("tolerance"))); +} + diff --git a/pxr/base/gf/wrapColorSpace.cpp b/pxr/base/gf/wrapColorSpace.cpp new file mode 100644 index 0000000000..d91a1e7925 --- /dev/null +++ b/pxr/base/gf/wrapColorSpace.cpp @@ -0,0 +1,59 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" +#include "pxr/base/gf/color.h" +#include "pxr/base/gf/colorSpace.h" +#include "pxr/base/tf/pyStaticTokens.h" +#include "pxr/base/tf/pyUtils.h" +#include "pxr/base/tf/stringUtils.h" + +#include +#include +#include +#include + +using namespace boost::python; + +PXR_NAMESPACE_USING_DIRECTIVE + +namespace { + +static std::string __repr__(GfColorSpace const &self) +{ + return TF_PY_REPR_PREFIX + + TfStringPrintf("ColorSpace(%s)", TfPyRepr(self.GetName()).c_str()); +} + +} // anon + +void wrapColorSpace() +{ + class_("ColorSpace", init()) + .def(init( + (arg("name"), arg("redChroma"), arg("greenChroma"), + arg("blueChroma"), arg("whitePoint"), arg("gamma"), + arg("linearBias")))) + .def(init( + (arg("name"), arg("rgbToXYZ"), arg("gamma"), arg("linearBias")))) + .def("__repr__", &__repr__) + .def("GetName", &GfColorSpace::GetName) + .def("ConvertRGBSpan", &GfColorSpace::ConvertRGBSpan) + .def("ConvertRGBASpan", &GfColorSpace::ConvertRGBASpan) + .def("Convert", &GfColorSpace::Convert) + .def("GetRGBToXYZ", &GfColorSpace::GetRGBToXYZ) + .def("GetGamma", &GfColorSpace::GetGamma) + .def("GetLinearBias", &GfColorSpace::GetLinearBias) + .def("GetTransferFunctionParams", &GfColorSpace::GetTransferFunctionParams) + .def("GetPrimariesAndWhitePoint", &GfColorSpace::GetPrimariesAndWhitePoint) + .def(self == self) + .def(self != self); + + TF_PY_WRAP_PUBLIC_TOKENS("ColorSpaceNames", GfColorSpaceNames, + GF_COLORSPACE_NAME_TOKENS); +} From 591c93d4fedf58d6e9d70da064946dd3df8a2810 Mon Sep 17 00:00:00 2001 From: sunyab Date: Mon, 26 Aug 2024 15:19:22 -0700 Subject: [PATCH 103/202] python: Add pass-through to boost::python The headers in this library now just forward to their corresponding boost::python header by default. This allows us to update code to include headers from this library while still maintaining our current behavior and use of boost::python until we're ready to switch to our internal implementation. The "real" internal implementation is guarded behind a PXR_USE_INTERNAL_BOOST_PYTHON preprocessor symbol. We currently hard-code the definition of this symbol when building this library; a later change will turn this into an option. Note that this pass-through is intended to be a temporary staging measure for the the development and rollout of this library. Developers should not rely on this option, as it will be removed as soon as the switch to the internal implementation is complete. (Internal change: 2338450) --- pxr/external/boost/python.hpp | 7 +++++++ pxr/external/boost/python/CMakeLists.txt | 11 ++++++++++- pxr/external/boost/python/arg_from_python.hpp | 7 +++++++ pxr/external/boost/python/args.hpp | 7 +++++++ pxr/external/boost/python/args_fwd.hpp | 7 +++++++ pxr/external/boost/python/back_reference.hpp | 7 +++++++ pxr/external/boost/python/base_type_traits.hpp | 7 +++++++ pxr/external/boost/python/bases.hpp | 7 +++++++ pxr/external/boost/python/borrowed.hpp | 7 +++++++ pxr/external/boost/python/call.hpp | 7 +++++++ pxr/external/boost/python/call_method.hpp | 7 +++++++ pxr/external/boost/python/cast.hpp | 7 +++++++ pxr/external/boost/python/class.hpp | 7 +++++++ pxr/external/boost/python/class_fwd.hpp | 7 +++++++ .../boost/python/converter/arg_from_python.hpp | 7 +++++++ pxr/external/boost/python/converter/arg_to_python.hpp | 7 +++++++ .../boost/python/converter/arg_to_python_base.hpp | 7 +++++++ .../boost/python/converter/as_to_python_function.hpp | 7 +++++++ .../boost/python/converter/builtin_converters.hpp | 7 +++++++ .../boost/python/converter/constructor_function.hpp | 7 +++++++ .../python/converter/context_result_converter.hpp | 7 +++++++ .../boost/python/converter/convertible_function.hpp | 7 +++++++ pxr/external/boost/python/converter/from_python.hpp | 7 +++++++ pxr/external/boost/python/converter/implicit.hpp | 7 +++++++ .../python/converter/obj_mgr_arg_from_python.hpp | 7 +++++++ .../boost/python/converter/object_manager.hpp | 7 +++++++ .../boost/python/converter/pointer_type_id.hpp | 7 +++++++ .../boost/python/converter/pyobject_traits.hpp | 7 +++++++ pxr/external/boost/python/converter/pyobject_type.hpp | 7 +++++++ .../boost/python/converter/pytype_function.hpp | 7 +++++++ .../python/converter/pytype_object_mgr_traits.hpp | 7 +++++++ pxr/external/boost/python/converter/registered.hpp | 7 +++++++ .../boost/python/converter/registered_pointee.hpp | 7 +++++++ pxr/external/boost/python/converter/registrations.hpp | 7 +++++++ pxr/external/boost/python/converter/registry.hpp | 7 +++++++ .../boost/python/converter/return_from_python.hpp | 7 +++++++ .../python/converter/rvalue_from_python_data.hpp | 7 +++++++ .../boost/python/converter/shared_ptr_deleter.hpp | 7 +++++++ .../boost/python/converter/shared_ptr_from_python.hpp | 7 +++++++ .../boost/python/converter/shared_ptr_to_python.hpp | 7 +++++++ .../python/converter/to_python_function_type.hpp | 7 +++++++ pxr/external/boost/python/copy_const_reference.hpp | 7 +++++++ .../boost/python/copy_non_const_reference.hpp | 7 +++++++ pxr/external/boost/python/data_members.hpp | 7 +++++++ pxr/external/boost/python/def.hpp | 7 +++++++ pxr/external/boost/python/def_visitor.hpp | 7 +++++++ pxr/external/boost/python/default_call_policies.hpp | 7 +++++++ pxr/external/boost/python/detail/aix_init_module.hpp | 7 +++++++ pxr/external/boost/python/detail/api_placeholder.hpp | 7 +++++++ pxr/external/boost/python/detail/borrowed_ptr.hpp | 7 +++++++ pxr/external/boost/python/detail/caller.hpp | 7 +++++++ pxr/external/boost/python/detail/config.hpp | 7 +++++++ pxr/external/boost/python/detail/construct.hpp | 7 +++++++ pxr/external/boost/python/detail/convertible.hpp | 7 +++++++ .../boost/python/detail/copy_ctor_mutates_rhs.hpp | 7 +++++++ pxr/external/boost/python/detail/cv_category.hpp | 7 +++++++ pxr/external/boost/python/detail/dealloc.hpp | 7 +++++++ .../boost/python/detail/decorated_type_id.hpp | 7 +++++++ pxr/external/boost/python/detail/decref_guard.hpp | 7 +++++++ pxr/external/boost/python/detail/def_helper.hpp | 7 +++++++ pxr/external/boost/python/detail/def_helper_fwd.hpp | 7 +++++++ pxr/external/boost/python/detail/defaults_def.hpp | 7 +++++++ pxr/external/boost/python/detail/defaults_gen.hpp | 7 +++++++ pxr/external/boost/python/detail/dependent.hpp | 7 +++++++ pxr/external/boost/python/detail/destroy.hpp | 7 +++++++ pxr/external/boost/python/detail/enable_if.hpp | 7 +++++++ .../boost/python/detail/exception_handler.hpp | 7 +++++++ .../boost/python/detail/force_instantiate.hpp | 7 +++++++ pxr/external/boost/python/detail/if_else.hpp | 7 +++++++ pxr/external/boost/python/detail/indirect_traits.hpp | 7 +++++++ pxr/external/boost/python/detail/invoke.hpp | 7 +++++++ pxr/external/boost/python/detail/is_auto_ptr.hpp | 6 ++++++ pxr/external/boost/python/detail/is_shared_ptr.hpp | 7 +++++++ pxr/external/boost/python/detail/is_wrapper.hpp | 7 +++++++ pxr/external/boost/python/detail/is_xxx.hpp | 7 +++++++ .../boost/python/detail/make_keyword_range_fn.hpp | 7 +++++++ pxr/external/boost/python/detail/map_entry.hpp | 7 +++++++ pxr/external/boost/python/detail/mpl_lambda.hpp | 7 +++++++ pxr/external/boost/python/detail/msvc_typeinfo.hpp | 7 +++++++ pxr/external/boost/python/detail/none.hpp | 7 +++++++ pxr/external/boost/python/detail/not_specified.hpp | 7 +++++++ .../boost/python/detail/nullary_function_adaptor.hpp | 7 +++++++ pxr/external/boost/python/detail/operator_id.hpp | 7 +++++++ pxr/external/boost/python/detail/overloads_fwd.hpp | 7 +++++++ pxr/external/boost/python/detail/pointee.hpp | 7 +++++++ pxr/external/boost/python/detail/prefix.hpp | 7 +++++++ pxr/external/boost/python/detail/preprocessor.hpp | 7 +++++++ pxr/external/boost/python/detail/python_type.hpp | 7 +++++++ pxr/external/boost/python/detail/raw_pyobject.hpp | 7 +++++++ pxr/external/boost/python/detail/referent_storage.hpp | 7 +++++++ pxr/external/boost/python/detail/result.hpp | 7 +++++++ pxr/external/boost/python/detail/scope.hpp | 7 +++++++ pxr/external/boost/python/detail/sfinae.hpp | 7 +++++++ pxr/external/boost/python/detail/signature.hpp | 7 +++++++ pxr/external/boost/python/detail/string_literal.hpp | 7 +++++++ pxr/external/boost/python/detail/target.hpp | 7 +++++++ .../boost/python/detail/translate_exception.hpp | 7 +++++++ pxr/external/boost/python/detail/type_list.hpp | 7 +++++++ pxr/external/boost/python/detail/type_list_impl.hpp | 7 +++++++ pxr/external/boost/python/detail/type_traits.hpp | 7 +++++++ pxr/external/boost/python/detail/unwind_type.hpp | 7 +++++++ pxr/external/boost/python/detail/unwrap_type_id.hpp | 7 +++++++ pxr/external/boost/python/detail/unwrap_wrapper.hpp | 7 +++++++ pxr/external/boost/python/detail/value_arg.hpp | 7 +++++++ .../boost/python/detail/value_is_shared_ptr.hpp | 7 +++++++ pxr/external/boost/python/detail/value_is_xxx.hpp | 7 +++++++ pxr/external/boost/python/detail/void_ptr.hpp | 7 +++++++ pxr/external/boost/python/detail/void_return.hpp | 7 +++++++ pxr/external/boost/python/detail/wrapper_base.hpp | 7 +++++++ pxr/external/boost/python/dict.hpp | 7 +++++++ pxr/external/boost/python/docstring_options.hpp | 7 +++++++ pxr/external/boost/python/enum.hpp | 7 +++++++ pxr/external/boost/python/errors.hpp | 7 +++++++ pxr/external/boost/python/exception_translator.hpp | 7 +++++++ pxr/external/boost/python/exec.hpp | 7 +++++++ pxr/external/boost/python/extract.hpp | 7 +++++++ pxr/external/boost/python/handle.hpp | 7 +++++++ pxr/external/boost/python/handle_fwd.hpp | 7 +++++++ pxr/external/boost/python/has_back_reference.hpp | 7 +++++++ pxr/external/boost/python/implicit.hpp | 7 +++++++ pxr/external/boost/python/import.hpp | 7 +++++++ pxr/external/boost/python/init.hpp | 7 +++++++ pxr/external/boost/python/instance_holder.hpp | 7 +++++++ pxr/external/boost/python/iterator.hpp | 7 +++++++ pxr/external/boost/python/list.hpp | 7 +++++++ pxr/external/boost/python/long.hpp | 7 +++++++ pxr/external/boost/python/lvalue_from_pytype.hpp | 7 +++++++ pxr/external/boost/python/make_constructor.hpp | 7 +++++++ pxr/external/boost/python/make_function.hpp | 7 +++++++ pxr/external/boost/python/manage_new_object.hpp | 7 +++++++ pxr/external/boost/python/module.hpp | 7 +++++++ pxr/external/boost/python/module_init.hpp | 7 +++++++ pxr/external/boost/python/numpy.hpp | 7 +++++++ pxr/external/boost/python/numpy/config.hpp | 7 +++++++ pxr/external/boost/python/numpy/dtype.hpp | 7 +++++++ pxr/external/boost/python/numpy/internal.hpp | 7 +++++++ pxr/external/boost/python/numpy/invoke_matching.hpp | 7 +++++++ pxr/external/boost/python/numpy/matrix.hpp | 7 +++++++ pxr/external/boost/python/numpy/ndarray.hpp | 7 +++++++ .../boost/python/numpy/numpy_object_mgr_traits.hpp | 7 +++++++ pxr/external/boost/python/numpy/scalars.hpp | 7 +++++++ pxr/external/boost/python/numpy/ufunc.hpp | 7 +++++++ pxr/external/boost/python/object.hpp | 7 +++++++ pxr/external/boost/python/object/add_to_namespace.hpp | 7 +++++++ pxr/external/boost/python/object/class.hpp | 7 +++++++ pxr/external/boost/python/object/class_detail.hpp | 7 +++++++ pxr/external/boost/python/object/class_metadata.hpp | 7 +++++++ pxr/external/boost/python/object/class_wrapper.hpp | 7 +++++++ pxr/external/boost/python/object/enum_base.hpp | 7 +++++++ pxr/external/boost/python/object/find_instance.hpp | 7 +++++++ pxr/external/boost/python/object/forward.hpp | 7 +++++++ pxr/external/boost/python/object/function.hpp | 7 +++++++ .../boost/python/object/function_doc_signature.hpp | 7 +++++++ pxr/external/boost/python/object/function_handle.hpp | 7 +++++++ pxr/external/boost/python/object/function_object.hpp | 7 +++++++ pxr/external/boost/python/object/inheritance.hpp | 7 +++++++ .../boost/python/object/inheritance_query.hpp | 7 +++++++ pxr/external/boost/python/object/instance.hpp | 7 +++++++ pxr/external/boost/python/object/iterator.hpp | 7 +++++++ pxr/external/boost/python/object/iterator_core.hpp | 7 +++++++ pxr/external/boost/python/object/life_support.hpp | 7 +++++++ pxr/external/boost/python/object/make_holder.hpp | 7 +++++++ pxr/external/boost/python/object/make_instance.hpp | 7 +++++++ .../boost/python/object/make_ptr_instance.hpp | 7 +++++++ pxr/external/boost/python/object/pickle_support.hpp | 7 +++++++ pxr/external/boost/python/object/pointer_holder.hpp | 7 +++++++ pxr/external/boost/python/object/py_function.hpp | 7 +++++++ .../boost/python/object/stl_iterator_core.hpp | 7 +++++++ pxr/external/boost/python/object/value_holder.hpp | 7 +++++++ pxr/external/boost/python/object/value_holder_fwd.hpp | 7 +++++++ pxr/external/boost/python/object_attributes.hpp | 7 +++++++ pxr/external/boost/python/object_core.hpp | 7 +++++++ pxr/external/boost/python/object_fwd.hpp | 7 +++++++ pxr/external/boost/python/object_items.hpp | 7 +++++++ pxr/external/boost/python/object_operators.hpp | 7 +++++++ pxr/external/boost/python/object_protocol.hpp | 7 +++++++ pxr/external/boost/python/object_protocol_core.hpp | 7 +++++++ pxr/external/boost/python/object_slices.hpp | 7 +++++++ .../boost/python/opaque_pointer_converter.hpp | 7 +++++++ pxr/external/boost/python/operators.hpp | 7 +++++++ pxr/external/boost/python/other.hpp | 7 +++++++ pxr/external/boost/python/overloads.hpp | 7 +++++++ pxr/external/boost/python/override.hpp | 7 +++++++ pxr/external/boost/python/pointee.hpp | 7 +++++++ pxr/external/boost/python/proxy.hpp | 7 +++++++ pxr/external/boost/python/ptr.hpp | 7 +++++++ pxr/external/boost/python/pure_virtual.hpp | 7 +++++++ pxr/external/boost/python/raw_function.hpp | 7 +++++++ pxr/external/boost/python/refcount.hpp | 7 +++++++ .../boost/python/reference_existing_object.hpp | 7 +++++++ pxr/external/boost/python/register_ptr_to_python.hpp | 7 +++++++ pxr/external/boost/python/return_arg.hpp | 7 +++++++ pxr/external/boost/python/return_by_value.hpp | 7 +++++++ .../boost/python/return_internal_reference.hpp | 7 +++++++ pxr/external/boost/python/return_opaque_pointer.hpp | 7 +++++++ pxr/external/boost/python/return_value_policy.hpp | 7 +++++++ pxr/external/boost/python/scope.hpp | 7 +++++++ pxr/external/boost/python/self.hpp | 7 +++++++ pxr/external/boost/python/signature.hpp | 7 +++++++ pxr/external/boost/python/slice.hpp | 7 +++++++ pxr/external/boost/python/slice_nil.hpp | 7 +++++++ pxr/external/boost/python/ssize_t.hpp | 7 +++++++ pxr/external/boost/python/stl_iterator.hpp | 7 +++++++ pxr/external/boost/python/str.hpp | 7 +++++++ .../boost/python/suite/indexing/container_utils.hpp | 7 +++++++ .../suite/indexing/detail/indexing_suite_detail.hpp | 7 +++++++ .../boost/python/suite/indexing/indexing_suite.hpp | 7 +++++++ .../python/suite/indexing/map_indexing_suite.hpp | 7 +++++++ .../python/suite/indexing/vector_indexing_suite.hpp | 7 +++++++ pxr/external/boost/python/tag.hpp | 7 +++++++ pxr/external/boost/python/to_python_converter.hpp | 7 +++++++ pxr/external/boost/python/to_python_indirect.hpp | 7 +++++++ pxr/external/boost/python/to_python_value.hpp | 7 +++++++ pxr/external/boost/python/tuple.hpp | 7 +++++++ pxr/external/boost/python/type_id.hpp | 7 +++++++ pxr/external/boost/python/with_custodian_and_ward.hpp | 7 +++++++ pxr/external/boost/python/wrapper.hpp | 7 +++++++ 217 files changed, 1521 insertions(+), 1 deletion(-) diff --git a/pxr/external/boost/python.hpp b/pxr/external/boost/python.hpp index 307dd25936..9c3540c42b 100644 --- a/pxr/external/boost/python.hpp +++ b/pxr/external/boost/python.hpp @@ -13,6 +13,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/args.hpp" # include "pxr/external/boost/python/args_fwd.hpp" # include "pxr/external/boost/python/back_reference.hpp" @@ -77,4 +83,5 @@ # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/with_custodian_and_ward.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HPP diff --git a/pxr/external/boost/python/CMakeLists.txt b/pxr/external/boost/python/CMakeLists.txt index d7d0a2798d..035603949a 100644 --- a/pxr/external/boost/python/CMakeLists.txt +++ b/pxr/external/boost/python/CMakeLists.txt @@ -295,7 +295,16 @@ pxr_library(python # Add BOOST_PYTHON_SOURCE when building this library to ensure symbols # decorated with BOOST_PYTHON_DECL are exported. target_compile_definitions(python - PRIVATE BOOST_PYTHON_SOURCE) + PRIVATE BOOST_PYTHON_SOURCE +) + +# XXX: +# Force this on for now during initial development so we continue to +# build and test this library. Later there'll be an option to turn +# this on or off. +target_compile_definitions(python + PUBLIC PXR_USE_INTERNAL_BOOST_PYTHON +) #### # Helper functions for unit tests diff --git a/pxr/external/boost/python/arg_from_python.hpp b/pxr/external/boost/python/arg_from_python.hpp index 2074a80d66..38a5fc425d 100644 --- a/pxr/external/boost/python/arg_from_python.hpp +++ b/pxr/external/boost/python/arg_from_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ARG_FROM_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ARG_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/arg_from_python.hpp" # if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ @@ -78,4 +84,5 @@ inline arg_from_python::arg_from_python(PyObject* source) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/args.hpp b/pxr/external/boost/python/args.hpp index b4c1555681..8f444d8dbd 100644 --- a/pxr/external/boost/python/args.hpp +++ b/pxr/external/boost/python/args.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ARGS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ARGS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/args_fwd.hpp" @@ -148,4 +154,5 @@ inline detail::keywords args(BOOST_PP_ENUM_PARAMS_Z(1, n, char const* name)) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_ARGS_HPP diff --git a/pxr/external/boost/python/args_fwd.hpp b/pxr/external/boost/python/args_fwd.hpp index c7a7c7e897..e427bf17d0 100644 --- a/pxr/external/boost/python/args_fwd.hpp +++ b/pxr/external/boost/python/args_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ARGS_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ARGS_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/handle.hpp" @@ -54,4 +60,5 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ARGS_FWD_HPP diff --git a/pxr/external/boost/python/back_reference.hpp b/pxr/external/boost/python/back_reference.hpp index 313db0a337..057794cfa9 100644 --- a/pxr/external/boost/python/back_reference.hpp +++ b/pxr/external/boost/python/back_reference.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_BACK_REFERENCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_BACK_REFERENCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_fwd.hpp" @@ -73,4 +79,5 @@ T back_reference::get() const }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BACK_REFERENCE_HPP diff --git a/pxr/external/boost/python/base_type_traits.hpp b/pxr/external/boost/python/base_type_traits.hpp index e60a60068d..09ab45cc5d 100644 --- a/pxr/external/boost/python/base_type_traits.hpp +++ b/pxr/external/boost/python/base_type_traits.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_BASE_TYPE_TRAITS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_BASE_TYPE_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -45,4 +51,5 @@ struct base_type_traits }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BASE_TYPE_TRAITS_HPP diff --git a/pxr/external/boost/python/bases.hpp b/pxr/external/boost/python/bases.hpp index 9fc236acb1..8ad8798ff2 100644 --- a/pxr/external/boost/python/bases.hpp +++ b/pxr/external/boost/python/bases.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_BASES_HPP # define PXR_EXTERNAL_BOOST_PYTHON_BASES_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_list.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -52,4 +58,5 @@ namespace boost { namespace python { # undef BOOST_PYTHON_BASE_PARAMS }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BASES_HPP diff --git a/pxr/external/boost/python/borrowed.hpp b/pxr/external/boost/python/borrowed.hpp index ba0e06da49..ff11014c10 100644 --- a/pxr/external/boost/python/borrowed.hpp +++ b/pxr/external/boost/python/borrowed.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_BORROWED_HPP # define PXR_EXTERNAL_BOOST_PYTHON_BORROWED_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/borrowed_ptr.hpp" @@ -23,4 +29,5 @@ inline python::detail::borrowed* borrowed(T* p) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BORROWED_HPP diff --git a/pxr/external/boost/python/call.hpp b/pxr/external/boost/python/call.hpp index 410264fb04..de199db1aa 100644 --- a/pxr/external/boost/python/call.hpp +++ b/pxr/external/boost/python/call.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_CALL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CALL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -41,6 +47,7 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_CALL_HPP // For gcc 4.4 compatability, we must include the diff --git a/pxr/external/boost/python/call_method.hpp b/pxr/external/boost/python/call_method.hpp index 75911faa0d..6e9eb3c880 100644 --- a/pxr/external/boost/python/call_method.hpp +++ b/pxr/external/boost/python/call_method.hpp @@ -12,6 +12,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_CALL_METHOD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CALL_METHOD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -40,6 +46,7 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_CALL_METHOD_HPP // For gcc 4.4 compatability, we must include the diff --git a/pxr/external/boost/python/cast.hpp b/pxr/external/boost/python/cast.hpp index 7379982497..026d155305 100644 --- a/pxr/external/boost/python/cast.hpp +++ b/pxr/external/boost/python/cast.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CAST_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CAST_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -107,4 +113,5 @@ inline Target* downcast(Source* x, Target* = 0) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CAST_HPP diff --git a/pxr/external/boost/python/class.hpp b/pxr/external/boost/python/class.hpp index ce9f8fe252..0b84d39da5 100644 --- a/pxr/external/boost/python/class.hpp +++ b/pxr/external/boost/python/class.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CLASS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CLASS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -610,4 +616,5 @@ inline class_::class_(char const* name, char const* doc, no_init_t) # undef BOOST_PYTHON_NO_DATA_MEMBER # undef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CLASS_HPP diff --git a/pxr/external/boost/python/class_fwd.hpp b/pxr/external/boost/python/class_fwd.hpp index 729bb6e1dd..435e59fa1f 100644 --- a/pxr/external/boost/python/class_fwd.hpp +++ b/pxr/external/boost/python/class_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CLASS_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CLASS_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/not_specified.hpp" @@ -26,4 +32,5 @@ class class_; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CLASS_FWD_HPP diff --git a/pxr/external/boost/python/converter/arg_from_python.hpp b/pxr/external/boost/python/converter/arg_from_python.hpp index febace1d03..21f32d6c78 100644 --- a/pxr/external/boost/python/converter/arg_from_python.hpp +++ b/pxr/external/boost/python/converter/arg_from_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_FROM_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/from_python.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" @@ -337,4 +343,5 @@ back_reference_arg_from_python::operator()() }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python.hpp b/pxr/external/boost/python/converter/arg_to_python.hpp index ae9837b1da..cac56d795d 100644 --- a/pxr/external/boost/python/converter/arg_to_python.hpp +++ b/pxr/external/boost/python/converter/arg_to_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/ptr.hpp" # include "pxr/external/boost/python/tag.hpp" # include "pxr/external/boost/python/to_python_indirect.hpp" @@ -259,4 +265,5 @@ inline arg_to_python::arg_to_python(T const& x) }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python_base.hpp b/pxr/external/boost/python/converter/arg_to_python_base.hpp index 78f987c018..c1bf592884 100644 --- a/pxr/external/boost/python/converter/arg_to_python_base.hpp +++ b/pxr/external/boost/python/converter/arg_to_python_base.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_BASE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_BASE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/handle.hpp" namespace boost { namespace python { namespace converter { @@ -26,4 +32,5 @@ namespace detail }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_BASE_HPP diff --git a/pxr/external/boost/python/converter/as_to_python_function.hpp b/pxr/external/boost/python/converter/as_to_python_function.hpp index c856d82701..8d0c272dc8 100644 --- a/pxr/external/boost/python/converter/as_to_python_function.hpp +++ b/pxr/external/boost/python/converter/as_to_python_function.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_AS_TO_PYTHON_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_AS_TO_PYTHON_FUNCTION_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/converter/to_python_function_type.hpp" namespace boost { namespace python { namespace converter { @@ -51,4 +57,5 @@ struct as_to_python_function }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_AS_TO_PYTHON_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/builtin_converters.hpp b/pxr/external/boost/python/converter/builtin_converters.hpp index 6f00f40582..555e682491 100644 --- a/pxr/external/boost/python/converter/builtin_converters.hpp +++ b/pxr/external/boost/python/converter/builtin_converters.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_BUILTIN_CONVERTERS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_BUILTIN_CONVERTERS_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/none.hpp" # include "pxr/external/boost/python/handle.hpp" @@ -192,4 +198,5 @@ namespace converter }} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_BUILTIN_CONVERTERS_HPP diff --git a/pxr/external/boost/python/converter/constructor_function.hpp b/pxr/external/boost/python/converter/constructor_function.hpp index 5665e45399..a3876e9d7f 100644 --- a/pxr/external/boost/python/converter/constructor_function.hpp +++ b/pxr/external/boost/python/converter/constructor_function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONSTRUCTOR_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONSTRUCTOR_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace converter { // Declares the type of functions used to construct C++ objects for @@ -19,4 +25,5 @@ typedef void (*constructor_function)(PyObject* source, rvalue_from_python_stage1 }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONSTRUCTOR_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/context_result_converter.hpp b/pxr/external/boost/python/converter/context_result_converter.hpp index 444da07ca7..c0384a5a63 100644 --- a/pxr/external/boost/python/converter/context_result_converter.hpp +++ b/pxr/external/boost/python/converter/context_result_converter.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONTEXT_RESULT_CONVERTER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONTEXT_RESULT_CONVERTER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace converter { // A ResultConverter base class used to indicate that this result @@ -19,4 +25,5 @@ struct context_result_converter {}; }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONTEXT_RESULT_CONVERTER_HPP diff --git a/pxr/external/boost/python/converter/convertible_function.hpp b/pxr/external/boost/python/converter/convertible_function.hpp index b15a01aa8b..3d57f8acf9 100644 --- a/pxr/external/boost/python/converter/convertible_function.hpp +++ b/pxr/external/boost/python/converter/convertible_function.hpp @@ -10,10 +10,17 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONVERTIBLE_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONVERTIBLE_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace converter { typedef void* (*convertible_function)(PyObject*); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONVERTIBLE_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/from_python.hpp b/pxr/external/boost/python/converter/from_python.hpp index 835da17d1f..4ebb77e49d 100644 --- a/pxr/external/boost/python/converter/from_python.hpp +++ b/pxr/external/boost/python/converter/from_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_FROM_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" @@ -43,4 +49,5 @@ BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject*, registration co }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/implicit.hpp b/pxr/external/boost/python/converter/implicit.hpp index 265c06f8b0..a6c4b5603d 100644 --- a/pxr/external/boost/python/converter/implicit.hpp +++ b/pxr/external/boost/python/converter/implicit.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_IMPLICIT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_IMPLICIT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" # include "pxr/external/boost/python/converter/registrations.hpp" # include "pxr/external/boost/python/converter/registered.hpp" @@ -48,4 +54,5 @@ struct implicit }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_IMPLICIT_HPP diff --git a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp index 17cc59d14e..1de0bff48d 100644 --- a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp +++ b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJ_MGR_ARG_FROM_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJ_MGR_ARG_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/referent_storage.hpp" # include "pxr/external/boost/python/detail/destroy.hpp" @@ -123,4 +129,5 @@ inline Ref object_manager_ref_arg_from_python::operator()() const }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJ_MGR_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/object_manager.hpp b/pxr/external/boost/python/converter/object_manager.hpp index 075d578859..f6523930f4 100644 --- a/pxr/external/boost/python/converter/object_manager.hpp +++ b/pxr/external/boost/python/converter/object_manager.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJECT_MANAGER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJECT_MANAGER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/handle.hpp" # include "pxr/external/boost/python/cast.hpp" # include "pxr/external/boost/python/converter/pyobject_traits.hpp" @@ -158,4 +164,5 @@ struct is_reference_to_object_manager }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJECT_MANAGER_HPP diff --git a/pxr/external/boost/python/converter/pointer_type_id.hpp b/pxr/external/boost/python/converter/pointer_type_id.hpp index ab97a9c7a5..e2eab5ebc6 100644 --- a/pxr/external/boost/python/converter/pointer_type_id.hpp +++ b/pxr/external/boost/python/converter/pointer_type_id.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_POINTER_TYPE_ID_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_POINTER_TYPE_ID_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -70,4 +76,5 @@ type_info pointer_type_id(T(*)() = 0) }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_POINTER_TYPE_ID_HPP diff --git a/pxr/external/boost/python/converter/pyobject_traits.hpp b/pxr/external/boost/python/converter/pyobject_traits.hpp index 79cfb07e6c..421b5b9b4f 100644 --- a/pxr/external/boost/python/converter/pyobject_traits.hpp +++ b/pxr/external/boost/python/converter/pyobject_traits.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TRAITS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/pyobject_type.hpp" @@ -48,4 +54,5 @@ BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Tuple); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TRAITS_HPP diff --git a/pxr/external/boost/python/converter/pyobject_type.hpp b/pxr/external/boost/python/converter/pyobject_type.hpp index 401a809202..d7529cb95c 100644 --- a/pxr/external/boost/python/converter/pyobject_type.hpp +++ b/pxr/external/boost/python/converter/pyobject_type.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TYPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TYPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/cast.hpp" namespace boost { namespace python { namespace converter { @@ -42,4 +48,5 @@ struct pyobject_type }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TYPE_HPP diff --git a/pxr/external/boost/python/converter/pytype_function.hpp b/pxr/external/boost/python/converter/pytype_function.hpp index 6f05d03da1..a6154a0ba8 100644 --- a/pxr/external/boost/python/converter/pytype_function.hpp +++ b/pxr/external/boost/python/converter/pytype_function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/registered.hpp" # include "pxr/external/boost/python/detail/unwind_type.hpp" @@ -135,4 +141,5 @@ struct to_python_target_type_direct }}} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp index 802fbed164..542413cf7b 100644 --- a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp +++ b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_OBJECT_MGR_TRAITS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_OBJECT_MGR_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/raw_pyobject.hpp" # include "pxr/external/boost/python/cast.hpp" @@ -44,4 +50,5 @@ inline python::detail::new_reference pytype_object_manager_traits::ado }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_OBJECT_MGR_TRAITS_HPP diff --git a/pxr/external/boost/python/converter/registered.hpp b/pxr/external/boost/python/converter/registered.hpp index 3ccd3ac3d4..a46ad62fa8 100644 --- a/pxr/external/boost/python/converter/registered.hpp +++ b/pxr/external/boost/python/converter/registered.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_HPP #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/type_id.hpp" #include "pxr/external/boost/python/converter/registry.hpp" #include "pxr/external/boost/python/converter/registrations.hpp" @@ -126,4 +132,5 @@ namespace detail }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/registered_pointee.hpp b/pxr/external/boost/python/converter/registered_pointee.hpp index 77ac9ada95..87ab90718b 100644 --- a/pxr/external/boost/python/converter/registered_pointee.hpp +++ b/pxr/external/boost/python/converter/registered_pointee.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_POINTEE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_POINTEE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/converter/registered.hpp" # include "pxr/external/boost/python/converter/pointer_type_id.hpp" # include "pxr/external/boost/python/converter/registry.hpp" @@ -31,4 +37,5 @@ struct registered_pointee }; }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_POINTEE_HPP diff --git a/pxr/external/boost/python/converter/registrations.hpp b/pxr/external/boost/python/converter/registrations.hpp index 6e6c431281..6ccbc50097 100644 --- a/pxr/external/boost/python/converter/registrations.hpp +++ b/pxr/external/boost/python/converter/registrations.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRATIONS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRATIONS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/type_id.hpp" @@ -101,4 +107,5 @@ inline bool operator<(registration const& lhs, registration const& rhs) }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRATIONS_HPP diff --git a/pxr/external/boost/python/converter/registry.hpp b/pxr/external/boost/python/converter/registry.hpp index 8aecb39198..2a93a82620 100644 --- a/pxr/external/boost/python/converter/registry.hpp +++ b/pxr/external/boost/python/converter/registry.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRY_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/converter/to_python_function_type.hpp" # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" @@ -57,4 +63,5 @@ namespace registry }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRY_HPP diff --git a/pxr/external/boost/python/converter/return_from_python.hpp b/pxr/external/boost/python/converter/return_from_python.hpp index e98ea193e6..e84338dea3 100644 --- a/pxr/external/boost/python/converter/return_from_python.hpp +++ b/pxr/external/boost/python/converter/return_from_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RETURN_FROM_PYTHON_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RETURN_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/converter/from_python.hpp" # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" # include "pxr/external/boost/python/converter/registered.hpp" @@ -164,4 +170,5 @@ namespace detail }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RETURN_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp index a30e86e2d0..acc1cdd51a 100644 --- a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp +++ b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RVALUE_FROM_PYTHON_DATA_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RVALUE_FROM_PYTHON_DATA_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/converter/constructor_function.hpp" # include "pxr/external/boost/python/detail/referent_storage.hpp" # include "pxr/external/boost/python/detail/destroy.hpp" @@ -149,4 +155,5 @@ inline rvalue_from_python_data::~rvalue_from_python_data() }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RVALUE_FROM_PYTHON_DATA_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp index 0e3ceea1cd..5e298b3cb9 100644 --- a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_DELETER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_DELETER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace converter { struct BOOST_PYTHON_DECL shared_ptr_deleter @@ -24,4 +30,5 @@ struct BOOST_PYTHON_DECL shared_ptr_deleter }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_DELETER_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp index aeff1bdfdb..0351df5579 100644 --- a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_FROM_PYTHON_HPP #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_FROM_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/handle.hpp" #include "pxr/external/boost/python/converter/shared_ptr_deleter.hpp" #include "pxr/external/boost/python/converter/from_python.hpp" @@ -71,4 +77,5 @@ struct shared_ptr_from_python }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp index 3c4407439c..e77026e4a0 100644 --- a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_TO_PYTHON_HPP #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_TO_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/refcount.hpp" #include "pxr/external/boost/python/converter/shared_ptr_deleter.hpp" #include @@ -45,4 +51,5 @@ PyObject* shared_ptr_to_python(std::shared_ptr const& x) }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/to_python_function_type.hpp b/pxr/external/boost/python/converter/to_python_function_type.hpp index ec19193c12..b551d4d6d1 100644 --- a/pxr/external/boost/python/converter/to_python_function_type.hpp +++ b/pxr/external/boost/python/converter/to_python_function_type.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_TO_PYTHON_FUNCTION_TYPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_TO_PYTHON_FUNCTION_TYPE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -21,4 +27,5 @@ typedef PyObject* (*to_python_function_t)(void const*); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_TO_PYTHON_FUNCTION_TYPE_HPP diff --git a/pxr/external/boost/python/copy_const_reference.hpp b/pxr/external/boost/python/copy_const_reference.hpp index d9563f2308..57982ea6b4 100644 --- a/pxr/external/boost/python/copy_const_reference.hpp +++ b/pxr/external/boost/python/copy_const_reference.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_COPY_CONST_REFERENCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_COPY_CONST_REFERENCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include @@ -45,4 +51,5 @@ struct copy_const_reference }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_COPY_CONST_REFERENCE_HPP diff --git a/pxr/external/boost/python/copy_non_const_reference.hpp b/pxr/external/boost/python/copy_non_const_reference.hpp index 6647ce1303..0f70430a90 100644 --- a/pxr/external/boost/python/copy_non_const_reference.hpp +++ b/pxr/external/boost/python/copy_non_const_reference.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_COPY_NON_CONST_REFERENCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_COPY_NON_CONST_REFERENCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include @@ -45,4 +51,5 @@ struct copy_non_const_reference }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_COPY_NON_CONST_REFERENCE_HPP diff --git a/pxr/external/boost/python/data_members.hpp b/pxr/external/boost/python/data_members.hpp index 708844c473..e1c78d4e67 100644 --- a/pxr/external/boost/python/data_members.hpp +++ b/pxr/external/boost/python/data_members.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DATA_MEMBERS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DATA_MEMBERS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/handle.hpp" @@ -313,4 +319,5 @@ inline object make_setter(D const& x) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DATA_MEMBERS_HPP diff --git a/pxr/external/boost/python/def.hpp b/pxr/external/boost/python/def.hpp index 43a002dec9..8a807b7254 100644 --- a/pxr/external/boost/python/def.hpp +++ b/pxr/external/boost/python/def.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DEF_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DEF_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_fwd.hpp" @@ -116,4 +122,5 @@ void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEF_HPP diff --git a/pxr/external/boost/python/def_visitor.hpp b/pxr/external/boost/python/def_visitor.hpp index 96bdcd0575..7a0bd3f894 100644 --- a/pxr/external/boost/python/def_visitor.hpp +++ b/pxr/external/boost/python/def_visitor.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DEF_VISITOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DEF_VISITOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -88,4 +94,5 @@ class def_visitor }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEF_VISITOR_HPP diff --git a/pxr/external/boost/python/default_call_policies.hpp b/pxr/external/boost/python/default_call_policies.hpp index f17c569588..87716d9aec 100644 --- a/pxr/external/boost/python/default_call_policies.hpp +++ b/pxr/external/boost/python/default_call_policies.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DEFAULT_CALL_POLICIES_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DEFAULT_CALL_POLICIES_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include # include "pxr/external/boost/python/to_python_value.hpp" @@ -91,4 +97,5 @@ struct default_result_converter::apply }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEFAULT_CALL_POLICIES_HPP diff --git a/pxr/external/boost/python/detail/aix_init_module.hpp b/pxr/external/boost/python/detail/aix_init_module.hpp index 80dad4f85f..46acb029a9 100644 --- a/pxr/external/boost/python/detail/aix_init_module.hpp +++ b/pxr/external/boost/python/detail/aix_init_module.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_AIX_INIT_MODULE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_AIX_INIT_MODULE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # ifdef _AIX # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -28,4 +34,5 @@ void aix_init_module(so_load_function, char const* name, void (*init_module)()); }}} // namespace boost::python::detail # endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_AIX_INIT_MODULE_HPP diff --git a/pxr/external/boost/python/detail/api_placeholder.hpp b/pxr/external/boost/python/detail/api_placeholder.hpp index c3825316ea..444c4572ce 100644 --- a/pxr/external/boost/python/detail/api_placeholder.hpp +++ b/pxr/external/boost/python/detail/api_placeholder.hpp @@ -15,6 +15,13 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_API_PLACEHOLDER_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_API_PLACEHOLDER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/object.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_API_PLACEHOLDER_HPP diff --git a/pxr/external/boost/python/detail/borrowed_ptr.hpp b/pxr/external/boost/python/detail/borrowed_ptr.hpp index 07273196b7..6edf98e4f7 100644 --- a/pxr/external/boost/python/detail/borrowed_ptr.hpp +++ b/pxr/external/boost/python/detail/borrowed_ptr.hpp @@ -1,5 +1,11 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_BORROWED_PTR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_BORROWED_PTR_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else // // Copyright 2024 Pixar // Licensed under the terms set forth in the LICENSE.txt file available at @@ -82,4 +88,5 @@ inline T* get_managed_object(detail::borrowed const volatile* p, tag_t) }} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_BORROWED_PTR_HPP diff --git a/pxr/external/boost/python/detail/caller.hpp b/pxr/external/boost/python/detail/caller.hpp index f056b2c023..e466a2143f 100644 --- a/pxr/external/boost/python/detail/caller.hpp +++ b/pxr/external/boost/python/detail/caller.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CALLER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CALLER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/handle.hpp" @@ -199,6 +205,7 @@ struct caller }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CALLER_HPP #else diff --git a/pxr/external/boost/python/detail/config.hpp b/pxr/external/boost/python/detail/config.hpp index 2996e99670..a0cb5feb03 100644 --- a/pxr/external/boost/python/detail/config.hpp +++ b/pxr/external/boost/python/detail/config.hpp @@ -17,6 +17,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONFIG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONFIG_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include @@ -136,4 +142,5 @@ # define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) #endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONFIG_HPP diff --git a/pxr/external/boost/python/detail/construct.hpp b/pxr/external/boost/python/detail/construct.hpp index 7bd00463bc..f601ca1819 100644 --- a/pxr/external/boost/python/detail/construct.hpp +++ b/pxr/external/boost/python/detail/construct.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONSTRUCT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONSTRUCT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { template @@ -38,4 +44,5 @@ void construct_referent(void* storage, Arg& x, T(*tag)() = 0) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONSTRUCT_HPP diff --git a/pxr/external/boost/python/detail/convertible.hpp b/pxr/external/boost/python/detail/convertible.hpp index 3e5abcc1c1..d09b9e1db4 100644 --- a/pxr/external/boost/python/detail/convertible.hpp +++ b/pxr/external/boost/python/detail/convertible.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONVERTIBLE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONVERTIBLE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 241 # include # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -40,4 +46,5 @@ struct convertible }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONVERTIBLE_HPP diff --git a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp index 261155cb56..2a3c5f290f 100644 --- a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp +++ b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_COPY_CTOR_MUTATES_RHS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_COPY_CTOR_MUTATES_RHS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/is_auto_ptr.hpp" #include @@ -23,4 +29,5 @@ struct copy_ctor_mutates_rhs }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_COPY_CTOR_MUTATES_RHS_HPP diff --git a/pxr/external/boost/python/detail/cv_category.hpp b/pxr/external/boost/python/detail/cv_category.hpp index c8a7f74c1e..1ed01a00ca 100644 --- a/pxr/external/boost/python/detail/cv_category.hpp +++ b/pxr/external/boost/python/detail/cv_category.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CV_CATEGORY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CV_CATEGORY_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/type_traits.hpp" namespace boost { namespace python { namespace detail { @@ -38,4 +44,5 @@ struct cv_category }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CV_CATEGORY_HPP diff --git a/pxr/external/boost/python/detail/dealloc.hpp b/pxr/external/boost/python/detail/dealloc.hpp index ab17aec5c7..689b8aae43 100644 --- a/pxr/external/boost/python/detail/dealloc.hpp +++ b/pxr/external/boost/python/detail/dealloc.hpp @@ -10,6 +10,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEALLOC_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEALLOC_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else namespace boost { namespace python { namespace detail { extern "C" { @@ -19,4 +25,5 @@ namespace boost { namespace python { namespace detail { } } }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEALLOC_HPP diff --git a/pxr/external/boost/python/detail/decorated_type_id.hpp b/pxr/external/boost/python/detail/decorated_type_id.hpp index 9ac54b8e7a..2c6546d2a4 100644 --- a/pxr/external/boost/python/detail/decorated_type_id.hpp +++ b/pxr/external/boost/python/detail/decorated_type_id.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECORATED_TYPE_ID_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECORATED_TYPE_ID_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -78,4 +84,5 @@ BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info co }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECORATED_TYPE_ID_HPP diff --git a/pxr/external/boost/python/detail/decref_guard.hpp b/pxr/external/boost/python/detail/decref_guard.hpp index a42b0fea86..69cc6a53e4 100644 --- a/pxr/external/boost/python/detail/decref_guard.hpp +++ b/pxr/external/boost/python/detail/decref_guard.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECREF_GUARD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECREF_GUARD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { struct decref_guard @@ -23,4 +29,5 @@ struct decref_guard }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECREF_GUARD_HPP diff --git a/pxr/external/boost/python/detail/def_helper.hpp b/pxr/external/boost/python/detail/def_helper.hpp index ca4c529e96..da77aacd3a 100644 --- a/pxr/external/boost/python/detail/def_helper.hpp +++ b/pxr/external/boost/python/detail/def_helper.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/args.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -213,4 +219,5 @@ namespace detail }} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_HPP diff --git a/pxr/external/boost/python/detail/def_helper_fwd.hpp b/pxr/external/boost/python/detail/def_helper_fwd.hpp index 26494cfdb1..d6ec6d518d 100644 --- a/pxr/external/boost/python/detail/def_helper_fwd.hpp +++ b/pxr/external/boost/python/detail/def_helper_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/not_specified.hpp" namespace boost { namespace python { namespace detail { @@ -19,4 +25,5 @@ struct def_helper; }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_FWD_HPP diff --git a/pxr/external/boost/python/detail/defaults_def.hpp b/pxr/external/boost/python/detail/defaults_def.hpp index 2afef89a8c..56f6f4788a 100644 --- a/pxr/external/boost/python/detail/defaults_def.hpp +++ b/pxr/external/boost/python/detail/defaults_def.hpp @@ -15,6 +15,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_DEF_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_DEF_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/defaults_gen.hpp" #include "pxr/external/boost/python/detail/type_traits.hpp" #include @@ -264,6 +270,7 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_DEF_HPP #else // defined(BOOST_PP_IS_ITERATING) diff --git a/pxr/external/boost/python/detail/defaults_gen.hpp b/pxr/external/boost/python/detail/defaults_gen.hpp index f6bd0c81d7..60b64ab35e 100644 --- a/pxr/external/boost/python/detail/defaults_gen.hpp +++ b/pxr/external/boost/python/detail/defaults_gen.hpp @@ -13,6 +13,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_GEN_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_GEN_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/preprocessor.hpp" #include #include @@ -387,6 +393,7 @@ namespace detail #define BOOST_PYTHON_MEM_FUN_GENERATOR BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS /////////////////////////////////////////////////////////////////////////////// +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_GEN_HPP diff --git a/pxr/external/boost/python/detail/dependent.hpp b/pxr/external/boost/python/detail/dependent.hpp index cde20f5d2e..51dd67d229 100644 --- a/pxr/external/boost/python/detail/dependent.hpp +++ b/pxr/external/boost/python/detail/dependent.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEPENDENT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEPENDENT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { // A way to turn a concrete type T into a type dependent on U. This @@ -29,4 +35,5 @@ struct dependent }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEPENDENT_HPP diff --git a/pxr/external/boost/python/detail/destroy.hpp b/pxr/external/boost/python/detail/destroy.hpp index 4d57f6d66e..e84ee55ae7 100644 --- a/pxr/external/boost/python/detail/destroy.hpp +++ b/pxr/external/boost/python/detail/destroy.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DESTROY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DESTROY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/type_traits.hpp" # include namespace boost { namespace python { namespace detail { @@ -65,4 +71,5 @@ inline void destroy_referent(void* p, T(*)() = 0) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DESTROY_HPP diff --git a/pxr/external/boost/python/detail/enable_if.hpp b/pxr/external/boost/python/detail/enable_if.hpp index 8bcc788748..a055f5e3a4 100644 --- a/pxr/external/boost/python/detail/enable_if.hpp +++ b/pxr/external/boost/python/detail/enable_if.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_ENABLE_IF_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_ENABLE_IF_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/sfinae.hpp" # include @@ -41,4 +47,5 @@ struct disable_if_ret # endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_ENABLE_IF_HPP diff --git a/pxr/external/boost/python/detail/exception_handler.hpp b/pxr/external/boost/python/detail/exception_handler.hpp index be423fef09..d0945a207f 100644 --- a/pxr/external/boost/python/detail/exception_handler.hpp +++ b/pxr/external/boost/python/detail/exception_handler.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_EXCEPTION_HANDLER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_EXCEPTION_HANDLER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/config.hpp" # include # include @@ -50,4 +56,5 @@ BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f); }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_EXCEPTION_HANDLER_HPP diff --git a/pxr/external/boost/python/detail/force_instantiate.hpp b/pxr/external/boost/python/detail/force_instantiate.hpp index 6eb4e3ec20..48897043ae 100644 --- a/pxr/external/boost/python/detail/force_instantiate.hpp +++ b/pxr/external/boost/python/detail/force_instantiate.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_FORCE_INSTANTIATE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_FORCE_INSTANTIATE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { // Allows us to force the argument to be instantiated without @@ -20,4 +26,5 @@ inline void force_instantiate(T const&) {} }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_FORCE_INSTANTIATE_HPP diff --git a/pxr/external/boost/python/detail/if_else.hpp b/pxr/external/boost/python/detail/if_else.hpp index 14a1b128c5..7f537ffef7 100644 --- a/pxr/external/boost/python/detail/if_else.hpp +++ b/pxr/external/boost/python/detail/if_else.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IF_ELSE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IF_ELSE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include namespace boost { namespace python { namespace detail { @@ -83,4 +89,5 @@ struct if_ }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IF_ELSE_HPP diff --git a/pxr/external/boost/python/detail/indirect_traits.hpp b/pxr/external/boost/python/detail/indirect_traits.hpp index ab05324dec..9808fd69d8 100644 --- a/pxr/external/boost/python/detail/indirect_traits.hpp +++ b/pxr/external/boost/python/detail/indirect_traits.hpp @@ -9,10 +9,17 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INDIRECT_TRAITS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INDIRECT_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include namespace boost { namespace python { namespace indirect_traits = boost::detail::indirect_traits; }} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INDIRECT_TRAITS_HPP diff --git a/pxr/external/boost/python/detail/invoke.hpp b/pxr/external/boost/python/detail/invoke.hpp index 4aa57fc4d4..1a857b6e1e 100644 --- a/pxr/external/boost/python/detail/invoke.hpp +++ b/pxr/external/boost/python/detail/invoke.hpp @@ -12,6 +12,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INVOKE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INVOKE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/preprocessor.hpp" # include "pxr/external/boost/python/detail/none.hpp" @@ -67,6 +73,7 @@ struct invoke_tag }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INVOKE_HPP #else diff --git a/pxr/external/boost/python/detail/is_auto_ptr.hpp b/pxr/external/boost/python/detail/is_auto_ptr.hpp index 7022ce435b..e9d224402a 100644 --- a/pxr/external/boost/python/detail/is_auto_ptr.hpp +++ b/pxr/external/boost/python/detail/is_auto_ptr.hpp @@ -10,6 +10,11 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else #include namespace boost { namespace python { namespace detail { @@ -21,4 +26,5 @@ struct is_auto_ptr : std::false_type }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP diff --git a/pxr/external/boost/python/detail/is_shared_ptr.hpp b/pxr/external/boost/python/detail/is_shared_ptr.hpp index 09c09096cb..83735a3d97 100644 --- a/pxr/external/boost/python/detail/is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/is_shared_ptr.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_SHARED_PTR_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_SHARED_PTR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/is_xxx.hpp" #include @@ -25,4 +31,5 @@ struct is_shared_ptr > : std::true_type {}; }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/detail/is_wrapper.hpp b/pxr/external/boost/python/detail/is_wrapper.hpp index 755a5d8e5b..ec607da69d 100644 --- a/pxr/external/boost/python/detail/is_wrapper.hpp +++ b/pxr/external/boost/python/detail/is_wrapper.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_WRAPPER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_WRAPPER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -31,4 +37,5 @@ namespace detail }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_WRAPPER_HPP diff --git a/pxr/external/boost/python/detail/is_xxx.hpp b/pxr/external/boost/python/detail/is_xxx.hpp index 002bd6a920..79c549c982 100644 --- a/pxr/external/boost/python/detail/is_xxx.hpp +++ b/pxr/external/boost/python/detail/is_xxx.hpp @@ -10,9 +10,16 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_XXX_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_XXX_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_XXX_HPP diff --git a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp index d1f5464335..e32df5143d 100644 --- a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp +++ b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAKE_KEYWORD_RANGE_FN_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAKE_KEYWORD_RANGE_FN_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/make_function.hpp" # include "pxr/external/boost/python/args_fwd.hpp" @@ -74,4 +80,5 @@ object make_keyword_range_constructor( }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAKE_KEYWORD_RANGE_FN_HPP diff --git a/pxr/external/boost/python/detail/map_entry.hpp b/pxr/external/boost/python/detail/map_entry.hpp index 2c88a37c92..c68ff2b6e4 100644 --- a/pxr/external/boost/python/detail/map_entry.hpp +++ b/pxr/external/boost/python/detail/map_entry.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAP_ENTRY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAP_ENTRY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { // A trivial type that works well as the value_type of associative @@ -45,4 +51,5 @@ bool operator<(Key const& k, map_entry const& e) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAP_ENTRY_HPP diff --git a/pxr/external/boost/python/detail/mpl_lambda.hpp b/pxr/external/boost/python/detail/mpl_lambda.hpp index 2e4bc7afe9..4e49a7e0e3 100644 --- a/pxr/external/boost/python/detail/mpl_lambda.hpp +++ b/pxr/external/boost/python/detail/mpl_lambda.hpp @@ -10,8 +10,15 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MPL_LAMBDA_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MPL_LAMBDA_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + // this header should go away soon # include # define BOOST_PYTHON_MPL_LAMBDA_SUPPORT BOOST_MPL_AUX_LAMBDA_SUPPORT +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MPL_LAMBDA_HPP diff --git a/pxr/external/boost/python/detail/msvc_typeinfo.hpp b/pxr/external/boost/python/detail/msvc_typeinfo.hpp index cd7012ca6b..4b9c567320 100644 --- a/pxr/external/boost/python/detail/msvc_typeinfo.hpp +++ b/pxr/external/boost/python/detail/msvc_typeinfo.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MSVC_TYPEINFO_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MSVC_TYPEINFO_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include #include @@ -86,4 +92,5 @@ inline typeinfo assert_array_typeid_compiles() }}} // namespace boost::python::detail # endif // BOOST_INTEL_CXX_VERSION +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MSVC_TYPEINFO_HPP diff --git a/pxr/external/boost/python/detail/none.hpp b/pxr/external/boost/python/detail/none.hpp index 5876f33bc7..add01501f1 100644 --- a/pxr/external/boost/python/detail/none.hpp +++ b/pxr/external/boost/python/detail/none.hpp @@ -14,6 +14,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NONE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NONE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { namespace detail { @@ -22,4 +28,5 @@ inline PyObject* none() { Py_INCREF(Py_None); return Py_None; } }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NONE_HPP diff --git a/pxr/external/boost/python/detail/not_specified.hpp b/pxr/external/boost/python/detail/not_specified.hpp index f14763eb08..711bdca107 100644 --- a/pxr/external/boost/python/detail/not_specified.hpp +++ b/pxr/external/boost/python/detail/not_specified.hpp @@ -10,10 +10,17 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NOT_SPECIFIED_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NOT_SPECIFIED_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { struct not_specified {}; }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NOT_SPECIFIED_HPP diff --git a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp index 93cddb5808..245c29f59b 100644 --- a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp +++ b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NULLARY_FUNCTION_ADAPTOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NULLARY_FUNCTION_ADAPTOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include # include @@ -48,4 +54,5 @@ struct nullary_function_adaptor }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NULLARY_FUNCTION_ADAPTOR_HPP diff --git a/pxr/external/boost/python/detail/operator_id.hpp b/pxr/external/boost/python/detail/operator_id.hpp index 76a4db26e7..3e642340fb 100644 --- a/pxr/external/boost/python/detail/operator_id.hpp +++ b/pxr/external/boost/python/detail/operator_id.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OPERATOR_ID_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OPERATOR_ID_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { enum operator_id @@ -65,4 +71,5 @@ enum operator_id }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OPERATOR_ID_HPP diff --git a/pxr/external/boost/python/detail/overloads_fwd.hpp b/pxr/external/boost/python/detail/overloads_fwd.hpp index 57ccd2396c..561cac84d7 100644 --- a/pxr/external/boost/python/detail/overloads_fwd.hpp +++ b/pxr/external/boost/python/detail/overloads_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OVERLOADS_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OVERLOADS_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { // forward declarations @@ -20,4 +26,5 @@ inline void define_with_defaults(char const* name, OverloadsT const&, NameSpaceT }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OVERLOADS_FWD_HPP diff --git a/pxr/external/boost/python/detail/pointee.hpp b/pxr/external/boost/python/detail/pointee.hpp index 57d908ac65..a79b5de19d 100644 --- a/pxr/external/boost/python/detail/pointee.hpp +++ b/pxr/external/boost/python/detail/pointee.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_POINTEE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_POINTEE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/type_traits.hpp" namespace boost { namespace python { namespace detail { @@ -37,4 +43,5 @@ struct pointee }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_POINTEE_HPP diff --git a/pxr/external/boost/python/detail/prefix.hpp b/pxr/external/boost/python/detail/prefix.hpp index 3dd752c09b..296c1eb6da 100644 --- a/pxr/external/boost/python/detail/prefix.hpp +++ b/pxr/external/boost/python/detail/prefix.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREFIX_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREFIX_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + // The rule is that must be included before any system // headers (so it can get control over some awful macros). // Unfortunately, Boost.Python needs to #include first, at @@ -18,4 +24,5 @@ # include "pxr/external/boost/python/detail/wrap_python.hpp" # include "pxr/external/boost/python/detail/config.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREFIX_HPP diff --git a/pxr/external/boost/python/detail/preprocessor.hpp b/pxr/external/boost/python/detail/preprocessor.hpp index ff8ad63d57..3034a1a211 100644 --- a/pxr/external/boost/python/detail/preprocessor.hpp +++ b/pxr/external/boost/python/detail/preprocessor.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREPROCESSOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREPROCESSOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include # include @@ -68,4 +74,5 @@ # define BOOST_PYTHON_FUNCTION_POINTER 0x0001 # define BOOST_PYTHON_POINTER_TO_MEMBER 0x0002 +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREPROCESSOR_HPP diff --git a/pxr/external/boost/python/detail/python_type.hpp b/pxr/external/boost/python/detail/python_type.hpp index f67d984ae5..bfefb13b3c 100644 --- a/pxr/external/boost/python/detail/python_type.hpp +++ b/pxr/external/boost/python/detail/python_type.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PYTHON_TYPE_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PYTHON_TYPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/converter/registered.hpp" namespace boost {namespace python {namespace detail{ @@ -39,4 +45,5 @@ template struct python_class : PyObject }}} //namespace boost :: python :: detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif //PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PYTHON_TYPE_HPP diff --git a/pxr/external/boost/python/detail/raw_pyobject.hpp b/pxr/external/boost/python/detail/raw_pyobject.hpp index a5e6a34d9f..3dac279bcc 100644 --- a/pxr/external/boost/python/detail/raw_pyobject.hpp +++ b/pxr/external/boost/python/detail/raw_pyobject.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RAW_PYOBJECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RAW_PYOBJECT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace detail { // @@ -34,4 +40,5 @@ typedef new_non_null_reference_t* new_non_null_reference; }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RAW_PYOBJECT_HPP diff --git a/pxr/external/boost/python/detail/referent_storage.hpp b/pxr/external/boost/python/detail/referent_storage.hpp index 0cb5dc84e1..3d9067c46c 100644 --- a/pxr/external/boost/python/detail/referent_storage.hpp +++ b/pxr/external/boost/python/detail/referent_storage.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_REFERENT_STORAGE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_REFERENT_STORAGE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include # include # include @@ -47,4 +53,5 @@ struct referent_storage }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_REFERENT_STORAGE_HPP diff --git a/pxr/external/boost/python/detail/result.hpp b/pxr/external/boost/python/detail/result.hpp index fd5445d7a9..c5f99205e4 100644 --- a/pxr/external/boost/python/detail/result.hpp +++ b/pxr/external/boost/python/detail/result.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RESULT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RESULT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include "pxr/external/boost/python/detail/preprocessor.hpp" @@ -86,6 +92,7 @@ result(X const&, short = 0) { return 0; } }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RESULT_HPP /* --------------- function pointers --------------- */ diff --git a/pxr/external/boost/python/detail/scope.hpp b/pxr/external/boost/python/detail/scope.hpp index 0f4c9a2e7b..b0eefcdc47 100644 --- a/pxr/external/boost/python/detail/scope.hpp +++ b/pxr/external/boost/python/detail/scope.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SCOPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SCOPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/config.hpp" namespace boost { namespace python { namespace detail { @@ -18,4 +24,5 @@ void BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& obj, ch }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SCOPE_HPP diff --git a/pxr/external/boost/python/detail/sfinae.hpp b/pxr/external/boost/python/detail/sfinae.hpp index 120f7a2206..5b3b9c45fd 100644 --- a/pxr/external/boost/python/detail/sfinae.hpp +++ b/pxr/external/boost/python/detail/sfinae.hpp @@ -9,10 +9,17 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SFINAE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SFINAE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # if defined(BOOST_NO_SFINAE) && !defined(BOOST_MSVC) # define BOOST_PYTHON_NO_SFINAE # endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SFINAE_HPP diff --git a/pxr/external/boost/python/detail/signature.hpp b/pxr/external/boost/python/detail/signature.hpp index 79700b3b48..d73d25dcec 100644 --- a/pxr/external/boost/python/detail/signature.hpp +++ b/pxr/external/boost/python/detail/signature.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SIGNATURE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SIGNATURE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/detail/preprocessor.hpp" @@ -65,6 +71,7 @@ struct signature }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SIGNATURE_HPP #else diff --git a/pxr/external/boost/python/detail/string_literal.hpp b/pxr/external/boost/python/detail/string_literal.hpp index ecbc76fe29..7c8f9eeff8 100644 --- a/pxr/external/boost/python/detail/string_literal.hpp +++ b/pxr/external/boost/python/detail/string_literal.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_STRING_LITERAL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_STRING_LITERAL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -51,4 +57,5 @@ struct is_string_literal }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_STRING_LITERAL_HPP diff --git a/pxr/external/boost/python/detail/target.hpp b/pxr/external/boost/python/detail/target.hpp index bdae712c3a..6ad4cf61f5 100644 --- a/pxr/external/boost/python/detail/target.hpp +++ b/pxr/external/boost/python/detail/target.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TARGET_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TARGET_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/preprocessor.hpp" # include @@ -39,6 +45,7 @@ T& (* target(R (T::*)) )() { return 0; } }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TARGET_HPP /* --------------- function pointers --------------- */ diff --git a/pxr/external/boost/python/detail/translate_exception.hpp b/pxr/external/boost/python/detail/translate_exception.hpp index 5718b75ab8..5c3367af4c 100644 --- a/pxr/external/boost/python/detail/translate_exception.hpp +++ b/pxr/external/boost/python/detail/translate_exception.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TRANSLATE_EXCEPTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TRANSLATE_EXCEPTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/exception_handler.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -69,4 +75,5 @@ struct translate_exception }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // TRANSLATE_EXCEPTION_DWA2002810_HPP diff --git a/pxr/external/boost/python/detail/type_list.hpp b/pxr/external/boost/python/detail/type_list.hpp index 486bae9867..a690e5ce98 100644 --- a/pxr/external/boost/python/detail/type_list.hpp +++ b/pxr/external/boost/python/detail/type_list.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include "pxr/external/boost/python/detail/preprocessor.hpp" # include @@ -37,4 +43,5 @@ # include "pxr/external/boost/python/detail/type_list_impl.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_HPP diff --git a/pxr/external/boost/python/detail/type_list_impl.hpp b/pxr/external/boost/python/detail/type_list_impl.hpp index 00a99f0d54..7ccafa3613 100644 --- a/pxr/external/boost/python/detail/type_list_impl.hpp +++ b/pxr/external/boost/python/detail/type_list_impl.hpp @@ -11,6 +11,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_IMPL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_IMPL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/type_list.hpp" # include @@ -36,6 +42,7 @@ struct type_list }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_IMPL_HPP #else // BOOST_PP_IS_ITERATING diff --git a/pxr/external/boost/python/detail/type_traits.hpp b/pxr/external/boost/python/detail/type_traits.hpp index 6e6eaaee2e..51ee62bf67 100644 --- a/pxr/external/boost/python/detail/type_traits.hpp +++ b/pxr/external/boost/python/detail/type_traits.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include #ifdef BOOST_NO_CXX11_HDR_TYPE_TRAITS @@ -113,4 +119,5 @@ namespace boost { namespace python { namespace detail { }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif //BOOST_DETAIL_TYPE_TRAITS_HPP diff --git a/pxr/external/boost/python/detail/unwind_type.hpp b/pxr/external/boost/python/detail/unwind_type.hpp index 7d79cef85f..b3c8dc2cf8 100644 --- a/pxr/external/boost/python/detail/unwind_type.hpp +++ b/pxr/external/boost/python/detail/unwind_type.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWIND_TYPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWIND_TYPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/cv_category.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -174,4 +180,5 @@ unwind_type(boost::type*p =0, Generator* =0) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWIND_TYPE_HPP diff --git a/pxr/external/boost/python/detail/unwrap_type_id.hpp b/pxr/external/boost/python/detail/unwrap_type_id.hpp index bc9ea96304..5a401236a1 100644 --- a/pxr/external/boost/python/detail/unwrap_type_id.hpp +++ b/pxr/external/boost/python/detail/unwrap_type_id.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_TYPE_ID_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_TYPE_ID_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include @@ -33,4 +39,5 @@ inline type_info unwrap_type_id(U*, wrapper*) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_TYPE_ID_HPP diff --git a/pxr/external/boost/python/detail/unwrap_wrapper.hpp b/pxr/external/boost/python/detail/unwrap_wrapper.hpp index db21ce6f09..4b3af3ac15 100644 --- a/pxr/external/boost/python/detail/unwrap_wrapper.hpp +++ b/pxr/external/boost/python/detail/unwrap_wrapper.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_WRAPPER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_WRAPPER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/is_wrapper.hpp" # include @@ -36,4 +42,5 @@ unwrap_wrapper(T*) }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_WRAPPER_HPP diff --git a/pxr/external/boost/python/detail/value_arg.hpp b/pxr/external/boost/python/detail/value_arg.hpp index 6723658a4b..4ec119432c 100644 --- a/pxr/external/boost/python/detail/value_arg.hpp +++ b/pxr/external/boost/python/detail/value_arg.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_ARG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_ARG_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp" # include # include "pxr/external/boost/python/detail/indirect_traits.hpp" @@ -28,4 +34,5 @@ struct value_arg }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_ARG_HPP diff --git a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp index 88931b1689..989e2e434b 100644 --- a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_SHARED_PTR_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_SHARED_PTR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/value_is_xxx.hpp" #include "pxr/external/boost/python/detail/is_shared_ptr.hpp" @@ -30,4 +36,5 @@ struct value_is_shared_ptr }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // VALUE_IS_SHARED_PTR_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/value_is_xxx.hpp b/pxr/external/boost/python/detail/value_is_xxx.hpp index 96fee57ea4..5396196cb6 100644 --- a/pxr/external/boost/python/detail/value_is_xxx.hpp +++ b/pxr/external/boost/python/detail/value_is_xxx.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_XXX_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_XXX_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include # include @@ -35,4 +41,5 @@ struct value_is_##name \ }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_XXX_HPP diff --git a/pxr/external/boost/python/detail/void_ptr.hpp b/pxr/external/boost/python/detail/void_ptr.hpp index ef73f93a96..354d5ece2e 100644 --- a/pxr/external/boost/python/detail/void_ptr.hpp +++ b/pxr/external/boost/python/detail/void_ptr.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_PTR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_PTR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/type_traits.hpp" namespace boost { namespace python { namespace detail { @@ -37,4 +43,5 @@ inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U& }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_PTR_HPP diff --git a/pxr/external/boost/python/detail/void_return.hpp b/pxr/external/boost/python/detail/void_return.hpp index 49d3f9b2cf..0e853e3553 100644 --- a/pxr/external/boost/python/detail/void_return.hpp +++ b/pxr/external/boost/python/detail/void_return.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_RETURN_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_RETURN_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include namespace boost { namespace python { namespace detail { @@ -44,4 +50,5 @@ template <> struct returnable : returnable {}; }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_RETURN_HPP diff --git a/pxr/external/boost/python/detail/wrapper_base.hpp b/pxr/external/boost/python/detail/wrapper_base.hpp index 430cbc7b1c..01a7350d6e 100644 --- a/pxr/external/boost/python/detail/wrapper_base.hpp +++ b/pxr/external/boost/python/detail/wrapper_base.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_WRAPPER_BASE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_WRAPPER_BASE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -91,4 +97,5 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_WRAPPER_BASE_HPP diff --git a/pxr/external/boost/python/dict.hpp b/pxr/external/boost/python/dict.hpp index 8b4a4bf6c3..e625bdf4a2 100644 --- a/pxr/external/boost/python/dict.hpp +++ b/pxr/external/boost/python/dict.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DICT_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DICT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" #include "pxr/external/boost/python/object.hpp" @@ -153,5 +159,6 @@ namespace converter }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/docstring_options.hpp b/pxr/external/boost/python/docstring_options.hpp index 52c9e0a528..21737daec4 100644 --- a/pxr/external/boost/python/docstring_options.hpp +++ b/pxr/external/boost/python/docstring_options.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_DOCSTRING_OPTIONS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_DOCSTRING_OPTIONS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/object/function.hpp" namespace boost { namespace python { @@ -129,4 +135,5 @@ class BOOST_PYTHON_DECL docstring_options : boost::noncopyable }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DOCSTRING_OPTIONS_HPP diff --git a/pxr/external/boost/python/enum.hpp b/pxr/external/boost/python/enum.hpp index 416dd8f84c..f1fb4fbad6 100644 --- a/pxr/external/boost/python/enum.hpp +++ b/pxr/external/boost/python/enum.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ENUM_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ENUM_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object/enum_base.hpp" @@ -110,4 +116,5 @@ inline enum_& enum_::export_values() }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ENUM_HPP diff --git a/pxr/external/boost/python/errors.hpp b/pxr/external/boost/python/errors.hpp index 2e784c6ae2..883ce33bd7 100644 --- a/pxr/external/boost/python/errors.hpp +++ b/pxr/external/boost/python/errors.hpp @@ -14,6 +14,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ERRORS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ERRORS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -57,4 +63,5 @@ BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* pytype, PyObject* source) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ERRORS_HPP diff --git a/pxr/external/boost/python/exception_translator.hpp b/pxr/external/boost/python/exception_translator.hpp index ed0dde932e..573380cf81 100644 --- a/pxr/external/boost/python/exception_translator.hpp +++ b/pxr/external/boost/python/exception_translator.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_EXCEPTION_TRANSLATOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_EXCEPTION_TRANSLATOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -31,4 +37,5 @@ void register_exception_translator(Translate translate, boost::type +#else + # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/str.hpp" @@ -65,4 +71,5 @@ exec_file(char const *filename, object global = object(), object local = object( } } +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/extract.hpp b/pxr/external/boost/python/extract.hpp index 649774d722..24afd4ae88 100644 --- a/pxr/external/boost/python/extract.hpp +++ b/pxr/external/boost/python/extract.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_EXTRACT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_EXTRACT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/object_manager.hpp" @@ -261,4 +267,5 @@ namespace converter }} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_EXTRACT_HPP diff --git a/pxr/external/boost/python/handle.hpp b/pxr/external/boost/python/handle.hpp index 29fd25610e..1fcc6cd7be 100644 --- a/pxr/external/boost/python/handle.hpp +++ b/pxr/external/boost/python/handle.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_HANDLE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_HANDLE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/cast.hpp" @@ -239,4 +245,5 @@ inline PyObject* get_managed_object(handle const& h, tag_t) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HANDLE_HPP diff --git a/pxr/external/boost/python/handle_fwd.hpp b/pxr/external/boost/python/handle_fwd.hpp index 4a60272667..dc81de1e8e 100644 --- a/pxr/external/boost/python/handle_fwd.hpp +++ b/pxr/external/boost/python/handle_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_HANDLE_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_HANDLE_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -18,4 +24,5 @@ template class handle; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HANDLE_FWD_HPP diff --git a/pxr/external/boost/python/has_back_reference.hpp b/pxr/external/boost/python/has_back_reference.hpp index 49a3a009de..a5c1e88fb6 100644 --- a/pxr/external/boost/python/has_back_reference.hpp +++ b/pxr/external/boost/python/has_back_reference.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_HAS_BACK_REFERENCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_HAS_BACK_REFERENCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -26,4 +32,5 @@ struct has_back_reference }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HAS_BACK_REFERENCE_HPP diff --git a/pxr/external/boost/python/implicit.hpp b/pxr/external/boost/python/implicit.hpp index e7ff9a886f..6cac1e4245 100644 --- a/pxr/external/boost/python/implicit.hpp +++ b/pxr/external/boost/python/implicit.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_IMPLICIT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_IMPLICIT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include # include "pxr/external/boost/python/converter/implicit.hpp" @@ -38,4 +44,5 @@ void implicitly_convertible(boost::type* = 0, boost::type* = 0) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_IMPLICIT_HPP diff --git a/pxr/external/boost/python/import.hpp b/pxr/external/boost/python/import.hpp index 8eba5dec46..4c34a014b8 100644 --- a/pxr/external/boost/python/import.hpp +++ b/pxr/external/boost/python/import.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_IMPORT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_IMPORT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/str.hpp" @@ -24,4 +30,5 @@ object BOOST_PYTHON_DECL import(str name); } } +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/init.hpp b/pxr/external/boost/python/init.hpp index 51c95ec46b..8772705a4c 100644 --- a/pxr/external/boost/python/init.hpp +++ b/pxr/external/boost/python/init.hpp @@ -13,6 +13,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_INIT_HPP #define PXR_EXTERNAL_BOOST_PYTHON_INIT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" #include "pxr/external/boost/python/detail/type_list.hpp" @@ -392,6 +398,7 @@ namespace detail #undef BOOST_PYTHON_APPEND_TO_INIT /////////////////////////////////////////////////////////////////////////////// +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_INIT_HPP diff --git a/pxr/external/boost/python/instance_holder.hpp b/pxr/external/boost/python/instance_holder.hpp index 5755ae27e7..9f500213aa 100644 --- a/pxr/external/boost/python/instance_holder.hpp +++ b/pxr/external/boost/python/instance_holder.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_INSTANCE_HOLDER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_INSTANCE_HOLDER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -65,4 +71,5 @@ inline instance_holder* instance_holder::next() const }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_INSTANCE_HOLDER_HPP diff --git a/pxr/external/boost/python/iterator.hpp b/pxr/external/boost/python/iterator.hpp index 780ca68cde..1971c9270d 100644 --- a/pxr/external/boost/python/iterator.hpp +++ b/pxr/external/boost/python/iterator.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_ITERATOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_ITERATOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/target.hpp" @@ -138,4 +144,5 @@ struct iterator : object }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ITERATOR_HPP diff --git a/pxr/external/boost/python/list.hpp b/pxr/external/boost/python/list.hpp index 1af9e01e4d..a4b0fc45a4 100644 --- a/pxr/external/boost/python/list.hpp +++ b/pxr/external/boost/python/list.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_LIST_HPP # define PXR_EXTERNAL_BOOST_PYTHON_LIST_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object.hpp" @@ -150,4 +156,5 @@ namespace converter }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LIST_HPP diff --git a/pxr/external/boost/python/long.hpp b/pxr/external/boost/python/long.hpp index 50975c9717..1fa085ad69 100644 --- a/pxr/external/boost/python/long.hpp +++ b/pxr/external/boost/python/long.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_LONG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_LONG_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object.hpp" @@ -70,4 +76,5 @@ namespace converter }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LONG_HPP diff --git a/pxr/external/boost/python/lvalue_from_pytype.hpp b/pxr/external/boost/python/lvalue_from_pytype.hpp index 1333cc3f14..8aea52a9c2 100644 --- a/pxr/external/boost/python/lvalue_from_pytype.hpp +++ b/pxr/external/boost/python/lvalue_from_pytype.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_LVALUE_FROM_PYTYPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_LVALUE_FROM_PYTYPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" #ifndef BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" @@ -119,4 +125,5 @@ struct lvalue_from_pytype }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LVALUE_FROM_PYTYPE_HPP diff --git a/pxr/external/boost/python/make_constructor.hpp b/pxr/external/boost/python/make_constructor.hpp index 29fad8a52f..b1be13882b 100644 --- a/pxr/external/boost/python/make_constructor.hpp +++ b/pxr/external/boost/python/make_constructor.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_MAKE_CONSTRUCTOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_MAKE_CONSTRUCTOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -283,4 +289,5 @@ object make_constructor( }} +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_MAKE_CONSTRUCTOR_HPP diff --git a/pxr/external/boost/python/make_function.hpp b/pxr/external/boost/python/make_function.hpp index c502cb4b65..de70aa024c 100644 --- a/pxr/external/boost/python/make_function.hpp +++ b/pxr/external/boost/python/make_function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_MAKE_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_MAKE_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -155,4 +161,5 @@ object make_function( }} +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_MAKE_FUNCTION_HPP diff --git a/pxr/external/boost/python/manage_new_object.hpp b/pxr/external/boost/python/manage_new_object.hpp index dec58564c4..bd4987e46b 100644 --- a/pxr/external/boost/python/manage_new_object.hpp +++ b/pxr/external/boost/python/manage_new_object.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_MANAGE_NEW_OBJECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_MANAGE_NEW_OBJECT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -43,4 +49,5 @@ struct manage_new_object }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_MANAGE_NEW_OBJECT_HPP diff --git a/pxr/external/boost/python/module.hpp b/pxr/external/boost/python/module.hpp index 834b3bf6e3..6bbbcf0da0 100644 --- a/pxr/external/boost/python/module.hpp +++ b/pxr/external/boost/python/module.hpp @@ -10,9 +10,16 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_MODULE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_MODULE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/module_init.hpp" # define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // MODULE_DWA20011221_HPP diff --git a/pxr/external/boost/python/module_init.hpp b/pxr/external/boost/python/module_init.hpp index d2b0eb2caf..9d65e66854 100644 --- a/pxr/external/boost/python/module_init.hpp +++ b/pxr/external/boost/python/module_init.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_MODULE_INIT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_MODULE_INIT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include # include @@ -77,4 +83,5 @@ extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name) # endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_MODULE_INIT_HPP diff --git a/pxr/external/boost/python/numpy.hpp b/pxr/external/boost/python/numpy.hpp index 78fe2ebbc4..42bc2c0b71 100644 --- a/pxr/external/boost/python/numpy.hpp +++ b/pxr/external/boost/python/numpy.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/numpy/dtype.hpp" #include "pxr/external/boost/python/numpy/ndarray.hpp" #include "pxr/external/boost/python/numpy/scalars.hpp" @@ -36,4 +42,5 @@ BOOST_NUMPY_DECL void initialize(bool register_scalar_converters=true); }}} // namespace boost::python::numpy +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/config.hpp b/pxr/external/boost/python/numpy/config.hpp index 82228602c5..2ffb3ae0c8 100644 --- a/pxr/external/boost/python/numpy/config.hpp +++ b/pxr/external/boost/python/numpy/config.hpp @@ -17,6 +17,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_CONFIG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_CONFIG_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include /***************************************************************************** @@ -87,4 +93,5 @@ #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_NUMPY_CONFIG_HPP diff --git a/pxr/external/boost/python/numpy/dtype.hpp b/pxr/external/boost/python/numpy/dtype.hpp index b993aee9cd..14ba092a94 100644 --- a/pxr/external/boost/python/numpy/dtype.hpp +++ b/pxr/external/boost/python/numpy/dtype.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_DTYPE_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_DTYPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @file boost/python/numpy/dtype.hpp * @brief Object manager for Python's numpy.dtype class. @@ -119,4 +125,5 @@ namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::dtype); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/internal.hpp b/pxr/external/boost/python/numpy/internal.hpp index 087196bfca..97b4520140 100644 --- a/pxr/external/boost/python/numpy/internal.hpp +++ b/pxr/external/boost/python/numpy/internal.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INTERNAL_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INTERNAL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @file boost/python/numpy/internal.hpp * @brief Internal header file to include the Numpy C-API headers. @@ -38,4 +44,5 @@ ERROR_internal_hpp_is_for_internal_use_only #define NUMPY_OBJECT_MANAGER_TRAITS_IMPL(pytype,manager) \ PyTypeObject const * object_manager_traits::get_pytype() { return &pytype; } +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/invoke_matching.hpp b/pxr/external/boost/python/numpy/invoke_matching.hpp index 71db758fc7..5d1eb191d0 100644 --- a/pxr/external/boost/python/numpy/invoke_matching.hpp +++ b/pxr/external/boost/python/numpy/invoke_matching.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INVOKE_MATCHING_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INVOKE_MATCHING_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @brief Template invocation based on dtype matching. */ @@ -188,4 +194,5 @@ void invoke_matching_array(ndarray const & array_, Function f) }}} // namespace boost::python::numpy +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/matrix.hpp b/pxr/external/boost/python/numpy/matrix.hpp index 6bef6159cd..064a523c57 100644 --- a/pxr/external/boost/python/numpy/matrix.hpp +++ b/pxr/external/boost/python/numpy/matrix.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_MATRIX_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_MATRIX_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @brief Object manager for numpy.matrix. */ @@ -86,4 +92,5 @@ NUMPY_OBJECT_MANAGER_TRAITS(numpy::matrix); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/ndarray.hpp b/pxr/external/boost/python/numpy/ndarray.hpp index a8dce345cb..a9420dbc65 100644 --- a/pxr/external/boost/python/numpy/ndarray.hpp +++ b/pxr/external/boost/python/numpy/ndarray.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NDARRAY_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NDARRAY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @brief Object manager and various utilities for numpy.ndarray. */ @@ -315,4 +321,5 @@ NUMPY_OBJECT_MANAGER_TRAITS(numpy::ndarray); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp index 503a3e5af6..e82067c75e 100644 --- a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp +++ b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/numpy/config.hpp" /** @@ -39,5 +45,6 @@ struct BOOST_NUMPY_DECL object_manager_traits \ static PyTypeObject const * get_pytype(); \ } +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/scalars.hpp b/pxr/external/boost/python/numpy/scalars.hpp index aee6493983..fb43f2cb55 100644 --- a/pxr/external/boost/python/numpy/scalars.hpp +++ b/pxr/external/boost/python/numpy/scalars.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_SCALARS_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_SCALARS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @brief Object managers for array scalars (currently only numpy.void is implemented). */ @@ -60,4 +66,5 @@ namespace converter NUMPY_OBJECT_MANAGER_TRAITS(numpy::void_); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/ufunc.hpp b/pxr/external/boost/python/numpy/ufunc.hpp index 8ecab72da0..6f15879331 100644 --- a/pxr/external/boost/python/numpy/ufunc.hpp +++ b/pxr/external/boost/python/numpy/ufunc.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_NUMPY_UFUNC_HPP #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_UFUNC_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + /** * @brief Utilities to create ufunc-like broadcasting functions out of C++ functors. */ @@ -208,4 +214,5 @@ NUMPY_OBJECT_MANAGER_TRAITS(numpy::multi_iter); }}} // namespace boost::python::converter +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/object.hpp b/pxr/external/boost/python/object.hpp index 1cd1823392..a7775b6dc7 100644 --- a/pxr/external/boost/python/object.hpp +++ b/pxr/external/boost/python/object.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/ssize_t.hpp" # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object_attributes.hpp" @@ -29,4 +35,5 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_HPP diff --git a/pxr/external/boost/python/object/add_to_namespace.hpp b/pxr/external/boost/python/object/add_to_namespace.hpp index ccdb2df52c..3f1d76a08d 100644 --- a/pxr/external/boost/python/object/add_to_namespace.hpp +++ b/pxr/external/boost/python/object/add_to_namespace.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ADD_TO_NAMESPACE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ADD_TO_NAMESPACE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object_fwd.hpp" namespace boost { namespace python { namespace objects { @@ -25,4 +31,5 @@ BOOST_PYTHON_DECL void add_to_namespace( }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ADD_TO_NAMESPACE_HPP diff --git a/pxr/external/boost/python/object/class.hpp b/pxr/external/boost/python/object/class.hpp index efbbbe3c6a..1dbfbbe2e6 100644 --- a/pxr/external/boost/python/object/class.hpp +++ b/pxr/external/boost/python/object/class.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/type_id.hpp" @@ -65,4 +71,5 @@ struct BOOST_PYTHON_DECL class_base : python::api::object }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_HPP diff --git a/pxr/external/boost/python/object/class_detail.hpp b/pxr/external/boost/python/object/class_detail.hpp index 2bf3026b05..4e9f442fc3 100644 --- a/pxr/external/boost/python/object/class_detail.hpp +++ b/pxr/external/boost/python/object/class_detail.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_DETAIL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_DETAIL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/handle.hpp" # include "pxr/external/boost/python/type_id.hpp" @@ -21,4 +27,5 @@ BOOST_PYTHON_DECL type_handle class_type(); }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_DETAIL_HPP diff --git a/pxr/external/boost/python/object/class_metadata.hpp b/pxr/external/boost/python/object/class_metadata.hpp index b40b4e5aab..1cb34d60ff 100644 --- a/pxr/external/boost/python/object/class_metadata.hpp +++ b/pxr/external/boost/python/object/class_metadata.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_METADATA_HPP #define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_METADATA_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/converter/shared_ptr_from_python.hpp" #include "pxr/external/boost/python/object/inheritance.hpp" #include "pxr/external/boost/python/object/class_wrapper.hpp" @@ -296,4 +302,5 @@ struct class_metadata }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/object/class_wrapper.hpp b/pxr/external/boost/python/object/class_wrapper.hpp index 90a2d624cb..b006fd7ff8 100644 --- a/pxr/external/boost/python/object/class_wrapper.hpp +++ b/pxr/external/boost/python/object/class_wrapper.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_WRAPPER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_WRAPPER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/to_python_converter.hpp" #ifndef BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" @@ -53,4 +59,5 @@ struct class_value_wrapper }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_WRAPPER_HPP diff --git a/pxr/external/boost/python/object/enum_base.hpp b/pxr/external/boost/python/object/enum_base.hpp index 8e01173239..5c6bf7e602 100644 --- a/pxr/external/boost/python/object/enum_base.hpp +++ b/pxr/external/boost/python/object/enum_base.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ENUM_BASE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ENUM_BASE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/converter/to_python_function_type.hpp" @@ -38,4 +44,5 @@ struct BOOST_PYTHON_DECL enum_base : python::api::object }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ENUM_BASE_HPP diff --git a/pxr/external/boost/python/object/find_instance.hpp b/pxr/external/boost/python/object/find_instance.hpp index d860453558..84120f5bba 100644 --- a/pxr/external/boost/python/object/find_instance.hpp +++ b/pxr/external/boost/python/object/find_instance.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FIND_INSTANCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FIND_INSTANCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" namespace boost { namespace python { namespace objects { @@ -23,4 +29,5 @@ BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_share }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FIND_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/forward.hpp b/pxr/external/boost/python/object/forward.hpp index d8b0089f01..0cc1a03abc 100644 --- a/pxr/external/boost/python/object/forward.hpp +++ b/pxr/external/boost/python/object/forward.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FORWARD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FORWARD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include # include "pxr/external/boost/python/detail/value_arg.hpp" @@ -96,4 +102,5 @@ T const& do_unforward(T const& x, ...) }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FORWARD_HPP diff --git a/pxr/external/boost/python/object/function.hpp b/pxr/external/boost/python/object/function.hpp index 87e758f141..5a1c595c3d 100644 --- a/pxr/external/boost/python/object/function.hpp +++ b/pxr/external/boost/python/object/function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/args_fwd.hpp" # include "pxr/external/boost/python/handle.hpp" @@ -84,4 +90,5 @@ inline object const& function::name() const }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HPP diff --git a/pxr/external/boost/python/object/function_doc_signature.hpp b/pxr/external/boost/python/object/function_doc_signature.hpp index ea93e08e75..f5b1c47055 100644 --- a/pxr/external/boost/python/object/function_doc_signature.hpp +++ b/pxr/external/boost/python/object/function_doc_signature.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_DOC_SIGNATURE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_DOC_SIGNATURE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/object/function.hpp" #include "pxr/external/boost/python/converter/registrations.hpp" #include "pxr/external/boost/python/str.hpp" @@ -38,4 +44,5 @@ class function_doc_signature_generator{ }}}//end of namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif //PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_DOC_SIGNATURE_HPP diff --git a/pxr/external/boost/python/object/function_handle.hpp b/pxr/external/boost/python/object/function_handle.hpp index 6514a78736..94f828ca54 100644 --- a/pxr/external/boost/python/object/function_handle.hpp +++ b/pxr/external/boost/python/object/function_handle.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HANDLE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HANDLE_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/handle.hpp" # include "pxr/external/boost/python/detail/caller.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -46,4 +52,5 @@ handle<> make_function_handle(F f) }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HANDLE_HPP diff --git a/pxr/external/boost/python/object/function_object.hpp b/pxr/external/boost/python/object/function_object.hpp index 2c1c4c9043..edb5fe9deb 100644 --- a/pxr/external/boost/python/object/function_object.hpp +++ b/pxr/external/boost/python/object/function_object.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_OBJECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_OBJECT_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/prefix.hpp" # include # include "pxr/external/boost/python/object_core.hpp" @@ -42,4 +48,5 @@ namespace objects }} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_OBJECT_HPP diff --git a/pxr/external/boost/python/object/inheritance.hpp b/pxr/external/boost/python/object/inheritance.hpp index 5e001a45db..dddd076c42 100644 --- a/pxr/external/boost/python/object/inheritance.hpp +++ b/pxr/external/boost/python/object/inheritance.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" # include # include @@ -133,4 +139,5 @@ inline void register_conversion( }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_HPP diff --git a/pxr/external/boost/python/object/inheritance_query.hpp b/pxr/external/boost/python/object/inheritance_query.hpp index 6b467a22ac..66beafa97e 100644 --- a/pxr/external/boost/python/object/inheritance_query.hpp +++ b/pxr/external/boost/python/object/inheritance_query.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_QUERY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_QUERY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/type_id.hpp" namespace boost { namespace python { namespace objects { @@ -19,4 +25,5 @@ BOOST_PYTHON_DECL void* find_dynamic_type(void* p, type_info src, type_info dst) }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_QUERY_HPP diff --git a/pxr/external/boost/python/object/instance.hpp b/pxr/external/boost/python/object/instance.hpp index abbf0a0782..61958d1eb0 100644 --- a/pxr/external/boost/python/object/instance.hpp +++ b/pxr/external/boost/python/object/instance.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INSTANCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INSTANCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" # include @@ -54,4 +60,5 @@ struct additional_instance_size }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/iterator.hpp b/pxr/external/boost/python/object/iterator.hpp index d78920fa78..ee291a1809 100644 --- a/pxr/external/boost/python/object/iterator.hpp +++ b/pxr/external/boost/python/object/iterator.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -229,4 +235,5 @@ inline iterator_range::iterator_range( }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_HPP diff --git a/pxr/external/boost/python/object/iterator_core.hpp b/pxr/external/boost/python/object/iterator_core.hpp index 3c1a264a0c..21c335c40f 100644 --- a/pxr/external/boost/python/object/iterator_core.hpp +++ b/pxr/external/boost/python/object/iterator_core.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_CORE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_CORE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object_fwd.hpp" namespace boost { namespace python { namespace objects { @@ -19,4 +25,5 @@ BOOST_PYTHON_DECL void stop_iteration_error(); }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_CORE_HPP diff --git a/pxr/external/boost/python/object/life_support.hpp b/pxr/external/boost/python/object/life_support.hpp index 96aaa05651..75a5c9e6e4 100644 --- a/pxr/external/boost/python/object/life_support.hpp +++ b/pxr/external/boost/python/object/life_support.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_LIFE_SUPPORT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_LIFE_SUPPORT_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { namespace objects { @@ -17,4 +23,5 @@ BOOST_PYTHON_DECL PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* pa }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_LIFE_SUPPORT_HPP diff --git a/pxr/external/boost/python/object/make_holder.hpp b/pxr/external/boost/python/object/make_holder.hpp index d0573aa3b7..56aac57bc2 100644 --- a/pxr/external/boost/python/object/make_holder.hpp +++ b/pxr/external/boost/python/object/make_holder.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_HOLDER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_HOLDER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object/instance.hpp" @@ -50,6 +56,7 @@ template struct make_holder; }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_HOLDER_HPP // For gcc 4.4 compatability, we must include the diff --git a/pxr/external/boost/python/object/make_instance.hpp b/pxr/external/boost/python/object/make_instance.hpp index 0a5704d6db..ab347c2d47 100644 --- a/pxr/external/boost/python/object/make_instance.hpp +++ b/pxr/external/boost/python/object/make_instance.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_INSTANCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_INSTANCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object/instance.hpp" # include "pxr/external/boost/python/converter/registered.hpp" @@ -87,4 +93,5 @@ struct make_instance }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/make_ptr_instance.hpp b/pxr/external/boost/python/object/make_ptr_instance.hpp index aa912371f3..d8e5d1669c 100644 --- a/pxr/external/boost/python/object/make_ptr_instance.hpp +++ b/pxr/external/boost/python/object/make_ptr_instance.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_PTR_INSTANCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_PTR_INSTANCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object/make_instance.hpp" # include "pxr/external/boost/python/converter/registry.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -78,4 +84,5 @@ struct make_ptr_instance }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_PTR_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/pickle_support.hpp b/pxr/external/boost/python/object/pickle_support.hpp index bd9a1ac3ca..2ecf10ca36 100644 --- a/pxr/external/boost/python/object/pickle_support.hpp +++ b/pxr/external/boost/python/object/pickle_support.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -126,4 +132,5 @@ namespace detail { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_HPP diff --git a/pxr/external/boost/python/object/pointer_holder.hpp b/pxr/external/boost/python/object/pointer_holder.hpp index 06c75ca2ea..101d38d9c8 100644 --- a/pxr/external/boost/python/object/pointer_holder.hpp +++ b/pxr/external/boost/python/object/pointer_holder.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_POINTER_HOLDER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_POINTER_HOLDER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include @@ -180,6 +186,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_POINTER_HOLDER_HPP /* --------------- pointer_holder --------------- */ diff --git a/pxr/external/boost/python/object/py_function.hpp b/pxr/external/boost/python/object/py_function.hpp index bedd5467b1..2ae2820dc2 100644 --- a/pxr/external/boost/python/object/py_function.hpp +++ b/pxr/external/boost/python/object/py_function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PY_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PY_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/signature.hpp" # include # include @@ -178,4 +184,5 @@ struct py_function }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PY_FUNCTION_HPP diff --git a/pxr/external/boost/python/object/stl_iterator_core.hpp b/pxr/external/boost/python/object/stl_iterator_core.hpp index 3f54c67a69..b5a4801e6f 100644 --- a/pxr/external/boost/python/object/stl_iterator_core.hpp +++ b/pxr/external/boost/python/object/stl_iterator_core.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_STL_ITERATOR_CORE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_STL_ITERATOR_CORE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object_fwd.hpp" # include "pxr/external/boost/python/handle_fwd.hpp" @@ -29,4 +35,5 @@ struct BOOST_PYTHON_DECL stl_input_iterator_impl }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_STL_ITERATOR_CORE_HPP diff --git a/pxr/external/boost/python/object/value_holder.hpp b/pxr/external/boost/python/object/value_holder.hpp index 945c6cf0c2..5e8ac4724e 100644 --- a/pxr/external/boost/python/object/value_holder.hpp +++ b/pxr/external/boost/python/object/value_holder.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/object/value_holder_fwd.hpp" # include "pxr/external/boost/python/instance_holder.hpp" @@ -114,6 +120,7 @@ void* value_holder_back_reference::holds( }}} // namespace boost::python::objects +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_HPP // --------------- value_holder --------------- diff --git a/pxr/external/boost/python/object/value_holder_fwd.hpp b/pxr/external/boost/python/object/value_holder_fwd.hpp index 66fdfeb781..0a5ab74481 100644 --- a/pxr/external/boost/python/object/value_holder_fwd.hpp +++ b/pxr/external/boost/python/object/value_holder_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + namespace boost { namespace python { namespace objects { struct no_back_reference; @@ -18,4 +24,5 @@ template struct value_holder_generator; }}} // namespace boost::python::object +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_FWD_HPP diff --git a/pxr/external/boost/python/object_attributes.hpp b/pxr/external/boost/python/object_attributes.hpp index ce3fd9c1e5..51f6d05f48 100644 --- a/pxr/external/boost/python/object_attributes.hpp +++ b/pxr/external/boost/python/object_attributes.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ATTRIBUTES_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ATTRIBUTES_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/proxy.hpp" @@ -118,4 +124,5 @@ inline void objattribute_policies::del( }}} // namespace boost::python::api +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ATTRIBUTES_HPP diff --git a/pxr/external/boost/python/object_core.hpp b/pxr/external/boost/python/object_core.hpp index 7c0b027ffc..befed56aef 100644 --- a/pxr/external/boost/python/object_core.hpp +++ b/pxr/external/boost/python/object_core.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CORE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CORE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # define BOOST_PYTHON_OBJECT_HAS_IS_NONE // added 2010-03-15 by rwgk # include "pxr/external/boost/python/detail/prefix.hpp" @@ -487,4 +493,5 @@ inline PyObject* get_managed_object(object const& x, tag_t) # include "pxr/external/boost/python/slice_nil.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CORE_HPP diff --git a/pxr/external/boost/python/object_fwd.hpp b/pxr/external/boost/python/object_fwd.hpp index e5cfadb895..4353057976 100644 --- a/pxr/external/boost/python/object_fwd.hpp +++ b/pxr/external/boost/python/object_fwd.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FWD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FWD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -20,4 +26,5 @@ namespace api using api::object; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FWD_HPP diff --git a/pxr/external/boost/python/object_items.hpp b/pxr/external/boost/python/object_items.hpp index 1579239387..ec90b395e8 100644 --- a/pxr/external/boost/python/object_items.hpp +++ b/pxr/external/boost/python/object_items.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITEMS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITEMS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/proxy.hpp" @@ -88,4 +94,5 @@ inline void item_policies::del( }}} // namespace boost::python::api +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITEMS_HPP diff --git a/pxr/external/boost/python/object_operators.hpp b/pxr/external/boost/python/object_operators.hpp index cd46a736ee..863062e96d 100644 --- a/pxr/external/boost/python/object_operators.hpp +++ b/pxr/external/boost/python/object_operators.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_OPERATORS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_OPERATORS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_core.hpp" @@ -138,4 +144,5 @@ BOOST_PYTHON_INPLACE_OPERATOR(|=) #include +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_OPERATORS_HPP diff --git a/pxr/external/boost/python/object_protocol.hpp b/pxr/external/boost/python/object_protocol.hpp index de2eb0122d..a3c59ba67e 100644 --- a/pxr/external/boost/python/object_protocol.hpp +++ b/pxr/external/boost/python/object_protocol.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_protocol_core.hpp" @@ -92,4 +98,5 @@ void delslice(object const& target, Begin const& begin, End const& end) }}} // namespace boost::python::api +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_HPP diff --git a/pxr/external/boost/python/object_protocol_core.hpp b/pxr/external/boost/python/object_protocol_core.hpp index e0ecad4711..1d5783cf58 100644 --- a/pxr/external/boost/python/object_protocol_core.hpp +++ b/pxr/external/boost/python/object_protocol_core.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_CORE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_CORE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/handle_fwd.hpp" @@ -55,4 +61,5 @@ using api::delslice; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_CORE_HPP diff --git a/pxr/external/boost/python/object_slices.hpp b/pxr/external/boost/python/object_slices.hpp index 7402810c90..d526fde5d3 100644 --- a/pxr/external/boost/python/object_slices.hpp +++ b/pxr/external/boost/python/object_slices.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OBJECT_SLICES_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_SLICES_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/proxy.hpp" @@ -148,4 +154,5 @@ inline void slice_policies::del( }}} // namespace boost::python::api +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_SLICES_HPP diff --git a/pxr/external/boost/python/opaque_pointer_converter.hpp b/pxr/external/boost/python/opaque_pointer_converter.hpp index 017563ed18..099a3cda90 100644 --- a/pxr/external/boost/python/opaque_pointer_converter.hpp +++ b/pxr/external/boost/python/opaque_pointer_converter.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_OPAQUE_POINTER_CONVERTER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OPAQUE_POINTER_CONVERTER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/lvalue_from_pytype.hpp" # include "pxr/external/boost/python/to_python_converter.hpp" @@ -189,4 +195,5 @@ PyTypeObject opaque::type_object = } \ }} +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OPAQUE_POINTER_CONVERTER_HPP diff --git a/pxr/external/boost/python/operators.hpp b/pxr/external/boost/python/operators.hpp index c6d63c2286..4fcbf57e59 100644 --- a/pxr/external/boost/python/operators.hpp +++ b/pxr/external/boost/python/operators.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OPERATORS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OPERATORS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/def_visitor.hpp" @@ -376,4 +382,5 @@ using boost::python::self_ns::repr; using boost::python::self_ns::pow; # endif +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OPERATORS_HPP diff --git a/pxr/external/boost/python/other.hpp b/pxr/external/boost/python/other.hpp index e016c447e7..e7ebe37776 100644 --- a/pxr/external/boost/python/other.hpp +++ b/pxr/external/boost/python/other.hpp @@ -1,6 +1,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OTHER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OTHER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" // // Copyright 2024 Pixar @@ -54,4 +60,5 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/overloads.hpp b/pxr/external/boost/python/overloads.hpp index 322c651232..7164d4a6f5 100644 --- a/pxr/external/boost/python/overloads.hpp +++ b/pxr/external/boost/python/overloads.hpp @@ -10,9 +10,16 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OVERLOADS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OVERLOADS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/overloads_fwd.hpp" # include "pxr/external/boost/python/detail/defaults_def.hpp" +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OVERLOADS_HPP diff --git a/pxr/external/boost/python/override.hpp b/pxr/external/boost/python/override.hpp index 05c13b5a9a..249e9143a8 100644 --- a/pxr/external/boost/python/override.hpp +++ b/pxr/external/boost/python/override.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_OVERRIDE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_OVERRIDE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/return_from_python.hpp" @@ -120,6 +126,7 @@ class override : public object }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OVERRIDE_HPP #else diff --git a/pxr/external/boost/python/pointee.hpp b/pxr/external/boost/python/pointee.hpp index 40abf570da..dfa30f5108 100644 --- a/pxr/external/boost/python/pointee.hpp +++ b/pxr/external/boost/python/pointee.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_POINTEE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_POINTEE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" @@ -43,4 +49,5 @@ struct pointee }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_POINTEE_HPP diff --git a/pxr/external/boost/python/proxy.hpp b/pxr/external/boost/python/proxy.hpp index 0dc0a0c0b1..582c25e276 100644 --- a/pxr/external/boost/python/proxy.hpp +++ b/pxr/external/boost/python/proxy.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_PROXY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_PROXY_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object_operators.hpp" @@ -99,4 +105,5 @@ inline void proxy::del() const }}} // namespace boost::python::api +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_PROXY_HPP diff --git a/pxr/external/boost/python/ptr.hpp b/pxr/external/boost/python/ptr.hpp index 1a2796bc3d..47c755a3c1 100644 --- a/pxr/external/boost/python/ptr.hpp +++ b/pxr/external/boost/python/ptr.hpp @@ -1,6 +1,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_PTR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_PTR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" // // Copyright 2024 Pixar @@ -67,4 +73,5 @@ class unwrap_pointer > }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/pure_virtual.hpp b/pxr/external/boost/python/pure_virtual.hpp index 4006ebce1a..739dd97665 100644 --- a/pxr/external/boost/python/pure_virtual.hpp +++ b/pxr/external/boost/python/pure_virtual.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_PURE_VIRTUAL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_PURE_VIRTUAL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/def_visitor.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" # include @@ -126,4 +132,5 @@ pure_virtual(PointerToMemberFunction pmf) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_PURE_VIRTUAL_HPP diff --git a/pxr/external/boost/python/raw_function.hpp b/pxr/external/boost/python/raw_function.hpp index 1b24c629af..336c2d8bef 100644 --- a/pxr/external/boost/python/raw_function.hpp +++ b/pxr/external/boost/python/raw_function.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_RAW_FUNCTION_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RAW_FUNCTION_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/tuple.hpp" @@ -63,4 +69,5 @@ object raw_function(F f, std::size_t min_args = 0) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RAW_FUNCTION_HPP diff --git a/pxr/external/boost/python/refcount.hpp b/pxr/external/boost/python/refcount.hpp index 70352bcbb1..c630f1dc60 100644 --- a/pxr/external/boost/python/refcount.hpp +++ b/pxr/external/boost/python/refcount.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_REFCOUNT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_REFCOUNT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/cast.hpp" @@ -45,4 +51,5 @@ inline void xdecref(T* p) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REFCOUNT_HPP diff --git a/pxr/external/boost/python/reference_existing_object.hpp b/pxr/external/boost/python/reference_existing_object.hpp index 32b0e94599..bc7519fbd8 100644 --- a/pxr/external/boost/python/reference_existing_object.hpp +++ b/pxr/external/boost/python/reference_existing_object.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_REFERENCE_EXISTING_OBJECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_REFERENCE_EXISTING_OBJECT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include @@ -48,4 +54,5 @@ struct reference_existing_object }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REFERENCE_EXISTING_OBJECT_HPP diff --git a/pxr/external/boost/python/register_ptr_to_python.hpp b/pxr/external/boost/python/register_ptr_to_python.hpp index dc14caf7da..cf32167140 100644 --- a/pxr/external/boost/python/register_ptr_to_python.hpp +++ b/pxr/external/boost/python/register_ptr_to_python.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_REGISTER_PTR_TO_PYTHON_HPP #define PXR_EXTERNAL_BOOST_PYTHON_REGISTER_PTR_TO_PYTHON_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/pointee.hpp" #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/object/class_wrapper.hpp" @@ -31,6 +37,7 @@ void register_ptr_to_python() }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REGISTER_PTR_TO_PYTHON_HPP diff --git a/pxr/external/boost/python/return_arg.hpp b/pxr/external/boost/python/return_arg.hpp index a7a5fc0c63..883393a57d 100644 --- a/pxr/external/boost/python/return_arg.hpp +++ b/pxr/external/boost/python/return_arg.hpp @@ -9,6 +9,12 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef PXR_EXTERNAL_BOOST_PYTHON_RETURN_ARG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_ARG_HPP + +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else # include "pxr/external/boost/python/default_call_policies.hpp" # include "pxr/external/boost/python/detail/none.hpp" # include "pxr/external/boost/python/detail/value_arg.hpp" @@ -111,4 +117,5 @@ struct return_self }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_ARG_HPP diff --git a/pxr/external/boost/python/return_by_value.hpp b/pxr/external/boost/python/return_by_value.hpp index 1d90911d5b..00ad8221be 100644 --- a/pxr/external/boost/python/return_by_value.hpp +++ b/pxr/external/boost/python/return_by_value.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_RETURN_BY_VALUE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_BY_VALUE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/to_python_value.hpp" @@ -32,4 +38,5 @@ struct return_by_value }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_BY_VALUE_HPP diff --git a/pxr/external/boost/python/return_internal_reference.hpp b/pxr/external/boost/python/return_internal_reference.hpp index 05ea01b281..80363345d9 100644 --- a/pxr/external/boost/python/return_internal_reference.hpp +++ b/pxr/external/boost/python/return_internal_reference.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_RETURN_INTERNAL_REFERENCE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_INTERNAL_REFERENCE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -45,4 +51,5 @@ struct return_internal_reference }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_INTERNAL_REFERENCE_HPP diff --git a/pxr/external/boost/python/return_opaque_pointer.hpp b/pxr/external/boost/python/return_opaque_pointer.hpp index 804923f0ff..9d62a840c6 100644 --- a/pxr/external/boost/python/return_opaque_pointer.hpp +++ b/pxr/external/boost/python/return_opaque_pointer.hpp @@ -13,6 +13,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_RETURN_OPAQUE_POINTER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_OPAQUE_POINTER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/opaque_pointer_converter.hpp" # include "pxr/external/boost/python/detail/force_instantiate.hpp" @@ -49,4 +55,5 @@ struct return_opaque_pointer }; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_OPAQUE_POINTER_HPP diff --git a/pxr/external/boost/python/return_value_policy.hpp b/pxr/external/boost/python/return_value_policy.hpp index 2cc2f181fd..530c139003 100644 --- a/pxr/external/boost/python/return_value_policy.hpp +++ b/pxr/external/boost/python/return_value_policy.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_RETURN_VALUE_POLICY_HPP # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_VALUE_POLICY_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -23,4 +29,5 @@ struct return_value_policy : BasePolicy_ }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_VALUE_POLICY_HPP diff --git a/pxr/external/boost/python/scope.hpp b/pxr/external/boost/python/scope.hpp index 5dccc0d52a..c2c0af1195 100644 --- a/pxr/external/boost/python/scope.hpp +++ b/pxr/external/boost/python/scope.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SCOPE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SCOPE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/refcount.hpp" @@ -79,4 +85,5 @@ inline scope::scope(scope const& new_scope) }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SCOPE_HPP diff --git a/pxr/external/boost/python/self.hpp b/pxr/external/boost/python/self.hpp index bf50426a0f..4dad25e995 100644 --- a/pxr/external/boost/python/self.hpp +++ b/pxr/external/boost/python/self.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SELF_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SELF_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -35,4 +41,5 @@ using self_ns::self; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SELF_HPP diff --git a/pxr/external/boost/python/signature.hpp b/pxr/external/boost/python/signature.hpp index 54ccb06416..b40d36e8ac 100644 --- a/pxr/external/boost/python/signature.hpp +++ b/pxr/external/boost/python/signature.hpp @@ -15,6 +15,12 @@ # ifndef PXR_EXTERNAL_BOOST_PYTHON_SIGNATURE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SIGNATURE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include @@ -177,6 +183,7 @@ struct most_derived }}} // namespace boost::python::detail +#endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_SIGNATURE_HPP // For gcc 4.4 compatability, we must include the diff --git a/pxr/external/boost/python/slice.hpp b/pxr/external/boost/python/slice.hpp index 495880fe6c..287d9d30dc 100644 --- a/pxr/external/boost/python/slice.hpp +++ b/pxr/external/boost/python/slice.hpp @@ -1,6 +1,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SLICE_HPP #define PXR_EXTERNAL_BOOST_PYTHON_SLICE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + // // Copyright 2024 Pixar // Licensed under the terms set forth in the LICENSE.txt file available at @@ -278,4 +284,5 @@ struct object_manager_traits } } // !namespace ::boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // !defined PXR_EXTERNAL_BOOST_PYTHON_SLICE_HPP diff --git a/pxr/external/boost/python/slice_nil.hpp b/pxr/external/boost/python/slice_nil.hpp index 603153bda8..726dc5ef63 100644 --- a/pxr/external/boost/python/slice_nil.hpp +++ b/pxr/external/boost/python/slice_nil.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SLICE_NIL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SLICE_NIL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_core.hpp" @@ -46,4 +52,5 @@ using api::_; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SLICE_NIL_HPP diff --git a/pxr/external/boost/python/ssize_t.hpp b/pxr/external/boost/python/ssize_t.hpp index 18d7a59add..3190801062 100644 --- a/pxr/external/boost/python/ssize_t.hpp +++ b/pxr/external/boost/python/ssize_t.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SSIZE_T_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SSIZE_T_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -31,4 +37,5 @@ ssize_t const ssize_t_min = INT_MIN; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SSIZE_T_HPP diff --git a/pxr/external/boost/python/stl_iterator.hpp b/pxr/external/boost/python/stl_iterator.hpp index 3d43e853e7..489614582b 100644 --- a/pxr/external/boost/python/stl_iterator.hpp +++ b/pxr/external/boost/python/stl_iterator.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_STL_ITERATOR_HPP # define PXR_EXTERNAL_BOOST_PYTHON_STL_ITERATOR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object/stl_iterator_core.hpp" @@ -63,4 +69,5 @@ struct stl_input_iterator }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_STL_ITERATOR_HPP diff --git a/pxr/external/boost/python/str.hpp b/pxr/external/boost/python/str.hpp index 079c1c3a91..0a2c3ee4e9 100644 --- a/pxr/external/boost/python/str.hpp +++ b/pxr/external/boost/python/str.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_STR_HPP #define PXR_EXTERNAL_BOOST_PYTHON_STR_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" #include "pxr/external/boost/python/object.hpp" @@ -424,4 +430,5 @@ namespace converter }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_STR_HPP diff --git a/pxr/external/boost/python/suite/indexing/container_utils.hpp b/pxr/external/boost/python/suite/indexing/container_utils.hpp index e6c19def36..e7bf233ac8 100644 --- a/pxr/external/boost/python/suite/indexing/container_utils.hpp +++ b/pxr/external/boost/python/suite/indexing/container_utils.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_CONTAINER_UTILS_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_CONTAINER_UTILS_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include # include # include "pxr/external/boost/python/object.hpp" @@ -59,4 +65,5 @@ namespace boost { namespace python { namespace container_utils { }}} // namespace boost::python::container_utils +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp index b375795e1b..648c3bd12b 100644 --- a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp +++ b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_DETAIL_INDEXING_SUITE_DETAIL_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_DETAIL_INDEXING_SUITE_DETAIL_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/extract.hpp" # include # include @@ -761,4 +767,5 @@ namespace boost { namespace python { namespace detail { } // namespace boost +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_DETAIL_INDEXING_SUITE_DETAIL_HPP diff --git a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp index 8969e5f366..522a4f706d 100644 --- a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_INDEXING_SUITE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_INDEXING_SUITE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/class.hpp" # include "pxr/external/boost/python/def_visitor.hpp" # include "pxr/external/boost/python/register_ptr_to_python.hpp" @@ -297,4 +303,5 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp index 779db07d04..f1d82ad804 100644 --- a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_MAP_INDEXING_SUITE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_MAP_INDEXING_SUITE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/suite/indexing/indexing_suite.hpp" # include "pxr/external/boost/python/iterator.hpp" # include "pxr/external/boost/python/call_method.hpp" @@ -183,4 +189,5 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_MAP_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp index 17e7e833d4..103f7a5998 100644 --- a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp @@ -11,6 +11,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_VECTOR_INDEXING_SUITE_HPP # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_VECTOR_INDEXING_SUITE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/suite/indexing/indexing_suite.hpp" # include "pxr/external/boost/python/suite/indexing/container_utils.hpp" # include "pxr/external/boost/python/iterator.hpp" @@ -244,4 +250,5 @@ namespace boost { namespace python { }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_VECTOR_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/tag.hpp b/pxr/external/boost/python/tag.hpp index 200095f040..8d3781130a 100644 --- a/pxr/external/boost/python/tag.hpp +++ b/pxr/external/boost/python/tag.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TAG_HPP # define PXR_EXTERNAL_BOOST_PYTHON_TAG_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" namespace boost { namespace python { @@ -20,4 +26,5 @@ enum tag_t { tag }; }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TAG_HPP diff --git a/pxr/external/boost/python/to_python_converter.hpp b/pxr/external/boost/python/to_python_converter.hpp index 7dbed6a254..1ce877ef16 100644 --- a/pxr/external/boost/python/to_python_converter.hpp +++ b/pxr/external/boost/python/to_python_converter.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_CONVERTER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_CONVERTER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/registry.hpp" @@ -95,5 +101,6 @@ to_python_converter::to_python_converter() }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_CONVERTER_HPP diff --git a/pxr/external/boost/python/to_python_indirect.hpp b/pxr/external/boost/python/to_python_indirect.hpp index 4def299ecc..5044228d9d 100644 --- a/pxr/external/boost/python/to_python_indirect.hpp +++ b/pxr/external/boost/python/to_python_indirect.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_INDIRECT_HPP # define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_INDIRECT_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object/pointer_holder.hpp" @@ -105,4 +111,5 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_INDIRECT_HPP diff --git a/pxr/external/boost/python/to_python_value.hpp b/pxr/external/boost/python/to_python_value.hpp index 69be90de6d..f1a70c422d 100644 --- a/pxr/external/boost/python/to_python_value.hpp +++ b/pxr/external/boost/python/to_python_value.hpp @@ -12,6 +12,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_VALUE_HPP #define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_VALUE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + #include "pxr/external/boost/python/detail/prefix.hpp" #include "pxr/external/boost/python/refcount.hpp" @@ -179,4 +185,5 @@ namespace detail }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/tuple.hpp b/pxr/external/boost/python/tuple.hpp index 4488acea59..7a0d5d2777 100644 --- a/pxr/external/boost/python/tuple.hpp +++ b/pxr/external/boost/python/tuple.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TUPLE_HPP #define PXR_EXTERNAL_BOOST_PYTHON_TUPLE_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" #include "pxr/external/boost/python/object.hpp" @@ -76,5 +82,6 @@ inline tuple make_tuple() { return tuple(); } }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/type_id.hpp b/pxr/external/boost/python/type_id.hpp index 421c5af227..7848158d1c 100644 --- a/pxr/external/boost/python/type_id.hpp +++ b/pxr/external/boost/python/type_id.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_TYPE_ID_HPP # define PXR_EXTERNAL_BOOST_PYTHON_TYPE_ID_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/msvc_typeinfo.hpp" @@ -186,4 +192,5 @@ inline type_info type_id() }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TYPE_ID_HPP diff --git a/pxr/external/boost/python/with_custodian_and_ward.hpp b/pxr/external/boost/python/with_custodian_and_ward.hpp index cdc62ae442..a52908b7ea 100644 --- a/pxr/external/boost/python/with_custodian_and_ward.hpp +++ b/pxr/external/boost/python/with_custodian_and_ward.hpp @@ -10,6 +10,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_WITH_CUSTODIAN_AND_WARD_HPP # define PXR_EXTERNAL_BOOST_PYTHON_WITH_CUSTODIAN_AND_WARD_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" @@ -123,4 +129,5 @@ struct with_custodian_and_ward_postcall : BasePolicy_ }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_WITH_CUSTODIAN_AND_WARD_HPP diff --git a/pxr/external/boost/python/wrapper.hpp b/pxr/external/boost/python/wrapper.hpp index 0642767195..8ee2172cb0 100644 --- a/pxr/external/boost/python/wrapper.hpp +++ b/pxr/external/boost/python/wrapper.hpp @@ -9,6 +9,12 @@ #ifndef PXR_EXTERNAL_BOOST_PYTHON_WRAPPER_HPP # define PXR_EXTERNAL_BOOST_PYTHON_WRAPPER_HPP +#include "pxr/pxr.h" + +#ifndef PXR_USE_INTERNAL_BOOST_PYTHON +#include +#else + # include "pxr/external/boost/python/detail/wrapper_base.hpp" # include "pxr/external/boost/python/override.hpp" # include "pxr/external/boost/python/converter/registered.hpp" @@ -37,4 +43,5 @@ class wrapper : public detail::wrapper_base }} // namespace boost::python +#endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_WRAPPER_HPP From 3f01abc87fe1240fccd674d67096fb60d01608e6 Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Mon, 26 Aug 2024 15:20:17 -0700 Subject: [PATCH 104/202] Cleanup left over flex+bison stuff (Internal change: 2338544) (Internal change: 2338565) --- cmake/defaults/Packages.cmake | 8 - cmake/defaults/msvcdefaults.cmake | 4 - pxr/usd/sdf/sdfGenAsciiParsers.py | 312 ------------------ pxr/usd/sdf/textParserContext.h | 3 - .../plugin/hdPrman/CMakeLists.txt | 5 + .../plugin/hdPrman/CMakeLists.txt | 5 + 6 files changed, 10 insertions(+), 327 deletions(-) delete mode 100644 pxr/usd/sdf/sdfGenAsciiParsers.py diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake index eab4db0348..57d51de345 100644 --- a/cmake/defaults/Packages.cmake +++ b/cmake/defaults/Packages.cmake @@ -180,14 +180,6 @@ if (PXR_BUILD_DOCUMENTATION) endif() endif() -if (PXR_VALIDATE_GENERATED_CODE) - find_package(BISON 2.4.1 EXACT) - # Flex 2.5.39+ is required, generated API is generated incorrectly in - # 2.5.35, at least. scan_bytes generates with (..., int len, ...) instead of - # the correct (..., yy_size_t len, ...). Lower at your own peril. - find_package(FLEX 2.5.39 EXACT) -endif() - # Imaging Components Package Requirements # ---------------------------------------------- diff --git a/cmake/defaults/msvcdefaults.cmake b/cmake/defaults/msvcdefaults.cmake index 78bde7a77e..13d77d0ae7 100644 --- a/cmake/defaults/msvcdefaults.cmake +++ b/cmake/defaults/msvcdefaults.cmake @@ -87,10 +87,6 @@ _add_define("_SCL_SECURE_NO_WARNINGS") # will conflict with std::min() and std::max(). _add_define("NOMINMAX") -# Needed to prevent YY files trying to include unistd.h -# (which doesn't exist on Windows) -_add_define("YY_NO_UNISTD_H") - # Forces all libraries that have separate source to be linked as # DLL's rather than static libraries on Microsoft Windows, unless # explicitly told otherwise. diff --git a/pxr/usd/sdf/sdfGenAsciiParsers.py b/pxr/usd/sdf/sdfGenAsciiParsers.py deleted file mode 100644 index d41dff04b8..0000000000 --- a/pxr/usd/sdf/sdfGenAsciiParsers.py +++ /dev/null @@ -1,312 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2016 Pixar -# -# Licensed under the terms set forth in the LICENSE.txt file available at -# https://openusd.org/license. -# -# A script for generating the ascii parser files for Sdf. -# This takes the flex and bison sources in Sdf and generates C++ -# source files using flex and bison. - -from __future__ import print_function - -from tempfile import mkdtemp -from argparse import ArgumentParser -from sys import exit, stdout -from os import listdir, mkdir, getcwd, chdir, rename, access, W_OK -from os.path import abspath, basename, join, splitext, isfile -from subprocess import call -from shutil import rmtree, copyfile -from difflib import unified_diff - -# ----------------------------------------------------------------------------- -# Validation functions. -# This section contains code that will gather/report diffs between the generated -# code and the installed files as well as installing generating files which -# pass validation. -# ----------------------------------------------------------------------------- -def _compareFiles(installedFiles, generatedFiles, configuration): - failOnDiff = configuration[VALIDATE] - - if len(installedFiles) != len(generatedFiles): - installedNames = set(map(basename, installedFiles)) - generatedNames = set(map(basename, generatedFiles)) - - if (generatedNames - installedNames): - exit('*** Unknown files generated, please add them to the list of ' - 'base files names in sdfGenAsciiParsers.py') - - exit('*** Missing files:\n' + '\n'.join(installedNames - generatedNames)) - - diffs = {} - for i in range(0, len(installedFiles)): - with open(installedFiles[i], 'r') as installedFile,\ - open(generatedFiles[i], 'r') as generatedFile: - - installedContent = installedFile.read() - generatedContent = generatedFile.read() - - if installedContent != generatedContent: - diff = '\n'.join(unified_diff(installedContent.split('\n'), - generatedContent.split('\n'), - 'Source ' + installedFile.name, - 'Generated ' + generatedFile.name)) - diffs[basename(installedFile.name)] = diff - - if diffs and failOnDiff: - exit('*** Differing Generated Files:\n' + - '\n'.join(diffs.values())) - - return diffs - -def _copyGeneratedFiles(installedFiles, generatedFiles, diffs): - for generatedFile, installedFile in zip(generatedFiles, installedFiles): - baseName = basename(installedFile) - if baseName in diffs: - print('Changed: ' + baseName) - print(diffs[baseName]) - if not access(installedFile, W_OK): - print('Cannot author ' + installedFile + ', (no write access).') - else: - copyfile(generatedFile, installedFile) - else: - print('Unchanged: ' + baseName) - -# ----------------------------------------------------------------------------- -# Code generation functions. -# This section contains the code that will actually generate the C++ source -# and headers from the yy/ll source files as well as the code which will -# curate the generated code. -# ----------------------------------------------------------------------------- -def _runBisonAndFlexCommands(configuration): - # build up collections of all relevant files, these include - # yy/ll source files, as well as the generated C++ header - # and source files. - srcDir = configuration[SRC_DIR] - destDir = configuration[DEST_DIR] - bases = configuration[BASES] - - bisonFiles = [join(srcDir, base + '.yy') for base in bases] - flexFiles = [join(srcDir, base + '.ll') for base in bases] - bisonGenSources = [join(destDir, base + '.tab.cpp') for base in bases] - bisonGenHeaders = [join(destDir, base + '.tab.hpp') for base in bases] - flexGenSources = [join(destDir, base + '.lex.cpp') for base in bases] - - sourceFiles = bisonFiles + flexFiles - generatedFiles = bisonGenHeaders + bisonGenSources + flexGenSources - - # generate all components of a flex/bison command, these - # include the desired executables, flag settings - bisonFlags = lambda base: ['-d', '-p', base + 'Yy', '-o'] - flexFlags = lambda base: ['-P'+ base + "Yy", '-Cfe', '-o'] - - bisonExecutable = configuration[BISON_EXE] - flexExecutable = configuration[FLEX_EXE] - - bisonCommand = lambda index: ([bisonExecutable] - + bisonFlags(base) - + [bisonGenSources[index]] - + [bisonFiles[index]]) - - flexCommand = lambda index: ([flexExecutable] - + flexFlags(base) - + [flexGenSources[index]] - + [flexFiles[index]]) - - for index, base in enumerate(bases): - print('Running bison on %s' % (base + '.yy')) - print(' ', ' '.join(bisonCommand(index))) - call(bisonCommand(index)) - - print('Running flex on %s' % (base + '.ll')) - print(' ', ' '.join(flexCommand(index))) - call(flexCommand(index)) - - # prepend license header to all generated files. - licenseText = '\n'.join([ - "//" - , "// Copyright 2016 Pixar" - , "//" - , "// Licensed under the terms set forth in the LICENSE.txt file available at" - , "// https://openusd.org/license." - , "//\n"]) - - for generatedFile in generatedFiles: - with open(generatedFile, 'r') as f: - lines = f.read() - with open(generatedFile, 'w') as f: - f.write(licenseText) - f.write(lines) - - return sourceFiles, generatedFiles - -def _canonicalizeFiles(sourceFiles, generatedFiles): - PXR_PREFIX_PATH = 'pxr/usd/sdf' - - # by default, bison will output hpp header files, we don't want this - # as it goes against our convention of .h for headers. More recent - # versions of bison support this option directly. - # - # We also need to update the paths in the generated #line directives - # so we can easily diff the generated and installed files. - - # 'renamed' represents the renamed files on disk, whereas the identifiers - # are altered paths that will be used in #line directives in the source - renamed = list(generatedFiles) - identifiers = list(generatedFiles) - - # rename hpp files to h, also update our index of renamed files - # and identifiers(these will be used when scrubbing the files' contents) - for index, fileName in enumerate(generatedFiles): - if 'hpp' in fileName: - newName = fileName.replace('.hpp', '.h') - rename(fileName, newName) - renamed[index] = newName - identifiers[index] = newName - - # identifiers includes the sourceFiles(yy,ll files) because - # they are also referred to in line directives - identifiers += sourceFiles - for index, fileName in enumerate(list(renamed + sourceFiles)): - if '/' in fileName: - identifiers[index] = join(PXR_PREFIX_PATH, basename(fileName)) - - # create a list of pairs, representing the things to replace in our - # generated files - replacements = [] - for index, fileName in enumerate(list(generatedFiles+sourceFiles)): - oldFileName = fileName - newFileName = identifiers[index] - replacements.append((oldFileName, newFileName)) - - for renamedFile in renamed: - print('Canonicalizing ' + basename(renamedFile)) - - with open(renamedFile, 'r+') as inputFile: - data = inputFile.read() - - # find and replace all generated file names - print('... Fixing line directives') - for oldFileName, newFileName in replacements: - data = data.replace(oldFileName, newFileName) - - # flex versions older than 2.6 emit the register keyword - # which is no longer supported as of C++17. To support - # these versions, we manually strip 'register' from each - # .lex.cpp file. This is hacky, since it could affect - # hand-written parser code that uses the word "register". - # In practice, none of our parser code does this. - # - # XXX: Remove this when we stop supporting older flex versions - if renamedFile.endswith('.lex.cpp'): - print('... Removing register keyword') - data = data.replace("register ", "") - - # we seek to 0 and truncate as we intend - # to overwrite the existing data in the file - inputFile.seek(0) - inputFile.write(data) - inputFile.truncate() - - return renamed - -# ----------------------------------------------------------------------------- -# Configuration info. -# This section of code discerns all the necessary info the run the parser -# and lexical analyzer generators over the source files. -# ----------------------------------------------------------------------------- -def _parseArguments(): - parser = ArgumentParser(description='Generate Ascii File Parsers for Sdf') - parser.add_argument('--srcDir', required=False, default=getcwd(), - help='The source directory for sdf.') - parser.add_argument('--bison', required=True, - help='The location of the bison executable to be used.') - parser.add_argument('--flex', required=True, - help='The location of the flex executable to be used.') - parser.add_argument('--validate', action='store_true', - help='Verify that the source files are unchanged.') - parser.add_argument('--bases', nargs='+', - help='Base file identifiers used for generation,' - 'for example, textFileFormat') - return parser.parse_args() - -# Configuration constants -DEST_DIR = 0 -SRC_DIR = 1 -VALIDATE = 2 -BASES = 3 -BISON_EXE = 4 -FLEX_EXE = 5 - -def _getConfiguration(): - arguments = _parseArguments() - - config = { VALIDATE : arguments.validate, - SRC_DIR : arguments.srcDir, - DEST_DIR : mkdtemp(), - BISON_EXE : arguments.bison, - FLEX_EXE : arguments.flex, - BASES : arguments.bases } - - # Ensure all optional arguments get properly populated - if not arguments.bases: - allFiles = listdir(arguments.srcDir) - validExts = ['.yy', '.ll'] - relevantFiles = [f for f in allFiles if splitext(f)[1] in validExts] - bases = set([splitext(f)[0] for f in relevantFiles]) - - if not bases: - exit('*** Unable to find source files for parser. Ensure that they ' - 'are in the source directory(--srcDir). If unspecified, the ' - 'source directory is assumed to be the current directory.') - - config[BASES] = bases - - _validateSourceDirectory(config) - - return config - -def _validateSourceDirectory(configuration): - bases = configuration[BASES] - srcDir = configuration[SRC_DIR] - - allFiles = ([join(srcDir, base + '.yy') for base in bases] - + [join(srcDir, base + '.ll') for base in bases] - + [join(srcDir, base + '.tab.cpp') for base in bases] - + [join(srcDir, base + '.tab.h') for base in bases] - + [join(srcDir, base + '.lex.cpp') for base in bases]) - - for f in allFiles: - if not isfile(f): - exit('*** Invalid source directory. This directory must ' - 'contain all necessary flex/bison sources; missing: %s' % f) - -# ----------------------------------------------------------------------------- - -def _printSection(sectionInfo): - print('+-------------------------------------------------+') - print(sectionInfo) - print('+-------------------------------------------------+') - -if __name__ == '__main__': - configuration = _getConfiguration() - - _printSection('Running flex and bison on sources') - sourceFiles, generatedFiles = _runBisonAndFlexCommands(configuration) - - _printSection('Canonicalizing generated files') - generatedFiles = _canonicalizeFiles(sourceFiles, generatedFiles) - - diffSectionMsg = 'Checking for diffs' - if configuration[VALIDATE]: - diffSectionMsg = diffSectionMsg + '(validation on)' - - _printSection(diffSectionMsg) - installedFiles = [join(configuration[SRC_DIR], basename(f)) - for f in generatedFiles] - - diffs = _compareFiles(installedFiles, generatedFiles, configuration) - _copyGeneratedFiles(installedFiles, generatedFiles, diffs) - # If validation passed, clean up the generated files - rmtree(configuration[DEST_DIR]) diff --git a/pxr/usd/sdf/textParserContext.h b/pxr/usd/sdf/textParserContext.h index 9cfea017b6..a5a0bd7696 100644 --- a/pxr/usd/sdf/textParserContext.h +++ b/pxr/usd/sdf/textParserContext.h @@ -32,9 +32,6 @@ #include #include -// Lexical scanner type. -typedef void *yyscan_t; - PXR_NAMESPACE_OPEN_SCOPE diff --git a/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt b/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt index 6d7b18b1ab..65d34f416e 100644 --- a/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt +++ b/third_party/renderman-25/plugin/hdPrman/CMakeLists.txt @@ -18,6 +18,11 @@ set(PXR_PACKAGE hdPrman) # This is only temporary and will be removed shortly add_definitions(-DPRMANBUILDINGAPI) +# Needed to prevent YY files trying to include unistd.h +if (WIN32) + add_compile_definitions("YY_NO_UNISTD_H") +endif() + # TODO The pxr cmake macros don't provide a good way to link prman with link_directories # on Linux/OSX without resorting to absolute rpath. For now, simply avoid linking # libprman on Linux/OSX. diff --git a/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt b/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt index 6d7b18b1ab..65d34f416e 100644 --- a/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt +++ b/third_party/renderman-26/plugin/hdPrman/CMakeLists.txt @@ -18,6 +18,11 @@ set(PXR_PACKAGE hdPrman) # This is only temporary and will be removed shortly add_definitions(-DPRMANBUILDINGAPI) +# Needed to prevent YY files trying to include unistd.h +if (WIN32) + add_compile_definitions("YY_NO_UNISTD_H") +endif() + # TODO The pxr cmake macros don't provide a good way to link prman with link_directories # on Linux/OSX without resorting to absolute rpath. For now, simply avoid linking # libprman on Linux/OSX. From 5b265db4401a6f3c9a26de7e82cf73d8a049f6f6 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Mon, 26 Aug 2024 15:20:37 -0700 Subject: [PATCH 105/202] Add github SECURITY.md security policy to opensrc repo (Internal change: 2338550) --- README.md | 2 ++ SECURITY.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 SECURITY.md diff --git a/README.md b/README.md index 19ad9ce782..1458206dde 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ visit our [forum](https://groups.google.com/forum/#!forum/usd-interest). If you are experiencing undocumented problems with the software, please [file a bug](https://github.com/PixarAnimationStudios/OpenUSD/issues/new). +If you need to report a security issue with the software, please review the +[Security Policy](SECURITY.md). Supported Platforms ------------------- diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..6e1b0d8c2f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +We appreciate your efforts to responsibly disclose your findings and will make +every effort to acknowledge your contributions. + +## Reporting a Vulnerability + +Please use the GitHub Security Advisory +["Report a Vulnerability" tab](https://github.com/PixarAnimationStudios/OpenUSD/security/advisories/new) +to report a security issue. Please do not report security vulnerabilities +through public issues, discussions, or change requests. + +The team will send a response indicating the next steps in handling your report. +After the initial reply to your report, the security team will keep you informed +of the progress towards a fix and may ask for additional information or guidance. + +Report security bugs in third-party plugins/applications to the team maintaining +the application. From db4cdfe6f7f10a50b03d647d0ecdf1ceba0bbeff Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 26 Aug 2024 18:34:00 -0400 Subject: [PATCH 106/202] fix: don't use references on temp strings --- pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index 2b3e66762e..e51f00ec1e 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -55,12 +55,12 @@ TestPackageEncapsulationValidator() // Verify both the layer & asset errors are present TF_AXIOM(errors.size() == 2); - const std::string& absoluteUsdzPath = TfAbsPath( + const std::string absoluteUsdzPath = TfAbsPath( stage->GetRootLayer()->GetIdentifier()); - const std::string& usdzRootDirectory = TfGetPathName(absoluteUsdzPath); - const std::string& errorLayer = TfStringCatPaths( + const std::string usdzRootDirectory = TfGetPathName(absoluteUsdzPath); + const std::string errorLayer = TfStringCatPaths( usdzRootDirectory, "excludedDirectory/layer.usda"); - const std::string& errorAsset = TfStringCatPaths( + const std::string errorAsset = TfStringCatPaths( usdzRootDirectory, "excludedDirectory/image.jpg"); std::vector expectedErrorMessages = { From 8479bed1c78ac080c58d4d1ad318a087a5246174 Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 27 Aug 2024 14:52:05 -0700 Subject: [PATCH 107/202] python: Rename boost::python namespace and BOOST_PYTHON_* macros The "boost::python" namespace is now "pxr_boost::python" and has been moved into the OpenUSD "pxr" namespace. BOOST_PYTHON_* macros have also been renamed PXR_BOOST_PYTHON_*. This change introduces a new header, common.hpp, which is included in every other header file in the library. This header defines the new namespaces and also sets up compatibility with the original boost::python library when PXR_USE_INTERNAL_BOOST_PYTHON is turned off. This allows us to incrementally update downstream code to use the new namespaces and macros. (Internal change: 2338656) --- pxr/external/boost/python.hpp | 1 + pxr/external/boost/python/CMakeLists.txt | 11 +- pxr/external/boost/python/arg_from_python.hpp | 5 +- pxr/external/boost/python/args.hpp | 13 +- pxr/external/boost/python/args_fwd.hpp | 5 +- pxr/external/boost/python/back_reference.hpp | 5 +- .../boost/python/base_type_traits.hpp | 5 +- pxr/external/boost/python/bases.hpp | 17 +-- pxr/external/boost/python/borrowed.hpp | 5 +- pxr/external/boost/python/call.hpp | 15 +-- pxr/external/boost/python/call_method.hpp | 15 +-- pxr/external/boost/python/cast.hpp | 5 +- pxr/external/boost/python/class.hpp | 55 ++++---- pxr/external/boost/python/class_fwd.hpp | 11 +- pxr/external/boost/python/common.hpp | 62 +++++++++ .../python/converter/arg_from_python.hpp | 15 +-- .../boost/python/converter/arg_to_python.hpp | 11 +- .../python/converter/arg_to_python_base.hpp | 7 +- .../converter/as_to_python_function.hpp | 7 +- .../python/converter/builtin_converters.hpp | 103 +++++++-------- .../python/converter/constructor_function.hpp | 5 +- .../converter/context_result_converter.hpp | 5 +- .../python/converter/convertible_function.hpp | 5 +- .../boost/python/converter/from_python.hpp | 25 ++-- .../boost/python/converter/implicit.hpp | 5 +- .../converter/obj_mgr_arg_from_python.hpp | 5 +- .../boost/python/converter/object_manager.hpp | 9 +- .../python/converter/pointer_type_id.hpp | 7 +- .../python/converter/pyobject_traits.hpp | 21 ++-- .../boost/python/converter/pyobject_type.hpp | 9 +- .../python/converter/pytype_function.hpp | 17 +-- .../converter/pytype_object_mgr_traits.hpp | 5 +- .../boost/python/converter/registered.hpp | 15 ++- .../python/converter/registered_pointee.hpp | 11 +- .../boost/python/converter/registrations.hpp | 7 +- .../boost/python/converter/registry.hpp | 19 +-- .../python/converter/return_from_python.hpp | 5 +- .../converter/rvalue_from_python_data.hpp | 17 +-- .../python/converter/shared_ptr_deleter.hpp | 7 +- .../converter/shared_ptr_from_python.hpp | 9 +- .../python/converter/shared_ptr_to_python.hpp | 9 +- .../converter/to_python_function_type.hpp | 5 +- .../boost/python/copy_const_reference.hpp | 5 +- .../boost/python/copy_non_const_reference.hpp | 5 +- pxr/external/boost/python/data_members.hpp | 9 +- pxr/external/boost/python/def.hpp | 9 +- pxr/external/boost/python/def_visitor.hpp | 5 +- .../boost/python/default_call_policies.hpp | 11 +- .../boost/python/detail/aix_init_module.hpp | 5 +- .../boost/python/detail/api_placeholder.hpp | 3 +- .../boost/python/detail/borrowed_ptr.hpp | 5 +- pxr/external/boost/python/detail/caller.hpp | 23 ++-- pxr/external/boost/python/detail/config.hpp | 77 ++++++------ .../boost/python/detail/construct.hpp | 5 +- .../boost/python/detail/convertible.hpp | 5 +- .../python/detail/copy_ctor_mutates_rhs.hpp | 5 +- .../boost/python/detail/cv_category.hpp | 5 +- pxr/external/boost/python/detail/dealloc.hpp | 5 +- .../boost/python/detail/decorated_type_id.hpp | 9 +- .../boost/python/detail/decref_guard.hpp | 5 +- .../boost/python/detail/def_helper.hpp | 5 +- .../boost/python/detail/def_helper_fwd.hpp | 5 +- .../boost/python/detail/defaults_def.hpp | 9 +- .../boost/python/detail/defaults_gen.hpp | 97 +++++++------- .../boost/python/detail/dependent.hpp | 5 +- pxr/external/boost/python/detail/destroy.hpp | 5 +- .../boost/python/detail/enable_if.hpp | 5 +- .../boost/python/detail/exception_handler.hpp | 9 +- .../boost/python/detail/force_instantiate.hpp | 5 +- pxr/external/boost/python/detail/if_else.hpp | 5 +- .../boost/python/detail/indirect_traits.hpp | 5 +- pxr/external/boost/python/detail/invoke.hpp | 7 +- .../boost/python/detail/is_auto_ptr.hpp | 7 +- .../boost/python/detail/is_shared_ptr.hpp | 7 +- .../boost/python/detail/is_wrapper.hpp | 5 +- pxr/external/boost/python/detail/is_xxx.hpp | 3 +- .../python/detail/make_keyword_range_fn.hpp | 7 +- .../boost/python/detail/make_tuple.hpp | 10 +- .../boost/python/detail/map_entry.hpp | 5 +- .../boost/python/detail/mpl_lambda.hpp | 3 +- .../boost/python/detail/msvc_typeinfo.hpp | 5 +- pxr/external/boost/python/detail/none.hpp | 5 +- .../boost/python/detail/not_specified.hpp | 5 +- .../detail/nullary_function_adaptor.hpp | 7 +- .../boost/python/detail/operator_id.hpp | 5 +- .../boost/python/detail/overloads_fwd.hpp | 5 +- pxr/external/boost/python/detail/pointee.hpp | 5 +- pxr/external/boost/python/detail/prefix.hpp | 1 + .../boost/python/detail/preprocessor.hpp | 53 ++++---- .../boost/python/detail/python_type.hpp | 7 +- .../boost/python/detail/raw_pyobject.hpp | 5 +- .../boost/python/detail/referent_storage.hpp | 10 +- pxr/external/boost/python/detail/result.hpp | 17 +-- pxr/external/boost/python/detail/scope.hpp | 7 +- pxr/external/boost/python/detail/sfinae.hpp | 3 +- .../boost/python/detail/signature.hpp | 9 +- .../boost/python/detail/string_literal.hpp | 5 +- pxr/external/boost/python/detail/target.hpp | 17 +-- .../python/detail/translate_exception.hpp | 5 +- .../boost/python/detail/type_list.hpp | 19 +-- .../boost/python/detail/type_list_impl.hpp | 17 +-- .../boost/python/detail/type_traits.hpp | 5 +- .../boost/python/detail/unwind_type.hpp | 5 +- .../boost/python/detail/unwrap_type_id.hpp | 5 +- .../boost/python/detail/unwrap_wrapper.hpp | 5 +- .../boost/python/detail/value_arg.hpp | 5 +- .../python/detail/value_is_shared_ptr.hpp | 5 +- .../boost/python/detail/value_is_xxx.hpp | 9 +- pxr/external/boost/python/detail/void_ptr.hpp | 5 +- .../boost/python/detail/void_return.hpp | 5 +- .../boost/python/detail/wrap_python.hpp | 34 ++--- .../boost/python/detail/wrapper_base.hpp | 7 +- pxr/external/boost/python/dict.hpp | 11 +- .../boost/python/docstring_options.hpp | 7 +- pxr/external/boost/python/enum.hpp | 5 +- pxr/external/boost/python/errors.hpp | 13 +- .../boost/python/exception_translator.hpp | 5 +- pxr/external/boost/python/exec.hpp | 19 +-- pxr/external/boost/python/extract.hpp | 5 +- pxr/external/boost/python/handle.hpp | 5 +- pxr/external/boost/python/handle_fwd.hpp | 5 +- .../boost/python/has_back_reference.hpp | 5 +- pxr/external/boost/python/implicit.hpp | 9 +- pxr/external/boost/python/import.hpp | 5 +- pxr/external/boost/python/init.hpp | 49 ++++---- pxr/external/boost/python/instance_holder.hpp | 9 +- pxr/external/boost/python/iterator.hpp | 5 +- pxr/external/boost/python/list.hpp | 11 +- pxr/external/boost/python/long.hpp | 11 +- .../boost/python/lvalue_from_pytype.hpp | 13 +- .../boost/python/make_constructor.hpp | 3 +- pxr/external/boost/python/make_function.hpp | 3 +- .../boost/python/manage_new_object.hpp | 5 +- pxr/external/boost/python/module.hpp | 3 +- pxr/external/boost/python/module_init.hpp | 21 ++-- pxr/external/boost/python/numpy.hpp | 7 +- pxr/external/boost/python/numpy/config.hpp | 11 +- pxr/external/boost/python/numpy/dtype.hpp | 9 +- pxr/external/boost/python/numpy/internal.hpp | 5 +- .../boost/python/numpy/invoke_matching.hpp | 9 +- pxr/external/boost/python/numpy/matrix.hpp | 11 +- pxr/external/boost/python/numpy/ndarray.hpp | 15 +-- .../python/numpy/numpy_object_mgr_traits.hpp | 1 + pxr/external/boost/python/numpy/scalars.hpp | 9 +- pxr/external/boost/python/numpy/ufunc.hpp | 13 +- pxr/external/boost/python/object.hpp | 5 +- .../boost/python/object/add_to_namespace.hpp | 9 +- pxr/external/boost/python/object/class.hpp | 7 +- .../boost/python/object/class_detail.hpp | 11 +- .../boost/python/object/class_metadata.hpp | 39 +++--- .../boost/python/object/class_wrapper.hpp | 11 +- .../boost/python/object/enum_base.hpp | 7 +- .../boost/python/object/find_instance.hpp | 7 +- pxr/external/boost/python/object/forward.hpp | 13 +- pxr/external/boost/python/object/function.hpp | 7 +- .../python/object/function_doc_signature.hpp | 5 +- .../boost/python/object/function_handle.hpp | 7 +- .../boost/python/object/function_object.hpp | 15 +-- .../boost/python/object/inheritance.hpp | 17 +-- .../boost/python/object/inheritance_query.hpp | 9 +- pxr/external/boost/python/object/instance.hpp | 17 +-- pxr/external/boost/python/object/iterator.hpp | 9 +- .../boost/python/object/iterator_core.hpp | 9 +- .../boost/python/object/life_support.hpp | 7 +- .../boost/python/object/make_holder.hpp | 21 ++-- .../boost/python/object/make_instance.hpp | 11 +- .../boost/python/object/make_ptr_instance.hpp | 17 ++- .../boost/python/object/pickle_support.hpp | 7 +- .../boost/python/object/pointer_holder.hpp | 25 ++-- .../boost/python/object/py_function.hpp | 7 +- .../boost/python/object/stl_iterator_core.hpp | 15 +-- .../boost/python/object/value_holder.hpp | 17 +-- .../boost/python/object/value_holder_fwd.hpp | 5 +- .../boost/python/object_attributes.hpp | 5 +- pxr/external/boost/python/object_call.hpp | 4 +- pxr/external/boost/python/object_core.hpp | 41 +++--- pxr/external/boost/python/object_fwd.hpp | 5 +- pxr/external/boost/python/object_items.hpp | 5 +- .../boost/python/object_operators.hpp | 83 ++++++------ pxr/external/boost/python/object_protocol.hpp | 23 ++-- .../boost/python/object_protocol_core.hpp | 33 ++--- pxr/external/boost/python/object_slices.hpp | 5 +- .../boost/python/opaque_pointer_converter.hpp | 17 +-- pxr/external/boost/python/operators.hpp | 119 +++++++++--------- pxr/external/boost/python/other.hpp | 5 +- pxr/external/boost/python/overloads.hpp | 1 + pxr/external/boost/python/override.hpp | 17 +-- pxr/external/boost/python/pointee.hpp | 5 +- pxr/external/boost/python/proxy.hpp | 29 ++--- pxr/external/boost/python/ptr.hpp | 5 +- pxr/external/boost/python/pure_virtual.hpp | 7 +- pxr/external/boost/python/raw_function.hpp | 7 +- pxr/external/boost/python/refcount.hpp | 5 +- .../python/reference_existing_object.hpp | 5 +- .../boost/python/register_ptr_to_python.hpp | 7 +- pxr/external/boost/python/return_arg.hpp | 9 +- pxr/external/boost/python/return_by_value.hpp | 5 +- .../python/return_internal_reference.hpp | 5 +- .../boost/python/return_opaque_pointer.hpp | 7 +- .../boost/python/return_value_policy.hpp | 5 +- pxr/external/boost/python/scope.hpp | 7 +- pxr/external/boost/python/self.hpp | 11 +- pxr/external/boost/python/signature.hpp | 87 ++++++------- pxr/external/boost/python/slice.hpp | 13 +- pxr/external/boost/python/slice_nil.hpp | 5 +- .../src/converter/arg_to_python_base.cpp | 4 +- .../src/converter/builtin_converters.cpp | 42 +++---- .../python/src/converter/from_python.cpp | 28 ++--- .../boost/python/src/converter/registry.cpp | 42 +++---- .../boost/python/src/converter/type_id.cpp | 14 +-- pxr/external/boost/python/src/dict.cpp | 6 +- pxr/external/boost/python/src/errors.cpp | 18 +-- pxr/external/boost/python/src/exec.cpp | 22 ++-- pxr/external/boost/python/src/import.cpp | 8 +- pxr/external/boost/python/src/list.cpp | 6 +- pxr/external/boost/python/src/long.cpp | 4 +- pxr/external/boost/python/src/module.cpp | 14 +-- pxr/external/boost/python/src/numpy/dtype.cpp | 12 +- .../boost/python/src/numpy/matrix.cpp | 12 +- .../boost/python/src/numpy/ndarray.cpp | 8 +- pxr/external/boost/python/src/numpy/numpy.cpp | 6 +- .../boost/python/src/numpy/scalars.cpp | 8 +- pxr/external/boost/python/src/numpy/ufunc.cpp | 8 +- .../boost/python/src/object/class.cpp | 18 +-- pxr/external/boost/python/src/object/enum.cpp | 4 +- .../boost/python/src/object/function.cpp | 20 +-- .../src/object/function_doc_signature.cpp | 10 +- .../boost/python/src/object/inheritance.cpp | 21 ++-- .../boost/python/src/object/iterator.cpp | 6 +- .../boost/python/src/object/life_support.cpp | 6 +- .../python/src/object/pickle_support.cpp | 4 +- .../boost/python/src/object/stl_iterator.cpp | 14 +-- .../boost/python/src/object_operators.cpp | 78 ++++++------ .../boost/python/src/object_protocol.cpp | 32 ++--- pxr/external/boost/python/src/slice.cpp | 4 +- pxr/external/boost/python/src/str.cpp | 108 ++++++++-------- pxr/external/boost/python/src/tuple.cpp | 6 +- pxr/external/boost/python/src/wrapper.cpp | 6 +- pxr/external/boost/python/ssize_t.hpp | 5 +- pxr/external/boost/python/stl_iterator.hpp | 7 +- pxr/external/boost/python/str.hpp | 11 +- .../python/suite/indexing/container_utils.hpp | 9 +- .../indexing/detail/indexing_suite_detail.hpp | 41 +++--- .../python/suite/indexing/indexing_suite.hpp | 5 +- .../suite/indexing/map_indexing_suite.hpp | 5 +- .../suite/indexing/vector_indexing_suite.hpp | 5 +- pxr/external/boost/python/tag.hpp | 5 +- .../python/test/a_map_indexing_suite.cpp | 12 +- .../boost/python/test/aligned_class.cpp | 4 +- .../boost/python/test/andreas_beyer.cpp | 3 +- pxr/external/boost/python/test/args.cpp | 16 +-- .../python/test/as_to_python_function.cpp | 2 +- .../boost/python/test/back_reference.cpp | 12 +- pxr/external/boost/python/test/bases.cpp | 40 +++--- pxr/external/boost/python/test/ben_scott1.cpp | 4 +- pxr/external/boost/python/test/bienstman1.cpp | 8 +- pxr/external/boost/python/test/bienstman2.cpp | 4 +- pxr/external/boost/python/test/bienstman3.cpp | 4 +- pxr/external/boost/python/test/bienstman4.cpp | 4 +- pxr/external/boost/python/test/bienstman5.cpp | 4 +- pxr/external/boost/python/test/borrowed.cpp | 6 +- .../boost/python/test/builtin_converters.cpp | 20 +-- pxr/external/boost/python/test/callbacks.cpp | 4 +- .../boost/python/test/calling_conventions.cpp | 10 +- .../python/test/calling_conventions_mf.cpp | 10 +- pxr/external/boost/python/test/class.cpp | 4 +- pxr/external/boost/python/test/cltree.cpp | 10 +- .../boost/python/test/const_argument.cpp | 4 +- .../python/test/copy_ctor_mutates_rhs.cpp | 2 +- .../python/test/crossmod_exception_a.cpp | 4 +- .../python/test/crossmod_exception_b.cpp | 4 +- .../boost/python/test/crossmod_opaque_a.cpp | 6 +- .../boost/python/test/crossmod_opaque_b.cpp | 6 +- .../boost/python/test/data_members.cpp | 8 +- pxr/external/boost/python/test/defaults.cpp | 24 ++-- .../boost/python/test/destroy_test.cpp | 6 +- pxr/external/boost/python/test/dict.cpp | 4 +- pxr/external/boost/python/test/docstring.cpp | 10 +- .../python/test/enable_shared_from_this.cpp | 4 +- pxr/external/boost/python/test/enum_ext.cpp | 8 +- .../python/test/exception_translator.cpp | 4 +- pxr/external/boost/python/test/exec.cpp | 6 +- pxr/external/boost/python/test/extract.cpp | 6 +- pxr/external/boost/python/test/if_else.cpp | 12 +- pxr/external/boost/python/test/implicit.cpp | 10 +- pxr/external/boost/python/test/import_.cpp | 2 +- .../python/test/indirect_traits_test.cpp | 4 +- pxr/external/boost/python/test/injected.cpp | 4 +- .../boost/python/test/input_iterator.cpp | 4 +- .../python/test/int_map_indexing_suite.cpp | 2 +- pxr/external/boost/python/test/iterator.cpp | 6 +- pxr/external/boost/python/test/keywords.cpp | 14 +-- pxr/external/boost/python/test/list.cpp | 4 +- pxr/external/boost/python/test/long.cpp | 8 +- pxr/external/boost/python/test/m1.cpp | 14 +-- pxr/external/boost/python/test/m2.cpp | 18 +-- .../boost/python/test/map_indexing_suite.cpp | 4 +- pxr/external/boost/python/test/minimal.cpp | 2 +- .../python/test/module_init_exception.cpp | 4 +- .../boost/python/test/module_tail.cpp | 6 +- .../python/test/multi_arg_constructor.cpp | 4 +- pxr/external/boost/python/test/nested.cpp | 4 +- .../boost/python/test/numpy/dtype.cpp | 6 +- .../boost/python/test/numpy/indexing.cpp | 6 +- .../boost/python/test/numpy/ndarray.cpp | 6 +- .../boost/python/test/numpy/shapes.cpp | 6 +- .../boost/python/test/numpy/templates.cpp | 6 +- .../boost/python/test/numpy/ufunc.cpp | 6 +- pxr/external/boost/python/test/object.cpp | 4 +- .../boost/python/test/object_fail1.cpp | 2 +- .../boost/python/test/object_manager.cpp | 4 +- pxr/external/boost/python/test/opaque.cpp | 8 +- pxr/external/boost/python/test/operators.cpp | 6 +- .../boost/python/test/operators_wrapper.cpp | 4 +- pxr/external/boost/python/test/pickle1.cpp | 14 +-- pxr/external/boost/python/test/pickle2.cpp | 24 ++-- pxr/external/boost/python/test/pickle3.cpp | 28 ++--- pxr/external/boost/python/test/pickle4.cpp | 8 +- pxr/external/boost/python/test/pointee.cpp | 8 +- .../python/test/pointer_type_id_test.cpp | 6 +- .../boost/python/test/pointer_vector.cpp | 4 +- .../boost/python/test/polymorphism.cpp | 4 +- .../boost/python/test/polymorphism2.cpp | 4 +- pxr/external/boost/python/test/properties.cpp | 4 +- .../boost/python/test/pytype_function.cpp | 24 ++-- pxr/external/boost/python/test/raw_ctor.cpp | 4 +- .../boost/python/test/raw_pyobject_fail1.cpp | 2 +- .../boost/python/test/raw_pyobject_fail2.cpp | 2 +- .../boost/python/test/register_ptr.cpp | 4 +- pxr/external/boost/python/test/result.cpp | 2 +- pxr/external/boost/python/test/return_arg.cpp | 6 +- .../python/test/select_arg_to_python_test.cpp | 10 +- .../python/test/select_from_python_test.cpp | 8 +- .../boost/python/test/select_holder.cpp | 14 +-- pxr/external/boost/python/test/shared_ptr.hpp | 4 +- pxr/external/boost/python/test/slice.cpp | 6 +- .../boost/python/test/staticmethod.cpp | 4 +- .../boost/python/test/stl_iterator.cpp | 6 +- pxr/external/boost/python/test/str.cpp | 4 +- .../boost/python/test/string_literal.cpp | 2 +- .../python/test/test_overload_resolution.cpp | 10 +- .../python/test/test_pointer_adoption.cpp | 4 +- pxr/external/boost/python/test/tuple.cpp | 4 +- pxr/external/boost/python/test/upcast.cpp | 4 +- .../python/test/vector_indexing_suite.cpp | 4 +- .../boost/python/test/virtual_functions.cpp | 4 +- pxr/external/boost/python/test/voidptr.cpp | 4 +- .../boost/python/test/wrapper_held_type.cpp | 4 +- .../boost/python/to_python_converter.hpp | 11 +- .../boost/python/to_python_indirect.hpp | 9 +- pxr/external/boost/python/to_python_value.hpp | 19 +-- pxr/external/boost/python/tuple.hpp | 17 +-- pxr/external/boost/python/type_id.hpp | 49 ++++---- .../boost/python/with_custodian_and_ward.hpp | 9 +- pxr/external/boost/python/wrapper.hpp | 5 +- 355 files changed, 2189 insertions(+), 1885 deletions(-) create mode 100644 pxr/external/boost/python/common.hpp diff --git a/pxr/external/boost/python.hpp b/pxr/external/boost/python.hpp index 9c3540c42b..5b36e7545c 100644 --- a/pxr/external/boost/python.hpp +++ b/pxr/external/boost/python.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include diff --git a/pxr/external/boost/python/CMakeLists.txt b/pxr/external/boost/python/CMakeLists.txt index 035603949a..30c4a7e82a 100644 --- a/pxr/external/boost/python/CMakeLists.txt +++ b/pxr/external/boost/python/CMakeLists.txt @@ -37,6 +37,7 @@ pxr_library(python cast.hpp class.hpp class_fwd.hpp + common.hpp converter/arg_from_python.hpp converter/arg_to_python.hpp converter/arg_to_python_base.hpp @@ -292,10 +293,10 @@ pxr_library(python DISABLE_PRECOMPILED_HEADERS ) -# Add BOOST_PYTHON_SOURCE when building this library to ensure symbols -# decorated with BOOST_PYTHON_DECL are exported. +# Add PXR_BOOST_PYTHON_SOURCE when building this library to ensure symbols +# decorated with PXR_BOOST_PYTHON_DECL are exported. target_compile_definitions(python - PRIVATE BOOST_PYTHON_SOURCE + PRIVATE PXR_BOOST_PYTHON_SOURCE ) # XXX: @@ -594,7 +595,7 @@ boost_python_cpp_test_lib("select_holder") # here, we'll run into duplicate symbol errors at link time. # # Because we're compiling in this extra source file, we need to set -# BOOST_PYTHON_STATIC_LIB to ensure the symbols from that file +# PXR_BOOST_PYTHON_STATIC_LIB to ensure the symbols from that file # aren't set to be exported, which will cause conflicts with # the header files that say they should be imported. if (NOT PXR_BUILD_MONOLITHIC) @@ -607,6 +608,6 @@ boost_python_cpp_test("select_from_python_test" ${extracppfiles} ) target_compile_definitions(select_from_python_test - PRIVATE BOOST_PYTHON_STATIC_LIB) + PRIVATE PXR_BOOST_PYTHON_STATIC_LIB) boost_python_cpp_test_lib("select_arg_to_python_test") diff --git a/pxr/external/boost/python/arg_from_python.hpp b/pxr/external/boost/python/arg_from_python.hpp index 38a5fc425d..3199478d28 100644 --- a/pxr/external/boost/python/arg_from_python.hpp +++ b/pxr/external/boost/python/arg_from_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ARG_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" #endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct arg_from_python @@ -82,7 +83,7 @@ inline arg_from_python::arg_from_python(PyObject* source) { } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/args.hpp b/pxr/external/boost/python/args.hpp index 8f444d8dbd..af5a014475 100644 --- a/pxr/external/boost/python/args.hpp +++ b/pxr/external/boost/python/args.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ARGS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -37,7 +38,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { typedef detail::keywords<1> arg; typedef arg arg_; // gcc 2.96 workaround @@ -131,7 +132,7 @@ namespace detail BOOST_STATIC_CONSTANT(bool, value = (is_ref & is_key)); typedef mpl::bool_ type; - BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) + PXR_BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T)) }; } @@ -140,18 +141,18 @@ inline detail::keywords<1> args(char const* name) return detail::keywords<1>(name); } -# define BOOST_PYTHON_ASSIGN_NAME(z, n, _) result.elements[n].name = name##n; +# define PXR_BOOST_PYTHON_ASSIGN_NAME(z, n, _) result.elements[n].name = name##n; # define BOOST_PP_LOCAL_MACRO(n) \ inline detail::keywords args(BOOST_PP_ENUM_PARAMS_Z(1, n, char const* name)) \ { \ detail::keywords result; \ - BOOST_PP_REPEAT_1(n, BOOST_PYTHON_ASSIGN_NAME, _) \ + BOOST_PP_REPEAT_1(n, PXR_BOOST_PYTHON_ASSIGN_NAME, _) \ return result; \ } -# define BOOST_PP_LOCAL_LIMITS (2, BOOST_PYTHON_MAX_ARITY) +# define BOOST_PP_LOCAL_LIMITS (2, PXR_BOOST_PYTHON_MAX_ARITY) # include BOOST_PP_LOCAL_ITERATE() -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/args_fwd.hpp b/pxr/external/boost/python/args_fwd.hpp index e427bf17d0..fed08e4573 100644 --- a/pxr/external/boost/python/args_fwd.hpp +++ b/pxr/external/boost/python/args_fwd.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ARGS_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -58,7 +59,7 @@ namespace detail } } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ARGS_FWD_HPP diff --git a/pxr/external/boost/python/back_reference.hpp b/pxr/external/boost/python/back_reference.hpp index 057794cfa9..5ff3996305 100644 --- a/pxr/external/boost/python/back_reference.hpp +++ b/pxr/external/boost/python/back_reference.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_BACK_REFERENCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/detail/dependent.hpp" # include "pxr/external/boost/python/detail/raw_pyobject.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct back_reference @@ -77,7 +78,7 @@ T back_reference::get() const return m_value; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BACK_REFERENCE_HPP diff --git a/pxr/external/boost/python/base_type_traits.hpp b/pxr/external/boost/python/base_type_traits.hpp index 09ab45cc5d..0783640d4f 100644 --- a/pxr/external/boost/python/base_type_traits.hpp +++ b/pxr/external/boost/python/base_type_traits.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_BASE_TYPE_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -49,7 +50,7 @@ struct base_type_traits typedef PyObject type; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BASE_TYPE_TRAITS_HPP diff --git a/pxr/external/boost/python/bases.hpp b/pxr/external/boost/python/bases.hpp index 8ad8798ff2..791908b0d5 100644 --- a/pxr/external/boost/python/bases.hpp +++ b/pxr/external/boost/python/bases.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_BASES_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,13 +25,13 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -# define BOOST_PYTHON_BASE_PARAMS BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, Base) +# define PXR_BOOST_PYTHON_BASE_PARAMS BOOST_PP_ENUM_PARAMS_Z(1, PXR_BOOST_PYTHON_MAX_BASES, Base) // A type list for specifying bases - template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_MAX_BASES, typename Base, mpl::void_) > - struct bases : detail::type_list< BOOST_PYTHON_BASE_PARAMS >::type + template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PXR_BOOST_PYTHON_MAX_BASES, typename Base, mpl::void_) > + struct bases : detail::type_list< PXR_BOOST_PYTHON_BASE_PARAMS >::type {}; namespace detail @@ -40,8 +41,8 @@ namespace boost { namespace python { { }; - template < BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_MAX_BASES, class Base) > - struct specifies_bases< bases< BOOST_PYTHON_BASE_PARAMS > > + template < BOOST_PP_ENUM_PARAMS_Z(1, PXR_BOOST_PYTHON_MAX_BASES, class Base) > + struct specifies_bases< bases< PXR_BOOST_PYTHON_BASE_PARAMS > > : mpl::true_ { }; @@ -55,8 +56,8 @@ namespace boost { namespace python { { }; } -# undef BOOST_PYTHON_BASE_PARAMS -}} // namespace boost::python +# undef PXR_BOOST_PYTHON_BASE_PARAMS +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BASES_HPP diff --git a/pxr/external/boost/python/borrowed.hpp b/pxr/external/boost/python/borrowed.hpp index ff11014c10..22446f3108 100644 --- a/pxr/external/boost/python/borrowed.hpp +++ b/pxr/external/boost/python/borrowed.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_BORROWED_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/borrowed_ptr.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template inline python::detail::borrowed* borrowed(T* p) @@ -27,7 +28,7 @@ inline python::detail::borrowed* borrowed(T* p) return (detail::borrowed*)p; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_BORROWED_HPP diff --git a/pxr/external/boost/python/call.hpp b/pxr/external/boost/python/call.hpp index de199db1aa..c31a586b16 100644 --- a/pxr/external/boost/python/call.hpp +++ b/pxr/external/boost/python/call.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CALL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -35,17 +36,17 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ +# define PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ , converter::arg_to_python(a##n).get() -# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/call.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/call.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET +# undef PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_CALL_HPP @@ -74,8 +75,8 @@ call(PyObject* callable PyObject* const result = PyObject_CallFunction( callable - , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) + , const_cast("(" BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) ); // This conversion *must not* be done in the same expression as diff --git a/pxr/external/boost/python/call_method.hpp b/pxr/external/boost/python/call_method.hpp index 6e9eb3c880..38bf31cc89 100644 --- a/pxr/external/boost/python/call_method.hpp +++ b/pxr/external/boost/python/call_method.hpp @@ -13,6 +13,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CALL_METHOD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -34,17 +35,17 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -# define BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ +# define PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET(z, n, _) \ , converter::arg_to_python(a##n).get() -# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/call_method.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/call_method.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET +# undef PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_CALL_METHOD_HPP @@ -74,8 +75,8 @@ call_method(PyObject* self, char const* name PyObject_CallMethod( self , const_cast(name) - , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) + , const_cast("(" BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_FAST_ARG_TO_PYTHON_GET, nil) ); // This conversion *must not* be done in the same expression as diff --git a/pxr/external/boost/python/cast.hpp b/pxr/external/boost/python/cast.hpp index 026d155305..3b7f44b8bb 100644 --- a/pxr/external/boost/python/cast.hpp +++ b/pxr/external/boost/python/cast.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CAST_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/base_type_traits.hpp" # include "pxr/external/boost/python/detail/convertible.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -111,7 +112,7 @@ inline Target* downcast(Source* x, Target* = 0) return detail::downcast(x, detail::convertible::check((Target*)0)); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CAST_HPP diff --git a/pxr/external/boost/python/class.hpp b/pxr/external/boost/python/class.hpp index 0b84d39da5..4718f84a32 100644 --- a/pxr/external/boost/python/class.hpp +++ b/pxr/external/boost/python/class.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CLASS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -55,15 +56,15 @@ || (BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) -# define BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING 1 +# define PXR_BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING 1 # endif -# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +# ifdef PXR_BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING # include # endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class def_visitor; @@ -96,18 +97,18 @@ namespace detail > {}; -# ifdef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , detail::is_data_member_pointer() -# define BOOST_PYTHON_YES_DATA_MEMBER , mpl::true_ -# define BOOST_PYTHON_NO_DATA_MEMBER , mpl::false_ +# ifdef PXR_BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +# define PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D) , detail::is_data_member_pointer() +# define PXR_BOOST_PYTHON_YES_DATA_MEMBER , mpl::true_ +# define PXR_BOOST_PYTHON_NO_DATA_MEMBER , mpl::false_ # elif defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) , 0 -# define BOOST_PYTHON_YES_DATA_MEMBER , int -# define BOOST_PYTHON_NO_DATA_MEMBER , ... +# define PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D) , 0 +# define PXR_BOOST_PYTHON_YES_DATA_MEMBER , int +# define PXR_BOOST_PYTHON_NO_DATA_MEMBER , ... # else -# define BOOST_PYTHON_DATA_MEMBER_HELPER(D) -# define BOOST_PYTHON_YES_DATA_MEMBER -# define BOOST_PYTHON_NO_DATA_MEMBER +# define PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D) +# define PXR_BOOST_PYTHON_YES_DATA_MEMBER +# define PXR_BOOST_PYTHON_NO_DATA_MEMBER # endif namespace error @@ -286,25 +287,25 @@ class class_ : public objects::class_base template self& def_readonly(char const* name, D const& d, char const* doc=0) { - return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + return this->def_readonly_impl(name, d, doc PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D)); } template self& def_readwrite(char const* name, D const& d, char const* doc=0) { - return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + return this->def_readwrite_impl(name, d, doc PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D)); } template self& def_readonly(char const* name, D& d, char const* doc=0) { - return this->def_readonly_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + return this->def_readonly_impl(name, d, doc PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D)); } template self& def_readwrite(char const* name, D& d, char const* doc=0) { - return this->def_readwrite_impl(name, d, doc BOOST_PYTHON_DATA_MEMBER_HELPER(D)); + return this->def_readwrite_impl(name, d, doc PXR_BOOST_PYTHON_DATA_MEMBER_HELPER(D)); } // Property creation @@ -429,28 +430,28 @@ class class_ : public objects::class_base template self& def_readonly_impl( - char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) + char const* name, D B::*pm_, char const* doc PXR_BOOST_PYTHON_YES_DATA_MEMBER) { return this->add_property(name, pm_, doc); } template self& def_readwrite_impl( - char const* name, D B::*pm_, char const* doc BOOST_PYTHON_YES_DATA_MEMBER) + char const* name, D B::*pm_, char const* doc PXR_BOOST_PYTHON_YES_DATA_MEMBER) { return this->add_property(name, pm_, pm_, doc); } template self& def_readonly_impl( - char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) + char const* name, D& d, char const* PXR_BOOST_PYTHON_NO_DATA_MEMBER) { return this->add_static_property(name, python::make_getter(d)); } template self& def_readwrite_impl( - char const* name, D& d, char const* BOOST_PYTHON_NO_DATA_MEMBER) + char const* name, D& d, char const* PXR_BOOST_PYTHON_NO_DATA_MEMBER) { return this->add_static_property(name, python::make_getter(d), python::make_setter(d)); } @@ -545,7 +546,7 @@ class class_ : public objects::class_base // // These two overloads discriminate between def() as applied to // regular functions and def() as applied to the result of - // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to + // PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to // discriminate. // // @group def_maybe_overloads { @@ -609,12 +610,12 @@ inline class_::class_(char const* name, char const* doc, no_init_t) this->initialize(no_init); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python -# undef BOOST_PYTHON_DATA_MEMBER_HELPER -# undef BOOST_PYTHON_YES_DATA_MEMBER -# undef BOOST_PYTHON_NO_DATA_MEMBER -# undef BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING +# undef PXR_BOOST_PYTHON_DATA_MEMBER_HELPER +# undef PXR_BOOST_PYTHON_YES_DATA_MEMBER +# undef PXR_BOOST_PYTHON_NO_DATA_MEMBER +# undef PXR_BOOST_PYTHON_NO_MEMBER_POINTER_ORDERING #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CLASS_HPP diff --git a/pxr/external/boost/python/class_fwd.hpp b/pxr/external/boost/python/class_fwd.hpp index 435e59fa1f..1f37cdeb1c 100644 --- a/pxr/external/boost/python/class_fwd.hpp +++ b/pxr/external/boost/python/class_fwd.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CLASS_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,18 +20,18 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/not_specified.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template < class T // class being wrapped // arbitrarily-ordered optional arguments. Full qualification needed for MSVC6 - , class X1 = ::boost::python::detail::not_specified - , class X2 = ::boost::python::detail::not_specified - , class X3 = ::boost::python::detail::not_specified + , class X1 = ::PXR_BOOST_NAMESPACE::python::detail::not_specified + , class X2 = ::PXR_BOOST_NAMESPACE::python::detail::not_specified + , class X3 = ::PXR_BOOST_NAMESPACE::python::detail::not_specified > class class_; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CLASS_FWD_HPP diff --git a/pxr/external/boost/python/common.hpp b/pxr/external/boost/python/common.hpp new file mode 100644 index 0000000000..308c30c8e0 --- /dev/null +++ b/pxr/external/boost/python/common.hpp @@ -0,0 +1,62 @@ +// +// Copyright 2024 Pixar +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_EXTERNAL_BOOST_PYTHON_COMMON_HPP +#define PXR_EXTERNAL_BOOST_PYTHON_COMMON_HPP + +#include "pxr/pxr.h" + +// Common definitions and utilities included by all headers + +#ifdef PXR_USE_INTERNAL_BOOST_PYTHON + +#if PXR_USE_NAMESPACES +#define PXR_BOOST_NAMESPACE PXR_INTERNAL_NS::pxr_boost +#else +#define PXR_BOOST_NAMESPACE pxr_boost +#endif + +#define PXR_BOOST_PYTHON_NAMESPACE PXR_BOOST_NAMESPACE::python + +// Allow lookups in the boost namespace to accommodate code that +// relied on this library being in the boost namespace as well. +namespace boost { } +namespace PXR_BOOST_NAMESPACE { + using namespace boost; +} + +#else + +// Set up a namespace alias so that code that uses pxr_boost::python +// will automatically pick up boost::python. +namespace boost::python { } + +#if PXR_USE_NAMESPACES +namespace PXR_INTERNAL_NS::pxr_boost { +#else +namespace pxr_boost { +#endif + namespace python = ::boost::python; +} + +#define PXR_BOOST_NAMESPACE boost +#define PXR_BOOST_PYTHON_NAMESPACE boost::python + +#define PXR_BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE + +#define PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS +#define PXR_BOOST_PYTHON_FUNCTION_OVERLOADS BOOST_PYTHON_FUNCTION_OVERLOADS + +#ifdef PXR_BOOST_PYTHON_MAX_ARITY +#define BOOST_PYTHON_MAX_ARITY PXR_BOOST_PYTHON_MAX_ARITY +#endif + +#ifdef PXR_BOOST_PYTHON_NO_PY_SIGNATURES +#define BOOST_PYTHON_NO_PY_SIGNATURES +#endif + +#endif // PXR_USE_INTERNAL_BOOST_PYTHON + +#endif diff --git a/pxr/external/boost/python/converter/arg_from_python.hpp b/pxr/external/boost/python/converter/arg_from_python.hpp index 21f32d6c78..e6b6ad0d57 100644 --- a/pxr/external/boost/python/converter/arg_from_python.hpp +++ b/pxr/external/boost/python/converter/arg_from_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -35,7 +36,7 @@ # include "pxr/external/boost/python/detail/referent_storage.hpp" # include "pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp" -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { template struct arg_from_python; }} @@ -43,7 +44,7 @@ namespace boost { namespace python // This header defines Python->C++ function argument converters, // parametrized on the argument type. -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // // lvalue converters @@ -116,7 +117,7 @@ struct reference_arg_from_python : arg_lvalue_from_python_base template struct arg_rvalue_from_python { - typedef typename boost::python::detail::add_lvalue_reference< + typedef typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference< T // We can't add_const here, or it would be impossible to pass // auto_ptr args from Python to C++ @@ -142,14 +143,14 @@ struct arg_rvalue_from_python // back to the Python object template struct back_reference_arg_from_python - : boost::python::arg_from_python + : PXR_BOOST_NAMESPACE::python::arg_from_python { typedef T result_type; back_reference_arg_from_python(PyObject*); T operator()(); private: - typedef boost::python::arg_from_python base; + typedef PXR_BOOST_NAMESPACE::python::arg_from_python base; PyObject* m_source; }; @@ -190,7 +191,7 @@ struct select_arg_from_python > , reference_arg_from_python , mpl::if_< - boost::python::is_back_reference + PXR_BOOST_NAMESPACE::python::is_back_reference , back_reference_arg_from_python , arg_rvalue_from_python > @@ -341,7 +342,7 @@ back_reference_arg_from_python::operator()() return T(m_source, base::operator()()); } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python.hpp b/pxr/external/boost/python/converter/arg_to_python.hpp index cac56d795d..efb8b35c11 100644 --- a/pxr/external/boost/python/converter/arg_to_python.hpp +++ b/pxr/external/boost/python/converter/arg_to_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -39,7 +40,7 @@ # include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct is_object_manager; @@ -123,9 +124,9 @@ namespace detail , typename mpl::if_< mpl::or_< - boost::python::detail::is_function + PXR_BOOST_NAMESPACE::python::detail::is_function , indirect_traits::is_pointer_to_function - , boost::python::detail::is_member_function_pointer + , PXR_BOOST_NAMESPACE::python::detail::is_member_function_pointer > , function_arg_to_python @@ -134,7 +135,7 @@ namespace detail , object_manager_arg_to_python , typename mpl::if_< - boost::python::detail::is_pointer + PXR_BOOST_NAMESPACE::python::detail::is_pointer , pointer_deep_arg_to_python , typename mpl::if_< @@ -263,7 +264,7 @@ inline arg_to_python::arg_to_python(T const& x) : base(x) {} -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/arg_to_python_base.hpp b/pxr/external/boost/python/converter/arg_to_python_base.hpp index c1bf592884..5e8633fd85 100644 --- a/pxr/external/boost/python/converter/arg_to_python_base.hpp +++ b/pxr/external/boost/python/converter/arg_to_python_base.hpp @@ -11,26 +11,27 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_BASE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/handle.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { struct registration; namespace detail { - struct BOOST_PYTHON_DECL arg_to_python_base + struct PXR_BOOST_PYTHON_DECL arg_to_python_base : handle<> { arg_to_python_base(void const volatile* source, registration const&); }; } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_ARG_TO_PYTHON_BASE_HPP diff --git a/pxr/external/boost/python/converter/as_to_python_function.hpp b/pxr/external/boost/python/converter/as_to_python_function.hpp index 8d0c272dc8..e7bf9c412e 100644 --- a/pxr/external/boost/python/converter/as_to_python_function.hpp +++ b/pxr/external/boost/python/converter/as_to_python_function.hpp @@ -11,13 +11,14 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_AS_TO_PYTHON_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/converter/to_python_function_type.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // Given a typesafe to_python conversion function, produces a // to_python_function_t which can be registered in the usual way. @@ -50,12 +51,12 @@ struct as_to_python_function // but c'est la vie. return ToPython::convert(*const_cast(static_cast(x))); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const * get_pytype() { return ToPython::get_pytype(); } #endif }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_AS_TO_PYTHON_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/builtin_converters.hpp b/pxr/external/boost/python/converter/builtin_converters.hpp index 555e682491..c7f6f54807 100644 --- a/pxr/external/boost/python/converter/builtin_converters.hpp +++ b/pxr/external/boost/python/converter/builtin_converters.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_BUILTIN_CONVERTERS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -30,15 +31,15 @@ // lookups using explicit specializations of arg_to_python and // result_to_python. -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct arg_to_python; - BOOST_PYTHON_DECL PyObject* do_return_to_python(char); - BOOST_PYTHON_DECL PyObject* do_return_to_python(char const*); - BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject*); - BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject*); + PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(char); + PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(char const*); + PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject*); + PXR_BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject*); } // Provide specializations of to_python_value @@ -58,7 +59,7 @@ namespace detail } // Use expr to create the PyObject corresponding to x -# define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)\ +# define PXR_BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)\ template <> struct to_python_value \ : detail::builtin_to_python \ { \ @@ -84,7 +85,7 @@ namespace detail } \ }; -# define BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T, expr) \ +# define PXR_BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T, expr) \ namespace converter \ { \ template <> struct arg_to_python< T > \ @@ -96,22 +97,22 @@ namespace detail } // Specialize argument and return value converters for T using expr -# define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \ - BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T,expr, pytype) \ - BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr) +# define PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype) \ + PXR_BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T,expr, pytype) \ + PXR_BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr) // Specialize converters for signed and unsigned T to Python Int #if PY_VERSION_HEX >= 0x03000000 -# define BOOST_PYTHON_TO_INT(T) \ - BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyLong_FromLong(x), &PyLong_Type) \ - BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned T, ::PyLong_FromUnsignedLong(x), &PyLong_Type) +# define PXR_BOOST_PYTHON_TO_INT(T) \ + PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyLong_FromLong(x), &PyLong_Type) \ + PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned T, ::PyLong_FromUnsignedLong(x), &PyLong_Type) #else -# define BOOST_PYTHON_TO_INT(T) \ - BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyInt_FromLong(x), &PyInt_Type) \ - BOOST_PYTHON_TO_PYTHON_BY_VALUE( \ +# define PXR_BOOST_PYTHON_TO_INT(T) \ + PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed T, ::PyInt_FromLong(x), &PyInt_Type) \ + PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE( \ unsigned T \ , static_cast(x) > static_cast( \ (std::numeric_limits::max)()) \ @@ -121,17 +122,17 @@ namespace detail // Bool is not signed. #if PY_VERSION_HEX >= 0x02030000 -BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyBool_FromLong(x), &PyBool_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyBool_FromLong(x), &PyBool_Type) #else -BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyInt_FromLong(x), &PyInt_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(bool, ::PyInt_FromLong(x), &PyInt_Type) #endif // note: handles signed char and unsigned char, but not char (see below) -BOOST_PYTHON_TO_INT(char) +PXR_BOOST_PYTHON_TO_INT(char) -BOOST_PYTHON_TO_INT(short) -BOOST_PYTHON_TO_INT(int) -BOOST_PYTHON_TO_INT(long) +PXR_BOOST_PYTHON_TO_INT(short) +PXR_BOOST_PYTHON_TO_INT(int) +PXR_BOOST_PYTHON_TO_INT(long) # if defined(_MSC_VER) && defined(_WIN64) && PY_VERSION_HEX < 0x03000000 /* Under 64-bit Windows std::size_t is "unsigned long long". To avoid @@ -139,17 +140,17 @@ BOOST_PYTHON_TO_INT(long) the conversion. A std::size_t is converted to a simple Python int if possible; a Python long appears only if the value is too small or too large to fit into a simple int. */ -BOOST_PYTHON_TO_PYTHON_BY_VALUE( - signed BOOST_PYTHON_LONG_LONG, - ( x < static_cast( +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE( + signed PXR_BOOST_PYTHON_LONG_LONG, + ( x < static_cast( (std::numeric_limits::min)()) - || x > static_cast( + || x > static_cast( (std::numeric_limits::max)())) ? ::PyLong_FromLongLong(x) : ::PyInt_FromLong(static_cast(x)), &PyInt_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE( - unsigned BOOST_PYTHON_LONG_LONG, - x > static_cast( +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE( + unsigned PXR_BOOST_PYTHON_LONG_LONG, + x > static_cast( (std::numeric_limits::max)()) ? ::PyLong_FromUnsignedLongLong(x) : ::PyInt_FromLong(static_cast(x)), &PyInt_Type) @@ -157,37 +158,37 @@ BOOST_PYTHON_TO_PYTHON_BY_VALUE( # elif defined(HAVE_LONG_LONG) // using Python's macro instead of Boost's // - we don't seem to get the config right // all the time. -BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed BOOST_PYTHON_LONG_LONG, ::PyLong_FromLongLong(x), &PyLong_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned BOOST_PYTHON_LONG_LONG, ::PyLong_FromUnsignedLongLong(x), &PyLong_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed PXR_BOOST_PYTHON_LONG_LONG, ::PyLong_FromLongLong(x), &PyLong_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned PXR_BOOST_PYTHON_LONG_LONG, ::PyLong_FromUnsignedLongLong(x), &PyLong_Type) # endif # undef BOOST_TO_PYTHON_INT #if PY_VERSION_HEX >= 0x03000000 -BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyUnicode_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyUnicode_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyUnicode_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyUnicode_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyUnicode_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyUnicode_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyUnicode_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyUnicode_Type) #else -BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyString_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyString_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyString_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x), &PyString_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x), &PyString_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast(x.size())), &PyString_Type) #endif #if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast(x.size())), &PyUnicode_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast(x.size())), &PyUnicode_Type) # endif -BOOST_PYTHON_TO_PYTHON_BY_VALUE(float, ::PyFloat_FromDouble(x), &PyFloat_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(double, ::PyFloat_FromDouble(x), &PyFloat_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(long double, ::PyFloat_FromDouble(x), &PyFloat_Type) -BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(PyObject*, converter::do_return_to_python(x), 0) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) - -# undef BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE -# undef BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE -# undef BOOST_PYTHON_TO_PYTHON_BY_VALUE -# undef BOOST_PYTHON_TO_INT +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(float, ::PyFloat_FromDouble(x), &PyFloat_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(double, ::PyFloat_FromDouble(x), &PyFloat_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(long double, ::PyFloat_FromDouble(x), &PyFloat_Type) +PXR_BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(PyObject*, converter::do_return_to_python(x), 0) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) +PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::complex, ::PyComplex_FromDoubles(x.real(), x.imag()), &PyComplex_Type) + +# undef PXR_BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE +# undef PXR_BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE +# undef PXR_BOOST_PYTHON_TO_PYTHON_BY_VALUE +# undef PXR_BOOST_PYTHON_TO_INT namespace converter { @@ -196,7 +197,7 @@ namespace converter } -}} // namespace boost::python::converter +}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_BUILTIN_CONVERTERS_HPP diff --git a/pxr/external/boost/python/converter/constructor_function.hpp b/pxr/external/boost/python/converter/constructor_function.hpp index a3876e9d7f..d337e0d120 100644 --- a/pxr/external/boost/python/converter/constructor_function.hpp +++ b/pxr/external/boost/python/converter/constructor_function.hpp @@ -11,19 +11,20 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONSTRUCTOR_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // Declares the type of functions used to construct C++ objects for // rvalue from_python conversions. struct rvalue_from_python_stage1_data; typedef void (*constructor_function)(PyObject* source, rvalue_from_python_stage1_data*); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONSTRUCTOR_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/context_result_converter.hpp b/pxr/external/boost/python/converter/context_result_converter.hpp index c0384a5a63..3bc7b5be74 100644 --- a/pxr/external/boost/python/converter/context_result_converter.hpp +++ b/pxr/external/boost/python/converter/context_result_converter.hpp @@ -11,19 +11,20 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONTEXT_RESULT_CONVERTER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // A ResultConverter base class used to indicate that this result // converter should be constructed with the original Python argument // list. struct context_result_converter {}; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONTEXT_RESULT_CONVERTER_HPP diff --git a/pxr/external/boost/python/converter/convertible_function.hpp b/pxr/external/boost/python/converter/convertible_function.hpp index 3d57f8acf9..053d33e120 100644 --- a/pxr/external/boost/python/converter/convertible_function.hpp +++ b/pxr/external/boost/python/converter/convertible_function.hpp @@ -11,16 +11,17 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONVERTIBLE_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { typedef void* (*convertible_function)(PyObject*); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_CONVERTIBLE_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/from_python.hpp b/pxr/external/boost/python/converter/from_python.hpp index 4ebb77e49d..bb1b86d002 100644 --- a/pxr/external/boost/python/converter/from_python.hpp +++ b/pxr/external/boost/python/converter/from_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,35 +20,35 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { struct registration; -BOOST_PYTHON_DECL void* get_lvalue_from_python( +PXR_BOOST_PYTHON_DECL void* get_lvalue_from_python( PyObject* source, registration const&); -BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( +PXR_BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( PyObject* source, registration const&); -BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( +PXR_BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( PyObject* source, registration const&); -BOOST_PYTHON_DECL void* rvalue_from_python_stage2( +PXR_BOOST_PYTHON_DECL void* rvalue_from_python_stage2( PyObject* source, rvalue_from_python_stage1_data&, registration const&); -BOOST_PYTHON_DECL void* rvalue_result_from_python( +PXR_BOOST_PYTHON_DECL void* rvalue_result_from_python( PyObject*, rvalue_from_python_stage1_data&); -BOOST_PYTHON_DECL void* reference_result_from_python(PyObject*, registration const&); -BOOST_PYTHON_DECL void* pointer_result_from_python(PyObject*, registration const&); +PXR_BOOST_PYTHON_DECL void* reference_result_from_python(PyObject*, registration const&); +PXR_BOOST_PYTHON_DECL void* pointer_result_from_python(PyObject*, registration const&); -BOOST_PYTHON_DECL void void_result_from_python(PyObject*); +PXR_BOOST_PYTHON_DECL void void_result_from_python(PyObject*); -BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject*, registration const&); -BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject*, registration const&); +PXR_BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject*, registration const&); +PXR_BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject*, registration const&); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/implicit.hpp b/pxr/external/boost/python/converter/implicit.hpp index a6c4b5603d..52894a5dc4 100644 --- a/pxr/external/boost/python/converter/implicit.hpp +++ b/pxr/external/boost/python/converter/implicit.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_IMPLICIT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/extract.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct implicit @@ -52,7 +53,7 @@ struct implicit } }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_IMPLICIT_HPP diff --git a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp index 1de0bff48d..8751e92d36 100644 --- a/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp +++ b/pxr/external/boost/python/converter/obj_mgr_arg_from_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJ_MGR_ARG_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,7 +29,7 @@ // arg_from_python converters for Python type wrappers, to be used as // base classes for specializations. // -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct object_manager_value_arg_from_python @@ -127,7 +128,7 @@ inline Ref object_manager_ref_arg_from_python::operator()() const this->m_result.bytes, (Ref(*)())0); } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJ_MGR_ARG_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/object_manager.hpp b/pxr/external/boost/python/converter/object_manager.hpp index f6523930f4..e07c4c897d 100644 --- a/pxr/external/boost/python/converter/object_manager.hpp +++ b/pxr/external/boost/python/converter/object_manager.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJECT_MANAGER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -58,7 +59,7 @@ // * T(detail::borrowed_reference(p)) // Manages p without checking its type // -// * get_managed_object(x, boost::python::tag) +// * get_managed_object(x, PXR_BOOST_NAMESPACE::python::tag) // Convertible to PyObject* // // Additional requirements if T can be converted from_python: @@ -73,7 +74,7 @@ // Forward declarations // -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { @@ -81,7 +82,7 @@ namespace boost { namespace python } }} -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // Specializations for handle @@ -162,7 +163,7 @@ struct is_reference_to_object_manager { }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_OBJECT_MANAGER_HPP diff --git a/pxr/external/boost/python/converter/pointer_type_id.hpp b/pxr/external/boost/python/converter/pointer_type_id.hpp index e2eab5ebc6..fd8f5b8dc0 100644 --- a/pxr/external/boost/python/converter/pointer_type_id.hpp +++ b/pxr/external/boost/python/converter/pointer_type_id.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_POINTER_TYPE_ID_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/type_id.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { namespace detail { @@ -70,11 +71,11 @@ template type_info pointer_type_id(T(*)() = 0) { return detail::pointer_typeid_select< - boost::python::detail::is_lvalue_reference::value + PXR_BOOST_NAMESPACE::python::detail::is_lvalue_reference::value >::execute((T(*)())0); } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_POINTER_TYPE_ID_HPP diff --git a/pxr/external/boost/python/converter/pyobject_traits.hpp b/pxr/external/boost/python/converter/pyobject_traits.hpp index 421b5b9b4f..7d30cde5cd 100644 --- a/pxr/external/boost/python/converter/pyobject_traits.hpp +++ b/pxr/external/boost/python/converter/pyobject_traits.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/converter/pyobject_type.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct pyobject_traits; @@ -29,7 +30,7 @@ struct pyobject_traits // All objects are convertible to PyObject static bool check(PyObject*) { return true; } static PyObject* checked_downcast(PyObject* x) { return x; } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const* get_pytype() { return 0; } #endif }; @@ -38,21 +39,21 @@ struct pyobject_traits // Specializations // -# define BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(T) \ +# define PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(T) \ template <> struct pyobject_traits \ : pyobject_type {} // This is not an exhaustive list; should be expanded. -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Type); -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(List); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Type); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(List); #if PY_VERSION_HEX < 0x03000000 -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Int); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Int); #endif -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Long); -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Dict); -BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Tuple); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Long); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Dict); +PXR_BOOST_PYTHON_BUILTIN_OBJECT_TRAITS(Tuple); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TRAITS_HPP diff --git a/pxr/external/boost/python/converter/pyobject_type.hpp b/pxr/external/boost/python/converter/pyobject_type.hpp index d7529cb95c..1152e18ec7 100644 --- a/pxr/external/boost/python/converter/pyobject_type.hpp +++ b/pxr/external/boost/python/converter/pyobject_type.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,9 +19,9 @@ # include "pxr/external/boost/python/cast.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { -BOOST_PYTHON_DECL inline +PXR_BOOST_PYTHON_DECL inline PyObject* checked_downcast_impl(PyObject *obj, PyTypeObject *type) { return (PyType_IsSubtype(Py_TYPE(obj), type) ? obj : NULL); @@ -41,12 +42,12 @@ struct pyobject_type (checked_downcast_impl)(x, pytype) ); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const* get_pytype() { return pytype; } #endif }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYOBJECT_TYPE_HPP diff --git a/pxr/external/boost/python/converter/pytype_function.hpp b/pxr/external/boost/python/converter/pytype_function.hpp index a6154a0ba8..691ec498eb 100644 --- a/pxr/external/boost/python/converter/pytype_function.hpp +++ b/pxr/external/boost/python/converter/pytype_function.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { @@ -37,7 +38,7 @@ struct wrap_pytype typedef PyTypeObject const* (*pytype_function)(); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES @@ -54,7 +55,7 @@ struct unwind_type_id_helper{ template inline python::type_info unwind_type_id_(boost::type* = 0, mpl::false_ * =0) { - return boost::python::detail::unwind_type (); + return PXR_BOOST_NAMESPACE::python::detail::unwind_type (); } inline python::type_info unwind_type_id_(boost::type* = 0, mpl::true_* =0) @@ -65,7 +66,7 @@ inline python::type_info unwind_type_id_(boost::type* = 0, mpl::true_* =0) template inline python::type_info unwind_type_id(boost::type* p= 0) { - return unwind_type_id_(p, (mpl::bool_::value >*)0 ); + return unwind_type_id_(p, (mpl::bool_::value >*)0 ); } } @@ -76,7 +77,7 @@ struct expected_pytype_for_arg static PyTypeObject const *get_pytype() { const converter::registration *r=converter::registry::query( - detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) + detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) ); return r ? r->expected_from_python_type(): 0; } @@ -89,7 +90,7 @@ struct registered_pytype static PyTypeObject const *get_pytype() { const converter::registration *r=converter::registry::query( - detail::unwind_type_id_((boost::type*) 0, (mpl::bool_::value >*)0 ) + detail::unwind_type_id_((boost::type*) 0, (mpl::bool_::value >*)0 ) ); return r ? r->m_class_object: 0; } @@ -123,7 +124,7 @@ struct to_python_target_type static PyTypeObject const *get_pytype() { const converter::registration *r=converter::registry::query( - detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) + detail::unwind_type_id_((boost::type*)0, (mpl::bool_::value >*)0 ) ); return r ? r->to_python_target_type(): 0; } @@ -139,7 +140,7 @@ struct to_python_target_type_direct }; #endif -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_FUNCTION_HPP diff --git a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp index 542413cf7b..527f346121 100644 --- a/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp +++ b/pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_OBJECT_MGR_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/converter/pyobject_type.hpp" # include "pxr/external/boost/python/errors.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // Provide a forward declaration as a convenience for clients, who all // need it. @@ -48,7 +49,7 @@ inline python::detail::new_reference pytype_object_manager_traits::ado return python::detail::new_reference(python::pytype_check(pytype, x)); } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_PYTYPE_OBJECT_MGR_TRAITS_HPP diff --git a/pxr/external/boost/python/converter/registered.hpp b/pxr/external/boost/python/converter/registered.hpp index a46ad62fa8..99a02fbd83 100644 --- a/pxr/external/boost/python/converter/registered.hpp +++ b/pxr/external/boost/python/converter/registered.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -25,8 +26,8 @@ #include #include #include -#if defined(BOOST_PYTHON_TRACE_REGISTRY) \ - || defined(BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) +#if defined(PXR_BOOST_PYTHON_TRACE_REGISTRY) \ + || defined(PXR_BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) # include #endif @@ -37,6 +38,10 @@ namespace boost { // implement special shared_ptr handling for rvalue conversions. template class shared_ptr; +} + +namespace PXR_BOOST_NAMESPACE { + namespace python { namespace converter { struct registration; @@ -53,8 +58,8 @@ namespace detail template struct registered : detail::registered_base< - typename boost::python::detail::add_lvalue_reference< - typename boost::python::detail::add_cv::type + typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference< + typename PXR_BOOST_NAMESPACE::python::detail::add_cv::type >::type > { @@ -130,7 +135,7 @@ namespace detail } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/registered_pointee.hpp b/pxr/external/boost/python/converter/registered_pointee.hpp index 87ab90718b..224e2a504e 100644 --- a/pxr/external/boost/python/converter/registered_pointee.hpp +++ b/pxr/external/boost/python/converter/registered_pointee.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_POINTEE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,22 +21,22 @@ # include "pxr/external/boost/python/converter/registry.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { struct registration; template struct registered_pointee : registered< - typename boost::python::detail::remove_pointer< - typename boost::python::detail::remove_cv< - typename boost::python::detail::remove_reference::type + typename PXR_BOOST_NAMESPACE::python::detail::remove_pointer< + typename PXR_BOOST_NAMESPACE::python::detail::remove_cv< + typename PXR_BOOST_NAMESPACE::python::detail::remove_reference::type >::type >::type > { }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTERED_POINTEE_HPP diff --git a/pxr/external/boost/python/converter/registrations.hpp b/pxr/external/boost/python/converter/registrations.hpp index 6ccbc50097..b2befd023f 100644 --- a/pxr/external/boost/python/converter/registrations.hpp +++ b/pxr/external/boost/python/converter/registrations.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRATIONS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ # include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { struct lvalue_from_python_chain { @@ -42,7 +43,7 @@ struct rvalue_from_python_chain rvalue_from_python_chain* next; }; -struct BOOST_PYTHON_DECL registration +struct PXR_BOOST_PYTHON_DECL registration { public: // member functions explicit registration(type_info target, bool is_shared_ptr = false); @@ -105,7 +106,7 @@ inline bool operator<(registration const& lhs, registration const& rhs) return lhs.target_type < rhs.target_type; } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRATIONS_HPP diff --git a/pxr/external/boost/python/converter/registry.hpp b/pxr/external/boost/python/converter/registry.hpp index 2a93a82620..081386c35d 100644 --- a/pxr/external/boost/python/converter/registry.hpp +++ b/pxr/external/boost/python/converter/registry.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ # include "pxr/external/boost/python/converter/constructor_function.hpp" # include "pxr/external/boost/python/converter/convertible_function.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { struct registration; @@ -29,22 +30,22 @@ struct registration; namespace registry { // Get the registration corresponding to the type, creating it if necessary - BOOST_PYTHON_DECL registration const& lookup(type_info); + PXR_BOOST_PYTHON_DECL registration const& lookup(type_info); // Get the registration corresponding to the type, creating it if // necessary. Use this first when the type is a shared_ptr. - BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info); + PXR_BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info); // Return a pointer to the corresponding registration, if one exists - BOOST_PYTHON_DECL registration const* query(type_info); + PXR_BOOST_PYTHON_DECL registration const* query(type_info); - BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0); + PXR_BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0); // Insert an lvalue from_python converter - BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0); + PXR_BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0); // Insert an rvalue from_python converter - BOOST_PYTHON_DECL void insert( + PXR_BOOST_PYTHON_DECL void insert( convertible_function , constructor_function , type_info @@ -53,7 +54,7 @@ namespace registry // Insert an rvalue from_python converter at the tail of the // chain. Used for implicit conversions - BOOST_PYTHON_DECL void push_back( + PXR_BOOST_PYTHON_DECL void push_back( convertible_function , constructor_function , type_info @@ -61,7 +62,7 @@ namespace registry ); } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_REGISTRY_HPP diff --git a/pxr/external/boost/python/converter/return_from_python.hpp b/pxr/external/boost/python/converter/return_from_python.hpp index e84338dea3..4e211f345f 100644 --- a/pxr/external/boost/python/converter/return_from_python.hpp +++ b/pxr/external/boost/python/converter/return_from_python.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RETURN_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -29,7 +30,7 @@ # include # include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template struct is_object_manager; @@ -168,7 +169,7 @@ namespace detail } } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RETURN_FROM_PYTHON_HPP diff --git a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp index acc1cdd51a..483e932178 100644 --- a/pxr/external/boost/python/converter/rvalue_from_python_data.hpp +++ b/pxr/external/boost/python/converter/rvalue_from_python_data.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RVALUE_FROM_PYTHON_DATA_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -47,7 +48,7 @@ // references can bind to temporary rvalues, we allow rvalue // converters to be chosen when the target type is T const& for some // T. -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // Conversions begin by filling in and returning a copy of this // structure. The process looks up a converter in the rvalue converter @@ -89,7 +90,7 @@ struct rvalue_from_python_storage // Storage for the result, in case an rvalue must be constructed typename python::detail::referent_storage< - typename boost::python::detail::add_lvalue_reference::type + typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference::type >::type storage; }; @@ -105,9 +106,9 @@ struct rvalue_from_python_data : rvalue_from_python_storage # if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) \ && (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) \ && (!defined(__DECCXX_VER) || __DECCXX_VER > 60590014) \ - && !defined(BOOST_PYTHON_SYNOPSIS) /* Synopsis' OpenCXX has trouble parsing this */ + && !defined(PXR_BOOST_PYTHON_SYNOPSIS) /* Synopsis' OpenCXX has trouble parsing this */ // This must always be a POD struct with m_data its first member. - BOOST_STATIC_ASSERT(BOOST_PYTHON_OFFSETOF(rvalue_from_python_storage,stage1) == 0); + BOOST_STATIC_ASSERT(PXR_BOOST_PYTHON_OFFSETOF(rvalue_from_python_storage,stage1) == 0); # endif // The usual constructor @@ -121,8 +122,8 @@ struct rvalue_from_python_data : rvalue_from_python_storage // Destroys any object constructed in the storage. ~rvalue_from_python_data(); private: - typedef typename boost::python::detail::add_lvalue_reference< - typename boost::python::detail::add_cv::type>::type ref_type; + typedef typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference< + typename PXR_BOOST_NAMESPACE::python::detail::add_cv::type>::type ref_type; }; // @@ -148,12 +149,12 @@ inline rvalue_from_python_data::~rvalue_from_python_data() size_t allocated = sizeof(this->storage); void *ptr = this->storage.bytes; void *aligned_storage = - ::boost::alignment::align(boost::python::detail::alignment_of::value, 0, ptr, allocated); + ::boost::alignment::align(PXR_BOOST_NAMESPACE::python::detail::alignment_of::value, 0, ptr, allocated); python::detail::destroy_referent(aligned_storage); } } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_RVALUE_FROM_PYTHON_DATA_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp index 5e298b3cb9..dff2b9a029 100644 --- a/pxr/external/boost/python/converter/shared_ptr_deleter.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_deleter.hpp @@ -11,14 +11,15 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_DELETER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { -struct BOOST_PYTHON_DECL shared_ptr_deleter +struct PXR_BOOST_PYTHON_DECL shared_ptr_deleter { shared_ptr_deleter(handle<> owner); ~shared_ptr_deleter(); @@ -28,7 +29,7 @@ struct BOOST_PYTHON_DECL shared_ptr_deleter handle<> owner; }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_DELETER_HPP diff --git a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp index 0351df5579..7db164b9af 100644 --- a/pxr/external/boost/python/converter/shared_ptr_from_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_from_python.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_FROM_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,13 +24,13 @@ #include "pxr/external/boost/python/converter/from_python.hpp" #include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" #include "pxr/external/boost/python/converter/registered.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif #include #include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template class SP> struct shared_ptr_from_python @@ -37,7 +38,7 @@ struct shared_ptr_from_python shared_ptr_from_python() { converter::registry::insert(&convertible, &construct, type_id >() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &converter::expected_from_python_type_direct::get_pytype #endif ); @@ -75,7 +76,7 @@ struct shared_ptr_from_python } }; -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp index e77026e4a0..08a8c28a24 100644 --- a/pxr/external/boost/python/converter/shared_ptr_to_python.hpp +++ b/pxr/external/boost/python/converter/shared_ptr_to_python.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_SHARED_PTR_TO_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,11 @@ #include #include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { + using boost::get_pointer; // Enable ADL for boost types +} + +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { template PyObject* shared_ptr_to_python(shared_ptr const& x) @@ -49,7 +54,7 @@ PyObject* shared_ptr_to_python(std::shared_ptr const& x) } #endif -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/converter/to_python_function_type.hpp b/pxr/external/boost/python/converter/to_python_function_type.hpp index b551d4d6d1..c641ac6900 100644 --- a/pxr/external/boost/python/converter/to_python_function_type.hpp +++ b/pxr/external/boost/python/converter/to_python_function_type.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_TO_PYTHON_FUNCTION_TYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,14 +19,14 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // The type of stored function pointers which actually do conversion // by-value. The void* points to the object to be converted, and // type-safety is preserved through runtime registration. typedef PyObject* (*to_python_function_t)(void const*); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_CONVERTER_TO_PYTHON_FUNCTION_TYPE_HPP diff --git a/pxr/external/boost/python/copy_const_reference.hpp b/pxr/external/boost/python/copy_const_reference.hpp index 57982ea6b4..da71b05a90 100644 --- a/pxr/external/boost/python/copy_const_reference.hpp +++ b/pxr/external/boost/python/copy_const_reference.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_COPY_CONST_REFERENCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ # include # include "pxr/external/boost/python/to_python_value.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -49,7 +50,7 @@ struct copy_const_reference }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_COPY_CONST_REFERENCE_HPP diff --git a/pxr/external/boost/python/copy_non_const_reference.hpp b/pxr/external/boost/python/copy_non_const_reference.hpp index 0f70430a90..fe9ae1244a 100644 --- a/pxr/external/boost/python/copy_non_const_reference.hpp +++ b/pxr/external/boost/python/copy_non_const_reference.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_COPY_NON_CONST_REFERENCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ # include # include "pxr/external/boost/python/to_python_value.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -49,7 +50,7 @@ struct copy_non_const_reference }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_COPY_NON_CONST_REFERENCE_HPP diff --git a/pxr/external/boost/python/data_members.hpp b/pxr/external/boost/python/data_members.hpp index e1c78d4e67..675c07a373 100644 --- a/pxr/external/boost/python/data_members.hpp +++ b/pxr/external/boost/python/data_members.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DATA_MEMBERS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -38,7 +39,7 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // // This file defines the make_getter and make_setter function @@ -148,7 +149,7 @@ namespace detail // // make_getter helper function family -- These helpers to - // boost::python::make_getter are used to dispatch behavior. The + // PXR_BOOST_NAMESPACE::python::make_getter are used to dispatch behavior. The // third argument is a workaround for a CWPro8 partial ordering bug // with pointers to data members. It should be convertible to // detail::true_ iff the first argument is a pointer-to-member, and @@ -213,7 +214,7 @@ namespace detail // // make_setter helper function family -- These helpers to - // boost::python::make_setter are used to dispatch behavior. The + // PXR_BOOST_NAMESPACE::python::make_setter are used to dispatch behavior. The // third argument is for compilers which don't support partial // ordering at all and should always be passed 0. // @@ -317,7 +318,7 @@ inline object make_setter(D const& x) } # endif -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DATA_MEMBERS_HPP diff --git a/pxr/external/boost/python/def.hpp b/pxr/external/boost/python/def.hpp index 8a807b7254..59a8e2044d 100644 --- a/pxr/external/boost/python/def.hpp +++ b/pxr/external/boost/python/def.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DEF_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ # include "pxr/external/boost/python/signature.hpp" # include "pxr/external/boost/python/detail/scope.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -51,7 +52,7 @@ namespace detail >::type assertion BOOST_ATTRIBUTE_UNUSED; detail::scope_setattr_doc( - name, boost::python::make_function( + name, PXR_BOOST_NAMESPACE::python::make_function( fn , helper.policies() , helper.keywords()) @@ -62,7 +63,7 @@ namespace detail // // These two overloads discriminate between def() as applied to // regular functions and def() as applied to the result of - // BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to + // PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(). The final argument is used to // discriminate. // template @@ -120,7 +121,7 @@ void def(char const* name, F f, A1 const& a1, A2 const& a2, A3 const& a3) detail::def_from_helper(name, f, detail::def_helper(a1,a2,a3)); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEF_HPP diff --git a/pxr/external/boost/python/def_visitor.hpp b/pxr/external/boost/python/def_visitor.hpp index 7a0bd3f894..c8a53beafa 100644 --- a/pxr/external/boost/python/def_visitor.hpp +++ b/pxr/external/boost/python/def_visitor.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DEF_VISITOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class def_visitor; template class class_; @@ -92,7 +93,7 @@ class def_visitor } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEF_VISITOR_HPP diff --git a/pxr/external/boost/python/default_call_policies.hpp b/pxr/external/boost/python/default_call_policies.hpp index 87716d9aec..b14ed44314 100644 --- a/pxr/external/boost/python/default_call_policies.hpp +++ b/pxr/external/boost/python/default_call_policies.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DEFAULT_CALL_POLICIES_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,7 +25,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct to_python_value; @@ -75,7 +76,7 @@ struct default_result_converter typedef typename mpl::if_< mpl::or_, detail::is_reference > , detail::specify_a_return_value_policy_to_wrap_functions_returning - , boost::python::to_python_value< + , PXR_BOOST_NAMESPACE::python::to_python_value< typename detail::value_arg::type > >::type type; @@ -86,16 +87,16 @@ struct default_result_converter template <> struct default_result_converter::apply { - typedef boost::python::to_python_value type; + typedef PXR_BOOST_NAMESPACE::python::to_python_value type; }; template <> struct default_result_converter::apply { - typedef boost::python::to_python_value type; + typedef PXR_BOOST_NAMESPACE::python::to_python_value type; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DEFAULT_CALL_POLICIES_HPP diff --git a/pxr/external/boost/python/detail/aix_init_module.hpp b/pxr/external/boost/python/detail/aix_init_module.hpp index 46acb029a9..4cb9c2800a 100644 --- a/pxr/external/boost/python/detail/aix_init_module.hpp +++ b/pxr/external/boost/python/detail/aix_init_module.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_AIX_INIT_MODULE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include // this works around a problem in KCC 4.0f # endif -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { extern "C" { @@ -31,7 +32,7 @@ extern "C" void aix_init_module(so_load_function, char const* name, void (*init_module)()); -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail # endif #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/api_placeholder.hpp b/pxr/external/boost/python/detail/api_placeholder.hpp index 444c4572ce..99ae2c0de7 100644 --- a/pxr/external/boost/python/detail/api_placeholder.hpp +++ b/pxr/external/boost/python/detail/api_placeholder.hpp @@ -10,12 +10,13 @@ // DEPRECATED HEADER (2006 Jan 12) // Provided only for backward compatibility. -// The boost::python::len() function is now defined in object.hpp. +// The PXR_BOOST_NAMESPACE::python::len() function is now defined in object.hpp. #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_API_PLACEHOLDER_HPP #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_API_PLACEHOLDER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include diff --git a/pxr/external/boost/python/detail/borrowed_ptr.hpp b/pxr/external/boost/python/detail/borrowed_ptr.hpp index 6edf98e4f7..e7a02ae335 100644 --- a/pxr/external/boost/python/detail/borrowed_ptr.hpp +++ b/pxr/external/boost/python/detail/borrowed_ptr.hpp @@ -2,6 +2,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_BORROWED_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" # include "pxr/external/boost/python/tag.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template class borrowed { @@ -86,7 +87,7 @@ inline T* get_managed_object(detail::borrowed const volatile* p, tag_t) return (T*)p; } -}} // namespace boost::python::detail +}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // #ifndef PXR_EXTERNAL_BOOST_PYTHON_DETAIL_BORROWED_PTR_HPP diff --git a/pxr/external/boost/python/detail/caller.hpp b/pxr/external/boost/python/detail/caller.hpp index e466a2143f..9049bb418a 100644 --- a/pxr/external/boost/python/detail/caller.hpp +++ b/pxr/external/boost/python/detail/caller.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CALLER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -51,7 +52,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template inline PyObject* get(mpl::int_, PyObject* const& args_) @@ -102,7 +103,7 @@ inline ResultConverter create_result_converter( return ResultConverter(); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES template struct converter_target_type { @@ -145,22 +146,22 @@ template struct caller_arity; template struct caller; -# define BOOST_PYTHON_NEXT(init,name,n) \ +# define PXR_BOOST_PYTHON_NEXT(init,name,n) \ typedef BOOST_PP_IF(n,typename mpl::next< BOOST_PP_CAT(name,BOOST_PP_DEC(n)) >::type, init) name##n; -# define BOOST_PYTHON_ARG_CONVERTER(n) \ - BOOST_PYTHON_NEXT(typename mpl::next::type, arg_iter,n) \ +# define PXR_BOOST_PYTHON_ARG_CONVERTER(n) \ + PXR_BOOST_PYTHON_NEXT(typename mpl::next::type, arg_iter,n) \ typedef arg_from_python c_t##n; \ c_t##n c##n(get(mpl::int_(), inner_args)); \ if (!c##n.convertible()) \ return 0; # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY + 1, "pxr/external/boost/python/detail/caller.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY + 1, "pxr/external/boost/python/detail/caller.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_ARG_CONVERTER -# undef BOOST_PYTHON_NEXT +# undef PXR_BOOST_PYTHON_ARG_CONVERTER +# undef PXR_BOOST_PYTHON_NEXT // A metafunction returning the base class used for caller. @@ -203,7 +204,7 @@ struct caller }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CALLER_HPP @@ -233,7 +234,7 @@ struct caller_arity argument_package inner_args(args_); # if N -# define BOOST_PP_LOCAL_MACRO(i) BOOST_PYTHON_ARG_CONVERTER(i) +# define BOOST_PP_LOCAL_MACRO(i) PXR_BOOST_PYTHON_ARG_CONVERTER(i) # define BOOST_PP_LOCAL_LIMITS (0, N-1) # include BOOST_PP_LOCAL_ITERATE() # endif @@ -257,7 +258,7 @@ struct caller_arity static py_func_sig_info signature() { const signature_element * sig = detail::signature::elements(); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES // MSVC 15.7.2, when compiling to /O2 left the static const signature_element ret, // originally defined here, uninitialized. This in turn led to SegFault in Python interpreter. // Issue is resolved by moving the generation of ret to separate function in detail namespace (see above). diff --git a/pxr/external/boost/python/detail/config.hpp b/pxr/external/boost/python/detail/config.hpp index a0cb5feb03..6a373c3a40 100644 --- a/pxr/external/boost/python/detail/config.hpp +++ b/pxr/external/boost/python/detail/config.hpp @@ -18,6 +18,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONFIG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,15 +29,15 @@ # ifdef BOOST_NO_OPERATORS_IN_NAMESPACE // A gcc bug forces some symbols into the global namespace -# define BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE -# define BOOST_PYTHON_END_CONVERSION_NAMESPACE -# define BOOST_PYTHON_CONVERSION -# define BOOST_PYTHON_IMPORT_CONVERSION(x) using ::x +# define PXR_BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE +# define PXR_BOOST_PYTHON_END_CONVERSION_NAMESPACE +# define PXR_BOOST_PYTHON_CONVERSION +# define PXR_BOOST_PYTHON_IMPORT_CONVERSION(x) using ::x # else -# define BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE namespace boost { namespace python { -# define BOOST_PYTHON_END_CONVERSION_NAMESPACE }} // namespace boost::python -# define BOOST_PYTHON_CONVERSION boost::python -# define BOOST_PYTHON_IMPORT_CONVERSION(x) void never_defined() // so we can follow the macro with a ';' +# define PXR_BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE namespace PXR_BOOST_NAMESPACE { namespace python { +# define PXR_BOOST_PYTHON_END_CONVERSION_NAMESPACE }} // namespace PXR_BOOST_NAMESPACE::python +# define PXR_BOOST_PYTHON_CONVERSION PXR_BOOST_NAMESPACE::python +# define PXR_BOOST_PYTHON_IMPORT_CONVERSION(x) void never_defined() // so we can follow the macro with a ';' # endif # if defined(BOOST_MSVC) @@ -68,61 +69,61 @@ ****************************************************************************/ // backwards compatibility: -#ifdef BOOST_PYTHON_STATIC_LIB -# define BOOST_PYTHON_STATIC_LINK -# elif !defined(BOOST_PYTHON_DYNAMIC_LIB) -# define BOOST_PYTHON_DYNAMIC_LIB +#ifdef PXR_BOOST_PYTHON_STATIC_LIB +# define PXR_BOOST_PYTHON_STATIC_LINK +# elif !defined(PXR_BOOST_PYTHON_DYNAMIC_LIB) +# define PXR_BOOST_PYTHON_DYNAMIC_LIB #endif -#if defined(BOOST_PYTHON_DYNAMIC_LIB) +#if defined(PXR_BOOST_PYTHON_DYNAMIC_LIB) # if defined(BOOST_SYMBOL_EXPORT) -# if defined(BOOST_PYTHON_SOURCE) -# define BOOST_PYTHON_DECL BOOST_SYMBOL_EXPORT -# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT -# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT -# define BOOST_PYTHON_BUILD_DLL +# if defined(PXR_BOOST_PYTHON_SOURCE) +# define PXR_BOOST_PYTHON_DECL BOOST_SYMBOL_EXPORT +# define PXR_BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_EXPORT +# define PXR_BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_EXPORT +# define PXR_BOOST_PYTHON_BUILD_DLL # else -# define BOOST_PYTHON_DECL BOOST_SYMBOL_IMPORT -# define BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT -# define BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT +# define PXR_BOOST_PYTHON_DECL BOOST_SYMBOL_IMPORT +# define PXR_BOOST_PYTHON_DECL_FORWARD BOOST_SYMBOL_FORWARD_IMPORT +# define PXR_BOOST_PYTHON_DECL_EXCEPTION BOOST_EXCEPTION_IMPORT # endif # endif #endif -#ifndef BOOST_PYTHON_DECL -# define BOOST_PYTHON_DECL +#ifndef PXR_BOOST_PYTHON_DECL +# define PXR_BOOST_PYTHON_DECL #endif -#ifndef BOOST_PYTHON_DECL_FORWARD -# define BOOST_PYTHON_DECL_FORWARD +#ifndef PXR_BOOST_PYTHON_DECL_FORWARD +# define PXR_BOOST_PYTHON_DECL_FORWARD #endif -#ifndef BOOST_PYTHON_DECL_EXCEPTION -# define BOOST_PYTHON_DECL_EXCEPTION +#ifndef PXR_BOOST_PYTHON_DECL_EXCEPTION +# define PXR_BOOST_PYTHON_DECL_EXCEPTION #endif #if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) // Replace broken Tru64/cxx offsetof macro -# define BOOST_PYTHON_OFFSETOF(s_name, s_member) \ +# define PXR_BOOST_PYTHON_OFFSETOF(s_name, s_member) \ ((size_t)__INTADDR__(&(((s_name *)0)->s_member))) #else -# define BOOST_PYTHON_OFFSETOF offsetof +# define PXR_BOOST_PYTHON_OFFSETOF offsetof #endif // enable automatic library variant selection ------------------------------// -#if !defined(BOOST_PYTHON_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_PYTHON_NO_LIB) +#if !defined(PXR_BOOST_PYTHON_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(PXR_BOOST_PYTHON_NO_LIB) // // Set the name of our library, this will get undef'ed by auto_link.hpp // once it's done with it: // -#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m -#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) -#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_python, PY_MAJOR_VERSION, PY_MINOR_VERSION) +#define _PXR_BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define PXR_BOOST_PYTHON_CONCAT(N, M, m) _PXR_BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME PXR_BOOST_PYTHON_CONCAT(boost_python, PY_MAJOR_VERSION, PY_MINOR_VERSION) // // If we're importing code from a dll, then tell auto_link.hpp about it: // -#ifdef BOOST_PYTHON_DYNAMIC_LIB +#ifdef PXR_BOOST_PYTHON_DYNAMIC_LIB # define BOOST_DYN_LINK #endif // @@ -131,11 +132,11 @@ #include #endif // auto-linking disabled -#undef BOOST_PYTHON_CONCAT -#undef _BOOST_PYTHON_CONCAT +#undef PXR_BOOST_PYTHON_CONCAT +#undef _PXR_BOOST_PYTHON_CONCAT -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES -#define BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES +#define PXR_BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition #endif #if !defined(BOOST_ATTRIBUTE_UNUSED) && defined(__GNUC__) && (__GNUC__ >= 4) diff --git a/pxr/external/boost/python/detail/construct.hpp b/pxr/external/boost/python/detail/construct.hpp index f601ca1819..fe0a06c723 100644 --- a/pxr/external/boost/python/detail/construct.hpp +++ b/pxr/external/boost/python/detail/construct.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONSTRUCT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template void construct_pointee(void* storage, Arg& x, T const volatile*) @@ -42,7 +43,7 @@ void construct_referent(void* storage, Arg& x, T(*tag)() = 0) construct_referent_impl(storage, x, tag); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONSTRUCT_HPP diff --git a/pxr/external/boost/python/detail/convertible.hpp b/pxr/external/boost/python/detail/convertible.hpp index d09b9e1db4..119b88cbc3 100644 --- a/pxr/external/boost/python/detail/convertible.hpp +++ b/pxr/external/boost/python/detail/convertible.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONVERTIBLE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ // Supplies a runtime is_convertible check which can be used with tag // dispatching to work around the Metrowerks Pro7 limitation with boost/std::is_convertible -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { typedef char* yes_convertible; typedef int* no_convertible; @@ -44,7 +45,7 @@ struct convertible # endif }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CONVERTIBLE_HPP diff --git a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp index 2a3c5f290f..42bd509f2f 100644 --- a/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp +++ b/pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_COPY_CTOR_MUTATES_RHS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ #include "pxr/external/boost/python/detail/is_auto_ptr.hpp" #include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct copy_ctor_mutates_rhs @@ -27,7 +28,7 @@ struct copy_ctor_mutates_rhs { }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_COPY_CTOR_MUTATES_RHS_HPP diff --git a/pxr/external/boost/python/detail/cv_category.hpp b/pxr/external/boost/python/detail/cv_category.hpp index 1ed01a00ca..173149be9a 100644 --- a/pxr/external/boost/python/detail/cv_category.hpp +++ b/pxr/external/boost/python/detail/cv_category.hpp @@ -11,13 +11,14 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CV_CATEGORY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct cv_tag @@ -42,7 +43,7 @@ struct cv_category > type; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_CV_CATEGORY_HPP diff --git a/pxr/external/boost/python/detail/dealloc.hpp b/pxr/external/boost/python/detail/dealloc.hpp index 689b8aae43..8595236649 100644 --- a/pxr/external/boost/python/detail/dealloc.hpp +++ b/pxr/external/boost/python/detail/dealloc.hpp @@ -12,11 +12,12 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEALLOC_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { extern "C" { inline void dealloc(PyObject* self) @@ -24,6 +25,6 @@ namespace boost { namespace python { namespace detail { PyObject_Del(self); } } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEALLOC_HPP diff --git a/pxr/external/boost/python/detail/decorated_type_id.hpp b/pxr/external/boost/python/detail/decorated_type_id.hpp index 2c6546d2a4..020ce27c2b 100644 --- a/pxr/external/boost/python/detail/decorated_type_id.hpp +++ b/pxr/external/boost/python/detail/decorated_type_id.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECORATED_TYPE_ID_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,7 +21,7 @@ # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct decorated_type_info : totally_ordered { @@ -31,7 +32,7 @@ struct decorated_type_info : totally_ordered inline bool operator<(decorated_type_info const& rhs) const; inline bool operator==(decorated_type_info const& rhs) const; - friend BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); + friend PXR_BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); operator type_info const&() const; private: // type @@ -80,9 +81,9 @@ inline decorated_type_info::operator type_info const&() const return m_base_type; } -BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); +PXR_BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, decorated_type_info const&); -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECORATED_TYPE_ID_HPP diff --git a/pxr/external/boost/python/detail/decref_guard.hpp b/pxr/external/boost/python/detail/decref_guard.hpp index 69cc6a53e4..63f1c6c282 100644 --- a/pxr/external/boost/python/detail/decref_guard.hpp +++ b/pxr/external/boost/python/detail/decref_guard.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECREF_GUARD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct decref_guard { @@ -27,7 +28,7 @@ struct decref_guard PyObject* obj; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DECREF_GUARD_HPP diff --git a/pxr/external/boost/python/detail/def_helper.hpp b/pxr/external/boost/python/detail/def_helper.hpp index da77aacd3a..f8bed4faac 100644 --- a/pxr/external/boost/python/detail/def_helper.hpp +++ b/pxr/external/boost/python/detail/def_helper.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,7 +29,7 @@ # include "pxr/external/boost/python/detail/not_specified.hpp" # include "pxr/external/boost/python/detail/def_helper_fwd.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { struct default_call_policies; @@ -217,7 +218,7 @@ namespace detail }; } -}} // namespace boost::python::detail +}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_HPP diff --git a/pxr/external/boost/python/detail/def_helper_fwd.hpp b/pxr/external/boost/python/detail/def_helper_fwd.hpp index d6ec6d518d..84afd8a1a6 100644 --- a/pxr/external/boost/python/detail/def_helper_fwd.hpp +++ b/pxr/external/boost/python/detail/def_helper_fwd.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,12 +19,12 @@ # include "pxr/external/boost/python/detail/not_specified.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct def_helper; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEF_HELPER_FWD_HPP diff --git a/pxr/external/boost/python/detail/defaults_def.hpp b/pxr/external/boost/python/detail/defaults_def.hpp index 56f6f4788a..3fbc2abe5f 100644 --- a/pxr/external/boost/python/detail/defaults_def.hpp +++ b/pxr/external/boost/python/detail/defaults_def.hpp @@ -16,6 +16,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_DEF_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -35,7 +36,7 @@ #include "pxr/external/boost/python/object/add_to_namespace.hpp" /////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { struct module; @@ -120,7 +121,7 @@ namespace detail // name_space.def(name, &OverloadsT::func_N); // } // - // where N runs from 0 to BOOST_PYTHON_MAX_ARITY. + // where N runs from 0 to PXR_BOOST_PYTHON_MAX_ARITY. // // The set of overloaded functions (define_stub_function) expects: // @@ -136,7 +137,7 @@ namespace detail struct define_stub_function {}; #define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/defaults_def.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/defaults_def.hpp")) #include BOOST_PP_ITERATE() @@ -268,7 +269,7 @@ namespace detail } // namespace detail -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_DEF_HPP diff --git a/pxr/external/boost/python/detail/defaults_gen.hpp b/pxr/external/boost/python/detail/defaults_gen.hpp index 60b64ab35e..0d82ecd2b8 100644 --- a/pxr/external/boost/python/detail/defaults_gen.hpp +++ b/pxr/external/boost/python/detail/defaults_gen.hpp @@ -14,6 +14,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEFAULTS_GEN_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -38,7 +39,7 @@ #include #include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -123,16 +124,16 @@ namespace detail } }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail -#define BOOST_PYTHON_TYPEDEF_GEN(z, index, data) \ +#define PXR_BOOST_PYTHON_TYPEDEF_GEN(z, index, data) \ typedef typename ::boost::mpl::next::type \ BOOST_PP_CAT(iter, BOOST_PP_INC(index)); \ typedef typename ::boost::mpl::deref::type \ BOOST_PP_CAT(T, index); -#define BOOST_PYTHON_FUNC_WRAPPER_GEN(z, index, data) \ +#define PXR_BOOST_PYTHON_FUNC_WRAPPER_GEN(z, index, data) \ static RT BOOST_PP_CAT(func_, \ BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ BOOST_PP_ENUM_BINARY_PARAMS_Z( \ @@ -145,7 +146,7 @@ namespace detail arg)); \ } -#define BOOST_PYTHON_GEN_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ +#define PXR_BOOST_PYTHON_GEN_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ struct fstubs_name \ { \ BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ @@ -160,19 +161,19 @@ namespace detail \ BOOST_PP_REPEAT_2ND( \ n_args, \ - BOOST_PYTHON_TYPEDEF_GEN, \ + PXR_BOOST_PYTHON_TYPEDEF_GEN, \ 0) \ \ BOOST_PP_REPEAT_FROM_TO_2( \ BOOST_PP_SUB_D(1, n_args, n_dflts), \ BOOST_PP_INC(n_args), \ - BOOST_PYTHON_FUNC_WRAPPER_GEN, \ + PXR_BOOST_PYTHON_FUNC_WRAPPER_GEN, \ (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ }; \ }; \ /////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN(z, index, data) \ +#define PXR_BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN(z, index, data) \ static RT BOOST_PP_CAT(func_, \ BOOST_PP_SUB_D(1, index, BOOST_PP_TUPLE_ELEM(3, 1, data))) ( \ ClassT obj BOOST_PP_COMMA_IF(index) \ @@ -184,7 +185,7 @@ namespace detail ); \ } -#define BOOST_PYTHON_GEN_MEM_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ +#define PXR_BOOST_PYTHON_GEN_MEM_FUNCTION(fname, fstubs_name, n_args, n_dflts, ret) \ struct fstubs_name \ { \ BOOST_STATIC_CONSTANT(int, n_funcs = BOOST_PP_INC(n_dflts)); \ @@ -202,88 +203,88 @@ namespace detail \ BOOST_PP_REPEAT_2ND( \ n_args, \ - BOOST_PYTHON_TYPEDEF_GEN, \ + PXR_BOOST_PYTHON_TYPEDEF_GEN, \ 0) \ \ BOOST_PP_REPEAT_FROM_TO_2( \ BOOST_PP_SUB_D(1, n_args, n_dflts), \ BOOST_PP_INC(n_args), \ - BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN, \ + PXR_BOOST_PYTHON_MEM_FUNC_WRAPPER_GEN, \ (fname, BOOST_PP_SUB_D(1, n_args, n_dflts), ret)) \ }; \ }; -#define BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ +#define PXR_BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ fstubs_name(char const* doc = 0) \ - : ::boost::python::detail::overloads_common(doc) {} \ + : ::PXR_BOOST_NAMESPACE::python::detail::overloads_common(doc) {} \ template \ - fstubs_name(char const* doc, ::boost::python::detail::keywords const& keywords) \ - : ::boost::python::detail::overloads_common( \ + fstubs_name(char const* doc, ::PXR_BOOST_NAMESPACE::python::detail::keywords const& keywords) \ + : ::PXR_BOOST_NAMESPACE::python::detail::overloads_common( \ doc, keywords.range()) \ { \ - typedef typename ::boost::python::detail:: \ + typedef typename ::PXR_BOOST_NAMESPACE::python::detail:: \ error::more_keywords_than_function_arguments< \ N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ } \ template \ - fstubs_name(::boost::python::detail::keywords const& keywords, char const* doc = 0) \ - : ::boost::python::detail::overloads_common( \ + fstubs_name(::PXR_BOOST_NAMESPACE::python::detail::keywords const& keywords, char const* doc = 0) \ + : ::PXR_BOOST_NAMESPACE::python::detail::overloads_common( \ doc, keywords.range()) \ { \ - typedef typename ::boost::python::detail:: \ + typedef typename ::PXR_BOOST_NAMESPACE::python::detail:: \ error::more_keywords_than_function_arguments< \ N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ } # if defined(BOOST_NO_VOID_RETURNS) -# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ +# define PXR_BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ struct fstubs_name \ - : public ::boost::python::detail::overloads_common \ + : public ::PXR_BOOST_NAMESPACE::python::detail::overloads_common \ { \ - BOOST_PYTHON_GEN_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_FUNCTION( \ fname, non_void_return_type, n_args, n_dflts, return) \ - BOOST_PYTHON_GEN_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_FUNCTION( \ fname, void_return_type, n_args, n_dflts, ;) \ \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ + PXR_BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ }; -# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ +# define PXR_BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ struct fstubs_name \ - : public ::boost::python::detail::overloads_common \ + : public ::PXR_BOOST_NAMESPACE::python::detail::overloads_common \ { \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_MEM_FUNCTION( \ fname, non_void_return_type, n_args, n_dflts, return) \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_MEM_FUNCTION( \ fname, void_return_type, n_args, n_dflts, ;) \ \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ + PXR_BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ }; # else // !defined(BOOST_NO_VOID_RETURNS) -# define BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ +# define PXR_BOOST_PYTHON_GEN_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ struct fstubs_name \ - : public ::boost::python::detail::overloads_common \ + : public ::PXR_BOOST_NAMESPACE::python::detail::overloads_common \ { \ - BOOST_PYTHON_GEN_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_FUNCTION( \ fname, non_void_return_type, n_args, n_dflts, return) \ \ typedef non_void_return_type void_return_type; \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ + PXR_BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args, n_dflts) \ }; -# define BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ +# define PXR_BOOST_PYTHON_GEN_MEM_FUNCTION_STUB(fname, fstubs_name, n_args, n_dflts) \ struct fstubs_name \ - : public ::boost::python::detail::overloads_common \ + : public ::PXR_BOOST_NAMESPACE::python::detail::overloads_common \ { \ - BOOST_PYTHON_GEN_MEM_FUNCTION( \ + PXR_BOOST_PYTHON_GEN_MEM_FUNCTION( \ fname, non_void_return_type, n_args, n_dflts, return) \ \ typedef non_void_return_type void_return_type; \ - BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ + PXR_BOOST_PYTHON_OVERLOAD_CONSTRUCTORS(fstubs_name, n_args + 1, n_dflts) \ }; # endif // !defined(BOOST_NO_VOID_RETURNS) @@ -300,8 +301,8 @@ namespace detail // // There are two versions: // -// 1. BOOST_PYTHON_FUNCTION_OVERLOADS for free functions -// 2. BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS for member functions. +// 1. PXR_BOOST_PYTHON_FUNCTION_OVERLOADS for free functions +// 2. PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS for member functions. // // For instance, given a function: // @@ -313,7 +314,7 @@ namespace detail // // The macro invocation: // -// BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) +// PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) // // Generates this code: // @@ -352,13 +353,13 @@ namespace detail // }; // // struct foo_overloads -// : public boost::python::detail::overloads_common +// : public PXR_BOOST_NAMESPACE::python::detail::overloads_common // { // typedef foo_overloadsNonVoid non_void_return_type; // typedef foo_overloadsNonVoid void_return_type; // // foo_overloads(char const* doc = 0) -// : boost::python::detail::overloads_common(doc) {} +// : PXR_BOOST_NAMESPACE::python::detail::overloads_common(doc) {} // }; // // The typedefs non_void_return_type and void_return_type are @@ -374,23 +375,23 @@ namespace detail // foo_overloads' base class. // /////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ - BOOST_PYTHON_GEN_FUNCTION_STUB( \ +#define PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ + PXR_BOOST_PYTHON_GEN_FUNCTION_STUB( \ fname, \ generator_name, \ max_args, \ BOOST_PP_SUB_D(1, max_args, min_args)) -#define BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ - BOOST_PYTHON_GEN_MEM_FUNCTION_STUB( \ +#define PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \ + PXR_BOOST_PYTHON_GEN_MEM_FUNCTION_STUB( \ fname, \ generator_name, \ max_args, \ BOOST_PP_SUB_D(1, max_args, min_args)) // deprecated macro names (to be removed) -#define BOOST_PYTHON_FUNCTION_GENERATOR BOOST_PYTHON_FUNCTION_OVERLOADS -#define BOOST_PYTHON_MEM_FUN_GENERATOR BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS +#define PXR_BOOST_PYTHON_FUNCTION_GENERATOR PXR_BOOST_PYTHON_FUNCTION_OVERLOADS +#define PXR_BOOST_PYTHON_MEM_FUN_GENERATOR PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS /////////////////////////////////////////////////////////////////////////////// #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/dependent.hpp b/pxr/external/boost/python/detail/dependent.hpp index 51dd67d229..25bfa6592a 100644 --- a/pxr/external/boost/python/detail/dependent.hpp +++ b/pxr/external/boost/python/detail/dependent.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEPENDENT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // A way to turn a concrete type T into a type dependent on U. This // keeps conforming compilers (those implementing proper 2-phase @@ -33,7 +34,7 @@ struct dependent typedef T type; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DEPENDENT_HPP diff --git a/pxr/external/boost/python/detail/destroy.hpp b/pxr/external/boost/python/detail/destroy.hpp index e84ee55ae7..c24a1f3ef2 100644 --- a/pxr/external/boost/python/detail/destroy.hpp +++ b/pxr/external/boost/python/detail/destroy.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DESTROY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct value_destroyer; @@ -69,7 +70,7 @@ inline void destroy_referent(void* p, T(*)() = 0) destroy_referent_impl(p, (T(*)())0); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_DESTROY_HPP diff --git a/pxr/external/boost/python/detail/enable_if.hpp b/pxr/external/boost/python/detail/enable_if.hpp index a055f5e3a4..999e1e7eaa 100644 --- a/pxr/external/boost/python/detail/enable_if.hpp +++ b/pxr/external/boost/python/detail/enable_if.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_ENABLE_IF_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ #if !defined(BOOST_NO_SFINAE) # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct enable_if_arg @@ -43,7 +44,7 @@ struct disable_if_ret : disable_if {}; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail # endif diff --git a/pxr/external/boost/python/detail/exception_handler.hpp b/pxr/external/boost/python/detail/exception_handler.hpp index d0945a207f..61b3f28fc0 100644 --- a/pxr/external/boost/python/detail/exception_handler.hpp +++ b/pxr/external/boost/python/detail/exception_handler.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_EXCEPTION_HANDLER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,13 +21,13 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct exception_handler; typedef function2 const&> handler_function; -struct BOOST_PYTHON_DECL exception_handler +struct PXR_BOOST_PYTHON_DECL exception_handler { private: // types @@ -52,9 +53,9 @@ inline bool exception_handler::handle(function0 const& f) const return this->m_impl(*this, f); } -BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f); +PXR_BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f); -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_EXCEPTION_HANDLER_HPP diff --git a/pxr/external/boost/python/detail/force_instantiate.hpp b/pxr/external/boost/python/detail/force_instantiate.hpp index 48897043ae..04b45ceeee 100644 --- a/pxr/external/boost/python/detail/force_instantiate.hpp +++ b/pxr/external/boost/python/detail/force_instantiate.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_FORCE_INSTANTIATE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // Allows us to force the argument to be instantiated without // incurring unused variable warnings @@ -24,7 +25,7 @@ namespace boost { namespace python { namespace detail { template inline void force_instantiate(T const&) {} -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_FORCE_INSTANTIATE_HPP diff --git a/pxr/external/boost/python/detail/if_else.hpp b/pxr/external/boost/python/detail/if_else.hpp index 7f537ffef7..cc8902a858 100644 --- a/pxr/external/boost/python/detail/if_else.hpp +++ b/pxr/external/boost/python/detail/if_else.hpp @@ -11,13 +11,14 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IF_ELSE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct elif_selected; @@ -87,7 +88,7 @@ struct if_ }; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IF_ELSE_HPP diff --git a/pxr/external/boost/python/detail/indirect_traits.hpp b/pxr/external/boost/python/detail/indirect_traits.hpp index 9808fd69d8..ab0cd31d18 100644 --- a/pxr/external/boost/python/detail/indirect_traits.hpp +++ b/pxr/external/boost/python/detail/indirect_traits.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INDIRECT_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -17,9 +18,9 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace indirect_traits = boost::detail::indirect_traits; -}} // namespace boost::python::detail +}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INDIRECT_TRAITS_HPP diff --git a/pxr/external/boost/python/detail/invoke.hpp b/pxr/external/boost/python/detail/invoke.hpp index 1a857b6e1e..c914d4e300 100644 --- a/pxr/external/boost/python/detail/invoke.hpp +++ b/pxr/external/boost/python/detail/invoke.hpp @@ -13,6 +13,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INVOKE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -47,7 +48,7 @@ // - The arg_from_python converters for each of the arguments to be // passed to the function being invoked. -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // This "result converter" is really just used as a dispatch tag to // invoke(...), selecting the appropriate implementation @@ -68,10 +69,10 @@ struct invoke_tag }; # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/invoke.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/invoke.hpp")) # include BOOST_PP_ITERATE() -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_INVOKE_HPP diff --git a/pxr/external/boost/python/detail/is_auto_ptr.hpp b/pxr/external/boost/python/detail/is_auto_ptr.hpp index e9d224402a..8c92fbf373 100644 --- a/pxr/external/boost/python/detail/is_auto_ptr.hpp +++ b/pxr/external/boost/python/detail/is_auto_ptr.hpp @@ -11,20 +11,21 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else #include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct is_auto_ptr : std::false_type { }; - -}}} // namespace boost::python::detail + +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_AUTO_PTR_HPP diff --git a/pxr/external/boost/python/detail/is_shared_ptr.hpp b/pxr/external/boost/python/detail/is_shared_ptr.hpp index 83735a3d97..d523f150a8 100644 --- a/pxr/external/boost/python/detail/is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/is_shared_ptr.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_SHARED_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,15 +22,15 @@ #include "pxr/external/boost/python/detail/is_xxx.hpp" #include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { -BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1) +PXR_BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1) #if !defined(BOOST_NO_CXX11_SMART_PTR) template struct is_shared_ptr > : std::true_type {}; #endif -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/detail/is_wrapper.hpp b/pxr/external/boost/python/detail/is_wrapper.hpp index ec607da69d..e6a3a85ba9 100644 --- a/pxr/external/boost/python/detail/is_wrapper.hpp +++ b/pxr/external/boost/python/detail/is_wrapper.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_WRAPPER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class wrapper; @@ -35,7 +36,7 @@ namespace detail : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)> {}; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_WRAPPER_HPP diff --git a/pxr/external/boost/python/detail/is_xxx.hpp b/pxr/external/boost/python/detail/is_xxx.hpp index 79c549c982..0c5a2c189f 100644 --- a/pxr/external/boost/python/detail/is_xxx.hpp +++ b/pxr/external/boost/python/detail/is_xxx.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_IS_XXX_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include -# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ +# define PXR_BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \ BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp index e32df5143d..657df9eda5 100644 --- a/pxr/external/boost/python/detail/make_keyword_range_fn.hpp +++ b/pxr/external/boost/python/detail/make_keyword_range_fn.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAKE_KEYWORD_RANGE_FN_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,7 +25,7 @@ # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // Think of this as a version of make_function without a compile-time // check that the size of kw is no greater than the expected arity of @@ -68,7 +69,7 @@ object make_keyword_range_constructor( , Holder* = 0 , ArgList* = 0, Arity* = 0) { -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) +#if !defined( PXR_BOOST_PYTHON_NO_PY_SIGNATURES) && defined( PXR_BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) python_class::register_(); #endif return detail::make_keyword_range_function( @@ -78,7 +79,7 @@ object make_keyword_range_constructor( , kw); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAKE_KEYWORD_RANGE_FN_HPP diff --git a/pxr/external/boost/python/detail/make_tuple.hpp b/pxr/external/boost/python/detail/make_tuple.hpp index 6888a177e8..9f04b10629 100644 --- a/pxr/external/boost/python/detail/make_tuple.hpp +++ b/pxr/external/boost/python/detail/make_tuple.hpp @@ -1,4 +1,4 @@ -# ifndef BOOST_PYTHON_SYNOPSIS +# ifndef PXR_BOOST_PYTHON_SYNOPSIS # // # // Copyright 2024 Pixar # // Licensed under the terms set forth in the LICENSE.txt file available at @@ -15,7 +15,7 @@ # define N BOOST_PP_ITERATION() -# define BOOST_PYTHON_MAKE_TUPLE_ARG(z, N, ignored) \ +# define PXR_BOOST_PYTHON_MAKE_TUPLE_ARG(z, N, ignored) \ PyTuple_SET_ITEM( \ result.ptr() \ , N \ @@ -27,11 +27,11 @@ make_tuple(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a)) { tuple result((detail::new_reference)::PyTuple_New(N)); - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_MAKE_TUPLE_ARG, _) + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_MAKE_TUPLE_ARG, _) return result; } -# undef BOOST_PYTHON_MAKE_TUPLE_ARG +# undef PXR_BOOST_PYTHON_MAKE_TUPLE_ARG # undef N -# endif // BOOST_PYTHON_SYNOPSIS +# endif // PXR_BOOST_PYTHON_SYNOPSIS diff --git a/pxr/external/boost/python/detail/map_entry.hpp b/pxr/external/boost/python/detail/map_entry.hpp index c68ff2b6e4..e3629775ab 100644 --- a/pxr/external/boost/python/detail/map_entry.hpp +++ b/pxr/external/boost/python/detail/map_entry.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAP_ENTRY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // A trivial type that works well as the value_type of associative // vector maps @@ -49,7 +50,7 @@ bool operator<(Key const& k, map_entry const& e) } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MAP_ENTRY_HPP diff --git a/pxr/external/boost/python/detail/mpl_lambda.hpp b/pxr/external/boost/python/detail/mpl_lambda.hpp index 4e49a7e0e3..e3bb411591 100644 --- a/pxr/external/boost/python/detail/mpl_lambda.hpp +++ b/pxr/external/boost/python/detail/mpl_lambda.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MPL_LAMBDA_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ // this header should go away soon # include -# define BOOST_PYTHON_MPL_LAMBDA_SUPPORT BOOST_MPL_AUX_LAMBDA_SUPPORT +# define PXR_BOOST_PYTHON_MPL_LAMBDA_SUPPORT BOOST_MPL_AUX_LAMBDA_SUPPORT #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MPL_LAMBDA_HPP diff --git a/pxr/external/boost/python/detail/msvc_typeinfo.hpp b/pxr/external/boost/python/detail/msvc_typeinfo.hpp index 4b9c567320..a532748e1e 100644 --- a/pxr/external/boost/python/detail/msvc_typeinfo.hpp +++ b/pxr/external/boost/python/detail/msvc_typeinfo.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_MSVC_TYPEINFO_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -31,7 +32,7 @@ # if defined(BOOST_INTEL_CXX_VERSION) && BOOST_INTEL_CXX_VERSION <= 700 -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { typedef std::type_info const& typeinfo; @@ -89,7 +90,7 @@ inline typeinfo assert_array_typeid_compiles() } # endif -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail # endif // BOOST_INTEL_CXX_VERSION #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/none.hpp b/pxr/external/boost/python/detail/none.hpp index add01501f1..dcd8d476e5 100644 --- a/pxr/external/boost/python/detail/none.hpp +++ b/pxr/external/boost/python/detail/none.hpp @@ -15,6 +15,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NONE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,11 +23,11 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { inline PyObject* none() { Py_INCREF(Py_None); return Py_None; } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NONE_HPP diff --git a/pxr/external/boost/python/detail/not_specified.hpp b/pxr/external/boost/python/detail/not_specified.hpp index 711bdca107..9587c9a030 100644 --- a/pxr/external/boost/python/detail/not_specified.hpp +++ b/pxr/external/boost/python/detail/not_specified.hpp @@ -11,16 +11,17 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NOT_SPECIFIED_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct not_specified {}; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NOT_SPECIFIED_HPP diff --git a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp index 245c29f59b..8e4370e1f5 100644 --- a/pxr/external/boost/python/detail/nullary_function_adaptor.hpp +++ b/pxr/external/boost/python/detail/nullary_function_adaptor.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NULLARY_FUNCTION_ADAPTOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // nullary_function_adaptor -- a class template which ignores its // arguments and calls a nullary function instead. Used for building @@ -45,14 +46,14 @@ struct nullary_function_adaptor m_fn(); \ } -# define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY) +# define BOOST_PP_LOCAL_LIMITS (1, PXR_BOOST_PYTHON_MAX_ARITY) # include BOOST_PP_LOCAL_ITERATE() private: NullaryFunction m_fn; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_NULLARY_FUNCTION_ADAPTOR_HPP diff --git a/pxr/external/boost/python/detail/operator_id.hpp b/pxr/external/boost/python/detail/operator_id.hpp index 3e642340fb..616a8a14e4 100644 --- a/pxr/external/boost/python/detail/operator_id.hpp +++ b/pxr/external/boost/python/detail/operator_id.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OPERATOR_ID_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { enum operator_id { @@ -69,7 +70,7 @@ enum operator_id #endif }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OPERATOR_ID_HPP diff --git a/pxr/external/boost/python/detail/overloads_fwd.hpp b/pxr/external/boost/python/detail/overloads_fwd.hpp index 561cac84d7..8219243724 100644 --- a/pxr/external/boost/python/detail/overloads_fwd.hpp +++ b/pxr/external/boost/python/detail/overloads_fwd.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OVERLOADS_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // forward declarations struct overloads_base; @@ -24,7 +25,7 @@ struct overloads_base; template inline void define_with_defaults(char const* name, OverloadsT const&, NameSpaceT&, SigT const&); -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_OVERLOADS_FWD_HPP diff --git a/pxr/external/boost/python/detail/pointee.hpp b/pxr/external/boost/python/detail/pointee.hpp index a79b5de19d..29c2f0902d 100644 --- a/pxr/external/boost/python/detail/pointee.hpp +++ b/pxr/external/boost/python/detail/pointee.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_POINTEE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct pointee_impl @@ -41,7 +42,7 @@ struct pointee { }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_POINTEE_HPP diff --git a/pxr/external/boost/python/detail/prefix.hpp b/pxr/external/boost/python/detail/prefix.hpp index 296c1eb6da..cb0404fb6b 100644 --- a/pxr/external/boost/python/detail/prefix.hpp +++ b/pxr/external/boost/python/detail/prefix.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREFIX_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include diff --git a/pxr/external/boost/python/detail/preprocessor.hpp b/pxr/external/boost/python/detail/preprocessor.hpp index 3034a1a211..8055d428f0 100644 --- a/pxr/external/boost/python/detail/preprocessor.hpp +++ b/pxr/external/boost/python/detail/preprocessor.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREPROCESSOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,56 +24,56 @@ // stuff that should be in the preprocessor library -# define BOOST_PYTHON_APPLY(x) BOOST_PP_CAT(BOOST_PYTHON_APPLY_, x) +# define PXR_BOOST_PYTHON_APPLY(x) BOOST_PP_CAT(PXR_BOOST_PYTHON_APPLY_, x) -# define BOOST_PYTHON_APPLY_BOOST_PYTHON_ITEM(v) v -# define BOOST_PYTHON_APPLY_BOOST_PYTHON_NIL +# define PXR_BOOST_PYTHON_APPLY_PXR_BOOST_PYTHON_ITEM(v) v +# define PXR_BOOST_PYTHON_APPLY_PXR_BOOST_PYTHON_NIL // cv-qualifiers # if !defined(__MWERKS__) || __MWERKS__ > 0x2407 -# define BOOST_PYTHON_CV_COUNT 4 +# define PXR_BOOST_PYTHON_CV_COUNT 4 # else -# define BOOST_PYTHON_CV_COUNT 1 +# define PXR_BOOST_PYTHON_CV_COUNT 1 # endif -# ifndef BOOST_PYTHON_MAX_ARITY -# define BOOST_PYTHON_MAX_ARITY 15 +# ifndef PXR_BOOST_PYTHON_MAX_ARITY +# define PXR_BOOST_PYTHON_MAX_ARITY 15 # endif -# ifndef BOOST_PYTHON_MAX_BASES -# define BOOST_PYTHON_MAX_BASES 10 +# ifndef PXR_BOOST_PYTHON_MAX_BASES +# define PXR_BOOST_PYTHON_MAX_BASES 10 # endif -# define BOOST_PYTHON_CV_QUALIFIER(i) \ - BOOST_PYTHON_APPLY( \ - BOOST_PP_TUPLE_ELEM(4, i, BOOST_PYTHON_CV_QUALIFIER_I) \ +# define PXR_BOOST_PYTHON_CV_QUALIFIER(i) \ + PXR_BOOST_PYTHON_APPLY( \ + BOOST_PP_TUPLE_ELEM(4, i, PXR_BOOST_PYTHON_CV_QUALIFIER_I) \ ) -# define BOOST_PYTHON_CV_QUALIFIER_I \ +# define PXR_BOOST_PYTHON_CV_QUALIFIER_I \ ( \ - BOOST_PYTHON_NIL, \ - BOOST_PYTHON_ITEM(const), \ - BOOST_PYTHON_ITEM(volatile), \ - BOOST_PYTHON_ITEM(const volatile) \ + PXR_BOOST_PYTHON_NIL, \ + PXR_BOOST_PYTHON_ITEM(const), \ + PXR_BOOST_PYTHON_ITEM(volatile), \ + PXR_BOOST_PYTHON_ITEM(const volatile) \ ) // enumerators -# define BOOST_PYTHON_UNARY_ENUM(c, text) BOOST_PP_REPEAT(c, BOOST_PYTHON_UNARY_ENUM_I, text) -# define BOOST_PYTHON_UNARY_ENUM_I(z, n, text) BOOST_PP_COMMA_IF(n) text ## n +# define PXR_BOOST_PYTHON_UNARY_ENUM(c, text) BOOST_PP_REPEAT(c, PXR_BOOST_PYTHON_UNARY_ENUM_I, text) +# define PXR_BOOST_PYTHON_UNARY_ENUM_I(z, n, text) BOOST_PP_COMMA_IF(n) text ## n -# define BOOST_PYTHON_BINARY_ENUM(c, a, b) BOOST_PP_REPEAT(c, BOOST_PYTHON_BINARY_ENUM_I, (a, b)) -# define BOOST_PYTHON_BINARY_ENUM_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, _), n) +# define PXR_BOOST_PYTHON_BINARY_ENUM(c, a, b) BOOST_PP_REPEAT(c, PXR_BOOST_PYTHON_BINARY_ENUM_I, (a, b)) +# define PXR_BOOST_PYTHON_BINARY_ENUM_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, _), n) -# define BOOST_PYTHON_ENUM_WITH_DEFAULT(c, text, def) BOOST_PP_REPEAT(c, BOOST_PYTHON_ENUM_WITH_DEFAULT_I, (text, def)) -# define BOOST_PYTHON_ENUM_WITH_DEFAULT_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) = BOOST_PP_TUPLE_ELEM(2, 1, _) +# define PXR_BOOST_PYTHON_ENUM_WITH_DEFAULT(c, text, def) BOOST_PP_REPEAT(c, PXR_BOOST_PYTHON_ENUM_WITH_DEFAULT_I, (text, def)) +# define PXR_BOOST_PYTHON_ENUM_WITH_DEFAULT_I(z, n, _) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, _), n) = BOOST_PP_TUPLE_ELEM(2, 1, _) // fixed text (no commas) -# define BOOST_PYTHON_FIXED(z, n, text) text +# define PXR_BOOST_PYTHON_FIXED(z, n, text) text // flags -# define BOOST_PYTHON_FUNCTION_POINTER 0x0001 -# define BOOST_PYTHON_POINTER_TO_MEMBER 0x0002 +# define PXR_BOOST_PYTHON_FUNCTION_POINTER 0x0001 +# define PXR_BOOST_PYTHON_POINTER_TO_MEMBER 0x0002 #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PREPROCESSOR_HPP diff --git a/pxr/external/boost/python/detail/python_type.hpp b/pxr/external/boost/python/detail/python_type.hpp index bfefb13b3c..11e1ef8d6f 100644 --- a/pxr/external/boost/python/detail/python_type.hpp +++ b/pxr/external/boost/python/detail/python_type.hpp @@ -11,6 +11,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PYTHON_TYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ #include "pxr/external/boost/python/converter/registered.hpp" -namespace boost {namespace python {namespace detail{ +namespace PXR_BOOST_NAMESPACE {namespace python {namespace detail{ template struct python_class : PyObject @@ -38,12 +39,12 @@ template struct python_class : PyObject if ( !first_time ) return; first_time = false; - converter::registry::insert(&converter, boost::python::type_id(), &converter::registered_pytype_direct::get_pytype); + converter::registry::insert(&converter, PXR_BOOST_NAMESPACE::python::type_id(), &converter::registered_pytype_direct::get_pytype); } }; -}}} //namespace boost :: python :: detail +}}} //namespace PXR_BOOST_NAMESPACE :: python :: detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif //PXR_EXTERNAL_BOOST_PYTHON_DETAIL_PYTHON_TYPE_HPP diff --git a/pxr/external/boost/python/detail/raw_pyobject.hpp b/pxr/external/boost/python/detail/raw_pyobject.hpp index 3dac279bcc..23e20e5177 100644 --- a/pxr/external/boost/python/detail/raw_pyobject.hpp +++ b/pxr/external/boost/python/detail/raw_pyobject.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RAW_PYOBJECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // // Define some types which we can use to get around the vagaries of @@ -38,7 +39,7 @@ typedef borrowed_reference_t* borrowed_reference; struct new_non_null_reference_t; typedef new_non_null_reference_t* new_non_null_reference; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RAW_PYOBJECT_HPP diff --git a/pxr/external/boost/python/detail/referent_storage.hpp b/pxr/external/boost/python/detail/referent_storage.hpp index 3d9067c46c..0d3be2cacf 100644 --- a/pxr/external/boost/python/detail/referent_storage.hpp +++ b/pxr/external/boost/python/detail/referent_storage.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_REFERENT_STORAGE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct aligned_storage @@ -48,10 +49,13 @@ struct aligned_storage template struct referent_storage { - typedef typename aligned_storage::value, alignment_of::value>::type type; + typedef typename aligned_storage< + ::PXR_BOOST_NAMESPACE::python::detail::referent_size::value, + alignment_of::value + >::type type; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_REFERENT_STORAGE_HPP diff --git a/pxr/external/boost/python/detail/result.hpp b/pxr/external/boost/python/detail/result.hpp index c5f99205e4..ee235b8247 100644 --- a/pxr/external/boost/python/detail/result.hpp +++ b/pxr/external/boost/python/detail/result.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RESULT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -32,7 +33,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // Defines a family of overloaded function which, given x, a function // pointer, member [function] pointer, or an AdaptableFunction object, @@ -44,11 +45,11 @@ namespace boost { namespace python { namespace detail { // to get this to work portably. # define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/result.hpp", BOOST_PYTHON_FUNCTION_POINTER)) + (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/result.hpp", PXR_BOOST_PYTHON_FUNCTION_POINTER)) # include BOOST_PP_ITERATE() # define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_CV_COUNT - 1, "pxr/external/boost/python/detail/result.hpp", BOOST_PYTHON_POINTER_TO_MEMBER)) + (4, (0, PXR_BOOST_PYTHON_CV_COUNT - 1, "pxr/external/boost/python/detail/result.hpp", PXR_BOOST_PYTHON_POINTER_TO_MEMBER)) # include BOOST_PP_ITERATE() template @@ -90,7 +91,7 @@ result(X const&, short = 0) { return 0; } # endif -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_RESULT_HPP @@ -99,7 +100,7 @@ result(X const&, short = 0) { return 0; } // For gcc 4.4 compatability, we must include the // BOOST_PP_ITERATION_DEPTH test inside an #else clause. #else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == PXR_BOOST_PYTHON_FUNCTION_POINTER # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, result.hpp(function pointers)) @@ -116,10 +117,10 @@ boost::type* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0) # undef N /* --------------- pointers-to-members --------------- */ -#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == PXR_BOOST_PYTHON_POINTER_TO_MEMBER // Outer over cv-qualifiers -# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/result.hpp")) +# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/result.hpp")) # include BOOST_PP_ITERATE() #elif BOOST_PP_ITERATION_DEPTH() == 2 @@ -130,7 +131,7 @@ boost::type* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0) // Inner over arities # define N BOOST_PP_ITERATION() -# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) +# define Q PXR_BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) template boost::type* result(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0) diff --git a/pxr/external/boost/python/detail/scope.hpp b/pxr/external/boost/python/detail/scope.hpp index b0eefcdc47..d208b6cb48 100644 --- a/pxr/external/boost/python/detail/scope.hpp +++ b/pxr/external/boost/python/detail/scope.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SCOPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,11 +19,11 @@ # include "pxr/external/boost/python/detail/config.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { -void BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& obj, char const* doc); +void PXR_BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& obj, char const* doc); -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SCOPE_HPP diff --git a/pxr/external/boost/python/detail/sfinae.hpp b/pxr/external/boost/python/detail/sfinae.hpp index 5b3b9c45fd..24e1e6ce5f 100644 --- a/pxr/external/boost/python/detail/sfinae.hpp +++ b/pxr/external/boost/python/detail/sfinae.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SFINAE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # if defined(BOOST_NO_SFINAE) && !defined(BOOST_MSVC) -# define BOOST_PYTHON_NO_SFINAE +# define PXR_BOOST_PYTHON_NO_SFINAE # endif #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/signature.hpp b/pxr/external/boost/python/detail/signature.hpp index d73d25dcec..89fba7b0a6 100644 --- a/pxr/external/boost/python/detail/signature.hpp +++ b/pxr/external/boost/python/detail/signature.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SIGNATURE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -31,7 +32,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct signature_element { @@ -49,7 +50,7 @@ struct py_func_sig_info template struct signature_arity; # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY + 1, "pxr/external/boost/python/detail/signature.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY + 1, "pxr/external/boost/python/detail/signature.hpp")) # include BOOST_PP_ITERATE() // A metafunction returning the base class used for @@ -69,7 +70,7 @@ struct signature { }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_SIGNATURE_HPP @@ -88,7 +89,7 @@ struct signature_arity { static signature_element const result[N+2] = { -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # define BOOST_PP_LOCAL_MACRO(i) \ { \ type_id::type>().name() \ diff --git a/pxr/external/boost/python/detail/string_literal.hpp b/pxr/external/boost/python/detail/string_literal.hpp index 7c8f9eeff8..0c158d33a4 100644 --- a/pxr/external/boost/python/detail/string_literal.hpp +++ b/pxr/external/boost/python/detail/string_literal.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_STRING_LITERAL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct is_string_literal : mpl::false_ @@ -55,7 +56,7 @@ struct is_string_literal }; # endif -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_STRING_LITERAL_HPP diff --git a/pxr/external/boost/python/detail/target.hpp b/pxr/external/boost/python/detail/target.hpp index 6ad4cf61f5..a795efeffd 100644 --- a/pxr/external/boost/python/detail/target.hpp +++ b/pxr/external/boost/python/detail/target.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TARGET_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -30,20 +31,20 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { # define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/target.hpp", BOOST_PYTHON_FUNCTION_POINTER)) + (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/target.hpp", PXR_BOOST_PYTHON_FUNCTION_POINTER)) # include BOOST_PP_ITERATE() # define BOOST_PP_ITERATION_PARAMS_1 \ - (4, (0, BOOST_PYTHON_CV_COUNT - 1, "pxr/external/boost/python/detail/target.hpp", BOOST_PYTHON_POINTER_TO_MEMBER)) + (4, (0, PXR_BOOST_PYTHON_CV_COUNT - 1, "pxr/external/boost/python/detail/target.hpp", PXR_BOOST_PYTHON_POINTER_TO_MEMBER)) # include BOOST_PP_ITERATE() template T& (* target(R (T::*)) )() { return 0; } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TARGET_HPP @@ -52,7 +53,7 @@ T& (* target(R (T::*)) )() { return 0; } // For gcc 4.4 compatability, we must include the // BOOST_PP_ITERATION_DEPTH test inside an #else clause. #else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == PXR_BOOST_PYTHON_FUNCTION_POINTER # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers)) @@ -69,10 +70,10 @@ BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )() # undef N /* --------------- pointers-to-members --------------- */ -#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == PXR_BOOST_PYTHON_POINTER_TO_MEMBER // Outer over cv-qualifiers -# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/target.hpp")) +# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/target.hpp")) # include BOOST_PP_ITERATE() #elif BOOST_PP_ITERATION_DEPTH() == 2 @@ -83,7 +84,7 @@ BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )() // Inner over arities # define N BOOST_PP_ITERATION() -# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) +# define Q PXR_BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1)) template T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )() diff --git a/pxr/external/boost/python/detail/translate_exception.hpp b/pxr/external/boost/python/detail/translate_exception.hpp index 5c3367af4c..6ec1a3ad0a 100644 --- a/pxr/external/boost/python/detail/translate_exception.hpp +++ b/pxr/external/boost/python/detail/translate_exception.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TRANSLATE_EXCEPTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // A ternary function object used to translate C++ exceptions of type // ExceptionType into Python exceptions by invoking an object of type @@ -73,7 +74,7 @@ struct translate_exception } }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // TRANSLATE_EXCEPTION_DWA2002810_HPP diff --git a/pxr/external/boost/python/detail/type_list.hpp b/pxr/external/boost/python/detail/type_list.hpp index a690e5ce98..14d04cefda 100644 --- a/pxr/external/boost/python/detail/type_list.hpp +++ b/pxr/external/boost/python/detail/type_list.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,22 +21,22 @@ # include "pxr/external/boost/python/detail/preprocessor.hpp" # include -# if BOOST_PYTHON_MAX_ARITY + 2 > BOOST_PYTHON_MAX_BASES -# define BOOST_PYTHON_LIST_SIZE BOOST_PP_INC(BOOST_PP_INC(BOOST_PYTHON_MAX_ARITY)) +# if PXR_BOOST_PYTHON_MAX_ARITY + 2 > PXR_BOOST_PYTHON_MAX_BASES +# define PXR_BOOST_PYTHON_LIST_SIZE BOOST_PP_INC(BOOST_PP_INC(PXR_BOOST_PYTHON_MAX_ARITY)) # else -# define BOOST_PYTHON_LIST_SIZE BOOST_PYTHON_MAX_BASES +# define PXR_BOOST_PYTHON_LIST_SIZE PXR_BOOST_PYTHON_MAX_BASES # endif -// Compute the MPL vector header to use for lists up to BOOST_PYTHON_LIST_SIZE in length -# if BOOST_PYTHON_LIST_SIZE > 48 +// Compute the MPL vector header to use for lists up to PXR_BOOST_PYTHON_LIST_SIZE in length +# if PXR_BOOST_PYTHON_LIST_SIZE > 48 # error Arities above 48 not supported by Boost.Python due to MPL internal limit -# elif BOOST_PYTHON_LIST_SIZE > 38 +# elif PXR_BOOST_PYTHON_LIST_SIZE > 38 # include -# elif BOOST_PYTHON_LIST_SIZE > 28 +# elif PXR_BOOST_PYTHON_LIST_SIZE > 28 # include -# elif BOOST_PYTHON_LIST_SIZE > 18 +# elif PXR_BOOST_PYTHON_LIST_SIZE > 18 # include -# elif BOOST_PYTHON_LIST_SIZE > 8 +# elif PXR_BOOST_PYTHON_LIST_SIZE > 8 # include # else # include diff --git a/pxr/external/boost/python/detail/type_list_impl.hpp b/pxr/external/boost/python/detail/type_list_impl.hpp index 7ccafa3613..b94e0d79f1 100644 --- a/pxr/external/boost/python/detail/type_list_impl.hpp +++ b/pxr/external/boost/python/detail/type_list_impl.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_IMPL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,20 +28,20 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { -template +template struct type_list - : BOOST_PP_CAT(mpl::vector,BOOST_PYTHON_LIST_SIZE) + : BOOST_PP_CAT(mpl::vector,PXR_BOOST_PYTHON_LIST_SIZE) { }; # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PP_DEC(BOOST_PYTHON_LIST_SIZE), "pxr/external/boost/python/detail/type_list_impl.hpp")) + (3, (0, BOOST_PP_DEC(PXR_BOOST_PYTHON_LIST_SIZE), "pxr/external/boost/python/detail/type_list_impl.hpp")) # include BOOST_PP_ITERATE() -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_LIST_IMPL_HPP @@ -48,7 +49,7 @@ struct type_list #else // BOOST_PP_IS_ITERATING # define N BOOST_PP_ITERATION() -# define BOOST_PYTHON_VOID_ARGS BOOST_PP_SUB_D(1,BOOST_PYTHON_LIST_SIZE,N) +# define PXR_BOOST_PYTHON_VOID_ARGS BOOST_PP_SUB_D(1,PXR_BOOST_PYTHON_LIST_SIZE,N) template < BOOST_PP_ENUM_PARAMS_Z(1, N, class T) @@ -57,13 +58,13 @@ struct type_list< BOOST_PP_ENUM_PARAMS_Z(1, N, T) BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM( - BOOST_PYTHON_VOID_ARGS, BOOST_PYTHON_FIXED, mpl::void_) + PXR_BOOST_PYTHON_VOID_ARGS, PXR_BOOST_PYTHON_FIXED, mpl::void_) > : BOOST_PP_CAT(mpl::vector,N) { }; -# undef BOOST_PYTHON_VOID_ARGS +# undef PXR_BOOST_PYTHON_VOID_ARGS # undef N #endif // BOOST_PP_IS_ITERATING diff --git a/pxr/external/boost/python/detail/type_traits.hpp b/pxr/external/boost/python/detail/type_traits.hpp index 51ee62bf67..9bb8d9d4f7 100644 --- a/pxr/external/boost/python/detail/type_traits.hpp +++ b/pxr/external/boost/python/detail/type_traits.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_TYPE_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -44,7 +45,7 @@ # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { #ifdef BOOST_NO_CXX11_HDR_TYPE_TRAITS using boost::alignment_of; @@ -116,7 +117,7 @@ namespace boost { namespace python { namespace detail { using boost::is_base_and_derived; using boost::type_with_alignment; using boost::has_trivial_copy; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/detail/unwind_type.hpp b/pxr/external/boost/python/detail/unwind_type.hpp index b3c8dc2cf8..12df328b4d 100644 --- a/pxr/external/boost/python/detail/unwind_type.hpp +++ b/pxr/external/boost/python/detail/unwind_type.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWIND_TYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,7 +21,7 @@ # include "pxr/external/boost/python/detail/indirect_traits.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { #if (!defined(_MSC_VER) || _MSC_VER >= 1915) // If forward declared, msvc6.5 does not recognize them as inline. @@ -178,7 +179,7 @@ unwind_type(boost::type*p =0, Generator* =0) return unwind_helper2::execute((U(*)())0,(Generator*)0); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWIND_TYPE_HPP diff --git a/pxr/external/boost/python/detail/unwrap_type_id.hpp b/pxr/external/boost/python/detail/unwrap_type_id.hpp index 5a401236a1..06adaf71df 100644 --- a/pxr/external/boost/python/detail/unwrap_type_id.hpp +++ b/pxr/external/boost/python/detail/unwrap_type_id.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_TYPE_ID_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class wrapper; @@ -37,7 +38,7 @@ inline type_info unwrap_type_id(U*, wrapper*) return type_id(); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_TYPE_ID_HPP diff --git a/pxr/external/boost/python/detail/unwrap_wrapper.hpp b/pxr/external/boost/python/detail/unwrap_wrapper.hpp index 4b3af3ac15..42e3d8ed41 100644 --- a/pxr/external/boost/python/detail/unwrap_wrapper.hpp +++ b/pxr/external/boost/python/detail/unwrap_wrapper.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_WRAPPER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,7 +21,7 @@ # include # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct unwrap_wrapper_helper @@ -40,7 +41,7 @@ unwrap_wrapper(T*) return 0; } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_UNWRAP_WRAPPER_HPP diff --git a/pxr/external/boost/python/detail/value_arg.hpp b/pxr/external/boost/python/detail/value_arg.hpp index 4ec119432c..5eec108449 100644 --- a/pxr/external/boost/python/detail/value_arg.hpp +++ b/pxr/external/boost/python/detail/value_arg.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_ARG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include # include "pxr/external/boost/python/detail/indirect_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct value_arg @@ -32,7 +33,7 @@ struct value_arg > {}; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_ARG_HPP diff --git a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp index 989e2e434b..ecb76f7e5b 100644 --- a/pxr/external/boost/python/detail/value_is_shared_ptr.hpp +++ b/pxr/external/boost/python/detail/value_is_shared_ptr.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_SHARED_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ #include "pxr/external/boost/python/detail/value_is_xxx.hpp" #include "pxr/external/boost/python/detail/is_shared_ptr.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template struct value_is_shared_ptr @@ -34,7 +35,7 @@ struct value_is_shared_ptr typedef mpl::bool_ type; }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // VALUE_IS_SHARED_PTR_DWA2003224_HPP diff --git a/pxr/external/boost/python/detail/value_is_xxx.hpp b/pxr/external/boost/python/detail/value_is_xxx.hpp index 5396196cb6..fd1d9e10be 100644 --- a/pxr/external/boost/python/detail/value_is_xxx.hpp +++ b/pxr/external/boost/python/detail/value_is_xxx.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_XXX_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,13 +24,13 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" # include "pxr/external/boost/python/detail/is_xxx.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { -# define BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \ +# define PXR_BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \ template \ struct value_is_##name \ { \ - BOOST_PYTHON_IS_XXX_DEF(name,qualified_name,nargs) \ + PXR_BOOST_PYTHON_IS_XXX_DEF(name,qualified_name,nargs) \ BOOST_STATIC_CONSTANT(bool, value = is_##name< \ typename remove_cv< \ typename remove_reference::type \ @@ -39,7 +40,7 @@ struct value_is_##name \ \ }; -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VALUE_IS_XXX_HPP diff --git a/pxr/external/boost/python/detail/void_ptr.hpp b/pxr/external/boost/python/detail/void_ptr.hpp index 354d5ece2e..5e083d73c4 100644 --- a/pxr/external/boost/python/detail/void_ptr.hpp +++ b/pxr/external/boost/python/detail/void_ptr.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { template inline U& void_ptr_to_reference(void const volatile* p, U&(*)()) @@ -41,7 +42,7 @@ inline void write_void_ptr_reference(void const volatile* storage, void* ptr, U& write_void_ptr(storage, ptr, u_stripped(0)); } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_PTR_HPP diff --git a/pxr/external/boost/python/detail/void_return.hpp b/pxr/external/boost/python/detail/void_return.hpp index 0e853e3553..67dd974bfd 100644 --- a/pxr/external/boost/python/detail/void_return.hpp +++ b/pxr/external/boost/python/detail/void_return.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_RETURN_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { struct void_return { @@ -48,7 +49,7 @@ template <> struct returnable : returnable {}; # endif // BOOST_NO_VOID_RETURNS -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_VOID_RETURN_HPP diff --git a/pxr/external/boost/python/detail/wrap_python.hpp b/pxr/external/boost/python/detail/wrap_python.hpp index e0507817b5..c8a66744ae 100644 --- a/pxr/external/boost/python/detail/wrap_python.hpp +++ b/pxr/external/boost/python/detail/wrap_python.hpp @@ -72,13 +72,13 @@ // #include #ifndef ULONG_MAX -# define BOOST_PYTHON_ULONG_MAX_UNDEFINED +# define PXR_BOOST_PYTHON_ULONG_MAX_UNDEFINED #endif #ifndef LONGLONG_MAX -# define BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +# define PXR_BOOST_PYTHON_LONGLONG_MAX_UNDEFINED #endif #ifndef ULONGLONG_MAX -# define BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +# define PXR_BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED #endif // @@ -160,16 +160,16 @@ typedef int pid_t; #if defined(__GNUC__) # if defined(__has_warning) -# define BOOST_PYTHON_GCC_HAS_WREGISTER __has_warning("-Wregister") +# define PXR_BOOST_PYTHON_GCC_HAS_WREGISTER __has_warning("-Wregister") # else -# define BOOST_PYTHON_GCC_HAS_WREGISTER __GNUC__ >= 7 +# define PXR_BOOST_PYTHON_GCC_HAS_WREGISTER __GNUC__ >= 7 # endif #else -# define BOOST_PYTHON_GCC_HAS_WREGISTER 0 +# define PXR_BOOST_PYTHON_GCC_HAS_WREGISTER 0 #endif // Python.h header uses `register` keyword until Python 3.4 -#if BOOST_PYTHON_GCC_HAS_WREGISTER +#if PXR_BOOST_PYTHON_GCC_HAS_WREGISTER # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wregister" #elif defined(_MSC_VER) @@ -183,26 +183,26 @@ typedef int pid_t; # include #endif -#if BOOST_PYTHON_GCC_HAS_WREGISTER +#if PXR_BOOST_PYTHON_GCC_HAS_WREGISTER # pragma GCC diagnostic pop #elif defined(_MSC_VER) # pragma warning(pop) #endif -#undef BOOST_PYTHON_GCC_HAS_WREGISTER +#undef PXR_BOOST_PYTHON_GCC_HAS_WREGISTER -#ifdef BOOST_PYTHON_ULONG_MAX_UNDEFINED +#ifdef PXR_BOOST_PYTHON_ULONG_MAX_UNDEFINED # undef ULONG_MAX -# undef BOOST_PYTHON_ULONG_MAX_UNDEFINED +# undef PXR_BOOST_PYTHON_ULONG_MAX_UNDEFINED #endif -#ifdef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +#ifdef PXR_BOOST_PYTHON_LONGLONG_MAX_UNDEFINED # undef LONGLONG_MAX -# undef BOOST_PYTHON_LONGLONG_MAX_UNDEFINED +# undef PXR_BOOST_PYTHON_LONGLONG_MAX_UNDEFINED #endif -#ifdef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +#ifdef PXR_BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED # undef ULONGLONG_MAX -# undef BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED +# undef PXR_BOOST_PYTHON_ULONGLONG_MAX_UNDEFINED #endif #ifdef PY_MSC_VER_DEFINED_FROM_WRAP_PYTHON_H @@ -248,9 +248,9 @@ typedef int pid_t; #if defined(HAVE_LONG_LONG) # if defined(PY_LONG_LONG) -# define BOOST_PYTHON_LONG_LONG PY_LONG_LONG +# define PXR_BOOST_PYTHON_LONG_LONG PY_LONG_LONG # elif defined(LONG_LONG) -# define BOOST_PYTHON_LONG_LONG LONG_LONG +# define PXR_BOOST_PYTHON_LONG_LONG LONG_LONG # else # error "HAVE_LONG_LONG defined but not PY_LONG_LONG or LONG_LONG" # endif diff --git a/pxr/external/boost/python/detail/wrapper_base.hpp b/pxr/external/boost/python/detail/wrapper_base.hpp index 01a7350d6e..9f8399b436 100644 --- a/pxr/external/boost/python/detail/wrapper_base.hpp +++ b/pxr/external/boost/python/detail/wrapper_base.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DETAIL_WRAPPER_BASE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { class override; @@ -48,7 +49,7 @@ namespace detail } } - class BOOST_PYTHON_DECL wrapper_base + class PXR_BOOST_PYTHON_DECL wrapper_base { friend void initialize_wrapper(PyObject* self, wrapper_base* w); friend PyObject* wrapper_base_::get_owner(wrapper_base const volatile& w); @@ -95,7 +96,7 @@ namespace detail } // namespace detail -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DETAIL_WRAPPER_BASE_HPP diff --git a/pxr/external/boost/python/dict.hpp b/pxr/external/boost/python/dict.hpp index e625bdf4a2..70e86fcabc 100644 --- a/pxr/external/boost/python/dict.hpp +++ b/pxr/external/boost/python/dict.hpp @@ -11,6 +11,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_DICT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,13 +24,13 @@ #include "pxr/external/boost/python/tuple.hpp" #include "pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { class dict; namespace detail { - struct BOOST_PYTHON_DECL dict_base : object + struct PXR_BOOST_PYTHON_DECL dict_base : object { // D.clear() -> None. Remove all items from D. void clear(); @@ -83,7 +84,7 @@ namespace detail dict_base(); // new dict explicit dict_base(object_cref data); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict_base, object) private: static detail::new_reference call(object const&); }; @@ -142,7 +143,7 @@ class dict : public detail::dict_base } public: // implementation detail -- for internal use only - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict, base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict, base) }; // @@ -157,7 +158,7 @@ namespace converter }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/docstring_options.hpp b/pxr/external/boost/python/docstring_options.hpp index 21737daec4..72cc24b7b2 100644 --- a/pxr/external/boost/python/docstring_options.hpp +++ b/pxr/external/boost/python/docstring_options.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_DOCSTRING_OPTIONS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,11 +19,11 @@ #include "pxr/external/boost/python/object/function.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // Note: the static data members are defined in object/function.cpp -class BOOST_PYTHON_DECL docstring_options : boost::noncopyable +class PXR_BOOST_PYTHON_DECL docstring_options : boost::noncopyable { public: docstring_options(bool show_all=true) @@ -133,7 +134,7 @@ class BOOST_PYTHON_DECL docstring_options : boost::noncopyable bool previous_show_py_signatures_; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_DOCSTRING_OPTIONS_HPP diff --git a/pxr/external/boost/python/enum.hpp b/pxr/external/boost/python/enum.hpp index f1fb4fbad6..e327acebb9 100644 --- a/pxr/external/boost/python/enum.hpp +++ b/pxr/external/boost/python/enum.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ENUM_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/converter/rvalue_from_python_data.hpp" # include "pxr/external/boost/python/converter/registered.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct enum_ : public objects::enum_base @@ -114,7 +115,7 @@ inline enum_& enum_::export_values() return *this; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ENUM_HPP diff --git a/pxr/external/boost/python/errors.hpp b/pxr/external/boost/python/errors.hpp index 883ce33bd7..dcadf9a5dc 100644 --- a/pxr/external/boost/python/errors.hpp +++ b/pxr/external/boost/python/errors.hpp @@ -15,6 +15,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ERRORS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,16 +24,16 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -struct BOOST_PYTHON_DECL error_already_set +struct PXR_BOOST_PYTHON_DECL error_already_set { virtual ~error_already_set(); }; // Handles exceptions caught just before returning to Python code. // Returns true iff an exception was caught. -BOOST_PYTHON_DECL bool handle_exception_impl(function0); +PXR_BOOST_PYTHON_DECL bool handle_exception_impl(function0); template bool handle_exception(T f) @@ -47,7 +48,7 @@ inline void handle_exception() handle_exception(detail::rethrow); } -BOOST_PYTHON_DECL void throw_error_already_set(); +PXR_BOOST_PYTHON_DECL void throw_error_already_set(); template inline T* expect_non_null(T* x) @@ -59,9 +60,9 @@ inline T* expect_non_null(T* x) // Return source if it is an instance of pytype; throw an appropriate // exception otherwise. -BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* pytype, PyObject* source); +PXR_BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* pytype, PyObject* source); -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ERRORS_HPP diff --git a/pxr/external/boost/python/exception_translator.hpp b/pxr/external/boost/python/exception_translator.hpp index 573380cf81..08f5c79308 100644 --- a/pxr/external/boost/python/exception_translator.hpp +++ b/pxr/external/boost/python/exception_translator.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_EXCEPTION_TRANSLATOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,7 +25,7 @@ # include "pxr/external/boost/python/detail/translate_exception.hpp" # include "pxr/external/boost/python/detail/exception_handler.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template void register_exception_translator(Translate translate, boost::type* = 0) @@ -35,7 +36,7 @@ void register_exception_translator(Translate translate, boost::type @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/str.hpp" -namespace boost +namespace PXR_BOOST_NAMESPACE { namespace python { @@ -28,44 +29,44 @@ namespace python // global and local are the global and local scopes respectively, // used during evaluation. object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL eval(str string, object global = object(), object local = object()); object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL eval(char const *string, object global = object(), object local = object()); // Execute an individual python statement from str. // global and local are the global and local scopes respectively, // used during execution. object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec_statement(str string, object global = object(), object local = object()); object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec_statement(char const *string, object global = object(), object local = object()); // Execute python source code from str. // global and local are the global and local scopes respectively, // used during execution. object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec(str string, object global = object(), object local = object()); object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec(char const *string, object global = object(), object local = object()); // Execute python source code from file filename. // global and local are the global and local scopes respectively, // used during execution. object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec_file(str filename, object global = object(), object local = object()); object -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL exec_file(char const *filename, object global = object(), object local = object()); } diff --git a/pxr/external/boost/python/extract.hpp b/pxr/external/boost/python/extract.hpp index 24afd4ae88..60e64bc0d7 100644 --- a/pxr/external/boost/python/extract.hpp +++ b/pxr/external/boost/python/extract.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_EXTRACT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -38,7 +39,7 @@ # define BOOST_EXTRACT_WORKAROUND #endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { @@ -265,7 +266,7 @@ namespace converter } } -}} // namespace boost::python::converter +}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_EXTRACT_HPP diff --git a/pxr/external/boost/python/handle.hpp b/pxr/external/boost/python/handle.hpp index 1fcc6cd7be..df94fc083e 100644 --- a/pxr/external/boost/python/handle.hpp +++ b/pxr/external/boost/python/handle.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_HANDLE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ # include "pxr/external/boost/python/tag.hpp" # include "pxr/external/boost/python/detail/raw_pyobject.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct null_ok; @@ -242,7 +243,7 @@ inline PyObject* get_managed_object(handle const& h, tag_t) return h.get() ? python::upcast(h.get()) : Py_None; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/handle_fwd.hpp b/pxr/external/boost/python/handle_fwd.hpp index dc81de1e8e..a1b0175bc5 100644 --- a/pxr/external/boost/python/handle_fwd.hpp +++ b/pxr/external/boost/python/handle_fwd.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_HANDLE_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,11 +19,11 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class handle; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HANDLE_FWD_HPP diff --git a/pxr/external/boost/python/has_back_reference.hpp b/pxr/external/boost/python/has_back_reference.hpp index a5c1e88fb6..cc83d6eca9 100644 --- a/pxr/external/boost/python/has_back_reference.hpp +++ b/pxr/external/boost/python/has_back_reference.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_HAS_BACK_REFERENCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // traits class which users can specialize to indicate that a class // contains a back-reference to its owning PyObject* @@ -30,7 +31,7 @@ struct has_back_reference }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_HAS_BACK_REFERENCE_HPP diff --git a/pxr/external/boost/python/implicit.hpp b/pxr/external/boost/python/implicit.hpp index 6cac1e4245..4f563106a0 100644 --- a/pxr/external/boost/python/implicit.hpp +++ b/pxr/external/boost/python/implicit.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_IMPLICIT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,12 +21,12 @@ # include # include "pxr/external/boost/python/converter/implicit.hpp" # include "pxr/external/boost/python/converter/registry.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif # include "pxr/external/boost/python/type_id.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template void implicitly_convertible(boost::type* = 0, boost::type* = 0) @@ -36,13 +37,13 @@ void implicitly_convertible(boost::type* = 0, boost::type* = 0) &functions::convertible , &functions::construct , type_id() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &converter::expected_from_python_type_direct::get_pytype #endif ); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_IMPLICIT_HPP diff --git a/pxr/external/boost/python/import.hpp b/pxr/external/boost/python/import.hpp index 4c34a014b8..cef609801e 100644 --- a/pxr/external/boost/python/import.hpp +++ b/pxr/external/boost/python/import.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_IMPORT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,13 +20,13 @@ # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/str.hpp" -namespace boost +namespace PXR_BOOST_NAMESPACE { namespace python { // Import the named module and return a reference to it. -object BOOST_PYTHON_DECL import(str name); +object PXR_BOOST_PYTHON_DECL import(str name); } } diff --git a/pxr/external/boost/python/init.hpp b/pxr/external/boost/python/init.hpp index 8772705a4c..64df63ff75 100644 --- a/pxr/external/boost/python/init.hpp +++ b/pxr/external/boost/python/init.hpp @@ -14,6 +14,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_INIT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -45,30 +46,30 @@ #include /////////////////////////////////////////////////////////////////////////////// -#define BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT \ +#define PXR_BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT \ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( \ - BOOST_PYTHON_MAX_ARITY, \ + PXR_BOOST_PYTHON_MAX_ARITY, \ class T, \ mpl::void_) \ -#define BOOST_PYTHON_OVERLOAD_TYPES \ +#define PXR_BOOST_PYTHON_OVERLOAD_TYPES \ BOOST_PP_ENUM_PARAMS_Z(1, \ - BOOST_PYTHON_MAX_ARITY, \ + PXR_BOOST_PYTHON_MAX_ARITY, \ class T) \ -#define BOOST_PYTHON_OVERLOAD_ARGS \ +#define PXR_BOOST_PYTHON_OVERLOAD_ARGS \ BOOST_PP_ENUM_PARAMS_Z(1, \ - BOOST_PYTHON_MAX_ARITY, \ + PXR_BOOST_PYTHON_MAX_ARITY, \ T) \ /////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -template +template class init; // forward declaration -template +template struct optional; // forward declaration namespace detail @@ -92,8 +93,8 @@ namespace detail : mpl::false_ {}; - template - struct is_optional > + template + struct is_optional > : mpl::true_ {}; @@ -216,12 +217,12 @@ namespace detail {}; } -template -class init : public init_base > +template +class init : public init_base > { - typedef init_base > base; + typedef init_base > base; public: - typedef init self_t; + typedef init self_t; init(char const* doc_ = 0) : base(doc_) @@ -254,7 +255,7 @@ class init : public init_base > policies, this->doc_string(), this->keywords()); } - typedef detail::type_list signature_; + typedef detail::type_list signature_; typedef detail::is_optional< typename mpl::eval_if< @@ -297,9 +298,9 @@ class init : public init_base > // optional::type returns a typelist. // /////////////////////////////////////////////////////////////////////////////// -template +template struct optional - : detail::type_list + : detail::type_list { }; @@ -389,13 +390,13 @@ namespace detail }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python -#undef BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT -#undef BOOST_PYTHON_OVERLOAD_TYPES -#undef BOOST_PYTHON_OVERLOAD_ARGS -#undef BOOST_PYTHON_IS_OPTIONAL_VALUE -#undef BOOST_PYTHON_APPEND_TO_INIT +#undef PXR_BOOST_PYTHON_OVERLOAD_TYPES_WITH_DEFAULT +#undef PXR_BOOST_PYTHON_OVERLOAD_TYPES +#undef PXR_BOOST_PYTHON_OVERLOAD_ARGS +#undef PXR_BOOST_PYTHON_IS_OPTIONAL_VALUE +#undef PXR_BOOST_PYTHON_APPEND_TO_INIT /////////////////////////////////////////////////////////////////////////////// #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/instance_holder.hpp b/pxr/external/boost/python/instance_holder.hpp index 9f500213aa..10e113d83c 100644 --- a/pxr/external/boost/python/instance_holder.hpp +++ b/pxr/external/boost/python/instance_holder.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_INSTANCE_HOLDER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,10 +23,10 @@ # include "pxr/external/boost/python/type_id.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // Base class for all holders -struct BOOST_PYTHON_DECL instance_holder : private noncopyable +struct PXR_BOOST_PYTHON_DECL instance_holder : private noncopyable { public: instance_holder(); @@ -59,7 +60,7 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable }; // This macro is needed for implementation of derived holders -# define BOOST_PYTHON_UNFORWARD(N,ignored) (typename unforward::type)(a##N) +# define PXR_BOOST_PYTHON_UNFORWARD(N,ignored) (typename unforward::type)(a##N) // // implementation @@ -69,7 +70,7 @@ inline instance_holder* instance_holder::next() const return m_next; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_INSTANCE_HOLDER_HPP diff --git a/pxr/external/boost/python/iterator.hpp b/pxr/external/boost/python/iterator.hpp index 1971c9270d..13516144b8 100644 --- a/pxr/external/boost/python/iterator.hpp +++ b/pxr/external/boost/python/iterator.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_ITERATOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -36,7 +37,7 @@ works correctly. */ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -142,7 +143,7 @@ struct iterator : object } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_ITERATOR_HPP diff --git a/pxr/external/boost/python/list.hpp b/pxr/external/boost/python/list.hpp index a4b0fc45a4..b08ab56a19 100644 --- a/pxr/external/boost/python/list.hpp +++ b/pxr/external/boost/python/list.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_LIST_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,11 +23,11 @@ # include "pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp" # include "pxr/external/boost/python/ssize_t.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { - struct BOOST_PYTHON_DECL list_base : object + struct PXR_BOOST_PYTHON_DECL list_base : object { void append(object_cref); // append object to end @@ -59,7 +60,7 @@ namespace detail list_base(); // new list explicit list_base(object_cref sequence); // new list initialized from sequence's items - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list_base, object) private: static detail::new_non_null_reference call(object const&); }; @@ -139,7 +140,7 @@ class list : public detail::list_base #endif public: // implementation detail -- for internal use only - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list, base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list, base) }; // @@ -154,7 +155,7 @@ namespace converter }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LIST_HPP diff --git a/pxr/external/boost/python/long.hpp b/pxr/external/boost/python/long.hpp index 1fa085ad69..fc2db61eae 100644 --- a/pxr/external/boost/python/long.hpp +++ b/pxr/external/boost/python/long.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_LONG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,18 +22,18 @@ # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/converter/pytype_object_mgr_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { - struct BOOST_PYTHON_DECL long_base : object + struct PXR_BOOST_PYTHON_DECL long_base : object { protected: long_base(); // new long_ explicit long_base(object_cref rhs); explicit long_base(object_cref rhs, object_cref base); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object) private: static detail::new_reference call(object const&); @@ -59,7 +60,7 @@ class long_ : public detail::long_base } public: // implementation detail -- for internal use only - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base) }; // @@ -74,7 +75,7 @@ namespace converter }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LONG_HPP diff --git a/pxr/external/boost/python/lvalue_from_pytype.hpp b/pxr/external/boost/python/lvalue_from_pytype.hpp index 8aea52a9c2..7346f0fecb 100644 --- a/pxr/external/boost/python/lvalue_from_pytype.hpp +++ b/pxr/external/boost/python/lvalue_from_pytype.hpp @@ -11,13 +11,14 @@ # define PXR_EXTERNAL_BOOST_PYTHON_LVALUE_FROM_PYTYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/detail/prefix.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif @@ -26,7 +27,7 @@ # include "pxr/external/boost/python/detail/void_ptr.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -49,7 +50,7 @@ namespace detail { typedef typename add_lvalue_reference::type param; return &Extractor::execute( - boost::python::detail::void_ptr_to_reference( + PXR_BOOST_NAMESPACE::python::detail::void_ptr_to_reference( op, (param(*)())0 ) ); } @@ -103,7 +104,7 @@ struct lvalue_from_pytype converter::registry::insert ( &extract , detail::extractor_type_id(&Extractor::execute) -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &get_pytype #endif ); @@ -118,12 +119,12 @@ struct lvalue_from_pytype : 0 ; } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const*get_pytype() { return python_type; } #endif }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_LVALUE_FROM_PYTYPE_HPP diff --git a/pxr/external/boost/python/make_constructor.hpp b/pxr/external/boost/python/make_constructor.hpp index b1be13882b..25a0fd1772 100644 --- a/pxr/external/boost/python/make_constructor.hpp +++ b/pxr/external/boost/python/make_constructor.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_MAKE_CONSTRUCTOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -36,7 +37,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { diff --git a/pxr/external/boost/python/make_function.hpp b/pxr/external/boost/python/make_function.hpp index de70aa024c..0f0922131f 100644 --- a/pxr/external/boost/python/make_function.hpp +++ b/pxr/external/boost/python/make_function.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_MAKE_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,7 +28,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { diff --git a/pxr/external/boost/python/manage_new_object.hpp b/pxr/external/boost/python/manage_new_object.hpp index bd4987e46b..923500e487 100644 --- a/pxr/external/boost/python/manage_new_object.hpp +++ b/pxr/external/boost/python/manage_new_object.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_MANAGE_NEW_OBJECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include # include "pxr/external/boost/python/to_python_indirect.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -47,7 +48,7 @@ struct manage_new_object }; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_MANAGE_NEW_OBJECT_HPP diff --git a/pxr/external/boost/python/module.hpp b/pxr/external/boost/python/module.hpp index 6bbbcf0da0..71f3851d11 100644 --- a/pxr/external/boost/python/module.hpp +++ b/pxr/external/boost/python/module.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_MODULE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/module_init.hpp" -# define BOOST_PYTHON_MODULE BOOST_PYTHON_MODULE_INIT +# define PXR_BOOST_PYTHON_MODULE PXR_BOOST_PYTHON_MODULE_INIT #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // MODULE_DWA20011221_HPP diff --git a/pxr/external/boost/python/module_init.hpp b/pxr/external/boost/python/module_init.hpp index 9d65e66854..ee6d7b259d 100644 --- a/pxr/external/boost/python/module_init.hpp +++ b/pxr/external/boost/python/module_init.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_MODULE_INIT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,17 +21,17 @@ # include # include -# ifndef BOOST_PYTHON_MODULE_INIT +# ifndef PXR_BOOST_PYTHON_MODULE_INIT -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { # if PY_VERSION_HEX >= 0x03000000 -BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef&, void(*)()); +PXR_BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef&, void(*)()); #else -BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); +PXR_BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); #endif @@ -38,7 +39,7 @@ BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); # if PY_VERSION_HEX >= 0x03000000 -# define _BOOST_PYTHON_MODULE_INIT(name) \ +# define _PXR_BOOST_PYTHON_MODULE_INIT(name) \ PyObject* BOOST_PP_CAT(PyInit_, name)() \ { \ static PyModuleDef_Base initial_m_base = { \ @@ -60,26 +61,26 @@ BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*)()); 0, /* m_free */ \ }; \ \ - return boost::python::detail::init_module( \ + return PXR_BOOST_NAMESPACE::python::detail::init_module( \ moduledef, BOOST_PP_CAT(init_module_, name) ); \ } \ void BOOST_PP_CAT(init_module_, name)() # else -# define _BOOST_PYTHON_MODULE_INIT(name) \ +# define _PXR_BOOST_PYTHON_MODULE_INIT(name) \ void BOOST_PP_CAT(init,name)() \ { \ - boost::python::detail::init_module( \ + PXR_BOOST_NAMESPACE::python::detail::init_module( \ BOOST_PP_STRINGIZE(name),&BOOST_PP_CAT(init_module_,name)); \ } \ void BOOST_PP_CAT(init_module_,name)() # endif -# define BOOST_PYTHON_MODULE_INIT(name) \ +# define PXR_BOOST_PYTHON_MODULE_INIT(name) \ void BOOST_PP_CAT(init_module_,name)(); \ -extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name) +extern "C" BOOST_SYMBOL_EXPORT _PXR_BOOST_PYTHON_MODULE_INIT(name) # endif diff --git a/pxr/external/boost/python/numpy.hpp b/pxr/external/boost/python/numpy.hpp index 42bc2c0b71..97f06b98ca 100644 --- a/pxr/external/boost/python/numpy.hpp +++ b/pxr/external/boost/python/numpy.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,13 +27,13 @@ #include "pxr/external/boost/python/numpy/invoke_matching.hpp" #include "pxr/external/boost/python/numpy/config.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief Initialize the Numpy C-API * * This must be called before using anything in boost.numpy; - * It should probably be the first line inside BOOST_PYTHON_MODULE. + * It should probably be the first line inside PXR_BOOST_PYTHON_MODULE. * * @internal This just calls the Numpy C-API functions "import_array()" * and "import_ufunc()", and then calls @@ -40,7 +41,7 @@ namespace boost { namespace python { namespace numpy { */ BOOST_NUMPY_DECL void initialize(bool register_scalar_converters=true); -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/config.hpp b/pxr/external/boost/python/numpy/config.hpp index 2ffb3ae0c8..7efafbdcb8 100644 --- a/pxr/external/boost/python/numpy/config.hpp +++ b/pxr/external/boost/python/numpy/config.hpp @@ -18,6 +18,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_CONFIG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -73,9 +74,9 @@ // Set the name of our library, this will get undef'ed by auto_link.hpp // once it's done with it: // -#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m -#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m) -#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION) +#define _PXR_BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m +#define PXR_BOOST_PYTHON_CONCAT(N, M, m) _PXR_BOOST_PYTHON_CONCAT(N, M, m) +#define BOOST_LIB_NAME PXR_BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION) // // If we're importing code from a dll, then tell auto_link.hpp about it: // @@ -88,8 +89,8 @@ #include #endif // auto-linking disabled -#undef BOOST_PYTHON_CONCAT -#undef _BOOST_PYTHON_CONCAT +#undef PXR_BOOST_PYTHON_CONCAT +#undef _PXR_BOOST_PYTHON_CONCAT #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION diff --git a/pxr/external/boost/python/numpy/dtype.hpp b/pxr/external/boost/python/numpy/dtype.hpp index 14ba092a94..6a4af1ddc2 100644 --- a/pxr/external/boost/python/numpy/dtype.hpp +++ b/pxr/external/boost/python/numpy/dtype.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_DTYPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -29,7 +30,7 @@ #include #include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief A boost.python "object manager" (subclass of object) for numpy.dtype. @@ -76,7 +77,7 @@ class BOOST_NUMPY_DECL dtype : public object { */ static void register_scalar_converters(); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dtype, object); + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dtype, object); }; @@ -119,11 +120,11 @@ struct builtin_dtype< std::complex, false > { template inline dtype dtype::get_builtin() { return detail::builtin_dtype::get(); } -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::dtype); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/internal.hpp b/pxr/external/boost/python/numpy/internal.hpp index 97b4520140..f439ea1e3f 100644 --- a/pxr/external/boost/python/numpy/internal.hpp +++ b/pxr/external/boost/python/numpy/internal.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INTERNAL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,11 +28,11 @@ #include "pxr/external/boost/python.hpp" #include "pxr/external/boost/python/numpy/config.hpp" -#ifdef BOOST_PYTHON_NUMPY_INTERNAL +#ifdef PXR_BOOST_PYTHON_NUMPY_INTERNAL #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #else -#ifndef BOOST_PYTHON_NUMPY_INTERNAL_MAIN +#ifndef PXR_BOOST_PYTHON_NUMPY_INTERNAL_MAIN ERROR_internal_hpp_is_for_internal_use_only #endif #endif diff --git a/pxr/external/boost/python/numpy/invoke_matching.hpp b/pxr/external/boost/python/numpy/invoke_matching.hpp index 5d1eb191d0..47f3d6239c 100644 --- a/pxr/external/boost/python/numpy/invoke_matching.hpp +++ b/pxr/external/boost/python/numpy/invoke_matching.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_INVOKE_MATCHING_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ #include "pxr/external/boost/python/numpy/ndarray.hpp" #include -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { namespace detail { @@ -127,7 +128,7 @@ struct nd_template_invoker< boost::reference_wrapper > Function & m_func; }; -} // namespace boost::python::numpy::detail +} // namespace PXR_BOOST_NAMESPACE::python::numpy::detail template void invoke_matching_nd(int nd, Function f) @@ -183,7 +184,7 @@ struct array_template_invoker_wrapper_1< DimSequence, boost::reference_wrapper(nd, func) {} }; -} // namespace boost::python::numpy::detail +} // namespace PXR_BOOST_NAMESPACE::python::numpy::detail template void invoke_matching_array(ndarray const & array_, Function f) @@ -192,7 +193,7 @@ void invoke_matching_array(ndarray const & array_, Function f) invoke_matching_dtype(array_.get_dtype(), wrapper); } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/matrix.hpp b/pxr/external/boost/python/numpy/matrix.hpp index 064a523c57..236cb97993 100644 --- a/pxr/external/boost/python/numpy/matrix.hpp +++ b/pxr/external/boost/python/numpy/matrix.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_MATRIX_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,7 +29,7 @@ #include "pxr/external/boost/python/numpy/config.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief A boost.python "object manager" (subclass of object) for numpy.matrix. @@ -36,7 +37,7 @@ namespace boost { namespace python { namespace numpy { * @internal numpy.matrix is defined in Python, so object_manager_traits::get_pytype() * is implemented by importing numpy and getting the "matrix" attribute of the module. * We then just hope that doesn't get destroyed while we need it, because if we put - * a dynamic python object in a static-allocated boost::python::object or handle<>, + * a dynamic python object in a static-allocated PXR_BOOST_NAMESPACE::python::object or handle<>, * bad things happen when Python shuts down. I think this solution is safe, but I'd * love to get that confirmed. */ @@ -46,7 +47,7 @@ class BOOST_NUMPY_DECL matrix : public ndarray static object construct(object_cref obj, bool copy); public: - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(matrix, ndarray); + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(matrix, ndarray); /// @brief Equivalent to "numpy.matrix(obj,dt,copy)" in Python. explicit matrix(object const & obj, dtype const & dt, bool copy=true) @@ -83,14 +84,14 @@ struct as_matrix : Base } }; -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::matrix); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/ndarray.hpp b/pxr/external/boost/python/numpy/ndarray.hpp index a9420dbc65..f460961689 100644 --- a/pxr/external/boost/python/numpy/ndarray.hpp +++ b/pxr/external/boost/python/numpy/ndarray.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NDARRAY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -31,12 +32,12 @@ #include -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief A boost.python "object manager" (subclass of object) for numpy.ndarray. * - * @todo This could have a lot more functionality (like boost::python::numeric::array). + * @todo This could have a lot more functionality (like PXR_BOOST_NAMESPACE::python::numeric::array). * Right now all that exists is what was needed to move raw data between C++ and Python. */ @@ -86,7 +87,7 @@ class BOOST_NUMPY_DECL ndarray : public object UPDATE_ALL=0x1|0x2|0x4, VARRAY=0x1|0x2|0x8, ALL=0x1|0x2|0x4|0x8 }; - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(ndarray, object); + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(ndarray, object); /// @brief Return a view of the scalar with the given dtype. ndarray view(dtype const & dt) const; @@ -187,7 +188,7 @@ ndarray from_data_impl(void * data, Container strides, object const & owner, bool writeable, - typename boost::enable_if< boost::python::detail::is_integral >::type * enabled = NULL) + typename boost::enable_if< PXR_BOOST_NAMESPACE::python::detail::is_integral >::type * enabled = NULL) { std::vector shape_(shape.begin(),shape.end()); std::vector strides_(strides.begin(), strides.end()); @@ -201,7 +202,7 @@ BOOST_NUMPY_DECL ndarray from_data_impl(void * data, object const & owner, bool writeable); -} // namespace boost::python::numpy::detail +} // namespace PXR_BOOST_NAMESPACE::python::numpy::detail /** * @brief Construct a new ndarray object from a raw pointer. @@ -312,14 +313,14 @@ BOOST_NUMPY_DECL inline ndarray::bitflag operator&(ndarray::bitflag a, return ndarray::bitflag(int(a) & int(b)); } -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::ndarray); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp index e82067c75e..4c6fa0640e 100644 --- a/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp +++ b/pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_NUMPY_OBJECT_MGR_TRAITS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include diff --git a/pxr/external/boost/python/numpy/scalars.hpp b/pxr/external/boost/python/numpy/scalars.hpp index fb43f2cb55..a49b774d69 100644 --- a/pxr/external/boost/python/numpy/scalars.hpp +++ b/pxr/external/boost/python/numpy/scalars.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_SCALARS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ #include "pxr/external/boost/python/numpy/numpy_object_mgr_traits.hpp" #include "pxr/external/boost/python/numpy/dtype.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief A boost.python "object manager" (subclass of object) for numpy.void. @@ -49,7 +50,7 @@ class BOOST_NUMPY_DECL void_ : public object */ explicit void_(Py_ssize_t size); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(void_, object); + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(void_, object); /// @brief Return a view of the scalar with the given dtype. void_ view(dtype const & dt) const; @@ -59,12 +60,12 @@ class BOOST_NUMPY_DECL void_ : public object }; -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::void_); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/numpy/ufunc.hpp b/pxr/external/boost/python/numpy/ufunc.hpp index 6f15879331..5dc6a18e0e 100644 --- a/pxr/external/boost/python/numpy/ufunc.hpp +++ b/pxr/external/boost/python/numpy/ufunc.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_NUMPY_UFUNC_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,7 +29,7 @@ #include "pxr/external/boost/python/numpy/ndarray.hpp" #include "pxr/external/boost/python/numpy/config.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { /** * @brief A boost.python "object manager" (subclass of object) for PyArray_MultiIter. @@ -50,7 +51,7 @@ class BOOST_NUMPY_DECL multi_iter : public object { public: - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(multi_iter, object); + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(multi_iter, object); /// @brief Increment the iterator. void next(); @@ -94,7 +95,7 @@ BOOST_NUMPY_DECL multi_iter make_multi_iter(object const & a1, object const & a2 * double operator()(double input) const { return input * M_PI; } * }; * - * BOOST_PYTHON_MODULE(example) + * PXR_BOOST_PYTHON_MODULE(example) * { * class_< TimesPI >("TimesPI") * .def("__call__", unary_ufunc::make()); @@ -157,7 +158,7 @@ struct unary_ufunc * double operator()(double input1, double input2) const { return std::cos(input1 + input2); } * }; * - * BOOST_PYTHON_MODULE(example) + * PXR_BOOST_PYTHON_MODULE(example) * { * class_< CosSum >("CosSum") * .def("__call__", binary_ufunc::make()); @@ -205,14 +206,14 @@ struct binary_ufunc }; -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { NUMPY_OBJECT_MANAGER_TRAITS(numpy::multi_iter); -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/object.hpp b/pxr/external/boost/python/object.hpp index a7775b6dc7..1cdd53b22f 100644 --- a/pxr/external/boost/python/object.hpp +++ b/pxr/external/boost/python/object.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,7 +25,7 @@ # include "pxr/external/boost/python/object_operators.hpp" # include "pxr/external/boost/python/converter/arg_to_python.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { inline ssize_t len(object const& obj) { @@ -33,7 +34,7 @@ namespace boost { namespace python { return result; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_HPP diff --git a/pxr/external/boost/python/object/add_to_namespace.hpp b/pxr/external/boost/python/object/add_to_namespace.hpp index 3f1d76a08d..4529e010d4 100644 --- a/pxr/external/boost/python/object/add_to_namespace.hpp +++ b/pxr/external/boost/python/object/add_to_namespace.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ADD_TO_NAMESPACE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,18 +19,18 @@ # include "pxr/external/boost/python/object_fwd.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // // A setattr that's "smart" about function overloading (and docstrings). // -BOOST_PYTHON_DECL void add_to_namespace( +PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute); -BOOST_PYTHON_DECL void add_to_namespace( +PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute, char const* doc); -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ADD_TO_NAMESPACE_HPP diff --git a/pxr/external/boost/python/object/class.hpp b/pxr/external/boost/python/object/class.hpp index 1dbfbbe2e6..01f86cc6b7 100644 --- a/pxr/external/boost/python/object/class.hpp +++ b/pxr/external/boost/python/object/class.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,11 +22,11 @@ # include "pxr/external/boost/python/type_id.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -struct BOOST_PYTHON_DECL class_base : python::api::object +struct PXR_BOOST_PYTHON_DECL class_base : python::api::object { // constructor class_base( @@ -69,7 +70,7 @@ struct BOOST_PYTHON_DECL class_base : python::api::object void make_method_static(const char *method_name); }; -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_HPP diff --git a/pxr/external/boost/python/object/class_detail.hpp b/pxr/external/boost/python/object/class_detail.hpp index 4e9f442fc3..df5c7e94a6 100644 --- a/pxr/external/boost/python/object/class_detail.hpp +++ b/pxr/external/boost/python/object/class_detail.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_DETAIL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,13 +20,13 @@ # include "pxr/external/boost/python/handle.hpp" # include "pxr/external/boost/python/type_id.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL type_handle registered_class_object(type_info id); -BOOST_PYTHON_DECL type_handle class_metatype(); -BOOST_PYTHON_DECL type_handle class_type(); +PXR_BOOST_PYTHON_DECL type_handle registered_class_object(type_info id); +PXR_BOOST_PYTHON_DECL type_handle class_metatype(); +PXR_BOOST_PYTHON_DECL type_handle class_type(); -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_DETAIL_HPP diff --git a/pxr/external/boost/python/object/class_metadata.hpp b/pxr/external/boost/python/object/class_metadata.hpp index 1cb34d60ff..c04459c80d 100644 --- a/pxr/external/boost/python/object/class_metadata.hpp +++ b/pxr/external/boost/python/object/class_metadata.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_METADATA_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -47,9 +48,9 @@ #include #include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL +PXR_BOOST_PYTHON_DECL void copy_class_object(type_info const& src, type_info const& dst); // @@ -61,7 +62,7 @@ struct register_base_of template inline void operator()(Base*) const { - BOOST_MPL_ASSERT_NOT((boost::python::detail::is_same)); + BOOST_MPL_ASSERT_NOT((PXR_BOOST_NAMESPACE::python::detail::is_same)); // Register the Base class register_dynamic_id(); @@ -70,14 +71,14 @@ struct register_base_of register_conversion(false); // Register the down-cast, if appropriate. - this->register_downcast((Base*)0, boost::python::detail::is_polymorphic()); + this->register_downcast((Base*)0, PXR_BOOST_NAMESPACE::python::detail::is_polymorphic()); } private: - static inline void register_downcast(void*, boost::python::detail::false_) {} + static inline void register_downcast(void*, PXR_BOOST_NAMESPACE::python::detail::false_) {} template - static inline void register_downcast(Base*, boost::python::detail::true_) + static inline void register_downcast(Base*, PXR_BOOST_NAMESPACE::python::detail::true_) { register_conversion(true); } @@ -103,7 +104,7 @@ inline void register_shared_ptr_from_python_and_casts(T*, Bases) // interface to mpl::for_each to avoid an MSVC 6 bug. // register_dynamic_id(); - mpl::for_each(register_base_of(), (Bases*)0, (boost::python::detail::add_pointer*)0); + mpl::for_each(register_base_of(), (Bases*)0, (PXR_BOOST_NAMESPACE::python::detail::add_pointer*)0); } // @@ -114,7 +115,7 @@ struct select_held_type : mpl::if_< mpl::or_< python::detail::specifies_bases - , boost::python::detail::is_same + , PXR_BOOST_NAMESPACE::python::detail::is_same > , Prev , T @@ -161,9 +162,9 @@ struct class_metadata >::type bases; typedef mpl::or_< - boost::python::detail::is_same - , boost::python::detail::is_same - , boost::python::detail::is_same + PXR_BOOST_NAMESPACE::python::detail::is_same + , PXR_BOOST_NAMESPACE::python::detail::is_same + , PXR_BOOST_NAMESPACE::python::detail::is_same > is_noncopyable; // @@ -172,11 +173,11 @@ struct class_metadata // Compute the actual type that will be held in the Holder. typedef typename mpl::if_< - boost::python::detail::is_same, T, held_type_arg + PXR_BOOST_NAMESPACE::python::detail::is_same, T, held_type_arg >::type held_type; // Determine if the object will be held by value - typedef mpl::bool_::value> use_value_holder; + typedef mpl::bool_::value> use_value_holder; // Compute the "wrapped type", that is, if held_type is a smart // pointer, we're talking about the pointee. @@ -190,7 +191,7 @@ struct class_metadata typedef mpl::bool_< mpl::or_< has_back_reference - , boost::python::detail::is_same + , PXR_BOOST_NAMESPACE::python::detail::is_same , is_base_and_derived >::value > use_back_reference; @@ -219,7 +220,7 @@ struct class_metadata template inline static void register_aux(python::wrapper*) { - typedef typename mpl::not_ >::type use_callback; + typedef typename mpl::not_ >::type use_callback; class_metadata::register_aux2((T2*)0, use_callback()); } @@ -247,7 +248,7 @@ struct class_metadata // inline static void maybe_register_pointer_to_python(...) {} -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) { objects::copy_class_object(python::type_id(), python::type_id >()); @@ -264,7 +265,7 @@ struct class_metadata , make_ptr_instance > >() ); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES // explicit qualification of type_id makes msvc6 happy objects::copy_class_object(python::type_id(), python::type_id()); #endif @@ -279,7 +280,7 @@ struct class_metadata inline static void maybe_register_class_to_python(T2*, mpl::false_) { python::detail::force_instantiate(class_cref_wrapper >()); -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES // explicit qualification of type_id makes msvc6 happy objects::copy_class_object(python::type_id(), python::type_id()); #endif @@ -300,7 +301,7 @@ struct class_metadata } }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/object/class_wrapper.hpp b/pxr/external/boost/python/object/class_wrapper.hpp index b006fd7ff8..52e838ba07 100644 --- a/pxr/external/boost/python/object/class_wrapper.hpp +++ b/pxr/external/boost/python/object/class_wrapper.hpp @@ -11,18 +11,19 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_WRAPPER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/to_python_converter.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // // These two classes adapt the static execute function of a class @@ -39,7 +40,7 @@ struct class_cref_wrapper { return MakeInstance::execute(boost::ref(x)); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const *get_pytype() { return converter::registered_pytype_direct::get_pytype(); } #endif }; @@ -52,12 +53,12 @@ struct class_value_wrapper { return MakeInstance::execute(x); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const *get_pytype() { return MakeInstance::get_pytype(); } #endif }; -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CLASS_WRAPPER_HPP diff --git a/pxr/external/boost/python/object/enum_base.hpp b/pxr/external/boost/python/object/enum_base.hpp index 5c6bf7e602..4ec6ad2106 100644 --- a/pxr/external/boost/python/object/enum_base.hpp +++ b/pxr/external/boost/python/object/enum_base.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ENUM_BASE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,9 +23,9 @@ # include "pxr/external/boost/python/converter/convertible_function.hpp" # include "pxr/external/boost/python/converter/constructor_function.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -struct BOOST_PYTHON_DECL enum_base : python::api::object +struct PXR_BOOST_PYTHON_DECL enum_base : python::api::object { protected: enum_base( @@ -42,7 +43,7 @@ struct BOOST_PYTHON_DECL enum_base : python::api::object static PyObject* to_python(PyTypeObject* type, long x); }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ENUM_BASE_HPP diff --git a/pxr/external/boost/python/object/find_instance.hpp b/pxr/external/boost/python/object/find_instance.hpp index 84120f5bba..47fb6d5308 100644 --- a/pxr/external/boost/python/object/find_instance.hpp +++ b/pxr/external/boost/python/object/find_instance.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FIND_INSTANCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,16 +19,16 @@ # include "pxr/external/boost/python/type_id.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // Given a type_id, find the instance data which corresponds to it, or // return 0 in case no such type is held. If null_shared_ptr_only is // true and the type being sought is a shared_ptr, only find an // instance if it turns out to be NULL. Needed for shared_ptr rvalue // from_python support. -BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_shared_ptr_only = false); +PXR_BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_shared_ptr_only = false); -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FIND_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/forward.hpp b/pxr/external/boost/python/object/forward.hpp index 0cc1a03abc..f463119ac8 100644 --- a/pxr/external/boost/python/object/forward.hpp +++ b/pxr/external/boost/python/object/forward.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FORWARD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/detail/copy_ctor_mutates_rhs.hpp" # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // Very much like boost::reference_wrapper, except that in this // case T can be a reference already without causing a @@ -31,8 +32,8 @@ namespace boost { namespace python { namespace objects { template struct reference_to_value { - typedef typename boost::python::detail::add_lvalue_reference::type>::type reference; + typedef typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference::type>::type reference; reference_to_value(reference x) : m_value(x) {} reference get() const { return m_value; } @@ -46,7 +47,7 @@ struct reference_to_value template struct forward : mpl::if_< - mpl::or_, boost::python::detail::is_scalar > + mpl::or_, PXR_BOOST_NAMESPACE::python::detail::is_scalar > , T , reference_to_value > @@ -75,7 +76,7 @@ struct unforward_cref template struct unforward_cref > - : boost::python::detail::add_lvalue_reference::type> + : PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference::type> { }; @@ -100,7 +101,7 @@ T const& do_unforward(T const& x, ...) return x; } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FORWARD_HPP diff --git a/pxr/external/boost/python/object/function.hpp b/pxr/external/boost/python/object/function.hpp index 5a1c595c3d..7ff20d9bbb 100644 --- a/pxr/external/boost/python/object/function.hpp +++ b/pxr/external/boost/python/object/function.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,10 +24,10 @@ # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object/py_function.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -struct BOOST_PYTHON_DECL function : PyObject +struct PXR_BOOST_PYTHON_DECL function : PyObject { function( py_function const& @@ -88,7 +89,7 @@ inline object const& function::name() const return this->m_name; } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HPP diff --git a/pxr/external/boost/python/object/function_doc_signature.hpp b/pxr/external/boost/python/object/function_doc_signature.hpp index f5b1c47055..aec0561c6f 100644 --- a/pxr/external/boost/python/object/function_doc_signature.hpp +++ b/pxr/external/boost/python/object/function_doc_signature.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_DOC_SIGNATURE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ #include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { class function_doc_signature_generator{ static const char * py_type_str(const python::detail::signature_element &s); @@ -42,7 +43,7 @@ class function_doc_signature_generator{ static list function_doc_signatures( function const * f); }; -}}}//end of namespace boost::python::objects +}}}//end of namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif //PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_DOC_SIGNATURE_HPP diff --git a/pxr/external/boost/python/object/function_handle.hpp b/pxr/external/boost/python/object/function_handle.hpp index 94f828ca54..fe1dbea859 100644 --- a/pxr/external/boost/python/object/function_handle.hpp +++ b/pxr/external/boost/python/object/function_handle.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HANDLE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,9 +22,9 @@ # include "pxr/external/boost/python/object/py_function.hpp" # include "pxr/external/boost/python/signature.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL handle<> function_handle_impl(py_function const& f); +PXR_BOOST_PYTHON_DECL handle<> function_handle_impl(py_function const& f); // Just like function_object, but returns a handle<> instead. Using // this for arg_to_python<> allows us to break a circular dependency @@ -50,7 +51,7 @@ handle<> make_function_handle(F f) return objects::function_handle(f, python::detail::get_signature(f)); } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_HANDLE_HPP diff --git a/pxr/external/boost/python/object/function_object.hpp b/pxr/external/boost/python/object/function_object.hpp index edb5fe9deb..014e7e229e 100644 --- a/pxr/external/boost/python/object/function_object.hpp +++ b/pxr/external/boost/python/object/function_object.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_OBJECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,32 +22,32 @@ # include "pxr/external/boost/python/args_fwd.hpp" # include "pxr/external/boost/python/object/py_function.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { - BOOST_PYTHON_DECL api::object function_object( + PXR_BOOST_PYTHON_DECL api::object function_object( py_function const& f , python::detail::keyword_range const&); - BOOST_PYTHON_DECL api::object function_object( + PXR_BOOST_PYTHON_DECL api::object function_object( py_function const& f , python::detail::keyword_range const&); - BOOST_PYTHON_DECL api::object function_object(py_function const& f); + PXR_BOOST_PYTHON_DECL api::object function_object(py_function const& f); // Add an attribute to the name_space with the given name. If it is // a Boost.Python function object // (boost/python/object/function.hpp), and an existing function is // already there, add it as an overload. - BOOST_PYTHON_DECL void add_to_namespace( + PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute); - BOOST_PYTHON_DECL void add_to_namespace( + PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute, char const* doc); } -}} // namespace boost::python::objects +}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FUNCTION_OBJECT_HPP diff --git a/pxr/external/boost/python/object/inheritance.hpp b/pxr/external/boost/python/object/inheritance.hpp index dddd076c42..15296e481e 100644 --- a/pxr/external/boost/python/object/inheritance.hpp +++ b/pxr/external/boost/python/object/inheritance.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { typedef type_info class_id; using python::type_id; @@ -31,10 +32,10 @@ using python::type_id; typedef std::pair dynamic_id_t; typedef dynamic_id_t (*dynamic_id_function)(void*); -BOOST_PYTHON_DECL void register_dynamic_id_aux( +PXR_BOOST_PYTHON_DECL void register_dynamic_id_aux( class_id static_id, dynamic_id_function get_dynamic_id); -BOOST_PYTHON_DECL void add_cast( +PXR_BOOST_PYTHON_DECL void add_cast( class_id src_t, class_id dst_t, void* (*cast)(void*), bool is_downcast); // @@ -68,9 +69,9 @@ struct non_polymorphic_id_generator template struct dynamic_id_generator : mpl::if_< - boost::python::detail::is_polymorphic - , boost::python::objects::polymorphic_id_generator - , boost::python::objects::non_polymorphic_id_generator + PXR_BOOST_NAMESPACE::python::detail::is_polymorphic + , PXR_BOOST_NAMESPACE::python::objects::polymorphic_id_generator + , PXR_BOOST_NAMESPACE::python::objects::non_polymorphic_id_generator > {}; @@ -114,7 +115,7 @@ struct implicit_cast_generator template struct cast_generator : mpl::if_< - boost::python::detail::is_base_and_derived + PXR_BOOST_NAMESPACE::python::detail::is_base_and_derived , implicit_cast_generator , dynamic_cast_generator > @@ -137,7 +138,7 @@ inline void register_conversion( ); } -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_HPP diff --git a/pxr/external/boost/python/object/inheritance_query.hpp b/pxr/external/boost/python/object/inheritance_query.hpp index 66beafa97e..ee85b6a3a9 100644 --- a/pxr/external/boost/python/object/inheritance_query.hpp +++ b/pxr/external/boost/python/object/inheritance_query.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_QUERY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,12 +19,12 @@ # include "pxr/external/boost/python/type_id.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL void* find_static_type(void* p, type_info src, type_info dst); -BOOST_PYTHON_DECL void* find_dynamic_type(void* p, type_info src, type_info dst); +PXR_BOOST_PYTHON_DECL void* find_static_type(void* p, type_info src, type_info dst); +PXR_BOOST_PYTHON_DECL void* find_dynamic_type(void* p, type_info src, type_info dst); -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INHERITANCE_QUERY_HPP diff --git a/pxr/external/boost/python/object/instance.hpp b/pxr/external/boost/python/object/instance.hpp index 61958d1eb0..9413987120 100644 --- a/pxr/external/boost/python/object/instance.hpp +++ b/pxr/external/boost/python/object/instance.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INSTANCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,12 +21,12 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" # include -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { struct instance_holder; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // Each extension instance will be one of these template @@ -36,8 +37,8 @@ struct instance PyObject* weakrefs; instance_holder* objects; - typedef typename boost::python::detail::type_with_alignment< - boost::python::detail::alignment_of::value + typedef typename PXR_BOOST_NAMESPACE::python::detail::type_with_alignment< + PXR_BOOST_NAMESPACE::python::detail::alignment_of::value >::type align_t; union @@ -54,11 +55,11 @@ struct additional_instance_size typedef instance instance_char; BOOST_STATIC_CONSTANT(std::size_t, value = sizeof(instance_data) - - BOOST_PYTHON_OFFSETOF(instance_char,storage) + - boost::python::detail::alignment_of::value); + PXR_BOOST_PYTHON_OFFSETOF(instance_char,storage) + + PXR_BOOST_NAMESPACE::python::detail::alignment_of::value); }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/iterator.hpp b/pxr/external/boost/python/object/iterator.hpp index ee291a1809..f46bc9f30b 100644 --- a/pxr/external/boost/python/object/iterator.hpp +++ b/pxr/external/boost/python/object/iterator.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -38,7 +39,7 @@ # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // CallPolicies for the next() method of iterators. We don't want // users to have to explicitly specify that the references returned by @@ -210,8 +211,8 @@ inline object make_iterator_function( ) { typedef typename Accessor1::result_type iterator; - typedef typename boost::python::detail::add_const::type iterator_const; - typedef typename boost::python::detail::add_lvalue_reference::type iterator_cref; + typedef typename PXR_BOOST_NAMESPACE::python::detail::add_const::type iterator_const; + typedef typename PXR_BOOST_NAMESPACE::python::detail::add_lvalue_reference::type iterator_cref; return detail::make_iterator_function( get_start @@ -233,7 +234,7 @@ inline iterator_range::iterator_range( { } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_HPP diff --git a/pxr/external/boost/python/object/iterator_core.hpp b/pxr/external/boost/python/object/iterator_core.hpp index 21c335c40f..85a589c32f 100644 --- a/pxr/external/boost/python/object/iterator_core.hpp +++ b/pxr/external/boost/python/object/iterator_core.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_CORE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,12 +19,12 @@ # include "pxr/external/boost/python/object_fwd.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL object const& identity_function(); -BOOST_PYTHON_DECL void stop_iteration_error(); +PXR_BOOST_PYTHON_DECL object const& identity_function(); +PXR_BOOST_PYTHON_DECL void stop_iteration_error(); -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITERATOR_CORE_HPP diff --git a/pxr/external/boost/python/object/life_support.hpp b/pxr/external/boost/python/object/life_support.hpp index 75a5c9e6e4..b3d1402a9a 100644 --- a/pxr/external/boost/python/object/life_support.hpp +++ b/pxr/external/boost/python/object/life_support.hpp @@ -11,17 +11,18 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_LIFE_SUPPORT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -BOOST_PYTHON_DECL PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient); +PXR_BOOST_PYTHON_DECL PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient); -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_LIFE_SUPPORT_HPP diff --git a/pxr/external/boost/python/object/make_holder.hpp b/pxr/external/boost/python/object/make_holder.hpp index 56aac57bc2..cb0f25ad65 100644 --- a/pxr/external/boost/python/object/make_holder.hpp +++ b/pxr/external/boost/python/object/make_holder.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_HOLDER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/object/instance.hpp" # include "pxr/external/boost/python/converter/registry.hpp" -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) +#if !defined( PXR_BOOST_PYTHON_NO_PY_SIGNATURES) && defined( PXR_BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) # include "pxr/external/boost/python/detail/python_type.hpp" #endif @@ -42,19 +43,19 @@ # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { template struct make_holder; -# define BOOST_PYTHON_DO_FORWARD_ARG(z, index, _) , f##index(a##index) +# define PXR_BOOST_PYTHON_DO_FORWARD_ARG(z, index, _) , f##index(a##index) // specializations... -# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/make_holder.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/make_holder.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_DO_FORWARD_ARG +# undef PXR_BOOST_PYTHON_DO_FORWARD_ARG -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_HOLDER_HPP @@ -93,8 +94,8 @@ struct make_holder # endif static void execute( -#if !defined( BOOST_PYTHON_NO_PY_SIGNATURES) && defined( BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) - boost::python::detail::python_class *p +#if !defined( PXR_BOOST_PYTHON_NO_PY_SIGNATURES) && defined( PXR_BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE) + PXR_BOOST_NAMESPACE::python::detail::python_class *p #else PyObject *p #endif @@ -103,10 +104,10 @@ struct make_holder typedef instance instance_t; void* memory = Holder::allocate(p, offsetof(instance_t, storage), sizeof(Holder), - boost::python::detail::alignment_of::value); + PXR_BOOST_NAMESPACE::python::detail::alignment_of::value); try { (new (memory) Holder( - p BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_DO_FORWARD_ARG, nil)))->install(p); + p BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_DO_FORWARD_ARG, nil)))->install(p); } catch(...) { Holder::deallocate(p, memory); diff --git a/pxr/external/boost/python/object/make_instance.hpp b/pxr/external/boost/python/object/make_instance.hpp index ab347c2d47..d3d7c2c206 100644 --- a/pxr/external/boost/python/object/make_instance.hpp +++ b/pxr/external/boost/python/object/make_instance.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_INSTANCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -25,7 +26,7 @@ # include # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { template struct make_instance_impl @@ -35,8 +36,8 @@ struct make_instance_impl template static inline PyObject* execute(Arg& x) { - BOOST_MPL_ASSERT((mpl::or_, - boost::python::detail::is_union >)); + BOOST_MPL_ASSERT((mpl::or_, + PXR_BOOST_NAMESPACE::python::detail::is_union >)); PyTypeObject* type = Derived::get_class_object(x); @@ -84,14 +85,14 @@ struct make_instance static inline Holder* construct(void* storage, PyObject* instance, reference_wrapper x) { size_t allocated = objects::additional_instance_size::value; - void* aligned_storage = ::boost::alignment::align(boost::python::detail::alignment_of::value, + void* aligned_storage = ::boost::alignment::align(PXR_BOOST_NAMESPACE::python::detail::alignment_of::value, sizeof(Holder), storage, allocated); return new (aligned_storage) Holder(instance, x); } }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/make_ptr_instance.hpp b/pxr/external/boost/python/object/make_ptr_instance.hpp index d8e5d1669c..edc54cb029 100644 --- a/pxr/external/boost/python/object/make_ptr_instance.hpp +++ b/pxr/external/boost/python/object/make_ptr_instance.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_PTR_INSTANCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,11 @@ # include # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { + using boost::get_pointer; // Enable ADL for boost types +} + +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { template struct make_ptr_instance @@ -44,7 +49,7 @@ struct make_ptr_instance { return get_class_object_impl(get_pointer(x)); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static inline PyTypeObject const* get_pytype() { return converter::registered::converters.get_class_object(); @@ -58,7 +63,7 @@ struct make_ptr_instance return 0; // means "return None". PyTypeObject* derived = get_derived_class_object( - BOOST_DEDUCED_TYPENAME boost::python::detail::is_polymorphic::type(), p); + BOOST_DEDUCED_TYPENAME PXR_BOOST_NAMESPACE::python::detail::is_polymorphic::type(), p); if (derived) return derived; @@ -66,7 +71,7 @@ struct make_ptr_instance } template - static inline PyTypeObject* get_derived_class_object(boost::python::detail::true_, U const volatile* x) + static inline PyTypeObject* get_derived_class_object(PXR_BOOST_NAMESPACE::python::detail::true_, U const volatile* x) { converter::registration const* r = converter::registry::query( type_info(typeid(*x)) @@ -75,14 +80,14 @@ struct make_ptr_instance } template - static inline PyTypeObject* get_derived_class_object(boost::python::detail::false_, U*) + static inline PyTypeObject* get_derived_class_object(PXR_BOOST_NAMESPACE::python::detail::false_, U*) { return 0; } }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_MAKE_PTR_INSTANCE_HPP diff --git a/pxr/external/boost/python/object/pickle_support.hpp b/pxr/external/boost/python/object/pickle_support.hpp index 2ecf10ca36..44a58b7d81 100644 --- a/pxr/external/boost/python/object/pickle_support.hpp +++ b/pxr/external/boost/python/object/pickle_support.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,7 +19,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { @@ -27,7 +28,7 @@ namespace api using api::object; class tuple; -BOOST_PYTHON_DECL object const& make_instance_reduce_function(); +PXR_BOOST_PYTHON_DECL object const& make_instance_reduce_function(); struct pickle_suite; @@ -130,7 +131,7 @@ namespace detail { } // namespace detail -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_HPP diff --git a/pxr/external/boost/python/object/pointer_holder.hpp b/pxr/external/boost/python/object/pointer_holder.hpp index 101d38d9c8..a8b36e1a67 100644 --- a/pxr/external/boost/python/object/pointer_holder.hpp +++ b/pxr/external/boost/python/object/pointer_holder.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_POINTER_HOLDER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -47,16 +48,20 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { + using boost::get_pointer; // Enable ADL for boost types +} + +namespace PXR_BOOST_NAMESPACE { namespace python { template class wrapper; }} -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) +#define PXR_BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) template struct pointer_holder : instance_holder @@ -67,7 +72,7 @@ struct pointer_holder : instance_holder // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/pointer_holder.hpp", 1)) +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/pointer_holder.hpp", 1)) # include BOOST_PP_ITERATE() private: // types @@ -103,7 +108,7 @@ struct pointer_holder_back_reference : instance_holder pointer_holder_back_reference(Pointer); // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/pointer_holder.hpp", 2)) +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/pointer_holder.hpp", 2)) # include BOOST_PP_ITERATE() private: // required holder implementation @@ -113,7 +118,7 @@ struct pointer_holder_back_reference : instance_holder Pointer m_p; }; -# undef BOOST_PYTHON_UNFORWARD_LOCAL +# undef PXR_BOOST_PYTHON_UNFORWARD_LOCAL template inline pointer_holder::pointer_holder(Pointer p) @@ -138,7 +143,7 @@ inline pointer_holder_back_reference::pointer_holder_back_referen template void* pointer_holder::holds(type_info dst_t, bool null_ptr_only) { - typedef typename boost::python::detail::remove_const< Value >::type non_const_value; + typedef typename PXR_BOOST_NAMESPACE::python::detail::remove_const< Value >::type non_const_value; if (dst_t == python::type_id() && !(null_ptr_only && get_pointer(this->m_p)) @@ -184,7 +189,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t); } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_POINTER_HOLDER_HPP @@ -206,7 +211,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool # endif pointer_holder(PyObject* self BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) : m_p(new Value( - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_UNFORWARD_LOCAL, nil) )) { python::detail::initialize_wrapper(self, get_pointer(this->m_p)); @@ -229,7 +234,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool pointer_holder_back_reference( PyObject* p BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) : m_p(new held_type( - p BOOST_PP_COMMA_IF(N) BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + p BOOST_PP_COMMA_IF(N) BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_UNFORWARD_LOCAL, nil) )) {} diff --git a/pxr/external/boost/python/object/py_function.hpp b/pxr/external/boost/python/object/py_function.hpp index 2ae2820dc2..f4021c7b14 100644 --- a/pxr/external/boost/python/object/py_function.hpp +++ b/pxr/external/boost/python/object/py_function.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PY_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,14 +22,14 @@ # include # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { // This type is used as a "generalized Python callback", wrapping the // function signature: // // PyObject* (PyObject* args, PyObject* keywords) -struct BOOST_PYTHON_DECL py_function_impl_base +struct PXR_BOOST_PYTHON_DECL py_function_impl_base { virtual ~py_function_impl_base(); virtual PyObject* operator()(PyObject*, PyObject*) = 0; @@ -182,7 +183,7 @@ struct py_function mutable std::unique_ptr m_impl; }; -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PY_FUNCTION_HPP diff --git a/pxr/external/boost/python/object/stl_iterator_core.hpp b/pxr/external/boost/python/object/stl_iterator_core.hpp index b5a4801e6f..9cc3133c1e 100644 --- a/pxr/external/boost/python/object/stl_iterator_core.hpp +++ b/pxr/external/boost/python/object/stl_iterator_core.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_STL_ITERATOR_CORE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,21 +20,21 @@ # include "pxr/external/boost/python/object_fwd.hpp" # include "pxr/external/boost/python/handle_fwd.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -struct BOOST_PYTHON_DECL stl_input_iterator_impl +struct PXR_BOOST_PYTHON_DECL stl_input_iterator_impl { stl_input_iterator_impl(); - stl_input_iterator_impl(boost::python::object const &ob); + stl_input_iterator_impl(PXR_BOOST_NAMESPACE::python::object const &ob); void increment(); bool equal(stl_input_iterator_impl const &that) const; - boost::python::handle<> const ¤t() const; + PXR_BOOST_NAMESPACE::python::handle<> const ¤t() const; private: - boost::python::object it_; - boost::python::handle<> ob_; + PXR_BOOST_NAMESPACE::python::object it_; + PXR_BOOST_NAMESPACE::python::handle<> ob_; }; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_STL_ITERATOR_CORE_HPP diff --git a/pxr/external/boost/python/object/value_holder.hpp b/pxr/external/boost/python/object/value_holder.hpp index 5e8ac4724e..dc059e4dec 100644 --- a/pxr/external/boost/python/object/value_holder.hpp +++ b/pxr/external/boost/python/object/value_holder.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -42,9 +43,9 @@ # include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { -#define BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) +#define PXR_BOOST_PYTHON_UNFORWARD_LOCAL(z, n, _) BOOST_PP_COMMA_IF(n) objects::do_unforward(a##n,0) template struct value_holder : instance_holder @@ -53,7 +54,7 @@ struct value_holder : instance_holder typedef Value value_type; // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/value_holder.hpp", 1)) +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/value_holder.hpp", 1)) # include BOOST_PP_ITERATE() private: // required holder implementation @@ -80,7 +81,7 @@ struct value_holder_back_reference : instance_holder typedef Value value_type; // Forward construction to the held object -# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/value_holder.hpp", 2)) +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object/value_holder.hpp", 2)) # include BOOST_PP_ITERATE() private: // required holder implementation @@ -90,7 +91,7 @@ struct value_holder_back_reference : instance_holder Held m_held; }; -# undef BOOST_PYTHON_UNFORWARD_LOCAL +# undef PXR_BOOST_PYTHON_UNFORWARD_LOCAL template void* value_holder::holds(type_info dst_t, bool /*null_ptr_only*/) @@ -118,7 +119,7 @@ void* value_holder_back_reference::holds( return find_static_type(x, src_t, dst_t); } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_HPP @@ -142,7 +143,7 @@ void* value_holder_back_reference::holds( value_holder( PyObject* self BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) : m_held( - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_UNFORWARD_LOCAL, nil) ) { python::detail::initialize_wrapper(self, boost::addressof(this->m_held)); @@ -167,7 +168,7 @@ void* value_holder_back_reference::holds( PyObject* p BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, a)) : m_held( p BOOST_PP_COMMA_IF(N) - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_UNFORWARD_LOCAL, nil) ) { } diff --git a/pxr/external/boost/python/object/value_holder_fwd.hpp b/pxr/external/boost/python/object/value_holder_fwd.hpp index 0a5ab74481..e43af74127 100644 --- a/pxr/external/boost/python/object/value_holder_fwd.hpp +++ b/pxr/external/boost/python/object/value_holder_fwd.hpp @@ -11,18 +11,19 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { struct no_back_reference; template struct value_holder_generator; -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_VALUE_HOLDER_FWD_HPP diff --git a/pxr/external/boost/python/object_attributes.hpp b/pxr/external/boost/python/object_attributes.hpp index 51f6d05f48..b765abad2d 100644 --- a/pxr/external/boost/python/object_attributes.hpp +++ b/pxr/external/boost/python/object_attributes.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ATTRIBUTES_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object_protocol.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { struct const_attribute_policies { @@ -122,7 +123,7 @@ inline void objattribute_policies::del( python::delattr(target, key); } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ATTRIBUTES_HPP diff --git a/pxr/external/boost/python/object_call.hpp b/pxr/external/boost/python/object_call.hpp index 65937d5d97..52e7e6eee7 100644 --- a/pxr/external/boost/python/object_call.hpp +++ b/pxr/external/boost/python/object_call.hpp @@ -1,4 +1,4 @@ -# if !defined(BOOST_PYTHON_SYNOPSIS) +# if !defined(PXR_BOOST_PYTHON_SYNOPSIS) # // # // Copyright 2024 Pixar # // Licensed under the terms set forth in the LICENSE.txt file available at @@ -25,4 +25,4 @@ } # undef N -# endif // BOOST_PYTHON_SYNOPSIS +# endif // PXR_BOOST_PYTHON_SYNOPSIS diff --git a/pxr/external/boost/python/object_core.hpp b/pxr/external/boost/python/object_core.hpp index befed56aef..82aad77ffa 100644 --- a/pxr/external/boost/python/object_core.hpp +++ b/pxr/external/boost/python/object_core.hpp @@ -11,12 +11,13 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_CORE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include #else -# define BOOST_PYTHON_OBJECT_HAS_IS_NONE // added 2010-03-15 by rwgk +# define PXR_BOOST_PYTHON_OBJECT_HAS_IS_NONE // added 2010-03-15 by rwgk # include "pxr/external/boost/python/detail/prefix.hpp" @@ -45,11 +46,11 @@ # include "pxr/external/boost/python/detail/type_traits.hpp" // XXX: Workaround for distcc issues with BOOST_PP_ITERATE -# define BOOST_PYTHON_SYNOPSIS +# define PXR_BOOST_PYTHON_SYNOPSIS # include "pxr/external/boost/python/object_call.hpp" -# undef BOOST_PYTHON_SYNOPSIS +# undef PXR_BOOST_PYTHON_SYNOPSIS -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -94,7 +95,7 @@ namespace api // // is_proxy -- proxy type detection // - BOOST_PYTHON_IS_XXX_DEF(proxy, boost::python::api::proxy, 1) + PXR_BOOST_PYTHON_IS_XXX_DEF(proxy, PXR_BOOST_NAMESPACE::python::api::proxy, 1) template struct object_initializer; @@ -111,7 +112,7 @@ namespace api // object operator()() const; -# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object_call.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/object_call.hpp")) # include BOOST_PP_ITERATE() detail::args_proxy operator* () const; @@ -221,7 +222,7 @@ namespace api template struct is_derived - : boost::python::detail::is_convertible< + : PXR_BOOST_NAMESPACE::python::detail::is_convertible< typename detail::remove_reference::type* , U const* > @@ -265,7 +266,7 @@ namespace api } // Throw error_already_set() if the handle is null. - BOOST_PYTHON_DECL explicit object(handle<> const&); + PXR_BOOST_PYTHON_DECL explicit object(handle<> const&); private: public: // implementation detail -- for internal use only @@ -277,12 +278,12 @@ namespace api // Macros for forwarding constructors in classes derived from // object. Derived classes will usually want these as an // implementation detail -# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \ - inline explicit derived(::boost::python::detail::borrowed_reference p) \ +# define PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \ + inline explicit derived(::PXR_BOOST_NAMESPACE::python::detail::borrowed_reference p) \ : base(p) {} \ - inline explicit derived(::boost::python::detail::new_reference p) \ + inline explicit derived(::PXR_BOOST_NAMESPACE::python::detail::new_reference p) \ : base(p) {} \ - inline explicit derived(::boost::python::detail::new_non_null_reference p) \ + inline explicit derived(::PXR_BOOST_NAMESPACE::python::detail::new_non_null_reference p) \ : base(p) {} // @@ -324,7 +325,7 @@ namespace api static PyObject* get(T const& x, U) { - return python::incref(get_managed_object(x, boost::python::tag)); + return python::incref(get_managed_object(x, PXR_BOOST_NAMESPACE::python::tag)); } }; @@ -377,17 +378,17 @@ template detail::args_proxy api::object_operators::operator* () const { object_cref2 x = *static_cast(this); - return boost::python::detail::args_proxy(x); + return PXR_BOOST_NAMESPACE::python::detail::args_proxy(x); } template object api::object_operators::operator()(detail::args_proxy const &args) const { U const& self = *static_cast(this); - PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), + PyObject *result = PyObject_Call(get_managed_object(self, PXR_BOOST_NAMESPACE::python::tag), args.operator object().ptr(), 0); - return object(boost::python::detail::new_reference(result)); + return object(PXR_BOOST_NAMESPACE::python::detail::new_reference(result)); } @@ -396,10 +397,10 @@ object api::object_operators::operator()(detail::args_proxy const &args, detail::kwds_proxy const &kwds) const { U const& self = *static_cast(this); - PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), + PyObject *result = PyObject_Call(get_managed_object(self, PXR_BOOST_NAMESPACE::python::tag), args.operator object().ptr(), kwds.operator object().ptr()); - return object(boost::python::detail::new_reference(result)); + return object(PXR_BOOST_NAMESPACE::python::detail::new_reference(result)); } @@ -478,7 +479,7 @@ namespace converter { return python::detail::new_non_null_reference(x); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const *get_pytype() {return 0;} #endif }; @@ -489,7 +490,7 @@ inline PyObject* get_managed_object(object const& x, tag_t) return x.ptr(); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python # include "pxr/external/boost/python/slice_nil.hpp" diff --git a/pxr/external/boost/python/object_fwd.hpp b/pxr/external/boost/python/object_fwd.hpp index 4353057976..d214eed111 100644 --- a/pxr/external/boost/python/object_fwd.hpp +++ b/pxr/external/boost/python/object_fwd.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FWD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,13 +19,13 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { class object; } using api::object; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_FWD_HPP diff --git a/pxr/external/boost/python/object_items.hpp b/pxr/external/boost/python/object_items.hpp index ec90b395e8..01165a3aa1 100644 --- a/pxr/external/boost/python/object_items.hpp +++ b/pxr/external/boost/python/object_items.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITEMS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object_protocol.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { struct const_item_policies { @@ -92,7 +93,7 @@ inline void item_policies::del( delitem(target, key); } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_ITEMS_HPP diff --git a/pxr/external/boost/python/object_operators.hpp b/pxr/external/boost/python/object_operators.hpp index 863062e96d..98e5e5f34b 100644 --- a/pxr/external/boost/python/object_operators.hpp +++ b/pxr/external/boost/python/object_operators.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_OPERATORS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -25,7 +26,7 @@ # include -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { template char is_object_operators_helper(object_operators const*); @@ -53,9 +54,9 @@ template struct enable_binary : boost::iterators::enable_if, T> {}; -# define BOOST_PYTHON_BINARY_RETURN(T) typename enable_binary::type +# define PXR_BOOST_PYTHON_BINARY_RETURN(T) typename enable_binary::type # else -# define BOOST_PYTHON_BINARY_RETURN(T) T +# define PXR_BOOST_PYTHON_BINARY_RETURN(T) T # endif template @@ -86,61 +87,61 @@ object_operators::operator!() const return !is_true; } -# define BOOST_PYTHON_COMPARE_OP(op, opid) \ +# define PXR_BOOST_PYTHON_COMPARE_OP(op, opid) \ template \ -BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ +PXR_BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ { \ return PyObject_RichCompare( \ object(l).ptr(), object(r).ptr(), opid); \ } -# undef BOOST_PYTHON_COMPARE_OP +# undef PXR_BOOST_PYTHON_COMPARE_OP -# define BOOST_PYTHON_BINARY_OPERATOR(op) \ -BOOST_PYTHON_DECL object operator op(object const& l, object const& r); \ +# define PXR_BOOST_PYTHON_BINARY_OPERATOR(op) \ +PXR_BOOST_PYTHON_DECL object operator op(object const& l, object const& r); \ template \ -BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ +PXR_BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ { \ return object(l) op object(r); \ } -BOOST_PYTHON_BINARY_OPERATOR(>) -BOOST_PYTHON_BINARY_OPERATOR(>=) -BOOST_PYTHON_BINARY_OPERATOR(<) -BOOST_PYTHON_BINARY_OPERATOR(<=) -BOOST_PYTHON_BINARY_OPERATOR(==) -BOOST_PYTHON_BINARY_OPERATOR(!=) -BOOST_PYTHON_BINARY_OPERATOR(+) -BOOST_PYTHON_BINARY_OPERATOR(-) -BOOST_PYTHON_BINARY_OPERATOR(*) -BOOST_PYTHON_BINARY_OPERATOR(/) -BOOST_PYTHON_BINARY_OPERATOR(%) -BOOST_PYTHON_BINARY_OPERATOR(<<) -BOOST_PYTHON_BINARY_OPERATOR(>>) -BOOST_PYTHON_BINARY_OPERATOR(&) -BOOST_PYTHON_BINARY_OPERATOR(^) -BOOST_PYTHON_BINARY_OPERATOR(|) -# undef BOOST_PYTHON_BINARY_OPERATOR +PXR_BOOST_PYTHON_BINARY_OPERATOR(>) +PXR_BOOST_PYTHON_BINARY_OPERATOR(>=) +PXR_BOOST_PYTHON_BINARY_OPERATOR(<) +PXR_BOOST_PYTHON_BINARY_OPERATOR(<=) +PXR_BOOST_PYTHON_BINARY_OPERATOR(==) +PXR_BOOST_PYTHON_BINARY_OPERATOR(!=) +PXR_BOOST_PYTHON_BINARY_OPERATOR(+) +PXR_BOOST_PYTHON_BINARY_OPERATOR(-) +PXR_BOOST_PYTHON_BINARY_OPERATOR(*) +PXR_BOOST_PYTHON_BINARY_OPERATOR(/) +PXR_BOOST_PYTHON_BINARY_OPERATOR(%) +PXR_BOOST_PYTHON_BINARY_OPERATOR(<<) +PXR_BOOST_PYTHON_BINARY_OPERATOR(>>) +PXR_BOOST_PYTHON_BINARY_OPERATOR(&) +PXR_BOOST_PYTHON_BINARY_OPERATOR(^) +PXR_BOOST_PYTHON_BINARY_OPERATOR(|) +# undef PXR_BOOST_PYTHON_BINARY_OPERATOR -# define BOOST_PYTHON_INPLACE_OPERATOR(op) \ -BOOST_PYTHON_DECL object& operator op(object& l, object const& r); \ +# define PXR_BOOST_PYTHON_INPLACE_OPERATOR(op) \ +PXR_BOOST_PYTHON_DECL object& operator op(object& l, object const& r); \ template \ object& operator op(object& l, R const& r) \ { \ return l op object(r); \ } -BOOST_PYTHON_INPLACE_OPERATOR(+=) -BOOST_PYTHON_INPLACE_OPERATOR(-=) -BOOST_PYTHON_INPLACE_OPERATOR(*=) -BOOST_PYTHON_INPLACE_OPERATOR(/=) -BOOST_PYTHON_INPLACE_OPERATOR(%=) -BOOST_PYTHON_INPLACE_OPERATOR(<<=) -BOOST_PYTHON_INPLACE_OPERATOR(>>=) -BOOST_PYTHON_INPLACE_OPERATOR(&=) -BOOST_PYTHON_INPLACE_OPERATOR(^=) -BOOST_PYTHON_INPLACE_OPERATOR(|=) -# undef BOOST_PYTHON_INPLACE_OPERATOR - -}}} // namespace boost::python +PXR_BOOST_PYTHON_INPLACE_OPERATOR(+=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(-=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(*=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(/=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(%=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(<<=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(>>=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(&=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(^=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(|=) +# undef PXR_BOOST_PYTHON_INPLACE_OPERATOR + +}}} // namespace PXR_BOOST_NAMESPACE::python #include diff --git a/pxr/external/boost/python/object_protocol.hpp b/pxr/external/boost/python/object_protocol.hpp index a3c59ba67e..d525b59e61 100644 --- a/pxr/external/boost/python/object_protocol.hpp +++ b/pxr/external/boost/python/object_protocol.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,57 +24,57 @@ # include -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { # if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) // attempt to use SFINAE to prevent functions accepting T const& from // coming up as ambiguous with the one taking a char const* when a // string literal is passed -# define BOOST_PYTHON_NO_ARRAY_ARG(T) , T (*)() = 0 +# define PXR_BOOST_PYTHON_NO_ARRAY_ARG(T) , T (*)() = 0 # else -# define BOOST_PYTHON_NO_ARRAY_ARG(T) +# define PXR_BOOST_PYTHON_NO_ARRAY_ARG(T) # endif template -object getattr(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +object getattr(Target const& target, Key const& key PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { return getattr(object(target), object(key)); } template -object getattr(Target const& target, Key const& key, Default const& default_ BOOST_PYTHON_NO_ARRAY_ARG(Key)) +object getattr(Target const& target, Key const& key, Default const& default_ PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { return getattr(object(target), object(key), object(default_)); } template -void setattr(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key)) +void setattr(object const& target, Key const& key, Value const& value PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { setattr(target, object(key), object(value)); } template -void delattr(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +void delattr(object const& target, Key const& key PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { delattr(target, object(key)); } template -object getitem(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +object getitem(Target const& target, Key const& key PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { return getitem(object(target), object(key)); } template -void setitem(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key)) +void setitem(object const& target, Key const& key, Value const& value PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { setitem(target, object(key), object(value)); } template -void delitem(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key)) +void delitem(object const& target, Key const& key PXR_BOOST_PYTHON_NO_ARRAY_ARG(Key)) { delitem(target, object(key)); } @@ -96,7 +97,7 @@ void delslice(object const& target, Begin const& begin, End const& end) delslice(target, object(begin), object(end)); } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_HPP diff --git a/pxr/external/boost/python/object_protocol_core.hpp b/pxr/external/boost/python/object_protocol_core.hpp index 1d5783cf58..0880297a65 100644 --- a/pxr/external/boost/python/object_protocol_core.hpp +++ b/pxr/external/boost/python/object_protocol_core.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_CORE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,31 +21,31 @@ # include "pxr/external/boost/python/handle_fwd.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { class object; - BOOST_PYTHON_DECL object getattr(object const& target, object const& key); - BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_); - BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value); - BOOST_PYTHON_DECL void delattr(object const& target, object const& key); + PXR_BOOST_PYTHON_DECL object getattr(object const& target, object const& key); + PXR_BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_); + PXR_BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value); + PXR_BOOST_PYTHON_DECL void delattr(object const& target, object const& key); // These are defined for efficiency, since attributes are commonly // accessed through literal strings. - BOOST_PYTHON_DECL object getattr(object const& target, char const* key); - BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_); - BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value); - BOOST_PYTHON_DECL void delattr(object const& target, char const* key); + PXR_BOOST_PYTHON_DECL object getattr(object const& target, char const* key); + PXR_BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_); + PXR_BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value); + PXR_BOOST_PYTHON_DECL void delattr(object const& target, char const* key); - BOOST_PYTHON_DECL object getitem(object const& target, object const& key); - BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value); - BOOST_PYTHON_DECL void delitem(object const& target, object const& key); + PXR_BOOST_PYTHON_DECL object getitem(object const& target, object const& key); + PXR_BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value); + PXR_BOOST_PYTHON_DECL void delitem(object const& target, object const& key); - BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end); - BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value); - BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end); + PXR_BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end); + PXR_BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value); + PXR_BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end); } using api::getattr; @@ -59,7 +60,7 @@ using api::getslice; using api::setslice; using api::delslice; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_PROTOCOL_CORE_HPP diff --git a/pxr/external/boost/python/object_slices.hpp b/pxr/external/boost/python/object_slices.hpp index d526fde5d3..9a7386985d 100644 --- a/pxr/external/boost/python/object_slices.hpp +++ b/pxr/external/boost/python/object_slices.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OBJECT_SLICES_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,7 +25,7 @@ # include "pxr/external/boost/python/handle.hpp" # include -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { struct const_slice_policies { @@ -152,7 +153,7 @@ inline void slice_policies::del( delslice(target, key.first, key.second); } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OBJECT_SLICES_HPP diff --git a/pxr/external/boost/python/opaque_pointer_converter.hpp b/pxr/external/boost/python/opaque_pointer_converter.hpp index 099a3cda90..47d8c6df20 100644 --- a/pxr/external/boost/python/opaque_pointer_converter.hpp +++ b/pxr/external/boost/python/opaque_pointer_converter.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OPAQUE_POINTER_CONVERTER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -42,11 +43,11 @@ // Note: // In addition you need to define specializations for type_id // on the type pointed to by Pointer using -// BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) +// PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) // // For an example see libs/python/test/opaque.cpp // -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct opaque @@ -101,7 +102,7 @@ struct opaque if ((existing == 0) || (existing->m_to_python == 0)) { -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES converter::registry::insert(&extract, type_id(), &get_pytype); converter::registry::insert(&wrap, type_id(), &get_pytype); #else @@ -118,7 +119,7 @@ struct opaque }; static PyTypeObject type_object; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const *get_pytype(){return &type_object; } #endif }; @@ -133,7 +134,7 @@ PyTypeObject opaque::type_object = 0, sizeof( BOOST_DEDUCED_TYPENAME opaque::python_instance ), 0, - ::boost::python::detail::dealloc, + ::PXR_BOOST_NAMESPACE::python::detail::dealloc, 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ @@ -178,11 +179,11 @@ PyTypeObject opaque::type_object = 0 /* tp_del */ #endif }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python // If you change the below, don't forget to alter the end of type_id.hpp -# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ - namespace boost { namespace python { \ +# define PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ + namespace PXR_BOOST_NAMESPACE { namespace python { \ template<> \ inline type_info type_id() \ { \ diff --git a/pxr/external/boost/python/operators.hpp b/pxr/external/boost/python/operators.hpp index 4fcbf57e59..8b4a6efafb 100644 --- a/pxr/external/boost/python/operators.hpp +++ b/pxr/external/boost/python/operators.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OPERATORS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -33,7 +34,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -172,7 +173,7 @@ namespace detail }; } -# define BOOST_PYTHON_BINARY_OPERATION(id, rid, expr) \ +# define PXR_BOOST_PYTHON_BINARY_OPERATION(id, rid, expr) \ namespace detail \ { \ template <> \ @@ -208,8 +209,8 @@ namespace detail \ }; \ } -# define BOOST_PYTHON_BINARY_OPERATOR(id, rid, op) \ -BOOST_PYTHON_BINARY_OPERATION(id, rid, l op r) \ +# define PXR_BOOST_PYTHON_BINARY_OPERATOR(id, rid, op) \ +PXR_BOOST_PYTHON_BINARY_OPERATION(id, rid, l op r) \ namespace self_ns \ { \ template \ @@ -220,31 +221,31 @@ namespace self_ns \ } \ } -BOOST_PYTHON_BINARY_OPERATOR(add, radd, +) -BOOST_PYTHON_BINARY_OPERATOR(sub, rsub, -) -BOOST_PYTHON_BINARY_OPERATOR(mul, rmul, *) +PXR_BOOST_PYTHON_BINARY_OPERATOR(add, radd, +) +PXR_BOOST_PYTHON_BINARY_OPERATOR(sub, rsub, -) +PXR_BOOST_PYTHON_BINARY_OPERATOR(mul, rmul, *) #if PY_VERSION_HEX >= 0x03000000 - BOOST_PYTHON_BINARY_OPERATOR(truediv, rtruediv, /) + PXR_BOOST_PYTHON_BINARY_OPERATOR(truediv, rtruediv, /) #else - BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) + PXR_BOOST_PYTHON_BINARY_OPERATOR(div, rdiv, /) #endif -BOOST_PYTHON_BINARY_OPERATOR(mod, rmod, %) -BOOST_PYTHON_BINARY_OPERATOR(lshift, rlshift, <<) -BOOST_PYTHON_BINARY_OPERATOR(rshift, rrshift, >>) -BOOST_PYTHON_BINARY_OPERATOR(and, rand, &) -BOOST_PYTHON_BINARY_OPERATOR(xor, rxor, ^) -BOOST_PYTHON_BINARY_OPERATOR(or, ror, |) -BOOST_PYTHON_BINARY_OPERATOR(gt, lt, >) -BOOST_PYTHON_BINARY_OPERATOR(ge, le, >=) -BOOST_PYTHON_BINARY_OPERATOR(lt, gt, <) -BOOST_PYTHON_BINARY_OPERATOR(le, ge, <=) -BOOST_PYTHON_BINARY_OPERATOR(eq, eq, ==) -BOOST_PYTHON_BINARY_OPERATOR(ne, ne, !=) -# undef BOOST_PYTHON_BINARY_OPERATOR +PXR_BOOST_PYTHON_BINARY_OPERATOR(mod, rmod, %) +PXR_BOOST_PYTHON_BINARY_OPERATOR(lshift, rlshift, <<) +PXR_BOOST_PYTHON_BINARY_OPERATOR(rshift, rrshift, >>) +PXR_BOOST_PYTHON_BINARY_OPERATOR(and, rand, &) +PXR_BOOST_PYTHON_BINARY_OPERATOR(xor, rxor, ^) +PXR_BOOST_PYTHON_BINARY_OPERATOR(or, ror, |) +PXR_BOOST_PYTHON_BINARY_OPERATOR(gt, lt, >) +PXR_BOOST_PYTHON_BINARY_OPERATOR(ge, le, >=) +PXR_BOOST_PYTHON_BINARY_OPERATOR(lt, gt, <) +PXR_BOOST_PYTHON_BINARY_OPERATOR(le, ge, <=) +PXR_BOOST_PYTHON_BINARY_OPERATOR(eq, eq, ==) +PXR_BOOST_PYTHON_BINARY_OPERATOR(ne, ne, !=) +# undef PXR_BOOST_PYTHON_BINARY_OPERATOR // pow isn't an operator in C++; handle it specially. -BOOST_PYTHON_BINARY_OPERATION(pow, rpow, pow(l,r)) -# undef BOOST_PYTHON_BINARY_OPERATION +PXR_BOOST_PYTHON_BINARY_OPERATION(pow, rpow, pow(l,r)) +# undef PXR_BOOST_PYTHON_BINARY_OPERATION namespace self_ns { @@ -282,7 +283,7 @@ namespace self_ns } -# define BOOST_PYTHON_INPLACE_OPERATOR(id, op) \ +# define PXR_BOOST_PYTHON_INPLACE_OPERATOR(id, op) \ namespace detail \ { \ template <> \ @@ -313,18 +314,18 @@ namespace self_ns \ } \ } -BOOST_PYTHON_INPLACE_OPERATOR(iadd,+=) -BOOST_PYTHON_INPLACE_OPERATOR(isub,-=) -BOOST_PYTHON_INPLACE_OPERATOR(imul,*=) -BOOST_PYTHON_INPLACE_OPERATOR(idiv,/=) -BOOST_PYTHON_INPLACE_OPERATOR(imod,%=) -BOOST_PYTHON_INPLACE_OPERATOR(ilshift,<<=) -BOOST_PYTHON_INPLACE_OPERATOR(irshift,>>=) -BOOST_PYTHON_INPLACE_OPERATOR(iand,&=) -BOOST_PYTHON_INPLACE_OPERATOR(ixor,^=) -BOOST_PYTHON_INPLACE_OPERATOR(ior,|=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(iadd,+=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(isub,-=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(imul,*=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(idiv,/=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(imod,%=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(ilshift,<<=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(irshift,>>=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(iand,&=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(ixor,^=) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(ior,|=) -# define BOOST_PYTHON_UNARY_OPERATOR(id, op, func_name) \ +# define PXR_BOOST_PYTHON_UNARY_OPERATOR(id, op, func_name) \ namespace detail \ { \ template <> \ @@ -350,36 +351,36 @@ namespace self_ns \ return detail::operator_(); \ } \ } -# undef BOOST_PYTHON_INPLACE_OPERATOR +# undef PXR_BOOST_PYTHON_INPLACE_OPERATOR -BOOST_PYTHON_UNARY_OPERATOR(neg, -, operator-) -BOOST_PYTHON_UNARY_OPERATOR(pos, +, operator+) -BOOST_PYTHON_UNARY_OPERATOR(abs, abs, abs) -BOOST_PYTHON_UNARY_OPERATOR(invert, ~, operator~) +PXR_BOOST_PYTHON_UNARY_OPERATOR(neg, -, operator-) +PXR_BOOST_PYTHON_UNARY_OPERATOR(pos, +, operator+) +PXR_BOOST_PYTHON_UNARY_OPERATOR(abs, abs, abs) +PXR_BOOST_PYTHON_UNARY_OPERATOR(invert, ~, operator~) #if PY_VERSION_HEX >= 0x03000000 -BOOST_PYTHON_UNARY_OPERATOR(bool, !!, operator!) +PXR_BOOST_PYTHON_UNARY_OPERATOR(bool, !!, operator!) #else -BOOST_PYTHON_UNARY_OPERATOR(nonzero, !!, operator!) +PXR_BOOST_PYTHON_UNARY_OPERATOR(nonzero, !!, operator!) #endif -BOOST_PYTHON_UNARY_OPERATOR(int, long, int_) -BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) -BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) -BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex, complex_) -BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast, str) -BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast, repr) -# undef BOOST_PYTHON_UNARY_OPERATOR +PXR_BOOST_PYTHON_UNARY_OPERATOR(int, long, int_) +PXR_BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) +PXR_BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) +PXR_BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex, complex_) +PXR_BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast, str) +PXR_BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast, repr) +# undef PXR_BOOST_PYTHON_UNARY_OPERATOR -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python # ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -using boost::python::self_ns::abs; -using boost::python::self_ns::int_; -using boost::python::self_ns::long_; -using boost::python::self_ns::float_; -using boost::python::self_ns::complex_; -using boost::python::self_ns::str; -using boost::python::self_ns::repr; -using boost::python::self_ns::pow; +using PXR_BOOST_NAMESPACE::python::self_ns::abs; +using PXR_BOOST_NAMESPACE::python::self_ns::int_; +using PXR_BOOST_NAMESPACE::python::self_ns::long_; +using PXR_BOOST_NAMESPACE::python::self_ns::float_; +using PXR_BOOST_NAMESPACE::python::self_ns::complex_; +using PXR_BOOST_NAMESPACE::python::self_ns::str; +using PXR_BOOST_NAMESPACE::python::self_ns::repr; +using PXR_BOOST_NAMESPACE::python::self_ns::pow; # endif #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/other.hpp b/pxr/external/boost/python/other.hpp index e7ebe37776..25a23a7f70 100644 --- a/pxr/external/boost/python/other.hpp +++ b/pxr/external/boost/python/other.hpp @@ -2,6 +2,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OTHER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,7 +21,7 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct other { @@ -58,7 +59,7 @@ namespace detail }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/overloads.hpp b/pxr/external/boost/python/overloads.hpp index 7164d4a6f5..ace6e99758 100644 --- a/pxr/external/boost/python/overloads.hpp +++ b/pxr/external/boost/python/overloads.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OVERLOADS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include diff --git a/pxr/external/boost/python/override.hpp b/pxr/external/boost/python/override.hpp index 249e9143a8..d624feead2 100644 --- a/pxr/external/boost/python/override.hpp +++ b/pxr/external/boost/python/override.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_OVERRIDE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -32,7 +33,7 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { class override; @@ -44,7 +45,7 @@ namespace detail class method_result { private: - friend class boost::python::override; + friend class PXR_BOOST_NAMESPACE::python::override; explicit method_result(PyObject* x) : m_obj(x) {} @@ -115,16 +116,16 @@ class override : public object return x; } -# define BOOST_PYTHON_fast_arg_to_python_get(z, n, _) \ +# define PXR_BOOST_PYTHON_fast_arg_to_python_get(z, n, _) \ , converter::arg_to_python(a##n).get() -# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/override.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/override.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_fast_arg_to_python_get +# undef PXR_BOOST_PYTHON_fast_arg_to_python_get }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_OVERRIDE_HPP @@ -146,8 +147,8 @@ operator()( BOOST_PP_ENUM_BINARY_PARAMS_Z(1, N, A, const& a) ) const detail::method_result x( PyObject_CallFunction( this->ptr() - , const_cast("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")") - BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_fast_arg_to_python_get, nil) + , const_cast("(" BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_FIXED, "O") ")") + BOOST_PP_REPEAT_1ST(N, PXR_BOOST_PYTHON_fast_arg_to_python_get, nil) )); return x; } diff --git a/pxr/external/boost/python/pointee.hpp b/pxr/external/boost/python/pointee.hpp index dfa30f5108..239adab3ff 100644 --- a/pxr/external/boost/python/pointee.hpp +++ b/pxr/external/boost/python/pointee.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_POINTEE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -47,7 +48,7 @@ struct pointee { }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_POINTEE_HPP diff --git a/pxr/external/boost/python/proxy.hpp b/pxr/external/boost/python/proxy.hpp index 582c25e276..26f41f2158 100644 --- a/pxr/external/boost/python/proxy.hpp +++ b/pxr/external/boost/python/proxy.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_PROXY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/object_core.hpp" # include "pxr/external/boost/python/object_operators.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { template class proxy : public object_operators > @@ -78,24 +79,24 @@ inline proxy const& proxy::operator=(typename proxy::assignm return *this = python::object(rhs); } -# define BOOST_PYTHON_PROXY_INPLACE(op) \ +# define PXR_BOOST_PYTHON_PROXY_INPLACE(op) \ template \ proxy const& operator op(proxy const& lhs, R const& rhs) \ { \ object old(lhs); \ return lhs = (old op rhs); \ } -BOOST_PYTHON_PROXY_INPLACE(+=) -BOOST_PYTHON_PROXY_INPLACE(-=) -BOOST_PYTHON_PROXY_INPLACE(*=) -BOOST_PYTHON_PROXY_INPLACE(/=) -BOOST_PYTHON_PROXY_INPLACE(%=) -BOOST_PYTHON_PROXY_INPLACE(<<=) -BOOST_PYTHON_PROXY_INPLACE(>>=) -BOOST_PYTHON_PROXY_INPLACE(&=) -BOOST_PYTHON_PROXY_INPLACE(^=) -BOOST_PYTHON_PROXY_INPLACE(|=) -# undef BOOST_PYTHON_PROXY_INPLACE +PXR_BOOST_PYTHON_PROXY_INPLACE(+=) +PXR_BOOST_PYTHON_PROXY_INPLACE(-=) +PXR_BOOST_PYTHON_PROXY_INPLACE(*=) +PXR_BOOST_PYTHON_PROXY_INPLACE(/=) +PXR_BOOST_PYTHON_PROXY_INPLACE(%=) +PXR_BOOST_PYTHON_PROXY_INPLACE(<<=) +PXR_BOOST_PYTHON_PROXY_INPLACE(>>=) +PXR_BOOST_PYTHON_PROXY_INPLACE(&=) +PXR_BOOST_PYTHON_PROXY_INPLACE(^=) +PXR_BOOST_PYTHON_PROXY_INPLACE(|=) +# undef PXR_BOOST_PYTHON_PROXY_INPLACE template inline void proxy::del() const @@ -103,7 +104,7 @@ inline void proxy::del() const Policies::del(m_target, m_key); } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_PROXY_HPP diff --git a/pxr/external/boost/python/ptr.hpp b/pxr/external/boost/python/ptr.hpp index 47c755a3c1..2d6422a798 100644 --- a/pxr/external/boost/python/ptr.hpp +++ b/pxr/external/boost/python/ptr.hpp @@ -2,6 +2,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_PTR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -25,7 +26,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class pointer_wrapper { @@ -71,7 +72,7 @@ class unwrap_pointer > typedef T type; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/pure_virtual.hpp b/pxr/external/boost/python/pure_virtual.hpp index 739dd97665..652c2048ee 100644 --- a/pxr/external/boost/python/pure_virtual.hpp +++ b/pxr/external/boost/python/pure_virtual.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_PURE_VIRTUAL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/detail/nullary_function_adaptor.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -33,7 +34,7 @@ namespace detail // Raises a Python RuntimeError reporting that a pure virtual // function was called. - void BOOST_PYTHON_DECL pure_virtual_called(); + void PXR_BOOST_PYTHON_DECL pure_virtual_called(); // Replace the two front elements of S with T1 and T2 template @@ -130,7 +131,7 @@ pure_virtual(PointerToMemberFunction pmf) return detail::pure_virtual_visitor(pmf); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_PURE_VIRTUAL_HPP diff --git a/pxr/external/boost/python/raw_function.hpp b/pxr/external/boost/python/raw_function.hpp index 336c2d8bef..a0c302acff 100644 --- a/pxr/external/boost/python/raw_function.hpp +++ b/pxr/external/boost/python/raw_function.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RAW_FUNCTION_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ # include # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -51,7 +52,7 @@ namespace detail F f; }; - object BOOST_PYTHON_DECL make_raw_function(objects::py_function); + object PXR_BOOST_PYTHON_DECL make_raw_function(objects::py_function); } template @@ -67,7 +68,7 @@ object raw_function(F f, std::size_t min_args = 0) ); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RAW_FUNCTION_HPP diff --git a/pxr/external/boost/python/refcount.hpp b/pxr/external/boost/python/refcount.hpp index c630f1dc60..94eed898bf 100644 --- a/pxr/external/boost/python/refcount.hpp +++ b/pxr/external/boost/python/refcount.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_REFCOUNT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/cast.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template inline T* incref(T* p) @@ -49,7 +50,7 @@ inline void xdecref(T* p) Py_XDECREF(python::upcast(p)); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REFCOUNT_HPP diff --git a/pxr/external/boost/python/reference_existing_object.hpp b/pxr/external/boost/python/reference_existing_object.hpp index bc7519fbd8..76750cf668 100644 --- a/pxr/external/boost/python/reference_existing_object.hpp +++ b/pxr/external/boost/python/reference_existing_object.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_REFERENCE_EXISTING_OBJECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/to_python_indirect.hpp" # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -52,7 +53,7 @@ struct reference_existing_object }; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REFERENCE_EXISTING_OBJECT_HPP diff --git a/pxr/external/boost/python/register_ptr_to_python.hpp b/pxr/external/boost/python/register_ptr_to_python.hpp index cf32167140..f9c95688be 100644 --- a/pxr/external/boost/python/register_ptr_to_python.hpp +++ b/pxr/external/boost/python/register_ptr_to_python.hpp @@ -11,6 +11,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_REGISTER_PTR_TO_PYTHON_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,12 +21,12 @@ #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/object/class_wrapper.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template void register_ptr_to_python() { - typedef typename boost::python::pointee

    ::type X; + typedef typename PXR_BOOST_NAMESPACE::python::pointee

    ::type X; objects::class_value_wrapper< P , objects::make_ptr_instance< @@ -35,7 +36,7 @@ void register_ptr_to_python() >(); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_REGISTER_PTR_TO_PYTHON_HPP diff --git a/pxr/external/boost/python/return_arg.hpp b/pxr/external/boost/python/return_arg.hpp index 883393a57d..ba55df7dee 100644 --- a/pxr/external/boost/python/return_arg.hpp +++ b/pxr/external/boost/python/return_arg.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_ARG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/none.hpp" # include "pxr/external/boost/python/detail/value_arg.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif @@ -33,7 +34,7 @@ # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -59,7 +60,7 @@ namespace detail { return none(); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const *get_pytype() const { return converter::expected_pytype_for_arg::get_pytype() ; } #endif }; @@ -115,7 +116,7 @@ struct return_self : return_arg<1,Base> {}; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_ARG_HPP diff --git a/pxr/external/boost/python/return_by_value.hpp b/pxr/external/boost/python/return_by_value.hpp index 00ad8221be..31f08dc161 100644 --- a/pxr/external/boost/python/return_by_value.hpp +++ b/pxr/external/boost/python/return_by_value.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_BY_VALUE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/detail/value_arg.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { struct return_by_value { @@ -36,7 +37,7 @@ struct return_by_value }; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_BY_VALUE_HPP diff --git a/pxr/external/boost/python/return_internal_reference.hpp b/pxr/external/boost/python/return_internal_reference.hpp index 80363345d9..f859b6b99f 100644 --- a/pxr/external/boost/python/return_internal_reference.hpp +++ b/pxr/external/boost/python/return_internal_reference.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_INTERNAL_REFERENCE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/with_custodian_and_ward.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -49,7 +50,7 @@ struct return_internal_reference >::type result_converter; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_INTERNAL_REFERENCE_HPP diff --git a/pxr/external/boost/python/return_opaque_pointer.hpp b/pxr/external/boost/python/return_opaque_pointer.hpp index 9d62a840c6..37974c4cfb 100644 --- a/pxr/external/boost/python/return_opaque_pointer.hpp +++ b/pxr/external/boost/python/return_opaque_pointer.hpp @@ -14,6 +14,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_OPAQUE_POINTER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -26,7 +27,7 @@ # include "pxr/external/boost/python/detail/value_arg.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -45,7 +46,7 @@ struct return_opaque_pointer BOOST_MPL_ASSERT_MSG( is_pointer::value, RETURN_OPAQUE_POINTER_EXPECTS_A_POINTER_TYPE, (R)); struct type : - boost::python::to_python_value< + PXR_BOOST_NAMESPACE::python::to_python_value< typename detail::value_arg::type > { @@ -54,6 +55,6 @@ struct return_opaque_pointer }; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON # endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_OPAQUE_POINTER_HPP diff --git a/pxr/external/boost/python/return_value_policy.hpp b/pxr/external/boost/python/return_value_policy.hpp index 530c139003..412aa80dcb 100644 --- a/pxr/external/boost/python/return_value_policy.hpp +++ b/pxr/external/boost/python/return_value_policy.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_RETURN_VALUE_POLICY_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/default_call_policies.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct return_value_policy : BasePolicy_ @@ -27,7 +28,7 @@ struct return_value_policy : BasePolicy_ typedef ResultConverterGenerator result_converter; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_RETURN_VALUE_POLICY_HPP diff --git a/pxr/external/boost/python/scope.hpp b/pxr/external/boost/python/scope.hpp index c2c0af1195..a8aad69d87 100644 --- a/pxr/external/boost/python/scope.hpp +++ b/pxr/external/boost/python/scope.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SCOPE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,13 +21,13 @@ # include "pxr/external/boost/python/object.hpp" # include "pxr/external/boost/python/refcount.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // Making this a namespace-scope variable to avoid Cygwin issues. // Use a PyObject* to avoid problems with static destruction after Py_Finalize - extern BOOST_PYTHON_DECL PyObject* current_scope; + extern PXR_BOOST_PYTHON_DECL PyObject* current_scope; } class scope @@ -83,7 +84,7 @@ inline scope::scope(scope const& new_scope) detail::current_scope = python::incref(new_scope.ptr()); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SCOPE_HPP diff --git a/pxr/external/boost/python/self.hpp b/pxr/external/boost/python/self.hpp index 4dad25e995..a64b77ac07 100644 --- a/pxr/external/boost/python/self.hpp +++ b/pxr/external/boost/python/self.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SELF_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,9 +19,9 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -#define BOOST_PYTHON_SELF_IS_CLASS +#define PXR_BOOST_PYTHON_SELF_IS_CLASS // Sink self_t into its own namespace so that we have a safe place to // put the completely general operator templates which operate on @@ -28,18 +29,18 @@ namespace boost { namespace python { // complicated and finally GCC 2.95.2 chokes on it. namespace self_ns { -# ifndef BOOST_PYTHON_SELF_IS_CLASS +# ifndef PXR_BOOST_PYTHON_SELF_IS_CLASS enum self_t { self }; # else struct self_t {}; - extern BOOST_PYTHON_DECL self_t self; + extern PXR_BOOST_PYTHON_DECL self_t self; # endif } using self_ns::self_t; using self_ns::self; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SELF_HPP diff --git a/pxr/external/boost/python/signature.hpp b/pxr/external/boost/python/signature.hpp index b40d36e8ac..b82162d67b 100644 --- a/pxr/external/boost/python/signature.hpp +++ b/pxr/external/boost/python/signature.hpp @@ -16,6 +16,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SIGNATURE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -40,11 +41,11 @@ # include # include -# define BOOST_PYTHON_LIST_INC(n) \ +# define PXR_BOOST_PYTHON_LIST_INC(n) \ BOOST_PP_CAT(mpl::vector, BOOST_PP_INC(n)) /////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { // A metafunction returning C1 if C1 is derived from C2, and C2 // otherwise @@ -62,23 +63,23 @@ struct most_derived // // template // inline mpl::vector -// get_signature(RT(BOOST_PYTHON_FN_CC *)(T0...TN), void* = 0) +// get_signature(RT(PXR_BOOST_PYTHON_FN_CC *)(T0...TN), void* = 0) // { // return mpl::list(); // } // -// where BOOST_PYTHON_FN_CC is a calling convention keyword, can be +// where PXR_BOOST_PYTHON_FN_CC is a calling convention keyword, can be // // empty, for default calling convention -// __cdecl (if BOOST_PYTHON_ENABLE_CDECL is defined) -// __stdcall (if BOOST_PYTHON_ENABLE_STDCALL is defined) -// __fastcall (if BOOST_PYTHON_ENABLE_FASTCALL is defined) +// __cdecl (if PXR_BOOST_PYTHON_ENABLE_CDECL is defined) +// __stdcall (if PXR_BOOST_PYTHON_ENABLE_STDCALL is defined) +// __fastcall (if PXR_BOOST_PYTHON_ENABLE_FASTCALL is defined) // // And, for an appropriate assortment of cv-qualifications:: // // template // inline mpl::vector -// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv)) +// get_signature(RT(PXR_BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv)) // { // return mpl::list(); // } @@ -89,7 +90,7 @@ struct most_derived // , typename most_derived::type& // , T0...TN // > -// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv), Target*) +// get_signature(RT(PXR_BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv), Target*) // { // return mpl::list(); // } @@ -120,67 +121,67 @@ struct most_derived // 'default' calling convention -# define BOOST_PYTHON_FN_CC +# define PXR_BOOST_PYTHON_FN_CC # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FN_CC +# undef PXR_BOOST_PYTHON_FN_CC // __cdecl calling convention -# if defined(BOOST_PYTHON_ENABLE_CDECL) +# if defined(PXR_BOOST_PYTHON_ENABLE_CDECL) -# define BOOST_PYTHON_FN_CC __cdecl -# define BOOST_PYTHON_FN_CC_IS_CDECL +# define PXR_BOOST_PYTHON_FN_CC __cdecl +# define PXR_BOOST_PYTHON_FN_CC_IS_CDECL # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FN_CC -# undef BOOST_PYTHON_FN_CC_IS_CDECL +# undef PXR_BOOST_PYTHON_FN_CC +# undef PXR_BOOST_PYTHON_FN_CC_IS_CDECL -# endif // defined(BOOST_PYTHON_ENABLE_CDECL) +# endif // defined(PXR_BOOST_PYTHON_ENABLE_CDECL) // __stdcall calling convention -# if defined(BOOST_PYTHON_ENABLE_STDCALL) +# if defined(PXR_BOOST_PYTHON_ENABLE_STDCALL) -# define BOOST_PYTHON_FN_CC __stdcall +# define PXR_BOOST_PYTHON_FN_CC __stdcall # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FN_CC +# undef PXR_BOOST_PYTHON_FN_CC -# endif // defined(BOOST_PYTHON_ENABLE_STDCALL) +# endif // defined(PXR_BOOST_PYTHON_ENABLE_STDCALL) // __fastcall calling convention -# if defined(BOOST_PYTHON_ENABLE_FASTCALL) +# if defined(PXR_BOOST_PYTHON_ENABLE_FASTCALL) -# define BOOST_PYTHON_FN_CC __fastcall +# define PXR_BOOST_PYTHON_FN_CC __fastcall # define BOOST_PP_ITERATION_PARAMS_1 \ - (3, (0, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) + (3, (0, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/signature.hpp")) # include BOOST_PP_ITERATE() -# undef BOOST_PYTHON_FN_CC +# undef PXR_BOOST_PYTHON_FN_CC -# endif // defined(BOOST_PYTHON_ENABLE_FASTCALL) +# endif // defined(PXR_BOOST_PYTHON_ENABLE_FASTCALL) -# undef BOOST_PYTHON_LIST_INC +# undef PXR_BOOST_PYTHON_LIST_INC // } -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail #endif // PXR_USE_INTERNAL_BOOST_PYTHON @@ -196,20 +197,20 @@ struct most_derived // as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same // function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)', // we don't define it twice -# if !defined(BOOST_PYTHON_FN_CC_IS_CDECL) +# if !defined(PXR_BOOST_PYTHON_FN_CC_IS_CDECL) template < class RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> -inline BOOST_PYTHON_LIST_INC(N)< +inline PXR_BOOST_PYTHON_LIST_INC(N)< RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> -get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0) +get_signature(RT(PXR_BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0) { - return BOOST_PYTHON_LIST_INC(N)< + return PXR_BOOST_PYTHON_LIST_INC(N)< RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) >(); } -# endif // !defined(BOOST_PYTHON_FN_CC_IS_CDECL) +# endif // !defined(PXR_BOOST_PYTHON_FN_CC_IS_CDECL) # undef N @@ -220,15 +221,15 @@ get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = #else # define N BOOST_PP_RELATIVE_ITERATION(1) -# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_ITERATION()) +# define Q PXR_BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_ITERATION()) template < class RT, class ClassT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> -inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< +inline PXR_BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> -get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q) +get_signature(RT(PXR_BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q) { - return BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + return PXR_BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) >(); } @@ -239,17 +240,17 @@ template < , class ClassT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T) > -inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< +inline PXR_BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT , typename most_derived::type& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) > get_signature( - RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q + RT(PXR_BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q , Target* ) { - return BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< + return PXR_BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT , BOOST_DEDUCED_TYPENAME most_derived::type& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) diff --git a/pxr/external/boost/python/slice.hpp b/pxr/external/boost/python/slice.hpp index 287d9d30dc..4b2df94cd8 100644 --- a/pxr/external/boost/python/slice.hpp +++ b/pxr/external/boost/python/slice.hpp @@ -2,6 +2,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_SLICE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -28,18 +29,18 @@ #include #include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { - class BOOST_PYTHON_DECL slice_base : public object + class PXR_BOOST_PYTHON_DECL slice_base : public object { public: // Get the Python objects associated with the slice. In principle, these // may be any arbitrary Python type, but in practice they are usually // integers. If one or more parameter is ommited in the Python expression // that created this slice, than that parameter is None here, and compares - // equal to a default-constructed boost::python::object. + // equal to a default-constructed PXR_BOOST_NAMESPACE::python::object. // If a user-defined type wishes to support slicing, then support for the // special meaning associated with negative indices is up to the user. object start() const; @@ -49,7 +50,7 @@ namespace detail protected: explicit slice_base(PyObject*, PyObject*, PyObject*); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice_base, object) }; } @@ -267,7 +268,7 @@ class slice : public detail::slice_base // object_manager_traits<> below, allows C++ functions accepting slice // arguments to be called from from Python. These constructors should never // be used in client code. - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice, detail::slice_base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(slice, detail::slice_base) }; @@ -281,7 +282,7 @@ struct object_manager_traits } // !namesapce converter -} } // !namespace ::boost::python +} } // !namespace ::PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON diff --git a/pxr/external/boost/python/slice_nil.hpp b/pxr/external/boost/python/slice_nil.hpp index 726dc5ef63..8ae1b2d1a5 100644 --- a/pxr/external/boost/python/slice_nil.hpp +++ b/pxr/external/boost/python/slice_nil.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SLICE_NIL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" # include "pxr/external/boost/python/object_core.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { class slice_nil : public object { @@ -50,7 +51,7 @@ using api::slice_nil; using api::_; # endif -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SLICE_NIL_HPP diff --git a/pxr/external/boost/python/src/converter/arg_to_python_base.cpp b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp index a8d20eb4d6..0a07eff377 100644 --- a/pxr/external/boost/python/src/converter/arg_to_python_base.cpp +++ b/pxr/external/boost/python/src/converter/arg_to_python_base.cpp @@ -14,7 +14,7 @@ #include "pxr/external/boost/python/handle.hpp" #include "pxr/external/boost/python/refcount.hpp" -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { namespace detail { @@ -30,4 +30,4 @@ namespace detail } } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter diff --git a/pxr/external/boost/python/src/converter/builtin_converters.cpp b/pxr/external/boost/python/src/converter/builtin_converters.cpp index 0f9b2c9489..9c3a8a50b0 100644 --- a/pxr/external/boost/python/src/converter/builtin_converters.cpp +++ b/pxr/external/boost/python/src/converter/builtin_converters.cpp @@ -27,7 +27,7 @@ #include #include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { shared_ptr_deleter::shared_ptr_deleter(handle<> owner) : owner(owner) @@ -164,7 +164,7 @@ namespace return 0; return ( -#if PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) +#if PY_VERSION_HEX >= 0x02040000 && defined(PXR_BOOST_PYTHON_BOOL_INT_STRICT) !PyBool_Check(obj) && #endif (PyInt_Check(obj) || PyLong_Check(obj))) @@ -196,7 +196,7 @@ namespace return 0; return ( -#if PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) +#if PY_VERSION_HEX >= 0x02040000 && defined(PXR_BOOST_PYTHON_BOOL_INT_STRICT) !PyBool_Check(obj) && #endif (PyInt_Check(obj) || PyLong_Check(obj))) @@ -268,7 +268,7 @@ namespace struct long_long_rvalue_from_python : long_long_rvalue_from_python_base { - static BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) + static PXR_BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) { #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(intermediate)) @@ -278,7 +278,7 @@ namespace else #endif { - BOOST_PYTHON_LONG_LONG result = PyLong_AsLongLong(intermediate); + PXR_BOOST_PYTHON_LONG_LONG result = PyLong_AsLongLong(intermediate); if (PyErr_Occurred()) throw_error_already_set(); @@ -290,17 +290,17 @@ namespace struct unsigned_long_long_rvalue_from_python : long_long_rvalue_from_python_base { - static unsigned BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) + static unsigned PXR_BOOST_PYTHON_LONG_LONG extract(PyObject* intermediate) { #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(intermediate)) { - return numeric_cast(PyInt_AS_LONG(intermediate)); + return numeric_cast(PyInt_AS_LONG(intermediate)); } else #endif { - unsigned BOOST_PYTHON_LONG_LONG result = PyLong_AsUnsignedLongLong(intermediate); + unsigned PXR_BOOST_PYTHON_LONG_LONG result = PyLong_AsUnsignedLongLong(intermediate); if (PyErr_Occurred()) throw_error_already_set(); @@ -318,7 +318,7 @@ namespace { #if PY_VERSION_HEX >= 0x03000000 return obj == Py_None || PyLong_Check(obj) ? &py_object_identity : 0; -#elif PY_VERSION_HEX >= 0x02040000 && defined(BOOST_PYTHON_BOOL_INT_STRICT) +#elif PY_VERSION_HEX >= 0x02040000 && defined(PXR_BOOST_PYTHON_BOOL_INT_STRICT) return obj == Py_None || PyBool_Check(obj) ? &py_object_identity : 0; #else return obj == Py_None || PyInt_Check(obj) ? &py_object_identity : 0; @@ -451,7 +451,7 @@ namespace Py_ssize_t size = 0; wchar_t *buf = PyUnicode_AsWideCharString(intermediate, &size); if (buf == NULL) { - boost::python::throw_error_already_set(); + PXR_BOOST_NAMESPACE::python::throw_error_already_set(); } std::wstring result(buf, size); PyMem_Free(buf); @@ -510,7 +510,7 @@ namespace }; } -BOOST_PYTHON_DECL PyObject* do_return_to_python(char x) +PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(char x) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_FromStringAndSize(&x, 1); @@ -519,24 +519,24 @@ BOOST_PYTHON_DECL PyObject* do_return_to_python(char x) #endif } -BOOST_PYTHON_DECL PyObject* do_return_to_python(char const* x) +PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(char const* x) { #if PY_VERSION_HEX >= 0x03000000 - return x ? PyUnicode_FromString(x) : boost::python::detail::none(); + return x ? PyUnicode_FromString(x) : PXR_BOOST_NAMESPACE::python::detail::none(); #else - return x ? PyString_FromString(x) : boost::python::detail::none(); + return x ? PyString_FromString(x) : PXR_BOOST_NAMESPACE::python::detail::none(); #endif } -BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject* x) +PXR_BOOST_PYTHON_DECL PyObject* do_return_to_python(PyObject* x) { - return x ? x : boost::python::detail::none(); + return x ? x : PXR_BOOST_NAMESPACE::python::detail::none(); } -BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject* x) +PXR_BOOST_PYTHON_DECL PyObject* do_arg_to_python(PyObject* x) { if (x == 0) - return boost::python::detail::none(); + return PXR_BOOST_NAMESPACE::python::detail::none(); Py_INCREF(x); return x; @@ -566,8 +566,8 @@ void initialize_builtin_converters() // using Python's macro instead of Boost's - we don't seem to get the // config right all the time. # ifdef HAVE_LONG_LONG - slot_rvalue_from_python(); - slot_rvalue_from_python(); + slot_rvalue_from_python(); + slot_rvalue_from_python(); # endif // floating types @@ -594,4 +594,4 @@ void initialize_builtin_converters() } -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter diff --git a/pxr/external/boost/python/src/converter/from_python.cpp b/pxr/external/boost/python/src/converter/from_python.cpp index 72e01667a2..683d01a72e 100644 --- a/pxr/external/boost/python/src/converter/from_python.cpp +++ b/pxr/external/boost/python/src/converter/from_python.cpp @@ -21,7 +21,7 @@ #include #include -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { // rvalue_from_python_stage1 -- do the first stage of a conversion // from a Python object to a C++ rvalue. @@ -40,7 +40,7 @@ namespace boost { namespace python { namespace converter { // x.construct(source, y) constructs an object of type T // in y.storage.bytes and then sets y.convertible == y.storage.bytes, // or else throws an exception and has no effect. -BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( +PXR_BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( PyObject* source , registration const& converters) { @@ -79,7 +79,7 @@ BOOST_PYTHON_DECL rvalue_from_python_stage1_data rvalue_from_python_stage1( // // Requires: data.convertible == ®istered::converters // -BOOST_PYTHON_DECL void* rvalue_result_from_python( +PXR_BOOST_PYTHON_DECL void* rvalue_result_from_python( PyObject* src, rvalue_from_python_stage1_data& data) { // Retrieve the registration @@ -92,7 +92,7 @@ BOOST_PYTHON_DECL void* rvalue_result_from_python( return rvalue_from_python_stage2(src, data, converters); } -BOOST_PYTHON_DECL void* rvalue_from_python_stage2( +PXR_BOOST_PYTHON_DECL void* rvalue_from_python_stage2( PyObject* source, rvalue_from_python_stage1_data& data, registration const& converters) { if (!data.convertible) @@ -122,7 +122,7 @@ BOOST_PYTHON_DECL void* rvalue_from_python_stage2( return data.convertible; } -BOOST_PYTHON_DECL void* get_lvalue_from_python( +PXR_BOOST_PYTHON_DECL void* get_lvalue_from_python( PyObject* source , registration const& converters) { @@ -175,7 +175,7 @@ namespace } -BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( +PXR_BOOST_PYTHON_DECL bool implicit_rvalue_convertible_from_python( PyObject* source , registration const& converters) { @@ -253,24 +253,24 @@ namespace } -BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject* source, registration const& converters) +PXR_BOOST_PYTHON_DECL void throw_no_pointer_from_python(PyObject* source, registration const& converters) { (throw_no_lvalue_from_python)(source, converters, "pointer"); } -BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject* source, registration const& converters) +PXR_BOOST_PYTHON_DECL void throw_no_reference_from_python(PyObject* source, registration const& converters) { (throw_no_lvalue_from_python)(source, converters, "reference"); } -BOOST_PYTHON_DECL void* reference_result_from_python( +PXR_BOOST_PYTHON_DECL void* reference_result_from_python( PyObject* source , registration const& converters) { return (lvalue_result_from_python)(source, converters, "reference"); } -BOOST_PYTHON_DECL void* pointer_result_from_python( +PXR_BOOST_PYTHON_DECL void* pointer_result_from_python( PyObject* source , registration const& converters) { @@ -282,14 +282,14 @@ BOOST_PYTHON_DECL void* pointer_result_from_python( return (lvalue_result_from_python)(source, converters, "pointer"); } -BOOST_PYTHON_DECL void void_result_from_python(PyObject* o) +PXR_BOOST_PYTHON_DECL void void_result_from_python(PyObject* o) { Py_DECREF(expect_non_null(o)); } -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter -BOOST_PYTHON_DECL PyObject* +PXR_BOOST_PYTHON_DECL PyObject* pytype_check(PyTypeObject* type_, PyObject* source) { if (!PyObject_IsInstance(source, python::upcast(type_))) @@ -305,4 +305,4 @@ pytype_check(PyTypeObject* type_, PyObject* source) return source; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/converter/registry.cpp b/pxr/external/boost/python/src/converter/registry.cpp index 3634b3288d..1e3d5877ee 100644 --- a/pxr/external/boost/python/src/converter/registry.cpp +++ b/pxr/external/boost/python/src/converter/registry.cpp @@ -16,16 +16,16 @@ #if defined(__APPLE__) && defined(__MACH__) && defined(__GNUC__) \ && __GNUC__ == 3 && __GNUC_MINOR__ <= 4 && !defined(__APPLE_CC__) -# define BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND +# define PXR_BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND #endif -#if defined(BOOST_PYTHON_TRACE_REGISTRY) \ - || defined(BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) +#if defined(PXR_BOOST_PYTHON_TRACE_REGISTRY) \ + || defined(PXR_BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND) # include #endif -namespace boost { namespace python { namespace converter { -BOOST_PYTHON_DECL PyTypeObject const* registration::expected_from_python_type() const +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { +PXR_BOOST_PYTHON_DECL PyTypeObject const* registration::expected_from_python_type() const { if (this->m_class_object != 0) return this->m_class_object; @@ -44,7 +44,7 @@ BOOST_PYTHON_DECL PyTypeObject const* registration::expected_from_python_type() } -BOOST_PYTHON_DECL PyTypeObject const* registration::to_python_target_type() const +PXR_BOOST_PYTHON_DECL PyTypeObject const* registration::to_python_target_type() const { if (this->m_class_object != 0) return this->m_class_object; @@ -55,7 +55,7 @@ BOOST_PYTHON_DECL PyTypeObject const* registration::to_python_target_type() cons return 0; } -BOOST_PYTHON_DECL PyTypeObject* registration::get_class_object() const +PXR_BOOST_PYTHON_DECL PyTypeObject* registration::get_class_object() const { if (this->m_class_object == 0) { @@ -70,7 +70,7 @@ BOOST_PYTHON_DECL PyTypeObject* registration::get_class_object() const return this->m_class_object; } -BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source) const +PXR_BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source) const { if (this->m_to_python == 0) { @@ -120,12 +120,12 @@ namespace // typedef std::set registry_t; -#ifndef BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND +#ifndef PXR_BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND registry_t& entries() { static registry_t registry; -# ifndef BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION +# ifndef PXR_BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION static bool builtin_converters_initialized = false; if (!builtin_converters_initialized) { @@ -135,7 +135,7 @@ namespace // initialize_builtin_converters(); } -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "registry: "; for (registry_t::iterator p = registry.begin(); p != registry.end(); ++p) { @@ -166,12 +166,12 @@ namespace // registry_t& entries() { -# ifndef BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION +# ifndef PXR_BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION if (!static_builtin_converters_initialized()) { initialize_builtin_converters(); } -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "registry: "; for (registry_t::iterator p = static_registry().begin(); p != static_registry().end(); ++p) { @@ -182,11 +182,11 @@ namespace // # endif return static_registry(); } -#endif // BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND +#endif // PXR_BOOST_PYTHON_CONVERTER_REGISTRY_APPLE_MACH_WORKAROUND entry* get(type_info type, bool is_shared_ptr = false) { -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY registry_t::iterator p = entries().find(entry(type)); std::cout << "looking up " << type << ": " @@ -209,7 +209,7 @@ namespace registry { void insert(to_python_function_t f, type_info source_t, PyTypeObject const* (*to_python_target_type)()) { -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "inserting to_python " << source_t << "\n"; # endif entry* slot = get(source_t); @@ -235,7 +235,7 @@ namespace registry // Insert an lvalue from_python converter void insert(convertible_function convert, type_info key, PyTypeObject const* (*exp_pytype)()) { -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "inserting lvalue from_python " << key << "\n"; # endif entry* found = get(key); @@ -253,7 +253,7 @@ namespace registry , type_info key , PyTypeObject const* (*exp_pytype)()) { -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "inserting rvalue from_python " << key << "\n"; # endif entry* found = get(key); @@ -271,7 +271,7 @@ namespace registry , type_info key , PyTypeObject const* (*exp_pytype)()) { -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "push_back rvalue from_python " << key << "\n"; # endif rvalue_from_python_chain** found = &get(key)->rvalue_chain; @@ -299,7 +299,7 @@ namespace registry registration const* query(type_info type) { registry_t::iterator p = entries().find(entry(type)); -# ifdef BOOST_PYTHON_TRACE_REGISTRY +# ifdef PXR_BOOST_PYTHON_TRACE_REGISTRY std::cout << "querying " << type << (p == entries().end() || p->target_type != type ? "...NOT found\n" : "...found\n"); @@ -308,4 +308,4 @@ namespace registry } } // namespace registry -}}} // namespace boost::python::converter +}}} // namespace PXR_BOOST_NAMESPACE::python::converter diff --git a/pxr/external/boost/python/src/converter/type_id.cpp b/pxr/external/boost/python/src/converter/type_id.cpp index 9ea0472513..9b8c81a119 100644 --- a/pxr/external/boost/python/src/converter/type_id.cpp +++ b/pxr/external/boost/python/src/converter/type_id.cpp @@ -27,7 +27,7 @@ # include #endif -# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# ifdef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # if defined(__GNUC__) && __GNUC__ >= 3 // http://lists.debian.org/debian-gcc/2003/09/msg00055.html notes @@ -42,9 +42,9 @@ class __class_type_info; # endif #endif /* defined(__QNXNTO__) */ -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# ifdef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # if defined(__QNXNTO__) namespace cxxabi { @@ -112,7 +112,7 @@ bool cxxabi_cxa_demangle_is_broken() namespace detail { - BOOST_PYTHON_DECL char const* gcc_demangle(char const* mangled) + PXR_BOOST_PYTHON_DECL char const* gcc_demangle(char const* mangled) { typedef std::vector< std::pair @@ -195,14 +195,14 @@ namespace detail } # endif -BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, type_info const& x) +PXR_BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, type_info const& x) { return os << x.name(); } namespace detail { - BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, detail::decorated_type_info const& x) + PXR_BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream& os, detail::decorated_type_info const& x) { os << x.m_base_type; if (x.m_decoration & decorated_type_info::const_) @@ -214,4 +214,4 @@ namespace detail return os; } } -}} // namespace boost::python::converter +}} // namespace PXR_BOOST_NAMESPACE::python::converter diff --git a/pxr/external/boost/python/src/dict.cpp b/pxr/external/boost/python/src/dict.cpp index 19504945a6..a27735146f 100644 --- a/pxr/external/boost/python/src/dict.cpp +++ b/pxr/external/boost/python/src/dict.cpp @@ -9,7 +9,7 @@ #include "pxr/external/boost/python/dict.hpp" #include "pxr/external/boost/python/extract.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { namespace { // When returning list objects from methods, it may turn out that the @@ -181,9 +181,9 @@ static struct register_dict_pytype_ptr register_dict_pytype_ptr() { const_cast( - converter::registry::lookup(boost::python::type_id()) + converter::registry::lookup(PXR_BOOST_NAMESPACE::python::type_id()) ).m_class_object = &PyDict_Type; } }register_dict_pytype_ptr_; -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/errors.cpp b/pxr/external/boost/python/src/errors.cpp index ecadb1178b..d6cc459062 100644 --- a/pxr/external/boost/python/src/errors.cpp +++ b/pxr/external/boost/python/src/errors.cpp @@ -8,20 +8,20 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_PYTHON_SOURCE -# define BOOST_PYTHON_SOURCE +#ifndef PXR_BOOST_PYTHON_SOURCE +# define PXR_BOOST_PYTHON_SOURCE #endif #include "pxr/external/boost/python/errors.hpp" #include #include "pxr/external/boost/python/detail/exception_handler.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { error_already_set::~error_already_set() {} // IMPORTANT: this function may only be called from within a catch block! -BOOST_PYTHON_DECL bool handle_exception_impl(function0 f) +PXR_BOOST_PYTHON_DECL bool handle_exception_impl(function0 f) { try { @@ -30,7 +30,7 @@ BOOST_PYTHON_DECL bool handle_exception_impl(function0 f) f(); return false; } - catch(const boost::python::error_already_set&) + catch(const PXR_BOOST_NAMESPACE::python::error_already_set&) { // The python error reporting has already been handled. } @@ -61,7 +61,7 @@ BOOST_PYTHON_DECL bool handle_exception_impl(function0 f) return true; } -void BOOST_PYTHON_DECL throw_error_already_set() +void PXR_BOOST_PYTHON_DECL throw_error_already_set() { throw error_already_set(); } @@ -95,7 +95,7 @@ exception_handler::exception_handler(handler_function const& impl) exception_handler* exception_handler::chain; exception_handler* exception_handler::tail; -BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f) +PXR_BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f) { // the constructor links the new object into a handler chain, so // this object isn't actaully leaked (until, of course, the @@ -103,8 +103,8 @@ BOOST_PYTHON_DECL void register_exception_handler(handler_function const& f) new exception_handler(f); } -} // namespace boost::python::detail +} // namespace PXR_BOOST_NAMESPACE::python::detail -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/exec.cpp b/pxr/external/boost/python/src/exec.cpp index 187b3e9d9e..20791ea889 100644 --- a/pxr/external/boost/python/src/exec.cpp +++ b/pxr/external/boost/python/src/exec.cpp @@ -14,17 +14,17 @@ #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/handle.hpp" -namespace boost +namespace PXR_BOOST_NAMESPACE { namespace python { -object BOOST_PYTHON_DECL eval(str string, object global, object local) +object PXR_BOOST_PYTHON_DECL eval(str string, object global, object local) { return eval(python::extract(string), global, local); } -object BOOST_PYTHON_DECL eval(char const *string, object global, object local) +object PXR_BOOST_PYTHON_DECL eval(char const *string, object global, object local) { // Set suitable default values for global and local dicts. if (global.is_none()) @@ -42,12 +42,12 @@ object BOOST_PYTHON_DECL eval(char const *string, object global, object local) return object(detail::new_reference(result)); } -object BOOST_PYTHON_DECL exec(str string, object global, object local) +object PXR_BOOST_PYTHON_DECL exec(str string, object global, object local) { return exec(python::extract(string), global, local); } -object BOOST_PYTHON_DECL exec(char const *string, object global, object local) +object PXR_BOOST_PYTHON_DECL exec(char const *string, object global, object local) { // Set suitable default values for global and local dicts. if (global.is_none()) @@ -65,12 +65,12 @@ object BOOST_PYTHON_DECL exec(char const *string, object global, object local) return object(detail::new_reference(result)); } -object BOOST_PYTHON_DECL exec_statement(str string, object global, object local) +object PXR_BOOST_PYTHON_DECL exec_statement(str string, object global, object local) { return exec_statement(python::extract(string), global, local); } -object BOOST_PYTHON_DECL exec_statement(char const *string, object global, object local) +object PXR_BOOST_PYTHON_DECL exec_statement(char const *string, object global, object local) { // Set suitable default values for global and local dicts. if (global.is_none()) @@ -91,12 +91,12 @@ object BOOST_PYTHON_DECL exec_statement(char const *string, object global, objec // Execute python source code from file filename. // global and local are the global and local scopes respectively, // used during execution. -object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) +object PXR_BOOST_PYTHON_DECL exec_file(str filename, object global, object local) { return exec_file(python::extract(filename), global, local); } -object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object local) +object PXR_BOOST_PYTHON_DECL exec_file(char const *filename, object global, object local) { // Set suitable default values for global and local dicts. if (global.is_none()) @@ -139,5 +139,5 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l return object(detail::new_reference(result)); } -} // namespace boost::python -} // namespace boost +} // namespace PXR_BOOST_NAMESPACE::python +} // namespace PXR_BOOST_NAMESPACE diff --git a/pxr/external/boost/python/src/import.cpp b/pxr/external/boost/python/src/import.cpp index 37bc58776d..0c2b78a0a7 100644 --- a/pxr/external/boost/python/src/import.cpp +++ b/pxr/external/boost/python/src/import.cpp @@ -13,12 +13,12 @@ #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/handle.hpp" -namespace boost +namespace PXR_BOOST_NAMESPACE { namespace python { -object BOOST_PYTHON_DECL import(str name) +object PXR_BOOST_PYTHON_DECL import(str name) { // should be 'char const *' but older python versions don't use 'const' yet. char *n = python::extract(name); @@ -26,5 +26,5 @@ object BOOST_PYTHON_DECL import(str name) return python::object(module); } -} // namespace boost::python -} // namespace boost +} // namespace PXR_BOOST_NAMESPACE::python +} // namespace PXR_BOOST_NAMESPACE diff --git a/pxr/external/boost/python/src/list.cpp b/pxr/external/boost/python/src/list.cpp index c60ff09c06..0743ca0453 100644 --- a/pxr/external/boost/python/src/list.cpp +++ b/pxr/external/boost/python/src/list.cpp @@ -10,7 +10,7 @@ #include "pxr/external/boost/python/list.hpp" #include "pxr/external/boost/python/ssize_t.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { detail::new_non_null_reference list_base::call(object const& arg_) @@ -167,9 +167,9 @@ static struct register_list_pytype_ptr register_list_pytype_ptr() { const_cast( - converter::registry::lookup(boost::python::type_id()) + converter::registry::lookup(PXR_BOOST_NAMESPACE::python::type_id()) ).m_class_object = &PyList_Type; } }register_list_pytype_ptr_; -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/long.cpp b/pxr/external/boost/python/src/long.cpp index 5b1412320c..79d8aac8fe 100644 --- a/pxr/external/boost/python/src/long.cpp +++ b/pxr/external/boost/python/src/long.cpp @@ -9,7 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include "pxr/external/boost/python/long.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { new_reference long_base::call(object const& arg_) { @@ -41,4 +41,4 @@ long_base::long_base(object_cref arg, object_cref base) {} -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/module.cpp b/pxr/external/boost/python/src/module.cpp index 1fa3497f43..cf821de542 100644 --- a/pxr/external/boost/python/src/module.cpp +++ b/pxr/external/boost/python/src/module.cpp @@ -14,7 +14,7 @@ #include "pxr/external/boost/python/scope.hpp" #include "pxr/external/boost/python/object/add_to_namespace.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { namespace { @@ -33,7 +33,7 @@ namespace } } -BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char const* doc) +PXR_BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char const* doc) { // Use function::add_to_namespace to achieve overloading if // appropriate. @@ -43,7 +43,7 @@ BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char #if PY_VERSION_HEX >= 0x03000000 -BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef& moduledef, void(*init_function)()) +PXR_BOOST_PYTHON_DECL PyObject* init_module(PyModuleDef& moduledef, void(*init_function)()) { return init_module_in_scope( PyModule_Create(&moduledef), @@ -57,7 +57,7 @@ namespace PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; } -BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*init_function)()) +PXR_BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*init_function)()) { return init_module_in_scope( Py_InitModule(const_cast(name), initial_methods), @@ -66,13 +66,13 @@ BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*init_function)() #endif -}}} // namespace boost::python::detail +}}} // namespace PXR_BOOST_NAMESPACE::python::detail -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { - BOOST_PYTHON_DECL PyObject* current_scope = 0; + PXR_BOOST_PYTHON_DECL PyObject* current_scope = 0; } }} diff --git a/pxr/external/boost/python/src/numpy/dtype.cpp b/pxr/external/boost/python/src/numpy/dtype.cpp index c0bd61286d..2ca9fde0fe 100644 --- a/pxr/external/boost/python/src/numpy/dtype.cpp +++ b/pxr/external/boost/python/src/numpy/dtype.cpp @@ -12,7 +12,7 @@ #ifdef _MSC_VER #include #endif -#define BOOST_PYTHON_NUMPY_INTERNAL +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL #include "pxr/external/boost/python/numpy/internal.hpp" #define DTYPE_FROM_CODE(code) \ @@ -44,9 +44,9 @@ }; \ template BOOST_NUMPY_DECL dtype get_complex_dtype() -namespace boost { namespace python { namespace converter { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayDescr_Type, numpy::dtype) -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter namespace numpy { namespace detail { @@ -137,7 +137,7 @@ bool equivalent(dtype const & a, dtype const & b) { namespace { -namespace pyconv = boost::python::converter; +namespace pyconv = PXR_BOOST_NAMESPACE::python::converter; template class array_scalar_converter @@ -184,7 +184,7 @@ class array_scalar_converter static void declare() { pyconv::registry::push_back(&convertible, &convert, python::type_id() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &get_pytype #endif ); @@ -222,4 +222,4 @@ void dtype::register_scalar_converters() #endif } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/numpy/matrix.cpp b/pxr/external/boost/python/src/numpy/matrix.cpp index 5be573f3c0..d55b85435b 100644 --- a/pxr/external/boost/python/src/numpy/matrix.cpp +++ b/pxr/external/boost/python/src/numpy/matrix.cpp @@ -9,11 +9,11 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_PYTHON_NUMPY_INTERNAL +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL #include "pxr/external/boost/python/numpy/internal.hpp" #include "pxr/external/boost/python/numpy/matrix.hpp" -namespace boost { namespace python { namespace numpy +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { namespace detail { @@ -22,8 +22,8 @@ inline object get_matrix_type() object module = import("numpy"); return module.attr("matrix"); } -} // namespace boost::python::numpy::detail -} // namespace boost::python::numpy +} // namespace PXR_BOOST_NAMESPACE::python::numpy::detail +} // namespace PXR_BOOST_NAMESPACE::python::numpy namespace converter { @@ -33,7 +33,7 @@ PyTypeObject const * object_manager_traits::get_pytype() return reinterpret_cast(numpy::detail::get_matrix_type().ptr()); } -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter namespace numpy { @@ -65,4 +65,4 @@ matrix matrix::transpose() const return matrix(extract(ndarray::transpose())); } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/numpy/ndarray.cpp b/pxr/external/boost/python/src/numpy/ndarray.cpp index b1cd90408d..dbe49df3ec 100644 --- a/pxr/external/boost/python/src/numpy/ndarray.cpp +++ b/pxr/external/boost/python/src/numpy/ndarray.cpp @@ -9,15 +9,15 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_PYTHON_NUMPY_INTERNAL +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL #include "pxr/external/boost/python/numpy/internal.hpp" #include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArray_Type, numpy::ndarray) -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter namespace numpy { @@ -303,4 +303,4 @@ ndarray from_object(python::object const & obj, int nd_min, int nd_max, ndarray: NULL))); } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/numpy/numpy.cpp b/pxr/external/boost/python/src/numpy/numpy.cpp index b46a9d9923..b2194fb082 100644 --- a/pxr/external/boost/python/src/numpy/numpy.cpp +++ b/pxr/external/boost/python/src/numpy/numpy.cpp @@ -9,11 +9,11 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_PYTHON_NUMPY_INTERNAL_MAIN +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL_MAIN #include "pxr/external/boost/python/numpy/internal.hpp" #include "pxr/external/boost/python/numpy/dtype.hpp" -namespace boost { namespace python { namespace numpy { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace numpy { #if PY_MAJOR_VERSION == 2 static void wrap_import_array() @@ -36,4 +36,4 @@ void initialize(bool register_scalar_converters) dtype::register_scalar_converters(); } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/numpy/scalars.cpp b/pxr/external/boost/python/src/numpy/scalars.cpp index 253faf7e7c..c77f8d29b7 100644 --- a/pxr/external/boost/python/src/numpy/scalars.cpp +++ b/pxr/external/boost/python/src/numpy/scalars.cpp @@ -9,14 +9,14 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_PYTHON_NUMPY_INTERNAL +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL #include "pxr/external/boost/python/numpy/internal.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyVoidArrType_Type, numpy::void_) -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter namespace numpy { @@ -38,4 +38,4 @@ void_ void_::copy() const (PyObject_CallMethod(this->ptr(), const_cast("copy"), const_cast("")))); } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/numpy/ufunc.cpp b/pxr/external/boost/python/src/numpy/ufunc.cpp index 6d0e93888d..2760eb40c9 100644 --- a/pxr/external/boost/python/src/numpy/ufunc.cpp +++ b/pxr/external/boost/python/src/numpy/ufunc.cpp @@ -9,15 +9,15 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_PYTHON_NUMPY_INTERNAL +#define PXR_BOOST_PYTHON_NUMPY_INTERNAL #include "pxr/external/boost/python/numpy/internal.hpp" #include "pxr/external/boost/python/numpy/ufunc.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace converter { NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyArrayMultiIter_Type, numpy::multi_iter) -} // namespace boost::python::converter +} // namespace PXR_BOOST_NAMESPACE::python::converter namespace numpy { @@ -67,4 +67,4 @@ Py_intptr_t multi_iter::shape(int n) const return reinterpret_cast(ptr())->dimensions[n]; } -}}} // namespace boost::python::numpy +}}} // namespace PXR_BOOST_NAMESPACE::python::numpy diff --git a/pxr/external/boost/python/src/object/class.cpp b/pxr/external/boost/python/src/object/class.cpp index 1ada149d14..a289694ea3 100644 --- a/pxr/external/boost/python/src/object/class.cpp +++ b/pxr/external/boost/python/src/object/class.cpp @@ -33,9 +33,9 @@ #include #include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { -# ifdef BOOST_PYTHON_SELF_IS_CLASS +# ifdef PXR_BOOST_PYTHON_SELF_IS_CLASS namespace self_ns { self_t self; @@ -210,7 +210,7 @@ namespace objects } #endif - BOOST_PYTHON_DECL PyObject* static_data() + PXR_BOOST_PYTHON_DECL PyObject* static_data() { if (static_data_object.tp_dict == 0) { @@ -318,7 +318,7 @@ void instance_holder::install(PyObject* self) throw() namespace objects { // Get the metatype object for all extension classes. - BOOST_PYTHON_DECL type_handle class_metatype() + PXR_BOOST_PYTHON_DECL type_handle class_metatype() { if (class_metatype_object.tp_dict == 0) { @@ -467,7 +467,7 @@ namespace objects #endif }; - BOOST_PYTHON_DECL type_handle class_type() + PXR_BOOST_PYTHON_DECL type_handle class_type() { if (class_type_object.tp_dict == 0) { @@ -480,7 +480,7 @@ namespace objects return type_handle(borrowed(&class_type_object)); } - BOOST_PYTHON_DECL void* + PXR_BOOST_PYTHON_DECL void* find_instance_impl(PyObject* inst, type_info type, bool null_shared_ptr_only) { if (!Py_TYPE(Py_TYPE(inst)) || @@ -599,7 +599,7 @@ namespace objects converters.m_class_object = (PyTypeObject*)incref(this->ptr()); } - BOOST_PYTHON_DECL void copy_class_object(type_info const& src, type_info const& dst) + PXR_BOOST_PYTHON_DECL void copy_class_object(type_info const& src, type_info const& dst) { converter::registration& dst_converters = const_cast(converter::registry::lookup(dst)); @@ -720,7 +720,7 @@ namespace objects )); } - BOOST_PYTHON_DECL type_handle registered_class_object(type_info id) + PXR_BOOST_PYTHON_DECL type_handle registered_class_object(type_info id) { return query_class(id); } @@ -783,4 +783,4 @@ void instance_holder::deallocate(PyObject* self_, void* storage) throw() } } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/object/enum.cpp b/pxr/external/boost/python/src/object/enum.cpp index 65c6aee878..fc7858dad3 100644 --- a/pxr/external/boost/python/src/object/enum.cpp +++ b/pxr/external/boost/python/src/object/enum.cpp @@ -19,7 +19,7 @@ #include "pxr/external/boost/python/object_protocol.hpp" #include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { struct enum_object { @@ -253,4 +253,4 @@ PyObject* enum_base::to_python(PyTypeObject* type_, long x) (v == object() ? type(x) : v).ptr()); } -}}} // namespace boost::python::object +}}} // namespace PXR_BOOST_NAMESPACE::python::object diff --git a/pxr/external/boost/python/src/object/function.cpp b/pxr/external/boost/python/src/object/function.cpp index 747dd39c80..6cff73c634 100644 --- a/pxr/external/boost/python/src/object/function.cpp +++ b/pxr/external/boost/python/src/object/function.cpp @@ -31,21 +31,21 @@ #include #include -#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES +#if PXR_BOOST_PYTHON_DEBUG_ERROR_MESSAGES # include #endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { volatile bool docstring_options::show_user_defined_ = true; volatile bool docstring_options::show_cpp_signatures_ = true; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES volatile bool docstring_options::show_py_signatures_ = true; #else volatile bool docstring_options::show_py_signatures_ = false; #endif }} -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { py_function_impl_base::~py_function_impl_base() { @@ -312,7 +312,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const message += ")\ndid not match C++ signature:\n "; message += str("\n ").join(signatures()); -#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES +#if PXR_BOOST_PYTHON_DEBUG_ERROR_MESSAGES std::printf("\n--------\n%s\n--------\n", extract(message)()); #endif PyErr_SetObject(exception.get(), message.ptr()); @@ -557,13 +557,13 @@ void function::add_to_namespace( } } -BOOST_PYTHON_DECL void add_to_namespace( +PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute) { function::add_to_namespace(name_space, name, attribute, 0); } -BOOST_PYTHON_DECL void add_to_namespace( +PXR_BOOST_PYTHON_DECL void add_to_namespace( object const& name_space, char const* name, object const& attribute, char const* doc) { function::add_to_namespace(name_space, name, attribute, doc); @@ -775,7 +775,7 @@ handle<> function_handle_impl(py_function const& f) namespace detail { - object BOOST_PYTHON_DECL make_raw_function(objects::py_function f) + object PXR_BOOST_PYTHON_DECL make_raw_function(objects::py_function f) { static keyword k; @@ -783,7 +783,7 @@ namespace detail f , keyword_range(&k,&k)); } - void BOOST_PYTHON_DECL pure_virtual_called() + void PXR_BOOST_PYTHON_DECL pure_virtual_called() { PyErr_SetString( PyExc_RuntimeError, const_cast("Pure virtual function called")); @@ -791,4 +791,4 @@ namespace detail } } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/object/function_doc_signature.cpp b/pxr/external/boost/python/src/object/function_doc_signature.cpp index d97091eb67..4c6059707d 100644 --- a/pxr/external/boost/python/src/object/function_doc_signature.cpp +++ b/pxr/external/boost/python/src/object/function_doc_signature.cpp @@ -8,7 +8,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// boost::python::make_tuple below are for gcc 4.4 -std=c++0x compatibility +// PXR_BOOST_NAMESPACE::python::make_tuple below are for gcc 4.4 -std=c++0x compatibility // (Intel C++ 10 and 11 with -std=c++0x don't need the full qualification). #include "pxr/external/boost/python/converter/registrations.hpp" @@ -22,7 +22,7 @@ #include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { bool function_doc_signature_generator::arity_cmp( function const *f1, function const *f2 ) { @@ -235,7 +235,7 @@ namespace boost { namespace python { namespace objects { { return str( "%s %s(%s%s%s%s)" - % boost::python::make_tuple // workaround, see top + % PXR_BOOST_NAMESPACE::python::make_tuple // workaround, see top ( ret_type , f->m_name , str(",").join(formal_params.slice(0,arity-n_overloads)) @@ -246,7 +246,7 @@ namespace boost { namespace python { namespace objects { }else{ return str( "%s(%s%s%s%s) -> %s" - % boost::python::make_tuple // workaround, see top + % PXR_BOOST_NAMESPACE::python::make_tuple // workaround, see top ( f->m_name , str(",").join(formal_params.slice(0,arity-n_overloads)) , n_overloads ? (n_overloads!=arity?str(" [,"):str("[ ")) : str() @@ -258,7 +258,7 @@ namespace boost { namespace python { namespace objects { return str( "%s %s(%s%s%s%s) %s" - % boost::python::make_tuple // workaround, see top + % PXR_BOOST_NAMESPACE::python::make_tuple // workaround, see top ( cpp_types?ret_type:str("") , f->m_name , str(",").join(formal_params.slice(0,arity-n_overloads)) diff --git a/pxr/external/boost/python/src/object/inheritance.cpp b/pxr/external/boost/python/src/object/inheritance.cpp index 9ae690450f..1804d659f7 100644 --- a/pxr/external/boost/python/src/object/inheritance.cpp +++ b/pxr/external/boost/python/src/object/inheritance.cpp @@ -35,16 +35,21 @@ // paths. The vertex distance to any goal node is calculated on // demand and outdated by the addition of edges to the graph. -namespace boost { +namespace PXR_BOOST_NAMESPACE { namespace { enum edge_cast_t { edge_cast = 8010 }; template inline void unused_variable(const T&) { } } +} +namespace boost { +using namespace PXR_BOOST_NAMESPACE; // Install properties BOOST_INSTALL_PROPERTY(edge, cast); +} +namespace PXR_BOOST_NAMESPACE { namespace { typedef void*(*cast_function)(void*); @@ -156,7 +161,7 @@ namespace // // Our index of class types // - using boost::python::objects::dynamic_id_function; + using PXR_BOOST_NAMESPACE::python::objects::dynamic_id_function; typedef tuples::tuple< class_id // static type , vertex_t // corresponding vertex @@ -406,7 +411,7 @@ namespace // Look up the dynamic_id function and call it to get the dynamic // info - boost::python::objects::dynamic_id_t dynamic_id = polymorphic + PXR_BOOST_NAMESPACE::python::objects::dynamic_id_t dynamic_id = polymorphic ? tuples::get(*src_p)(p) : std::make_pair(p, src_t); @@ -444,17 +449,17 @@ namespace namespace python { namespace objects { -BOOST_PYTHON_DECL void* find_dynamic_type(void* p, class_id src_t, class_id dst_t) +PXR_BOOST_PYTHON_DECL void* find_dynamic_type(void* p, class_id src_t, class_id dst_t) { return convert_type(p, src_t, dst_t, true); } -BOOST_PYTHON_DECL void* find_static_type(void* p, class_id src_t, class_id dst_t) +PXR_BOOST_PYTHON_DECL void* find_static_type(void* p, class_id src_t, class_id dst_t) { return convert_type(p, src_t, dst_t, false); } -BOOST_PYTHON_DECL void add_cast( +PXR_BOOST_PYTHON_DECL void add_cast( class_id src_t, class_id dst_t, cast_function cast, bool is_downcast) { // adding an edge will invalidate any record of unreachability in @@ -492,10 +497,10 @@ BOOST_PYTHON_DECL void add_cast( } } -BOOST_PYTHON_DECL void register_dynamic_id_aux( +PXR_BOOST_PYTHON_DECL void register_dynamic_id_aux( class_id static_id, dynamic_id_function get_dynamic_id) { tuples::get(*demand_type(static_id)) = get_dynamic_id; } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects diff --git a/pxr/external/boost/python/src/object/iterator.cpp b/pxr/external/boost/python/src/object/iterator.cpp index ffa3b406d0..992862cbf1 100644 --- a/pxr/external/boost/python/src/object/iterator.cpp +++ b/pxr/external/boost/python/src/object/iterator.cpp @@ -13,7 +13,7 @@ #include #include -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { namespace { @@ -25,7 +25,7 @@ namespace } } -BOOST_PYTHON_DECL object const& identity_function() +PXR_BOOST_PYTHON_DECL object const& identity_function() { static object result( function_object( @@ -41,4 +41,4 @@ void stop_iteration_error() throw_error_already_set(); } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects diff --git a/pxr/external/boost/python/src/object/life_support.cpp b/pxr/external/boost/python/src/object/life_support.cpp index a8b81adbac..a6eede4cee 100644 --- a/pxr/external/boost/python/src/object/life_support.cpp +++ b/pxr/external/boost/python/src/object/life_support.cpp @@ -11,7 +11,7 @@ #include "pxr/external/boost/python/detail/none.hpp" #include "pxr/external/boost/python/refcount.hpp" -namespace boost { namespace python { namespace objects { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { struct life_support { @@ -36,7 +36,7 @@ extern "C" ((life_support*)self)->patient = 0; // Let the weak reference die. This probably kills us. Py_XDECREF(PyTuple_GET_ITEM(arg, 0)); - return ::boost::python::detail::none(); + return ::PXR_BOOST_NAMESPACE::python::detail::none(); } } @@ -123,4 +123,4 @@ PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient) return weakref; } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects diff --git a/pxr/external/boost/python/src/object/pickle_support.cpp b/pxr/external/boost/python/src/object/pickle_support.cpp index 10d0913bcf..9a6d535636 100644 --- a/pxr/external/boost/python/src/object/pickle_support.cpp +++ b/pxr/external/boost/python/src/object/pickle_support.cpp @@ -15,7 +15,7 @@ #include "pxr/external/boost/python/dict.hpp" #include "pxr/external/boost/python/str.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace { @@ -80,4 +80,4 @@ object const& make_instance_reduce_function() return result; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/object/stl_iterator.cpp b/pxr/external/boost/python/src/object/stl_iterator.cpp index 1b3981c40e..a7b9a8977a 100644 --- a/pxr/external/boost/python/src/object/stl_iterator.cpp +++ b/pxr/external/boost/python/src/object/stl_iterator.cpp @@ -16,7 +16,7 @@ #include "pxr/external/boost/python/handle.hpp" #include "pxr/external/boost/python/object/stl_iterator_core.hpp" -namespace boost { namespace python { namespace objects +namespace PXR_BOOST_NAMESPACE { namespace python { namespace objects { stl_input_iterator_impl::stl_input_iterator_impl() @@ -25,7 +25,7 @@ stl_input_iterator_impl::stl_input_iterator_impl() { } -stl_input_iterator_impl::stl_input_iterator_impl(boost::python::object const &ob) +stl_input_iterator_impl::stl_input_iterator_impl(PXR_BOOST_NAMESPACE::python::object const &ob) : it_(ob.attr("__iter__")()) , ob_() { @@ -34,10 +34,10 @@ stl_input_iterator_impl::stl_input_iterator_impl(boost::python::object const &ob void stl_input_iterator_impl::increment() { - this->ob_ = boost::python::handle<>( - boost::python::allow_null(PyIter_Next(this->it_.ptr()))); + this->ob_ = PXR_BOOST_NAMESPACE::python::handle<>( + PXR_BOOST_NAMESPACE::python::allow_null(PyIter_Next(this->it_.ptr()))); if (PyErr_Occurred()) - throw boost::python::error_already_set(); + throw PXR_BOOST_NAMESPACE::python::error_already_set(); } bool stl_input_iterator_impl::equal(stl_input_iterator_impl const &that) const @@ -45,9 +45,9 @@ bool stl_input_iterator_impl::equal(stl_input_iterator_impl const &that) const return !this->ob_ == !that.ob_; } -boost::python::handle<> const &stl_input_iterator_impl::current() const +PXR_BOOST_NAMESPACE::python::handle<> const &stl_input_iterator_impl::current() const { return this->ob_; } -}}} // namespace boost::python::objects +}}} // namespace PXR_BOOST_NAMESPACE::python::objects diff --git a/pxr/external/boost/python/src/object_operators.cpp b/pxr/external/boost/python/src/object_operators.cpp index baf394f6b5..a6f1622a97 100644 --- a/pxr/external/boost/python/src/object_operators.cpp +++ b/pxr/external/boost/python/src/object_operators.cpp @@ -11,10 +11,10 @@ #include "pxr/external/boost/python/object_operators.hpp" #include "pxr/external/boost/python/detail/raw_pyobject.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { -# define BOOST_PYTHON_COMPARE_OP(op, opid) \ -BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ +# define PXR_BOOST_PYTHON_COMPARE_OP(op, opid) \ +PXR_BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ { \ return object( \ detail::new_reference( \ @@ -22,17 +22,17 @@ BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ l.ptr(), r.ptr(), opid)) \ ); \ } -BOOST_PYTHON_COMPARE_OP(>, Py_GT) -BOOST_PYTHON_COMPARE_OP(>=, Py_GE) -BOOST_PYTHON_COMPARE_OP(<, Py_LT) -BOOST_PYTHON_COMPARE_OP(<=, Py_LE) -BOOST_PYTHON_COMPARE_OP(==, Py_EQ) -BOOST_PYTHON_COMPARE_OP(!=, Py_NE) -# undef BOOST_PYTHON_COMPARE_OP +PXR_BOOST_PYTHON_COMPARE_OP(>, Py_GT) +PXR_BOOST_PYTHON_COMPARE_OP(>=, Py_GE) +PXR_BOOST_PYTHON_COMPARE_OP(<, Py_LT) +PXR_BOOST_PYTHON_COMPARE_OP(<=, Py_LE) +PXR_BOOST_PYTHON_COMPARE_OP(==, Py_EQ) +PXR_BOOST_PYTHON_COMPARE_OP(!=, Py_NE) +# undef PXR_BOOST_PYTHON_COMPARE_OP -#define BOOST_PYTHON_BINARY_OPERATOR(op, name) \ -BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ +#define PXR_BOOST_PYTHON_BINARY_OPERATOR(op, name) \ +PXR_BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ { \ return object( \ detail::new_reference( \ @@ -40,51 +40,51 @@ BOOST_PYTHON_DECL object operator op(object const& l, object const& r) \ ); \ } -BOOST_PYTHON_BINARY_OPERATOR(+, Add) -BOOST_PYTHON_BINARY_OPERATOR(-, Subtract) -BOOST_PYTHON_BINARY_OPERATOR(*, Multiply) +PXR_BOOST_PYTHON_BINARY_OPERATOR(+, Add) +PXR_BOOST_PYTHON_BINARY_OPERATOR(-, Subtract) +PXR_BOOST_PYTHON_BINARY_OPERATOR(*, Multiply) #if PY_VERSION_HEX >= 0x03000000 // We choose FloorDivide instead of TrueDivide to keep the semantic // conform with C/C++'s '/' operator -BOOST_PYTHON_BINARY_OPERATOR(/, FloorDivide) +PXR_BOOST_PYTHON_BINARY_OPERATOR(/, FloorDivide) #else -BOOST_PYTHON_BINARY_OPERATOR(/, Divide) +PXR_BOOST_PYTHON_BINARY_OPERATOR(/, Divide) #endif -BOOST_PYTHON_BINARY_OPERATOR(%, Remainder) -BOOST_PYTHON_BINARY_OPERATOR(<<, Lshift) -BOOST_PYTHON_BINARY_OPERATOR(>>, Rshift) -BOOST_PYTHON_BINARY_OPERATOR(&, And) -BOOST_PYTHON_BINARY_OPERATOR(^, Xor) -BOOST_PYTHON_BINARY_OPERATOR(|, Or) -#undef BOOST_PYTHON_BINARY_OPERATOR +PXR_BOOST_PYTHON_BINARY_OPERATOR(%, Remainder) +PXR_BOOST_PYTHON_BINARY_OPERATOR(<<, Lshift) +PXR_BOOST_PYTHON_BINARY_OPERATOR(>>, Rshift) +PXR_BOOST_PYTHON_BINARY_OPERATOR(&, And) +PXR_BOOST_PYTHON_BINARY_OPERATOR(^, Xor) +PXR_BOOST_PYTHON_BINARY_OPERATOR(|, Or) +#undef PXR_BOOST_PYTHON_BINARY_OPERATOR -#define BOOST_PYTHON_INPLACE_OPERATOR(op, name) \ -BOOST_PYTHON_DECL object& operator op##=(object& l, object const& r) \ +#define PXR_BOOST_PYTHON_INPLACE_OPERATOR(op, name) \ +PXR_BOOST_PYTHON_DECL object& operator op##=(object& l, object const& r) \ { \ return l = object( \ (detail::new_reference) \ PyNumber_InPlace##name(l.ptr(), r.ptr())); \ } -BOOST_PYTHON_INPLACE_OPERATOR(+, Add) -BOOST_PYTHON_INPLACE_OPERATOR(-, Subtract) -BOOST_PYTHON_INPLACE_OPERATOR(*, Multiply) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(+, Add) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(-, Subtract) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(*, Multiply) #if PY_VERSION_HEX >= 0x03000000 // Same reason as above for choosing FloorDivide instead of TrueDivide -BOOST_PYTHON_INPLACE_OPERATOR(/, FloorDivide) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(/, FloorDivide) #else -BOOST_PYTHON_INPLACE_OPERATOR(/, Divide) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(/, Divide) #endif -BOOST_PYTHON_INPLACE_OPERATOR(%, Remainder) -BOOST_PYTHON_INPLACE_OPERATOR(<<, Lshift) -BOOST_PYTHON_INPLACE_OPERATOR(>>, Rshift) -BOOST_PYTHON_INPLACE_OPERATOR(&, And) -BOOST_PYTHON_INPLACE_OPERATOR(^, Xor) -BOOST_PYTHON_INPLACE_OPERATOR(|, Or) -#undef BOOST_PYTHON_INPLACE_OPERATOR +PXR_BOOST_PYTHON_INPLACE_OPERATOR(%, Remainder) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(<<, Lshift) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(>>, Rshift) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(&, And) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(^, Xor) +PXR_BOOST_PYTHON_INPLACE_OPERATOR(|, Or) +#undef PXR_BOOST_PYTHON_INPLACE_OPERATOR object::object(handle<> const& x) : object_base(python::incref(python::expect_non_null(x.get()))) {} -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/object_protocol.cpp b/pxr/external/boost/python/src/object_protocol.cpp index 427ed52f16..c2afe13878 100644 --- a/pxr/external/boost/python/src/object_protocol.cpp +++ b/pxr/external/boost/python/src/object_protocol.cpp @@ -13,14 +13,14 @@ #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/ssize_t.hpp" -namespace boost { namespace python { namespace api { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace api { -BOOST_PYTHON_DECL object getattr(object const& target, object const& key) +PXR_BOOST_PYTHON_DECL object getattr(object const& target, object const& key) { return object(detail::new_reference(PyObject_GetAttr(target.ptr(), key.ptr()))); } -BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_) +PXR_BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object const& default_) { PyObject* result = PyObject_GetAttr(target.ptr(), key.ptr()); if (result == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -31,19 +31,19 @@ BOOST_PYTHON_DECL object getattr(object const& target, object const& key, object return object(detail::new_reference(result)); } -BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value) +PXR_BOOST_PYTHON_DECL void setattr(object const& target, object const& key, object const& value) { if (PyObject_SetAttr(target.ptr(), key.ptr(), value.ptr()) == -1) throw_error_already_set(); } -BOOST_PYTHON_DECL void delattr(object const& target, object const& key) +PXR_BOOST_PYTHON_DECL void delattr(object const& target, object const& key) { if (PyObject_DelAttr(target.ptr(), key.ptr()) == -1) throw_error_already_set(); } -BOOST_PYTHON_DECL object getattr(object const& target, char const* key) +PXR_BOOST_PYTHON_DECL object getattr(object const& target, char const* key) { return object( detail::new_reference( @@ -51,7 +51,7 @@ BOOST_PYTHON_DECL object getattr(object const& target, char const* key) )); } -BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_) +PXR_BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object const& default_) { PyObject* result = PyObject_GetAttrString(target.ptr(), const_cast(key)); if (result == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -62,7 +62,7 @@ BOOST_PYTHON_DECL object getattr(object const& target, char const* key, object c return object(detail::new_reference(result)); } -BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value) +PXR_BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object const& value) { if (PyObject_SetAttrString( target.ptr(), const_cast(key), value.ptr()) == -1 @@ -72,7 +72,7 @@ BOOST_PYTHON_DECL void setattr(object const& target, char const* key, object con } } -BOOST_PYTHON_DECL void delattr(object const& target, char const* key) +PXR_BOOST_PYTHON_DECL void delattr(object const& target, char const* key) { if (PyObject_DelAttrString( target.ptr(), const_cast(key)) == -1 @@ -82,19 +82,19 @@ BOOST_PYTHON_DECL void delattr(object const& target, char const* key) } } -BOOST_PYTHON_DECL object getitem(object const& target, object const& key) +PXR_BOOST_PYTHON_DECL object getitem(object const& target, object const& key) { return object(detail::new_reference( PyObject_GetItem(target.ptr(), key.ptr()))); } -BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value) +PXR_BOOST_PYTHON_DECL void setitem(object const& target, object const& key, object const& value) { if (PyObject_SetItem(target.ptr(), key.ptr(), value.ptr()) == -1) throw_error_already_set(); } -BOOST_PYTHON_DECL void delitem(object const& target, object const& key) +PXR_BOOST_PYTHON_DECL void delitem(object const& target, object const& key) { if (PyObject_DelItem(target.ptr(), key.ptr()) == -1) throw_error_already_set(); @@ -172,14 +172,14 @@ namespace // slicing code copied directly out of the Python implementation } } -BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end) +PXR_BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end) { return object( detail::new_reference( apply_slice(target.ptr(), begin.get(), end.get()))); } -BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value) +PXR_BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, handle<> const& end, object const& value) { if (assign_slice( target.ptr(), begin.get(), end.get(), value.ptr()) == -1 @@ -189,7 +189,7 @@ BOOST_PYTHON_DECL void setslice(object const& target, handle<> const& begin, han } } -BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end) +PXR_BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end) { if (assign_slice( target.ptr(), begin.get(), end.get(), 0) == -1 @@ -199,4 +199,4 @@ BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, han } } -}}} // namespace boost::python::api +}}} // namespace PXR_BOOST_NAMESPACE::python::api diff --git a/pxr/external/boost/python/src/slice.cpp b/pxr/external/boost/python/src/slice.cpp index 5606c53b01..8b24775d9b 100644 --- a/pxr/external/boost/python/src/slice.cpp +++ b/pxr/external/boost/python/src/slice.cpp @@ -11,7 +11,7 @@ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step) : object(detail::new_reference( PySlice_New(start, stop, step))) @@ -39,4 +39,4 @@ slice_base::step() const ((PySliceObject*)this->ptr())->step)); } -} } } // !namespace boost::python::detail +} } } // !namespace PXR_BOOST_NAMESPACE::python::detail diff --git a/pxr/external/boost/python/src/str.cpp b/pxr/external/boost/python/src/str.cpp index 65e4ed8346..8f06988778 100644 --- a/pxr/external/boost/python/src/str.cpp +++ b/pxr/external/boost/python/src/str.cpp @@ -10,7 +10,7 @@ #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/ssize_t.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { detail::new_reference str_base::call(object const& arg_) { @@ -87,10 +87,10 @@ str_base::str_base(object_cref other) : object(str_base::call(other)) {} -#define BOOST_PYTHON_FORMAT_OBJECT(z, n, data) "O" -#define BOOST_PYTHON_OBJECT_PTR(z, n, data) , x##n .ptr() +#define PXR_BOOST_PYTHON_FORMAT_OBJECT(z, n, data) "O" +#define PXR_BOOST_PYTHON_OBJECT_PTR(z, n, data) , x##n .ptr() -#define BOOST_PYTHON_DEFINE_STR_METHOD(name, arity) \ +#define PXR_BOOST_PYTHON_DEFINE_STR_METHOD(name, arity) \ str str_base:: name ( BOOST_PP_ENUM_PARAMS(arity, object_cref x) ) const \ { \ return str(new_reference( \ @@ -98,12 +98,12 @@ str str_base:: name ( BOOST_PP_ENUM_PARAMS(arity, object_cref x) ) const PyObject_CallMethod( \ this->ptr(), const_cast( #name ), \ const_cast( \ - "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")") \ - BOOST_PP_REPEAT_1(arity, BOOST_PYTHON_OBJECT_PTR, _))))); \ + "(" BOOST_PP_REPEAT(arity, PXR_BOOST_PYTHON_FORMAT_OBJECT, _) ")") \ + BOOST_PP_REPEAT_1(arity, PXR_BOOST_PYTHON_OBJECT_PTR, _))))); \ } -BOOST_PYTHON_DEFINE_STR_METHOD(capitalize, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(center, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(capitalize, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(center, 1) long str_base::count(object_cref sub) const { @@ -154,14 +154,14 @@ object str_base::encode(object_cref encoding, object_cref errors) const #if PY_VERSION_HEX >= 0x03000000 - #define _BOOST_PYTHON_ASLONG PyLong_AsLong + #define _PXR_BOOST_PYTHON_ASLONG PyLong_AsLong #else - #define _BOOST_PYTHON_ASLONG PyInt_AsLong + #define _PXR_BOOST_PYTHON_ASLONG PyInt_AsLong #endif bool str_base::endswith(object_cref suffix) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -169,7 +169,7 @@ bool str_base::endswith(object_cref suffix) const bool str_base::endswith(object_cref suffix, object_cref start) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -177,18 +177,18 @@ bool str_base::endswith(object_cref suffix, object_cref start) const bool str_base::endswith(object_cref suffix, object_cref start, object_cref end) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start,end).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; } -BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 1) long str_base::find(object_cref sub) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("find")(sub).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -196,7 +196,7 @@ long str_base::find(object_cref sub) const long str_base::find(object_cref sub, object_cref start) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub,start).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("find")(sub,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -204,7 +204,7 @@ long str_base::find(object_cref sub, object_cref start) const long str_base::find(object_cref sub, object_cref start, object_cref end) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("find")(sub,start,end).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("find")(sub,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -212,7 +212,7 @@ long str_base::find(object_cref sub, object_cref start, object_cref end) const long str_base::index(object_cref sub) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("index")(sub).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -220,7 +220,7 @@ long str_base::index(object_cref sub) const long str_base::index(object_cref sub, object_cref start) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub,start).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("index")(sub,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -228,7 +228,7 @@ long str_base::index(object_cref sub, object_cref start) const long str_base::index(object_cref sub, object_cref start, object_cref end) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("index")(sub,start,end).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("index")(sub,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -236,7 +236,7 @@ long str_base::index(object_cref sub, object_cref start, object_cref end) const bool str_base::isalnum() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("isalnum")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("isalnum")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -244,7 +244,7 @@ bool str_base::isalnum() const bool str_base::isalpha() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("isalpha")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("isalpha")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -252,7 +252,7 @@ bool str_base::isalpha() const bool str_base::isdigit() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("isdigit")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("isdigit")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -260,7 +260,7 @@ bool str_base::isdigit() const bool str_base::islower() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("islower")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("islower")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -268,7 +268,7 @@ bool str_base::islower() const bool str_base::isspace() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("isspace")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("isspace")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -276,7 +276,7 @@ bool str_base::isspace() const bool str_base::istitle() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("istitle")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("istitle")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -284,22 +284,22 @@ bool str_base::istitle() const bool str_base::isupper() const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("isupper")().ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("isupper")().ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; } -BOOST_PYTHON_DEFINE_STR_METHOD(join, 1) -BOOST_PYTHON_DEFINE_STR_METHOD(ljust, 1) -BOOST_PYTHON_DEFINE_STR_METHOD(lower, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(lstrip, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(replace, 2) -BOOST_PYTHON_DEFINE_STR_METHOD(replace, 3) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(join, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(ljust, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(lower, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(lstrip, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(replace, 2) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(replace, 3) long str_base::rfind(object_cref sub) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rfind")(sub).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -307,7 +307,7 @@ long str_base::rfind(object_cref sub) const long str_base::rfind(object_cref sub, object_cref start) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -315,7 +315,7 @@ long str_base::rfind(object_cref sub, object_cref start) const long str_base::rfind(object_cref sub, object_cref start, object_cref end) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start,end).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rfind")(sub,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -323,7 +323,7 @@ long str_base::rfind(object_cref sub, object_cref start, object_cref end) const long str_base::rindex(object_cref sub) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rindex")(sub).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -331,7 +331,7 @@ long str_base::rindex(object_cref sub) const long str_base::rindex(object_cref sub, object_cref start) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -339,14 +339,14 @@ long str_base::rindex(object_cref sub, object_cref start) const long str_base::rindex(object_cref sub, object_cref start, object_cref end) const { - long result = _BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start,end).ptr()); + long result = _PXR_BOOST_PYTHON_ASLONG(this->attr("rindex")(sub,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; } -BOOST_PYTHON_DEFINE_STR_METHOD(rjust, 1) -BOOST_PYTHON_DEFINE_STR_METHOD(rstrip, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(rjust, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(rstrip, 0) list str_base::split() const { @@ -375,7 +375,7 @@ list str_base::splitlines(object_cref keepends) const bool str_base::startswith(object_cref prefix) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -383,7 +383,7 @@ bool str_base::startswith(object_cref prefix) const bool str_base::startswith(object_cref prefix, object_cref start) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; @@ -391,27 +391,27 @@ bool str_base::startswith(object_cref prefix, object_cref start) const bool str_base::startswith(object_cref prefix, object_cref start, object_cref end) const { - bool result = _BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start,end).ptr()); + bool result = _PXR_BOOST_PYTHON_ASLONG(this->attr("startswith")(prefix,start,end).ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; } -#undef _BOOST_PYTHON_ASLONG +#undef _PXR_BOOST_PYTHON_ASLONG -BOOST_PYTHON_DEFINE_STR_METHOD(strip, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(swapcase, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(title, 0) -BOOST_PYTHON_DEFINE_STR_METHOD(translate, 1) -BOOST_PYTHON_DEFINE_STR_METHOD(translate, 2) -BOOST_PYTHON_DEFINE_STR_METHOD(upper, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(strip, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(swapcase, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(title, 0) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(translate, 1) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(translate, 2) +PXR_BOOST_PYTHON_DEFINE_STR_METHOD(upper, 0) static struct register_str_pytype_ptr { register_str_pytype_ptr() { const_cast( - converter::registry::lookup(boost::python::type_id()) + converter::registry::lookup(PXR_BOOST_NAMESPACE::python::type_id()) ) #if PY_VERSION_HEX >= 0x03000000 .m_class_object = &PyUnicode_Type; @@ -421,4 +421,4 @@ static struct register_str_pytype_ptr } }register_str_pytype_ptr_; -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/tuple.cpp b/pxr/external/boost/python/src/tuple.cpp index 83d52dd96c..86fb07ca8b 100644 --- a/pxr/external/boost/python/src/tuple.cpp +++ b/pxr/external/boost/python/src/tuple.cpp @@ -9,7 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include "pxr/external/boost/python/tuple.hpp" -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { detail::new_reference tuple_base::call(object const& arg_) { @@ -31,10 +31,10 @@ static struct register_tuple_pytype_ptr register_tuple_pytype_ptr() { const_cast( - converter::registry::lookup(boost::python::type_id()) + converter::registry::lookup(PXR_BOOST_NAMESPACE::python::type_id()) ).m_class_object = &PyTuple_Type; } }register_tuple_pytype_ptr_; -}}} // namespace boost::python +}}} // namespace PXR_BOOST_NAMESPACE::python diff --git a/pxr/external/boost/python/src/wrapper.cpp b/pxr/external/boost/python/src/wrapper.cpp index 3a494e8599..642777f8e0 100644 --- a/pxr/external/boost/python/src/wrapper.cpp +++ b/pxr/external/boost/python/src/wrapper.cpp @@ -9,7 +9,7 @@ #include "pxr/external/boost/python/wrapper.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -50,7 +50,7 @@ namespace detail #if 0 namespace converter { - PyObject* BOOST_PYTHON_DECL do_polymorphic_ref_to_python( + PyObject* PXR_BOOST_PYTHON_DECL do_polymorphic_ref_to_python( python::detail::wrapper_base const volatile* x, type_info src ) { @@ -68,4 +68,4 @@ namespace converter } #endif -}} // namespace boost::python::detail +}} // namespace PXR_BOOST_NAMESPACE::python::detail diff --git a/pxr/external/boost/python/ssize_t.hpp b/pxr/external/boost/python/ssize_t.hpp index 3190801062..85ec386881 100644 --- a/pxr/external/boost/python/ssize_t.hpp +++ b/pxr/external/boost/python/ssize_t.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SSIZE_T_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -19,7 +20,7 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { #if PY_VERSION_HEX >= 0x02050000 @@ -35,7 +36,7 @@ ssize_t const ssize_t_min = INT_MIN; #endif -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SSIZE_T_HPP diff --git a/pxr/external/boost/python/stl_iterator.hpp b/pxr/external/boost/python/stl_iterator.hpp index 489614582b..827308ca81 100644 --- a/pxr/external/boost/python/stl_iterator.hpp +++ b/pxr/external/boost/python/stl_iterator.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_STL_ITERATOR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { // An STL input iterator over a python sequence @@ -41,7 +42,7 @@ struct stl_input_iterator } // ob is the python sequence - stl_input_iterator(boost::python::object const &ob) + stl_input_iterator(PXR_BOOST_NAMESPACE::python::object const &ob) : impl_(ob) { } @@ -67,7 +68,7 @@ struct stl_input_iterator objects::stl_input_iterator_impl impl_; }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_STL_ITERATOR_HPP diff --git a/pxr/external/boost/python/str.hpp b/pxr/external/boost/python/str.hpp index 0a2c3ee4e9..c7d15830fe 100644 --- a/pxr/external/boost/python/str.hpp +++ b/pxr/external/boost/python/str.hpp @@ -11,6 +11,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_STR_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -30,13 +31,13 @@ #undef isalnum #undef isupper -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { class str; namespace detail { - struct BOOST_PYTHON_DECL str_base : object + struct PXR_BOOST_PYTHON_DECL str_base : object { str capitalize() const; @@ -145,7 +146,7 @@ namespace detail explicit str_base(object_cref other); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str_base, object) private: static new_reference call(object const&); }; @@ -409,7 +410,7 @@ class str : public detail::str_base } public: // implementation detail -- for internal use only - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str, base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str, base) }; // @@ -428,7 +429,7 @@ namespace converter }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_STR_HPP diff --git a/pxr/external/boost/python/suite/indexing/container_utils.hpp b/pxr/external/boost/python/suite/indexing/container_utils.hpp index e7bf233ac8..7936a8b243 100644 --- a/pxr/external/boost/python/suite/indexing/container_utils.hpp +++ b/pxr/external/boost/python/suite/indexing/container_utils.hpp @@ -13,6 +13,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_CONTAINER_UTILS_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -25,7 +26,7 @@ # include "pxr/external/boost/python/extract.hpp" # include "pxr/external/boost/python/stl_iterator.hpp" -namespace boost { namespace python { namespace container_utils { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace container_utils { template void @@ -36,8 +37,8 @@ namespace boost { namespace python { namespace container_utils { // l must be iterable BOOST_FOREACH(object elem, std::make_pair( - boost::python::stl_input_iterator(l), - boost::python::stl_input_iterator() + PXR_BOOST_NAMESPACE::python::stl_input_iterator(l), + PXR_BOOST_NAMESPACE::python::stl_input_iterator() )) { extract x(elem); @@ -63,7 +64,7 @@ namespace boost { namespace python { namespace container_utils { } } -}}} // namespace boost::python::container_utils +}}} // namespace PXR_BOOST_NAMESPACE::python::container_utils #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp index 648c3bd12b..1ccc206b67 100644 --- a/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp +++ b/pxr/external/boost/python/suite/indexing/detail/indexing_suite_detail.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_DETAIL_INDEXING_SUITE_DETAIL_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,12 +28,12 @@ # include #include -namespace boost { namespace python { namespace detail { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { #if defined(NDEBUG) -#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT +#define PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT #else -#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT check_invariant() +#define PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT check_invariant() #endif template @@ -93,32 +94,32 @@ namespace boost { namespace python { namespace detail { break; } } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } void add(PyObject* prox) { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Add a proxy proxies.insert( first_proxy(extract(prox)().get_index()), prox); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } void erase(index_type i, mpl::false_) { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Erase the proxy with index i replace(i, i+1, 0); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } void erase(index_type i, mpl::true_) { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Erase the proxy with index i iterator iter = first_proxy(i); @@ -130,7 +131,7 @@ namespace boost { namespace python { namespace detail { p().detach(); proxies.erase(iter); } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } void @@ -138,10 +139,10 @@ namespace boost { namespace python { namespace detail { { // note: this cannot be called when container is not sliceable - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Erase all proxies with indexes from..to replace(from, to, 0); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } void @@ -152,7 +153,7 @@ namespace boost { namespace python { namespace detail { { // note: this cannot be called when container is not sliceable - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Erase all proxies with indexes from..to. // Adjust the displaced indexes such that the // final effect is that we have inserted *len* @@ -190,13 +191,13 @@ namespace boost { namespace python { namespace detail { ++right; } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; } PyObject* find(index_type i) { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // Find the proxy with *exact* index i. // Return 0 (null) if no proxy with the // given index is found. @@ -204,17 +205,17 @@ namespace boost { namespace python { namespace detail { if (iter != proxies.end() && extract(*iter)().get_index() == i) { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; return *iter; } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; return 0; } typename std::vector::size_type size() const { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; + PXR_BOOST_PYTHON_INDEXING_CHECK_INVARIANT; // How many proxies are there so far? return proxies.size(); } @@ -760,12 +761,12 @@ namespace boost { namespace python { namespace detail { #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP // Don't hide these other get_pointer overloads - using boost::python::get_pointer; + using PXR_BOOST_NAMESPACE::python::get_pointer; using boost::get_pointer; }} // namespace python::detail #endif -} // namespace boost +} // namespace PXR_BOOST_NAMESPACE #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_DETAIL_INDEXING_SUITE_DETAIL_HPP diff --git a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp index 522a4f706d..743017a5c9 100644 --- a/pxr/external/boost/python/suite/indexing/indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/indexing_suite.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_INDEXING_SUITE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,7 +28,7 @@ # include # include "pxr/external/boost/python/detail/type_traits.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // indexing_suite class. This class is the facade class for // the management of C++ containers intended to be integrated @@ -301,7 +302,7 @@ namespace boost { namespace python { } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp index f1d82ad804..355276a5e7 100644 --- a/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/map_indexing_suite.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_MAP_INDEXING_SUITE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/call_method.hpp" # include "pxr/external/boost/python/tuple.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // Forward declaration template @@ -187,7 +188,7 @@ namespace boost { namespace python { } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_MAP_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp index 103f7a5998..57a0e405c9 100644 --- a/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp +++ b/pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp @@ -12,6 +12,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_VECTOR_INDEXING_SUITE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -21,7 +22,7 @@ # include "pxr/external/boost/python/suite/indexing/container_utils.hpp" # include "pxr/external/boost/python/iterator.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // Forward declaration template @@ -248,7 +249,7 @@ namespace boost { namespace python { } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_SUITE_INDEXING_VECTOR_INDEXING_SUITE_HPP diff --git a/pxr/external/boost/python/tag.hpp b/pxr/external/boost/python/tag.hpp index 8d3781130a..dc968b88e7 100644 --- a/pxr/external/boost/python/tag.hpp +++ b/pxr/external/boost/python/tag.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_TAG_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -18,13 +19,13 @@ # include "pxr/external/boost/python/detail/prefix.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // used only to prevent argument-dependent lookup from finding the // wrong function in some cases. Cheaper than qualification. enum tag_t { tag }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TAG_HPP diff --git a/pxr/external/boost/python/test/a_map_indexing_suite.cpp b/pxr/external/boost/python/test/a_map_indexing_suite.cpp index f6eb668133..d502fc58ec 100644 --- a/pxr/external/boost/python/test/a_map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/a_map_indexing_suite.cpp @@ -12,7 +12,7 @@ #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/implicit.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct A { @@ -36,7 +36,7 @@ struct AToPython { static PyObject* convert(const A& s) { - return boost::python::incref(boost::python::object((int)s.value).ptr()); + return PXR_BOOST_NAMESPACE::python::incref(PXR_BOOST_NAMESPACE::python::object((int)s.value).ptr()); } }; @@ -45,10 +45,10 @@ struct AFromPython { AFromPython() { - boost::python::converter::registry::push_back( + PXR_BOOST_NAMESPACE::python::converter::registry::push_back( &convertible, &construct, - boost::python::type_id< A >()); + PXR_BOOST_NAMESPACE::python::type_id< A >()); } static void* convertible(PyObject* obj_ptr) @@ -63,10 +63,10 @@ struct AFromPython static void construct( PyObject* obj_ptr, - boost::python::converter::rvalue_from_python_stage1_data* data) + PXR_BOOST_NAMESPACE::python::converter::rvalue_from_python_stage1_data* data) { void* storage = ( - (boost::python::converter::rvalue_from_python_storage< A >*) + (PXR_BOOST_NAMESPACE::python::converter::rvalue_from_python_storage< A >*) data)-> storage.bytes; #if PY_VERSION_HEX >= 0x03000000 diff --git a/pxr/external/boost/python/test/aligned_class.cpp b/pxr/external/boost/python/test/aligned_class.cpp index 3c6be85992..1117cfdf98 100644 --- a/pxr/external/boost/python/test/aligned_class.cpp +++ b/pxr/external/boost/python/test/aligned_class.cpp @@ -13,7 +13,7 @@ #include #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct BOOST_ALIGNMENT(32) X { @@ -28,7 +28,7 @@ struct BOOST_ALIGNMENT(32) X int x_function(X& x) { return x.x;} float f_function(X& x) { return x.f;} -BOOST_PYTHON_MODULE(aligned_class_ext) +PXR_BOOST_PYTHON_MODULE(aligned_class_ext) { class_("X", init()); def("x_function", x_function); diff --git a/pxr/external/boost/python/test/andreas_beyer.cpp b/pxr/external/boost/python/test/andreas_beyer.cpp index 3578ecc08b..1e6777a5f6 100644 --- a/pxr/external/boost/python/test/andreas_beyer.cpp +++ b/pxr/external/boost/python/test/andreas_beyer.cpp @@ -10,6 +10,7 @@ #include #include +using namespace PXR_BOOST_NAMESPACE; using namespace boost; class A : public enable_shared_from_this { @@ -51,7 +52,7 @@ A::A_ptr get_b_a(shared_ptr b) return b->get(); } -BOOST_PYTHON_MODULE(andreas_beyer_ext) { +PXR_BOOST_PYTHON_MODULE(andreas_beyer_ext) { python::class_ ("A") .def("self", &A::self) .def_readwrite("val", &A::val) diff --git a/pxr/external/boost/python/test/args.cpp b/pxr/external/boost/python/test/args.cpp index d760d00504..f6e85c76aa 100644 --- a/pxr/external/boost/python/test/args.cpp +++ b/pxr/external/boost/python/test/args.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/module.hpp" #include "test_class.hpp" @@ -24,10 +24,10 @@ #include "pxr/external/boost/python/raw_function.hpp" #include "pxr/external/boost/python/return_internal_reference.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) -# define make_tuple boost::python::make_tuple +# define make_tuple PXR_BOOST_NAMESPACE::python::make_tuple #endif tuple f(int x = 1, double y = 4.25, char const* z = "wow") @@ -35,7 +35,7 @@ tuple f(int x = 1, double y = 4.25, char const* z = "wow") return make_tuple(x, y, z); } -BOOST_PYTHON_FUNCTION_OVERLOADS(f_overloads, f, 0, 3) +PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(f_overloads, f, 0, 3) typedef test_class<> Y; @@ -53,7 +53,7 @@ struct X Y inner1; }; -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_f_overloads, X::f, 0, 3) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_f_overloads, X::f, 0, 3) tuple raw_func(tuple args, dict kw) @@ -61,10 +61,10 @@ tuple raw_func(tuple args, dict kw) return make_tuple(args, kw); } -BOOST_PYTHON_MODULE(args_ext) +PXR_BOOST_PYTHON_MODULE(args_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/as_to_python_function.cpp b/pxr/external/boost/python/test/as_to_python_function.cpp index 80f7f536fd..745efda253 100644 --- a/pxr/external/boost/python/test/as_to_python_function.cpp +++ b/pxr/external/boost/python/test/as_to_python_function.cpp @@ -15,4 +15,4 @@ struct hopefully_illegal static PyObject* convert(int&); }; -PyObject* x = boost::python::converter::as_to_python_function::convert(0); +PyObject* x = PXR_BOOST_NAMESPACE::python::converter::as_to_python_function::convert(0); diff --git a/pxr/external/boost/python/test/back_reference.cpp b/pxr/external/boost/python/test/back_reference.cpp index 422ca34ba9..e586b1d40f 100644 --- a/pxr/external/boost/python/test/back_reference.cpp +++ b/pxr/external/boost/python/test/back_reference.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/class.hpp" #include "pxr/external/boost/python/docstring_options.hpp" @@ -31,7 +31,7 @@ // This test shows that a class can be wrapped "as itself" but also // acquire a back-reference iff has_back_reference<> is appropriately // specialized. -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X { @@ -73,7 +73,7 @@ struct Z : X Y const& copy_Y(Y const& y) { return y; } Z const& copy_Z(Z const& z) { return z; } -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { template <> struct has_back_reference @@ -100,10 +100,10 @@ bool y_equality(back_reference y1, Y const& y2) return &y1.get() == &y2; } -BOOST_PYTHON_MODULE(back_reference_ext) +PXR_BOOST_PYTHON_MODULE(back_reference_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/bases.cpp b/pxr/external/boost/python/test/bases.cpp index 7279201a55..03be5af580 100644 --- a/pxr/external/boost/python/test/bases.cpp +++ b/pxr/external/boost/python/test/bases.cpp @@ -16,11 +16,11 @@ struct B; template struct choose_bases - : boost::python::detail::select_bases< + : PXR_BOOST_NAMESPACE::python::detail::select_bases< X - , typename boost::python::detail::select_bases< + , typename PXR_BOOST_NAMESPACE::python::detail::select_bases< Y - , typename boost::python::detail::select_bases::type + , typename PXR_BOOST_NAMESPACE::python::detail::select_bases::type >::type> { @@ -28,40 +28,40 @@ struct choose_bases int main() { - BOOST_STATIC_ASSERT((boost::python::detail::specifies_bases< - boost::python::bases >::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::specifies_bases< + PXR_BOOST_NAMESPACE::python::bases >::value)); - BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< - boost::python::bases& >::value)); + BOOST_STATIC_ASSERT((!PXR_BOOST_NAMESPACE::python::detail::specifies_bases< + PXR_BOOST_NAMESPACE::python::bases& >::value)); - BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + BOOST_STATIC_ASSERT((!PXR_BOOST_NAMESPACE::python::detail::specifies_bases< void* >::value)); - BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + BOOST_STATIC_ASSERT((!PXR_BOOST_NAMESPACE::python::detail::specifies_bases< int >::value)); - BOOST_STATIC_ASSERT((!boost::python::detail::specifies_bases< + BOOST_STATIC_ASSERT((!PXR_BOOST_NAMESPACE::python::detail::specifies_bases< int[5] >::value)); - typedef boost::python::detail::select_bases< + typedef PXR_BOOST_NAMESPACE::python::detail::select_bases< int - , boost::python::detail::select_bases::type > collected1; + , PXR_BOOST_NAMESPACE::python::detail::select_bases::type > collected1; - BOOST_STATIC_ASSERT((boost::python::detail::is_same >::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,boost::python::bases<> >::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same >::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,PXR_BOOST_NAMESPACE::python::bases<> >::value)); - typedef boost::python::detail::select_bases< + typedef PXR_BOOST_NAMESPACE::python::detail::select_bases< int - , boost::python::detail::select_bases< - boost::python::bases - , boost::python::detail::select_bases< + , PXR_BOOST_NAMESPACE::python::detail::select_bases< + PXR_BOOST_NAMESPACE::python::bases + , PXR_BOOST_NAMESPACE::python::detail::select_bases< A >::type >::type > collected2; - BOOST_STATIC_ASSERT((boost::python::detail::is_same >::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same,long>::type,boost::python::bases >::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same >::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same,long>::type,PXR_BOOST_NAMESPACE::python::bases >::value)); return 0; } diff --git a/pxr/external/boost/python/test/ben_scott1.cpp b/pxr/external/boost/python/test/ben_scott1.cpp index 58be05ce98..40c0e20be2 100644 --- a/pxr/external/boost/python/test/ben_scott1.cpp +++ b/pxr/external/boost/python/test/ben_scott1.cpp @@ -8,7 +8,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "pxr/external/boost/python.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; using namespace boost; struct Product {}; @@ -42,7 +42,7 @@ struct CreatorWrap : public Creator PyObject* mSelf; }; -BOOST_PYTHON_MODULE(ben_scott1_ext) +PXR_BOOST_PYTHON_MODULE(ben_scott1_ext) { class_("Product"); diff --git a/pxr/external/boost/python/test/bienstman1.cpp b/pxr/external/boost/python/test/bienstman1.cpp index 28de1cdcd9..0d0b162df2 100644 --- a/pxr/external/boost/python/test/bienstman1.cpp +++ b/pxr/external/boost/python/test/bienstman1.cpp @@ -26,12 +26,12 @@ struct V const A* outside(const V& v) {return &v.a;} -BOOST_PYTHON_MODULE(bienstman1_ext) +PXR_BOOST_PYTHON_MODULE(bienstman1_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; using boost::shared_ptr; - using boost::python::return_value_policy; - using boost::python::reference_existing_object; + using PXR_BOOST_NAMESPACE::python::return_value_policy; + using PXR_BOOST_NAMESPACE::python::reference_existing_object; class_("A"); diff --git a/pxr/external/boost/python/test/bienstman2.cpp b/pxr/external/boost/python/test/bienstman2.cpp index 4cc747ddac..8da2069fb2 100644 --- a/pxr/external/boost/python/test/bienstman2.cpp +++ b/pxr/external/boost/python/test/bienstman2.cpp @@ -20,9 +20,9 @@ struct E const D fe2(const C&, const C&) {return D();} }; -BOOST_PYTHON_MODULE(bienstman2_ext) +PXR_BOOST_PYTHON_MODULE(bienstman2_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; class_("C"); class_("D"); diff --git a/pxr/external/boost/python/test/bienstman3.cpp b/pxr/external/boost/python/test/bienstman3.cpp index 660ebb52eb..86811b3a93 100644 --- a/pxr/external/boost/python/test/bienstman3.cpp +++ b/pxr/external/boost/python/test/bienstman3.cpp @@ -21,9 +21,9 @@ struct B B(const V&) {} }; -BOOST_PYTHON_MODULE(bienstman3_ext) +PXR_BOOST_PYTHON_MODULE(bienstman3_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; class_("V", no_init); class_("B", init()); diff --git a/pxr/external/boost/python/test/bienstman4.cpp b/pxr/external/boost/python/test/bienstman4.cpp index eabb70ef50..1c75ddcb3b 100644 --- a/pxr/external/boost/python/test/bienstman4.cpp +++ b/pxr/external/boost/python/test/bienstman4.cpp @@ -20,9 +20,9 @@ struct Term {Term(Type1 const&) {} }; struct Expression {void add(Term const&) {} }; -BOOST_PYTHON_MODULE(bienstman4_ext) +PXR_BOOST_PYTHON_MODULE(bienstman4_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; using boost::mpl::list; implicitly_convertible(); diff --git a/pxr/external/boost/python/test/bienstman5.cpp b/pxr/external/boost/python/test/bienstman5.cpp index eeb449882e..f8d4cc3bba 100644 --- a/pxr/external/boost/python/test/bienstman5.cpp +++ b/pxr/external/boost/python/test/bienstman5.cpp @@ -17,9 +17,9 @@ struct M {M(const std::complex&) {} }; -BOOST_PYTHON_MODULE(bienstman5_ext) +PXR_BOOST_PYTHON_MODULE(bienstman5_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; class_("M", init const&>()) ; diff --git a/pxr/external/boost/python/test/borrowed.cpp b/pxr/external/boost/python/test/borrowed.cpp index 941d068e3c..1176618ed5 100644 --- a/pxr/external/boost/python/test/borrowed.cpp +++ b/pxr/external/boost/python/test/borrowed.cpp @@ -11,18 +11,18 @@ #include "pxr/external/boost/python/borrowed.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; template void assert_borrowed_ptr(T const&) { - BOOST_STATIC_ASSERT(boost::python::detail::is_borrowed_ptr::value); + BOOST_STATIC_ASSERT(PXR_BOOST_NAMESPACE::python::detail::is_borrowed_ptr::value); } template void assert_not_borrowed_ptr(T const&) { - BOOST_STATIC_ASSERT(!boost::python::detail::is_borrowed_ptr::value); + BOOST_STATIC_ASSERT(!PXR_BOOST_NAMESPACE::python::detail::is_borrowed_ptr::value); } int main() diff --git a/pxr/external/boost/python/test/builtin_converters.cpp b/pxr/external/boost/python/test/builtin_converters.cpp index 038c5297f1..481d90c520 100644 --- a/pxr/external/boost/python/test/builtin_converters.cpp +++ b/pxr/external/boost/python/test/builtin_converters.cpp @@ -46,10 +46,10 @@ struct by_reference } }; -using boost::python::def; -using boost::python::handle; -using boost::python::object; -using boost::python::borrowed; +using PXR_BOOST_NAMESPACE::python::def; +using PXR_BOOST_NAMESPACE::python::handle; +using PXR_BOOST_NAMESPACE::python::object; +using PXR_BOOST_NAMESPACE::python::borrowed; // Used to test that arbitrary handle<>s can be returned handle get_type(handle<> x) @@ -66,7 +66,7 @@ char const* rewrap_value_mutable_cstring(char* x) { return x; } object identity_(object x) { return x; } -BOOST_PYTHON_MODULE(builtin_converters_ext) +PXR_BOOST_PYTHON_MODULE(builtin_converters_ext) { def("get_type", get_type); def("return_null_handle", return_null_handle); @@ -78,7 +78,7 @@ BOOST_PYTHON_MODULE(builtin_converters_ext) def("short_size", by_value::size); def("long_size", by_value::size); #ifdef HAVE_LONG_LONG - def("long_long_size", by_value::size); + def("long_long_size", by_value::size); #endif def("rewrap_value_bool", by_value::rewrap); @@ -94,8 +94,8 @@ BOOST_PYTHON_MODULE(builtin_converters_ext) // using Python's macro instead of Boost's - we don't seem to get the // config right all the time. #ifdef HAVE_LONG_LONG - def("rewrap_value_long_long", by_value::rewrap); - def("rewrap_value_unsigned_long_long", by_value::rewrap); + def("rewrap_value_long_long", by_value::rewrap); + def("rewrap_value_unsigned_long_long", by_value::rewrap); # endif def("rewrap_value_float", by_value::rewrap); def("rewrap_value_double", by_value::rewrap); @@ -139,8 +139,8 @@ BOOST_PYTHON_MODULE(builtin_converters_ext) // using Python's macro instead of Boost's - we don't seem to get the // config right all the time. # ifdef HAVE_LONG_LONG - def("rewrap_const_reference_long_long", by_const_reference::rewrap); - def("rewrap_const_reference_unsigned_long_long", by_const_reference::rewrap); + def("rewrap_const_reference_long_long", by_const_reference::rewrap); + def("rewrap_const_reference_unsigned_long_long", by_const_reference::rewrap); # endif def("rewrap_const_reference_float", by_const_reference::rewrap); def("rewrap_const_reference_double", by_const_reference::rewrap); diff --git a/pxr/external/boost/python/test/callbacks.cpp b/pxr/external/boost/python/test/callbacks.cpp index 0b2e5d1ea5..eca3147636 100644 --- a/pxr/external/boost/python/test/callbacks.cpp +++ b/pxr/external/boost/python/test/callbacks.cpp @@ -20,7 +20,7 @@ #define BOOST_ENABLE_ASSERT_HANDLER #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; BOOST_STATIC_ASSERT(converter::is_object_manager >::value); int apply_int_int(PyObject* f, int x) @@ -119,7 +119,7 @@ object apply_object_object(PyObject* f, object x) int X::counter; -BOOST_PYTHON_MODULE(callbacks_ext) +PXR_BOOST_PYTHON_MODULE(callbacks_ext) { def("apply_object_object", apply_object_object); def("apply_to_own_type", apply_to_own_type); diff --git a/pxr/external/boost/python/test/calling_conventions.cpp b/pxr/external/boost/python/test/calling_conventions.cpp index 3fcc48307f..0285615eb8 100644 --- a/pxr/external/boost/python/test/calling_conventions.cpp +++ b/pxr/external/boost/python/test/calling_conventions.cpp @@ -21,14 +21,14 @@ // this section is the main body of the test extension module #if defined(_WIN32) && !defined(_WIN64) -# define BOOST_PYTHON_ENABLE_CDECL -# define BOOST_PYTHON_ENABLE_STDCALL -# define BOOST_PYTHON_ENABLE_FASTCALL +# define PXR_BOOST_PYTHON_ENABLE_CDECL +# define PXR_BOOST_PYTHON_ENABLE_STDCALL +# define PXR_BOOST_PYTHON_ENABLE_FASTCALL #endif #include #include #include "pxr/external/boost/python.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; // first define test functions for every calling convention @@ -50,7 +50,7 @@ using namespace boost::python; // then create a module wrapping the defined functions for every calling convention -BOOST_PYTHON_MODULE( calling_conventions_ext ) +PXR_BOOST_PYTHON_MODULE( calling_conventions_ext ) { #define TEST_WRAP_FUNCTIONS diff --git a/pxr/external/boost/python/test/calling_conventions_mf.cpp b/pxr/external/boost/python/test/calling_conventions_mf.cpp index d7dc8a20d7..084a8a0d9a 100644 --- a/pxr/external/boost/python/test/calling_conventions_mf.cpp +++ b/pxr/external/boost/python/test/calling_conventions_mf.cpp @@ -22,14 +22,14 @@ // this section is the main body of the test extension module #if defined(_WIN32) && !defined(_WIN64) -# define BOOST_PYTHON_ENABLE_CDECL -# define BOOST_PYTHON_ENABLE_STDCALL -# define BOOST_PYTHON_ENABLE_FASTCALL +# define PXR_BOOST_PYTHON_ENABLE_CDECL +# define PXR_BOOST_PYTHON_ENABLE_STDCALL +# define PXR_BOOST_PYTHON_ENABLE_FASTCALL #endif #include #include #include "pxr/external/boost/python.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; // first define test functions for every calling convention @@ -51,7 +51,7 @@ using namespace boost::python; // then create a module wrapping the defined functions for every calling convention -BOOST_PYTHON_MODULE( calling_conventions_mf_ext ) +PXR_BOOST_PYTHON_MODULE( calling_conventions_mf_ext ) { #define TEST_WRAP_FUNCTIONS diff --git a/pxr/external/boost/python/test/class.cpp b/pxr/external/boost/python/test/class.cpp index d112be2e12..82e617e52e 100644 --- a/pxr/external/boost/python/test/class.cpp +++ b/pxr/external/boost/python/test/class.cpp @@ -11,7 +11,7 @@ #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X { @@ -24,7 +24,7 @@ int x_function(X& x) } -BOOST_PYTHON_MODULE(class_ext) +PXR_BOOST_PYTHON_MODULE(class_ext) { class_("X", init()); def("x_function", x_function); diff --git a/pxr/external/boost/python/test/cltree.cpp b/pxr/external/boost/python/test/cltree.cpp index 176eecebd2..f3d4a40072 100644 --- a/pxr/external/boost/python/test/cltree.cpp +++ b/pxr/external/boost/python/test/cltree.cpp @@ -58,20 +58,20 @@ class variable_wrapper: public variable { }; -BOOST_PYTHON_MODULE(cltree) +PXR_BOOST_PYTHON_MODULE(cltree) { - boost::python::class_("basic") + PXR_BOOST_NAMESPACE::python::class_("basic") .def("__repr__",&basic::repr) ; - boost::python::class_, boost::noncopyable>("constant") + PXR_BOOST_NAMESPACE::python::class_, boost::noncopyable>("constant") ; - boost::python::class_("symbol") + PXR_BOOST_NAMESPACE::python::class_("symbol") ; - boost::python::class_, variable_wrapper>("variable") + PXR_BOOST_NAMESPACE::python::class_, variable_wrapper>("variable") ; } diff --git a/pxr/external/boost/python/test/const_argument.cpp b/pxr/external/boost/python/test/const_argument.cpp index 6f425e7396..57c5cf9870 100644 --- a/pxr/external/boost/python/test/const_argument.cpp +++ b/pxr/external/boost/python/test/const_argument.cpp @@ -14,7 +14,7 @@ * compiler's bug. */ #include "pxr/external/boost/python.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; #if BOOST_WORKAROUND(BOOST_MSVC, == 1200) @@ -27,7 +27,7 @@ bool accept_const_arg( const object ) } -BOOST_PYTHON_MODULE( const_argument_ext ) +PXR_BOOST_PYTHON_MODULE( const_argument_ext ) { def( "accept_const_arg", accept_const_arg ); } diff --git a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp index 7eb0d3cf78..75baefd5f9 100644 --- a/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp +++ b/pxr/external/boost/python/test/copy_ctor_mutates_rhs.cpp @@ -14,7 +14,7 @@ int main() { - using namespace boost::python::detail; + using namespace PXR_BOOST_NAMESPACE::python::detail; BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); BOOST_STATIC_ASSERT(!copy_ctor_mutates_rhs::value); return 0; diff --git a/pxr/external/boost/python/test/crossmod_exception_a.cpp b/pxr/external/boost/python/test/crossmod_exception_a.cpp index a15f9bbcf0..00e4203ab8 100644 --- a/pxr/external/boost/python/test/crossmod_exception_a.cpp +++ b/pxr/external/boost/python/test/crossmod_exception_a.cpp @@ -10,14 +10,14 @@ #include "pxr/external/boost/python.hpp" -namespace python = boost::python; +namespace python = PXR_BOOST_NAMESPACE::python; void tossit(){ PyErr_SetString(PyExc_IndexError,"a-blah!"); throw python::error_already_set(); } -BOOST_PYTHON_MODULE(crossmod_exception_a) +PXR_BOOST_PYTHON_MODULE(crossmod_exception_a) { python::def("tossit",tossit); } diff --git a/pxr/external/boost/python/test/crossmod_exception_b.cpp b/pxr/external/boost/python/test/crossmod_exception_b.cpp index ea74026ee2..a756bd9a4c 100644 --- a/pxr/external/boost/python/test/crossmod_exception_b.cpp +++ b/pxr/external/boost/python/test/crossmod_exception_b.cpp @@ -10,14 +10,14 @@ #include "pxr/external/boost/python.hpp" -namespace python = boost::python; +namespace python = PXR_BOOST_NAMESPACE::python; void tossit(){ PyErr_SetString(PyExc_IndexError,"b-blah!"); throw python::error_already_set(); } -BOOST_PYTHON_MODULE(crossmod_exception_b) +PXR_BOOST_PYTHON_MODULE(crossmod_exception_b) { python::def("tossit",tossit); } diff --git a/pxr/external/boost/python/test/crossmod_opaque_a.cpp b/pxr/external/boost/python/test/crossmod_opaque_a.cpp index 7d4bec165b..29d14d074c 100644 --- a/pxr/external/boost/python/test/crossmod_opaque_a.cpp +++ b/pxr/external/boost/python/test/crossmod_opaque_a.cpp @@ -18,11 +18,11 @@ opaque the_op = ((opaque) 0x47110815); opaque get() { return the_op; } -BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) +PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) -namespace bpl = boost::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; -BOOST_PYTHON_MODULE(crossmod_opaque_a) +PXR_BOOST_PYTHON_MODULE(crossmod_opaque_a) { bpl::def ( "get", diff --git a/pxr/external/boost/python/test/crossmod_opaque_b.cpp b/pxr/external/boost/python/test/crossmod_opaque_b.cpp index 81ebc37d6a..9affa0ea1c 100644 --- a/pxr/external/boost/python/test/crossmod_opaque_b.cpp +++ b/pxr/external/boost/python/test/crossmod_opaque_b.cpp @@ -18,11 +18,11 @@ opaque the_op = ((opaque) 0x47110815); opaque get() { return the_op; } -BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) +PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) -namespace bpl = boost::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; -BOOST_PYTHON_MODULE(crossmod_opaque_b) +PXR_BOOST_PYTHON_MODULE(crossmod_opaque_b) { bpl::def ( "get", diff --git a/pxr/external/boost/python/test/data_members.cpp b/pxr/external/boost/python/test/data_members.cpp index 6d64a182e7..25e92ab01d 100644 --- a/pxr/external/boost/python/test/data_members.cpp +++ b/pxr/external/boost/python/test/data_members.cpp @@ -18,7 +18,7 @@ #endif -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; @@ -57,7 +57,7 @@ int Var::static1 = 0; Y Var::static2(0); // Compilability regression tests -namespace boost_python_test +namespace PXR_BOOST_NAMESPACE_python_test { struct trivial { @@ -89,9 +89,9 @@ namespace boost_python_test } } -BOOST_PYTHON_MODULE(data_members_ext) +PXR_BOOST_PYTHON_MODULE(data_members_ext) { - using namespace boost_python_test; + using namespace PXR_BOOST_NAMESPACE_python_test; class_("X", init()) .def("value", &X::value) .def("set", &X::set) diff --git a/pxr/external/boost/python/test/defaults.cpp b/pxr/external/boost/python/test/defaults.cpp index e0e346c12e..1d2b70a7aa 100644 --- a/pxr/external/boost/python/test/defaults.cpp +++ b/pxr/external/boost/python/test/defaults.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/module.hpp" @@ -26,8 +26,8 @@ # include // works around a KCC intermediate code generation bug #endif -using namespace boost::python; -namespace bpl = boost::python; +using namespace PXR_BOOST_NAMESPACE::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; char const* const format = "int(%s); char(%s); string(%s); double(%s); "; @@ -60,7 +60,7 @@ bar(int a) return format % bpl::make_tuple(a, 'D', "default", 0.0); } -BOOST_PYTHON_FUNCTION_OVERLOADS(bar_stubs, bar, 1, 4) +PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(bar_stubs, bar, 1, 4) /////////////////////////////////////////////////////////////////////////////// // @@ -73,7 +73,7 @@ foo(int a, char b = 'D', std::string c = "default", double d = 0.0) return format % bpl::make_tuple(a, b, c, d); } -BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) +PXR_BOOST_PYTHON_FUNCTION_OVERLOADS(foo_stubs, foo, 1, 4) /////////////////////////////////////////////////////////////////////////////// // @@ -151,17 +151,17 @@ struct X { object state; }; -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs, bar, 1, 4) -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs2, bar2, 0, 4) -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_2_stubs, foo, 1, 2) -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_3_stubs, foo, 2, 3) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs, bar, 1, 4) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_bar_stubs2, bar2, 0, 4) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_2_stubs, foo, 1, 2) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_foo_3_stubs, foo, 2, 3) /////////////////////////////////////////////////////////////////////////////// -BOOST_PYTHON_MODULE(defaults_ext) +PXR_BOOST_PYTHON_MODULE(defaults_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/destroy_test.cpp b/pxr/external/boost/python/test/destroy_test.cpp index f740276833..dd13a89eb2 100644 --- a/pxr/external/boost/python/test/destroy_test.cpp +++ b/pxr/external/boost/python/test/destroy_test.cpp @@ -45,18 +45,18 @@ int main() assert_destructions(0); foo* f1 = new foo; - boost::python::detail::destroy_referent(f1); + PXR_BOOST_NAMESPACE::python::detail::destroy_referent(f1); assert_destructions(1); foo* f2 = new foo[2]; typedef foo x[2]; - boost::python::detail::destroy_referent(f2); + PXR_BOOST_NAMESPACE::python::detail::destroy_referent(f2); assert_destructions(3); typedef foo y[2][2]; x* f3 = new y; - boost::python::detail::destroy_referent(f3); + PXR_BOOST_NAMESPACE::python::detail::destroy_referent(f3); assert_destructions(7); return boost::report_errors(); diff --git a/pxr/external/boost/python/test/dict.cpp b/pxr/external/boost/python/test/dict.cpp index 8d5ed5f8fe..5df2de6fa2 100644 --- a/pxr/external/boost/python/test/dict.cpp +++ b/pxr/external/boost/python/test/dict.cpp @@ -16,7 +16,7 @@ #include #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; object new_dict() { @@ -81,7 +81,7 @@ void test_templates(object print) BOOST_ASSERT(!tmp.has_key(key)); } -BOOST_PYTHON_MODULE(dict_ext) +PXR_BOOST_PYTHON_MODULE(dict_ext) { def("new_dict", new_dict); def("data_dict", data_dict); diff --git a/pxr/external/boost/python/test/docstring.cpp b/pxr/external/boost/python/test/docstring.cpp index 55847cc67a..0865455774 100644 --- a/pxr/external/boost/python/test/docstring.cpp +++ b/pxr/external/boost/python/test/docstring.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/operators.hpp" #include "pxr/external/boost/python/class.hpp" @@ -26,7 +26,7 @@ // trouble for non-conforming compilers and libraries. #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; @@ -40,10 +40,10 @@ unsigned long fact(unsigned long n) return n <= 1 ? n : n * fact(n - 1); } -BOOST_PYTHON_MODULE(docstring_ext) +PXR_BOOST_PYTHON_MODULE(docstring_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/enable_shared_from_this.cpp b/pxr/external/boost/python/test/enable_shared_from_this.cpp index ef5db873a3..421661293e 100644 --- a/pxr/external/boost/python/test/enable_shared_from_this.cpp +++ b/pxr/external/boost/python/test/enable_shared_from_this.cpp @@ -19,7 +19,7 @@ #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; using boost::shared_ptr; class Test; @@ -39,7 +39,7 @@ class Test : public boost::enable_shared_from_this { } }; -BOOST_PYTHON_MODULE(enable_shared_from_this_ext) +PXR_BOOST_PYTHON_MODULE(enable_shared_from_this_ext) { class_("Test") .def("construct", &Test::construct).staticmethod("construct") diff --git a/pxr/external/boost/python/test/enum_ext.cpp b/pxr/external/boost/python/test/enum_ext.cpp index 14d1b90199..997adb7db8 100644 --- a/pxr/external/boost/python/test/enum_ext.cpp +++ b/pxr/external/boost/python/test/enum_ext.cpp @@ -15,14 +15,14 @@ #include "pxr/external/boost/python/detail/type_traits.hpp" # include #endif -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; enum color { red = 1, green = 2, blue = 4, blood = 1 }; #if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) -namespace boost // Pro7 has a hard time detecting enums +namespace PXR_BOOST_NAMESPACE // Pro7 has a hard time detecting enums { - template <> struct boost::python::detail::is_enum : boost::mpl::true_ {}; + template <> struct PXR_BOOST_NAMESPACE::python::detail::is_enum : boost::mpl::true_ {}; } #endif @@ -33,7 +33,7 @@ struct colorized { color x; }; -BOOST_PYTHON_MODULE(enum_ext) +PXR_BOOST_PYTHON_MODULE(enum_ext) { enum_("color") .value("red", red) diff --git a/pxr/external/boost/python/test/exception_translator.cpp b/pxr/external/boost/python/test/exception_translator.cpp index 3d03a5dcf9..68e1dc2c03 100644 --- a/pxr/external/boost/python/test/exception_translator.cpp +++ b/pxr/external/boost/python/test/exception_translator.cpp @@ -23,9 +23,9 @@ void throw_error() } -BOOST_PYTHON_MODULE(exception_translator_ext) +PXR_BOOST_PYTHON_MODULE(exception_translator_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; register_exception_translator(&translate); def("throw_error", throw_error); diff --git a/pxr/external/boost/python/test/exec.cpp b/pxr/external/boost/python/test/exec.cpp index 0474335835..c0cfd550c5 100644 --- a/pxr/external/boost/python/test/exec.cpp +++ b/pxr/external/boost/python/test/exec.cpp @@ -14,7 +14,7 @@ #include -namespace python = boost::python; +namespace python = PXR_BOOST_NAMESPACE::python; // An abstract base class class Base : public boost::noncopyable @@ -48,7 +48,7 @@ struct BaseWrap : Base, python::wrapper }; // Pack the Base class wrapper into a module -BOOST_PYTHON_MODULE(embedded_hello) +PXR_BOOST_PYTHON_MODULE(embedded_hello) { python::class_ base("Base"); } @@ -111,7 +111,7 @@ void exec_test_error() void exercise_embedding_html() { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; /* code from: libs/python/doc/tutorial/doc/tutorial.qbk (generates libs/python/doc/tutorial/doc/html/python/embedding.html) */ diff --git a/pxr/external/boost/python/test/extract.cpp b/pxr/external/boost/python/test/extract.cpp index 47b6ec3092..d2db5f2e5a 100644 --- a/pxr/external/boost/python/test/extract.cpp +++ b/pxr/external/boost/python/test/extract.cpp @@ -22,13 +22,13 @@ #include #include "test_class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; bool extract_bool(object x) { return extract(x); } -boost::python::list extract_list(object x) +PXR_BOOST_NAMESPACE::python::list extract_list(object x) { extract get_list((x)); @@ -102,7 +102,7 @@ std::string x_rep(X const& x) return "X(" + boost::lexical_cast(x.value()) + ")"; } -BOOST_PYTHON_MODULE(extract_ext) +PXR_BOOST_PYTHON_MODULE(extract_ext) { implicitly_convertible(); diff --git a/pxr/external/boost/python/test/if_else.cpp b/pxr/external/boost/python/test/if_else.cpp index e1a28faf74..dec49cf87c 100644 --- a/pxr/external/boost/python/test/if_else.cpp +++ b/pxr/external/boost/python/test/if_else.cpp @@ -19,7 +19,7 @@ template struct choose { - typedef typename boost::python::detail::if_< + typedef typename PXR_BOOST_NAMESPACE::python::detail::if_< (sizeof(c1) == size) >::template then< c1 @@ -40,10 +40,10 @@ struct choose int main() { - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c1>::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c2>::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c3>::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,c4>::value)); - BOOST_STATIC_ASSERT((boost::python::detail::is_same::type,void*>::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,c1>::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,c2>::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,c3>::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,c4>::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::type,void*>::value)); return 0; } diff --git a/pxr/external/boost/python/test/implicit.cpp b/pxr/external/boost/python/test/implicit.cpp index f55f80f0b4..aa875879a2 100644 --- a/pxr/external/boost/python/test/implicit.cpp +++ b/pxr/external/boost/python/test/implicit.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/class.hpp" #include "pxr/external/boost/python/docstring_options.hpp" @@ -20,7 +20,7 @@ #include "pxr/external/boost/python/def.hpp" #include "test_class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; @@ -41,10 +41,10 @@ struct foo operator bar() const { return bar(); } }; -BOOST_PYTHON_MODULE(implicit_ext) +PXR_BOOST_PYTHON_MODULE(implicit_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/import_.cpp b/pxr/external/boost/python/test/import_.cpp index 213d745709..115e31990d 100644 --- a/pxr/external/boost/python/test/import_.cpp +++ b/pxr/external/boost/python/test/import_.cpp @@ -15,7 +15,7 @@ #include #include -namespace bpl = boost::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; void import_test(char const *py_file_path) { diff --git a/pxr/external/boost/python/test/indirect_traits_test.cpp b/pxr/external/boost/python/test/indirect_traits_test.cpp index 19705ff38a..768950af08 100644 --- a/pxr/external/boost/python/test/indirect_traits_test.cpp +++ b/pxr/external/boost/python/test/indirect_traits_test.cpp @@ -18,7 +18,7 @@ // not all the compilers can handle an incomplete class type here. struct X {}; -using namespace boost::python::indirect_traits; +using namespace PXR_BOOST_NAMESPACE::python::indirect_traits; typedef void (X::*pmf)(); @@ -81,7 +81,7 @@ BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); BOOST_MPL_ASSERT_NOT((is_reference_to_volatile)); -namespace tt = boost::python::indirect_traits; +namespace tt = PXR_BOOST_NAMESPACE::python::indirect_traits; BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); BOOST_MPL_ASSERT_NOT((tt::is_reference_to_class)); diff --git a/pxr/external/boost/python/test/injected.cpp b/pxr/external/boost/python/test/injected.cpp index cf0f6f9645..3f02a582aa 100644 --- a/pxr/external/boost/python/test/injected.cpp +++ b/pxr/external/boost/python/test/injected.cpp @@ -16,7 +16,7 @@ #include "pxr/external/boost/python/make_constructor.hpp" #include "pxr/external/boost/python/args.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; @@ -29,7 +29,7 @@ boost::shared_ptr product(int a, int b, int c) return boost::shared_ptr(new X(a*b*c)); } -BOOST_PYTHON_MODULE(injected_ext) +PXR_BOOST_PYTHON_MODULE(injected_ext) { class_("X", init()) .def("__init__", make_constructor(empty)) diff --git a/pxr/external/boost/python/test/input_iterator.cpp b/pxr/external/boost/python/test/input_iterator.cpp index 3c7a1d7f7b..5dd8eb9c4f 100644 --- a/pxr/external/boost/python/test/input_iterator.cpp +++ b/pxr/external/boost/python/test/input_iterator.cpp @@ -14,7 +14,7 @@ #include #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef std::list list_int; @@ -39,7 +39,7 @@ list_range2 range2(list_int& x) // to work around an MSVC6 linker bug, which causes it to complain // about a "duplicate comdat" if the input iterator is instantiated in // the same module with the others. -BOOST_PYTHON_MODULE(input_iterator) +PXR_BOOST_PYTHON_MODULE(input_iterator) { def("range2", &::range2); diff --git a/pxr/external/boost/python/test/int_map_indexing_suite.cpp b/pxr/external/boost/python/test/int_map_indexing_suite.cpp index 46eddaffe8..f2e77d10d1 100644 --- a/pxr/external/boost/python/test/int_map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/int_map_indexing_suite.cpp @@ -12,7 +12,7 @@ void int_map_indexing_suite() { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; // Compile check only... class_ >("IntMap") diff --git a/pxr/external/boost/python/test/iterator.cpp b/pxr/external/boost/python/test/iterator.cpp index 94e48b74f0..0858ab8039 100644 --- a/pxr/external/boost/python/test/iterator.cpp +++ b/pxr/external/boost/python/test/iterator.cpp @@ -19,7 +19,7 @@ #include #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef std::list list_int; typedef std::list list_list; @@ -81,9 +81,9 @@ struct two_lists list_int two; }; -BOOST_PYTHON_MODULE(iterator_ext) +PXR_BOOST_PYTHON_MODULE(iterator_ext) { - using boost::python::iterator; // gcc 2.96 bug workaround + using PXR_BOOST_NAMESPACE::python::iterator; // gcc 2.96 bug workaround def("range", &::range); class_("list_int") diff --git a/pxr/external/boost/python/test/keywords.cpp b/pxr/external/boost/python/test/keywords.cpp index b79f867642..68e4ee955f 100644 --- a/pxr/external/boost/python/test/keywords.cpp +++ b/pxr/external/boost/python/test/keywords.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python.hpp" #include @@ -83,19 +83,19 @@ struct Bar std::string n_; }; -BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(bar_set, Bar::set, 0,3) +PXR_BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(bar_set, Bar::set, 0,3) -using namespace boost::python; -BOOST_PYTHON_MODULE(keywords) +using namespace PXR_BOOST_NAMESPACE::python; +PXR_BOOST_PYTHON_MODULE(keywords) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); #if BOOST_WORKAROUND(__GNUC__, == 2) - using boost::python::arg; + using PXR_BOOST_NAMESPACE::python::arg; #endif class_( diff --git a/pxr/external/boost/python/test/list.cpp b/pxr/external/boost/python/test/list.cpp index de9013b849..65b5d0e463 100644 --- a/pxr/external/boost/python/test/list.cpp +++ b/pxr/external/boost/python/test/list.cpp @@ -20,7 +20,7 @@ #include #include "test_class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; object new_list() { @@ -138,7 +138,7 @@ void exercise(list x, object y, object print) BOOST_ASSERT(w[3] == 'i'); } -BOOST_PYTHON_MODULE(list_ext) +PXR_BOOST_PYTHON_MODULE(list_ext) { def("new_list", new_list); def("listify", listify); diff --git a/pxr/external/boost/python/test/long.cpp b/pxr/external/boost/python/test/long.cpp index 181f57b6d1..02930a2ff1 100644 --- a/pxr/external/boost/python/test/long.cpp +++ b/pxr/external/boost/python/test/long.cpp @@ -15,7 +15,7 @@ #define BOOST_ENABLE_ASSERT_HANDLER #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; object new_long() { @@ -50,10 +50,10 @@ int is_long2(char const*) struct Y { - Y(boost::python::long_) {} + Y(PXR_BOOST_NAMESPACE::python::long_) {} }; -BOOST_PYTHON_MODULE(long_ext) +PXR_BOOST_PYTHON_MODULE(long_ext) { def("new_long", new_long); def("longify", longify); @@ -61,7 +61,7 @@ BOOST_PYTHON_MODULE(long_ext) def("is_long", is_long1); def("is_long", is_long2); - class_< Y >("Y", init< boost::python::long_ >()) + class_< Y >("Y", init< PXR_BOOST_NAMESPACE::python::long_ >()) ; } diff --git a/pxr/external/boost/python/test/m1.cpp b/pxr/external/boost/python/test/m1.cpp index 663188c595..b6aade2396 100644 --- a/pxr/external/boost/python/test/m1.cpp +++ b/pxr/external/boost/python/test/m1.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/docstring_options.hpp" @@ -175,12 +175,12 @@ PyObject* new_simple() // Declare some wrappers/unwrappers to test the low-level conversion // mechanism. // -using boost::python::to_python_converter; +using PXR_BOOST_NAMESPACE::python::to_python_converter; // Wrap a simple by copying it into a Simple struct simple_to_python : to_python_converter - //, boost::python::converter::wrap_pytype<&SimpleType> + //, PXR_BOOST_NAMESPACE::python::converter::wrap_pytype<&SimpleType> { static PyObject* convert(simple const& x) { @@ -279,13 +279,13 @@ Unregistered make_unregistered(int) { return Unregistered(); } Unregistered* make_unregistered2(int) { return new Unregistered; } -BOOST_PYTHON_MODULE(m1) +PXR_BOOST_PYTHON_MODULE(m1) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; using boost::shared_ptr; // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/m2.cpp b/pxr/external/boost/python/test/m2.cpp index 99a805d125..c33b2a674b 100644 --- a/pxr/external/boost/python/test/m2.cpp +++ b/pxr/external/boost/python/test/m2.cpp @@ -8,10 +8,10 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES // This module exercises the converters exposed in m1 at a low level // by exposing raw Python extension functions that use wrap<> and @@ -81,16 +81,16 @@ struct rewrap static T f(T x) { return x; } }; -BOOST_PYTHON_MODULE(m2) +PXR_BOOST_PYTHON_MODULE(m2) { - using boost::python::return_value_policy; - using boost::python::copy_const_reference; - using boost::python::copy_non_const_reference; - using boost::python::def; - using boost::python::docstring_options; + using PXR_BOOST_NAMESPACE::python::return_value_policy; + using PXR_BOOST_NAMESPACE::python::copy_const_reference; + using PXR_BOOST_NAMESPACE::python::copy_non_const_reference; + using PXR_BOOST_NAMESPACE::python::def; + using PXR_BOOST_NAMESPACE::python::docstring_options; // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/map_indexing_suite.cpp b/pxr/external/boost/python/test/map_indexing_suite.cpp index 23cb25d3ab..bacbb9d084 100644 --- a/pxr/external/boost/python/test/map_indexing_suite.cpp +++ b/pxr/external/boost/python/test/map_indexing_suite.cpp @@ -12,7 +12,7 @@ #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/implicit.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X // a container element { @@ -32,7 +32,7 @@ std::string x_value(X const& x) } -BOOST_PYTHON_MODULE(map_indexing_suite_ext) +PXR_BOOST_PYTHON_MODULE(map_indexing_suite_ext) { class_("X") .def(init<>()) diff --git a/pxr/external/boost/python/test/minimal.cpp b/pxr/external/boost/python/test/minimal.cpp index 87b22df11c..aae1a33f21 100644 --- a/pxr/external/boost/python/test/minimal.cpp +++ b/pxr/external/boost/python/test/minimal.cpp @@ -14,7 +14,7 @@ # include // works around a KCC intermediate code generation bug #endif -BOOST_PYTHON_MODULE(minimal_ext) +PXR_BOOST_PYTHON_MODULE(minimal_ext) { } diff --git a/pxr/external/boost/python/test/module_init_exception.cpp b/pxr/external/boost/python/test/module_init_exception.cpp index f6888a9708..00b9a49c15 100644 --- a/pxr/external/boost/python/test/module_init_exception.cpp +++ b/pxr/external/boost/python/test/module_init_exception.cpp @@ -11,9 +11,9 @@ #include "pxr/external/boost/python/module.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; -BOOST_PYTHON_MODULE(module_init_exception_ext) +PXR_BOOST_PYTHON_MODULE(module_init_exception_ext) { throw std::runtime_error("Module init failed"); } diff --git a/pxr/external/boost/python/test/module_tail.cpp b/pxr/external/boost/python/test/module_tail.cpp index 06694553f4..d88ea1959b 100644 --- a/pxr/external/boost/python/test/module_tail.cpp +++ b/pxr/external/boost/python/test/module_tail.cpp @@ -39,17 +39,17 @@ extern "C" void (*old_translator)(unsigned, EXCEPTION_POINTERS*) struct test_failure : std::exception { test_failure(char const* expr, char const* /*function*/, char const* file, unsigned line) - : msg(file + boost::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr) + : msg(file + PXR_BOOST_NAMESPACE::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr) {} ~test_failure() throw() {} char const* what() const throw() { - return boost::python::extract(msg)(); + return PXR_BOOST_NAMESPACE::python::extract(msg)(); } - boost::python::str msg; + PXR_BOOST_NAMESPACE::python::str msg; }; namespace boost diff --git a/pxr/external/boost/python/test/multi_arg_constructor.cpp b/pxr/external/boost/python/test/multi_arg_constructor.cpp index d8bbdd48de..22c2e7dbe0 100644 --- a/pxr/external/boost/python/test/multi_arg_constructor.cpp +++ b/pxr/external/boost/python/test/multi_arg_constructor.cpp @@ -18,9 +18,9 @@ struct A ) {} }; -BOOST_PYTHON_MODULE(multi_arg_constructor_ext) +PXR_BOOST_PYTHON_MODULE(multi_arg_constructor_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; class_( "A" diff --git a/pxr/external/boost/python/test/nested.cpp b/pxr/external/boost/python/test/nested.cpp index d851884a6e..8d7b06a3aa 100644 --- a/pxr/external/boost/python/test/nested.cpp +++ b/pxr/external/boost/python/test/nested.cpp @@ -32,9 +32,9 @@ std::ostream& operator<<(std::ostream& s, Y const& x) } -BOOST_PYTHON_MODULE(nested_ext) +PXR_BOOST_PYTHON_MODULE(nested_ext) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; // Establish X as the current scope. scope x_class diff --git a/pxr/external/boost/python/test/numpy/dtype.cpp b/pxr/external/boost/python/test/numpy/dtype.cpp index a85078c21b..221f2d939b 100644 --- a/pxr/external/boost/python/test/numpy/dtype.cpp +++ b/pxr/external/boost/python/test/numpy/dtype.cpp @@ -12,15 +12,15 @@ #include "pxr/external/boost/python/numpy.hpp" #include -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; template np::dtype accept(T) { return np::dtype::get_builtin(); } -BOOST_PYTHON_MODULE(dtype_ext) +PXR_BOOST_PYTHON_MODULE(dtype_ext) { np::initialize(); // wrap dtype equivalence test, since it isn't available in Python API. diff --git a/pxr/external/boost/python/test/numpy/indexing.cpp b/pxr/external/boost/python/test/numpy/indexing.cpp index cfbd2d3ddb..7c0ac34c25 100644 --- a/pxr/external/boost/python/test/numpy/indexing.cpp +++ b/pxr/external/boost/python/test/numpy/indexing.cpp @@ -12,8 +12,8 @@ #include "pxr/external/boost/python/numpy.hpp" #include "pxr/external/boost/python/slice.hpp" -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; p::object single(np::ndarray ndarr, int i) { return ndarr[i];} p::object slice(np::ndarray ndarr, p::slice sl) { return ndarr[sl];} @@ -21,7 +21,7 @@ p::object indexarray(np::ndarray ndarr, np::ndarray d1) { return ndarr[d1];} p::object indexarray_2d(np::ndarray ndarr, np::ndarray d1,np::ndarray d2) { return ndarr[p::make_tuple(d1,d2)];} p::object indexslice(np::ndarray ndarr, np::ndarray d1, p::slice sl) { return ndarr[p::make_tuple(d1, sl)];} -BOOST_PYTHON_MODULE(indexing_ext) +PXR_BOOST_PYTHON_MODULE(indexing_ext) { np::initialize(); p::def("single", single); diff --git a/pxr/external/boost/python/test/numpy/ndarray.cpp b/pxr/external/boost/python/test/numpy/ndarray.cpp index 095d546263..d74d868c73 100644 --- a/pxr/external/boost/python/test/numpy/ndarray.cpp +++ b/pxr/external/boost/python/test/numpy/ndarray.cpp @@ -11,8 +11,8 @@ #include "pxr/external/boost/python/numpy.hpp" -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; np::ndarray zeros(p::tuple shape, np::dtype dt) { return np::zeros(shape, dt);} np::ndarray array2(p::object obj, np::dtype dt) { return np::array(obj,dt);} @@ -39,7 +39,7 @@ np::ndarray reshape(np::ndarray arr,p::tuple tup) { return arr.reshape(tup);} Py_intptr_t shape_index(np::ndarray arr,int k) { return arr.shape(k); } Py_intptr_t strides_index(np::ndarray arr,int k) { return arr.strides(k); } -BOOST_PYTHON_MODULE(ndarray_ext) +PXR_BOOST_PYTHON_MODULE(ndarray_ext) { np::initialize(); p::def("zeros", zeros); diff --git a/pxr/external/boost/python/test/numpy/shapes.cpp b/pxr/external/boost/python/test/numpy/shapes.cpp index 2687f183f0..e189c40fd6 100644 --- a/pxr/external/boost/python/test/numpy/shapes.cpp +++ b/pxr/external/boost/python/test/numpy/shapes.cpp @@ -11,8 +11,8 @@ #include "pxr/external/boost/python/numpy.hpp" -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; np::ndarray reshape(np::ndarray old_array, p::tuple shape) { @@ -20,7 +20,7 @@ np::ndarray reshape(np::ndarray old_array, p::tuple shape) return local_shape; } -BOOST_PYTHON_MODULE(shapes_ext) +PXR_BOOST_PYTHON_MODULE(shapes_ext) { np::initialize(); p::def("reshape", reshape); diff --git a/pxr/external/boost/python/test/numpy/templates.cpp b/pxr/external/boost/python/test/numpy/templates.cpp index 81b62838fe..6dc0ccb234 100644 --- a/pxr/external/boost/python/test/numpy/templates.cpp +++ b/pxr/external/boost/python/test/numpy/templates.cpp @@ -13,8 +13,8 @@ #include #include -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; struct ArrayFiller { @@ -61,7 +61,7 @@ void fill(np::ndarray const & arg) np::invoke_matching_array(arg, filler); } -BOOST_PYTHON_MODULE(templates_ext) +PXR_BOOST_PYTHON_MODULE(templates_ext) { np::initialize(); p::def("fill", fill); diff --git a/pxr/external/boost/python/test/numpy/ufunc.cpp b/pxr/external/boost/python/test/numpy/ufunc.cpp index 7dd022f5a5..fca1d19b73 100644 --- a/pxr/external/boost/python/test/numpy/ufunc.cpp +++ b/pxr/external/boost/python/test/numpy/ufunc.cpp @@ -11,8 +11,8 @@ #include "pxr/external/boost/python/numpy.hpp" -namespace p = boost::python; -namespace np = boost::python::numpy; +namespace p = PXR_BOOST_NAMESPACE::python; +namespace np = PXR_BOOST_NAMESPACE::python::numpy; struct UnaryCallable { @@ -31,7 +31,7 @@ struct BinaryCallable double operator()(double a, double b) const { return a * 2 + b * 3;} }; -BOOST_PYTHON_MODULE(ufunc_ext) +PXR_BOOST_PYTHON_MODULE(ufunc_ext) { np::initialize(); p::class_("UnaryCallable") diff --git a/pxr/external/boost/python/test/object.cpp b/pxr/external/boost/python/test/object.cpp index 8ec79d2814..b6e9906836 100644 --- a/pxr/external/boost/python/test/object.cpp +++ b/pxr/external/boost/python/test/object.cpp @@ -12,7 +12,7 @@ #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; class NotCopyable { @@ -346,7 +346,7 @@ bool check_inplace(object l, object o) return true; } -BOOST_PYTHON_MODULE(object_ext) +PXR_BOOST_PYTHON_MODULE(object_ext) { class_("NotCopyable", no_init); diff --git a/pxr/external/boost/python/test/object_fail1.cpp b/pxr/external/boost/python/test/object_fail1.cpp index 5da4d03bdd..69a46a1039 100644 --- a/pxr/external/boost/python/test/object_fail1.cpp +++ b/pxr/external/boost/python/test/object_fail1.cpp @@ -9,7 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include "pxr/external/boost/python/object.hpp" -int f(boost::python::object const& x) +int f(PXR_BOOST_NAMESPACE::python::object const& x) { x._("hello") = 1; return 0; diff --git a/pxr/external/boost/python/test/object_manager.cpp b/pxr/external/boost/python/test/object_manager.cpp index 4c7b59d73e..b98ce89970 100644 --- a/pxr/external/boost/python/test/object_manager.cpp +++ b/pxr/external/boost/python/test/object_manager.cpp @@ -12,8 +12,8 @@ #include #include "pxr/external/boost/python/handle.hpp" -using namespace boost::python; -using namespace boost::python::converter; +using namespace PXR_BOOST_NAMESPACE::python; +using namespace PXR_BOOST_NAMESPACE::python::converter; struct X {}; diff --git a/pxr/external/boost/python/test/opaque.cpp b/pxr/external/boost/python/test/opaque.cpp index 7b65eb1121..581e1a0180 100644 --- a/pxr/external/boost/python/test/opaque.cpp +++ b/pxr/external/boost/python/test/opaque.cpp @@ -56,12 +56,12 @@ void failuse2 (opaque2 op) throw std::runtime_error (std::string ("success")); } -BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) -BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque2_) +PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque_) +PXR_BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(opaque2_) -namespace bpl = boost::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; -BOOST_PYTHON_MODULE(opaque_ext) +PXR_BOOST_PYTHON_MODULE(opaque_ext) { bpl::def ( "get", &::get, bpl::return_value_policy()); diff --git a/pxr/external/boost/python/test/operators.cpp b/pxr/external/boost/python/test/operators.cpp index 10d777dacd..a416fad2f4 100644 --- a/pxr/external/boost/python/test/operators.cpp +++ b/pxr/external/boost/python/test/operators.cpp @@ -27,10 +27,10 @@ # include #endif -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X : test_class<> { @@ -106,7 +106,7 @@ struct number long x; }; -BOOST_PYTHON_MODULE(operators_ext) +PXR_BOOST_PYTHON_MODULE(operators_ext) { class_("X", init()) .def("value", &X::value) diff --git a/pxr/external/boost/python/test/operators_wrapper.cpp b/pxr/external/boost/python/test/operators_wrapper.cpp index acb54d5db4..70f3d7f419 100644 --- a/pxr/external/boost/python/test/operators_wrapper.cpp +++ b/pxr/external/boost/python/test/operators_wrapper.cpp @@ -23,7 +23,7 @@ struct vector struct dvector : vector {}; -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct vector_wrapper : vector, wrapper< vector > @@ -32,7 +32,7 @@ struct vector_wrapper vector_wrapper() {} }; -BOOST_PYTHON_MODULE( operators_wrapper_ext ) +PXR_BOOST_PYTHON_MODULE( operators_wrapper_ext ) { class_< vector_wrapper >( "vector" ) .def( self + self ) diff --git a/pxr/external/boost/python/test/pickle1.cpp b/pxr/external/boost/python/test/pickle1.cpp index 8acfbe4870..9814ada86c 100644 --- a/pxr/external/boost/python/test/pickle1.cpp +++ b/pxr/external/boost/python/test/pickle1.cpp @@ -24,7 +24,7 @@ #include -namespace boost_python_test { +namespace PXR_BOOST_NAMESPACE_python_test { // A friendly class. class world @@ -39,13 +39,13 @@ namespace boost_python_test { std::string get_country() const { return country; } }; - struct world_pickle_suite : boost::python::pickle_suite + struct world_pickle_suite : PXR_BOOST_NAMESPACE::python::pickle_suite { static - boost::python::tuple + PXR_BOOST_NAMESPACE::python::tuple getinitargs(const world& w) { - return boost::python::make_tuple(w.get_country()); + return PXR_BOOST_NAMESPACE::python::make_tuple(w.get_country()); } }; @@ -53,10 +53,10 @@ namespace boost_python_test { struct noop {}; } -BOOST_PYTHON_MODULE(pickle1_ext) +PXR_BOOST_PYTHON_MODULE(pickle1_ext) { - using namespace boost::python; - using namespace boost_python_test; + using namespace PXR_BOOST_NAMESPACE::python; + using namespace PXR_BOOST_NAMESPACE_python_test; class_("world", init()) .def("greet", &world::greet) .def_pickle(world_pickle_suite()) diff --git a/pxr/external/boost/python/test/pickle2.cpp b/pxr/external/boost/python/test/pickle2.cpp index 94c7e7dfb0..d8b594c69a 100644 --- a/pxr/external/boost/python/test/pickle2.cpp +++ b/pxr/external/boost/python/test/pickle2.cpp @@ -33,7 +33,7 @@ #include "pxr/external/boost/python/tuple.hpp" #include "pxr/external/boost/python/extract.hpp" -namespace boost_python_test { +namespace PXR_BOOST_NAMESPACE_python_test { // A friendly class. class world @@ -51,27 +51,27 @@ namespace boost_python_test { int secret_number; }; - struct world_pickle_suite : boost::python::pickle_suite + struct world_pickle_suite : PXR_BOOST_NAMESPACE::python::pickle_suite { static - boost::python::tuple + PXR_BOOST_NAMESPACE::python::tuple getinitargs(const world& w) { - return boost::python::make_tuple(w.get_country()); + return PXR_BOOST_NAMESPACE::python::make_tuple(w.get_country()); } static - boost::python::tuple + PXR_BOOST_NAMESPACE::python::tuple getstate(const world& w) { - return boost::python::make_tuple(w.get_secret_number()); + return PXR_BOOST_NAMESPACE::python::make_tuple(w.get_secret_number()); } static void - setstate(world& w, boost::python::tuple state) + setstate(world& w, PXR_BOOST_NAMESPACE::python::tuple state) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; if (len(state) != 1) { PyErr_SetObject(PyExc_ValueError, @@ -89,11 +89,11 @@ namespace boost_python_test { } -BOOST_PYTHON_MODULE(pickle2_ext) +PXR_BOOST_PYTHON_MODULE(pickle2_ext) { - using namespace boost_python_test; - boost::python::class_( - "world", boost::python::init()) + using namespace PXR_BOOST_NAMESPACE_python_test; + PXR_BOOST_NAMESPACE::python::class_( + "world", PXR_BOOST_NAMESPACE::python::init()) .def("greet", &world::greet) .def("get_secret_number", &world::get_secret_number) .def("set_secret_number", &world::set_secret_number) diff --git a/pxr/external/boost/python/test/pickle3.cpp b/pxr/external/boost/python/test/pickle3.cpp index 77bd32db66..b391a5fb02 100644 --- a/pxr/external/boost/python/test/pickle3.cpp +++ b/pxr/external/boost/python/test/pickle3.cpp @@ -30,7 +30,7 @@ #include "pxr/external/boost/python/extract.hpp" #include "pxr/external/boost/python/back_reference.hpp" -namespace boost_python_test { +namespace PXR_BOOST_NAMESPACE_python_test { // A friendly class. class world @@ -48,31 +48,31 @@ namespace boost_python_test { int secret_number; }; - struct world_pickle_suite : boost::python::pickle_suite + struct world_pickle_suite : PXR_BOOST_NAMESPACE::python::pickle_suite { static - boost::python::tuple + PXR_BOOST_NAMESPACE::python::tuple getinitargs(const world& w) { - return boost::python::make_tuple(w.get_country()); + return PXR_BOOST_NAMESPACE::python::make_tuple(w.get_country()); } static - boost::python::tuple - getstate(boost::python::object w_obj) + PXR_BOOST_NAMESPACE::python::tuple + getstate(PXR_BOOST_NAMESPACE::python::object w_obj) { - world const& w = boost::python::extract(w_obj)(); + world const& w = PXR_BOOST_NAMESPACE::python::extract(w_obj)(); - return boost::python::make_tuple( + return PXR_BOOST_NAMESPACE::python::make_tuple( w_obj.attr("__dict__"), w.get_secret_number()); } static void - setstate(boost::python::object w_obj, boost::python::tuple state) + setstate(PXR_BOOST_NAMESPACE::python::object w_obj, PXR_BOOST_NAMESPACE::python::tuple state) { - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python; world& w = extract(w_obj)(); if (len(state) != 2) @@ -99,11 +99,11 @@ namespace boost_python_test { } -BOOST_PYTHON_MODULE(pickle3_ext) +PXR_BOOST_PYTHON_MODULE(pickle3_ext) { - using namespace boost_python_test; - boost::python::class_( - "world", boost::python::init()) + using namespace PXR_BOOST_NAMESPACE_python_test; + PXR_BOOST_NAMESPACE::python::class_( + "world", PXR_BOOST_NAMESPACE::python::init()) .def("greet", &world::greet) .def("get_secret_number", &world::get_secret_number) .def("set_secret_number", &world::set_secret_number) diff --git a/pxr/external/boost/python/test/pickle4.cpp b/pxr/external/boost/python/test/pickle4.cpp index d6b0bc3130..35aa2fdb77 100644 --- a/pxr/external/boost/python/test/pickle4.cpp +++ b/pxr/external/boost/python/test/pickle4.cpp @@ -20,7 +20,7 @@ #include -namespace boost_python_test { +namespace PXR_BOOST_NAMESPACE_python_test { // A friendly class. class world @@ -37,10 +37,10 @@ namespace boost_python_test { } -BOOST_PYTHON_MODULE(pickle4_ext) +PXR_BOOST_PYTHON_MODULE(pickle4_ext) { - using namespace boost::python; - using namespace boost_python_test; + using namespace PXR_BOOST_NAMESPACE::python; + using namespace PXR_BOOST_NAMESPACE_python_test; class_("world", init()) .enable_pickling() .def("greet", &world::greet) diff --git a/pxr/external/boost/python/test/pointee.cpp b/pxr/external/boost/python/test/pointee.cpp index deaa24b8a7..8ba5be2362 100644 --- a/pxr/external/boost/python/test/pointee.cpp +++ b/pxr/external/boost/python/test/pointee.cpp @@ -18,14 +18,14 @@ struct A; int main() { BOOST_STATIC_ASSERT( - (boost::python::detail::is_same< - boost::python::pointee >::type + (PXR_BOOST_NAMESPACE::python::detail::is_same< + PXR_BOOST_NAMESPACE::python::pointee >::type , A>::value)); #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION BOOST_STATIC_ASSERT( - (boost::python::detail::is_same< - boost::python::pointee::type + (PXR_BOOST_NAMESPACE::python::detail::is_same< + PXR_BOOST_NAMESPACE::python::pointee::type , char >::value)); #endif diff --git a/pxr/external/boost/python/test/pointer_type_id_test.cpp b/pxr/external/boost/python/test/pointer_type_id_test.cpp index 7388e8eb10..dd26fd82ba 100644 --- a/pxr/external/boost/python/test/pointer_type_id_test.cpp +++ b/pxr/external/boost/python/test/pointer_type_id_test.cpp @@ -13,10 +13,10 @@ int main() { - using namespace boost::python::converter; + using namespace PXR_BOOST_NAMESPACE::python::converter; - boost::python::type_info x - = boost::python::type_id(); + PXR_BOOST_NAMESPACE::python::type_info x + = PXR_BOOST_NAMESPACE::python::type_id(); BOOST_TEST(pointer_type_id() == x); diff --git a/pxr/external/boost/python/test/pointer_vector.cpp b/pxr/external/boost/python/test/pointer_vector.cpp index b27a2e6134..99763df305 100644 --- a/pxr/external/boost/python/test/pointer_vector.cpp +++ b/pxr/external/boost/python/test/pointer_vector.cpp @@ -10,7 +10,7 @@ #include "pxr/external/boost/python/suite/indexing/vector_indexing_suite.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; class Abstract { @@ -39,7 +39,7 @@ class DoesSomething } }; -BOOST_PYTHON_MODULE(pointer_vector_ext) +PXR_BOOST_PYTHON_MODULE(pointer_vector_ext) { class_("Abstract", no_init) .def("f", &Abstract::f) diff --git a/pxr/external/boost/python/test/polymorphism.cpp b/pxr/external/boost/python/test/polymorphism.cpp index c6b9f85d5b..924f9483fe 100644 --- a/pxr/external/boost/python/test/polymorphism.cpp +++ b/pxr/external/boost/python/test/polymorphism.cpp @@ -17,7 +17,7 @@ #include "pxr/external/boost/python/def.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct Callback { @@ -130,7 +130,7 @@ C& getCCppObj () A* pass_a(A* x) { return x; } -BOOST_PYTHON_MODULE_INIT(polymorphism_ext) +PXR_BOOST_PYTHON_MODULE_INIT(polymorphism_ext) { class_("A") .def("f", &A::f, &ACallback::default_f) diff --git a/pxr/external/boost/python/test/polymorphism2.cpp b/pxr/external/boost/python/test/polymorphism2.cpp index 524e73e519..e6a69f57ca 100644 --- a/pxr/external/boost/python/test/polymorphism2.cpp +++ b/pxr/external/boost/python/test/polymorphism2.cpp @@ -20,7 +20,7 @@ #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct P { @@ -130,7 +130,7 @@ C& getCCppObj () A* pass_a(A* x) { return x; } -BOOST_PYTHON_MODULE_INIT(polymorphism2_ext) +PXR_BOOST_PYTHON_MODULE_INIT(polymorphism2_ext) { class_("A") .def("f", &A::f, &ACallback::default_f) diff --git a/pxr/external/boost/python/test/properties.cpp b/pxr/external/boost/python/test/properties.cpp index 0de26b171c..6beed7dc43 100644 --- a/pxr/external/boost/python/test/properties.cpp +++ b/pxr/external/boost/python/test/properties.cpp @@ -8,7 +8,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "pxr/external/boost/python.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; namespace test { @@ -62,7 +62,7 @@ int get_X_instance_count() -BOOST_PYTHON_MODULE(properties_ext) +PXR_BOOST_PYTHON_MODULE(properties_ext) { typedef return_value_policy return_by_value_t; typedef return_internal_reference<> return_by_internal_reference_t; diff --git a/pxr/external/boost/python/test/pytype_function.cpp b/pxr/external/boost/python/test/pytype_function.cpp index f132d0c2b7..26940199f2 100644 --- a/pxr/external/boost/python/test/pytype_function.cpp +++ b/pxr/external/boost/python/test/pytype_function.cpp @@ -7,10 +7,10 @@ // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// If BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, +// If PXR_BOOST_PYTHON_NO_PY_SIGNATURES was defined when building this module, // boost::python will generate simplified docstrings that break the associated // test unless we undefine it before including any headers. -#undef BOOST_PYTHON_NO_PY_SIGNATURES +#undef PXR_BOOST_PYTHON_NO_PY_SIGNATURES #include "pxr/external/boost/python/module.hpp" #include "pxr/external/boost/python/def.hpp" @@ -19,7 +19,7 @@ #include "pxr/external/boost/python/to_python_converter.hpp" #include "pxr/external/boost/python/class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct A { @@ -33,13 +33,13 @@ struct B // Converter from A to python int struct BToPython -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES : converter::to_python_target_type //inherits get_pytype #endif { static PyObject* convert(const B& b) { - return boost::python::incref(boost::python::object(b.a).ptr()); + return PXR_BOOST_NAMESPACE::python::incref(PXR_BOOST_NAMESPACE::python::object(b.a).ptr()); } }; @@ -48,11 +48,11 @@ struct BFromPython { BFromPython() { - boost::python::converter::registry::push_back( + PXR_BOOST_NAMESPACE::python::converter::registry::push_back( &convertible, &construct, - boost::python::type_id< B >() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES + PXR_BOOST_NAMESPACE::python::type_id< B >() +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &converter::expected_from_python_type::get_pytype//convertible to A can be converted to B #endif ); @@ -67,10 +67,10 @@ struct BFromPython static void construct( PyObject* obj_ptr, - boost::python::converter::rvalue_from_python_stage1_data* data) + PXR_BOOST_NAMESPACE::python::converter::rvalue_from_python_stage1_data* data) { void* storage = ( - (boost::python::converter::rvalue_from_python_storage< B >*)data)-> storage.bytes; + (PXR_BOOST_NAMESPACE::python::converter::rvalue_from_python_storage< B >*)data)-> storage.bytes; extract ex(obj_ptr); new (storage) B(ex()); @@ -82,10 +82,10 @@ struct BFromPython B func(const B& b) { return b ; } -BOOST_PYTHON_MODULE(pytype_function_ext) +PXR_BOOST_PYTHON_MODULE(pytype_function_ext) { // Explicitly enable Python signatures in docstrings in case boost::python - // was built with BOOST_PYTHON_NO_PY_SIGNATURES, which disables those + // was built with PXR_BOOST_PYTHON_NO_PY_SIGNATURES, which disables those // signatures by default. docstring_options doc_options; doc_options.enable_py_signatures(); diff --git a/pxr/external/boost/python/test/raw_ctor.cpp b/pxr/external/boost/python/test/raw_ctor.cpp index 70ff036997..705f5c1aac 100644 --- a/pxr/external/boost/python/test/raw_ctor.cpp +++ b/pxr/external/boost/python/test/raw_ctor.cpp @@ -14,7 +14,7 @@ #include "pxr/external/boost/python/tuple.hpp" #include "pxr/external/boost/python/module.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; class Foo { @@ -32,7 +32,7 @@ object init_foo(tuple args, dict kw) return args[0].attr("__init__")(rest, kw); } -BOOST_PYTHON_MODULE(raw_ctor_ext) +PXR_BOOST_PYTHON_MODULE(raw_ctor_ext) { // using no_init postpones defining __init__ function until after // raw_function for proper overload resolution order, since later diff --git a/pxr/external/boost/python/test/raw_pyobject_fail1.cpp b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp index 24707324e8..269b25e0a4 100644 --- a/pxr/external/boost/python/test/raw_pyobject_fail1.cpp +++ b/pxr/external/boost/python/test/raw_pyobject_fail1.cpp @@ -11,6 +11,6 @@ int main() { - boost::python::converter::arg_to_python x(0); + PXR_BOOST_NAMESPACE::python::converter::arg_to_python x(0); return 0; } diff --git a/pxr/external/boost/python/test/raw_pyobject_fail2.cpp b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp index 31418f2868..68abf32938 100644 --- a/pxr/external/boost/python/test/raw_pyobject_fail2.cpp +++ b/pxr/external/boost/python/test/raw_pyobject_fail2.cpp @@ -13,6 +13,6 @@ struct X : PyObject {}; int main() { - boost::python::converter::arg_to_python x(0); + PXR_BOOST_NAMESPACE::python::converter::arg_to_python x(0); return 0; } diff --git a/pxr/external/boost/python/test/register_ptr.cpp b/pxr/external/boost/python/test/register_ptr.cpp index 9efa85d368..32d35c8a95 100644 --- a/pxr/external/boost/python/test/register_ptr.cpp +++ b/pxr/external/boost/python/test/register_ptr.cpp @@ -10,7 +10,7 @@ #include "pxr/external/boost/python.hpp" #include -using namespace boost; +using namespace PXR_BOOST_NAMESPACE; using namespace python; struct A @@ -48,7 +48,7 @@ struct A_Wrapper: A PyObject* self; }; -BOOST_PYTHON_MODULE(register_ptr) +PXR_BOOST_PYTHON_MODULE(register_ptr) { class_("A") .def("f", &A::f, &A_Wrapper::default_f) diff --git a/pxr/external/boost/python/test/result.cpp b/pxr/external/boost/python/test/result.cpp index 8f3483811e..c2285ff9ce 100644 --- a/pxr/external/boost/python/test/result.cpp +++ b/pxr/external/boost/python/test/result.cpp @@ -11,7 +11,7 @@ #include #include -using boost::python::detail::result; +using PXR_BOOST_NAMESPACE::python::detail::result; using boost::type; void expect_int(type*) {} diff --git a/pxr/external/boost/python/test/return_arg.cpp b/pxr/external/boost/python/test/return_arg.cpp index 141bae07a8..5edcefd327 100644 --- a/pxr/external/boost/python/test/return_arg.cpp +++ b/pxr/external/boost/python/test/return_arg.cpp @@ -51,10 +51,10 @@ struct Label : Widget std::string label_; }; -void return_arg_f(boost::python::object) {} +void return_arg_f(PXR_BOOST_NAMESPACE::python::object) {} -using namespace boost::python; -BOOST_PYTHON_MODULE(return_arg_ext) +using namespace PXR_BOOST_NAMESPACE::python; +PXR_BOOST_PYTHON_MODULE(return_arg_ext) { class_("Widget") .def("sensitive", &Widget::get_sensitive) diff --git a/pxr/external/boost/python/test/select_arg_to_python_test.cpp b/pxr/external/boost/python/test/select_arg_to_python_test.cpp index a9f4377988..03be4613e8 100644 --- a/pxr/external/boost/python/test/select_arg_to_python_test.cpp +++ b/pxr/external/boost/python/test/select_arg_to_python_test.cpp @@ -15,8 +15,8 @@ // gcc 2.95.x and MIPSpro 7.3.1.3 linker seem to demand this definition #if ((defined(__GNUC__) && __GNUC__ < 3)) \ || (defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) -namespace boost { namespace python { -BOOST_PYTHON_DECL bool handle_exception_impl(function0) +namespace PXR_BOOST_NAMESPACE { namespace python { +PXR_BOOST_PYTHON_DECL bool handle_exception_impl(function0) { return true; } @@ -37,9 +37,9 @@ void assert_same(U* = 0, T* = 0) int main() { - using namespace boost::python::converter::detail; - using namespace boost::python::converter; - using namespace boost::python; + using namespace PXR_BOOST_NAMESPACE::python::converter::detail; + using namespace PXR_BOOST_NAMESPACE::python::converter; + using namespace PXR_BOOST_NAMESPACE::python; using namespace boost; diff --git a/pxr/external/boost/python/test/select_from_python_test.cpp b/pxr/external/boost/python/test/select_from_python_test.cpp index d1dfcb9f78..5a42756731 100644 --- a/pxr/external/boost/python/test/select_from_python_test.cpp +++ b/pxr/external/boost/python/test/select_from_python_test.cpp @@ -14,8 +14,8 @@ #if (defined(__GNUC__) && (__GNUC__ < 3)) \ || (defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) \ || (defined(__IBMCPP__) && defined(__linux__)) -namespace boost { namespace python { -BOOST_PYTHON_DECL bool handle_exception_impl(function0) +namespace PXR_BOOST_NAMESPACE { namespace python { +PXR_BOOST_PYTHON_DECL bool handle_exception_impl(function0) { return true; } @@ -34,8 +34,8 @@ int result; int main() { - using namespace boost::python::converter; - using namespace boost; + using namespace PXR_BOOST_NAMESPACE::python::converter; + using namespace PXR_BOOST_NAMESPACE; ASSERT_SAME( diff --git a/pxr/external/boost/python/test/select_holder.cpp b/pxr/external/boost/python/test/select_holder.cpp index 77ca55f477..a7be28eca2 100644 --- a/pxr/external/boost/python/test/select_holder.cpp +++ b/pxr/external/boost/python/test/select_holder.cpp @@ -21,7 +21,7 @@ struct BR {}; struct Base {}; struct Derived : Base {}; -namespace boost { namespace python +namespace PXR_BOOST_NAMESPACE { namespace python { // specialization template <> @@ -29,20 +29,20 @@ namespace boost { namespace python : mpl::true_ { }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python template void assert_same(U* = 0, T* = 0) { - BOOST_STATIC_ASSERT((boost::python::detail::is_same::value)); + BOOST_STATIC_ASSERT((PXR_BOOST_NAMESPACE::python::detail::is_same::value)); } template void assert_holder(T* = 0, Held* = 0, Holder* = 0) { - using namespace boost::python::detail; - using namespace boost::python::objects; + using namespace PXR_BOOST_NAMESPACE::python::detail; + using namespace PXR_BOOST_NAMESPACE::python::objects; typedef typename class_metadata< T,Held,not_specified,not_specified @@ -55,8 +55,8 @@ void assert_holder(T* = 0, Held* = 0, Holder* = 0) int test_main(int, char * []) { - using namespace boost::python::detail; - using namespace boost::python::objects; + using namespace PXR_BOOST_NAMESPACE::python::detail; + using namespace PXR_BOOST_NAMESPACE::python::objects; assert_holder >(); diff --git a/pxr/external/boost/python/test/shared_ptr.hpp b/pxr/external/boost/python/test/shared_ptr.hpp index 7ad2ac7228..64bb13f3cd 100644 --- a/pxr/external/boost/python/test/shared_ptr.hpp +++ b/pxr/external/boost/python/test/shared_ptr.hpp @@ -11,7 +11,7 @@ #include "test_class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef test_class<> X; typedef test_class<1> Y; @@ -163,7 +163,7 @@ struct Test { // ------ -BOOST_PYTHON_MODULE(MODULE) +PXR_BOOST_PYTHON_MODULE(MODULE) { class_, boost::noncopyable>("A") .def("call_f", &A::call_f) diff --git a/pxr/external/boost/python/test/slice.cpp b/pxr/external/boost/python/test/slice.cpp index 47f603e7b7..09c0decf94 100644 --- a/pxr/external/boost/python/test/slice.cpp +++ b/pxr/external/boost/python/test/slice.cpp @@ -13,10 +13,10 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) -# define make_tuple boost::python::make_tuple +# define make_tuple PXR_BOOST_NAMESPACE::python::make_tuple #endif // These checks are only valid under Python 2.3 @@ -95,7 +95,7 @@ int check_slice_get_indices( } -BOOST_PYTHON_MODULE(slice_ext) +PXR_BOOST_PYTHON_MODULE(slice_ext) { def( "accept_slice", accept_slice); def( "check_string_rich_slice", check_string_rich_slice); diff --git a/pxr/external/boost/python/test/staticmethod.cpp b/pxr/external/boost/python/test/staticmethod.cpp index 598f884189..e051223196 100644 --- a/pxr/external/boost/python/test/staticmethod.cpp +++ b/pxr/external/boost/python/test/staticmethod.cpp @@ -17,7 +17,7 @@ #define BOOST_ENABLE_ASSERT_HANDLER #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X { @@ -38,7 +38,7 @@ struct X int X::counter; int getXmagic(){return 7654321;} -BOOST_PYTHON_MODULE(staticmethod_ext) +PXR_BOOST_PYTHON_MODULE(staticmethod_ext) { class_("X", init()) .def("value", &X::value) diff --git a/pxr/external/boost/python/test/stl_iterator.cpp b/pxr/external/boost/python/test/stl_iterator.cpp index 1a1159f939..7188acf247 100644 --- a/pxr/external/boost/python/test/stl_iterator.cpp +++ b/pxr/external/boost/python/test/stl_iterator.cpp @@ -13,7 +13,7 @@ #include "pxr/external/boost/python/stl_iterator.hpp" #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; typedef std::list list_int; @@ -25,9 +25,9 @@ void assign(list_int& x, object const& y) x.push_back(*begin); } -BOOST_PYTHON_MODULE(stl_iterator_ext) +PXR_BOOST_PYTHON_MODULE(stl_iterator_ext) { - using boost::python::iterator; // gcc 2.96 bug workaround + using PXR_BOOST_NAMESPACE::python::iterator; // gcc 2.96 bug workaround class_("list_int") .def("assign", assign) diff --git a/pxr/external/boost/python/test/str.cpp b/pxr/external/boost/python/test/str.cpp index 89de99d214..a2dc45ab11 100644 --- a/pxr/external/boost/python/test/str.cpp +++ b/pxr/external/boost/python/test/str.cpp @@ -15,7 +15,7 @@ #define BOOST_ENABLE_ASSERT_HANDLER #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; object convert_to_string(object data) { @@ -80,7 +80,7 @@ void work_with_string(object print) } -BOOST_PYTHON_MODULE(str_ext) +PXR_BOOST_PYTHON_MODULE(str_ext) { def("convert_to_string",convert_to_string); def("work_with_string",work_with_string); diff --git a/pxr/external/boost/python/test/string_literal.cpp b/pxr/external/boost/python/test/string_literal.cpp index 39db2099c2..af88727bc2 100644 --- a/pxr/external/boost/python/test/string_literal.cpp +++ b/pxr/external/boost/python/test/string_literal.cpp @@ -12,7 +12,7 @@ #include #include -using namespace boost::python::detail; +using namespace PXR_BOOST_NAMESPACE::python::detail; template diff --git a/pxr/external/boost/python/test/test_overload_resolution.cpp b/pxr/external/boost/python/test/test_overload_resolution.cpp index 9595f826f9..17e91e4682 100644 --- a/pxr/external/boost/python/test/test_overload_resolution.cpp +++ b/pxr/external/boost/python/test/test_overload_resolution.cpp @@ -27,17 +27,17 @@ #include "pxr/external/boost/python/object.hpp" #include "pxr/external/boost/python/detail/wrap_python.hpp" -using boost::python::def; -using boost::python::handle; -using boost::python::object; -using boost::python::borrowed; +using PXR_BOOST_NAMESPACE::python::def; +using PXR_BOOST_NAMESPACE::python::handle; +using PXR_BOOST_NAMESPACE::python::object; +using PXR_BOOST_NAMESPACE::python::borrowed; std::string takes_bool(bool b) { return "bool"; } std::string takes_int(int b) { return "int"; } std::string takes_double(double b) { return "double"; } -BOOST_PYTHON_MODULE(overload_resolution) +PXR_BOOST_PYTHON_MODULE(overload_resolution) { def("bid", takes_bool); def("bid", takes_int); diff --git a/pxr/external/boost/python/test/test_pointer_adoption.cpp b/pxr/external/boost/python/test/test_pointer_adoption.cpp index 8cf7555c32..0de04d1346 100644 --- a/pxr/external/boost/python/test/test_pointer_adoption.cpp +++ b/pxr/external/boost/python/test/test_pointer_adoption.cpp @@ -14,7 +14,7 @@ #include "pxr/external/boost/python/return_internal_reference.hpp" #include "pxr/external/boost/python/class.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; int a_instances = 0; @@ -91,7 +91,7 @@ A* as_A(Base* b) return dynamic_cast(b); } -BOOST_PYTHON_MODULE(test_pointer_adoption_ext) +PXR_BOOST_PYTHON_MODULE(test_pointer_adoption_ext) { def("num_a_instances", num_a_instances); diff --git a/pxr/external/boost/python/test/tuple.cpp b/pxr/external/boost/python/test/tuple.cpp index 4726571b62..db40679729 100644 --- a/pxr/external/boost/python/test/tuple.cpp +++ b/pxr/external/boost/python/test/tuple.cpp @@ -12,7 +12,7 @@ #include "pxr/external/boost/python/class.hpp" #include "pxr/external/boost/python/tuple.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; object convert_to_tuple(object data) { @@ -28,7 +28,7 @@ tuple mktuple0() { return make_tuple(); } tuple mktuple1(int x) { return make_tuple(x); } tuple mktuple2(char const* a1, int x) { return make_tuple(a1, x); } -BOOST_PYTHON_MODULE(tuple_ext) +PXR_BOOST_PYTHON_MODULE(tuple_ext) { def("convert_to_tuple",convert_to_tuple); def("test_operators",test_operators); diff --git a/pxr/external/boost/python/test/upcast.cpp b/pxr/external/boost/python/test/upcast.cpp index 6ccfc23937..e51358e6bf 100644 --- a/pxr/external/boost/python/test/upcast.cpp +++ b/pxr/external/boost/python/test/upcast.cpp @@ -18,7 +18,7 @@ int main() { PyTypeObject o; Y y; - BOOST_TEST(&Py_REFCNT(boost::python::upcast(&o)) == &Py_REFCNT(&o)); - BOOST_TEST(&Py_REFCNT(boost::python::upcast(&y)) == &Py_REFCNT(&y)); + BOOST_TEST(&Py_REFCNT(PXR_BOOST_NAMESPACE::python::upcast(&o)) == &Py_REFCNT(&o)); + BOOST_TEST(&Py_REFCNT(PXR_BOOST_NAMESPACE::python::upcast(&y)) == &Py_REFCNT(&y)); return boost::report_errors(); } diff --git a/pxr/external/boost/python/test/vector_indexing_suite.cpp b/pxr/external/boost/python/test/vector_indexing_suite.cpp index 23ffe9e17e..32730ac2c2 100644 --- a/pxr/external/boost/python/test/vector_indexing_suite.cpp +++ b/pxr/external/boost/python/test/vector_indexing_suite.cpp @@ -12,7 +12,7 @@ #include "pxr/external/boost/python/def.hpp" #include "pxr/external/boost/python/implicit.hpp" -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X // a container element { @@ -31,7 +31,7 @@ std::string x_value(X const& x) return "gotya " + x.s; } -BOOST_PYTHON_MODULE(vector_indexing_suite_ext) +PXR_BOOST_PYTHON_MODULE(vector_indexing_suite_ext) { class_("X") .def(init<>()) diff --git a/pxr/external/boost/python/test/virtual_functions.cpp b/pxr/external/boost/python/test/virtual_functions.cpp index 425ba6c64b..3a4b7d9b9c 100644 --- a/pxr/external/boost/python/test/virtual_functions.cpp +++ b/pxr/external/boost/python/test/virtual_functions.cpp @@ -19,7 +19,7 @@ #define BOOST_ENABLE_ASSERT_HANDLER #include -using namespace boost::python; +using namespace PXR_BOOST_NAMESPACE::python; struct X { @@ -103,7 +103,7 @@ struct concrete_callback : concrete int X::counter; -BOOST_PYTHON_MODULE(virtual_functions_ext) +PXR_BOOST_PYTHON_MODULE(virtual_functions_ext) { class_("concrete", init()) .def("value", &concrete::value) diff --git a/pxr/external/boost/python/test/voidptr.cpp b/pxr/external/boost/python/test/voidptr.cpp index 8ab866076d..ce39799ab4 100644 --- a/pxr/external/boost/python/test/voidptr.cpp +++ b/pxr/external/boost/python/test/voidptr.cpp @@ -37,9 +37,9 @@ int useany(void *a) } -namespace bpl = boost::python; +namespace bpl = PXR_BOOST_NAMESPACE::python; -BOOST_PYTHON_MODULE(voidptr_ext) +PXR_BOOST_PYTHON_MODULE(voidptr_ext) { bpl::def("get", &::get, bpl::return_value_policy()); bpl::def("getnull", &::getnull, bpl::return_value_policy()); diff --git a/pxr/external/boost/python/test/wrapper_held_type.cpp b/pxr/external/boost/python/test/wrapper_held_type.cpp index e9c8639ab9..d2db5816e2 100644 --- a/pxr/external/boost/python/test/wrapper_held_type.cpp +++ b/pxr/external/boost/python/test/wrapper_held_type.cpp @@ -33,7 +33,7 @@ std::shared_ptr create_data() void do_nothing( std::shared_ptr& ){} -namespace bp = boost::python; +namespace bp = PXR_BOOST_NAMESPACE::python; struct data_wrapper : data, bp::wrapper< data > { @@ -62,7 +62,7 @@ struct data_wrapper : data, bp::wrapper< data > }; -BOOST_PYTHON_MODULE(wrapper_held_type_ext) +PXR_BOOST_PYTHON_MODULE(wrapper_held_type_ext) { bp::class_< data_wrapper, std::shared_ptr< data > >( "data" ) .def( "id", &data::id, &::data_wrapper::default_id ); diff --git a/pxr/external/boost/python/to_python_converter.hpp b/pxr/external/boost/python/to_python_converter.hpp index 1ce877ef16..5388fa9315 100644 --- a/pxr/external/boost/python/to_python_converter.hpp +++ b/pxr/external/boost/python/to_python_converter.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_CONVERTER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,12 +21,12 @@ # include "pxr/external/boost/python/converter/registry.hpp" # include "pxr/external/boost/python/converter/as_to_python_function.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif # include "pxr/external/boost/python/type_id.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { #if 0 //get_pytype member detection namespace detail @@ -58,7 +59,7 @@ namespace detail template < class T, class Conversion, bool has_get_pytype=false > struct to_python_converter { -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES typedef boost::mpl::bool_ HasGetPytype; static PyTypeObject const* get_pytype_1(boost::mpl::true_ *) @@ -93,13 +94,13 @@ to_python_converter::to_python_converter() converter::registry::insert( &normalized::convert , type_id() -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES , &get_pytype_impl #endif ); } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_CONVERTER_HPP diff --git a/pxr/external/boost/python/to_python_indirect.hpp b/pxr/external/boost/python/to_python_indirect.hpp index 5044228d9d..1e12263533 100644 --- a/pxr/external/boost/python/to_python_indirect.hpp +++ b/pxr/external/boost/python/to_python_indirect.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_INDIRECT_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -23,7 +24,7 @@ # include "pxr/external/boost/python/detail/none.hpp" -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES # include "pxr/external/boost/python/converter/pytype_function.hpp" #endif @@ -37,7 +38,7 @@ # include # endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template struct to_python_indirect @@ -48,7 +49,7 @@ struct to_python_indirect { return this->execute(const_cast(ref), detail::is_pointer()); } -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES inline PyTypeObject const* get_pytype()const { @@ -109,7 +110,7 @@ namespace detail }; } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_INDIRECT_HPP diff --git a/pxr/external/boost/python/to_python_value.hpp b/pxr/external/boost/python/to_python_value.hpp index f1a70c422d..884a826874 100644 --- a/pxr/external/boost/python/to_python_value.hpp +++ b/pxr/external/boost/python/to_python_value.hpp @@ -13,6 +13,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_TO_PYTHON_VALUE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -37,11 +38,11 @@ #include #include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES template struct object_manager_get_pytype @@ -71,7 +72,7 @@ struct object_manager_get_pytype typedef typename value_arg::type argument_type; PyObject* operator()(argument_type) const; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES typedef boost::mpl::bool_::value> is_t_handle; typedef boost::detail::indirect_traits::is_reference_to_const is_t_const; PyTypeObject const* get_pytype() const { @@ -100,7 +101,7 @@ struct object_manager_get_pytype typedef typename value_arg::type argument_type; PyObject* operator()(argument_type) const; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return converter::registered::converters.to_python_target_type();} #endif @@ -116,7 +117,7 @@ struct object_manager_get_pytype typedef typename value_arg::type argument_type; PyObject* operator()(argument_type) const; -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return get_pytype((boost::type*)0);} #endif // This information helps make_getter() decide whether to try to @@ -124,11 +125,11 @@ struct object_manager_get_pytype // but it will have to serve for now. BOOST_STATIC_CONSTANT(bool, uses_registry = false); private: -#ifndef BOOST_PYTHON_NO_PY_SIGNATURES +#ifndef PXR_BOOST_PYTHON_NO_PY_SIGNATURES template - PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} template - PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} # if !defined(BOOST_NO_CXX11_SMART_PTR) template PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} @@ -183,7 +184,7 @@ namespace detail } } -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/tuple.hpp b/pxr/external/boost/python/tuple.hpp index 7a0d5d2777..2ee07f5468 100644 --- a/pxr/external/boost/python/tuple.hpp +++ b/pxr/external/boost/python/tuple.hpp @@ -11,6 +11,7 @@ #define PXR_EXTERNAL_BOOST_PYTHON_TUPLE_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -24,21 +25,21 @@ #include // XXX: Workaround for distcc issues with BOOST_PP_ITERATE -# define BOOST_PYTHON_SYNOPSIS +# define PXR_BOOST_PYTHON_SYNOPSIS # include "pxr/external/boost/python/detail/make_tuple.hpp" -# undef BOOST_PYTHON_SYNOPSIS +# undef PXR_BOOST_PYTHON_SYNOPSIS -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { - struct BOOST_PYTHON_DECL tuple_base : object + struct PXR_BOOST_PYTHON_DECL tuple_base : object { protected: tuple_base(); tuple_base(object_cref sequence); - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple_base, object) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple_base, object) private: static detail::new_reference call(object const&); @@ -58,7 +59,7 @@ class tuple : public detail::tuple_base } public: // implementation detail -- for internal use only - BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple, base) + PXR_BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple, base) }; // @@ -77,10 +78,10 @@ namespace converter // for completeness inline tuple make_tuple() { return tuple(); } -# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/make_tuple.hpp")) +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, PXR_BOOST_PYTHON_MAX_ARITY, "pxr/external/boost/python/detail/make_tuple.hpp")) # include BOOST_PP_ITERATE() -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif diff --git a/pxr/external/boost/python/type_id.hpp b/pxr/external/boost/python/type_id.hpp index 7848158d1c..8fc2f05cb1 100644 --- a/pxr/external/boost/python/type_id.hpp +++ b/pxr/external/boost/python/type_id.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_TYPE_ID_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -27,14 +28,14 @@ # include # include "pxr/external/boost/python/detail/type_traits.hpp" -# ifndef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# ifndef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # if defined(__GNUC__) \ && !defined(__EDG_VERSION__) -# define BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# define PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE # endif # endif -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { // for this compiler at least, cross-shared-library type_info // comparisons don't work, so use typeid(x).name() instead. It's not @@ -44,14 +45,14 @@ namespace boost { namespace python { || ( defined(__sgi) && defined(__host_mips)) \ || (defined(__hpux) && defined(__HP_aCC)) \ || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) -# define BOOST_PYTHON_TYPE_ID_NAME +# define PXR_BOOST_PYTHON_TYPE_ID_NAME # endif -#ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +#ifdef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE // Runtime detection of broken cxxabi::__cxa_demangle versions, // to avoid #ifdef clutter. bool cxxabi_cxa_demangle_is_broken(); -#define BOOST_PYTHON_HAVE_CXXABI_CXA_DEMANGLE_IS_BROKEN +#define PXR_BOOST_PYTHON_HAVE_CXXABI_CXA_DEMANGLE_IS_BROKEN #endif // type ids which represent the same information as std::type_info @@ -65,11 +66,11 @@ struct type_info : private totally_ordered inline bool operator==(type_info const& rhs) const; char const* name() const; - friend BOOST_PYTHON_DECL std::ostream& operator<<( + friend PXR_BOOST_PYTHON_DECL std::ostream& operator<<( std::ostream&, type_info const&); private: // data members -# ifdef BOOST_PYTHON_TYPE_ID_NAME +# ifdef PXR_BOOST_PYTHON_TYPE_ID_NAME typedef char const* base_id_t; # else typedef std::type_info const* base_id_t; @@ -80,7 +81,7 @@ struct type_info : private totally_ordered // This macro is obsolete. Port away and remove. -# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) +# define PXR_BOOST_PYTHON_EXPLICIT_TT_DEF(T) template inline type_info type_id() @@ -103,28 +104,28 @@ inline type_info type_id() // down into template instantiations. Explicit specialization stops // that from taking hold. -# define BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \ +# define PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \ template <> \ inline type_info type_id() \ { \ return type_info(typeid(T)); \ } -BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(short) -BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(int) -BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long) +PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(short) +PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(int) +PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long) // using Python's macro instead of Boost's - we don't seem to get the // config right all the time. # ifdef HAVE_LONG_LONG -BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long long) +PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(long long) # endif -# undef BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID +# undef PXR_BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID # endif // inline type_info::type_info(std::type_info const& id) : m_base_type( -# ifdef BOOST_PYTHON_TYPE_ID_NAME +# ifdef PXR_BOOST_PYTHON_TYPE_ID_NAME id.name() # else &id @@ -135,7 +136,7 @@ inline type_info::type_info(std::type_info const& id) inline bool type_info::operator<(type_info const& rhs) const { -# ifdef BOOST_PYTHON_TYPE_ID_NAME +# ifdef PXR_BOOST_PYTHON_TYPE_ID_NAME return std::strcmp(m_base_type, rhs.m_base_type) < 0; # else return m_base_type->before(*rhs.m_base_type); @@ -144,17 +145,17 @@ inline bool type_info::operator<(type_info const& rhs) const inline bool type_info::operator==(type_info const& rhs) const { -# ifdef BOOST_PYTHON_TYPE_ID_NAME +# ifdef PXR_BOOST_PYTHON_TYPE_ID_NAME return !std::strcmp(m_base_type, rhs.m_base_type); # else return *m_base_type == *rhs.m_base_type; # endif } -# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# ifdef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE namespace detail { - BOOST_PYTHON_DECL char const* gcc_demangle(char const*); + PXR_BOOST_PYTHON_DECL char const* gcc_demangle(char const*); } # endif @@ -162,12 +163,12 @@ inline char const* type_info::name() const { char const* raw_name = m_base_type -# ifndef BOOST_PYTHON_TYPE_ID_NAME +# ifndef PXR_BOOST_PYTHON_TYPE_ID_NAME ->name() # endif ; -# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE +# ifdef PXR_BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE return detail::gcc_demangle(raw_name); # else return raw_name; @@ -175,7 +176,7 @@ inline char const* type_info::name() const } -BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, type_info const&); +PXR_BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, type_info const&); template<> inline type_info type_id() @@ -190,7 +191,7 @@ inline type_info type_id() } # endif -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_TYPE_ID_HPP diff --git a/pxr/external/boost/python/with_custodian_and_ward.hpp b/pxr/external/boost/python/with_custodian_and_ward.hpp index a52908b7ea..f4ce79f2b8 100644 --- a/pxr/external/boost/python/with_custodian_and_ward.hpp +++ b/pxr/external/boost/python/with_custodian_and_ward.hpp @@ -11,6 +11,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_WITH_CUSTODIAN_AND_WARD_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -22,7 +23,7 @@ # include "pxr/external/boost/python/object/life_support.hpp" # include -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { namespace detail { @@ -65,7 +66,7 @@ struct with_custodian_and_ward : BasePolicy_ { PyErr_SetString( PyExc_IndexError - , "boost::python::with_custodian_and_ward: argument index out of range" + , "PXR_BOOST_NAMESPACE::python::with_custodian_and_ward: argument index out of range" ); return false; } @@ -103,7 +104,7 @@ struct with_custodian_and_ward_postcall : BasePolicy_ { PyErr_SetString( PyExc_IndexError - , "boost::python::with_custodian_and_ward_postcall: argument index out of range" + , "PXR_BOOST_NAMESPACE::python::with_custodian_and_ward_postcall: argument index out of range" ); return 0; } @@ -127,7 +128,7 @@ struct with_custodian_and_ward_postcall : BasePolicy_ }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_WITH_CUSTODIAN_AND_WARD_HPP diff --git a/pxr/external/boost/python/wrapper.hpp b/pxr/external/boost/python/wrapper.hpp index 8ee2172cb0..b891e84d8f 100644 --- a/pxr/external/boost/python/wrapper.hpp +++ b/pxr/external/boost/python/wrapper.hpp @@ -10,6 +10,7 @@ # define PXR_EXTERNAL_BOOST_PYTHON_WRAPPER_HPP #include "pxr/pxr.h" +#include "pxr/external/boost/python/common.hpp" #ifndef PXR_USE_INTERNAL_BOOST_PYTHON #include @@ -20,7 +21,7 @@ # include "pxr/external/boost/python/converter/registered.hpp" # include "pxr/external/boost/python/detail/sfinae.hpp" -namespace boost { namespace python { +namespace PXR_BOOST_NAMESPACE { namespace python { template class wrapper : public detail::wrapper_base @@ -41,7 +42,7 @@ class wrapper : public detail::wrapper_base } }; -}} // namespace boost::python +}} // namespace PXR_BOOST_NAMESPACE::python #endif // PXR_USE_INTERNAL_BOOST_PYTHON #endif // PXR_EXTERNAL_BOOST_PYTHON_WRAPPER_HPP From f37d897defd65e62a97950a366a5b2375fa4e244 Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 27 Aug 2024 15:05:32 -0700 Subject: [PATCH 108/202] python: Respect PXR_BUILD_TESTS setting for building unit tests This setting was inadvertently ignored, causing the tests for this library to be built even when PXR_BUILD_TESTS was off. (Internal change: 2338719) --- pxr/external/boost/python/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pxr/external/boost/python/CMakeLists.txt b/pxr/external/boost/python/CMakeLists.txt index 30c4a7e82a..66bebcea07 100644 --- a/pxr/external/boost/python/CMakeLists.txt +++ b/pxr/external/boost/python/CMakeLists.txt @@ -307,6 +307,12 @@ target_compile_definitions(python PUBLIC PXR_USE_INTERNAL_BOOST_PYTHON ) +# Since we're not going through the normal pxr_build_test macros +# we need to elide tests here if requested. +if (NOT PXR_BUILD_TESTS) + return() +endif() + #### # Helper functions for unit tests #### From f835f492326320ee638f267827e71a35efcbebde Mon Sep 17 00:00:00 2001 From: sunyab Date: Tue, 27 Aug 2024 15:05:41 -0700 Subject: [PATCH 109/202] python: Fix test incompatibility with Python 3.10+ This test failed to build against these versions of Python with errors like: error: lvalue required as unary '&' operand This was because Py_REFCNT was changed from a macro to a function as of Python 3.10. (Internal change: 2338720) --- pxr/external/boost/python/test/upcast.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pxr/external/boost/python/test/upcast.cpp b/pxr/external/boost/python/test/upcast.cpp index e51358e6bf..0438d0f425 100644 --- a/pxr/external/boost/python/test/upcast.cpp +++ b/pxr/external/boost/python/test/upcast.cpp @@ -18,7 +18,22 @@ int main() { PyTypeObject o; Y y; + + // In Python 3.10 Py_REFCNT was changed from a macro that evaluated to the + // ob_refcnt struct member to a function that returns its value. This breaks + // the previous test, since taking the address of an rvalue is not allowed. + // + // To workaround this, we look at the struct members directly instead of + // going through the API. These members are documented and are part of + // the Python Stable ABI. We also look at ob_type instead of ob_refcnt since + // the latter does not exist in Python builds with the GIL disabled. +#if PY_VERSION_HEX < 0x030a00f0 BOOST_TEST(&Py_REFCNT(PXR_BOOST_NAMESPACE::python::upcast(&o)) == &Py_REFCNT(&o)); BOOST_TEST(&Py_REFCNT(PXR_BOOST_NAMESPACE::python::upcast(&y)) == &Py_REFCNT(&y)); +#else + BOOST_TEST(&PXR_BOOST_NAMESPACE::python::upcast(&o)->ob_type == &o.ob_base.ob_base.ob_type); + BOOST_TEST(&PXR_BOOST_NAMESPACE::python::upcast(&y)->ob_type == &y.ob_type); +#endif + return boost::report_errors(); } From 212b210a9254cd445bf0243051348cd6352c0765 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Aug 2024 19:43:48 -0400 Subject: [PATCH 110/202] fix: update error message - fixed the error message for the packagePath to be the same as the actual code, being based off of the realPath --- .../usdUtils/testenv/testUsdUtilsValidators.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index e51f00ec1e..fbab5decf3 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -4,6 +4,7 @@ #include "pxr/usd/usd/validationRegistry.h" #include "pxr/base/arch/systemInfo.h" #include "pxr/base/tf/pathUtils.h" +#include "pxr/usd/ar/packageUtils.h" PXR_NAMESPACE_USING_DIRECTIVE @@ -55,8 +56,13 @@ TestPackageEncapsulationValidator() // Verify both the layer & asset errors are present TF_AXIOM(errors.size() == 2); - const std::string absoluteUsdzPath = TfAbsPath( - stage->GetRootLayer()->GetIdentifier()); + const SdfLayerRefPtr& rootLayer = stage->GetRootLayer(); + + const std::string absoluteUsdzPath = TfAbsPath(rootLayer->GetIdentifier()); + const std::string realUsdzPath = rootLayer->GetRealPath(); + const std::string& packagePath = ArIsPackageRelativePath(rootLayer->GetIdentifier()) ? + ArSplitPackageRelativePathOuter(realUsdzPath).first : + realUsdzPath; const std::string usdzRootDirectory = TfGetPathName(absoluteUsdzPath); const std::string errorLayer = TfStringCatPaths( usdzRootDirectory, "excludedDirectory/layer.usda"); @@ -66,10 +72,10 @@ TestPackageEncapsulationValidator() std::vector expectedErrorMessages = { TfStringPrintf(("Found referenced layer '%s' that does not " "belong to the package '%s'."), - errorLayer.c_str(), absoluteUsdzPath.c_str()), + errorLayer.c_str(), packagePath.c_str()), TfStringPrintf(("Found asset reference '%s' that does not belong" " to the package '%s'."), - errorAsset.c_str(), absoluteUsdzPath.c_str()) + errorAsset.c_str(), packagePath.c_str()) }; for (size_t i = 0; i < errors.size(); ++i) From 3d3ff5823a6edfac364bca042bd1c7521483baeb Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Aug 2024 19:48:10 -0400 Subject: [PATCH 111/202] fix: remove unnecessary check --- pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp index fbab5decf3..3ec138b9a9 100644 --- a/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp +++ b/pxr/usd/usdUtils/testenv/testUsdUtilsValidators.cpp @@ -4,7 +4,6 @@ #include "pxr/usd/usd/validationRegistry.h" #include "pxr/base/arch/systemInfo.h" #include "pxr/base/tf/pathUtils.h" -#include "pxr/usd/ar/packageUtils.h" PXR_NAMESPACE_USING_DIRECTIVE @@ -60,9 +59,6 @@ TestPackageEncapsulationValidator() const std::string absoluteUsdzPath = TfAbsPath(rootLayer->GetIdentifier()); const std::string realUsdzPath = rootLayer->GetRealPath(); - const std::string& packagePath = ArIsPackageRelativePath(rootLayer->GetIdentifier()) ? - ArSplitPackageRelativePathOuter(realUsdzPath).first : - realUsdzPath; const std::string usdzRootDirectory = TfGetPathName(absoluteUsdzPath); const std::string errorLayer = TfStringCatPaths( usdzRootDirectory, "excludedDirectory/layer.usda"); @@ -72,10 +68,10 @@ TestPackageEncapsulationValidator() std::vector expectedErrorMessages = { TfStringPrintf(("Found referenced layer '%s' that does not " "belong to the package '%s'."), - errorLayer.c_str(), packagePath.c_str()), + errorLayer.c_str(), realUsdzPath.c_str()), TfStringPrintf(("Found asset reference '%s' that does not belong" " to the package '%s'."), - errorAsset.c_str(), packagePath.c_str()) + errorAsset.c_str(), realUsdzPath.c_str()) }; for (size_t i = 0; i < errors.size(); ++i) From 6030846ba6a4187af64051597a9c3c2e07ceec58 Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Tue, 27 Aug 2024 21:18:02 -0700 Subject: [PATCH 112/202] Sdf USDA Parser: Small cleanup - Avoid a string copy by using the string's data directly using PEGTL's memory_input content initialization. (Internal change: 2338769) --- pxr/usd/sdf/textFileFormatParser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pxr/usd/sdf/textFileFormatParser.cpp b/pxr/usd/sdf/textFileFormatParser.cpp index e3b632869a..5136a28ce6 100644 --- a/pxr/usd/sdf/textFileFormatParser.cpp +++ b/pxr/usd/sdf/textFileFormatParser.cpp @@ -4388,12 +4388,13 @@ Sdf_ParseLayerFromString( context.magicIdentifierToken = magicId; context.versionString = versionString; - Sdf_TextFileFormatParser::PEGTL_NS::string_input<> content { - std::move(layerString), ""}; - context.values.errorReporter = + Sdf_TextFileFormatParser::PEGTL_NS::memory_input<> content { + layerString.data(), layerString.size(), ""}; + + context.values.errorReporter = [&context, capture0 = std::cref(content)](auto && PH1) { return Sdf_TextFileFormatParser::_ReportParseError< - Sdf_TextFileFormatParser::PEGTL_NS::string_input<>>( + Sdf_TextFileFormatParser::PEGTL_NS::memory_input<>>( context, capture0, std::forward(PH1)); }; bool status = false; try From 47f6cbe00212eaedee3a41eb7c4dd67e3bdaec2b Mon Sep 17 00:00:00 2001 From: Song Date: Thu, 29 Aug 2024 14:38:51 +0800 Subject: [PATCH 113/202] chore: delete useless residual member function declaration for SdfPath --- pxr/usd/sdf/path.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pxr/usd/sdf/path.h b/pxr/usd/sdf/path.h index 494c744ef6..78dc60abb9 100644 --- a/pxr/usd/sdf/path.h +++ b/pxr/usd/sdf/path.h @@ -1022,10 +1022,6 @@ class SdfPath friend class Sdfext_PathAccess; friend class SdfPathAncestorsRange; - // converts elements to a string for parsing (unfortunate) - static std::string - _ElementsToString(bool absolute, const std::vector &elements); - SdfPath _ReplacePrimPrefix(SdfPath const &oldPrefix, SdfPath const &newPrefix) const; From 4f0eb47c6bddff2b19300a398b73fcac600a5473 Mon Sep 17 00:00:00 2001 From: songruining Date: Thu, 29 Aug 2024 17:56:57 +0800 Subject: [PATCH 114/202] perf: cherry pick of robin-map's opptimization from up-stream, use erase_fast instead of erase when iter is not needed as a return value to improve the performance of erase operation --- pxr/base/tf/pxrTslRobinMap/robin_hash.h | 9 +++++---- pxr/base/tf/pxrTslRobinMap/robin_map.h | 9 +++++++++ pxr/base/tf/pxrTslRobinMap/robin_set.h | 9 +++++++++ pxr/usd/sdf/identity.cpp | 2 +- pxr/usd/sdf/pathNode.cpp | 2 +- pxr/usd/usd/crateData.cpp | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/pxr/base/tf/pxrTslRobinMap/robin_hash.h b/pxr/base/tf/pxrTslRobinMap/robin_hash.h index 4f1b657091..3f633ae595 100644 --- a/pxr/base/tf/pxrTslRobinMap/robin_hash.h +++ b/pxr/base/tf/pxrTslRobinMap/robin_hash.h @@ -817,6 +817,10 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy { return try_emplace(std::forward(key), std::forward(args)...).first; } + void erase_fast(iterator pos) { + erase_from_bucket(pos); + } + /** * Here to avoid `template size_type erase(const K& key)` being used * when we use an `iterator` instead of a `const_iterator`. @@ -833,8 +837,6 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy { ++pos; } - m_try_shrink_on_next_insert = true; - return pos; } @@ -913,8 +915,6 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy { auto it = find(key, hash); if (it != end()) { erase_from_bucket(it); - m_try_shrink_on_next_insert = true; - return 1; } else { return 0; @@ -1207,6 +1207,7 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy { previous_ibucket = ibucket; ibucket = next_bucket(ibucket); } + m_try_shrink_on_next_insert = true; } template diff --git a/pxr/base/tf/pxrTslRobinMap/robin_map.h b/pxr/base/tf/pxrTslRobinMap/robin_map.h index c0e380ce08..05fbedbe67 100644 --- a/pxr/base/tf/pxrTslRobinMap/robin_map.h +++ b/pxr/base/tf/pxrTslRobinMap/robin_map.h @@ -339,6 +339,15 @@ class robin_map { iterator erase(iterator pos) { return m_ht.erase(pos); } iterator erase(const_iterator pos) { return m_ht.erase(pos); } + + /** + * Erase the element at position 'pos'. In contrast to the regular erase() + * function, erase_fast() does not return an iterator. This allows it to be + * faster especially in hash tables with a low load factor, where finding the + * next nonempty bucket would be costly. + */ + void erase_fast(iterator pos) { return m_ht.erase_fast(pos); } + iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } diff --git a/pxr/base/tf/pxrTslRobinMap/robin_set.h b/pxr/base/tf/pxrTslRobinMap/robin_set.h index 92fd376042..71d2f69ec0 100644 --- a/pxr/base/tf/pxrTslRobinMap/robin_set.h +++ b/pxr/base/tf/pxrTslRobinMap/robin_set.h @@ -263,6 +263,15 @@ class robin_set { iterator erase(iterator pos) { return m_ht.erase(pos); } iterator erase(const_iterator pos) { return m_ht.erase(pos); } + + /** + * Erase the element at position 'pos'. In contrast to the regular erase() + * function, erase_fast() does not return an iterator. This allows it to be + * faster especially in hash sets with a low load factor, where finding the + * next nonempty bucket would be costly. + */ + void erase_fast(iterator pos) { return m_ht.erase_fast(pos); } + iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } diff --git a/pxr/usd/sdf/identity.cpp b/pxr/usd/sdf/identity.cpp index bfe04b98ed..d61734a9f5 100644 --- a/pxr/usd/sdf/identity.cpp +++ b/pxr/usd/sdf/identity.cpp @@ -109,7 +109,7 @@ class Sdf_IdRegistryImpl newIdStatus.first->second->_path = newPath; // Erase the old identity map entry. - _ids.erase(oldIdIt); + _ids.erase_fast(oldIdIt); } private: diff --git a/pxr/usd/sdf/pathNode.cpp b/pxr/usd/sdf/pathNode.cpp index 6a26affbf2..ced0d7113a 100644 --- a/pxr/usd/sdf/pathNode.cpp +++ b/pxr/usd/sdf/pathNode.cpp @@ -278,7 +278,7 @@ _Remove(const Sdf_PathNode *pathNode, auto iter = mapAndMutex.map.find(pat); if (iter != mapAndMutex.map.end() && iter->second.GetPtr() == reinterpret_cast(pathNode)) { - mapAndMutex.map.erase(iter); + mapAndMutex.map.erase_fast(iter); } } diff --git a/pxr/usd/usd/crateData.cpp b/pxr/usd/usd/crateData.cpp index b05b547d22..a82933214b 100644 --- a/pxr/usd/usd/crateData.cpp +++ b/pxr/usd/usd/crateData.cpp @@ -255,7 +255,7 @@ class Usd_CrateDataImpl } _lastSet = _data.end(); auto tmpFields(std::move(oldIter->second)); - _data.erase(oldIter); + _data.erase_fast(oldIter); auto iresult = _data.emplace(newPath, std::move(tmpFields)); TF_VERIFY(iresult.second); } From 80eed9cdf3a75d0cd0efb8f1e98a6674df7f045a Mon Sep 17 00:00:00 2001 From: Erika Harrison Date: Thu, 29 Aug 2024 22:33:15 -0600 Subject: [PATCH 115/202] Bugfix for materialx shadows in Metal --- pxr/imaging/hdSt/materialXShaderGen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pxr/imaging/hdSt/materialXShaderGen.cpp b/pxr/imaging/hdSt/materialXShaderGen.cpp index a53d821f10..b0e98f43ed 100644 --- a/pxr/imaging/hdSt/materialXShaderGen.cpp +++ b/pxr/imaging/hdSt/materialXShaderGen.cpp @@ -663,7 +663,8 @@ HdStMaterialXShaderGen::emitLine( // 'occlusion' represents shadow occlusion. We don't use MaterialX's // shadow implementation (hwShadowMap is false). Instead, use our own // per-light occlusion value calculated in mxInit() and stored in lightData - if (_emittingSurfaceNode && str == "vec3 L = lightShader.direction") { + // Metal uses float3, Glsl uses vec3 + if (_emittingSurfaceNode && (str == "vec3 L = lightShader.direction" || str == "float3 L = lightShader.direction" )) { emitLine( "occlusion = u_lightData[activeLightIndex].shadowOcclusion", stage); } From 9449e13c70c8e16635fd2a3352eacf0da09bed67 Mon Sep 17 00:00:00 2001 From: jesschimein Date: Tue, 3 Sep 2024 15:55:33 -0700 Subject: [PATCH 116/202] Updated PR template to mention about basing PR on dev branch. (Internal change: 2338885) --- .github/pull_request_template.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c3cd324aaa..346ae60941 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,8 @@ ### Checklist +[ ] I have created this PR based on the dev branch + [ ] I have followed the [coding conventions](https://openusd.org/release/api/_page__coding__guidelines.html) [ ] I have added unit tests that exercise this functionality (Reference: From 6f76d3021dd0b1da9c1144456f79f976127503f6 Mon Sep 17 00:00:00 2001 From: clach Date: Tue, 3 Sep 2024 15:56:37 -0700 Subject: [PATCH 117/202] [usdImagingGL] Remove unneeded argument "-rendererAov color" from several usdImagingGL tests. testUsdImagingGLBasicDrawing has been using AOVs (with color as the default AOV) for a while now. (Internal change: 2339273) --- pxr/usdImaging/usdImagingGL/CMakeLists.txt | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/pxr/usdImaging/usdImagingGL/CMakeLists.txt b/pxr/usdImaging/usdImagingGL/CMakeLists.txt index 4c483b71c2..b927d0272b 100644 --- a/pxr/usdImaging/usdImagingGL/CMakeLists.txt +++ b/pxr/usdImaging/usdImagingGL/CMakeLists.txt @@ -3854,7 +3854,7 @@ pxr_register_test(testUsdImagingGLInstancePrimvars_Animated ) pxr_register_test(testUsdImagingGLSimpleVolumes - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage simpleVolumes.usda -write testUsdImagingGLSimpleVolumes.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.04 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage simpleVolumes.usda -write testUsdImagingGLSimpleVolumes.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.04 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" IMAGE_DIFF_COMPARE testUsdImagingGLSimpleVolumes.png FAIL 1 @@ -3865,7 +3865,7 @@ pxr_register_test(testUsdImagingGLSimpleVolumes ) pxr_register_test(testUsdImagingGLSimpleVolumes_Glow - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage simpleVolumeGlow.usda -write testUsdImagingGLSimpleVolumeGlow.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.05 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage simpleVolumeGlow.usda -write testUsdImagingGLSimpleVolumeGlow.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.05 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" IMAGE_DIFF_COMPARE testUsdImagingGLSimpleVolumeGlow.png FAIL 1 @@ -3876,7 +3876,7 @@ pxr_register_test(testUsdImagingGLSimpleVolumes_Glow ) pxr_register_test(testUsdImagingGLVolumeMaterial - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage volumeMaterial.usda -write testUsdImagingGLVolumeMaterial.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.05 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage volumeMaterial.usda -write testUsdImagingGLVolumeMaterial.png -clear 0 0 0 1 -lighting -camera /main_cam -renderSetting volumeRaymarchingStepSize float 0.05 -renderSetting volumeRaymarchingStepSizeLighting float 0.05" IMAGE_DIFF_COMPARE testUsdImagingGLVolumeMaterial.png FAIL 1 @@ -4173,7 +4173,7 @@ pxr_register_test(testUsdImagingGLPrimvarProcessing ) pxr_register_test(testUsdImagingGLComposite - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -times 0 1 2 -stage moving_cubes.usda -camera /main_cam -presentComposite -rendererAov color -write testUsdImagingGLComposite.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -frameAll -times 0 1 2 -stage moving_cubes.usda -camera /main_cam -presentComposite -write testUsdImagingGLComposite.png" IMAGE_DIFF_COMPARE testUsdImagingGLComposite_000.png testUsdImagingGLComposite_001.png @@ -4186,7 +4186,7 @@ pxr_register_test(testUsdImagingGLComposite ) pxr_register_test(testUsdImagingGLPresentDisabled - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -presentDisabled -offscreen -lighting -frameAll -stage sphere.usda -rendererAov color -write testUsdImagingGLPresentDisabled.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -presentDisabled -offscreen -lighting -frameAll -stage sphere.usda -write testUsdImagingGLPresentDisabled.png" IMAGE_DIFF_COMPARE testUsdImagingGLPresentDisabled.png FAIL 1 @@ -4197,7 +4197,7 @@ pxr_register_test(testUsdImagingGLPresentDisabled ) pxr_register_test(testUsdImagingGLFraming_1 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 640 480 -windowPolicy fit -write testUsdImagingGLFraming1.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 640 480 -windowPolicy fit -write testUsdImagingGLFraming1.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming1.png FAIL 0.01 @@ -4210,7 +4210,7 @@ pxr_register_test(testUsdImagingGLFraming_1 pxr_register_test(testUsdImagingGLFraming_2 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 40 640 430 -displayWindow 0 0 1280 960 -windowPolicy fit -write testUsdImagingGLFraming2.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 40 640 430 -displayWindow 0 0 1280 960 -windowPolicy fit -write testUsdImagingGLFraming2.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming2.png FAIL 0.01 @@ -4223,7 +4223,7 @@ pxr_register_test(testUsdImagingGLFraming_2 pxr_register_test(testUsdImagingGLFraming_3 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -write testUsdImagingGLFraming3.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -write testUsdImagingGLFraming3.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming3.png FAIL 0.01 @@ -4236,7 +4236,7 @@ pxr_register_test(testUsdImagingGLFraming_3 pxr_register_test(testUsdImagingGLFraming_4 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -pixelAspectRatio 1.5 -write testUsdImagingGLFraming4.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -pixelAspectRatio 1.5 -write testUsdImagingGLFraming4.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming4.png FAIL 0.01 @@ -4249,7 +4249,7 @@ pxr_register_test(testUsdImagingGLFraming_4 pxr_register_test(testUsdImagingGLFraming_5 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFraming5.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFraming5.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming5.png FAIL 0.01 @@ -4262,7 +4262,7 @@ pxr_register_test(testUsdImagingGLFraming_5 pxr_register_test(testUsdImagingGLFraming_6 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /OrthoCam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFraming6.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /OrthoCam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFraming6.png" IMAGE_DIFF_COMPARE testUsdImagingGLFraming6.png FAIL 0.01 @@ -5150,7 +5150,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) ) pxr_register_test(testUsdImagingGLFramingEmbree_1 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 640 480 -windowPolicy fit -write testUsdImagingGLFramingEmbree1.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 640 480 -windowPolicy fit -write testUsdImagingGLFramingEmbree1.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree1.png FAIL 1 @@ -5168,7 +5168,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) pxr_register_test(testUsdImagingGLFramingEmbree_2 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 40 640 430 -displayWindow 0 0 1280 960 -windowPolicy fit -write testUsdImagingGLFramingEmbree2.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 40 640 430 -displayWindow 0 0 1280 960 -windowPolicy fit -write testUsdImagingGLFramingEmbree2.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree2.png FAIL 1 @@ -5186,7 +5186,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) pxr_register_test(testUsdImagingGLFramingEmbree_3 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -write testUsdImagingGLFramingEmbree3.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -write testUsdImagingGLFramingEmbree3.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree3.png FAIL 1 @@ -5204,7 +5204,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) pxr_register_test(testUsdImagingGLFramingEmbree_4 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -pixelAspectRatio 1.5 -write testUsdImagingGLFramingEmbree4.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 0 0 640 480 -displayWindow 0 0 320 480 -windowPolicy fit -pixelAspectRatio 1.5 -write testUsdImagingGLFramingEmbree4.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree4.png FAIL 1 @@ -5222,7 +5222,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) pxr_register_test(testUsdImagingGLFramingEmbree_5 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFramingEmbree5.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /main_cam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFramingEmbree5.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree5.png FAIL 1 @@ -5240,7 +5240,7 @@ if (EMBREE_FOUND AND ${PXR_BUILD_EMBREE_PLUGIN}) pxr_register_test(testUsdImagingGLFramingEmbree_6 - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -rendererAov color -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /OrthoCam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFramingEmbree6.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -renderer HdEmbreeRendererPlugin -offscreen -stage framing.usda -clear 0 0 0 1 -lighting -camera /OrthoCam -dataWindow 25 136 367 298 -displayWindow 50 80 320 400 -windowPolicy fit -write testUsdImagingGLFramingEmbree6.png" IMAGE_DIFF_COMPARE testUsdImagingGLFramingEmbree6.png FAIL 1 @@ -5537,7 +5537,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) ) pxr_register_test(testUsdImagingGLVdbVolume - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolume.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolume.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolume.png FAIL 1 @@ -5551,7 +5551,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_DisableSceneMaterials - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -disableSceneMaterials -rendererAov color -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeDisableSceneMaterials.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -disableSceneMaterials -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeDisableSceneMaterials.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeDisableSceneMaterials.png FAIL 1 @@ -5565,7 +5565,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_Large - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeLarge.usda -clear 0 0 0 1 -lighting -camera /World/main_cam -write testUsdImagingGLVdbVolumeLarge.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeLarge.usda -clear 0 0 0 1 -lighting -camera /World/main_cam -write testUsdImagingGLVdbVolumeLarge.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeLarge.png FAIL 1 @@ -5579,7 +5579,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_Flipped - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeFlipped.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFlipped.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeFlipped.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFlipped.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeFlipped.png FAIL 1 @@ -5593,7 +5593,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_FallbackMaterial - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeFallbackMaterial.usda -times 1 2 3 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFallbackMaterial.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeFallbackMaterial.usda -times 1 2 3 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFallbackMaterial.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeFallbackMaterial_001.png testUsdImagingGLVdbVolumeFallbackMaterial_002.png @@ -5609,7 +5609,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_Inside - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeInside.usda -times 1 13 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeInside.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeInside.usda -times 1 13 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeInside.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeInside_001.png testUsdImagingGLVdbVolumeInside_013.png @@ -5625,7 +5625,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_Ortho - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeOrtho.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeOrtho.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeOrtho.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeOrtho.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeOrtho.png FAIL_PERCENT 2 @@ -5638,7 +5638,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_TwoFields - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeTwoFields.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTwoFields.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeTwoFields.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTwoFields.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeTwoFields.png FAIL_PERCENT 2 @@ -5651,7 +5651,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolume_TargetMemory - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeTargetMemory.usda -times 2 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTargetMemory.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeTargetMemory.usda -times 2 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTargetMemory.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeTargetMemory_002.png FAIL 1 @@ -5664,7 +5664,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) ) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolume.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolume.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolume.png FAIL 1 @@ -5678,7 +5678,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_DisableSceneMaterials - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -disableSceneMaterials -rendererAov color -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeDisableSceneMaterials.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -disableSceneMaterials -offscreen -stage vdbVolume.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeDisableSceneMaterials.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeDisableSceneMaterials.png FAIL 1 @@ -5692,7 +5692,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_Large - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeLarge.usda -clear 0 0 0 1 -lighting -camera /World/main_cam -write testUsdImagingGLVdbVolumeLarge.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeLarge.usda -clear 0 0 0 1 -lighting -camera /World/main_cam -write testUsdImagingGLVdbVolumeLarge.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeLarge.png FAIL 1 @@ -5706,7 +5706,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_Flipped - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeFlipped.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFlipped.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeFlipped.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFlipped.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeFlipped.png FAIL 1 @@ -5720,7 +5720,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_FallbackMaterial - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeFallbackMaterial.usda -times 1 2 3 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFallbackMaterial.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeFallbackMaterial.usda -times 1 2 3 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeFallbackMaterial.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeFallbackMaterial_001.png testUsdImagingGLVdbVolumeFallbackMaterial_002.png @@ -5736,7 +5736,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_Inside - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeInside.usda -times 1 13 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeInside.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeInside.usda -times 1 13 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeInside.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeInside_001.png testUsdImagingGLVdbVolumeInside_013.png @@ -5752,7 +5752,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_Ortho - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeOrtho.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeOrtho.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeOrtho.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeOrtho.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeOrtho.png FAIL_PERCENT 2 @@ -5765,7 +5765,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_TwoFields - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeTwoFields.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTwoFields.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeTwoFields.usda -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTwoFields.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeTwoFields.png FAIL_PERCENT 2 @@ -5778,7 +5778,7 @@ if (OPENVDB_FOUND AND ${PXR_ENABLE_OPENVDB_SUPPORT}) pxr_register_test(testUsdImagingGLVdbVolumeNonBindless_TargetMemory - COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -rendererAov color -offscreen -stage vdbVolumeTargetMemory.usda -times 2 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTargetMemory.png" + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingGLBasicDrawing -offscreen -stage vdbVolumeTargetMemory.usda -times 2 -clear 0 0 0 1 -lighting -camera /main_cam -write testUsdImagingGLVdbVolumeTargetMemory.png" IMAGE_DIFF_COMPARE testUsdImagingGLVdbVolumeTargetMemory_002.png FAIL 1 From 8ff421b4509f450ced1bad420dce1612b0851ed0 Mon Sep 17 00:00:00 2001 From: LiamGFX Date: Tue, 3 Sep 2024 15:58:02 -0700 Subject: [PATCH 118/202] enable/add OpenUSD GitHub workflows (Internal change: 2339303) --- .github/workflows/buildusd.yml | 165 ++++++++++++++++ .github/workflows/pypi.yml | 342 +++++++++++++++++++++++++++++++++ 2 files changed, 507 insertions(+) create mode 100644 .github/workflows/buildusd.yml create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/buildusd.yml b/.github/workflows/buildusd.yml new file mode 100644 index 0000000000..a90a903aa5 --- /dev/null +++ b/.github/workflows/buildusd.yml @@ -0,0 +1,165 @@ +name: BuildUSD + +on: + push: + branches: + - dev + - release + issue_comment: + types: [created] + +env: + PYTHON_VERSION: "3.9" + PYTHON_VERSION_MAC: "3.11" + +jobs: + GetUser: + runs-on: ubuntu-20.04 + timeout-minutes: 5 + outputs: + require-result: ${{ steps.check.outputs.require-result }} + steps: + - uses: actions-cool/check-user-permission@v2 + id: check + with: + require: 'write' + username: ${{ github.event.comment.user.login }} + Linux: + needs: [GetUser] + if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }} + runs-on: ubuntu-20.04 + timeout-minutes: 120 + steps: + - run: echo ${{ needs.GetUser.outputs.require-result }} + - name: Checkout code + uses: actions/checkout@v4 + - name: Restore cached artifacts + id: cache-usd-build-dependency + uses: actions/cache/restore@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + check-latest: false + - name: Install dependencies + run: | + sudo apt-get -qq update + sudo apt-get install -y python3-setuptools libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev + pip install --upgrade pip + pip install PySide2 PyOpenGL + - name: Build USD + run: | + python3 build_scripts/build_usd.py --no-materialx --build USDgen/build --src USDgen/src USDinst -v + - name: Save build artifacts to cache + if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }} + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: usd-linux + path: USDinst + + macOS: + needs: [GetUser] + if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }} + runs-on: macos-12 + timeout-minutes: 120 + steps: + - run: echo ${{ needs.GetUser.outputs.require-result }} + - name: Checkout code + uses: actions/checkout@v4 + - name: Restore cached artifacts + id: cache-usd-build-dependency + uses: actions/cache/restore@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION_MAC }}-${{ hashFiles('build_scripts/**/*') }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION_MAC }} + check-latest: false + - name: Install dependencies + run: | + export PATH=/Applications/CMake.app/Contents/bin:$PATH + sudo xcode-select -s /Applications/Xcode_13.3.app/Contents/Developer + # Set SYSTEM_VERSION_COMPAT while installing Python packages to + # accommodate the macOS version numbering change from 10.x to 11 + export SYSTEM_VERSION_COMPAT=1 + pip install PySide6 PyOpenGL setuptools + export -n SYSTEM_VERSION_COMPAT + - name: Build USD + run: | + export PATH=/Applications/CMake.app/Contents/bin:$PATH + python3 build_scripts/build_usd.py --no-materialx --generator Xcode --build USDgen/build --src USDgen/src USDinst -v + - name: Save build artifacts to cache + if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION_MAC }}-${{ hashFiles('build_scripts/**/*') }} + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: usd-macOS + path: USDinst + + Windows: + needs: [GetUser] + if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }} + runs-on: windows-2019 + timeout-minutes: 120 + steps: + - run: echo ${{ needs.GetUser.outputs.require-result }} + - name: Checkout code + uses: actions/checkout@v4 + - name: Restore cached artifacts + id: cache-usd-build-dependency + uses: actions/cache/restore@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + check-latest: false + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install PyOpenGL PySide2 + - name: Build USD + run: | + REM Unset BOOST_ROOT on Windows. The VS2017-Win2016 image + REM sets this env var to a pre-installed boost which causes + REM the USD build to favor this over the boost built by + REM build_usd.py. This causes the build to fail, because + REM the pre-installed boost does not include boost_python27 + call set BOOST_ROOT= + python build_scripts/build_usd.py --no-materialx --generator "Visual Studio 16 2019" --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF" -v + shell: cmd + - name: Save build artifacts to cache + if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: | + USDinst + key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }} + - name: Upload artifacts + # use v3 because actions/upload-artifact@v4 fails + # see https://github.com/actions/upload-artifact/issues/485 + uses: actions/upload-artifact@v3 + with: + name: usd-win64 + path: USDinst \ No newline at end of file diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000000..7342f27792 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,342 @@ +name: PyPiPackaging + +# Trigger this build whenever the dev or release branches are updated +# or on-demand. +# +# Ideally we'd run this pipeline for all pull requests, but doing so consumes +# our limited number of slots and almost always just duplicates the +# build done in the main pipeline. +on: + push: + branches: + - dev + - release + workflow_dispatch: + inputs: + post_release_tag: + description: 'post release tag' + default: '' + +env: + POST_RELEASE_TAG: ${{ github.event.inputs.post_release_tag == '' && ' ' || format('--post-release-tag {0}', github.event.inputs.post_release_tag) }} + +jobs: + Linux: + strategy: + matrix: + PYTHON: + - TAG: cp37 + INTERPRETER: /opt/python/cp37-cp37m/bin/python + VERSION_SPEC: '3.7' + - TAG: cp38 + INTERPRETER: /opt/python/cp38-cp38/bin/python + VERSION_SPEC: '3.8' + - TAG: cp39 + INTERPRETER: /opt/python/cp39-cp39/bin/python + VERSION_SPEC: '3.9' + - TAG: cp310 + INTERPRETER: /opt/python/cp310-cp310/bin/python + VERSION_SPEC: '3.10' + - TAG: cp311 + INTERPRETER: /opt/python/cp311-cp311/bin/python + VERSION_SPEC: '3.11' + runs-on: ubuntu-20.04 + timeout-minutes: 60 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.PYTHON.VERSION_SPEC }} + check-latest: false + - name: Setting up docker + run: | + docker build -t manylinuxwithcmake build_scripts/pypi/docker + docker run --name usdmanylinux --rm -id -v ./:/opt/USD -v /home/vsts/dist:/opt/USD-dist manylinuxwithcmake + - name: Building USD + run: | + # Terrible, terrible hack. The manylinux Docker image used to build the + # Python wheel does not include the corresponding Python shared library + # to link against. https://peps.python.org/pep-0513/#libpythonx-y-so-1 + # describes why this is so. However, the FindPython CMake module used + # by USD's build system requires that the library exists and will error + # out otherwise, even though we explicitly avoid linking against Python + # via the PXR_PY_UNDEFINED_DYNAMIC_LOOKUP flag. + # + # To work around this, we create a dummy file for the library using + # the same logic as build_usd.py to determine where the library should + # exist (see GetPythonInfo). FindPython will see that the library exists + # and allow the build to continue. The file is 100% bogus, but the + # PXR_PY_UNDEFINED_DYNAMIC_LOOKUP flag will ensure that we never try to + # link against this library anyway, so it doesn't matter. + docker exec usdmanylinux ${{ matrix.PYTHON.INTERPRETER }} -c "import pathlib,sysconfig; pathlib.Path(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')).touch()" + docker exec usdmanylinux ${{ matrix.PYTHON.INTERPRETER }} build_scripts/build_usd.py --build-args USD,"-DPXR_PY_UNDEFINED_DYNAMIC_LOOKUP=ON -DPXR_BUILD_USD_TOOLS=OFF -DPXR_INSTALL_LOCATION=../pxr/pluginfo" --no-materialx --no-imaging --no-examples --no-tutorials --build /opt/USD/gen/build --src /opt/USD/gen/src /opt/USD/inst -v + - name: Creating packaging directory + run: | + docker exec usdmanylinux mkdir ./packaging + docker exec usdmanylinux cp -R /opt/USD/inst ./packaging + docker exec usdmanylinux sh -c 'cp build_scripts/pypi/package_files/* ./packaging' + docker exec usdmanylinux sh -c 'cp LICENSE.txt ./packaging' + - name: Running setup.py + run: | + docker exec -w /opt/USD/packaging usdmanylinux ${{ matrix.PYTHON.INTERPRETER }} setup.py ${{ env.POST_RELEASE_TAG }} bdist_wheel --python-tag ${{ matrix.PYTHON.TAG }} + - name: Running auditwheel repair (moves .so files into package) + run: | + docker exec usdmanylinux /bin/bash -c 'PYTHONPATH=/opt/USD/packaging/pypi/lib/python LD_LIBRARY_PATH=/opt/USD/packaging/pypi/lib:$LD_LIBRARY_PATH auditwheel repair packaging/dist/*.whl' + - name: Updating pluginfo paths + run: | + WHEEL_PACKAGE_NAME=`docker exec usdmanylinux ls wheelhouse` + docker exec usdmanylinux ${{ matrix.PYTHON.INTERPRETER }} build_scripts/pypi/updatePluginfos.py "wheelhouse/$WHEEL_PACKAGE_NAME" "/opt/USD-dist/$WHEEL_PACKAGE_NAME" + - name: Stopping docker container + run: | + docker stop usdmanylinux + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-linux-${{ matrix.PYTHON.TAG }} + path: /home/vsts/dist + macOS: + strategy: + matrix: + PYTHON: + - VERSION_SPEC: '3.7' + INTERPRETER: python3.7 + TAG: cp37 + - VERSION_SPEC: '3.8' + INTERPRETER: python3.8 + TAG: cp38 + - VERSION_SPEC: '3.9' + INTERPRETER: python3.9 + TAG: cp39 + - VERSION_SPEC: '3.10' + INTERPRETER: python3.10 + TAG: cp310 + - VERSION_SPEC: '3.11' + INTERPRETER: python3.11 + TAG: cp311 + runs-on: macos-12 + timeout-minutes: 120 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.PYTHON.VERSION_SPEC }} + check-latest: false + - name: Install dependencies + run: | + ${{ matrix.PYTHON.INTERPRETER }} -m pip install --upgrade pip + ${{ matrix.PYTHON.INTERPRETER }} -m pip install delocate~=0.10.2 wheel + - name: Build USD + run: | + sudo xcode-select -s /Applications/Xcode_13.3.app/Contents/Developer + ${{ matrix.PYTHON.INTERPRETER }} build_scripts/build_usd.py --build-args USD,"-DPXR_PY_UNDEFINED_DYNAMIC_LOOKUP=ON -DPXR_BUILD_USD_TOOLS=OFF -DPXR_INSTALL_LOCATION=../pluginfo" --no-materialx --no-imaging --no-examples --no-tutorials --generator Xcode --build-target universal --build $GITHUB_WORKSPACE/USDgen/build --src $GITHUB_WORKSPACE/USDgen/src $GITHUB_WORKSPACE/USDinst -v + - name: Packaging USD + run: | + pwd + ls -la + mkdir ./packaging + mkdir ./packaging/inst + cp -R $GITHUB_WORKSPACE/USDinst/* ./packaging/inst + cp build_scripts/pypi/package_files/* ./packaging + cp LICENSE.txt ./packaging + ls -la ./packaging + ls -la ./packaging/inst + - name: Running setup.py + run: | + cd ./packaging + ${{ matrix.PYTHON.INTERPRETER }} setup.py ${{ env.POST_RELEASE_TAG }} bdist_wheel --python-tag ${{ matrix.PYTHON.TAG }} --plat-name macosx_10_9_universal2 + - name: Running delocate + run: | + # set DYLD_FALLBACK_LIBRARY_PATH for delocate-wheel to resolve libs + # https://github.com/pypa/cibuildwheel/issues/816 + export DYLD_FALLBACK_LIBRARY_PATH=`readlink -f USDinst/lib` + echo $DYLD_FALLBACK_LIBRARY_PATH + ls -la $DYLD_FALLBACK_LIBRARY_PATH + delocate-wheel -vv -w dist-delocated packaging/dist/* + ls -la packaging/dist + ls -la dist-delocated + - name: Updating pluginfo paths + run: | + WHEEL_PACKAGE_NAME=`ls ./packaging/dist` + mkdir -p ./dist + ls -la ./packaging/dist + ls -la ./dist + ${{ matrix.PYTHON.INTERPRETER }} build_scripts/pypi/updatePluginfos.py "./dist-delocated/$WHEEL_PACKAGE_NAME" "./dist/$WHEEL_PACKAGE_NAME" + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-mac-${{ matrix.PYTHON.TAG }} + path: ./dist + Windows: + strategy: + matrix: + PYTHON: + - VERSION_SPEC: '3.7' + TAG: cp37 + - VERSION_SPEC: '3.8' + TAG: cp38 + - VERSION_SPEC: '3.9' + TAG: cp39 + - VERSION_SPEC: '3.10' + TAG: cp310 + - VERSION_SPEC: '3.11' + TAG: cp311 + runs-on: windows-2019 + timeout-minutes: 60 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.PYTHON.VERSION_SPEC }} + check-latest: false + - name: Install dependencies + run: | + python -m pip install wheel + shell: cmd + - name: Build USD + run: | + call C:\"Program Files (x86)"\"Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat + set BOOST_ROOT= + python --version + python build_scripts/build_usd.py --build-args USD,"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF -DPXR_PY_UNDEFINED_DYNAMIC_LOOKUP=ON -DPXR_BUILD_USD_TOOLS=OFF -DPXR_INSTALL_LOCATION=../pxr/pluginfo" --no-materialx --no-imaging --no-examples --no-tutorials --build USDgen/build --src USDgen/src USDinst -v + shell: cmd + - name: Packaging USD + run: | + dir + mkdir D:\packaging + xcopy /E /I USDinst D:\packaging\inst + copy build_scripts\pypi\package_files\* D:\packaging + copy LICENSE.txt D:\packaging + dir D:\packaging + dir D:\packaging\inst + shell: cmd + - name: Running setup.py + run: | + D: + cd D:\packaging + python setup.py ${{ env.POST_RELEASE_TAG }} bdist_wheel --python-tag ${{ matrix.PYTHON.TAG }} --plat-name win_amd64 + dir + shell: cmd + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-windows-${{ matrix.PYTHON.TAG }} + path: D:\packaging\dist + + CollectPackages: + if: ${{ always() }} + needs: [Linux, macOS, Windows] + timeout-minutes: 5 + runs-on: ubuntu-24.04 + steps: + - uses: actions/download-artifact@v4 + with: + path: dist-final + pattern: dist-*-* + merge-multiple: true + - name: Display structure of downloaded files + run: ls -R dist-final + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist-final + + Test: + needs: [CollectPackages] + timeout-minutes: 5 + strategy: + matrix: + BUILD_CONFIG: + - NAME: Linux_Python37 + PYTHON_VERSION_SPEC: '3.7' + IMAGE: ubuntu-20.04 + PYTHON_INTERPRETER: python3 + - NAME: Linux_Python38 + PYTHON_VERSION_SPEC: '3.8' + IMAGE: ubuntu-20.04 + PYTHON_INTERPRETER: python3 + - NAME: Linux_Python39 + PYTHON_VERSION_SPEC: '3.9' + IMAGE: ubuntu-20.04 + PYTHON_INTERPRETER: python3 + - NAME: Linux_Python310 + PYTHON_VERSION_SPEC: '3.10' + IMAGE: ubuntu-20.04 + PYTHON_INTERPRETER: python3 + - NAME: Linux_Python311 + PYTHON_VERSION_SPEC: '3.11' + IMAGE: ubuntu-20.04 + PYTHON_INTERPRETER: python3 + - NAME: Mac_Python37 + PYTHON_VERSION_SPEC: '3.7' + IMAGE: macos-12 + PYTHON_INTERPRETER: python3 + - NAME: Mac_Python38 + PYTHON_VERSION_SPEC: '3.8' + IMAGE: macos-12 + PYTHON_INTERPRETER: python3 + - NAME: Mac_Python39 + PYTHON_VERSION_SPEC: '3.9' + IMAGE: macos-12 + PYTHON_INTERPRETER: python3 + - NAME: Mac_Python310 + PYTHON_VERSION_SPEC: '3.10' + IMAGE: macos-12 + PYTHON_INTERPRETER: python3 + - NAME: Mac_Python311 + PYTHON_VERSION_SPEC: '3.11' + IMAGE: macos-12 + PYTHON_INTERPRETER: python3 + - NAME: Windows_Python37 + PYTHON_VERSION_SPEC: '3.7' + IMAGE: windows-2019 + PYTHON_INTERPRETER: python3 + - NAME: Windows_Python38 + PYTHON_VERSION_SPEC: '3.8' + IMAGE: windows-2019 + PYTHON_INTERPRETER: python3 + - NAME: Windows_Python39 + PYTHON_VERSION_SPEC: '3.9' + IMAGE: windows-2019 + PYTHON_INTERPRETER: python3 + - NAME: Windows_Python310 + PYTHON_VERSION_SPEC: '3.10' + IMAGE: windows-2019 + PYTHON_INTERPRETER: python3 + - NAME: Windows_Python311 + PYTHON_VERSION_SPEC: '3.11' + IMAGE: windows-2019 + PYTHON_INTERPRETER: python3 + runs-on: ${{ matrix.BUILD_CONFIG.IMAGE }} + steps: + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.BUILD_CONFIG.PYTHON_VERSION_SPEC }} + check-latest: false + - name: Checkout code + uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: dist + merge-multiple: true + - name: Packaging USD + run: | + which python3 + ${{ matrix.BUILD_CONFIG.PYTHON_INTERPRETER }} --version + ${{ matrix.BUILD_CONFIG.PYTHON_INTERPRETER }} -m pip install pytest + ${{ matrix.BUILD_CONFIG.PYTHON_INTERPRETER }} -m pip install --no-index --find-links=file://${{ github.workspace }} usd-core + py.test --junitxml TEST-usdinstall-${{ matrix.BUILD_CONFIG.NAME }}.xml build_scripts/pypi/test.py + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: TEST-usdinstall-${{ matrix.BUILD_CONFIG.NAME }} + path: TEST-usdinstall-${{ matrix.BUILD_CONFIG.NAME }}.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} \ No newline at end of file From 8054e577b565a602d385126b57b31841956b2c43 Mon Sep 17 00:00:00 2001 From: anwang2009 Date: Tue, 3 Sep 2024 15:58:16 -0700 Subject: [PATCH 119/202] Correctly quote dictionary keys with control characters (Internal change: 2339311) --- pxr/usd/sdf/fileIO_Common.cpp | 2 +- pxr/usd/sdf/testenv/testSdfParsing.py | 1 + .../222_dict_key_control_characters.sdf | 13 +++++++++++++ .../baseline/222_dict_key_control_characters.sdf | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pxr/usd/sdf/testenv/testSdfParsing.testenv/222_dict_key_control_characters.sdf create mode 100644 pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/222_dict_key_control_characters.sdf diff --git a/pxr/usd/sdf/fileIO_Common.cpp b/pxr/usd/sdf/fileIO_Common.cpp index 34ea38261e..cc36f2ab33 100644 --- a/pxr/usd/sdf/fileIO_Common.cpp +++ b/pxr/usd/sdf/fileIO_Common.cpp @@ -839,7 +839,7 @@ Sdf_FileIOUtility::_WriteDictionary( // Put quotes around the keyName if it is not a valid identifier string keyName = *(i->first); if (!TfIsValidIdentifier(keyName)) { - keyName = "\"" + keyName + "\""; + keyName = Quote(keyName); } if (value.IsHolding()) { Write(out, multiLine ? indent+1 : 0, "dictionary %s = ", diff --git a/pxr/usd/sdf/testenv/testSdfParsing.py b/pxr/usd/sdf/testenv/testSdfParsing.py index 566ab4227c..97e6d32e5a 100644 --- a/pxr/usd/sdf/testenv/testSdfParsing.py +++ b/pxr/usd/sdf/testenv/testSdfParsing.py @@ -47,6 +47,7 @@ def test_Basic(self): # This will mean that your new test runs first and you can spot # failures much quicker. testFiles = ''' + 222_dict_key_control_characters.sdf 221_bad_spline_type.sdf 220_splines.sdf 219_utf8_bad_type_name.sdf diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/222_dict_key_control_characters.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/222_dict_key_control_characters.sdf new file mode 100644 index 0000000000..6e858aeef5 --- /dev/null +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/222_dict_key_control_characters.sdf @@ -0,0 +1,13 @@ +#sdf 1.4.32 + +def XForm "default" +{ + def Sphere "ball" ( + customData = { + int """jkj + """ = 15 + } + ) + { + } +} \ No newline at end of file diff --git a/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/222_dict_key_control_characters.sdf b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/222_dict_key_control_characters.sdf new file mode 100644 index 0000000000..d4a61fe105 --- /dev/null +++ b/pxr/usd/sdf/testenv/testSdfParsing.testenv/baseline/222_dict_key_control_characters.sdf @@ -0,0 +1,14 @@ +#sdf 1.4.32 + +def XForm "default" +{ + def Sphere "ball" ( + customData = { + int """jkj + """ = 15 + } + ) + { + } +} + From 90f32073759ad313c5e44c2e1663e1c835c7efba Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 3 Sep 2024 16:03:29 -0700 Subject: [PATCH 120/202] hdPrman support for using render settings in interactive mode. (Internal change: 2339333) --- .../plugin/hdPrman/renderParam.cpp | 49 ++++++++++++++++++- .../renderman-25/plugin/hdPrman/renderParam.h | 3 +- .../plugin/hdPrman/renderPass.cpp | 3 +- .../plugin/hdPrman/renderParam.cpp | 49 ++++++++++++++++++- .../renderman-26/plugin/hdPrman/renderParam.h | 3 +- .../plugin/hdPrman/renderPass.cpp | 3 +- 6 files changed, 104 insertions(+), 6 deletions(-) diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp index eebc7fec40..dedd5c7e86 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.cpp @@ -96,6 +96,17 @@ TF_DEFINE_ENV_SETTING(HD_PRMAN_DISABLE_HIDER_JITTER, false, TF_DEFINE_ENV_SETTING(HD_PRMAN_DEFER_SET_OPTIONS, true, "Defer first SetOptions call to render settings prim sync."); +// We now have two env setting related to driving hdPrman rendering using the +// render settings prim. HD_PRMAN_RENDER_SETTINGS_DRIVE_RENDER_PASS ignores the +// task's AOV bindings and creates the render view using solely the render +// settings' products; this is limited to batch (non-interactive) rendering. +// The new setting HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS creates the +// render view using both the task's AOV bindings and the render settings' +// products. The Hydra framebuffer is limited to displaying only the AOVs in +// the task bindings. This will be improved in a future change. +TF_DEFINE_ENV_SETTING(HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS, false, + "Add render settings outputs to interactive renders"); + extern TfEnvSetting HD_PRMAN_ENABLE_QUICKINTEGRATE; static bool _enableQuickIntegrate = @@ -3021,7 +3032,8 @@ _GetAsRtUString(const HdAovSettingsMap & m, const TfToken & key) void HdPrman_RenderParam::CreateFramebufferAndRenderViewFromAovs( - const HdRenderPassAovBindingVector& aovBindings) + const HdRenderPassAovBindingVector& aovBindings, + const HdPrman_RenderSettings* renderSettings) { if (!_framebuffer) { _framebuffer = std::make_unique(); @@ -3070,6 +3082,41 @@ HdPrman_RenderParam::CreateFramebufferAndRenderViewFromAovs( renderViewDesc.displayFilterList = GetDisplayFilterList(); renderViewDesc.resolution = GetResolution(); + if (TfGetEnvSetting(HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS) && + renderSettings) { + // Get the descriptors for the render settings products. + // N.B. this overrides the camera opinion on the product. That + // isn't the intent in case it becomes a problem. + auto rsrvd = + _ComputeRenderViewDesc(renderSettings->GetRenderProducts(), + renderViewDesc.cameraId, + renderViewDesc.integratorId, + renderViewDesc.sampleFilterList, + renderViewDesc.displayFilterList); + + // Adjust indices to account for the ones we already have. The + // entries in rsrvd.renderOutputIndices index into + // rsrvd.renderOutputDescs. Since we're moving the latter's + // entries to the end of renderViewDesc.renderOutputDescs we must + // adjust the indices to reflect their new positions. + const auto base = renderViewDesc.renderOutputDescs.size(); + for (auto& displayDesc: rsrvd.displayDescs) { + for (auto& index: displayDesc.renderOutputIndices) { + index += base; + } + } + + // Add to final lists. + renderViewDesc.renderOutputDescs.insert( + renderViewDesc.renderOutputDescs.end(), + std::make_move_iterator(rsrvd.renderOutputDescs.begin()), + std::make_move_iterator(rsrvd.renderOutputDescs.end())); + renderViewDesc.displayDescs.insert( + renderViewDesc.displayDescs.end(), + std::make_move_iterator(rsrvd.displayDescs.begin()), + std::make_move_iterator(rsrvd.displayDescs.end())); + } + TF_DEBUG(HDPRMAN_RENDER_PASS) .Msg("Create Riley RenderView from AOV bindings.\n"); GetRenderViewContext().CreateRenderView(renderViewDesc, riley); diff --git a/third_party/renderman-25/plugin/hdPrman/renderParam.h b/third_party/renderman-25/plugin/hdPrman/renderParam.h index 7dd43d4f06..7df5817853 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderParam.h +++ b/third_party/renderman-25/plugin/hdPrman/renderParam.h @@ -269,7 +269,8 @@ class HdPrman_RenderParam : public HdRenderParam // with HdPrmanFramebuffer to transfer the result between the // render thread and the hydra render buffers. void CreateFramebufferAndRenderViewFromAovs( - const HdRenderPassAovBindingVector& aovBindings); + const HdRenderPassAovBindingVector& aovBindings, + const HdPrman_RenderSettings* renderSettings); // Deletes HdPrmanFramebuffer (created with // CreateRenderViewFromAovs). Can be called if there is no frame diff --git a/third_party/renderman-25/plugin/hdPrman/renderPass.cpp b/third_party/renderman-25/plugin/hdPrman/renderPass.cpp index ec6f456ca9..433552cf5a 100644 --- a/third_party/renderman-25/plugin/hdPrman/renderPass.cpp +++ b/third_party/renderman-25/plugin/hdPrman/renderPass.cpp @@ -444,7 +444,8 @@ HdPrman_RenderPass::_Execute( // Use AOV-bindings to create render view with displays that // have drivers writing into the intermediate framebuffer blitted // to the AOVs. - _renderParam->CreateFramebufferAndRenderViewFromAovs(aovBindings); + _renderParam->CreateFramebufferAndRenderViewFromAovs(aovBindings, + rsPrim); } HdPrman_RenderViewContext &rvCtx = _renderParam->GetRenderViewContext(); diff --git a/third_party/renderman-26/plugin/hdPrman/renderParam.cpp b/third_party/renderman-26/plugin/hdPrman/renderParam.cpp index eebc7fec40..dedd5c7e86 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderParam.cpp +++ b/third_party/renderman-26/plugin/hdPrman/renderParam.cpp @@ -96,6 +96,17 @@ TF_DEFINE_ENV_SETTING(HD_PRMAN_DISABLE_HIDER_JITTER, false, TF_DEFINE_ENV_SETTING(HD_PRMAN_DEFER_SET_OPTIONS, true, "Defer first SetOptions call to render settings prim sync."); +// We now have two env setting related to driving hdPrman rendering using the +// render settings prim. HD_PRMAN_RENDER_SETTINGS_DRIVE_RENDER_PASS ignores the +// task's AOV bindings and creates the render view using solely the render +// settings' products; this is limited to batch (non-interactive) rendering. +// The new setting HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS creates the +// render view using both the task's AOV bindings and the render settings' +// products. The Hydra framebuffer is limited to displaying only the AOVs in +// the task bindings. This will be improved in a future change. +TF_DEFINE_ENV_SETTING(HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS, false, + "Add render settings outputs to interactive renders"); + extern TfEnvSetting HD_PRMAN_ENABLE_QUICKINTEGRATE; static bool _enableQuickIntegrate = @@ -3021,7 +3032,8 @@ _GetAsRtUString(const HdAovSettingsMap & m, const TfToken & key) void HdPrman_RenderParam::CreateFramebufferAndRenderViewFromAovs( - const HdRenderPassAovBindingVector& aovBindings) + const HdRenderPassAovBindingVector& aovBindings, + const HdPrman_RenderSettings* renderSettings) { if (!_framebuffer) { _framebuffer = std::make_unique(); @@ -3070,6 +3082,41 @@ HdPrman_RenderParam::CreateFramebufferAndRenderViewFromAovs( renderViewDesc.displayFilterList = GetDisplayFilterList(); renderViewDesc.resolution = GetResolution(); + if (TfGetEnvSetting(HD_PRMAN_INTERACTIVE_RENDER_WITH_RENDER_SETTINGS) && + renderSettings) { + // Get the descriptors for the render settings products. + // N.B. this overrides the camera opinion on the product. That + // isn't the intent in case it becomes a problem. + auto rsrvd = + _ComputeRenderViewDesc(renderSettings->GetRenderProducts(), + renderViewDesc.cameraId, + renderViewDesc.integratorId, + renderViewDesc.sampleFilterList, + renderViewDesc.displayFilterList); + + // Adjust indices to account for the ones we already have. The + // entries in rsrvd.renderOutputIndices index into + // rsrvd.renderOutputDescs. Since we're moving the latter's + // entries to the end of renderViewDesc.renderOutputDescs we must + // adjust the indices to reflect their new positions. + const auto base = renderViewDesc.renderOutputDescs.size(); + for (auto& displayDesc: rsrvd.displayDescs) { + for (auto& index: displayDesc.renderOutputIndices) { + index += base; + } + } + + // Add to final lists. + renderViewDesc.renderOutputDescs.insert( + renderViewDesc.renderOutputDescs.end(), + std::make_move_iterator(rsrvd.renderOutputDescs.begin()), + std::make_move_iterator(rsrvd.renderOutputDescs.end())); + renderViewDesc.displayDescs.insert( + renderViewDesc.displayDescs.end(), + std::make_move_iterator(rsrvd.displayDescs.begin()), + std::make_move_iterator(rsrvd.displayDescs.end())); + } + TF_DEBUG(HDPRMAN_RENDER_PASS) .Msg("Create Riley RenderView from AOV bindings.\n"); GetRenderViewContext().CreateRenderView(renderViewDesc, riley); diff --git a/third_party/renderman-26/plugin/hdPrman/renderParam.h b/third_party/renderman-26/plugin/hdPrman/renderParam.h index 7dd43d4f06..7df5817853 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderParam.h +++ b/third_party/renderman-26/plugin/hdPrman/renderParam.h @@ -269,7 +269,8 @@ class HdPrman_RenderParam : public HdRenderParam // with HdPrmanFramebuffer to transfer the result between the // render thread and the hydra render buffers. void CreateFramebufferAndRenderViewFromAovs( - const HdRenderPassAovBindingVector& aovBindings); + const HdRenderPassAovBindingVector& aovBindings, + const HdPrman_RenderSettings* renderSettings); // Deletes HdPrmanFramebuffer (created with // CreateRenderViewFromAovs). Can be called if there is no frame diff --git a/third_party/renderman-26/plugin/hdPrman/renderPass.cpp b/third_party/renderman-26/plugin/hdPrman/renderPass.cpp index ec6f456ca9..433552cf5a 100644 --- a/third_party/renderman-26/plugin/hdPrman/renderPass.cpp +++ b/third_party/renderman-26/plugin/hdPrman/renderPass.cpp @@ -444,7 +444,8 @@ HdPrman_RenderPass::_Execute( // Use AOV-bindings to create render view with displays that // have drivers writing into the intermediate framebuffer blitted // to the AOVs. - _renderParam->CreateFramebufferAndRenderViewFromAovs(aovBindings); + _renderParam->CreateFramebufferAndRenderViewFromAovs(aovBindings, + rsPrim); } HdPrman_RenderViewContext &rvCtx = _renderParam->GetRenderViewContext(); From 45e8168df5e0cf9b2559fc71f6a3788ffcd54e8b Mon Sep 17 00:00:00 2001 From: ohjay Date: Tue, 3 Sep 2024 16:09:29 -0700 Subject: [PATCH 121/202] Add AOV light USD imaging adapter. This is necessary for the AOV light USD prim to be transported to Hydra as expected (e.g. with a nonempty prim type). (Internal change: 2339351) --- pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt | 1 + pxr/usdImaging/usdRiPxrImaging/plugInfo.json | 7 ++ .../usdRiPxrImaging/pxrAovLightAdapter.cpp | 65 +++++++++++++++++++ .../usdRiPxrImaging/pxrAovLightAdapter.h | 65 +++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.cpp create mode 100644 pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.h diff --git a/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt b/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt index 16478b37aa..2b978360db 100644 --- a/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt +++ b/pxr/usdImaging/usdRiPxrImaging/CMakeLists.txt @@ -25,6 +25,7 @@ pxr_library(usdRiPxrImaging ${TBB_INCLUDE_DIRS} PUBLIC_CLASSES + pxrAovLightAdapter pxrCameraAPIAdapter pxrDisplayFilterAdapter pxrIntegratorAdapter diff --git a/pxr/usdImaging/usdRiPxrImaging/plugInfo.json b/pxr/usdImaging/usdRiPxrImaging/plugInfo.json index fa0cb5d88f..c5d2afba6e 100644 --- a/pxr/usdImaging/usdRiPxrImaging/plugInfo.json +++ b/pxr/usdImaging/usdRiPxrImaging/plugInfo.json @@ -3,6 +3,13 @@ { "Info": { "Types": { + "UsdRiPxrImagingAovLightAdapter": { + "bases": [ + "UsdImagingLightAdapter" + ], + "isInternal": true, + "primTypeName": "PxrAovLight" + }, "UsdRiPxrImagingDisplayFilterAdapter": { "bases": [ "UsdImagingPrimAdapter" diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.cpp b/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.cpp new file mode 100644 index 0000000000..d4fee02b2a --- /dev/null +++ b/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.cpp @@ -0,0 +1,65 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.h" +#include "pxr/usdImaging/usdImaging/indexProxy.h" + +#include "pxr/imaging/hd/tokens.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_REGISTRY_FUNCTION(TfType) +{ + using Adapter = UsdRiPxrImagingAovLightAdapter; + TfType t = TfType::Define>(); + t.SetFactory>(); +} + +UsdRiPxrImagingAovLightAdapter::~UsdRiPxrImagingAovLightAdapter() = default; + +TfTokenVector +UsdRiPxrImagingAovLightAdapter::GetImagingSubprims(UsdPrim const& prim) +{ + return { TfToken() }; +} + +TfToken +UsdRiPxrImagingAovLightAdapter::GetImagingSubprimType( + UsdPrim const& prim, + TfToken const& subprim) +{ + if (subprim.IsEmpty()) { + return HdPrimTypeTokens->light; + } + + return TfToken(); +} + +bool +UsdRiPxrImagingAovLightAdapter::IsSupported(UsdImagingIndexProxy const* index) const +{ + return UsdImagingLightAdapter::IsEnabledSceneLights() && + index->IsSprimTypeSupported(HdPrimTypeTokens->light); +} + +SdfPath +UsdRiPxrImagingAovLightAdapter::Populate( + UsdPrim const& prim, + UsdImagingIndexProxy* index, + UsdImagingInstancerContext const* instancerContext) +{ + return _AddSprim(HdPrimTypeTokens->light, prim, index, instancerContext); +} + +void +UsdRiPxrImagingAovLightAdapter::_RemovePrim( + SdfPath const& cachePath, + UsdImagingIndexProxy* index) +{ + _RemoveSprim(HdPrimTypeTokens->light, cachePath, index); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.h b/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.h new file mode 100644 index 0000000000..9f0156d0a1 --- /dev/null +++ b/pxr/usdImaging/usdRiPxrImaging/pxrAovLightAdapter.h @@ -0,0 +1,65 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_AOV_LIGHT_ADAPTER_H +#define PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_AOV_LIGHT_ADAPTER_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/usdImaging/usdRiPxrImaging/api.h" +#include "pxr/usdImaging/usdImaging/lightAdapter.h" + +PXR_NAMESPACE_OPEN_SCOPE + +class UsdPrim; + +/// \class UsdRiPxrImagingAovLightAdapter +/// +/// Adapter class for lights of type PxrAovLight. +/// +class UsdRiPxrImagingAovLightAdapter : public UsdImagingLightAdapter +{ +public: + using BaseAdapter = UsdImagingLightAdapter; + + UsdRiPxrImagingAovLightAdapter() + : UsdImagingLightAdapter() + {} + + USDRIPXRIMAGING_API + virtual ~UsdRiPxrImagingAovLightAdapter(); + + // ---------------------------------------------------------------------- // + /// \name Scene Index Support + // ---------------------------------------------------------------------- // + + USDRIPXRIMAGING_API + TfTokenVector GetImagingSubprims(UsdPrim const& prim) override; + + USDRIPXRIMAGING_API + TfToken GetImagingSubprimType(UsdPrim const& prim, + TfToken const& subprim) override; + + // ---------------------------------------------------------------------- // + + USDRIPXRIMAGING_API + SdfPath Populate( + UsdPrim const& prim, + UsdImagingIndexProxy* index, + UsdImagingInstancerContext const* instancerContext = NULL) override; + + USDRIPXRIMAGING_API + bool IsSupported(UsdImagingIndexProxy const* index) const override; + +protected: + void _RemovePrim(SdfPath const& cachePath, + UsdImagingIndexProxy* index) override final; +}; + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_USD_IMAGING_USD_RI_PXR_IMAGING_PXR_AOV_LIGHT_ADAPTER_H From b3c064b29243fbf3ae21e3e24b493a4989de75e6 Mon Sep 17 00:00:00 2001 From: tallytalwar Date: Tue, 3 Sep 2024 16:18:54 -0700 Subject: [PATCH 122/202] Cleanup tutorials mention of View -> Display (Internal change: 2339359) --- docs/tut_helloworld.rst | 2 +- docs/tut_usdview_plugin.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tut_helloworld.rst b/docs/tut_helloworld.rst index aba9a314b5..2576a1e0c3 100644 --- a/docs/tut_helloworld.rst +++ b/docs/tut_helloworld.rst @@ -45,7 +45,7 @@ Use :ref:`toolset:usdview` to visualize and inspect the stage. .. image:: http://openusd.org/images/tut_helloworld_sphere_1.png -#. You can refine the geometry with the :menuselection:`View --> Complexity` +#. You can refine the geometry with the :menuselection:`Display --> Complexity` menu item or use the hotkeys :kbd:`Ctrl-+` and :kbd:`Ctrl--` to increase or decrease the refinement. diff --git a/docs/tut_usdview_plugin.rst b/docs/tut_usdview_plugin.rst index e552738b10..8b62eeeaf7 100644 --- a/docs/tut_usdview_plugin.rst +++ b/docs/tut_usdview_plugin.rst @@ -135,7 +135,7 @@ the Interpreter window in :program:`usdview` * :python:`viewSettings` - A collection of settings which only affect the viewport. Most of these settings are normally controlled using - usdview's 'View' menu. Some examples are listed below. + usdview's 'Display' menu. Some examples are listed below. * :python:`complexity` - The scene's subdivision complexity. From 599c931a5f480234fc93d18cbb987e5348093e18 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Tue, 3 Sep 2024 16:19:03 -0700 Subject: [PATCH 123/202] Fix broken Hydra doc link (Internal change: 2339371) --- pxr/imaging/hd/overview.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/imaging/hd/overview.dox b/pxr/imaging/hd/overview.dox index 5d2d04bc60..e700c628c9 100644 --- a/pxr/imaging/hd/overview.dox +++ b/pxr/imaging/hd/overview.dox @@ -7,6 +7,6 @@ Hd is a framework that enables the communication between multiple scene graphs and multiple renderers. -See also: \ref Developer_Guides_Hydra +See also: \ref Developer_Guides */ From c40020ad616a16707785a1c056f699f8adb08050 Mon Sep 17 00:00:00 2001 From: florianz Date: Thu, 5 Sep 2024 22:41:25 -0700 Subject: [PATCH 124/202] Open source WorkParallelSort. (Internal change: 2339491) (Internal change: 2339580) --- pxr/base/work/CMakeLists.txt | 10 ++++ pxr/base/work/sort.h | 52 +++++++++++++++++ pxr/base/work/testenv/testWorkSort.cpp | 78 ++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 pxr/base/work/sort.h create mode 100644 pxr/base/work/testenv/testWorkSort.cpp diff --git a/pxr/base/work/CMakeLists.txt b/pxr/base/work/CMakeLists.txt index f15ad1542f..0f1052db4f 100644 --- a/pxr/base/work/CMakeLists.txt +++ b/pxr/base/work/CMakeLists.txt @@ -21,6 +21,7 @@ pxr_library(work PUBLIC_HEADERS api.h + sort.h withScopedParallelism.h PYTHON_CPPFILES @@ -54,6 +55,12 @@ pxr_build_test(testWorkReduce work CPPFILES testenv/testWorkReduce.cpp +) +pxr_build_test(testWorkSort + LIBRARIES + work + CPPFILES + testenv/testWorkSort.cpp ) pxr_build_test(testWorkThreadLimits LIBRARIES @@ -70,6 +77,9 @@ pxr_register_test(testWorkLoops pxr_register_test(testWorkReduce COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testWorkReduce" ) +pxr_register_test(testWorkSort + COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testWorkSort" +) pxr_register_test(testWorkThreadLimitsDefault COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testWorkThreadLimits" ) diff --git a/pxr/base/work/sort.h b/pxr/base/work/sort.h new file mode 100644 index 0000000000..0198146909 --- /dev/null +++ b/pxr/base/work/sort.h @@ -0,0 +1,52 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_BASE_WORK_SORT_H +#define PXR_BASE_WORK_SORT_H + +/// \file + +#include "pxr/pxr.h" +#include "pxr/base/work/threadLimits.h" + +#include +#include + +PXR_NAMESPACE_OPEN_SCOPE + +/// Sorts in-place a container that provides begin() and end() methods +/// +template +void +WorkParallelSort(C* container) +{ + // Don't bother with parallel_for, if concurrency is limited to 1. + if (WorkHasConcurrency()) { + tbb::parallel_sort(container->begin(), container->end()); + }else{ + std::sort(container->begin(), container->end()); + } +} + + +/// Sorts in-place a container that provides begin() and end() methods, +/// using a custom comparison functor. +/// +template +void +WorkParallelSort(C* container, const Compare& comp) +{ + // Don't bother with parallel_for, if concurrency is limited to 1. + if (WorkHasConcurrency()) { + tbb::parallel_sort(container->begin(), container->end(), comp); + }else{ + std::sort(container->begin(), container->end(), comp); + } +} + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif diff --git a/pxr/base/work/testenv/testWorkSort.cpp b/pxr/base/work/testenv/testWorkSort.cpp new file mode 100644 index 0000000000..6230964089 --- /dev/null +++ b/pxr/base/work/testenv/testWorkSort.cpp @@ -0,0 +1,78 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// + +#include "pxr/pxr.h" + +#include "pxr/base/work/sort.h" +#include "pxr/base/work/threadLimits.h" + +#include "pxr/base/arch/fileSystem.h" +#include "pxr/base/tf/diagnostic.h" +#include "pxr/base/tf/stopwatch.h" + +#include +#include +#include +#include + +PXR_NAMESPACE_USING_DIRECTIVE + +static void +_PopulateVector(size_t arraySize, std::vector* v) +{ + std::srand(std::time(NULL)); + v->clear(); + v->reserve(arraySize); + for (size_t i = 0; i < arraySize; ++i) { + v->push_back(std::rand()); + } +} + +// Returns the number of seconds it took to complete this operation. +double +_DoTBBTest(const size_t arraySize, const size_t numIterations) +{ + std::vector v; + _PopulateVector(arraySize, &v); + std::vector save = v; + + TfStopwatch sw; + sw.Start(); + std::vector filterv; + for (size_t i = 0; i < numIterations; i++) { + v = save; + WorkParallelSort(&v); + } + + TF_AXIOM(numIterations == 1); + for(unsigned int i = 1; i < v.size(); ++i){ + TF_AXIOM(v[i-1] <= v[i]); + } + + sw.Stop(); + return sw.GetSeconds(); +} + + +int +main(int argc, char **argv) +{ + const size_t arraySize = 1000000; + const size_t numIterations = 1; + + WorkSetMaximumConcurrencyLimit(); + + std::cout << "Initialized with " << + WorkGetPhysicalConcurrencyLimit() << " cores..." << std::endl; + + const double tbbSeconds = _DoTBBTest(arraySize, numIterations); + + std::cout << "TBB parallel_sort.h took: " << tbbSeconds << " seconds" + << std::endl; + + return 0; +} From 2761d5aefefec8c2c759c048583b75ef836ce259 Mon Sep 17 00:00:00 2001 From: pixar-oss Date: Thu, 5 Sep 2024 22:42:08 -0700 Subject: [PATCH 125/202] Add SIGGRAPH 2024 BoF PDF to docs (Internal change: 2339537) --- docs/dl_downloads.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/dl_downloads.rst b/docs/dl_downloads.rst index 26ce384d47..948b0470d6 100644 --- a/docs/dl_downloads.rst +++ b/docs/dl_downloads.rst @@ -4,6 +4,11 @@ Downloads and Videos ==================== +SIGGRAPH 2024 Notes +=================== + +| `SIGGRAPH 2024 USD, Hydra, and OpenSubdiv Birds of a Feather Notes `__ + SIGGRAPH 2023 Notes =================== From 06f540dff84a1f378589e4bc62956900781a7a23 Mon Sep 17 00:00:00 2001 From: cvj Date: Thu, 5 Sep 2024 22:44:10 -0700 Subject: [PATCH 126/202] Ensure we get roughly equal brightness for any lights used by Storm regardless of the material model used (fallback, UsdPreviewSurface, HydraPbsSurface). - HydraPbsSurface should apply the Lambertian BRDF for diffuse colors like UsdPreviewSurface does. - Simple and camera lights should scale their diffuse and specular colors up to get the expected brightness levels with physically-based materials. - Non-physically-based materials should scale the diffuse and specular components of lights down like the physically-based materials to ensure similar brightness levels for all light types. (Internal change: 2339566) --- pxr/imaging/glf/shaders/simpleLighting.glslfx | 6 ++-- pxr/imaging/hdSt/light.cpp | 31 +++++++++++++++++- pxr/imaging/hdSt/light.h | 5 ++- .../baseline/start.png | Bin 126346 -> 149705 bytes .../baseline/step_1.png | Bin 126645 -> 149987 bytes .../baseline/step_2.png | Bin 130043 -> 153705 bytes .../baseline/allVisible.png | Bin 14780 -> 15133 bytes .../baseline/singleInvisible1.png | Bin 9332 -> 9651 bytes .../baseline/singleInvisible2.png | Bin 9702 -> 9567 bytes .../baseline/visible.png | Bin 23300 -> 17944 bytes .../testUsdviewLights/baseline/bothLights.png | Bin 195096 -> 193100 bytes .../baseline/bothLightsYup.png | Bin 200257 -> 199641 bytes .../testUsdviewLights/baseline/camera.png | Bin 27172 -> 29344 bytes .../testUsdviewMaterialEdits/baseline/1.png | Bin 26253 -> 31269 bytes .../testUsdviewMaterialEdits/baseline/2.png | Bin 26382 -> 31696 bytes .../testUsdviewMaterialEdits/baseline/3.png | Bin 26253 -> 31269 bytes .../baseline/variantA.png | Bin 9825 -> 12831 bytes .../baseline/variantB.png | Bin 9825 -> 12831 bytes .../baseline/add_fallback_primvar_flat.png | Bin 26385 -> 31700 bytes .../baseline/add_fallback_primvar_smooth.png | Bin 17804 -> 23366 bytes .../baseline/add_unused_primvars.png | Bin 17624 -> 23075 bytes .../baseline/remove_fallback_primvar_flat.png | Bin 26216 -> 31277 bytes .../remove_fallback_primvar_wireOnSurf.png | Bin 17839 -> 23256 bytes .../baseline/remove_unused_primvars.png | Bin 17624 -> 23075 bytes .../baseline/start.png | Bin 17624 -> 23075 bytes .../baseline/camera_scene_GL.png | Bin 7612 -> 7374 bytes .../baseline/domeInvis_scene_GL.png | Bin 8056 -> 7658 bytes .../baseline/domeVis_scene_GL.png | Bin 175356 -> 174980 bytes .../baseline/sceneLights_GL.png | Bin 7204 -> 6539 bytes .../baseline/sceneLights_edit_GL.png | Bin 5060 -> 4646 bytes .../RecordTest/baseline/AnimCube.1.png | Bin 27504 -> 28353 bytes .../RecordTest/baseline/AnimCube.10.png | Bin 29272 -> 30167 bytes .../RecordTest/baseline/AnimCube.5.png | Bin 28199 -> 29081 bytes .../baseline/AnimCube_overrides.1.png | Bin 30221 -> 32181 bytes .../FrameRecorderTest/baseline/AnimCube.1.png | Bin 27504 -> 28353 bytes .../baseline/AnimCube.10.png | Bin 29272 -> 30167 bytes .../FrameRecorderTest/baseline/AnimCube.5.png | Bin 28199 -> 29081 bytes .../testUsdImagingGLAnimatedLights_001.png | Bin 41725 -> 45758 bytes .../testUsdImagingGLAnimatedLights_002.png | Bin 46986 -> 47163 bytes .../testUsdImagingGLAnimatedLights_003.png | Bin 41562 -> 45574 bytes ...ingGLBasicDrawing_transparentGrayscale.png | Bin 14037 -> 16126 bytes .../baseline/testAnim_001.png | Bin 103034 -> 159017 bytes .../baseline/testAnim_002.png | Bin 510105 -> 750236 bytes .../baseline/testCards.png | Bin 24306 -> 26865 bytes .../baseline/testCardsBasic.png | Bin 157679 -> 217878 bytes ...ngGLFaceVaryingLeftHanded_Adaptive_Low.png | Bin 120052 -> 141566 bytes ...ingGLFaceVaryingLeftHanded_Uniform_Low.png | Bin 98951 -> 119912 bytes ...ngGLFaceVaryingLeftHanded_Uniform_None.png | Bin 83790 -> 102522 bytes ...GLFaceVaryingLinearInterp_Adaptive_Low.png | Bin 133358 -> 167445 bytes ...aceVaryingLinearInterp_Adaptive_Medium.png | Bin 129056 -> 163180 bytes ...gGLFaceVaryingLinearInterp_Uniform_Low.png | Bin 113445 -> 145372 bytes ...FaceVaryingLinearInterp_Uniform_Medium.png | Bin 126660 -> 161913 bytes ...stUsdImagingGLFaceVarying_Adaptive_Low.png | Bin 123261 -> 155705 bytes ...sdImagingGLFaceVarying_Adaptive_Medium.png | Bin 123161 -> 155830 bytes ...estUsdImagingGLFaceVarying_Uniform_Low.png | Bin 68659 -> 87213 bytes ...UsdImagingGLFaceVarying_Uniform_Medium.png | Bin 83601 -> 110887 bytes .../baseline/testUsdImagingGLFraming1.png | Bin 13527 -> 13982 bytes .../baseline/testUsdImagingGLFraming3.png | Bin 13834 -> 14668 bytes .../baseline/testUsdImagingGLFraming4.png | Bin 14097 -> 14896 bytes .../baseline/testUsdImagingGLFraming5.png | Bin 13551 -> 14187 bytes .../testUsdImagingGLGeomSubsets_Adaptive.png | Bin 82891 -> 95597 bytes .../testUsdImagingGLGeomSubsets_High.png | Bin 81548 -> 93699 bytes .../testUsdImagingGLGeomSubsets_Low.png | Bin 57383 -> 66312 bytes .../testUsdImagingGLGeomSubsets_Medium.png | Bin 70439 -> 81246 bytes ...UsdImagingGLGeomSubsets_Quadrangulated.png | Bin 57403 -> 66387 bytes .../testUsdImagingGLGeomSubsets_VeryHigh.png | Bin 82169 -> 95347 bytes ...tUsdImagingGLInstancePrimvarsFiltering.png | Bin 33596 -> 45064 bytes ...tUsdImagingGLInstancing_instancedCubes.png | Bin 19432 -> 19910 bytes ...agingGLInstancing_nestedInstancedCubes.png | Bin 17978 -> 18711 bytes ...ances_per_instance_overrides_noshading.png | Bin 18393 -> 20455 bytes ...cingWithMaterials_ni_2instances_shaded.png | Bin 18103 -> 19879 bytes ...terials_ni_2instances_shaded_overrides.png | Bin 18103 -> 19879 bytes .../baseline/bindingStrength.png | Bin 26567 -> 31957 bytes .../baseline/mxDirectLightsCameraLight.png | Bin 65010 -> 70013 bytes .../baseline/testUsdImagingGLMipmap_003.png | Bin 19050 -> 21596 bytes .../baseline/testUsdImagingGLMipmap_006.png | Bin 15049 -> 16117 bytes .../baseline/testUsdImagingGLMipmap_010.png | Bin 38820 -> 46943 bytes .../baseline/testUsdImagingGLMipmap_014.png | Bin 24480 -> 27205 bytes .../baseline/testUsdImagingGLMipmap_017.png | Bin 14669 -> 14898 bytes .../baseline/pi_ni_material.png | Bin 15002 -> 19932 bytes .../baseline/pi_ni_material2.png | Bin 35220 -> 45027 bytes .../baseline/testPremultiplyAlpha.png | Bin 12988 -> 13048 bytes .../baseline/testPremultiplyAlphaUdims.png | Bin 18110 -> 18023 bytes .../testPreviewSurfaceAnimated_001.png | Bin 127635 -> 167801 bytes .../testPreviewSurfaceAnimated_002.png | Bin 127962 -> 167821 bytes .../testPreviewSurfaceAnimated_003.png | Bin 129427 -> 169444 bytes .../testPreviewSurfaceAnimated_004.png | Bin 95572 -> 128065 bytes .../testPreviewSurfaceConnectedScalar.png | Bin 21635 -> 25377 bytes .../testPreviewSurfaceDisplacement.png | Bin 167959 -> 236804 bytes .../baseline/testPreviewSurfaceFallback.png | Bin 63326 -> 80021 bytes .../testPreviewSurfaceFallbackPrimvar.png | Bin 12741 -> 13210 bytes .../testPreviewSurfaceFallbackTexture.png | Bin 12741 -> 13210 bytes .../testPreviewSurfaceInstancedMaterial.png | Bin 17907 -> 20358 bytes .../testPreviewSurfaceMaterialInterface.png | Bin 30705 -> 36588 bytes .../baseline/testPreviewSurfaceNormalMap.png | Bin 35132 -> 44008 bytes .../testPreviewSurfaceOpacityThreshold.png | Bin 16093 -> 16360 bytes .../testPreviewSurfacePrimvarFallback.png | Bin 12903 -> 13667 bytes ...testPreviewSurfacePrimvarReaderOpacity.png | Bin 16601 -> 18363 bytes .../baseline/testPreviewSurfacePrimvars.png | Bin 66451 -> 84843 bytes .../testPreviewSurfaceSourceColorSpace.png | Bin 26969 -> 49409 bytes .../baseline/testPreviewSurfaceSpecular.png | Bin 18357 -> 19879 bytes .../baseline/testPreviewSurfaceTexture.png | Bin 127635 -> 167801 bytes .../testPreviewSurfaceTextureFallback.png | Bin 12903 -> 13667 bytes .../testPreviewSurfaceTextureNoFile.png | Bin 12903 -> 13667 bytes .../testPreviewSurfaceTextureOpacity.png | Bin 15630 -> 18074 bytes .../testPreviewSurfaceTextureScaleAndBias.png | Bin 152489 -> 211541 bytes .../testPreviewSurfaceTextureWithToken.png | Bin 12903 -> 13667 bytes .../testPreviewSurfaceTransform2d.png | Bin 160393 -> 206198 bytes .../testPreviewSurfaceTranslucent.png | Bin 17359 -> 19424 bytes .../testUsdImagingGLShadingPrimvars.png | Bin 25885 -> 30671 bytes .../testUsdImagingGLSimpleVolumeGlow.png | Bin 61756 -> 68779 bytes .../testUsdImagingGLSimpleVolumes.png | Bin 196574 -> 206428 bytes .../baseline/usdLux.png | Bin 15816 -> 14809 bytes .../baseline/usdUdims.png | Bin 63144 -> 79305 bytes .../baseline/usdUdimsScaleAndBias.png | Bin 54947 -> 66127 bytes .../baseline/usdUdimsSymlinked.png | Bin 63144 -> 79305 bytes .../baseline/usdUdimsTextureFallback.png | Bin 12781 -> 12789 bytes .../baseline/usdUdimsUsdz.png | Bin 63144 -> 79305 bytes .../baseline/testUsdImagingGLVdbVolume.png | Bin 111905 -> 115293 bytes ...magingGLVdbVolumeDisableSceneMaterials.png | Bin 85662 -> 87399 bytes ...ImagingGLVdbVolumeFallbackMaterial_002.png | Bin 110207 -> 113901 bytes ...ImagingGLVdbVolumeFallbackMaterial_003.png | Bin 130312 -> 134805 bytes .../testUsdImagingGLVdbVolumeFlipped.png | Bin 111983 -> 115973 bytes .../testUsdImagingGLVdbVolumeInside_001.png | Bin 261591 -> 267228 bytes .../testUsdImagingGLVdbVolumeInside_013.png | Bin 78175 -> 80084 bytes .../testUsdImagingGLVdbVolumeLarge.png | Bin 111905 -> 115294 bytes .../testUsdImagingGLVdbVolumeOrtho.png | Bin 127661 -> 131723 bytes ...tUsdImagingGLVdbVolumeTargetMemory_002.png | Bin 70157 -> 72374 bytes .../testUsdImagingGLVdbVolumeTwoFields.png | Bin 84942 -> 86191 bytes .../testUsdImagingGLVolumeMaterial.png | Bin 98628 -> 102787 bytes 130 files changed, 38 insertions(+), 4 deletions(-) diff --git a/pxr/imaging/glf/shaders/simpleLighting.glslfx b/pxr/imaging/glf/shaders/simpleLighting.glslfx index aea52730b4..1431719644 100644 --- a/pxr/imaging/glf/shaders/simpleLighting.glslfx +++ b/pxr/imaging/glf/shaders/simpleLighting.glslfx @@ -446,9 +446,11 @@ integrateLightsDefault(vec4 Peye, vec3 Neye, LightingInterfaceProperties props) #else float shadow = 1.0; #endif + + const float PI = 3.1415; result.ambient += atten * light.ambient.rgb; - result.diffuse += atten * shadow * d * light.diffuse.rgb; - result.specular += atten * shadow * s * light.specular.rgb; + result.diffuse += atten * shadow * d * light.diffuse.rgb / PI; + result.specular += atten * shadow * s * light.specular.rgb / PI; } } diff --git a/pxr/imaging/hdSt/light.cpp b/pxr/imaging/hdSt/light.cpp index 4aa67c9600..04ec7bddd0 100644 --- a/pxr/imaging/hdSt/light.cpp +++ b/pxr/imaging/hdSt/light.cpp @@ -337,6 +337,35 @@ HdStLight::_PrepareDomeLight( return l; } +static +GfVec4f +_ScaleColor( + const GfVec4f& color) +{ + return GfVec4f(M_PI * color[0], M_PI * color[1], M_PI * color[2], 1.0f); +} + +GlfSimpleLight +HdStLight::_PrepareSimpleLight( + SdfPath const &id, + HdSceneDelegate * const sceneDelegate) +{ + const VtValue v = sceneDelegate->Get(id, HdLightTokens->params); + if (!TF_VERIFY(v.IsHolding())) { + return GlfSimpleLight(); + } + + // We assume that the color specified for these "simple" lights means that + // it is the expected color a white Lambertian surface would have if one of + // these colored "simple" lights was pointed directly at it. To achieve + // this, the light color needs to be scaled appropriately. + GlfSimpleLight l = v.Get(); + l.SetDiffuse(_ScaleColor(l.GetDiffuse())); + l.SetSpecular(_ScaleColor(l.GetSpecular())); + + return l; +} + /* virtual */ void HdStLight::Sync(HdSceneDelegate *sceneDelegate, @@ -383,7 +412,7 @@ HdStLight::Sync(HdSceneDelegate *sceneDelegate, if (_lightType == HdPrimTypeTokens->simpleLight) { _params[HdLightTokens->params] = - sceneDelegate->Get(id, HdLightTokens->params); + _PrepareSimpleLight(id, sceneDelegate); } else if (_lightType == HdPrimTypeTokens->domeLight) { _params[HdLightTokens->params] = diff --git a/pxr/imaging/hdSt/light.h b/pxr/imaging/hdSt/light.h index 004a5e302d..c1e70ab0b0 100644 --- a/pxr/imaging/hdSt/light.h +++ b/pxr/imaging/hdSt/light.h @@ -65,7 +65,10 @@ class HdStLight final : public HdLight { // the different textures needed for IBL. GlfSimpleLight _PrepareDomeLight(SdfPath const &id, HdSceneDelegate *sceneDelegate); - + + GlfSimpleLight _PrepareSimpleLight(SdfPath const &id, + HdSceneDelegate *sceneDelegate); + private: // Stores the internal light type of this light. TfToken _lightType; diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/baseline/start.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/baseline/start.png index f4b6e0376648d98f0c4f5fd9d6aa33cba7f5fd10..7dc34f0eb45293aa52177794f9e6c2fffa860b16 100644 GIT binary patch literal 149705 zcmV)7K*zs{P)g}%VnLESbXee?h zlVrxx3r)s1J?dxaMK5}hjmbaFnk z-@h&W?f+@~KVJev`+srW57Gn>0HSk%nGa-Ih$cj5%}TKotABO!M}K6k zq@7(12IzL_=~Fh0bTfP($H&xaq1|Sgsn^$J+c-L6CA|{CvT%H?92{`1mM(+{r>CSS zc=AN5Wi+D8OM3d0OQm$4Ai&9qQmyj#b_#=SD}VZ@l|TPh{mqA=`9GVYB+@N$h~5(K zF*l@^&;=m`AIcfVM5n~>F_$Gg3_2kc!8>vxeZm0zlu?jyxS$h42i%eixg>btBL)F0 zT;;zgAN^m27r(~;I<<~GPbTDqr~vG7ik9fskm!c!sSuJ%1RppdY5*O%kQ*WkIATs# zqInXV=q=F`=6Xy>LfknKfG25MA{rB208g1yd!mAOSOt{H=7)(2Ytxv8QQgNd?5QH*Vk zsQXZMC0#ttET4B|%s&L82Y-PZs9nCb*&C(U#rB5Ftz4 z`9erQ!9sGXkN`paW}H(%WLpwa$lzOsw09v$L|P(K6PCmzhmhu%00FR^0f3lUMDgs< zG6Mr5Q%E@fKRpN|3UdfyfMaH?7Ro|Ps*u@DArJ&<&*x78gyEv1tw;&M3?ZZpkq~AC z0c7i6qO>cPEagZDQWOpXnNyFOn%-6;;X74lBFJRK;fKi zo}EPdA|_&DX2@R+1PFu>tVo91c`8wMeV;Gj2q8CwD5{7V*qqsgz{)9%CR5{(s(ioGL;f;=Jq1zn73EU}n<@`pT}(o~i!pL_vvMrSkeD^>^y z26w4Dz+g3b#P7l-kVn$>V@i13`wQ+;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qXryEtXvgga|xtX7o=Vh0D7vT2#j9>M)SN~)0_3zpQzH)lf>V0Zo z>pGkDqTu(^P8S`%>JXr(=lCoGce{D0)=YMv#U=CFq`8PU{Tc1_={cQ;?0Qm;|HJt0 ze{cP~EpoHt7=3XitlvHRdl_2W$kN@P!(I72lbH2#@RckZI$5T5(gx~YW$gvN>?m{* zF0Z16F0;e;3XI<=J5Z0v^`%#S7h!e6B&91bTgPcss{lt%F8m%>fv?5+S*O;fdWN+i zp5EN<<=9lB*VitM#FpQ$cqZ0#{OMdKCnR`E+WI;F3rvXtw0DQSxVp|9FBS#!QpT^F f7@gT36X5>`K97x$MYIX=00000NkvXXu0mjfb7ix7 diff --git a/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/baseline/step_1.png b/pxr/usdImaging/bin/testusdview/testenv/testUsdviewExpressionVariableEdits/baseline/step_1.png index 3337f9e19e10a41b4afd4e0d8d240361e89900aa..cd2a72d0394fa658e5544870e69224b72bbc2778 100644 GIT binary patch literal 149987 zcmV)7K*zs{P)g}%VnLESbXee?h zlVrxx3r)s1J?dxaMK5}hjmbaFnk z-@h&W?f+@~KVJev`+srW57Gn>0HSk%nGa-Ih$cj5%}TKotABO!M}K6k zq@7(12IzL_=~Fh0bTfP($H&xaq1|Sgsn^$J+c-L6CA|{CvT%H?92{`1mM(+{r>CSS zc=AN5Wi+D8OM3d0OQm$4Ai&9qQmyj#b_#=SD}VZ@l|TPh{mqA=`9GVYB+@N$h~5(K zF*l@^&;=m`AIcfVM5n~>F_$Gg3_2kc!8>vxeZm0zlu?jyxS$h42i%eixg>btBL)F0 zT;;zgAN^m27r(~;I<<~GPbTDqr~vG7ik9fskm!c!sSuJ%1RppdY5*O%kQ*WkIATs# zqInXV=q=F`=6Xy>LfknKfG25MA{rB208g1yd!mAOSOt{H=7)(2Ytxv8QQgNd?5QH*Vk zsQXZMC0#ttET4B|%s&L82Y-PZs9nCb*&C(U#rB5Ftz4 z`9erQ!9sGXkN`paW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