|
GRASS 8 Programmer's Manual
8.5.0dev(2025)-9d806b45d8
|
OGSF library - dataset loading and management (lower level functions) More...
#include <stdlib.h>#include <string.h>#include <grass/gis.h>#include <grass/glocale.h>#include <grass/ogsf.h>
Go to the source code of this file.
Macros | |
| #define | LUCKY 33 |
| #define | BLOC 20 |
| #define | MAX_DS 100 |
Functions | |
| int | gsds_findh (const char *name, unsigned int *changes, unsigned int *types, int begin) |
| Get handle to gsds. More... | |
| int | gsds_newh (const char *name) |
| Get handle to gsds. More... | |
| typbuff * | gsds_get_typbuff (int id, unsigned int change_flag) |
| Get data buffer. More... | |
| char * | gsds_get_name (int id) |
| Get name. More... | |
| int | gsds_free_datah (int id) |
| Free allocated dataset. More... | |
| int | gsds_free_data_buff (int id, int typ) |
| Free allocated buffer. More... | |
| size_t | free_data_buffs (dataset *ds, int typ) |
| Free data buffer. More... | |
| size_t | gsds_alloc_typbuff (int id, int *dims, int ndims, int type) |
| Allocates correct buffer according to type, keeps track of total mem. More... | |
| int | gsds_get_changed (int id) |
| ADD. More... | |
| int | gsds_set_changed (int id, unsigned int reason) |
| ADD. More... | |
| int | gsds_get_type (int id) |
| ADD. More... | |
OGSF library - dataset loading and management (lower level functions)
GRASS OpenGL gsurf OGSF Library
The idea here is to treat datasets as separate objects, which SHOULD:
These structures are defined in gstypes.h:
typedef struct{ float *fb; int *ib; short *sb; char *cb; struct BM *bm; } typbuff;
How about adding a transform func here, so GET_MAPATT would do an on-the-fly transformation? Or even a transform func LIST!
typedef struct{ int data_id; int dims[MAXDIMS]; int ndims; int numbytes; char unique_name[80]; typbuff databuff; int changed; int need_reload; } dataset;
(C) 1999-2008 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.
Definition in file gsds.c.
| size_t free_data_buffs | ( | dataset * | ds, |
| int | typ | ||
| ) |
| size_t gsds_alloc_typbuff | ( | int | id, |
| int * | dims, | ||
| int | ndims, | ||
| int | type | ||
| ) |
| int gsds_findh | ( | const char * | name, |
| unsigned int * | changes, | ||
| unsigned int * | types, | ||
| int | begin | ||
| ) |
Get handle to gsds.
Successive calls will continue search until "begin" is set (problem here is, unique_name no longer uniquely identifies dataset, since changes may be made; but unique_name should still be useful for reloading dataset) changes & types are set to actual for dataset if found.
| name | |
| changes,types | acceptable changes & types, flags may be or'd not changed is assumed to always be acceptable |
| begin | flag to indicate search from beginning |
| int gsds_free_data_buff | ( | int | id, |
| int | typ | ||
| ) |
| int gsds_free_datah | ( | int | id | ) |
| int gsds_get_changed | ( | int | id | ) |
ADD.
| id |
Definition at line 613 of file gsds.c.
Referenced by Gs_update_attrange().
| char* gsds_get_name | ( | int | id | ) |
Get name.
| id |
Definition at line 303 of file gsds.c.
References GPATH_MAX.
Referenced by GS_get_cat_at_xy().
| typbuff* gsds_get_typbuff | ( | int | id, |
| unsigned int | change_flag | ||
| ) |
| int gsds_newh | ( | const char * | name | ) |