[vtkusers] SetImplicitionFunction is not a member of vtkSampleFunction! PLEASE HELP!
Jose A. Romero M.
jaroma at sdf.lonestar.org
Mon Mar 5 22:46:53 EST 2001
For the manpages:
void SetImplicitFunction (vtkImplicitFunction *);
and not theCreamSample->SetImplicitionFunction(theCream);
jaroma at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
On Tue, 6 Mar 2001, german wrote:
> Dear all vtk user:
> I try to convert the icecream.tcl to C++! My code was shoe in below:--
> void main()
> {
> //create a rendering windows and render
> vtkRenderer*ren=vtkRenderer::New();
> vtkRenderWindow*renWindow=vtkRenderWindow::New();
> renWindow->AddRenderer(ren);
> renWindow->SetSize(500,500);
>
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> iren->SetRenderWindow(renWindow);
>
> //create implicit function primitives
> vtkSphere*iceCream=vtkSphere::New();
> iceCream->SetRadius(0.5);
> iceCream->SetCenter(1.333, 0, 0);
> vtkSphere*bite=vtkSphere::New();
> bite->SetRadius(0.25);
> bite->SetCenter(1.5, 0, 0.5);
>
> //Set Operation
> vtkImplicitBoolean*theCream=vtkImplicitBoolean::New();
> theCream->SetOperationTypeToDifference();
> theCream->AddFunction(iceCream);
> theCream->AddFunction(bite);
>
> //iso-surface to create geometry
> vtkSampleFunction*theCreamSample=vtkSampleFunction::New();
> theCreamSample->SetImplicitionFunction(theCream);
> theCreamSample->SetModelBounds(-1,1.5,-1.25,1.25,-1.25,1.25);
> theCreamSample->SetSampleDimensions(60,60,60);
> theCreamSample->ComputeNormalsOff();
>
> //Generate implicit surface
> vtkContourFilter*theCreamSurface=vtkContourFilter::New();
> theCreamSurface->SetInput(theCreamSample->GetOutput());
> theCreamSurface->SetValue(0, 0.0);
> // range[0]=1.0;range[1]=6.0;
> // theCreamSurface->GenerateValues(3,range);
>
> //Map theCreamSurface
> vtkPolyDataMapper*creamMapper=vtkPolyDataMapper::New();
> creamMapper->SetInput(theCreamSurface->GetOutput());
> creamMapper->ScalarVisibilityOff();
>
> //Add actor into the scene
> vtkActor*theCreamSurfaceActor=vtkActor::New();
> theCreamSurfaceActor->SetMapper(creamMapper);
> ren->AddActor(theCreamSurfaceActor);
>
> //draw the result scene
> renWindow->Render();
> ren->SetBackground(0.1, 0.2, 0.4);
> iren->Start();
> }
>
> When I try to build the program, but the error show " SetImplicitionFunction is not a member of vtkSampleFunction"
>
> But in icecream.tcl:--
> the code show this:
> vtkImplicitBoolean theCream
> theCream SetOperationTypeToDifference
> theCream AddFunction iceCream
> theCream AddFunction bite
>
> # iso-surface to create geometry
> vtkSampleFunction theConeSample
> theConeSample SetImplicitFunction theCone
>
> What is the difference between the code in C++ and tcl? Why the program can run in tcl but not in C++??
>
> Please help! Because I want try some vtkImplicitBoolean in C++!
>
> Can anyone sent me some idea to solve this problems?
>
> Best regards,
> German Leung
>
>
>
More information about the vtkusers
mailing list