All Classes Files Functions Variables Pages
physxForceFieldAPI.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 FORCEFIELDSCHEMA_GENERATED_PHYSXFORCEFIELDAPI_H
25 #define FORCEFIELDSCHEMA_GENERATED_PHYSXFORCEFIELDAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include ".//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 ".//tokens.h"
35 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
45 PXR_NAMESPACE_OPEN_SCOPE
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // PHYSXFORCEFIELDAPI //
51 // -------------------------------------------------------------------------- //
52 
57 class ForceFieldSchemaPhysxForceFieldAPI : public UsdAPISchemaBase
58 {
59 public:
63  static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
64 
75  const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
76  : UsdAPISchemaBase(prim, /*instanceName*/ name)
77  { }
78 
84  const UsdSchemaBase& schemaObj, const TfToken &name)
85  : UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
86  { }
87 
89  FORCEFIELDSCHEMA_API
91 
95  FORCEFIELDSCHEMA_API
96  static const TfTokenVector &
97  GetSchemaAttributeNames(bool includeInherited=true);
98 
104  FORCEFIELDSCHEMA_API
105  static TfTokenVector
106  GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName);
107 
109  TfToken GetName() const {
110  return _GetInstanceName();
111  }
112 
127  FORCEFIELDSCHEMA_API
129  Get(const UsdStagePtr &stage, const SdfPath &path);
130 
133  FORCEFIELDSCHEMA_API
135  Get(const UsdPrim &prim, const TfToken &name);
136 
139  FORCEFIELDSCHEMA_API
140  static std::vector<ForceFieldSchemaPhysxForceFieldAPI>
141  GetAll(const UsdPrim &prim);
142 
145  FORCEFIELDSCHEMA_API
146  static bool
147  IsSchemaPropertyBaseName(const TfToken &baseName);
148 
152  FORCEFIELDSCHEMA_API
153  static bool
154  IsPhysxForceFieldAPIPath(const SdfPath &path, TfToken *name);
155 
172  FORCEFIELDSCHEMA_API
173  static bool
174  CanApply(const UsdPrim &prim, const TfToken &name,
175  std::string *whyNot=nullptr);
176 
196  FORCEFIELDSCHEMA_API
198  Apply(const UsdPrim &prim, const TfToken &name);
199 
200 protected:
204  FORCEFIELDSCHEMA_API
205  UsdSchemaKind _GetSchemaKind() const override;
206 
207 private:
208  // needs to invoke _GetStaticTfType.
209  friend class UsdSchemaRegistry;
210  FORCEFIELDSCHEMA_API
211  static const TfType &_GetStaticTfType();
212 
213  static bool _IsTypedSchema();
214 
215  // override SchemaBase virtuals.
216  FORCEFIELDSCHEMA_API
217  const TfType &_GetTfType() const override;
218 
219 public:
220  // --------------------------------------------------------------------- //
221  // ENABLED
222  // --------------------------------------------------------------------- //
230  FORCEFIELDSCHEMA_API
231  UsdAttribute GetEnabledAttr() const;
232 
238  FORCEFIELDSCHEMA_API
239  UsdAttribute CreateEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
240 
241 public:
242  // --------------------------------------------------------------------- //
243  // SURFACESAMPLEDENSITY
244  // --------------------------------------------------------------------- //
263  FORCEFIELDSCHEMA_API
264  UsdAttribute GetSurfaceSampleDensityAttr() const;
265 
271  FORCEFIELDSCHEMA_API
272  UsdAttribute CreateSurfaceSampleDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
273 
274 public:
275  // --------------------------------------------------------------------- //
276  // SURFACEAREASCALEENABLED
277  // --------------------------------------------------------------------- //
291  FORCEFIELDSCHEMA_API
292  UsdAttribute GetSurfaceAreaScaleEnabledAttr() const;
293 
299  FORCEFIELDSCHEMA_API
300  UsdAttribute CreateSurfaceAreaScaleEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
301 
302 public:
303  // --------------------------------------------------------------------- //
304  // POSITION
305  // --------------------------------------------------------------------- //
314  FORCEFIELDSCHEMA_API
315  UsdAttribute GetPositionAttr() const;
316 
322  FORCEFIELDSCHEMA_API
323  UsdAttribute CreatePositionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
324 
325 public:
326  // --------------------------------------------------------------------- //
327  // RANGE
328  // --------------------------------------------------------------------- //
341  FORCEFIELDSCHEMA_API
342  UsdAttribute GetRangeAttr() const;
343 
349  FORCEFIELDSCHEMA_API
350  UsdAttribute CreateRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
351 
352 public:
353  // ===================================================================== //
354  // Feel free to add custom code below this line, it will be preserved by
355  // the code generator.
356  //
357  // Just remember to:
358  // - Close the class declaration with };
359  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
360  // - Close the include guard with #endif
361  // ===================================================================== //
362  // --(BEGIN CUSTOM CODE)--
363 };
364 
365 PXR_NAMESPACE_CLOSE_SCOPE
366 
367 #endif
FORCEFIELDSCHEMA_API UsdAttribute CreateSurfaceAreaScaleEnabledAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSurfaceAreaScaleEnabledAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Crea...
FORCEFIELDSCHEMA_API UsdAttribute GetEnabledAttr() const
Enable or disable this ForceField.
static FORCEFIELDSCHEMA_API bool IsPhysxForceFieldAPIPath(const SdfPath &path, TfToken *name)
Checks if the given path path is of an API schema of type PhysxForceFieldAPI.
FORCEFIELDSCHEMA_API UsdAttribute GetPositionAttr() const
The location of the force field.
static FORCEFIELDSCHEMA_API bool IsSchemaPropertyBaseName(const TfToken &baseName)
Checks if the given name baseName is the base name of a property of PhysxForceFieldAPI.
static FORCEFIELDSCHEMA_API ForceFieldSchemaPhysxForceFieldAPI Apply(const UsdPrim &prim, const TfToken &name)
Applies this multiple-apply API schema to the given prim along with the given instance name...
static FORCEFIELDSCHEMA_API ForceFieldSchemaPhysxForceFieldAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a ForceFieldSchemaPhysxForceFieldAPI holding the prim adhering to this schema at path on stage...
FORCEFIELDSCHEMA_API UsdAttribute GetRangeAttr() const
Forces are not applied when the distance to the force field is outside of this (minimum, maximum) range.
Force field base class that simply specifies the position and enables or disables the ForceField...
ForceFieldSchemaPhysxForceFieldAPI(const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken())
Construct a ForceFieldSchemaPhysxForceFieldAPI on UsdPrim prim with name name .
static FORCEFIELDSCHEMA_API std::vector< ForceFieldSchemaPhysxForceFieldAPI > GetAll(const UsdPrim &prim)
Return a vector of all named instances of ForceFieldSchemaPhysxForceFieldAPI on the given prim...
FORCEFIELDSCHEMA_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
FORCEFIELDSCHEMA_API UsdAttribute CreateRangeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetRangeAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
FORCEFIELDSCHEMA_API UsdAttribute CreateEnabledAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetEnabledAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create.
FORCEFIELDSCHEMA_API UsdAttribute CreatePositionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetPositionAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create...
FORCEFIELDSCHEMA_API UsdAttribute GetSurfaceAreaScaleEnabledAttr() const
Enable or disable scaling forces by the surface area that faces in the direction of the applied force...
FORCEFIELDSCHEMA_API UsdAttribute GetSurfaceSampleDensityAttr() const
Number of rays to cast per square unit of surface area.
FORCEFIELDSCHEMA_API UsdAttribute CreateSurfaceSampleDensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSurfaceSampleDensityAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create...
static FORCEFIELDSCHEMA_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...
virtual FORCEFIELDSCHEMA_API ~ForceFieldSchemaPhysxForceFieldAPI()
Destructor.
ForceFieldSchemaPhysxForceFieldAPI(const UsdSchemaBase &schemaObj, const TfToken &name)
Construct a ForceFieldSchemaPhysxForceFieldAPI on the prim held by schemaObj with name name...
static FORCEFIELDSCHEMA_API bool CanApply(const UsdPrim &prim, const TfToken &name, std::string *whyNot=nullptr)
Returns true if this multiple-apply API schema can be applied, with the given instance name...
TfToken GetName() const
Returns the name of this multiple-apply schema instance.