VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSMPMergePoints.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/ 00030 #ifndef __vtkSMPMergePoints_h__ 00031 #define __vtkSMPMergePoints_h__ 00032 00033 #include "vtkFiltersSMPModule.h" // For export macro 00034 #include "vtkMergePoints.h" 00035 #include "vtkIdList.h" // For inline functions 00036 #include "vtkAtomicInt.h" // For the atomic integer used in Merge() 00037 00038 class vtkPointData; 00039 00040 class VTKFILTERSSMP_EXPORT vtkSMPMergePoints : public vtkMergePoints 00041 { 00042 public: 00043 vtkTypeMacro(vtkSMPMergePoints, vtkMergePoints); 00044 static vtkSMPMergePoints* New(); 00045 void PrintSelf(ostream &os, vtkIndent indent); 00046 00048 void InitializeMerge(); 00049 00051 00058 void Merge(vtkSMPMergePoints* locator, 00059 vtkIdType idx, 00060 vtkPointData *outPd, 00061 vtkPointData *inPd, 00062 vtkIdList* idList); 00064 00071 void FixSizeOfPointArray(); 00072 00074 00075 vtkIdType GetMaxId() 00076 { 00077 return this->AtomicInsertionId - 1; 00078 } 00080 00082 00083 vtkIdType GetNumberOfIdsInBucket(vtkIdType idx) 00084 { 00085 if ( !this->HashTable ) 00086 { 00087 return 0; 00088 } 00089 vtkIdList* bucket = this->HashTable[idx]; 00090 return bucket ? bucket->GetNumberOfIds() : 0; 00091 } 00093 00095 00096 vtkIdType GetNumberOfBuckets() 00097 { 00098 return this->NumberOfBuckets; 00099 } 00101 00102 protected: 00103 vtkSMPMergePoints(); 00104 ~vtkSMPMergePoints(); 00105 00106 vtkAtomicInt<vtkIdType> AtomicInsertionId; 00107 00108 private: 00109 vtkSMPMergePoints(const vtkSMPMergePoints&); // Not implemented 00110 void operator=(const vtkSMPMergePoints&); // Not implemented 00111 }; 00112 00113 #endif // __vtkSMPMergePoints_h__