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 =========================================================================*/
80 #ifndef vtkGL2PSExporter_h
81 #define vtkGL2PSExporter_h
82 
83 #include "vtkIOExportModule.h" // For export macro
84 #include "vtkExporter.h"
85 
86 #include "vtkNew.h" // For vtkNew
87 
88 class vtkPropCollection;
89 
90 class VTKIOEXPORT_EXPORT vtkGL2PSExporter : public vtkExporter
91 {
92 public:
93  static vtkGL2PSExporter *New();
95  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
98 
103  vtkSetStringMacro(FilePrefix);
104  vtkGetStringMacro(FilePrefix);
106 
108 
116  vtkSetMacro(BufferSize, int);
117  vtkGetMacro(BufferSize, int);
119 
121 
125  vtkSetStringMacro(Title);
126  vtkGetStringMacro(Title);
128 
130  {
135  SVG_FILE
136  };
137 
139 
147  {
148  this->SetSortToOff();
149  this->SetSimpleLineOffset(0);
150  }
152 
154 
160  vtkSetClampMacro(FileFormat, int, PS_FILE, SVG_FILE);
161  vtkGetMacro(FileFormat, int);
163  {this->SetFileFormat(PS_FILE);};
165  {this->SetFileFormat(EPS_FILE);};
167  {this->SetFileFormat(PDF_FILE);};
169  {this->SetFileFormat(TEX_FILE);};
171  {this->SetFileFormat(SVG_FILE);};
172  const char *GetFileFormatAsString();
174 
176  {
177  NO_SORT=0,
178  SIMPLE_SORT=1,
179  BSP_SORT=2
180  };
181 
183 
188  vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
189  vtkGetMacro(Sort,int);
191  {this->SetSort(NO_SORT);};
193  {this->SetSort(SIMPLE_SORT);};
195  {this->SetSort(BSP_SORT);};
196  const char *GetSortAsString();
198 
200 
204  vtkSetMacro(Compress, vtkTypeBool);
205  vtkGetMacro(Compress, vtkTypeBool);
206  vtkBooleanMacro(Compress, vtkTypeBool);
208 
210 
215  vtkSetMacro(DrawBackground, vtkTypeBool);
216  vtkGetMacro(DrawBackground, vtkTypeBool);
217  vtkBooleanMacro(DrawBackground, vtkTypeBool);
219 
221 
227  vtkSetMacro(SimpleLineOffset, vtkTypeBool);
228  vtkGetMacro(SimpleLineOffset, vtkTypeBool);
229  vtkBooleanMacro(SimpleLineOffset, vtkTypeBool);
231 
233 
237  vtkSetMacro(Silent, vtkTypeBool);
238  vtkGetMacro(Silent, vtkTypeBool);
239  vtkBooleanMacro(Silent, vtkTypeBool);
241 
243 
249  vtkSetMacro(BestRoot, vtkTypeBool);
250  vtkGetMacro(BestRoot, vtkTypeBool);
251  vtkBooleanMacro(BestRoot, vtkTypeBool);
253 
255 
261  vtkSetMacro(Text, vtkTypeBool);
262  vtkGetMacro(Text, vtkTypeBool);
263  vtkBooleanMacro(Text, vtkTypeBool);
265 
267 
271  vtkSetMacro(Landscape, vtkTypeBool);
272  vtkGetMacro(Landscape, vtkTypeBool);
273  vtkBooleanMacro(Landscape, vtkTypeBool);
275 
277 
282  vtkSetMacro(PS3Shading, vtkTypeBool);
283  vtkGetMacro(PS3Shading, vtkTypeBool);
284  vtkBooleanMacro(PS3Shading, vtkTypeBool);
286 
288 
293  vtkSetMacro(OcclusionCull, vtkTypeBool);
294  vtkGetMacro(OcclusionCull, vtkTypeBool);
295  vtkBooleanMacro(OcclusionCull, vtkTypeBool);
297 
299 
307  vtkSetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
308  vtkGetMacro(Write3DPropsAsRasterImage, vtkTypeBool);
309  vtkBooleanMacro(Write3DPropsAsRasterImage, vtkTypeBool);
311 
313 
318  vtkSetMacro(TextAsPath, bool);
319  vtkGetMacro(TextAsPath, bool);
320  vtkBooleanMacro(TextAsPath, bool);
322 
324 
330  void SetRasterExclusions(vtkPropCollection*);
331  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
333 
335 
339  vtkSetMacro(PointSizeFactor, float);
340  vtkGetMacro(PointSizeFactor, float);
342 
344 
348  vtkSetMacro(LineWidthFactor, float);
349  vtkGetMacro(LineWidthFactor, float);
351 
352 protected:
354  ~vtkGL2PSExporter() override;
355 
356  int GetGL2PSOptions();
357  int GetGL2PSSort();
358  int GetGL2PSFormat();
359  const char *GetFileExtension();
360 
362 
363  char *FilePrefix;
364  char *Title;
367  int Sort;
381 
382 private:
383  vtkGL2PSExporter(const vtkGL2PSExporter&) = delete;
384  void operator=(const vtkGL2PSExporter&) = delete;
385 };
386 
387 inline const char *vtkGL2PSExporter::GetSortAsString(void)
388 {
389  if ( this->Sort == NO_SORT )
390  {
391  return "Off";
392  }
393  else if ( this->Sort == SIMPLE_SORT )
394  {
395  return "Simple";
396  }
397  else
398  {
399  return "BSP";
400  }
401 }
402 
404 {
405  if ( this->FileFormat == PS_FILE )
406  {
407  return "PS";
408  }
409  else if ( this->FileFormat == EPS_FILE )
410  {
411  return "EPS";
412  }
413  else if ( this->FileFormat == PDF_FILE )
414  {
415  return "PDF";
416  }
417  else if ( this->FileFormat == TEX_FILE )
418  {
419  return "TeX";
420  }
421  else
422  {
423  return "SVG";
424  }
425 }
426 
427 #endif
void SetFileFormatToEPS()
Specify the format of file to write out.
abstract class to write a scene to a file
Definition: vtkExporter.h:47
void SetFileFormatToPDF()
Specify the format of file to write out.
export a scene as a PostScript file using GL2PS.
vtkTypeBool Landscape
vtkTypeBool Compress
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
void SetSortToOff()
Set the type of sorting algorithm to order primitives from back to front.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetSortToSimple()
Set the type of sorting algorithm to order primitives from back to front.
void SetFileFormatToSVG()
Specify the format of file to write out.
vtkTypeBool OcclusionCull
vtkTypeBool Write3DPropsAsRasterImage
vtkTypeBool PS3Shading
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.
vtkTypeBool SimpleLineOffset
void UsePainterSettings()
Configure the exporter to expect a painter-ordered 2D rendering, that is, a rendering at a fixed dept...
vtkPropCollection * RasterExclusions
const char * GetSortAsString()
Set the type of sorting algorithm to order primitives from back to front.
vtkTypeBool BestRoot
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeBool DrawBackground
void SetSortToBSP()
Set the type of sorting algorithm to order primitives from back to front.