/*========================================================================= Program: ShapeWorks: Particle-based Shape Correspondence & Visualization Module: $RCSfile: itkParticleRegionNeighborhood.h,v $ Date: $Date: 2011/03/24 01:17:34 $ Version: $Revision: 1.2 $ Author: $Author: wmartin $ Copyright (c) 2009 Scientific Computing and Imaging Institute. See ShapeWorksLicense.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information.=========================================================================*/#ifndef __itkParticleRegionNeighborhood_h#define __itkParticleRegionNeighborhood_h#include"itkParticleNeighborhood.h"#include"itkPowerOfTwoPointTree.h"namespaceitk{template<unsignedintVDimension=3>classITK_EXPORTParticleRegionNeighborhood:publicParticleNeighborhood<VDimension>{public:typedefParticleRegionNeighborhoodSelf;typedefParticleNeighborhood<VDimension>Superclass;typedefSmartPointer<Self>Pointer;typedefSmartPointer<constSelf>ConstPointer;typedefWeakPointer<constSelf>ConstWeakPointer;itkNewMacro(Self);itkTypeMacro(ParticleRegionNeighborhood,ParticleNeighborhood);itkStaticConstMacro(Dimension,unsignedint,VDimension);typedeftypenameSuperclass::PointTypePointType;typedeftypenameSuperclass::PointContainerTypePointContainerType;typedeftypenameSuperclass::DomainTypeDomainType;typedeftypenameSuperclass::PointVectorTypePointVectorType;typedefPowerOfTwoPointTree<VDimension>PointTreeType;virtualPointVectorTypeFindNeighborhoodPoints(constPointType&,intidx,double)const;// virtual unsigned int FindNeighborhoodPoints(const PointType &, double, PointVectorType &) const;virtualvoidSetDomain(DomainType*p);itkSetMacro(TreeLevels,unsignedint);itkGetMacro(TreeLevels,unsignedint);voidPrintSelf(std::ostream&os,Indentindent)const{os<<indent<<"m_TreeLevels = "<<m_TreeLevels<<std::endl;m_Tree->PrintSelf(os,indent);Superclass::PrintSelf(os,indent);}virtualvoidAddPosition(constPointType&p,unsignedintidx,intthreadId=0);virtualvoidSetPosition(constPointType&p,unsignedintidx,intthreadId=0);virtualvoidRemovePosition(unsignedintidx,intthreadId=0);protected:ParticleRegionNeighborhood():m_TreeLevels(3){m_Tree=PointTreeType::New();m_IteratorMap=IteratorMapType::New();}virtual~ParticleRegionNeighborhood(){};structIteratorNodePair{typedeftypenamePointTreeType::NodePointerTypeNodePointerType;typedeftypenamePointTreeType::PointListType::iteratorIteratorType;IteratorNodePair(){}~IteratorNodePair(){}IteratorNodePair(constIteratorType&p,constNodePointerType&n){Iterator=p;NodePointer=n;}IteratorNodePair(constIteratorNodePair&o){this->operator=(o);}constIteratorNodePair&operator=(constIteratorNodePair&o){Iterator=o.Iterator;NodePointer=o.NodePointer;return*this;}IteratorTypeIterator;NodePointerTypeNodePointer;};typedefParticleContainer<IteratorNodePair>IteratorMapType;protected:typenamePointTreeType::Pointerm_Tree;typenameIteratorMapType::Pointerm_IteratorMap;unsignedintm_TreeLevels;private:ParticleRegionNeighborhood(constSelf&);//purposely not implementedvoidoperator=(constSelf&);//purposely not implemented};}// end namespace itk#if ITK_TEMPLATE_EXPLICIT#include"Templates/itkParticleRegionNeighborhood+-.h"#endif#if ITK_TEMPLATE_TXX#include"itkParticleRegionNeighborhood.txx"#endif#include"itkParticleRegionNeighborhood.txx"#endif