<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>Hello, 
there,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=859410923-22012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>Please help me to 
set the PATH to vtk library in Visual C++ .Net!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=859410923-22012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>I tried to use 
Visual C++ .Net with Vtk. After setting a few </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>environment 
variables, I can compile the source code. However,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>I have to use 
the&nbsp;<FONT color=#0000ff> </FONT>#pragma<FONT size=2> </FONT><FONT 
color=#0000ff size=2>comment</FONT><FONT size=2>( </FONT><FONT color=#0000ff 
size=2>lib</FONT><FONT size=2>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkCommon.lib" ) to</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>load library. I 
remember that when I use Visual C++ 6.0, I can go to</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=859410923-22012003>Project--&gt;Settings to define the PATH to the "lib". 
I don't know where</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>to set it in Visual 
C++ .Net? </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=859410923-22012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=859410923-22012003>The following are 
m</SPAN></FONT><FONT face=Arial size=2><SPAN class=859410923-22012003>y source 
code.</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=859410923-22012003>
<P><SPAN class=859410923-22012003><FONT face=Arial color=#0000ff 
size=2>Regards,</FONT></SPAN></P>
<P><SPAN class=859410923-22012003><FONT face=Arial color=#0000ff 
size=2>Henry</FONT></SPAN></P>
<P><FONT size=2><FONT face=Arial color=#0000ff>#include</FONT><FONT face=Arial> 
"stdafx.h"</FONT></FONT></P>
<P><FONT face=Arial><FONT size=2><FONT color=#0000ff>#include</FONT> 
"qs.h"</FONT></P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkConeSource.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkSphereSource.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkPolyDataMapper.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkActor.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkRenderWindow.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkRenderer.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#include</FONT></FONT><FONT face=Arial size=2> 
"vtkRenderWindowInteractor.h"</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#ifdef</FONT></FONT><FONT face=Arial size=2> 
_DEBUG</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>#define</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>new</FONT> DEBUG_NEW</FONT></P></FONT><FONT face=Arial 
color=#0000ff size=2>
<P>#endif</P></FONT><FONT face=Arial color=#008000 size=2>
<P>// The one and only application object</P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkCommon.lib" )</FONT></P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkRendering.lib" )</FONT></P></FONT><FONT 
color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkGraphics.lib" )</FONT></P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkImaging.lib" )</FONT></P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT>, "C:\\Program 
Files\\vtk40\\lib\\vtk\\vtkFiltering.lib" )</FONT></P></FONT><FONT 
color=#0000ff>
<P><FONT face=Arial size=2>#pragma</FONT></FONT><FONT size=2><FONT face=Arial> 
<FONT color=#0000ff>comment</FONT>( <FONT color=#0000ff>lib</FONT></FONT><FONT 
face=Arial>, "C:\\Program Files\\vtk40\\lib\\vtk\\vtkHybrid.lib" 
)</FONT></FONT></P>
<P><FONT face=Arial size=2>CWinApp theApp;</FONT></P><FONT color=#0000ff>
<P><FONT face=Arial size=2>using</FONT></FONT><FONT face=Arial><FONT size=2> 
<FONT color=#0000ff>namespace</FONT> std;</FONT></P></FONT><FONT color=#0000ff>
<P><FONT face=Arial size=2>int</FONT></FONT><FONT size=2><FONT face=Arial> 
_tmain(<FONT color=#0000ff>int</FONT></FONT><FONT face=Arial> argc, TCHAR* 
argv[], TCHAR* envp[])</FONT></FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT size=2><FONT face=Arial color=#0000ff>int</FONT><FONT face=Arial> 
nRetCode = 0;</FONT></FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// initialize MFC and print and 
error on failure</FONT></P></FONT>
<P><FONT size=2><FONT face=Arial color=#0000ff>if</FONT><FONT face=Arial> 
(!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 
0))</FONT></FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// TODO: change error code to 
suit your needs</FONT></P></FONT>
<P><FONT face=Arial size=2>_tprintf(_T("Fatal Error: MFC initialization 
failed\n"));</FONT></P>
<P><FONT face=Arial size=2>nRetCode = 1;</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT color=#0000ff><FONT face=Arial size=2>else</FONT></P></FONT>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// create sphere 
geometry</FONT></P></FONT>
<P><FONT face=Arial size=2>vtkSphereSource *sphere = 
vtkSphereSource::New();</FONT></P>
<P><FONT face=Arial size=2>sphere-&gt;SetRadius(1.0);</FONT></P>
<P><FONT face=Arial size=2>sphere-&gt;SetThetaResolution(18);</FONT></P>
<P><FONT face=Arial size=2>sphere-&gt;SetPhiResolution(18);</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// vtkTextProperty tprop=new 
vtkTextProperty();</FONT></P></FONT>
<P><FONT color=#008000><FONT face=Arial size=2>// map to graphics 
library</FONT></P></FONT>
<P><FONT face=Arial size=2>vtkPolyDataMapper *map = 
vtkPolyDataMapper::New();</FONT></P>
<P><FONT face=Arial size=2>map-&gt;SetInput(sphere-&gt;GetOutput());</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// actor coordinates geometry, 
properties, transformation</FONT></P></FONT>
<P><FONT face=Arial size=2>vtkActor *aSphere = vtkActor::New();</FONT></P>
<P><FONT face=Arial size=2>aSphere-&gt;SetMapper(map);</FONT></P>
<P><FONT size=2><FONT face=Arial>aSphere-&gt;GetProperty()-&gt;SetColor(0,0,1); 
</FONT><FONT color=#008000><FONT face=Arial>// sphere color 
blue</FONT></P></FONT></FONT>
<P><FONT color=#008000><FONT face=Arial size=2>// a renderer and render 
window</FONT></P></FONT>
<P><FONT face=Arial size=2>vtkRenderer *ren1 = vtkRenderer::New();</FONT></P>
<P><FONT face=Arial size=2>vtkRenderWindow *renWin = 
vtkRenderWindow::New();</FONT></P>
<P><FONT face=Arial size=2>renWin-&gt;AddRenderer(ren1);</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// an 
interactor</FONT></P></FONT>
<P><FONT face=Arial size=2>vtkRenderWindowInteractor *iren = 
vtkRenderWindowInteractor::New();</FONT></P>
<P><FONT face=Arial size=2>iren-&gt;SetRenderWindow(renWin);</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// add the actor to the 
scene</FONT></P></FONT>
<P><FONT face=Arial size=2>ren1-&gt;AddActor(aSphere);</FONT></P>
<P><FONT size=2><FONT face=Arial>ren1-&gt;SetBackground(1,1,1); </FONT><FONT 
color=#008000><FONT face=Arial>// Background color 
white</FONT></P></FONT></FONT>
<P><FONT color=#008000><FONT face=Arial size=2>// render an image (lights and 
cameras are created automatically)</FONT></P></FONT>
<P><FONT face=Arial size=2>renWin-&gt;Render();</FONT></P>
<P><FONT color=#008000><FONT face=Arial size=2>// begin mouse 
interaction</FONT></P></FONT>
<P><FONT face=Arial size=2>iren-&gt;Start();</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT size=2><FONT face=Arial color=#0000ff>return</FONT><FONT face=Arial> 
nRetCode;</FONT></FONT></P>
<P><FONT face=Arial size=2>}</FONT></P></SPAN></FONT></DIV></BODY></HTML>