VTK: IO/ExportGL2PS/vtkGL2PSExporter.h Source File

| VTK 9.3.1

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
76 VTK_ABI_NAMESPACE_BEGIN
77 class vtkPropCollection;
78
79 class VTKIOEXPORTGL2PS_EXPORT vtkGL2PSExporter : public vtkExporter
80 {
81 public:
82 static vtkGL2PSExporter* New();
83 vtkTypeMacro(vtkGL2PSExporter, vtkExporter);
84 void PrintSelf(ostream& os, vtkIndent indent) override;
85
87
92 vtkSetFilePathMacro(FilePrefix);
93 vtkGetFilePathMacro(FilePrefix);
95
97
105 vtkSetMacro(BufferSize, int);
106 vtkGetMacro(BufferSize, int);
108
110
114 vtkSetStringMacro(Title);
115 vtkGetStringMacro(Title);
117
118 enum OutputFormat
119 {
120 PS_FILE,
121 EPS_FILE,
122 PDF_FILE,
123 TEX_FILE,
124 SVG_FILE
125 };
126
128
135 void UsePainterSettings()
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
159 enum SortScheme
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
311 void SetRasterExclusions(vtkPropCollection*);
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
333 protected:
334 vtkGL2PSExporter();
335 ~vtkGL2PSExporter() override;
336
337 int GetGL2PSOptions();
338 int GetGL2PSSort();
339 int GetGL2PSFormat();
340 const char* GetFileExtension();
341
342 vtkPropCollection* RasterExclusions;
343
344 char* FilePrefix;
345 char* Title;
346 int FileFormat;
347 int BufferSize;
348 int Sort;
349 vtkTypeBool Compress;
350 vtkTypeBool DrawBackground;
351 vtkTypeBool SimpleLineOffset;
352 vtkTypeBool Silent;
353 vtkTypeBool BestRoot;
354 vtkTypeBool Text;
355 vtkTypeBool Landscape;
356 vtkTypeBool PS3Shading;
357 vtkTypeBool OcclusionCull;
358 vtkTypeBool Write3DPropsAsRasterImage;
359 bool TextAsPath;
360 float PointSizeFactor;
361 float LineWidthFactor;
362
363 private:
364 vtkGL2PSExporter(const vtkGL2PSExporter&) = delete;
365 void operator=(const vtkGL2PSExporter&) = delete;
366 };
367
368 inline const char* vtkGL2PSExporter::GetSortAsString()
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
384 inline const char* vtkGL2PSExporter::GetFileFormatAsString()
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
408 VTK_ABI_NAMESPACE_END
409 #endif
vtkExporter
abstract class to write a scene to a file
Definition: vtkExporter.h:37
vtkGL2PSExporter
export a scene as a PostScript file using GL2PS.
Definition: vtkGL2PSExporter.h:80
vtkGL2PSExporter::BestRoot
vtkTypeBool BestRoot
Definition: vtkGL2PSExporter.h:353
vtkGL2PSExporter::GetGL2PSSort
int GetGL2PSSort()
vtkGL2PSExporter::BufferSize
int BufferSize
Definition: vtkGL2PSExporter.h:347
vtkGL2PSExporter::vtkGL2PSExporter
vtkGL2PSExporter()
vtkGL2PSExporter::~vtkGL2PSExporter
~vtkGL2PSExporter() override
vtkGL2PSExporter::PS3Shading
vtkTypeBool PS3Shading
Definition: vtkGL2PSExporter.h:356
vtkGL2PSExporter::DrawBackground
vtkTypeBool DrawBackground
Definition: vtkGL2PSExporter.h:350
vtkGL2PSExporter::Silent
vtkTypeBool Silent
Definition: vtkGL2PSExporter.h:352
vtkGL2PSExporter::SetSortToBSP
void SetSortToBSP()
Set the type of sorting algorithm to order primitives from back to front.
Definition: vtkGL2PSExporter.h:176
vtkGL2PSExporter::SetFileFormatToSVG
void SetFileFormatToSVG()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:155
vtkGL2PSExporter::GetGL2PSFormat
int GetGL2PSFormat()
vtkGL2PSExporter::GetFileExtension
const char * GetFileExtension()
vtkGL2PSExporter::SetFileFormatToPS
void SetFileFormatToPS()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:151
vtkGL2PSExporter::TextAsPath
bool TextAsPath
Definition: vtkGL2PSExporter.h:359
vtkGL2PSExporter::vtkSetFilePathMacro
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkGL2PSExporter::FilePrefix
char * FilePrefix
Definition: vtkGL2PSExporter.h:344
vtkGL2PSExporter::RasterExclusions
vtkPropCollection * RasterExclusions
Definition: vtkGL2PSExporter.h:342
vtkGL2PSExporter::SortScheme
SortScheme
Definition: vtkGL2PSExporter.h:160
vtkGL2PSExporter::SIMPLE_SORT
@ SIMPLE_SORT
Definition: vtkGL2PSExporter.h:162
vtkGL2PSExporter::NO_SORT
@ NO_SORT
Definition: vtkGL2PSExporter.h:161
vtkGL2PSExporter::New
static vtkGL2PSExporter * New()
vtkGL2PSExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGL2PSExporter::vtkGetFilePathMacro
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
vtkGL2PSExporter::SetSortToOff
void SetSortToOff()
Set the type of sorting algorithm to order primitives from back to front.
Definition: vtkGL2PSExporter.h:174
vtkGL2PSExporter::Text
vtkTypeBool Text
Definition: vtkGL2PSExporter.h:354
vtkGL2PSExporter::SetRasterExclusions
void SetRasterExclusions(vtkPropCollection *)
Collection of props to exclude from rasterization.
vtkGL2PSExporter::Landscape
vtkTypeBool Landscape
Definition: vtkGL2PSExporter.h:355
vtkGL2PSExporter::SetFileFormatToTeX
void SetFileFormatToTeX()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:154
vtkGL2PSExporter::SimpleLineOffset
vtkTypeBool SimpleLineOffset
Definition: vtkGL2PSExporter.h:351
vtkGL2PSExporter::Sort
int Sort
Definition: vtkGL2PSExporter.h:348
vtkGL2PSExporter::LineWidthFactor
float LineWidthFactor
Definition: vtkGL2PSExporter.h:361
vtkGL2PSExporter::Compress
vtkTypeBool Compress
Definition: vtkGL2PSExporter.h:349
vtkGL2PSExporter::FileFormat
int FileFormat
Definition: vtkGL2PSExporter.h:346
vtkGL2PSExporter::GetFileFormatAsString
const char * GetFileFormatAsString()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:384
vtkGL2PSExporter::UsePainterSettings
void UsePainterSettings()
Configure the exporter to expect a painter-ordered 2D rendering, that is, a rendering at a fixed dept...
Definition: vtkGL2PSExporter.h:135
vtkGL2PSExporter::Title
char * Title
Definition: vtkGL2PSExporter.h:345
vtkGL2PSExporter::SetFileFormatToPDF
void SetFileFormatToPDF()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:153
vtkGL2PSExporter::OcclusionCull
vtkTypeBool OcclusionCull
Definition: vtkGL2PSExporter.h:357
vtkGL2PSExporter::SetSortToSimple
void SetSortToSimple()
Set the type of sorting algorithm to order primitives from back to front.
Definition: vtkGL2PSExporter.h:175
vtkGL2PSExporter::GetSortAsString
const char * GetSortAsString()
Set the type of sorting algorithm to order primitives from back to front.
Definition: vtkGL2PSExporter.h:368
vtkGL2PSExporter::GetGL2PSOptions
int GetGL2PSOptions()
vtkGL2PSExporter::Write3DPropsAsRasterImage
vtkTypeBool Write3DPropsAsRasterImage
Definition: vtkGL2PSExporter.h:358
vtkGL2PSExporter::OutputFormat
OutputFormat
Definition: vtkGL2PSExporter.h:119
vtkGL2PSExporter::PDF_FILE
@ PDF_FILE
Definition: vtkGL2PSExporter.h:122
vtkGL2PSExporter::TEX_FILE
@ TEX_FILE
Definition: vtkGL2PSExporter.h:123
vtkGL2PSExporter::PS_FILE
@ PS_FILE
Definition: vtkGL2PSExporter.h:120
vtkGL2PSExporter::EPS_FILE
@ EPS_FILE
Definition: vtkGL2PSExporter.h:121
vtkGL2PSExporter::SetFileFormatToEPS
void SetFileFormatToEPS()
Specify the format of file to write out.
Definition: vtkGL2PSExporter.h:152
vtkGL2PSExporter::PointSizeFactor
float PointSizeFactor
Definition: vtkGL2PSExporter.h:360
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:37
vtkBlockSortHelper::Sort
void Sort(RandomIt bitr, RandomIt eitr, BackToFront< T > &me)
Definition: vtkBlockSortHelper.h:291
vtkX3D::Text
@ Text
Definition: vtkX3D.h:160
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkExporter.h
vtkNew.h