[vtkusers] TensorGlyph

Gib Bogle g.bogle at auckland.ac.nz
Sun Jul 13 19:29:31 EDT 2014


I find that my modification works if I comment out the first
  tensorGlyph->Update();
(after defining the first two glyphs).  It seems that Update() fixes the mapper's glyph list.
________________________________________
From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz]
Sent: Monday, 14 July 2014 10:05 a.m.
To: Bill Lorensen
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] TensorGlyph

I am trying to get a better understanding of what I can do with this method of creating a scene using glyphs.  What I want to be able to do is (a) change the position/shape/orientation of a glyph, and (b) add new glyphs.  I am assuming that for performance reasons (I expect to have tens of thousands of glyphs) it will be better to modify an existing actor rather than delete it a create it afresh each time step.  If this is an incorrect assumption please tell me so.

My ideas about this have so far been unsuccessful.  For example, I thought that I could do this in the TensorGlyph example:

after the line

    renderer->AddActor(actor);

add

    tensors->SetNumberOfTuples(3);
    points->InsertNextPoint(0.0, 5.0, 0.0);
    tensors->InsertTuple9(2,1,0,0,0,1,0,0,0,1);
    tensorGlyph->Update();
    mapper->Update();

but this still displays two glyphs.
Is there a way to do what I'm trying to do, or is this misguided?

Thanks
Gib
________________________________________
From: Bill Lorensen [bill.lorensen at gmail.com]
Sent: Sunday, 13 July 2014 12:19 a.m.
To: Gib Bogle
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] TensorGlyph

I'll fix the example on the wiki so it works for both vtk5 and vtk6.
 Normally the night builds would catch this, but the example was in
the wring location.


On Sat, Jul 12, 2014 at 6:00 AM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:
> I got a clue from the Glyph3D example, which shows the check for
> VTK_MAJOR_VERSION <= 5
> I then replaced these lines
> //    tensorGlyph->SetInputData(polyData);
> //    tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort());
>     tensorGlyph->SetSource(cubeSource->GetOutput());
>     tensorGlyph->SetInput(polyData);
> and this one
> //    mapper->SetInputData(tensorGlyph->GetOutput());
>     mapper->SetInputConnection(tensorGlyph->GetOutputPort());
> and now it builds and runs :)
>
> ________________________________
> From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle
> [g.bogle at auckland.ac.nz]
> Sent: Saturday, 12 July 2014 8:56 p.m.
> To: vtkusers at vtk.org
> Subject: [vtkusers] TensorGlyph
>
> Hi,
> I tried to build this example:
> http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph
> but I get two errors:
>     class "vtkTensorGlyph" has no member "SetInputData"
>     class "vtkPolyDataMapper" has no member "SetInputData"
> I am using VTK-5.10
>
> Regards
> Gib
>
>
>
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers
>



--
Unpaid intern in BillsBasement at noware dot com
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list