Loading...
Searching...
No Matches
Functions.h
Go to the documentation of this file.
// Copyright Contributors to the OpenVDB Project
// SPDX-License-Identifier: MPL-2.0
/// @file codegen/Functions.h
///
/// @authors Nick Avramoussis, Richard Jones, Francisco Gochez
///
/// @brief Contains the function objects that define the functions used in
/// compute function generation, to be inserted into the FunctionRegistry.
/// These define general purpose functions such as math functions.
///
#ifndef OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
#define OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
#include "FunctionRegistry.h"
#include "../compiler/CompilerOptions.h"
#include <openvdb/version.h>
namespace openvdb {
OPENVDB_USE_VERSION_NAMESPACE
namespace OPENVDB_VERSION_NAME {
namespace ax {
namespace codegen {
/// @brief Creates a registry with the default set of registered functions
/// including math functions, point functions and volume functions
/// @param op The current function options
///
inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op = nullptr);
/// @brief Populates a function registry with all available "standard" AX
/// library function. This primarily consists of all mathematical ops
/// on AX containers (scalars, vectors, matrices) and other stl built-ins
/// @param reg The function registry to populate
/// @param options The current function options
///
OPENVDB_AX_API void insertStandardFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
/// @brief Populates a function registry with all available OpenVDB Point AX
/// library function
/// @param reg The function registry to populate
/// @param options The current function options
///
OPENVDB_AX_API void insertVDBPointFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
/// @brief Populates a function registry with all available OpenVDB Volume AX
/// library function
/// @param reg The function registry to populate
/// @param options The current function options
///
OPENVDB_AX_API void insertVDBVolumeFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op)
{
FunctionRegistry::UniquePtr registry(new FunctionRegistry);
insertStandardFunctions(*registry, op);
insertVDBPointFunctions(*registry, op);
insertVDBVolumeFunctions(*registry, op);
return registry;
}
} // namespace codegen
} // namespace ax
} // namespace OPENVDB_VERSION_NAME
} // namespace openvdb
#endif // OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
CompilerOptions.h
OpenVDB AX Compiler Options.
FunctionRegistry.h
Contains the global function registration definition which described all available user front end fun...
OPENVDB_AX_API
#define OPENVDB_AX_API
Definition Platform.h:272
openvdb::v10_0::ax::codegen::FunctionRegistry
The function registry which is used for function code generation. Each time a function is visited wit...
Definition FunctionRegistry.h:36
openvdb::v10_0::ax::codegen::FunctionRegistry::UniquePtr
std::unique_ptr< FunctionRegistry > UniquePtr
Definition FunctionRegistry.h:40
openvdb::v10_0::ax::codegen::createDefaultRegistry
FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions *op=nullptr)
Creates a registry with the default set of registered functions including math functions,...
Definition Functions.h:62
openvdb::v10_0::ax::codegen::insertVDBPointFunctions
OPENVDB_AX_API void insertVDBPointFunctions(FunctionRegistry &reg, const FunctionOptions *options=nullptr)
Populates a function registry with all available OpenVDB Point AX library function.
openvdb::v10_0::ax::codegen::insertVDBVolumeFunctions
OPENVDB_AX_API void insertVDBVolumeFunctions(FunctionRegistry &reg, const FunctionOptions *options=nullptr)
Populates a function registry with all available OpenVDB Volume AX library function.
openvdb::v10_0::ax::codegen::insertStandardFunctions
OPENVDB_AX_API void insertStandardFunctions(FunctionRegistry &reg, const FunctionOptions *options=nullptr)
Populates a function registry with all available "standard" AX library function. This primarily consi...
openvdb
Definition Exceptions.h:13
openvdb::v10_0::ax::FunctionOptions
Options that control how functions behave.
Definition CompilerOptions.h:25
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212