OpenVDB 12.1.0

Loading...
Searching...
No Matches
Functions.h
Go to the documentation of this file.
1// Copyright Contributors to the OpenVDB Project
2// SPDX-License-Identifier: Apache-2.0
3
4/// @file codegen/Functions.h
5///
6/// @authors Nick Avramoussis, Richard Jones, Francisco Gochez
7///
8/// @brief Contains the function objects that define the functions used in
9/// compute function generation, to be inserted into the FunctionRegistry.
10/// These define general purpose functions such as math functions.
11///
12
13#ifndef OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
14#define OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
15
16#include "FunctionRegistry.h"
17
18#include "../compiler/CompilerOptions.h"
19
20#include <openvdb/version.h>
21
22 namespace openvdb {
23 OPENVDB_USE_VERSION_NAMESPACE
24 namespace OPENVDB_VERSION_NAME {
25
26 namespace ax {
27 namespace codegen {
28
29/// @brief Creates a registry with the default set of registered functions
30/// including math functions, point functions and volume functions
31/// @param op The current function options
32///
33 inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op = nullptr);
34
35/// @brief Populates a function registry with all available "standard" AX
36/// library function. This primarily consists of all mathematical ops
37/// on AX containers (scalars, vectors, matrices) and other stl built-ins
38/// @param reg The function registry to populate
39/// @param options The current function options
40///
41 OPENVDB_AX_API void insertStandardFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
42
43/// @brief Populates a function registry with all available OpenVDB Point AX
44/// library function
45/// @param reg The function registry to populate
46/// @param options The current function options
47///
48 OPENVDB_AX_API void insertVDBPointFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
49
50/// @brief Populates a function registry with all available OpenVDB Volume AX
51/// library function
52/// @param reg The function registry to populate
53/// @param options The current function options
54///
55 OPENVDB_AX_API void insertVDBVolumeFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
56
57
58///////////////////////////////////////////////////////////////////////////
59///////////////////////////////////////////////////////////////////////////
60
61
62 inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op)
63{
64 FunctionRegistry::UniquePtr registry(new FunctionRegistry());
65 insertStandardFunctions(*registry, op);
66 insertVDBPointFunctions(*registry, op);
67 insertVDBVolumeFunctions(*registry, op);
68 return registry;
69}
70
71} // namespace codegen
72} // namespace ax
73} // namespace OPENVDB_VERSION_NAME
74} // namespace openvdb
75
76#endif // OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
77
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:312
openvdb::v12_1::ax::codegen::FunctionRegistry
The function registry which is used for function code generation. Each time a function is visited wit...
Definition FunctionRegistry.h:40
openvdb::v12_1::ax::codegen::FunctionRegistry::UniquePtr
std::unique_ptr< FunctionRegistry > UniquePtr
Definition FunctionRegistry.h:44
openvdb::v12_1::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::v12_1::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::v12_1::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::v12_1::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::v12_1::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:218