Samples

Several simple sample shell applications are provided to illustrate basic usage of the toolkit.

Note:
Microsoft Visual Studio users should consult the build configurations in the project files to see how the pre-preprocessor build flags are set.

Building the Samples

Microsoft Visual Studio

Simply open the Visual Studio project file or solution and build the desired configuration. DLL build configurations will required that the appropriate (debug or release) version of dwftk.7.5.0.dll (and possibly whiptk.7.11.601.dll and/or w3dtk.1.5.1555.dll) is available in the path. To work with different configurations (static Or shared and Release Or Debug) of the samples change the values in samples.vsprops file, which is mainly meant for driving the different configurations of the samples. The default state of the configure file is as follows

Contents of the Configure.vsprops

        <?xml version="1.0" encoding="Windows-1252"?>
        <VisualStudioPropertySheet
        ProjectType="Visual C++"
        Version="8.00"
        Name="DWF Toolkit Libraries"
        >
        <UserMacro
        Name="Platform"
        Value="Win32"                        //Change this to "x64" while working for x64 platform
        />
        <UserMacro
        Name="StaticOrShared"
        Value="shared"                        //Change this to "static" while working for static configuration
        />
        <UserMacro
        Name="DebugOrRelease"
        Value="release"                        //Change this to "debug" while working for debug configuration
        />
        <UserMacro
        Name="VCOutDir"
        Value="vc8.0"                            //Change this to " vc9.0" while working with VC90 projects
        />
        <UserMacro
        Name="binloc"
        Value="bin"                                //Change this to "bin\x64 " while working with x64 platform
        />
        </VisualStudioPropertySheet>

Note:
: Unload the project and reload it in Visual studio to get the updates of the changes done with the VSProperty sheets

GCC (GNU Compiler Collection)

All but one of the samples that ship with the toolkit work on non-Win32 systems. The W2dTest sample can be built on Windows only at this time.

Some of the samples were created in the Visual Studio development environment and are stored in Windows-brand Unicode (UTF-16LE). These files have been resaved as UTF8 with the Unicode text removed; and named with the _UTF8.cpp suffix.

Note:
If the toolkit samples fail to compile because XMLCALL is not defined, then add -DDWFTK_BUILD_EXPAT to your build options. This macro was added in Expat 1.95.7 and using an older version of expat.h will result in these errors.

Static Linking

This section shows how the sample applications can be built using the static toolkit library.

3DPublish

 g++ -I../../../develop/global/src/ -I/usr/include 3DPublish_UTF8.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -ljpeg -o 3dpublish

Aggregate

 g++ -I../../../develop/global/src/ -I/usr/include Aggregate.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -ljpeg -o aggregate

GlobalSectionWriter

g++ -I../../../develop/global/src/ -I/usr/include GlobalSectionWriter.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o gsw

ObjectDefinitionReader

g++ -I../../../develop/global/src/ -I/usr/include ObjectDefinitionReader.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o objdefreader

PublishMetadata

 g++ -I../../../develop/global/src/ -I/usr/include PublishMetadata.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -ljpeg -o publishmetadata

ReadContentDefinition

 g++ -I../../../develop/global/src/ -I/usr/include ReadContentDefinition.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -ljpeg -o readcontentdefinition

SimpleEnumReader

g++ -I../../../develop/global/src/ -I/usr/include SimpleEnumReader.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o enumreader

SimpleEPlotWriter

g++ -I../../../develop/global/src/ -I/usr/include SimpleEPlotWriter_UTF8.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o eplotwriter

TimedXMLReader

g++ -I../../../develop/global/src/ -I/usr/include TimedXMLReader.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o timedreader

WhipExamples

g++ -I../../../develop/global/src/ -I/usr/include AppendBlocks.cpp Color.cpp ColorMap.cpp ContourSet.cpp DashPattern.cpp DataReading.cpp DrawingInfo.cpp FileRead.cpp FileWrite.cpp FilledEllipse.cpp FillPattern.cpp Font.cpp GouraudPolyline.cpp GouraudPolytriangle.cpp Layer.cpp LinePattern.cpp LineStyle.cpp LineWeight.cpp Main.cpp ObjectNode.cpp OutlineEllipse.cpp OutputBlocks.cpp Polygon.cpp Polyline.cpp Polymarker.cpp Polytriangle.cpp ReadTwoBlocks.cpp SingleLine.cpp Text.cpp Url.cpp UserData.cpp View.cpp Viewport.cpp Visibility.cpp WriteBlocks.cpp WriteRedline.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o whipexamples

WriteContent

g++ -I../../../develop/global/src/ -I/usr/include WriteContent.cpp ../../../develop/global/src/dwf/.libs/libdwftk.a -ldwfcore -o WriteContent

See the GCC Static Linking section of the main page for more details.

Dynamic Linking

This sections show how the sample applications can be built using the shared toolkit library.

3DPublish

g++ 3DPublish_UTF8.cpp -ldwfcore -ldwftk -o 3dpublish

Aggregate

 g++ Aggregate.cpp -ldwfcore -ldwftk -o aggregate

GlobalSectionWriter

g++ GlobalSectionWriter.cpp -ldwfcore -ldwftk -o gsw

ObjectDefinitionReader

g++ ObjectDefinitionReader.cpp -ldwfcore -ldwftk -o objdefreader

PublishMetadata

g++ PublishMetadata.cpp -ldwfcore -ldwftk -o publishmetadata

SimpleEnumReader

g++ SimpleEnumReader.cpp -ldwfcore -ldwftk -o enumreader

SimpleEPlotWriter

g++ SimpleEPlotWriter_UTF8.cpp -ldwfcore -ldwftk -o eplotwriter

TimedXMLReader

g++ TimedXMLReader.cpp -ldwfcore -ldwftk -o timedreader

WhipExamples

g++ AppendBlocks.cpp Color.cpp ColorMap.cpp ContourSet.cpp DashPattern.cpp DataReading.cpp DrawingInfo.cpp FileRead.cpp FileWrite.cpp FilledEllipse.cpp FillPattern.cpp Font.cpp GouraudPolyline.cpp GouraudPolytriangle.cpp Layer.cpp LinePattern.cpp LineStyle.cpp LineWeight.cpp Main.cpp ObjectNode.cpp OutlineEllipse.cpp OutputBlocks.cpp Polygon.cpp Polyline.cpp Polymarker.cpp Polytriangle.cpp ReadTwoBlocks.cpp SingleLine.cpp Text.cpp Url.cpp UserData.cpp View.cpp Viewport.cpp Visibility.cpp WriteBlocks.cpp WriteRedline.cpp -ldwfcore -ldwftk -o whipexamples

WriteContent

g++ WriteContent.cpp -ldwfcore -ldwftk -o writecontent

Apple XCode

Developers have more options with OS X and XCode in that the same steps for GCC Static Linking and Dynamic Linking can be followed from the shell, while XCode users can take advantage of the project files provided by Apple for building the DWF Toolkit samples. These XCode projects are valuable reference resources for building your own applications with the DWF Toolkit.


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