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::CoordRepType; \
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>
127 static constexpr unsigned int PointDimension = CellTraits::PointDimension;
173 smartPtr->UnRegister();
191 return m_Visitors[
static_cast<int>(id)];
195 auto pos = m_UserDefined.find(
id);
196 if (pos != m_UserDefined.end())
211 m_Visitors[
static_cast<int>(id)] = v;
453#if !defined(ITK_WRAPPING_PARSER)
479#if !defined(ITK_LEGACY_REMOVE)
518template <
int VPointDimension,
520 typename TInterpolationWeight,
521 typename TPointIdentifier,
522 typename TCellIdentifier,
523 typename TCellFeatureIdentifier,
525 typename TPointsContainer,
526 typename TUsingCellsContainer>
530 static constexpr unsigned int PointDimension = VPointDimension;
544#define itkMakeCellTraitsMacro \
545 CellTraitsInfo<Self::PointDimension, \
547 InterpolationWeightType, \
550 CellFeatureIdentifier, \
556#if !defined(ITK_WRAPPING_PARSER)
557# ifndef ITK_MANUAL_INSTANTIATION
558# 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
virtual unsigned int GetNumberOfPoints() const =0
virtual bool IsUsingCell(CellIdentifier cellId)
virtual void SetPointIds(PointIdConstIterator first)=0
virtual PointIdConstIterator PointIdsBegin() const =0
CoordRepType GetBoundingBoxDiagonalLength2()
typename CellTraits::PointIdentifier PointIdentifier
virtual void SetPointId(int localId, PointIdentifier)=0
virtual ~CellInterface()=default
virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension *2], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType *)
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
CellFeatureIdentifier CellFeatureCount
typename UsingCellsContainer::iterator UsingCellsContainerIterator
virtual void SetPointIds(PointIdConstIterator first, PointIdConstIterator last)=0
virtual void Accept(CellIdentifier cellId, MultiVisitor *)=0
virtual bool GetClosestBoundary(CoordRepType[], bool *, CellAutoPointer &)
virtual PointIdIterator PointIdsEnd()=0
typename CellTraits::UsingCellsContainer UsingCellsContainer
virtual bool IntersectWithLine(CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType, CoordRepType[PointDimension], CoordRepType *, CoordRepType[])
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
virtual bool EvaluatePosition(CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *)
itkCellCommonTypedefs(CellInterface)
virtual unsigned int GetInterpolationOrder() const
CoordRepType * GetBoundingBox(CoordRepType[PointDimension *2])
virtual unsigned int GetNumberOfUsingCells()
virtual void MakeCopy(CellAutoPointer &) const =0
typename CellTraits::CoordRepType CoordRepType
A simple utility class to define the cell type inside a mesh type structure definition....
TPointIdentifier PointIdentifier
PointIdentifier * PointIdIterator
TInterpolationWeight InterpolationWeightType
TUsingCellsContainer UsingCellsContainer
TPointsContainer PointsContainer
TCellFeatureIdentifier CellFeatureIdentifier
const PointIdentifier * PointIdConstIterator
TCellIdentifier CellIdentifier
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