All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
instancerShapeAdapter.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_INSTANCER_SHAPE_ADAPTER_H
25 #define PXRUSDMAYAGL_INSTANCER_SHAPE_ADAPTER_H
26 
28 
29 #include "pxrUsdMayaGL/api.h"
31 
32 #include "pxr/base/gf/matrix4d.h"
33 #include "pxr/imaging/hd/renderIndex.h"
34 #include "pxr/usd/sdf/path.h"
35 #include "pxr/usd/usd/prim.h"
36 #include "pxr/usdImaging/usdImaging/delegate.h"
37 
38 #include <maya/M3dView.h>
39 
40 #include <memory>
41 
42 
43 PXR_NAMESPACE_OPEN_SCOPE
44 
45 
52 {
53  public:
54 
70  bool UpdateVisibility(const M3dView* view = nullptr) override;
71 
76  bool IsVisible() const override;
77 
78  void SetRootXform(const GfMatrix4d& transform) override;
79 
80  const SdfPath& GetDelegateID() const override;
81 
83 
84  protected:
85 
94  bool _Sync(
95  const MDagPath& shapeDagPath,
96  const unsigned int displayStyle,
97  const MHWRender::DisplayStatus displayStatus) override;
98 
104 
105  private:
106 
116  bool _Init(HdRenderIndex* renderIndex);
117 
122  size_t _SyncInstancerPrototypes(
123  const UsdGeomPointInstancer& usdInstancer,
124  const MPlug& inputHierarchy);
125 
130  void _SyncInstancer(
131  const UsdGeomPointInstancer& usdInstancer,
132  const MDagPath& mayaInstancerPath);
133 
134  UsdStageRefPtr _instancerStage;
135 
136  std::shared_ptr<UsdImagingDelegate> _delegate;
137 
143 };
144 
145 
146 PXR_NAMESPACE_CLOSE_SCOPE
147 
148 #endif
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:119
bool IsVisible() const override
Gets whether the shape adapter&#39;s shape is visible.
UsdMayaGL_InstancerShapeAdapter()
Construct a new uninitialized UsdMayaGL_InstancerShapeAdapter.
Abstract base class for objects that manage translation of Maya shape node data and viewport state fo...
Definition: shapeAdapter.h:64
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 dagPath and display state...
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
Class for syncing native Maya instancers with the pxrHdImagingShape so that it can draw USD reference...
bool UpdateVisibility(const M3dView *view=nullptr) override
Update the shape adapter&#39;s visibility state from the display status of its shape. ...
Encodes vectorized instancing of multiple, potentially animated, prototypes (object/instance masters)...
Class to manage translation of native Maya instancers into UsdGeomPointInstancers for imaging with Hy...