VTK  9.3.20240424
vtkGL2PSExporter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
68#ifndef vtkGL2PSExporter_h
69#define vtkGL2PSExporter_h
70
71#include "vtkExporter.h"
72#include "vtkIOExportGL2PSModule.h" // For export macro
73
74#include "vtkNew.h" // For vtkNew
75
76VTK_ABI_NAMESPACE_BEGIN
78
79class VTKIOEXPORTGL2PS_EXPORT vtkGL2PSExporter : public vtkExporter
80{
81public:
84 void PrintSelf(ostream& os, vtkIndent indent) override;
85
87
95
97
105 vtkSetMacro(BufferSize, int);
106 vtkGetMacro(BufferSize, int);
108
110
114 vtkSetStringMacro(Title);
115 vtkGetStringMacro(Title);
117
119 {
124 SVG_FILE
125 };
126
128
136 {
137 this->SetSortToOff();
138 this->SetSimpleLineOffset(0);
139 }
141
143
149 vtkSetClampMacro(FileFormat, int, PS_FILE, SVG_FILE);
150 vtkGetMacro(FileFormat, int);
151 void SetFileFormatToPS() { this->SetFileFormat(PS_FILE); }
152 void SetFileFormatToEPS() { this->SetFileFormat(EPS_FILE); }
153 void SetFileFormatToPDF() { this->SetFileFormat(PDF_FILE); }
154 void SetFileFormatToTeX() { this->SetFileFormat(TEX_FILE); }
155 void SetFileFormatToSVG() { this->SetFileFormat(SVG_FILE); }
156 const char* GetFileFormatAsString();
158
160 {
161 NO_SORT = 0,
162 SIMPLE_SORT = 1,
163 BSP_SORT = 2
164 };
165
167
172 vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
173 vtkGetMacro(Sort, int);
174 void SetSortToOff() { this->SetSort(NO_SORT); }
175 void SetSortToSimple() { this->SetSort(SIMPLE_SORT); }
176 void SetSortToBSP() { this->SetSort(BSP_SORT); }
177 const char* GetSortAsString();
179
181
185 vtkSetMacro(Compress, vtkTypeBool);
186 vtkGetMacro(Compress, vtkTypeBool);
187 vtkBooleanMacro(Compress, vtkTypeBool);
189
191
196 vtkSetMacro(DrawBackground, vtkTypeBool);
197 vtkGetMacro(DrawBackground, vtkTypeBool);
198 vtkBooleanMacro(DrawBackground, vtkTypeBool);
200
202
208 vtkSetMacro(SimpleLineOffset, vtkTypeBool);
209 vtkGetMacro(SimpleLineOffset, vtkTypeBool);
210 vtkBooleanMacro(SimpleLineOffset, vtkTypeBool);
212
214
218 vtkSetMacro(Silent, vtkTypeBool);
219 vtkGetMacro(Silent, vtkTypeBool);
220 vtkBooleanMacro(Silent, vtkTypeBool);
222
224
230 vtkSetMacro(BestRoot, vtkTypeBool);
231 vtkGetMacro(BestRoot, vtkTypeBool);
232 vtkBooleanMacro(BestRoot, vtkTypeBool);
234
236
242 vtkSetMacro(Text, vtkTypeBool);
243 vtkGetMacro(Text, vtkTypeBool);
244 vtkBooleanMacro(Text, vtkTypeBool);
246
248
252 vtkSetMacro(Landscape, vtkTypeBool);
253 vtkGetMacro(Landscape, vtkTypeBool);
254 vtkBooleanMacro(Landscape, vtkTypeBool);
256
258
263 vtkSetMacro(PS3Shading, vtkTypeBool);
264 vtkGetMacro(PS3Shading, vtkTypeBool);
265 vtkBooleanMacro(PS3Shading, vtkTypeBool);
267
269
274 vtkSetMacro(OcclusionCull, vtkTypeBool);
275 vtkGetMacro(OcclusionCull, vtkTypeBool);
276 vtkBooleanMacro(OcclusionCull, vtkTypeBool);
278
280
288 vtkSetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
289 vtkGetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
290 vtkBooleanMacro(Write3DPropsAsRasterImage, vtkTypeBool);
292
294
299 vtkSetMacro(TextAsPath, bool);
300 vtkGetMacro(TextAsPath, bool);
301 vtkBooleanMacro(TextAsPath, bool);
303
305
312 vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
314
316
320 vtkSetMacro(PointSizeFactor, float);
321 vtkGetMacro(PointSizeFactor, float);
323
325
329 vtkSetMacro(LineWidthFactor, float);
330 vtkGetMacro(LineWidthFactor, float);
332
333protected:
336
340 const char* GetFileExtension();
341
343
345 char* Title;
348 int Sort;
362
363private:
364 vtkGL2PSExporter(const vtkGL2PSExporter&) = delete;
365 void operator=(const vtkGL2PSExporter&) = delete;
366};
367
369{
370 if (this->Sort == NO_SORT)
371 {
372 return "Off";
373 }
374 else if (this->Sort == SIMPLE_SORT)
375 {
376 return "Simple";
377 }
378 else
379 {
380 return "BSP";
381 }
382}
383
385{
386 if (this->FileFormat == PS_FILE)
387 {
388 return "PS";
389 }
390 else if (this->FileFormat == EPS_FILE)
391 {
392 return "EPS";
393 }
394 else if (this->FileFormat == PDF_FILE)
395 {
396 return "PDF";
397 }
398 else if (this->FileFormat == TEX_FILE)
399 {
400 return "TeX";
401 }
402 else
403 {
404 return "SVG";
405 }
406}
407
408VTK_ABI_NAMESPACE_END
409#endif
abstract class to write a scene to a file
Definition vtkExporter.h:37
export a scene as a PostScript file using GL2PS.
~vtkGL2PSExporter() override
vtkTypeBool DrawBackground
void SetSortToBSP()
Set the type of sorting algorithm to order primitives from back to front.
void SetFileFormatToSVG()
Specify the format of file to write out.
void SetFileFormatToPS()
Specify the format of file to write out.
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkPropCollection * RasterExclusions
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void SetSortToOff()
Set the type of sorting algorithm to order primitives from back to front.
void SetRasterExclusions(vtkPropCollection *)
Collection of props to exclude from rasterization.
void SetFileFormatToTeX()
Specify the format of file to write out.
vtkTypeBool SimpleLineOffset
static vtkGL2PSExporter * New()
const char * GetFileFormatAsString()
Specify the format of file to write out.
void UsePainterSettings()
Configure the exporter to expect a painter-ordered 2D rendering, that is, a rendering at a fixed dept...
const char * GetFileExtension()
void SetFileFormatToPDF()
Specify the format of file to write out.
vtkTypeBool OcclusionCull
void SetSortToSimple()
Set the type of sorting algorithm to order primitives from back to front.
const char * GetSortAsString()
Set the type of sorting algorithm to order primitives from back to front.
vtkTypeBool Write3DPropsAsRasterImage
void SetFileFormatToEPS()
Specify the format of file to write out.
a simple class to control print indentation
Definition vtkIndent.h:108
an ordered list of Props
int vtkTypeBool
Definition vtkABI.h:64