This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 370 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Geometry/AlignedBox.h (+34 lines)
Lines 349-352 Link Here
349
  return dist2;
349
  return dist2;
350
}
350
}
351
351
352
/** \defgroup alignedboxtypedefs Global aligned box typedefs
353
  *
354
  * \ingroup Geometry_Module
355
  *
356
  * Eigen defines several typedef shortcuts for most common aligned box types.
357
  *
358
  * The general patterns are the following:
359
  *
360
  * \c AlignedBoxSizeType where \c Size can be \c 1, \c 2,\c 3,\c 4 for fixed size boxes or \c X for dynamic size,
361
  * and where \c Type can be \c i for integer, \c f for float, \c d for double.
362
  *
363
  * For example, \c AlignedBox3d is a fixed-size 3x3 aligned box type of doubles, and \c AlignedBoxXf is a dynamic-size aligned box of floats.
364
  *
365
  * \sa class AlignedBox
366
  */
367
368
#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix)    \
369
/** \ingroup alignedboxtypedefs */                                 \
370
typedef AlignedBox<Type, Size>   AlignedBox##SizeSuffix##TypeSuffix;
371
372
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
373
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 1, 1) \
374
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
375
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
376
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
377
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X)
378
379
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int,                  i)
380
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float,                f)
381
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double,               d)
382
383
#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
384
#undef EIGEN_MAKE_TYPEDEFS
385
352
#endif // EIGEN_ALIGNEDBOX_H
386
#endif // EIGEN_ALIGNEDBOX_H
(-)a/test/geo_alignedbox.cpp (-13 / +13 lines)
Lines 113-119 Link Here
113
    Vector2f m; m << -1.0f, -2.0f;
113
    Vector2f m; m << -1.0f, -2.0f;
114
    Vector2f M; M <<  1.0f,  5.0f;
114
    Vector2f M; M <<  1.0f,  5.0f;
115
115
116
    typedef AlignedBox<float,2>  BoxType;
116
    typedef AlignedBox2f  BoxType;
117
    BoxType box( m, M );
117
    BoxType box( m, M );
118
118
119
    Vector2f sides = M-m;
119
    Vector2f sides = M-m;
Lines 140-146 Link Here
140
    Vector3i m; m << -1, -2, 0;
140
    Vector3i m; m << -1, -2, 0;
141
    Vector3i M; M <<  1,  5, 3;
141
    Vector3i M; M <<  1,  5, 3;
142
142
143
    typedef AlignedBox<int,3>  BoxType;
143
    typedef AlignedBox3i  BoxType;
144
    BoxType box( m, M );
144
    BoxType box( m, M );
145
145
146
    Vector3i sides = M-m;
146
    Vector3i sides = M-m;
Lines 165-185 Link Here
165
{
165
{
166
  for(int i = 0; i < g_repeat; i++)
166
  for(int i = 0; i < g_repeat; i++)
167
  {
167
  {
168
    CALL_SUBTEST_1( alignedbox(AlignedBox<float,2>()) );
168
    CALL_SUBTEST_1( alignedbox(AlignedBox2f()) );
169
    CALL_SUBTEST_2( alignedboxCastTests(AlignedBox<float,2>()) );
169
    CALL_SUBTEST_2( alignedboxCastTests(AlignedBox2f()) );
170
170
171
    CALL_SUBTEST_3( alignedbox(AlignedBox<float,3>()) );
171
    CALL_SUBTEST_3( alignedbox(AlignedBox3f()) );
172
    CALL_SUBTEST_4( alignedboxCastTests(AlignedBox<float,3>()) );
172
    CALL_SUBTEST_4( alignedboxCastTests(AlignedBox3f()) );
173
173
174
    CALL_SUBTEST_5( alignedbox(AlignedBox<double,4>()) );
174
    CALL_SUBTEST_5( alignedbox(AlignedBox4d()) );
175
    CALL_SUBTEST_6( alignedboxCastTests(AlignedBox<double,4>()) );
175
    CALL_SUBTEST_6( alignedboxCastTests(AlignedBox4d()) );
176
176
177
    CALL_SUBTEST_7( alignedbox(AlignedBox<double,1>()) );
177
    CALL_SUBTEST_7( alignedbox(AlignedBox1d()) );
178
    CALL_SUBTEST_8( alignedboxCastTests(AlignedBox<double,1>()) );
178
    CALL_SUBTEST_8( alignedboxCastTests(AlignedBox1d()) );
179
179
180
    CALL_SUBTEST_9( alignedbox(AlignedBox<int,1>()) );
180
    CALL_SUBTEST_9( alignedbox(AlignedBox1i()) );
181
    CALL_SUBTEST_10( alignedbox(AlignedBox<int,2>()) );
181
    CALL_SUBTEST_10( alignedbox(AlignedBox2i()) );
182
    CALL_SUBTEST_11( alignedbox(AlignedBox<int,3>()) );
182
    CALL_SUBTEST_11( alignedbox(AlignedBox3i()) );
183
  }
183
  }
184
  CALL_SUBTEST_12( specificTest1() );
184
  CALL_SUBTEST_12( specificTest1() );
185
  CALL_SUBTEST_13( specificTest2() );
185
  CALL_SUBTEST_13( specificTest2() );

Return to bug 370