OpenVDB 13.0.0

Loading...
Searching...
No Matches
openvdb::v13_0::ax Namespace Reference

## Namespaces
namespace | ast
namespace | codegen
namespace | math

## Classes
class | AttributeBindings
| This class wraps an interface for a map of attribute bindings. These map attributes in AX code to context data. These mappings are one-to-one i.e. each AX name can only map to one data name, however each name can appear as either an AX name or data name or both, i.e. the following sets of bindings are valid: axname: a -> dataname: a axname: b -> dataname: c or axname: a -> dataname: b axname: b -> dataname: a. More...
class | AttributeRegistry
| This class stores a list of access names, types and their dependency connections. More...
class | Compiler
| The compiler class. This holds a set of compiler options and constructs executable objects (e.g. PointExecutable or VolumeExecutable) from a syntax tree or snippet of code. More...
struct | FunctionOptions
| Options that control how functions behave. More...
struct | CompilerOptions
| Settings which control how a Compiler class object behaves. More...
class | CustomData
| The custom data class is a simple container for named openvdb metadata. Its primary use case is passing arbitrary "external" data to an AX executable object when calling Compiler::compile. For example, it is the mechanism by which we pass data held inside of a parent DCC to executable AX code. More...
class | Logger
| Logger for collecting errors and warnings that occur during AX compilation. More...
class | PointExecutable
| Object that encapsulates compiled AX code which can be executed on a collection of VDB Point Data grids. Executables are created by the compiler and hold the final immutable JIT compiled function and context. More...
class | VolumeExecutable
| Object that encapsulates compiled AX code which can be executed on a collection of VDB volume grids. Executables are created by the compiler and hold the final immutable JIT compiled function and context. More...
class | TypedMetadata
| Templated metadata class to hold specific types. More...
struct | String
| An extremely basic but native representation of a string class with SSO support. This exists to provide an interface between the AX C++ API and backend IR string logic. It is not designed to fulfill any other use and should very rarely be used directly. More...

## Functions
OPENVDB_AX_API void | initialize ()
| Initializes OpenVDB AX and subsequent LLVM components.
OPENVDB_AX_API bool | isInitialized ()
| Check to see if OpenVDB AX components have been initialized.
OPENVDB_AX_API void | uninitialize ()
| Uninitialize and deregister OpenVDB AX.
OPENVDB_AX_API void | run (const char *ax, openvdb::GridBase &grid, const AttributeBindings &bindings={})
| Run a full AX pipeline (parse, compile and execute) on a single OpenVDB Grid.
OPENVDB_AX_API void | run (const char *ax, openvdb::GridPtrVec &grids, const AttributeBindings &bindings={})
| Run a full AX pipeline (parse, compile and execute) on a vector of OpenVDB numerical grids OR a vector of OpenVDB Point Data grids.
std::ostream & | operator<< (std::ostream &os, const AttributeBindings &bindings)

## Function Documentation

## ◆ initialize()

OPENVDB_AX_API void initialize | ( |  | ) |

Initializes OpenVDB AX and subsequent LLVM components.

Must be called before any AX compilation or execution is performed. Can be safely called from multiple threads. Cannot be called after uninitialize has been called.

## ◆ isInitialized()

OPENVDB_AX_API bool isInitialized | ( |  | ) |

Check to see if OpenVDB AX components have been initialized.

Note
  Can be safely called from multiple threads.

## ◆ operator<<()

std::ostream & operator<< | ( | std::ostream & | os,
|  | const AttributeBindings & | bindings )
| inline

## ◆ run() [1/2]

OPENVDB_AX_API void run | ( | const char * | ax,
|  | openvdb::GridBase & | grid,
|  | const AttributeBindings & | bindings = {} )

Run a full AX pipeline (parse, compile and execute) on a single OpenVDB Grid.

This method wraps the parsing, compilation and execution of AX code for a single OpenVDB grid of any standard grid type (including OpenVDB Points Grids). Provided AX code is expected to only refer to the provided single grid. On success, the grid will have its voxels or point data modified as dictated by the provided AX code.

Note
  Various defaults are applied to this pipeline to provide a simple run signature. For OpenVDB Numerical grids, only active voxels are processed. For OpenVDB Points grids, all points are processed. Any warnings generated by the parser, compiler or executable will be ignored.
  Various runtime errors may be thrown from the different AX pipeline stages. See Exceptions.h for the possible different errors.

Parameters

  ax | The null terminated AX code string to parse and compile
  grid | The grid to which to apply the compiled AX function
  bindings | An attribute bindings object mapping names in the AX string to names of the point attributes/grids (points/volumes resp.) This can be initialized as a vector of pairs of strings e.g. {{"axname0","dataname0"}, {"axname1","dataname1"}} see AttributeBindings.h for details.

## ◆ run() [2/2]

OPENVDB_AX_API void run | ( | const char * | ax,
|  | openvdb::GridPtrVec & | grids,
|  | const AttributeBindings & | bindings = {} )

Run a full AX pipeline (parse, compile and execute) on a vector of OpenVDB numerical grids OR a vector of OpenVDB Point Data grids.

This method wraps the parsing, compilation and execution of AX code for a vector of OpenVDB grids. The vector must contain either a set of any numerical grids supported by the default AX types OR a set of OpenVDB Points grids. On success, grids in the provided grid vector will be iterated over and updated if they are written to.

Warning
  The type of grids provided changes the type of AX compilation. If the vector is empty, this function immediately returns with no other effect.

Note
  Various defaults are applied to this pipeline to provide a simple run signature. For numerical grids, only active voxels are processed and missing grid creation is disabled. For OpenVDB Points grids, all points are processed. Any warnings generated by the parser, compiler or executable will be ignored.
  Various runtime errors may be thrown from the different AX pipeline stages. See Exceptions.h for the possible different errors.

Parameters

  ax | The null terminated AX code string to parse and compile
  grids | The grids to which to apply the compiled AX function
  bindings | An attribute bindings object mapping names in the AX string to names of the point attributes/grids (points/volumes resp.) This can be initialized as a vector of pairs of strings e.g. {{"axname0","dataname0"}, {"axname1","dataname1"}} see AttributeBindings.h for details.

## ◆ uninitialize()

OPENVDB_AX_API void uninitialize | ( |  | ) |

Uninitialize and deregister OpenVDB AX.

This has the important function of shutting down LLVM and correctly freeing statically allocated LLVM types. Should be called on application termination. Can be safely called from multiple threads.