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

imaging/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 =========================================================================*/
00056 #ifndef __vtkXImageWindow_h
00057 #define __vtkXImageWindow_h
00058 
00059 #include    <X11/Xlib.h>
00060 #include    <X11/Xutil.h>
00061 #include    <X11/cursorfont.h>
00062 #include    <X11/X.h>
00063 #include    <X11/keysym.h>
00064 
00065 #include        "vtkImageWindow.h"
00066 
00067 class VTK_EXPORT vtkXImageWindow : public vtkImageWindow
00068 {
00069 public:
00070   static vtkXImageWindow *New();
00071   vtkTypeMacro(vtkXImageWindow,vtkImageWindow);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00075   void SetWindowName(char* name);
00076   
00078   vtkGetMacro(NumberOfColors,int);
00079   
00081   vtkGetMacro(VisualDepth,int);
00082   
00084   vtkGetMacro(VisualClass,int);
00085   
00087   Window   GetParentId();
00088   void     SetParentId(Window);
00089   void     SetParentId(void *);
00090   void     SetDisplayId(Display *);
00091   void     SetDisplayId(void *);
00092   void     SetWindowId(Window);
00093   void     SetWindowId(void *);
00094   Window   GetWindowId();
00095   Display *GetDisplayId();
00096   GC       GetGC();
00097 
00099   int     *GetPosition();
00100   void     GetPosition(int* x, int* y) {this->vtkImageWindow::GetPosition(x, y);};
00101   void     SetPosition(int,int);
00102   void     SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); };
00103  
00105   int     *GetSize();
00106   void     GetSize(int* x, int* y) {this->vtkImageWindow::GetSize(x, y);};
00107   void     SetSize(int x, int y);
00108   void     SetSize(int a[2]) { this->SetSize(a[0], a[1]); };
00109   
00111   void *GetGenericDisplayId() {return (void*) this->DisplayId;};
00112   void *GetGenericWindowId() {return (void*) this->WindowId;};
00113   void *GetGenericParentId() {return (void*) this->ParentId;};
00114   void *GetGenericContext() {return (void*) this->Gc;};
00115   void *GetGenericDrawable();
00116 
00119   void SwapBuffers();
00120 
00122   void Frame();
00123 
00125   virtual int      GetDesiredDepth();
00126   
00128   virtual Colormap GetDesiredColormap();
00129 
00131   virtual Visual  *GetDesiredVisual();
00132 
00134   Visual *GetVisualId() {return VisualId;};
00135 
00137   void SetBackgroundColor(float r, float g, float b);
00138 
00140   void EraseWindow();
00141 
00150   unsigned char *GetPixelData(int x1, int y1, int x2, int y2, int);
00151 
00152 
00153 protected:
00154   vtkXImageWindow();
00155   ~vtkXImageWindow();
00156   vtkXImageWindow(const vtkXImageWindow&) {};
00157   void operator=(const vtkXImageWindow&) {};
00158 
00159   // X stuff
00160   Window               ParentId;
00161   Window        WindowId;
00162   Display             *DisplayId;
00163   Visual              *VisualId;
00164   int                  VisualDepth;
00165   int                  VisualClass;
00166   Colormap             ColorMap;
00167   GC                   Gc;
00168   int                Offset;
00169   XColor               Colors[256];
00170   int                  NumberOfColors;
00171   Pixmap               Drawable;
00172   int                  OwnDisplay;
00173   int                  PixmapWidth;
00174   int                  PixmapHeight;
00175 
00176   
00177   void MakeDefaultWindow();
00178   void GetDefaultVisualInfo(XVisualInfo *info);
00179   Colormap MakeColorMap(Visual *visual);
00180   void AllocateDirectColorMap();
00181   void GetShiftsScalesAndMasks(int &rshift, int &gshift, int &bshift,
00182                 int &rscale, int &gscale, int &bscale,
00183                 unsigned long &rmask, unsigned long &gmask,
00184                 unsigned long &bmask);
00185 };
00186 
00187 #endif
00188 
00189 
00190 
00191 
00192 

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