@@ -33,7 +33,7 @@ namespace itk
33
33
* type held at each pixel in an Image or at each vertex of an Mesh.
34
34
* The template parameter T can be any data type that behaves like a
35
35
* primitive (or atomic) data type (int, short, float, complex).
36
- * The NVectorDimension defines the number of components in the vector array.
36
+ * The VVectorDimension defines the number of components in the vector array.
37
37
*
38
38
* CovariantVector is not a dynamically extendible array like std::vector. It is
39
39
* intended to be used like a mathematical vector.
@@ -65,13 +65,13 @@ namespace itk
65
65
* \endsphinx
66
66
*/
67
67
68
- template <typename T, unsigned int NVectorDimension = 3 >
69
- class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimension >
68
+ template <typename T, unsigned int VVectorDimension = 3 >
69
+ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, VVectorDimension >
70
70
{
71
71
public:
72
72
/* * Standard class type aliases. */
73
73
using Self = CovariantVector;
74
- using Superclass = FixedArray<T, NVectorDimension >;
74
+ using Superclass = FixedArray<T, VVectorDimension >;
75
75
76
76
/* * ValueType can be used to declare a variable that is the same type
77
77
* as a data element held in an CovariantVector. */
@@ -82,19 +82,19 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
82
82
using ComponentType = T;
83
83
84
84
/* * Dimension of the Space */
85
- static constexpr unsigned int Dimension = NVectorDimension ;
85
+ static constexpr unsigned int Dimension = VVectorDimension ;
86
86
87
87
/* * I am a covariant vector. */
88
88
using CovariantVectorType = Self;
89
89
90
90
/* * The Array type from which this CovariantVector is derived. */
91
- using BaseArray = FixedArray<T, NVectorDimension >;
91
+ using BaseArray = FixedArray<T, VVectorDimension >;
92
92
93
93
/* * Get the dimension (size) of the vector. */
94
94
static unsigned int
95
95
GetCovariantVectorDimension ()
96
96
{
97
- return NVectorDimension ;
97
+ return VVectorDimension ;
98
98
}
99
99
100
100
/* * Set a vnl_vector_ref referencing the same memory block. */
@@ -127,7 +127,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
127
127
/* * Pass-through constructor for the Array base class. Implicit casting is
128
128
* performed to initialize constructor from any another one of datatype. */
129
129
template <typename TVectorValueType>
130
- CovariantVector (const CovariantVector<TVectorValueType, NVectorDimension > & r)
130
+ CovariantVector (const CovariantVector<TVectorValueType, VVectorDimension > & r)
131
131
: BaseArray(r)
132
132
{}
133
133
CovariantVector (const ValueType r[Dimension])
@@ -137,22 +137,22 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
137
137
/* * Assignment operator with implicit casting from another data type */
138
138
template <typename TCovariantVectorValueType>
139
139
Self &
140
- operator =(const CovariantVector<TCovariantVectorValueType, NVectorDimension > & r)
140
+ operator =(const CovariantVector<TCovariantVectorValueType, VVectorDimension > & r)
141
141
{
142
142
BaseArray::operator =(r);
143
143
return *this ;
144
144
}
145
145
146
146
/* * Pass-through assignment operator for the Array base class. */
147
147
CovariantVector &
148
- operator =(const ValueType r[NVectorDimension ]);
148
+ operator =(const ValueType r[VVectorDimension ]);
149
149
150
150
/* * Scalar operator*=. Scales elements by a scalar. */
151
151
template <typename Tt>
152
152
inline const Self &
153
153
operator *=(const Tt & value)
154
154
{
155
- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
155
+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
156
156
{
157
157
(*this )[i] = static_cast <ValueType>((*this )[i] * value);
158
158
}
@@ -164,7 +164,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
164
164
const Self &
165
165
operator /=(const Tt & value)
166
166
{
167
- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
167
+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
168
168
{
169
169
(*this )[i] = static_cast <ValueType>((*this )[i] / value);
170
170
}
@@ -200,15 +200,15 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
200
200
201
201
/* * operator*. Performs the scalar product with a vector (contravariant).
202
202
* This scalar product is invariant under affine transformations */
203
- ValueType operator *(const Vector<T, NVectorDimension > & other) const ;
203
+ ValueType operator *(const Vector<T, VVectorDimension > & other) const ;
204
204
205
205
/* * Scalar operator*. Scale the elements of a vector by a scalar.
206
206
* Return a new vector. */
207
207
inline Self operator *(const ValueType & val) const
208
208
{
209
209
Self result;
210
210
211
- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
211
+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
212
212
{
213
213
result[i] = static_cast <ValueType>((*this )[i] * val);
214
214
}
@@ -223,7 +223,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
223
223
{
224
224
Self result;
225
225
226
- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
226
+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
227
227
{
228
228
result[i] = static_cast <ValueType>((*this )[i] / val);
229
229
}
@@ -238,7 +238,7 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
238
238
static unsigned int
239
239
GetNumberOfComponents ()
240
240
{
241
- return NVectorDimension ;
241
+ return VVectorDimension ;
242
242
}
243
243
244
244
/* * Divides the covariant vector components by the norm and return the norm */
@@ -253,9 +253,9 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
253
253
* Casting is done with C-Like rules */
254
254
template <typename TCoordRepB>
255
255
void
256
- CastFrom (const CovariantVector<TCoordRepB, NVectorDimension > & pa)
256
+ CastFrom (const CovariantVector<TCoordRepB, VVectorDimension > & pa)
257
257
{
258
- for (unsigned int i = 0 ; i < NVectorDimension ; ++i)
258
+ for (unsigned int i = 0 ; i < VVectorDimension ; ++i)
259
259
{
260
260
(*this )[i] = static_cast <T>(pa[i]);
261
261
}
@@ -264,17 +264,17 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray<T, NVectorDimensio
264
264
265
265
/* * Premultiply Operator for product of a vector and a scalar.
266
266
* CovariantVector< T, N > = T * CovariantVector< T,N > */
267
- template <typename T, unsigned int NVectorDimension >
268
- inline CovariantVector<T, NVectorDimension > operator *(const T & scalar, const CovariantVector<T, NVectorDimension > & v)
267
+ template <typename T, unsigned int VVectorDimension >
268
+ inline CovariantVector<T, VVectorDimension > operator *(const T & scalar, const CovariantVector<T, VVectorDimension > & v)
269
269
{
270
270
return v.operator *(scalar);
271
271
}
272
272
273
273
/* * Performs the scalar product of a covariant with a contravariant.
274
274
* This scalar product is invariant under affine transformations */
275
- template <typename T, unsigned int NVectorDimension >
276
- inline T operator *(const Vector<T, NVectorDimension > & contravariant,
277
- const CovariantVector<T, NVectorDimension > & covariant)
275
+ template <typename T, unsigned int VVectorDimension >
276
+ inline T operator *(const Vector<T, VVectorDimension > & contravariant,
277
+ const CovariantVector<T, VVectorDimension > & covariant)
278
278
{
279
279
return covariant.operator *(contravariant);
280
280
}
@@ -289,9 +289,9 @@ ITKCommon_EXPORT void
289
289
CrossProduct (CovariantVector<int , 3 >, const Vector<int , 3 > &, const Vector<int , 3 > &);
290
290
291
291
292
- template <typename T, unsigned int NVectorDimension >
292
+ template <typename T, unsigned int VVectorDimension >
293
293
inline void
294
- swap (CovariantVector<T, NVectorDimension > & a, CovariantVector<T, NVectorDimension > & b)
294
+ swap (CovariantVector<T, VVectorDimension > & a, CovariantVector<T, VVectorDimension > & b)
295
295
{
296
296
a.swap (b);
297
297
}
0 commit comments