17 #include <vtkErrorCode.h>
28 m_WriterWriteHasReturnValue =
false;
35 m_WriterWriteHasReturnValue =
false;
42 m_WriterWriteHasReturnValue =
true;
54 return "STL Surface (*.stl)";
66 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
72 if (this->CanWriteBaseDataType(data))
74 this->SetInput(data.GetPointer());
88 return "VTK Polydata (*.vtk)";
100 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
106 if (this->CanWriteBaseDataType(data))
108 this->SetInput(data.GetPointer());
122 return "VTK XML Polydata (*.vtp)";
134 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
140 if (this->CanWriteBaseDataType(data))
142 this->SetInput(data.GetPointer());
150 if (vtkWriter->Write() == 0 || vtkWriter->GetErrorCode() != 0)
152 itkExceptionMacro(<<
"Error during surface writing: "
153 << vtkErrorCode::GetStringFromErrorCode(vtkWriter->GetErrorCode()));
160 std::vector<std::string> possibleFileExtensions;
161 possibleFileExtensions.push_back(
".stl");
162 possibleFileExtensions.push_back(
".obj");
163 return possibleFileExtensions;
169 std::vector<std::string> possibleFileExtensions;
170 possibleFileExtensions.push_back(
".vtk");
171 possibleFileExtensions.push_back(
".obj");
172 return possibleFileExtensions;
178 std::vector<std::string> possibleFileExtensions;
179 possibleFileExtensions.push_back(
".vtp");
180 possibleFileExtensions.push_back(
".obj");
181 return possibleFileExtensions;
virtual std::vector< std::string > GetPossibleFileExtensions() override
Return the possible file extensions for the data type associated with the writer. ...
Class for storing surfaces (vtkPolyData).
virtual const char * GetDefaultFilename() override
VTK-based writer for mitk::Surface.
static void Update(vtkPolyData *)
DataCollection - Class to facilitate loading/accessing structured data.
virtual const char * GetDefaultExtension() override
virtual bool CanWriteBaseDataType(BaseData::Pointer data) override
void ExecuteWrite(VtkWriterType *vtkWriter)
virtual void DoWrite(BaseData::Pointer data) override
void SetDefaultExtension()
Set the extension to be added to the filename to the default.
virtual const char * GetFileDialogPattern() override