Loading...
Searching...
No Matches
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"
32#include "pxr/usd/usd/prim.h"
33#include "pxr/usd/usd/stage.h"
35
36#include "pxr/usd/usdGeom/bboxCache.h"
37#include "pxr/usd/usdGeom/constraintTarget.h"
39
40#include "pxr/base/vt/value.h"
41
42#include "pxr/base/gf/vec3d.h"
43#include "pxr/base/gf/vec3f.h"
45
46#include "pxr/base/tf/token.h"
47#include "pxr/base/tf/type.h"
48
49PXR_NAMESPACE_OPEN_SCOPE
50
51class SdfAssetPath;
52
53// -------------------------------------------------------------------------- //
54// GEOMMODELAPI //
55// -------------------------------------------------------------------------- //
56
154{
155public:
159 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
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 // MODELCARDTEXTUREXPOS
369 // --------------------------------------------------------------------- //
378 USDGEOM_API
380
386 USDGEOM_API
387 UsdAttribute CreateModelCardTextureXPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
388
389public:
390 // --------------------------------------------------------------------- //
391 // MODELCARDTEXTUREYPOS
392 // --------------------------------------------------------------------- //
401 USDGEOM_API
403
409 USDGEOM_API
410 UsdAttribute CreateModelCardTextureYPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
411
412public:
413 // --------------------------------------------------------------------- //
414 // MODELCARDTEXTUREZPOS
415 // --------------------------------------------------------------------- //
424 USDGEOM_API
426
432 USDGEOM_API
433 UsdAttribute CreateModelCardTextureZPosAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
434
435public:
436 // --------------------------------------------------------------------- //
437 // MODELCARDTEXTUREXNEG
438 // --------------------------------------------------------------------- //
447 USDGEOM_API
449
455 USDGEOM_API
456 UsdAttribute CreateModelCardTextureXNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
457
458public:
459 // --------------------------------------------------------------------- //
460 // MODELCARDTEXTUREYNEG
461 // --------------------------------------------------------------------- //
470 USDGEOM_API
472
478 USDGEOM_API
479 UsdAttribute CreateModelCardTextureYNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
480
481public:
482 // --------------------------------------------------------------------- //
483 // MODELCARDTEXTUREZNEG
484 // --------------------------------------------------------------------- //
493 USDGEOM_API
495
501 USDGEOM_API
502 UsdAttribute CreateModelCardTextureZNegAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
503
504public:
505 // ===================================================================== //
506 // Feel free to add custom code below this line, it will be preserved by
507 // the code generator.
508 //
509 // Just remember to:
510 // - Close the class declaration with };
511 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
512 // - Close the include guard with #endif
513 // ===================================================================== //
514 // --(BEGIN CUSTOM CODE)--
515
522
564 USDGEOM_API
565 bool GetExtentsHint(VtVec3fArray *extents,
566 const UsdTimeCode &time = UsdTimeCode::Default()) const;
567
572 USDGEOM_API
573 bool SetExtentsHint(VtVec3fArray const &extents,
574 const UsdTimeCode &time = UsdTimeCode::Default()) const;
575
577 USDGEOM_API
579
610 USDGEOM_API
611 VtVec3fArray ComputeExtentsHint(UsdGeomBBoxCache& bboxCache) const;
612
614
621
627 USDGEOM_API
629 const std::string &constraintName) const;
630
636 USDGEOM_API
638 const std::string &constraintName) const;
639
645 USDGEOM_API
646 std::vector<UsdGeomConstraintTarget> GetConstraintTargets() const;
647
649
669 USDGEOM_API
670 TfToken ComputeModelDrawMode(const TfToken &parentDrawMode=TfToken()) const;
671};
672
673
674PXR_NAMESPACE_CLOSE_SCOPE
675
676#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
TfType represents a dynamic runtime type.
Definition: type.h:65
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
Caches bounds by recursively computing and aggregating bounds of children in world space and aggregat...
Definition: bboxCache.h:88
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...
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: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:134
The base class for all schema types in Usd.
Definition: schemaBase.h:56
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:84
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:112
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:129
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:457