Hi, David,<br><br>Thank you for your help.<br><br>I made it in your way. Thank you so much.<br><br>Have a good night.<br><br>Wenlong<br><br><div class="gmail_quote">2011/10/11 David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">In my quick scan of your code I didn't notice that you are already<br>
taking approach #2. Sorry about that.<br>
<br>
VTK won't draw points without cells. Add one VTK_VERTEX cell for every<br>
landmark point and I think you will see the result. One way to do that<br>
is feed newpolydata into the glyph filter.<br>
<div class="im"><br>
David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a><br>
<br>
<br>
<br>
</div>2011/10/11 Wenlong Wang <<a href="mailto:scc.wwl@gmail.com">scc.wwl@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi, David,<br>
><br>
> Thank you for your reply.<br>
><br>
> Yes, the code clip I attached is building a polydata object for the<br>
> landmarks only and there is another polydata object for the surface.<br>
><br>
> What I want to make is the landmarks are drawn on the screen while another<br>
> surface is show. However, when the application runs, only the surface is<br>
> shown, the landmarks are never appreared. I tried to change the z-coordinate<br>
> by hand, but they still don't appear.<br>
><br>
> Could it be anything wrong with the visualization pipeline? I think I've<br>
> accomplish the basic operation to visualize actors in the code clip.<br>
><br>
> Thank you for your kind helpӣ<br>
><br>
> Wenlong<br>
><br>
> 2011/10/11 David E DeMarle <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>><br>
>><br>
>> You have to have as many tuples in the scalars array as there are<br>
>> points in the polydata. You have only as many tuples as there are<br>
>> landmark points.<br>
>><br>
>> Alternatively might make another polydata that contains only the<br>
>> landmark points and draw both polydata. Scale the landmark polydata up<br>
>> slightly to avoid z-tearing.<br>
>><br>
>> David E DeMarle<br>
>> Kitware, Inc.<br>
>> R&D Engineer<br>
>> 21 Corporate Drive<br>
>> Clifton Park, NY 12065-8662<br>
>> Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a><br>
>><br>
>><br>
>><br>
>> On Tue, Oct 11, 2011 at 9:17 AM, Wenlong Wang <<a href="mailto:scc.wwl@gmail.com">scc.wwl@gmail.com</a>> wrote:<br>
>> > Dear all,<br>
>> ><br>
>> > Is there anyone know how to change the color of points with specific<br>
>> > point<br>
>> > ID?<br>
>> ><br>
>> > I do it like this, but the surface appeared but none of these point is<br>
>> > shown.<br>
>> ><br>
>> > Here is the code,<br>
>> ><br>
>> > vtkPoints* newpoints = vtkPoints::New();<br>
>> > for (int i = 0; i < sizeof(landmarks)/sizeof(double); i++)<br>
>> > {<br>
>> > double temp_point[3];<br>
>> > points->GetPoint(vtkIdType(landmarks[i]), temp_point);<br>
>> > newpoints->InsertPoint(vtkIdType(i), temp_point[0],<br>
>> > temp_point[1],<br>
>> > temp_point[2]);<br>
>> > }<br>
>> ><br>
>> > vtkPolyData* newpolydata = vtkPolyData::New();<br>
>> > newpolydata->SetPoints(newpoints);<br>
>> ><br>
>> > vtkFloatArray* newarray = vtkFloatArray::New();<br>
>> > for (int i = 0; i < sizeof(landmarks)/sizeof(double); i++)<br>
>> > {<br>
>> > newarray->InsertTuple1(vtkIdType(i), double(i));<br>
>> > }<br>
>> ><br>
>> > newpolydata->GetPointData()->SetScalars(newarray);<br>
>> ><br>
>> > vtkPolyDataMapper* newmapper = vtkPolyDataMapper::New();<br>
>> > newmapper->SetInput(newpolydata);<br>
>> > newmapper->SetScalarRange(0, 7);<br>
>> > newmapper->SetScalarVisibility(0);<br>
>> ><br>
>> > vtkActor* newactor = vtkActor::New();<br>
>> > newactor->SetMapper(newmapper);<br>
>> > newactor->GetProperty()->SetColor(0.0, 1.0, 0.0);<br>
>> > newactor->GetProperty()->SetPointSize(3);<br>
>> ><br>
>> > ren->AddActor(newactor);<br>
>> > renWin->AddRenderer(ren);<br>
>> ><br>
>> > ren->Render();<br>
>> > renWin->Render();<br>
>> ><br>
>> > where 'ren' is a vtkRenderer object, 'renWin' is a vtkRenderWindow<br>
>> > object,<br>
>> > and 'landmarks' is an array stores vtk point IDs.<br>
>> ><br>
>> > Can anybody help me with this? I'll be very grateful.<br>
>> ><br>
>> > Thank you all so much.<br>
>> ><br>
>> > Bests<br>
>> > Wenlong<br>
>> ><br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the VTK FAQ at:<br>
>> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>