ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkContinuousIndex.h
Go to the documentation of this file.
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 __itkContinuousIndex_h
19 #define __itkContinuousIndex_h
20 
21 #include "itkPoint.h"
22 #include "itkIndex.h"
23 
24 namespace itk
25 {
44 template< class TCoordRep = double, unsigned int VIndexDimension = 2 >
45 class ContinuousIndex:public Point< TCoordRep, VIndexDimension >
46 {
47 public:
51 
54  typedef TCoordRep ValueType;
55  typedef TCoordRep CoordRepType;
56 
58  itkStaticConstMacro(IndexDimension, unsigned int, VIndexDimension);
59 
62 
64  typedef typename Superclass::BaseArray BaseArray;
65  typedef typename BaseArray::Iterator Iterator;
67 
70 
72  ContinuousIndex(const Self & r):Superclass(r) {}
75 
77  ContinuousIndex(const IndexType & index)
78  {
79  for ( unsigned int i = 0; i < VIndexDimension; i++ )
80  {
81  ( *this )[i] = TCoordRep(index[i]);
82  }
83  }
84 };
85 } // namespace itk
87 
88 #endif
89