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) ITK_OVERRIDE \
38 typename CellInterfaceVisitor< PixelType, CellTraits >::Pointer v = \
39 mv->GetVisitor(TopologyId); \
42 v->VisitFromCell(cellid, this); \
48 #define itkCellCommonTypedefs(celltype) \
49 typedef celltype Self; \
50 typedef AutoPointer< const Self > ConstSelfAutoPointer; \
51 typedef AutoPointer< Self > SelfAutoPointer; \
52 typedef Self * RawPointer; \
53 typedef const Self *ConstRawPointer
57 #define itkCellInheritedTypedefs(superclassArg) \
58 typedef superclassArg Superclass; \
59 typedef typename Superclass::PixelType PixelType; \
60 typedef typename Superclass::CellType CellType; \
61 typedef typename Superclass::CellAutoPointer CellAutoPointer; \
62 typedef typename Superclass::CellConstAutoPointer CellConstAutoPointer; \
63 typedef typename Superclass::CellRawPointer CellRawPointer; \
64 typedef typename Superclass::CellConstRawPointer CellConstRawPointer; \
65 typedef typename Superclass::CellTraits CellTraits; \
66 typedef typename Superclass::CoordRepType CoordRepType; \
67 typedef typename Superclass::InterpolationWeightType \
68 InterpolationWeightType; \
69 typedef typename Superclass::PointIdentifier PointIdentifier; \
70 typedef typename Superclass::PointIdIterator PointIdIterator; \
71 typedef typename Superclass::PointIdConstIterator PointIdConstIterator; \
72 typedef typename Superclass::CellIdentifier CellIdentifier; \
73 typedef typename Superclass::CellFeatureIdentifier CellFeatureIdentifier; \
74 typedef typename Superclass::CellFeatureIdentifier CellFeatureCount; \
75 typedef typename Superclass::PointType PointType; \
76 typedef typename Superclass::VectorType VectorType; \
77 typedef typename Superclass::PointsContainer PointsContainer; \
78 typedef typename Superclass::UsingCellsContainer UsingCellsContainer; \
79 typedef typename Superclass::CellGeometry CellGeometry; \
80 typedef typename Superclass::ParametricCoordArrayType \
81 ParametricCoordArrayType; \
82 typedef typename Superclass::ShapeFunctionsArrayType \
83 ShapeFunctionsArrayType; \
84 itkStaticConstMacro(PointDimension, unsigned int, Superclass::PointDimension)
133 itkStaticConstMacro(PointDimension,
unsigned int, CellTraits::PointDimension);
152 LAST_ITK_CELL, MAX_ITK_CELLS = 255 };
189 typedef typename std::map< int, VisitorPointer >::value_type
195 if (
id < LAST_ITK_CELL )
197 return m_Visitors[id];
201 typename std::map< int, typename VisitorType::Pointer >::iterator
202 pos = m_UserDefined.find(
id);
203 if ( pos != m_UserDefined.end() )
205 return ( *pos ).second;
215 if (
id < LAST_ITK_CELL )
247 virtual unsigned int GetDimension(
void)
const = 0;
250 virtual unsigned int GetInterpolationOrder()
const;
253 virtual unsigned int GetNumberOfPoints(
void)
const = 0;
256 virtual CellFeatureCount GetNumberOfBoundaryFeatures(
int dimension)
const = 0;
396 virtual bool IsExplicitBoundary();
402 virtual void AddUsingCell(CellIdentifier cellId);
407 virtual void RemoveUsingCell(CellIdentifier cellId);
414 virtual bool IsUsingCell(CellIdentifier cellId);
419 virtual unsigned int GetNumberOfUsingCells();
421 #if !defined( ITK_WRAPPING_PARSER )
425 virtual UsingCellsContainerIterator UsingCellsBegin();
430 virtual UsingCellsContainerIterator UsingCellsEnd();
471 template<
int VPointDimension,
typename TCoordRep,
472 typename TInterpolationWeight,
typename TPointIdentifier,
473 typename TCellIdentifier,
typename TCellFeatureIdentifier,
474 typename TPoint,
typename TPointsContainer,
475 typename TUsingCellsContainer >
479 itkStaticConstMacro(PointDimension,
unsigned int, VPointDimension);
493 #define itkMakeCellTraitsMacro \
494 CellTraitsInfo < itkGetStaticConstMacro(PointDimension), CoordRepType, \
495 InterpolationWeightType, \
496 PointIdentifier, CellIdentifier, CellFeatureIdentifier, \
497 PointType, PointsContainer, UsingCellsContainer >
500 #if !defined( ITK_WRAPPING_PARSER )
501 #ifndef ITK_MANUAL_INSTANTIATION
502 #include "itkCellInterface.hxx"
Array class with size defined at construction time.
const PointIdentifier * PointIdConstIterator
CellTraits::CellIdentifier CellIdentifier
itk::Array< PointIdentifier > PointIdentifierContainerType
void UnRegister() noexcept
CellInterfaceVisitor< TPixelType, TCellTraits > VisitorType
Light weight base class for most itk classes.
SelfAutoPointer CellAutoPointer
RawPointer CellRawPointer
SmartPointer< Self > Pointer
UsingCellsContainer m_UsingCells
virtual void EvaluateShapeFunctions(const ParametricCoordArrayType &, ShapeFunctionsArrayType &) const
virtual ~MultiVisitor() override
CoordRepType * GetBoundingBox(CoordRepType[PointDimension *2])
TCellIdentifier CellIdentifier
TUsingCellsContainer UsingCellsContainer
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
An abstract interface for cells.
CellTraits::PointType PointType
CellTraits::PointIdentifier PointIdentifier
TPointIdentifier PointIdentifier
CellTraits::InterpolationWeightType InterpolationWeightType
ImageBaseType::SpacingType VectorType
std::map< int, VisitorPointer > m_UserDefined
VisitorType * GetVisitor(int id)
Abstract interface for a visitor class that can visit the cells in a Mesh.
CellFeatureIdentifier CellFeatureCount
PointType::VectorType VectorType
NOTE: it should normally be defined in the traits.
#define itkCellCommonTypedefs(celltype)
virtual bool EvaluatePosition(CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *)
ImageBaseType::PointType PointType
TCellFeatureIdentifier CellFeatureIdentifier
TInterpolationWeight InterpolationWeightType
CellTraits::CellFeatureIdentifier CellFeatureIdentifier
UsingCellsContainer::iterator UsingCellsContainerIterator
ConstSelfAutoPointer CellConstAutoPointer
virtual bool IntersectWithLine(CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType, CoordRepType[PointDimension], CoordRepType *, CoordRepType[])
TPointsContainer PointsContainer
CellTraits::PointIdIterator PointIdIterator
Array< InterpolationWeightType > ShapeFunctionsArrayType
ConstRawPointer CellConstRawPointer
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.
PointIdentifier * PointIdIterator
CoordRepType GetBoundingBoxDiagonalLength2(void)
Array< CoordRepType > ParametricCoordArrayType
CellTraits::PointsContainer PointsContainer
virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension *2], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType *)
CellTraits::CoordRepType CoordRepType
CellTraits::PointIdConstIterator PointIdConstIterator
VisitorType::Pointer VisitorPointer
virtual bool GetClosestBoundary(CoordRepType[], bool *, CellAutoPointer &)
virtual int GetCellTopologyId()=0
void AddVisitor(VisitorType *v)
CellTraits::UsingCellsContainer UsingCellsContainer
std::map< int, VisitorPointer >::value_type VisitorPointerValueType