<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [vtkusers] How to use VTK with Borland C++ Builder</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>How to USE VTK With Borland C++ Builder (BCB)</FONT>
</P>

<P><FONT SIZE=2>1) Download VTK source from <A HREF="http://www.vtk.org/get-software.php" TARGET="_blank">http://www.vtk.org/get-software.php</A></FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; Source code: VTK-X.XX-LatestRelease.tar.gz</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Example data: VTKData-X.XX.tar.gz </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Document: VTKDoc-X.XX.chm or HTML files</FONT>
</P>

<P><FONT SIZE=2>2) Download CMake from www.cmake.org</FONT>
</P>

<P><FONT SIZE=2>3) Install CMake.</FONT>
</P>

<P><FONT SIZE=2>4) Extract VTK source to C:\VTK. </FONT>
</P>

<P><FONT SIZE=2>5) Read \VTK\README.html, &quot;Common Problems&quot; section in particular for BCB issues.</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; You have to convert Tcl libraires from coff to omf.</FONT>
</P>

<P><FONT SIZE=2>6) Create a new directory, e.g., C:\vtkbin, to store compiled VTK binary files.</FONT>
</P>

<P><FONT SIZE=2>7) Unzip VTKData to C:\VTKData. Create VTK_DATA_ROOT environmental variable from</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Control Panel | Systems | Advanced | Environmental Variables | User Variables</FONT>
</P>

<P><FONT SIZE=2>8) Run CmakeSetup with these optional Settings to create BCB makefiles.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; Source code: c:\VTK</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Binary:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c:\vtkbin</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Build For:&nbsp;&nbsp; Borland Makefiles</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Show Advanced Values: Checked.</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Click the Configure button</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; USE_SHARED_LIBS: OFF (you will use static VTK LIB's)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; USE_SHARED_LIBS: ON&nbsp; (you will use dynamic VTK DLL's)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; VTK_WRAP_TCL: ON&nbsp;&nbsp;&nbsp; (For running example TCL scripts)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; TK_LIBRARY&nbsp; = C:\Program Files\Tcl\lib\bcbvtk\tk83.lib&nbsp; (converted above)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; TCL_LIBRARY = C:\Program Files\Tcl\lib\bcbvtk\tcl83.lib (converted above)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; VTK_USE_RENDERING: ON</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; VTK_USE_HYBRID: ON</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; VTK_DATA_ROOT: the path you set up at step (7) above.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; Click the Confiure button until no Red fields, then the OK button.</FONT>
</P>

<P><FONT SIZE=2>9) Start Windows command prompt and go to C:\vtkbin, then type &quot;make&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; to compile VTK for BCB. This may take more than 2 hours.</FONT>
</P>

<P><FONT SIZE=2>10) Read \VTK\Examples\GUI\Win32\vtkBorland\Readme.txt 10 times.</FONT>
</P>

<P><FONT SIZE=2>11) Install vtkBorlandRenderWindow package found in </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; C:\VTK\Examples\GUI\Win32\vtkBorland\Package\vtkBorlandRenderWindowPkg.bpk</FONT>
</P>

<P><FONT SIZE=2>12) Run the Borland Demo Project_vtkDemo in</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; C:\VTK\Examples\GUI\Win32\vtkBorland\ProjectDemo </FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; - Remove FormDestroy event and add the following FormClose event</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; to avoid some problem at exit.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; void __fastcall TVTK_Form::FormClose(TObject *Sender, TCloseAction &amp;Action)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; {</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; if (shrink) shrink-&gt;Delete();</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; vtkWindow1-&gt;GetRenderer()-&gt;RemoveAllProps();</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; vtkTimerLog::CleanupLog();&nbsp; </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; }</FONT>
</P>

<P><FONT SIZE=2>13) To compile CXX examples under C:\VTK\Examples</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; a) Start CMake, choose Borland Compiler, Source and BIN dir's,</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; b) Configure, Configure, and then OK.</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; c) From Windows Command Prompt, go to BIN dir, then type make.</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; d) Run EXE from either command prompt or double-click the EXE.</FONT>
<BR><FONT SIZE=2>&nbsp; </FONT>
<BR><FONT SIZE=2>14) TO Learn more </FONT>
<BR><FONT SIZE=2>&nbsp; a) Read VTK FAQ. <A HREF="http://public.kitware.com/cgi-bin/vtkfaq" TARGET="_blank">http://public.kitware.com/cgi-bin/vtkfaq</A></FONT>
<BR><FONT SIZE=2>&nbsp; b) Read and search the mailing list Archives</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.kitware.com/search.html" TARGET="_blank">http://www.kitware.com/search.html</A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.bioengineering-research.com/vtk/index.htm" TARGET="_blank">http://www.bioengineering-research.com/vtk/index.htm</A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://public.kitware.com/pipermail/vtkusers/" TARGET="_blank">http://public.kitware.com/pipermail/vtkusers/</A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://news.gmane.org/gmane.comp.lib.vtk.user" TARGET="_blank">http://news.gmane.org/gmane.comp.lib.vtk.user</A></FONT>
</P>

<P><FONT SIZE=2>&nbsp; c) Purchase the book &quot;The Visualization Toolkit&quot; ISBN 0-13-954694-4 from amazon.com, </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.vtk.org/buy-books.php" TARGET="_blank">http://www.vtk.org/buy-books.php</A> </FONT>
<BR><FONT SIZE=2>&nbsp; d) Purchase the &quot;VTK Users Guide&quot; from Kitware. </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.kitware.com/products/vtkguide.html" TARGET="_blank">http://www.kitware.com/products/vtkguide.html</A> </FONT>
<BR><FONT SIZE=2>&nbsp; e) Download the source code and/or binaries (available on Windows) and work through </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; the examples (there are 400-500 examples). <A HREF="http://www.vtk.org/get-software.php" TARGET="_blank">http://www.vtk.org/get-software.php</A> </FONT>
<BR><FONT SIZE=2>&nbsp; f) To learn the innards of VTK, you can attend a VTK course or sponsor a VTK course </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; at your site through Kitware. <A HREF="http://www.kitware.com/products/index.html" TARGET="_blank">http://www.kitware.com/products/index.html</A> </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; </FONT>
</P>

<P><FONT SIZE=2>Good luck.</FONT>
</P>

<P><FONT SIZE=2>Yang</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Howell wuhao1126 [<A HREF="mailto:wuhao1126@hotmail.com">mailto:wuhao1126@hotmail.com</A>] </FONT>
<BR><FONT SIZE=2>Sent: Friday, April 02, 2004 8:45 AM</FONT>
<BR><FONT SIZE=2>To: vtkusers@vtk.org</FONT>
<BR><FONT SIZE=2>Subject: [vtkusers] How to use VTK in C++</FONT>
</P>
<BR>

<P><FONT SIZE=2>i am apprentice, i want to know how to adopt VTK in c++ BUILDER?</FONT>
</P>

</BODY>
</HTML>