/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_SRND_API_H
#define _FORMZ_MODEL_SRND_API_H

#ifdef __cplusplus
extern "C" {
#endif



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

	Smooth Rounded


	Description
		formZ Model Smooth Rounding objects. This module contains functions to construct and edit 
		Smooth Rounding objects.
 ****************************************************************/

#include "fz_model_core_api.h"

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

	FZ_OBJT_TYPE_SRND


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

#define FZ_OBJT_TYPE_SRND			"\x98\xcf\x7e\xce\xf1\xcb\x4a\x85\x9f\x73\x69\x10\x57\x49\xc5\xd8"


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

	fz_objt_srnd_opts_ptr


	Description
		Data structure to hold options for the construction of a Smooth Rounded object. 
		The individual fields of this type can be accessed and set via fz_objt_srnd_opts_get and 
		fz_objt_srnd_opts_set.

	Availability	5.0.0.0


	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get, 
		fz_objt_srnd_opts_set,fz_objt_cnstr_srnd,fz_objt_edit_srnd_plain, 
		fz_objt_edit_srnd_stitch,fz_objt_edit_srnd_get_grups,fz_objt_edit_srnd_set_grups

 ****************************************************************/
typedef struct srnd_opts_td *fz_objt_srnd_opts_ptr;

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

	fz_objt_srnd_edge_type_enum


	Description
		Defines the type of Edge in Smooth Rounding options. 
		Used by the paramter id FZ_OBJT_SRND_PARM_EDGE_TYPE in the functions 
		fz_objt_srnd_opts_get, fz_objt_srnd_opts_set.

	Members
		FZ_OBJT_SRND_EDGE_TYPE_NONE
			Edge type None
		FZ_OBJT_SRND_EDGE_TYPE_CIRC
			Edge type Circular
		FZ_OBJT_SRND_EDGE_TYPE_ELPS
			Edge type Elliptical
		FZ_OBJT_SRND_EDGE_TYPE_BVEL
			Edge type Bevel

	Availability	5.0.0.0


	See Also
		fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef enum fz_objt_srnd_edge_type_enum
{
	FZ_OBJT_SRND_EDGE_TYPE_NONE = 0,
	FZ_OBJT_SRND_EDGE_TYPE_CIRC,
	FZ_OBJT_SRND_EDGE_TYPE_ELPS,
	FZ_OBJT_SRND_EDGE_TYPE_BVEL
} fz_objt_srnd_edge_type_enum;

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

	fz_objt_srnd_vrtx_type_enum


	Description
		Defines the type of Vertex in Smooth Rounding options. 
		Used by the paramter id FZ_OBJT_SRND_PARM_VRTX_TYPE in the functions 
		fz_objt_srnd_opts_get, fz_objt_srnd_opts_set.

	Members
		FZ_OBJT_SRND_VRTX_TYPE_NONE
			Vertex type None
		FZ_OBJT_SRND_VRTX_TYPE_CIRC
			Vertex type Circular

	Availability	5.0.0.0


	See Also
		fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef enum fz_objt_srnd_vrtx_type_enum
{
	FZ_OBJT_SRND_VRTX_TYPE_NONE = 0,
	FZ_OBJT_SRND_VRTX_TYPE_CIRC
} fz_objt_srnd_vrtx_type_enum;

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

	fz_objt_srnd_parm_enum


	Description
		Parameter identifiers for a parametric Smooth Rounding options. Used for the 
		"which" argument of fz_objt_srnd_opts_get and fz_objt_srnd_opts_set.

	Members
		FZ_OBJT_SRND_PARM_EDGE_TYPE
			Construction and Editing - Edge Round type.
			Type: fz_objt_srnd_edge_type_enum
			Default Value: FZ_OBJT_SRND_EDGE_TYPE_NONE
		FZ_OBJT_SRND_PARM_EDGE_CIRC_USE_DIST
			Construction and Editing - Use Distance
			Type: fzrt_boolean
			Default Value: False
		FZ_OBJT_SRND_PARM_EDGE_CIRC_DIST
			Construction and Editing - Distance value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_CIRC_RAD_START
			Construction and Editing - Start Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_CIRC_RAD_END
			Construction and Editing - End Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_CIRC_USE_WEIT
			Construction and Editing - Use Weights
			Type: fzrt_boolean
			Default Value: False
		FZ_OBJT_SRND_PARM_EDGE_CIRC_WEIT_LEFT
			Construction and Editing - Left weight value
			Type: double
			Range: 0.0
		FZ_OBJT_SRND_PARM_EDGE_CIRC_WEIT_RITE
			Construction and Editing - Right weight value
			Type: double
			Range: 0.0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_MAJRAD_START
			Construction and Editing - Start Major Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_MAJRAD_END
			Construction and Editing - End Major Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_MINRAD_START
			Construction and Editing - Start Minor Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_MINRAD_END
			Construction and Editing - End Minor Radius value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_ROT_START
			Construction and Editing - Start Rotation angle
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_ROT_END
			Construction and Editing - End Rotation angle
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ELPS_REF_FACE
			Construction and Editing - Refernce Face Left/Right True=Right, False=Left
			Type: fzrt_boolean
			Default Value: False
		FZ_OBJT_SRND_PARM_EDGE_BVEL_LEFT_START
			Construction and Editing - Left Distance start value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_LEFT_END
			Construction and Editing - Left Distance end value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_RITE_START
			Construction and Editing - Right Distance start value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_RITE_END
			Construction and Editing - Right Distance end value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_USE_BULGE
			Construction and Editing - Use Bulge factors
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_BULGE_LEFT
			Construction and Editing - Left bulge value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_BVEL_BULGE_RITE
			Construction and Editing - Right bulge value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_VRTX_TYPE
			Construction and Editing - Vertex Round type.
			Type: fz_objt_srnd_vrtx_type_enum
			Default Value: FZ_OBJT_SRND_VRTX_TYPE_NONE
		FZ_OBJT_SRND_PARM_VRTX_BULGE
			Construction and Editing - bulge value
			Type: double
			Range: 0.0
		FZ_OBJT_SRND_PARM_VRTX_SETBACK
			Construction and Editing - Setback value
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_NUM_EDGE
			Construction and Editing - Number of segments
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_EDGE_ARRAY
			Construction and Editing - Array of segment indices
			Type: long_ptr
		FZ_OBJT_SRND_PARM_NUM_VRTX
			Construction and Editing - Number of segments
			Type: double
			Range: 0
		FZ_OBJT_SRND_PARM_VRTX_ARRAY
			Construction and Editing - Array of segment indices
			Type: long_ptr

	Availability	5.0.0.0


	See Also
		fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef enum fz_objt_srnd_parm_enum
{
	FZ_OBJT_SRND_PARM_EDGE_TYPE = MODEL_PARM_CSED_START,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_USE_DIST,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_DIST,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_RAD_START,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_RAD_END,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_USE_WEIT,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_WEIT_LEFT,
	FZ_OBJT_SRND_PARM_EDGE_CIRC_WEIT_RITE,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_MAJRAD_START,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_MAJRAD_END,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_MINRAD_START,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_MINRAD_END,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_ROT_START,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_ROT_END,
	FZ_OBJT_SRND_PARM_EDGE_ELPS_REF_FACE,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_LEFT_START,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_LEFT_END,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_RITE_START,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_RITE_END,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_USE_BULGE,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_BULGE_LEFT,
	FZ_OBJT_SRND_PARM_EDGE_BVEL_BULGE_RITE,
	FZ_OBJT_SRND_PARM_VRTX_TYPE,
	FZ_OBJT_SRND_PARM_VRTX_BULGE,
	FZ_OBJT_SRND_PARM_VRTX_SETBACK,
	FZ_OBJT_SRND_PARM_NUM_EDGE,
	FZ_OBJT_SRND_PARM_EDGE_ARRAY,
	FZ_OBJT_SRND_PARM_NUM_VRTX,
	FZ_OBJT_SRND_PARM_VRTX_ARRAY,
	
	MODEL_SRND_MAX
} fz_objt_srnd_parm_enum;


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

	fz_objt_srnd_opts_init



	Description
		Allocates Smooth rounding options and fills with defaults

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_finit,fz_objt_srnd_opts_set,fz_objt_srnd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_srnd_opts_init_func) (
	fzrt_int				windex,
	fz_objt_srnd_opts_ptr		*opts
	);

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

	fz_objt_srnd_opts_set



	Description
		Sets the value of a Smooth rounding option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Smooth rounding options
		which  [Input]
			Parameter id (see fz_objt_srnd_parm_enum)
		data  [Input]
			Parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_srnd_opts_set_func) (
	fzrt_int					windex,
	fz_objt_srnd_opts_ptr			opts,
	fz_objt_srnd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_srnd_opts_get



	Description
		Gets the value of a Smooth rounding option.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Smooth rounding options
		which  [Input]
			Parameter id (see fz_objt_srnd_parm_enum)
		data  [Result]
			Parameter data

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_srnd_opts_get_func) (
	fzrt_int					windex,
	fz_objt_srnd_opts_ptr			opts,
	fz_objt_srnd_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_srnd_opts_finit



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

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_srnd_opts_finit_func) (
	fzrt_int				windex,
	fz_objt_srnd_opts_ptr		*opts
	);

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

	fz_objt_cnstr_srnd



	Description
		Creates a Smooth Rounded object from existing object. 
		A set of Smooth Rounding options can be assigned to a group of edges and/or vertices. 
		Multiple groups of edges and/or vertices can be assigned different sets of Smooth 
		Rounding options through an array of such options. 
		The edges to be rounded	for each group are identified by their indices via fz_objt_srnd_opts_ptr. 
		The points to be rounded for each group are identified by their indices via fz_objt_srnd_opts_ptr. 
		The resulting object is a controlled object.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source Object
		n_grup  [Input]
			Number of groups
		srnd_opts  [Input]
			Smooth rounding options	array
		refn_opts  [Input, Optional]
			Display resolution options 
			See fz_attr_refn_parm_enum for defaults
		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_srnd.fsl

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_srnd_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int				n_grup,
	fz_objt_srnd_opts_ptr		*srnd_opts,
	fz_attr_refn_ptr	refn_opts,
	fz_objt_ptr		*obj
	);

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

	fz_objt_edit_srnd_get_grups



	Description
		Gets the Smooth Rounding options for a Smooth Rounded object. 
		The number of groups exisiting and their corresponding Smooth Rounding options are returned. 
		Typically this function would be called twice successively, the first time to get the 
		number of groups and the second time to get the array of Smooth Rounding options 
		which is allocated by the user.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source Object
		n_grup  [Result]
			Number of groups
		srnd_opts  [Result]
			Smooth rounding options array

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_srnd_get_grups_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int				*n_grup,
	fz_objt_srnd_opts_ptr		*srnd_opts
	);

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

	fz_objt_edit_srnd_set_grups



	Description
		Sets the Smooth Rounding options for a Smooth Rounded object. 
		Clears all existing edge and vertex rounds before assigning these new rounding options. 
		Note, that the shape of the  Smooth 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
		n_grup  [Input]
			Number of groups
		srnd_opts  [Input]
			Smooth Rounding options	array

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_srnd_opts_get,fz_objt_srnd_opts_set,fz_objt_cnstr_srnd,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_srnd_set_grups_func) (
	fzrt_int				windex,
	fz_objt_ptr		obj,
	fzrt_int				n_grup,
	fz_objt_srnd_opts_ptr		*srnd_opts
	);

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

	fz_objt_edit_srnd_plain



	Description
		Applies Plain Smooth Rounding to input object. 
		The Smooth Rounding options is assigned to all the edges and/or vertices. 
		The edges to be rounded	are identified by their indices via fz_objt_srnd_opts_ptr. 
		The points to be rounded are identified by their indices via fz_objt_srnd_opts_ptr.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source Object
		srnd_opts  [Input]
			Smooth rounding options
		refn_opts  [Input, Optional]
			Display resolution options 
			See fz_attr_refn_parm_enum for defaults

	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_srnd.fsl

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_srnd_plain_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fz_objt_srnd_opts_ptr		srnd_opts,
	fz_attr_refn_ptr	refn_opts
	);

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

	fz_objt_edit_srnd_stitch



	Description
		Applies Smooth Stitch Rounding to input object. 
		A sequence of edges joining smoothly with a minimum angle of 100 degrees 
		starting with the input edge is first identified and then the input Smooth 
		Rounding options are assigned to them. 
		The following parameter identifiers in fz_objt_srnd_parm_enum do not apply 
		for the smooth rounding options to this function:

		FZ_OBJT_SRND_PARM_NUM_EDGE 
		FZ_OBJT_SRND_PARM_EDGE_ARRAY 
		FZ_OBJT_SRND_PARM_VRTX_TYPE 
		FZ_OBJT_SRND_PARM_VRTX_BULGE 
		FZ_OBJT_SRND_PARM_VRTX_SETBACK 
		FZ_OBJT_SRND_PARM_NUM_VRTX 
		FZ_OBJT_SRND_PARM_VRTX_ARRAY

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			Source Object
		seg_indx  [Input]
			Segment index
		srnd_opts  [Input]
			Smooth rounding options
		refn_opts  [Input, Optional]
			Display resolution options 
			See fz_attr_refn_parm_enum for defaults

	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_srnd.fsl

	See Also
		fz_objt_srnd_opts_init,fz_objt_srnd_opts_finit,fz_objt_srnd_opts_get,fz_objt_srnd_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_srnd_stitch_func) (
	fzrt_int 				windex,
	fz_objt_ptr		src_obj,
	fzrt_int 				seg_indx,
	fz_objt_srnd_opts_ptr		srnd_opts,
	fz_attr_refn_ptr	refn_opts
	);

#ifdef __cplusplus
}
#endif


#endif
