VTK  9.3.0
vtkRIBExporter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
42 #ifndef vtkRIBExporter_h
43 #define vtkRIBExporter_h
44 
45 #include "vtkExporter.h"
46 #include "vtkIOExportModule.h" // For export macro
47 
48 VTK_ABI_NAMESPACE_BEGIN
49 class vtkActor;
50 class vtkCamera;
51 class vtkLight;
52 class vtkPolyData;
53 class vtkProperty;
54 class vtkRenderer;
55 class vtkTexture;
57 
58 class VTKIOEXPORT_EXPORT vtkRIBExporter : public vtkExporter
59 {
60 public:
61  static vtkRIBExporter* New();
62  vtkTypeMacro(vtkRIBExporter, vtkExporter);
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
70  vtkSetVector2Macro(Size, int);
71  vtkGetVectorMacro(Size, int, 2);
73 
75 
78  vtkSetVector2Macro(PixelSamples, int);
79  vtkGetVectorMacro(PixelSamples, int, 2);
81 
83 
87  vtkSetFilePathMacro(FilePrefix);
88  vtkGetFilePathMacro(FilePrefix);
90 
92 
95  vtkSetStringMacro(TexturePrefix);
96  vtkGetStringMacro(TexturePrefix);
98 
100 
117  vtkSetMacro(Background, vtkTypeBool);
118  vtkGetMacro(Background, vtkTypeBool);
119  vtkBooleanMacro(Background, vtkTypeBool);
121 
123 
128  vtkSetClampMacro(ExportArrays, vtkTypeBool, 0, 1);
129  vtkBooleanMacro(ExportArrays, vtkTypeBool);
130  vtkGetMacro(ExportArrays, vtkTypeBool);
132 
133 protected:
135  ~vtkRIBExporter() override;
136 
138  int Size[2];
139  int PixelSamples[2];
140 
145 
147 
151  void WriteTrailer();
152  void WriteTexture(vtkTexture* aTexture);
153  void WriteViewport(vtkRenderer* aRenderer, int size[2]);
154  void WriteCamera(vtkCamera* aCamera);
155  void WriteLight(vtkLight* aLight, int count);
156  void WriteAmbientLight(int count);
157  void WriteProperty(vtkProperty* aProperty, vtkTexture* aTexture);
159  void WriteStrips(vtkPolyData* pd, vtkUnsignedCharArray* colors, vtkProperty* aProperty);
161 
162  void WriteData() override;
163  void WriteActor(vtkActor* anActor);
164 
171  void ModifyArrayName(char* newname, const char* name);
172 
173  char* GetTextureName(vtkTexture* aTexture);
174  char* GetTIFFName(vtkTexture* aTexture);
175  char* FilePrefix;
176  FILE* FilePtr;
178 
179 private:
180  vtkRIBExporter(const vtkRIBExporter&) = delete;
181  void operator=(const vtkRIBExporter&) = delete;
182 };
183 
184 VTK_ABI_NAMESPACE_END
185 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
abstract class to write a scene to a file
Definition: vtkExporter.h:37
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual light for 3D rendering
Definition: vtkLight.h:58
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
represent surface properties of a geometric object
Definition: vtkProperty.h:66
export a scene into RenderMan RIB format.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void WriteLight(vtkLight *aLight, int count)
Write the RIB header.
void WriteTexture(vtkTexture *aTexture)
Write the RIB header.
void WriteProperty(vtkProperty *aProperty, vtkTexture *aTexture)
Write the RIB header.
static vtkRIBExporter * New()
void WriteActor(vtkActor *anActor)
char * GetTextureName(vtkTexture *aTexture)
void WriteCamera(vtkCamera *aCamera)
Write the RIB header.
~vtkRIBExporter() override
vtkTypeBool ExportArrays
This variable defines whether the arrays are exported or not.
vtkSetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void WriteData() override
char * GetTIFFName(vtkTexture *aTexture)
vtkTypeBool Background
void WriteStrips(vtkPolyData *pd, vtkUnsignedCharArray *colors, vtkProperty *aProperty)
Write the RIB header.
vtkGetFilePathMacro(FilePrefix)
Specify the prefix of the files to write out.
void WriteViewport(vtkRenderer *aRenderer, int size[2])
Write the RIB header.
void WriteTrailer()
Write the RIB header.
void WriteAmbientLight(int count)
Write the RIB header.
void WriteHeader(vtkRenderer *aRen)
Write the RIB header.
void ModifyArrayName(char *newname, const char *name)
Since additional variables are sent to the shader as variables, and their names are used in the shade...
void WritePolygons(vtkPolyData *pd, vtkUnsignedCharArray *colors, vtkProperty *aProperty)
Write the RIB header.
abstract specification for renderers
Definition: vtkRenderer.h:71
handles properties associated with a texture map
Definition: vtkTexture.h:67
dynamic, self-adjusting array of unsigned char
@ Background
Definition: vtkX3D.h:71
@ name
Definition: vtkX3D.h:219
@ size
Definition: vtkX3D.h:253
int vtkTypeBool
Definition: vtkABI.h:64