casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
casa::GLPixelCanvas Class Reference

OpenGL implementation of PixelCanvas. More...

#include <GLPixelCanvas.h>

Inheritance diagram for casa::GLPixelCanvas:
casa::PixelCanvas

List of all members.

Classes

class  GLPCColorValue
 Holds both a color index and RGBA values. More...

Public Member Functions

 GLPixelCanvas (Widget parent, GLPixelCanvasColorTable *glpcctbl, uInt width, uInt height)
 
Caution: Drawing can not take place until the window exists!

virtual ~GLPixelCanvas ()
virtual void enableMotionEvents ()
 enabling/disabling of event tracking (unimplemented)
virtual void disableMotionEvents ()
virtual void enablePositionEvents ()
virtual void disablePositionEvents ()
virtual Bool supportsLists ()
 Does this canvas support cached display lists? The user of the canvas should always check this, because undefined behaviour can result when an attempt is made to use a list on a PixelCanvas which does not support lists.
virtual uInt newList ()
 begin caching display commands - return list ID
virtual void endList ()
 end caching display commands
virtual void drawList (uInt list)
 (Cacheable) recall cached display commands
virtual void translateAllLists (Int xt, Int yt)
 translate all lists
virtual void translateList (uInt list, Int xt, Int yt)
 translate the list
virtual void deleteList (uInt list)
 remove list from cache
virtual void deleteLists ()
 flush all lists from the cache
virtual Bool validList (uInt list)
 return True if the list exists
virtual Bool setFont (const String &fontName)
 (Cacheable) Set the font to the recognizable font name.
virtual void drawText (Int x, Int y, const String &text, Display::TextAlign alignment=Display::AlignCenter)
 (Cacheable) Draw text using that font aligned in some way to the position.
virtual void drawImage (const Matrix< uInt > &data, Int x, Int y)
 (Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>
virtual void drawImage (const Matrix< Int > &data, Int x, Int y)
virtual void drawImage (const Matrix< uLong > &data, Int x, Int y)
virtual void drawImage (const Matrix< Float > &data, Int x, Int y)
virtual void drawImage (const Matrix< Double > &data, Int x, Int y)
void GLPixelCanvas::drawIndexedImage (const Matrix< uInt > &data, Float x=0.0, Float y=0.0, Float z=0.0, Float xscl=1.0, Float yscl=1.0)
 (Cacheable) Draw an image using color indexes.
virtual void drawImage (const Int &x, const Int &y, const Matrix< uInt > &data, const Matrix< Bool > &mask, Bool opaqueMask=False)
 (Cacheable) Draw an array of 2D color data as a raster image, taking note of the Bool mask.
virtual void drawImage (const Matrix< uInt > &data, Int x, Int y, uInt xzoom, uInt yzoom)
 (Cacheable) Draw an array of 2D color data as a raster image for any positive integer zoom
virtual void drawImage (const Matrix< Int > &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage (const Matrix< uLong > &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage (const Matrix< Float > &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage (const Matrix< Double > &data, Int x, Int y, uInt xzoom, uInt yzoom)
virtual void drawImage (const Matrix< uInt > &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)
 (Cacheable) Draw a component of a multi-channel image, storing it in buffers until flushComponentImages() is called.
virtual void bufferComponent (const Matrix< uInt > &data, const Int &x, const Int &y, const Display::ColorComponent &colorcomponent)
 Fill one of the channel buffers.
virtual void flushComponentBuffers ()
 (NOT CACHEABLE!) Flush the component buffers.
virtual void drawPoint (Int x1, Int y1)
 (Cacheable) Draw a single point using current color
virtual void drawPoint (Float x1, Float y1)
virtual void drawPoint3D (Float x1, Float y1, Float z1)
virtual void drawPoint (Double x1, Double y1)
virtual void drawPoints (const Matrix< Int > &verts)
 (Cacheable) Draw N points specified as a Nx2 matrix
virtual void drawPoints (const Matrix< Float > &verts)
void drawPoints3D (const Matrix< Float > &verts)
virtual void drawPoints (const Matrix< Double > &verts)
virtual void drawPoints (const Vector< Int > &x1, const Vector< Int > &y1)
 (Cacheable) Draw a bunch of points using current color
virtual void drawPoints (const Vector< Float > &x1, const Vector< Float > &y1)
virtual void drawPoints3D (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &z1)
virtual void drawPoints (const Vector< Double > &x1, const Vector< Double > &y1)
void setPointSize (const uInt pointsize)
 (cacheable) Change the size of the points (in pixels) drawn by drawPoints.
virtual void drawLine (Int x1, Int y1, Int x2, Int y2)
 (Cacheable) Draw a single line using current color
virtual void drawLine (Float x1, Float y1, Float x2, Float y2)
virtual void drawLine3D (Float x1, Float y1, Float z1, Float x2, Float y2, Float z2)
virtual void drawLine (Double x1, Double y1, Double x2, Double y2)
virtual void drawLines (const Matrix< Int > &verts)
 (Cacheable) Draw N/2 lines from an Nx2 matrix
virtual void drawLines (const Matrix< Float > &verts)
virtual void drawLines3D (const Matrix< Float > &verts)
virtual void drawLines (const Matrix< Double > &verts)
virtual void drawLines (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< Int > &x2, const Vector< Int > &y2)
 (Cacheable) Draw a bunch of unrelated lines using current color
virtual void drawLines (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &x2, const Vector< Float > &y2)
virtual void drawLines (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< Double > &x2, const Vector< Double > &y2)
virtual void drawPolyline (const Vector< Int > &x1, const Vector< Int > &y1)
 (Cacheable) Draw a single connected line between the given points.
virtual void drawPolyline (const Vector< Float > &x1, const Vector< Float > &y1)
virtual void drawPolyline3D (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &z1)
virtual void drawPolyline (const Vector< Double > &x1, const Vector< Double > &y1)
virtual void drawPolyline (const Matrix< Int > &verts)
 (Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices
virtual void drawPolyline (const Matrix< Float > &verts)
virtual void drawPolyline (const Matrix< Double > &verts)
virtual void drawPolygon (const Vector< Int > &x1, const Vector< Int > &y1)
 (Cacheable) Draw a closed polygon
virtual void drawPolygon (const Vector< Float > &x1, const Vector< Float > &y1)
virtual void drawPolygon3D (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &z1)
virtual void drawPolygon (const Vector< Double > &x1, const Vector< Double > &y1)
virtual void drawFilledPolygon (const Vector< Int > &x1, const Vector< Int > &y1)
 (Cacheable) Draw and fill a closed polygon
virtual void drawFilledPolygon (const Vector< Float > &x1, const Vector< Float > &y1)
virtual void drawFilledPolygon3D (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &z1)
virtual void drawFilledPolygon (const Vector< Double > &x1, const Vector< Double > &y1)
virtual void drawPolygon (const Matrix< Int > &verts)
 (Cacheable) Draw a closed N-sided polygon from Nx2 matrix of vertices
virtual void drawPolygon (const Matrix< Float > &verts)
virtual void drawPolygon3D (const Matrix< Float > &verts)
virtual void drawPolygon (const Matrix< Double > &verts)
virtual void drawRectangle (Int x1, Int y1, Int x2, Int y2)
 (Cacheable) Draw a rectangle
virtual void drawRectangle (Float x1, Float y1, Float x2, Float y2)
virtual void drawRectangle (Double x1, Double y1, Double x2, Double y2)
virtual void drawFilledRectangle (Int x1, Int y1, Int x2, Int y2)
 (Cacheable) Draw a filled rectangle
virtual void drawFilledRectangle (Float x1, Float y1, Float x2, Float y2)
virtual void drawFilledRectangle (Double x1, Double y1, Double x2, Double y2)
virtual void drawColoredPoints (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< uInt > &colors)
 (Cacheable) Draw a set of points, specifying a color per point to be drawn.
virtual void drawColoredPoints (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Matrix< Int > &xy, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Matrix< Float > &xy, const Vector< uInt > &colors)
virtual void drawColoredPoints (const Matrix< Double > &xy, const Vector< uInt > &colors)
virtual void drawColoredLines (const Vector< Int > &x1, const Vector< Int > &y1, const Vector< Int > &x2, const Vector< Int > &y2, const Vector< uInt > &colors)
 (Cacheable) Draw a set of lines, specifying a color per line to be drawn.
virtual void drawColoredLines (const Vector< Float > &x1, const Vector< Float > &y1, const Vector< Float > &x2, const Vector< Float > &y2, const Vector< uInt > &colors)
virtual void drawColoredLines (const Vector< Double > &x1, const Vector< Double > &y1, const Vector< Double > &x2, const Vector< Double > &y2, const Vector< uInt > &colors)
virtual void setForeground (uLong color)
 Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .
virtual void setLineWidth (Float width)
 virtual void setLineWidth(uInt width) = 0;
virtual void setLineStyle (Display::LineStyle style)
virtual void setFillStyle (Display::FillStyle style)
virtual void setDrawFunction (Display::DrawFunction function)
 Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .
virtual void setBackground (uLong color)
 Unimplemented set graphics functions.
virtual void setCapStyle (Display::CapStyle style)
virtual void setJoinStyle (Display::JoinStyle style)
virtual void setFillRule (Display::FillRule rule)
virtual void setArcMode (Display::ArcMode mode)
virtual uLong getForeground () const
 Implemented get Graphics Attributes functions.
virtual Float getLineWidth () const
 virtual uInt getLineWidth() const = 0;
virtual Display::LineStyle getLineStyle () const
virtual Display::FillStyle getFillStyle () const
virtual Display::DrawFunction getDrawFunction () const
 Get Graphics Attributes.
virtual uLong getBackground () const
 Unimplemented get Graphics Attributes.
virtual Display::CapStyle getCapStyle () const
virtual Display::JoinStyle getJoinStyle () const
virtual Display::FillRule getFillRule () const
virtual Display::ArcMode getArcMode () const
virtual Bool enable (Display::Option option)
 (Cacheable) Option Control Options listed in DisplayEnums Only Display::ClipWindow is implemented.
virtual Bool disable (Display::Option option)
virtual void setImageCacheStrategy (Display::ImageCacheStrategy strategy)
 Control the image-caching strategy.
virtual Display::ImageCacheStrategy imageCacheStrategy () const
virtual void setClipWindow (Int x1, Int y1, Int x2, Int y2)
 (Cacheable) Setup the clip window.
virtual void getClipWindow (Int &x1, Int &y1, Int &x2, Int &y2)
void redraw ()
 (Not Cacheable) Redraw the window
virtual void refresh (const Display::RefreshReason &reason=Display::UserCommand, const Bool &explicitrequest=True)
void repaint (const Bool redraw=False)
 Just redraws window.
virtual void flush ()
 Cause display to flush any graphics commands not yet drawn.
virtual void clear ()
 (Cacheable) Clear the window using the background color
Tip: If you want to clear the window use clear(), not clear(IIII);

virtual void clear (Int x1, Int y1, Int x2, Int y2)
virtual void setClearColor (uInt colorIndex)
 (Cacheable) Set the color to use for clearing the display
virtual void setClearColor (const String &colorname)
 
Caution: Setting named colors for Index mode isn't implemented;

virtual void setClearColor (float r, float g, float b)
virtual uInt clearColor () const
 (Not Cacheable) Get the current color to use for clearing the display.
virtual void getClearColor (float &r, float &g, float &b) const
virtual void setDeviceForegroundColor (const String colorname)
 Get/set the current foreground/background colors.
virtual String deviceForegroundColor () const
virtual void setDeviceBackgroundColor (const String colorname)
virtual String deviceBackgroundColor () const
virtual uInt width () const
 Return the width of the GLPixelCanvas in pixels.
virtual uInt height () const
 Return the height of the GLPixelCanvas in pixels.
virtual uInt depth () const
 Return the depth of the GLPixelCanvas in bits.
virtual void pixelDensity (Float &xdpi, Float &ydpi) const
 Get the pixel density (in dots per inch [dpi]) of the GLPixelCanvas
Tip: The X server is queried; It may or may not have the correct answer;

virtual void setColor (uInt colorIndex)
 (Cacheable) Set current color (works in RGB or colormap mode)
virtual void setColor (const String &colorname)
virtual void setRGBColor (float r, float g, float b)
 
Caution: Calling setRGBColor when in Index mode ignores r, g & b and uses the current index value;

virtual Bool getColorComponents (const String &colorname, Float &r, Float &g, Float &b)
 Get color components in range 0 to 1 without actually allocating the color.
virtual uInt color () const
 (Not Cacheable) Returns the current color as a color index
Note: In RGB mode, this is only valid if setColor(index) has been called;

virtual void getColor (float &r, float &g, float &b) const
 (Not Cacheable) Retuns the current color as an RGB triple
virtual Bool getColor (Int x, Int y, uInt &color)
 (Not Cacheable) Get color index value (works in RGB or colormap mode)
Tip: Don't bother; No existing canvas implements these;

virtual Bool getRGBColor (Int x, Int y, float &r, float &g, float &b)
 This should be removed since no one implements it.
virtual Bool resize (uInt reqXSize, uInt reqYSize, Bool doCallbacks=True)
 (Not Cacheable) resize request.
virtual Bool resizeColorTable (uInt newSize)
 (Not Cacheable) resize the colortable by requesting a new number of cells
virtual Bool resizeColorTable (uInt nReds, uInt nGreens, uInt nBlues)
 (Not Cacheable) resize the colortable by requesting a new RGB/HSV cube
virtual GLPixelCanvasColorTableglpcctbl () const
 Need a mechanism to return the GLPixelCanvasColorTable so drawing functions within classes can operate.
PixelCanvasColorTablepcctbl () const
 Return the pixel canvas color table.
void setPcctbl (PixelCanvasColorTable *pcctbl)
virtual void pushMatrix ()
 save/restore the current translation.
virtual void popMatrix ()
virtual void loadIdentity ()
 zero the current translation
virtual void translate (Int xt, Int yt)
 translation functions translate applies a relative translation to the current matrix and can be used to position graphics.
virtual void getTranslation (Int &xt, Int &yt) const
 
Tip: get/x/yTranslation are not currently implemented;

virtual Int xTranslation () const
virtual Int yTranslation () const
virtual void setDrawBuffer (Display::DrawBuffer buf)
 (Not cacheable) set the draw buffer
Caution: The draw buffer is always set to BACK if double buffered and FRONT if single buffered;

void copyBuffer (GLenum from, GLenum to)
virtual void copyBackBufferToFrontBuffer ()
 buffer memory exchanges (Not cacheable)
virtual void copyFrontBufferToBackBuffer ()
virtual void swapBuffers ()
virtual void copyBackBufferToFrontBuffer (Int x1, Int y1, Int x2, Int y2)
 partial buffer memory exchanges.
virtual void copyFrontBufferToBackBuffer (Int x1, Int y1, Int x2, Int y2)
virtual void swapBuffers (Int x1, Int y1, Int x2, Int y2)
virtual Bool refreshAllowed () const
 return True if refresh is allowed right now...
void makeCurrent ()
 Make this canvas's context current.
void waitX ()
 Wait for X or GL commands to finish.
void waitGL ()
int glcheck (const char *msg=NULL, uInt nspaces=0)
 Print any GL error messages.
void drawTexturedImage (GLfloat x, GLfloat y, GLfloat z, GLsizei width, GLsizei height, GLfloat xscale, GLfloat yscale, GLenum format, const GLushort *pixels, GLPCTextureParams *params=NULL)
 Various ways to draw images.
void drawImagePixels (GLfloat x, GLfloat y, GLfloat z, GLsizei width, GLsizei height, GLfloat xscale, GLfloat yscale, GLenum format, const GLushort *pixels)
void drawGLImage (GLfloat x, GLfloat y, GLfloat z, GLsizei width, GLsizei height, GLfloat xscale, GLfloat yscale, GLenum format, const GLushort *pixels)
 Calls drawImagePixels if in indexed mode or drawTexturedImage if RGB.
void bufferZValue (const Float z=0.0)
 
  

void trace (Boolean trace)
 Tracing support.
Boolean tracing () const
void traceLevel (const uLong traceLevel)
 Set trace level.
uLong traceLevel () const
void postToStream (Bool p=False)
void postToString (String *s=NULL)
void postString ()
void note (const char *note)
 Add a note entry to traced output.
Boolean autoRefresh () const
 Normally GLPixelCanvas repaints the window when it is damaged.
void autoRefresh (Boolean refresh)
void pushAttrib (const GLbitfield attrib)
 OpenGL's push/popAttrib functions.
void popAttrib ()
Boolean doubleBuffered () const
Boolean isRGB () const

Static Public Member Functions

static void copyBuffer (GLenum from, GLenum to, GLint x, GLint y, GLsizei width, GLsizei height)
 buffer memory exchanges (Not cacheable)
static int glCheck (const char *msg=NULL, uInt nspaces=0)
static void drawPixels (GLfloat x, GLfloat y, GLfloat z, GLsizei width, GLsizei height, GLfloat xscale, GLfloat yscale, GLenum format, GLenum type, const GLvoid *pixels)

Private Member Functions

void exposeHandler ()
 Handle the X expose event.
void resizeHandler ()
 Called when window is resized.
void handleEvents (Widget w, XEvent *ev)
Boolean handleResizeEvent (uInt w, uInt h)
void initComponents ()
 
   

GLPCDisplayListcreateList (const char *name=NULL)
 Internal handling of display lists.
uInt makeList (const char *name=NULL)
 Create a new display list and add to the list of lists.
void resizeList ()
 Grow the list.
void cleanLists ()
 Go through the list of display lists removing any unused lists.
void purgeLists ()
 Called when the window is resized or cleared.
Boolean removeList (uInt listid)
 Remove a display list from list of lists.
void beginListEntry (const char *name=NULL)
 Called to begin caching.
void beginListEntry (GLPCDisplayListElement *e)
void endListEntry ()
 Called to end caching.
void traceCheck (const char *name, uLong traceLevel, uInt nspaces)
 Print <name> if tracing is turned on.
void traceCheck (const char *name, uLong traceLevel)
void storeColorValue (GLPCColorValue &v, uLong value)
 Store the new value in the struct.
void storeColorIndex (GLPCColorValue &v, uInt index)
 If RGB mode, index is interpreted as an index into the virtual CT.
void storeColorValue (GLPCColorValue &v, Float r, Float g, Float b)
void storeColorValue (GLPCColorValue &v, Float r, Float g, Float b, Float a)
void setCurrentColorIndex (uInt index, const char *name=NULL)
 index is always treated as an index.
void setCurrentColorValue (uLong value, const char *name=NULL)
void setCurrentColorValue (Float r, Float g, Float b, const char *name=NULL)
void setCurrentColorValue (Float r, Float g, Float b, Float a, const char *name=NULL)
void setCurrentColorValue (const GLPCColorValue &v, const char *name=NULL)
void setClearColorIndex (uInt index, const char *name=NULL)
void setClearColorValue (uLong index, const char *name=NULL)
void setClearColorValue (Float r, Float g, Float b, const char *name=NULL)
void setClearColorValue (Float r, Float g, Float b, Float a, const char *name=NULL)
void setClearColorValue (const GLPCColorValue &v, const char *name=NULL)
 Tell OpenGL to use the given color index or RGB value depending on whether we're in Index or RGB mode.
void drawColoredPoints_ (const char *Name, const Vector< Int > &x1, const Vector< Int > &y1, const Vector< uInt > &colors)
 Internal versions of public functions.
void drawColoredPoints_ (const char *Name, const Vector< Float > &x1, const Vector< Float > &y1, const Vector< uInt > &colors)
void drawColoredPoints_ (const char *Name, const Vector< Double > &x1, const Vector< Double > &y1, const Vector< uInt > &colors)
void pRWbuf (const char *str=NULL, int nspaces=0)
void warn (const char *routine, const char *msg, const SourceLocation *where) const
 Routines to print warnings.
void unimplemented (const char *routine, const SourceLocation *where) const

Static Private Member Functions

static void handleEventsCB (Widget w, GLPixelCanvas *xpc, XEvent *ev, Boolean *)
 Event Handling.
static void colorTableResizeCB (PixelCanvasColorTable *pcctbl, uInt, GLPixelCanvas *xpc, Display::RefreshReason reason)
 handle colorTable resize

Private Attributes

::XDisplay * display_
Widget parent_
Widget form_
Widget drawArea_
XVisualInfo * visualInfo_
Visual * visual_
uInt BlackPixel_
Bool doubleBuffered_
 GL information.
Bool isRGB_
GLPixelCanvasColorTableglpcctbl_
GLXContext context_
GLbitfield bufferMask_
uInt width_
uInt height_
uInt depth_
Boolean doClipping_
Int clipX1_
Int clipY1_
Int clipX2_
Int clipY2_
String itsDeviceForegroundColor_
String itsDeviceBackgroundColor_
GLPCColorValue currentColor_
 Current color.
GLPCColorValue clearColor_
 Clear color.
Display::LineStyle lineStyle_
Display::FillStyle fillStyle_
Boolean exposeHandlerFirstTime_
uShortitsComponents_
 Component / multi-channel buffers etc.
Float itsComponentX_
Float itsComponentY_
Float itsComponentZ_
Float itsComponentScaleX_
Float itsComponentScaleY_
uLong itsComponentWidth_
uLong itsComponentHeight_
uInt listSize_
 Display lists.
uInt numinuse_
uInt nextfree_
uInt sizeincr_
uInt currentListID_
GLPCDisplayList ** dlists_
GLPCDisplayListElementcurrentElement_
Boolean trace_
uLong traceLevel_
uInt nspaces_
GLLogIO log_
Boolean autoRefresh_

Detailed Description

OpenGL implementation of PixelCanvas.

Intended use:

Public interface

Prerequisite

Synopsis

Implementation of PixelCanvas for OpenGL. Most, but not all of the PixelCanvas functions are available. There is very little support for 3D.

Thrown Exceptions

Definition at line 76 of file GLPixelCanvas.h.


Constructor & Destructor Documentation

casa::GLPixelCanvas::GLPixelCanvas ( Widget  parent,
GLPixelCanvasColorTable glpcctbl,
uInt  width,
uInt  height 
)


Caution: Drawing can not take place until the window exists!

virtual casa::GLPixelCanvas::~GLPixelCanvas ( ) [virtual]

Member Function Documentation

Boolean casa::GLPixelCanvas::autoRefresh ( ) const [inline]

Normally GLPixelCanvas repaints the window when it is damaged.

If the user wishes to handle this, turn off auto refreshing.

Definition at line 628 of file GLPixelCanvas.h.

References autoRefresh_.

void casa::GLPixelCanvas::autoRefresh ( Boolean  refresh) [inline]

Definition at line 629 of file GLPixelCanvas.h.

References autoRefresh_, and refresh().

void casa::GLPixelCanvas::beginListEntry ( const char *  name = NULL) [private]

Called to begin caching.

virtual void casa::GLPixelCanvas::bufferComponent ( const Matrix< uInt > &  data,
const Int x,
const Int y,
const Display::ColorComponent colorcomponent 
) [virtual]

Fill one of the channel buffers.

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::bufferZValue ( const Float  z = 0.0) [inline]

  

Definition at line 606 of file GLPixelCanvas.h.

References itsComponentZ_.

void casa::GLPixelCanvas::cleanLists ( ) [private]

Go through the list of display lists removing any unused lists.

virtual void casa::GLPixelCanvas::clear ( ) [virtual]

(Cacheable) Clear the window using the background color
Tip: If you want to clear the window use clear(), not clear(IIII);

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::clear ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual uInt casa::GLPixelCanvas::clearColor ( ) const [virtual]

(Not Cacheable) Get the current color to use for clearing the display.

Implements casa::PixelCanvas.

virtual uInt casa::GLPixelCanvas::color ( ) const [virtual]

(Not Cacheable) Returns the current color as a color index
Note: In RGB mode, this is only valid if setColor(index) has been called;

Implements casa::PixelCanvas.

static void casa::GLPixelCanvas::colorTableResizeCB ( PixelCanvasColorTable pcctbl,
uInt  ,
GLPixelCanvas xpc,
Display::RefreshReason  reason 
) [static, private]

handle colorTable resize

buffer memory exchanges (Not cacheable)

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::copyBackBufferToFrontBuffer ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

partial buffer memory exchanges.

(x1,y1 are blc, x2,y2 are trc) None of these are implemented.

Implements casa::PixelCanvas.

static void casa::GLPixelCanvas::copyBuffer ( GLenum  from,
GLenum  to,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height 
) [static]

buffer memory exchanges (Not cacheable)


Caution: Of this group, only swapbuffers() works;

void casa::GLPixelCanvas::copyBuffer ( GLenum  from,
GLenum  to 
)

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::copyFrontBufferToBackBuffer ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

Implements casa::PixelCanvas.

GLPCDisplayList* casa::GLPixelCanvas::createList ( const char *  name = NULL) [private]

Internal handling of display lists.

There is a list of GLPCDisplayLists. Item 0 always exists and is used to redraw the window after expose events. Any other entries are created in response to newList() calls.

Return a pointer to a new GLPC display list.

virtual void casa::GLPixelCanvas::deleteList ( uInt  list) [virtual]

remove list from cache

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::deleteLists ( ) [virtual]

flush all lists from the cache

Implements casa::PixelCanvas.

virtual uInt casa::GLPixelCanvas::depth ( ) const [virtual]

Return the depth of the GLPixelCanvas in bits.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::disable ( Display::Option  option) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::disableMotionEvents ( ) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::disablePositionEvents ( ) [virtual]

Implements casa::PixelCanvas.

Boolean casa::GLPixelCanvas::doubleBuffered ( ) const [inline]

Definition at line 635 of file GLPixelCanvas.h.

References doubleBuffered_.

virtual void casa::GLPixelCanvas::drawColoredLines ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< Int > &  x2,
const Vector< Int > &  y2,
const Vector< uInt > &  colors 
) [virtual]

(Cacheable) Draw a set of lines, specifying a color per line to be drawn.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredLines ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  x2,
const Vector< Float > &  y2,
const Vector< uInt > &  colors 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredLines ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< Double > &  x2,
const Vector< Double > &  y2,
const Vector< uInt > &  colors 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< uInt > &  colors 
) [virtual]

(Cacheable) Draw a set of points, specifying a color per point to be drawn.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< uInt > &  colors 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< uInt > &  colors 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Matrix< Int > &  xy,
const Vector< uInt > &  colors 
) [virtual]

Reimplemented from casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Matrix< Float > &  xy,
const Vector< uInt > &  colors 
) [virtual]

Reimplemented from casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawColoredPoints ( const Matrix< Double > &  xy,
const Vector< uInt > &  colors 
) [virtual]

Reimplemented from casa::PixelCanvas.

void casa::GLPixelCanvas::drawColoredPoints_ ( const char *  Name,
const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< uInt > &  colors 
) [private]

Internal versions of public functions.

void casa::GLPixelCanvas::drawColoredPoints_ ( const char *  Name,
const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< uInt > &  colors 
) [private]
void casa::GLPixelCanvas::drawColoredPoints_ ( const char *  Name,
const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< uInt > &  colors 
) [private]
virtual void casa::GLPixelCanvas::drawFilledPolygon ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [virtual]

(Cacheable) Draw and fill a closed polygon

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawFilledPolygon ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawFilledPolygon ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawFilledPolygon3D ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  z1 
) [virtual]
virtual void casa::GLPixelCanvas::drawFilledRectangle ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

(Cacheable) Draw a filled rectangle

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawFilledRectangle ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawFilledRectangle ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [virtual]

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::drawGLImage ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLsizei  width,
GLsizei  height,
GLfloat  xscale,
GLfloat  yscale,
GLenum  format,
const GLushort *  pixels 
)

Calls drawImagePixels if in indexed mode or drawTexturedImage if RGB.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< uInt > &  data,
Int  x,
Int  y 
) [virtual]

(Cacheable) Draw an array of 2D color data as a raster image for zoom = <1,1>

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Int > &  data,
Int  x,
Int  y 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< uLong > &  data,
Int  x,
Int  y 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Float > &  data,
Int  x,
Int  y 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Double > &  data,
Int  x,
Int  y 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Int x,
const Int y,
const Matrix< uInt > &  data,
const Matrix< Bool > &  mask,
Bool  opaqueMask = False 
) [virtual]

(Cacheable) Draw an array of 2D color data as a raster image, taking note of the Bool mask.

(opaqueMask ignored/unimplemented)

Reimplemented from casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< uInt > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [virtual]

(Cacheable) Draw an array of 2D color data as a raster image for any positive integer zoom

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Int > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< uLong > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Float > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< Double > &  data,
Int  x,
Int  y,
uInt  xzoom,
uInt  yzoom 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawImage ( const Matrix< uInt > &  data,
const Int x,
const Int y,
const Display::ColorComponent colorcomponent 
) [virtual]

(Cacheable) Draw a component of a multi-channel image, storing it in buffers until flushComponentImages() is called.

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::drawImagePixels ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLsizei  width,
GLsizei  height,
GLfloat  xscale,
GLfloat  yscale,
GLenum  format,
const GLushort *  pixels 
)
virtual void casa::GLPixelCanvas::drawLine ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

(Cacheable) Draw a single line using current color

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLine ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLine ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLine3D ( Float  x1,
Float  y1,
Float  z1,
Float  x2,
Float  y2,
Float  z2 
) [virtual]
virtual void casa::GLPixelCanvas::drawLines ( const Matrix< Int > &  verts) [virtual]

(Cacheable) Draw N/2 lines from an Nx2 matrix

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines ( const Matrix< Float > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines ( const Matrix< Double > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines ( const Vector< Int > &  x1,
const Vector< Int > &  y1,
const Vector< Int > &  x2,
const Vector< Int > &  y2 
) [virtual]

(Cacheable) Draw a bunch of unrelated lines using current color

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  x2,
const Vector< Float > &  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines ( const Vector< Double > &  x1,
const Vector< Double > &  y1,
const Vector< Double > &  x2,
const Vector< Double > &  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawLines3D ( const Matrix< Float > &  verts) [virtual]
virtual void casa::GLPixelCanvas::drawList ( uInt  list) [virtual]

(Cacheable) recall cached display commands

Implements casa::PixelCanvas.

static void casa::GLPixelCanvas::drawPixels ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLsizei  width,
GLsizei  height,
GLfloat  xscale,
GLfloat  yscale,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
) [static]
virtual void casa::GLPixelCanvas::drawPoint ( Int  x1,
Int  y1 
) [virtual]

(Cacheable) Draw a single point using current color

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoint ( Float  x1,
Float  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoint ( Double  x1,
Double  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoint3D ( Float  x1,
Float  y1,
Float  z1 
) [virtual]
virtual void casa::GLPixelCanvas::drawPoints ( const Matrix< Int > &  verts) [virtual]

(Cacheable) Draw N points specified as a Nx2 matrix

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoints ( const Matrix< Float > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoints ( const Matrix< Double > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoints ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [virtual]

(Cacheable) Draw a bunch of points using current color

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoints ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPoints ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [virtual]

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::drawPoints3D ( const Matrix< Float > &  verts)
virtual void casa::GLPixelCanvas::drawPoints3D ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  z1 
) [virtual]
virtual void casa::GLPixelCanvas::drawPolygon ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [virtual]

(Cacheable) Draw a closed polygon

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon ( const Matrix< Int > &  verts) [virtual]

(Cacheable) Draw a closed N-sided polygon from Nx2 matrix of vertices

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon ( const Matrix< Float > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon ( const Matrix< Double > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolygon3D ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  z1 
) [virtual]
virtual void casa::GLPixelCanvas::drawPolygon3D ( const Matrix< Float > &  verts) [virtual]
virtual void casa::GLPixelCanvas::drawPolyline ( const Vector< Int > &  x1,
const Vector< Int > &  y1 
) [virtual]

(Cacheable) Draw a single connected line between the given points.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline ( const Vector< Float > &  x1,
const Vector< Float > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline ( const Vector< Double > &  x1,
const Vector< Double > &  y1 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline ( const Matrix< Int > &  verts) [virtual]

(Cacheable) Draw N-1 connected lines from Nx2 matrix of vertices

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline ( const Matrix< Float > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline ( const Matrix< Double > &  verts) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawPolyline3D ( const Vector< Float > &  x1,
const Vector< Float > &  y1,
const Vector< Float > &  z1 
) [virtual]
virtual void casa::GLPixelCanvas::drawRectangle ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

(Cacheable) Draw a rectangle

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawRectangle ( Float  x1,
Float  y1,
Float  x2,
Float  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawRectangle ( Double  x1,
Double  y1,
Double  x2,
Double  y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::drawText ( Int  x,
Int  y,
const String text,
Display::TextAlign  alignment = Display::AlignCenter 
) [virtual]

(Cacheable) Draw text using that font aligned in some way to the position.

(unimplemented)

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::drawTexturedImage ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLsizei  width,
GLsizei  height,
GLfloat  xscale,
GLfloat  yscale,
GLenum  format,
const GLushort *  pixels,
GLPCTextureParams params = NULL 
)

Various ways to draw images.

Used internally.

virtual Bool casa::GLPixelCanvas::enable ( Display::Option  option) [virtual]

(Cacheable) Option Control Options listed in DisplayEnums Only Display::ClipWindow is implemented.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::enableMotionEvents ( ) [virtual]

enabling/disabling of event tracking (unimplemented)

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::enablePositionEvents ( ) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::endList ( ) [virtual]

end caching display commands

Implements casa::PixelCanvas.

Called to end caching.

Handle the X expose event.

This is caught by the pixel canvas and forwarded as a refresh event only if the pixel canvas changed dimensions. If there was no size change, the pixel canvas simply copies its pixmap to the display without generating a refresh.

virtual void casa::GLPixelCanvas::flush ( ) [virtual]

Cause display to flush any graphics commands not yet drawn.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::flushComponentBuffers ( ) [virtual]

(NOT CACHEABLE!) Flush the component buffers.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

virtual uLong casa::GLPixelCanvas::getBackground ( ) const [virtual]

Unimplemented get Graphics Attributes.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::getClearColor ( float &  r,
float &  g,
float &  b 
) const [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::getClipWindow ( Int x1,
Int y1,
Int x2,
Int y2 
) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::getColor ( float &  r,
float &  g,
float &  b 
) const [virtual]

(Not Cacheable) Retuns the current color as an RGB triple

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::getColor ( Int  x,
Int  y,
uInt color 
) [virtual]

(Not Cacheable) Get color index value (works in RGB or colormap mode)
Tip: Don't bother; No existing canvas implements these;

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::getColorComponents ( const String colorname,
Float r,
Float g,
Float b 
) [virtual]

Get color components in range 0 to 1 without actually allocating the color.

This is needed to set up other devices, for example PgPlot.

Implements casa::PixelCanvas.

Get Graphics Attributes.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

virtual uLong casa::GLPixelCanvas::getForeground ( ) const [virtual]

Implemented get Graphics Attributes functions.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

virtual Float casa::GLPixelCanvas::getLineWidth ( ) const [virtual]

virtual uInt getLineWidth() const = 0;

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::getRGBColor ( Int  x,
Int  y,
float &  r,
float &  g,
float &  b 
) [virtual]

This should be removed since no one implements it.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::getTranslation ( Int xt,
Int yt 
) const [virtual]


Tip: get/x/yTranslation are not currently implemented;

Implements casa::PixelCanvas.

int casa::GLPixelCanvas::glcheck ( const char *  msg = NULL,
uInt  nspaces = 0 
)

Print any GL error messages.

if msg is non NULL, it is printed first if there is an error. nspaces is the number of spaces to indent the text. Returns the number of errors. Usually only used internally.

static int casa::GLPixelCanvas::glCheck ( const char *  msg = NULL,
uInt  nspaces = 0 
) [static]
virtual GLPixelCanvasColorTable* casa::GLPixelCanvas::glpcctbl ( ) const [inline, virtual]

Need a mechanism to return the GLPixelCanvasColorTable so drawing functions within classes can operate.

Definition at line 502 of file GLPixelCanvas.h.

References glpcctbl_.

void casa::GLPixelCanvas::GLPixelCanvas::drawIndexedImage ( const Matrix< uInt > &  data,
Float  x = 0.0,
Float  y = 0.0,
Float  z = 0.0,
Float  xscl = 1.0,
Float  yscl = 1.0 
)

(Cacheable) Draw an image using color indexes.

If in RGB mode, the virtual colortable is used.

void casa::GLPixelCanvas::handleEvents ( Widget  w,
XEvent *  ev 
) [private]
static void casa::GLPixelCanvas::handleEventsCB ( Widget  w,
GLPixelCanvas xpc,
XEvent *  ev,
Boolean *   
) [static, private]

Event Handling.

Boolean casa::GLPixelCanvas::handleResizeEvent ( uInt  w,
uInt  h 
) [private]
virtual uInt casa::GLPixelCanvas::height ( ) const [virtual]

Return the height of the GLPixelCanvas in pixels.

Implements casa::PixelCanvas.

Implements casa::PixelCanvas.

   

Boolean casa::GLPixelCanvas::isRGB ( ) const [inline]

Definition at line 636 of file GLPixelCanvas.h.

References isRGB_.

virtual void casa::GLPixelCanvas::loadIdentity ( ) [virtual]

zero the current translation

Implements casa::PixelCanvas.

Make this canvas's context current.


Caution: This must be called when switching between GLPixelCanvases or else drawing will go to the wrong canvas; It is not needed unless more than one GLPixelCanvas is active at a time;

uInt casa::GLPixelCanvas::makeList ( const char *  name = NULL) [private]

Create a new display list and add to the list of lists.

virtual uInt casa::GLPixelCanvas::newList ( ) [virtual]

begin caching display commands - return list ID

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::note ( const char *  note)

Add a note entry to traced output.

PixelCanvasColorTable* casa::GLPixelCanvas::pcctbl ( ) const [inline, virtual]

Return the pixel canvas color table.

Implements casa::PixelCanvas.

Definition at line 504 of file GLPixelCanvas.h.

References glpcctbl_.

virtual void casa::GLPixelCanvas::pixelDensity ( Float xdpi,
Float ydpi 
) const [virtual]

Get the pixel density (in dots per inch [dpi]) of the GLPixelCanvas
Tip: The X server is queried; It may or may not have the correct answer;

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::popMatrix ( ) [virtual]

Implements casa::PixelCanvas.

Definition at line 620 of file GLPixelCanvas.h.

References log_, and casa::GLLogIO::postString().

Definition at line 618 of file GLPixelCanvas.h.

References log_, and casa::GLLogIO::postToStream().

void casa::GLPixelCanvas::postToString ( String s = NULL) [inline]

Definition at line 619 of file GLPixelCanvas.h.

References log_, and casa::GLLogIO::postToString().

void casa::GLPixelCanvas::pRWbuf ( const char *  str = NULL,
int  nspaces = 0 
) [private]
void casa::GLPixelCanvas::purgeLists ( ) [private]

Called when the window is resized or cleared.

Deletes the repaint list.

void casa::GLPixelCanvas::pushAttrib ( const GLbitfield  attrib)

OpenGL's push/popAttrib functions.

virtual void casa::GLPixelCanvas::pushMatrix ( ) [virtual]

save/restore the current translation.

This is called pushMatrix because eventually we may want scaling or rotation to play a modest role here.
Tip: GLPixelCanvas uses OpenGL's push/pop matrix;

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::redraw ( ) [inline]

(Not Cacheable) Redraw the window

Reimplemented from casa::PixelCanvas.

Definition at line 400 of file GLPixelCanvas.h.

References repaint(), and casa::True.

virtual void casa::GLPixelCanvas::refresh ( const Display::RefreshReason reason = Display::UserCommand,
const Bool explicitrequest = True 
) [virtual]

Implements casa::PixelCanvas.

Referenced by autoRefresh().

virtual Bool casa::GLPixelCanvas::refreshAllowed ( ) const [virtual]

return True if refresh is allowed right now...

Reimplemented from casa::PixelCanvas.

Boolean casa::GLPixelCanvas::removeList ( uInt  listid) [private]

Remove a display list from list of lists.

Returns True if list was removed. False if listid is invalid or list has already been removed.

void casa::GLPixelCanvas::repaint ( const Bool  redraw = False)

Just redraws window.

(If redraw is T, the window will be redrawn. If F, it will only be redrawn if autoRefresh is T.

Referenced by redraw().

virtual Bool casa::GLPixelCanvas::resize ( uInt  reqXSize,
uInt  reqYSize,
Bool  doCallbacks = True 
) [virtual]

(Not Cacheable) resize request.

returns true if window was resized. Will refresh if doCallbacks is True.

Reimplemented from casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::resizeColorTable ( uInt  newSize) [virtual]

(Not Cacheable) resize the colortable by requesting a new number of cells

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::resizeColorTable ( uInt  nReds,
uInt  nGreens,
uInt  nBlues 
) [virtual]

(Not Cacheable) resize the colortable by requesting a new RGB/HSV cube

Implements casa::PixelCanvas.

Called when window is resized.

void casa::GLPixelCanvas::resizeList ( ) [private]

Grow the list.

virtual void casa::GLPixelCanvas::setArcMode ( Display::ArcMode  mode) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setBackground ( uLong  color) [virtual]

Unimplemented set graphics functions.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setCapStyle ( Display::CapStyle  style) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setClearColor ( uInt  colorIndex) [virtual]

(Cacheable) Set the color to use for clearing the display

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setClearColor ( const String colorname) [virtual]


Caution: Setting named colors for Index mode isn't implemented;

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setClearColor ( float  r,
float  g,
float  b 
) [virtual]

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::setClearColorIndex ( uInt  index,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setClearColorValue ( uLong  index,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setClearColorValue ( Float  r,
Float  g,
Float  b,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setClearColorValue ( Float  r,
Float  g,
Float  b,
Float  a,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setClearColorValue ( const GLPCColorValue v,
const char *  name = NULL 
) [private]

Tell OpenGL to use the given color index or RGB value depending on whether we're in Index or RGB mode.

If name is not NULL, wrap the call in the usual begin/endListEntry, tracecheck.

virtual void casa::GLPixelCanvas::setClipWindow ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

(Cacheable) Setup the clip window.

The clip window, when enabled, allows a user to clip all graphics output to a rectangular region on the screen.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setColor ( uInt  colorIndex) [virtual]

(Cacheable) Set current color (works in RGB or colormap mode)


Tip: setColor(colorIndex) when called in RGB mode gets the RGB values from the virtual color table; setForeground assumes the value is a packed pixel;

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setColor ( const String colorname) [virtual]

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::setCurrentColorIndex ( uInt  index,
const char *  name = NULL 
) [private]

index is always treated as an index.

(In RGB mode, the virtual color table is used.

void casa::GLPixelCanvas::setCurrentColorValue ( uLong  value,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setCurrentColorValue ( Float  r,
Float  g,
Float  b,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setCurrentColorValue ( Float  r,
Float  g,
Float  b,
Float  a,
const char *  name = NULL 
) [private]
void casa::GLPixelCanvas::setCurrentColorValue ( const GLPCColorValue v,
const char *  name = NULL 
) [private]
virtual void casa::GLPixelCanvas::setDeviceBackgroundColor ( const String  colorname) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setDeviceForegroundColor ( const String  colorname) [virtual]

Get/set the current foreground/background colors.

These colors should be used when the special Strings "foreground" and "background" are given for a color.

Implements casa::PixelCanvas.

(Not cacheable) set the draw buffer
Caution: The draw buffer is always set to BACK if double buffered and FRONT if single buffered;

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setDrawFunction ( Display::DrawFunction  function) [virtual]

Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setFillRule ( Display::FillRule  rule) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setFillStyle ( Display::FillStyle  style) [virtual]

Implements casa::PixelCanvas.

virtual Bool casa::GLPixelCanvas::setFont ( const String fontName) [virtual]

(Cacheable) Set the font to the recognizable font name.

(unimplemented)

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setForeground ( uLong  color) [virtual]

Set Graphics Attributes Options for functions with enum argument listed in DisplayEnums .

Implements casa::PixelCanvas.

Control the image-caching strategy.

(Ignored)

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setJoinStyle ( Display::JoinStyle  style) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setLineStyle ( Display::LineStyle  style) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::setLineWidth ( Float  width) [virtual]

virtual void setLineWidth(uInt width) = 0;

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::setPcctbl ( PixelCanvasColorTable pcctbl) [inline, virtual]

Implements casa::PixelCanvas.

Definition at line 506 of file GLPixelCanvas.h.

References glpcctbl_.

void casa::GLPixelCanvas::setPointSize ( const uInt  pointsize)

(cacheable) Change the size of the points (in pixels) drawn by drawPoints.

virtual void casa::GLPixelCanvas::setRGBColor ( float  r,
float  g,
float  b 
) [virtual]


Caution: Calling setRGBColor when in Index mode ignores r, g & b and uses the current index value;

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::storeColorIndex ( GLPCColorValue v,
uInt  index 
) [private]

If RGB mode, index is interpreted as an index into the virtual CT.

void casa::GLPixelCanvas::storeColorValue ( GLPCColorValue v,
uLong  value 
) [private]

Store the new value in the struct.

If RGB mode, index is interpreted as a packed RGB value.

void casa::GLPixelCanvas::storeColorValue ( GLPCColorValue v,
Float  r,
Float  g,
Float  b 
) [private]
void casa::GLPixelCanvas::storeColorValue ( GLPCColorValue v,
Float  r,
Float  g,
Float  b,
Float  a 
) [private]

Does this canvas support cached display lists? The user of the canvas should always check this, because undefined behaviour can result when an attempt is made to use a list on a PixelCanvas which does not support lists.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::swapBuffers ( ) [virtual]

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::swapBuffers ( Int  x1,
Int  y1,
Int  x2,
Int  y2 
) [virtual]

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::trace ( Boolean  trace) [inline]

Tracing support.

May be useful when debugging graphics code.

 Turn tracing on/off.  

Definition at line 612 of file GLPixelCanvas.h.

References trace(), and trace_.

Referenced by trace().

void casa::GLPixelCanvas::traceCheck ( const char *  name,
uLong  traceLevel,
uInt  nspaces 
) [private]

Print <name> if tracing is turned on.

Most user callable drawing routines call this.

void casa::GLPixelCanvas::traceCheck ( const char *  name,
uLong  traceLevel 
) [inline, private]

Definition at line 694 of file GLPixelCanvas.h.

References nspaces_, and traceCheck().

Referenced by traceCheck().

void casa::GLPixelCanvas::traceLevel ( const uLong  traceLevel) [inline]

Set trace level.

(actually a mask). default is GLTraceNormal. NOT fully implemented.

Definition at line 616 of file GLPixelCanvas.h.

References traceLevel(), and traceLevel_.

Referenced by traceLevel().

Definition at line 617 of file GLPixelCanvas.h.

References traceLevel_.

Boolean casa::GLPixelCanvas::tracing ( ) const [inline]

Definition at line 613 of file GLPixelCanvas.h.

References trace_.

virtual void casa::GLPixelCanvas::translate ( Int  xt,
Int  yt 
) [virtual]

translation functions translate applies a relative translation to the current matrix and can be used to position graphics.

Together with pushMatrix and popMatrix it can be used to build heirarchical scenes.

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::translateAllLists ( Int  xt,
Int  yt 
) [virtual]

translate all lists

Implements casa::PixelCanvas.

virtual void casa::GLPixelCanvas::translateList ( uInt  list,
Int  xt,
Int  yt 
) [virtual]

translate the list

Implements casa::PixelCanvas.

void casa::GLPixelCanvas::unimplemented ( const char *  routine,
const SourceLocation *  where 
) const [private]
virtual Bool casa::GLPixelCanvas::validList ( uInt  list) [virtual]

return True if the list exists

Implements casa::PixelCanvas.

Wait for X or GL commands to finish.

Usually not needed.

void casa::GLPixelCanvas::warn ( const char *  routine,
const char *  msg,
const SourceLocation *  where 
) const [private]

Routines to print warnings.

virtual uInt casa::GLPixelCanvas::width ( ) const [virtual]

Return the width of the GLPixelCanvas in pixels.

Implements casa::PixelCanvas.

virtual Int casa::GLPixelCanvas::xTranslation ( ) const [virtual]

Implements casa::PixelCanvas.

virtual Int casa::GLPixelCanvas::yTranslation ( ) const [virtual]

Implements casa::PixelCanvas.


Member Data Documentation

Definition at line 798 of file GLPixelCanvas.h.

Referenced by autoRefresh().

Definition at line 756 of file GLPixelCanvas.h.

GLbitfield casa::GLPixelCanvas::bufferMask_ [private]

Definition at line 763 of file GLPixelCanvas.h.

Clear color.

Definition at line 774 of file GLPixelCanvas.h.

Definition at line 768 of file GLPixelCanvas.h.

Definition at line 769 of file GLPixelCanvas.h.

Definition at line 768 of file GLPixelCanvas.h.

Definition at line 769 of file GLPixelCanvas.h.

GLXContext casa::GLPixelCanvas::context_ [private]

Definition at line 762 of file GLPixelCanvas.h.

Current color.

Definition at line 772 of file GLPixelCanvas.h.

Definition at line 792 of file GLPixelCanvas.h.

Definition at line 790 of file GLPixelCanvas.h.

Definition at line 766 of file GLPixelCanvas.h.

::XDisplay* casa::GLPixelCanvas::display_ [private]

Definition at line 750 of file GLPixelCanvas.h.

Definition at line 791 of file GLPixelCanvas.h.

Definition at line 767 of file GLPixelCanvas.h.

GL information.

Definition at line 758 of file GLPixelCanvas.h.

Referenced by doubleBuffered().

Definition at line 753 of file GLPixelCanvas.h.

Definition at line 779 of file GLPixelCanvas.h.

Definition at line 777 of file GLPixelCanvas.h.

Widget casa::GLPixelCanvas::form_ [private]

Definition at line 752 of file GLPixelCanvas.h.

Definition at line 761 of file GLPixelCanvas.h.

Referenced by glpcctbl(), pcctbl(), and setPcctbl().

Definition at line 765 of file GLPixelCanvas.h.

Definition at line 759 of file GLPixelCanvas.h.

Referenced by isRGB().

Definition at line 784 of file GLPixelCanvas.h.

Component / multi-channel buffers etc.

Definition at line 781 of file GLPixelCanvas.h.

Definition at line 783 of file GLPixelCanvas.h.

Definition at line 783 of file GLPixelCanvas.h.

Definition at line 784 of file GLPixelCanvas.h.

Definition at line 782 of file GLPixelCanvas.h.

Definition at line 782 of file GLPixelCanvas.h.

Definition at line 782 of file GLPixelCanvas.h.

Referenced by bufferZValue().

Definition at line 770 of file GLPixelCanvas.h.

Definition at line 770 of file GLPixelCanvas.h.

Definition at line 776 of file GLPixelCanvas.h.

Display lists.

Definition at line 786 of file GLPixelCanvas.h.

GLLogIO casa::GLPixelCanvas::log_ [mutable, private]

Definition at line 797 of file GLPixelCanvas.h.

Referenced by postString(), postToStream(), and postToString().

Definition at line 788 of file GLPixelCanvas.h.

Definition at line 796 of file GLPixelCanvas.h.

Referenced by traceCheck().

Definition at line 787 of file GLPixelCanvas.h.

Widget casa::GLPixelCanvas::parent_ [private]

Definition at line 751 of file GLPixelCanvas.h.

Definition at line 789 of file GLPixelCanvas.h.

Boolean casa::GLPixelCanvas::trace_ [private]

Definition at line 794 of file GLPixelCanvas.h.

Referenced by trace(), and tracing().

Definition at line 795 of file GLPixelCanvas.h.

Referenced by traceLevel().

Visual* casa::GLPixelCanvas::visual_ [private]

Definition at line 755 of file GLPixelCanvas.h.

XVisualInfo* casa::GLPixelCanvas::visualInfo_ [private]

Definition at line 754 of file GLPixelCanvas.h.

Definition at line 764 of file GLPixelCanvas.h.


The documentation for this class was generated from the following file: