13 #include <vtkErrorCode.h> 24 m_WriterWriteHasReturnValue =
false;
31 m_WriterWriteHasReturnValue =
false;
38 m_WriterWriteHasReturnValue =
true;
50 return "STL Surface (*.stl)";
62 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
68 if (this->CanWriteBaseDataType(data))
70 this->SetInput(data.GetPointer());
84 return "VTK Polydata (*.vtk)";
96 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
102 if (this->CanWriteBaseDataType(data))
104 this->SetInput(data.GetPointer());
118 return "VTK XML Polydata (*.vtp)";
130 return dynamic_cast<mitk::Surface *
>(data.GetPointer()) !=
nullptr;
136 if (this->CanWriteBaseDataType(data))
138 this->SetInput(data.GetPointer());
146 if (vtkWriter->Write() == 0 || vtkWriter->GetErrorCode() != 0)
148 itkExceptionMacro(<<
"Error during surface writing: " 149 << vtkErrorCode::GetStringFromErrorCode(vtkWriter->GetErrorCode()));
156 std::vector<std::string> possibleFileExtensions;
157 possibleFileExtensions.push_back(
".stl");
158 possibleFileExtensions.push_back(
".obj");
159 return possibleFileExtensions;
165 std::vector<std::string> possibleFileExtensions;
166 possibleFileExtensions.push_back(
".vtk");
167 possibleFileExtensions.push_back(
".obj");
168 return possibleFileExtensions;
174 std::vector<std::string> possibleFileExtensions;
175 possibleFileExtensions.push_back(
".vtp");
176 possibleFileExtensions.push_back(
".obj");
177 return possibleFileExtensions;
Class for storing surfaces (vtkPolyData).
bool CanWriteBaseDataType(BaseData::Pointer data) override
const char * GetFileDialogPattern() override
std::vector< std::string > GetPossibleFileExtensions() override
Return the possible file extensions for the data type associated with the writer. ...
VTK-based writer for mitk::Surface.
const char * GetDefaultExtension() override
static void Update(vtkPolyData *)
DataCollection - Class to facilitate loading/accessing structured data.
const char * GetDefaultFilename() override
void ExecuteWrite(VtkWriterType *vtkWriter)
void SetDefaultExtension()
Set the extension to be added to the filename to the default.
void DoWrite(BaseData::Pointer data) override