18 #ifndef itkCellInterface_h
19 #define itkCellInterface_h
30 #define itkCellVisitMacro(TopologyId) \
31 static int GetTopologyId() \
35 virtual void Accept(CellIdentifier cellid, typename CellInterface< PixelType, \
36 CellTraits >::MultiVisitor * mv) override \
38 typename CellInterfaceVisitor< PixelType, CellTraits >::Pointer v = \
39 mv->GetVisitor(TopologyId); \
42 v->VisitFromCell(cellid, this); \
48 #define itkCellCommonTypedefs(celltype) \
49 using Self = celltype; \
50 using ConstSelfAutoPointer = AutoPointer< const Self >; \
51 using SelfAutoPointer = AutoPointer< Self >; \
52 using RawPointer = Self *; \
53 using ConstRawPointer = const Self *
57 #define itkCellInheritedTypedefs(superclassArg) \
58 using Superclass = superclassArg; \
59 using PixelType = typename Superclass::PixelType; \
60 using CellType = typename Superclass::CellType; \
61 using CellAutoPointer = typename Superclass::CellAutoPointer; \
62 using CellConstAutoPointer = typename Superclass::CellConstAutoPointer; \
63 using CellRawPointer = typename Superclass::CellRawPointer; \
64 using CellConstRawPointer = typename Superclass::CellConstRawPointer; \
65 using CellTraits = typename Superclass::CellTraits; \
66 using CoordRepType = typename Superclass::CoordRepType; \
67 using InterpolationWeightType = typename Superclass::InterpolationWeightType; \
68 using PointIdentifier = typename Superclass::PointIdentifier; \
69 using PointIdIterator = typename Superclass::PointIdIterator; \
70 using PointIdConstIterator = typename Superclass::PointIdConstIterator; \
71 using CellIdentifier = typename Superclass::CellIdentifier; \
72 using CellFeatureIdentifier = typename Superclass::CellFeatureIdentifier; \
73 using CellFeatureCount = typename Superclass::CellFeatureIdentifier; \
74 using PointType = typename Superclass::PointType; \
75 using VectorType = typename Superclass::VectorType; \
76 using PointsContainer = typename Superclass::PointsContainer; \
77 using UsingCellsContainer = typename Superclass::UsingCellsContainer; \
78 using CellGeometry = typename Superclass::CellGeometry; \
79 using ParametricCoordArrayType = typename Superclass::ParametricCoordArrayType; \
80 using ShapeFunctionsArrayType = typename Superclass::ShapeFunctionsArrayType; \
81 static constexpr unsigned int PointDimension = Superclass::PointDimension
131 static constexpr
unsigned int PointDimension = CellTraits::PointDimension;
150 LAST_ITK_CELL, MAX_ITK_CELLS = 255 };
192 if (
id < LAST_ITK_CELL )
194 return m_Visitors[id];
198 auto pos = m_UserDefined.find(
id);
199 if ( pos != m_UserDefined.end() )
201 return ( *pos ).second;
211 if (
id < LAST_ITK_CELL )
243 virtual unsigned int GetDimension()
const = 0;
246 virtual unsigned int GetInterpolationOrder()
const;
249 virtual unsigned int GetNumberOfPoints()
const = 0;
252 virtual CellFeatureCount GetNumberOfBoundaryFeatures(
int dimension)
const = 0;
392 virtual bool IsExplicitBoundary();
398 virtual void AddUsingCell(CellIdentifier cellId);
403 virtual void RemoveUsingCell(CellIdentifier cellId);
410 virtual bool IsUsingCell(CellIdentifier cellId);
415 virtual unsigned int GetNumberOfUsingCells();
417 #if !defined( ITK_WRAPPING_PARSER )
421 virtual UsingCellsContainerIterator UsingCellsBegin();
426 virtual UsingCellsContainerIterator UsingCellsEnd();
464 template<
int VPointDimension,
typename TCoordRep,
465 typename TInterpolationWeight,
typename TPointIdentifier,
466 typename TCellIdentifier,
typename TCellFeatureIdentifier,
467 typename TPoint,
typename TPointsContainer,
468 typename TUsingCellsContainer >
472 static constexpr
unsigned int PointDimension = VPointDimension;
486 #define itkMakeCellTraitsMacro \
487 CellTraitsInfo < Self::PointDimension, CoordRepType, \
488 InterpolationWeightType, \
489 PointIdentifier, CellIdentifier, CellFeatureIdentifier, \
490 PointType, PointsContainer, UsingCellsContainer >
493 #if !defined( ITK_WRAPPING_PARSER )
494 #ifndef ITK_MANUAL_INSTANTIATION
495 #include "itkCellInterface.hxx"
Array class with size defined at construction time.
ConstSelfAutoPointer CellConstAutoPointer
void UnRegister() noexcept
Light weight base class for most itk classes.
class ITK_TEMPLATE_EXPORT CellInterface
TPointsContainer PointsContainer
UsingCellsContainer m_UsingCells
virtual void EvaluateShapeFunctions(const ParametricCoordArrayType &, ShapeFunctionsArrayType &) const
Define numeric traits for std::vector.
CoordRepType * GetBoundingBox(CoordRepType[PointDimension *2])
typename CellTraits::PointsContainer PointsContainer
TUsingCellsContainer UsingCellsContainer
SelfAutoPointer CellAutoPointer
TCellIdentifier CellIdentifier
typename CellTraits::PointIdConstIterator PointIdConstIterator
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
TInterpolationWeight InterpolationWeightType
An abstract interface for cells.
std::map< int, VisitorPointer > m_UserDefined
RawPointer CellRawPointer
typename CellTraits::PointIdIterator PointIdIterator
TCellFeatureIdentifier CellFeatureIdentifier
VisitorType * GetVisitor(int id)
typename CellTraits::PointIdentifier PointIdentifier
Abstract interface for a visitor class that can visit the cells in a Mesh.
typename CellTraits::CellFeatureIdentifier CellFeatureIdentifier
#define itkCellCommonTypedefs(celltype)
virtual bool EvaluatePosition(CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *)
PointIdentifier * PointIdIterator
typename UsingCellsContainer::iterator UsingCellsContainerIterator
typename VisitorType::Pointer VisitorPointer
typename PointType::VectorType VectorType
NOTE: it should normally be defined in the traits.
virtual bool IntersectWithLine(CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType, CoordRepType[PointDimension], CoordRepType *, CoordRepType[])
typename CellTraits::UsingCellsContainer UsingCellsContainer
ConstRawPointer CellConstRawPointer
TPointIdentifier PointIdentifier
typename CellTraits::InterpolationWeightType InterpolationWeightType
const PointIdentifier * PointIdConstIterator
typename CellTraits::CoordRepType CoordRepType
A simple utility class to define the cell type inside a mesh type structure definition. This just makes a copy of existing type information that is needed for a cell type template parameter.
ImageBaseType::PointType PointType
CoordRepType GetBoundingBoxDiagonalLength2()
typename CellTraits::CellIdentifier CellIdentifier
CellFeatureIdentifier CellFeatureCount
virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension *2], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType *)
ImageBaseType::SpacingType VectorType
typename CellTraits::PointType PointType
typename std::map< int, VisitorPointer >::value_type VisitorPointerValueType
virtual bool GetClosestBoundary(CoordRepType[], bool *, CellAutoPointer &)
virtual int GetCellTopologyId()=0
void AddVisitor(VisitorType *v)