OGS
VtkFilterFactory.cpp
Go to the documentation of this file.
1
15// ** INCLUDES **
16#include "VtkFilterFactory.h"
17
18#include <vtkDataSetSurfaceFilter.h>
19
34
35QVector<VtkFilterInfo> VtkFilterFactory::GetFilterList()
36{
37 QVector<VtkFilterInfo> filterList;
38
39 // Composite filters
40 filterList.push_back(VtkFilterInfo("VtkCompositeImageToCylindersFilter",
41 "Image to bar chart",
42 "This filter converts the red pixel "
43 "values of the image into a bar graph.",
44 VTK_IMAGE_DATA, VTK_POLY_DATA));
45
46 filterList.push_back(
47 VtkFilterInfo("VtkCompositePointToGlyphFilter", "Points to spheres",
48 "This filter generates spheres on point data that can be "
49 "scaled and colored by scalar data.",
50 VTK_POLY_DATA, VTK_POLY_DATA));
51
52 filterList.push_back(
53 VtkFilterInfo("VtkCompositeLineToTubeFilter", "Lines to tubes",
54 "This filter will convert lines to tubes that can be "
55 "colored by scalar data.",
56 VTK_POLY_DATA, VTK_POLY_DATA));
57
58 filterList.push_back(VtkFilterInfo(
59 "VtkCompositeColormapToImageFilter", "Apply lookup table to image",
60 "This filter will take an input image of any valid scalar type, and "
61 "map the first component of the image through a lookup table.",
62 VTK_IMAGE_DATA, VTK_IMAGE_DATA));
63
64 filterList.push_back(VtkFilterInfo(
65 "VtkCompositeTextureOnSurfaceFilter", "Apply texture to surface",
66 "This filter assigns an image or raster file as a texture for the "
67 "given surface.",
68 VTK_POINT_SET, VTK_POLY_DATA));
69
70 filterList.push_back(VtkFilterInfo(
71 "VtkCompositeThresholdFilter", "Extract cells by threshold",
72 "This filter extracts cells from any dataset type that satisfy a "
73 "threshold criterion. A cell satisfies the criterion if the (first) "
74 "scalar value of (every or any) point satisfies the criterion. For "
75 "example this can be used to show only certain material groups in a "
76 "mesh.",
77 VTK_POINT_SET, VTK_UNSTRUCTURED_GRID));
78
79 filterList.push_back(VtkFilterInfo(
80 "VtkCompositeColorByHeightFilter", "Elevation-based colouring",
81 "This filter will generate scalar values based on the elevation of "
82 "each point in the dataset.",
83 VTK_POINT_SET, VTK_POLY_DATA));
84
85 filterList.push_back(VtkFilterInfo(
86 "VtkCompositeContourFilter", "Generate contours based on scalar fields",
87 "Visualisation of contour-lines/-planes within dense scalar fields.",
88 VTK_UNSTRUCTURED_GRID, VTK_UNSTRUCTURED_GRID));
89
90 filterList.push_back(VtkFilterInfo(
91 "VtkCompositeImageToPointCloudFilter", "Image to point cloud",
92 "This filter creates a point cloud with a density based on the first "
93 "component of pixel values.",
94 VTK_IMAGE_DATA, VTK_POLY_DATA));
95
96 filterList.push_back(VtkFilterInfo(
97 "VtkCompositeImageToSurfacePointsFilter", "Image to surface points",
98 "This filter creates a point cloud representing a surface based on the "
99 "first component of pixel values.",
100 VTK_IMAGE_DATA, VTK_POLY_DATA));
101
102 // Simple filters
103 filterList.push_back(VtkFilterInfo(
104 "VtkImageDataToLinePolyDataFilter", "Image to vertical lines",
105 "This filter converts the red pixel values of the image to lines with "
106 "length of the value.",
107 VTK_IMAGE_DATA, VTK_POLY_DATA));
108
109 // Standard VTK filter without properties
110 filterList.push_back(VtkFilterInfo("vtkDataSetSurfaceFilter",
111 "Surface filter",
112 "Extracts outer (polygonal) surface.",
113 VTK_UNSTRUCTURED_GRID, VTK_POLY_DATA));
114
115 // filterList.push_back(VtkFilterInfo(
116 // "VtkCompositeSelectionFilter",
117 // "Mesh Quality Filter",
118 // "This filter calculates the quality of meshes and highlights
119 // deformed elements.", VTK_UNSTRUCTURED_GRID,
120 // VTK_UNSTRUCTURED_GRID));
121
122 return filterList;
123}
124
126 QString type, vtkAlgorithm* inputAlgorithm)
127{
128 if (type.compare(QString("VtkCompositeImageToCylindersFilter")) == 0)
129 {
130 return new VtkCompositeImageToCylindersFilter(inputAlgorithm);
131 }
132 if (type.compare(QString("VtkCompositePointToGlyphFilter")) == 0)
133 {
134 return new VtkCompositePointToGlyphFilter(inputAlgorithm);
135 }
136 if (type.compare(QString("VtkCompositeLineToTubeFilter")) == 0)
137 {
138 return new VtkCompositeLineToTubeFilter(inputAlgorithm);
139 }
140 if (type.compare(QString("VtkCompositeColormapToImageFilter")) == 0)
141 {
142 return new VtkCompositeColormapToImageFilter(inputAlgorithm);
143 }
144 if (type.compare(QString("VtkCompositeTextureOnSurfaceFilter")) == 0)
145 {
146 return new VtkCompositeTextureOnSurfaceFilter(inputAlgorithm);
147 }
148 if (type.compare(QString("VtkCompositeThresholdFilter")) == 0)
149 {
150 return new VtkCompositeThresholdFilter(inputAlgorithm);
151 }
152 if (type.compare(QString("VtkCompositeColorByHeightFilter")) == 0)
153 {
154 return new VtkCompositeColorByHeightFilter(inputAlgorithm);
155 }
156 if (type.compare(QString("VtkCompositeElementSelectionFilter")) == 0)
157 {
158 return new VtkCompositeElementSelectionFilter(inputAlgorithm);
159 }
160 if (type.compare(QString("VtkCompositeNodeSelectionFilter")) == 0)
161 {
162 return new VtkCompositeNodeSelectionFilter(inputAlgorithm);
163 }
164 if (type.compare(QString("VtkCompositeContourFilter")) == 0)
165 {
166 return new VtkCompositeContourFilter(inputAlgorithm);
167 }
168 if (type.compare(QString("VtkCompositeGeoObjectFilter")) == 0)
169 {
170 return new VtkCompositeGeoObjectFilter(inputAlgorithm);
171 }
172 if (type.compare(QString("VtkCompositeImageToPointCloudFilter")) == 0)
173 {
174 return new VtkCompositeImageToPointCloudFilter(inputAlgorithm);
175 }
176 if (type.compare(QString("VtkCompositeImageToSurfacePointsFilter")) == 0)
177 {
178 return new VtkCompositeImageToSurfacePointsFilter(inputAlgorithm);
179 }
180
181 return nullptr;
182}
183
184vtkAlgorithm* VtkFilterFactory::CreateSimpleFilter(QString type)
185{
186 if (type.compare(QString("VtkImageDataToLinePolyDataFilter")) == 0)
187 {
189 }
190 if (type.compare(QString("vtkDataSetSurfaceFilter")) == 0)
191 {
192 return vtkDataSetSurfaceFilter::New();
193 }
194
195 return nullptr;
196}
Definition of the VtkCompositeColorByHeightFilter class.
Definition of the VtkCompositeColormapToImageFilter class.
Definition of the VtkCompositeContourFilter class.
Definition of the VtkCompositeSelectionFilter class.
Definition of the VtkCompositeGeoObjectFilter class.
Definition of the VtkCompositeImageToCylindersFilter class.
Definition of the VtkCompositeLineToTubeFilter class.
Definition of the VtkCompositeNodeSelectionFilter class.
Definition of the VtkCompositePointToGlyphFilter class.
Definition of the VtkCompositeTextureOnSurfaceFilter class.
Definition of the VtkCompositeThresholdFilter class.
Definition of the VtkFilterFactory class.
Definition of the VtkImageDataToLinePolyDataFilter class.
This filter colors the input by the points z-value.
Applies a user adjustable color map to an image.
Visualisation of contour-lines/-planes within dense scalar fields. In init() the threshold is first s...
This filter selects/thresholds elements based on the selected array.
Is used to combine several filter in one VtkVisPipelineItem. You can use vtk filter and custom filter...
Highlights a single GeoObject.
Creates cylinders that stand on top of the image with the length of the corresponding first sub-pixel...
Converts lines to tube-objects.
This filter displays the points/nodes given in the index field as spheres.
Converts point data to scalar-scaled spheres.
Puts a texture on an object (and converts it into a vtkPolyData if necessary).
Visualises only parts of meshes that are above/below/within given thresholds. In init() the threshold...
static QVector< VtkFilterInfo > GetFilterList()
Returns all registered filters. New VtkCompositeFilter or filter inherited from VtkAlgorithmPropertie...
static VtkCompositeFilter * CreateCompositeFilter(QString type, vtkAlgorithm *inputAlgorithm)
Creates a composite filter by name.
static vtkAlgorithm * CreateSimpleFilter(QString type)
Creates a normal filter name.
static VtkImageDataToLinePolyDataFilter * New()
Create new objects with New() because of VTKs reference counting.
Holds meta information about a filter.