Autodesk DWF Toolkit Documentation

Version 7.5.0

Introduction

The DWF Toolkit is a collection of cross-platform components for creating, publishing, reading and processing 2D and 3D design data in the Autodesk DWF File Format.

DWF Toolkit Components:

The DWF Toolkit uses the Autodesk DWF Core Library which ships as part of the standard distribution.

Downloading the Distribution

The latest version can be downloaded at the Autodesk DWF Developer Center . The source code has been built and run on the following hardware, software and development environments:

Building the DWF Toolkit

The full source code is available for developers to review and build on a number of different platforms and build development environments. Developers wishing to fine tune the toolkit should review the Build Configuration page.

Microsoft Visual Studio

Developers wishing to fine tune the toolkit for Windows should review the Build Configuration and Microsoft Windows Build Configuration pages.

1. Locate and open the DWFToolkit.vcproj project file in the folder that matches the desired development environment.

2. Select the desired build configuration .

3. Build the project.

Note:
On Microsoft Windows, the DWF Toolkit, Whip Toolkit and W3D Toolkit are separated out into individual modules as they may be built and used independently from one another.

GCC (GNU Compiler Collection)

This section applies for any system using GCC and the GNU Build System (Automake, Autoconf, etc.)

1. Open a shell and locate the build folder:

 cd develop/global/build/gnu/dwftoolkit 

2. Run the build setup script, this will unpack several required files and reconfigure the GNU Build System:

 ./build_setup.sh 

3. Locate the source folder:

 cd ../../../src/dwf/ 

4. Configure the build scripts:

 ./configure 

5. Build the library:

 make 

6. Optionally, install the library and headers on the system (by default, to /usr/local/lib and /usr/local/include, respectively):

 make install 

Note:
1. Be sure to use the source tarball distribution (.tar.gz) as it preserves the permissions correctly - the zip source archive (.zip) will not preserve.

2. If the build_setup.sh script fails to execute, ensure the permissions are correct:

 chmod +x build_setup.sh 

3. By default, a full debug configuration is generated. To configure a highly optimized build:

 ./configure --enable-optimized 

4. By default, the toolkit will be dependent on the version of libz installed on the system. Alteratively, the toolkit can be configured to use the internal z compression code in libdwfcore:

 ./configure --without-zlib 

5. By default, the toolkit will be dependent on the version of libjpeg installed on the system. Alteratively, the toolkit can be configured to use the internal JPEG code in the W3D toolkit:

 ./configure --without-jpeg 

6. By default, the toolkit will use it's own internal version of the Expat XML parser. Alternatively, the toolkit can be configured to use the version of libexpat install on the system:

 ./configure --with-expat 

7. All of the normal GNU Build System rules still apply, for full details:

 ./configure --help 

8. On Linux and OS X platforms, the DWF Toolkit, Whip Toolkit and W3D Toolkit are built into a single module. While this has not been tested, the individual static modules that are generated as a result of the build process could probably be used individually, though this is not recommended.

9. On OS X, libjpeg is usually not installed in a location that configure can find it, so it's usually necessary to use the built-in version. To do this and disable the dependency on the system library:

 ./configure --without-jpeg 

Apple XCode

1. Locate and open the DWFToolkit.xcode project folder that matches the desired development environment.

2. Select the desired build configuration.

3. Build the project.

Note:
On OS X, the DWF Toolkit, Whip Toolkit and W3D Toolkit are built into a single library or framework.

Using the DWF Toolkit

This section outlines how a client application can use the toolkit.

Including Header Files

The following path should be used added to the include path of the client application build configuration:
 develop/global/src/ 

Microsoft Windows

Currently, the SDK ships with build solutions and project files for Visual Studio 2005 and 2008, and the binary distribution includes pre-built libraries for all environments (dynamically linking the MSVC runtime libraries).

Visual Studio 2005 and 2008 will deploy their build targets into subfolders indicating their source:

develop/global/bin/debug/vc8.0/dwftk.7.5.0.dll
develop/global/lib/static/release/vc9.0/dwftk.7.5.0.lib

Static Linking

The following path(s) should be added to the library search path of the client application project file:
 develop/global/lib/static/[debug|release]/ 

Note:
When linking statically, the client application must define the DWFTK_STATIC pre-processor macro.

Dynamic Linking

The following path(s) should be added to the library search path of the client application project file:
 develop/global/lib/shared/[debug|release]/ 

The dynamic link libraries are located at the following location:

 develop/global/bin/[debug|release]/ 

Note:
Be sure to copy dwftk.7.5.0.dll to a location where the client application can find it at run time.
See the Microsoft Visual Studio section of the Samples page for more details.

GNU/Linux

The binary distribution contains pre-built shared and static libraries that have been copied to the above directory structure. The GNU build process does not deploy the libraries to this hierarchy, rather make will leave the libraries in:

 develop/global/src/dwf/.libs 

and make install will deploy the libraries to the installation path specified to configure, the default location is:

 /usr/local/lib/dwfcore 

Static Linking

When statically linking, add libdwftk.a to the list of input files. There may still be other dependencies depending on what functions of the library are used and if the toolkit and/or core library was customized with libz, libexpat and libjpeg. Ignoring the latter, it's usually safest to link in libjpeg to ensure no unresolved symbols for any code that uses the 3D toolkit. Remember that libdwfcore must always be linked. For example, the TimedXMLReader sample can be built as follows:

Note:
Static linking requires explicitly linking in dependent libraries.

On platforms that use the GNU Build System, there is no need to define the DWFTK_STATIC pre-processor macro.

Dynamic Linking

When dynamically linking, the library (and standard soft links) must be in the ld cache. Please refer to the ldconfig man page for more details. After the library and headers have been installed, it can be referenced just as any other system library. For example, the 3DPublish sample can be built as follows:
g++ 3DPublish_UTF8.cpp -ldwfcore -ldwftk -o 3dpublish

Note:
Dynamically linking the shared library automatically determines the dependencies on other shared libaries, no explicit linkage is required at build time:
        [dwf@dwfhat 3DPublish]$ ldd 3dpublish
            libdwfcore-1.5.0.so => /usr/local/lib/libdwfcore-1.5.0.so (0x0016c000)
            libdwftk-7.5.0.so => /usr/local/lib/libdwftk-7.5.0.so (0x0099e000)
            libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x0060b000)
            libm.so.6 => /lib/tls/libm.so.6 (0x003d3000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0085e000)
            libc.so.6 => /lib/tls/libc.so.6 (0x001bb000)
            libz.so.1 => /usr/lib/libz.so.1 (0x00d6c000)
            libuuid.so.1 => /lib/libuuid.so.1 (0x00111000)
            libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00950000)
            libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x007af000)
            /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00f8a000)
See the GCC (GNU Compiler Collection) section of the Samples page for more details.

OS X

The binary distribution contains pre-built dylibs, static libraries and Carbon Frameworks that have been copied to the above directory structure. The GNU build process does not deploy the libraries to this hierarchy, rather make will leave the libraries in:

 develop/global/src/dwf/.libs 
Likewise, the XCode project configurations build to:
 [Development] develop/global/lib/debug and [Deployment] develop/global/lib/release 

Static Linking

Using gcc directly from the shell is exactly the same as noted in the GNU/Linux Static Linking section.

Using XCode, add the static library to the Frameworks and Libraries group of the build target.

Framework

When using the DWFToolkit.framework, add the appropriate bundle to the Frameworks and Libraries group of the build target.

See the Apple XCode section of the Samples page for more details.


Generated on Tue Jan 6 22:40:01 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5