ITK  6.0.0
Insight Toolkit
itkRegularSphereMeshSource.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 itkRegularSphereMeshSource_h
19#define itkRegularSphereMeshSource_h
20
21#include "itkIntTypes.h"
22#include "itkMesh.h"
23#include "itkMeshSource.h"
24#include "itkTriangleCell.h"
25
26namespace itk
27{
40template <typename TOutputMesh>
41class ITK_TEMPLATE_EXPORT RegularSphereMeshSource : public MeshSource<TOutputMesh>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(RegularSphereMeshSource);
45
51
53 itkNewMacro(Self);
54
56 itkOverrideGetNameOfClassMacro(RegularSphereMeshSource);
57
59 using OutputMeshType = TOutputMesh;
60 using MeshTraits = typename OutputMeshType::MeshTraits;
62 using PixelType = typename MeshTraits::PixelType;
64
67 using CellTraits = typename OutputMeshType::CellTraits;
68 using PointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
69 using PointsContainer = typename OutputMeshType::PointsContainer;
70
74 using TriCellAutoPointer = typename TriCellType::SelfAutoPointer;
75 using CellAutoPointer = typename TriCellType::CellAutoPointer;
76
77 using IndexPairType = std::pair<IdentifierType, IdentifierType>;
79
82 itkSetMacro(Resolution, unsigned int);
83 itkGetConstMacro(Resolution, unsigned int);
87 itkSetMacro(Center, PointType);
88 itkGetConstMacro(Center, PointType);
94 itkSetMacro(Scale, VectorType);
95 itkGetConstMacro(Scale, VectorType);
98protected:
100 ~RegularSphereMeshSource() override = default;
101 void
102 PrintSelf(std::ostream & os, itk::Indent indent) const override;
103
104 void
105 GenerateData() override;
106
108 Divide(const PointType & p1, const PointType & p2) const;
109
110 void
111 AddCell(OutputMeshType * mesh, const typename OutputMeshType::PointIdentifier * pointIds, IdentifierType idx);
112
114 PointType m_Center{};
115
117 unsigned int m_Resolution{};
118
120 VectorType m_Scale{};
121};
122} // end namespace itk
123
124#ifndef ITK_MANUAL_INSTANTIATION
125# include "itkRegularSphereMeshSource.hxx"
126#endif
127
128#endif //_itkRegularSphereMeshSource_h
An abstract interface for cells.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
A wrapper of the STL "map" container.
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:50
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
Inputs are the center of the mesh, the scale (radius in each dimension) of the mesh and a resolution ...
~RegularSphereMeshSource() override=default
typename OutputMeshType::PointsContainerPointer PointsContainerPointer
void GenerateData() override
typename OutputMeshType::PointsContainer PointsContainer
std::pair< IdentifierType, IdentifierType > IndexPairType
typename OutputMeshType::PointType PointType
typename OutputMeshType::CellTraits CellTraits
typename PointType::VectorType VectorType
PointType Divide(const PointType &p1, const PointType &p2) const
void AddCell(OutputMeshType *mesh, const typename OutputMeshType::PointIdentifier *pointIds, IdentifierType idx)
typename OutputMeshType::MeshTraits MeshTraits
typename TriCellType::SelfAutoPointer TriCellAutoPointer
typename MeshTraits::PixelType PixelType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
typename TriCellType::CellAutoPointer CellAutoPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition: itkIntTypes.h:90