<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 <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<vtkRenderer> 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<vtkRenderer>::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<vtkRenderWindow> 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<vtkRenderWindow>::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->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<vtkRenderWindowInteractor> 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<vtkRenderWindowInteractor>::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->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<vtkJPEGReader> 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<vtkJPEGReader>::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;"><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->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->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->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->SetDataSpacing(2.0 / 3, 2.0 / 3, 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>jpegReader->SetFileNameSliceSpacing(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>jpegReader->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->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;"><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<vtkContourFilter> 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<vtkContourFilter>::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->SetInputConnection(jpegReader->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->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. </span></font></div><div><font color="#444444" face="Microsoft YaHei UI, Microsoft YaHei, 宋体, Calibri, sans-serif"><span style="font-size: 15px; line-height: 21px;"> // 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->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->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->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->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<Point3d> 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 < 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> points->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<char>(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<vtkPolyDataMapper> 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<vtkPolyDataMapper>::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->SetInputConnection(skinExtractor->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->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<vtkActor> 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<vtkActor>::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->SetMapper(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;"><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<vtkOutlineFilter> 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<vtkOutlineFilter>::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->SetInputConnection(jpegReader->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<vtkPolyDataMapper> 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<vtkPolyDataMapper>::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->SetInputConnection(outlineData->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<vtkActor> 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<vtkActor>::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->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->GetProperty()->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<vtkCamera> 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<vtkCamera>::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->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->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->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->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->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->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->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->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->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->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->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->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->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->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<vtkLineSource> lineSource = vtkSmartPointer<vtkLineSource>::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->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->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->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->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<vtkSphereSource> sp = vtkSmartPointer<vtkSphereSource>::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->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->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<vtkDataSetMapper> lineMapper = vtkSmartPointer<vtkDataSetMapper>::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->SetInput(lineSource->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<vtkActor> lineActor = vtkSmartPointer<vtkActor>::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->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->GetProperty()->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->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<vtkPointWidget> pointWidget = vtkSmartPointer<vtkPointWidget>::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->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->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->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;"> renWin->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->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->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->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>> Date: Tue, 16 Apr 2013 11:34:28 -0400<br>> Subject: Re: [vtkusers] vtkPointWidget set the right position<br>> From: daviddoria@gmail.com<br>> To: cybfly1@hotmail.com<br>> CC: vtkusers@vtk.org<br>> <br>> On Tue, Apr 16, 2013 at 10:01 AM, ChenDawnWind <cybfly1@hotmail.com> wrote:<br>> > Hi everyone,I want to position a point in the model,then i use the codes<br>> > like this:<br>> ><br>> > vtkSmartPointer<vtkPointWidget> pointWidget =<br>> > vtkSmartPointer<vtkPointWidget>::New();<br>> > pointWidget->SetPosition(center.x, center.y, 0);<br>> > pointWidget->SetInteractor(iren);<br>> > pointWidget->On();<br>> ><br>> > But the point always appear at the corner of the outline of the model.<br>> > So i search the answer in the examples and google, and tried:<br>> ><br>> > vtkSmartPointer<vtkPointWidget> pointWidget =<br>> > vtkSmartPointer<vtkPointWidget>::New();<br>> > pointWidget->PlaceWidget();<br>> > pointWidget->SetPosition(center.x, center.y, 0);<br>> > pointWidget->SetInteractor(iren);<br>> > pointWidget->On();<br>> ><br>> > or some other codes but the problem still. So i wanna know what codes should<br>> > i use to achieve my goal?<br>> > Thanks!<br>> ><br>> > DawnWind.Chen<br>> > CSU<br>> <br>> <br>> Please send the most simple, fully compilable code you can that<br>> demonstrates the problem.<br>> <br>> David<br></div></div></div></div></div>                                            </div></body>
</html>