VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkFrameBufferObject Class Reference

internal class which encapsulates OpenGL frame buffer object. Not to be used directly. More...

#include <vtkFrameBufferObject.h>

Inheritance diagram for vtkFrameBufferObject:
Inheritance graph
[legend]
Collaboration diagram for vtkFrameBufferObject:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkFrameBufferObjectNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void Bind ()
void UnBind ()
void SetColorBuffer (unsigned int index, vtkTextureObject *texture, unsigned int zslice=0)
vtkTextureObjectGetColorBuffer (unsigned int index)
void RemoveColorBuffer (unsigned int index)
void RemoveAllColorBuffers ()
unsigned int GetMaximumNumberOfActiveTargets ()
unsigned int GetMaximumNumberOfRenderTargets ()
void SetContext (vtkRenderWindow *context)
vtkRenderWindowGetContext ()
bool Start (int width, int height, bool shaderSupportsTextureInt)
bool StartNonOrtho (int width, int height, bool shaderSupportsTextureInt)
void RenderQuad (int minX, int maxX, int minY, int maxY)
void SetActiveBuffer (unsigned int index)
void SetActiveBuffers (int numbuffers, unsigned int indices[])
void SetDepthBuffer (vtkTextureObject *depthTexture)
void RemoveDepthBuffer ()
virtual void SetDepthBufferNeeded (bool)
virtual bool GetDepthBufferNeeded ()
void SetNumberOfRenderTargets (unsigned int)
virtual unsigned int GetNumberOfRenderTargets ()
virtual intGetLastSize ()
virtual void GetLastSize (int &, int &)
virtual void GetLastSize (int[2])

Static Public Member Functions

static vtkFrameBufferObjectNew ()
static int IsTypeOf (const char *type)
static vtkFrameBufferObjectSafeDownCast (vtkObjectBase *o)
static bool IsSupported (vtkRenderWindow *renWin)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
void CheckFrameBufferStatus ()
void DisplayFrameBufferAttachments ()
void DisplayFrameBufferAttachment (unsigned int uattachment)
void DisplayDrawBuffers ()
void DisplayReadBuffer ()
void DisplayBuffer (int value)
 vtkFrameBufferObject ()
 ~vtkFrameBufferObject ()
void CreateFBO ()
void DestroyFBO ()
void Create (int width, int height)
void CreateBuffers (int width, int height)
void CreateColorBuffers (int width, int height, bool shaderSupportsTextureInt)
void Destroy ()
void DestroyBuffers ()
void DestroyColorBuffers ()
void ActivateBuffers ()
bool LoadRequiredExtensions (vtkOpenGLExtensionManager *manager)

Protected Attributes

vtkWeakPointer< vtkRenderWindowContext
bool DepthBufferNeeded
bool ColorBuffersDirty
unsigned int FBOIndex
int PreviousFBOIndex
unsigned int DepthBuffer
unsigned int NumberOfRenderTargets
int LastSize [2]
std::vector< unsigned intUserZSlices
std::vector< vtkSmartPointer
< vtkTextureObject > > 
UserColorBuffers
std::vector< vtkSmartPointer
< vtkTextureObject > > 
ColorBuffers
std::vector< unsigned intActiveBuffers
vtkSmartPointer< vtkTextureObjectUserDepthBuffer
bool DepthBufferDirty

Detailed Description

internal class which encapsulates OpenGL frame buffer object. Not to be used directly.

Encapsulates an OpenGL Frame Buffer Object. For use by vtkOpenGLFBORenderWindow, not to be used directly.

Warning:
DON'T PLAY WITH IT YET.

Definition at line 40 of file vtkFrameBufferObject.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Definition at line 44 of file vtkFrameBufferObject.h.


Constructor & Destructor Documentation


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

static int vtkFrameBufferObject::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkFrameBufferObject::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented from vtkObject.

virtual vtkObjectBase* vtkFrameBufferObject::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkObject.

Reimplemented from vtkObject.

void vtkFrameBufferObject::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

Get/Set the context. Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

Get/Set the context. Context must be a vtkOpenGLRenderWindow. This does not increase the reference count of the context to avoid reference loops. SetContext() may raise an error is the OpenGL context does not support the required OpenGL extensions.

bool vtkFrameBufferObject::Start ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

User must take care that width/height match the dimensions of the user defined texture attachments. This method makes the "active buffers" the buffers that will get drawn into by subsequent drawing calls. Note that this does not clear the render buffers i.e. no glClear() calls are made by either of these methods. It's up to the caller to clear the buffers if needed.

bool vtkFrameBufferObject::StartNonOrtho ( int  width,
int  height,
bool  shaderSupportsTextureInt 
)

User must take care that width/height match the dimensions of the user defined texture attachments. This method makes the "active buffers" the buffers that will get drawn into by subsequent drawing calls. Note that this does not clear the render buffers i.e. no glClear() calls are made by either of these methods. It's up to the caller to clear the buffers if needed.

void vtkFrameBufferObject::RenderQuad ( int  minX,
int  maxX,
int  minY,
int  maxY 
)

Renders a quad at the given location with pixel coordinates. This method is provided as a convenience, since we often render quads in a FBO.

Precondition:
positive_minX: minX>=0
increasing_x: minX<=maxX
valid_maxX: maxX<LastSize[0]
positive_minY: minY>=0
increasing_y: minY<=maxY
valid_maxY: maxY<LastSize[1]

Save the current framebuffer and make the frame buffer active. Multiple calls to Bind has no effect.

Restore the framebuffer saved with the call to Bind(). Multiple calls to UnBind has no effect.

void vtkFrameBufferObject::SetActiveBuffer ( unsigned int  index) [inline]

Choose the buffer to render into.

Definition at line 93 of file vtkFrameBufferObject.h.

void vtkFrameBufferObject::SetActiveBuffers ( int  numbuffers,
unsigned int  indices[] 
)

Choose the buffer to render into. This is available only if the GL_ARB_draw_buffers extension is supported by the card.

void vtkFrameBufferObject::SetColorBuffer ( unsigned int  index,
vtkTextureObject texture,
unsigned int  zslice = 0 
)
void vtkFrameBufferObject::RemoveColorBuffer ( unsigned int  index)

Set the texture to use as depth buffer.

Set the texture to use as depth buffer.

virtual void vtkFrameBufferObject::SetDepthBufferNeeded ( bool  ) [virtual]

If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.

virtual bool vtkFrameBufferObject::GetDepthBufferNeeded ( ) [virtual]

If true, the frame buffer object will be initialized with a depth buffer. Initial value is true.

Set/Get the number of render targets to render into at once.

virtual unsigned int vtkFrameBufferObject::GetNumberOfRenderTargets ( ) [virtual]

Set/Get the number of render targets to render into at once.

Returns the maximum number of targets that can be rendered to at one time. This limits the active targets set by SetActiveTargets(). The return value is valid only if GetContext is non-null.

Returns the maximum number of render targets available. This limits the available attachement points for SetColorAttachment(). The return value is valid only if GetContext is non-null.

virtual int* vtkFrameBufferObject::GetLastSize ( ) [virtual]

Dimensions in pixels of the framebuffer.

virtual void vtkFrameBufferObject::GetLastSize ( int ,
int  
) [virtual]

Dimensions in pixels of the framebuffer.

virtual void vtkFrameBufferObject::GetLastSize ( int  [2]) [virtual]

Dimensions in pixels of the framebuffer.

static bool vtkFrameBufferObject::IsSupported ( vtkRenderWindow renWin) [static]

Returns if the context supports the required extensions.

Display the status of the current framebuffer on the standard output.

Display all the attachments of the current framebuffer object.

void vtkFrameBufferObject::DisplayFrameBufferAttachment ( unsigned int  uattachment) [protected]

Display a given attachment for the current framebuffer object.

Display the draw buffers.

Display the read buffer.

void vtkFrameBufferObject::DisplayBuffer ( int  value) [protected]

Display any buffer (convert value into string).

void vtkFrameBufferObject::CreateFBO ( ) [protected]
void vtkFrameBufferObject::DestroyFBO ( ) [protected]
void vtkFrameBufferObject::Create ( int  width,
int  height 
) [protected]
void vtkFrameBufferObject::CreateBuffers ( int  width,
int  height 
) [protected]
void vtkFrameBufferObject::CreateColorBuffers ( int  width,
int  height,
bool  shaderSupportsTextureInt 
) [protected]
void vtkFrameBufferObject::Destroy ( ) [protected]

Load all necessary extensions.


Member Data Documentation

Definition at line 180 of file vtkFrameBufferObject.h.

Definition at line 182 of file vtkFrameBufferObject.h.

Definition at line 183 of file vtkFrameBufferObject.h.

unsigned int vtkFrameBufferObject::FBOIndex [protected]

Definition at line 184 of file vtkFrameBufferObject.h.

Definition at line 185 of file vtkFrameBufferObject.h.

unsigned int vtkFrameBufferObject::DepthBuffer [protected]

Definition at line 186 of file vtkFrameBufferObject.h.

Definition at line 188 of file vtkFrameBufferObject.h.

Definition at line 191 of file vtkFrameBufferObject.h.

std::vector<unsigned int> vtkFrameBufferObject::UserZSlices [protected]

Definition at line 210 of file vtkFrameBufferObject.h.

Definition at line 211 of file vtkFrameBufferObject.h.

Definition at line 212 of file vtkFrameBufferObject.h.

std::vector<unsigned int> vtkFrameBufferObject::ActiveBuffers [protected]

Definition at line 213 of file vtkFrameBufferObject.h.

Definition at line 214 of file vtkFrameBufferObject.h.

Definition at line 215 of file vtkFrameBufferObject.h.


The documentation for this class was generated from the following file: