NAME
vtkRenderWindow - create a window for renderers to draw into
SYNOPSIS
#include "/opt/vtk-c++/graphics/vtkRenderWindow.h"
class VTK_EXPORT vtkRenderWindow : public vtkObject
vtkRenderWindow();
~vtkRenderWindow();
static vtkRenderWindow *New();
const char *GetClassName() {return "vtkRenderWindow";};
void PrintSelf(ostream& os, vtkIndent indent);
void AddRenderer(vtkRenderer *);
void RemoveRenderer(vtkRenderer *);
vtkRendererCollection *GetRenderers() {return &(this->Renderers);};
virtual void Render();
virtual void Start() {};
virtual void Frame() {};
virtual void SetDisplayId(void *) {};
virtual void SetWindowId(void *) {};
virtual void SetParentId(void *) {};
virtual void SetWindowInfo(char *) {};
virtual void CopyResultFrame();
virtual vtkRenderer *MakeRenderer();
static char *GetRenderLibrary();
virtual vtkRenderWindowInteractor *MakeRenderWindowInteractor();
virtual int *GetPosition() {return (int *)NULL;};
virtual void SetPosition(int,int);
virtual void SetPosition(int a[2]);
virtual int *GetSize() {return (int *)NULL;};
virtual void SetSize(int,int) {};
virtual void SetSize(int a[2]);
virtual void SetFullScreen(int) {};
int GetFullScreen();
void FullScreenOn();
void FullScreenOff();
void SetBorders(int);
int GetBorders();
void BordersOn();
void BordersOff();
void SetMapped(int);
int GetMapped();
void MappedOn();
void MappedOff();
void SetDoubleBuffer(int);
int GetDoubleBuffer();
void DoubleBufferOn();
void DoubleBufferOff();
int GetStereoRender();
void SetStereoRender(int);
void StereoRenderOn();
void StereoRenderOff();
int GetStereoType();
void SetStereoType(int);
void SetStereoTypeToCrystalEyes()
{this->SetStereoType(VTK_STEREO_CRYSTAL_EYES);};
void SetStereoTypeToRedBlue()
{this->SetStereoType(VTK_STEREO_RED_BLUE);};
char *GetStereoTypeAsString();
virtual void StereoUpdate();
virtual void StereoMidpoint();
virtual void StereoRenderComplete();
virtual int GetRemapWindow();
virtual void WindowRemap() {};
void SetErase(int);
int GetErase();
void EraseOn();
void EraseOff();
void SetSwapBuffers(int);
int GetSwapBuffers();
void SwapBuffersOn();
void SwapBuffersOff();
char *GetWindowName();
virtual void SetWindowName( char * );
void SetFileName(char *);
char *GetFileName();
virtual void SaveImageAsPPM();
virtual int OpenPPMImageFile();
virtual void WritePPMImageFile();
virtual void ClosePPMImageFile();
virtual unsigned char *GetPixelData(int, int, int, int, int) {return (unsigned char *)NULL;};
virtual void SetPixelData(int, int, int, int, unsigned char *,int) {};
virtual float *GetRGBAPixelData(int ,int ,int ,int ,int ) {return (float *)NULL;};
virtual void SetRGBAPixelData(int ,int ,int ,int ,float *,int ) {};
virtual float *GetZbufferData(int, int, int, int ) {return (float *)NULL;};
virtual void SetZbufferData(int, int, int, int, float *) {};
int GetAAFrames();
void SetAAFrames(int);
int GetFDFrames();
void SetFDFrames(int);
int GetSubFrames();
void SetSubFrames(int);
int GetAbortRender();
void SetAbortRender(int);
int GetInAbortCheck();
virtual int CheckAbortStatus();
virtual int GetEventPending() { return 0;};
void SetAbortCheckMethod(void (*f)(void *), void *arg);
void SetAbortCheckMethodArgDelete(void (*f)(void *));
void SetDesiredUpdateRate(float);
float GetDesiredUpdateRate();
vtkRenderWindowInteractor *GetInteractor();
void SetInteractor(vtkRenderWindowInteractor *);
DESCRIPTION
vtkRenderWindow is an abstract object to specify the behavior of a rendering window. A rendering window is a window in a graphical user interface where renderers draw their images. Methods are provided to synchronize the rendering process, set window size, and control double buffering.
SEE ALSO
vtkRenderer vtkRenderMaster vtkRenderWindowInteractor
DEFINED MACROS
VTK_STEREO_CRYSTAL_EYES 1
virtual void Frame() {};
A termination method performed at the end of the rendering process to do things like swapping buffers (if necessary) or similar actions.
virtual void CopyResultFrame();
Performed at the end of the rendering process to generate image. This is typically done right before swapping buffers.
virtual vtkRenderer *MakeRenderer();
Create a device specific renderer. This is the only way to create a renderer that will work. This method is implemented in the subclasses of vtkRenderWindow so that each subclass will return the correct renderer for its graphics library.
virtual vtkRenderWindowInteractor *MakeRenderWindowInteractor(); Create an interactor to control renderers in this window. We need to know what type of interactor to create, because we might be in X Windows or MS Windows.
virtual int *GetPosition() {return (int *)NULL;};
Set/Get the position in screen coordinates of the rendering window.
virtual int *GetSize() {return (int *)NULL;};
Set/Get the size of the window in screen coordinates.
virtual void SetFullScreen(int) {};
Turn on/off rendering full screen window size.
void SetBorders(int)
Turn on/off window manager borders. Typically, you shouldn't turn the borders off, because that bypasses the window manager and can cause undesirable behavior.
void SetMapped(int)
Keep track of whether the rendering window has been mapped to screen.
void SetDoubleBuffer(int)
Turn on/off double buffering.
int GetStereoRender()
Turn on/off stereo rendering.
int GetStereoType()
Set/Get what type of stereo rendering to use.
void SetErase(int)
Turn on/off erasing the screen between images. This allows multiple exposure sequences if turned on. You will need to turn double buffering off or make use of the SwapBuffers methods to prevent you from swapping buffers between exposures.
void SetSwapBuffers(int)
Turn on/off buffer swapping between images.
char *GetWindowName()
Get name of rendering window
void SetFileName(char *)
Set/Get the FileName used for saving images. See the SaveImageAsPPM method.
virtual void SaveImageAsPPM();
Save the current image as a PPM file.
virtual unsigned char *GetPixelData(int, int, int, int, int) {return (unsigned char *)NULL;};
Set/Get the pixel data of an image, transmitted as RGBRGBRGB. The front argument indicates if the front buffer should be used or the back buffer. It is the caller's responsibility to delete the resulting array. It is very important to realize that the memory in this array is organized from the bottom of the window to the top. The origin of the screen is in the lower left corner. The y axis increases as you go up the screen. So the storage of pixels is from left to right and from bottom to top.
virtual float *GetRGBAPixelData(int ,int ,int ,int ,int ) {return (float *)NULL;};
Same as Get/SetPixelData except that the image also contains an alpha component. The image is transmitted as RGBARGBARGBA... each of which is a float value.
virtual float *GetZbufferData(int, int, int, int ) {return (float *)NULL;};
Set/Get the zbuffer data from the frame buffer.
int GetAAFrames()
Set the number of frames for doing antialiasing. The default is zero. Typically five or six will yield reasonable results without taking too long.
int GetFDFrames()
Set the number of frames for doing focal depth. The default is zero. Depending on how your scene is organized you can get away with as few as four frames for focal depth or you might need thirty. One thing to note is that if you are using focal depth frames, then you will not need many (if any) frames for antialiasing.
int GetSubFrames()
Set the number of sub frames for doing motion blur. The default is zero. Once this is set greater than one, you will no longer see a new frame for every Render(). If you set this to five, you will need to do five Render() invocations before seeing the result. This isn't very impressive unless something is changing between the Renders.
int GetAbortRender()
This is a flag that can be set to interrupt a rendering that is in progress.
float GetDesiredUpdateRate()
Set/Get the desired update rate. This is used with the vtkLODActor class. When using level of detail actors you need to specify what update rate you require. The LODActors then will pick the correct resolution to meet your desired update rate in frames per second. A value of zero indicates that they can use all the time they want to.
vtkRenderWindowInteractor *GetInteractor()
Get the interactor associated with this render window
char *GetStereoTypeAsString(void)
Return the stereo type as a character string.
vtkRenderWindow()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on, positioned at (0,0), double buffering turned on.
void SetAbortCheckMethod(void (*f)(void *), void *arg) Specify a function to be called to check and see if an abort of the rendering in progress is desired.
void SetAbortCheckMethodArgDelete(void (*f)(void *))
Set the arg delete method. This is used to free user memory.
vtkRenderWindowInteractor *MakeRenderWindowInteractor()
Create an interactor that will work with this renderer.
void SetInteractor(vtkRenderWindowInteractor *rwi)
Set the interactor that will work with this renderer.
void Render()
Ask each renderer owned by this RenderWindow to render its image and synchronize this process.
void DoAARender()
Handle rendering any antialiased frames.
void DoFDRender()
Handle rendering any focal depth frames.
void DoStereoRender()
Handle rendering the two different views for stereo rendering.
void AddRenderer(vtkRenderer *ren)
Add a renderer to the list of renderers.
void RemoveRenderer(vtkRenderer *ren)
Remove a renderer from the list of renderers.
void StereoUpdate(void)
Update the system, if needed, due to stereo rendering. For some stereo methods, subclasses might need to switch some hardware settings here.
void StereoMidpoint(void)
Intermediate method performs operations required between the rendering of the left and right eye.
void StereoRenderComplete(void)
Handles work required once both views have been rendered when using stereo rendering.
int GetRemapWindow(void)
This method indicates if a StereoOn/Off will require the window to be remapped. Some types of stereo rendering require a new window to be created.