1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkImplicitTextureCoords.h,v $
6 Date: $Date: 2002/02/01 06:35:48 $
7 Version: $Revision: 1.1.1.1 $
10 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
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.
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.
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.
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.
40 =========================================================================*/
41 // .NAME vtkImplicitTextureCoords - generate 1D, 2D, or 3D texture coordinates based on implicit function(s)
42 // .SECTION Description
43 // vtkImplicitTextureCoords is a filter to generate 1D, 2D, or 3D texture
44 // coordinates from one, two, or three implicit functions, respectively.
45 // In combinations with a vtkBooleanTexture map (or another texture map of
46 // your own creation), the texture coordinates can be used to highlight
47 //(via color or intensity) or cut (via transparency) dataset geometry without
48 // any complex geometric processing. (Note: the texture coordinates are
49 // referred to as r-s-t coordinates.)
51 // The texture coordinates are automatically normalized to lie between (0,1).
52 // Thus, no matter what the implicit functions evaluate to, the resulting
53 // texture coordinates lie between (0,1), with the zero implicit function
54 // value mapped to the 0.5 texture coordinates value. Depending upon the
55 // maximum negative/positive implicit function values, the full (0,1) range
56 // may not be occupied (i.e., the positive/negative ranges are mapped using
57 // the same scale factor).
59 // A boolean variable InvertTexture is available to flip the texture
60 // coordinates around 0.5 (value 1.0 becomes 0.0, 0.25->0.75). This is
61 // equivalent to flipping the texture map (but a whole lot easier).
64 // You can use the transformation capabilities of vtkImplicitFunction to
65 // orient, translate, and scale the implicit functions. Also, the dimension of
66 // the texture coordinates is implicitly defined by the number of implicit
70 // vtkImplicitFunction vtkTexture vtkBooleanTexture vtkTransformTexture
72 #ifndef __vtkImplicitTextureCoords_h
73 #define __vtkImplicitTextureCoords_h
75 #include "vtkDataSetToDataSetFilter.h"
76 #include "vtkImplicitFunction.h"
78 class VTK_EXPORT vtkImplicitTextureCoords : public vtkDataSetToDataSetFilter
81 vtkImplicitTextureCoords();
82 static vtkImplicitTextureCoords *New() {return new vtkImplicitTextureCoords;};
83 const char *GetClassName() {return "vtkImplicitTextureCoords";};
84 void PrintSelf(ostream& os, vtkIndent indent);
87 // Specify an implicit function to compute the r texture coordinate.
88 vtkSetObjectMacro(RFunction,vtkImplicitFunction);
89 vtkGetObjectMacro(RFunction,vtkImplicitFunction);
92 // Specify an implicit function to compute the s texture coordinate.
93 vtkSetObjectMacro(SFunction,vtkImplicitFunction);
94 vtkGetObjectMacro(SFunction,vtkImplicitFunction);
97 // Specify an implicit function to compute the t texture coordinate.
98 vtkSetObjectMacro(TFunction,vtkImplicitFunction);
99 vtkGetObjectMacro(TFunction,vtkImplicitFunction);
102 // If enabled, this will flip the sense of inside and outside the implicit
103 // function (i.e., a rotation around the r-s-t=0.5 axis).
104 vtkSetMacro(FlipTexture,int);
105 vtkGetMacro(FlipTexture,int);
106 vtkBooleanMacro(FlipTexture,int);
113 vtkImplicitFunction *RFunction;
114 vtkImplicitFunction *SFunction;
115 vtkImplicitFunction *TFunction;