#include <vtkCocoaRenderWindow.h>
vtkCocoaRenderWindow is a concrete implementation of the abstract class vtkOpenGLRenderWindow. It is only available on Mac OS X 10.3 and later. To use this class, build VTK with VTK_USE_COCOA turned ON. This class can be used by 32 and 64 bit processes, and either in garbage collected or reference counted modes. vtkCocoaRenderWindow uses Objective-C++, and the OpenGL and Cocoa APIs. This class's default behaviour is to create an NSWindow and a vtkCocoaGLView which are used together to draw all vtk stuff into. If you already have an NSWindow and vtkCocoaGLView and you want this class to use them you must call both SetRootWindow() and SetWindowId(), respectively, early on (before WindowInitialize() is executed).
Definition at line 46 of file vtkCocoaRenderWindow.h.
Public Types | |
typedef vtkOpenGLRenderWindow | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | Start () |
virtual void | Frame () |
virtual void | WindowConfigure () |
virtual void | Initialize () |
virtual void | SetFullScreen (int) |
virtual void | WindowRemap () |
virtual void | PrefFullScreen () |
virtual int * | GetSize () |
virtual int * | GetScreenSize () |
virtual int * | GetPosition () |
virtual void | SetWindowName (const char *) |
void | SetNextWindowInfo (char *) |
virtual void * | GetGenericDrawable () |
virtual void | SetDisplayId (void *) |
virtual void * | GetGenericDisplayId () |
virtual void | SetWindowInfo (char *) |
virtual void | SetParentInfo (char *) |
void | SetNextWindowId (void *) |
virtual void | StereoUpdate () |
virtual void | SetStereoCapableWindow (int capable) |
virtual void | MakeCurrent () |
virtual bool | IsCurrent () |
void | UpdateContext () |
const char * | ReportCapabilities () |
int | SupportsOpenGL () |
int | IsDirect () |
virtual void | SetForceMakeCurrent () |
virtual int | GetEventPending () |
void | Finalize () |
void | RegisterTextureResource (GLuint id) |
int | GetDepthBufferSize () |
virtual void | SetCurrentCursor (int) |
virtual int | GetWindowCreated () |
virtual void | SetRootWindow (void *) |
virtual void * | GetRootWindow () |
virtual void | SetWindowId (void *) |
virtual void | SetParentId (void *nsview) |
virtual void | SetSize (int *) |
virtual void | SetSize (int, int) |
virtual void | SetPosition (int *) |
virtual void | SetPosition (int, int) |
virtual void | SetupPalette (void *hDC) |
virtual void | SetupPixelFormat (void *hDC, void *dwFlags, int debug, int bpp=16, int zbpp=16) |
virtual void | HideCursor () |
virtual void | ShowCursor () |
virtual void | SetCursorPosition (int x, int y) |
void | SetContextId (void *) |
void * | GetContextId () |
virtual void * | GetGenericContext () |
virtual void * | GetWindowId () |
virtual void * | GetGenericWindowId () |
virtual void * | GetParentId () |
virtual void * | GetGenericParentId () |
virtual double | GetScaleFactor () |
void | SetPixelFormat (void *pixelFormat) |
void * | GetPixelFormat () |
Static Public Member Functions | |
static vtkCocoaRenderWindow * | New () |
static int | IsTypeOf (const char *type) |
static vtkCocoaRenderWindow * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkCocoaRenderWindow () | |
~vtkCocoaRenderWindow () | |
void | CreateGLContext () |
void | CreateAWindow () |
void | DestroyWindow () |
void | DestroyOffScreenWindow () |
void | SetCocoaManager (void *manager) |
void * | GetCocoaManager () |
Protected Attributes | |
int | OffScreenInitialized |
int | OnScreenInitialized |
float | ScaleFactor |
vtkCocoaRenderWindow::vtkCocoaRenderWindow | ( | ) | [protected] |
vtkCocoaRenderWindow::~vtkCocoaRenderWindow | ( | ) | [protected] |
static vtkCocoaRenderWindow* vtkCocoaRenderWindow::New | ( | ) | [static] |
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on, positioned at (0,0), double buffering turned on.
Reimplemented from vtkRenderWindow.
virtual const char* vtkCocoaRenderWindow::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkOpenGLRenderWindow.
static int vtkCocoaRenderWindow::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 vtkOpenGLRenderWindow.
virtual int vtkCocoaRenderWindow::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 vtkOpenGLRenderWindow.
static vtkCocoaRenderWindow* vtkCocoaRenderWindow::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkOpenGLRenderWindow.
void vtkCocoaRenderWindow::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 vtkOpenGLRenderWindow.
virtual void vtkCocoaRenderWindow::Start | ( | ) | [virtual] |
Begin the rendering process.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::Frame | ( | ) | [virtual] |
Finish the rendering process.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::WindowConfigure | ( | ) | [virtual] |
Specify various window parameters.
virtual void vtkCocoaRenderWindow::Initialize | ( | ) | [virtual] |
Initialize the window for rendering. virtual void WindowInitialize();
Initialize the rendering window.
virtual void vtkCocoaRenderWindow::SetFullScreen | ( | int | ) | [virtual] |
Change the window to fill the entire screen.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::WindowRemap | ( | ) | [virtual] |
Remap the window.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::PrefFullScreen | ( | ) | [virtual] |
Set the preferred window size to full screen.
virtual void vtkCocoaRenderWindow::SetSize | ( | int * | ) | [virtual] |
Set the size of the window in pixels.
virtual void vtkCocoaRenderWindow::SetSize | ( | int | , | |
int | ||||
) | [virtual] |
Set the size of the window in pixels.
Reimplemented from vtkWindow.
virtual int* vtkCocoaRenderWindow::GetSize | ( | ) | [virtual] |
Get the current size of the window in pixels.
Reimplemented from vtkWindow.
virtual void vtkCocoaRenderWindow::SetPosition | ( | int * | ) | [virtual] |
Set the position of the window.
virtual void vtkCocoaRenderWindow::SetPosition | ( | int | , | |
int | ||||
) | [virtual] |
Set the position of the window.
Reimplemented from vtkWindow.
virtual int* vtkCocoaRenderWindow::GetScreenSize | ( | ) | [virtual] |
Get the current size of the screen in pixels.
Implements vtkWindow.
virtual int* vtkCocoaRenderWindow::GetPosition | ( | ) | [virtual] |
Get the position in screen coordinates of the window.
Reimplemented from vtkWindow.
virtual void vtkCocoaRenderWindow::SetWindowName | ( | const char * | ) | [virtual] |
Set the name of the window. This appears at the top of the window normally.
Reimplemented from vtkWindow.
void vtkCocoaRenderWindow::SetNextWindowInfo | ( | char * | ) | [inline, virtual] |
Dummy stubs for vtkWindow API.
Implements vtkRenderWindow.
Definition at line 101 of file vtkCocoaRenderWindow.h.
virtual void* vtkCocoaRenderWindow::GetGenericDrawable | ( | ) | [inline, virtual] |
Dummy stubs for vtkWindow API.
Implements vtkRenderWindow.
Definition at line 105 of file vtkCocoaRenderWindow.h.
virtual void vtkCocoaRenderWindow::SetDisplayId | ( | void * | ) | [inline, virtual] |
Dummy stubs for vtkWindow API.
Implements vtkRenderWindow.
Definition at line 110 of file vtkCocoaRenderWindow.h.
virtual void* vtkCocoaRenderWindow::GetGenericDisplayId | ( | ) | [inline, virtual] |
Dummy stubs for vtkWindow API.
Implements vtkRenderWindow.
Definition at line 114 of file vtkCocoaRenderWindow.h.
virtual void vtkCocoaRenderWindow::SetWindowInfo | ( | char * | ) | [virtual] |
Set this RenderWindow's window id to a pre-existing window. The paramater is an ASCII string of a decimal number representing a pointer to the window.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetParentInfo | ( | char * | ) | [virtual] |
See the documenation for SetParentId(). This method allows the ParentId to be set as an ASCII string of a decimal number that is the memory address of the parent NSView.
Implements vtkRenderWindow.
void vtkCocoaRenderWindow::SetNextWindowId | ( | void * | ) | [inline, virtual] |
Dummy stubs for vtkWindow API.
Implements vtkRenderWindow.
Definition at line 130 of file vtkCocoaRenderWindow.h.
virtual void vtkCocoaRenderWindow::StereoUpdate | ( | ) | [virtual] |
Update system if needed due to stereo rendering.
Reimplemented from vtkOpenGLRenderWindow.
virtual void vtkCocoaRenderWindow::SetStereoCapableWindow | ( | int | capable | ) | [virtual] |
Prescribe that the window be created in a stereo-capable mode. This method must be called before the window is realized. This method overrrides the superclass method since this class can actually check whether the window has been realized yet.
Reimplemented from vtkRenderWindow.
virtual void vtkCocoaRenderWindow::MakeCurrent | ( | ) | [virtual] |
Make this windows OpenGL context the current context.
Implements vtkRenderWindow.
virtual bool vtkCocoaRenderWindow::IsCurrent | ( | ) | [virtual] |
Tells if this window is the current OpenGL context for the calling thread.
Implements vtkRenderWindow.
void vtkCocoaRenderWindow::UpdateContext | ( | ) |
Update this window's OpenGL context, e.g. when the window is resized.
const char* vtkCocoaRenderWindow::ReportCapabilities | ( | ) | [virtual] |
Get report of capabilities for the render window
Reimplemented from vtkRenderWindow.
int vtkCocoaRenderWindow::SupportsOpenGL | ( | ) | [virtual] |
Does this render window support OpenGL? 0-false, 1-true
Reimplemented from vtkRenderWindow.
int vtkCocoaRenderWindow::IsDirect | ( | ) | [virtual] |
Is this render window using hardware acceleration? 0-false, 1-true
Reimplemented from vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetForceMakeCurrent | ( | ) | [virtual] |
If called, allow MakeCurrent() to skip cache-check when called. MakeCurrent() reverts to original behavior of cache-checking on the next render.
Reimplemented from vtkRenderWindow.
virtual int vtkCocoaRenderWindow::GetEventPending | ( | ) | [virtual] |
Check to see if an event is pending for this window. This is a useful check to abort a long render.
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetupPalette | ( | void * | hDC | ) | [virtual] |
Initialize OpenGL for this window.
virtual void vtkCocoaRenderWindow::SetupPixelFormat | ( | void * | hDC, | |
void * | dwFlags, | |||
int | debug, | |||
int | bpp = 16 , |
|||
int | zbpp = 16 | |||
) | [virtual] |
Initialize OpenGL for this window.
void vtkCocoaRenderWindow::Finalize | ( | ) | [virtual] |
Clean up device contexts, rendering contexts, etc.
Implements vtkRenderWindow.
void vtkCocoaRenderWindow::RegisterTextureResource | ( | GLuint | id | ) |
Register a texture name with this render window
Reimplemented from vtkOpenGLRenderWindow.
int vtkCocoaRenderWindow::GetDepthBufferSize | ( | ) | [virtual] |
Get the size of the depth buffer.
Reimplemented from vtkOpenGLRenderWindow.
virtual void vtkCocoaRenderWindow::HideCursor | ( | ) | [virtual] |
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to display a 3D cursor instead. Set cursor position in window (note that (0,0) is the lower left corner).
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::ShowCursor | ( | ) | [virtual] |
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to display a 3D cursor instead. Set cursor position in window (note that (0,0) is the lower left corner).
Implements vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetCursorPosition | ( | int | x, | |
int | y | |||
) | [virtual] |
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to display a 3D cursor instead. Set cursor position in window (note that (0,0) is the lower left corner).
Reimplemented from vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetCurrentCursor | ( | int | ) | [virtual] |
Change the shape of the cursor.
Reimplemented from vtkRenderWindow.
virtual int vtkCocoaRenderWindow::GetWindowCreated | ( | ) | [virtual] |
Get the WindowCreated flag. It is 1 if this object created an instance of NSWindow, 0 otherwise.
void vtkCocoaRenderWindow::SetContextId | ( | void * | ) |
Accessors for the OpenGL context (Really an NSOpenGLContext*).
void* vtkCocoaRenderWindow::GetContextId | ( | ) |
Accessors for the OpenGL context (Really an NSOpenGLContext*).
virtual void* vtkCocoaRenderWindow::GetGenericContext | ( | ) | [inline, virtual] |
Accessors for the OpenGL context (Really an NSOpenGLContext*).
Implements vtkRenderWindow.
Definition at line 209 of file vtkCocoaRenderWindow.h.
virtual void vtkCocoaRenderWindow::SetRootWindow | ( | void * | ) | [virtual] |
Sets the NSWindow* associated with this vtkRenderWindow. This class' default behaviour, that is, if you never call SetWindowId()/SetRootWindow() is to create an NSWindow and a vtkCocoaGLView (NSView subclass) which are used together to draw all vtk stuff into. If you already have an NSWindow and NSView and you want this class to use them you must call both SetRootWindow() and SetWindowId(), respectively, early on (before WindowInitialize() is executed). In the case of Java, you should call only SetWindowId().
virtual void* vtkCocoaRenderWindow::GetRootWindow | ( | ) | [virtual] |
Returns the NSWindow* associated with this vtkRenderWindow.
virtual void vtkCocoaRenderWindow::SetWindowId | ( | void * | ) | [virtual] |
Sets the NSView* associated with this vtkRenderWindow. This class' default behaviour, that is, if you never call this SetWindowId()/SetRootWindow() is to create an NSWindow and a vtkCocoaGLView (NSView subclass) which are used together to draw all vtk stuff into. If you already have an NSWindow and NSView and you want this class to use them you must call both SetRootWindow() and SetWindowId(), respectively, early on (before WindowInitialize() is executed). In the case of Java, you should call only SetWindowId().
Implements vtkRenderWindow.
virtual void* vtkCocoaRenderWindow::GetWindowId | ( | ) | [virtual] |
Returns the NSView* associated with this vtkRenderWindow.
virtual void* vtkCocoaRenderWindow::GetGenericWindowId | ( | ) | [inline, virtual] |
Returns the NSView* associated with this vtkRenderWindow.
Implements vtkRenderWindow.
Definition at line 238 of file vtkCocoaRenderWindow.h.
virtual void vtkCocoaRenderWindow::SetParentId | ( | void * | nsview | ) | [virtual] |
Set the NSView* for the vtkRenderWindow to be parented within. The Position and Size of the RenderWindow will set the rectangle of the NSView that the vtkRenderWindow will create within this parent. If you set the WindowId, then this ParentId will be ignored.
Implements vtkRenderWindow.
virtual void* vtkCocoaRenderWindow::GetParentId | ( | ) | [virtual] |
Get the parent NSView* for this vtkRenderWindow. This method will return "NULL" if the parent was not set with SetParentId() or SetParentInfo().
virtual void* vtkCocoaRenderWindow::GetGenericParentId | ( | ) | [inline, virtual] |
Get the parent NSView* for this vtkRenderWindow. This method will return "NULL" if the parent was not set with SetParentId() or SetParentInfo().
Implements vtkRenderWindow.
Definition at line 252 of file vtkCocoaRenderWindow.h.
virtual double vtkCocoaRenderWindow::GetScaleFactor | ( | ) | [virtual] |
Returns the scaling factor for 'resolution independence', to convert between points and pixels.
void vtkCocoaRenderWindow::SetPixelFormat | ( | void * | pixelFormat | ) |
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
void* vtkCocoaRenderWindow::GetPixelFormat | ( | ) |
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
void vtkCocoaRenderWindow::CreateGLContext | ( | ) | [protected] |
void vtkCocoaRenderWindow::CreateAWindow | ( | ) | [protected, virtual] |
Create a not-off-screen window.
Implements vtkOpenGLRenderWindow.
void vtkCocoaRenderWindow::DestroyWindow | ( | ) | [protected, virtual] |
Destroy a not-off-screen window.
Implements vtkOpenGLRenderWindow.
void vtkCocoaRenderWindow::DestroyOffScreenWindow | ( | ) | [protected] |
void vtkCocoaRenderWindow::SetCocoaManager | ( | void * | manager | ) | [protected] |
Accessors for the cocoa manager (Really an NSMutableDictionary*). It manages all Cocoa objects in this C++ class.
void* vtkCocoaRenderWindow::GetCocoaManager | ( | ) | [protected] |
Accessors for the cocoa manager (Really an NSMutableDictionary*). It manages all Cocoa objects in this C++ class.
int vtkCocoaRenderWindow::OffScreenInitialized [protected] |
Definition at line 278 of file vtkCocoaRenderWindow.h.
int vtkCocoaRenderWindow::OnScreenInitialized [protected] |
Definition at line 279 of file vtkCocoaRenderWindow.h.
float vtkCocoaRenderWindow::ScaleFactor [protected] |
Definition at line 286 of file vtkCocoaRenderWindow.h.