18#ifndef itkMeshFileWriter_h
19#define itkMeshFileWriter_h
51template <
typename TInputMesh>
78 using Superclass::SetInput;
89 itkSetStringMacro(FileName);
90 itkGetStringMacro(FileName);
105 if (this->m_MeshIO != io)
110 m_FactorySpecifiedMeshIO =
false;
111 m_UserSpecifiedMeshIO =
true;
119 m_FileTypeIsBINARY =
false;
124 m_FileTypeIsBINARY =
true;
142 itkSetMacro(UseCompression,
bool);
143 itkGetConstReferenceMacro(UseCompression,
bool);
144 itkBooleanMacro(UseCompression);
153 template <
typename Output>
157 template <
typename Output>
161 template <
typename Output>
165 template <
typename Output>
182 std::string m_FileName{};
184 bool m_UserSpecifiedMeshIO{
false };
185 bool m_FactorySpecifiedMeshIO{
false };
186 bool m_UseCompression{
false };
187 bool m_FileTypeIsBINARY{
false };
195template <
typename TMeshPo
inter>
196ITK_TEMPLATE_EXPORT
void
197WriteMesh(TMeshPointer && mesh,
const std::string & filename,
bool compress =
false)
199 using NonReferenceMeshPointer = std::remove_reference_t<TMeshPointer>;
200 static_assert(std::is_pointer_v<NonReferenceMeshPointer> || mpl::IsSmartPointer<NonReferenceMeshPointer>::Value,
201 "WriteMesh requires a raw pointer or SmartPointer.");
204 using MeshType = std::remove_const_t<std::remove_reference_t<
decltype(*mesh)>>;
206 writer->SetInput(mesh);
207 writer->SetFileName(filename);
208 writer->SetUseCompression(compress);
214#ifndef ITK_MANUAL_INSTANTIATION
215# include "itkMeshFileWriter.hxx"
218#if defined ITK_MESHIO_FACTORY_REGISTER_MANAGER || defined ITK_IO_FACTORY_REGISTER_MANAGER
219# include "itkMeshIOFactoryRegisterManager.h"
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Writes mesh data to a single file.
void SetFileTypeAsASCII()
typename InputMeshType::Pointer InputMeshPointer
typename MeshIOBase::SizeValueType SizeValueType
void SetInput(const InputMeshType *input)
const InputMeshType * GetInput()
void CopyPointDataToBuffer(Output *data)
void CopyPointsToBuffer(Output *data)
void SetFileTypeAsBINARY()
~MeshFileWriter() override=default
const InputMeshType * GetInput(unsigned int idx)
void PrintSelf(std::ostream &os, Indent indent) const override
void CopyCellDataToBuffer(Output *data)
void SetMeshIO(MeshIOBase *io)
typename InputMeshType::RegionType InputMeshRegionType
typename InputMeshType::PixelType InputMeshPixelType
void CopyCellsToBuffer(Output *data)
typename InputMeshType::CellType InputMeshCellType
Abstract superclass defines mesh IO interface.
IdentifierType SizeValueType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITK_TEMPLATE_EXPORT void WriteMesh(TMeshPointer &&mesh, const std::string &filename, bool compress=false)
class ITK_FORWARD_EXPORT ProcessObject