/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_BEND_API_H
#define _FORMZ_MODEL_BEND_API_H

#include "fz_model_core_api.h"

#ifdef __cplusplus
extern "C" {
#endif


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

	Bend Curve


	Description
		This module contains functions to construct Bend objects in formZ.
 ****************************************************************/

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

	FZ_OBJT_TYPE_BEND


	Description
		Unique identifier for the Bend object type.
 ****************************************************************/

#define FZ_OBJT_TYPE_BEND	"\x84\x3e\x31\xab\xc6\x65\x4c\x92\x96\xb4\x88\xd2\x0a\x88\xfc\xe3"

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

	fz_objt_bend_cnstr_opts_ptr


	Description
		Data structure to hold options for the construction of a Bend object. 
		This type is used to pass additional construction options to the functions 
		fz_objt_cnstr_bend. The individual fields of this type 
		can be accessed and set via fz_objt_cnstr_bend_opts_get and 
		fz_objt_cnstr_bend_opts_set.

	Availability	5.5.0.0


	See Also
		fz_objt_cnstr_bend_opts_get,fz_objt_cnstr_bend_opts_set,fz_objt_cnstr_bend

 ****************************************************************/
typedef struct	bend_cnstr_opts_td	*fz_objt_bend_cnstr_opts_ptr;

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

	fz_objt_bend_parm_enum


	Description
		Parameter identifiers for a parametric bend object. Used for the 
		"which" argument of fz_objt_edit_bend_parm_get, fz_objt_edit_bend_parm_set, 
		fz_objt_cnstr_bend_opts_get and fz_objt_cnstr_bend_opts_set. 
		After creating a bend object, the source and curve objects can be 
		replaced by passing in a new object using the fz_objt_edit_bend_parm_set 
		API function. Note, that the same restrictions apply for the new objects 
		as for the ones used to construct the bend object initially. When getting 
		the source or curve objects from an existing bend object via fz_objt_edit_bend_parm_get, 
		a copy of the source or curve is made and passed back. It is the responsibility 
		of the calling function to delete this new object afterwards, using fz_objt_edit_delete_objt.

	Members
		FZ_OBJT_BEND_PARM_ROT
			Construction and Editing - rotation of alignment axis.
			Type: double
			Default Value: 0
		FZ_OBJT_BEND_PARM_BEG
			Construction and Editing - Start point along curve.
			Type: double
			Default Value: 0
		FZ_OBJT_BEND_PARM_END
			Construction and Editing - End point along curve.
			Type: double
			Default Value: 1
		FZ_OBJT_BEND_PARM_JOIN_COPLANAR
			Construction and Editing - Join coplanar faces. 
			Applicable only for model type Facetted.
			Type: fz_boolean
			Default Value: FALSE
		FZ_OBJT_BEND_PARM_TRIANGULATE
			Construction and Editing - Triangulate nonplanar faces. 
			Applicable only for model type Facetted.
			Type: fz_boolean
			Default Value: FALSE
		FZ_OBJT_BEND_PARM_MODEL_TYPE
			Editing - Model type.
			Type: fz_objt_model_type_enum
		FZ_OBJT_BEND_PARM_SCL_TYPE
			Construction and Editing - Scaling type.
			Type: fz_objt_bend_scale_enum
			Default Value: FZ_OBJT_BEND_SCL_NATURAL
		FZ_OBJT_BEND_PARM_SRC_OBJ
			Editing - Bend source object.
			Type: fz_objt_ptr
		FZ_OBJT_BEND_PARM_CRV_OBJ
			Editing - Bend curve object.
			Type: fz_objt_ptr
		FZ_OBJT_BEND_PARM_KEEP_FACES
			Construction and Editing - Keep original faces (i.e. Do not add faces. 
			Applicable only for model type Facetted.
			Type: fz_boolean
			Default Value: FALSE

	Availability	5.5.0.0


	See Also
		fz_objt_edit_bend_parm_get,fz_objt_edit_bend_parm_set, 
		fz_objt_cnstr_bend_opts_get,fz_objt_cnstr_bend_opts_set

 ****************************************************************/
typedef enum fz_objt_bend_parm_enum
{
	
	FZ_OBJT_BEND_PARM_ROT = MODEL_PARM_CSED_START,

	FZ_OBJT_BEND_PARM_BEG,

	FZ_OBJT_BEND_PARM_END,
	FZ_OBJT_BEND_PARM_JOIN_COPLANAR,
	FZ_OBJT_BEND_PARM_TRIANGULATE,

	
	FZ_OBJT_BEND_PARM_MODEL_TYPE = MODEL_PARM_EDIT_START,
	FZ_OBJT_BEND_PARM_SCL_TYPE,
	FZ_OBJT_BEND_PARM_SRC_OBJ,
	FZ_OBJT_BEND_PARM_CRV_OBJ,
	FZ_OBJT_BEND_PARM_KEEP_FACES,
	FZ_OBJT_BEND_PARM_MAX
	
} fz_objt_bend_parm_enum;


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

	fz_objt_bend_scale_enum


	Description
		Indicates the scaling type of a parametric Bend object. This enum 
		is used in the parameter FZ_OBJT_BEND_PARM_SCL_TYPE in the 
		functions fz_objt_edit_bend_parm_get and fz_objt_cnstr_bend_opts_set.

	Members
		FZ_OBJT_BEND_SCL_NATURAL
			Bend Scaling is Natural
		FZ_OBJT_BEND_SCL_PROPORTION
			Bend Scaling is Preserve Proportion
		FZ_OBJT_BEND_SCL_SIZE
			Bend Scaling is Preserve Size

	Availability	5.5.0.0


	See Also
		fz_objt_edit_bend_parm_get, fz_objt_cnstr_bend_opts_set

 ****************************************************************/
typedef enum fz_objt_bend_scale_enum
{
	FZ_OBJT_BEND_SCL_NATURAL = 0,
	FZ_OBJT_BEND_SCL_PROPORTION,
	FZ_OBJT_BEND_SCL_SIZE
	
} fz_objt_bend_scale_enum;

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

	fz_objt_cnstr_bend_opts_init



	Description
		Allocates Bend construction options and fills with defaults

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

	Returns
		Error codes


	Availability	5.5.0.0

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

	See Also
		fz_objt_edit_bend_parm_set,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_bend_opts_init_func)(
	fzrt_int						windex,
	fz_objt_bend_cnstr_opts_ptr	*opts
	);

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

	fz_objt_cnstr_bend_opts_get



	Description
		Gets the value of a Bend object's construction option. Note, that 
		only those values in fz_objt_bend_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_bend_parm_enum for details.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Bend construction options
		which  [Input]
			Parameter id
		data  [Result]
			Parameter data

	Returns
		Error codes


	Availability	5.5.0.0

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

	See Also
		fz_objt_cnstr_bend_opts_init,fz_objt_cnstr_bend_opts_finit,fz_objt_cnstr_bend_opts_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_bend_opts_get_func)(
	fzrt_int							windex,
	fz_objt_bend_cnstr_opts_ptr		opts,
	fz_objt_bend_parm_enum			which,
	fz_type_td						*data
	);

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

	fz_objt_cnstr_bend_opts_set



	Description
		Sets the value of a Bend object's construction option. Note, that 
		only those values in fz_objt_bend_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_bend_parm_enum for details.

	Parameters
		windex  [Input]
			project window index
		opts  [Input]
			Bend construction options
		which  [Input]
			Parameter id
		data  [Input]
			Parameter data

	Returns
		Error codes


	Availability	5.5.0.0

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

	See Also
		fz_objt_cnstr_bend_opts_init,fz_objt_cnstr_bend_opts_finit,fz_objt_cnstr_bend_opts_get

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_bend_opts_set_func)(
	fzrt_int							windex,
	fz_objt_bend_cnstr_opts_ptr		opts,
	fz_objt_bend_parm_enum			which,
	fz_type_td						*data
	);

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

	fz_objt_cnstr_bend_opts_finit



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

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

	Returns
		Error codes


	Availability	5.5.0.0

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

	See Also
		fz_objt_cnstr_bend_opts_init,fz_objt_cnstr_bend_opts_get,fz_objt_cnstr_bend_opts_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_bend_opts_finit_func)(
	fzrt_int						windex,
	fz_objt_bend_cnstr_opts_ptr	*opts
	);

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

	fz_objt_cnstr_bend



	Description
		Creates a Bend object by curve. 
		This function constructs a Smooth object by sweeping the source object 
		along the path object while offsetting the source by an amount specified by 
		the given curve object.

	Parameters
		windex  [Input]
			Project window index
		src_obj  [Input]
			Source object
		crv_obj  [Input]
			Curve object
		axis_p1  [Input]
			Axis start point
		axis_p2  [Input]
			Axis end point
		align_vec  [Input]
			Alignment axis vector
		scale_type  [Input]
			Scaling Type
		model_type  [Input]
			Model Type
		bend_opts  [Input, Optional]
			Bend construction options
		refn_opts  [Input, Optional]
			Display resolution
		obj  [Result]
			New object

	Returns
		Error codes


	Availability	5.5.0.0

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

	See Also
		fz_objt_cnstr_bend_opts_init,fz_objt_cnstr_bend_opts_get,fz_objt_cnstr_bend_opts_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_bend_func)(
	fzrt_int						windex,
	fz_objt_ptr					src_obj,
	fz_objt_ptr					crv_obj,
	fz_xyz_td*					axis_p1,
	fz_xyz_td*					axis_p2,
	fz_xyz_td*					align_vec,
	fz_objt_bend_scale_enum		scale_type,
	fz_objt_model_type_enum		model_type,
	fz_objt_bend_cnstr_opts_ptr	bend_opts,
	fz_attr_refn_ptr			refn_opts,
	fz_objt_ptr*				obj
	);

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

	fz_objt_edit_bend_parm_get



	Description
		Gets a parameter of a Bend object.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Bend construction options
		which  [Input]
			Parameter id
		data  [Result]
			Parameter data

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


	Availability	5.5.0.0

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

	See Also
		fz_objt_edit_bend_parm_set,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_bend_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_bend_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_bend_parm_set



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

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			Bend construction options
		which  [Input]
			Parameter id
		data  [Input]
			Parameter data

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


	Availability	5.5.0.0

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

	See Also
		fz_objt_edit_bend_parm_get,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_bend_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_bend_parm_enum	which,
	fz_type_td				*data
	);

#ifdef __cplusplus
}
#endif

#endif
