<div>Greetings ,</div><div><br></div><div>I generated seperate meshes for each curve-set and the result looks like this:</div><div><br></div><div><a href="http://oi56.tinypic.com/b9ch82.jpg">http://oi56.tinypic.com/b9ch82.jpg</a></div>
<div><br></div><div>As can be seen in the picute,they have lots the relative positions.</div><div><br></div><div>Any tips whould be greatly appretiated.</div><div><br></div><div>Here is my code :</div><div><br></div><div>
<br></div><div> QList<vtkAppendPolyData*> *collection=constCurvePolyDataSets(); //get list of curve-sets </div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for(int i=0;i<collection->size();i++)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkAppendPolyData *appPoly=collection->at(i); //Generate mesh for each Curve set</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>qDebug("PolyData %d %d",i,appPoly);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>double bc[6], bm[6];</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>appPoly->GetOutput()->GetBounds(bc);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkActor *actor = vtkActor::New(); //New actor for each mesh part<span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkVoxelContoursToSurfaceFilter *contoursToSurface =vtkVoxelContoursToSurfaceFilter::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>contoursToSurface->SetInputConnection(appPoly->GetOutputPort());<span class="Apple-tab-span" style="white-space:pre">                                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>contoursToSurface->SetSpacing(5, 5, 1);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>contoursToSurface->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>contoursToSurface->GetOutput()->GetBounds(bm);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>qDebug("C - %d %d %d %d %d %d " ,bc[0],bc[1],bc[2],bc[3],bc[4],bc[5]);</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>qDebug("M - %d %d %d %d %d %d " ,bm[0],bm[1],bm[2],bm[3],bm[4],bm[5]);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>mapper->AddInputConnection(contoursToSurface->GetOutputPort() );</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>mapper2->SetInputConnection(appPoly->GetOutputPort());</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>actor->SetMapper(mapper);<span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>renderer->AddActor(actor);<span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><br></div><div><br></div><div><br></div><div><br>
</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><br><div class="gmail_quote">On 6 October 2010 12:07, Ashika Umanga Umagiliya <span dir="ltr"><<a href="mailto:aumanga@biggjapan.com">aumanga@biggjapan.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Greetings all,<br><br>I have stack of contours which generated using someother algorithm outside VTK.<br>Each contour consists of several curves .<br>
<br>Please refer to image at : <br><br><a href="http://oi52.tinypic.com/14xkobc.jpg" target="_blank">http://oi52.tinypic.com/14xkobc.jpg</a><br>
<br><br>As seen in the image, each curve has an ID to identify which level it is.(Curves in same level have identical color)<br><br>Now I want to generate Meshes using "vtkVoxelContoursToSurfaceFilter" for each of this Curve set belong.<br>
That is, one mesh for contours in Blue color , another mesh for contours in Orange color ..and so on..<br>And I should keep the relative positions of these Meshes. And should color each generated mesh in different color.<br>
<br>I keep a list of "vtkAppendPolyData" for each Curve set.<br><br>But I am not sure where I should go after this?<br>1.Shall I create seperate Actors for each Mesh ? If so how can I keep the relative positions of Meshes. (vtkVoxelContoursToSurfaceFilter change the origin right?)<br>
2.Can I use vtkVoxelContoursToSurfaceFilter.SetInputConnection(int port,vtkAlgorithmOutput) and use different port number for each curves "vtkAppendPolyData".<br><br>Any tips,<br><br>thanks in advance,<br><font color="#888888">umanga<br>
<br>
</font></blockquote></div><br>