24 #ifndef PXRUSDMAYAGL_SHAPE_ADAPTER_H
25 #define PXRUSDMAYAGL_SHAPE_ADAPTER_H
31 #include "pxrUsdMayaGL/api.h"
35 #include "pxr/base/gf/matrix4d.h"
36 #include "pxr/base/tf/token.h"
37 #include "pxr/imaging/hd/repr.h"
38 #include "pxr/imaging/hd/rprimCollection.h"
39 #include "pxr/usd/sdf/path.h"
45 #include "pxr/usd/sdf/types.h"
47 #include <maya/M3dView.h>
48 #include <maya/MBoundingBox.h>
49 #include <maya/MColor.h>
50 #include <maya/MDagPath.h>
51 #include <maya/MDrawRequest.h>
52 #include <maya/MHWGeometryUtilities.h>
53 #include <maya/MPxSurfaceShapeUI.h>
54 #include <maya/MUserData.h>
59 PXR_NAMESPACE_OPEN_SCOPE
72 const MDagPath& shapeDagPath,
73 const M3dView::DisplayStyle legacyDisplayStyle,
74 const M3dView::DisplayStatus legacyDisplayStatus);
80 const MDagPath& shapeDagPath,
81 const unsigned int displayStyle,
82 const MHWRender::DisplayStatus displayStatus);
120 MPxSurfaceShapeUI* shapeUI,
121 MDrawRequest& drawRequest,
122 const MBoundingBox* boundingBox =
nullptr);
145 const MBoundingBox* boundingBox =
nullptr);
167 const unsigned int displayStyle,
168 const MHWRender::DisplayStatus displayStatus)
const;
177 bool* drawBoundingBox)
const;
193 virtual const GfMatrix4d& GetRootXform()
const;
196 virtual void SetRootXform(
const GfMatrix4d& transform);
199 virtual const SdfPath& GetDelegateID()
const;
202 virtual const MDagPath& GetDagPath()
const;
227 const MDagPath& shapeDagPath,
228 const unsigned int displayStyle,
229 const MHWRender::DisplayStatus displayStatus) = 0;
261 const unsigned int displayStyle,
262 const MHWRender::DisplayStatus displayStatus,
263 const MDagPath& shapeDagPath,
264 MColor* mayaWireColor);
276 const MDagPath& dagPath,
285 virtual ~PxrMayaHdShapeAdapter();
287 MDagPath _shapeDagPath;
289 PxrMayaHdRenderParams _renderParams;
291 bool _drawBoundingBox;
302 PXR_NAMESPACE_CLOSE_SCOPE
virtual PXRUSDMAYAGL_API bool IsViewport2() const
Get whether this shape adapter is for use with Viewport 2.0.
PXRUSDMAYAGL_API PxrMayaHdShapeAdapter()
Construct a new uninitialized PxrMayaHdShapeAdapter.
virtual PXRUSDMAYAGL_API bool IsVisible() const
Gets whether the shape adapter's shape is visible.
static bool _GetWireframeColor(const unsigned int displayStyle, const MHWRender::DisplayStatus displayStatus, const MDagPath &shapeDagPath, MColor *mayaWireColor)
Helper for getting the wireframe color of the shape.
virtual PXRUSDMAYAGL_API HdReprSelector GetReprSelectorForDisplayState(const unsigned int displayStyle, const MHWRender::DisplayStatus displayStatus) const
Gets the HdReprSelector that corresponds to the given Maya display state.
Abstract base class for objects that manage translation of Maya shape node data and viewport state fo...
virtual PXRUSDMAYAGL_API PxrMayaHdRenderParams GetRenderParams(bool *drawShape, bool *drawBoundingBox) const
Get a set of render params from the shape adapter's current state.
virtual PXRUSDMAYAGL_API TfToken _GetRprimCollectionName() const
Helper for computing the name of the shape's HdRprimCollection.
Token for efficient comparison, assignment, and hashing of known strings.
Stores a 4x4 matrix of double elements.
std::vector< TfToken > TfTokenVector
Convenience types.
A named, semantic collection of objects.
virtual PXRUSDMAYAGL_API bool UpdateVisibility(const M3dView *view=nullptr)
Update the shape adapter's visibility state from the display status of its shape. ...
A path value used to locate objects in layers or scenegraphs.
Container for all of the information needed for a draw request in the legacy viewport or Viewport 2...
static bool _GetVisibility(const MDagPath &dagPath, const M3dView *view, bool *visibility)
Helper for computing the viewport visibility of the shape.
virtual PXRUSDMAYAGL_API bool Sync(const MDagPath &shapeDagPath, const M3dView::DisplayStyle legacyDisplayStyle, const M3dView::DisplayStatus legacyDisplayStatus)
Update the shape adapter's state from the shape with the given shapeDagPath and the legacy viewport d...
virtual PXRUSDMAYAGL_API bool _Sync(const MDagPath &shapeDagPath, const unsigned int displayStyle, const MHWRender::DisplayStatus displayStatus)=0
Update the shape adapter's state from the shape with the given dagPath and display state...
virtual PXRUSDMAYAGL_API void GetMayaUserData(MPxSurfaceShapeUI *shapeUI, MDrawRequest &drawRequest, const MBoundingBox *boundingBox=nullptr)
Get the Maya user data object for drawing in the legacy viewport.
Describes one or more authored display representations for an rprim.
virtual PXRUSDMAYAGL_API const TfTokenVector & GetRenderTags() const
Retrieves the render tags for this shape.