/*========================================================================= 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.=========================================================================*/#pragma once#include"itkParticleDomain.h"namespaceitk{classParticleRegionDomain:publicParticleDomain{public:typedefSmartPointer<ParticleRegionDomain>Pointer;typedeftypenameParticleDomain::PointTypePointType;virtualboolApplyConstraints(PointType&p)const{boolchanged=false;for(unsignedinti=0;i<DIMENSION;i++){if(p[i]<GetLowerBound()[i]){changed=true;p[i]=GetLowerBound()[i];}elseif(p[i]>GetUpperBound()[i]){changed=true;p[i]=GetUpperBound()[i];}}returnchanged;}virtualconstPointType&GetUpperBound()const{returnm_UpperBound;}virtualconstPointType&GetLowerBound()const{returnm_LowerBound;}voidSetUpperBound(constPointType_UpperBound){m_UpperBound=_UpperBound;}voidSetLowerBound(constPointType_LowerBound){m_LowerBound=_LowerBound;}voidSetRegion(constPointType&lowerBound,constPointType&upperBound){SetLowerBound(lowerBound);SetUpperBound(upperBound);}protected:ParticleRegionDomain(){}virtual~ParticleRegionDomain(){};voidPrintSelf(std::ostream&os,Indentindent)const{ParticleDomain::PrintSelf(os,indent);os<<"LowerBound = "<<GetLowerBound()<<std::endl;os<<"UpperBound = "<<GetUpperBound()<<std::endl;}inlineboolIsInsideBuffer(constPointType&p)const{for(inti=0;i<DIMENSION;i++){if(p[i]<m_LowerBound[i]||p[i]>m_UpperBound[i]){returnfalse;}}returntrue;}private:PointTypem_LowerBound;PointTypem_UpperBound;};}// end namespace itk