HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
packedUsdWrapper.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_PACKEDUSDWRAPPER_H__
25 #define __GUSD_PACKEDUSDWRAPPER_H__
26 
27 #include "primWrapper.h"
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdGeom/xform.h"
31 
33 
35 {
36 public:
37  GusdPackedUsdWrapper( const UsdStagePtr& stage, const SdfPath& path,
38  bool isOverride );
40  ~GusdPackedUsdWrapper() override;
41 
42  // GusdPrimWrapper interface -----------------------------------------------
43 
44 public:
45 
46  const UsdGeomImageable getUsdPrim() const override {
47  return UsdGeomImageable(m_primRef);
48  }
49 
50  bool redefine(
51  const UsdStagePtr& stage,
52  const SdfPath& path,
53  const GusdContext& ctxt,
54  const GT_PrimitiveHandle& sourcePrim ) override;
55 
56  const char* className() const override;
57 
58  void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
59 
60  int getMotionSegments() const override;
61 
62  int64 getMemoryUsage() const override;
63 
64  GT_PrimitiveHandle doSoftCopy() const override;
65 
66  bool
67  updateFromGTPrim(const GT_PrimitiveHandle& sourcePrim,
68  const UT_Matrix4D& houXform,
69  const GusdContext& ctxt,
70  GusdSimpleXformCache& xformCache) override;
71 
72  bool isValid() const override;
73 
74  // -------------------------------------------------------------------------
75 
76 public:
77 
78  static GT_PrimitiveHandle
79  defineForWrite( const GT_PrimitiveHandle& sourcePrim,
80  const UsdStagePtr& stage,
81  const SdfPath& path,
82  const GusdContext& ctxt);
83 
84 private:
85 
86  bool initUsdPrim( const UsdStagePtr& stage,
87  const SdfPath& path,
88  bool asOverride );
89 
90  UsdPrim m_primRef;
91 };
92 
94 
95 #endif // __GUSD_PACKEDUSDWRAPPER_H__
96 
static GT_PrimitiveHandle defineForWrite(const GT_PrimitiveHandle &sourcePrim, const UsdStagePtr &stage, const SdfPath &path, const GusdContext &ctxt)
A GT_Primitive that wraps a USD Prim.
Definition: primWrapper.h:90
GT_PrimitiveHandle doSoftCopy() const override
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int64 getMemoryUsage() const override
bool isValid() const override
Return true if the underlying USD prim is valid.
~GusdPackedUsdWrapper() override
GusdPackedUsdWrapper(const UsdStagePtr &stage, const SdfPath &path, bool isOverride)
long long int64
Definition: SYS_Types.h:116
Definition: prim.h:133
bool updateFromGTPrim(const GT_PrimitiveHandle &sourcePrim, const UT_Matrix4D &houXform, const GusdContext &ctxt, GusdSimpleXformCache &xformCache) override
Definition: path.h:290
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
const UsdGeomImageable getUsdPrim() const override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
const char * className() const override
int getMotionSegments() const override
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.
std::map< SdfPath, UT_Matrix4D > GusdSimpleXformCache
Definition: primWrapper.h:88
void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override