OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / HP / util / HP / include / vtk / vtkWarpScalar.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkWarpScalar.h,v $
5   Language:  C++
6   Date:      $Date: 2002/02/01 06:33:21 $
7   Version:   $Revision: 1.1.1.1 $
8
9
10 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
11
12 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
13 The following terms apply to all files associated with the software unless
14 explicitly disclaimed in individual files. This copyright specifically does
15 not apply to the related textbook "The Visualization Toolkit" ISBN
16 013199837-4 published by Prentice Hall which is covered by its own copyright.
17
18 The authors hereby grant permission to use, copy, and distribute this
19 software and its documentation for any purpose, provided that existing
20 copyright notices are retained in all copies and that this notice is included
21 verbatim in any distributions. Additionally, the authors grant permission to
22 modify this software and its documentation for any purpose, provided that
23 such modifications are not distributed without the explicit consent of the
24 authors and that existing copyright notices are retained in all copies. Some
25 of the algorithms implemented by this software are patented, observe all
26 applicable patent law.
27
28 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
29 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
30 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
31 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
34 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
35 PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
36 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
38
39
40 =========================================================================*/
41 // .NAME vtkWarpScalar - deform geometry with scalar data
42 // .SECTION Description
43 // vtkWarpScalar is a filter that modifies point coordinates by moving
44 // points along point normals by the scalar amount times the scale factor.
45 // Useful for creating carpet or x-y-z plots.
46 //
47 // If normals are not present in data, the Normal instance variable will
48 // be used as the direction along which to warp the geometry. If normals are
49 // present but you would like to use the Normal instance variable, set the 
50 // UseNormal boolean to true.
51 //
52 // If XYPlane boolean is set true, then the z-value is considered to be 
53 // a scalar value (still scaled by scale factor), and the displacement is
54 // along the z-axis. If scalars are also present, these are copied through
55 // and can be used to color the surface.
56 //
57 // Note that the filter passes both its point data and cell data to its output, 
58 // except for normals, since these are distorted by the warping.
59
60
61 #ifndef __vtkWarpScalar_h
62 #define __vtkWarpScalar_h
63
64 #include "vtkPointSetToPointSetFilter.h"
65
66 class VTK_EXPORT vtkWarpScalar : public vtkPointSetToPointSetFilter
67 {
68 public:
69   vtkWarpScalar();
70   static vtkWarpScalar *New() {return new vtkWarpScalar;};
71   const char *GetClassName() {return "vtkWarpScalar";};
72   void PrintSelf(ostream& os, vtkIndent indent);
73
74   // Description:
75   // Specify value to scale displacement.
76   vtkSetMacro(ScaleFactor,float);
77   vtkGetMacro(ScaleFactor,float);
78
79   // Description:
80   // Turn on/off use of user specified normal. If on, data normals
81   // will be ignored and instance variable Normal will be used instead.
82   vtkSetMacro(UseNormal,int);
83   vtkGetMacro(UseNormal,int);
84   vtkBooleanMacro(UseNormal,int);
85
86   // Description:
87   // Normal (i.e., direction) along which to warp geometry. Only used
88   // if UseNormal boolean set to true or no normals available in data.
89   vtkSetVector3Macro(Normal,float);
90   vtkGetVectorMacro(Normal,float,3);
91
92   // Description:
93   // Turn on/off flag specifying that input data is x-y plane. If x-y plane,
94   // then the z value is used to warp the surface in the z-axis direction 
95   // (times the scale factor) and scalars are used to color the surface.
96   vtkSetMacro(XYPlane,int);
97   vtkGetMacro(XYPlane,int);
98   vtkBooleanMacro(XYPlane,int);
99
100 protected:
101   void Execute();
102
103   float ScaleFactor;
104   int UseNormal;
105   float Normal[3];
106   int XYPlane;
107
108   //BTX
109   float *(vtkWarpScalar::*PointNormal)(int id, vtkNormals *normals);
110   float *DataNormal(int id, vtkNormals *normals=NULL);
111   float *InstanceNormal(int id, vtkNormals *normals=NULL);
112   float *ZNormal(int id, vtkNormals *normals=NULL);
113   //ETX
114 };
115
116 #endif
117
118