All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
usdProxyShapeAdapter.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXRUSDMAYAGL_USD_PROXY_SHAPE_ADAPTER_H
25 #define PXRUSDMAYAGL_USD_PROXY_SHAPE_ADAPTER_H
26 
28 
29 #include "pxr/pxr.h"
30 
31 #include "pxrUsdMayaGL/api.h"
33 
34 #include "pxr/base/gf/matrix4d.h"
35 #include "pxr/imaging/hd/renderIndex.h"
36 #include "pxr/usd/sdf/path.h"
37 #include "pxr/usd/usd/prim.h"
38 #include "pxr/usdImaging/usdImaging/delegate.h"
39 
40 #include <maya/M3dView.h>
41 #include <maya/MHWGeometryUtilities.h>
42 #include <maya/MPxSurfaceShape.h>
43 
44 #include <memory>
45 
46 
47 PXR_NAMESPACE_OPEN_SCOPE
48 
49 
50 class UsdMayaProxyDrawOverride;
51 class UsdMayaProxyShapeUI;
52 
53 
57 {
58  public:
59 
75  PXRUSDMAYAGL_API
76  bool UpdateVisibility(const M3dView* view = nullptr) override;
77 
82  PXRUSDMAYAGL_API
83  bool IsVisible() const override;
84 
85  PXRUSDMAYAGL_API
86  void SetRootXform(const GfMatrix4d& transform) override;
87 
88  PXRUSDMAYAGL_API
89  const SdfPath& GetDelegateID() const override;
90 
91  protected:
92 
101  PXRUSDMAYAGL_API
102  bool _Sync(
103  const MDagPath& shapeDagPath,
104  const unsigned int displayStyle,
105  const MHWRender::DisplayStatus displayStatus) override;
106 
111  PXRUSDMAYAGL_API
113 
114  PXRUSDMAYAGL_API
115  ~PxrMayaHdUsdProxyShapeAdapter() override;
116 
117  private:
118 
128  PXRUSDMAYAGL_API
129  bool _Init(HdRenderIndex* renderIndex);
130 
131  UsdPrim _rootPrim;
132  SdfPathVector _excludedPrimPaths;
133 
134  std::shared_ptr<UsdImagingDelegate> _delegate;
135 
141  friend class UsdMayaProxyShapeUI;
142 };
143 
144 
145 PXR_NAMESPACE_CLOSE_SCOPE
146 
147 
148 #endif
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:119
PXRUSDMAYAGL_API bool _Sync(const MDagPath &shapeDagPath, const unsigned int displayStyle, const MHWRender::DisplayStatus displayStatus) override
Update the shape adapter&#39;s state from the shape with the given shapeDagPath and display state...
Abstract base class for objects that manage translation of Maya shape node data and viewport state fo...
Definition: shapeAdapter.h:64
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
PXRUSDMAYAGL_API bool UpdateVisibility(const M3dView *view=nullptr) override
Update the shape adapter&#39;s visibility state from the display status of its shape. ...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
PXRUSDMAYAGL_API bool IsVisible() const override
Gets whether the shape adapter&#39;s shape is visible.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
Class to manage translation of USD proxy shape node data and viewport state for imaging with Hydra...
PXRUSDMAYAGL_API PxrMayaHdUsdProxyShapeAdapter()
Construct a new uninitialized PxrMayaHdUsdProxyShapeAdapter.
friend class UsdMayaProxyDrawOverride
The classes that maintain ownership of and are responsible for updating the shape adapter for their s...