Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Servers/Filters/vtkPickFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPickFilter.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00025 #ifndef __vtkPickFilter_h
00026 #define __vtkPickFilter_h
00027 
00028 #include "vtkUnstructuredGridSource.h"
00029 
00030 class vtkMultiProcessController;
00031 class vtkIdList;
00032 class vtkIntArray;
00033 class vtkPoints;
00034 class vtkDataSet;
00035 class vtkAppendFilter;
00036 
00037 class VTK_EXPORT vtkPickFilter : public vtkUnstructuredGridSource
00038 {
00039 public:
00040   static vtkPickFilter *New();
00041   vtkTypeRevisionMacro(vtkPickFilter,vtkUnstructuredGridSource);
00042   void PrintSelf(ostream& os, vtkIndent indent);
00043 
00045 
00046   void AddInput(vtkDataSet* input);
00047   void AddInput(vtkDataObject*){vtkErrorMacro("NotDefined");}
00048   vtkDataSet* GetInput(int idx);
00049   void RemoveInput(vtkDataSet* input);
00050   void RemoveInput(vtkDataObject*){vtkErrorMacro("NotDefined");}
00051   void RemoveAllInputs();
00053 
00055 
00056   vtkSetVector3Macro(WorldPoint,double);
00057   vtkGetVector3Macro(WorldPoint,double);
00059 
00061 
00063   vtkSetMacro(PickCell,int);
00064   vtkGetMacro(PickCell,int);
00065   vtkBooleanMacro(PickCell,int);
00067 
00069 
00071   vtkSetMacro(UseIdToPick,int);
00072   vtkGetMacro(UseIdToPick,int);
00073   vtkBooleanMacro(UseIdToPick,int);
00075   
00077 
00078   vtkSetMacro(Id,vtkIdType);
00079   vtkGetMacro(Id,vtkIdType);
00081   
00082   // Descrption:
00083   // If the input point/cell attributes has an array with this name,
00084   // then it is used to find the point.  Defaults to GlobalId.
00085   vtkSetStringMacro(GlobalPointIdArrayName);
00086   vtkGetStringMacro(GlobalPointIdArrayName);
00087   vtkSetStringMacro(GlobalCellIdArrayName);
00088   vtkGetStringMacro(GlobalCellIdArrayName);
00089   
00092   void SetController(vtkMultiProcessController* controller);
00093   
00094 protected:
00095   vtkPickFilter();
00096   ~vtkPickFilter();
00097 
00098   void Execute();
00099   void PointExecute();
00100   void CellExecute();
00101   int CompareProcesses(double bestDist2);
00102   void CreateOutput(vtkIdList* regionCellIds);
00103 
00104   void IdExecute();
00105   int CellIdExecute(vtkDataSet* input, int inputIdx,  vtkAppendFilter* append);
00106   int PointIdExecute(vtkDataSet* input, int inputIdx, vtkAppendFilter* append);
00107 
00108   // Flag that toggles between picking cells or picking points.
00109   int PickCell;
00110 
00111   // Input pick point.
00112   double WorldPoint[3];
00113 
00114   int UseIdToPick;
00115   vtkIdType Id;
00116   char* GlobalPointIdArrayName;
00117   char* GlobalCellIdArrayName;
00118 
00119   vtkMultiProcessController* Controller;
00120 
00121   // Index is the input id, value is the output id.
00122   vtkIdList* PointMap;
00123   // Index is the output id, value is the input id.
00124   vtkIdList* RegionPointIds;
00125 
00126   // I need this because I am converting this filter
00127   // to have multiple inputs, and removing the layer feature
00128   // at the same time.  Maps can only be from one input.
00129   int BestInputIndex;
00130 
00131   // Returns outputId.
00132   vtkIdType InsertIdInPointMap(vtkIdType inId);
00133   void InitializePointMap(vtkIdType numerOfInputPoints);
00134   void DeletePointMap();
00135   int ListContainsId(vtkIdList* ids, vtkIdType id);
00136 
00137   // Locator did no do what I wanted.
00138   vtkIdType FindPointId(double pt[3], vtkDataSet* input);
00139 
00140 private:
00141   vtkPickFilter(const vtkPickFilter&);  // Not implemented.
00142   void operator=(const vtkPickFilter&);  // Not implemented.
00143 };
00144 
00145 #endif
00146 
00147 

Generated on Tue May 30 12:31:46 2006 for ParaView by doxygen 1.3.5