OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkProjectedTexture.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkProjectedTexture.h,v $
5   Language:  C++
6   Date:      $Date: 2002/12/09 13:39:05 $
7   Version:   $Revision: 1.17 $
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 vtkProjectedTexture - assign texture coordinates for a projected texture
19 // .SECTION Description
20 // vtkProjectedTexture assigns texture coordinates to a dataset as if
21 // the texture was projected from a slide projected located somewhere in the
22 // scene.  Methods are provided to position the projector and aim it at a 
23 // location, to set the width of the projector's frustum, and to set the
24 // range of texture coordinates assigned to the dataset.  
25 //
26 // Objects in the scene that appear behind the projector are also assigned
27 // texture coordinates; the projected image is left-right and top-bottom 
28 // flipped, much as a lens' focus flips the rays of light that pass through
29 // it.  A warning is issued if a point in the dataset falls at the focus
30 // of the projector.
31
32 #ifndef __vtkProjectedTexture_h
33 #define __vtkProjectedTexture_h
34
35 #include "vtkDataSetToDataSetFilter.h"
36
37 #define VTK_PROJECTED_TEXTURE_USE_PINHOLE 0
38 #define VTK_PROJECTED_TEXTURE_USE_TWO_MIRRORS 1
39
40 class VTK_GRAPHICS_EXPORT vtkProjectedTexture : public vtkDataSetToDataSetFilter 
41 {
42 public:
43   static vtkProjectedTexture *New();
44   vtkTypeRevisionMacro(vtkProjectedTexture,vtkDataSetToDataSetFilter);
45   void PrintSelf(ostream& os, vtkIndent indent);
46
47   // Description:
48   // Set/Get the position of the focus of the projector.
49   vtkSetVector3Macro(Position,float);
50   vtkGetVectorMacro(Position,float,3);
51
52   // Description:
53   // Set/Get the focal point of the projector (a point that lies along
54   // the center axis of the projector's frustum).
55   void SetFocalPoint(float focalPoint[3]);
56   void SetFocalPoint(float x, float y, float z);
57   vtkGetVectorMacro(FocalPoint,float,3);
58
59   // Description:
60   // Set/Get the camera mode of the projection -- pinhole projection or
61   // two mirror projection.
62   vtkSetMacro(CameraMode, int);
63   vtkGetMacro(CameraMode, int);
64   void SetCameraModeToPinhole() {this->SetCameraMode(VTK_PROJECTED_TEXTURE_USE_PINHOLE);}
65   void SetCameraModeToTwoMirror() {this->SetCameraMode(VTK_PROJECTED_TEXTURE_USE_TWO_MIRRORS);}
66
67   // Description:
68   // Set/Get the mirror separation for the two mirror system.
69   vtkSetMacro(MirrorSeparation, float);
70   vtkGetMacro(MirrorSeparation, float);
71
72   // Description:
73   // Get the normalized orientation vector of the projector.
74   vtkGetVectorMacro(Orientation,float,3);
75   
76   // Set/Get the up vector of the projector.
77   vtkSetVector3Macro(Up,float);
78   vtkGetVectorMacro(Up,float,3);
79
80   // Set/Get the aspect ratio of a perpendicular cross-section of the
81   // the projector's frustum.  The aspect ratio consists of three 
82   // numbers:  (x, y, z), where x is the width of the 
83   // frustum, y is the height, and z is the perpendicular
84   // distance from the focus of the projector.
85   vtkSetVector3Macro(AspectRatio,float);
86   vtkGetVectorMacro(AspectRatio,float,3);
87
88   // Description:
89   // Specify s-coordinate range for texture s-t coordinate pair.
90   vtkSetVector2Macro(SRange,float);
91   vtkGetVectorMacro(SRange,float,2);
92
93   // Description:
94   // Specify t-coordinate range for texture s-t coordinate pair.
95   vtkSetVector2Macro(TRange,float);
96   vtkGetVectorMacro(TRange,float,2);
97   
98 protected:
99   vtkProjectedTexture();
100   ~vtkProjectedTexture() {};
101
102   void Execute();
103   void ComputeNormal();
104
105   int CameraMode;
106
107   float Position[3];
108   float Orientation[3];
109   float FocalPoint[3];
110   float Up[3];
111   float MirrorSeparation;
112   float AspectRatio[3];
113   float SRange[2];
114   float TRange[2];
115 private:
116   vtkProjectedTexture(const vtkProjectedTexture&);  // Not implemented.
117   void operator=(const vtkProjectedTexture&);  // Not implemented.
118 };
119
120 #endif
121