<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"> </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; "> <span style="color: #aa0d91">typedef</span> itk::CellInterface<MeshType::PixelType,MeshType::CellTraits > CellInterfaceType;</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::TriangleCell<CellInterfaceType> floatTriangleCell;</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::QuadrilateralCell<CellInterfaceType> floatQuadrilateralCell;</div></div><div><br></div><div>here you should add something like this</div><div><br></div><div> typedef itk::PolygonCell< 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> void Visit(unsigned long, floatPolygonCell* t )</div><div> {</div><div> // you have to write it yourself.</div><div> // you might just want to make a switch, </div><div> // cast to the right triangle / quad type </div><div> // and call the corresponding Visit method</div><div> }</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<vtkFloatingPointType, MeshType::CellTraits,itk::PolygonCell< itk::CellInterface<MeshType::PixelType, MeshType::CellTraits > >, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> 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; "> 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; "> 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 : <b>Sam 28.2.09, nadan zhu <i><<a href="mailto:nadan.zhu@gmail.com">nadan.zhu@gmail.com</a>></i></b> a écrit :<br></div> <blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">De: nadan zhu <<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" <<a href="mailto:martine_lef@yahoo.fr">martine_lef@yahoo.fr</a>><br>Cc: "Luis Ibanez" <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>>, "insight itk" <<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> 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><ATT00001.txt></span></blockquote></div><br></div></body></html>