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 vtkActor;
88 class vtkActor2D;
89 class vtkCollection;
90 class vtkCoordinate;
91 class vtkImageData;
92 class vtkIntArray;
95 class vtkMatrix4x4;
96 class vtkPath;
97 class vtkProp;
98 class vtkPropCollection;
100 class vtkRenderer;
102 class vtkScalarBarActor;
103 class vtkTextActor;
104 class vtkTextActor3D;
105 class vtkTextMapper;
106 class vtkTextProperty;
107 
109 {
110 public:
111  static vtkGL2PSExporter *New();
113  void PrintSelf(ostream& os, vtkIndent indent);
114 
116 
119  vtkSetStringMacro(FilePrefix);
120  vtkGetStringMacro(FilePrefix);
122 
124 
130  vtkSetMacro(BufferSize, int);
131  vtkGetMacro(BufferSize, int);
133 
135 
137  vtkSetStringMacro(Title);
138  vtkGetStringMacro(Title);
140 
141 //BTX
143  {
148  SVG_FILE
149  };
150 //ETX
151 
153 
159  {
160  this->SetSortToOff();
161  this->SetSimpleLineOffset(0);
162  }
164 
166 
170  vtkSetClampMacro(FileFormat, int, PS_FILE, SVG_FILE);
171  vtkGetMacro(FileFormat, int);
173  {this->SetFileFormat(PS_FILE);};
175  {this->SetFileFormat(EPS_FILE);};
177  {this->SetFileFormat(PDF_FILE);};
179  {this->SetFileFormat(TEX_FILE);};
181  {this->SetFileFormat(SVG_FILE);};
182  const char *GetFileFormatAsString();
184 
185 //BTX
187  {
188  NO_SORT=0,
189  SIMPLE_SORT=1,
190  BSP_SORT=2
191  };
192 //ETX
193 
195 
198  vtkSetClampMacro(Sort, int, NO_SORT, BSP_SORT);
199  vtkGetMacro(Sort,int);
201  {this->SetSort(NO_SORT);};
203  {this->SetSort(SIMPLE_SORT);};
205  {this->SetSort(BSP_SORT);};
206  const char *GetSortAsString();
208 
210 
212  vtkSetMacro(Compress, int);
213  vtkGetMacro(Compress, int);
214  vtkBooleanMacro(Compress, int);
216 
218 
220  vtkSetMacro(DrawBackground, int);
221  vtkGetMacro(DrawBackground, int);
222  vtkBooleanMacro(DrawBackground, int);
224 
226 
229  vtkSetMacro(SimpleLineOffset, int);
230  vtkGetMacro(SimpleLineOffset, int);
231  vtkBooleanMacro(SimpleLineOffset, int);
233 
235 
237  vtkSetMacro(Silent, int);
238  vtkGetMacro(Silent, int);
239  vtkBooleanMacro(Silent, int);
241 
243 
246  vtkSetMacro(BestRoot, int);
247  vtkGetMacro(BestRoot, int);
248  vtkBooleanMacro(BestRoot, int);
250 
252 
255  vtkSetMacro(Text, int);
256  vtkGetMacro(Text, int);
257  vtkBooleanMacro(Text, int);
259 
261 
263  vtkSetMacro(Landscape, int);
264  vtkGetMacro(Landscape, int);
265  vtkBooleanMacro(Landscape, int);
267 
269 
272  vtkSetMacro(PS3Shading, int);
273  vtkGetMacro(PS3Shading, int);
274  vtkBooleanMacro(PS3Shading, int);
276 
278 
281  vtkSetMacro(OcclusionCull, int);
282  vtkGetMacro(OcclusionCull, int);
283  vtkBooleanMacro(OcclusionCull, int);
285 
287 
291  vtkSetMacro(Write3DPropsAsRasterImage, int);
292  vtkGetMacro(Write3DPropsAsRasterImage, int);
293  vtkBooleanMacro(Write3DPropsAsRasterImage, int);
295 
297 
300  vtkSetMacro(TextAsPath, bool);
301  vtkGetMacro(TextAsPath, bool);
302  vtkBooleanMacro(TextAsPath, bool);
304 
306 
311  void SetRasterExclusions(vtkPropCollection*);
312  vtkGetObjectMacro(RasterExclusions, vtkPropCollection);
314 
316 
318  vtkSetMacro(PointSizeFactor, float);
319  vtkGetMacro(PointSizeFactor, float);
321 
323 
325  vtkSetMacro(LineWidthFactor, float);
326  vtkGetMacro(LineWidthFactor, float);
328 
329 protected:
331  ~vtkGL2PSExporter();
332 
333  void WriteData();
334 
335  int GetGL2PSOptions();
336  int GetGL2PSSort();
337  int GetGL2PSFormat();
338  const char *GetFileExtension();
339 
340  void SavePropVisibility(vtkRendererCollection *renCol,
341  vtkIntArray *volVis, vtkIntArray *actVis,
342  vtkIntArray *act2dVis);
343  void RestorePropVisibility(vtkRendererCollection *renCol,
344  vtkIntArray *volVis, vtkIntArray *actVis,
345  vtkIntArray *act2dVis);
346  void Turn3DPropsOff(vtkRendererCollection *renCol);
347  void Turn2DPropsOff(vtkRendererCollection *renCol);
348  void GetVisibleContextActors(vtkPropCollection *contextActors,
349  vtkRendererCollection *renCol);
350  void SetPropVisibilities(vtkPropCollection *col, int vis);
351 
352  void DrawSpecialProps(vtkCollection *propCol, vtkRendererCollection *renCol);
354 
356  virtual void HandleSpecialProp(vtkProp *prop, vtkRenderer *ren);
357  void DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren);
358  void DrawTextActor3D(vtkTextActor3D *textAct, vtkRenderer *ren);
359  void DrawTextMapper(vtkTextMapper *textMap, vtkActor2D *textAct,
360  vtkRenderer *ren);
361  void DrawLabeledDataMapper(vtkLabeledDataMapper *mapper, vtkRenderer *ren);
362  void DrawLabeledContourMapper(vtkActor *act, vtkLabeledContourMapper *mapper,
363  vtkRenderer *ren);
364  void DrawScalarBarActor(vtkScalarBarActor *bar, vtkRenderer *ren);
365  void DrawViewportTextOverlay(const char *string, vtkTextProperty *tprop,
366  vtkCoordinate *coord, vtkRenderer *ren);
368 
372  void CopyPixels(int copyRect[4], vtkRenderer *ren);
373 
374  void DrawContextActors(vtkPropCollection *contextActs,
375  vtkRendererCollection *renCol);
376 
377 
379 
380  char *FilePrefix;
381  char *Title;
384  int Sort;
385  int Compress;
388  int Silent;
389  int BestRoot;
390  int Text;
398 
400 
401 private:
402  vtkGL2PSExporter(const vtkGL2PSExporter&); // Not implemented
403  void operator=(const vtkGL2PSExporter&); // Not implemented
404 };
405 
406 inline const char *vtkGL2PSExporter::GetSortAsString(void)
407 {
408  if ( this->Sort == NO_SORT )
409  {
410  return "Off";
411  }
412  else if ( this->Sort == SIMPLE_SORT )
413  {
414  return "Simple";
415  }
416  else
417  {
418  return "BSP";
419  }
420 }
421 
423 {
424  if ( this->FileFormat == PS_FILE )
425  {
426  return "PS";
427  }
428  else if ( this->FileFormat == EPS_FILE )
429  {
430  return "EPS";
431  }
432  else if ( this->FileFormat == PDF_FILE )
433  {
434  return "PDF";
435  }
436  else if ( this->FileFormat == TEX_FILE )
437  {
438  return "TeX";
439  }
440  else
441  {
442  return "SVG";
443  }
444 }
445 
446 #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
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
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:62
Draw labeled isolines.
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()