VTK  9.0.1
vtkGL2PSExporter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGL2PSExporter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
77 #ifndef vtkGL2PSExporter_h
78 #define vtkGL2PSExporter_h
79 
80 #include "vtkExporter.h"
81 #include "vtkIOExportGL2PSModule.h" // For export macro
82 
83 #include "vtkNew.h" // For vtkNew
84 
85 class vtkPropCollection;
86 
87 class VTKIOEXPORTGL2PS_EXPORT vtkGL2PSExporter : public vtkExporter
88 {
89 public:
90  static vtkGL2PSExporter* New();
91  vtkTypeMacro(vtkGL2PSExporter, vtkExporter);
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
95 
100  vtkSetStringMacro(FilePrefix);
101  vtkGetStringMacro(FilePrefix);
103 
105 
113  vtkSetMacro(BufferSize, int);
114  vtkGetMacro(BufferSize, int);
116 
118 
122  vtkSetStringMacro(Title);
123  vtkGetStringMacro(Title);
125 
127  {
132  SVG_FILE
133  };
134 
136 
144  {
145  this->SetSortToOff();
146  this->SetSimpleLineOffset(0);
147  }
149 
151 
157  vtkSetClampMacro(FileFormat, int, PS_FILE, SVG_FILE);
158  vtkGetMacro(FileFormat, int);
159  void SetFileFormatToPS() { this->SetFileFormat(PS_FILE); }
160  void SetFileFormatToEPS() { this->SetFileFormat(EPS_FILE); }
161  void SetFileFormatToPDF() { this->SetFileFormat(PDF_FILE); }
162  void SetFileFormatToTeX() { this->SetFileFormat(TEX_FILE); }
163  void SetFileFormatToSVG() { this->SetFileFormat(SVG_FILE); }
164  const char* GetFileFormatAsString();
166 
168  {
169  NO_SORT = 0,
170  SIMPLE_SORT = 1,
171  BSP_SORT = 2
172  };
173 
175 
180  vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
181  vtkGetMacro(Sort, int);
182  void SetSortToOff() { this->SetSort(NO_SORT); }
183  void SetSortToSimple() { this->SetSort(SIMPLE_SORT); }
184  void SetSortToBSP() { this->SetSort(BSP_SORT); }
185  const char* GetSortAsString();
187 
189 
193  vtkSetMacro(Compress, vtkTypeBool);
194  vtkGetMacro(Compress, vtkTypeBool);
195  vtkBooleanMacro(Compress, vtkTypeBool);
197 
199 
204  vtkSetMacro(DrawBackground, vtkTypeBool);
205  vtkGetMacro(DrawBackground, vtkTypeBool);
206  vtkBooleanMacro(DrawBackground, vtkTypeBool);
208 
210 
216  vtkSetMacro(SimpleLineOffset, vtkTypeBool);
217  vtkGetMacro(SimpleLineOffset, vtkTypeBool);
218  vtkBooleanMacro(SimpleLineOffset, vtkTypeBool);
220 
222 
226  vtkSetMacro(Silent, vtkTypeBool);
227  vtkGetMacro(Silent, vtkTypeBool);
228  vtkBooleanMacro(Silent, vtkTypeBool);
230 
232 
238  vtkSetMacro(BestRoot, vtkTypeBool);
239  vtkGetMacro(BestRoot, vtkTypeBool);
240  vtkBooleanMacro(BestRoot, vtkTypeBool);
242 
244 
250  vtkSetMacro(Text, vtkTypeBool);
251  vtkGetMacro(Text, vtkTypeBool);
252  vtkBooleanMacro(Text, vtkTypeBool);
254 
256 
260  vtkSetMacro(Landscape, vtkTypeBool);
261  vtkGetMacro(Landscape, vtkTypeBool);
262  vtkBooleanMacro(Landscape, vtkTypeBool);
264 
266 
271  vtkSetMacro(PS3Shading, vtkTypeBool);
272  vtkGetMacro(PS3Shading, vtkTypeBool);
273  vtkBooleanMacro(PS3Shading, vtkTypeBool);
275 
277 
282  vtkSetMacro(OcclusionCull, vtkTypeBool);
283  vtkGetMacro(OcclusionCull, vtkTypeBool);
284  vtkBooleanMacro(OcclusionCull, vtkTypeBool);
286 
288 
296  vtkSetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
297  vtkGetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
298  vtkBooleanMacro(Write3DPropsAsRasterImage, vtkTypeBool);
300 
302 
307  vtkSetMacro(TextAsPath, bool);
308  vtkGetMacro(TextAsPath, bool);
309  vtkBooleanMacro(TextAsPath, bool);
311 
313 
319  void SetRasterExclusions(vtkPropCollection*);
320  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
322 
324 
328  vtkSetMacro(PointSizeFactor, float);
329  vtkGetMacro(PointSizeFactor, float);
331 
333 
337  vtkSetMacro(LineWidthFactor, float);
338  vtkGetMacro(LineWidthFactor, float);
340 
341 protected:
343  ~vtkGL2PSExporter() override;
344 
345  int GetGL2PSOptions();
346  int GetGL2PSSort();
347  int GetGL2PSFormat();
348  const char* GetFileExtension();
349 
351 
352  char* FilePrefix;
353  char* Title;
356  int Sort;
370 
371 private:
372  vtkGL2PSExporter(const vtkGL2PSExporter&) = delete;
373  void operator=(const vtkGL2PSExporter&) = delete;
374 };
375 
376 inline const char* vtkGL2PSExporter::GetSortAsString(void)
377 {
378  if (this->Sort == NO_SORT)
379  {
380  return "Off";
381  }
382  else if (this->Sort == SIMPLE_SORT)
383  {
384  return "Simple";
385  }
386  else
387  {
388  return "BSP";
389  }
390 }
391 
393 {
394  if (this->FileFormat == PS_FILE)
395  {
396  return "PS";
397  }
398  else if (this->FileFormat == EPS_FILE)
399  {
400  return "EPS";
401  }
402  else if (this->FileFormat == PDF_FILE)
403  {
404  return "PDF";
405  }
406  else if (this->FileFormat == TEX_FILE)
407  {
408  return "TeX";
409  }
410  else
411  {
412  return "SVG";
413  }
414 }
415 
416 #endif
vtkX3D::Text
@ Text
Definition: vtkX3D.h:166
vtkGL2PSExporter::SetFileFormatToSVG
void SetFileFormatToSVG()
Definition: vtkGL2PSExporter.h:163
vtkGL2PSExporter::PDF_FILE
@ PDF_FILE
Definition: vtkGL2PSExporter.h:130
vtkGL2PSExporter::PointSizeFactor
float PointSizeFactor
Definition: vtkGL2PSExporter.h:368
vtkGL2PSExporter::OcclusionCull
vtkTypeBool OcclusionCull
Definition: vtkGL2PSExporter.h:365
vtkGL2PSExporter::Write3DPropsAsRasterImage
vtkTypeBool Write3DPropsAsRasterImage
Definition: vtkGL2PSExporter.h:366
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkGL2PSExporter::RasterExclusions
vtkPropCollection * RasterExclusions
Definition: vtkGL2PSExporter.h:350
vtkGL2PSExporter::GetFileFormatAsString
const char * GetFileFormatAsString()
Definition: vtkGL2PSExporter.h:392
vtkGL2PSExporter
export a scene as a PostScript file using GL2PS.
Definition: vtkGL2PSExporter.h:87
vtkGL2PSExporter::DrawBackground
vtkTypeBool DrawBackground
Definition: vtkGL2PSExporter.h:358
vtkGL2PSExporter::FilePrefix
char * FilePrefix
Definition: vtkGL2PSExporter.h:352
vtkGL2PSExporter::FileFormat
int FileFormat
Definition: vtkGL2PSExporter.h:354
vtkGL2PSExporter::SetFileFormatToTeX
void SetFileFormatToTeX()
Definition: vtkGL2PSExporter.h:162
vtkGL2PSExporter::SimpleLineOffset
vtkTypeBool SimpleLineOffset
Definition: vtkGL2PSExporter.h:359
vtkGL2PSExporter::SetFileFormatToPS
void SetFileFormatToPS()
Definition: vtkGL2PSExporter.h:159
vtkGL2PSExporter::BufferSize
int BufferSize
Definition: vtkGL2PSExporter.h:355
vtkGL2PSExporter::BestRoot
vtkTypeBool BestRoot
Definition: vtkGL2PSExporter.h:361
vtkGL2PSExporter::SIMPLE_SORT
@ SIMPLE_SORT
Definition: vtkGL2PSExporter.h:170
vtkGL2PSExporter::Silent
vtkTypeBool Silent
Definition: vtkGL2PSExporter.h:360
vtkGL2PSExporter::TextAsPath
bool TextAsPath
Definition: vtkGL2PSExporter.h:367
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:143
vtkGL2PSExporter::Title
char * Title
Definition: vtkGL2PSExporter.h:353
vtkGL2PSExporter::SetFileFormatToEPS
void SetFileFormatToEPS()
Definition: vtkGL2PSExporter.h:160
vtkGL2PSExporter::SetSortToBSP
void SetSortToBSP()
Definition: vtkGL2PSExporter.h:184
vtkGL2PSExporter::GetSortAsString
const char * GetSortAsString()
Definition: vtkGL2PSExporter.h:376
vtkGL2PSExporter::SetFileFormatToPDF
void SetFileFormatToPDF()
Definition: vtkGL2PSExporter.h:161
vtkGL2PSExporter::SortScheme
SortScheme
Definition: vtkGL2PSExporter.h:167
vtkGL2PSExporter::EPS_FILE
@ EPS_FILE
Definition: vtkGL2PSExporter.h:129
vtkGL2PSExporter::LineWidthFactor
float LineWidthFactor
Definition: vtkGL2PSExporter.h:369
vtkGL2PSExporter::PS_FILE
@ PS_FILE
Definition: vtkGL2PSExporter.h:128
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGL2PSExporter::NO_SORT
@ NO_SORT
Definition: vtkGL2PSExporter.h:169
vtkExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGL2PSExporter::TEX_FILE
@ TEX_FILE
Definition: vtkGL2PSExporter.h:131
vtkGL2PSExporter::Text
vtkTypeBool Text
Definition: vtkGL2PSExporter.h:362
vtkGL2PSExporter::Compress
vtkTypeBool Compress
Definition: vtkGL2PSExporter.h:357
vtkNew.h
vtkExporter
abstract class to write a scene to a file
Definition: vtkExporter.h:47
vtkGL2PSExporter::Sort
int Sort
Definition: vtkGL2PSExporter.h:356
vtkGL2PSExporter::Landscape
vtkTypeBool Landscape
Definition: vtkGL2PSExporter.h:363
vtkGL2PSExporter::OutputFormat
OutputFormat
Definition: vtkGL2PSExporter.h:126
vtkExporter.h
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkGL2PSExporter::SetSortToOff
void SetSortToOff()
Definition: vtkGL2PSExporter.h:182
vtkGL2PSExporter::SetSortToSimple
void SetSortToSimple()
Definition: vtkGL2PSExporter.h:183
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkGL2PSExporter::PS3Shading
vtkTypeBool PS3Shading
Definition: vtkGL2PSExporter.h:364