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:
109  static vtkGL2PSExporter *New();
111  void PrintSelf(ostream& os, vtkIndent indent);
112 
114 
117  vtkSetStringMacro(FilePrefix);
118  vtkGetStringMacro(FilePrefix);
120 
122 
124  vtkSetStringMacro(Title);
125  vtkGetStringMacro(Title);
127 
128 //BTX
130  {
135  SVG_FILE
136  };
137 //ETX
138 
140 
146  {
147  this->SetSortToOff();
148  this->SetSimpleLineOffset(0);
149  }
151 
153 
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 
172 //BTX
174  {
175  NO_SORT=0,
176  SIMPLE_SORT=1,
177  BSP_SORT=2
178  };
179 //ETX
180 
182 
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 
199  vtkSetMacro(Compress, int);
200  vtkGetMacro(Compress, int);
201  vtkBooleanMacro(Compress, int);
203 
205 
207  vtkSetMacro(DrawBackground, int);
208  vtkGetMacro(DrawBackground, int);
209  vtkBooleanMacro(DrawBackground, int);
211 
213 
216  vtkSetMacro(SimpleLineOffset, int);
217  vtkGetMacro(SimpleLineOffset, int);
218  vtkBooleanMacro(SimpleLineOffset, int);
220 
222 
224  vtkSetMacro(Silent, int);
225  vtkGetMacro(Silent, int);
226  vtkBooleanMacro(Silent, int);
228 
230 
233  vtkSetMacro(BestRoot, int);
234  vtkGetMacro(BestRoot, int);
235  vtkBooleanMacro(BestRoot, int);
237 
239 
242  vtkSetMacro(Text, int);
243  vtkGetMacro(Text, int);
244  vtkBooleanMacro(Text, int);
246 
248 
250  vtkSetMacro(Landscape, int);
251  vtkGetMacro(Landscape, int);
252  vtkBooleanMacro(Landscape, int);
254 
256 
259  vtkSetMacro(PS3Shading, int);
260  vtkGetMacro(PS3Shading, int);
261  vtkBooleanMacro(PS3Shading, int);
263 
265 
268  vtkSetMacro(OcclusionCull, int);
269  vtkGetMacro(OcclusionCull, int);
270  vtkBooleanMacro(OcclusionCull, int);
272 
274 
278  vtkSetMacro(Write3DPropsAsRasterImage, int);
279  vtkGetMacro(Write3DPropsAsRasterImage, int);
280  vtkBooleanMacro(Write3DPropsAsRasterImage, int);
282 
284 
287  vtkSetMacro(TextAsPath, bool);
288  vtkGetMacro(TextAsPath, bool);
289  vtkBooleanMacro(TextAsPath, bool);
291 
293 
298  void SetRasterExclusions(vtkPropCollection*);
299  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
301 
303 
305  vtkSetMacro(PointSizeFactor, float);
306  vtkGetMacro(PointSizeFactor, float);
308 
310 
312  vtkSetMacro(LineWidthFactor, float);
313  vtkGetMacro(LineWidthFactor, float);
315 
316 protected:
318  ~vtkGL2PSExporter();
319 
320  void WriteData();
321 
322  int GetGL2PSOptions();
323  int GetGL2PSSort();
324  int GetGL2PSFormat();
325  const char *GetFileExtension();
326 
327  void SavePropVisibility(vtkRendererCollection *renCol,
328  vtkIntArray *volVis, vtkIntArray *actVis,
329  vtkIntArray *act2dVis);
330  void RestorePropVisibility(vtkRendererCollection *renCol,
331  vtkIntArray *volVis, vtkIntArray *actVis,
332  vtkIntArray *act2dVis);
333  void Turn3DPropsOff(vtkRendererCollection *renCol);
334  void Turn2DPropsOff(vtkRendererCollection *renCol);
335  void GetVisibleContextActors(vtkPropCollection *contextActors,
336  vtkRendererCollection *renCol);
337  void SetPropVisibilities(vtkPropCollection *col, int vis);
338 
339  void DrawSpecialProps(vtkCollection *propCol, vtkRendererCollection *renCol);
341 
343  virtual void HandleSpecialProp(vtkProp *prop, vtkRenderer *ren);
344  void DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren);
345  void DrawTextActor3D(vtkTextActor3D *textAct, vtkRenderer *ren);
346  void DrawTextMapper(vtkTextMapper *textMap, vtkActor2D *textAct,
347  vtkRenderer *ren);
348  void DrawLabeledDataMapper(vtkLabeledDataMapper *mapper, vtkRenderer *ren);
349  void DrawScalarBarActor(vtkScalarBarActor *bar, vtkRenderer *ren);
350  void DrawViewportTextOverlay(const char *string, vtkTextProperty *tprop,
353 
357  void CopyPixels(int copyRect[4], vtkRenderer *ren);
358 
359  void DrawContextActors(vtkPropCollection *contextActs,
360  vtkRendererCollection *renCol);
361 
362 
364 
365  char *FilePrefix;
366  char *Title;
368  int Sort;
369  int Compress;
372  int Silent;
373  int BestRoot;
374  int Text;
382 
384 
385 private:
386  vtkGL2PSExporter(const vtkGL2PSExporter&); // Not implemented
387  void operator=(const vtkGL2PSExporter&); // Not implemented
388 };
389 
390 inline const char *vtkGL2PSExporter::GetSortAsString(void)
391 {
392  if ( this->Sort == NO_SORT )
393  {
394  return "Off";
395  }
396  else if ( this->Sort == SIMPLE_SORT )
397  {
398  return "Simple";
399  }
400  else
401  {
402  return "BSP";
403  }
404 }
405 
407 {
408  if ( this->FileFormat == PS_FILE )
409  {
410  return "PS";
411  }
412  else if ( this->FileFormat == EPS_FILE )
413  {
414  return "EPS";
415  }
416  else if ( this->FileFormat == PDF_FILE )
417  {
418  return "PDF";
419  }
420  else if ( this->FileFormat == TEX_FILE )
421  {
422  return "TeX";
423  }
424  else
425  {
426  return "SVG";
427  }
428 }
429 
430 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
abstract class to write a scene to a file
Definition: vtkExporter.h:45
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
export a scene as a PostScript file using GL2PS.
virtual void WriteData()=0
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:34
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
a actor that draws 2D data
Definition: vtkActor2D.h:44
Create a scalar bar with labels.
#define VTKIOEXPORT_EXPORT
abstract specification for renderers
Definition: vtkRenderer.h:63
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
2D text annotation
Definition: vtkTextMapper.h:59
draw text labels at dataset points
vtkNew< vtkImageData > PixelData
a list of Props
GLuint coord
Definition: vtkgl.h:16713
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:55
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
a list of renderers
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
An actor that displays text.
a list of 3D props
#define vtkGetStringMacro(name)
Definition: vtkSetGet.h:120
represent text properties.
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
const char * GetFileFormatAsString()
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
vtkPropCollection * RasterExclusions
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
void PrintSelf(ostream &os, vtkIndent indent)
const char * GetSortAsString()
static vtkObject * New()
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69