[vtkusers] Active data question

John Platt jcplatt at lineone.net
Fri May 14 12:11:28 EDT 2004


Hi Jacques,

vectors->SetName("Glyph");

do you mean

vectorsGlyph->SetName("Glyph"); ?

When the pipeline executes I think you will find that the attribute
vectors are "Glyph" - the last call to SetActiveVectors(). You could
either try updating the pipeline after the warp filter using Update() or
use vtkAssignAttribute after the warp to set "Glyph" as the attribute
vectors. 

John.

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of Jacques Charreyron-F264897
Sent: 13 May 2004 16:41
To: Vtkusers at vtk.org
Subject: [vtkusers] Active data question


Hi,

    I have a question concerning result selection : I am trying to
display a 3D
vector as a glyph on a deformed mesh. I used two 3D named float arrays:
One for
warp vector and the other for glyph.
    I must be confusing at some point with the   "SetActiveVectors"
method. I am
not sure that this call is stored into the pipeline. As a consequence
when the
Render occurs it seems that it takes the last active vestors for all
filters?

My question is it mandatory to create two unstructured grid and if so
what's the
use of 
"SetActiveVectors" ?


 I introduce a code snippet to show my attempt :
    // Creation of the first vector
    vtkFloatArray *vectorsGlyph = vtkFloatArray::New();
    vectors->SetName("Glyph");
    
    // Creation of 2nd vector
    vtkFloatArray *vectors = vtkFloatArray::New();
    vectors->SetName("Dep");

    // Add them to the grid :
    grid->GetPointData()->AddArray(vectors);g
    grid->GetPointData()->AddArray(vectorsGlyph);
    
    // Now let's filter with the proper vector :
    grid->GetPointData()->SetActiveVectors("Dep");

    vtkWarpVector *warp=vtkWarpVector::New();
    warp->SetInput(grid);
    warp->SetScaleFactor(0.5);
    vtkDataSetMapper *currentMapper=vtkDataSetMapper::New();
    currentMapper->SetInput(warp->GetOutput());

    // Now let's filter with the proper vector :
    grid->GetPointData()->SetActiveVectors("Glyph");
    vtkArrowSource *arrow = vtkArrowSource::New();
    arrowsGlyph->SetInput(warp->GetOutput());
    arrowsGlyph->SetSource(arrow->GetOutput());
    arrowsGlyph->SetVectorModeToUseVector();
    arrowsGlyph->SetScaleFactor(0.5);
    arrowsGlyph->ScalingOff();
Thanks for your  help,


Jacques Charreyron

__________________________________________________________
\
 \          Jacques Charreyron
  \          Société Michelin 
   \           Service PE3/EFX
    \            Site de Ladoux - Bât. F32 Bureau 2328
     \             23, pl. des Carmes Deschaux
      \              63040 Clermont-Ferrand Cedex 09 - France
       \               Tel : +33 (0) 4 73 10 91 60   
        \                Fax :+33 (0) 4 73 10 85 41  
         \                 Poste : 69160
          \                  E-Mail : Jacques.Charreyron at fr.michelin.com
           \
 
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list