SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SceneryGlue.h
1#ifndef SMALLCHANGE_SCENERYGLUE_H
2#define SMALLCHANGE_SCENERYGLUE_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) 1998-2003 by Systems in Motion. All rights reserved.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Systems in Motion about acquiring
18 * a Coin Professional Edition License.
19 *
20 * See <URL:http://www.coin3d.org> for more information.
21 *
22 * Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY.
23 * <URL:http://www.sim.no>.
24 *
25\**************************************************************************/
26
27#ifndef SMALLCHANGE_INTERNAL
28#error this is a private header file
29#endif /* SMALLCHANGE_INTERNAL */
30
31#include <Inventor/SbBasic.h> /* uint32_t */
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*************************************************************************/
38
39#define SS_RENDER_BIT_WEST (0x0010)
40#define SS_RENDER_BIT_SOUTH (0x0020)
41#define SS_RENDER_BIT_EAST (0x0040)
42#define SS_RENDER_BIT_NORTH (0x0080)
43
44#define SS_ELEVATION_TYPE (1)
45#define SS_TEXTURE_TYPE (2)
46
47#define SS_USE_RESIDENT_ONLY (0x0001)
48
49/*************************************************************************/
50
51typedef struct ss_system ss_system;
52typedef struct ss_render_block_cb_info ss_render_block_cb_info;
53
54typedef int ss_cull_pre_cb(void * closure,
55 const double * bbmin, const double * bbmax);
56typedef void ss_cull_post_cb(void * closure);
57typedef void ss_render_block_cb(void * closure, ss_render_block_cb_info * info);
58typedef void ss_render_cb(void * closure, const int x, const int y,
59 const int len, const unsigned int omitmask);
60typedef uint32_t ss_rttexture2d_cb(void * closure, double * pos, float elevation, double * spacing);
61
62/*************************************************************************/
63
64int sc_scenery_available(void);
65
66int sc_ssglue_initialize(void);
67ss_system * sc_ssglue_system_create_for_cross_and_line(int maxviews, double * minpos, double * spacing, int * minelements);
68ss_system * sc_ssglue_system_open(const char * filename, int maxviews);
69void sc_ssglue_system_close(ss_system * system);
70
71ss_system * sc_ssglue_system_construct(int maxviews, double * origo,
72 double * spacing, int * elements,
73 float * values, float undef);
74ss_system * sc_ssglue_system_construct_rotated(int maxviews, int rows, int cols,
75 double * xyzgrid, double undef);
76ss_system * sc_ssglue_system_construct_randomized(int maxviews, int points,
77 double * xyzvals, float reach);
78
79void sc_ssglue_render_get_elevation_measures(ss_render_block_cb_info * info,
80 double * offset,
81 double * vertex_spacing,
82 int * dimensions,
83 float ** elevation_array,
84 signed char ** normal_array,
85 int ** dataset_array);
86
87void sc_ssglue_render_get_texture_image(ss_render_block_cb_info * info,
88 unsigned int texture_id,
89 unsigned char ** bytes,
90 int * width, int * height,
91 int * components);
92
93void sc_ssglue_render_get_texture_measures(ss_render_block_cb_info * info,
94 unsigned int * texture_id,
95 float * offset,
96 float * scaling);
97const signed char * sc_ssglue_render_get_undef_array(unsigned int bitmask);
98
99int sc_ssglue_system_add_runtime_texture2d(ss_system * system,
100 int dataset,
101 ss_rttexture2d_cb * callback,
102 void * closure);
103int sc_ssglue_system_add_runtime_texture0d(ss_system * system, uint32_t abgr);
104
105int sc_ssglue_system_get_blocksize(ss_system * system);
106
107void sc_ssglue_system_get_origo_world_position(ss_system * system, double * coordinates);
108void sc_ssglue_system_get_object_box(ss_system * system, double * bbmin, double * bbmax);
109void sc_ssglue_system_get_elevation_data_box(ss_system * system, int id, double * bbmin, double * bbmax);
110void sc_ssglue_system_get_elevation_range(ss_system * system, int num, int * datasets, float * minval, float * maxval);
111void sc_ssglue_system_refresh_runtime_texture2d(ss_system * system, int id);
112
113int sc_ssglue_view_allocate(ss_system * system);
114void sc_ssglue_view_deallocate(ss_system * system, int viewid);
115void sc_ssglue_view_enable(ss_system * system, int viewid);
116void sc_ssglue_view_evaluate(ss_system * system, int viewid);
117
118void sc_ssglue_view_pre_frame(ss_system * system, int viewid);
119int sc_ssglue_view_post_frame(ss_system * system, int viewid);
120
121int sc_ssglue_view_render(ss_system * system, int viewid);
122void sc_ssglue_view_set_culling_post_callback(ss_system * system, int viewid,
123 ss_cull_post_cb * postcb,
124 void * postclosure);
125
126void sc_ssglue_view_set_culling_pre_callback(ss_system * system, int viewid,
127 ss_cull_pre_cb * precb,
128 void * preclosure);
129
130void sc_ssglue_view_set_evaluate_rottger_parameters(ss_system * system,
131 int viewid,
132 float C, float c);
133void sc_ssglue_view_get_evaluate_rottger_parameters(ss_system * system,
134 int viewid,
135 float * C, float * c);
136void sc_ssglue_view_set_hotspots(ss_system * system, int viewid,
137 int numhotspots, double * hotspots);
138void sc_ssglue_view_set_load_rottger_parameters(ss_system * system, int viewid,
139 float C, float c);
140void sc_ssglue_view_get_load_rottger_parameters(ss_system * system, int viewid,
141 float * C, float * c);
142void sc_ssglue_view_set_render_callback(ss_system * system, int viewid,
143 ss_render_cb * cb, void * closure);
144
145void sc_ssglue_view_set_render_pre_callback(ss_system * system, int viewid,
146 ss_render_block_cb * precb,
147 void * closure);
148
149void sc_ssglue_view_set_render_post_callback(ss_system * system, int viewid,
150 ss_render_block_cb * postcb,
151 void * closure);
152
153void sc_ssglue_view_set_undef_render_callback(ss_system * system, int viewid,
154 ss_render_cb * cb,
155 void * closure);
156void sc_ssglue_view_set_render_sequence_a(ss_system * system, int viewid,
157 int num, int * sequence);
158
159int sc_ssglue_system_get_num_datasets(ss_system * system);
160int sc_ssglue_system_get_datasetid(ss_system * system, int datasetindex);
161int sc_ssglue_system_has_dataset(ss_system * system, int datasetid);
162int sc_ssglue_system_get_dataset_type(ss_system * system, int datasetid);
163void sc_ssglue_system_set_dataset_name(ss_system * system, int datasetid, const char * name);
164int sc_ssglue_system_get_dataset_name(ss_system * system, int datasetid, int maxchars, char * name);
165int sc_ssglue_system_add_dataset(ss_system * system, int type, const char * name, int flags);
166int sc_ssglue_system_delete_dataset(ss_system * system, int datasetid);
167
168void sc_ssglue_system_set_dataset_cross_and_line_data(ss_system * handle, int dataset,
169 int lodlevel, int flags,
170 int startcross, int startline,
171 int numcross, int numline,
172 float * crosslineelevation);
173float sc_ssglue_system_get_undef_elevation(ss_system * system);
174void sc_ssglue_system_get_spacing_for_lodlevel(ss_system * system, int lodlevel, double * spacing);
175
176void sc_ssglue_system_change_dataset_proximity(ss_system * handle, int datasetid, int numdatasets, int * datasets, float epsilon, float newval);
177
178void sc_ssglue_system_cull_dataset_above(ss_system * handle, int datasetid, int numdatasets, int * datasets, float distance);
179void sc_ssglue_system_cull_dataset_below(ss_system * handle, int datasetid, int numdatasets, int * datasets, float distance);
180
181void sc_ssglue_system_oversample_dataset(ss_system * handle, int datasetid);
182void sc_ssglue_system_smooth_dataset(ss_system * handle, int datasetid);
183void sc_ssglue_system_strip_verticals(ss_system * handle, int datasetid, float dropsize);
184void sc_ssglue_system_strip_horizontals(ss_system * handle, int datasetid, float maxskew);
185
186int sc_ssglue_system_get_elevation(ss_system * system,
187 int numdatasets, int * datasets,
188 int numpoints, double * points,
189 float * normals, uint32_t * rgba,
190 int * datasetids,
191 unsigned int flags);
192
193/*************************************************************************/
194
195#ifdef __cplusplus
196}
197#endif
198
199#endif /* !SMALLCHANGE_SCENERYGLUE_H */