ITK  6.0.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
itk::CellInterface< TPixelType, TCellTraits > Class Template Referenceabstract

#include <itkCellInterface.h>

Detailed Description

template<typename TPixelType, typename TCellTraits>
class itk::CellInterface< TPixelType, TCellTraits >

An abstract interface for cells.

Define an abstract interface for cells. Actual cell types derive from this class.

Template Parameters
TPixelTypeThe type stored with an entity (cell, point, or boundary).
TCellTraitsType information for cell.
Examples
Examples/SpatialObjects/MeshSpatialObject.cxx, and SphinxExamples/src/Core/Mesh/ConvertMeshToUnstructeredGrid/Code.cxx.

Definition at line 97 of file itkCellInterface.h.

Classes

class  MultiVisitor
 

Public Types

using CellAutoPointer = SelfAutoPointer
 
using CellConstAutoPointer = ConstSelfAutoPointer
 
using CellConstRawPointer = ConstRawPointer
 
using CellFeatureCount = CellFeatureIdentifier
 
using CellFeatureIdentifier = typename CellTraits::CellFeatureIdentifier
 
using CellIdentifier = typename CellTraits::CellIdentifier
 
using CellRawPointer = RawPointer
 
using CellTraits = TCellTraits
 
using CellType = CellInterface
 
using CoordRepType = typename CellTraits::CoordRepType
 
using InterpolationWeightType = typename CellTraits::InterpolationWeightType
 
using ParametricCoordArrayType = Array< CoordRepType >
 
using PixelType = TPixelType
 
using PointIdConstIterator = typename CellTraits::PointIdConstIterator
 
using PointIdentifier = typename CellTraits::PointIdentifier
 
using PointIdIterator = typename CellTraits::PointIdIterator
 
using PointsContainer = typename CellTraits::PointsContainer
 
using PointType = typename CellTraits::PointType
 
using ShapeFunctionsArrayType = Array< InterpolationWeightType >
 
using UsingCellsContainer = typename CellTraits::UsingCellsContainer
 
using UsingCellsContainerIterator = typename UsingCellsContainer::iterator
 
using VectorType = typename PointType::VectorType
 

Public Member Functions

virtual void Accept (CellIdentifier cellId, MultiVisitor *)=0
 
virtual void AddUsingCell (CellIdentifier cellId)
 
 CellInterface ()=default
 
virtual bool EvaluatePosition (CoordRepType *, PointsContainer *, CoordRepType *, CoordRepType[], double *, InterpolationWeightType *)
 
virtual void EvaluateShapeFunctions (const ParametricCoordArrayType &, ShapeFunctionsArrayType &) const
 
virtual bool GetBoundaryFeature (int dimension, CellFeatureIdentifier, CellAutoPointer &)=0
 
CoordRepType GetBoundingBoxDiagonalLength2 ()
 
virtual bool GetClosestBoundary (CoordRepType[], bool *, CellAutoPointer &)
 
virtual unsigned int GetDimension () const =0
 
virtual unsigned int GetInterpolationOrder () const
 
virtual const char * GetNameOfClass () const
 
virtual CellFeatureCount GetNumberOfBoundaryFeatures (int dimension) const =0
 
virtual unsigned int GetNumberOfPoints () const =0
 
virtual unsigned int GetNumberOfUsingCells ()
 
virtual PointIdConstIterator GetPointIds () const
 
virtual itk::CommonEnums::CellGeometry GetType () const =0
 
virtual bool IntersectBoundingBoxWithLine (CoordRepType[PointDimension *2], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType *)
 
virtual bool IntersectWithLine (CoordRepType[PointDimension], CoordRepType[PointDimension], CoordRepType, CoordRepType[PointDimension], CoordRepType *, CoordRepType[])
 
virtual bool IsExplicitBoundary ()
 
virtual bool IsUsingCell (CellIdentifier cellId)
 
 itkCellCommonTypedefs (CellInterface)
 
virtual void MakeCopy (CellAutoPointer &) const =0
 
virtual PointIdConstIterator PointIdsBegin () const =0
 
virtual PointIdIterator PointIdsBegin ()=0
 
virtual PointIdConstIterator PointIdsEnd () const =0
 
virtual PointIdIterator PointIdsEnd ()=0
 
virtual void RemoveUsingCell (CellIdentifier cellId)
 
virtual void SetPointId (int localId, PointIdentifier)=0
 
virtual void SetPointIds (PointIdConstIterator first)=0
 
virtual void SetPointIds (PointIdConstIterator first, PointIdConstIterator last)=0
 
virtual UsingCellsContainerIterator UsingCellsBegin ()
 
virtual UsingCellsContainerIterator UsingCellsEnd ()
 
virtual ~CellInterface ()=default
 
CoordRepTypeGetBoundingBox (CoordRepType[PointDimension *2])
 

Static Public Attributes

static constexpr unsigned int PointDimension = CellTraits::PointDimension
 

Protected Attributes

UsingCellsContainer m_UsingCells {}
 
using PointIdentifierContainerType = itk::Array< PointIdentifier >
 
PointIdentifierContainerType GetPointIdsContainer () const
 
void SetPointIdsContainer (const PointIdentifierContainerType &)
 

Member Typedef Documentation

◆ CellAutoPointer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellAutoPointer = SelfAutoPointer

Definition at line 134 of file itkCellInterface.h.

◆ CellConstAutoPointer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellConstAutoPointer = ConstSelfAutoPointer

Definition at line 135 of file itkCellInterface.h.

◆ CellConstRawPointer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellConstRawPointer = ConstRawPointer

Definition at line 137 of file itkCellInterface.h.

◆ CellFeatureCount

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellFeatureCount = CellFeatureIdentifier

A useful rename.

Definition at line 140 of file itkCellInterface.h.

◆ CellFeatureIdentifier

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellFeatureIdentifier = typename CellTraits::CellFeatureIdentifier

Definition at line 118 of file itkCellInterface.h.

◆ CellIdentifier

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellIdentifier = typename CellTraits::CellIdentifier

Definition at line 117 of file itkCellInterface.h.

◆ CellRawPointer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellRawPointer = RawPointer

Definition at line 136 of file itkCellInterface.h.

◆ CellTraits

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellTraits = TCellTraits

Save the CellTraits template parameter.

Definition at line 109 of file itkCellInterface.h.

◆ CellType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CellType = CellInterface

Give this and all derived classes quick access to the base cell type.

Definition at line 133 of file itkCellInterface.h.

◆ CoordRepType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::CoordRepType = typename CellTraits::CoordRepType

Save type information for this cell.

Definition at line 112 of file itkCellInterface.h.

◆ InterpolationWeightType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::InterpolationWeightType = typename CellTraits::InterpolationWeightType

Definition at line 113 of file itkCellInterface.h.

◆ ParametricCoordArrayType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::ParametricCoordArrayType = Array<CoordRepType>

Types needed to contour the cells

Definition at line 143 of file itkCellInterface.h.

◆ PixelType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PixelType = TPixelType

Save the PixelType template parameter.

Definition at line 106 of file itkCellInterface.h.

◆ PointIdConstIterator

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointIdConstIterator = typename CellTraits::PointIdConstIterator

Definition at line 116 of file itkCellInterface.h.

◆ PointIdentifier

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointIdentifier = typename CellTraits::PointIdentifier

Definition at line 114 of file itkCellInterface.h.

◆ PointIdentifierContainerType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointIdentifierContainerType = itk::Array<PointIdentifier>

Get/Set the point id list used by the cell

Definition at line 306 of file itkCellInterface.h.

◆ PointIdIterator

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointIdIterator = typename CellTraits::PointIdIterator

Definition at line 115 of file itkCellInterface.h.

◆ PointsContainer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointsContainer = typename CellTraits::PointsContainer

Definition at line 120 of file itkCellInterface.h.

◆ PointType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::PointType = typename CellTraits::PointType

Definition at line 119 of file itkCellInterface.h.

◆ ShapeFunctionsArrayType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::ShapeFunctionsArrayType = Array<InterpolationWeightType>

Definition at line 144 of file itkCellInterface.h.

◆ UsingCellsContainer

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::UsingCellsContainer = typename CellTraits::UsingCellsContainer

Definition at line 121 of file itkCellInterface.h.

◆ UsingCellsContainerIterator

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::UsingCellsContainerIterator = typename UsingCellsContainer::iterator

An iterator through the UsingCellsContainer.

Definition at line 130 of file itkCellInterface.h.

◆ VectorType

template<typename TPixelType, typename TCellTraits>
using itk::CellInterface< TPixelType, TCellTraits >::VectorType = typename PointType::VectorType

NOTE: it should normally be defined in the traits.

Definition at line 124 of file itkCellInterface.h.

Constructor & Destructor Documentation

◆ CellInterface()

template<typename TPixelType, typename TCellTraits>
itk::CellInterface< TPixelType, TCellTraits >::CellInterface ( )
default

◆ ~CellInterface()

template<typename TPixelType, typename TCellTraits>
virtual itk::CellInterface< TPixelType, TCellTraits >::~CellInterface ( )
virtualdefault

Member Function Documentation

◆ Accept()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::Accept ( CellIdentifier  cellId,
MultiVisitor  
)
pure virtual

This must be implemented by all sub-classes of CellInterface

◆ AddUsingCell()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::AddUsingCell ( CellIdentifier  cellId)
virtual

Register the fact that this cell is a part of the boundary of the cell cellId, by adding cellId to the UsingCellsContainer.

◆ EvaluatePosition()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::EvaluatePosition ( CoordRepType ,
PointsContainer ,
CoordRepType ,
CoordRepType  [],
double *  ,
InterpolationWeightType  
)
inlinevirtual

Given the geometric coordinates of a point (coord[PointDimension]), return whether it is inside the cell. Also perform the following calculations, if the corresponding result pointers are not nullptr:

  • Find the closest point in or on the cell to the given point (Returns through pointer to array: closestPoint[PointDimension]).
  • Get the cell's parametric coordinates for the given point (Returns through pointer to array: pCoords[CellDimension]).
  • Get the square of the distance between the point and the cell (this is the distance from the point to the closest point, returned through "dist2" pointer).
  • Get the interpolation weights for the cell (Returns through pointer to array: weights[NumberOfPoints]).

Definition at line 340 of file itkCellInterface.h.

◆ EvaluateShapeFunctions()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::EvaluateShapeFunctions ( const ParametricCoordArrayType ,
ShapeFunctionsArrayType  
) const
inlinevirtual

Given the parametric coordinates of a point in the cell determine the value of its Shape Functions returned through an itkArray<InterpolationWeightType>).

Definition at line 354 of file itkCellInterface.h.

◆ GetBoundaryFeature()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::GetBoundaryFeature ( int  dimension,
CellFeatureIdentifier  ,
CellAutoPointer  
)
pure virtual

Get the boundary feature corresponding to the given dimension and Id.

◆ GetBoundingBox()

template<typename TPixelType, typename TCellTraits>
CoordRepType* itk::CellInterface< TPixelType, TCellTraits >::GetBoundingBox ( CoordRepType  [PointDimension *2])
inline

Compute cell bounding box and store in the user-provided array. 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]);".

Definition at line 387 of file itkCellInterface.h.

◆ GetBoundingBoxDiagonalLength2()

template<typename TPixelType, typename TCellTraits>
CoordRepType itk::CellInterface< TPixelType, TCellTraits >::GetBoundingBoxDiagonalLength2 ( )
inline

Compute the square of the diagonal length of the bounding box.

Definition at line 392 of file itkCellInterface.h.

◆ GetClosestBoundary()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::GetClosestBoundary ( CoordRepType  [],
bool *  ,
CellAutoPointer  
)
inlinevirtual

Given the parametric coordinates of a point in the cell (pCoords[CellDimension]), get the closest cell boundary feature of topological dimension CellDimension-1. If the "inside" pointer is not nullptr, the flag is set to indicate whether the point is inside the cell.

Definition at line 318 of file itkCellInterface.h.

◆ GetDimension()

template<typename TPixelType, typename TCellTraits>
virtual unsigned int itk::CellInterface< TPixelType, TCellTraits >::GetDimension ( ) const
pure virtual

Get the topological dimension of this cell.

◆ GetInterpolationOrder()

template<typename TPixelType, typename TCellTraits>
virtual unsigned int itk::CellInterface< TPixelType, TCellTraits >::GetInterpolationOrder ( ) const
virtual

Get the interpolation order of the cell. Usually linear.

◆ GetNameOfClass()

template<typename TPixelType, typename TCellTraits>
virtual const char* itk::CellInterface< TPixelType, TCellTraits >::GetNameOfClass ( ) const
virtual

◆ GetNumberOfBoundaryFeatures()

template<typename TPixelType, typename TCellTraits>
virtual CellFeatureCount itk::CellInterface< TPixelType, TCellTraits >::GetNumberOfBoundaryFeatures ( int  dimension) const
pure virtual

Get the number of boundary features of a given dimension on this cell.

◆ GetNumberOfPoints()

template<typename TPixelType, typename TCellTraits>
virtual unsigned int itk::CellInterface< TPixelType, TCellTraits >::GetNumberOfPoints ( ) const
pure virtual

Get the number of points required to define the cell.

◆ GetNumberOfUsingCells()

template<typename TPixelType, typename TCellTraits>
virtual unsigned int itk::CellInterface< TPixelType, TCellTraits >::GetNumberOfUsingCells ( )
virtual

Get the number of cells in the UsingCellsContainer.

◆ GetPointIds()

template<typename TPixelType, typename TCellTraits>
virtual PointIdConstIterator itk::CellInterface< TPixelType, TCellTraits >::GetPointIds ( ) const
virtual

Get the point id list used by the cell in a form suitable to pass to SetPointIds(first) on another cell. This is equivalent to PointIdsBegin() const.

◆ GetPointIdsContainer()

template<typename TPixelType, typename TCellTraits>
PointIdentifierContainerType itk::CellInterface< TPixelType, TCellTraits >::GetPointIdsContainer ( ) const

Get/Set the point id list used by the cell

◆ GetType()

template<typename TPixelType, typename TCellTraits>
virtual itk::CommonEnums::CellGeometry itk::CellInterface< TPixelType, TCellTraits >::GetType ( ) const
pure virtual

Return the type of the cell (one of the CellGeometryEnum enums listed above).

◆ IntersectBoundingBoxWithLine()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::IntersectBoundingBoxWithLine ( CoordRepType  [PointDimension *2],
CoordRepType  [PointDimension],
CoordRepType  [PointDimension],
CoordRepType  [PointDimension],
CoordRepType  
)
inlinevirtual

Intersect the given bounding box (bounds[PointDimension*2]) with a line given by an origin (origin[PointDimension]) and direction (direction[PointDimension]). Get the following results if the corresponding pointers are not nullptr:

  • The intersection point's geometric coordinates (returned through pointer to array: coords[PointDimension]).
  • The line's parametric coordinate of the intersection point (returned through "t" pointer).

Returns whether an intersection exists.

Definition at line 409 of file itkCellInterface.h.

◆ IntersectWithLine()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::IntersectWithLine ( CoordRepType  [PointDimension],
CoordRepType  [PointDimension],
CoordRepType  ,
CoordRepType  [PointDimension],
CoordRepType ,
CoordRepType  [] 
)
inlinevirtual

Intersect the cell with a line given by an origin (origin[PointDimension]) and direction (direction[PointDimension]). The intersection point found will be within the given tolerance of the real intersection. Get the following results if the corresponding pointers are not nullptr:

  • The intersection point's geometric coordinates (returned through pointer to array: coords[PointDimension]).
  • The line's parametric coordinate of the intersection point (returned through "t" pointer).
  • The cell's parametric coordinates of the intersection point (returned through pointer to array: pCoords[CellDimension]).

Returns whether an intersection exists within the given tolerance.

Definition at line 373 of file itkCellInterface.h.

◆ IsExplicitBoundary()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::IsExplicitBoundary ( )
virtual

Interface to the boundary form of the cell to set/get UsingCells. See the boundary wrapper source for more information. Returns true if the cell has been explicitly assigned as a boundary, false otherwise.

◆ IsUsingCell()

template<typename TPixelType, typename TCellTraits>
virtual bool itk::CellInterface< TPixelType, TCellTraits >::IsUsingCell ( CellIdentifier  cellId)
virtual

Test if a cell is in the UsingCellsContainer. A result of true indicates that this cell is part of the boundary of the cell cellId, assuming that boundary information has been recorded.

◆ itkCellCommonTypedefs()

template<typename TPixelType, typename TCellTraits>
itk::CellInterface< TPixelType, TCellTraits >::itkCellCommonTypedefs ( CellInterface< TPixelType, TCellTraits >  )

Standard class type aliases.

◆ MakeCopy()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::MakeCopy ( CellAutoPointer ) const
pure virtual

Create a new copy of this cell. This is provided so that a copy can be made without knowing the cell type.

◆ PointIdsBegin() [1/2]

template<typename TPixelType, typename TCellTraits>
virtual PointIdConstIterator itk::CellInterface< TPixelType, TCellTraits >::PointIdsBegin ( ) const
pure virtual

Get a const begin iterator to the list of point identifiers used by the cell.

◆ PointIdsBegin() [2/2]

template<typename TPixelType, typename TCellTraits>
virtual PointIdIterator itk::CellInterface< TPixelType, TCellTraits >::PointIdsBegin ( )
pure virtual

Get a begin iterator to the list of point identifiers used by the cell.

◆ PointIdsEnd() [1/2]

template<typename TPixelType, typename TCellTraits>
virtual PointIdConstIterator itk::CellInterface< TPixelType, TCellTraits >::PointIdsEnd ( ) const
pure virtual

Get a const end iterator to the list of point identifiers used by the cell.

◆ PointIdsEnd() [2/2]

template<typename TPixelType, typename TCellTraits>
virtual PointIdIterator itk::CellInterface< TPixelType, TCellTraits >::PointIdsEnd ( )
pure virtual

Get an end iterator to the list of point identifiers used by the cell.

◆ RemoveUsingCell()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::RemoveUsingCell ( CellIdentifier  cellId)
virtual

Remove a cell from the UsingCellsContainer.

◆ SetPointId()

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::SetPointId ( int  localId,
PointIdentifier   
)
pure virtual

Set the point identifier for a given spot in the point list for the cell.

◆ SetPointIds() [1/2]

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::SetPointIds ( PointIdConstIterator  first)
pure virtual

Set the point id list used by the cell. It is assumed that the given iterator can be incremented and safely de-referenced enough times to get all the point ids needed by the cell.

◆ SetPointIds() [2/2]

template<typename TPixelType, typename TCellTraits>
virtual void itk::CellInterface< TPixelType, TCellTraits >::SetPointIds ( PointIdConstIterator  first,
PointIdConstIterator  last 
)
pure virtual

Set the point id list used by the cell. It is assumed that the range of iterators [first, last) contains the correct number of points needed to define the cell. The position *last is NOT referenced, so it can safely be one beyond the end of an array or other container.

◆ SetPointIdsContainer()

template<typename TPixelType, typename TCellTraits>
void itk::CellInterface< TPixelType, TCellTraits >::SetPointIdsContainer ( const PointIdentifierContainerType )

Get/Set the point id list used by the cell

◆ UsingCellsBegin()

template<typename TPixelType, typename TCellTraits>
virtual UsingCellsContainerIterator itk::CellInterface< TPixelType, TCellTraits >::UsingCellsBegin ( )
virtual

Get a begin iterator for the UsingCellsContainer.

◆ UsingCellsEnd()

template<typename TPixelType, typename TCellTraits>
virtual UsingCellsContainerIterator itk::CellInterface< TPixelType, TCellTraits >::UsingCellsEnd ( )
virtual

Get an end iterator for the UsingCellsContainer.

Member Data Documentation

◆ m_UsingCells

template<typename TPixelType, typename TCellTraits>
UsingCellsContainer itk::CellInterface< TPixelType, TCellTraits >::m_UsingCells {}
protected

Cell internal utility routines. Get the geometric position of a point. Store the set of cells using this boundary.

Definition at line 497 of file itkCellInterface.h.

◆ PointDimension

template<typename TPixelType, typename TCellTraits>
constexpr unsigned int itk::CellInterface< TPixelType, TCellTraits >::PointDimension = CellTraits::PointDimension
staticconstexpr

Save the dimension from the template parameters.

Definition at line 127 of file itkCellInterface.h.


The documentation for this class was generated from the following file: