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
vtkX3D::Text
Definition: vtkX3D.h:160
vtkGL2PSExporter::SetFileFormatToSVG
void SetFileFormatToSVG()
Definition: vtkGL2PSExporter.h:170
vtkGL2PSExporter::PDF_FILE
Definition: vtkGL2PSExporter.h:133
vtkGL2PSExporter::PointSizeFactor
float PointSizeFactor
Definition: vtkGL2PSExporter.h:379
vtkGL2PSExporter::OcclusionCull
vtkTypeBool OcclusionCull
Definition: vtkGL2PSExporter.h:376
vtkGL2PSExporter::Write3DPropsAsRasterImage
vtkTypeBool Write3DPropsAsRasterImage
Definition: vtkGL2PSExporter.h:377
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:361
vtkGL2PSExporter::GetFileFormatAsString
const char * GetFileFormatAsString()
Definition: vtkGL2PSExporter.h:403
vtkGL2PSExporter
export a scene as a PostScript file using GL2PS.
Definition: vtkGL2PSExporter.h:90
vtkGL2PSExporter::DrawBackground
vtkTypeBool DrawBackground
Definition: vtkGL2PSExporter.h:369
vtkGL2PSExporter::FilePrefix
char * FilePrefix
Definition: vtkGL2PSExporter.h:363
vtkGL2PSExporter::FileFormat
int FileFormat
Definition: vtkGL2PSExporter.h:365
vtkGL2PSExporter::SetFileFormatToTeX
void SetFileFormatToTeX()
Definition: vtkGL2PSExporter.h:168
vtkGL2PSExporter::SimpleLineOffset
vtkTypeBool SimpleLineOffset
Definition: vtkGL2PSExporter.h:370
vtkGL2PSExporter::SetFileFormatToPS
void SetFileFormatToPS()
Definition: vtkGL2PSExporter.h:162
vtkGL2PSExporter::BufferSize
int BufferSize
Definition: vtkGL2PSExporter.h:366
vtkGL2PSExporter::BestRoot
vtkTypeBool BestRoot
Definition: vtkGL2PSExporter.h:372
vtkGL2PSExporter::SIMPLE_SORT
Definition: vtkGL2PSExporter.h:178
vtkGL2PSExporter::Silent
vtkTypeBool Silent
Definition: vtkGL2PSExporter.h:371
vtkGL2PSExporter::TextAsPath
bool TextAsPath
Definition: vtkGL2PSExporter.h:378
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:146
vtkGL2PSExporter::Title
char * Title
Definition: vtkGL2PSExporter.h:364
vtkGL2PSExporter::SetFileFormatToEPS
void SetFileFormatToEPS()
Definition: vtkGL2PSExporter.h:164
vtkGL2PSExporter::SetSortToBSP
void SetSortToBSP()
Definition: vtkGL2PSExporter.h:194
vtkGL2PSExporter::GetSortAsString
const char * GetSortAsString()
Definition: vtkGL2PSExporter.h:387
vtkGL2PSExporter::SetFileFormatToPDF
void SetFileFormatToPDF()
Definition: vtkGL2PSExporter.h:166
vtkGL2PSExporter::SortScheme
SortScheme
Definition: vtkGL2PSExporter.h:175
vtkGL2PSExporter::EPS_FILE
Definition: vtkGL2PSExporter.h:132
vtkGL2PSExporter::LineWidthFactor
float LineWidthFactor
Definition: vtkGL2PSExporter.h:380
vtkGL2PSExporter::PS_FILE
Definition: vtkGL2PSExporter.h:131
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGL2PSExporter::NO_SORT
Definition: vtkGL2PSExporter.h:177
vtkExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGL2PSExporter::TEX_FILE
Definition: vtkGL2PSExporter.h:134
vtkGL2PSExporter::Text
vtkTypeBool Text
Definition: vtkGL2PSExporter.h:373
vtkGL2PSExporter::Compress
vtkTypeBool Compress
Definition: vtkGL2PSExporter.h:368
vtkNew.h
vtkExporter
abstract class to write a scene to a file
Definition: vtkExporter.h:47
vtkGL2PSExporter::Sort
int Sort
Definition: vtkGL2PSExporter.h:367
vtkGL2PSExporter::Landscape
vtkTypeBool Landscape
Definition: vtkGL2PSExporter.h:374
vtkGL2PSExporter::OutputFormat
OutputFormat
Definition: vtkGL2PSExporter.h:129
vtkExporter.h
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkGL2PSExporter::SetSortToOff
void SetSortToOff()
Definition: vtkGL2PSExporter.h:190
vtkGL2PSExporter::SetSortToSimple
void SetSortToSimple()
Definition: vtkGL2PSExporter.h:192
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkGL2PSExporter::PS3Shading
vtkTypeBool PS3Shading
Definition: vtkGL2PSExporter.h:375