Loading...
Searching...
No Matches
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
154{
155public:
160
165 explicit UsdGeomModelAPI(const UsdPrim& prim=UsdPrim())
166 : UsdAPISchemaBase(prim)
167 {
168 }
169
173 explicit UsdGeomModelAPI(const UsdSchemaBase& schemaObj)
174 : UsdAPISchemaBase(schemaObj)
175 {
176 }
177
179 USDGEOM_API
181
185 USDGEOM_API
186 static const TfTokenVector &
187 GetSchemaAttributeNames(bool includeInherited=true);
188
198 USDGEOM_API
199 static UsdGeomModelAPI
200 Get(const UsdStagePtr &stage, const SdfPath &path);
201
202
219 USDGEOM_API
220 static bool
221 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
222
238 USDGEOM_API
239 static UsdGeomModelAPI
240 Apply(const UsdPrim &prim);
241
242protected:
246 USDGEOM_API
248
249private:
250 // needs to invoke _GetStaticTfType.
251 friend class UsdSchemaRegistry;
252 USDGEOM_API
253 static const TfType &_GetStaticTfType();
254
255 static bool _IsTypedSchema();
256
257 // override SchemaBase virtuals.
258 USDGEOM_API
259 const TfType &_GetTfType() const override;
260
261public:
262 // --------------------------------------------------------------------- //
263 // MODELDRAWMODE
264 // --------------------------------------------------------------------- //
278 USDGEOM_API
280
286 USDGEOM_API
287 UsdAttribute CreateModelDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
288
289public:
290 // --------------------------------------------------------------------- //
291 // MODELAPPLYDRAWMODE
292 // --------------------------------------------------------------------- //
303 USDGEOM_API
305
311 USDGEOM_API
312 UsdAttribute CreateModelApplyDrawModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
313
314public:
315 // --------------------------------------------------------------------- //
316 // MODELDRAWMODECOLOR
317 // --------------------------------------------------------------------- //
329 USDGEOM_API
331
337 USDGEOM_API
338 UsdAttribute CreateModelDrawModeColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
339
340public:
341 // --------------------------------------------------------------------- //
342 // MODELCARDGEOMETRY
343 // --------------------------------------------------------------------- //
355 USDGEOM_API
357
363 USDGEOM_API
364 UsdAttribute CreateModelCardGeometryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
365
366public:
367 // --------------------------------------------------------------------- //
368 // MODELCARDVISIBILITY
369 // --------------------------------------------------------------------- //
380 USDGEOM_API
382
388 USDGEOM_API
389 UsdAttribute CreateModelCardVisibilityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
390
391public:
392 // --------------------------------------------------------------------- //
393 // MODELCARDTEXTUREXPOS
394 // --------------------------------------------------------------------- //
403 USDGEOM_API
405
411 USDGEOM_API
412 UsdAttribute CreateModelCardTextureXPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
413
414public:
415 // --------------------------------------------------------------------- //
416 // MODELCARDTEXTUREYPOS
417 // --------------------------------------------------------------------- //
426 USDGEOM_API
428
434 USDGEOM_API
435 UsdAttribute CreateModelCardTextureYPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
436
437public:
438 // --------------------------------------------------------------------- //
439 // MODELCARDTEXTUREZPOS
440 // --------------------------------------------------------------------- //
449 USDGEOM_API
451
457 USDGEOM_API
458 UsdAttribute CreateModelCardTextureZPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
459
460public:
461 // --------------------------------------------------------------------- //
462 // MODELCARDTEXTUREXNEG
463 // --------------------------------------------------------------------- //
472 USDGEOM_API
474
480 USDGEOM_API
481 UsdAttribute CreateModelCardTextureXNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
482
483public:
484 // --------------------------------------------------------------------- //
485 // MODELCARDTEXTUREYNEG
486 // --------------------------------------------------------------------- //
495 USDGEOM_API
497
503 USDGEOM_API
504 UsdAttribute CreateModelCardTextureYNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
505
506public:
507 // --------------------------------------------------------------------- //
508 // MODELCARDTEXTUREZNEG
509 // --------------------------------------------------------------------- //
518 USDGEOM_API
520
526 USDGEOM_API
527 UsdAttribute CreateModelCardTextureZNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
528
529public:
530 // ===================================================================== //
531 // Feel free to add custom code below this line, it will be preserved by
532 // the code generator.
533 //
534 // Just remember to:
535 // - Close the class declaration with };
536 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
537 // - Close the include guard with #endif
538 // ===================================================================== //
539 // --(BEGIN CUSTOM CODE)--
540
547
589 USDGEOM_API
590 bool GetExtentsHint(VtVec3fArray *extents,
591 const UsdTimeCode &time = UsdTimeCode::Default()) const;
592
597 USDGEOM_API
598 bool SetExtentsHint(VtVec3fArray const &extents,
599 const UsdTimeCode &time = UsdTimeCode::Default()) const;
600
602 USDGEOM_API
604
635 USDGEOM_API
636 VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache& bboxCache) const;
637
639
646
652 USDGEOM_API
654 const std::string &constraintName) const;
655
661 USDGEOM_API
663 const std::string &constraintName) const;
664
670 USDGEOM_API
671 std::vector<UsdGeomConstraintTarget> GetConstraintTargets() const;
672
674
694 USDGEOM_API
695 TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const;
696};
697
698
699PXR_NAMESPACE_CLOSE_SCOPE
700
701#endif
Contains an asset path and optional evaluated and resolved paths.
Definition assetPath.h:79
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
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.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition attribute.h:183
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:154
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:159
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...
USDGEOM_API UsdAttribute CreateModelCardVisibilityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetModelCardVisibilityAttr(), and also Create vs Get Property Methods for when to use Get vs Crea...
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.
USDGEOM_API UsdAttribute GetModelCardVisibilityAttr() const
When using the cards imaging mode, determines if cards in the upAxis direction should be visible.
UsdGeomModelAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomModelAPI on UsdPrim prim .
Definition modelAPI.h:165
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:173
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:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition timeCode.h:113
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition value.h:90
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition common.h:112
@ SingleApplyAPI
Single Apply API schema.
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