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  virtual ~GusdCylinderWrapper();
31 
32  virtual const UsdGeomImageable getUsdPrim() const override
33  {
34  return m_usdCylinder;
35  }
36 
37  virtual const char* className() const override;
38 
39  virtual void
40  enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
41 
42  virtual int getMotionSegments() const override;
43 
44  virtual int64 getMemoryUsage() const override;
45 
46  virtual GT_PrimitiveHandle doSoftCopy() const override;
47 
48  virtual bool isValid() const override;
49 
50  virtual 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:90
virtual const char * className() const override
GT_API const UT_StringHolder time
virtual ~GusdCylinderWrapper()
virtual const UsdGeomImageable getUsdPrim() const override
virtual int getMotionSegments() const override
long long int64
Definition: SYS_Types.h:111
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override
PXR_NAMESPACE_OPEN_SCOPE UT_Matrix4D GusdBuildTubeXform(const ConeOrCylinder &prim, UsdTimeCode time)
GusdCylinderWrapper(const UsdGeomCylinder &usdCylinder, UsdTimeCode t, GusdPurposeSet purposes)
Definition: path.h:287
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
GLsizei const GLchar *const * path
Definition: glew.h:6461
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=nullptr) const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
virtual int64 getMemoryUsage() const override
virtual 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)
GLdouble GLdouble t
Definition: glew.h:1398
virtual GT_PrimitiveHandle doSoftCopy() const override