All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
modelAPI.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDGEOM_GENERATED_MODELAPI_H
8#define USDGEOM_GENERATED_MODELAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdGeom/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/usd/usdGeom/bboxCache.h"
20#include "pxr/usd/usdGeom/constraintTarget.h"
22
23#include "pxr/base/vt/value.h"
24
25#include "pxr/base/gf/vec3d.h"
26#include "pxr/base/gf/vec3f.h"
28
29#include "pxr/base/tf/token.h"
30#include "pxr/base/tf/type.h"
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34class SdfAssetPath;
35
36// -------------------------------------------------------------------------- //
37// GEOMMODELAPI //
38// -------------------------------------------------------------------------- //
39
137{
138public:
142 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
143
148 explicit UsdGeomModelAPI(const UsdPrim& prim=UsdPrim())
149 : UsdAPISchemaBase(prim)
150 {
151 }
152
156 explicit UsdGeomModelAPI(const UsdSchemaBase& schemaObj)
157 : UsdAPISchemaBase(schemaObj)
158 {
159 }
160
162 USDGEOM_API
164
168 USDGEOM_API
169 static const TfTokenVector &
170 GetSchemaAttributeNames(bool includeInherited=true);
171
181 USDGEOM_API
182 static UsdGeomModelAPI
183 Get(const UsdStagePtr &stage, const SdfPath &path);
184
185
202 USDGEOM_API
203 static bool
204 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
205
221 USDGEOM_API
222 static UsdGeomModelAPI
223 Apply(const UsdPrim &prim);
224
225protected:
229 USDGEOM_API
231
232private:
233 // needs to invoke _GetStaticTfType.
234 friend class UsdSchemaRegistry;
235 USDGEOM_API
236 static const TfType &_GetStaticTfType();
237
238 static bool _IsTypedSchema();
239
240 // override SchemaBase virtuals.
241 USDGEOM_API
242 const TfType &_GetTfType() const override;
243
244public:
245 // --------------------------------------------------------------------- //
246 // MODELDRAWMODE
247 // --------------------------------------------------------------------- //
261 USDGEOM_API
263
269 USDGEOM_API
270 UsdAttribute CreateModelDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
271
272public:
273 // --------------------------------------------------------------------- //
274 // MODELAPPLYDRAWMODE
275 // --------------------------------------------------------------------- //
286 USDGEOM_API
288
294 USDGEOM_API
295 UsdAttribute CreateModelApplyDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
296
297public:
298 // --------------------------------------------------------------------- //
299 // MODELDRAWMODECOLOR
300 // --------------------------------------------------------------------- //
312 USDGEOM_API
314
320 USDGEOM_API
321 UsdAttribute CreateModelDrawModeColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
322
323public:
324 // --------------------------------------------------------------------- //
325 // MODELCARDGEOMETRY
326 // --------------------------------------------------------------------- //
338 USDGEOM_API
340
346 USDGEOM_API
347 UsdAttribute CreateModelCardGeometryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
348
349public:
350 // --------------------------------------------------------------------- //
351 // MODELCARDTEXTUREXPOS
352 // --------------------------------------------------------------------- //
361 USDGEOM_API
363
369 USDGEOM_API
370 UsdAttribute CreateModelCardTextureXPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
371
372public:
373 // --------------------------------------------------------------------- //
374 // MODELCARDTEXTUREYPOS
375 // --------------------------------------------------------------------- //
384 USDGEOM_API
386
392 USDGEOM_API
393 UsdAttribute CreateModelCardTextureYPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
394
395public:
396 // --------------------------------------------------------------------- //
397 // MODELCARDTEXTUREZPOS
398 // --------------------------------------------------------------------- //
407 USDGEOM_API
409
415 USDGEOM_API
416 UsdAttribute CreateModelCardTextureZPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
417
418public:
419 // --------------------------------------------------------------------- //
420 // MODELCARDTEXTUREXNEG
421 // --------------------------------------------------------------------- //
430 USDGEOM_API
432
438 USDGEOM_API
439 UsdAttribute CreateModelCardTextureXNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
440
441public:
442 // --------------------------------------------------------------------- //
443 // MODELCARDTEXTUREYNEG
444 // --------------------------------------------------------------------- //
453 USDGEOM_API
455
461 USDGEOM_API
462 UsdAttribute CreateModelCardTextureYNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
463
464public:
465 // --------------------------------------------------------------------- //
466 // MODELCARDTEXTUREZNEG
467 // --------------------------------------------------------------------- //
476 USDGEOM_API
478
484 USDGEOM_API
485 UsdAttribute CreateModelCardTextureZNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
486
487public:
488 // ===================================================================== //
489 // Feel free to add custom code below this line, it will be preserved by
490 // the code generator.
491 //
492 // Just remember to:
493 // - Close the class declaration with };
494 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
495 // - Close the include guard with #endif
496 // ===================================================================== //
497 // --(BEGIN CUSTOM CODE)--
498
505
547 USDGEOM_API
548 bool GetExtentsHint(VtVec3fArray *extents,
549 const UsdTimeCode &time = UsdTimeCode::Default()) const;
550
555 USDGEOM_API
556 bool SetExtentsHint(VtVec3fArray const &extents,
557 const UsdTimeCode &time = UsdTimeCode::Default()) const;
558
560 USDGEOM_API
562
593 USDGEOM_API
594 VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache& bboxCache) const;
595
597
604
610 USDGEOM_API
612 const std::string &constraintName) const;
613
619 USDGEOM_API
621 const std::string &constraintName) const;
622
628 USDGEOM_API
629 std::vector<UsdGeomConstraintTarget> GetConstraintTargets() const;
630
632
652 USDGEOM_API
653 TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const;
654};
655
656
657PXR_NAMESPACE_CLOSE_SCOPE
658
659#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
Caches bounds by recursively computing and aggregating bounds of children in world space and aggregat...
Definition: bboxCache.h:71
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are constraint target...
UsdGeomModelAPI extends the generic UsdModelAPI schema with geometry specific concepts such as cached...
Definition: modelAPI.h:137
USDGEOM_API UsdAttribute GetModelDrawModeAttr() const
Alternate imaging mode; applied to this prim or child prims where model:applyDrawMode is true,...
USDGEOM_API UsdAttribute GetExtentsHintAttr() const
Returns the custom 'extentsHint' attribute if it exits.
USDGEOM_API UsdAttribute GetModelCardTextureXPosAttr() const
In cards imaging mode, the texture applied to the X+ quad.
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.
USDGEOM_API UsdAttribute GetModelCardGeometryAttr() const
The geometry to generate for imaging prims inserted for cards imaging mode.
USDGEOM_API TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const
Calculate the effective model:drawMode of this prim.
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...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: modelAPI.h:142
USDGEOM_API UsdAttribute GetModelApplyDrawModeAttr() const
If true, and the resolved value of model:drawMode is non-default, apply an alternate imaging mode to ...
USDGEOM_API UsdAttribute GetModelCardTextureZPosAttr() const
In cards imaging mode, the texture applied to the Z+ quad.
USDGEOM_API bool GetExtentsHint(VtVec3fArray *extents, const UsdTimeCode &time=UsdTimeCode::Default()) const
Retrieve the authored value (if any) of this model's "extentsHint".
static USDGEOM_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
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.
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 UsdAttribute GetModelCardTextureXNegAttr() const
In cards imaging mode, the texture applied to the X- quad.
USDGEOM_API UsdAttribute GetModelCardTextureZNegAttr() const
In cards imaging mode, the texture applied to the Z- quad.
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...
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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 GetModelDrawModeColorAttr() const
The base color of imaging prims inserted for alternate imaging modes.
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...
USDGEOM_API UsdGeomConstraintTarget GetConstraintTarget(const std::string &constraintName) const
Get the constraint target with the given name, constraintName.
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...
virtual USDGEOM_API ~UsdGeomModelAPI()
Destructor.
USDGEOM_API VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache &bboxCache) const
Compute a value suitable for passing to SetExtentsHint().
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...
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 UsdGeomConstraintTarget CreateConstraintTarget(const std::string &constraintName) const
Creates a new constraint target with the given name, constraintName.
UsdGeomModelAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomModelAPI on UsdPrim prim .
Definition: modelAPI.h:148
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...
UsdGeomModelAPI(const UsdSchemaBase &schemaObj)
Construct a UsdGeomModelAPI on the prim held by schemaObj .
Definition: modelAPI.h:156
USDGEOM_API UsdAttribute GetModelCardTextureYNegAttr() const
In cards imaging mode, the texture applied to the Y- quad.
static USDGEOM_API UsdGeomModelAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
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...
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.
USDGEOM_API bool SetExtentsHint(VtVec3fArray const &extents, const UsdTimeCode &time=UsdTimeCode::Default()) const
Authors the extentsHint array for this model at the given time.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:67
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:95
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440