1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkBooleanTexture.h,v $
6 Date: $Date: 2002/06/11 15:47:59 $
7 Version: $Revision: 1.34 $
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 vtkBooleanTexture - generate 2D texture map based on combinations of inside, outside, and on region boundary
20 // .SECTION Description
21 // vtkBooleanTexture is a filter to generate a 2D texture map based on
22 // combinations of inside, outside, and on region boundary. The "region" is
23 // implicitly represented via 2D texture coordinates. These texture
24 // coordinates are normally generated using a filter like
25 // vtkImplicitTextureCoords, which generates the texture coordinates for
26 // any implicit function.
28 // vtkBooleanTexture generates the map according to the s-t texture
29 // coordinates plus the notion of being in, on, or outside of a
30 // region. An in region is when the texture coordinate is between
31 // (0,0.5-thickness/2). An out region is where the texture coordinate
32 // is (0.5+thickness/2). An on region is between
33 // (0.5-thickness/2,0.5+thickness/2). The combination in, on, and out
34 // for each of the s-t texture coordinates results in 16 possible
35 // combinations (see text). For each combination, a different value of
36 // intensity and transparency can be assigned. To assign maximum intensity
37 // and/or opacity use the value 255. A minimum value of 0 results in
38 // a black region (for intensity) and a fully transparent region (for
42 // vtkImplicitTextureCoords vtkThresholdTextureCoords
44 #ifndef __vtkBooleanTexture_h
45 #define __vtkBooleanTexture_h
47 #include "vtkImageSource.h"
49 class VTK_IMAGING_EXPORT vtkBooleanTexture : public vtkImageSource
52 static vtkBooleanTexture *New();
54 vtkTypeRevisionMacro(vtkBooleanTexture,vtkImageSource);
55 void PrintSelf(ostream& os, vtkIndent indent);
58 // Set the X texture map dimension.
59 vtkSetMacro(XSize,int);
60 vtkGetMacro(XSize,int);
63 // Set the Y texture map dimension.
64 vtkSetMacro(YSize,int);
65 vtkGetMacro(YSize,int);
68 // Set the thickness of the "on" region.
69 vtkSetMacro(Thickness,int);
70 vtkGetMacro(Thickness,int);
73 // Specify intensity/transparency for "in/in" region.
74 vtkSetVector2Macro(InIn,unsigned char);
75 vtkGetVectorMacro(InIn,unsigned char,2);
78 // Specify intensity/transparency for "in/out" region.
79 vtkSetVector2Macro(InOut,unsigned char);
80 vtkGetVectorMacro(InOut,unsigned char,2);
83 // Specify intensity/transparency for "out/in" region.
84 vtkSetVector2Macro(OutIn,unsigned char);
85 vtkGetVectorMacro(OutIn,unsigned char,2);
88 // Specify intensity/transparency for "out/out" region.
89 vtkSetVector2Macro(OutOut,unsigned char);
90 vtkGetVectorMacro(OutOut,unsigned char,2);
93 // Specify intensity/transparency for "on/on" region.
94 vtkSetVector2Macro(OnOn,unsigned char);
95 vtkGetVectorMacro(OnOn,unsigned char,2);
98 // Specify intensity/transparency for "on/in" region.
99 vtkSetVector2Macro(OnIn,unsigned char);
100 vtkGetVectorMacro(OnIn,unsigned char,2);
103 // Specify intensity/transparency for "on/out" region.
104 vtkSetVector2Macro(OnOut,unsigned char);
105 vtkGetVectorMacro(OnOut,unsigned char,2);
108 // Specify intensity/transparency for "in/on" region.
109 vtkSetVector2Macro(InOn,unsigned char);
110 vtkGetVectorMacro(InOn,unsigned char,2);
113 // Specify intensity/transparency for "out/on" region.
114 vtkSetVector2Macro(OutOn,unsigned char);
115 vtkGetVectorMacro(OutOn,unsigned char,2);
119 ~vtkBooleanTexture() {};
121 virtual void ExecuteInformation();
122 virtual void ExecuteData(vtkDataObject *data);
128 unsigned char InIn[2];
129 unsigned char InOut[2];
130 unsigned char OutIn[2];
131 unsigned char OutOut[2];
132 unsigned char OnOn[2];
133 unsigned char OnIn[2];
134 unsigned char OnOut[2];
135 unsigned char InOn[2];
136 unsigned char OutOn[2];
139 vtkBooleanTexture(const vtkBooleanTexture&); // Not implemented.
140 void operator=(const vtkBooleanTexture&); // Not implemented.