ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRegularSphereMeshSource.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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_ASSIGN(RegularSphereMeshSource);
45 
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(RegularSphereMeshSource, MeshSource);
57 
59  using OutputMeshType = TOutputMesh;
60  using MeshTraits = typename OutputMeshType::MeshTraits;
62  using PixelType = typename MeshTraits::PixelType;
64 
66  using OutputMeshPointer = typename OutputMeshType::Pointer;
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);
85 
87  itkSetMacro(Center, PointType);
88  itkGetConstMacro(Center, PointType);
90 
94  itkSetMacro(Scale, VectorType);
95  itkGetConstMacro(Scale, VectorType);
97 
98 protected:
100  ~RegularSphereMeshSource() override = default;
101  void PrintSelf(std::ostream & os, itk::Indent indent) const override;
102 
103  void GenerateData() override;
104 
105  PointType Divide(const PointType & p1, const PointType & p2) const;
106 
107  void AddCell(OutputMeshType *mesh, const typename OutputMeshType::PointIdentifier *pointIds, IdentifierType idx);
108 
111 
113  unsigned int m_Resolution;
114 
117 };
118 } // end namespace itk
119 
120 #ifndef ITK_MANUAL_INSTANTIATION
121 #include "itkRegularSphereMeshSource.hxx"
122 #endif
123 
124 #endif //_itkRegularSphereMeshSource_h
typename TriCellType::SelfAutoPointer TriCellAutoPointer
Light weight base class for most itk classes.
typename MeshTraits::PixelType PixelType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename OutputMeshType::MeshTraits MeshTraits
typename PointType::VectorType VectorType
A wrapper of the STL &quot;map&quot; container.
std::pair< IdentifierType, IdentifierType > IndexPairType
An abstract interface for cells.
Inputs are the center of the mesh, the scale (radius in each dimension) of the mesh and a resolution ...
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
typename OutputMeshType::PointsContainer PointsContainer
typename TriCellType::CellAutoPointer CellAutoPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
typename OutputMeshType::PointType PointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename OutputMeshType::CellTraits CellTraits
typename OutputMeshType::PointsContainerPointer PointsContainerPointer