ITK  5.4.0
Insight Toolkit
itkCellInterfaceVisitor.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkCellInterfaceVisitor_h
19#define itkCellInterfaceVisitor_h
20
21#include "itkLightObject.h"
22#include "itkObjectFactory.h"
23#include "itkCommonEnums.h"
24
25namespace itk
26{
27// Forward reference of CellInterface because of circular #include dependencies
28template <typename TPixelType, typename TCellTraits>
29class ITK_TEMPLATE_EXPORT CellInterface;
30
44template <typename TPixelType, typename TCellTraits>
45class ITK_TEMPLATE_EXPORT CellInterfaceVisitor : public LightObject
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(CellInterfaceVisitor);
49
55 using CellIdentifier = typename TCellTraits::CellIdentifier;
56
58 itkOverrideGetNameOfClassMacro(CellInterfaceVisitor);
59
61 virtual void
63
65 virtual CellGeometryEnum
67
68protected:
70 ~CellInterfaceVisitor() override = default;
71};
72
99template <typename TPixelType, typename TCellTraits, typename CellTopology, typename UserVisitor>
101 : public CellInterfaceVisitor<TPixelType, TCellTraits>
102 , public UserVisitor
103{
104public:
105 ITK_DISALLOW_COPY_AND_MOVE(CellInterfaceVisitorImplementation);
106
110 using CellIdentifier = typename TCellTraits::CellIdentifier;
111
113 itkNewMacro(Self);
114
116 itkOverrideGetNameOfClassMacro(CellInterfaceVisitorImplementation);
117
122 {
123 return CellTopology::GetTopologyId();
124 }
125
128 void
130 {
131 this->UserVisitor::Visit(cellId, (CellTopology *)c);
132 }
133
134protected:
137};
138} // end namespace itk
139
140#endif
A template class used to implement a visitor object.
~CellInterfaceVisitorImplementation() override=default
void VisitFromCell(CellIdentifier cellId, CellInterface< TPixelType, TCellTraits > *c) override
Abstract interface for a visitor class that can visit the cells in a Mesh.
virtual CellGeometryEnum GetCellTopologyId()=0
typename TCellTraits::CellIdentifier CellIdentifier
virtual void VisitFromCell(CellIdentifier cellId, CellInterface< TPixelType, TCellTraits > *)=0
~CellInterfaceVisitor() override=default
An abstract interface for cells.
Light weight base class for most itk classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....