HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cylinderWrapper.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5 */
6 
7 #ifndef GUSD_CYLINDERWRAPPER_H
8 #define GUSD_CYLINDERWRAPPER_H
9 
10 #include "primWrapper.h"
11 
12 #include <pxr/pxr.h>
14 
16 
17 /// Build a transform for a GT tube, given the height, radius, and axis
18 /// attributes from a USD cone or cylinder prim.
19 template <typename ConeOrCylinder>
20 UT_Matrix4D GusdBuildTubeXform(const ConeOrCylinder &prim, UsdTimeCode time);
21 
22 /// Wraps a USD cylinder prim and refines it to a GT tube for the viewport or
23 /// conversion back to GU primitives.
25 {
26 public:
28  GusdPurposeSet purposes);
29 
30  ~GusdCylinderWrapper() override;
31 
32  const UsdGeomImageable getUsdPrim() const override
33  {
34  return m_usdCylinder;
35  }
36 
37  const char* className() const override;
38 
39  void
40  enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
41 
42  int getMotionSegments() const override;
43 
44  int64 getMemoryUsage() const override;
45 
46  GT_PrimitiveHandle doSoftCopy() const override;
47 
48  bool isValid() const override;
49 
50  bool refine(GT_Refine& refiner,
51  const GT_RefineParms *parms=nullptr) const override;
52 
53 public:
54  static GT_PrimitiveHandle
56  GusdPurposeSet purposes);
57 
58 private:
59  bool initUsdPrim(const UsdStagePtr& stage,
60  const SdfPath& path,
61  bool asOverride);
62 
63  UsdGeomCylinder m_usdCylinder;
64 };
65 
67 
68 #endif
A GT_Primitive that wraps a USD Prim.
Definition: primWrapper.h:89
GT_API const UT_StringHolder time
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
const UsdGeomImageable getUsdPrim() const override
~GusdCylinderWrapper() override
int64 getMemoryUsage() const override
bool refine(GT_Refine &refiner, const GT_RefineParms *parms=nullptr) const override
int getMotionSegments() const override
const char * className() const override
PXR_NAMESPACE_OPEN_SCOPE UT_Matrix4D GusdBuildTubeXform(const ConeOrCylinder &prim, UsdTimeCode time)
GusdCylinderWrapper(const UsdGeomCylinder &usdCylinder, UsdTimeCode t, GusdPurposeSet purposes)
long long int64
Definition: SYS_Types.h:116
Definition: path.h:291
GLdouble t
Definition: glad.h:2397
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GT_PrimitiveHandle doSoftCopy() const override
bool isValid() const override
Return true if the underlying USD prim is valid.
GusdPurposeSet
Definition: purpose.h:39
static GT_PrimitiveHandle defineForRead(const UsdGeomImageable &sourcePrim, UsdTimeCode time, GusdPurposeSet purposes)