ITK  4.8.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 RegularSphereMeshSource:public MeshSource< TOutputMesh >
42 {
43 public:
49 
51  itkNewMacro(Self);
52 
55 
57  typedef TOutputMesh OutputMeshType;
58  typedef typename OutputMeshType::MeshTraits MeshTraits;
59  typedef typename OutputMeshType::PointType PointType;
60  typedef typename MeshTraits::PixelType PixelType;
61  typedef typename PointType::VectorType VectorType;
62 
64  typedef typename OutputMeshType::Pointer OutputMeshPointer;
65  typedef typename OutputMeshType::CellTraits CellTraits;
66  typedef typename OutputMeshType::PointsContainerPointer PointsContainerPointer;
67  typedef typename OutputMeshType::PointsContainer PointsContainer;
68 
72  typedef typename TriCellType::SelfAutoPointer TriCellAutoPointer;
73  typedef typename TriCellType::CellAutoPointer CellAutoPointer;
74 
75  typedef std::pair< IdentifierType, IdentifierType > IndexPairType;
77 
80  itkSetMacro(Resolution, unsigned int);
81  itkGetConstMacro(Resolution, unsigned int);
83 
85  itkSetMacro(Center, PointType);
86  itkGetConstMacro(Center, PointType);
88 
92  itkSetMacro(Scale, VectorType);
93  itkGetConstMacro(Scale, VectorType);
95 
96 protected:
99  void PrintSelf(std::ostream & os, itk::Indent indent) const ITK_OVERRIDE;
100 
101  void GenerateData() ITK_OVERRIDE;
102 
103  PointType Divide(const PointType & p1, const PointType & p2) const;
104 
105  void AddCell(OutputMeshType *mesh, const typename OutputMeshType::PointIdentifier *pointIds, IdentifierType idx);
106 
109 
111  unsigned int m_Resolution;
112 
115 
116 private:
117  RegularSphereMeshSource(const Self &); //purposely not implemented
118  void operator=(const Self &); //purposely not implemented
119 };
120 } // end namespace itk
121 
122 #ifndef ITK_MANUAL_INSTANTIATION
123 #include "itkRegularSphereMeshSource.hxx"
124 #endif
125 
126 #endif //_itkRegularSphereMeshSource_h
OutputMeshType::MeshTraits MeshTraits
Light weight base class for most itk classes.
TriCellType::SelfAutoPointer TriCellAutoPointer
OutputMeshType::PointsContainerPointer PointsContainerPointer
A wrapper of the STL &quot;map&quot; container.
OutputMeshType::PointsContainer PointsContainer
void GenerateData() override
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 ...
PointType Divide(const PointType &p1, const PointType &p2) const
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
TriCellType::CellAutoPointer CellAutoPointer
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
void PrintSelf(std::ostream &os, itk::Indent indent) const override
OutputMeshType::PointType PointType
itk::SmartPointer< const Self > ConstPointer
itk::TriangleCell< CellInterfaceType > TriCellType
OutputMeshType::CellTraits CellTraits
itk::MeshSource< TOutputMesh > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MapContainer< IndexPairType, IdentifierType > PointMapType
itk::CellInterface< PixelType, CellTraits > CellInterfaceType
OutputMeshType::Pointer OutputMeshPointer
void AddCell(OutputMeshType *mesh, const typename OutputMeshType::PointIdentifier *pointIds, IdentifierType idx)