/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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"



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

	FZ_LIGHT_REP_TYPE_AMBIENT

	Description
		Unique identifier for the Ambient light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_AMBIENT		"\xb8\x67\x7b\x36\x9f\xee\x11\xda\x8e\x35\x00\x03\x93\x63\x5d\xbc"
/****************************************************************

	FZ_LIGHT_REP_TYPE_DISTANT

	Description
		Unique identifier for the Distant light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_DISTANT		"\x55\x40\x12\x38\xbc\x32\x61\x4f\x9a\xcf\x88\x0e\xae\x40\xd6\x8d"
/****************************************************************

	FZ_LIGHT_REP_TYPE_POINT

	Description
		Unique identifier for the Point light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_POINT			"\xa9\x5c\xe8\x4d\xca\x4c\x6a\x40\xb9\xe7\x59\x90\x4d\x5f\xc7\x6d"
/****************************************************************

	FZ_LIGHT_REP_TYPE_CONE

	Description
		Unique identifier for the Cone light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_CONE			"\x80\x29\xef\x33\xb0\xdf\x7c\x44\xae\x6e\xae\x88\xe0\xb4\xc1\xf0"
/****************************************************************

	FZ_LIGHT_REP_TYPE_AREA

	Description
		Unique identifier for the Area light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_AREA			"\xca\xce\xff\xc8\xcd\xc1\xb8\x4f\x86\xc1\xd6\x88\x23\xc5\x2a\xcb"
/****************************************************************

	FZ_LIGHT_REP_TYPE_PROJECTOR

	Description
		Unique identifier for the Projector light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_PROJECTOR		"\x1c\x8d\x4c\x6f\xc3\x86\x6e\x44\xba\x96\x03\xaf\xdd\xf1\x74\x0f"
/****************************************************************

	FZ_LIGHT_REP_TYPE_ENVIRONMENT

	Description
		Unique identifier for the Environment light type

	Availability	7.0.0.0

 ****************************************************************/
#define FZ_LIGHT_REP_TYPE_ENVIRONMENT	"\xc0\x58\x98\xc8\xd3\xd7\x97\x43\x95\x3d\x05\x12\x36\xbc\x06\xb6"


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

	fz_light_rep_parm_enum


	Description
		These parameters are provided for the basic light types, but each light type for each 
		renderer needs to respond to whether or not it responds to it.  The advantage to using 
		these is that the fuim items are created automatically, the management of their storage 
		is kept on the formZ side, and formZ takes care of the animation of them.

	Availability	7.0.0.0

 ****************************************************************/
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;



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

	FZ_LIGHT_REP_PVIEW_SIZE


	Description
		The width and height (in pixels) of the preview rendering in the Light Parameters dialog

	Availability	7.0.0.0

 ****************************************************************/
#define	FZ_LIGHT_REP_PVIEW_SIZE	 128

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

	fz_light_rep_cbak_name



	Description
		Light Representation name function (Required). This function is called 
		at system startup. It is expected to return a name string 
		for the Light Representation. The name cannot be longer than 
		max_name.

	Parameters
		name  [Result]
			The name of the Light Representation.
		max_name  [Input]
			The maximum numbers of characters for the name.

	Returns
		error


	Availability	7.0.0.0

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


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

	fz_light_rep_cbak_uuid



	Description
		Light Representation uuid function (Required). This function is called 
		at system startup. It is expected to return a unique identifier 
		for the Light Representation.

	Parameters
		uuid  [Result]
			The uuid of the Light Representation.

	Returns
		error


	Availability	7.0.0.0

 ****************************************************************/
typedef fzrt_error_td	 (*fz_light_rep_cbak_uuid_func) (
	fzrt_UUID_td			uuid
	);

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

	fz_light_rep_cbak_info



	Description
		Light Representation info function (Required). This function is called 
		at system startup. It is expected to return basic information 
		about the Light Representation. The info to be returned is : 
		 
		size : the size of the Light Representation data in # of bytes. 
		 
		flags : general information about the Light Representation. The flags are bit encoded. 
		The bits are defined in fz_light_rep_flags_enum. 
		flags = 0; 
		FZ_SETBIT(*flags,XXX); 
		FZ_SETBIT(*flags,XXX);

	Parameters
		size  [Result]
			The size of the Light Representation data in # of bytes.
		flags  [Result]
			Bit encoded flags, which tell formZ basic information about the Light Representation.

	Returns
		error


	Availability	7.0.0.0

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

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

	fz_light_rep_cbak_init



	Description
		Light Representation init function (Optional). This function is called once 
		at system startup. It gives the plugin the opportunity to perform one time 
		initialization tasks.

	Returns
		error


	Availability	7.0.0.0

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

	fz_light_rep_cbak_finit



	Description
		Light Representation finit function (Optional). This function is called once 
		at system cleanup. It gives the plugin the opportunity to perform one time 
		finalization tasks.

	Returns
		error


	Availability	7.0.0.0

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

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

	fz_light_rep_cbak_data_io



	Description
		Light Representation data io function (Required). This function is called 
		whenever the data of a Light Representation is written to or read from file.

	Parameters
		windex  [Input]
			project window index
		iost  [Input]
			The io stream pointer.
		dir  [Input]
			Reading or writing indicator.
		version  [Input, Result]
			When reading, this is the version with which the Light Representation was written. 
			When writing, the parameter needs to be set to the current version of the Light Representation's 
			It is up to the plugin to keep track of the version.
		size  [Input]
			When reading, this parameter is the size of the data when it was 
			written. When writing, this parameter is unused.
		light  [Input]
			the light, which is written/read
		light_rep_data  [Input]
			Pointer to the Light Representation data from which to write or to which to read.

	Returns
		Error codes


	Availability	7.0.0.0

 ****************************************************************/
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
	);
												
/****************************************************************

	fz_light_rep_cbak_data_init



	Description
		Light Representation data initiailization function (Required). This function is called 
		whenever a new Light is created by formZ. It is 
		expected to fill in the default values for the content of the Light Representation. 
		Note, that formZ allocates the data block for the Light Representation, 
		based on the size parameter returned by the fz_light_rep_cbak_info function. 
		In other words, the plugin does not need to allocate / deallocate the 
		basic data storage. However, any dynamic memory needed within each instance 
		of a Light Representation needs to be allcoated here end deallocated 
		in the fz_light_rep_cbak_finit function. 
		For convenience ,the light, which is created new is also passed in. This allows the 
		plugin to inquire more detail about the light, such as its type.

	Parameters
		windex  [Input]
			project window index
		light  [Input]
			the light, which has been created new
		light_rep_data  [Input, Result]
			Light Representation data.

	Returns
		Error codes


	Availability	7.0.0.0

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

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

	fz_light_rep_cbak_data_finit



	Description
		Light Representation finit function (Optional). This function is called 
		whenever a Light is deleted. It allows the plugin to 
		free any dynamic memory that may be present in a Light Representation.

	Parameters
		windex  [Input]
			project window index
		light  [Input]
			the light, which will be deleted
		light_rep_data  [Input, Result]
			Light Representation data.

	Returns
		Error codes


	Availability	7.0.0.0

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

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

	fz_light_rep_cbak_data_copy



	Description
		Light Representation copy function (Optional). This function is called 
		whenever a Light is copied. It allows the plugin to 
		copy any dynamic memory that may be present in a Light Representation. 
		When this function is called, the actual Light Representation has already 
		been copied into dst_data.

	Parameters
		src_windex  [Input]
			source project window index
		src_light  [Input]
			The source Light
		src_data  [Input]
			The source Light Representation data.
		dst_windex  [Input]
			destination project window index
		dst_light  [Input]
			The destination Light
		dst_data  [Input]
			The destination Light Representation data.

	Returns
		Error codes


	Availability	7.0.0.0

 ****************************************************************/
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
	);

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

	fz_light_rep_cbak_data_are_equal



	Description
		Light Representation compare function (Optional). This function is called 
		whenever two Lights are compared to be equal.

	Parameters
		windex1  [Input]
			project window index of light 1.
		lite1  [Input]
			light 1.
		light_rep_data1  [Input]
			The data representation of Light 1.
		windex2  [Input]
			project window index of light 2.
		lite2  [Input]
			light 2.
		light_rep_data2  [Input]
			The data representation of Light 2.
		are_equal  [Result]
			TRUE, if they are equal, FALSE otherwise.

	Returns
		Error codes


	Availability	7.0.0.0

 ****************************************************************/
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
	);





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

	fz_light_rep_cbak_data_iface_tmpl_func



	Description
		Light Representation dialog function (Required). This function is called 
		whenever a Light is edited. It is expected to display the content of the 
		Light Representation. 
		In the Light Parameters dialog, each Light Representation can fill in 
		additional fuim items. By default, there is "RenderZone" and "Simple". 
		The item id of the parent group is passed into this callabck function. 
		All dialog items created by this callback function must be a child 
		of this item id. Otherwise the items will show up in the wrong place.

	Parameters
		windex  [Input]
			project window index
		fuim_tmpl  [Input]
			Pointer to the dialog template.
		parent_id  [Input]
			fuim item id of the parent group.
		fuim_data  [Input]
			Pointer to the Light Representation data.

	Returns
		Error codes


	Availability	7.0.0.0

 ****************************************************************/
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
	);

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

	fz_light_rep_cbak_data_iface_pview_func



	Description
		Light Representation preview function (Optional). This function is called 
		whenever a Light is edited. It is expected to create the 
		preview rendering that show the surface style rendered on a sample 
		object. The preview scene is defined as a separate formZ project, whose 
		index is passed in as the pview_windex parameter. All project settings 
		are defined in such a way, that the plugin can render the scene 
		using the view, surface styles, images size ... of that project.

		The action argument tells the preview function, when it is called. 
		A value of 0 indicates, that it is called when the dialog is first 
		opened by the user. It gives the plugin the opportunity to 
		initialize any data necessary for the preview. It is not expected to generate 
		a rendering at that time. A value of 1 indicates, that a new preview rendering 
		is needed. It is called as often with that value as the user makes changes. 
		A value of 2 indicates that the user closed the dialog. The plugin 
		may now finalize any data. No rendering is expected at that time.

		The preview function should call the api fz_rmtl_iface_pview_update as 
		frequently as possible to allow the user to see the progress of the 
		preview rendering in the dialog. A good interval would be, for example, 
		once every scanline. The fz_rmtl_iface_pview_update api expects the preview rendering 
		to be defined as an rgb pixel buffer of FZ_LIGHT_REP_PVIEW_SIZE * FZ_LIGHT_REP_PVIEW_SIZE * 3 bytes. 
		This buffer is allocated by formZ and passed to the preview function.

		The preview function should also call the api fz_rmtl_iface_pview_interrupt 
		frequently. If this api returns TRUE, the preview rendering needs to be 
		interrupted and the preview function must return FALSE for the complete 
		argument. For example, the user may have selected an dialog item while 
		the rendering is executing. In order to do this, the rendering needs to stop, 
		controll needs to be returned to the dialog driver, which will handle the 
		user's click. If the user changed a setting, the preview function will 
		be called again with TRUE for the dirty argument, meaning ,that a new 
		image needs to be started. If the user did not make any changes, the 
		preview function will be called with FALSE for the dirty argument. The preview 
		function may then continue the rendering, where it was previously interrupted. 
		If a preview rendering is completed, the complete argument must be 
		returned as TRUE. Again, it is important, that interrupting is handled properly and in 
		a responsive manner to allow the user to interact with the dialog while the 
		rendering is proceeding.

		If this function is not implemented, formZ will display the default 
		preview rendering, that is also shown in the Simple tab.

	Parameters
		windex  [Input]
			origin project window index
		pview_windex  [Input]
			index of the project window containing the preview scene
		action  [Input]
			identifies, when the preview function is called. 
			0 : it is called at the beginning. when the dialog is first opened. It is called only once with this value. 
			1 : it is called to generate a new preview rendering. it is called as often as the user makes changes inthe dialog. 
			2 : it is called at the end, when the dialog is closed. It is called only once with this value.
		dirty  [Input]
			TRUE, if a brand new preview image is required, FALSE, if a previously cancelled rendering may be continued.
		fuim_tmpl  [Input]
			Pointer to the dialog template.
		fuim_data  [Input]
			Pointer to the Light Representation data.
		image_buffer  [Input]
			The image buffer to be filled with the preview rendering. It is allocated by formZ and 
			has exactly FZ_LIGHT_REP_PVIEW_SIZE * FZ_LIGHT_REP_PVIEW_SIZE * 3 bytes.
		complete  [Result]
			Return TRUE, if the preview image was completed sucessfully. Return FALSE 
			if the preview rendering was interrupted before completion.

	Returns
		Error codes


	Availability	7.0.0.0

 ****************************************************************/
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_fset


	FZ_LIGHT_REP_CBAK_FSET_TYPE
		formZ Light Representation callbacks function set id.

	FZ_LIGHT_REP_CBAK_FSET_NAME
		formZ color shader callbacks function set name.

	FZ_LIGHT_REP_CBAK_FSET_VERSION
		Light Representation callbacks function set version.

	Description
		Function set for a Light Representation. The functions in this set need to 
		be supplied by the plugin to implement a Light Representation.

	Availability	7.0.0.0

 ****************************************************************/
#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(7,0,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_fset;



#ifdef __cplusplus
}
#endif
		
#endif

