All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
modelAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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 USDGEOM_GENERATED_MODELAPI_H
25 #define USDGEOM_GENERATED_MODELAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdGeom/api.h"
31 #include "pxr/usd/usd/apiSchemaBase.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usdGeom/tokens.h"
35 
36 #include "pxr/usd/usdGeom/bboxCache.h"
37 #include "pxr/usd/usdGeom/constraintTarget.h"
38 #include "pxr/usd/usdGeom/imageable.h"
39 
40 #include "pxr/base/vt/value.h"
41 
42 #include "pxr/base/gf/vec3d.h"
43 #include "pxr/base/gf/vec3f.h"
44 #include "pxr/base/gf/matrix4d.h"
45 
46 #include "pxr/base/tf/token.h"
47 #include "pxr/base/tf/type.h"
48 
49 PXR_NAMESPACE_OPEN_SCOPE
50 
51 class SdfAssetPath;
52 
53 // -------------------------------------------------------------------------- //
54 // GEOMMODELAPI //
55 // -------------------------------------------------------------------------- //
56 
147 {
148 public:
153 
158  explicit UsdGeomModelAPI(const UsdPrim& prim=UsdPrim())
159  : UsdAPISchemaBase(prim)
160  {
161  }
162 
166  explicit UsdGeomModelAPI(const UsdSchemaBase& schemaObj)
167  : UsdAPISchemaBase(schemaObj)
168  {
169  }
170 
172  USDGEOM_API
173  virtual ~UsdGeomModelAPI();
174 
178  USDGEOM_API
179  static const TfTokenVector &
180  GetSchemaAttributeNames(bool includeInherited=true);
181 
191  USDGEOM_API
192  static UsdGeomModelAPI
193  Get(const UsdStagePtr &stage, const SdfPath &path);
194 
195 
208  USDGEOM_API
209  static UsdGeomModelAPI
210  Apply(const UsdPrim &prim);
211 
212 protected:
216  USDGEOM_API
217  UsdSchemaType _GetSchemaType() const override;
218 
219 private:
220  // needs to invoke _GetStaticTfType.
221  friend class UsdSchemaRegistry;
222  USDGEOM_API
223  static const TfType &_GetStaticTfType();
224 
225  static bool _IsTypedSchema();
226 
227  // override SchemaBase virtuals.
228  USDGEOM_API
229  const TfType &_GetTfType() const override;
230 
231 public:
232  // --------------------------------------------------------------------- //
233  // MODELDRAWMODE
234  // --------------------------------------------------------------------- //
245  USDGEOM_API
247 
253  USDGEOM_API
254  UsdAttribute CreateModelDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
255 
256 public:
257  // --------------------------------------------------------------------- //
258  // MODELAPPLYDRAWMODE
259  // --------------------------------------------------------------------- //
268  USDGEOM_API
270 
276  USDGEOM_API
277  UsdAttribute CreateModelApplyDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
278 
279 public:
280  // --------------------------------------------------------------------- //
281  // MODELDRAWMODECOLOR
282  // --------------------------------------------------------------------- //
293  USDGEOM_API
295 
301  USDGEOM_API
302  UsdAttribute CreateModelDrawModeColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
303 
304 public:
305  // --------------------------------------------------------------------- //
306  // MODELCARDGEOMETRY
307  // --------------------------------------------------------------------- //
318  USDGEOM_API
320 
326  USDGEOM_API
327  UsdAttribute CreateModelCardGeometryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
328 
329 public:
330  // --------------------------------------------------------------------- //
331  // MODELCARDTEXTUREXPOS
332  // --------------------------------------------------------------------- //
340  USDGEOM_API
342 
348  USDGEOM_API
349  UsdAttribute CreateModelCardTextureXPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
350 
351 public:
352  // --------------------------------------------------------------------- //
353  // MODELCARDTEXTUREYPOS
354  // --------------------------------------------------------------------- //
362  USDGEOM_API
364 
370  USDGEOM_API
371  UsdAttribute CreateModelCardTextureYPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
372 
373 public:
374  // --------------------------------------------------------------------- //
375  // MODELCARDTEXTUREZPOS
376  // --------------------------------------------------------------------- //
384  USDGEOM_API
386 
392  USDGEOM_API
393  UsdAttribute CreateModelCardTextureZPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
394 
395 public:
396  // --------------------------------------------------------------------- //
397  // MODELCARDTEXTUREXNEG
398  // --------------------------------------------------------------------- //
406  USDGEOM_API
408 
414  USDGEOM_API
415  UsdAttribute CreateModelCardTextureXNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
416 
417 public:
418  // --------------------------------------------------------------------- //
419  // MODELCARDTEXTUREYNEG
420  // --------------------------------------------------------------------- //
428  USDGEOM_API
430 
436  USDGEOM_API
437  UsdAttribute CreateModelCardTextureYNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
438 
439 public:
440  // --------------------------------------------------------------------- //
441  // MODELCARDTEXTUREZNEG
442  // --------------------------------------------------------------------- //
450  USDGEOM_API
452 
458  USDGEOM_API
459  UsdAttribute CreateModelCardTextureZNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
460 
461 public:
462  // ===================================================================== //
463  // Feel free to add custom code below this line, it will be preserved by
464  // the code generator.
465  //
466  // Just remember to:
467  // - Close the class declaration with };
468  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
469  // - Close the include guard with #endif
470  // ===================================================================== //
471  // --(BEGIN CUSTOM CODE)--
472 
479 
521  USDGEOM_API
522  bool GetExtentsHint(VtVec3fArray *extents,
523  const UsdTimeCode &time = UsdTimeCode::Default()) const;
524 
529  USDGEOM_API
530  bool SetExtentsHint(VtVec3fArray const &extents,
531  const UsdTimeCode &time = UsdTimeCode::Default()) const;
532 
534  USDGEOM_API
536 
544  USDGEOM_API
545  VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache& bboxCache) const;
546 
548 
555 
561  USDGEOM_API
563  const std::string &constraintName) const;
564 
570  USDGEOM_API
572  const std::string &constraintName) const;
573 
579  USDGEOM_API
580  std::vector<UsdGeomConstraintTarget> GetConstraintTargets() const;
581 
583 
603  USDGEOM_API
604  TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const;
605 };
606 
607 
608 PXR_NAMESPACE_CLOSE_SCOPE
609 
610 #endif
USDGEOM_API UsdAttribute CreateModelDrawModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelDrawModeAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
UsdGeomModelAPI extends the generic UsdModelAPI schema with geometry specific concepts such as cached...
Definition: modelAPI.h:146
USDGEOM_API UsdAttribute CreateModelCardTextureZPosAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureZPosAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
static USDGEOM_API UsdGeomModelAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomModelAPI holding the prim adhering to this schema at path on stage.
static const UsdSchemaType schemaType
Compile time constant representing what kind of schema this class is.
Definition: modelAPI.h:152
USDGEOM_API UsdAttribute GetModelCardTextureZNegAttr() const
In cards imaging mode, the texture applied to the Z- quad.
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are constraint target...
virtual USDGEOM_API ~UsdGeomModelAPI()
Destructor.
USDGEOM_API UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
Caches bounds by recursively computing and aggregating bounds of children in world space and aggregat...
Definition: bboxCache.h:87
The base class for all API schemas.
USDGEOM_API UsdAttribute CreateModelDrawModeColorAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelDrawModeColorAttr(), and also Create vs Get Property Methods for when to use Get vs Creat...
USDGEOM_API UsdAttribute CreateModelCardTextureZNegAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureZNegAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
USDGEOM_API UsdAttribute CreateModelCardTextureYNegAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureYNegAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
USDGEOM_API bool SetExtentsHint(VtVec3fArray const &extents, const UsdTimeCode &time=UsdTimeCode::Default()) const
Authors the extentsHint array for this model at the given time.
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDGEOM_API UsdAttribute CreateModelCardTextureXNegAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureXNegAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
USDGEOM_API std::vector< UsdGeomConstraintTarget > GetConstraintTargets() const
Returns all the constraint targets belonging to the model.
USDGEOM_API UsdAttribute GetModelCardTextureYPosAttr() const
In cards imaging mode, the texture applied to the Y+ quad.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
USDGEOM_API TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const
Calculate the effective model:drawMode of this prim, as defined by its closest ancestral authored opi...
USDGEOM_API UsdAttribute CreateModelCardTextureYPosAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureYPosAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...
USDGEOM_API UsdAttribute GetModelCardGeometryAttr() const
The geometry to generate for imaging prims inserted for cards imaging mode.
USDGEOM_API UsdAttribute CreateModelApplyDrawModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelApplyDrawModeAttr(), and also Create vs Get Property Methods for when to use Get vs Creat...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
USDGEOM_API UsdAttribute CreateModelCardGeometryAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardGeometryAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDGEOM_API bool GetExtentsHint(VtVec3fArray *extents, const UsdTimeCode &time=UsdTimeCode::Default()) const
Retrieve the authored value (if any) of this model&#39;s &quot;extentsHint&quot;.
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:149
static USDGEOM_API UsdGeomModelAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
USDGEOM_API UsdAttribute GetExtentsHintAttr() const
Returns the custom &#39;extentsHint&#39; attribute if it exits.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
Single Apply API schema.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
USDGEOM_API UsdAttribute GetModelApplyDrawModeAttr() const
If true, and this prim or parent prims have model:drawMode set, apply an alternate imaging mode to th...
UsdGeomModelAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomModelAPI on UsdPrim prim .
Definition: modelAPI.h:158
USDGEOM_API UsdAttribute GetModelDrawModeAttr() const
Alternate imaging mode; applied to this prim or child prims where model:applyDrawMode is true...
USDGEOM_API UsdGeomConstraintTarget CreateConstraintTarget(const std::string &constraintName) const
Creates a new constraint target with the given name, constraintName.
USDGEOM_API VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache &bboxCache) const
For the given model, compute the value for the extents hint with the given bboxCache.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43
USDGEOM_API UsdGeomConstraintTarget GetConstraintTarget(const std::string &constraintName) const
Get the constraint target with the given name, constraintName.
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for &#39;default&#39;.
Definition: timeCode.h:113
USDGEOM_API UsdAttribute GetModelCardTextureZPosAttr() const
In cards imaging mode, the texture applied to the Z+ quad.
TfType represents a dynamic runtime type.
Definition: type.h:70
Singleton registry that provides access to prim and property definition information for registered Us...
USDGEOM_API UsdAttribute GetModelDrawModeColorAttr() const
The base color of imaging prims inserted for alternate imaging modes.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
USDGEOM_API UsdAttribute GetModelCardTextureYNegAttr() const
In cards imaging mode, the texture applied to the Y- quad.
USDGEOM_API UsdAttribute GetModelCardTextureXNegAttr() const
In cards imaging mode, the texture applied to the X- quad.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
USDGEOM_API UsdAttribute GetModelCardTextureXPosAttr() const
In cards imaging mode, the texture applied to the X+ quad.
UsdGeomModelAPI(const UsdSchemaBase &schemaObj)
Construct a UsdGeomModelAPI on the prim held by schemaObj .
Definition: modelAPI.h:166
USDGEOM_API UsdAttribute CreateModelCardTextureXPosAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardTextureXPosAttr(), and also Create vs Get Property Methods for when to use Get vs Cre...