[vtkusers] Active data question

Jacques Charreyron-F264897 Jacques.Charreyron at fr.michelin.com
Thu May 13 11:40:52 EDT 2004


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
           \
 



More information about the vtkusers mailing list