<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--body
        {overflow-y:auto;
        overflow-x:auto;}

 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

<style>
p.MsoNormal
        {margin-left:2.25pt;}
</style>
</head>

<body lang=EN-US link=blue vlink=blue style='margin-left:2.25pt;margin-top:
2.25pt;margin-right:2.25pt;margin-bottom:2.25pt'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Jacques,</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>On a very quick look, check</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font><font size=1
face=Arial><span style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp; currentMapper-&gt;SetScalarModeToUseCellData();&nbsp;
</span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span style='font-size:9.0pt;
font-family:Arial'><br>
</span></font><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'>Did you mean point data?</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>HTH </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>John.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <b><span style='font-weight:bold'>On Behalf
Of </span></b>jacques.charreyron<br>
<b><span style='font-weight:bold'>Sent:</span></b> </span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>21 February
 2005</span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> </span></font><font size=2 face=Tahoma><span
 style='font-size:10.0pt;font-family:Tahoma'>10:25</span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>To:</span></b> vtkusers@vtk.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [vtkusers] Quadratic cell
data bug ?</span></font></p>

<p class=MsoNormal style='margin-left:36.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:36.0pt'><font size=1 face=Arial><span
style='font-size:9.0pt;font-family:Arial'>Hello,<br>
<br>
<br>
I am trying to display values on quadratic cells. In my example I have one
quadratic quad cell <br>
I allocate only one tuple in my float array and put an arbitrary value :<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; vtkFloatArray *pointScalars = vtkFloatArray::New();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfComponents(1);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfTuples(6);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(0,10.0);<br>
&nbsp;&nbsp;&nbsp; grid-&gt;GetCellData()-&gt;SetScalars(pointScalars);<br>
<br>
When running this example I get this error :<br>
<br>
ERROR: In G:\Sandbox\Shared\common\intel_a\Api\Vtk\R4.4\Src\Common\vtkDataSet.cxx,
line 403<br>
vtkPolyData (0x01BADF98): Cell array&nbsp; with 1 components, has only 0 tuples
but there are 6 cells<br>
<br>
When I allocate six tuples to put six value : ie one for each triangle like
this :<br>
<br>
&nbsp;&nbsp;&nbsp; vtkFloatArray *pointScalars = vtkFloatArray::New();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfComponents(1);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfTuples(6);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(0,10.0);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(1,10.0);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(2,10.0);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(3,10.0);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(4,10.0);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(5,10.0);<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; grid-&gt;GetCellData()-&gt;SetScalars(pointScalars);<br>
&nbsp; <br>
<br>
&nbsp;I get the following error :<br>
<br>
Warning: In
G:\Sandbox\Shared\common\intel_a\Api\Vtk\R4.4\Src\Common\vtkDataSet.cxx, line
411<br>
vtkUnstructuredGrid (0x01B8CB00): Cell array&nbsp; with 1 components, has 6
tuples but there are only 1 cells<br>
<br>
ERROR: In
G:\Sandbox\Shared\common\intel_a\Api\Vtk\R4.4\Src\Common\vtkDataSet.cxx, line
403<br>
vtkPolyData (0x01BADF98): Cell array&nbsp; with 1 components, has only 0 tuples
but there are 6 cells<br>
<br>
<br>
<br>
Any idea ?<br>
<br>
<br>
<br>
Here is a code snippet to reproduce the behaviour :<br>
<br>
<br>
#include &lt;vtkActor.h&gt;<br>
#include &lt;vtkCellType.h&gt;<br>
#include &lt;vtkDataSetMapper.h&gt;<br>
#include &lt;vtkInteractorStyleTrackballCamera.h&gt;<br>
#include &lt;vtkPoints.h&gt;<br>
#include &lt;vtkProperty.h&gt;<br>
#include &lt;vtkRenderer.h&gt;<br>
#include &lt;vtkRenderWindow.h&gt;<br>
#include &lt;vtkRenderWindowInteractor.h&gt;<br>
#include &lt;vtkUnstructuredGrid.h&gt;<br>
#include &lt;vtkWindowToImageFilter.h&gt;<br>
#include &lt;vtkInteractorStyleTrackballCamera.h&gt;<br>
#include &lt;vtkActor2D.h&gt;<br>
#include &lt;vtkLabeledDataMapper.h&gt;<br>
#include &lt;vtkLookupTable.h&gt;<br>
#include &lt;vtkFloatArray.h&gt;<br>
#include &lt;vtkPointData.h&gt;<br>
#include &lt;vtkMath.h&gt;<br>
#include &lt;vtkScalarBarWidget.h&gt;<br>
#include &lt;vtkScalarBarActor.h&gt;<br>
#include &lt;vtkLookupTable.h&gt;<br>
#include &lt;vtkTexture.h&gt;<br>
#include &lt;vtkStructuredPoints.h&gt;<br>
#include &lt;vtkBandedPolyDataContourFilter.h&gt;<br>
#include &lt;vtkGeometryFilter.h&gt;<br>
#include &lt;vtkPolyDataMapper.h&gt;<br>
#include &lt;vtkCellData.h&gt;<br>
int main( int argc, char *argv[] )<br>
{<br>
<br>
&nbsp;&nbsp;&nbsp; vtkPoints *points = vtkPoints::New();<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetNumberOfPoints(8);<br>
<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(0,&nbsp;&nbsp;&nbsp;
0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(1,&nbsp;&nbsp;&nbsp;
1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(2,&nbsp;&nbsp;&nbsp;
1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(3,&nbsp;&nbsp;&nbsp;
0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(4,&nbsp;&nbsp;&nbsp; 0.5,&nbsp;&nbsp;&nbsp;
0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(5,&nbsp;&nbsp;&nbsp;
1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0.5,&nbsp;&nbsp;&nbsp; 0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(6,&nbsp;&nbsp;&nbsp;
0.5,&nbsp;&nbsp;&nbsp; 1,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0);<br>
&nbsp;&nbsp;&nbsp; points-&gt;SetPoint(7,&nbsp;&nbsp;&nbsp;
0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0.5,&nbsp;&nbsp;&nbsp; 0);<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; vtkIdType pointIds[8];<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; pointIds[0] = 0;<br>
&nbsp;&nbsp;&nbsp; pointIds[1] = 1;<br>
&nbsp;&nbsp;&nbsp; pointIds[2] = 2;<br>
&nbsp;&nbsp;&nbsp; pointIds[3] = 3;<br>
&nbsp;&nbsp;&nbsp; pointIds[4] = 4;<br>
&nbsp;&nbsp;&nbsp; pointIds[5] = 5;<br>
&nbsp;&nbsp;&nbsp; pointIds[6] = 6;<br>
&nbsp;&nbsp;&nbsp; pointIds[7] = 7;<br>
<br>
<br>
<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; //--------------<br>
&nbsp;&nbsp;&nbsp; // Quad grid<br>
&nbsp;&nbsp;&nbsp; //--------------<br>
<br>
&nbsp;&nbsp;&nbsp; vtkUnstructuredGrid*&nbsp;&nbsp;&nbsp; grid =
vtkUnstructuredGrid::New();<br>
&nbsp;&nbsp;&nbsp; grid-&gt;Allocate(1);<br>
&nbsp;&nbsp;&nbsp; grid-&gt;SetPoints(points);<br>
&nbsp;&nbsp;&nbsp; grid-&gt;InsertNextCell(VTK_QUADRATIC_QUAD,8,pointIds);<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; // Point data (scalars)<br>
&nbsp;&nbsp;&nbsp; vtkFloatArray *pointScalars = vtkFloatArray::New();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfComponents(1);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetNumberOfTuples(6);<br>
&nbsp;&nbsp;&nbsp; pointScalars-&gt;SetTuple1(0,10.0);<br>
<br>
&nbsp;&nbsp;&nbsp; grid-&gt;GetCellData()-&gt;SetScalars(pointScalars);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // Lookup :<br>
&nbsp;&nbsp;&nbsp; vtkLookupTable *lookupTable = vtkLookupTable::New();<br>
&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetNumberOfColors(10);<br>
&nbsp;&nbsp;&nbsp; lookupTable-&gt;SetTableRange(0.0,1.0);<br>
&nbsp;&nbsp;&nbsp; lookupTable-&gt;Build();&nbsp;&nbsp;&nbsp; <br>
<br>
<br>
&nbsp;&nbsp;&nbsp; // Scalar bar actor<br>
&nbsp;&nbsp;&nbsp; vtkScalarBarWidget&nbsp;
*scalarBarWidget=vtkScalarBarWidget::New();<br>
&nbsp;&nbsp;&nbsp; vtkScalarBarActor *scalarBarActor =
vtkScalarBarActor::New();<br>
&nbsp;&nbsp;&nbsp; scalarBarActor-&gt;SetLookupTable(lookupTable);<br>
&nbsp;&nbsp;&nbsp; scalarBarWidget-&gt;SetScalarBarActor(scalarBarActor);<br>
&nbsp;&nbsp;&nbsp; scalarBarActor-&gt;SetMaximumNumberOfColors(10);<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; // Mapper<br>
&nbsp;&nbsp;&nbsp; vtkDataSetMapper *currentMapper=vtkDataSetMapper::New();<br>
&nbsp;&nbsp;&nbsp; currentMapper-&gt;SetInput(grid);<br>
&nbsp;&nbsp;&nbsp; currentMapper-&gt;ScalarVisibilityOff();<br>
&nbsp;&nbsp;&nbsp; currentMapper-&gt;SetLookupTable(lookupTable);<br>
&nbsp;&nbsp;&nbsp; currentMapper-&gt;SetInterpolateScalarsBeforeMapping(1);<br>
&nbsp;&nbsp;&nbsp; currentMapper-&gt;SetScalarModeToUseCellData();<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; // Actor<br>
&nbsp;&nbsp;&nbsp; vtkActor *quadActor = vtkActor::New();<br>
&nbsp;&nbsp;&nbsp; quadActor-&gt;SetMapper(currentMapper);<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; //--------------<br>
&nbsp;&nbsp;&nbsp; // Visualization<br>
&nbsp;&nbsp;&nbsp; //--------------&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // Renderer<br>
&nbsp;&nbsp;&nbsp; vtkRenderer *renderer= vtkRenderer::New();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; renderer-&gt;SetLightFollowCamera(true);<br>
&nbsp;&nbsp;&nbsp; renderer-&gt;SetBackground(0.6,0.7,0.9);<br>
&nbsp;&nbsp;&nbsp; renderer-&gt;AddActor(quadActor);<br>
&nbsp;&nbsp;&nbsp; renderer-&gt;AddActor(scalarBarActor);<br>
<br>
&nbsp;&nbsp;&nbsp; // RenderWindow<br>
&nbsp;&nbsp;&nbsp; vtkRenderWindow *renderWindow = vtkRenderWindow::New();<br>
&nbsp;&nbsp;&nbsp; renderWindow-&gt;AddRenderer(renderer);<br>
&nbsp;&nbsp;&nbsp; renderWindow-&gt;SetSize(300,300);<br>
<br>
&nbsp;&nbsp;&nbsp; // Interactor<br>
&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();<br>
&nbsp;&nbsp;&nbsp; interactor-&gt;SetRenderWindow(renderWindow);<br>
<br>
&nbsp;&nbsp;&nbsp; // Interactor style<br>
&nbsp;&nbsp;&nbsp; vtkInteractorStyleTrackballCamera *interactorStyle =
vtkInteractorStyleTrackballCamera::New();<br>
&nbsp;&nbsp;&nbsp; interactor-&gt;SetInteractorStyle(interactorStyle);<br>
<br>
&nbsp;&nbsp;&nbsp; // Event loop<br>
&nbsp;&nbsp;&nbsp; interactor-&gt;Initialize();<br>
&nbsp;&nbsp;&nbsp; interactor-&gt;Start();<br>
<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; return 0;<br>
}<br>
<br>
<br>
<br>
</span></font></p>

</br>

<p style='margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:
.0001pt'><font size=1 face=Arial><span style='font-size:9.0pt;font-family:Arial'><img
width=32 height=32
src="http://premiummail.caramail.lycos.fr/Images/Mail/_icons/premium.gif"><b><font
color="#cc0000"><span style='color:#CC0000;font-weight:bold'>300 Mo gratuits
sur CaraMail : </span></font></b><a
href="http://secure.caramail.lycos.fr/services/signin/mail.jsp" target="_blank">Cliquez
ici pour en profiter!</a></span></font></p>

</div>

</div>

</body>

</html>