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 
128  vtkSetMacro(BufferSize, int);
129  vtkGetMacro(BufferSize, int);
131 
133 
135  vtkSetStringMacro(Title);
136  vtkGetStringMacro(Title);
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 
253  vtkSetMacro(Text, int);
254  vtkGetMacro(Text, int);
255  vtkBooleanMacro(Text, int);
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 
309  void SetRasterExclusions(vtkPropCollection*);
310  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
312 
314 
316  vtkSetMacro(PointSizeFactor, float);
317  vtkGetMacro(PointSizeFactor, float);
319 
321 
323  vtkSetMacro(LineWidthFactor, float);
324  vtkGetMacro(LineWidthFactor, float);
326 
327 protected:
329  ~vtkGL2PSExporter();
330 
331  void WriteData();
332 
333  int GetGL2PSOptions();
334  int GetGL2PSSort();
335  int GetGL2PSFormat();
336  const char *GetFileExtension();
337 
338  void SavePropVisibility(vtkRendererCollection *renCol,
339  vtkIntArray *volVis, vtkIntArray *actVis,
340  vtkIntArray *act2dVis);
341  void RestorePropVisibility(vtkRendererCollection *renCol,
342  vtkIntArray *volVis, vtkIntArray *actVis,
343  vtkIntArray *act2dVis);
344  void Turn3DPropsOff(vtkRendererCollection *renCol);
345  void Turn2DPropsOff(vtkRendererCollection *renCol);
346  void GetVisibleContextActors(vtkPropCollection *contextActors,
347  vtkRendererCollection *renCol);
348  void SetPropVisibilities(vtkPropCollection *col, int vis);
349 
350  void DrawSpecialProps(vtkCollection *propCol, vtkRendererCollection *renCol);
352 
354  virtual void HandleSpecialProp(vtkProp *prop, vtkRenderer *ren);
355  void DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren);
356  void DrawTextActor3D(vtkTextActor3D *textAct, vtkRenderer *ren);
357  void DrawTextMapper(vtkTextMapper *textMap, vtkActor2D *textAct,
358  vtkRenderer *ren);
359  void DrawLabeledDataMapper(vtkLabeledDataMapper *mapper, vtkRenderer *ren);
360  void DrawScalarBarActor(vtkScalarBarActor *bar, vtkRenderer *ren);
361  void DrawViewportTextOverlay(const char *string, vtkTextProperty *tprop,
362  vtkCoordinate *coord, vtkRenderer *ren);
364 
368  void CopyPixels(int copyRect[4], vtkRenderer *ren);
369 
370  void DrawContextActors(vtkPropCollection *contextActs,
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
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
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
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
2D text annotation
Definition: vtkTextMapper.h:52
draw text labels at dataset points
vtkNew< vtkImageData > PixelData
a list of Props
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:49
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
represent text properties.
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
void PrintSelf(ostream &os, vtkIndent indent)
const char * GetSortAsString()
static vtkObject * New()