MCPcopy Create free account
hub / github.com/Kitware/VTK / WriteData

Method WriteData

IO/Legacy/vtkDataSetWriter.cxx:24–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22vtkStandardNewMacro(vtkDataSetWriter);
23
24void vtkDataSetWriter::WriteData()
25{
26 int type;
27 vtkDataWriter* writer;
28 vtkAlgorithmOutput* input = this->GetInputConnection(0, 0);
29
30 vtkDebugMacro(<< "Writing vtk dataset...");
31
32 type = this->GetInput()->GetDataObjectType();
33 if (type == VTK_POLY_DATA)
34 {
35 vtkPolyDataWriter* pwriter = vtkPolyDataWriter::New();
36 pwriter->SetInputConnection(input);
37 writer = pwriter;
38 }
39
40 else if (type == VTK_STRUCTURED_POINTS || type == VTK_IMAGE_DATA || type == VTK_UNIFORM_GRID)
41 {
42 vtkStructuredPointsWriter* spwriter = vtkStructuredPointsWriter::New();
43 spwriter->SetInputConnection(input);
44 writer = spwriter;
45 }
46
47 else if (type == VTK_STRUCTURED_GRID)
48 {
49 vtkStructuredGridWriter* sgwriter = vtkStructuredGridWriter::New();
50 sgwriter->SetInputConnection(input);
51 writer = sgwriter;
52 }
53
54 else if (type == VTK_UNSTRUCTURED_GRID)
55 {
56 vtkUnstructuredGridWriter* ugwriter = vtkUnstructuredGridWriter::New();
57 ugwriter->SetInputConnection(input);
58 writer = ugwriter;
59 }
60
61 else if (type == VTK_RECTILINEAR_GRID)
62 {
63 vtkRectilinearGridWriter* rgwriter = vtkRectilinearGridWriter::New();
64 rgwriter->SetInputConnection(input);
65 writer = rgwriter;
66 }
67
68 else
69 {
70 vtkErrorMacro(<< "Cannot write dataset type: " << type);
71 return;
72 }
73
74 writer->SetFileName(this->FileName);
75 writer->SetScalarsName(this->ScalarsName);
76 writer->SetVectorsName(this->VectorsName);
77 writer->SetNormalsName(this->NormalsName);
78 writer->SetTensorsName(this->TensorsName);
79 writer->SetTCoordsName(this->TCoordsName);
80 writer->SetHeader(this->Header);
81 writer->SetLookupTableName(this->LookupTableName);

Callers

nothing calls this directly

Calls 13

GetInputMethod · 0.95
GetDataObjectTypeMethod · 0.80
SetHeaderMethod · 0.80
SetFileTypeMethod · 0.80
SetFileVersionMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetInputConnectionMethod · 0.45
SetInputConnectionMethod · 0.45
SetFileNameMethod · 0.45
SetDebugMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected