Skip to content

Commit

Permalink
DOC: Document miscellaneous cell class methods in header files
Browse files Browse the repository at this point in the history
Document miscellaneous cell class methods in header files: Doxygen picks
the method documentation from the header files, and leaves the method
documentation empty if it does not find it there.

Increase consistency in the characters used for documentation blocks
and follow the ITK SW Guideline: prefer using single-line comments for
separation of logical blocks.

Take advantage of the commit to fix typos in the method documentation.
  • Loading branch information
jhlegarreta committed Jul 16, 2023
1 parent cdbbdf9 commit 291e618
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 203 deletions.
41 changes: 39 additions & 2 deletions Modules/Core/Common/include/itkTetrahedronCell.h
Expand Up @@ -44,7 +44,7 @@ class ITK_TEMPLATE_EXPORT TetrahedronCell
public:
ITK_DISALLOW_COPY_AND_MOVE(TetrahedronCell);

/** Standard class type aliasa. */
/** Standard class type alias. */
itkCellCommonTypedefs(TetrahedronCell);
itkCellInheritedTypedefs(TCellInterface);

Expand All @@ -70,6 +70,8 @@ class ITK_TEMPLATE_EXPORT TetrahedronCell
static constexpr unsigned int NumberOfFaces = 4;
static constexpr unsigned int CellDimension = 3;

// Standard CellInterface

/** Implement the standard CellInterface. */
CellGeometryEnum
GetType() const override
Expand All @@ -79,51 +81,86 @@ class ITK_TEMPLATE_EXPORT TetrahedronCell
void
MakeCopy(CellAutoPointer &) const override;

/** Get the topological dimension of this cell. */
unsigned int
GetDimension() const override;

/** Get the number of points required to define the cell. */
unsigned int
GetNumberOfPoints() const override;

/** Get the number of boundary features of the given dimension. */
CellFeatureCount
GetNumberOfBoundaryFeatures(int dimension) const override;

/** Get the boundary feature of the given dimension specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfBoundaryFeatures(dimension)-1.
*/
bool
GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;

/** 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.
*/
void
SetPointIds(PointIdConstIterator first) override;

/** 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.
*/
void
SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;

/** Set an individual point identifier in the cell. */
void
SetPointId(int localId, PointIdentifier) override;

/** Get a begin iterator to the list of point identifiers used by the cell. */
PointIdIterator
PointIdsBegin() override;

/** Get a const begin iterator to the list of point identifiers used by the cell. */
PointIdConstIterator
PointIdsBegin() const override;

/** Get an end iterator to the list of point identifiers used by the cell. */
PointIdIterator
PointIdsEnd() override;

/** Get a const end iterator to the list of point identifiers used by the cell. */
PointIdConstIterator
PointIdsEnd() const override;

/** Tetrahedron-specific interface. */
// Tetrahedron-specific interface

/** Get the number of vertices defining the tetrahedron. */
virtual CellFeatureCount
GetNumberOfVertices() const;

/** Get the number of edges defined for the tetrahedron. */
virtual CellFeatureCount
GetNumberOfEdges() const;

/** Get the number of faces defined for the tetrahedron. */
virtual CellFeatureCount
GetNumberOfFaces() const;

/** Get the vertex specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfVertices()-1.
*/
virtual bool
GetVertex(CellFeatureIdentifier, VertexAutoPointer &);

/** Get the edge specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfEdges()-1.
*/
virtual bool
GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);

/** Get the face specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfFaces()-1.
*/
virtual bool
GetFace(CellFeatureIdentifier, FaceAutoPointer &);

Expand Down
84 changes: 1 addition & 83 deletions Modules/Core/Common/include/itkTetrahedronCell.hxx
Expand Up @@ -23,9 +23,7 @@

namespace itk
{
/**
* Standard CellInterface:
*/

template <typename TCellInterface>
void
TetrahedronCell<TCellInterface>::MakeCopy(CellAutoPointer & cellPointer) const
Expand All @@ -34,32 +32,20 @@ TetrahedronCell<TCellInterface>::MakeCopy(CellAutoPointer & cellPointer) const
cellPointer->SetPointIds(this->GetPointIds());
}

/**
* Standard CellInterface:
* Get the topological dimension of this cell.
*/
template <typename TCellInterface>
unsigned int
TetrahedronCell<TCellInterface>::GetDimension() const
{
return Self::CellDimension;
}

/**
* Standard CellInterface:
* Get the number of points required to define the cell.
*/
template <typename TCellInterface>
unsigned int
TetrahedronCell<TCellInterface>::GetNumberOfPoints() const
{
return Self::NumberOfPoints;
}

/**
* Standard CellInterface:
* Get the number of boundary features of the given dimension.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::GetNumberOfBoundaryFeatures(int dimension) const -> CellFeatureCount
Expand Down Expand Up @@ -220,12 +206,6 @@ TetrahedronCell<TCellInterface>::EvaluatePosition(CoordRepType * x,
return false;
}

/**
* Standard CellInterface:
* Get the boundary feature of the given dimension specified by the given
* cell feature Id.
* The Id can range from 0 to GetNumberOfBoundaryFeatures(dimension)-1.
*/
template <typename TCellInterface>
bool
TetrahedronCell<TCellInterface>::GetBoundaryFeature(int dimension,
Expand Down Expand Up @@ -271,26 +251,13 @@ TetrahedronCell<TCellInterface>::GetBoundaryFeature(int dimens
return false;
}

/**
* Standard CellInterface:
* 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.
*/
template <typename TCellInterface>
void
TetrahedronCell<TCellInterface>::SetPointIds(PointIdConstIterator first)
{
std::copy_n(first, Self::NumberOfPoints, m_PointIds.begin());
}

/**
* Standard CellInterface:
* 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.
*/
template <typename TCellInterface>
void
TetrahedronCell<TCellInterface>::SetPointIds(PointIdConstIterator first, PointIdConstIterator last)
Expand All @@ -304,101 +271,62 @@ TetrahedronCell<TCellInterface>::SetPointIds(PointIdConstIterator first, PointId
}
}

/**
* Standard CellInterface:
* Set an individual point identifier in the cell.
*/
template <typename TCellInterface>
void
TetrahedronCell<TCellInterface>::SetPointId(int localId, PointIdentifier ptId)
{
m_PointIds[localId] = ptId;
}

/**
* Standard CellInterface:
* Get a begin iterator to the list of point identifiers used by the cell.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::PointIdsBegin() -> PointIdIterator
{
return &m_PointIds[0];
}

/**
* Standard CellInterface:
* Get a const begin iterator to the list of point identifiers used
* by the cell.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::PointIdsBegin() const -> PointIdConstIterator
{
return &m_PointIds[0];
}

/**
* Standard CellInterface:
* Get an end iterator to the list of point identifiers used by the cell.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::PointIdsEnd() -> PointIdIterator
{
return &m_PointIds[Self::NumberOfPoints - 1] + 1;
}

/**
* Standard CellInterface:
* Get a const end iterator to the list of point identifiers used
* by the cell.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::PointIdsEnd() const -> PointIdConstIterator
{
return &m_PointIds[Self::NumberOfPoints - 1] + 1;
}

/**
* Tetrahedron-specific:
* Get the number of vertices defining the tetrahedron.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::GetNumberOfVertices() const -> CellFeatureCount
{
return Self::NumberOfVertices;
}

/**
* Tetrahedron-specific:
* Get the number of edges defined for the tetrahedron.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::GetNumberOfEdges() const -> CellFeatureCount
{
return Self::NumberOfEdges;
}

/**
* Tetrahedron-specific:
* Get the number of faces defined for the tetrahedron.
*/
template <typename TCellInterface>
auto
TetrahedronCell<TCellInterface>::GetNumberOfFaces() const -> CellFeatureCount
{
return Self::NumberOfFaces;
}

/**
* Tetrahedron-specific:
* Get the vertex specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfVertices()-1.
*/
template <typename TCellInterface>
bool
TetrahedronCell<TCellInterface>::GetVertex(CellFeatureIdentifier vertexId, VertexAutoPointer & vertexPointer)
Expand All @@ -410,11 +338,6 @@ TetrahedronCell<TCellInterface>::GetVertex(CellFeatureIdentifier vertexId, Verte
return true;
}

/**
* Tetrahedron-specific:
* Get the edge specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfEdges()-1.
*/
template <typename TCellInterface>
bool
TetrahedronCell<TCellInterface>::GetEdge(CellFeatureIdentifier edgeId, EdgeAutoPointer & edgePointer)
Expand All @@ -429,11 +352,6 @@ TetrahedronCell<TCellInterface>::GetEdge(CellFeatureIdentifier edgeId, EdgeAutoP
return true;
}

/**
* Tetrahedron-specific:
* Get the face specified by the given cell feature Id.
* The Id can range from 0 to GetNumberOfFaces()-1.
*/
template <typename TCellInterface>
bool
TetrahedronCell<TCellInterface>::GetFace(CellFeatureIdentifier faceId, FaceAutoPointer & facePointer)
Expand Down

0 comments on commit 291e618

Please sign in to comment.