HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pointsWrapper.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 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 __GUSD_POINTSWRAPPER_H__
25 #define __GUSD_POINTSWRAPPER_H__
26 
27 #include "primWrapper.h"
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdGeom/points.h"
31 
33 
34 
36 {
37 public:
39  const UsdStagePtr& stage,
40  const SdfPath& path,
41  bool isOverride = false );
42 
44  const UsdGeomPoints& usdPoints,
45  UsdTimeCode t,
46  GusdPurposeSet purposes );
47 
48  virtual ~GusdPointsWrapper();
49 
50  // GusdGT_Primitive interface -----------------------------------------------
51 
52  virtual const UsdGeomImageable getUsdPrim() const override { return m_usdPoints; }
53 
54  virtual bool redefine(
55  const UsdStagePtr& stage,
56  const SdfPath& path,
57  const GusdContext& ctxt,
58  const GT_PrimitiveHandle& sourcePrim ) override;
59 
60  virtual const char* className() const override;
61 
62  virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
63 
64  virtual int getMotionSegments() const override;
65 
66  virtual int64 getMemoryUsage() const override;
67 
68  virtual GT_PrimitiveHandle doSoftCopy() const override;
69 
70  virtual bool
71  updateFromGTPrim(const GT_PrimitiveHandle& sourcePrim,
72  const UT_Matrix4D& houXform,
73  const GusdContext& ctxt,
74  GusdSimpleXformCache& xformCache ) override;
75 
76  virtual bool isValid() const override;
77 
78  virtual bool refine(GT_Refine& refiner,
79  const GT_RefineParms* parms=NULL) const override;
80 
81  // -------------------------------------------------------------------------
82 
83 public:
84 
85  static GT_PrimitiveHandle
86  defineForWrite(const GT_PrimitiveHandle& sourcePrim,
87  const UsdStagePtr& stage,
88  const SdfPath& path,
89  const GusdContext& ctxt);
90 
91  static GT_PrimitiveHandle
92  defineForRead( const UsdGeomImageable& sourcePrim,
94  GusdPurposeSet purposes );
95 
96 private:
97  bool initUsdPrim(const UsdStagePtr& stage,
98  const SdfPath& path,
99  bool asOverride);
100 
101  UsdGeomPoints m_usdPoints;
102 };
103 
105 
106 #endif // __GUSD_POINTSWRAPPER_H__
107 
A GT_Primitive that wraps a USD Prim.
Definition: primWrapper.h:89
GT_API const UT_StringHolder time
virtual const char * className() const override
long long int64
Definition: SYS_Types.h:111
virtual GT_PrimitiveHandle doSoftCopy() const override
virtual ~GusdPointsWrapper()
virtual const UsdGeomImageable getUsdPrim() const override
Definition: pointsWrapper.h:52
virtual int getMotionSegments() const override
Definition: path.h:287
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
GLsizei const GLchar *const * path
Definition: glew.h:6461
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
static GT_PrimitiveHandle defineForWrite(const GT_PrimitiveHandle &sourcePrim, const UsdStagePtr &stage, const SdfPath &path, const GusdContext &ctxt)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
virtual bool isValid() const override
Return true if the underlying USD prim is valid.
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const override
virtual bool redefine(const UsdStagePtr &stage, const SdfPath &path, const GusdContext &ctxt, const GT_PrimitiveHandle &sourcePrim) override
Create a new USD prim to match GT primitive.
GusdPointsWrapper(const UsdStagePtr &stage, const SdfPath &path, bool isOverride=false)
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override
static GT_PrimitiveHandle defineForRead(const UsdGeomImageable &sourcePrim, UsdTimeCode time, GusdPurposeSet purposes)
GusdPurposeSet
Definition: purpose.h:39
virtual bool updateFromGTPrim(const GT_PrimitiveHandle &sourcePrim, const UT_Matrix4D &houXform, const GusdContext &ctxt, GusdSimpleXformCache &xformCache) override
virtual int64 getMemoryUsage() const override
std::map< SdfPath, UT_Matrix4D > GusdSimpleXformCache
Definition: primWrapper.h:87
GLdouble GLdouble t
Definition: glew.h:1398