Bifrost SDK
Bifrost SDK documentation
Identifying a Geometry Primitive

Functions

BIFROST_GEOMETRY_DECL Amino::Ptr< Amino::Array< Amino::Ptr< Bifrost::Object > > > Bifrost::Geometry::getGeometryTypes ()
 Return a list of geometry prototypes, ordered from most to least specific. Can be used to find the type of an object, for example using the helper function Bifrost::Geometry::resolveType. More...
 
template<typename Prototypes >
decltype(auto) Bifrost::Geometry::findPrototype (Bifrost::Object const &obj, Prototypes const &prototypes)
 Finds the first prototype in the given prototypes such that the given object satisfies this prototype. More...
 
Common::GeometryType Bifrost::Geometry::resolveType (Bifrost::Object const &obj)
 Determine the type of an object. More...
 

Detailed Description

Functions for querying the "type" of a geometry.

Function Documentation

◆ findPrototype()

template<typename Prototypes >
decltype(auto) Bifrost::Geometry::findPrototype ( Bifrost::Object const &  obj,
Prototypes const &  prototypes 
)

Finds the first prototype in the given prototypes such that the given object satisfies this prototype.

Definition at line 65 of file Primitives.h.

References Bifrost::Object::isA().

Referenced by Bifrost::Geometry::resolveType().

◆ getGeometryTypes()

BIFROST_GEOMETRY_DECL Amino::Ptr< Amino::Array< Amino::Ptr< Bifrost::Object > > > Bifrost::Geometry::getGeometryTypes ( )

Return a list of geometry prototypes, ordered from most to least specific. Can be used to find the type of an object, for example using the helper function Bifrost::Geometry::resolveType.

The ordering of types is (from most to least specific)

  • Volume
  • Instances
  • Mesh
  • Strands
  • Point cloud
Returns
A const array of geometry prototypes.

Referenced by Bifrost::Geometry::resolveType().

◆ resolveType()

Common::GeometryType Bifrost::Geometry::resolveType ( Bifrost::Object const &  obj)
inline

Determine the type of an object.

Simply traverses all the geometry prototypes and returns the first one that matches.

Definition at line 76 of file Primitives.h.

References Bifrost::Geometry::findPrototype(), Bifrost::Geometry::getGeometryTypes(), and Bifrost::Geometry::Common::not_a_geometry.