<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#003333">
Hi all,<br>
<br>
I'm quite new in developping with vtk and I have some questions
concerning vtkContourWidget.<br>
<br>
I built a quick project which uses vtkContourWidget and
vtkPolyDataPointPlacer to display a contour on a sphere.<br>
<br>
When I click on this sphere, there's no problem : the points of the
contour are well positionned on the sphere. But it's not the case for
the spans which are outside or inside the sphere (but not on).<br>
<br>
Is there a way to force the borders of the contour to follow the
surface ?<br>
<br>
A solution would be to project the contour on the sphere but I can find
any documentation about that.<br>
<br>
For more clarity, I post a sample of my code.<br>
<br>
Thanks by advance.<br>
<br>
Nicolas<br>
<br>
code:<br>
<pre> //sphere definition
vtkSphereSource* theSphere = vtkSphereSource::New();
vtkPolyDataMapper * sphereMapper = vtkPolyDataMapper::New();
sphereMapper->SetInput(theSphere->GetOutput());
vtkLODActor* sphereActor = vtkLODActor::New();
sphereActor->SetMapper( sphereMapper);
vtkRenderer *renderer1 = vtkRenderer::New();
renderer1->AddActor(sphereActor);
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(renderer1);
vtkRenderWindowInteractor *rendIter = vtkRenderWindowInteractor::New();
rendIter->SetRenderWindow(renWin);
// Here comes the image actor constrained handle widget stuff.....
vtkContourWidget *widget = vtkContourWidget::New();
widget->SetInteractor(rendIter);
vtkSmartPointer<vtkLinearContourLineInterpolator> contourStyle =
vtkSmartPointer<vtkLinearContourLineInterpolator>::New();
vtkOrientedGlyphContourRepresentation *rep
=vtkOrientedGlyphContourRepresentation::SafeDownCast(
widget->GetRepresentation() );
rep->SetLineInterpolator(contourStyle);
// we define a Placer to force the contour to be on the sphere
vtkPolyDataPointPlacer * spherePlacer = vtkPolyDataPointPlacer::New();
spherePlacer->AddProp(sphereActor);
rep->SetPointPlacer(spherePlacer);
renWin->Render();
rendIter->Initialize();
widget->EnabledOn();
rendIter->Start();/
</pre>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Test_Signa</title>
<br>
</div>
</body>
</html>