1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkSpatialRepresentationFilter.h,v $
6 Date: $Date: 2002/02/01 06:30:47 $
7 Version: $Revision: 1.1.1.1 $
10 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
12 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
13 The following terms apply to all files associated with the software unless
14 explicitly disclaimed in individual files. This copyright specifically does
15 not apply to the related textbook "The Visualization Toolkit" ISBN
16 013199837-4 published by Prentice Hall which is covered by its own copyright.
18 The authors hereby grant permission to use, copy, and distribute this
19 software and its documentation for any purpose, provided that existing
20 copyright notices are retained in all copies and that this notice is included
21 verbatim in any distributions. Additionally, the authors grant permission to
22 modify this software and its documentation for any purpose, provided that
23 such modifications are not distributed without the explicit consent of the
24 authors and that existing copyright notices are retained in all copies. Some
25 of the algorithms implemented by this software are patented, observe all
26 applicable patent law.
28 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
29 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
30 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
31 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
34 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
35 PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
36 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
40 =========================================================================*/
41 // .NAME vtkSpatialRepresentationFilter - generate polygonal model of spatial search object (i.e., a vtkLocator)
42 // .SECTION Description
43 // vtkSpatialRepresentationFilter generates an polygonal representation of a
44 // spatial search (vtkLocator) object. The representation varies depending
45 // upon the nature of the spatial search object. For example, the
46 // representation for vtkOBBTree is a collection of oriented bounding
47 // boxes. Ths input to this filter is a dataset of any type, and the output
48 // is polygonal data. You must also specify the spatial search object to
51 // Generally spatial search objects are used for collision detection and other
52 // geometric operations, but in this filter one or more levels of spatial
53 // searchers can be generated to form a geometric approximation to the
54 // input data. This is a form of data simplification, generally used to
55 // accelerate the rendering process. Or, this filter can be used as a debugging/
56 // visualization aid for spatial search objects.
58 // This filter can generate one or more output vtkPolyData corresponding to
59 // different levels in the spatial search tree. The output data is retrieved
60 // using the GetOutput(id) method, where id ranges from 0 (root level)
61 // to Level. Note that the output for level "id" is not computed unless a
62 // GetOutput(id) method is issued. Thus, if you desire three levels of output
63 // (say 2,4,7), you would have to invoke GetOutput(2), GetOutput(4), and
64 // GetOutput(7). (Also note that the Level ivar is computed automatically
65 // depending on the size and nature of the input data.) There is also
66 // another GetOutput() method that takes no parameters. This method returns
67 // the leafs of the spatial search tree, which may be at different levels.
70 // You can specify the number of levels of to generate with the MaxLevels
71 // ivar. However, when the spatial search tree is built, this number of levels
72 // may not actually be generated. The actual number available can be found in
73 // the Levels ivar. Note that the value of Levels may change after filter
77 // vtkLocator vtkPointLocator vtkCellLocator vtkOBBTree
79 #ifndef __vtkSpatialRepresentationFilter_h
80 #define __vtkSpatialRepresentationFilter_h
82 #include "vtkDataSetFilter.h"
83 #include "vtkPolyData.h"
84 #include "vtkLocator.h"
86 #define VTK_MAX_SPATIAL_REP_LEVEL 24
88 class VTK_EXPORT vtkSpatialRepresentationFilter : public vtkDataSetFilter
91 vtkSpatialRepresentationFilter();
92 ~vtkSpatialRepresentationFilter();
93 static vtkSpatialRepresentationFilter *New() {return new vtkSpatialRepresentationFilter;};
94 const char *GetClassName() {return "vtkSpatialRepresentationFilter";};
95 void PrintSelf(ostream& os, vtkIndent indent);
98 // Set/Get the locator that will be used to generate the representation.
99 vtkSetObjectMacro(SpatialRepresentation,vtkLocator);
100 vtkGetObjectMacro(SpatialRepresentation,vtkLocator);
103 // Get the maximum number of outputs actually available.
104 vtkGetMacro(Level,int);
106 // returns leaf nodes of the spatial representation.
107 vtkPolyData *GetOutput();
109 // special form of GetOutput() method returns multiple outputs
110 vtkPolyData *GetOutput(int level);
112 // reset requested output levels
119 void GenerateOutput();
122 int TerminalNodesRequested;
124 vtkLocator *SpatialRepresentation;
125 vtkPolyData *OutputList[VTK_MAX_SPATIAL_REP_LEVEL+1];