瀏覽代碼

xganim: removing xganim (replaced by g.gui.animation, motivation: it does not compile with clang)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58484 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 年之前
父節點
當前提交
8566755e0b

+ 0 - 25
visualization/xganim/Makefile

@@ -1,25 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = xganim
-
-EXTRA_CFLAGS = $(WXWIDGETSCXXFLAGS) -DWXINTL_NO_GETTEXT_MACRO
-
-LIBES = $(RASTERLIB) $(GISLIB) $(WXWIDGETSLIB)
-DEPENDENCIES = $(RASTERDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-# substitute OSX arch flags for wxpython
-ifneq ($(MACOSX_ARCHS),)
-CFLAGS := $(subst $(MACOSX_ARCHS),,$(CFLAGS)) $(MACOSX_ARCHS_WXPYTHON)
-CXXFLAGS := $(subst $(MACOSX_ARCHS),,$(CXXFLAGS)) $(MACOSX_ARCHS_WXPYTHON)
-LDFLAGS := $(subst $(MACOSX_ARCHS),,$(LDFLAGS)) $(MACOSX_ARCHS_WXPYTHON)
-endif
-
-LINK = $(CXX)
-
-ifneq ($(USE_WXWIDGETS),)
-ifneq ($(strip $(CXX)),)
-default: cmd
-endif
-endif

+ 0 - 1
visualization/xganim/bitmaps/README

@@ -1 +0,0 @@
-bitmaps for xganim

+ 0 - 8
visualization/xganim/bitmaps/ff.xbm

@@ -1,8 +0,0 @@
-#define ff_width 20
-#define ff_height 20
-static char ff_bits[] = {
-   0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x14, 0x05, 0x00, 0x2c, 0x0b, 0x00,
-   0x54, 0x15, 0x00, 0xac, 0x2b, 0x00, 0x44, 0x51, 0x00, 0x8c, 0xa3, 0x00,
-   0x04, 0x40, 0x01, 0x0c, 0x80, 0x03, 0x04, 0xc0, 0x01, 0x8c, 0xe3, 0x00,
-   0xc4, 0x71, 0x00, 0xec, 0x3b, 0x00, 0x74, 0x1d, 0x00, 0x3c, 0x0f, 0x00,
-   0x1c, 0x07, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/loop.xbm

@@ -1,8 +0,0 @@
-#define loop_width 20
-#define loop_height 20
-static char loop_bits[] = {
-   0x00, 0x10, 0x00, 0x00, 0xf0, 0x00, 0xa0, 0xa0, 0x03, 0x50, 0x51, 0x05,
-   0xe8, 0xa0, 0x06, 0x74, 0x50, 0x03, 0x38, 0xe0, 0x02, 0x34, 0x70, 0x05,
-   0x1a, 0x80, 0x06, 0x14, 0x00, 0x05, 0x1a, 0x80, 0x06, 0x14, 0x00, 0x05,
-   0x2a, 0x80, 0x06, 0x54, 0x40, 0x03, 0xa8, 0xaa, 0x02, 0x50, 0x55, 0x01,
-   0xb0, 0xea, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/play.xbm

@@ -1,8 +0,0 @@
-#define play_width 20
-#define play_height 20
-static char play_bits[] = {
-   0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x01, 0x00, 0xc0, 0x02, 0x00,
-   0x40, 0x05, 0x00, 0xc0, 0x0a, 0x00, 0x40, 0x14, 0x00, 0xc0, 0x28, 0x00,
-   0x40, 0x50, 0x00, 0xc0, 0xe0, 0x00, 0x40, 0x70, 0x00, 0xc0, 0x38, 0x00,
-   0x40, 0x1c, 0x00, 0xc0, 0x0e, 0x00, 0x40, 0x07, 0x00, 0xc0, 0x03, 0x00,
-   0xc0, 0x01, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/rabbit.xbm

@@ -1,8 +0,0 @@
-#define rabbit_width 20
-#define rabbit_height 20
-static char rabbit_bits[] = {
-   0x00, 0xc0, 0x00, 0x00, 0xcc, 0x00, 0x03, 0xd4, 0x00, 0x07, 0xe8, 0x00,
-   0xe5, 0xd1, 0x00, 0xbd, 0xa2, 0x03, 0x45, 0x4d, 0x06, 0xbf, 0x7a, 0x08,
-   0x37, 0x95, 0x08, 0x6b, 0x6a, 0x0f, 0x55, 0x95, 0x01, 0xeb, 0xbf, 0x01,
-   0x95, 0xbf, 0x01, 0x0a, 0xa0, 0x01, 0x3a, 0xd0, 0x00, 0x46, 0x70, 0x00,
-   0xfc, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/rewind.xbm

@@ -1,8 +0,0 @@
-#define rewind_width 20
-#define rewind_height 20
-static char rewind_bits[] = {
-   0x00, 0x00, 0x00, 0x30, 0x80, 0x01, 0x28, 0x40, 0x01, 0x30, 0xa0, 0x01,
-   0x28, 0x50, 0x01, 0x30, 0xa8, 0x01, 0x28, 0x14, 0x01, 0x30, 0x8a, 0x01,
-   0x28, 0x05, 0x01, 0xb0, 0x83, 0x01, 0x28, 0x03, 0x01, 0x30, 0x8e, 0x01,
-   0x28, 0x1c, 0x01, 0x30, 0xb8, 0x01, 0x28, 0x70, 0x01, 0x30, 0xe0, 0x01,
-   0x28, 0xc0, 0x01, 0x38, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/rplay.xbm

@@ -1,8 +0,0 @@
-#define rplay_width 20
-#define rplay_height 20
-static char rplay_bits[] = {
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x28, 0x00,
-   0x00, 0x34, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x35, 0x00, 0x80, 0x22, 0x00,
-   0x40, 0x31, 0x00, 0xa0, 0x20, 0x00, 0x70, 0x30, 0x00, 0xe0, 0x20, 0x00,
-   0xc0, 0x31, 0x00, 0x80, 0x23, 0x00, 0x00, 0x37, 0x00, 0x00, 0x2e, 0x00,
-   0x00, 0x3c, 0x00, 0x00, 0x38, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/snail.xbm

@@ -1,8 +0,0 @@
-#define snail_width 20
-#define snail_height 20
-static char snail_bits[] = {
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0xfc, 0x07, 0x00,
-   0x0e, 0x0f, 0x00, 0x06, 0x1c, 0x00, 0xe3, 0x39, 0x0c, 0x33, 0x33, 0x0c,
-   0x11, 0x32, 0x09, 0x91, 0x33, 0x0b, 0x93, 0x3b, 0x0a, 0x33, 0x18, 0x0e,
-   0xf3, 0x1f, 0x0e, 0x06, 0x70, 0x0e, 0x06, 0xc0, 0x07, 0x0e, 0xfc, 0x07,
-   0x8c, 0xff, 0x07, 0xfe, 0xff, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00};

+ 0 - 24
visualization/xganim/bitmaps/stepb.xbm

@@ -1,24 +0,0 @@
-#define stepb_width 20
-#define stepb_height 20
-static char stepb_bits[] = {
-0x00, 0x00, 0x00,
-0x00, 0x8c, 0x01,
-0x00, 0x8a, 0x02,
-0x00, 0x8d, 0x01,
-0x80, 0x8a, 0x02,
-0x40, 0x8d, 0x01,
-0xa0, 0x88, 0x02,
-0x50, 0x8c, 0x01,
-0x28, 0x88, 0x02,
-0x1c, 0x8c, 0x01,
-0x38, 0x88, 0x02,
-0x70, 0x8c, 0x01,
-0xe0, 0x88, 0x02,
-0xc0, 0x8d, 0x01,
-0x80, 0x8b, 0x02,
-0x00, 0x8f, 0x01,
-0x00, 0x8e, 0x02,
-0x00, 0x8c, 0x03,
-0x00, 0x00, 0x00,
-0x00, 0x00, 0x00,
-};

+ 0 - 8
visualization/xganim/bitmaps/stepf.xbm

@@ -1,8 +0,0 @@
-#define stepf_width 20
-#define stepf_height 20
-static char stepf_bits[] = {
-   0x00, 0x00, 0x00, 0x18, 0x03, 0x00, 0x14, 0x05, 0x00, 0x18, 0x0b, 0x00,
-   0x14, 0x15, 0x00, 0x18, 0x2b, 0x00, 0x14, 0x51, 0x00, 0x18, 0xa3, 0x00,
-   0x14, 0x41, 0x01, 0x18, 0x83, 0x03, 0x14, 0xc1, 0x01, 0x18, 0xe3, 0x00,
-   0x14, 0x71, 0x00, 0x18, 0x3b, 0x00, 0x14, 0x1d, 0x00, 0x18, 0x0f, 0x00,
-   0x14, 0x07, 0x00, 0x1c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/stop.xbm

@@ -1,8 +0,0 @@
-#define stop_width 20
-#define stop_height 20
-static char stop_bits[] = {
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x54, 0x55, 0x01,
-   0xac, 0xaa, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01,
-   0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01,
-   0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0xf4, 0xff, 0x01,
-   0xac, 0xaa, 0x02, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 8
visualization/xganim/bitmaps/swing.xbm

@@ -1,8 +0,0 @@
-#define swing_width 20
-#define swing_height 20
-static char swing_bits[] = {
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x86, 0x1f, 0x06,
-   0xe7, 0x7a, 0x0a, 0x53, 0xd5, 0x0c, 0xab, 0xa8, 0x0d, 0x35, 0x60, 0x0f,
-   0x0b, 0x00, 0x0e, 0x0e, 0x00, 0x07, 0x14, 0x80, 0x02, 0x38, 0xc0, 0x01,
-   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

+ 0 - 305
visualization/xganim/gui.cpp

@@ -1,305 +0,0 @@
-/* Written by Bill Brown, USACERL (brown@zorro.cecer.army.mil)
- * May 2-12, 1994
- *
- * This code is in the public domain. Specifically, we give to the public
- * domain all rights for future licensing of the source code, all resale
- * rights, and all publishing rights.
- * 
- * We ask, but do not require, that the following message be included in
- * all derived works:
- *     "Portions developed at the US Army Construction Engineering 
- *     Research Laboratories, Champaign, Illinois."
- * 
- * USACERL GIVES NO WARRANTY, EXPRESSED OR IMPLIED,
- * FOR THE SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT
- * LIMITATION, WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A
- * PARTICULAR PURPOSE.
- */
-
-#include <stdlib.h>
-#include <wx/button.h>
-#include <wx/bmpbuttn.h>
-#include <wx/bitmap.h>
-#include <wx/sizer.h>
-#include <wx/strconv.h>
-#include <wx/event.h>
-#include <wx/dcclient.h>
-#include <wx/dc.h>
-#include <wx/colour.h>
-#include "gui.h"
-
-#include "bitmaps/rewind.xbm"
-#include "bitmaps/rplay.xbm"
-#include "bitmaps/stepb.xbm"
-#include "bitmaps/stop.xbm"
-#include "bitmaps/stepf.xbm"
-#include "bitmaps/play.xbm"
-#include "bitmaps/loop.xbm"
-#include "bitmaps/swing.xbm"
-#include "bitmaps/snail.xbm"
-#include "bitmaps/rabbit.xbm"
-
-enum {
-    MYID_REW,
-    MYID_RPLAY,
-    MYID_STEPB,
-    MYID_STOP,
-    MYID_STEPF,
-    MYID_PLAY,
-    MYID_LOOP,
-    MYID_SWING,
-    MYID_SLOWER,
-    MYID_FASTER,
-    MYID_SHNAMES,
-    MYID_DOEXIT,
-};
-
-BEGIN_EVENT_TABLE(MyCanvas, wxPanel)
-EVT_ERASE_BACKGROUND(MyCanvas::erase)
-END_EVENT_TABLE()
-
-MyCanvas::MyCanvas(wxWindow *parent, wxWindowID id, const wxSize &size)
-    : wxPanel(parent, id, wxDefaultPosition, size)
-{
-    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-}
-
-void MyCanvas::erase(wxEraseEvent &ev)
-{
-    ev.GetDC();
-}
-
-void MyCanvas::draw_image(wxBitmap *bmp)
-{
-    wxClientDC dc(this);
-
-    dc.DrawBitmap(*bmp, 0, 0, false);
-}
-
-void MyCanvas::draw_text(int style, int x, int y, const char *str)
-{
-    wxClientDC dc(this);
-
-    switch (style) {
-    case 1:
-	dc.SetTextBackground(*wxWHITE);
-	dc.SetTextForeground(*wxBLACK);
-	break;
-    case 2:
-	dc.SetTextBackground(*wxBLACK);
-	dc.SetTextForeground(*wxWHITE);
-	break;
-    default:
-	return;
-    }
-
-    dc.DrawText(wxString(str, wxConvISO8859_1), x, y);
-}
-
-BEGIN_EVENT_TABLE(MyFrame, wxFrame)
-EVT_BUTTON(MYID_REW,     MyFrame::rewind_callback)
-EVT_BUTTON(MYID_RPLAY,   MyFrame::rplay_callback)
-EVT_BUTTON(MYID_STEPB,   MyFrame::stepb_callback)
-EVT_BUTTON(MYID_STOP,    MyFrame::stop_callback)
-EVT_BUTTON(MYID_STEPF,   MyFrame::stepf_callback)
-EVT_BUTTON(MYID_PLAY,    MyFrame::play_callback)
-EVT_BUTTON(MYID_LOOP,    MyFrame::loop_callback)
-EVT_BUTTON(MYID_SWING,   MyFrame::swing_callback)
-EVT_BUTTON(MYID_SLOWER,  MyFrame::slower_callback)
-EVT_BUTTON(MYID_FASTER,  MyFrame::faster_callback)
-EVT_BUTTON(MYID_SHNAMES, MyFrame::names_callback)
-EVT_BUTTON(MYID_DOEXIT,  MyFrame::exit_callback)
-END_EVENT_TABLE()
-
-void MyFrame::make_buttons(wxSizer *sizer)
-{
-    sizer->Add(new wxBitmapButton(this, MYID_REW   , wxBitmap(rewind_bits, rewind_width, rewind_height)));
-    sizer->Add(new wxBitmapButton(this, MYID_RPLAY , wxBitmap(rplay_bits , rplay_width , rplay_height )));
-    sizer->Add(new wxBitmapButton(this, MYID_STEPB , wxBitmap(stepb_bits , stepb_width , stepb_height )));
-    sizer->Add(new wxBitmapButton(this, MYID_STOP  , wxBitmap(stop_bits  , stop_width  , stop_height  )));
-    sizer->Add(new wxBitmapButton(this, MYID_STEPF , wxBitmap(stepf_bits , stepf_width , stepf_height )));
-    sizer->Add(new wxBitmapButton(this, MYID_PLAY  , wxBitmap(play_bits  , play_width  , play_height  )));
-    sizer->Add(new wxBitmapButton(this, MYID_LOOP  , wxBitmap(loop_bits  , loop_width  , loop_height  )));
-    sizer->Add(new wxBitmapButton(this, MYID_SWING , wxBitmap(swing_bits , swing_width , swing_height )));
-    sizer->Add(new wxBitmapButton(this, MYID_SLOWER, wxBitmap(snail_bits , snail_width , snail_height )));
-    sizer->Add(new wxBitmapButton(this, MYID_FASTER, wxBitmap(rabbit_bits, rabbit_width, rabbit_height)));
-    sizer->Add(new wxButton(this, MYID_SHNAMES, wxString("Names", wxConvISO8859_1)));
-    sizer->Add(new wxButton(this, MYID_DOEXIT,  wxString("Exit", wxConvISO8859_1)));
-}
-
-void MyFrame::rewind_callback(wxCommandEvent &event)
-{
-    cd->step = 0;
-    cd->stop = 1;
-    cd->rewind = 1;
-}
-
-void MyFrame::rplay_callback(wxCommandEvent &event)
-{
-    cd->step = 0;
-    cd->stop = 0;
-    cd->direction = -1;
-    cd->curframe = cd->prevframe + cd->direction;
-}
-
-void MyFrame::stepb_callback(wxCommandEvent &event)
-{
-    cd->step = 1;
-    cd->direction = -1;
-    cd->curframe = cd->prevframe + cd->direction;
-}
-
-void MyFrame::stop_callback(wxCommandEvent &event)
-{
-    cd->stop = 1;
-}
-
-void MyFrame::stepf_callback(wxCommandEvent &event)
-{
-    cd->step = 1;
-    cd->direction = 1;
-    cd->curframe = cd->prevframe + cd->direction;
-}
-
-void MyFrame::play_callback(wxCommandEvent &event)
-{
-    cd->step = 0;
-    cd->stop = 0;
-    cd->direction = 1;
-    cd->curframe = cd->prevframe + cd->direction;
-}
-
-void MyFrame::loop_callback(wxCommandEvent &event)
-{
-    cd->loop = !cd->loop;
-    cd->swing = 0;
-    cd->stop = !cd->loop;
-}
-
-void MyFrame::swing_callback(wxCommandEvent &event)
-{
-    cd->swing = !cd->swing;
-    cd->loop = 0;
-    cd->stop = !cd->swing;
-}
-
-void MyFrame::slower_callback(wxCommandEvent &event)
-{
-    if (cd->speed) {
-	if (cd->speed < 200000)
-	    cd->speed *= 3;
-    }
-    else
-	cd->speed = 1;
-}
-
-void MyFrame::faster_callback(wxCommandEvent &event)
-{
-    if (cd->speed > 1)
-	cd->speed /= 3;
-}
-
-void MyFrame::names_callback(wxCommandEvent &event)
-{
-    cd->shownames = (1 + cd->shownames) % 3;
-}
-
-void MyFrame::exit_callback(wxCommandEvent &event)
-{
-    exit(0);
-}
-
-void MyFrame::change_label(const char *label)
-{
-    flabel->SetLabel(wxString(label, wxConvISO8859_1));
-}
-
-#if 0
-
-void MyFrame::init_graphics()
-{
-/* global variables */
-    Widget canvas;
-    Display *theDisplay;
-    XImage *pic_array[MAXIMAGES];
-    GC invertGC, drawGC;
-
-    int scrn;
-    Display *dpy;
-    Window grwin;
-    Colormap fixedcmap;
-    unsigned long blackPix, whitePix;
-
-    unsigned int depth;
-    Visual *use_visual;
-
-    dpy = XtDisplay(canvas);
-    grwin = XtWindow(canvas);
-    scrn = DefaultScreen(dpy);
-    use_visual = DefaultVisual(dpy, scrn);
-#if 1
-    fixedcmap = XCreateColormap(dpy, grwin, use_visual, AllocNone);
-#else
-    fixedcmap = DefaultColormap(dpy, scrn);
-#endif
-    fixedcmap = InitColorTableFixed(fixedcmap);
-
-    XtVaGetValues(canvas, XmNdepth, &depth, NULL);
-
-    XtVaSetValues(toplevel, XmNcolormap, fixedcmap, NULL);
-    XtSetWMColormapWindows(toplevel, &canvas, 1);
-
-    /**************************************************************/
-
-    blackPix = _get_lookup_for_color(0, 0, 0);
-    whitePix = _get_lookup_for_color(255, 255, 255);
-
-    drawGC =
-	XCreateGC(XtDisplay(canvas), XtWindow(canvas), (unsigned long)0,
-		  NULL);
-
-    theDisplay = XtDisplay(toplevel);
-
-    XSetFunction(theDisplay, drawGC, GXcopy);
-    XSetForeground(theDisplay, drawGC, blackPix);
-    XSetBackground(theDisplay, drawGC, whitePix);
-
-    invertGC =
-	XCreateGC(XtDisplay(canvas), XtWindow(canvas), (unsigned long)0,
-		  NULL);
-    XSetFunction(theDisplay, invertGC, GXcopy);
-    XSetForeground(theDisplay, invertGC, whitePix);
-    XSetBackground(theDisplay, invertGC, blackPix);
-
-}
-
-#endif
-
-MyFrame::MyFrame(const wxString& title, int ncols, int nrows, struct gui_data *cd)
-    : wxFrame((wxFrame *)NULL, wxID_ANY, title), cd(cd)
-{
-    canvas = new MyCanvas(this, wxID_ANY, wxSize(ncols, nrows));
-
-    wxBoxSizer *sizer, *buttons;
-
-    if (ncols > nrows) {
-	sizer = new wxBoxSizer(wxVERTICAL);
-	buttons = new wxBoxSizer(wxHORIZONTAL);
-	sizer->Add(canvas);
-	sizer->Add(buttons);
-    }
-    else {
-	sizer = new wxBoxSizer(wxHORIZONTAL);
-	buttons = new wxBoxSizer(wxVERTICAL);
-	sizer->Add(canvas);
-	sizer->Add(buttons);
-    }
-
-    make_buttons(buttons);
-
-    flabel = new wxStaticText(this, wxID_ANY, wxString("00000", wxConvISO8859_1), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
-    buttons->Add(flabel);
-
-    SetSizerAndFit(sizer);
-}
-

+ 0 - 76
visualization/xganim/gui.h

@@ -1,76 +0,0 @@
-#include <wx/app.h>
-#include <wx/event.h>
-#include <wx/window.h>
-#include <wx/panel.h>
-#include <wx/frame.h>
-#include <wx/stattext.h>
-#include <wx/bitmap.h>
-
-#define MAXIMAGES 400
-#define MAXVIEWS    4
-
-struct gui_data
-{
-    int step, speed, stop, direction;
-    int rewind, prevframe, curframe, nframes;
-    int loop, swing, shownames;
-};
-
-class MyCanvas: public wxPanel
-{
-public:
-    MyCanvas(wxWindow *parent, wxWindowID id, const wxSize& size);
-    void erase(wxEraseEvent &ev);
-    void draw_image(wxBitmap *bmp);
-    void draw_text(int style, int x, int y, const char *str);
-
-    DECLARE_EVENT_TABLE()
-};
-
-class MyFrame: public wxFrame
-{
-public:
-    MyFrame(const wxString& title, int ncols, int nrows, struct gui_data *cd);
-    void change_label(const char *label);
-
-    MyCanvas *canvas;
-
-private:
-    struct gui_data *cd;
-    wxStaticText *flabel;
-
-    void make_buttons(wxSizer *);
-
-    void rewind_callback(wxCommandEvent &);
-    void rplay_callback(wxCommandEvent &);
-    void stepb_callback(wxCommandEvent &);
-    void stop_callback(wxCommandEvent &);
-    void stepf_callback(wxCommandEvent &);
-    void play_callback(wxCommandEvent &);
-    void loop_callback(wxCommandEvent &);
-    void swing_callback(wxCommandEvent &);
-    void exit_callback(wxCommandEvent &);
-    void names_callback(wxCommandEvent &);
-    void slower_callback(wxCommandEvent &);
-    void faster_callback(wxCommandEvent &);
-
-    DECLARE_EVENT_TABLE()
-};
-
-class MyApp: public wxApp
-{
-private:
-    wxBitmap *pic_array[MAXIMAGES];
-
-public:
-    virtual bool OnInit();
-
-private:
-    MyFrame *mainwin;
-    struct gui_data gd;
-
-    int load_files(void);
-    void do_run(wxIdleEvent &);
-
-    DECLARE_EVENT_TABLE()
-};

+ 0 - 474
visualization/xganim/main.cpp

@@ -1,474 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       xganim
- * AUTHOR(S):    Bill Brown <brown gis.uiuc.edu> CERL (original contributor),
- *               Markus Neteler <neteler itc.it>,
- *               Roberto Flor <flor itc.it>, 
- *               Bernhard Reiter <bernhard intevation.de>, 
- *               Brad Douglas <rez touchofmadness.com>, 
- *               Glynn Clements <glynn gclements.plus.com>
- * PURPOSE:      a tool for animating a series of GRASS raster files
- * COPYRIGHT:    (C) 1999-2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-#include <limits.h>
-#include <unistd.h>
-
-#include <wx/image.h>
-#include <wx/bitmap.h>
-#include <wx/event.h>
-
-extern "C" {
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/spawn.h>
-#include <grass/glocale.h>
-}
-
-#include "gui.h"
-
-#define DEF_MAX 900
-#define DEF_MIN 600
-#define BORDER_W    2
-
-static char **gee_wildfiles(const char *wildarg, const char *element, int *num);
-static void parse_command(
-    struct Option **viewopts,
-    char *vfiles[MAXVIEWS][MAXIMAGES],
-    int *numviews, int *numframes);
-
-struct Option *viewopts[MAXVIEWS];
-
-unsigned int nrows, ncols;
-char *vfiles[MAXVIEWS][MAXIMAGES];
-int numviews;
-int frames;
-int Top = 0, Left = 0;
-char frame[MAXIMAGES][4];
-int LabelPos[MAXVIEWS][2];
-
-float vscale, scale;		/* resampling scale factors */
-int irows, icols, vrows, vcols;
-
-BEGIN_EVENT_TABLE(MyApp, wxApp)
-EVT_IDLE(MyApp::do_run)
-END_EVENT_TABLE()
-
-int main(int argc, char **argv)
-{
-    int i;
-
-    G_gisinit(argv[0]);
-
-
-    for (i = 0; i < MAXVIEWS; i++) {
-	char buf[BUFSIZ];
-	viewopts[i] = G_define_option();
-	sprintf(buf, "view%d", i + 1);
-	viewopts[i]->key = G_store(buf);
-	viewopts[i]->type = TYPE_STRING;
-	viewopts[i]->required = (i ? NO : YES);
-	viewopts[i]->multiple = YES;
-	viewopts[i]->gisprompt = "old,cell,Raster";;
-	sprintf(buf, _("Raster file(s) for View%d"), i + 1);
-	viewopts[i]->description = G_store(buf);
-    }
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    parse_command(viewopts, vfiles, &numviews, &frames);
-
-    return wxEntry(argc, argv);
-}
-
-bool MyApp::OnInit()
-{
-    int i, j;
-    unsigned int *sdimp;
-    int longdim;
-
-    /* debug */
-    if (G_verbose() > G_verbose_std()) {
-	for (i = 0; i < numviews; i++) {
-	    fprintf(stderr, "\nVIEW %d: ", i + 1);
-	    for (j = 0; j < frames; j++) {
-		fprintf(stderr, "%s ", vfiles[i][j]);
-	    }
-	}
-    }
-    fprintf(stderr, "\n");
-
-    vrows = Rast_window_rows();
-    vcols = Rast_window_cols();
-    nrows = vrows;
-    ncols = vcols;
-
-    /* short dimension */
-    sdimp = nrows > ncols ? &ncols : &nrows;
-
-    /* these proportions should work fine for 1 or 4 views, but for
-       2 views, want to double the narrow dim & for 3 views triple it */
-    if (numviews == 2)
-	*sdimp *= 2;
-    else if (numviews == 3)
-	*sdimp *= 3;
-
-    longdim = nrows > ncols ? nrows : ncols;
-
-    scale = 1.0;
-
-    {				/* find animation image size */
-	int max, min;
-	char *p;
-
-	max = DEF_MAX;
-	min = DEF_MIN;
-
-	if ((p = getenv("XGANIM_SIZE")))
-	    max = min = atoi(p);
-
-	if (longdim > max)	/* scale down */
-	    scale = (float)max / longdim;
-	else if (longdim < min)	/* scale up */
-	    scale = (float)min / longdim;
-    }
-
-    vscale = scale;
-    if (numviews == 4)
-	vscale = scale / 2.;
-
-    nrows = (unsigned int) (nrows * scale);
-    ncols = (unsigned int) (ncols * scale);
-    /* now nrows & ncols are the size of the combined - views image */
-    vrows = (int) (vrows * vscale);
-    vcols = (int) (vcols * vscale);
-    /* now vrows & vcols are the size for each sub-image */
-
-    /* add to nrows & ncols for borders */
-    /* irows, icols used for vert/horizontal determination in loop below */
-    irows = nrows;
-    icols = ncols;
-    nrows += (1 + (nrows / vrows)) * BORDER_W;
-    ncols += (1 + (ncols / vcols)) * BORDER_W;
-
-    gd.speed = 100;
-    gd.direction = 1;
-    gd.shownames = 1;
-
-    mainwin = new MyFrame(wxString("GRASS Animate", wxConvISO8859_1), ncols, nrows, &gd);
-    mainwin->Show();
-    SetTopWindow(mainwin);
-
-    for (j = 0; j < MAXIMAGES; j++)
-	sprintf(frame[j], "%2d", j + 1);
-
-    return true;
-}
-
-
-int MyApp::load_files(void)
-{
-    DCELL *dcell;
-    unsigned char *tr, *tg, *tb, *tset;
-    int tsiz, coff;
-    int rowoff, row, col, vxoff, vyoff;
-    int cnt, ret, fd;
-    int vnum;
-    const char *name;
-    struct Colors colors;
-
-    dcell = Rast_allocate_d_buf();
-
-    tsiz = Rast_window_cols();
-
-    /* allocate memory */
-    tr   = (unsigned char *) G_malloc(tsiz * sizeof(char));
-    tg   = (unsigned char *) G_malloc(tsiz * sizeof(char));
-    tb   = (unsigned char *) G_malloc(tsiz * sizeof(char));
-    tset = (unsigned char *) G_malloc(tsiz * sizeof(char));
-
-    wxImage img(ncols, nrows);
-
-    for (cnt = 0; cnt < frames; cnt++) {
-	if (cnt > MAXIMAGES) {
-	    cnt--;
-	    break;
-	}
-
-	for (vnum = 0; vnum < numviews; vnum++) {
-	    if (icols == vcols) {
-		vxoff = BORDER_W;
-		vyoff = (irows == vrows) ? BORDER_W :
-		    BORDER_W + vnum * (BORDER_W + vrows);
-	    }
-	    else if (irows == vrows) {
-		vxoff = (icols == vcols) ? BORDER_W :
-		    BORDER_W + vnum * (BORDER_W + vcols);
-		vyoff = BORDER_W;
-	    }
-	    else {		/* 4 views */
-		/* assumes we want :
-		   view1        view2
-
-		   view3        view4   
-		 */
-		vxoff = vnum % 2 ? BORDER_W : vcols + 2 * BORDER_W;
-		vyoff = vnum > 1 ? vrows + 2 * BORDER_W : BORDER_W;
-	    }
-	    if (!cnt) {
-		LabelPos[vnum][0] = vxoff;
-		LabelPos[vnum][1] = vyoff + vrows - 1;
-	    }
-
-	    name = vfiles[vnum][cnt];
-	    G_message(_("Reading file [%s]..."), name);
-
-	    fd = Rast_open_old(name, "");
-	    if (fd < 0)
-		G_fatal_error(_("Unable to open raster map <%s>"), name);
-	    /*
-	       strcpy(title[cnt],G_get_cell_title(name, mapset));
-	     */
-
-	    ret = Rast_read_colors(name, "", &colors);
-	    if (ret < 0)
-		G_fatal_error(_("Unable to read color file"));
-
-	    for (row = 0; row < vrows; row++) {
-		Rast_get_d_row(fd, dcell, (int)(row / vscale));
-
-		rowoff = (vyoff + row) * ncols;
-		Rast_lookup_d_colors(dcell, tr, tg, tb, tset, tsiz, &colors);
-
-		for (col = 0; col < vcols; col++) {
-		    coff = (int)(col / vscale);
-
-		    if (!tset[coff])
-			img.SetRGB(vxoff + col, vyoff + row, 255, 255, 255);
-		    else
-			img.SetRGB(vxoff + col, vyoff + row, tr[coff], tg[coff], tb[coff]);
-		}
-	    }
-
-	    Rast_close(fd);
-	}
-
-	wxBitmap *bmp = new wxBitmap(img);
-	pic_array[cnt] = bmp;
-
-	mainwin->canvas->draw_image(bmp);
-	mainwin->change_label(frame[cnt]);
-    }
-
-    G_free(dcell);
-    G_free(tr);
-    G_free(tg);
-    G_free(tb);
-    G_free(tset);
-
-    return cnt;
-}
-
-
-/* ###################################################### */
-
-void MyApp::do_run(wxIdleEvent &ev)
-{
-    static int first = 1;
-    struct gui_data *cd = &gd;
-    int i, cnt;
-
-    if (first) {
-	first = 0;
-	cnt = load_files();
-	cd->curframe = cd->direction > 0 ? 0 : cnt - 1;
-	cd->prevframe = cd->curframe;
-	cd->step = cd->stop = 0;
-	cd->loop = cd->swing = 0;
-	cd->nframes = cnt;
-
-    }
-
-    if (cd->rewind) {
-	cd->rewind = 0;
-	cd->curframe = 0;
-	cd->direction = 1;
-	cd->step = 1;
-    }
-
-    if (cd->swing) {
-	if (cd->curframe == cd->nframes || cd->curframe < 0) {
-	    cd->direction = -cd->direction;
-	    cd->curframe += cd->direction;
-	}
-    }
-    else if (cd->loop) {
-	if (cd->curframe == cd->nframes)
-	    cd->curframe = 0;
-	else if (cd->curframe < 0)
-	    cd->curframe = cd->nframes - 1;
-    }
-    else if (cd->curframe == cd->nframes || cd->curframe < 0)
-	cd->stop = 1;
-
-    if (cd->stop && !cd->step)
-	return;
-
-    if (cd->curframe < cd->nframes && cd->curframe >= 0) {
-	/* little pause */
-	{
-	    float tf;
-
-	    for (tf = 0.0; tf < cd->speed; tf += .01) ;
-	}
-
-	mainwin->canvas->draw_image(pic_array[cd->curframe]);
-
-	/* draw labels */
-	for (i = 0; i < numviews; i++) {
-	    mainwin->canvas->draw_text(
-		cd->shownames,
-		LabelPos[i][0] + 5, LabelPos[i][1] - 5,
-		vfiles[i][cd->curframe]);
-	}
-
-	mainwin->change_label(frame[cd->curframe]);
-
-	cd->prevframe = cd->curframe;
-    }
-
-    cd->curframe += cd->direction;
-
-    if (cd->step) {
-	cd->step = 0;
-	cd->stop = 1;
-    }
-}
-
-/* ###################################################### */
-
-static void mlist(const char *element, const char *wildarg, const char *outfile)
-{
-    int n;
-    const char *mapset;
-
-    for (n = 0; (mapset = G__mapset_name(n)); n++) {
-	char type_arg[GNAME_MAX];
-	char pattern_arg[GNAME_MAX];
-	char mapset_arg[GMAPSET_MAX];
-
-	if (strcmp(mapset, ".") == 0)
-	    mapset = G_mapset();
-
-	sprintf(type_arg, "type=%s", element);
-	sprintf(pattern_arg, "pattern=%s", wildarg);
-	sprintf(mapset_arg, "mapset=%s", mapset);
-
-	G_spawn_ex("g.mlist", "g.mlist",
-		   type_arg, pattern_arg, mapset_arg,
-		   SF_REDIRECT_FILE, SF_STDOUT, SF_MODE_APPEND, outfile,
-		   NULL);
-    }
-}
-
-static char **parse(const char *filename, int *num)
-{
-    char buf[GNAME_MAX];
-    char **files = NULL;
-    int max_files = 0;
-    int num_files = 0;
-    FILE *fp;
-
-    fp = fopen(filename, "r");
-    if (!fp)
-	G_fatal_error(_("Error reading wildcard"));
-
-    while (fgets(buf, sizeof(buf), fp)) {
-	char *p = strchr(buf, '\n');
-	if (p)
-	    *p = '\0';
-
-	if (!*buf)
-	    continue;
-
-	if (num_files >= max_files) {
-	    max_files += 50;
-	    files = (char **) G_realloc((void *) files,
-					max_files * sizeof(char *));
-	}
-
-	files[num_files++] = G_store(buf);
-    }
-
-    fclose(fp);
-
-    *num = num_files;
-
-    return files;
-}
-
-static char **gee_wildfiles(const char *wildarg, const char *element, int *num)
-{
-    char *tfile;
-    char **files;
-
-    tfile = G_tempfile();
-
-    mlist(element, wildarg, tfile);
-    files = parse(tfile, num);
-
-    remove(tfile);
-    G_free(tfile);
-
-    return files;
-}
-
-static void parse_command(struct Option **viewopts,
-			  char *vfiles[MAXVIEWS][MAXIMAGES],
-			  int *numviews, int *numframes)
-{
-    int i, j, k;
-
-    *numviews = *numframes = 0;
-
-    for (i = 0; i < MAXVIEWS; i++) {
-	if (viewopts[i]->answers) {
-	    int numi, wildnum;
-
-	    (*numviews)++;
-
-	    for (j = 0, numi = 0; viewopts[i]->answers[j]; j++) {
-		if ((NULL != strchr(viewopts[i]->answers[j], '*')) ||
-		    (NULL != strchr(viewopts[i]->answers[j], '?')) ||
-		    (NULL != strchr(viewopts[i]->answers[j], '['))) {
-		    char **wildfiles = gee_wildfiles(viewopts[i]->answers[j],
-						     "rast", &wildnum);
-
-		    for (k = 0; k < wildnum; k++)
-			vfiles[i][numi++] = wildfiles[k];
-		}
-		else
-		    vfiles[i][numi++] = G_store(viewopts[i]->answers[j]);
-	    }
-	    /* keep track of smallest number of frames */
-	    *numframes =
-		*numframes ? *numframes > numi ? numi : *numframes : numi;
-	}
-    }
-}
-
-/********************************************************************/
-
-IMPLEMENT_APP_NO_MAIN(MyApp)
-

+ 0 - 73
visualization/xganim/xganim.html

@@ -1,73 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>xganim</em> is a tool for animating a series of GRASS raster
-files. At startup, a graphics window is opened containing VCR-like
-button controls for: rewind, reverse play, step back, stop, step
-forward, forward play, loop, swing, slower, faster, show filenames,
-current frame number, and Exit. The image is displayed above or to the
-left of the controls. Each raster map is read into memory, then the
-animation is played once beginning to end. The user may then replay
-the series or play continuous animation by using the buttons.
-<p>The user may define up to four "views", or sub-windows, to animate
-simultaneously. e.g., View 1 could be rainfall, View 2 flooded areas,
-View 3 damage to bridges or levees, View 4 other economic damage, all
-animated as a time series. There is an arbitrary limit of 400 files
-per view (400 animation frames), but the practical limit may be less
-depending on the window size and amount of available RAM.
-<p>The environment variable XGANIM_SIZE is checked for a value to use as
-the dimension, in pixels, of the longest dimension of the animation
-window. If XGANIM_SIZE is not set, the animation size defaults to the
-rows &amp; columns in the current GRASS region, scaling if necessary
-to a default minimum size of 600 and maximum of 900. The resolution of
-the current GRASS region is maintained, independent of window size. 
-Resizing the window after the program is running will have no effect
-on the animation size.
-<p>UNIX - style wild cards may be used with the command line version in
-place of a raster map name, but it must be quoted.
-<p>If the number of files differs for each view, the view with the fewest
-files will determine the number of frames in the animation.
-
-<h2>EXAMPLE</h2>
-
-<div class="code"><pre>
-export XGANIM_SIZE=800
-xganim view1="rain[1-9]","rain1[0-2]" view2="temp*"
-</pre></div>
-
-<h2>NOTES</h2>
-
-For wildcard matching, <em>xganim</em> understands whatever the shell 
-understands (as it invokes "ls" via the shell to expand wildcards). 
-E.g., a user can use "rast[0-9][0-9]" to match "rast00" through "rast99" inclusive.
-If the maps if interest have varying numbers of digits, multiple patterns
-can be combined, e.g.:
-
-<div class="code"><pre>
-export XGANIM_SIZE=1000
-xganim view1=rast[0-9],rast[1-9][0-9]
-</pre></div>
-
-to match rast0 through rast99 inclusive.
-
-
-<h2>BUGS</h2>
-On some displays that need to use private colormaps, the interface
-buttons may become difficult to see.
-
-<h2>SEE ALSO</h2>
-
-<em><a href="d.slide.show.html">d.slide.show</a></em>,
-<em><a href="gm_animate.html">gis.m: ANIMATE TOOL</a></em>
-
-<h2>AUTHOR</h2>
-
-Bill Brown, U.S. Army Construction Engineering Research Laboratories
-
-<!-- left in for historical purposes :)
-<h2>NOTICE</h2>
-This program is part of the contrib section of the GRASS distribution. 
-As such, it is externally contributed code that has not been examined
-or tested by the Office of GRASS Integration.
--->
-
-<p><i>Last changed: $Date$</i>