Shapeworks Studio  2.1
Shape analysis software suite
itkPSMNeighborhood.h
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkPSMNeighborhood_h
19 #define __itkPSMNeighborhood_h
20 
21 #include "itkDataObject.h"
22 #include "itkPoint.h"
23 #include "itkWeakPointer.h"
24 #include "itkPSMDomain.h"
25 #include "itkPSMContainer.h"
26 #include "itkPSMPointIndexPair.h"
27 #include <vector>
28 
29 namespace itk
30 {
43 template <unsigned int VDimension>
44 class ITK_EXPORT PSMNeighborhood : public DataObject
45 {
46 public:
49  typedef DataObject Superclass;
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52  typedef WeakPointer<const Self> ConstWeakPointer;
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro(PSMNeighborhood, DataObject);
59 
61  itkStaticConstMacro(Dimension, unsigned int, VDimension);
62 
65 
69 
73 
76  typedef std::vector<PSMPointIndexPair<VDimension> > PointVectorType;
77 
80  itkSetObjectMacro(PointContainer, PointContainerType);
81  itkGetConstObjectMacro(PointContainer, PointContainerType);
82 
86  virtual PointVectorType FindNeighborhoodPoints(const PointType &, double) const
87  {
88  itkExceptionMacro("No algorithm for finding neighbors has been specified.");
89  }
93  virtual PointVectorType FindNeighborhoodPointsWithWeights(const PointType &, std::vector<double> &,
94  double) const
95  {
96  itkExceptionMacro("No algorithm for finding neighbors has been specified.");
97  }
98 // virtual unsigned int FindNeighborhoodPoints(const PointType &, double, PointVectorType &) const
99 // {
100 // itkExceptionMacro("No algorithm for finding neighbors has been specified.");
101 // return 0;
102 // }
103 
107  itkSetObjectMacro(Domain, DomainType);
108  itkGetConstObjectMacro(Domain, DomainType);
109 
116  virtual void AddPosition(const PointType &, unsigned int, int ) {}
117  virtual void SetPosition(const PointType &, unsigned int, int) {}
118  virtual void RemovePosition(unsigned int, int) {}
119 
120 protected:
121  PSMNeighborhood() {}
122  void PrintSelf(std::ostream& os, Indent indent) const
123  {
124  Superclass::PrintSelf(os, indent);
125  }
126  virtual ~PSMNeighborhood() {};
127 
128 private:
129  PSMNeighborhood(const Self&); //purposely not implemented
130  void operator=(const Self&); //purposely not implemented
131 
132  typename PointContainerType::Pointer m_PointContainer;
133  typename DomainType::Pointer m_Domain;
134 };
135 
136 } // end namespace itk
137 
138 #endif
virtual void AddPosition(const PointType &, unsigned int, int)
PSMContainer< PointType > PointContainerType
virtual PointVectorType FindNeighborhoodPoints(const PointType &, double) const
virtual PointVectorType FindNeighborhoodPointsWithWeights(const PointType &, std::vector< double > &, double) const
PSMDomain< VDimension > DomainType
Base class for defining the domain in which a particle system exists.
Definition: itkPSMDomain.h:48
std::vector< PSMPointIndexPair< VDimension > > PointVectorType
A container class that holds particle position information for the PSMParticleSystem class...
Point< double, VDimension > PointType