<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Ok I understand, many thanks.<br><br><div><hr id="stopSpelling">Date: Tue, 13 Dec 2011 08:04:16 +0100<br>From: jerome.velut@kitware.com<br>To: stan1313@hotmail.fr<br>CC: paraview@paraview.org<br>Subject: Re: [Paraview] Creating cells<br><br>
  
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
    
  
  
    Hi,<br>
    <br>
    GetCell(...) is intended for internal use (see the doxygen
    documentation) where loc is not the cell id, but an offset in the
    internal array. Using InitTraversal together with GetNextCell
    instead would be easier.<br>
    <br>
    HTH<br>
    Jerome<br>
    <br>
    On 12/12/2011 06:19 PM, Fred Fred wrote:
    <blockquote cite="mid:BAY148-W46C69ED499B51F52A902D7B2BC0@phx.gbl">
      <style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>
      <div dir="ltr">
        <font class="ecxApple-style-span" face="Tahoma" size="2">Hello,</font>
        <div style="font-family:Tahoma;font-size:10pt">I have been
          reading and reading this piece of code but cannot figure out
          what is wrong!</div>
        <div style="font-family:Tahoma;font-size:10pt">I create a
          couple of cells of 4 ids and get...anything but what is
          expected.</div>
        <div style="font-family:Tahoma;font-size:10pt">Please tell
          me where I am wrong!</div>
        <div style="font-family:Tahoma;font-size:10pt"><br>
        </div>
        <div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp;
                vtkCellArray *faces = vtkCellArray::New();</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp;
                vtkIdList *fIds = vtkIdList::New();</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; for
                (int i=0 ; i&lt;faceIds.size() ; i++) {</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                for (int j=0 ; j&lt;faceIds[i].size() ; j++)</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp; &nbsp;
                fIds-&gt;InsertNextId(faceIds[i][j]);</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                faces-&gt;InsertNextCell(fIds);</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                printf("cell %d has %d ids\n", i,
                fIds-&gt;GetNumberOfIds());</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                fIds-&gt;Reset();</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; }</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; for
                (int i=0 ; i&lt;faces-&gt;GetNumberOfCells() ; i++) {</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                vtkIdList *list = vtkIdList::New();</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                faces-&gt;GetCell(i, list);</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; &nbsp;
                printf("cell %d has %d ids\n", i,
                list-&gt;GetNumberOfIds());</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">&nbsp; }</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px"><br>
              </span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 0
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 1
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 2
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 3
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 4
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 5
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 6
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 7
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 8
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 9
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                10 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                11 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                12 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                13 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                14 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                15 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                16 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                17 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                18 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                19 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px"><br>
              </span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 0
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 1
                has 64 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 2
                has 71 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 3
                has 113 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 4
                has 120 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 5
                has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 6
                has 63 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 7
                has 64 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 8
                has 112 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell 9
                has 113 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                10 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                11 has 64 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                12 has 63 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                13 has 71 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                14 has 70 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                15 has 4 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                16 has 71 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                17 has 78 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                18 has 120 ids</span></font></div>
          <div><font class="ecxApple-style-span" face="Tahoma"><span class="ecxApple-style-span" style="font-size:14px">cell
                19 has 127 ids</span></font></div>
        </div>
        <div style="font-family:Tahoma;font-size:10pt"><br>
        </div>
      </div>
      <br>
      <fieldset class="ecxmimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
Powered by <a class="ecxmoz-txt-link-abbreviated" href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="ecxmoz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the ParaView Wiki at: <a class="ecxmoz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a>

Follow this link to subscribe/unsubscribe:
<a class="ecxmoz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a>
</pre>
    </blockquote>
    <br>
    <br>
    <div class="ecxmoz-signature">-- <br>
      Jérôme Velut<br>
      R&amp;D Engineer<br>
      Kitware SAS<br>
      26 rue Louis Guérin<br>
      69100 Villeurbanne, France<br>
      F: +33 (0)4.37.45.04.15<br>
      <a href="http://www.kitware.fr" target="_blank">http://www.kitware.fr</a></div></div>                                               </div></body>
</html>