DWG Import using Teigha

HOOPS Luminate delivers a free auxiliary module with source code that can be used to connect HOOPS Luminate with the Teigha framework from the Open Design Alliance (www.opendesign.com).

The REDOdadevice setup installs a project for Visual Studio 2012 that can be used to recompile and use a Teigha vectorization device.

The current version of Teigha used by the REDOdaDevice is 4.01. Some easy compilation fixes may be requested to run the device on another version of Teigha.

Installing the REDOdaDevice

../../../_images/redodadevice_setup.png

The REDOdaDevice setup will ask you to locate Teigha.

The REDOdaDevice will require you to indicate two folders to it:

  • The location of the Teigha_vc11dll folder. This folder should be the root of Teigha (below, we should find Core, Dgn, exe, lib, Platforms and ThirdParty).

  • The location of the Teigha_vc11_amd64dll folder, for the x64 bits version of Teigha on Windows.

Please make sure that the two folders are properly selected. Otherwise, files will not be properly copied into the installation folder of the REDOdaDevice.

Please also note that the current version of the REDOdaDevice does not embed Linux and MacOS versions of Teigha.

Using the REDOdaDevice

From the Windows start menu (if you have already left Windows 8 for Windows 10 ;-)), please select the OdaMFCApp.exe, or access the executable directly from the installation folder / BuildImage / Win32 (or Win64 for the x64 version).

On launching the OdaMfcApp, after loading a .DWG file, please select the REDOdaDevice_4.01_11.txv vectorization device:

../../../_images/redodadevice_launch.png

Launching the REDOdaDevice for the vectorization of a .DWG file.

Then, enjoy the REDOdaDevice! But, please make sure that the GS model option is checked. See below for details.

Using the GS Model (Geometry Cache)

The device is using the geometry cache to avoid re-creating geometries that exist already each frame. This is a must have that is enforced at the device initialization phase. If the corresponding option is not enabled in the application, the device will refuse to start (OdaMfcApp / Tools / Options / Use GS Model (geometry cache) must be checked).

Recompiling the REDOdaDevice

The REDOdaDevice.sln, which is a Visual Studio 2012 solution, can be used to recompile the device. Recompiling will fail because of two undefined symbols; REDSDK_CUSTOMER_CODE and REDSDK_LICENSE_KEY:

rc = ilicense->SetLicense( STRINGIZE_VALUE_OF( REDSDK_LICENSE_KEY ), REDSDK_CUSTOMER_CODE );
if( rc != RED_OK )
{
    DisplayError( ROD::RC_REDSDK, rc );
    return RED_FAIL;
}

The pre-compiled REDOdaDevice_4.01_11.txv device owns a license key, so it can be used without having to enter any licensing information.

Overview of the REDOdaDevice

This documentation section will detail the REDOdaDevice architecture a bit further. We’ll find:

  • Document Architecture: This page details the way we overload the vectorization classes to display geometry using HOOPS Luminate in the context of a Teigha application.

  • Converting Geometries: We detail the different steps used in the geometry conversion process.

  • Materials and Lighting: Details choices made for the conversion of materials into HOOPS Luminate materials.