#ifndef _FORMZ_MODEL_DECAL_API_H
#define _FORMZ_MODEL_DECAL_API_H

#ifdef __cplusplus
extern "C" {
#endif

/* @doc EXTERNAL MODEL */

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

	@enum	decal attribute parameter ids.

	@desc	Parameter identifiers for the decal attribute. 
			Used for the "which" argument of fz_objt_attr_get_objt_decal_parm 
			and fz_objt_attr_set_objt_decal_parm

	@avail	5.0.0.0

 	@see	fz_objt_attr_get_objt_decal_parm,fz_objt_attr_set_objt_decal_parm,<auto>

	@exfile	<scdir>/Utilities | util_attr_decal.fsl

	@toc	modl_attr

*************************************************************************/
typedef enum fz_attr_decal_parm_enum
{
	FZ_ATTR_DECAL_PARM_NAME = 0,			/*  @emem 		Decal group name. The name cannot be longer than 32 characters.
											@ptype 		char* 						*/

	FZ_ATTR_DECAL_PARM_CENTER_HORIZ,		/*  @emem 		Center the horizontal tile
											@ptype		fzrt_boolean				*/
													
	FZ_ATTR_DECAL_PARM_CENTER_VERT,		/*  @emem 		Center the vertical tile
											@ptype		fzrt_boolean				*/
											
	FZ_ATTR_DECAL_PARM_MIRROR_HORIZ,		/*  @emem 		mirror the horizontal tile
											@ptype		fzrt_boolean				*/
													
	FZ_ATTR_DECAL_PARM_MIRROR_VERT,		/*  @emem 		Mirror the vertical tile
											@ptype		fzrt_boolean				*/
													
	FZ_ATTR_DECAL_PARM_FLIP,				/*  @emem 		Flip the horizontal and vertical direction of the decal
											@ptype		fzrt_boolean				*/
													
	FZ_ATTR_DECAL_PARM_SOLID_SIZE,		/*  @emem 		The size of a solid texture used by a decal.
											@ptype		double 
											@rmin		0.0							*/
													
	FZ_ATTR_DECAL_PARM_MAP_TYPE,			/*  @emem 		Mapping type. Certain restrictions apply when
														switching the mapping type of a decal.
														For more details see fz_objt_attr_set_objt_decal_parm.
											@ptype		fz_map_space_type_enum	*/
													
	FZ_ATTR_DECAL_PARM_ORIGIN,			/*  @emem 		The origin of the decal
											@ptype		fz_xyz_td
											@rimin_imax 0.0 | 1.0 if the
														the mapping type is FZ_MAP_SPACE_PARAMETRIC (only x and y are used).
														For all other mapping types, the origin parameter
														specifies a 3D location.	*/
													
	FZ_ATTR_DECAL_PARM_ROTATION,			/*  @emem 		The rotation of the decal in 3d space. The angles are
														applied in z y x order.
														FZ_MAP_SPACE_PARAMETRIC does not have a rotation parameter.
											@ptype		fz_xyz_td						*/
													
	FZ_ATTR_DECAL_PARM_SIZE_X,			/*  @emem 		The horizontal size of a decal tile. For FZ_MAP_SPACE_PARAMETRIC
														the tile size is a factor of the length/depth of the parametric surface. At a
														factor of 1.0 the decal occupies the surface with one tile. For
														FZ_MAP_SPACE_FLAT, FZ_MAP_SPACE_CUBIC and the
														vertical size of FZ_MAP_SPACE_CYLINDER mapping, the tile
														size is a linear dimension, which must be greater than 0.0. For the
														horizontal size of FZ_MAP_SPACE_CYLINDER and for
														FZ_MAP_SPACE_SPHERE the tile size is an angular dimension
														in the range 0.0 < value < 2PI. The FZ_ATTR_DECAL_PARM_SIZE_X/Y and
														FZ_ATTR_DECAL_PARM_REPS_X/Y parameters are interdependent. When changing
														one, the other parameter will automatically be updated.
											@ptype		double
											@rmin		0.0							*/
													
	FZ_ATTR_DECAL_PARM_SIZE_Y,			/*  @emem 		The vertical size of a decal tile.
											@ptype		double
											@rmin		0.0							*/
	
	FZ_ATTR_DECAL_PARM_INF_REPS_X,		/*  @emem 		Use an infinite number of horizontal tile repetitions.
											@ptype		fzrt_boolean				*/
	
	FZ_ATTR_DECAL_PARM_INF_REPS_Y,		/*  @emem 		Use an infinite number of vertical tile repetitions.
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_REPS_X,			/*  @emem 		The # of  horizontal repetitions of a decal tile if FZ_ATTR_DECAL_PARM_INF_REPS_X is FALSE. 
											@ptype		double
											@rmin		0.0							*/
													
	FZ_ATTR_DECAL_PARM_REPS_Y,			/*  @emem 		The # of  vertical repetitions of a decal tile if FZ_ATTR_DECAL_PARM_INF_REPS_Y is FALSE. 
											@ptype		double
											@rmin		0.0							*/

	FZ_ATTR_DECAL_PARM_SCALE_WITH_OBJ,	/*  @emem 		Scale the decal size, when uniform scaling is applied to the object.
											@ptype		fzrt_boolean 				*/
	
	FZ_ATTR_DECAL_PARM_SIZE_LOCK,			/*  @emem 		The size lock option. Only, None, Square and Current are available.
											@ptype		fz_map_space_size_lock_enum	*/
	
	FZ_ATTR_DECAL_PARM_RMTL_TAG,			/*  @emem 		The surface style tag associated with the decal.
											@ptype		fz_tag_td	*/

	FZ_ATTR_DECAL_PARM_COLOR_ON,			/*  @emem 		Use the color component of the decal's surface style
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_REFL_ON,			/*  @emem 		Use the reflection component of the decal's surface style
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_TRANS_ON,			/*  @emem 		Use the transparency component of the decal's surface style
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_BUMP_ON,			/*  @emem 		Use the bump component of the decal's surface style
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_TRANS_OPAQUE_ON,	/*  @emem 		Use the transparency component as an opacity mask (TRUE) or transparency mask (FALSE).
											@ptype		fzrt_boolean				*/

	FZ_ATTR_DECAL_PARM_VISIBLE,			/*  @emem 		Is the decal visible (TRUE) or not (FALSE).
											@ptype		fzrt_boolean				*/
													
	
	MODEL_ATTR_DECAL_MAX
} fz_attr_decal_parm_enum;




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

	@fsfunc_t	

	@desc		Gets the number of decal groups of an object decal attribute.
				When first created, the object decal attribute has 0 decal groups. 
				New decal groups can be added with fz_objt_attr_add_objt_decal_grp.

	@avail		5.0.0.0

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_get_objt_decal_count_func) (
	fzrt_int 				windex, 	/* @parm <in> | project window index */
	fz_objt_ptr		obj, 		/* @parm <in> | object						*/
	fzrt_int				*n_decal	/* @parm <out> | The number of decal groups of the object decal attribute */
	);
											
/************************************************************************

	@fsfunc_t	

	@desc		Adds a new decal group to the decal attribute
				of an object. If the object does not have a decal 
				attribute an error is returned. A new decal
				attribute can be created with fz_objt_attr_create_objt_decal. 
				The optional decal_index argument returns the
				index of the decal group which was added. An error is also returned
				if there are already 32 decal groups in the attribute, which is the limit.

	@avail		5.0.0.0

 	@see		fz_objt_attr_delete_objt_decal_grp,fz_objt_attr_create_objt_decal,fz_objt_attr_clear_objt_decal

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_add_objt_decal_grp_func) (
	fzrt_int 				windex, 		/* @parm <in> | project window index */
	fz_objt_ptr			obj, 			/* @parm <in> | object						*/
	fz_tag_td			*rmtl_tag,		/* @parm <in> | the tag of the surface associated with the decal.		*/
	fzrt_int				*decal_index	/* @parm <out_opt> | The index of the new decal group. */
	);
												
/************************************************************************

	@fsfunc_t	

	@desc		Deletes a decal group from the decal attribute
				of an object. If the object does not have a decal 
				attribute an error is returned. The decal_index parameter
				passed in is used to identify the decal group. It must
				be must between 0 and 32, but no more than the current
				number of decals.

	@avail		5.0.0.0

 	@see		fz_objt_attr_add_objt_decal_grp

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_delete_objt_decal_grp_func) (
	fzrt_int 				windex, 	/* @parm <in> | project window index */
	fz_objt_ptr		obj, 		/* @parm <in> | object						*/
	fzrt_int				decal_index	/* @parm <in> | decal group index			*/
	);
												
/************************************************************************

	@fsfunc_t	

	@desc		Sets the decal mask of a face for the object decal attribute.
				The mask is a fzrt_int integer, whose bits indicate whether the
				face uses a particular decal or not. If the bit in the nth position
				of the fzrt_int is 1, the face uses the nth decal in the attribute.
				If the bit is 0, the nth decal is not used by the face.

	@avail		5.0.0.0

 	@see		fz_objt_attr_get_face_decal_mask

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_set_face_decal_mask_func) (	
	fzrt_int 				windex, 	/* @parm <in> | project window index */
	fz_objt_ptr		obj, 		/* @parm <in> | object						*/
	fzrt_int				findx,		/* @parm <in> | face index					*/
	fzrt_int				decal_mask	/* @parm <in> | face decal mask				*/
	);
											
/************************************************************************

	@fsfunc_t	

	@desc		Gets the decal mask of a face for the object decal attribute.
				The mask is a fzrt_int integer, whose bits indicate whether the
				face uses a particular decal or not. If the bit in the nth position
				of the fzrt_int is 1, the face uses the nth decal in the attribute.
				If the bit is 0, the nth decal is not used by the face.

	@avail		5.0.0.0

 	@see		fz_objt_attr_set_face_decal_mask

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_get_face_decal_mask_func) (	
	fzrt_int 				windex, 	/* @parm <in> | project window index */
	fz_objt_ptr		obj, 		/* @parm <in> | object						*/
	fzrt_int				findx,		/* @parm <in> | face index					*/
	fzrt_int				*decal_mask /* @parm <out> | face decal mask			*/
	);
											
/************************************************************************

	@fsfunc_t
	
	
	@desc		Checks whether an object has a decal attribute.

	@avail		5.0.0.0

 	@see	

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_objt_has_decal_func) (		
	fzrt_int 					windex, 		/* @parm <in> | project window index */
	fz_objt_ptr			obj,			/* @parm <in> | object						*/
	fzrt_boolean			*has_decal		/* @parm <out> | TRUE if object has a decal control attribute, FALSE otherwise. */
	);
										
/************************************************************************

	@fsfunc_t


	@desc		Create a new, default decal attribute for an object. If an old 
				decal attribute exists, it will be overwritten without warning.
				The new decal will have zero decal groups. New decal groups can be 
				created with the function fz_objt_attr_add_objt_decal_grp. 

	@avail		5.0.0.0

 	@see		fz_objt_attr_add_objt_decal_grp,fz_objt_attr_clear_objt_decal

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_create_objt_decal_func) (		
	fzrt_int 					windex, /* @parm <in> | project window index */
	fz_objt_ptr			obj		/* @parm <in> | object						*/
	);
											
/************************************************************************

	@fsfunc_t
	

	@desc		Removes the object decal attribute from an object.

	@avail		5.0.0.0

 	@see		fz_objt_attr_create_objt_decal

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_clear_objt_decal_func) (		
	fzrt_int 					windex, /* @parm <in> | project window index */
	fz_objt_ptr			obj		/* @parm <in> | object						*/
	);
											
/************************************************************************

	@fsfunc_t


	@desc		Set a parameter of a decal group of the object decal attribute.
				The decal group is identified by decal_indx. 
				
				When assigning the name parameter, no checks
				are made whether the decal group name is unique. It is up to the
				calling function to assure this. The name cannot be larger
				than 32 characters.
				
				When setting the origin parameter and the decal group uses
				parametric mapping, the x and y value of the fz_xyz_td passed in
				must be in the range of 0.0 to 1.0. 
				
				When setting the rotation parameter and the decal group uses
				parametric mapping, the rotation values are
				ignored.
				
				When setting the map type parameter, the following rules apply :
				
				- Only nurbz and analytic primitives can be assigned the parametric
				mapping type.

	@avail		5.0.0.0

 	@see		fz_objt_attr_get_objt_decal_parm

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_set_objt_decal_parm_func) (	
	fzrt_int 					windex, 		/* @parm <in> | project window index */
	fz_objt_ptr			obj,			/* @parm <in> | object						*/
	fzrt_int					decal_indx,		/* @parm <in> | decal index					*/	
	fz_attr_decal_parm_enum	which,			/* @parm <in> | parameter identifier		*/	
	fz_type_td				*data			/* @parm <in> | parameter data				*/
	);
												
											
/************************************************************************

	@fsfunc_t


	@desc		Get a parameter of a decal group of the object decal attribute.
				The decal group is identified by decal_indx.

	@avail		5.0.0.0

 	@see		fz_objt_attr_set_objt_decal_parm

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_get_objt_decal_parm_func) (
	fzrt_int 					windex, 		/* @parm <in> | project window index */
	fz_objt_ptr			obj,	    	/* @parm <in> | object						*/
	fzrt_int					decal_indx,  	/* @parm <in> | decal index					*/
	fz_attr_decal_parm_enum	which,			/* @parm <in> | parameter identifier		*/
	fz_type_td				*data			/* @parm <out> | parameter data				*/
	);

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

	@fsfunc_t


	@desc		Set the order of the decal groups in an object decal attribute.
				The decal_indx_order array passed in contains the indices of the
				decal group in the new order. This array must be exactly ndecals
				fzrt_int and must contain each index exactly once.

	@avail		5.0.0.0

 	@see		fz_objt_attr_add_objt_decal_grp

	@exfile		<scdir>/Utilities | util_attr_decal.fsl

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_sort_objt_decals_func) (
	fzrt_int 					windex, 			/* @parm <in> | project window index */
	fz_objt_ptr			obj,	    		/* @parm <in> | object						*/
	fzrt_int					*decal_indx_order  	/* @parm <in> | decal order					*/
	);


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

	@fsfunc_t


	@desc		reterives a list of uv values for for each facetted or wire cordinate of an object. uvs must be pre allocated..

	@avail		9.2.0.0

	@see		fz_objt_attr_get_objt_decal_parm

	@exfile

	@toc		modl_attr

*************************************************************************/
typedef fzrt_error_td	 (FZRT_SPEC *fz_objt_attr_get_objt_decal_uvs_func) (
	fzrt_int 				windex, 		/* @parm <in> | project window index */
	fz_objt_ptr				obj,			/* @parm <in> | object						*/
	fzrt_int				decal_indx,		/* @parm <in> | decal index					*/
	fz_objt_model_type_enum	model_type,		/* @parm <in> | which model type to get uvs for		*/
	fz_xy_float_td			*uvs			/* @parm <in> | pre allocted array for uv values				*/
	);
												

#ifdef __cplusplus
}
#endif

#endif /* _FORMZ_MODEL_DECAL_API_H */
