[vtkusers] Glyphs on structuredGrid cell centers

Sebastian Gatzka sebastian.gatzka at stud.tu-darmstadt.de
Mon Feb 22 07:31:41 EST 2010


How does this work?
I have only found some strange 
file:///C:/Vtk%20Docs/html/classvtkCellCenterDepthSort.html stuff.

Am 22.02.2010 13:27, schrieb Dominik Szczerba:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Try passing your grid through CellCenters filter first.
>
> Sebastian Gatzka wrote:
>    
>>    Hello, me again.
>>
>> This time I'm facing trouble visualizing glyphs on my structured grid.
>> Suppose I have done it right there is some vector data:
>>
>> vtkFloatArray *v2 = vtkFloatArray::New();
>> v2->SetNumberOfComponents(3);
>> for (unsigned i = 0; i<  noCells; i++){
>>      v2->InsertNextTuple3(i,i,i);
>> }
>>
>> assigned to the structured grid cell centers:
>>
>> sGrid->GetCellData()->SetVectors(v2);
>>
>> Now creating some glyphs
>>
>> vtkConeSource *cone = vtkConeSource::New();
>> cone->SetResolution(6);
>>
>> vtkGlyph3D *glyph = vtkGlyph3D::New();
>> glyph->SetInput( *sGrid* );
>> glyph->SetSourceConnection(cone->GetOutputPort());
>> glyph->SetVectorModeToUseNormal();
>> glyph->SetScaleModeToScaleByVector();
>> glyph->SetScaleFactor(0.25);
>>
>> results in some arrows located at the structured grid points (sGrid)
>> instead of the cell centers.
>>
>>      * So how do I give vtkGlyph3D the cell centers of the structured
>>        grid as input?
>>      * And how does the gylph filter know it should represent the vector
>>        data?!
>>
>> Sebastian
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>      
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkuCeEkACgkQ/EBMh9bUuzJJlwCg5wTX7HvW3lFbBtSPaRKvL/xq
> JWgAnRnAFq78Z6B7NBcEYP9h/BDPIBJl
> =yF5L
> -----END PGP SIGNATURE-----
>
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100222/2dc89a9c/attachment.htm>


More information about the vtkusers mailing list