diff --git a/pxr/imaging/lib/cameraUtil/pch.h b/pxr/imaging/lib/cameraUtil/pch.h index 292133b4eb..d0d7b2958a 100644 --- a/pxr/imaging/lib/cameraUtil/pch.h +++ b/pxr/imaging/lib/cameraUtil/pch.h @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/lib/glf/baseTextureData.h b/pxr/imaging/lib/glf/baseTextureData.h index 6bc11de35b..f48432c23b 100644 --- a/pxr/imaging/lib/glf/baseTextureData.h +++ b/pxr/imaging/lib/glf/baseTextureData.h @@ -33,21 +33,25 @@ #include "pxr/base/tf/refPtr.h" #include "pxr/base/tf/weakPtr.h" -#include - PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(GlfBaseTextureData); class GlfBaseTextureData : public TfRefBase, - public TfWeakBase, - boost::noncopyable + public TfWeakBase { public: GLF_API virtual ~GlfBaseTextureData(); + GLF_API + GlfBaseTextureData() = default; + + // Disallow copies + GlfBaseTextureData(const GlfBaseTextureData&) = delete; + GlfBaseTextureData& operator=(const GlfBaseTextureData&) = delete; + struct WrapInfo { WrapInfo() : hasWrapModeS(false), hasWrapModeT(false), diff --git a/pxr/imaging/lib/glf/contextCaps.h b/pxr/imaging/lib/glf/contextCaps.h index 476efb90f3..17870be544 100644 --- a/pxr/imaging/lib/glf/contextCaps.h +++ b/pxr/imaging/lib/glf/contextCaps.h @@ -28,8 +28,6 @@ #include "pxr/imaging/glf/api.h" #include "pxr/base/tf/singleton.h" -#include - PXR_NAMESPACE_OPEN_SCOPE @@ -51,12 +49,16 @@ PXR_NAMESPACE_OPEN_SCOPE /// subscribe to when the caps changes, so they can /// update and invalidate. /// -class GlfContextCaps : boost::noncopyable { +class GlfContextCaps { public: GLF_API static GlfContextCaps &GetInstance(); + // Disallow copies + GlfContextCaps(const GlfContextCaps&) = delete; + GlfContextCaps& operator=(const GlfContextCaps&) = delete; + // GL version int glVersion; // 400 (4.0), 410 (4.1), ... diff --git a/pxr/imaging/lib/glf/glContext.h b/pxr/imaging/lib/glf/glContext.h index 538ecb68e4..f2dac95a3c 100644 --- a/pxr/imaging/lib/glf/glContext.h +++ b/pxr/imaging/lib/glf/glContext.h @@ -27,7 +27,6 @@ #include "pxr/pxr.h" #include "pxr/imaging/glf/api.h" #include "pxr/base/arch/threads.h" -#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -49,11 +48,15 @@ typedef boost::shared_ptr GlfGLContextSharedPtr; /// This mechanism depends on the application code registering callbacks to /// provide access to its GL contexts. /// -class GlfGLContext : public boost::noncopyable { +class GlfGLContext { public: GLF_API virtual ~GlfGLContext(); + // Disallow copies + GlfGLContext(const GlfGLContext&) = delete; + GlfGLContext& operator=(const GlfGLContext&) = delete; + /// Returns an instance for the current GL context. GLF_API static GlfGLContextSharedPtr GetCurrentGLContext(); @@ -162,13 +165,17 @@ class GlfGLContext : public boost::noncopyable { /// The underlying calls to make GL contexts current can be moderately /// expensive. So, this mechanism should be used carefully. /// -class GlfGLContextScopeHolder : boost::noncopyable { +class GlfGLContextScopeHolder { public: /// Make the given context current and restore the current context /// when this object is destroyed. GLF_API explicit GlfGLContextScopeHolder(const GlfGLContextSharedPtr& newContext); + // Disallow copies + GlfGLContextScopeHolder(const GlfGLContextScopeHolder&) = delete; + GlfGLContextScopeHolder& operator=(const GlfGLContextScopeHolder&) = delete; + GLF_API ~GlfGLContextScopeHolder(); @@ -249,11 +256,17 @@ class GlfSharedGLContextScopeHolder : private GlfGLContextScopeHolder { /// If you subclass GlfGLContext you should subclass this type and /// instantiate an instance on the heap. It will be cleaned up /// automatically. -class GlfGLContextRegistrationInterface : boost::noncopyable { +class GlfGLContextRegistrationInterface { public: GLF_API virtual ~GlfGLContextRegistrationInterface(); + // Disallow copies + GlfGLContextRegistrationInterface( + const GlfGLContextRegistrationInterface&) = delete; + GlfGLContextRegistrationInterface& operator=( + const GlfGLContextRegistrationInterface&) = delete; + /// If this GLContext system supports a shared context this should /// return it. This will be called at most once. virtual GlfGLContextSharedPtr GetShared() = 0; diff --git a/pxr/imaging/lib/glf/glContextRegistry.h b/pxr/imaging/lib/glf/glContextRegistry.h index 88e5cedb98..277eceebb6 100644 --- a/pxr/imaging/lib/glf/glContextRegistry.h +++ b/pxr/imaging/lib/glf/glContextRegistry.h @@ -29,7 +29,6 @@ #include "pxr/pxr.h" #include "pxr/imaging/glf/glContext.h" #include "pxr/base/tf/singleton.h" -#include #include #include #include @@ -46,8 +45,12 @@ typedef boost::shared_ptr GlfGLContextSharedPtr; /// /// Registry of GlfGLContexts. /// -class GlfGLContextRegistry : boost::noncopyable { +class GlfGLContextRegistry { public: + // Disallow copies + GlfGLContextRegistry(const GlfGLContextRegistry&) = delete; + GlfGLContextRegistry& operator=(const GlfGLContextRegistry&) = delete; + static GlfGLContextRegistry& GetInstance() { return TfSingleton::GetInstance(); diff --git a/pxr/imaging/lib/glf/image.h b/pxr/imaging/lib/glf/image.h index 3f67744d95..5b4b947036 100644 --- a/pxr/imaging/lib/glf/image.h +++ b/pxr/imaging/lib/glf/image.h @@ -35,7 +35,6 @@ #include "pxr/base/vt/dictionary.h" #include "pxr/base/vt/value.h" -#include #include #include @@ -51,18 +50,23 @@ typedef boost::shared_ptr GlfImageSharedPtr; /// /// The class allows basic access to texture image file data. /// -class GlfImage : public boost::noncopyable { - +class GlfImage { public: + GLF_API + GlfImage() = default; + + // Disallow copies + GlfImage(const GlfImage&) = delete; + GlfImage& operator=(const GlfImage&) = delete; /// Specifies whether to treat the image origin as the upper-left corner /// or the lower left enum ImageOriginLocation { - OriginUpperLeft, + OriginUpperLeft, OriginLowerLeft - }; - + }; + /// \class StorageSpec /// /// Describes the memory layout and storage of a texture image diff --git a/pxr/imaging/lib/glf/simpleShadowArray.h b/pxr/imaging/lib/glf/simpleShadowArray.h index 12b51e6c22..81575b2288 100644 --- a/pxr/imaging/lib/glf/simpleShadowArray.h +++ b/pxr/imaging/lib/glf/simpleShadowArray.h @@ -36,21 +36,23 @@ #include "pxr/base/gf/vec4d.h" #include "pxr/imaging/garch/gl.h" -#include #include PXR_NAMESPACE_OPEN_SCOPE class GlfSimpleShadowArray : public TfRefBase, - public TfWeakBase, - boost::noncopyable { + public TfWeakBase { public: GLF_API GlfSimpleShadowArray(GfVec2i const & size, size_t numLayers); GLF_API virtual ~GlfSimpleShadowArray(); + // Disallow copies + GlfSimpleShadowArray(const GlfSimpleShadowArray&) = delete; + GlfSimpleShadowArray& operator=(const GlfSimpleShadowArray&) = delete; + GLF_API GfVec2i GetSize() const; GLF_API diff --git a/pxr/imaging/lib/glf/texture.h b/pxr/imaging/lib/glf/texture.h index 5b66e2bf57..d4c730a088 100644 --- a/pxr/imaging/lib/glf/texture.h +++ b/pxr/imaging/lib/glf/texture.h @@ -40,7 +40,6 @@ #include #include #include -#include PXR_NAMESPACE_OPEN_SCOPE @@ -60,7 +59,7 @@ TF_DECLARE_WEAK_AND_REF_PTRS(GlfTexture); /// A texture is typically defined by reading texture image data from an image /// file but a texture might also represent an attachment of a draw target. /// -class GlfTexture : public TfRefBase, public TfWeakBase, boost::noncopyable { +class GlfTexture : public TfRefBase, public TfWeakBase { public: /// \class Binding /// @@ -90,6 +89,10 @@ class GlfTexture : public TfRefBase, public TfWeakBase, boost::noncopyable { GLF_API virtual ~GlfTexture() = 0; + // Disallow copies + GlfTexture(const GlfTexture&) = delete; + GlfTexture& operator=(const GlfTexture&) = delete; + /// Returns the bindings to use this texture for the shader resource /// named \a identifier. If \a samplerId is specified, the bindings /// returned will use this samplerId for resources which can be sampled. diff --git a/pxr/imaging/lib/glf/textureRegistry.h b/pxr/imaging/lib/glf/textureRegistry.h index d4c90f71ff..63fb8171ea 100644 --- a/pxr/imaging/lib/glf/textureRegistry.h +++ b/pxr/imaging/lib/glf/textureRegistry.h @@ -36,7 +36,6 @@ #include "pxr/base/tf/weakPtr.h" #include "pxr/base/vt/dictionary.h" -#include #include #include @@ -51,8 +50,12 @@ class GlfTextureFactoryBase; /// \class GlfTextureRegistry /// -class GlfTextureRegistry : boost::noncopyable { +class GlfTextureRegistry { public: + // Disallow copies + GlfTextureRegistry(const GlfTextureRegistry&) = delete; + GlfTextureRegistry& operator=(const GlfTextureRegistry&) = delete; + GLF_API static GlfTextureRegistry & GetInstance(); diff --git a/pxr/imaging/lib/hd/bufferArray.h b/pxr/imaging/lib/hd/bufferArray.h index ca7468227c..9dac0bfccf 100644 --- a/pxr/imaging/lib/hd/bufferArray.h +++ b/pxr/imaging/lib/hd/bufferArray.h @@ -32,7 +32,6 @@ #include "pxr/base/tf/token.h" #include "pxr/base/vt/value.h" -#include #include #include @@ -55,8 +54,7 @@ typedef boost::shared_ptr HdBufferSourceSharedPtr; /// can be shared across multiple HdRprims, in the context of buffer /// aggregation. /// -class HdBufferArray : public boost::enable_shared_from_this, - boost::noncopyable { +class HdBufferArray : public boost::enable_shared_from_this { public: HD_API HdBufferArray(TfToken const &role, @@ -66,6 +64,10 @@ class HdBufferArray : public boost::enable_shared_from_this, HD_API virtual ~HdBufferArray(); + // Disallow copies + HdBufferArray(const HdBufferArray&) = delete; + HdBufferArray& operator=(const HdBufferArray&) = delete; + /// Returns the role of the GPU data in this bufferArray. TfToken const& GetRole() const {return _role;} diff --git a/pxr/imaging/lib/hd/bufferArrayRange.h b/pxr/imaging/lib/hd/bufferArrayRange.h index 2cb117b569..8b7864d16e 100644 --- a/pxr/imaging/lib/hd/bufferArrayRange.h +++ b/pxr/imaging/lib/hd/bufferArrayRange.h @@ -31,7 +31,6 @@ #include "pxr/base/vt/value.h" #include "pxr/imaging/hd/bufferResource.h" -#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -51,7 +50,7 @@ typedef boost::shared_ptr HdBufferArrayRangeSharedPtr; /// inherited of this interface so that client (drawItem) can be agnostic about /// the implementation detail of aggregation. /// -class HdBufferArrayRange : boost::noncopyable { +class HdBufferArrayRange { public: /// Destructor (do nothing). /// The specialized range class may want to do something for garbage @@ -61,6 +60,13 @@ class HdBufferArrayRange : boost::noncopyable { HD_API virtual ~HdBufferArrayRange(); + /// Default constructor + HdBufferArrayRange() = default; + + /// Disallow copies + HdBufferArrayRange(const HdBufferArrayRange&) = delete; + HdBufferArrayRange& operator=(const HdBufferArrayRange&) = delete; + /// Returns true if this range is valid virtual bool IsValid() const = 0; diff --git a/pxr/imaging/lib/hd/bufferArrayRegistry.h b/pxr/imaging/lib/hd/bufferArrayRegistry.h index 0adc95188c..c43475a94d 100644 --- a/pxr/imaging/lib/hd/bufferArrayRegistry.h +++ b/pxr/imaging/lib/hd/bufferArrayRegistry.h @@ -38,7 +38,6 @@ #include "pxr/base/vt/dictionary.h" #include "pxr/base/tf/token.h" -#include #include #include @@ -54,7 +53,7 @@ typedef boost::shared_ptr HdBufferArraySharedPtr; /// /// Manages the pool of buffer arrays. /// -class HdBufferArrayRegistry : public boost::noncopyable { +class HdBufferArrayRegistry { public: HF_MALLOC_TAG_NEW("new HdBufferArrayRegistry"); @@ -62,6 +61,9 @@ class HdBufferArrayRegistry : public boost::noncopyable { HdBufferArrayRegistry(); ~HdBufferArrayRegistry() = default; + HdBufferArrayRegistry(const HdBufferArrayRegistry&) = delete; + HdBufferArrayRegistry& operator=(const HdBufferArrayRegistry&) = delete; + /// Allocate new buffer array range using strategy /// Thread-Safe HD_API diff --git a/pxr/imaging/lib/hd/bufferSource.h b/pxr/imaging/lib/hd/bufferSource.h index 13e69fae14..ba15fe872a 100644 --- a/pxr/imaging/lib/hd/bufferSource.h +++ b/pxr/imaging/lib/hd/bufferSource.h @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -57,10 +56,14 @@ typedef boost::weak_ptr HdBufferSourceWeakPtr; /// The public interface provided is intended to be convenient for OpenGL API /// calls. /// -class HdBufferSource : public boost::noncopyable { +class HdBufferSource { public: HdBufferSource() : _state(UNRESOLVED) { } + // Disallow copies + HdBufferSource(const HdBufferSource&) = delete; + HdBufferSource& operator=(const HdBufferSource&) = delete; + HD_API virtual ~HdBufferSource(); diff --git a/pxr/imaging/lib/hd/changeTracker.h b/pxr/imaging/lib/hd/changeTracker.h index 5cdf3be657..0e10614ef4 100644 --- a/pxr/imaging/lib/hd/changeTracker.h +++ b/pxr/imaging/lib/hd/changeTracker.h @@ -33,7 +33,6 @@ #include "pxr/base/tf/hashmap.h" #include -#include #include #include #include @@ -54,7 +53,7 @@ class HdRenderIndex; /// with the change is required, at which point the resource is updated and the /// flag is cleared. /// -class HdChangeTracker : public boost::noncopyable { +class HdChangeTracker { public: enum RprimDirtyBits : HdDirtyBits { @@ -101,9 +100,14 @@ class HdChangeTracker : public boost::noncopyable { HD_API HdChangeTracker(); + HD_API virtual ~HdChangeTracker(); + // Disallow copies + HdChangeTracker(const HdChangeTracker&) = delete; + HdChangeTracker& operator=(const HdChangeTracker&) = delete; + // ---------------------------------------------------------------------- // /// \name Rprim Object Tracking /// @{ diff --git a/pxr/imaging/lib/hd/pch.h b/pxr/imaging/lib/hd/pch.h index c0025af15f..675b4deccc 100644 --- a/pxr/imaging/lib/hd/pch.h +++ b/pxr/imaging/lib/hd/pch.h @@ -112,7 +112,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/lib/hd/perfLog.h b/pxr/imaging/lib/hd/perfLog.h index ffc5fd4449..f701ec5c24 100644 --- a/pxr/imaging/lib/hd/perfLog.h +++ b/pxr/imaging/lib/hd/perfLog.h @@ -35,7 +35,6 @@ #include "pxr/base/tf/singleton.h" #include "pxr/base/tf/token.h" -#include #include #include "pxr/base/tf/hashmap.h" @@ -94,8 +93,12 @@ typedef boost::shared_ptr HdResourceRegistrySharedPtr; /// /// Performance counter monitoring. /// -class HdPerfLog : public boost::noncopyable { +class HdPerfLog { public: + // Disallow copies + HdPerfLog(const HdPerfLog&) = delete; + HdPerfLog& operator=(const HdPerfLog&) = delete; + HD_API static HdPerfLog& GetInstance() { return TfSingleton::GetInstance(); diff --git a/pxr/imaging/lib/hd/renderIndex.h b/pxr/imaging/lib/hd/renderIndex.h index 28b6fa59dc..dd0863a5b1 100644 --- a/pxr/imaging/lib/hd/renderIndex.h +++ b/pxr/imaging/lib/hd/renderIndex.h @@ -42,7 +42,6 @@ #include "pxr/base/gf/vec4i.h" #include "pxr/base/tf/hashmap.h" -#include #include #include @@ -116,7 +115,7 @@ typedef std::unordered_map HdDrawItemPtrVector; typedef std::unordered_map HdRenderPassSharedPtr; /// Rendering backends are expected to specialize this abstract class, and /// return the specialized object via HdRenderDelegate::CreateRenderPass /// -class HdRenderPass : boost::noncopyable { +class HdRenderPass { public: + HdRenderPass(const HdRenderPass&) = delete; + HdRenderPass& operator=(const HdRenderPass&) = delete; + HD_API HdRenderPass(HdRenderIndex *index, HdRprimCollection const& collection); HD_API diff --git a/pxr/imaging/lib/hd/resource.h b/pxr/imaging/lib/hd/resource.h index 9d1e5e575e..c8b91df2ff 100644 --- a/pxr/imaging/lib/hd/resource.h +++ b/pxr/imaging/lib/hd/resource.h @@ -29,7 +29,6 @@ #include "pxr/imaging/hd/version.h" #include "pxr/base/tf/token.h" -#include #include #include @@ -43,14 +42,19 @@ typedef boost::shared_ptr HdResourceSharedPtr; /// /// Base class for all GPU resource objects. /// -class HdResource : boost::noncopyable +class HdResource { public: HD_API HdResource(TfToken const & role); + HD_API virtual ~HdResource(); + // Disallow copies + HdResource(const HdResource&) = delete; + HdResource& operator=(const HdResource&) = delete; + /// Returns the role of the GPU data in this resource. TfToken const & GetRole() const {return _role;} diff --git a/pxr/imaging/lib/hd/resourceRegistry.h b/pxr/imaging/lib/hd/resourceRegistry.h index fe6e092c08..f2e30f8fe9 100644 --- a/pxr/imaging/lib/hd/resourceRegistry.h +++ b/pxr/imaging/lib/hd/resourceRegistry.h @@ -44,7 +44,6 @@ #include "pxr/base/tf/singleton.h" #include "pxr/base/tf/token.h" -#include #include #include #include @@ -68,13 +67,17 @@ typedef boost::shared_ptr HdResourceRegistrySharedPtr; /// /// A central registry of all GPU resources. /// -class HdResourceRegistry : public boost::noncopyable { +class HdResourceRegistry { public: HF_MALLOC_TAG_NEW("new HdResourceRegistry"); HD_API HdResourceRegistry(); + // Disallow copies + HdResourceRegistry(const HdResourceRegistry&) = delete; + HdResourceRegistry& operator=(const HdResourceRegistry&) = delete; + HD_API virtual ~HdResourceRegistry(); /// Allocate new non uniform buffer array range diff --git a/pxr/imaging/lib/hdSt/pch.h b/pxr/imaging/lib/hdSt/pch.h index e60a40e336..f6edd72e98 100644 --- a/pxr/imaging/lib/hdSt/pch.h +++ b/pxr/imaging/lib/hdSt/pch.h @@ -105,7 +105,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/lib/hdSt/textureResource.h b/pxr/imaging/lib/hdSt/textureResource.h index 9a2244737e..da59a042f4 100644 --- a/pxr/imaging/lib/hdSt/textureResource.h +++ b/pxr/imaging/lib/hdSt/textureResource.h @@ -37,7 +37,6 @@ #include "pxr/base/tf/token.h" #include "pxr/base/gf/vec4f.h" -#include #include #include @@ -49,11 +48,18 @@ typedef boost::shared_ptr HdStTextureResourceSharedPt typedef boost::shared_ptr HdStSimpleTextureResourceSharedPtr; /// HdStTextureResource is an interface to a GL-backed texture. -class HdStTextureResource : public HdTextureResource, boost::noncopyable { +class HdStTextureResource : public HdTextureResource { public: HDST_API virtual ~HdStTextureResource(); + HDST_API + HdStTextureResource() = default; + + // Disallow copies + HdStTextureResource(const HdStTextureResource&) = delete; + HdStTextureResource& operator=(const HdStTextureResource&) = delete; + // Access to underlying GL storage. HDST_API virtual GLuint GetTexelsTextureId() = 0; HDST_API virtual GLuint GetTexelsSamplerId() = 0; diff --git a/pxr/imaging/lib/hdx/drawTargetRenderPass.h b/pxr/imaging/lib/hdx/drawTargetRenderPass.h index f9e3e50031..4bfd4141b4 100644 --- a/pxr/imaging/lib/hdx/drawTargetRenderPass.h +++ b/pxr/imaging/lib/hdx/drawTargetRenderPass.h @@ -48,7 +48,7 @@ class HdStDrawTargetRenderPassState; /// to major changes. It is likely this functionality will be absorbed into /// the base class. /// -class HdxDrawTargetRenderPass : boost::noncopyable { +class HdxDrawTargetRenderPass { public: HDX_API HdxDrawTargetRenderPass(HdRenderIndex *index); diff --git a/pxr/imaging/lib/hdx/pch.h b/pxr/imaging/lib/hdx/pch.h index 9442a7c9f7..ca4f068633 100644 --- a/pxr/imaging/lib/hdx/pch.h +++ b/pxr/imaging/lib/hdx/pch.h @@ -105,7 +105,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/lib/hf/pch.h b/pxr/imaging/lib/hf/pch.h index afb08b0b7f..464d3cf466 100644 --- a/pxr/imaging/lib/hf/pch.h +++ b/pxr/imaging/lib/hf/pch.h @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/lib/pxOsd/pch.h b/pxr/imaging/lib/pxOsd/pch.h index b660f0ce22..c6a13eaa19 100644 --- a/pxr/imaging/lib/pxOsd/pch.h +++ b/pxr/imaging/lib/pxOsd/pch.h @@ -90,7 +90,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h index 4e098053db..2135d728ea 100644 --- a/pxr/imaging/plugin/hdEmbree/pch.h +++ b/pxr/imaging/plugin/hdEmbree/pch.h @@ -103,7 +103,6 @@ #include #include #include -#include #include #include #include diff --git a/pxr/imaging/plugin/hdStream/pch.h b/pxr/imaging/plugin/hdStream/pch.h index 707fef1a11..8085d2546d 100644 --- a/pxr/imaging/plugin/hdStream/pch.h +++ b/pxr/imaging/plugin/hdStream/pch.h @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include