OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkSelectVisiblePoints.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkSelectVisiblePoints.h,v $
5   Language:  C++
6   Date:      $Date: 2002/08/22 22:00:34 $
7   Version:   $Revision: 1.23 $
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 vtkSelectVisiblePoints - extract points that are visible (based on z-buffer calculation)
19 // .SECTION Description
20 // vtkSelectVisiblePoints is a filter that selects points based on
21 // whether they are visible or not. Visibility is determined by
22 // accessing the z-buffer of a rendering window. (The position of each
23 // input point is converted into display coordinates, and then the
24 // z-value at that point is obtained. If within the user-specified
25 // tolerance, the point is considered visible.)
26 //
27 // Points that are visible (or if the ivar SelectInvisible is on,
28 // invisible points) are passed to the output. Associated data
29 // attributes are passed to the output as well.
30 //
31 // This filter also allows you to specify a rectangular window in display
32 // (pixel) coordinates in which the visible points must lie. This can be
33 // used as a sort of local "brushing" operation to select just data within
34 // a window.
35 // 
36
37 // .SECTION Caveats
38 // You must carefully synchronize the execution of this filter. The
39 // filter refers to a renderer, which is modified every time a render
40 // occurs. Therefore, the filter is always out of date, and always
41 // executes. You may have to perform two rendering passes, or if you
42 // are using this filter in conjunction with vtkLabeledPointMapper,
43 // things work out because 2D rendering occurs after the 3D rendering.
44
45 #ifndef __vtkSelectVisiblePoints_h
46 #define __vtkSelectVisiblePoints_h
47
48 #include "vtkDataSetToPolyDataFilter.h"
49
50 class vtkRenderer;
51
52 class VTK_RENDERING_EXPORT vtkSelectVisiblePoints : public vtkDataSetToPolyDataFilter
53 {
54 public:
55   vtkTypeRevisionMacro(vtkSelectVisiblePoints,vtkDataSetToPolyDataFilter);
56   void PrintSelf(ostream& os, vtkIndent indent);
57
58   // Description:
59   // Instantiate object with no renderer; window selection turned off; 
60   // tolerance set to 0.01; and select invisible off.
61   static vtkSelectVisiblePoints *New();
62
63   // Description:
64   // Specify the renderer in which the visibility computation is to be
65   // performed.
66   void SetRenderer(vtkRenderer* ren)
67     {
68       if (this->Renderer != ren)
69         {
70         this->Renderer = ren;
71         this->Modified();
72         }
73     }
74   vtkRenderer* GetRenderer() { return this->Renderer; }
75
76   // Description:
77   // Set/Get the flag which enables selection in a rectangular display
78   // region.
79   vtkSetMacro(SelectionWindow,int);
80   vtkGetMacro(SelectionWindow,int);
81   vtkBooleanMacro(SelectionWindow,int);
82
83   // Description:
84   // Specify the selection window in display coordinates. You must specify
85   // a rectangular region using (xmin,xmax,ymin,ymax).
86   vtkSetVector4Macro(Selection,int);
87   vtkGetVectorMacro(Selection,int,4);
88
89   // Description:
90   // Set/Get the flag which enables inverse selection; i.e., invisible points
91   // are selected.
92   vtkSetMacro(SelectInvisible,int);
93   vtkGetMacro(SelectInvisible,int);
94   vtkBooleanMacro(SelectInvisible,int);
95
96   // Description:
97   // Set/Get a tolerance to use to determine whether a point is visible. A
98   // tolerance is usually required because the conversion from world space
99   // to display space during rendering introduces numerical round-off.
100   vtkSetClampMacro(Tolerance,float,0.0,VTK_LARGE_FLOAT);
101   vtkGetMacro(Tolerance,float);
102
103   // Description:
104   // Return MTime also considering the renderer.
105   unsigned long GetMTime();
106
107 protected:
108   vtkSelectVisiblePoints();
109   ~vtkSelectVisiblePoints();
110
111   void Execute();
112
113   vtkRenderer *Renderer;
114
115   int SelectionWindow;
116   int Selection[4];
117   int SelectInvisible;
118   float Tolerance;
119
120 private:
121   vtkSelectVisiblePoints(const vtkSelectVisiblePoints&);  // Not implemented.
122   void operator=(const vtkSelectVisiblePoints&);  // Not implemented.
123 };
124
125 #endif
126
127