Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Rendering/vtkQuartzRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkQuartzRenderWindow.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2000 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00051 #ifndef __vtkQuartzRenderWindow_h
00052 #define __vtkQuartzRenderWindow_h
00053 
00054 #include <stdlib.h>
00055 #include "vtkRenderWindow.h"
00056 #include "vtkMutexLock.h"
00057 #include <OpenGL/gl.h>
00058 #endif
00059 
00060 class vtkIdList;
00061 
00062 class VTK_RENDERING_EXPORT vtkQuartzRenderWindow : public vtkRenderWindow
00063 {
00064 public:
00065   static vtkQuartzRenderWindow *New();
00066   vtkTypeMacro(vtkQuartzRenderWindow,vtkRenderWindow);
00067   void PrintSelf(ostream& os, vtkIndent indent);
00068 
00070   void Start(void);
00071 
00073   void Frame(void);
00074 
00076   virtual void WindowConfigure(void);
00077 
00079   virtual void WindowInitialize(void);
00080 
00082   virtual void Initialize(void);
00083 
00085   virtual void SetFullScreen(int);
00086 
00088   virtual void WindowRemap(void);
00089 
00091   virtual void PrefFullScreen(void);
00092 
00094   virtual void SetSize(int,int);
00095 
00097   virtual int *GetSize();
00098 
00100   virtual void SetPosition(int,int);
00101   
00103   virtual int *GetScreenSize();
00104 
00106   virtual int *GetPosition();
00107 
00110   virtual void SetWindowName(char *);
00111   
00113   void SetWindowInfo(void *);
00114 
00115   //BTX
00116   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00117   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00118   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00119   virtual void SetDisplayId(void *) {};
00120 
00122   virtual void *GetWindowId();
00123 
00125   virtual void  SetWindowId(void *);
00126   
00127   void  SetContextId(void *);   // hsr
00128   void  SetDeviceContext(void *);       // hsr
00129 
00130   //ETX
00131 
00132   // supply base class virtual function
00133   vtkSetMacro(MultiSamples,int);
00134   vtkGetMacro(MultiSamples,int);
00135 
00137   virtual void StereoUpdate();
00138   
00143   virtual void SetStereoCapableWindow(int capable);
00144 
00146 
00147   virtual unsigned char *GetPixelData(int x,int y,int x2,int y2,int front);
00148   virtual void SetPixelData(int x,int y,int x2,int y2,unsigned char *,
00149                             int front);
00151 
00153 
00154   virtual float *GetRGBAPixelData(int x,int y,int x2,int y2,int front);
00155   virtual void SetRGBAPixelData(int x,int y,int x2,int y2,float *,int front,
00156                                 int blend=0);
00157   virtual void ReleaseRGBAPixelData(float *data);
00159 
00161 
00162   virtual float *GetZbufferData( int x1, int y1, int x2, int y2 );
00163   virtual void SetZbufferData( int x1, int y1, int x2, int y2, float *buffer );
00165 
00167   void MakeCurrent();
00168 
00171   virtual  int GetEventPending();
00172 
00180   virtual void OpenGLInit();
00181   virtual void SetupPalette(void *hDC);
00182   virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug, 
00183                                 int bpp=16, int zbpp=16);
00185   
00187   void Clean();
00188 
00190   void RegisterTextureResource (GLuint id);
00191 
00193   int GetDepthBufferSize();
00194 
00196 
00198   void HideCursor();
00199   void ShowCursor();
00201   
00202   void UpdateSizeAndPosition(int xPos, int yPos, int xSize, int ySize);
00203 
00204   
00205 protected:
00206   vtkQuartzRenderWindow();
00207   ~vtkQuartzRenderWindow();
00208 
00209   int       ApplicationInitialized; //NSApplication called?
00210   void     *ContextId;
00211   void     *DeviceContext;
00212   void     *WindowId;
00213   void     *WindowController;
00214   int       OwnWindow;
00215   int       ScreenSize[2];
00216   int       MultiSamples;
00217   vtkIdList *TextureResourceIds;
00218 
00219   // the following is used to support rendering into memory
00220 //  void *MemoryDataHeader;
00221 //  void *MemoryBuffer;
00222 //  unsigned char *MemoryData;  // the data in the DIBSection
00223 //  void *MemoryHdc;
00224 
00225   int ScreenMapped;
00226   int ScreenWindowSize[2];
00227   void *ScreenDeviceContext;
00228   int ScreenDoubleBuffer;
00229   void *ScreenContextId;
00230 
00231   int CursorHidden;
00232 
00233 private:
00234   vtkQuartzRenderWindow(const vtkQuartzRenderWindow&);  // Not implemented.
00235   void operator=(const vtkQuartzRenderWindow&);  // Not implemented.
00236 };
00237 

Generated on Thu Mar 28 14:19:33 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001