SimpleWorldGLCanvasApp.h

Classes

SimpleWorldGLCanvasApp -- Simple application class providing a PixelCanvas and WorldCanvas. (full description)

class SimpleWorldGLCanvasApp

Types

enum

SimpleWorldGLCanvasAppVersion = 1

Interface

Public Members
SimpleWorldGLCanvasApp(const char *application_name="simpleWorldGLCanvasApp", const Display::ColorModel cm = Display::RGB, Float percent=90.0)
static void openApplication( const char *application_class_name, XrmOptionDescRec* options, Cardinal num_options, int *argc, char **argv, char **fallback_resources, ArgList args, Cardinal num_args)
SimpleWorldGLCanvasApp( const char *application_name, const char *application_class_name, XrmOptionDescRec* options, Cardinal num_options, int *argc, char **argv, char **fallback_resources, ArgList args, Cardinal num_args, const Display::ColorModel colormodel, const Float percent)
static void exitCB(Widget, XtPointer, XtPointer)
static void pcmapCB(Widget, XtPointer swca, XtPointer)
static void traceCB(Widget, XtPointer swca, XtPointer)
void printCmapInfo()
WorldCanvas *worldCanvas()
void addRefreshEventHandler(WCRefreshEH & eh)
void addMotionEventHandler(WCMotionEH & eh)
void addPositionEventHandler(WCPositionEH & eh)
void setSizeControlHandler(WCSizeControlHandler & sch)
void setCoordinateHandler(WCCoordinateHandler & ch)
void run()
GLPixelCanvas *glPixelCanvas()const
virtual ~SimpleWorldGLCanvasApp()
friend ostream & operator << (ostream & os, const SimpleWorldGLCanvasApp & spca)
friend AipsIO &operator<<(AipsIO &aio, const SimpleWorldGLCanvasApp & spca)
friend LogIO &operator<<(LogIO &lio, const SimpleWorldGLCanvasApp & spca)
friend AipsIO &operator>>(AipsIO &aio, SimpleWorldGLCanvasApp & spca)
Bool ok() const
Private Members
Widget buildWidget(const char *appname)
void initialize(const Display::ColorModel, const Float percent, const char *appname)
static void redrawCB(Widget w, XtPointer me, XtPointer unuseddata)

Description

Prerequisite

Etymology

SimpleWorldGLCanvasApp : Simple WorldCanvas OpenGL Application Class

Synopsis

SimpleWorldGLCanvasApp provides basic a basic GUI panel for a simple WorldCanvas application. Event and other handlers can be registered to the app class. SimpleWorldGLCanvasApp was copied from SimpleWorldCanvasApp and modified to use a GLPixelCanvas.

Motivation

Needed a testbed for GLPixelCanvas.

Example

See the test programs in Display

Thrown Exceptions

Member Description

SimpleWorldGLCanvasApp(const char *application_name="simpleWorldGLCanvasApp", const Display::ColorModel cm = Display::RGB, Float percent=90.0)

Constructor to use if openApplication has been called or just want default connection.

static void openApplication( const char *application_class_name, XrmOptionDescRec* options, Cardinal num_options, int *argc, char **argv, char **fallback_resources, ArgList args, Cardinal num_args)

Just make initial connection to X server. Used if it is desired to separate opening the display and creating the SimpleWorldGLCanvasApp. (e.g. Open connection then use the 'Input' class get the color model.)

SimpleWorldGLCanvasApp( const char *application_name, const char *application_class_name, XrmOptionDescRec* options, Cardinal num_options, int *argc, char **argv, char **fallback_resources, ArgList args, Cardinal num_args, const Display::ColorModel colormodel, const Float percent)

Connect to X server then create the app.

static void exitCB(Widget, XtPointer, XtPointer)

X callback to quit the program

static void pcmapCB(Widget, XtPointer swca, XtPointer)

Pass a SimpleWorldGLCanvasApp as the second arg to print colormap info. (Other args are ignored.

static void traceCB(Widget, XtPointer swca, XtPointer)

Toggle tracing.

void printCmapInfo()

called by pcmapCB.

WorldCanvas *worldCanvas()

get the WorldCanvas

void addRefreshEventHandler(WCRefreshEH & eh)
void addMotionEventHandler(WCMotionEH & eh)
void addPositionEventHandler(WCPositionEH & eh)

add event handlers to the WorldCanvas

void setSizeControlHandler(WCSizeControlHandler & sch)
void setCoordinateHandler(WCCoordinateHandler & ch)

add specialized handlers to the WorldCanvas

void run()

Run the application

GLPixelCanvas *glPixelCanvas()const

virtual ~SimpleWorldGLCanvasApp()

Destructor

friend ostream & operator << (ostream & os, const SimpleWorldGLCanvasApp & spca)

Write a SimpleWorldGLCanvasApp to an ostream in a simple text form.

friend AipsIO &operator<<(AipsIO &aio, const SimpleWorldGLCanvasApp & spca)

Write a SimpleWorldGLCanvasApp to an AipsIO stream in a binary format.

friend LogIO &operator<<(LogIO &lio, const SimpleWorldGLCanvasApp & spca)

Write a SimpleWorldGLCanvasApp to a LogIO stream.

friend AipsIO &operator>>(AipsIO &aio, SimpleWorldGLCanvasApp & spca)

Read a SimpleWorldGLCanvasApp from an AipsIO stream in a binary format. Will throw an AipsError if the current SimpleWorldGLCanvasApp Version does not match that of the one on disk.

Bool ok() const

Is this SimpleWorldGLCanvasApp consistent?

Widget buildWidget(const char *appname)

function that builds the basic GUI

void initialize(const Display::ColorModel, const Float percent, const char *appname)

static void redrawCB(Widget w, XtPointer me, XtPointer unuseddata)

enum