VTK
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 "vtkIOExportModule.h" // For export macro
81 #include "vtkExporter.h"
82 
83 #include "vtkNew.h" // For vtkNew
84 
85 class vtkPropCollection;
86 
87 class VTKIOEXPORT_EXPORT vtkGL2PSExporter : public vtkExporter
88 {
89 public:
90  static vtkGL2PSExporter *New();
92  void PrintSelf(ostream& os, vtkIndent indent) VTK_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);
160  {this->SetFileFormat(PS_FILE);};
162  {this->SetFileFormat(EPS_FILE);};
164  {this->SetFileFormat(PDF_FILE);};
166  {this->SetFileFormat(TEX_FILE);};
168  {this->SetFileFormat(SVG_FILE);};
169  const char *GetFileFormatAsString();
171 
173  {
174  NO_SORT=0,
175  SIMPLE_SORT=1,
176  BSP_SORT=2
177  };
178 
180 
185  vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
186  vtkGetMacro(Sort,int);
188  {this->SetSort(NO_SORT);};
190  {this->SetSort(SIMPLE_SORT);};
192  {this->SetSort(BSP_SORT);};
193  const char *GetSortAsString();
195 
197 
201  vtkSetMacro(Compress, int);
202  vtkGetMacro(Compress, int);
203  vtkBooleanMacro(Compress, int);
205 
207 
212  vtkSetMacro(DrawBackground, int);
213  vtkGetMacro(DrawBackground, int);
214  vtkBooleanMacro(DrawBackground, int);
216 
218 
224  vtkSetMacro(SimpleLineOffset, int);
225  vtkGetMacro(SimpleLineOffset, int);
226  vtkBooleanMacro(SimpleLineOffset, int);
228 
230 
234  vtkSetMacro(Silent, int);
235  vtkGetMacro(Silent, int);
236  vtkBooleanMacro(Silent, int);
238 
240 
246  vtkSetMacro(BestRoot, int);
247  vtkGetMacro(BestRoot, int);
248  vtkBooleanMacro(BestRoot, int);
250 
252 
258  vtkSetMacro(Text, int);
259  vtkGetMacro(Text, int);
260  vtkBooleanMacro(Text, int);
262 
264 
268  vtkSetMacro(Landscape, int);
269  vtkGetMacro(Landscape, int);
270  vtkBooleanMacro(Landscape, int);
272 
274 
279  vtkSetMacro(PS3Shading, int);
280  vtkGetMacro(PS3Shading, int);
281  vtkBooleanMacro(PS3Shading, int);
283 
285 
290  vtkSetMacro(OcclusionCull, int);
291  vtkGetMacro(OcclusionCull, int);
292  vtkBooleanMacro(OcclusionCull, int);
294 
296 
304  vtkSetMacro(Write3DPropsAsRasterImage, int);
305  vtkGetMacro(Write3DPropsAsRasterImage, int);
306  vtkBooleanMacro(Write3DPropsAsRasterImage, int);
308 
310 
315  vtkSetMacro(TextAsPath, bool);
316  vtkGetMacro(TextAsPath, bool);
317  vtkBooleanMacro(TextAsPath, bool);
319 
321 
327  void SetRasterExclusions(vtkPropCollection*);
328  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
330 
332 
336  vtkSetMacro(PointSizeFactor, float);
337  vtkGetMacro(PointSizeFactor, float);
339 
341 
345  vtkSetMacro(LineWidthFactor, float);
346  vtkGetMacro(LineWidthFactor, float);
348 
349 protected:
351  ~vtkGL2PSExporter() VTK_OVERRIDE;
352 
353  int GetGL2PSOptions();
354  int GetGL2PSSort();
355  int GetGL2PSFormat();
356  const char *GetFileExtension();
357 
358  vtkPropCollection *RasterExclusions;
359 
360  char *FilePrefix;
361  char *Title;
362  int FileFormat;
363  int BufferSize;
364  int Sort;
365  int Compress;
366  int DrawBackground;
367  int SimpleLineOffset;
368  int Silent;
369  int BestRoot;
370  int Text;
371  int Landscape;
372  int PS3Shading;
373  int OcclusionCull;
374  int Write3DPropsAsRasterImage;
375  bool TextAsPath;
376  float PointSizeFactor;
377  float LineWidthFactor;
378 
379 private:
380  vtkGL2PSExporter(const vtkGL2PSExporter&) VTK_DELETE_FUNCTION;
381  void operator=(const vtkGL2PSExporter&) VTK_DELETE_FUNCTION;
382 };
383 
384 inline const char *vtkGL2PSExporter::GetSortAsString(void)
385 {
386  if ( this->Sort == NO_SORT )
387  {
388  return "Off";
389  }
390  else if ( this->Sort == SIMPLE_SORT )
391  {
392  return "Simple";
393  }
394  else
395  {
396  return "BSP";
397  }
398 }
399 
401 {
402  if ( this->FileFormat == PS_FILE )
403  {
404  return "PS";
405  }
406  else if ( this->FileFormat == EPS_FILE )
407  {
408  return "EPS";
409  }
410  else if ( this->FileFormat == PDF_FILE )
411  {
412  return "PDF";
413  }
414  else if ( this->FileFormat == TEX_FILE )
415  {
416  return "TeX";
417  }
418  else
419  {
420  return "SVG";
421  }
422 }
423 
424 #endif
void SetFileFormatToEPS()
Specify the format of file to write out.
abstract class to write a scene to a file
Definition: vtkExporter.h:46
void SetFileFormatToPDF()
Specify the format of file to write out.
export a scene as a PostScript file using GL2PS.
an ordered list of Props
void SetSortToOff()
Set the the type of sorting algorithm to order primitives from back to front.
a simple class to control print indentation
Definition: vtkIndent.h:33
void SetSortToSimple()
Set the the type of sorting algorithm to order primitives from back to front.
void SetFileFormatToSVG()
Specify the format of file to write out.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
const char * GetFileFormatAsString()
Specify the format of file to write out.
void SetFileFormatToPS()
Specify the format of file to write out.
void SetFileFormatToTeX()
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...
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetSortToBSP()
Set the the type of sorting algorithm to order primitives from back to front.