/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_SUBD_API_H
#define _FORMZ_MODEL_SUBD_API_H

#ifdef __cplusplus
extern "C" {
#endif



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

	Subdivision Object


	Description
		formZ Model Subdivision objects
 ****************************************************************/

#include "fz_model_core_api.h"
#include "fzrt_api_type.h"
#include "fz_type_api.h"




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

	FZ_OBJT_TYPE_SUBD


	Description
		Unique identifier for the subdivision object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_SUBD		"\x7f\xce\x9f\x39\x52\xf0\x48\x5f\xbd\x30\xd2\x7a\x25\x4e\x29\xae"



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

	fz_objt_subd_cnstr_opts_ptr


	Description
		data structure to hold options for the construction of a Subdivision object. 
		This type is used to pass additional construction options to the 
		function fz_objt_cnstr_subd. The individual fields of this type 
		can be accessed and set via fz_objt_cnstr_subd_opts_get and 
		fz_objt_cnstr_subd_opts_set.

	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_get_func, fz_objt_cnstr_subd_opts_set_func

 ****************************************************************/
typedef struct	subd_cnstr_opts_td	*fz_objt_subd_cnstr_opts_ptr;


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

	fz_objt_subd_parm_enum


	Description
		Parameter identifiers for a subdivision object. Used for the 
		"which" argument of fz_objt_cnstr_subd_opts_get,fz_objt_cnstr_subd_opts_set, 
		fz_objt_edit_subd_parm_get,fz_objt_edit_subd_parm_set

	Members
		FZ_OBJT_SUBD_PARM_ITERATIONS
			Number of iterations in the subdivision.
			Type: fzrt_int
			Range: 1
			Default Value: 1

	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_get_func, fz_objt_cnstr_subd_opts_set_func, fz_objt_edit_subd_parm_get_func,  
		fz_objt_edit_subd_parm_set_func

 ****************************************************************/
typedef enum fz_objt_subd_parm_enum
{
	FZ_OBJT_SUBD_PARM_ITERATIONS= 0,
	
	
	
	FZ_OBJT_SUBD_PARM_MAX
	
}	fz_objt_subd_parm_enum;



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

	fz_objt_cnstr_subd_opts_init_func



	Description
		Allocates and initializes subdivision construction options. All options 
		are filled with default values.

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_finit,fz_objt_cnstr_subd_opts_get,fz_objt_cnstr_subd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_subd_opts_init_func) (
	fzrt_int				windex,
	fz_objt_subd_cnstr_opts_ptr	*opts
	);

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

	fz_objt_cnstr_subd_opts_get_func



	Description
		Gets the value of subdivision construction option. Note, that 
		only those values in fz_objt_subd_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_subd_parm_enum for details.

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_init,fz_objt_cnstr_subd_opts_finit,fz_objt_cnstr_subd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_subd_opts_get_func) (
	fzrt_int							windex,
	fz_objt_subd_cnstr_opts_ptr		opts,
	fz_objt_subd_parm_enum			which,
	fz_type_td						*data
	);

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

	fz_objt_cnstr_subd_opts_set_func



	Description
		Sets the value of a subdivision option. Note, that 
		only those values in fz_objt_subd_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_subd_parm_enum for details.

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_init,fz_objt_cnstr_subd_opts_finit,fz_objt_cnstr_subd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_subd_opts_set_func) (
	fzrt_int						windex,
	fz_objt_subd_cnstr_opts_ptr	opts,
	fz_objt_subd_parm_enum		which,
	fz_type_td					*data
	);

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

	fz_objt_cnstr_subd_opts_finit_func



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

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_subd_opts_init,fz_objt_cnstr_subd_opts_get,fz_objt_cnstr_subd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_subd_opts_finit_func) (
	fzrt_int				windex,
	fz_objt_subd_cnstr_opts_ptr	*opts
	);



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

	fz_objt_edit_subd_parm_get_func



	Description
		Gets a parameter of a subdivision. Note, that when 
		getting the subdivision object ( which == FZ_OBJT_SUBD_OBJ), 
		this function will create a new object in windex, and 
		copy the content of the subdivision  object into that new 
		object. It is the responsibility of the calling function 
		to delete this new object afterwards, using fz_objt_edit_delete_objt.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			stair from path object
		which  [Input]
			parameter identifier
		data  [Result]
			parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not subdivision


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_subd_parm_set,fz_objt_cnstr_subd,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_subd_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_subd_parm_enum	which,
	fz_type_td				*data
	);
											
/****************************************************************

	fz_objt_edit_subd_parm_set_func



	Description
		Sets a parameter of a subdivision. 
		When setting a new path object (which == FZ_OBJT_SUBD_OBJ), 
		the content of the object passed in is copied into the 
		object maintained with the subdivision. The same restrictions apply 
		for this object as for the one used to construct the subdivision initially 
		Note, that the shape of the stair from path is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			stair from path object
		which  [Input]
			parameter identifier
		data  [Input]
			parameter data

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_subd_parm_get,fz_objt_cnstr_subd,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_subd_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_subd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_subd_parm_get_mesh



	Description
		Sets the value of a subdivision option. Note, that 
		only those values in fz_objt_subd_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_subd_parm_enum for details.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			subd object
		interations  [Result, Optional]
			subd interations
		mesh_obj  [Result, Optional]
			mesh object (trinags/quads)
		mesh_obj_edge_sharp  [Result, Optional]
			mesh edge shapness (parallel to segt)
		mesh_obj_cord_sharp  [Result, Optional]
			mesh cord shapness	(parallel to cord)

	Returns
		Error codes


	Availability	8.5.4.0

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

	See Also
		fz_objt_cnstr_subd_opts_init,fz_objt_cnstr_subd_opts_finit,fz_objt_cnstr_subd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_subd_parm_get_mesh_func) (
	fzrt_int						windex,
	fz_objt_ptr						obj,
	fzrt_int						*interations,
	fz_objt_ptr						*mesh_obj,
	float							**mesh_obj_edge_sharp,
	float							**mesh_obj_cord_sharp
);


#ifdef __cplusplus
}

#endif

#endif
