Loading...
Searching...
No Matches
boundableComputeExtent.h File Reference
+ Include dependency graph for boundableComputeExtent.h:

Go to the source code of this file.

Typedefs

using UsdGeomComputeExtentFunction = bool(*)(const UsdGeomBoundable &, const UsdTimeCode &, const GfMatrix4d *, VtVec3fArray *)
 Function registered with UsdGeomRegisterComputeExtentFunction for computing extents for a Boundable prim at the given time and filling the given VtVec3fArray with the result.
 

Functions

template<class PrimType >
void UsdGeomRegisterComputeExtentFunction (const UsdGeomComputeExtentFunction &fn)
 Registers fn as the function to use for computing extents for Boundable prims of type PrimType by UsdGeomBoundable::ComputeExtentFromPlugins.
 
USDGEOM_API void UsdGeomRegisterComputeExtentFunction (const TfType &boundableType, const UsdGeomComputeExtentFunction &fn)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Typedef Documentation

◆ UsdGeomComputeExtentFunction

using UsdGeomComputeExtentFunction = bool(*)(const UsdGeomBoundable&, const UsdTimeCode&, const GfMatrix4d*, VtVec3fArray*)

Function registered with UsdGeomRegisterComputeExtentFunction for computing extents for a Boundable prim at the given time and filling the given VtVec3fArray with the result.

If an optional transform matrix is supplied, the extent is computed as if the object was first transformed by the matrix. If the transform matrix is nullptr, the extent is computed as if the identity matrix was passed.

The Boundable is guaranteed to be convertible to the prim type this function was registered with. The function must be thread-safe.
It should return true on success, false on failure.

Definition at line 52 of file boundableComputeExtent.h.

Function Documentation

◆ UsdGeomRegisterComputeExtentFunction() [1/2]

USDGEOM_API void UsdGeomRegisterComputeExtentFunction ( const TfType boundableType,
const UsdGeomComputeExtentFunction fn 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ UsdGeomRegisterComputeExtentFunction() [2/2]

void UsdGeomRegisterComputeExtentFunction ( const UsdGeomComputeExtentFunction fn)
inline

Registers fn as the function to use for computing extents for Boundable prims of type PrimType by UsdGeomBoundable::ComputeExtentFromPlugins.

PrimType must derive from UsdGeomBoundable.

Plugins should generally call this function in a TF_REGISTRY_FUNCTION. For example:

{
UsdGeomRegisterComputeExtentFunction<MyPrim>(MyComputeExtentFunction);
}
Boundable introduces the ability for a prim to persistently cache a rectilinear, local-space,...
Definition: boundable.h:83
#define TF_REGISTRY_FUNCTION(KEY_TYPE)
Define a function that is called on demand by TfRegistryManager.

Plugins must also note that this function is implemented for a prim type in that type's schema definition. For example:

class "MyPrim" (
...
customData = {
dictionary extraPlugInfo = {
bool implementsComputeExtent = true
}
}
...
)
{ ... }

This allows the plugin system to discover this function dynamically and load the plugin if needed.

Definition at line 91 of file boundableComputeExtent.h.