Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate CoordRepType and replace it with CoordinateType #4997

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Modules/Core/Common/include/itkBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,17 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object

/** Hold on to the type information specified by the template parameters. */
using PointIdentifier = TPointIdentifier;
using CoordRepType = TCoordinate;
using CoordinateType = TCoordinate;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
using PointsContainer = TPointsContainer;
using PointsContainerPointer = typename PointsContainer::Pointer;
using PointsContainerConstPointer = typename PointsContainer::ConstPointer;

using PointType = Point<CoordRepType, VPointDimension>;
using BoundsArrayType = FixedArray<CoordRepType, VPointDimension * 2>;
using PointType = Point<CoordinateType, VPointDimension>;
using BoundsArrayType = FixedArray<CoordinateType, VPointDimension * 2>;

/** Hold on to the dimensions specified by the template parameters. */
static constexpr unsigned int PointDimension = VPointDimension;
Expand Down Expand Up @@ -172,7 +176,7 @@ class ITK_TEMPLATE_EXPORT BoundingBox : public Object
/** Get the length squared of the diagonal of the bounding box.
* Returns zero if bounding box cannot be computed. Note that the
* Accumulate type is used to represent the length. */
using AccumulateType = typename NumericTraits<CoordRepType>::AccumulateType;
using AccumulateType = typename NumericTraits<CoordinateType>::AccumulateType;
AccumulateType
GetDiagonalLength2() const;

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkBoundingBox.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ BoundingBox<TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer>::C
{
if (this->GetMTime() > m_BoundsMTime)
{
m_Bounds.Fill(CoordRepType{});
m_Bounds.Fill(CoordinateType{});
m_BoundsMTime.Modified();
}
return false;
Expand All @@ -148,7 +148,7 @@ BoundingBox<TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer>::C
// start by initializing the values
if (m_PointsContainer->Size() < 1)
{
m_Bounds.Fill(CoordRepType{});
m_Bounds.Fill(CoordinateType{});
m_BoundsMTime.Modified();
return false;
}
Expand Down Expand Up @@ -287,7 +287,7 @@ auto
BoundingBox<TPointIdentifier, VPointDimension, TCoordinate, TPointsContainer>::GetDiagonalLength2() const
-> AccumulateType
{
typename NumericTraits<CoordRepType>::AccumulateType dist2 = CoordRepType{};
typename NumericTraits<CoordinateType>::AccumulateType dist2 = CoordinateType{};

if (this->ComputeBoundingBox())
{
Expand Down
54 changes: 31 additions & 23 deletions Modules/Core/Common/include/itkCellInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
using typename Superclass::CellRawPointer; \
using typename Superclass::CellConstRawPointer; \
using typename Superclass::CellTraits; \
using typename Superclass::CoordRepType; \
using typename Superclass::CoordinateType; \
using typename Superclass::InterpolationWeightType; \
using typename Superclass::PointIdentifier; \
using typename Superclass::PointIdIterator; \
Expand Down Expand Up @@ -109,7 +109,11 @@ class ITK_TEMPLATE_EXPORT CellInterface
using CellTraits = TCellTraits;

/** Save type information for this cell. */
using CoordRepType = typename CellTraits::CoordRepType;
using CoordinateType = typename CellTraits::CoordinateType;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
using InterpolationWeightType = typename CellTraits::InterpolationWeightType;
using PointIdentifier = typename CellTraits::PointIdentifier;
using PointIdIterator = typename CellTraits::PointIdIterator;
Expand Down Expand Up @@ -140,7 +144,7 @@ class ITK_TEMPLATE_EXPORT CellInterface
using CellFeatureCount = CellFeatureIdentifier;

/** Types needed to contour the cells */
using ParametricCoordArrayType = Array<CoordRepType>;
using ParametricCoordArrayType = Array<CoordinateType>;
using ShapeFunctionsArrayType = Array<InterpolationWeightType>;

// static int GetNextUserCellId(); // never return > MAX_INTERFACE
Expand Down Expand Up @@ -313,7 +317,7 @@ class ITK_TEMPLATE_EXPORT CellInterface
* topological dimension CellDimension-1. If the "inside" pointer is not
* nullptr, the flag is set to indicate whether the point is inside the cell. */
virtual bool
GetClosestBoundary(CoordRepType[], bool *, CellAutoPointer &)
GetClosestBoundary(CoordinateType[], bool *, CellAutoPointer &)
{
return false;
}
Expand All @@ -335,10 +339,10 @@ class ITK_TEMPLATE_EXPORT CellInterface
* - Get the interpolation weights for the cell
* (Returns through pointer to array: weights[NumberOfPoints]). */
virtual bool
EvaluatePosition(CoordRepType *,
EvaluatePosition(CoordinateType *,
PointsContainer *,
CoordRepType *,
CoordRepType[],
CoordinateType *,
CoordinateType[],
double *,
InterpolationWeightType *)
{
Expand Down Expand Up @@ -368,12 +372,12 @@ class ITK_TEMPLATE_EXPORT CellInterface
*
* Returns whether an intersection exists within the given tolerance. */
virtual bool
IntersectWithLine(CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType,
CoordRepType[PointDimension],
CoordRepType *,
CoordRepType[])
IntersectWithLine(CoordinateType[PointDimension],
CoordinateType[PointDimension],
CoordinateType,
CoordinateType[PointDimension],
CoordinateType *,
CoordinateType[])
{
return bool();
}
Expand All @@ -382,13 +386,13 @@ class ITK_TEMPLATE_EXPORT CellInterface
* Array is ordered (xmin, xmax, ymin, ymax, ....). A pointer to the
* array is returned for convenience. This allows code like:
* "CoordRep* bounds = cell->GetBoundingBox(new CoordRep[6]);". */
CoordRepType * GetBoundingBox(CoordRepType[PointDimension * 2]) { return nullptr; }
CoordinateType * GetBoundingBox(CoordinateType[PointDimension * 2]) { return nullptr; }

/** Compute the square of the diagonal length of the bounding box. */
CoordRepType
CoordinateType
GetBoundingBoxDiagonalLength2()
{
return CoordRepType{};
return CoordinateType{};
}

/** Intersect the given bounding box (bounds[PointDimension*2]) with a line
Expand All @@ -403,11 +407,11 @@ class ITK_TEMPLATE_EXPORT CellInterface
* (returned through "t" pointer).
*
* Returns whether an intersection exists. */
virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension * 2],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType[PointDimension],
CoordRepType *)
virtual bool IntersectBoundingBoxWithLine(CoordinateType[PointDimension * 2],
CoordinateType[PointDimension],
CoordinateType[PointDimension],
CoordinateType[PointDimension],
CoordinateType *)
{
return bool();
}
Expand Down Expand Up @@ -525,7 +529,11 @@ class ITK_TEMPLATE_EXPORT CellTraitsInfo
{
public:
static constexpr unsigned int PointDimension = VPointDimension;
using CoordRepType = TCoordinate;
using CoordinateType = TCoordinate;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
using InterpolationWeightType = TInterpolationWeight;
using PointIdentifier = TPointIdentifier;
using CellIdentifier = TCellIdentifier;
Expand All @@ -540,7 +548,7 @@ class ITK_TEMPLATE_EXPORT CellTraitsInfo

#define itkMakeCellTraitsMacro \
CellTraitsInfo<Self::PointDimension, \
CoordRepType, \
CoordinateType, \
InterpolationWeightType, \
PointIdentifier, \
CellIdentifier, \
Expand Down
6 changes: 5 additions & 1 deletion Modules/Core/Common/include/itkContinuousIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class ITK_TEMPLATE_EXPORT ContinuousIndex : public Point<TCoordinate, VIndexDime
/** ValueType can be used to declare a variable that is the same type
* as a data element held in an Point. */
using ValueType = TCoordinate;
using CoordRepType = TCoordinate;
using CoordinateType = TCoordinate;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif

/** Dimension of the Space */
static constexpr unsigned int IndexDimension = VIndexDimension;
Expand Down
10 changes: 7 additions & 3 deletions Modules/Core/Common/include/itkDefaultDynamicMeshTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ class DefaultDynamicMeshTraits
/** Just save all the template parameters. */
using PixelType = TPixelType;
using CellPixelType = TCellPixelType;
using CoordRepType = TCoordinate;
using CoordinateType = TCoordinate;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
using InterpolationWeightType = TInterpolationWeight;

/** Just save all the template parameters. */
Expand All @@ -90,11 +94,11 @@ class DefaultDynamicMeshTraits
using CellFeatureIdentifier = IdentifierType;

/** The type of point used by the mesh. */
using PointType = Point<CoordRepType, VPointDimension>;
using PointType = Point<CoordinateType, VPointDimension>;

/** The type of point used for hashing. This should never change from
* this setting, regardless of the mesh type. */
using PointHashType = Point<CoordRepType, VPointDimension>;
using PointHashType = Point<CoordinateType, VPointDimension>;

/** The container type for use in storing points. It must conform to
* the IndexedContainerInterface. */
Expand Down
10 changes: 7 additions & 3 deletions Modules/Core/Common/include/itkDefaultStaticMeshTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ class ITK_TEMPLATE_EXPORT DefaultStaticMeshTraits
/** Just save all the template parameters. */
using PixelType = TPixelType;
using CellPixelType = TCellPixelType;
using CoordRepType = TCoordinate;
using CoordinateType = TCoordinate;
#ifndef ITK_FUTURE_LEGACY_REMOVE
using CoordRepType [[deprecated("ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!")]] =
CoordinateType;
#endif
using InterpolationWeightType = TInterpolationWeight;

/** Just save all the template parameters. */
Expand All @@ -88,11 +92,11 @@ class ITK_TEMPLATE_EXPORT DefaultStaticMeshTraits
using CellFeatureIdentifier = IdentifierType;

/** The type of point used by the mesh. */
using PointType = Point<CoordRepType, VPointDimension>;
using PointType = Point<CoordinateType, VPointDimension>;

/** The type of point used for hashing. This should never change from
* this setting, regardless of the mesh type. */
using PointHashType = Point<CoordRepType, VPointDimension>;
using PointHashType = Point<CoordinateType, VPointDimension>;

/** The container type for use in storing points. It must conform to
* the IndexedContainer interface. */
Expand Down
16 changes: 8 additions & 8 deletions Modules/Core/Common/include/itkHexahedronCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class ITK_TEMPLATE_EXPORT HexahedronCell

/** Evaluate the position inside the cell */
bool
EvaluatePosition(CoordRepType *,
EvaluatePosition(CoordinateType *,
PointsContainer *,
CoordRepType *,
CoordRepType[],
CoordinateType *,
CoordinateType[],
double *,
InterpolationWeightType *) override;

Expand All @@ -157,15 +157,15 @@ class ITK_TEMPLATE_EXPORT HexahedronCell
NumericTraits<PointIdentifier>::max()) };

void
InterpolationDerivs(CoordRepType pcoords[Self::CellDimension],
CoordRepType derivs[Self::CellDimension * Self::NumberOfPoints]);
InterpolationDerivs(CoordinateType pcoords[Self::CellDimension],
CoordinateType derivs[Self::CellDimension * Self::NumberOfPoints]);
void
InterpolationFunctions(CoordRepType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
InterpolationFunctions(CoordinateType pcoords[Self::CellDimension], InterpolationWeightType sf[Self::NumberOfPoints]);
void
EvaluateLocation(int & itkNotUsed(subId),
PointsContainer * points,
CoordRepType pcoords[Self::CellDimension],
CoordRepType x[Self::CellDimension],
CoordinateType pcoords[Self::CellDimension],
CoordinateType x[Self::CellDimension],
InterpolationWeightType * weights);

public:
Expand Down
Loading