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

imaging/vtkWin32ImageWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkWin32ImageWindow.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00053 #ifndef __vtkWin32ImageWindow_h
00054 #define __vtkWin32ImageWindow_h
00055 
00056 
00057 #include    "vtkImageWindow.h"
00058 
00059 #ifndef VTK_REMOVE_LEGACY_CODE
00060 class VTK_EXPORT vtkWin32ImageWindow : public vtkImageWindow 
00061 {
00062 public:
00063   HINSTANCE ApplicationInstance;
00064   HPALETTE  Palette;
00065   HDC       DeviceContext;
00066   HWND      WindowId;
00067   HWND      ParentId;
00068 
00069   static vtkWin32ImageWindow *New();
00070   vtkTypeMacro(vtkWin32ImageWindow,vtkImageWindow);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00075   void SwapBuffers();
00076   
00079   void Frame();
00080 
00081   // output to the viewer.
00082   vtkWin32ImageWindow *GetOutput(){return this;};
00083   
00084   //BTX
00085 
00087   HWND GetWindowId(); 
00088   void SetWindowId(void* id) {this->WindowId = (HWND) id;};
00089   void SetParentId(void* id) {this->ParentId = (HWND) id;};
00090   void SetWindowId(HWND);
00091   void SetParentId(HWND);
00092 
00093   void SetDeviceContext(void* dc) {this->DeviceContext = (HDC) dc;};
00094   void SetDeviceContext(HDC);
00095   void SetDisplayId(void *foo) {vtkDebugMacro(<<"SetDisplayID not implemented");};
00096 
00097   void *GetGenericDisplayId() 
00098         {vtkDebugMacro(<<"Display ID not implemented in Win32."); return (void*) NULL;};
00099   void *GetGenericWindowId() {return (void*) this->WindowId;};
00100   void *GetGenericParentId() {return (void*) this->ParentId;};
00101   void *GetGenericContext() {return (void*) this->DeviceContext;};
00102   //ETX
00103 
00105   void   SetSize(int,int);
00106   int   *GetSize();
00107 
00109   int   *GetPosition();
00110   void   SetPosition(int,int);
00111 
00113   void SetBackgroundColor(float r, float g, float b);
00114 
00116   void EraseWindow();
00117 
00118   unsigned char *GetDIBPtr();
00119   unsigned char *GetPixelData(int x1, int y1, int x2, int y2, int);
00120   
00122   void MakeDefaultWindow();  
00123 
00126   void SetupMemoryRendering(int x, int y, HDC prn);
00127   void ResumeScreenRendering();
00128   HDC GetMemoryDC();
00129   unsigned char *GetMemoryData(){return this->MemoryData;};
00130 
00131 protected:
00132   vtkWin32ImageWindow();
00133   ~vtkWin32ImageWindow();
00134   vtkWin32ImageWindow(const vtkWin32ImageWindow&) {};
00135   void operator=(const vtkWin32ImageWindow&) {};
00136 
00137   // the following is used to support rendering into memory
00138   BITMAPINFO MemoryDataHeader;
00139   HBITMAP MemoryBuffer;
00140   unsigned char *MemoryData;  // the data in the DIBSection
00141   HDC MemoryHdc;
00142   int ScreenMapped;
00143   int ScreenWindowSize[2];
00144   HDC ScreenDeviceContext;
00145 
00146   int OwnWindow; // do we create this window ?
00147 
00148   unsigned char *DIBPtr;   // the data in the DIBSection
00149   int SwapFlag;
00150   HDC CompatHdc;
00151   HDC OldHdc;
00152   HBITMAP BackBuffer;
00153   BITMAPINFO DataHeader;
00154 };
00155 
00156 #endif
00157 
00158 #endif

Generated on Wed Nov 21 12:27:09 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001