/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_QSUB_API_H
#define _FORMZ_MODEL_QSUB_API_H

#ifdef __cplusplus
extern "C" {
#endif



#include "fz_model_core_api.h"



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

	FZ_OBJT_TYPE_QSUB


	Description
		Unique identifier for the qsubz object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_QSUB		"\x2e\x68\x42\x6b\x4c\xed\x47\x3a\x89\xaf\x6a\x0d\x26\x62\xca\xa4"

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

	fz_objt_qsub_edit_opts_ptr


	Description
		Data structure to hold options for construction and editing of qsubz objects. 
		This type is used to pass additional construction options to the function fz_objt_edit_qsub. 
		The individual fields of this type can be accessed and set via fz_objt_edit_qsub_opts_get and 
		fz_objt_edit_qsub_opts_set.

	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub, fz_objt_edit_qsub_opts_get, fz_objt_edit_qsub_opts_set

 ****************************************************************/
typedef struct qsubz_edit_opts_td	*fz_objt_qsub_edit_opts_ptr;

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

	fz_objt_qsub_parm_enum


	Description
		Parameter identifiers for a parametric qsubz object. 
		Used for the "which" argument of fz_objt_edit_qsub_parm_get, fz_objt_edit_qsub_parm_set, 
		model_cnstr_qsub_opts_get and model_cnstr_qsub_opts_set. 
		The FZ_OBJT_QSUB_PARM_N_FACE_LIST and FZ_OBJT_QSUB_PARM_FACE_LIST parameters can be used to get 
		and set the faces of the original control object which are to be affected by the qsubz operation. 
		When reading the faces, an array of longs must be preallocated to be at least "nfaces" fzrt_int. 
		The array pointer is set in the data argument of fz_objt_edit_qsub_parm_get. 
		Setting the faces is done exactly the same way. 
		That is, an array of nfaces items must be allocated and filled with the indices of the faces. 
		The array pointer is set in the data argument for fz_objt_edit_qsub_parm_set. 
		Note, that it is necessary to set the number of faces first before setting the face list itself.

	Members
		FZ_OBJT_QSUB_PARM_DO_SMOOTH
			Construction and Editing - qsubz smoothing on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_QSUB_PARM_DO_SEG_LENGTH
			Construction and Editing - qsubz use segment length for subdivision on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_QSUB_PARM_DO_FACE_ANGLE
			Construction and Editing - qsubz use face angle for subdivision on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_QSUB_PARM_TRIANG
			Construction and Editing - qsubz triangulation on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_QSUB_PARM_CURVATURE
			Construction and Editing - qsubz curvature.
			Type: double
			Range: 0.0
			Default Value: 0.5
		FZ_OBJT_QSUB_PARM_SEG_LENGTH
			Construction and Editing - qsubz max segment length.
			Type: double
			Range: 0.0
			Default Value: English 24.0 in, Metric 50.0 cm

		FZ_OBJT_QSUB_PARM_FACE_ANGLE
			Construction and Editing - qsubz max face angle.
			Type: double
			Range: 0.0
			Default Value: PI/18.0 (10.0 degrees in radians)
		FZ_OBJT_QSUB_PARM_N_SUBDIV
			Editing - qsubz max number of subdivision.
			Type: fzrt_int
			Range: 1
		FZ_OBJT_QSUB_PARM_N_FACE_LIST
			Editing - Number of faces tagged as smooth.
			Type: fzrt_int
			Range: 1
		FZ_OBJT_QSUB_PARM_FACE_LIST
			Editing - Array with indices of faces tagged as smooth.
			Type: fzrt_int*

	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub_opts_get, fz_objt_edit_qsub_opts_set, fz_objt_edit_qsub_parm_get,  
		fz_objt_edit_qsub_parm_set

 ****************************************************************/
typedef enum fz_objt_qsub_parm_enum
{
	
	FZ_OBJT_QSUB_PARM_DO_SMOOTH = 0,

	FZ_OBJT_QSUB_PARM_DO_SEG_LENGTH,
																	
	FZ_OBJT_QSUB_PARM_DO_FACE_ANGLE,
																	
	FZ_OBJT_QSUB_PARM_TRIANG,
																	
	FZ_OBJT_QSUB_PARM_CURVATURE,
																	
	FZ_OBJT_QSUB_PARM_SEG_LENGTH,
																	
	FZ_OBJT_QSUB_PARM_FACE_ANGLE,
	
	
	FZ_OBJT_QSUB_PARM_N_SUBDIV,
																	
	FZ_OBJT_QSUB_PARM_N_FACE_LIST,
																	
	FZ_OBJT_QSUB_PARM_FACE_LIST,
	
	MODEL_QSUB_PARM_MAX
	
} fz_objt_qsub_parm_enum;

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

	fz_objt_edit_qsub_opts_init



	Description
		Allocates qsubz options and fills then with defaults.

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub_opts_finit,fz_objt_edit_qsub_opts_get,fz_objt_edit_qsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_opts_init_func) (
	fzrt_int					windex,
	fz_objt_qsub_edit_opts_ptr		*opts
	);

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

	fz_objt_edit_qsub_opts_get



	Description
		Gets a qsubz 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_qsub.fsl

	See Also
		fz_objt_edit_qsub_opts_init,fz_objt_edit_qsub_opts_finit,fz_objt_edit_qsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_opts_get_func) (
	fzrt_int					windex,
	fz_objt_qsub_edit_opts_ptr		opts,
	fz_objt_qsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_qsub_opts_set



	Description
		Sets a qsubz 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_qsub.fsl

	See Also
		fz_objt_edit_qsub_opts_init,fz_objt_edit_qsub_opts_finit,fz_objt_edit_qsub_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_opts_set_func) (
	fzrt_int					windex,
	fz_objt_qsub_edit_opts_ptr		opts,
	fz_objt_qsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_qsub_opts_finit



	Description
		Frees qsubz 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_qsub.fsl

	See Also
		fz_objt_edit_qsub_opts_init,fz_objt_edit_qsub_opts_get,fz_objt_edit_qsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_opts_finit_func) (
	fzrt_int					windex,
	fz_objt_qsub_edit_opts_ptr		*opts
	);

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

	fz_objt_edit_qsub



	Description
		Creates quadrangular subdivisions on an object. 
		Optionally, only selected faces can be subdivided. 
		This is specified through the face_list array, which 
		contains the indices of the faces to be subdivided. 
		If face_list is NULL, the whole object is subdivided.

	Parameters
		windex  [Input]
			project window index
		obj  [Input, Result]
			object
		max_level  [Input]
			maximum number of subdivisions levels per face. 
			Note, that each level increases the number of faces 
			exponentially. Values above 10 are rarely meaningful.
			Range: 1
		face_list  [Input, Optional]
			list of faces to subdivide
		n_face_list  [Input, Optional]
			number of faces in list
		opts  [Input, Optional]
			edit options

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub_opts_init,fz_objt_edit_qsub_opts_finit, 
		fz_objt_edit_qsub_opts_get,fz_objt_edit_qsub_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					max_level,
	fzrt_int					*face_list,
	fzrt_int					n_face_list,
	fz_objt_qsub_edit_opts_ptr		opts
	);


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

	fz_objt_edit_qsub_parm_get



	Description
		Gets a parameter of a qsubz object.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub_parm_set,fz_objt_edit_qsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_qsub_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_qsub_parm_set



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

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_qsub_parm_get,fz_objt_edit_qsub, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_qsub_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_qsub_parm_enum	which,
	fz_type_td				*data
	);

#ifdef __cplusplus
}
#endif

#endif
