<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:微软雅黑
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><i>Thanks for your advise.The codes below are the full function.</i><div><i>Also the resources all in the&nbsp;<span style="color: rgb(68, 68, 68); font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', 宋体, Calibri, sans-serif; font-size: 15px; line-height: 21px;">attachments.</span></i></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><i><br></i></span></font><div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">void vtkSimplePointExample()</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">{</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRenderer&gt; aRenderer =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkRenderer&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRenderWindow&gt; renWin =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkRenderWindow&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>renWin-&gt;AddRenderer(aRenderer);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; iren =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>iren-&gt;SetRenderWindow(renWin);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkJPEGReader&gt; jpegReader =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkJPEGReader&gt;::New(); &nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetFilePrefix("C:/Users/DawnWind/Desktop/000/");</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetFilePattern("%s%d.jpg");</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetDataByteOrderToLittleEndian();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetDataSpacing(2.0 / 3, 2.0 / 3, 1);&nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetFileNameSliceSpacing(1);&nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;SetDataExtent(0, 209, 0, 209, 0, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>jpegReader-&gt;Update(); &nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkContourFilter&gt; skinExtractor =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkContourFilter&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skinExtractor-&gt;SetInputConnection(jpegReader-&gt;GetOutputPort());</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skinExtractor-&gt;SetValue(0, 100);<span class="Apple-tab-span" style="white-space:pre">        </span></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">#ifndef _OpenCV</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>// this codes get the points of the contour</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>// calculate the center and then show it with OpenCV</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>// The point center is the calculated center result.&nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">&nbsp; &nbsp; &nbsp; &nbsp; // If you do not have OpenCV then just delete the codes in this ifndef_zone.</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skinExtractor-&gt;Update();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkPolyData *data = skinExtractor-&gt;GetOutput();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkPoints *points = data-&gt;GetPoints();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkIdType pSize = points-&gt;GetNumberOfPoints();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vector&lt;Point3d&gt; pointsGroup;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>Mat newMat = Mat::zeros(210, 210, CV_8UC1);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>int matStep = newMat.step;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>uchar *matData = newMat.data;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>Point2d center;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>for (int i = 0; i &lt; pSize; i++)</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>{</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>double point[3];</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp; &nbsp;points-&gt;GetPoint(i, point);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>Point3d p1;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>p1.x = (point[0]);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>p1.y = (point[1]);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>p1.z = (point[2]);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>*(matData + (int)point[0] + (int)point[1] * matStep) = 255;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>pointsGroup.push_back(p1);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>center.x += (int)point[0];</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>center.y += (int)point[1];</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>}</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>center.x /= pSize;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>center.y /= pSize;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>newMat.at&lt;char&gt;(center) = 255;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>Mat dst0;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>flip(newMat, dst0, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>imshow("dst0", dst0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>imshow("Mat", newMat);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>waitKey();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">#endif</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPolyDataMapper&gt; skinMapper =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skinMapper-&gt;SetInputConnection(skinExtractor-&gt;GetOutputPort());</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skinMapper-&gt;ScalarVisibilityOff();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkActor&gt; skin =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkActor&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>skin-&gt;SetMapper(skinMapper);&nbsp;</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkOutlineFilter&gt; outlineData =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkOutlineFilter&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>outlineData-&gt;SetInputConnection(jpegReader-&gt;GetOutputPort());</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapOutline =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>mapOutline-&gt;SetInputConnection(outlineData-&gt;GetOutputPort());</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkActor&gt; outline =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkActor&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>outline-&gt;SetMapper(mapOutline);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>outline-&gt;GetProperty()-&gt;SetColor(0, 0, 0);</span></font></div><div><span class="Apple-tab-span" style="white-space: pre; font-size: 15px; line-height: 21px;"><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif">        </font></span></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkCamera&gt; aCamera =</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSmartPointer&lt;vtkCamera&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetViewUp (0, 0, -1);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetPosition (0, 1, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetFocalPoint (0, 0, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;ComputeViewPlaneNormal();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;Azimuth(30.0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;Elevation(30.0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;AddActor(outline);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;AddActor(skin);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;SetActiveCamera(aCamera);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;ResetCamera ();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;Dolly(1.5);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;SetBackground(.2, .3, .4);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>renWin-&gt;SetSize(640, 480);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;ResetCameraClippingRange ();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">#ifndef LINE</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkLineSource&gt; lineSource = vtkSmartPointer&lt;vtkLineSource&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>//lineSource-&gt;SetPoint1(123, 90, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>lineSource-&gt;SetPoint1(center.x, center.y, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>lineSource-&gt;SetPoint2(center.x, center.y, 50);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>//lineSource-&gt;SetPoint2(123, 90, 50);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkSphereSource&gt; sp = vtkSmartPointer&lt;vtkSphereSource&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>//sp-&gt;SetCenter(center.x, center.y, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>sp-&gt;SetCenter(90, 117, 50);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkDataSetMapper&gt; lineMapper = vtkSmartPointer&lt;vtkDataSetMapper&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>lineMapper-&gt;SetInput(lineSource-&gt;GetOutput());</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkActor&gt; lineActor = vtkSmartPointer&lt;vtkActor&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>lineActor-&gt;SetMapper(lineMapper);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>lineActor-&gt;GetProperty()-&gt;SetColor(1.0, 0, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>aRenderer-&gt;AddActor(lineActor);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><br></span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPointWidget&gt; pointWidget = vtkSmartPointer&lt;vtkPointWidget&gt;::New();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>pointWidget-&gt;SetPosition(center.x, center.y, 0);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>pointWidget-&gt;SetInteractor(iren);</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>pointWidget-&gt;On();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">#endif</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">&nbsp; &nbsp; renWin-&gt;Render();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>renWin-&gt;SetWindowName("CYB");</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>iren-&gt;Initialize();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"><span class="Apple-tab-span" style="white-space:pre">        </span>iren-&gt;Start();</span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;">}</span></font></div><div><div><br></div><div><div>int main()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSimplePointExample();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div>}</div></div><div><br></div><div>Best wishes:)<br><br>DawnWind.Chen<div>CSU</div><br><br><div><div id="SkyDrivePlaceholder"></div>&gt; Date: Tue, 16 Apr 2013 11:34:28 -0400<br>&gt; Subject: Re: [vtkusers] vtkPointWidget set the right position<br>&gt; From: daviddoria@gmail.com<br>&gt; To: cybfly1@hotmail.com<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; On Tue, Apr 16, 2013 at 10:01 AM, ChenDawnWind &lt;cybfly1@hotmail.com&gt; wrote:<br>&gt; &gt; Hi everyone,I want to position a point in the model,then i use the codes<br>&gt; &gt; like this:<br>&gt; &gt;<br>&gt; &gt; vtkSmartPointer&lt;vtkPointWidget&gt; pointWidget =<br>&gt; &gt; vtkSmartPointer&lt;vtkPointWidget&gt;::New();<br>&gt; &gt; pointWidget-&gt;SetPosition(center.x, center.y, 0);<br>&gt; &gt; pointWidget-&gt;SetInteractor(iren);<br>&gt; &gt; pointWidget-&gt;On();<br>&gt; &gt;<br>&gt; &gt; But the point always appear at the corner of the outline of the model.<br>&gt; &gt; So i search the answer in the examples and google, and tried:<br>&gt; &gt;<br>&gt; &gt;         vtkSmartPointer&lt;vtkPointWidget&gt; pointWidget =<br>&gt; &gt; vtkSmartPointer&lt;vtkPointWidget&gt;::New();<br>&gt; &gt;         pointWidget-&gt;PlaceWidget();<br>&gt; &gt; pointWidget-&gt;SetPosition(center.x, center.y, 0);<br>&gt; &gt; pointWidget-&gt;SetInteractor(iren);<br>&gt; &gt; pointWidget-&gt;On();<br>&gt; &gt;<br>&gt; &gt; or some other codes but the problem still. So i wanna know what codes should<br>&gt; &gt; i use to achieve my goal?<br>&gt; &gt; Thanks!<br>&gt; &gt;<br>&gt; &gt; DawnWind.Chen<br>&gt; &gt; CSU<br>&gt; <br>&gt; <br>&gt; Please send the most simple, fully compilable code you can that<br>&gt; demonstrates the problem.<br>&gt; <br>&gt; David<br></div></div></div></div></div>                                               </div></body>
</html>