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 
26 namespace itk
27 {
40 template <typename TOutputMesh>
41 class ITK_TEMPLATE_EXPORT RegularSphereMeshSource : public MeshSource<TOutputMesh>
42 {
43 public:
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);
98 protected:
100  ~RegularSphereMeshSource() override = default;
101  void
102  PrintSelf(std::ostream & os, itk::Indent indent) const override;
103 
104  void
105  GenerateData() override;
106 
107  PointType
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
itk::RegularSphereMeshSource
Inputs are the center of the mesh, the scale (radius in each dimension) of the mesh and a resolution ...
Definition: itkRegularSphereMeshSource.h:41
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::RegularSphereMeshSource::CellTraits
typename OutputMeshType::CellTraits CellTraits
Definition: itkRegularSphereMeshSource.h:67
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
itk::RegularSphereMeshSource::PointType
typename OutputMeshType::PointType PointType
Definition: itkRegularSphereMeshSource.h:61
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::MeshSource
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
itkMeshSource.h
itkMesh.h
itk::TriangleCell
Definition: itkTriangleCell.h:46
itkIntTypes.h
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:97
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::RegularSphereMeshSource::MeshTraits
typename OutputMeshType::MeshTraits MeshTraits
Definition: itkRegularSphereMeshSource.h:60
itk::RegularSphereMeshSource::VectorType
typename PointType::VectorType VectorType
Definition: itkRegularSphereMeshSource.h:63
itk::RegularSphereMeshSource::TriCellAutoPointer
typename TriCellType::SelfAutoPointer TriCellAutoPointer
Definition: itkRegularSphereMeshSource.h:74
itk::RegularSphereMeshSource::PointsContainer
typename OutputMeshType::PointsContainer PointsContainer
Definition: itkRegularSphereMeshSource.h:69
itk::RegularSphereMeshSource::PixelType
typename MeshTraits::PixelType PixelType
Definition: itkRegularSphereMeshSource.h:62
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itkTriangleCell.h
itk::RegularSphereMeshSource::IndexPairType
std::pair< IdentifierType, IdentifierType > IndexPairType
Definition: itkRegularSphereMeshSource.h:77
itk::IdentifierType
SizeValueType IdentifierType
Definition: itkIntTypes.h:90
itk::RegularSphereMeshSource::CellAutoPointer
typename TriCellType::CellAutoPointer CellAutoPointer
Definition: itkRegularSphereMeshSource.h:75
itk::RegularSphereMeshSource::PointsContainerPointer
typename OutputMeshType::PointsContainerPointer PointsContainerPointer
Definition: itkRegularSphereMeshSource.h:68