Monte Carlo eXtreme (MCX)
mcx_shapes.h
Go to the documentation of this file.
1 /***************************************************************************/
25 /***************************************************************************/
31 #ifndef _MCEXTREME_RASTERIZER_H
32 #define _MCEXTREME_RASTERIZER_H
33 
34 #include <vector_types.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define MAX_SHAPE_ERR 256
41 
47 typedef struct GridSpace {
48  unsigned int** vol;
51  int rowmajor;
52 } Grid3D;
53 
54 int mcx_load_jsonshapes(Grid3D* g, char* fname);
55 int mcx_parse_jsonshapes(cJSON* root, Grid3D* g);
56 int mcx_parse_shapestring(Grid3D* g, char* shapedata);
57 int mcx_raster_origin(cJSON* obj, Grid3D* g);
58 int mcx_raster_sphere(cJSON* obj, Grid3D* g);
59 int mcx_raster_subgrid(cJSON* obj, Grid3D* g);
60 int mcx_raster_box(cJSON* obj, Grid3D* g);
61 int mcx_raster_cylinder(cJSON* obj, Grid3D* g);
62 int mcx_raster_slabs(cJSON* obj, Grid3D* g);
63 int mcx_raster_layers(cJSON* obj, Grid3D* g);
64 int mcx_raster_upperspace(cJSON* obj, Grid3D* g);
65 int mcx_raster_grid(cJSON* obj, Grid3D* g);
66 int mcx_find_shapeid(char* shapename);
67 char* mcx_last_shapeerror();
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif
int mcx_load_jsonshapes(Grid3D *g, char *fname)
Load a JSON-formatted shape file and process.
Definition: mcx_shapes.c:64
int mcx_raster_cylinder(cJSON *obj, Grid3D *g)
Rasterize a finite 3D cylindrical region and add to the volume.
Definition: mcx_shapes.c:432
int mcx_raster_sphere(cJSON *obj, Grid3D *g)
Rasterize a 3D sphere and add to the volume.
Definition: mcx_shapes.c:233
#define float3(a, b, c)
Definition: mcx_core.cu:82
char * mcx_last_shapeerror()
return the last error message encountered in the processing
Definition: mcx_shapes.c:857
int mcx_raster_origin(cJSON *obj, Grid3D *g)
Reset the origin of the domain, default is [0,0,0].
Definition: mcx_shapes.c:212
int mcx_raster_subgrid(cJSON *obj, Grid3D *g)
Rasterize a 3D rectangular region and add to the volume.
Definition: mcx_shapes.c:294
int mcx_parse_shapestring(Grid3D *g, char *shapedata)
Load JSON-formatted shape definitions from a string.
Definition: mcx_shapes.c:113
int mcx_raster_grid(cJSON *obj, Grid3D *g)
Recreate the background grid with a different dimension or medium.
Definition: mcx_shapes.c:788
int mcx_raster_layers(cJSON *obj, Grid3D *g)
Rasterize a 3D layer structure and add to the volume.
Definition: mcx_shapes.c:634
int mcx_find_shapeid(char *shapename)
Look up the JSON object tag and return the index to the processing function.
Definition: mcx_shapes.c:837
int rowmajor
Definition: mcx_shapes.h:51
int mcx_raster_box(cJSON *obj, Grid3D *g)
Rasterize a 3D rectangular region and add to the volume.
Definition: mcx_shapes.c:360
unsigned int ** vol
Definition: mcx_shapes.h:48
int mcx_raster_slabs(cJSON *obj, Grid3D *g)
Rasterize a 3D layered-slab structure and add to the volume.
Definition: mcx_shapes.c:525
float3 orig
Definition: mcx_shapes.h:50
int mcx_parse_jsonshapes(cJSON *root, Grid3D *g)
Parse a JSON-formatted shape file and rasterize the objects to the volume.
Definition: mcx_shapes.c:159
3D voxelated space with which the shape constructs are rasterized
Definition: mcx_shapes.h:47
int mcx_raster_upperspace(cJSON *obj, Grid3D *g)
Rasterize a 3D semi-space region and add to the volume.
Definition: mcx_shapes.c:736
#define uint3(a, b, c)
Definition: mcx_core.cu:78
uint3 * dim
Definition: mcx_shapes.h:49