Extending HOOPS Exchange
By default, HOOPS Exchange does not load all functions exposed by the API. Some functions must be explicitly requested in order to access them.
HOOPS Exchange identifies two types of such functions: experimental and extensions. Both are enabled by defining a C macro, either at the compiler level or within the code.
Experimental Functions
Experimental functions are available when A3DAPI_EXPERIMENTAL
is defined.
This macro includes the A3DSDKExperimental.h header file, which is provided along with the standard headers.
When A3DAPI_EXPERIMENTAL
is defined, your compiler will output a message to highlight the use of experimental features.
Since HOOPS Exchange 2024.7.0, we introduce a first experimental feature with T-Junctions Detection and Removal.
Extension Functions
Extension functions are provided for specific use cases that fall outside the usual HOOPS Exchange API scope.
To enable them, define A3DAPI_EXTENSIONS
.
As of HOOPS Exchange 2025.4.0, no extension functions are available.
Deprecated Functions
Since HOOPS Exchange 2025.1.0, features deprecated in 2024 are provided as opt-in: they are available only when the A3DAPI_DEPRECATED
macro is defined.
To use them, define the A3DAPI_DEPRECATED
macro before every inclusion of the A3DSDKDeprecated.h header file, either directly or through the A3DSDKIncludes.h header.
It must also be defined beside the INITIALIZE_A3D_API
macro.
When A3DAPI_DEPRECATED
is defined, your compiler will output messages to highlight the use of deprecated features.
Examples
This code extends the example provided in Initializing HOOPS Exchange, enabling experimental features by defining A3DAPI_EXPERIMENTAL
on line 2.
#define INITIALIZE_A3D_API
#define A3DAPI_EXPERIMENTAL
#include <A3DSDKIncludes.h>
#include <hoops_license.h>
// Usual initialization code
int main(int argc, char* argv[])
{
A3DBool loaded = A3DSDKLoadLibraryA(PATH_TO_A3DLIBS_DIR);
assert(loaded);
A3DStatus result = A3DLicPutUnifiedLicense(HOOPS_LICENSE);
assert(result == A3D_SUCCESS);
result = A3DDllInitialize(A3D_DLL_MAJORVERSION, A3D_DLL_MINORVERSION);
assert(result == A3D_SUCCESS);
// HOOPS Exchange is now ready to use!
A3DDllTerminate();
A3DSDKUnloadLibrary();
return EXIT_SUCCESS;
}
A3DAPI_EXPERIMENTAL
and A3DAPI_EXTENSIONS
must also be defined in any source file that calls one of these additional functions.
This code extends the example provided in Initializing HOOPS Exchange, enabling deprecated features by defining A3DAPI_DEPRECATED
on line 2 and calling a deprecated function on line 19.
// main.c file
#define INITIALIZE_A3D_API
#define A3DAPI_DEPRECATED
#include <A3DSDKIncludes.h>
#include <hoops_license.h>
extern void CallDeprecatedFunction();
// Usual initialization code
int main(int argc, char* argv[])
{
A3DBool loaded = A3DSDKLoadLibraryA(PATH_TO_A3DLIBS_DIR);
assert(loaded);
A3DStatus result = A3DLicPutUnifiedLicense(HOOPS_LICENSE);
assert(result == A3D_SUCCESS);
result = A3DDllInitialize(A3D_DLL_MAJORVERSION, A3D_DLL_MINORVERSION);
assert(result == A3D_SUCCESS);
// HOOPS Exchange is now ready to use!
CallDeprecatedFunction();
A3DDllTerminate();
A3DSDKUnloadLibrary();
return EXIT_SUCCESS;
}
// other.c file
#define A3DAPI_DEPRECATED
#include <A3DSDKDeprecated.h>
// Call a deprecated function
void CallDeprecatedFunction()
{
// Let's call a deprecated function to check
A3DStatus result = deprecated_A3DEnableHandleSIGSEGV();
assert(result == A3D_SUCCESS);
}
A3DAPI_DEPRECATED
must also be defined in any source file that calls one of the deprecated functions.
For simplicity, you can define the macros at the compiler level using a compiler option such as /D
or -D
.