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 =========================================================================*/
79 #ifndef vtkGL2PSExporter_h
80 #define vtkGL2PSExporter_h
81 
82 #include "vtkIOExportModule.h" // For export macro
83 #include "vtkExporter.h"
84 
85 #include "vtkNew.h" // For vtkNew
86 
87 class vtkActor2D;
88 class vtkCollection;
89 class vtkCoordinate;
90 class vtkImageData;
91 class vtkIntArray;
93 class vtkMatrix4x4;
94 class vtkPath;
95 class vtkProp;
96 class vtkPropCollection;
98 class vtkRenderer;
100 class vtkScalarBarActor;
101 class vtkTextActor;
102 class vtkTextActor3D;
103 class vtkTextMapper;
104 class vtkTextProperty;
105 
107 {
108 public:
111  void PrintSelf(ostream& os, vtkIndent indent);
112 
114 
117  vtkSetStringMacro(FilePrefix);
118  vtkGetStringMacro(FilePrefix);
120 
122 
128  vtkSetMacro(BufferSize, int);
129  vtkGetMacro(BufferSize, int);
131 
133 
138 
139 //BTX
141  {
146  SVG_FILE
147  };
148 //ETX
149 
151 
157  {
158  this->SetSortToOff();
159  this->SetSimpleLineOffset(0);
160  }
162 
164 
168  vtkSetClampMacro(FileFormat, int, PS_FILE, SVG_FILE);
169  vtkGetMacro(FileFormat, int);
171  {this->SetFileFormat(PS_FILE);};
173  {this->SetFileFormat(EPS_FILE);};
175  {this->SetFileFormat(PDF_FILE);};
177  {this->SetFileFormat(TEX_FILE);};
179  {this->SetFileFormat(SVG_FILE);};
180  const char *GetFileFormatAsString();
182 
183 //BTX
185  {
186  NO_SORT=0,
187  SIMPLE_SORT=1,
188  BSP_SORT=2
189  };
190 //ETX
191 
193 
196  vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
197  vtkGetMacro(Sort,int);
199  {this->SetSort(NO_SORT);};
201  {this->SetSort(SIMPLE_SORT);};
203  {this->SetSort(BSP_SORT);};
204  const char *GetSortAsString();
206 
208 
210  vtkSetMacro(Compress, int);
211  vtkGetMacro(Compress, int);
212  vtkBooleanMacro(Compress, int);
214 
216 
218  vtkSetMacro(DrawBackground, int);
219  vtkGetMacro(DrawBackground, int);
220  vtkBooleanMacro(DrawBackground, int);
222 
224 
227  vtkSetMacro(SimpleLineOffset, int);
228  vtkGetMacro(SimpleLineOffset, int);
229  vtkBooleanMacro(SimpleLineOffset, int);
231 
233 
235  vtkSetMacro(Silent, int);
236  vtkGetMacro(Silent, int);
237  vtkBooleanMacro(Silent, int);
239 
241 
244  vtkSetMacro(BestRoot, int);
245  vtkGetMacro(BestRoot, int);
246  vtkBooleanMacro(BestRoot, int);
248 
250 
257 
259 
261  vtkSetMacro(Landscape, int);
262  vtkGetMacro(Landscape, int);
263  vtkBooleanMacro(Landscape, int);
265 
267 
270  vtkSetMacro(PS3Shading, int);
271  vtkGetMacro(PS3Shading, int);
272  vtkBooleanMacro(PS3Shading, int);
274 
276 
279  vtkSetMacro(OcclusionCull, int);
280  vtkGetMacro(OcclusionCull, int);
281  vtkBooleanMacro(OcclusionCull, int);
283 
285 
289  vtkSetMacro(Write3DPropsAsRasterImage, int);
290  vtkGetMacro(Write3DPropsAsRasterImage, int);
291  vtkBooleanMacro(Write3DPropsAsRasterImage, int);
293 
295 
298  vtkSetMacro(TextAsPath, bool);
299  vtkGetMacro(TextAsPath, bool);
300  vtkBooleanMacro(TextAsPath, bool);
302 
304 
312 
314 
316  vtkSetMacro(PointSizeFactor, float);
317  vtkGetMacro(PointSizeFactor, float);
319 
321 
323  vtkSetMacro(LineWidthFactor, float);
324  vtkGetMacro(LineWidthFactor, float);
326 
327 protected:
330 
331  void WriteData();
332 
336  const char *GetFileExtension();
337 
339  vtkIntArray *volVis, vtkIntArray *actVis,
340  vtkIntArray *act2dVis);
342  vtkIntArray *volVis, vtkIntArray *actVis,
343  vtkIntArray *act2dVis);
347  vtkRendererCollection *renCol);
349 
352 
354  virtual void HandleSpecialProp(vtkProp *prop, vtkRenderer *ren);
355  void DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren);
357  void DrawTextMapper(vtkTextMapper *textMap, vtkActor2D *textAct,
358  vtkRenderer *ren);
361  void DrawViewportTextOverlay(const char *string, vtkTextProperty *tprop,
364 
368  void CopyPixels(int copyRect[4], vtkRenderer *ren);
369 
371  vtkRendererCollection *renCol);
372 
373 
375 
376  char *FilePrefix;
377  char *Title;
380  int Sort;
381  int Compress;
384  int Silent;
385  int BestRoot;
386  int Text;
394 
396 
397 private:
398  vtkGL2PSExporter(const vtkGL2PSExporter&); // Not implemented
399  void operator=(const vtkGL2PSExporter&); // Not implemented
400 };
401 
402 inline const char *vtkGL2PSExporter::GetSortAsString(void)
403 {
404  if ( this->Sort == NO_SORT )
405  {
406  return "Off";
407  }
408  else if ( this->Sort == SIMPLE_SORT )
409  {
410  return "Simple";
411  }
412  else
413  {
414  return "BSP";
415  }
416 }
417 
419 {
420  if ( this->FileFormat == PS_FILE )
421  {
422  return "PS";
423  }
424  else if ( this->FileFormat == EPS_FILE )
425  {
426  return "EPS";
427  }
428  else if ( this->FileFormat == PDF_FILE )
429  {
430  return "PDF";
431  }
432  else if ( this->FileFormat == TEX_FILE )
433  {
434  return "TeX";
435  }
436  else
437  {
438  return "SVG";
439  }
440 }
441 
442 #endif
vtkGL2PSExporter::DrawTextActor
void DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren)
vtkX3D::Text
@ Text
Definition: vtkX3D.h:160
vtkGL2PSExporter::SetFileFormatToSVG
void SetFileFormatToSVG()
Definition: vtkGL2PSExporter.h:178
vtkGL2PSExporter::PDF_FILE
@ PDF_FILE
Definition: vtkGL2PSExporter.h:144
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkGL2PSExporter::GetVisibleContextActors
void GetVisibleContextActors(vtkPropCollection *contextActors, vtkRendererCollection *renCol)
vtkGL2PSExporter::New
static vtkGL2PSExporter * New()
vtkGL2PSExporter::GetGL2PSFormat
int GetGL2PSFormat()
vtkGL2PSExporter::GetGL2PSOptions
int GetGL2PSOptions()
vtkGL2PSExporter::PointSizeFactor
float PointSizeFactor
Definition: vtkGL2PSExporter.h:392
vtkGL2PSExporter::DrawBackground
int DrawBackground
Definition: vtkGL2PSExporter.h:382
vtkGL2PSExporter::SetRasterExclusions
void SetRasterExclusions(vtkPropCollection *)
vtkGL2PSExporter::DrawViewportTextOverlay
void DrawViewportTextOverlay(const char *string, vtkTextProperty *tprop, vtkCoordinate *coord, vtkRenderer *ren)
vtkIOExportModule.h
vtkTextActor3D
An actor that displays text.
Definition: vtkTextActor3D.h:49
vtkGL2PSExporter::vtkGL2PSExporter
vtkGL2PSExporter()
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:35
vtkGL2PSExporter::RasterExclusions
vtkPropCollection * RasterExclusions
Definition: vtkGL2PSExporter.h:374
vtkGL2PSExporter::GetFileFormatAsString
const char * GetFileFormatAsString()
Definition: vtkGL2PSExporter.h:418
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkGL2PSExporter::PS3Shading
int PS3Shading
Definition: vtkGL2PSExporter.h:388
vtkGL2PSExporter
export a scene as a PostScript file using GL2PS.
Definition: vtkGL2PSExporter.h:107
vtkGL2PSExporter::FilePrefix
char * FilePrefix
Definition: vtkGL2PSExporter.h:376
vtkgl::coord
GLuint coord
Definition: vtkgl.h:16713
vtkGL2PSExporter::FileFormat
int FileFormat
Definition: vtkGL2PSExporter.h:378
vtkGL2PSExporter::SetFileFormatToTeX
void SetFileFormatToTeX()
Definition: vtkGL2PSExporter.h:176
vtkGL2PSExporter::SetFileFormatToPS
void SetFileFormatToPS()
Definition: vtkGL2PSExporter.h:170
vtkGL2PSExporter::DrawScalarBarActor
void DrawScalarBarActor(vtkScalarBarActor *bar, vtkRenderer *ren)
vtkGL2PSExporter::BufferSize
int BufferSize
Definition: vtkGL2PSExporter.h:379
vtkRendererCollection
a list of renderers
Definition: vtkRendererCollection.h:34
vtkGL2PSExporter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGL2PSExporter::DrawContextActors
void DrawContextActors(vtkPropCollection *contextActs, vtkRendererCollection *renCol)
vtkGL2PSExporter::SIMPLE_SORT
@ SIMPLE_SORT
Definition: vtkGL2PSExporter.h:187
vtkGL2PSExporter::DrawTextActor3D
void DrawTextActor3D(vtkTextActor3D *textAct, vtkRenderer *ren)
vtkGL2PSExporter::TextAsPath
bool TextAsPath
Definition: vtkGL2PSExporter.h:391
vtkGL2PSExporter::UsePainterSettings
void UsePainterSettings()
Definition: vtkGL2PSExporter.h:156
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkGL2PSExporter::Title
char * Title
Definition: vtkGL2PSExporter.h:377
vtkCollection
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:53
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkGL2PSExporter::Silent
int Silent
Definition: vtkGL2PSExporter.h:384
vtkGL2PSExporter::Write3DPropsAsRasterImage
int Write3DPropsAsRasterImage
Definition: vtkGL2PSExporter.h:390
vtkGL2PSExporter::SetFileFormatToEPS
void SetFileFormatToEPS()
Definition: vtkGL2PSExporter.h:172
vtkGL2PSExporter::SetSortToBSP
void SetSortToBSP()
Definition: vtkGL2PSExporter.h:202
vtkGL2PSExporter::SavePropVisibility
void SavePropVisibility(vtkRendererCollection *renCol, vtkIntArray *volVis, vtkIntArray *actVis, vtkIntArray *act2dVis)
vtkGL2PSExporter::GetSortAsString
const char * GetSortAsString()
Definition: vtkGL2PSExporter.h:402
vtkGL2PSExporter::GetGL2PSSort
int GetGL2PSSort()
vtkGL2PSExporter::Landscape
int Landscape
Definition: vtkGL2PSExporter.h:387
vtkGL2PSExporter::SetFileFormatToPDF
void SetFileFormatToPDF()
Definition: vtkGL2PSExporter.h:174
vtkGL2PSExporter::GetFileExtension
const char * GetFileExtension()
vtkGL2PSExporter::SortScheme
SortScheme
Definition: vtkGL2PSExporter.h:185
vtkGL2PSExporter::EPS_FILE
@ EPS_FILE
Definition: vtkGL2PSExporter.h:143
vtkGL2PSExporter::LineWidthFactor
float LineWidthFactor
Definition: vtkGL2PSExporter.h:393
vtkGL2PSExporter::PS_FILE
@ PS_FILE
Definition: vtkGL2PSExporter.h:142
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:53
vtkGL2PSExporter::HandleSpecialProp
virtual void HandleSpecialProp(vtkProp *prop, vtkRenderer *ren)
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:70
vtkGL2PSExporter::NO_SORT
@ NO_SORT
Definition: vtkGL2PSExporter.h:186
vtkNew< vtkImageData >
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkGL2PSExporter::~vtkGL2PSExporter
~vtkGL2PSExporter()
vtkGL2PSExporter::DrawLabeledDataMapper
void DrawLabeledDataMapper(vtkLabeledDataMapper *mapper, vtkRenderer *ren)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkGL2PSExporter::TEX_FILE
@ TEX_FILE
Definition: vtkGL2PSExporter.h:145
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkLabeledDataMapper
draw text labels at dataset points
Definition: vtkLabeledDataMapper.h:74
vtkGL2PSExporter::WriteData
void WriteData()
vtkNew.h
vtkGL2PSExporter::SetPropVisibilities
void SetPropVisibilities(vtkPropCollection *col, int vis)
vtkGL2PSExporter::Turn2DPropsOff
void Turn2DPropsOff(vtkRendererCollection *renCol)
vtkGL2PSExporter::Turn3DPropsOff
void Turn3DPropsOff(vtkRendererCollection *renCol)
vtkExporter
abstract class to write a scene to a file
Definition: vtkExporter.h:46
vtkGL2PSExporter::SimpleLineOffset
int SimpleLineOffset
Definition: vtkGL2PSExporter.h:383
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkGL2PSExporter::DrawSpecialProps
void DrawSpecialProps(vtkCollection *propCol, vtkRendererCollection *renCol)
vtkGL2PSExporter::Sort
int Sort
Definition: vtkGL2PSExporter.h:380
vtkGL2PSExporter::OcclusionCull
int OcclusionCull
Definition: vtkGL2PSExporter.h:389
vtkGL2PSExporter::OutputFormat
OutputFormat
Definition: vtkGL2PSExporter.h:141
vtkGL2PSExporter::DrawTextMapper
void DrawTextMapper(vtkTextMapper *textMap, vtkActor2D *textAct, vtkRenderer *ren)
vtkGL2PSExporter::CopyPixels
void CopyPixels(int copyRect[4], vtkRenderer *ren)
vtkExporter.h
vtkGL2PSExporter::PixelData
vtkNew< vtkImageData > PixelData
Definition: vtkGL2PSExporter.h:395
vtkGL2PSExporter::BestRoot
int BestRoot
Definition: vtkGL2PSExporter.h:385
vtkGL2PSExporter::Text
int Text
Definition: vtkGL2PSExporter.h:386
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkGL2PSExporter::SetSortToOff
void SetSortToOff()
Definition: vtkGL2PSExporter.h:198
vtkScalarBarActor
Create a scalar bar with labels.
Definition: vtkScalarBarActor.h:80
vtkProp3DCollection
a list of 3D props
Definition: vtkProp3DCollection.h:37
vtkGL2PSExporter::SetSortToSimple
void SetSortToSimple()
Definition: vtkGL2PSExporter.h:200
vtkGL2PSExporter::RestorePropVisibility
void RestorePropVisibility(vtkRendererCollection *renCol, vtkIntArray *volVis, vtkIntArray *actVis, vtkIntArray *act2dVis)
vtkGL2PSExporter::Compress
int Compress
Definition: vtkGL2PSExporter.h:381
VTKIOEXPORT_EXPORT
#define VTKIOEXPORT_EXPORT
Definition: vtkIOExportModule.h:15