OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkTextureMapToSphere.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkTextureMapToSphere.h,v $
5   Language:  C++
6   Date:      $Date: 2002/01/22 15:29:51 $
7   Version:   $Revision: 1.27 $
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 vtkTextureMapToSphere - generate texture coordinates by mapping points to sphere
19 // .SECTION Description
20 // vtkTextureMapToSphere is a filter that generates 2D texture coordinates by
21 // mapping input dataset points onto a sphere. The sphere can either be user
22 // specified or generated automatically. (The sphere is generated
23 // automatically by computing the center (i.e., averaged coordinates) of the
24 // sphere.)  Note that the generated texture coordinates range between
25 // (0,1). The s-coordinate lies in the angular direction around the z-axis,
26 // measured counter-clockwise from the x-axis. The t-coordinate lies in the
27 // angular direction measured down from the north pole towards the south
28 // pole.
29 //
30 // A special ivar controls how the s-coordinate is generated. If PreventSeam
31 // is set to true, the s-texture varies from 0->1 and then 1->0 (corresponding
32 // to angles of 0->180 and 180->360).
33
34 // .SECTION Caveats
35 // The resulting texture coordinates will lie between (0,1), and the texture
36 // coordinates are determined with respect to the modeler's x-y-z coordinate
37 // system. Use the class vtkTransformTextureCoords to linearly scale and
38 // shift the origin of the texture coordinates (if necessary).
39
40 // .SECTION See Also
41 // vtkTextureMapToPlane vtkTextureMapToCylinder vtkTextureMapToBox
42 // vtkTransformTexture vtkThresholdTextureCoords
43
44 #ifndef __vtkTextureMapToSphere_h
45 #define __vtkTextureMapToSphere_h
46
47 #include "vtkDataSetToDataSetFilter.h"
48
49 class VTK_GRAPHICS_EXPORT vtkTextureMapToSphere : public vtkDataSetToDataSetFilter 
50 {
51 public:
52   vtkTypeRevisionMacro(vtkTextureMapToSphere,vtkDataSetToDataSetFilter);
53   void PrintSelf(ostream& os, vtkIndent indent);
54
55   // Description:
56   // Create object with Center (0,0,0) and the PreventSeam ivar is set to
57   // true. The sphere center is automatically computed.
58   static vtkTextureMapToSphere *New();
59
60   // Description:
61   // Specify a point defining the center of the sphere.
62   vtkSetVector3Macro(Center,float);
63   vtkGetVectorMacro(Center,float,3);
64
65   // Description:
66   // Turn on/off automatic sphere generation. This means it automatically
67   // finds the sphere center.
68   vtkSetMacro(AutomaticSphereGeneration,int);
69   vtkGetMacro(AutomaticSphereGeneration,int);
70   vtkBooleanMacro(AutomaticSphereGeneration,int);
71
72   // Description:
73   // Control how the texture coordinates are generated. If PreventSeam is
74   // set, the s-coordinate ranges from 0->1 and 1->0 corresponding to the
75   // theta angle variation between 0->180 and 180->0 degrees. Otherwise, the
76   // s-coordinate ranges from 0->1 between 0->360 degrees.
77   vtkSetMacro(PreventSeam,int);
78   vtkGetMacro(PreventSeam,int);
79   vtkBooleanMacro(PreventSeam,int);
80
81 protected:
82   vtkTextureMapToSphere();
83   ~vtkTextureMapToSphere() {};
84
85   void Execute();
86
87   float Center[3];
88   int AutomaticSphereGeneration;
89   int PreventSeam;
90
91 private:
92   vtkTextureMapToSphere(const vtkTextureMapToSphere&);  // Not implemented.
93   void operator=(const vtkTextureMapToSphere&);  // Not implemented.
94 };
95
96 #endif
97
98