OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkWarpScalar.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkWarpScalar.h,v $
5   Language:  C++
6   Date:      $Date: 2003/01/09 19:21:05 $
7   Version:   $Revision: 1.39 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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.
23 //
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.
28 //
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.
33 //
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
36 // warping.
37
38
39 #ifndef __vtkWarpScalar_h
40 #define __vtkWarpScalar_h
41
42 #include "vtkPointSetToPointSetFilter.h"
43
44 class vtkDataArray;
45
46 class VTK_GRAPHICS_EXPORT vtkWarpScalar : public vtkPointSetToPointSetFilter
47 {
48 public:
49   static vtkWarpScalar *New();
50   vtkTypeRevisionMacro(vtkWarpScalar,vtkPointSetToPointSetFilter);
51   void PrintSelf(ostream& os, vtkIndent indent);
52
53   // Description:
54   // Specify value to scale displacement.
55   vtkSetMacro(ScaleFactor,float);
56   vtkGetMacro(ScaleFactor,float);
57
58   // Description:
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);
64
65   // Description:
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);
70
71   // Description:
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);
78
79 protected:
80   vtkWarpScalar();
81   ~vtkWarpScalar();
82
83   void Execute();
84
85   float ScaleFactor;
86   int UseNormal;
87   float Normal[3];
88   int XYPlane;
89
90   //BTX
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);
95   //ETX
96
97   char *InputScalarsSelection;
98   vtkSetStringMacro(InputScalarsSelection);
99
100 private:
101   vtkWarpScalar(const vtkWarpScalar&);  // Not implemented.
102   void operator=(const vtkWarpScalar&);  // Not implemented.
103 };
104
105 #endif