~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to raster3d/r3.showdspf/main_ogl.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 *
17
17
 *****************************************************************************/
18
18
 
19
 
#include <grass/G3d.h>
 
19
#include <stdlib.h>
 
20
#include <grass/raster3d.h>
20
21
#include <grass/config.h>
21
22
 
22
23
#define TOGGLE(x) ((x) = (x) ? 0 : 1)
23
24
 
24
 
#define MAIN
25
25
#include <Xm/Xm.h>
26
26
#include <Xm/Form.h>
27
27
 
54
54
#define WAIT_ANY ((pid_t) -1)
55
55
#endif
56
56
 
 
57
GLuint Material_1_Dlist;
 
58
OGLMotifWindowData MainOGLWindow;
 
59
OGLMotifWindowData ColormapWindow;
 
60
GLuint MainDlist;
 
61
XtAppContext App_context;
 
62
 
 
63
file_info Headfax;      /* contains info about data itself */
 
64
file_info G3header;     /* contains info about data itself */
 
65
int G_sign;
 
66
int X_sign;
 
67
long D_offset;          /*offset to data in grid3 file */
 
68
 
57
69
void set_threshold_button(int i);
58
70
char *check_get_any_dspname();
59
71
void do__bbox(struct dspec *D_spec);
94
106
    XEvent event;
95
107
    int i, fdes[2];
96
108
    void *g3map;
97
 
    G3D_Region g3reg;
 
109
    RASTER3D_Region g3reg;
98
110
    char *p, *mapset;
99
111
    double dmin, dmax;
100
112
    fd_set set;
108
120
    g3->key = "grid3";
109
121
    g3->type = TYPE_STRING;
110
122
    g3->required = YES;
111
 
    g3->gisprompt = "old,grid3,3dcell";
 
123
    g3->gisprompt = "old,grid3,3d-raster";
112
124
    g3->description = "Name of an existing 3D raster map";
113
125
 
114
126
    dspf = G_define_option();
152
164
        /* opens grid3 file to read in original data 
153
165
         */
154
166
 
155
 
        G3d_setErrorFun(G3d_printError);
 
167
        Rast3d_set_error_fun(Rast3d_print_error);
156
168
 
157
169
        /* open g3 file for reading */
158
170
        if (NULL == (mapset = G_find_file2("grid3", g3->answer, ""))) {
160
172
            G_fatal_error(buff);
161
173
        }
162
174
 
163
 
        g3map = G3d_openCellOld(g3->answer, mapset, G3D_DEFAULT_WINDOW,
164
 
                                G3D_TILE_SAME_AS_FILE, G3D_USE_CACHE_DEFAULT);
 
175
        g3map = Rast3d_open_cell_old(g3->answer, mapset, RASTER3D_DEFAULT_WINDOW,
 
176
                                RASTER3D_TILE_SAME_AS_FILE, RASTER3D_USE_CACHE_DEFAULT);
165
177
 
166
178
        if (NULL == g3map) {
167
179
            sprintf(buff, "Unable to open 3D raster map <%s>", g3->answer);
168
180
            G_fatal_error(buff);
169
181
        }
170
182
 
171
 
        if (0 == G3d_range_load(g3map)) {
 
183
        if (0 == Rast3d_range_load(g3map)) {
172
184
            sprintf(buff, "Unable to read range of 3D raster map <%s>", g3->answer);
173
185
            G_fatal_error(buff);
174
186
        }
175
 
        G3d_range_min_max(g3map, &dmin, &dmax);
176
 
        G3d_getRegionStructMap(g3map, &g3reg);
 
187
        Rast3d_range_min_max(g3map, &dmin, &dmax);
 
188
        Rast3d_get_region_struct_map(g3map, &g3reg);
177
189
 
178
190
        viz_make_header(&G3header, dmin, dmax, &g3reg);
179
191
        init_caps(&D_Cap, &g3reg);