add usd-21-11-win64_py39
This commit is contained in:
1 parent
41d23e71ba
commit
ba5e1f7e67
15684 files changed
+3069957
No files matched your search
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Copyright 2017 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_HF_API_H
|
||||
#define PXR_IMAGING_HF_API_H
|
||||
|
||||
#include "pxr/base/arch/export.h"
|
||||
|
||||
#if defined(PXR_STATIC)
|
||||
# define HF_API
|
||||
# define HF_API_TEMPLATE_CLASS(...)
|
||||
# define HF_API_TEMPLATE_STRUCT(...)
|
||||
# define HF_LOCAL
|
||||
#else
|
||||
# if defined(HF_EXPORTS)
|
||||
# define HF_API ARCH_EXPORT
|
||||
# define HF_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define HF_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# else
|
||||
# define HF_API ARCH_IMPORT
|
||||
# define HF_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
|
||||
# define HF_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
|
||||
# endif
|
||||
# define HF_LOCAL ARCH_HIDDEN
|
||||
#endif
|
||||
|
||||
#endif // PXR_IMAGING_HF_API_H
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright 2018 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_HF_DIAGNOSTIC_H
|
||||
#define PXR_IMAGING_HF_DIAGNOSTIC_H
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/base/tf/diagnostic.h"
|
||||
#include "pxr/base/tf/stringUtils.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
///
|
||||
/// Issues a warning with a message. This differs from just calling TF_WARN
|
||||
/// in that it tags the warning as actually needing to be a validation error,
|
||||
/// and a place holder for when we develop a true validation system where we
|
||||
/// can plumb this information back to the application.
|
||||
///
|
||||
#define HF_VALIDATION_WARN(id, ...) \
|
||||
TF_WARN("Invalid Hydra prim '%s': %s", \
|
||||
id.GetText(), \
|
||||
TfStringPrintf(__VA_ARGS__).c_str())
|
||||
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif // PXR_IMAGING_HF_DIAGNOSTIC_H
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
#ifndef PXR_IMAGING_HF_PERF_LOG_H
|
||||
#define PXR_IMAGING_HF_PERF_LOG_H
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/base/tf/mallocTag.h"
|
||||
#include "pxr/base/tf/preprocessorUtilsLite.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
///
|
||||
/// Creates an auto-mallocTag with the function, including template params.
|
||||
///
|
||||
#define HF_MALLOC_TAG_FUNCTION() \
|
||||
TfAutoMallocTag2 tagFunc(TF_PP_STRINGIZE(MFB_PACKAGE_NAME), \
|
||||
__ARCH_PRETTY_FUNCTION__);
|
||||
|
||||
///
|
||||
/// Creates an auto-mallocTag with the given named tag.
|
||||
///
|
||||
#define HF_MALLOC_TAG(x) \
|
||||
TfAutoMallocTag2 tag2(TF_PP_STRINGIZE(MFB_PACKAGE_NAME), x);
|
||||
|
||||
///
|
||||
/// Overrides operator new/delete and injects malloc tags.
|
||||
///
|
||||
#define HF_MALLOC_TAG_NEW(x) \
|
||||
TF_MALLOC_TAG_NEW(TF_PP_STRINGIZE(MFB_PACKAGE_NAME), x);
|
||||
|
||||
|
||||
#define HF_TRACE_FUNCTION_SCOPE(tag) \
|
||||
TRACE_FUNCTION_SCOPE(tag)
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif // PXR_IMAGING_HF_PERF_LOG_H
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
#ifndef PXR_IMAGING_HF_PLUGIN_BASE_H
|
||||
#define PXR_IMAGING_HF_PLUGIN_BASE_H
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/imaging/hf/api.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
///
|
||||
/// \class HfPluginBase
|
||||
///
|
||||
/// Base class for all hydra plugin classes. This class provides no
|
||||
/// functionality other than to serve as a polymorphic type for the
|
||||
/// plugin registry.
|
||||
///
|
||||
class HfPluginBase
|
||||
{
|
||||
public:
|
||||
HF_API
|
||||
virtual ~HfPluginBase(); // = default: See workaround in cpp file
|
||||
|
||||
protected:
|
||||
// Pure virtual class, must be derived
|
||||
HF_API
|
||||
HfPluginBase() = default;
|
||||
|
||||
private:
|
||||
///
|
||||
/// This class is not intended to be copied.
|
||||
///
|
||||
HfPluginBase(const HfPluginBase &) = delete;
|
||||
HfPluginBase &operator=(const HfPluginBase &) = delete;
|
||||
};
|
||||
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif // PXR_IMAGING_HF_PLUGIN_BASE_H
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
#ifndef PXR_IMAGING_HF_PLUGIN_DESC_H
|
||||
#define PXR_IMAGING_HF_PLUGIN_DESC_H
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/base/tf/token.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
///
|
||||
/// Common structure used to report registered plugins in one of the plugin
|
||||
/// registries. The id token is used for internal api communication
|
||||
/// about the name of the plugin.
|
||||
/// displayName is a human readable name given to the plugin intended
|
||||
/// to be used in menus.
|
||||
/// priority is used to provide an ordering of plugins. The plugin
|
||||
/// with the highest priority is determined to be the default (unless
|
||||
/// overridden by the application). In the event of a tie
|
||||
/// the string version of id is used to sort alphabetically ('a' has priority
|
||||
/// over 'b').
|
||||
///
|
||||
struct HfPluginDesc {
|
||||
TfToken id;
|
||||
std::string displayName;
|
||||
int priority;
|
||||
};
|
||||
|
||||
typedef std::vector<HfPluginDesc> HfPluginDescVector;
|
||||
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif // PXR_IMAGING_HF_PLUGIN_DESC_H
|
||||
@@ -0,0 +1,209 @@
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
#ifndef PXR_IMAGING_HF_PLUGIN_REGISTRY_H
|
||||
#define PXR_IMAGING_HF_PLUGIN_REGISTRY_H
|
||||
|
||||
#include "pxr/pxr.h"
|
||||
#include "pxr/imaging/hf/api.h"
|
||||
#include "pxr/imaging/hf/perfLog.h"
|
||||
#include "pxr/imaging/hf/pluginDesc.h"
|
||||
#include "pxr/base/tf/type.h"
|
||||
#include <map>
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
|
||||
class HfPluginBase;
|
||||
class Hf_PluginEntry;
|
||||
|
||||
|
||||
///
|
||||
/// \class HfPluginRegistry
|
||||
///
|
||||
/// Base class for registering Hydra plugins using the plug mechanism.
|
||||
/// It is expected that each plugin has a pluginfo.json file that contains
|
||||
/// a list of types, where each type provides a list of base classes,
|
||||
/// displayName and priority.
|
||||
///
|
||||
/// The priority is used to order plugins, with the plugin with the highest
|
||||
/// priority being at the front of the order. priority is a signed integer.
|
||||
/// In the event of two plugins having the same priority, the plugins are sorted
|
||||
/// alphabetically on the type name.
|
||||
///
|
||||
/// The plugin sorted to the front is used as the default plugin, when not
|
||||
/// specified.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
///{
|
||||
/// "Types": {
|
||||
/// "CPPTypeName": {
|
||||
/// "bases": ["BaseTypeName"],
|
||||
/// "displayName": "Human Readable Name",
|
||||
/// "priority" : 0
|
||||
/// }
|
||||
/// }
|
||||
///}
|
||||
///
|
||||
class HfPluginRegistry
|
||||
{
|
||||
|
||||
public:
|
||||
///
|
||||
/// Returns an ordered list of all registered plugins.
|
||||
/// The plugins are ordered by priority then alphabetically
|
||||
///
|
||||
HF_API
|
||||
void GetPluginDescs(HfPluginDescVector *plugins);
|
||||
|
||||
///
|
||||
/// Returns the description for the given plugin id.
|
||||
/// The plugin may not be loaded or been actually created yet.
|
||||
///
|
||||
HF_API
|
||||
bool GetPluginDesc(const TfToken &pluginId, HfPluginDesc *desc);
|
||||
|
||||
///
|
||||
/// Increment the reference count on an existing plugin.
|
||||
///
|
||||
HF_API
|
||||
void AddPluginReference(HfPluginBase *plugin);
|
||||
|
||||
///
|
||||
/// Decrement the reference count on the plugin. If the
|
||||
/// reference count get to 0, the plugin is freed.
|
||||
///
|
||||
HF_API
|
||||
void ReleasePlugin(HfPluginBase *plugin);
|
||||
|
||||
///
|
||||
/// Returns true if a plugin has been registered for the given id.
|
||||
/// The plugin may not be loaded or been actually created yet.
|
||||
///
|
||||
HF_API
|
||||
bool IsRegisteredPlugin(const TfToken &pluginId);
|
||||
|
||||
HF_API
|
||||
TfToken GetPluginId(const HfPluginBase *plugin) const;
|
||||
|
||||
protected:
|
||||
// Must be derived.
|
||||
|
||||
///
|
||||
/// Constructs a Plugin Registry.
|
||||
/// pluginBaseType is the TfType of the class derived from
|
||||
/// HfPluginBase that provides the plugin API.
|
||||
///
|
||||
HF_API
|
||||
HfPluginRegistry(const TfType &pluginBaseType);
|
||||
HF_API
|
||||
virtual ~HfPluginRegistry();
|
||||
|
||||
///
|
||||
/// Returns the plugin from the given pluginId.
|
||||
/// The reference count on the plugin is automatically increased.
|
||||
///
|
||||
HF_API
|
||||
HfPluginBase *GetPlugin(const TfToken &pluginId);
|
||||
|
||||
///
|
||||
/// Entry point for registering a types implementation.
|
||||
/// T is the plugin being registered.
|
||||
/// PluginBaseType is the HfPluginBase derived class
|
||||
/// that specifies the API (the same one the TfType is for in
|
||||
/// the constructor).
|
||||
///
|
||||
/// Bases optionally specifies other classes that T is derived from.
|
||||
///
|
||||
template<typename T, typename PluginBaseType, typename... Bases>
|
||||
static void Define();
|
||||
|
||||
private:
|
||||
typedef std::vector<Hf_PluginEntry> _PluginEntryVector;
|
||||
typedef std::map<TfToken, size_t> _TokenMap;
|
||||
|
||||
//
|
||||
// The purpose of this group of functions is to provide a factory
|
||||
// to create the registered plugin with the type system
|
||||
// without exposing the internal class _PluginEntry
|
||||
///
|
||||
typedef std::function<HfPluginBase *()> _FactoryFn;
|
||||
|
||||
template<typename T>
|
||||
static HfPluginBase *_CreatePlugin();
|
||||
HF_API
|
||||
static void _SetFactory(TfType &type, _FactoryFn &func);
|
||||
|
||||
TfType _pluginBaseType;
|
||||
|
||||
//
|
||||
// Plugins are stored in a ordered list (as a vector). The token
|
||||
// map converts from plugin id into an index in the list.
|
||||
//
|
||||
_PluginEntryVector _pluginEntries;
|
||||
_TokenMap _pluginIndex;
|
||||
|
||||
// Plugin discovery is deferred until first use.
|
||||
bool _pluginCachePopulated;
|
||||
|
||||
// Use the Plug system to discover plugins from the meta data.
|
||||
void _DiscoverPlugins();
|
||||
|
||||
// Find the plugin entry for the given plugin object.
|
||||
Hf_PluginEntry *_GetEntryForPlugin(HfPluginBase *plugin);
|
||||
|
||||
///
|
||||
/// This class is not intended to be copied.
|
||||
///
|
||||
HfPluginRegistry() = delete;
|
||||
HfPluginRegistry(const HfPluginRegistry &) = delete;
|
||||
HfPluginRegistry &operator=(const HfPluginRegistry &) = delete;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
HfPluginBase *
|
||||
HfPluginRegistry::_CreatePlugin()
|
||||
{
|
||||
HF_MALLOC_TAG_FUNCTION();
|
||||
return new T;
|
||||
}
|
||||
|
||||
|
||||
template<typename T, typename PluginBaseType, typename... Bases>
|
||||
void
|
||||
HfPluginRegistry::Define()
|
||||
{
|
||||
TfType type = TfType::Define<T,
|
||||
TfType::Bases<PluginBaseType, Bases...> >();
|
||||
|
||||
_FactoryFn func = &_CreatePlugin<T>;
|
||||
_SetFactory(type, func);
|
||||
}
|
||||
|
||||
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
#endif //PXR_IMAGING_HF_PLUGIN_REGISTRY_H
|
||||
|
||||
Reference in new issue
Block a user