MCX shape JSON parser header.
More...
#include <vector_types.h>
Go to the source code of this file.
|
struct | GridSpace |
| 3D voxelated space with which the shape constructs are rasterized More...
|
|
|
#define | MAX_SHAPE_ERR 256 |
|
|
int | mcx_load_jsonshapes (Grid3D *g, char *fname) |
| Load a JSON-formatted shape file and process. More...
|
|
int | mcx_parse_jsonshapes (cJSON *root, Grid3D *g) |
| Parse a JSON-formatted shape file and rasterize the objects to the volume. More...
|
|
int | mcx_parse_shapestring (Grid3D *g, char *shapedata) |
| Load JSON-formatted shape definitions from a string. More...
|
|
int | mcx_raster_origin (cJSON *obj, Grid3D *g) |
| Reset the origin of the domain, default is [0,0,0]. More...
|
|
int | mcx_raster_sphere (cJSON *obj, Grid3D *g) |
| Rasterize a 3D sphere and add to the volume. More...
|
|
int | mcx_raster_subgrid (cJSON *obj, Grid3D *g) |
| Rasterize a 3D rectangular region and add to the volume. More...
|
|
int | mcx_raster_box (cJSON *obj, Grid3D *g) |
| Rasterize a 3D rectangular region and add to the volume. More...
|
|
int | mcx_raster_cylinder (cJSON *obj, Grid3D *g) |
| Rasterize a finite 3D cylindrical region and add to the volume. More...
|
|
int | mcx_raster_slabs (cJSON *obj, Grid3D *g) |
| Rasterize a 3D layered-slab structure and add to the volume. More...
|
|
int | mcx_raster_layers (cJSON *obj, Grid3D *g) |
| Rasterize a 3D layer structure and add to the volume. More...
|
|
int | mcx_raster_upperspace (cJSON *obj, Grid3D *g) |
| Rasterize a 3D semi-space region and add to the volume. More...
|
|
int | mcx_raster_grid (cJSON *obj, Grid3D *g) |
| Recreate the background grid with a different dimension or medium. More...
|
|
int | mcx_find_shapeid (char *shapename) |
| Look up the JSON object tag and return the index to the processing function. More...
|
|
char * | mcx_last_shapeerror () |
| return the last error message encountered in the processing
|
|
MCX shape JSON parser header.
◆ mcx_find_shapeid()
int mcx_find_shapeid |
( |
char * |
shapename | ) |
|
Look up the JSON object tag and return the index to the processing function.
- Parameters
-
shapename | The string of the JSON shape object |
◆ mcx_load_jsonshapes()
int mcx_load_jsonshapes |
( |
Grid3D * |
g, |
|
|
char * |
fname |
|
) |
| |
Load a JSON-formatted shape file and process.
- Parameters
-
g | A structure pointing to the volume and dimension data |
fname | The file name string to the JSON shape file |
◆ mcx_parse_jsonshapes()
int mcx_parse_jsonshapes |
( |
cJSON * |
root, |
|
|
Grid3D * |
g |
|
) |
| |
Parse a JSON-formatted shape file and rasterize the objects to the volume.
- Parameters
-
root | A cJSON pointer points to the root obj of the shape block |
g | A structure pointing to the volume and dimension data |
◆ mcx_parse_shapestring()
int mcx_parse_shapestring |
( |
Grid3D * |
g, |
|
|
char * |
shapedata |
|
) |
| |
Load JSON-formatted shape definitions from a string.
- Parameters
-
g | A structure pointing to the volume and dimension data |
shapedata | A string containg the JSON shape data |
◆ mcx_raster_box()
int mcx_raster_box |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D rectangular region and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the rectangular obj block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_cylinder()
int mcx_raster_cylinder |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a finite 3D cylindrical region and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the cylindrical obj block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_grid()
int mcx_raster_grid |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Recreate the background grid with a different dimension or medium.
- Parameters
-
obj | A cJSON pointer points to the background grid block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_layers()
int mcx_raster_layers |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D layer structure and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the layer structure block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_origin()
int mcx_raster_origin |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Reset the origin of the domain, default is [0,0,0].
- Parameters
-
obj | A cJSON pointer points to the Origin obj block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_slabs()
int mcx_raster_slabs |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D layered-slab structure and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the layered-slab structure block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_sphere()
int mcx_raster_sphere |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D sphere and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the sphere obj block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_subgrid()
int mcx_raster_subgrid |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D rectangular region and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the rectangular obj block |
g | A structure pointing to the volume and dimension data |
◆ mcx_raster_upperspace()
int mcx_raster_upperspace |
( |
cJSON * |
obj, |
|
|
Grid3D * |
g |
|
) |
| |
Rasterize a 3D semi-space region and add to the volume.
- Parameters
-
obj | A cJSON pointer points to the semi-space object block |
g | A structure pointing to the volume and dimension data |