file: XmdvTool.c
/* XmdvTool.c: a program for multivariate data display */
/* Version 2.0 - May 19, 1995 */
/* Version 1.0 - May 9, 1994 */
/* Copyright 1994, Matthew O. Ward
* 1995, Allen R. Martin
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without fee
* is granted provided that the above copyright notice appears in all copies.
* It is provided "as is" without express or implied warranty.
* see copyright note below.
*/
/* XmdvTool V 1.0 - a program for multivariate data display using scatterplots,
** glyphs, parallel coordinates, and dimensional stacking. Written by
** Matthew Ward, Computer Science Department, Worcester Polytechnic
** Institute, Worcester, MA 01609 USA (matt@cs.wpi.edu). This program was
** built using Athena Widgets and the Widget Creation Library (see notes
** below), and as such, inherits the warranties of those packages, i.e.
** none. Thanks to David E. Smyth and Martin Brunecky for WCL - it really is
** a nice package!
*/
/*
* Version 2.0 - This version of the software introduces extensions
* related to the concept of brushing. The user's manual
* contained in the distribution contains a full description
* of the extentions, but here is an overview:
*
* - Simultaneous display of multiple brushes
* - New brush operations of quantitative display,
* average, and masking.
* - Logical brush combinations
* - Ramped brush boundaries
* - Color Requester
* - Direct Manipulation of brushes
* - New methods of indirect manipulation through
* brush tools and global resize tool
* - Prioritized brush operations
* - Data driven brushing
*/
/*
** Copyright (c) 1990 David E. Smyth
**
** Redistribution and use in source and binary forms are permitted
** provided that the above copyright notice and this paragraph are
** duplicated in all such forms and that any documentation, advertising
** materials, and other materials related to such distribution and use
** acknowledge that the software was developed by David E. Smyth. The
** name of David E. Smyth may not be used to endorse or promote products
** derived from this software without specific prior written permission.
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
*/
/******************************************************************************
**
** Description: This file contains main() for a Athena Resource Interpreter
** which allows prototype interfaces to be built from
** resource files. The Widget Creation library is used.
**
** Notes: This program uses the Xrm (X resource management) database
** for widget tree definition and management. This program
** is dependent on the X Athena (Xaw) widget set, ALL the Xaw
** widget classes are registered by the call to XpRegisterAll().
**
** This version is slightly DIFFERENT than the original Mri
** provided by David Smyth with Wcl 1.05. It uses the first
** command line argument argv[1] as an application class, thus
** directly selecting controlled user interface
**
** 09/27/1991 Martin Brunecky
**
******************************************************************************/
/* main program checks usage, calls initialization routines, and starts X
event loop */
#include "XmdvTool.h"
#include "cursor.h"
#include "brush.h"
#include "init.h"
#include "util.h"
/* global variables for X and Athena Widgets */
Widget appShell;
GC gc, xor_gc;
/* is this a color display? */
int COLOR = 1;
int X_SIZE=600; /* default drawing area size, change as desired */
int Y_SIZE=600;
extern XColor outline_col;
main (int argc,char *argv[])
{
XtAppContext app;
Widget canvas_w;
XGCValues xgcv;
/* check args */
if ( argc < 3 ) {
printf("usage: XmdvTool app-class-name datafile\n");
printf("where app-class-name specifies the app-defaults resource file\n");
exit(-1);
}
/* Intialize Toolkit creating the application shell */
appShell = XtInitialize ( "XmdvTool", argv[1], NULL, 0, &argc, argv );
app = XtWidgetToApplicationContext(appShell);
/* register all callbacks, etc */
init_CB(app);
/* Create widget tree below toplevel shell using Xrm database */
if ( WcWidgetCreation ( appShell ) != 0 )
exit (-1);
/* Realize the widget tree and enter the main application loop */
XtRealizeWidget ( appShell );
canvas_w = WcFullNameToWidget(appShell,"*canvas");
/* create the standard gc */
gc = XCreateGC(XtDisplay(canvas_w),
DefaultRootWindow(XtDisplay(canvas_w)), 0, 0);
/* create the GC for drawing in XOR mode */
xgcv.function = GXxor;
xor_gc = XCreateGC(XtDisplay(canvas_w),
DefaultRootWindow(XtDisplay(canvas_w)), GCFunction, &xgcv);
/* initialize screen variables and read in data */
InitColors(canvas_w);
InitCursors(canvas_w);
get_head(argv[2]);
InitBrush();
init_HelpList();
init_DimList();
init_glyphkey();
init_hierkey();
/* set the foreground of the xor gc */
XSetForeground(XtDisplay(canvas_w), xor_gc, outline_col.pixel);
/* start up X event loop */
XtMainLoop ( );
exit(1);
}
C++ to HTML Conversion by ctoohtml