18 #ifndef itkMeshFileWriter_h
19 #define itkMeshFileWriter_h
51 template <
typename TInputMesh>
78 using Superclass::SetInput;
86 GetInput(
unsigned int idx);
89 itkSetStringMacro(FileName);
90 itkGetStringMacro(FileName);
105 if (this->m_MeshIO != io)
110 m_FactorySpecifiedMeshIO =
false;
111 m_UserSpecifiedMeshIO =
true;
113 itkGetModifiableObjectMacro(MeshIO,
MeshIOBase);
119 m_FileTypeIsBINARY =
false;
124 m_FileTypeIsBINARY =
true;
142 itkSetMacro(UseCompression,
bool);
143 itkGetConstReferenceMacro(UseCompression,
bool);
144 itkBooleanMacro(UseCompression);
151 PrintSelf(std::ostream & os,
Indent indent)
const override;
153 template <
typename Output>
155 CopyPointsToBuffer(Output * data);
157 template <
typename Output>
159 CopyCellsToBuffer(Output * data);
161 template <
typename Output>
163 CopyPointDataToBuffer(Output * data);
165 template <
typename Output>
167 CopyCellDataToBuffer(Output * data);
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 };
195 template <
typename TMeshPo
inter>
196 ITK_TEMPLATE_EXPORT
void
197 WriteMesh(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"
222 #endif // itkMeshFileWriter_h