<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<DIV style="PADDING-RIGHT: 0.6em; PADDING-LEFT: 0.6em; PADDING-BOTTOM: 0.6em; PADDING-TOP: 0.6em">Hi;</DIV>
<DIV style="PADDING-RIGHT: 0.6em; PADDING-LEFT: 0.6em; PADDING-BOTTOM: 0.6em; PADDING-TOP: 0.6em"> I use visual c++ and vtk as development tools, in my project. I work by the snake's method. I implemented functions to add or to remove points of snake is a polydata (it is a circle), after each iteration, I do not have any errors but l' posting of result it does not go (no posting, it posts dubug). Can someone help me please </DIV>
<DIV style="PADDING-RIGHT: 0.6em; PADDING-LEFT: 0.6em; PADDING-BOTTOM: 0.6em; PADDING-TOP: 0.6em">
<DIV style="PADDING-RIGHT: 0.6em; PADDING-LEFT: 0.6em; PADDING-BOTTOM: 0.6em; PADDING-TOP: 0.6em">Here is my code of function </DIV>
<DIV style="PADDING-RIGHT: 0.6em; PADDING-LEFT: 0.6em; PADDING-BOTTOM: 0.6em; PADDING-TOP: 0.6em">
<P class=EC_EC_MsoNormal><FONT face="Times New Roman" color=#000000 size=3>void vtkSnake::ResampleSnake(vtkPolyData *snake,int dmax,int dmin)</FONT></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int numberOfPoints=snake->GetNumberOfPoints();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int nbInputPoint,*inputPointsId;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>vtkPoints* points = snake->GetPoints();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>// get the number of point of the unregularized snake</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->GetLines()->GetCell(0,nbInputPoint,inputPointsId);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>for(int i=0;i<numberOfPoints;i++) {</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN lang=EN-GB><SPAN> </SPAN></SPAN>double pti[3];</FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN>points->GetPoint(inputPointsId[i],pti);</FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN lang=EN-GB>for(int idp=(1+numberOfPoints)/2;idp>0;idp--)</SPAN></FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN>double ptiFlw[3];</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[(idp+i)%numberOfPoints],ptiFlw);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[idp],pti);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double dist = sqrt(pow(ptiFlw[0]-pti[0],2)+pow(ptiFlw[1]-pti[1],2));</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN lang=EN-GB><SPAN> </SPAN></SPAN></FONT></FONT></FONT><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN>if(dist>dmin) continue;</FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN><SPAN lang=EN-GB>for(int k=0;k<idp;k++) </SPAN></FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>removeSnake(snake,inputPointsId[(i+1)%numberOfPoints]);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>break;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>for(int idp=0;idp<numberOfPoints;idp++)</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double ptiFlw[3],pti[3];</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[(idp+1)%numberOfPoints],ptiFlw);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[idp],pti);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double dist = sqrt(pow(ptiFlw[0]-pti[0],2)+pow(ptiFlw[1]-pti[1],2));</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>if(dist>dmax)</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>addSnake(snake,idp);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">//-------------------------------------------------------------------------</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">void vtkSnake::addSnake(vtkPolyData *snake,int pos)</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int numberOfPoints=snake->GetNumberOfPoints();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int nbInputPoint,*inputPointsId;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>vtkPoints* points = snake->GetPoints();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>// get the number of point of the unregularized snake</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->GetLines()->GetCell(0,nbInputPoint,inputPointsId);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double ptiFlw[3],pti[3];</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[(pos+1)%numberOfPoints],ptiFlw);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->GetPoint(inputPointsId[pos],pti);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double newX = (ptiFlw[0]+pti[0])/2.0;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>double newY = (ptiFlw[1]+pti[1])/2.0;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int newId=points->InsertNextPoint(newX,newY,pti[2]);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>points->Modified();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->GetLines()->InsertCellPoint(newId);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->GetLines()->UpdateCellCount(numberOfPoints++);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->Modified();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>numberOfPoints++;<SPAN> </SPAN><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN></FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">}</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">//-------------------------------------------------------------------------</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">void vtkSnake::removeSnake(vtkPolyData *snake,int pos)</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman">{</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int numberOfPoints=snake->GetNumberOfPoints();</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>int nbInputPoint,*inputPointsId;</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>snake->GetLines()->GetCell(0,nbInputPoint,inputPointsId);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN>snake->RemoveCellReference(inputPointsId[pos]);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><SPAN lang=EN-GB><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN><SPAN> </SPAN>snake->DeleteCell(inputPointsId[pos]);</FONT></FONT></FONT></SPAN></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN lang=EN-GB><SPAN> </SPAN><SPAN> </SPAN></SPAN>snake->Modified();</FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN> </SPAN>numberOfPoints--;</FONT></FONT></FONT></P>
<P class=EC_EC_MsoNormal><SPAN><FONT face="Times New Roman" color=#000000 size=3> </FONT></SPAN></P>
<P class=EC_EC_MsoNormal><FONT face="Times New Roman" color=#000000 size=3>}</FONT></P></DIV></DIV><br /><hr />Découvrez tout ce que <a href='http://www.microsoft.com/windows/windowslive/' target='_new'>Windows Live a à vous apporter !</a></body>
</html>