ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSphereMeshSource.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 itkSphereMeshSource_h
19 #define itkSphereMeshSource_h
20 
21 #include "vnl/vnl_matrix_fixed.h"
22 #include "itkMesh.h"
23 #include "itkMeshSource.h"
24 #include "itkVector.h"
25 #include "itkTriangleCell.h"
27 
28 namespace itk
29 {
40 template< typename TOutputMesh >
41 class ITK_TEMPLATE_EXPORT SphereMeshSource:public MeshSource< TOutputMesh >
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_ASSIGN(SphereMeshSource);
45 
47  using Self = SphereMeshSource;
48  using Superclass = MeshSource< TOutputMesh >;
49  using Pointer = SmartPointer< Self >;
50  using ConstPointer = SmartPointer< const Self >;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(SphereMeshSource, MeshSource);
57 
59  using OutputMeshType = TOutputMesh;
60  using OMeshTraits = typename OutputMeshType::MeshTraits;
61  using OPointType = typename OutputMeshType::PointType;
62  using OPixelType = typename OMeshTraits::PixelType;
63 
65  using OutputMeshPointer = typename OutputMeshType::Pointer;
66  using CellTraits = typename OutputMeshType::CellTraits;
67  using PointsContainerPointer = typename OutputMeshType::PointsContainerPointer;
68  using PointsContainer = typename OutputMeshType::PointsContainer;
69 
72  using CellInterfaceType = CellInterface< OPixelType, CellTraits >;
73  using TriCellType = TriangleCell< CellInterfaceType >;
74  using TriCellAutoPointer = typename TriCellType::SelfAutoPointer;
75  using CellAutoPointer = typename TriCellType::CellAutoPointer;
76 
79  itkSetMacro(ResolutionX, unsigned int);
80  itkSetMacro(ResolutionY, unsigned int);
82 
83  itkSetMacro(Center, OPointType);
84  itkSetMacro(Scale, OPointType);
85 
86  itkSetMacro(Squareness1, double);
87  itkSetMacro(Squareness2, double);
88 
89 protected:
90  SphereMeshSource();
91  ~SphereMeshSource() override = default;
92  void PrintSelf(std::ostream & os, Indent indent) const override;
93 
94  void GenerateData() override;
95 
97  OPointType m_Center;
98 
100  unsigned int m_ResolutionX;
101  unsigned int m_ResolutionY;
102 
104  OPointType m_Scale;
105