<!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++! My
code was shoe in below:--</FONT></DIV>
<DIV><FONT face=細明體 size=2>void main()<BR>{<BR> //create a rendering
windows and
render<BR> vtkRenderer*ren=vtkRenderer::New();<BR> vtkRenderWindow*renWindow=vtkRenderWindow::New();<BR> renWindow->AddRenderer(ren);<BR> renWindow->SetSize(500,500);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(renWindow);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //create implicit function
primitives<BR> vtkSphere*iceCream=vtkSphere::New();<BR> iceCream->SetRadius(0.5);<BR> iceCream->SetCenter(1.333,
0,
0);<BR> vtkSphere*bite=vtkSphere::New();<BR> bite->SetRadius(0.25);<BR> bite->SetCenter(1.5,
0, 0.5);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //Set
Operation<BR> vtkImplicitBoolean*theCream=vtkImplicitBoolean::New();<BR> theCream->SetOperationTypeToDifference();<BR> theCream->AddFunction(iceCream);<BR> theCream->AddFunction(bite);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //iso-surface to create
geometry<BR> vtkSampleFunction*theCreamSample=vtkSampleFunction::New(); </FONT></DIV>
<DIV><FONT face=細明體
size=2> <STRONG>theCreamSample->SetImplicitionFunction(theCream);</STRONG><BR> theCreamSample->SetModelBounds(-1,1.5,-1.25,1.25,-1.25,1.25);<BR> theCreamSample->SetSampleDimensions(60,60,60);<BR> theCreamSample->ComputeNormalsOff(); </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //Generate implicit
surface<BR> vtkContourFilter*theCreamSurface=vtkContourFilter::New();<BR> theCreamSurface->SetInput(theCreamSample->GetOutput());<BR> theCreamSurface->SetValue(0,
0.0);<BR>// range[0]=1.0;range[1]=6.0;<BR>// theCreamSurface->GenerateValues(3,range);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //Map
theCreamSurface<BR> vtkPolyDataMapper*creamMapper=vtkPolyDataMapper::New();<BR> creamMapper->SetInput(theCreamSurface->GetOutput());<BR> creamMapper->ScalarVisibilityOff();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //Add actor into the
scene<BR> vtkActor*theCreamSurfaceActor=vtkActor::New();<BR> theCreamSurfaceActor->SetMapper(creamMapper);<BR> ren->AddActor(theCreamSurfaceActor);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=細明體 size=2> //draw the result
scene<BR> renWindow->Render();<BR> ren->SetBackground(0.1, 0.2,
0.4);<BR> iren->Start();<BR>}</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT> </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> </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>
theCream SetOperationTypeToDifference<BR> theCream AddFunction
iceCream<BR> theCream AddFunction bite</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=MingLiu size=2># iso-surface to create
geometry<BR>vtkSampleFunction theConeSample<BR> theConeSample
SetImplicitFunction theCone</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT> </DIV>
<DIV><FONT face=細明體 size=2>What is the difference between the code in C++ and
tcl? Why the program can run in tcl but not in C++??</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT> </DIV>
<DIV><FONT face=細明體 size=2>Please help! Because I want try some
vtkImplicitBoolean in C++!</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT> </DIV>
<DIV><FONT face=細明體 size=2>Can anyone sent me some idea to solve this
problems?</FONT></DIV>
<DIV><FONT face=細明體 size=2></FONT> </DIV>
<DIV><FONT face=細明體 size=2>Best regards,</FONT></DIV>
<DIV><FONT face=細明體 size=2>German Leung</FONT></DIV></FONT></DIV></BODY></HTML>