<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">hi martine,<div><br></div><div>indeed in an itk:QuadEdgeMesh you have only Polygon cells, wether they represent triangles, quad or actual n-gons.</div><div><br></div><div>The code you are using is using the multivisitor patern, where you have to define yourself what kind of cells you are interested in. Here is some code, untested, that should put you in the right direction.</div><div><br></div><div>You first define the types:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">&nbsp;&nbsp;</span>// typedef the itk cells we are interested in</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp; <span style="color: #aa0d91">typedef</span> itk::CellInterface&lt;MeshType::PixelType,MeshType::CellTraits >&nbsp; CellInterfaceType;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp; <span style="color: #aa0d91">typedef</span> itk::TriangleCell&lt;CellInterfaceType>&nbsp; &nbsp; &nbsp; floatTriangleCell;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp; <span style="color: #aa0d91">typedef</span> itk::QuadrilateralCell&lt;CellInterfaceType> floatQuadrilateralCell;</div></div><div><br></div><div>here you should add something like this</div><div><br></div><div>&nbsp;&nbsp;typedef itk::PolygonCell&lt; CellInterfaceType> floatPolygonCell;</div><div><br></div><div>then you should create a flavor of the Visit method that takes one object of this new type as argument in the VistVTKCellsClass</div><div><br></div><div>&nbsp;&nbsp;void Visit(unsigned long, floatPolygonCell* t )</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp;// you have to write it yourself.</div><div>&nbsp;&nbsp; &nbsp;// you might just want to make a switch,&nbsp;</div><div>&nbsp;&nbsp; &nbsp;//&nbsp;cast to the right triangle / quad type&nbsp;</div><div>&nbsp;&nbsp; &nbsp;// and call the corresponding Visit method</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>almost there,</div><div>add a visitor type like this</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #aa0d91">typedef</span> itk::CellInterfaceVisitorImplementation&lt;vtkFloatingPointType, MeshType::CellTraits,itk::PolygonCell&lt; itk::CellInterface&lt;MeshType::PixelType, MeshType::CellTraits > >,&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp; VistVTKCellsClass> PolygonVisitor;</div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div></div><div>finally, in the MeshToUnstructuredGrid function, add an object of the new visitor type, and register it to the multivisitor:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp;PolygonVisitor::Pointer pv = PolygonVisitor::New();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">&nbsp;mv->AddVisitor(qv);</div></div><div><br></div><div>and you re done.</div><div><br></div><div>Computing curvature should then be straightforward with our classes. Note that this class was made for computation, and that influenced the design, most noticeably where we store curvature values.</div><div><br></div><div>Vizualizing will require you to transfer curvature values from pointype templates to vtk data-array. Brace yourself, and dig into the extended traits ;-)</div><div><br></div><div>alex.</div><div><br><div><div>On Feb 28, 2009, at 10:52 PM, Martine Lefevre wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;"><div>Hi , could you give me more details ...how and where I add them ?</div> <div>Thanks </div> <div>Martine</div> <div><br><br>--- En date de&nbsp;: <b>Sam 28.2.09, nadan zhu <i>&lt;<a href="mailto:nadan.zhu@gmail.com">nadan.zhu@gmail.com</a>></i></b> a écrit&nbsp;:<br></div> <blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: nadan zhu &lt;<a href="mailto:nadan.zhu@gmail.com">nadan.zhu@gmail.com</a>><br>Objet: Re: [Insight-users] Problem in mesh visualization with itkQuadEdgeMesh.. still waiting for a response…please help!<br>À: "Martine Lefevre" &lt;<a href="mailto:martine_lef@yahoo.fr">martine_lef@yahoo.fr</a>><br>Cc: "Luis Ibanez" &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>>, "insight itk" &lt;<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br>Date: Samedi 28 Février 2009, 5h14<br><br> <div id="yiv409765932">HI, <font face="Times New Roman"><span lang="EN-GB" style="FONT-SIZE: 11pt; COLOR: rgb(51,51,51)">Martine<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Please add itk::PolygonCell type and PolygonVisitor. It works for me. <br><br><br>wanlin<br><br><br></span></font><br><br></div></blockquote></td></tr></tbody></table><br>       <span>&lt;ATT00001.txt></span></blockquote></div><br></div></body></html>