1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkWarpScalar.h,v $
6 Date: $Date: 2003/01/09 19:21:05 $
7 Version: $Revision: 1.39 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkWarpScalar - deform geometry with scalar data
19 // .SECTION Description
20 // vtkWarpScalar is a filter that modifies point coordinates by moving
21 // points along point normals by the scalar amount times the scale factor.
22 // Useful for creating carpet or x-y-z plots.
24 // If normals are not present in data, the Normal instance variable will
25 // be used as the direction along which to warp the geometry. If normals are
26 // present but you would like to use the Normal instance variable, set the
27 // UseNormal boolean to true.
29 // If XYPlane boolean is set true, then the z-value is considered to be
30 // a scalar value (still scaled by scale factor), and the displacement is
31 // along the z-axis. If scalars are also present, these are copied through
32 // and can be used to color the surface.
34 // Note that the filter passes both its point data and cell data to
35 // its output, except for normals, since these are distorted by the
39 #ifndef __vtkWarpScalar_h
40 #define __vtkWarpScalar_h
42 #include "vtkPointSetToPointSetFilter.h"
46 class VTK_GRAPHICS_EXPORT vtkWarpScalar : public vtkPointSetToPointSetFilter
49 static vtkWarpScalar *New();
50 vtkTypeRevisionMacro(vtkWarpScalar,vtkPointSetToPointSetFilter);
51 void PrintSelf(ostream& os, vtkIndent indent);
54 // Specify value to scale displacement.
55 vtkSetMacro(ScaleFactor,float);
56 vtkGetMacro(ScaleFactor,float);
59 // Turn on/off use of user specified normal. If on, data normals
60 // will be ignored and instance variable Normal will be used instead.
61 vtkSetMacro(UseNormal,int);
62 vtkGetMacro(UseNormal,int);
63 vtkBooleanMacro(UseNormal,int);
66 // Normal (i.e., direction) along which to warp geometry. Only used
67 // if UseNormal boolean set to true or no normals available in data.
68 vtkSetVector3Macro(Normal,float);
69 vtkGetVectorMacro(Normal,float,3);
72 // Turn on/off flag specifying that input data is x-y plane. If x-y plane,
73 // then the z value is used to warp the surface in the z-axis direction
74 // (times the scale factor) and scalars are used to color the surface.
75 vtkSetMacro(XYPlane,int);
76 vtkGetMacro(XYPlane,int);
77 vtkBooleanMacro(XYPlane,int);
91 float *(vtkWarpScalar::*PointNormal)(vtkIdType id, vtkDataArray *normals);
92 float *DataNormal(vtkIdType id, vtkDataArray *normals=NULL);
93 float *InstanceNormal(vtkIdType id, vtkDataArray *normals=NULL);
94 float *ZNormal(vtkIdType id, vtkDataArray *normals=NULL);
97 char *InputScalarsSelection;
98 vtkSetStringMacro(InputScalarsSelection);
101 vtkWarpScalar(const vtkWarpScalar&); // Not implemented.
102 void operator=(const vtkWarpScalar&); // Not implemented.