/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_RADS_API_H
#define __FORMZ_RADS_API_H 1

#include "fzpl_plugin.h"

#include "fz_type_api.h"

#ifdef __cplusplus
extern "C" {
#endif




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

	fz_rads_lite_intens_enum


	Description
		Identifier for how to do light intensities in radiosity.

	Members
		FZ_RADS_LITE_INTENS_SIMPLE
			All Simple
		FZ_RADS_LITE_INTENS_ACCURATE
			All Accurate
		FZ_RADS_LITE_INTENS_LITE
			Per Light

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_rads_lite_intens_enum
{
	FZ_RADS_LITE_INTENS_SIMPLE = 0,
	FZ_RADS_LITE_INTENS_ACCURATE,
	FZ_RADS_LITE_INTENS_LITE,
	FZ_RADS_LITE_INTENS_MAX
}fz_rads_lite_intens_enum;

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

	fz_rads_squality_enum


	Description
		Identifier for how much sampling quality in radiosity solution.

	Members
		FZ_RADS_SQUALITY_SIMPLE
			Simple
		FZ_RADS_SQUALITY_BETTER
			Better
		FZ_RADS_SQUALITY_BEST
			Best

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_rads_squality_enum
{
	FZ_RADS_SQUALITY_SIMPLE = 0,
	FZ_RADS_SQUALITY_BETTER,
	FZ_RADS_SQUALITY_BEST,
	FZ_RADS_SQUALITY_MAX
}fz_rads_squality_enum;

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

	fz_rads_mesh_stop_enum


	Description
		Identifier for when to stop meshing during radiosity solution.

	Members
		FZ_RADS_MESH_STOP_NEVER
			Continuous meshing
		FZ_RADS_MESH_STOP_DECREASE
			Decrease meshing
		FZ_RADS_MESH_STOP_AFTER_LITES
			No meshing after processing lights
		FZ_RADS_MESH_STOP_AFTER_ITER
			No meshing after x iterations

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_rads_mesh_stop_enum
{
	FZ_RADS_MESH_STOP_NEVER = 0,
	FZ_RADS_MESH_STOP_DECREASE,
	FZ_RADS_MESH_STOP_AFTER_LITES,
	FZ_RADS_MESH_STOP_AFTER_ITER,
	FZ_RADS_MESH_STOP_MAX
}fz_rads_mesh_stop_enum;

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

	fz_rads_term_enum


	Description
		Identifier for when to terminate radiosity solution.

	Members
		FZ_RADS_TERM_LITE_ABSORB
			After x% light is absorbed
		FZ_RADS_TERM_ITER
			After x iterations
		FZ_RADS_TERM_TIME
			After x seconds
			Availability: 6.5.0.0


	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_rads_term_enum
{
	FZ_RADS_TERM_LITE_ABSORB = 0,
	FZ_RADS_TERM_ITER,
	FZ_RADS_TERM_TIME,
	FZ_RADS_TERM_MAX
}fz_rads_term_enum;


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

	fz_rads_pview_update_enum


	Description
		Identifier for when to update preview of radiosity solution.

	Members
		FZ_RADS_PVIEW_UPDATE_SECS
			After every x seconds
		FZ_RADS_PVIEW_UPDATE_ITER
			After each x iterations
		FZ_RADS_PVIEW_UPDATE_PERCENT
			After each x% of completion

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_rads_pview_update_enum
{
	FZ_RADS_PVIEW_UPDATE_SECS = 0,
	FZ_RADS_PVIEW_UPDATE_ITER,
	FZ_RADS_PVIEW_UPDATE_PERCENT,
	FZ_RADS_PVIEW_UPDATE_MAX
}fz_rads_pview_update_enum;


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

	fz_rads_mode_enum


	Description
		Identifier for when to update preview of radiosity solution.

	Members
		FZ_RADS_MODE_FG_SUPPORT
			Use FG also in solution
		FZ_RADS_MODE_DIRECT_ILLUM
			Use direct illumination in solution
		FZ_RADS_MODE_PURE_RADIOS
			Only use radiosity in solution

	Availability	6.5.0.0


	See Also
		fz_rads_parm_enum

 ****************************************************************/
typedef enum fz_rads_mode_enum
{
	FZ_RADS_MODE_FG_SUPPORT = 0,
	FZ_RADS_MODE_DIRECT_ILLUM,
	FZ_RADS_MODE_PURE_RADIOS,
	FZ_RADS_MODE_MAX
}fz_rads_mode_enum;

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

	fz_rads_parm_enum


	Description
		Radiosity options parameters.  This enum identifies which option is wanted to retrieve or 
		change.  This is used with the fz_rads_get_parm, fz_rads_set_parm radiosity functions.

	Members
		FZ_RADS_PARM_PATCHES
			Percentage of patches.
			Type: double
			Default Value: 60.0
			Range: 0.0
		FZ_RADS_PARM_POLYGONS
			Number of polygons per patch.
			Type: float
			Default Value: 3.0
			Range: 1.0
		FZ_RADS_PARM_LITE_MENU
			How to deal with light intensities.
			Type: fz_rads_lite_intens_enum
			Default Value: FZ_RADS_LITE_INTENS_LITE
		FZ_RADS_PARM_SHADOWS_OBSOLETE
			Whether or not to calculate shadows. 
			Obsolete: 6.5.0.0.  Now shadows are always calculated.
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_RADS_PARM_DIRECT_ILLUM_OBSOLETE
			Whether or not to render direct illumination. 
			Obsolete: 6.5.0.0.  This parameter has been replaced by the FZ_RADS_PARM_MODE 
			option, which includes this as the FZ_RADS_PARM_MODE_DIRECT_ILLUM option.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_AREA_LN_LITE
			Whether or not to include area/line lights in direct illumination.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_VIEW_DEP
			Whether or not to make solution view dependent.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_RESOLVE_ISECT
			Whether or not to resolve intersections.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_IGNORE_MESH_ATTR
			Whether or not to ignore object/face meshing attributes.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_SAMP_MIN
			Minimum number of samples.
			Type: short
			Default Value: 3
			Range: 1
		FZ_RADS_PARM_SAMP_MAX
			Maximum number of samples.
			Type: short
			Default Value: 6
			Range: 1
		FZ_RADS_PARM_SAMP_AT_VERT
			Whether or not to sample at vertices.
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_RADS_PARM_SAMP_AT_CTR
			Whether or not to sample at centers.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_SAMP_QUALITY
			Quality of sampling.
			Type: fz_rads_squality_enum
			Default Value: FZ_RADS_SQUALITY_BETTER
		FZ_RADS_PARM_ADAPTIVE_MESH
			Whether or not to do adaptive meshing.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_DENSITY
			Mesh density.
			Type: double
			Default Value: 65.0
			Range: 0.0
		FZ_RADS_PARM_THRESHOLD
			Mesh threshold.
			Type: double
			Default Value: 25.0
			Range: 0.0
		FZ_RADS_PARM_CUTOFF
			Mesh cutoff.
			Type: float
			Default Value: 0.0
			Range: 0.0
		FZ_RADS_PARM_MESH_STOP
			How to stop meshing.
			Type: fz_rads_mesh_stop_enum
			Default Value: FZ_RADS_MESH_STOP_AFTER_LITES
		FZ_RADS_PARM_MESH_STOP_ITER
			Number of iterations at which to stop meshing.
			Type: fzrt_int
			Default Value: 100
			Range: 1
		FZ_RADS_PARM_TERM
			How to stop radiosity solution.
			Type: fz_rads_term_enum
			Default Value: FZ_RADS_TERM_LITE_ABSORB
		FZ_RADS_PARM_TERM_LITE_ABS
			Terminate radiosity solution after this percentage of light is absorbed.
			Type: double
			Default Value: 60.0
			Range: 0.001
		FZ_RADS_PARM_TERM_ITER
			Terminate radiosity solution after this number of iterations has occurred.
			Type: fzrt_int
			Default Value: 500
			Range: 1
		FZ_RADS_PARM_APPLY_REFL_AMBT
			Apply reflected light as ambient.
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_RADS_PARM_PVIEW_UPDATE
			Whether or not to update a preview display during Radiosity.
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_RADS_PARM_PVIEW_TYPE
			How to update the preview Radiosity display.
			Type: fz_rads_pview_update_enum
			Default Value: FZ_RADS_PVIEW_UPDATE_SECS
		FZ_RADS_PARM_PVIEW_SECS
			Number of seconds to wait until update of preview display.
			Type: fzrt_int
			Default Value: 20
			Range: 1
		FZ_RADS_PARM_PVIEW_ITER
			Number of iterations to wait until update of preview display.
			Type: fzrt_int
			Default Value: 10
			Range: 1
		FZ_RADS_PARM_PVIEW_PERCENT
			Percentage of completion to wait until update of preview display.
			Type: float
			Default Value: 5.0
			Range: 0.001
		FZ_RADS_PARM_PVIEW_EACH_LITE
			Whether or not to update preview display after each primary light source.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_RADS_PARM_MODE
			This affects the general algorithms employed to compute Radiosity solution, 
			which also affects what other parameters are available for changing.
			Type: fz_rads_mode_enum
			Default Value: FZ_RADS_MODE_FG_SUPPORT
			Availability: 6.5.0.0

		FZ_RADS_PARM_SIMPLE_QUALITY
			Simple slider to control Radiosity solution's quality.
			Type: float
			Range: 0
			Availability: 6.5.0.0

		FZ_RADS_PARM_ADAPT_QUALITY
			Simple slider to control Radiosity solution's adaptive meshing quality for the 'Render Direct Illumination' mode only.
			Type: float
			Range: 0
			Availability: 6.5.0.0

		FZ_RADS_PARM_USE_BBOX
			Whether or not to use bounding box for Radiosity solution.
			Type: fzrt_boolean
			Default Value: FALSE
			Availability: 6.5.0.0

		FZ_RADS_PARM_TERM_TIME
			Terminate radiosity solution after this length of time (in seconds).
			Type: float
			Default Value: 120
			Range: 0
			Availability: 6.5.0.0


	Availability	5.0.0.0


	See Also
		fz_rads_get_parm, fz_rads_set_parm

 ****************************************************************/
typedef enum fz_rads_parm_enum
{
	FZ_RADS_PARM_PATCHES = 0,
	FZ_RADS_PARM_POLYGONS,
	FZ_RADS_PARM_LITE_MENU,
	FZ_RADS_PARM_SHADOWS_OBSOLETE,
	FZ_RADS_PARM_DIRECT_ILLUM_OBSOLETE,
	FZ_RADS_PARM_AREA_LN_LITE,
	FZ_RADS_PARM_VIEW_DEP,
	FZ_RADS_PARM_RESOLVE_ISECT,
	FZ_RADS_PARM_IGNORE_MESH_ATTR,
	FZ_RADS_PARM_SAMP_MIN,
	FZ_RADS_PARM_SAMP_MAX,
	FZ_RADS_PARM_SAMP_AT_VERT,
	FZ_RADS_PARM_SAMP_AT_CTR,
	FZ_RADS_PARM_SAMP_QUALITY,
	FZ_RADS_PARM_ADAPTIVE_MESH,
	FZ_RADS_PARM_DENSITY,
	FZ_RADS_PARM_THRESHOLD,
	FZ_RADS_PARM_CUTOFF,
	FZ_RADS_PARM_MESH_STOP,
	FZ_RADS_PARM_MESH_STOP_ITER,
	FZ_RADS_PARM_TERM,
	FZ_RADS_PARM_TERM_LITE_ABS,
	FZ_RADS_PARM_TERM_ITER,
	FZ_RADS_PARM_APPLY_REFL_AMBT,
	FZ_RADS_PARM_PVIEW_UPDATE,
	FZ_RADS_PARM_PVIEW_TYPE,
	FZ_RADS_PARM_PVIEW_SECS,
	FZ_RADS_PARM_PVIEW_ITER,
	FZ_RADS_PARM_PVIEW_PERCENT,
	FZ_RADS_PARM_PVIEW_EACH_LITE,
	FZ_RADS_PARM_MODE,
	FZ_RADS_PARM_SIMPLE_QUALITY,
	FZ_RADS_PARM_ADAPT_QUALITY,
	FZ_RADS_PARM_USE_BBOX,
	FZ_RADS_PARM_TERM_TIME,
	FZ_RADS_PARM_MAX
}fz_rads_parm_enum;



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

	fz_rads_get_parm



	Description
		Queries the Radiosity options parameter at the given 
		parameter index.

	Parameters
		windex  [Input]
			project window index
		parm_id  [Input]
			the id of the parameter to retrieve
		data  [Result]
			parameter data

	Returns
		Error codes.


	Availability	5.0.0.0


	See Also
		fz_rads_set_parm, fz_rads_init, fz_rads_generate, fz_rads_exit

 ****************************************************************/
typedef fzrt_error_td  (*fz_rads_get_parm_func)(
	fzrt_int				windex,
	fz_rads_parm_enum	parm_id,
	fz_type_td*			data
	);

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

	fz_rads_set_parm



	Description
		Assigns the parameter of the Radiosity options at the given 
		parameter index.

	Parameters
		windex  [Input]
			project window index
		parm_id  [Input]
			the id of the parameter to change
		data  [Input]
			parameter data

	Returns
		Error codes.


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_rads.fsl

	See Also
		fz_rads_get_parm, fz_rads_init, fz_rads_generate, fz_rads_exit

 ****************************************************************/
typedef fzrt_error_td  (*fz_rads_set_parm_func)(
	fzrt_int				windex,
	fz_rads_parm_enum	parm_id,
	fz_type_td*			data
	);

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

	fz_rads_init



	Description
		Initializes the radiosity solution according to the parameters which have been set. 
		Call this prior to generating a radiosity solution with fz_rads_generate.  This 
		sets up the radiosity solution and does things like meshing the scene.

	Parameters
		windex  [Input]
			project window index

	Returns
		Error codes.


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_rads.fsl

	See Also
		fz_rads_get_parm, fz_rads_set_parm, fz_rads_generate, fz_rads_exit

 ****************************************************************/
typedef fzrt_error_td  (*fz_rads_init_func)(
	fzrt_int				windex
	);

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

	fz_rads_generate



	Description
		Generates the radiosity solution according to the parameters which have been set, and 
		based on the initialization phase.  Call this after initializing the radiosity solution 
		with fz_rads_init.

	Parameters
		windex  [Input]
			project window index

	Returns
		Error codes.


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_rads.fsl

	See Also
		fz_rads_get_parm, fz_rads_set_parm, fz_rads_init, fz_rads_exit

 ****************************************************************/
typedef fzrt_error_td  (*fz_rads_generate_func)(
	fzrt_int				windex
	);

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

	fz_rads_exit



	Description
		Discards the radiosity solution that has been previously generated.  Call this after 
		generating a radiosity solution with fz_rads_generate.

	Parameters
		windex  [Input]
			project window index

	Returns
		Error codes.


	Availability	5.0.0.0


	See Also
		fz_rads_get_parm, fz_rads_set_parm, fz_rads_init, fz_rads_generate

 ****************************************************************/
typedef fzrt_error_td  (*fz_rads_exit_func)(
	fzrt_int				windex
	);



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

	fz_rads_fset


	FZ_RADS_FSET_TYPE
		Radiosity support function set UUID.

	FZ_RADS_FSET_NAME
		Radiosity support function set name

	FZ_RADS_FSET_VERSION
		Radiosity support function set version

	Description
		Radiosity support function set. It contains functions, which may 
		be needed by a plugin or script to control radiosity solutions in formZ.

	Availability	5.0.0.0

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


#define FZ_RADS_FSET_TYPE		"\xb1\x8b\xb4\x21\x05\x3b\x4b\x95\xae\x5c\x89\xc5\x80\xa0\xd2\x6d"

#define FZ_RADS_FSET_NAME		"formZ Radiosity Functions"

#define FZ_RADS_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct fz_rads_fset
{
	fzpl_fset_prvt_data_td				prvt_data;

	fz_rads_get_parm_func				fz_rads_get_parm;
	fz_rads_set_parm_func				fz_rads_set_parm;
	fz_rads_init_func					fz_rads_init;
	fz_rads_generate_func				fz_rads_generate;
	fz_rads_exit_func					fz_rads_exit;
	
	

}	fz_rads_fset;

#ifdef __cplusplus
}
#endif

#endif
