HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xformWrapper.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_XFORMWRAPPER_H__
25 #define __GUSD_XFORMWRAPPER_H__
26 
27 #include "pxr/pxr.h"
28 
29 #include "gusd/api.h"
30 
31 #include "groupBaseWrapper.h"
32 
34 
36 
37 
39 {
40 public:
41 
42  GUSD_API
44  const UsdStagePtr& stage,
45  const SdfPath& path,
46  bool isOverride = false );
47 
48  GUSD_API
49  GusdXformWrapper( const GusdXformWrapper& in );
50 
51  GUSD_API
53  const UsdGeomXformable& usdXform,
54  UsdTimeCode t,
55  GusdPurposeSet purposes );
56 
57  ~GusdXformWrapper() override;
58 
59  // GusdPrimWrapper interface -----------------------------------------------
60 
61 public:
62 
63  const UsdGeomImageable getUsdPrim() const override { return m_usdXform; }
64 
65  bool redefine(
66  const UsdStagePtr& stage,
67  const SdfPath& path,
68  const GusdContext& ctxt,
69  const GT_PrimitiveHandle& sourcePrim ) override;
70 
71  const char* className() const override;
72 
73  void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
74 
75  int getMotionSegments() const override;
76 
77  int64 getMemoryUsage() const override;
78 
79  GT_PrimitiveHandle doSoftCopy() const override;
80 
81  bool
82  updateFromGTPrim(const GT_PrimitiveHandle& sourcePrim,
83  const UT_Matrix4D& localXform,
84  const GusdContext& ctxt,
85  GusdSimpleXformCache& xformCache) override;
86 
87  bool isValid() const override;
88 
89  bool refine(GT_Refine& refiner,
90  const GT_RefineParms* parms=NULL) const override;
91 
92  // -------------------------------------------------------------------------
93 
94 public:
95 
96  static GT_PrimitiveHandle
97  defineForWrite(const GT_PrimitiveHandle& sourcePrim,
98  const UsdStagePtr& stage,
99  const SdfPath& path,
100  const GusdContext& ctxt);
101 
103  defineForRead( const UsdGeomImageable& sourcePrim,
105  GusdPurposeSet purposes );
106 
107 private:
108 
109  bool initUsdPrim(const UsdStagePtr& stage,
110  const SdfPath& path,
111  bool asOverride);
112 
113  UsdGeomXformable m_usdXform;
114 };
115 
117 #endif // __GUSD_XFORMWRAPPER_H__
118 
bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const override
GT_API const UT_StringHolder time
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int getMotionSegments() const override
static GT_PrimitiveHandle defineForWrite(const GT_PrimitiveHandle &sourcePrim, const UsdStagePtr &stage, const SdfPath &path, const GusdContext &ctxt)
void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override
GT_PrimitiveHandle doSoftCopy() const override
long long int64
Definition: SYS_Types.h:116
Definition: path.h:290
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.
GLdouble t
Definition: glad.h:2397
bool isValid() const override
Return true if the underlying USD prim is valid.
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
~GusdXformWrapper() override
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GUSD_API GusdXformWrapper(const UsdStagePtr &stage, const SdfPath &path, bool isOverride=false)
#define GUSD_API
Definition: api.h:40
bool updateFromGTPrim(const GT_PrimitiveHandle &sourcePrim, const UT_Matrix4D &localXform, const GusdContext &ctxt, GusdSimpleXformCache &xformCache) override
GusdPurposeSet
Definition: purpose.h:39
static GUSD_API GT_PrimitiveHandle defineForRead(const UsdGeomImageable &sourcePrim, UsdTimeCode time, GusdPurposeSet purposes)
int64 getMemoryUsage() const override
const char * className() const override
std::map< SdfPath, UT_Matrix4D > GusdSimpleXformCache
Definition: primWrapper.h:88
const UsdGeomImageable getUsdPrim() const override
Definition: xformWrapper.h:63