OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkTransformTextureCoords.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkTransformTextureCoords.h,v $
5   Language:  C++
6   Date:      $Date: 2002/01/22 15:29:53 $
7   Version:   $Revision: 1.29 $
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 vtkTransformTextureCoords - transform (scale, rotate, translate) texture coordinates
19 // .SECTION Description
20 // vtkTransformTextureCoords is a filter that operates on texture
21 // coordinates. It ingests any type of dataset, and outputs a dataset of the
22 // same type. The filter lets you scale, translate, and rotate texture
23 // coordinates. For example, by using the the Scale ivar, you can shift
24 // texture coordinates that range from (0->1) to range from (0->10) (useful
25 // for repeated patterns).
26 // 
27 // The filter operates on texture coordinates of dimension 1->3. The texture 
28 // coordinates are referred to as r-s-t. If the texture map is two dimensional,
29 // the t-coordinate (and operations on the t-coordinate) are ignored.
30
31 // .SECTION See Also
32 // vtkTextureMapToPlane vtkTextureMapToBox vtkTextureMapToCylinder 
33 // vtkTextureMapToSphere vtkThresholdTextureCoords vtkTexture
34
35 #ifndef __vtkTransformTextureCoords_h
36 #define __vtkTransformTextureCoords_h
37
38 #include "vtkDataSetToDataSetFilter.h"
39
40 class VTK_GRAPHICS_EXPORT vtkTransformTextureCoords : public vtkDataSetToDataSetFilter 
41 {
42 public:
43   vtkTypeRevisionMacro(vtkTransformTextureCoords,vtkDataSetToDataSetFilter);
44   void PrintSelf(ostream& os, vtkIndent indent);
45
46   // Description:
47   // Create instance with Origin (0.5,0.5,0.5); Position (0,0,0); and Scale
48   // set to (1,1,1). Rotation of the texture coordinates is turned off.
49   static vtkTransformTextureCoords *New();
50
51   // Description:
52   // Set/Get the position of the texture map. Setting the position translates
53   // the texture map by the amount specified. 
54   vtkSetVector3Macro(Position,float);
55   vtkGetVectorMacro(Position,float,3);
56
57   // Description:
58   // Incrementally change the position of the texture map (i.e., does a
59   // translate or shift of the texture coordinates).
60   void AddPosition(float deltaR, float deltaS, float deltaT);
61   void AddPosition(float deltaPosition[3]);
62   
63   // Description:
64   // Set/Get the scale of the texture map. Scaling in performed independently 
65   // on the r, s and t axes.
66   vtkSetVector3Macro(Scale,float);
67   vtkGetVectorMacro(Scale,float,3);
68
69   // Description:
70   // Set/Get the origin of the texture map. This is the point about which the
71   // texture map is flipped (e.g., rotated). Since a typical texture map ranges
72   // from (0,1) in the r-s-t coordinates, the default origin is set at 
73   // (0.5,0.5,0.5).
74   vtkSetVector3Macro(Origin,float);
75   vtkGetVectorMacro(Origin,float,3);
76
77   // Description:
78   // Boolean indicates whether the texture map should be flipped around the 
79   // s-axis. Note that the flips occur around the texture origin.
80   vtkSetMacro(FlipR,int);
81   vtkGetMacro(FlipR,int);
82   vtkBooleanMacro(FlipR,int);
83
84   // Description:
85   // Boolean indicates whether the texture map should be flipped around the 
86   // s-axis. Note that the flips occur around the texture origin.
87   vtkSetMacro(FlipS,int);
88   vtkGetMacro(FlipS,int);
89   vtkBooleanMacro(FlipS,int);
90
91   // Description:
92   // Boolean indicates whether the texture map should be flipped around the 
93   // t-axis. Note that the flips occur around the texture origin.
94   vtkSetMacro(FlipT,int);
95   vtkGetMacro(FlipT,int);
96   vtkBooleanMacro(FlipT,int);
97
98 protected:
99   vtkTransformTextureCoords();
100   ~vtkTransformTextureCoords() {};
101
102   void Execute();
103
104   float Origin[3]; //point around which map rotates
105   float Position[3]; //controls translation of map
106   float Scale[3]; //scales the texture map
107   int FlipR; //boolean indicates whether to flip texture around r-axis
108   int FlipS; //boolean indicates whether to flip texture around s-axis
109   int FlipT; //boolean indicates whether to flip texture around t-axis
110 private:
111   vtkTransformTextureCoords(const vtkTransformTextureCoords&);  // Not implemented.
112   void operator=(const vtkTransformTextureCoords&);  // Not implemented.
113 };
114
115 #endif