#pragma once#include"itkDataObject.h"#include"itkWeakPointer.h"#include"itkParticleAttribute.h"#include"itkParticleContainer.h"#include<vector>namespaceitk{template<classT,unsignedintVDimension>classITK_EXPORTParticleContainerArrayAttribute:publicstd::vector<typenameParticleContainer<T>::Pointer>,publicParticleAttribute<VDimension>{public:typedefTDataType;typedefParticleContainerArrayAttributeSelf;typedefParticleAttribute<VDimension>Superclass;typedefSmartPointer<Self>Pointer;typedefSmartPointer<constSelf>ConstPointer;typedefWeakPointer<constSelf>ConstWeakPointer;itkNewMacro(Self);itkTypeMacro(ParticleContainer,ParticleAttribute);virtualvoidDomainAddEventCallback(Object*,constEventObject&){this->resize(this->size()+1);this->operator[](this->size()-1)=ParticleContainer<T>::New();}virtualvoidPositionAddEventCallback(Object*o,constEventObject&e){constitk::ParticlePositionAddEvent&event=dynamic_cast<constitk::ParticlePositionAddEvent&>(e);this->operator[](event.GetDomainIndex())->operator[](event.GetPositionIndex())=0.0;}virtualvoidPositionRemoveEventCallback(Object*,constEventObject&){// NEED TO IMPLEMENT THIS}voidZeroAllValues(){for(unsignedd=0;d<this->size();d++){for(unsignedinti=0;i<this->operator[](d)->GetSize();i++){this->operator[](d)->operator[](i)=0.0;}}}protected:ParticleContainerArrayAttribute(){this->m_DefinedCallbacks.DomainAddEvent=true;this->m_DefinedCallbacks.PositionAddEvent=true;this->m_DefinedCallbacks.PositionRemoveEvent=true;}virtual~ParticleContainerArrayAttribute(){};voidPrintSelf(std::ostream&os,Indentindent)const{Superclass::PrintSelf(os,indent);}private:ParticleContainerArrayAttribute(constSelf&);//purposely not implementedvoidoperator=(constSelf&);//purposely not implemented};}// end namespace