<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 5.50.4134.100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=MingLiu size=2>
<DIV><FONT face=MingLiu size=2>Dear all vtk user:</FONT></DIV>
<DIV><FONT face=細明體 size=2>I try to convert the icecream.tcl to C++!&nbsp; My 
code was shoe in below:--</FONT></DIV>
<DIV><FONT face=細明體 size=2>void main()<BR>{<BR>&nbsp;//create a rendering 
windows and 
render<BR>&nbsp;vtkRenderer*ren=vtkRenderer::New();<BR>&nbsp;vtkRenderWindow*renWindow=vtkRenderWindow::New();<BR>&nbsp;renWindow-&gt;AddRenderer(ren);<BR>&nbsp;renWindow-&gt;SetSize(500,500);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;vtkRenderWindowInteractor *iren = 
vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
iren-&gt;SetRenderWindow(renWindow);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//create implicit function 
primitives<BR>&nbsp;vtkSphere*iceCream=vtkSphere::New();<BR>&nbsp;iceCream-&gt;SetRadius(0.5);<BR>&nbsp;iceCream-&gt;SetCenter(1.333, 
0, 
0);<BR>&nbsp;vtkSphere*bite=vtkSphere::New();<BR>&nbsp;bite-&gt;SetRadius(0.25);<BR>&nbsp;bite-&gt;SetCenter(1.5, 
0, 0.5);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//Set 
Operation<BR>&nbsp;vtkImplicitBoolean*theCream=vtkImplicitBoolean::New();<BR>&nbsp;theCream-&gt;SetOperationTypeToDifference();<BR>&nbsp;theCream-&gt;AddFunction(iceCream);<BR>&nbsp;theCream-&gt;AddFunction(bite);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//iso-surface to create 
geometry<BR>&nbsp;vtkSampleFunction*theCreamSample=vtkSampleFunction::New();&nbsp;</FONT></DIV>
<DIV><FONT face=細明體 
size=2>&nbsp;<STRONG>theCreamSample-&gt;SetImplicitionFunction(theCream);</STRONG><BR>&nbsp;theCreamSample-&gt;SetModelBounds(-1,1.5,-1.25,1.25,-1.25,1.25);<BR>&nbsp;theCreamSample-&gt;SetSampleDimensions(60,60,60);<BR>&nbsp;theCreamSample-&gt;ComputeNormalsOff();&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//Generate implicit 
surface<BR>&nbsp;vtkContourFilter*theCreamSurface=vtkContourFilter::New();<BR>&nbsp;theCreamSurface-&gt;SetInput(theCreamSample-&gt;GetOutput());<BR>&nbsp;theCreamSurface-&gt;SetValue(0, 
0.0);<BR>//&nbsp;range[0]=1.0;range[1]=6.0;<BR>//&nbsp;theCreamSurface-&gt;GenerateValues(3,range);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//Map 
theCreamSurface<BR>&nbsp;vtkPolyDataMapper*creamMapper=vtkPolyDataMapper::New();<BR>&nbsp;creamMapper-&gt;SetInput(theCreamSurface-&gt;GetOutput());<BR>&nbsp;creamMapper-&gt;ScalarVisibilityOff();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//Add actor into the 
scene<BR>&nbsp;vtkActor*theCreamSurfaceActor=vtkActor::New();<BR>&nbsp;theCreamSurfaceActor-&gt;SetMapper(creamMapper);<BR>&nbsp;ren-&gt;AddActor(theCreamSurfaceActor);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>&nbsp;//draw the result 
scene<BR>&nbsp;renWindow-&gt;Render();<BR>&nbsp;ren-&gt;SetBackground(0.1, 0.2, 
0.4);<BR>&nbsp;iren-&gt;Start();<BR>}</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>When I try to build the program, but the error show " 
SetImplicitionFunction is not a member of vtkSampleFunction"</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>But in icecream.tcl:--</FONT></DIV>
<DIV><FONT face=細明體 size=2>the code show this: </FONT></DIV>
<DIV><FONT face=MingLiu size=2>vtkImplicitBoolean theCream<BR>&nbsp;&nbsp;&nbsp; 
theCream SetOperationTypeToDifference<BR>&nbsp;&nbsp;&nbsp; theCream AddFunction 
iceCream<BR>&nbsp;&nbsp;&nbsp; theCream AddFunction bite</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2># iso-surface to create 
geometry<BR>vtkSampleFunction theConeSample<BR>&nbsp;&nbsp;&nbsp; theConeSample 
SetImplicitFunction theCone</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>What is the difference between the code in C++ and 
tcl?&nbsp; Why the program can run in tcl but not in C++??</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>Please help!&nbsp; Because I want try some 
vtkImplicitBoolean in C++!</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>Can anyone sent me some idea to solve this 
problems?</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=細明體 size=2>Best regards,</FONT></DIV>
<DIV><FONT face=細明體 size=2>German Leung</FONT></DIV></FONT></DIV></BODY></HTML>