/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_FRND_API_H
#define _FORMZ_MODEL_FRND_API_H

#include "fz_model_core_api.h"


#ifdef __cplusplus
extern "C" {
#endif



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

	Facetted Rounded


	Description
		formZ Model Facetted Rounding
 ****************************************************************/


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

	FZ_OBJT_TYPE_FRND


	Description
		Unique identifier for the Facetted Rounded object type.
 ****************************************************************/


#define FZ_OBJT_TYPE_FRND		"\x64\x89\x12\x96\x0b\x25\x4c\x7d\x9b\xba\x0b\x27\x7a\x5b\x46\xc2"

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

	fz_objt_frnd_opts_ptr


	Description
		Data structure to hold options for the construction of a Facetted Rounded object. 
		This type is used to pass facetted rounding options to the 
		function fz_objt_cnstr_frnd. The individual fields of this type 
		can be accessed and set via fz_objt_frnd_opts_get and 
		fz_objt_frnd_opts_set.

	Availability	5.0.0.0


	See Also
		fz_objt_cnstr_frnd,fz_objt_edit_frnd_plain,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set

 ****************************************************************/
typedef struct frnd_opts_td *fz_objt_frnd_opts_ptr;

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

	fz_objt_frnd_parm_enum


	Description
		Parameter identifiers for a parametric Facetted Rounding options. Used for the 
		"which" argument of fz_objt_frnd_opts_get, fz_objt_frnd_opts_set.

	Members
		FZ_OBJT_FRND_PARM_DO_DISTANCE
			Construction and Editing - Rounding by radius or distance 
			Type: fzrt_boolean
			Default Value: 0
		FZ_OBJT_FRND_PARM_DO_BEVEL
			Construction and Editing - Bevel on/off 
			Type: fzrt_boolean
			Default Value: 0
		FZ_OBJT_FRND_PARM_DO_TRIANG
			Construction and Editing - Triangulate on/off 
			Type: fzrt_boolean
			Default Value: 0
		FZ_OBJT_FRND_PARM_DO_ADJUST
			Construction and Editing - Adjust to fit on/off 
			Type: fzrt_boolean
			Default Value: 0
		FZ_OBJT_FRND_PARM_DO_HIRES
			Construction and Editing - High Density Point Rounding on/off 
			Type: fzrt_boolean
			Default Value: 0

	Availability	5.0.0.0


	See Also
		fz_objt_frnd_opts_get,fz_objt_frnd_opts_set

 ****************************************************************/
typedef enum fz_objt_frnd_parm_enum
{
	
	FZ_OBJT_FRND_PARM_DO_DISTANCE = MODEL_PARM_CSED_START,
	FZ_OBJT_FRND_PARM_DO_BEVEL,
	FZ_OBJT_FRND_PARM_DO_TRIANG,
	FZ_OBJT_FRND_PARM_DO_ADJUST,
	FZ_OBJT_FRND_PARM_DO_HIRES,
	
	MODEL_FRND_MAX
} fz_objt_frnd_parm_enum;


#define FZ_OBJT_FRND__PARM_DO_BEVEL FZ_OBJT_FRND_PARM_DO_BEVEL

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

	fz_objt_frnd_plain_type_enum


	Description
		Plain Facetted Rounding Type ids. This enum is used for the rounding type parameter 
		in the function fz_objt_edit_frnd_plain.

	Members
		FZ_OBJT_FRND_PLAIN_TYPE_VRTX
			Round vertices
		FZ_OBJT_FRND_PLAIN_TYPE_EDGE
			Round edges
		FZ_OBJT_FRND_PLAIN_TYPE_BOTH
			Round edges and vertices

	Availability	5.0.0.0


	See Also
		fz_objt_edit_frnd_plain

 ****************************************************************/
typedef enum fz_objt_frnd_plain_type_enum
{
	FZ_OBJT_FRND_PLAIN_TYPE_VRTX = 0,
	FZ_OBJT_FRND_PLAIN_TYPE_EDGE,
	FZ_OBJT_FRND_PLAIN_TYPE_BOTH
} fz_objt_frnd_plain_type_enum;


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

	fz_objt_frnd_opts_init



	Description
		Allocates Facetted rounding options and fills with defaults

	Parameters
		windex  [Input]
			project window index
		opts  [Result]
			Facetted rounding options

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_finit,fz_objt_frnd_opts_set,fz_objt_frnd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_frnd_opts_init_func) (
	fzrt_int			windex,
	fz_objt_frnd_opts_ptr	*opts
	);

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

	fz_objt_frnd_opts_set



	Description
		Sets the value of a Facetted rounding option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Facetted rounding options
		which  [Input]
			Parameter id
		data  [Input]
			Parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_frnd_opts_set_func) (
	fzrt_int					windex,
	fz_objt_frnd_opts_ptr			opts,
	fz_objt_frnd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_frnd_opts_get



	Description
		Gets the value of a Facetted rounding option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Facetted rounding options
		which  [Input]
			Parameter id
		data  [Result]
			Parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_frnd_opts_get_func) (
	fzrt_int					windex,
	fz_objt_frnd_opts_ptr			opts,
	fz_objt_frnd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_frnd_opts_finit



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

	Parameters
		windex  [Input]
			project window index
		opts  [Input, Result]
			Facetted rounding options

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_set,fz_objt_frnd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_frnd_opts_finit_func) (
	fzrt_int					windex,
	fz_objt_frnd_opts_ptr			*opts
	);
	
/****************************************************************

	fz_objt_cnstr_frnd



	Description
		Creates a Facetted Rounded object from an existing object. 
		The edges to be rounded	are identified by an array of segment indices. 
		Radius and number of sides for each segment is specified in corresponding arrays. 
		The maximum value of number of sides is used for all segments. 
		The points to be rounded are identified by an array of point indices. 
		Radius and number of points for each vertex is specified in corresponding arrays. 
		The resulting object is a controlled object.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source object
		n_edge  [Input]
			Number of edges
		eindex  [Input]
			Array of edge indices
		eradii  [Input]
			Array of edge radii
		esides  [Input]
			Array of edge nsides
		n_vrtx  [Input]
			Number of vertices
		vindex  [Input]
			Array of vertex indices
		vradii  [Input]
			Array of vertex radii
		vsides  [Input]
			Array of vertex nsides
		frnd_opts  [Input]
			Facetted rounding options
		new_obj  [Result]
			New object

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a solid or surface object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_frnd_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int				n_edge,
	fzrt_int				*eindex,
	double				*eradii,
	fzrt_int				*esides,
	fzrt_int				n_vrtx,
	fzrt_int				*vindex,
	double				*vradii,
	fzrt_int				*vsides,
	fz_objt_frnd_opts_ptr		frnd_opts,
	fz_objt_ptr		*new_obj
	);

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

	fz_objt_edit_frnd_parm_get



	Description
		Gets options for a Facetted Rounded object.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source object
		which  [Input]
			Parameter id
		data  [Result]
			Parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_get_func) (
	fzrt_int 					windex,
	fz_objt_ptr			src_obj,
	fz_objt_frnd_parm_enum	which,
	fz_type_td				*data
	);


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

	fz_objt_edit_frnd_parm_set



	Description
		Sets options for a Facetted Rounded object. 
		Note, that the shape of the  Facetted Rounded object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source object
		which  [Input]
			Parameter id
		data  [Input]
			Parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_get,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr			src_obj,
	fz_objt_frnd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_frnd_parm_edge_opts_get



	Description
		Gets edge options for a Facetted Rounded object. 
		This function retrieves the number of edges rounded, an array of edge indices. 
		an array of radii and an array of number of sides for each edge optionally. 
		Typically this function would be called twice successively, the first time to get the 
		number of edges and the second time to get the arrays which are allocated by the user.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Source object
		num  [Result, Optional]
			Number of edges rounded
		index  [Result, Optional]
			Array of edge indices
		radii  [Result, Optional]
			Array of edge radii
		nsids  [Result, Optional]
			Array of edge nsides

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_edge_opts_get_func)(
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					*num,
	fzrt_int					*index,
	double					*radii,
	fzrt_int					*nsids
	);

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

	fz_objt_edit_frnd_parm_edge_opts_set



	Description
		Sets edge options for a Facetted Rounded object. 
		Clears all existing edge rounds before assigning these new edge rounds. 
		Note, that the shape of the  Facetted Rounded object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Source object
		num  [Input]
			Number of edges to be rounded
		index  [Input]
			Array of edge indices
		radii  [Input]
			Array of edge radii
		nsids  [Input]
			Array of edge nsides

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_edge_opts_set_func)(
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					num,
	fzrt_int					*index,
	double					*radii,
	fzrt_int					*nsids
	);

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

	fz_objt_edit_frnd_parm_vrtx_opts_get



	Description
		Gets vertex options for a Facetted Rounded object. 
		This function retrieves the number of vertices rounded, an array of vertex indices. 
		an array of radii and an array of number of sides for each vertex optionally. 
		Typically this function would be called twice successively, the first time to get the 
		number of vertices and the second time to get the arrays which are allocated by the user.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Source object
		num  [Result, Optional]
			Number of vertices rounded
		index  [Result, Optional]
			Array of vertex indices
		radii  [Result, Optional]
			Array of vertex radii
		nsids  [Result, Optional]
			Array of vertex nsides

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_vrtx_opts_get_func)(
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					*num,
	fzrt_int					*index,
	double					*radii,
	fzrt_int					*nsids
	);

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

	fz_objt_edit_frnd_parm_vrtx_opts_set



	Description
		Sets vertex options for a Facetted Rounded object. 
		Clears all existing vertex rounds before assigning these new vertex rounds. 
		Note, that the shape of the  Facetted Rounded object is not changed 
		until the function fz_objt_edit_parm_regen has been called.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Source object
		num  [Input]
			Number of edges to be rounded
		index  [Input]
			Array of edge indices
		radii  [Input]
			Array of edge radii
		nsids  [Input]
			Array of edge nsides

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a Facetted Rounded object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_parm_vrtx_opts_set_func)(
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					num,
	fzrt_int					*index,
	double					*radii,
	fzrt_int					*nsids
	);

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

	fz_objt_edit_frnd_plain



	Description
		Applies Plain Facetted Rounding to input object. 
		The edges to be rounded	are identified by an array of segment indices. 
		The points to be rounded are identified by an array of point indices.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source object
		n_edge  [Input]
			Number of edges
		eindex  [Input]
			Array of edge indices
		n_vrtx  [Input]
			Number of vertices
		vindex  [Input]
			Array of edge indices
		radius  [Input]
			Radius
		nsides  [Input]
			Number of sides/points
		type  [Input]
			Round type
		frnd_opts  [Input]
			Facetted rounding options

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a solid or surface object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_plain_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int				n_edge,
	fzrt_int				*eindex,
	fzrt_int				n_vrtx,
	fzrt_int				*vindex,
	double				radius,
	fzrt_int				nsides,
	fz_objt_frnd_plain_type_enum	type,
	fz_objt_frnd_opts_ptr		frnd_opts
	);

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

	fz_objt_edit_frnd_stitch



	Description
		Applies Facetted Stitch Rounding to input object. 
		The edges to be rounded	are identified by their index.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source object
		seg_indx  [Input]
			Segment index
		radius  [Input]
			Radius

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- object passed in is not a solid or surface object


	Availability	5.0.0.0

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

	See Also
		fz_objt_frnd_opts_init,fz_objt_frnd_opts_finit,fz_objt_frnd_opts_get,fz_objt_frnd_opts_set,fz_objt_cnstr_frnd

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_frnd_stitch_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int 				seg_indx,
	double				radius
	);
#ifdef __cplusplus
}
#endif


#endif
