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

Rendering/vtkXImageWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXImageWindow.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 =========================================================================*/
00054 #ifndef __vtkXImageWindow_h
00055 #define __vtkXImageWindow_h
00056 
00057 #include        <X11/Xlib.h>
00058 #include        <X11/Xutil.h>
00059 #include        <X11/cursorfont.h>
00060 #include        <X11/X.h>
00061 #include        <X11/keysym.h>
00062 
00063 #include        "vtkImageWindow.h"
00064 
00065 class VTK_RENDERING_EXPORT vtkXImageWindow : public vtkImageWindow
00066 {
00067 public:
00068   static vtkXImageWindow *New();
00069   vtkTypeMacro(vtkXImageWindow,vtkImageWindow);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073   void SetWindowName(char* name);
00074   
00076 
00077   vtkGetMacro(NumberOfColors,int);
00079   
00081 
00082   vtkGetMacro(VisualDepth,int);
00084   
00086 
00087   vtkGetMacro(VisualClass,int);
00089   
00091 
00092   Window   GetParentId();
00093   void     SetParentId(Window);
00094   void     SetParentId(void *);
00095   void     SetDisplayId(Display *);
00096   void     SetDisplayId(void *);
00097   void     SetWindowId(Window);
00098   void     SetWindowId(void *);
00099   Window   GetWindowId();
00100   Display *GetDisplayId();
00101   GC       GetGC();
00103 
00105 
00106   int     *GetPosition();
00107   void     GetPosition(int* x, int* y) {this->vtkImageWindow::GetPosition(x, y);};
00108   void     SetPosition(int,int);
00109   void     SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); };
00111  
00113 
00114   int     *GetSize();
00115   void     GetSize(int* x, int* y) {this->vtkImageWindow::GetSize(x, y);};
00116   void     SetSize(int x, int y);
00117   void     SetSize(int a[2]) { this->SetSize(a[0], a[1]); };
00119   
00121 
00122   void *GetGenericDisplayId() {return (void*) this->DisplayId;};
00123   void *GetGenericWindowId() {return (void*) this->WindowId;};
00124   void *GetGenericParentId() {return (void*) this->ParentId;};
00125   void *GetGenericContext() {return (void*) this->Gc;};
00126   void *GetGenericDrawable();
00128 
00131   void SwapBuffers();
00132 
00134   void Frame();
00135 
00137   virtual int      GetDesiredDepth();
00138   
00140   virtual Colormap GetDesiredColormap();
00141 
00143   virtual Visual  *GetDesiredVisual();
00144 
00146   Visual *GetVisualId() {return VisualId;};
00147 
00149   void SetBackgroundColor(float r, float g, float b);
00150 
00152   void EraseWindow();
00153 
00162   unsigned char *GetPixelData(int x1, int y1, int x2, int y2, int);
00163 
00165   void     SetWindowInfo(char *info);
00166 
00168   void     SetParentInfo(char *info);
00169 
00170 protected:
00171   vtkXImageWindow();
00172   ~vtkXImageWindow();
00173 
00174   // X stuff
00175   Window               ParentId;
00176   Window               WindowId;
00177   Display             *DisplayId;
00178   Visual              *VisualId;
00179   int                  VisualDepth;
00180   int                  VisualClass;
00181   Colormap             ColorMap;
00182   GC                   Gc;
00183   int                  Offset;
00184   XColor               Colors[256];
00185   int                  NumberOfColors;
00186   Pixmap               Drawable;
00187   int                  OwnDisplay;
00188   int                  PixmapWidth;
00189   int                  PixmapHeight;
00190 
00191   
00192   void MakeDefaultWindow();
00193   void GetDefaultVisualInfo(XVisualInfo *info);
00194   Colormap MakeColorMap(Visual *visual);
00195   void AllocateDirectColorMap();
00196   void GetShiftsScalesAndMasks(int &rshift, int &gshift, int &bshift,
00197                                int &rscale, int &gscale, int &bscale,
00198                                unsigned long &rmask, unsigned long &gmask,
00199                                unsigned long &bmask);
00200 private:
00201   vtkXImageWindow(const vtkXImageWindow&);  // Not implemented.
00202   void operator=(const vtkXImageWindow&);  // Not implemented.
00203 };
00204 
00205 #endif
00206 
00207 
00208 
00209 
00210 

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