#ifndef _FORMZ_MODEL_GEND_API_H
#define _FORMZ_MODEL_GEND_API_H

#include "fz_model_core_api.h"

#ifdef __cplusplus
extern "C" {
#endif


/* @doc EXTERNAL MODEL */
/********************************************************************************************************

	@module Generative Objects

	@desc	This module contains functions for different ways to generate objects in formZ.

	@toc	modl_gend

*********************************************************************************************************/

/********************************************************************************************************

	@type	Surface scatter options

	@desc	Data structure to hold options for the surface scatter.
			This type is used to pass additional options to the
			function fz_surface_scatter. The individual 
			fields of this type can be accessed and set via fz_surf_scatter_opts_get 
			and fz_surf_scatter_opts_set.
			
	@avail	8.5.0.1
	
	@toc	modl_gend

*********************************************************************************************************/
typedef struct	surf_scatter_opts_td	*fz_surf_scatter_opts_ptr;

/********************************************************************************************************

	@enum	Surface scatter direction identifiers.

	@desc	Surface scatter direction identifiers. They identify whether objects are scattered in the
			outward (postive with respect to surface normals) direction or inward (negative with respect to 
			surface normals) direction,
			
	@avail	8.5.0.1

	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_surf_scatter_direction_enum
{	
	FZ_SURF_SCATTER_DIR_OUT = 0,		/*  @emem	Direction is outward (postive with respect to surface normals) */
	FZ_SURF_SCATTER_DIR_IN				/*  @emem	Direction is inward (negative with respect to surface normals) */
	
} fz_surf_scatter_direction_enum;

/********************************************************************************************************

	@enum	Surface scatter justification identifiers.

	@desc	Surface scatter justification identifiers. They determine how the scattered objects are placed 
			relative to the surface. With FZ_SURF_SCATTER_JUSTIFY_ORIGIN, the object’s origin is positioned on the 
			surface, before offset. With FZ_SURF_SCATTER_JUSTIFY_ABOVE, FZ_SURF_SCATTER_JUSTIFY_CENTER, 
			FZ_SURF_SCATTER_JUSTIFY_BELOW, the extents of the object are used to position the copies at the 
			specified position relative to the surface, before offset
			
	@avail	8.5.0.1

	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_surf_scatter_justify_enum
{	
	FZ_SURF_SCATTER_JUSTIFY_ABOVE = 0,		/*  @emem	Before offset, object is positioned above a plane defined by a surface point and the surface normal at that point */
	FZ_SURF_SCATTER_JUSTIFY_CENTER,			/*  @emem	Before offset, object is centered on a plane defined by a surface point and the surface normal at that point */
	FZ_SURF_SCATTER_JUSTIFY_BELOW,			/*  @emem	Before offset, object is positioned below a plane defined by a surface point and the surface normal at that point*/
	FZ_SURF_SCATTER_JUSTIFY_ORIGIN			/*  @emem	Before offset, object’s origin is positioned on a surface point */
	
} fz_surf_scatter_justify_enum;

/********************************************************************************************************

	@enum	Surface scatter parameter ids.

	@desc	Parameter identifiers for a surface scatter operation.
			
	@avail	8.5.0.1
	
	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_surf_scatter_parm_enum
{
	FZ_SURF_SCATTER_PARM_KEEP_COPIES = 0,			/*  @emem 		Number of scattered list entities to keep.
														@ptype		fzrt_int
														@default	0	*/
	
	FZ_SURF_SCATTER_PARM_SCATTER_INDIVIDUALLY,		/*  @emem		TRUE indicates that individual objects and groups should be selected from the <nl> 
																	source arrays, FALSE indicates that all sources should be scattered as a set
														@ptype		fzrt_boolean
														@default	TRUE	*/
											  		
	FZ_SURF_SCATTER_PARM_DIRECTION,					/*  @emem		Specifies direction in or out with respect to surface normals.
														@ptype		fz_surf_scatter_direction_enum
														@default	FZ_SURF_SCATTER_DIR_OUT	*/
											  		
	FZ_SURF_SCATTER_PARM_JUSTIFICATION,				/*  @emem		Specifies object position, before offset, relative to surface.
														@ptype		fz_surf_scatter_justify_enum 
														@default	FZ_SURF_SCATTER_JUSTIFY_ABOVE	*/
											  		
	FZ_SURF_SCATTER_PARM_SEPARATE,					/*  @emem		TRUE indicates that copies should not be allowed to overlap
														@ptype		fzrt_boolean 
														@default	TRUE	*/
											  		
	FZ_SURF_SCATTER_PARM_SEPARATION,				/*  @emem		Minimum distance allowed between object copies	
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SETBACK,					/*  @emem		Limits the scatter so that objects will be be placed no closer to a boundary or face <nl>
																	edge than the specified distance.	
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_USE_SOURCE_AXIS,			/*  @emem		TRUE indicates the Z-axis of each of the scattered objects is aligned before rotation of <nl>
																	object, FALSE indicates that source orientation is used.
														@ptype		fzrt_boolean 
														@default	TRUE	*/

	FZ_SURF_SCATTER_PARM_USE_SURFACE_NORMAL,		/*  @emem		TTRUE indicates that scattered objects are initially aligned to the normal of the surface, <nl>
																	FALSE indicates that the Cartesian Z-axis is used.
														@ptype		fzrt_boolean 
														@default	TRUE	*/

	FZ_SURF_SCATTER_PARM_ROTATE_X_RANGE_MIN,		/*  @emem		Allow random rotation around X axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_ROTATE_X_RANGE_MAX,		/*  @emem		Allow random rotation around X axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_ROTATE_Y_RANGE_MIN,		/*  @emem		Allow random rotation around Y axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_ROTATE_Y_RANGE_MAX,		/*  @emem		Allow random rotation around Y axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_ROTATE_Z_RANGE_MIN,		/*  @emem		Allow random rotation around Z axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_ROTATE_Z_RANGE_MAX,		/*  @emem		Allow random rotation around Z axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_UNIFORM_SCALE,				/*  @emem		TRUE indicates that relative dimensions of the scattered objects should be maintained.
														@ptype		fzrt_boolean 
														@default	FALSE	*/

	FZ_SURF_SCATTER_PARM_SCALE_X_RANGE_MIN,			/*  @emem		Allow random scale in X direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SCALE_X_RANGE_MAX,			/*  @emem		Allow random scale in X direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SCALE_Y_RANGE_MIN,			/*  @emem		Allow random scale in Y direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SCALE_Y_RANGE_MAX,			/*  @emem		Allow random scale in Y direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SCALE_Z_RANGE_MIN,			/*  @emem		Allow random scale in Z direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_SCALE_Z_RANGE_MAX,			/*  @emem		Allow random scale in Z direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_OFFSET_MIN,				/*  @emem		Minimum random translation along the placement axis..
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_OFFSET_MAX,				/*  @emem		Maximum random translation along the placement axis..
														@ptype		double
														@default	0.0	*/

	FZ_SURF_SCATTER_PARM_RANDOM_SEED1,				/*  @emem 		Number used to initialize random number generation. <nl>
														A different seed produces different scattering results.
														@ptype		fzrt_int	*/

	FZ_SURF_SCATTER_PARM_RANDOM_SEED2,				/*  @emem 		Number used to initialize random number generation. <nl>
														A different seed produces different scattering results.
														@ptype		fzrt_int	*/
											  		
	FZ_SURF_SCATTER_PARM_MAX
	
} fz_surf_scatter_parm_enum;

/************************************************************************

	@fsfunc_t
	
	@desc		Creates randomized copies of source objects and groups, and places 
				them at random positions on faces of boundary objects

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_surface_scatter_func)(					
	fzrt_int 					windex,					/* @parm <in> |	Project window index */
	fz_objt_ptr					*source_obj_list,		/* @parm <in> |	Array of objects from which copies will be scattered */ 
	fzrt_int 					num_source_objs,		/* @parm <in> |	Number of source objects */ 
	fzrt_int					*source_group_list,		/* @parm <in> |	Array of groups from which copies will be scattered */ 
	fzrt_int 					num_source_groups,		/* @parm <in> |	Number of source groups */ 
	fz_objt_ptr					*surface_obj_list,		/* @parm <in> | Array of objects to be used as surfaces upon which to scatter objects */
	fzrt_int					*surface_findx_list,	/* @parm <in> | Array of indices of faces of objects upon which to scatter objects */
	fzrt_int					num_surface_objs,		/* @parm <in> | Number of surface objects */
	fzrt_int					max_copies,				/* @parm <in> | Maximum number of copies of source objects or groups to scatter */
	fz_surf_scatter_opts_ptr	surf_scatter_opts,		/* @parm <in_opt> | surface scatter options. For defaults see fz_surf_scatter_parm_enum */
	fz_enty_list_ptr			scattered_list			/* @parm <out> | Entity list of scattered objects and groups */
	);

/************************************************************************

	@fsfunc_t	Allocate surface scatter options and fill with defaults
	
	@desc		Allocate surface scatter options and fill with defaults
	
	@return		Error codes
		
	@avail		8.5.0.1

	@see		fz_surf_scatter_opts_finit,fz_surf_scatter_opts_get,fz_surf_scatter_opts_set
												
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_surf_scatter_opts_init_func) (	
	fzrt_int					windex,	/* @parm <in> | project window index */
	fz_surf_scatter_opts_ptr	*opts   /* @parm <out> | surface scatter options	*/
	);

/************************************************************************
	
	@fsfunc_t	Get the value of a surface scatter option
	
	@desc		Get the value of a surface scatter option.
	
	@return		Error codes
			
	@avail		8.5.0.1

	@see		fz_surf_scatter_opts_init,fz_surf_scatter_opts_finit,fz_surf_scatter_opts_set
												
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_surf_scatter_opts_get_func) (
	fzrt_int					windex,		/* @parm <in> | project window index */
	fz_surf_scatter_opts_ptr	opts,		/* @parm <in> | surface scatter options	*/
	fz_surf_scatter_parm_enum	which,		/* @parm <in> | parameter id			*/
	fz_type_td					*data		/* @parm <out> | parameter data			*/
	);

/************************************************************************
	
	@fsfunc_t	Set the value of a surface scatter option
	
	@desc		Set the value of a surface scatter option.
	
	@return		Error codes

	@avail		8.5.0.1

	@see		fz_surf_scatter_opts_init,fz_surf_scatter_opts_finit,fz_surf_scatter_opts_get
																				
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_surf_scatter_opts_set_func) (
	fzrt_int					windex,		/* @parm <in> | project window index */
	fz_surf_scatter_opts_ptr	opts,		/* @parm <in> | surface scatter options	*/
	fz_surf_scatter_parm_enum	which,		/* @parm <in> | parameter id			*/
	fz_type_td					*data		/* @parm <in> | parameter data			*/
	);

/************************************************************************

	@fsfunc_t	Free surface scatter options
	
	@desc		Frees surface scatter options. The opts pointer
				is deallocated and returned back as NULL.
					
	@return		Error codes
		
	@avail		8.5.0.1

	@see		fz_surf_scatter_opts_init,fz_surf_scatter_opts_get,fz_surf_scatter_opts_set
	
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_surf_scatter_opts_finit_func) (
	fzrt_int					windex,	/* @parm <in> | project window index */
	fz_surf_scatter_opts_ptr	*opts   /* @parm <in_out> | options (will become NULL)	*/
	);

/********************************************************************************************************

	@type	Volume scatter options

	@desc	Data structure to hold options for the volume scatter.
			This type is used to pass additional options to the
			function fz_volume_scatter. The individual 
			fields of this type can be accessed and set via fz_volm_scatter_opts_get 
			and fz_volm_scatter_opts_set.
			
	@avail	8.5.0.1
	
	@toc	modl_gend

*********************************************************************************************************/
typedef struct	volm_scatter_opts_td	*fz_volm_scatter_opts_ptr;

/********************************************************************************************************

	@enum	Volume scatter parameter ids.

	@desc	Parameter identifiers for a volume scatter operation.
			
	@avail	8.5.0.1
	
	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_volm_scatter_parm_enum
{
	FZ_VOLM_SCATTER_PARM_KEEP_COPIES = 0,			/*  @emem 		Number of scattered list entities to keep.
														@ptype		fzrt_int
														@default	0	*/
	
	FZ_VOLM_SCATTER_PARM_SCATTER_INDIVIDUALLY,		/*  @emem		TRUE indicates that individual objects and groups should be selected from the <nl> 
																	source arrays, FALSE indicates that all sources should be scattered as a set
														@ptype		fzrt_boolean
														@default	TRUE	*/
											  													  		
	FZ_VOLM_SCATTER_PARM_SEPARATE,					/*  @emem		TRUE indicates that copies should not be allowed to overlap
														@ptype		fzrt_boolean 
														@default	TRUE	*/
											  		
	FZ_VOLM_SCATTER_PARM_SEPARATION,				/*  @emem		Minimum distance allowed between object copies	
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_X_RANGE_MIN,		/*  @emem		Allow random rotation around X axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_X_RANGE_MAX,		/*  @emem		Allow random rotation around X axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_Y_RANGE_MIN,		/*  @emem		Allow random rotation around Y axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_Y_RANGE_MAX,		/*  @emem		Allow random rotation around Y axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_Z_RANGE_MIN,		/*  @emem		Allow random rotation around Z axis, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_ROTATE_Z_RANGE_MAX,		/*  @emem		Allow random rotation around Z axis, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_UNIFORM_SCALE,				/*  @emem		TRUE indicates that relative dimensions of the scattered objects should be maintained.
														@ptype		fzrt_boolean 
														@default	FALSE	*/

	FZ_VOLM_SCATTER_PARM_SCALE_X_RANGE_MIN,			/*  @emem		Allow random scale in X direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_SCALE_X_RANGE_MAX,			/*  @emem		Allow random scale in X direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_SCALE_Y_RANGE_MIN,			/*  @emem		Allow random scale in Y direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_SCALE_Y_RANGE_MAX,			/*  @emem		Allow random scale in Y direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_SCALE_Z_RANGE_MIN,			/*  @emem		Allow random scale in Z direction, min value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_SCALE_Z_RANGE_MAX,			/*  @emem		Allow random scale in Z direction, max value.
														@ptype		double
														@default	0.0	*/

	FZ_VOLM_SCATTER_PARM_RANDOM_SEED1,				/*  @emem 		Number used to initialize random number generation. <nl>
														A different seed produces different scattering results.
														@ptype		fzrt_int	*/

	FZ_VOLM_SCATTER_PARM_RANDOM_SEED2,				/*  @emem 		Number used to initialize random number generation. <nl>
														A different seed produces different scattering results.
														@ptype		fzrt_int	*/
											  		
	FZ_VOLM_SCATTER_PARM_MAX
	
} fz_volm_scatter_parm_enum;

/************************************************************************

	@fsfunc_t
	
	@desc		Creates randomized copies of source objects and groups, and places 
				them at random positions within the volumes of boundary objects

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_volume_scatter_func)(					
	fzrt_int					windex,					/* @parm <in> |	Project window index */
	fz_objt_ptr					*source_obj_list,		/* @parm <in> |	Array of objects from which copies will be scattered */ 
	fzrt_int 					num_source_objs,		/* @parm <in> |	Number of source objects */ 
	fzrt_int					*source_group_list,		/* @parm <in> |	Array of groups from which copies will be scattered */ 
	fzrt_int 					num_source_groups,		/* @parm <in> |	Number of source groups */ 
	fz_objt_ptr					*boundary_obj_list,		/* @parm <in> | Array of objects to be used as volumes in which to scatter objects */
	fzrt_int					num_boundary_objs,		/* @parm <in> | Number of boundary objects */
	fzrt_int					max_copies,				/* @parm <in> | Maximum number of copies of source objects or groups to scatter */
	fz_volm_scatter_opts_ptr	volm_scatter_opts,		/* @parm <in_opt> | Volume scatter options. For defaults see fz_volm_scatter_parm_enum */
	fz_enty_list_ptr			scattered_list			/* @parm <out> | Entity list of scattered objects and groups */
	);

/************************************************************************

	@fsfunc_t	Allocate volume scatter options and fill with defaults
	
	@desc		Allocate volume scatter options and fill with defaults
	
	@return		Error codes
		
	@avail		8.5.0.1

	@see		fz_volm_scatter_opts_finit,fz_volm_scatter_opts_get,fz_volm_scatter_opts_set
												
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_volm_scatter_opts_init_func) (	
	fzrt_int					windex,	/* @parm <in> | project window index */
	fz_volm_scatter_opts_ptr	*opts   /* @parm <out> | volume scatter options	*/
	);

/************************************************************************
	
	@fsfunc_t	Get the value of a volume scatter option
	
	@desc		Get the value of a volume scatter option.
	
	@return		Error codes
			
	@avail		8.5.0.1

	@see		fz_volm_scatter_opts_init,fz_volm_scatter_opts_finit,fz_volm_scatter_opts_set
												
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_volm_scatter_opts_get_func) (
	fzrt_int					windex,		/* @parm <in> | project window index */
	fz_volm_scatter_opts_ptr	opts,		/* @parm <in> | volume scatter options	*/
	fz_volm_scatter_parm_enum	which,		/* @parm <in> | parameter id			*/
	fz_type_td					*data		/* @parm <out> | parameter data			*/
	);

/************************************************************************
	
	@fsfunc_t	Set the value of a volume scatter option
	
	@desc		Set the value of a volume scatter option.
	
	@return		Error codes

	@avail		8.5.0.1

	@see		fz_volm_scatter_opts_init,fz_volm_scatter_opts_finit,fz_volm_scatter_opts_get
																				
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_volm_scatter_opts_set_func) (
	fzrt_int					windex,		/* @parm <in> | project window index */
	fz_volm_scatter_opts_ptr	opts,		/* @parm <in> | volume scatter options	*/
	fz_volm_scatter_parm_enum	which,		/* @parm <in> | parameter id			*/
	fz_type_td					*data		/* @parm <in> | parameter data			*/
	);

/************************************************************************

	@fsfunc_t	Free volume scatter options
	
	@desc		Frees volume scatter options. The opts pointer
				is deallocated and returned back as NULL.
					
	@return		Error codes
		
	@avail		8.5.0.1

	@see		fz_volm_scatter_opts_init,fz_volm_scatter_opts_get,fz_volm_scatter_opts_set
	
*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_volm_scatter_opts_finit_func) (
	fzrt_int					windex,	/* @parm <in> | project window index */
	fz_volm_scatter_opts_ptr	*opts   /* @parm <in_out> | options (will become NULL)	*/
	);

/********************************************************************************************************

	@enum	Voronoi diagram output type identifiers.

	@desc	Output type identifiers for Voronoi diagrams
			
	@avail	8.5.0.1

	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_voronoi_output_type_enum
{	
	FZ_VORONOI_MAKE_SEGMENTS = 0,		/*  @emem	Output Voronoi diagram as individual segments */
	FZ_VORONOI_MAKE_SURFACE,			/*  @emem	Output Voronoi diagram as a surface */
	FZ_VORONOI_MAKE_LATTICE				/*  @emem	Output Voronoi diagram as a lattice of cylinders */
	
} fz_voronoi_output_type_enum;



/************************************************************************

	@fsfunc_t
	
	@desc		Creates Voronoi diagram from set of source points.

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_voronoi_diagram_func)(					
	fzrt_int 			windex,					/* @parm <in> |	Project window index */
	fz_xyz_td			*source_points,			/* @parm <in> | Array of source points */
	fzrt_int 			num_source_points,		/* @parm <in> |	Number of source points */ 
	char				make_surface,			/* @parm <in> | Selects output type */
	fz_objt_ptr			boundary_object,		/* @parm <in> | Object to be used to define surface and boundary */
	fzrt_int			boundary_findx,			/* @parm <in> | Index of object face to be used to define surface and boundary */
	double				hull_margin,			/* @parm <in> | Distance to extend convex hull when no boundary specified */
	double				hull_miter_angle,		/* @parm <in> | Corners of default boundary with less than specified angle will be mitered when margin allows */
	double				hull_min_angle,			/* @parm <in> | Angle used to identify and remove nearly collinear segments in default boundary */
	double				lattice_radius,			/* @parm <in> | Radius of lattice pipes */
	fzrt_boolean		imprint,				/* @parm <in> | TRUE indicates Voronoi diagram should be imprinted on boundary surface or face */
	fzrt_boolean		project,				/* @parm <in> | Not yet implemented */
	fz_objt_ptr			**voronoi_obj_list,		/* @parm <out> | Array of output objects, segments, surface or lattice */
	fzrt_int			*num_voronoi_objs		/* @parm <out> | Number of output objects */
	);


/********************************************************************************************************

	@enum	Delaunay triangulation output type identifiers.

	@desc	Output type identifiers for Delaunay triangulation
			
	@avail	8.5.0.1

	@toc	modl_gend

*********************************************************************************************************/
typedef enum fz_delaunay_output_type_enum
{	
	FZ_DELAUNAY_MAKE_SEGMENTS = 0,		/*  @emem	Output Delaunay triangulation as individual segments */
	FZ_DELAUNAY_MAKE_SURFACE,			/*  @emem	Output Delaunay triangulation as a surface */
	FZ_DELAUNAY_MAKE_LATTICE			/*  @emem	Output Delaunay triangulation as a lattice of cylinders */
	
} fz_delaunay_output_type_enum;


/************************************************************************

	@fsfunc_t
	
	@desc		Creates Dealaunay triangulation from set of source points.

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_delaunay_triangulation_func)(					
	fzrt_int 			windex,					/* @parm <in> |	Project window index */
	fz_xyz_td			*source_points,			/* @parm <in> | Array of source points */
	fzrt_int 			num_source_points,		/* @parm <in> |	Number of source points */ 
	fz_objt_ptr			surface_obj,			/* @parm <in> | Object to be used to define surface */
	fzrt_int			surface_findx,			/* @parm <in> | Index of object face to be used to define surface */
	char				make_surface,			/* @parm <in> | Selects output type */
	fzrt_boolean		triangulate_cocircular,	/* @parm <in> | TRUE to choose a triangulation for cocircular points, otherwise mesh face with 4 or more sides may occur */
	fzrt_boolean		include_edge_vertices,	/* @parm <in> | TRUE includes the edge facet points of the surface object in the triangulation */
	double				lattice_radius,			/* @parm <in> | Radius of lattice pipes */
	fzrt_boolean		imprint,				/* @parm <in> | TRUE indicates Delaunay triangulation should be imprinted on boundary surface or face */
	fzrt_boolean		project,				/* @parm <in> | Not yet implemented */
	fz_objt_ptr			**delaunay_obj_list,	/* @parm <out> | Array of output objects, segments, surface or lattice */
	fzrt_int			*num_delaunay_objs		/* @parm <out> | Number of output objects */
	);


/************************************************************************

	@fsfunc_t
	
	@desc		Creates a planar convex hull from set of source points.

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td (FZRT_SPEC* fz_planar_convex_hull_func)(
	fzrt_int		windex,						/* @parm <in> |	Project window index */
	fz_xyz_td		*source_points,				/* @parm <in> | Array of source points */
	fzrt_int		num_source_points,			/* @parm <in> |	Number of source points */
	double			margin,						/* @parm <in> | Distance to extend convex hull */
	double			miter_angle,				/* @parm <in> | Corners of convex hull with less than specified angle will be mitered when margin allows */
	double			min_angle,					/* @parm <in> | Angle used to identify and remove nearly collinear segments in convex hull */
	fz_objt_ptr		*convex_hull_obj			/* @parm <out> | Convex hull object */
	);

/************************************************************************

	@fsfunc_t
	
	@desc		Creates a convex hull from set of source points

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td (FZRT_SPEC* fz_shrink_wrap_points_func)(
	fzrt_int		windex,							/* @parm <in> |	Project window index */
	fz_xyz_td		*source_points,					/* @parm <in> | Array of source points */
	fzrt_int		num_source_points,				/* @parm <in> |	Number of source points */
	fz_objt_ptr		*convex_hull_obj				/* @parm <out> | Convex hull object */
	);


/************************************************************************

	@fsfunc_t
	
	@desc		Maps curves to the parametric space of a surface

	@return		Error codes
			
	@avail		8.5.0.1

	@see		
	
	@exfile

	@toc	modl_gend
											
*************************************************************************/
typedef fzrt_error_td (FZRT_SPEC* fz_map_curves_to_pspace_func)(
	fzrt_int		windex,						/* @parm <in> |	Project window index */
	fz_objt_ptr		*source_obj_list,			/* @parm <in> |	Array of curve objects to map */ 
	fzrt_int 		num_source_objs,			/* @parm <in> |	Number of source objects */ 
	fz_objt_ptr		surface_obj,				/* @parm <in> | Object to be used to define surface */
	fzrt_int		surface_findx,				/* @parm <in> | Index of object face to be used to define surface */
	double			left_margin,				/* @parm <in> | Amount of empty space padding proportional to the X extent of the source objects to add on the negative U boundary of the surface. */
	double			right_margin,				/* @parm <in> | Amount of empty space padding proportional to the X extent of the source objects to add on the positive U boundary of the surface. */
	double			top_margin,					/* @parm <in> | Amount of empty space padding proportional to the Y extent of the source objects to add on the positive V boundary of the surface. */
	double			bottom_margin,				/* @parm <in> | Amount of empty space padding proportional to the Y extent of the source objects to add on the negative V boundary of the surface. */
	fzrt_int		u_copies,					/* @parm <in> | Tile the mapping in the U direction for the specified number of copies. */
	fzrt_int		v_copies,					/* @parm <in> | Tile the mapping in the V direction for the specified number of copies. */
	fzrt_boolean	imprint,					/* @parm <in> | TRUE indicates mapping should be imprinted on target surface or face, otherwise a new surface is created. */
	fz_objt_ptr		*output_obj					/* @parm <out> | Output object */
	);

#ifdef __cplusplus
}
#endif

#endif /* _FORMZ_MODEL_GEND_API_H */