18#ifndef itkCellInterface_h
19#define itkCellInterface_h
32#define itkCellVisitMacro(TopologyId) \
33 static constexpr CellGeometryEnum GetTopologyId() { return TopologyId; } \
34 virtual void Accept(CellIdentifier cellid, typename CellInterface<PixelType, CellTraits>::MultiVisitor * mv) \
37 typename CellInterfaceVisitor<PixelType, CellTraits>::Pointer v = mv->GetVisitor(TopologyId); \
40 v->VisitFromCell(cellid, this); \
43 ITK_MACROEND_NOOP_STATEMENT
47#define itkCellCommonTypedefs(celltype) \
48 using Self = celltype; \
49 using ConstSelfAutoPointer = AutoPointer<const Self>; \
50 using SelfAutoPointer = AutoPointer<Self>; \
51 using RawPointer = Self *; \
52 using ConstRawPointer = const Self *
56#define itkCellInheritedTypedefs(superclassArg) \
57 using Superclass = superclassArg; \
58 using typename Superclass::PixelType; \
59 using CellType = typename Superclass::CellType; \
60 using typename Superclass::CellAutoPointer; \
61 using typename Superclass::CellConstAutoPointer; \
62 using typename Superclass::CellRawPointer; \
63 using typename Superclass::CellConstRawPointer; \
64 using typename Superclass::CellTraits; \
65 using typename Superclass::CoordinateType; \
66 using typename Superclass::InterpolationWeightType; \
67 using typename Superclass::PointIdentifier; \
68 using typename Superclass::PointIdIterator; \
69 using typename Superclass::PointIdConstIterator; \
70 using typename Superclass::CellIdentifier; \
71 using typename Superclass::CellFeatureIdentifier; \
72 using CellFeatureCount = typename Superclass::CellFeatureIdentifier; \
73 using typename Superclass::PointType; \
74 using typename Superclass::VectorType; \
75 using typename Superclass::PointsContainer; \
76 using typename Superclass::UsingCellsContainer; \
77 using typename Superclass::ParametricCoordArrayType; \
78 using typename Superclass::ShapeFunctionsArrayType; \
79 static constexpr unsigned int PointDimension = Superclass::PointDimension
96template <
typename TPixelType,
typename TCellTraits>
113#ifndef ITK_FUTURE_LEGACY_REMOVE
114 using CoordRepType ITK_FUTURE_DEPRECATED(
115 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
131 static constexpr unsigned int PointDimension = CellTraits::PointDimension;
177 smartPtr->UnRegister();
195 return m_Visitors[
static_cast<int>(id)];
199 auto pos = m_UserDefined.find(
id);
200 if (pos != m_UserDefined.end())
215 m_Visitors[
static_cast<int>(id)] = v;
462#if !defined(ITK_WRAPPING_PARSER)
488#if !defined(ITK_LEGACY_REMOVE)
527template <
int VPointDimension,
528 typename TCoordinate,
529 typename TInterpolationWeight,
530 typename TPointIdentifier,
531 typename TCellIdentifier,
532 typename TCellFeatureIdentifier,
534 typename TPointsContainer,
535 typename TUsingCellsContainer>
539 static constexpr unsigned int PointDimension = VPointDimension;
541#ifndef ITK_FUTURE_LEGACY_REMOVE
542 using CoordRepType ITK_FUTURE_DEPRECATED(
543 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
557#define itkMakeCellTraitsMacro \
558 CellTraitsInfo<Self::PointDimension, \
560 InterpolationWeightType, \
563 CellFeatureIdentifier, \
569#if !defined(ITK_WRAPPING_PARSER)
570# ifndef ITK_MANUAL_INSTANTIATION
571# include "itkCellInterface.hxx"
Array class with size defined at construction time.
Abstract interface for a visitor class that can visit the cells in a Mesh.
virtual CellGeometryEnum GetCellTopologyId()=0
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
~MultiVisitor() override=default
typename VisitorType::Pointer VisitorPointer
void AddVisitor(VisitorType *v)
VisitorType * GetVisitor(CellGeometryEnum id)
std::map< CellGeometryEnum, VisitorPointer > m_UserDefined
typename std::map< CellGeometryEnum, VisitorPointer >::value_type VisitorPointerValueType
An abstract interface for cells.
virtual itk::CommonEnums::CellGeometry GetType() const =0
typename CellTraits::CoordinateType CoordinateType
virtual unsigned int GetNumberOfPoints() const =0
virtual bool IsUsingCell(CellIdentifier cellId)
virtual void SetPointIds(PointIdConstIterator first)=0
virtual PointIdConstIterator PointIdsBegin() const =0
virtual bool IntersectWithLine(CoordinateType[PointDimension], CoordinateType[PointDimension], CoordinateType, CoordinateType[PointDimension], CoordinateType *, CoordinateType[])
typename CellTraits::PointIdentifier PointIdentifier
virtual void SetPointId(int localId, PointIdentifier)=0
virtual ~CellInterface()=default
PointIdentifierContainerType GetPointIdsContainer() const
virtual PointIdIterator PointIdsBegin()=0
virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &)=0
typename CellTraits::PointIdConstIterator PointIdConstIterator
virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const =0
virtual void RemoveUsingCell(CellIdentifier cellId)
RawPointer CellRawPointer
typename CellTraits::InterpolationWeightType InterpolationWeightType
typename CellTraits::PointsContainer PointsContainer
ConstSelfAutoPointer CellConstAutoPointer
virtual void AddUsingCell(CellIdentifier cellId)
virtual UsingCellsContainerIterator UsingCellsEnd()
virtual PointIdConstIterator GetPointIds() const
virtual bool IsExplicitBoundary()
void SetPointIdsContainer(const PointIdentifierContainerType &)
SelfAutoPointer CellAutoPointer
ConstRawPointer CellConstRawPointer
typename PointType::VectorType VectorType
NOTE: it should normally be defined in the traits.
virtual void EvaluateShapeFunctions(const ParametricCoordArrayType &, ShapeFunctionsArrayType &) const
virtual bool GetClosestBoundary(CoordinateType[], bool *, CellAutoPointer &)
CellFeatureIdentifier CellFeatureCount
typename UsingCellsContainer::iterator UsingCellsContainerIterator
virtual void SetPointIds(PointIdConstIterator first, PointIdConstIterator last)=0
virtual void Accept(CellIdentifier cellId, MultiVisitor *)=0
virtual bool EvaluatePosition(CoordinateType *, PointsContainer *, CoordinateType *, CoordinateType[], double *, InterpolationWeightType *)
virtual PointIdIterator PointIdsEnd()=0
virtual bool IntersectBoundingBoxWithLine(CoordinateType[PointDimension *2], CoordinateType[PointDimension], CoordinateType[PointDimension], CoordinateType[PointDimension], CoordinateType *)
typename CellTraits::UsingCellsContainer UsingCellsContainer
virtual unsigned int GetDimension() const =0
virtual PointIdConstIterator PointIdsEnd() const =0
typename CellTraits::PointIdIterator PointIdIterator
virtual UsingCellsContainerIterator UsingCellsBegin()
typename CellTraits::CellIdentifier CellIdentifier
typename CellTraits::PointType PointType
typename CellTraits::CellFeatureIdentifier CellFeatureIdentifier
itkCellCommonTypedefs(CellInterface)
virtual unsigned int GetInterpolationOrder() const
virtual unsigned int GetNumberOfUsingCells()
virtual void MakeCopy(CellAutoPointer &) const =0
CoordinateType GetBoundingBoxDiagonalLength2()
CoordinateType * GetBoundingBox(CoordinateType[PointDimension *2])
A simple utility class to define the cell type inside a mesh type structure definition....
TCellFeatureIdentifier CellFeatureIdentifier
TPointsContainer PointsContainer
const PointIdentifier * PointIdConstIterator
TCellIdentifier CellIdentifier
TPointIdentifier PointIdentifier
TInterpolationWeight InterpolationWeightType
TUsingCellsContainer UsingCellsContainer
PointIdentifier * PointIdIterator
TCoordinate CoordinateType
Light weight base class for most itk classes.
@ QUADRATIC_TRIANGLE_CELL
SmartPointer< Self > Pointer
ImageBaseType::PointType PointType
ImageBaseType::SpacingType VectorType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_TEMPLATE_EXPORT CellInterface