1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkTextureMapToSphere.h,v $
6 Date: $Date: 2002/01/22 15:29:51 $
7 Version: $Revision: 1.27 $
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 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
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).
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).
41 // vtkTextureMapToPlane vtkTextureMapToCylinder vtkTextureMapToBox
42 // vtkTransformTexture vtkThresholdTextureCoords
44 #ifndef __vtkTextureMapToSphere_h
45 #define __vtkTextureMapToSphere_h
47 #include "vtkDataSetToDataSetFilter.h"
49 class VTK_GRAPHICS_EXPORT vtkTextureMapToSphere : public vtkDataSetToDataSetFilter
52 vtkTypeRevisionMacro(vtkTextureMapToSphere,vtkDataSetToDataSetFilter);
53 void PrintSelf(ostream& os, vtkIndent indent);
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();
61 // Specify a point defining the center of the sphere.
62 vtkSetVector3Macro(Center,float);
63 vtkGetVectorMacro(Center,float,3);
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);
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);
82 vtkTextureMapToSphere();
83 ~vtkTextureMapToSphere() {};
88 int AutomaticSphereGeneration;
92 vtkTextureMapToSphere(const vtkTextureMapToSphere&); // Not implemented.
93 void operator=(const vtkTextureMapToSphere&); // Not implemented.