All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scopeWrapper.h
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_SCOPEWRAPPER_H__
25 #define __GUSD_SCOPEWRAPPER_H__
26 
27 #include "groupBaseWrapper.h"
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdGeom/scope.h"
31 
32 PXR_NAMESPACE_OPEN_SCOPE
33 
34 
35 class GusdScopeWrapper : public GusdGroupBaseWrapper
36 {
37 public:
38  GusdScopeWrapper( const UsdStagePtr& stage,
39  const SdfPath& path,
40  bool isOverride = false );
41  GusdScopeWrapper( const GusdScopeWrapper &in );
42  GusdScopeWrapper( const UsdGeomScope& scope,
43  UsdTimeCode t,
44  GusdPurposeSet purposes );
45  virtual ~GusdScopeWrapper();
46 
47  // GusdPrimWrapper interface -----------------------------------------------
48 
49 public:
50 
51  virtual const UsdGeomImageable getUsdPrim() const override { return m_usdScope; }
52 
53  virtual bool redefine(
54  const UsdStagePtr& stage,
55  const SdfPath& path,
56  const GusdContext& ctxt,
57  const GT_PrimitiveHandle& sourcePrim ) override;
58 
59  virtual const char* className() const override;
60 
61  virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const override;
62 
63  virtual int getMotionSegments() const override;
64 
65  virtual int64 getMemoryUsage() const override;
66 
67  virtual GT_PrimitiveHandle doSoftCopy() const override;
68 
69  virtual bool
70  updateFromGTPrim(const GT_PrimitiveHandle& sourcePrim,
71  const UT_Matrix4D& localXform,
72  const GusdContext& ctxt,
73  GusdSimpleXformCache& xformCache) override;
74 
75  virtual bool isValid() const override;
76 
77  virtual bool refine(GT_Refine& refiner,
78  const GT_RefineParms* parms=NULL) const override;
79 
80  // -------------------------------------------------------------------------
81 
82 public:
83 
84  static GT_PrimitiveHandle
85  defineForWrite(const GT_PrimitiveHandle& sourcePrim,
86  const UsdStagePtr& stage,
87  const SdfPath& path,
88  const GusdContext& ctxt);
89 
90  static GT_PrimitiveHandle
91  defineForRead( const UsdGeomImageable& sourcePrim,
92  UsdTimeCode time,
93  GusdPurposeSet purposes );
94 
95 private:
96 
97  bool initUsdPrim(const UsdStagePtr& stage,
98  const SdfPath& path,
99  bool asOverride);
100 
101  UsdGeomScope m_usdScope;
102 };
103 
104 PXR_NAMESPACE_CLOSE_SCOPE
105 
106 #endif // __GUSD_SCOPEWRAPPER_H__
107 
Scope is the simplest grouping primitive, and does not carry the baggage of transformability.
Definition: scope.h:59
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
A GusdContext structure is created by the ROPs that write USD files and passed to the GusdPrimWrapper...
Definition: context.h:46
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
Base class for all prims that may require rendering or visualization of some sort.
Definition: imageable.h:74