/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   Copyright 1989-2018 by AutoDesSys, Inc.                                                 *
 *                                                                                           *
 *   This software and its associated documentation contains proprietary,                    *
 *   confidential, and trade secret information of AutoDesSys Inc. and may not be            *
 *   disclosed, copied in any form, or used for any purpose except as specifically           *
 *   permitted in writing by AutoDesSys, Inc.                                                *
 *                                                                                           *
 *   AutoDesSys, Inc. grants permission to use the software to those who purchase            *
 *   a license.  Such a usage will be made according to the terms and conditions             *
 *   specified in the license agreement to which a licensee agrees before installing         *
 *   and commencing usage of the software.  The license agreement can be found               *
 *   on the envelop that contains the software CD.                                           *
 *                                                                                           *
 *   AutoDesSys, Inc. also grants permission to licensees to develop extensions to           *
 *   the software, which can be in the form of scripts or plugins.  The permission           *
 *   includes calling the API and call back functions provided by AutoDesSys, Inc.           *
 *   and accessing information relevant to these functions and the general workings          *
 *   of form.Z, but only up to the point to which AutoDesSys, Inc. has chosen to             *
 *   expose, through its form.Z SDK Manual.  All extensions developed by third               *
 *   parties will include a copy of this copyright note in an easily accessible place or     *
 *   a clear instruction to read this original note by AutoDesSys, Inc.                      *
 *                                                                                           *
 *   All the software distributed under a license, either for the purpose of using it or     *
 *   for the purpose of developing extensions, is distributed AS IS, WITHOUT                 *
 *   WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND                                    *
 *   AutoDesSys, Inc. HEREBY DISCLAIMS ALL SUCH WARRANTIES,                                  *
 *   INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF                                         *
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.                                    *
 *                                                                                           *
 *   formZ, RenderZone, and RadioZity are registered trademarks of AutoDesSys, Inc.          *
 *                                                                                           *
 *   form.Z SDK, Version 8.6.3, Dec 03, 2018                                                 *
 *                                                                                           *
 *                                                                                           *
 *********************************************************************************************/



#ifndef __FORMZ_LIGHT_REP_API_H
#define __FORMZ_LIGHT_REP_API_H

#ifdef __cplusplus
extern "C" {
#endif

#include "fzpl_plugin.h"

#include "fz_api.h"
#include "fz_type_api.h"
#include "fz_iost_api.h"
#include "fz_fuim_api.h"
#include "fz_cedt_api.h"



#define FZ_LIGHT_REP_TYPE_AMBIENT		"\xb8\x67\x7b\x36\x9f\xee\x11\xda\x8e\x35\x00\x03\x93\x63\x5d\xbc"
#define FZ_LIGHT_REP_TYPE_DISTANT		"\x55\x40\x12\x38\xbc\x32\x61\x4f\x9a\xcf\x88\x0e\xae\x40\xd6\x8d"
#define FZ_LIGHT_REP_TYPE_POINT			"\xa9\x5c\xe8\x4d\xca\x4c\x6a\x40\xb9\xe7\x59\x90\x4d\x5f\xc7\x6d"
#define FZ_LIGHT_REP_TYPE_CONE			"\x80\x29\xef\x33\xb0\xdf\x7c\x44\xae\x6e\xae\x88\xe0\xb4\xc1\xf0"
#define FZ_LIGHT_REP_TYPE_AREA			"\xca\xce\xff\xc8\xcd\xc1\xb8\x4f\x86\xc1\xd6\x88\x23\xc5\x2a\xcb"
#define FZ_LIGHT_REP_TYPE_PROJECTOR		"\x1c\x8d\x4c\x6f\xc3\x86\x6e\x44\xba\x96\x03\xaf\xdd\xf1\x74\x0f"
#define FZ_LIGHT_REP_TYPE_ENVIRONMENT	"\xc0\x58\x98\xc8\xd3\xd7\x97\x43\x95\x3d\x05\x12\x36\xbc\x06\xb6"


typedef enum fz_light_rep_parm_enum
{
	
	FZ_LIGHT_REP_PARM_NAME,
	FZ_LIGHT_REP_PARM_TYPE,
	FZ_LIGHT_REP_PARM_VISIBILITY,
	FZ_LIGHT_REP_PARM_SHINING_ON,
	FZ_LIGHT_REP_PARM_LOCKED_ON,
	
	
	FZ_LIGHT_REP_PARM_COLOR,
	FZ_LIGHT_REP_PARM_INTENS_BRIGHT,
	FZ_LIGHT_REP_PARM_INTENS_FALLOFF,
	FZ_LIGHT_REP_PARM_LOC_EYE,
	FZ_LIGHT_REP_PARM_LOC_COI,
	FZ_LIGHT_REP_PARM_SHADOWS_ON,
										
	
	FZ_LIGHT_REP_PARM_RADIUS,
	FZ_LIGHT_REP_PARM_INNER_ANGLE,
	FZ_LIGHT_REP_PARM_OUTER_ANGLE,
	FZ_LIGHT_REP_PARM_OBJ_VISIB,
	FZ_LIGHT_REP_PARM_OBJ_COLOR,
	FZ_LIGHT_REP_PARM_QUALITY,
	FZ_LIGHT_REP_PARM_USE_OBJ,
	FZ_LIGHT_REP_PARM_SPIN,
	FZ_LIGHT_REP_PARM_TMAP,
	FZ_LIGHT_REP_PARM_ENV_MAPS,
	FZ_LIGHT_REP_PARM_ENV_SPIN,
	
	FZ_LIGHT_REP_PARM_MAX
}fz_light_rep_parm_enum;



#define	FZ_LIGHT_REP_PVIEW_SIZE	 128

typedef fzrt_error_td	 (*fz_light_rep_cbak_name_func) (
	char		*name,
	fzrt_int		max_name
	);


typedef fzrt_error_td	 (*fz_light_rep_cbak_uuid_func) (
	fzrt_UUID_td			uuid
	);

typedef fzrt_error_td	 (*fz_light_rep_cbak_info_func) (
	fzrt_int		*size,
	fzrt_int		*flags
	);

typedef fzrt_error_td	 (*fz_light_rep_cbak_init_func) (
	void
	);
typedef fzrt_error_td	 (*fz_light_rep_cbak_finit_func) (
	void
	);

typedef fzrt_error_td 	 (*fz_light_rep_cbak_data_io_func) (
	fzrt_int 					windex,
	fz_iost_ptr				iost,
	fz_iost_dir_td_enum		dir,
	fzpl_vers_td * const version,
	fzrt_unsigned_int 			size,
	fz_lite_ptr				light,
	void					*light_rep_data
	);
												
typedef fzrt_error_td	 (*fz_light_rep_cbak_data_init_func) (
	fzrt_int					windex,
	fz_lite_ptr				light,
	void					*light_rep_data
	);

typedef fzrt_error_td	 (*fz_light_rep_cbak_data_finit_func) (
	fzrt_int 					windex,
	fz_lite_ptr				light,
	void					*light_rep_data
	);

typedef fzrt_error_td 	 (*fz_light_rep_cbak_data_copy_func) (
	fzrt_int					src_windex,
	fz_lite_ptr				src_light,
	void					*src_data,
	fzrt_int					dst_windex,
	fz_lite_ptr				dst_light,
	void					*dst_data
	);

typedef fzrt_error_td 	 (*fz_light_rep_cbak_data_are_equal_func) (
	fzrt_int					windex1,
	fz_lite_ptr				lite1,
	void					*light_rep_data1,
	fzrt_int					windex2,
	fz_lite_ptr				lite2,
	void					*light_rep_data2,
	fzrt_boolean			*are_equal
	);


typedef enum fz_lite_tform_type_enum
{
	FZ_LIGHT_TFORM_TYPE_ORG = 0,
	FZ_LIGHT_TFORM_TYPE_COI,
	FZ_LIGHT_TFORM_TYPE_UNITS

} fz_lite_tform_type_enum ;


typedef fzrt_error_td (*fz_light_rep_cbak_data_tform_func)(
	fzrt_int					windex,
	fz_lite_ptr				lite,
	void					*light_rep_data,
	fz_mat4x4_td			*tform_mat,
	fzrt_int					tform_type
	);



typedef fzrt_error_td (*fz_light_rep_cbak_type_change_func)(
	fzrt_int					windex,
	fz_lite_ptr				lite,
	void					*light_rep_data,
	fzrt_UUID_td			old_type,
	fzrt_UUID_td			new_type,
	fz_fuim_tmpl_ptr		fuim_tmpl

	);
	


typedef fzrt_error_td (*fz_light_rep_cbak_valid_obj_func)(
	fzrt_int					windex,
	fz_objt_ptr				objt,
	fz_objt_topo_type_enum	topo_type,
	fzrt_UUID_td			light_type,
	fzrt_boolean			*valid,
	fz_string_td			msg
	);
	
typedef fzrt_error_td (*fz_light_rep_cbak_light_edited_func) (
	fzrt_int					windex,
	fz_lite_ptr				lite_before,
	void					*light_before_rep_data,
	fz_lite_ptr				lite_after,
	void					*light_after_rep_data
);

typedef fzrt_error_td (*fz_light_rep_cbak_type_support_func)(
	fzrt_UUID_td		light_type,
	fzrt_boolean		*support
	);


typedef enum
{
	FZ_LREP_PARM_SUPPORT_NOT = 0,
	FZ_LREP_PARM_SUPPORT_AND_DISPLAY,
	FZ_LREP_PARM_SUPPORT_NO_DISPLAY
} fz_light_rep_parm_support_enum ;


typedef fzrt_error_td (*fz_light_rep_cbak_parm_support_func)(
	fzrt_UUID_td					light_type,
	fz_light_rep_parm_enum			parm_id,
	fz_light_rep_parm_support_enum	*support
	);


typedef fzrt_error_td (*fz_light_rep_cbak_custom_count_func)(
	fzrt_int				*count
	);


typedef fzrt_error_td (*fz_light_rep_cbak_custom_info_func)(
	fzrt_int				custom_index,
	fz_string_td		light_name,
	fzrt_UUID_td		light_type,
	fzrt_floc_ptr 		palette_pic_floc
	);


typedef fzrt_error_td (*fz_light_rep_cbak_custom_parm_count_func)(
	fzrt_int				windex,
	void				*light_rep_data,
	fzrt_UUID_td		light_type,
	fzrt_int				*count
	);
	

typedef fzrt_error_td (*fz_light_rep_cbak_custom_default_light_obj_func)(
	fzrt_int				windex,
	fzrt_UUID_td		light_type,
	fz_xyz_td			*origin,
	fz_objt_ptr			*new_obj
	);

typedef enum fz_light_rep_category_enum
{
	FZ_LIGHT_REP_CATEGORY_INTENSITY,
	FZ_LIGHT_REP_CATEGORY_LOCATION,
	FZ_LIGHT_REP_CATEGORY_SHADOWS,
	FZ_LIGHT_REP_CATEGORY_PARAMS,
}fz_lref_category_enum;
typedef enum fz_light_rep_custom_parm_info_enum
{
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_UUID,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_NAME,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_TYPE,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_FORMAT,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_FUIM_TYPE,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_RANGE,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_RANGE_MIN,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_RANGE_MAX,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_FLAGS,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_DEFAULT,
	FZ_LIGHT_REP_CUSTOM_PARM_INFO_CATEGORY,
}fz_light_rep_custom_parm_info_enum;



typedef fzrt_error_td (*fz_light_rep_cbak_custom_parm_info_func)(
	fzrt_int							windex,
	void							*light_rep_data,
	fzrt_UUID_td					light_type,
	fzrt_int							parm_indx,
	fz_light_rep_custom_parm_info_enum	parm_info,
	fz_type_td						*data
	);


typedef fzrt_error_td (*fz_light_rep_cbak_custom_parm_get_func)(
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		parm_uuid,
	fz_type_td			*data,
	fzrt_boolean		*found
	);
typedef fzrt_error_td (*fz_light_rep_cbak_custom_parm_set_func)(
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		parm_uuid,
	fz_type_td			*data,
	fzrt_boolean		*found
	);


typedef fzrt_error_td (*fz_light_rep_cbak_custom_parm_state_str_func)(
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		parm_uuid,
	fzrt_int				which_state,
	fz_string_td		str,
	fzrt_boolean		*found
	);



typedef fzrt_error_td (*fz_light_rep_cbak_intensity_iface_func)(
	fz_fuim_tmpl_ptr	fuim_tmpl,
	short				parent,
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		light_type
	);
typedef fzrt_error_td (*fz_light_rep_cbak_location_iface_func)(
	fz_fuim_tmpl_ptr	fuim_tmpl,
	short				parent,
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		light_type
	);
typedef fzrt_error_td (*fz_light_rep_cbak_shadows_iface_func)(
	fz_fuim_tmpl_ptr	fuim_tmpl,
	short				parent,
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		light_type
	);
typedef fzrt_error_td (*fz_light_rep_cbak_params_iface_func)(
	fz_fuim_tmpl_ptr	fuim_tmpl,
	short				parent,
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		light_type
	);




typedef fzrt_error_td (*fz_light_rep_cbak_custom_graphics_func)(
	fzrt_int				windex,
	fz_lite_ptr			lite,
	void				*light_rep_data,
	fzrt_UUID_td		light_type,
	fzrt_int				*nsets,
	fzrt_int				*sets,
	fzrt_int				*npts,
	fz_xyz_td			*pts
	);






typedef fzrt_error_td (*fz_light_rep_cbak_custom_approximate_func)(
	fzrt_UUID_td		light_type_org,
	fzrt_UUID_td		light_type_approx
	);





typedef fzrt_error_td 	 (*fz_light_rep_cbak_data_iface_tmpl_func) (
	fzrt_int				windex,
	fz_fuim_tmpl_ptr	fuim_tmpl,
	fzrt_int				parent_id,
	fzrt_ptr			fuim_data
	);

typedef fzrt_error_td 	 (*fz_light_rep_cbak_data_iface_pview_func) (
	fzrt_int				windex,
	fzrt_int				pview_windex,
	fzrt_int				action,
	fzrt_boolean		dirty,
	fz_fuim_tmpl_ptr	fuim_tmpl,
	fzrt_ptr			fuim_data,
	unsigned char		*image_buffer,
	fzrt_boolean		*complete
	);

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

	fz_light_rep_cbak_cedt



	Description
		Light Representation type parameter cedt function (Optional).

	Parameters
		windex  [Input]
			project window index
		lite  [Input]
			light for wighc the controls are being generated
		light_rep_data  [Input]
			Pointer to the Light Representation data from which to write or to which to read.
		parent_item  [Input]
			Parent cedt group, under which all cedt items for the light must be created.

	Returns
		Error codes


	Availability	8.5.0.0

 ****************************************************************/
typedef fzrt_error_td  (*fz_light_rep_cbak_cedt_func)(
	fzrt_int				windex,
	fz_lite_ptr				lite,
	void					*light_rep_data,
	fz_cedt_item_ptr		parent_item
	);

#define FZ_LIGHT_REP_CBAK_FSET_TYPE			"\xb6\x1e\x1e\xaf\xc0\xcc\xee\x4d\xbb\x54\xc3\x1a\xb0\xee\x47\x56"
#define FZ_LIGHT_REP_CBAK_FSET_NAME			"formZ Light Representation Callbacks"
#define FZ_LIGHT_REP_CBAK_FSET_VERSION		FZPL_VERS_MAKE(8,5,0,0)

typedef struct fz_light_rep_cbak_fset
{
	fzpl_fset_prvt_data_td						prvt_data;

	fz_light_rep_cbak_name_func					fz_light_rep_cbak_name;
	fz_light_rep_cbak_uuid_func					fz_light_rep_cbak_uuid;
	fz_light_rep_cbak_info_func					fz_light_rep_cbak_info;
	fz_light_rep_cbak_init_func					fz_light_rep_cbak_init;
	fz_light_rep_cbak_finit_func				fz_light_rep_cbak_finit;
	
	fz_light_rep_cbak_data_io_func				fz_light_rep_cbak_data_io;
	fz_light_rep_cbak_data_init_func			fz_light_rep_cbak_data_init;
	fz_light_rep_cbak_data_finit_func			fz_light_rep_cbak_data_finit;
	fz_light_rep_cbak_data_copy_func			fz_light_rep_cbak_data_copy;
	fz_light_rep_cbak_data_are_equal_func		fz_light_rep_cbak_data_are_equal;
	fz_light_rep_cbak_data_tform_func			fz_light_rep_cbak_data_tform;
	
	
	
	fz_light_rep_cbak_type_change_func			fz_light_rep_cbak_type_change;
	fz_light_rep_cbak_valid_obj_func			fz_light_rep_cbak_valid_obj;
	fz_light_rep_cbak_light_edited_func			fz_light_rep_cbak_light_edited;

	fz_light_rep_cbak_type_support_func				fz_light_rep_cbak_type_support;
	fz_light_rep_cbak_parm_support_func				fz_light_rep_cbak_parm_support;
	fz_light_rep_cbak_custom_count_func				fz_light_rep_cbak_custom_count;
	fz_light_rep_cbak_custom_info_func				fz_light_rep_cbak_custom_info;
	fz_light_rep_cbak_custom_default_light_obj_func	fz_light_rep_cbak_custom_default_light_obj;

	fz_light_rep_cbak_custom_parm_count_func		fz_light_rep_cbak_custom_parm_count;
	fz_light_rep_cbak_custom_parm_info_func			fz_light_rep_cbak_custom_parm_info;
	fz_light_rep_cbak_custom_parm_get_func			fz_light_rep_cbak_custom_parm_get;
	fz_light_rep_cbak_custom_parm_set_func			fz_light_rep_cbak_custom_parm_set;
	fz_light_rep_cbak_custom_parm_state_str_func	fz_light_rep_cbak_custom_parm_state_str;

	fz_light_rep_cbak_intensity_iface_func		fz_light_rep_cbak_intensity_iface;
	fz_light_rep_cbak_location_iface_func		fz_light_rep_cbak_location_iface;
	fz_light_rep_cbak_shadows_iface_func		fz_light_rep_cbak_shadows_iface;
	fz_light_rep_cbak_params_iface_func			fz_light_rep_cbak_params_iface;

	fz_light_rep_cbak_custom_graphics_func			fz_light_rep_cbak_custom_graphics;
	fz_light_rep_cbak_custom_approximate_func		fz_light_rep_cbak_custom_approximate;

	
	fz_light_rep_cbak_cedt_func						fz_light_rep_cbak_cedt;

}  fz_light_rep_cbak_fset;



#ifdef __cplusplus
}
#endif
		
#endif

