[vtk-developers] vtkTensorGlyph & scaling

John Platt jcplatt at lineone.net
Fri Mar 25 17:06:18 EST 2005


Hi All,

 

I would like to suggest a small enhancement to vtkTensorGlyph giving
more control over the scaling of the glyphs. At present, the glyphs are
always scaled because no test is made on the 'Scaling' ivar and so this
does address an existing glitch. The scaling proposed is very similar to
that used in vtkGlyph3D so it should be familiar. Here are the changes
to the public part of the header.

 

Replace

 

  // Description:

  // Turn on/off scaling of glyph with eigenvalues.

  vtkSetMacro(Scaling,int);

 

By

 

  // Description:

  // Turn on/off all scaling of the glyphs. The source glyphs can be
scaled by the composite

  // factor (eigenvalue*ScaleFactor). The ScaleMode controls the use of
the eigenvalues in

  // the composite factor. By default, scaling is on.

  vtkSetMacro(Scaling,int);

 

 

Insert

 

//BTX

  enum

  {

      SCALE_BY_EIGENVALUES,

      DATA_SCALING_OFF,

  };

//ETX

 

  // Description:

  // Include or exclude the eigenvalues in the composite scale factor.
By default, the

  // eigenvalues are included and the glyphs will be scaled by
(eigenvalue*ScaleFactor).

  vtkSetClampMacro(ScaleMode, int, SCALE_BY_EIGENVALUES,
DATA_SCALING_OFF);

  vtkGetMacro(ScaleMode,int);

  void SetScaleModeToScaleByEigenvalues() 

    {this->SetScaleMode(SCALE_BY_EIGENVALUES);};

  void SetScaleModeToDataScalingOff()

    {this->SetScaleMode(DATA_SCALING_OFF);};

  const char* GetScaleModeAsString();

 

 

Insert

 

  // Description:

  // Specify scale factors for each principal direction. The first scale
factor is paired

  // with the most positive eigenvalue. If scale factors are not
specified, the single

  // ScaleFactor is used for all directions.

  vtkSetVector3Macro(ScaleFactors,double);

  vtkGetVector3Macro(ScaleFactors,double);

 

 

Existing apps with SetScalingOff() may see different behaviour.

 

If there are no objections, I will add the above and the implementation
details to bug tracker.

 

Thanks.

 

John.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20050325/ce432ad4/attachment.html>


More information about the vtk-developers mailing list