ITK  5.3.0
Insight Toolkit
itkVTKPolyDataWriter.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  * 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 itkVTKPolyDataWriter_h
19 #define itkVTKPolyDataWriter_h
20 
21 #include "itkIntTypes.h"
22 #include "itkMesh.h"
23 #include "itkTriangleCell.h"
24 
25 namespace itk
26 {
45 template <typename TInputMesh>
46 class ITK_TEMPLATE_EXPORT VTKPolyDataWriter : public Object
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(VTKPolyDataWriter);
50 
53  using Superclass = Object;
56 
58  itkNewMacro(Self);
59 
61  itkTypeMacro(VTKPolyDataWriter, Object);
62 
65  void
66  Update();
67 
68  void
69  Write();
70 
73  using InputMeshType = TInputMesh;
74  using PixelType = typename InputMeshType::PixelType;
76  using CellType = typename InputMeshType::CellType;
77  using PointIdentifier = typename InputMeshType::PointIdentifier;
78 
80  using InputMeshPointer = typename InputMeshType::ConstPointer;
81  using CellTraits = typename InputMeshType::CellTraits;
82 
86 
87  using PointsContainer = typename InputMeshType::PointsContainer;
88  using CellsContainer = typename InputMeshType::CellsContainer;
89 
90  using PointIterator = typename PointsContainer::ConstIterator;
91  using CellIterator = typename CellsContainer::ConstIterator;
92 
93  using PointIdIterator = typename CellType::PointIdIterator;
94 
96  void
97  SetInput(const InputMeshType * input);
98 
100  itkSetStringMacro(FileName);
101  itkGetStringMacro(FileName);
103 
104 protected:
106  ~VTKPolyDataWriter() override = default;
107 
108  virtual void
109  GenerateData();
110 
111  std::string m_FileName;
112 
114 
115  void
116  PrintSelf(std::ostream & os, Indent indent) const override;
117 };
118 } // namespace itk
119 
120 #ifndef ITK_MANUAL_INSTANTIATION
121 # include "itkVTKPolyDataWriter.hxx"
122 #endif
123 
124 #endif
itk::VTKPolyDataWriter< TMesh >::PointIdIterator
typename CellType::PointIdIterator PointIdIterator
Definition: itkVTKPolyDataWriter.h:93
itk::VTKPolyDataWriter< TMesh >::InputMeshPointer
typename InputMeshType::ConstPointer InputMeshPointer
Definition: itkVTKPolyDataWriter.h:80
itk::VTKPolyDataWriter< TMesh >::PointIterator
typename PointsContainer::ConstIterator PointIterator
Definition: itkVTKPolyDataWriter.h:90
itk::VTKPolyDataWriter::m_Input
InputMeshPointer m_Input
Definition: itkVTKPolyDataWriter.h:113
itk::VTKPolyDataWriter< TMesh >::PointType
typename InputMeshType::PointType PointType
Definition: itkVTKPolyDataWriter.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::VTKPolyDataWriter< TMesh >::PixelType
typename InputMeshType::PixelType PixelType
Definition: itkVTKPolyDataWriter.h:74
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::VTKPolyDataWriter::m_FileName
std::string m_FileName
Definition: itkVTKPolyDataWriter.h:111
itkMesh.h
itk::VTKPolyDataWriter< TMesh >::InputMeshType
TMesh InputMeshType
Definition: itkVTKPolyDataWriter.h:73
itk::TriangleCell
Definition: itkTriangleCell.h:45
itkIntTypes.h
itk::VTKPolyDataWriter< TMesh >::PointsContainer
typename InputMeshType::PointsContainer PointsContainer
Definition: itkVTKPolyDataWriter.h:87
itk::CellInterface
An abstract interface for cells.
Definition: itkCellInterface.h:96
itk::VTKPolyDataWriter< TMesh >::CellTraits
typename InputMeshType::CellTraits CellTraits
Definition: itkVTKPolyDataWriter.h:81
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::VTKPolyDataWriter< TMesh >::CellsContainer
typename InputMeshType::CellsContainer CellsContainer
Definition: itkVTKPolyDataWriter.h:88
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::VTKPolyDataWriter< TMesh >::PointIdentifier
typename InputMeshType::PointIdentifier PointIdentifier
Definition: itkVTKPolyDataWriter.h:77
itk::VTKPolyDataWriter< TMesh >::CellIterator
typename CellsContainer::ConstIterator CellIterator
Definition: itkVTKPolyDataWriter.h:91
itkTriangleCell.h
itk::VTKPolyDataWriter< TMesh >::CellType
typename InputMeshType::CellType CellType
Definition: itkVTKPolyDataWriter.h:76
itk::VTKPolyDataWriter
Writes an itkMesh to a file in VTK file format.
Definition: itkVTKPolyDataWriter.h:46