• Technical Overview
  • Release Notes
  • Reference Manual
  • HOOPS/3dAF
TechSoft3d

HOOPS U3D Integration

1.0 Using the U3D HIO Component

  • 1.1 Output Handler Options
  • 1.2 Rebuilding the HIO Component

2.0 Integrating Directly with U3D SDK

3.0 Known Limitations

4.0 Platform Support

5.0 Required Libraries


1.0 Using the U3D HIO Component

The Universal 3D (U3D) format is a 3D format which has been developed by the 3D Industry Forum (3dIF). U3D has gained widespread adoption within the Engineering community. It is one of the formats that supports 3D within PDF. The U3D HIO component introduces support for import and export of U3D within the HOOPS.

To use this integration, you must install the SDK included in the Universal 3D Sample Software which is distributed under an Apache style license at sourceforge.org. As of writing, the U3D toolkit was not provided with pre-built binaries for Visual Studio 2005 and so you may need to build the U3D toolkit before you can proceed any further. Once you have a Visual Studio 2005 U3D libraries built, please follow the steps below to use the HOOPS/HIO component:

  1. Create a hio_plugins directory in your application's working directory.
  2. Copy the hio_u3d.hio file found in <hoops>/bin/<platform>/hio_plugins/hio_u3d to the hio_plugins directory created in the previous step.
  3. Ensure that the U3D SDK is installed on your system and correctly located in your path.
  4. Run your application.

During start-up, when HOOPS/MVO finds the U3D HIO component in your application's path, it will perform the following steps:

  1. Load in the necessary U3D libraries.
  2. Create the appropriate input and output handlers.
  3. Register both handlers and the associated file extensions to the HIOManager.

Once the U3D HIO component is successfully loaded, your application will be able import and export U3D files without having to recompile HOOPS. To utilize the extensive services available in the U3D SDK, you must compile against the U3D libraries directly and follow the steps described in 2.0 Integrating Directly with U3D.

1.1 Output Handler Options

To export to a 3D PDF, you must set the HOutputHandlerOptions::m_b3dOutput flag to true when using the HBaseModel::WriteWithOptions method. You will also need to define the camera settings so they can be saved with the model. To do this, specify the desired camera settings in your instance of HBaseView. Then supply a pointer to your HBaseView object via HOutputHandlerOptions::m_pHBaseView in your call to the HBaseModel::WriteWithOptions method.

1.2 Rebuilding the HIO Component

The U3D HIO component was built against a specific version of the U3D toolkit. If you want your application to run against another version of the U3D SDK, we recommend that you rebuild the U3D HIO component with that version of the library. To do so, simply open the hio_u3d_vc<version>.vcproj project located in the <hoops>/Dev_Tools/hoops_hio/hio_u3d/source. Be sure to set the environment variable U3D_SDK_DIR to point to the root of your U3D installation before you begin building. Once the project is built against the correct libraries, an .hio file will be created. Note that you may have some obstacle building against a different version of the U3D if interfaces are not compatible with the original libraries that the HIO component was built against.

2.0 Integrating Directly with the U3D SDK

In this section, we will outline the steps involved in integrating your HOOPS-based application directly with the U3D libraries. First, you must install the SDK included in the Universal 3D Sample Software which is distributed under an Apache style license at sourceforge.org. You may be required to build the U3D libraries if pre-built binaries are not provided in the package. Once all the binaries are installed in your path, please follow the step below:

  1. Set the U3D_SDK_DIR Environment Variable to point to the root of your U3D Installation.
  2. Add files HIOUtilityU3D.h/.cpp and HU3DHelper.h/.cpp to your project. These files are located in the Dev_Tools /hoops_hio/hio_u3d/source directory of your HOOPS installation. Refer to hio_u3d_vc80.vcproj in Dev_Tools/hoops_hio/hio_u3d/source directory.
  3. Add HOOPS_U3D_IO to your preprocessor declarations.
  4. Add the following directories to you'$(U3D_SDK_DIR)/include' to your additional include folders list:
  5. Depending on whether it is a debug or release build you should add the following to your additional linker directories.
    • "\$(U3D_SDK_DIR)/Source/RTL/Build/All/debug/wildcards";
    • "\$(U3D_SDK_DIR)/Source/RTL/Build/All/debug/base";
    • "\$(U3D_SDK_DIR)/Source/RTL/Build/All/debug/platform";
    • "\$(U3D_SDK_DIR)/Source/RTL/Build/All/debug/datatypes";
    • "\$(U3D_SDK_DIR)/Source/RTL/Build/All/debug/corestatic"
    • '$(U3D_SDK_DIR)/Lib/Win32/Debug' (or Release) to y
  6. Add Wildcards.lib, IFXBase.lib, Platform.lib, IFXCoreStatic.lib, DataTypes.lib and winmm.lib as additional dependencies.
  7. Copy IFXCore.dll from the U3D SDK to the directory where your application's executable is present.
  8. Ensure that you have a 'Plugins' directory where your executable file exists and copy IFXExporting.dll and IFXImporting.dll to this directory.

Once you have completed the above steps, you do not need to rely on the U3D HIO component anymore. Please remove the associated .hio file from the hio_plugins directory in your application's working directory. Note that in a direct integration, you must register HIOUtilityU3D as an input and output handler with the HIOManager so that the HBaseModel read/write functions can recognize that the U3d file format is supported. For more information on HOOPS/MVO file input/output architecture, please see section 4.0 File Input/Output and the I/O Manager of the HOOPS/MVO Programming Guide.

You should be able to import or export U3D files from your application with code similar to this:

    HIOUtilityU3D *handler;

//  This is the code for reading a U3D file
    char *inputfile = "c:\\temp\\myInput.u3d";
    HFileInputResult result = handler->FileInputByKey(inputfile, m_pHView->GetModelKey(), NULL);

// While this code could be used to write a U3D file
    char *outputfile = "c:\\temp\\myOutput.u3d";
    HOutputHandlerOptions options;
    options.m_pHBaseView = m_pHView;
    HFileOutputResult result = handler->FileOutputByKey(outputfile, m_pHView->GetModelKey(), &options);

3.0 Known Limitations

The U3D toolkit demonstrate extremely poor performance when creating polyline geometry. So, in our current implementation, we do not export any line data into the file. Also, U3D has extremely basic 3D definitions. Thus, some of the more advanced HOOPS/3dGS geometry and attributes may not be represented within our U3D export. Examples include text as well as some of the more sophisticated color interpolation schemes and static 2D geometry within a 3D scene. Animations composed of rotation, translation, scaling and camera movements are supported. However, the more advanced animations found in HOOPS/MVO like segment switches, vertex morphing, color morphing and attribute switches cannot be exported to U3D.

4.0 Platform Support

Our integration is only supported on Microsoft Visual Studio 2005. However, since the U3D toolkit is provided in source code form, developers should be able to port the integration on unsupported platforms.

5.0 Required Libraries

In Release 17, the U3D HIO component requires version 1.2.851.0 of the U3D toolkit .