ODA PRC SDK supports work with Universal 3D format files through converting these files contents into .prc files. This approach allows:
All types of mesh objects, including RHAdobeMesh, PointSet, and LineSet objects, as well as materials and textures, can be imported. Import of views and lighting objects is not supported.
U3D files conversion to PRC format is implemented in the OdU3D2PrcImport
module.
To convert a .u3d file into a .prc file, you should stick the following procedure:
OdU3D2PrcImportModulePtr pModule = ::odrxDynamicLinker()->loadModule(OdU3D2PrcImportModuleName);
OdU3D2PrcImportPtr importer = pModule->create();
if(importer.isNull())
odPrintConsoleString(L"U3D Importer object creation failed!\n");
importer->properties()->putAt(L"Database", pFile);
importer->properties()->putAt(L"U3DPath", OdRxVariantValue(u3dName));
if(OdResult::eOk != importer->import())
odPrintConsoleString(L"import failed!\n");
The OdU3D2PrcImport
module provides a set of import parameters, which are stored in a dictionary object within the importer object.
It means that each parameter is represented with a "name-value" pair.
To get the properties dictionary for reading and modification, call the properties()
method from the OdPdfImport
class.
To set a new value for a parameter, call the putAt()
method of the returned dictionary object passing parameter's name and new value.
You can find the list of supported import parameters in the following table:
Parameter | Dictionary Name | Description |
---|---|---|
Target PRC Database | Database | A PRC database where the U3D file content should be placed. Represented with a smart pointer to an OdPrcFile object. |
Input U3D File Path | U3DPath | A full path to the input .u3d file to be imported. |
Transformation Matrix | Transform Matrix | A transformation matrix to be applied to all imported elements. |
The Database and U3DPath parameters are mandatory.
You can explore the resulted .prc file structure and render its content by opening it in the OdaPrcApp sample application:
Please note, that it is possible to import several .u3d files into one .prc file. The picture below illustrates the result.
ODA Software provides two ways of rendering a U3D file content:
Prc2Visualize
module.
This module is used by the
Visualize SDK Viewer Application.
The result of such rendering you can see in the picture below.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|