/*
 * Ancestor for all geomobjects used while applying initial conditions
 */
typedef struct csg_geomobject_s
{
	/*
	 * check() returns 'true' if 'pos' is deeper than
	 * 'radius' in given half-space
	 */
	vboolean (*check)(void_p self,vec3_t pos,vec_t radius,vboolean inside);
	/* writes descrition of objects' geometry */
	void (*dump)(void_p self,vhandle_t out,vboolean dsmax_format);
	/* frees geomobject */
	void (*destroy)(void_p self);
}	csg_geomobject_t, *csg_geomobject_p;

/*
 * Nodal operations
 */
typedef enum
{
	csg_union,			/* CSG boolean */
	csg_intersection,	/* CSG boolean */
	csg_subtraction,	/* CSG boolean */
	
	csg_geomobject,		/* Geomobject: single constrain */
	csg_max_operation
}	csg_operation_t;

/*
 * Following structure incapsulates name, description and
 * constructor for CSG operation.
 */
typedef struct csg_operation_parse_entry_s
{
	csg_operation_t operation;
	char *name;
	char *description;
}	csg_operation_parse_entry_t, *csg_operation_parse_entry_p;

/*
 * Spatial constrain node
 */
typedef struct csg_node_info_s
{
	csg_operation_t op;
	csg_geomobject_p geomobject;
}	csg_node_info_t, *csg_node_info_p;

/*
 * Following structure incapsulates name, description and
 * constructor for geomobject.
 */
typedef struct geomobject_parse_entry_s
{
	char *name;
	csg_geomobject_p (*parse)(vhandle_t script);
	char *description;
}	geomobject_parse_entry_t, *geomobject_parse_entry_p;
