/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_MODEL_TSUB_API_H
#define _FORMZ_MODEL_TSUB_API_H

#ifdef __cplusplus
extern "C" {
#endif



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

	T-Subz


	Description
		formZ Model T-Subz objects. This module contains functions to construct and edit 
		T-Subz objects.
 ****************************************************************/

#include "fz_model_core_api.h"



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

	FZ_OBJT_TYPE_TSUB


	Description
		Unique identifier for the T-Subz object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_TSUB		"\x0a\xc5\xa8\xda\x66\x69\x45\x47\xb2\x85\x1a\x04\x9e\xe8\x22\x6c"

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

	fz_objt_tsub_edit_opts_ptr


	Description
		Data structure to hold options for construction and editing of tsubz objects. 
		This type is used to pass additional construction options to the function fz_objt_edit_tsub. 
		The individual fields of this type can be accessed and set via fz_objt_edit_tsub_opts_get and 
		fz_objt_edit_tsub_opts_set.

	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub, fz_objt_edit_tsub_opts_get, fz_objt_edit_tsub_opts_set

 ****************************************************************/
typedef struct tsubz_edit_opts_td	*fz_objt_tsub_edit_opts_ptr;

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

	fz_objt_tsub_bnd_type_enum


	Description
		Identifiers for a the boundary type of a tsubz object.

	Availability	5.5.0.0

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

	See Also
		fz_objt_tsub_parm_enum

 ****************************************************************/
typedef enum fz_objt_tsub_bnd_type_enum
{	FZ_OBJT_TSUB_BND_TYPE_NATURAL = 0,
	FZ_OBJT_TSUB_BND_TYPE_CUBIC,
	FZ_OBJT_TSUB_BND_TYPE_LINEAR,

	MODEL_EDIT_TSUBZ_BND_TYPE_MAX
} fz_objt_tsub_bnd_type_enum;

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

	fz_objt_tsub_parm_enum


	Description
		Parameter identifiers for a parametric tsubz object. 
		Used for the "which" argument of fz_objt_edit_tsub_parm_get, fz_objt_edit_tsub_parm_set, 
		fz_objt_edit_tsub_opts_get and fz_objt_edit_tsub_opts_set.

	Members
		FZ_OBJT_TSUB_PARM_SMOOTH_OUT
			Construction and Editing - tsubz smoothing on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_DO_SEG_LENGTH
			Construction and Editing - tsubz use segment length for subdivision on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_DO_FACE_ANGLE
			Construction and Editing - tsubz use face angle for subdivision on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_DO_FACE_AREA
			Construction and Editing - tsubz use face angle for subdivision on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_SEG_LENGTH
			Construction and Editing - tsubz max segment length.
			Type: double
			Range: 0.0
			Default Value: English 24.0 in, Metric 50.0 cm

		FZ_OBJT_TSUB_PARM_FACE_ANGLE
			Construction and Editing - tsubz max face angle.
			Type: double
			Range: 0.0
			Default Value: PI/18.0 (10.0 degrees in radians)
		FZ_OBJT_TSUB_PARM_FACE_AREA
			Construction and Editing - tsubz max segment length.
			Type: double
			Range: 0.0
			Default Value: English 24.0 in, Metric 50.0 cm

		FZ_OBJT_TSUB_PARM_TRIANG
			Construction and Editing - tsubz triangulate by center on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_LIMIT
			Construction and Editing - tsubz limit to surface on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_TSUB_PARM_BND_TYPE
			Construction and Editing - tsubz boundary type 0=natural,1=cubic,2=linear.
			Type: fz_objt_tsub_bnd_type_enum
			Range: FZ_OBJT_TSUB_BND_TYPE_NATURAL
			Default Value: FZ_OBJT_TSUB_BND_TYPE_NATURAL

	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_get, fz_objt_edit_tsub_opts_set, fz_objt_edit_tsub_parm_get,  
		fz_objt_edit_tsub_parm_set

 ****************************************************************/
typedef enum fz_objt_tsub_parm_enum
{	FZ_OBJT_TSUB_PARM_SMOOTH_OUT = 0,

	FZ_OBJT_TSUB_PARM_DO_SEG_LENGTH,
											
	FZ_OBJT_TSUB_PARM_DO_FACE_ANGLE,
	FZ_OBJT_TSUB_PARM_DO_FACE_AREA,
	FZ_OBJT_TSUB_PARM_SEG_LENGTH,
	FZ_OBJT_TSUB_PARM_FACE_ANGLE,
	FZ_OBJT_TSUB_PARM_FACE_AREA,
	FZ_OBJT_TSUB_PARM_TRIANG,
	FZ_OBJT_TSUB_PARM_LIMIT,
	FZ_OBJT_TSUB_PARM_BND_TYPE,

	MODEL_TSUB_PARM_MAX
} fz_objt_tsub_parm_enum;



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

	fz_objt_edit_tsub_opts_init



	Description
		Allocates tsubz options and fills with defaults

	Parameters
		windex  [Input]
			project window index
		opts  [Result]
			edit options

	Returns
		Error codes:  
		FZRT_MALLOC_ERROR						out of memory  
		FZRT_BAD_PARAM_ERROR				bad parameter


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_finit,fz_objt_edit_tsub_opts_get,fz_objt_edit_tsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_opts_init_func) (
	fzrt_int				windex,
	fz_objt_tsub_edit_opts_ptr	*opts
	);

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

	fz_objt_edit_tsub_opts_get



	Description
		Gets a tsubz option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			edit options
		which  [Input]
			parameter identifier
		data  [Result]
			parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_init,fz_objt_edit_tsub_opts_finit,fz_objt_edit_tsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_opts_get_func) (
	fzrt_int					windex,
	fz_objt_tsub_edit_opts_ptr		opts,
	fz_objt_tsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_tsub_opts_set



	Description
		Sets a tsubz option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			edit options
		which  [Input]
			parameter identifier
		data  [Input]
			parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_init,fz_objt_edit_tsub_opts_finit,fz_objt_edit_tsub_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_opts_set_func) (
	fzrt_int					windex,
	fz_objt_tsub_edit_opts_ptr		opts,
	fz_objt_tsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_tsub_opts_finit



	Description
		Frees tsubz options. 
		The opts pointer is deallocated and returned back as NULL.

	Parameters
		windex  [Input]
			project window index
		opts  [Input, Result]
			edit options (will become NULL)

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_init,fz_objt_edit_tsub_opts_get,fz_objt_edit_tsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_opts_finit_func) (
	fzrt_int				windex,
	fz_objt_tsub_edit_opts_ptr	*opts
	);

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

	fz_objt_edit_tsub



	Description
		Creates triangular subdivisions on an object.

	Parameters
		windex  [Input]
			project window index
		obj  [Input, Result]
			object
		max_level  [Input]
			maximum number of subdivisions 
			levels per face.
		curvature  [Input]
			curvature
		opts  [Input, Optional]
			edit options

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_opts_init,fz_objt_edit_tsub_opts_finit, 
		fz_objt_edit_tsub_opts_get,fz_objt_edit_tsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					max_level,
	double					curvature,
	fz_objt_tsub_edit_opts_ptr		opts
	);

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

	fz_objt_edit_tsub_parm_get



	Description
		Gets a parameter of a tsubz object.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			tsubz object
		which  [Input]
			parameter identifier
		data  [Result]
			parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_set,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_tsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_tsub_parm_set



	Description
		Sets a parameter of a tsubz object. 
		Note, that the shape of the tsubz object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			tsubz object
		which  [Input]
			parameter identifier
		data  [Input]
			parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_get,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_tsub_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_tsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_tsub_parm_vrtx_set



	Description
		Sets the curvature control of ith point in the source object of a tsubz object. 
		Note, that the shape of the tsubz object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project
		obj  [Input]
			tsubz object
		i  [Input]
			vertex index
		wt  [Input, Optional]
			weight
		pt  [Input, Optional]
			control point

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_get,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	(*fz_objt_edit_tsub_parm_vrtx_set_func)(
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fzrt_int					i,
	double 					wt,
	fz_xyz_td 				*pt
	);

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

	fz_objt_edit_tsub_parm_vrtx_get



	Description
		Gets the curvature control of ith point in the source object of a tsubz object. 
		Note, that the shape of the tsubz object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project
		obj  [Input]
			tsubz object
		i  [Input]
			vertex index
		wt  [Result, Optional]
			weight
		pt  [Result, Optional]
			control point

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_get,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	(*fz_objt_edit_tsub_parm_vrtx_get_func)(
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fzrt_int					i,
	double 					*wt,
	fz_xyz_td 				*pt
	);

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

	fz_objt_edit_tsub_parm_edge_set



	Description
		Sets the curvature control of ith edge in the source object of a tsubz object. 
		Note, that the shape of the tsubz object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project
		obj  [Input]
			tsubz object
		i  [Input]
			vertex index
		wt  [Input]
			weight

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_get,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	(*fz_objt_edit_tsub_parm_edge_set_func)(
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fzrt_int					i,
	double 					wt
	);

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

	fz_objt_edit_tsub_parm_edge_get



	Description
		Gets the curvature control of ith edge in the source object of a tsubz object. 
		Note, that the shape of the tsubz object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project
		obj  [Input]
			tsubz object
		i  [Input]
			vertex index
		wt  [Result]
			weight

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a tsubz object


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_tsub_parm_get,fz_objt_edit_tsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	(*fz_objt_edit_tsub_parm_edge_get_func)(
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fzrt_int					i,
	double 					*wt
	);
#ifdef __cplusplus
}
#endif


#endif
