/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_HELX_API_H
#define _FORMZ_MODEL_HELX_API_H


#include "fz_model_core_api.h"

#ifdef __cplusplus
extern "C" {
#endif



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

	Helix


	Description
		formZ Model Helix objects.
 ****************************************************************/

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

	FZ_OBJT_TYPE_HELIX


	Description
		Unique identifier for the helix object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_HELIX		"\x8c\x8c\x76\x0c\x9a\x70\x4c\xd6\x9e\x6f\xf4\x91\xa0\x14\x1d\xd5"


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

	fz_objt_helix_cnstr_opts_ptr


	Description
		Data structure to hold options for the construction of a helix object. 
		This type is used to pass additional options to the 
		function fz_objt_cnstr_helix_from_src,fz_objt_cnstr_helix_around_axis 
		and fz_objt_cnstr_helix_around_wire. The individual fields of this type 
		can be accessed and set via fz_objt_cnstr_helix_opts_get and 
		fz_objt_cnstr_helix_opts_set.

	Availability	5.0.0.0


	See Also
		fz_objt_cnstr_helix_around_axis, fz_objt_cnstr_helix_around_wire, fz_objt_cnstr_helix_from_src,  
		fz_objt_cnstr_helix_opts_get, fz_objt_cnstr_helix_opts_set

 ****************************************************************/
typedef struct	helx_cnstr_opts_td	*fz_objt_helix_cnstr_opts_ptr;

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

	fz_objt_helix_type_enum


	Description
		Indicates what type of helix a parameteric helix object is. This enum 
		is used in the read only parameter FZ_OBJT_HELIX_PARM_TYPE in the 
		function fz_objt_edit_helix_parm_get.

	Members
		FZ_OBJT_HELIX_TYPE_SOLID
			solid/surface helix
		FZ_OBJT_HELIX_TYPE_WIRE_AXIS
			wire helix around an axis
		FZ_OBJT_HELIX_TYPE_WIRE_PATH
			wire helix around a path

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_objt_helix_type_enum
{
	FZ_OBJT_HELIX_TYPE_SOLID = 0,
	FZ_OBJT_HELIX_TYPE_WIRE_AXIS,
	FZ_OBJT_HELIX_TYPE_WIRE_PATH
	
} fz_objt_helix_type_enum;

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

	fz_objt_helix_parm_enum


	Description
		Parameter identifiers for a parametric helix object. Used for the 
		"which" argument of fz_objt_edit_helix_parm_get, fz_objt_edit_helix_parm_set, 
		fz_objt_cnstr_helix_opts_get and fz_objt_cnstr_helix_opts_set.

	Members
		FZ_OBJT_HELIX_PARM_CAP_START
			Construction and Editing - Start cap on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_HELIX_PARM_CAP_END
			Construction and Editing - End cap on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: TRUE
		FZ_OBJT_HELIX_PARM_FACT_TRIANG
			Construction and Editing - Triangulate on (TRUE) or off (FALSE) for facetted objects.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_PATH_SCL_ON
			Construction and Editing - Scale path on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_PATH_SCL
			Construction and Editing - Path scale factor. The x field identifies 
			the path width scale factor. The y field stands for the path 
			length scale factor.
			Type: fz_xy_td
			Default Value: {1.0,1.0}
			Range: 0.0
		FZ_OBJT_HELIX_PARM_SRC_SCL_ON
			Construction and Editing - Scale source on/off.
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_SRC_SCL
			Construction and Editing - Source scale factor.
			Type: fz_xy_td
			Default Value: {1.0,1.0}
			Range: 0.0
		FZ_OBJT_HELIX_PARM_SRC_ROT_ON
			Construction and Editing - Rotate source on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_ROT_1STPT_ON
			Construction and Editing - Rotate source around first point on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_SRC_ROT
			Construction and Editing - Source rotation angle.
			Type: double
			Default Value: 0.0
		FZ_OBJT_HELIX_PARM_CLOCKWISE
			Construction and Editing - Helix direction clockwise on (TRUE) or off (FALSE).
			Type: fzrt_boolean
			Default Value: FALSE
		FZ_OBJT_HELIX_PARM_FACT_STEPS
			Construction and Editing - Number of total steps for facetted objects.
			Type: fzrt_int
			Default Value: 72
			Range: (3 * num_cycles)
		FZ_OBJT_HELIX_PARM_NRBZ_DEG_U
			Construction and Editing - Length degree for smooth nurbz option.
			Type: fzrt_int
			Default Value: 2
			Range: 1
		FZ_OBJT_HELIX_PARM_TYPE
			Editing - Helix type. This is a read only parameter and indicates 
			whether the helix is a solid/surface helix, wire helxi around axis or 
			wire helix around path
			Type: fz_objt_helix_type_enum.
		FZ_OBJT_HELIX_PARM_MODEL_TYPE
			Editing - Model type.
			Type: fz_objt_model_type_enum
		FZ_OBJT_HELIX_PARM_SMOOTH_TYPE
			Editing - Smooth type.
			Type: fz_objt_smooth_type_enum
		FZ_OBJT_HELIX_PARM_SRC_OBJ
			Editing - Helix source object, if object is a solid/surface helix. 
			After creating a solid/surface helix object, the source object itself can be 
			replaced by passing in a new object using the fz_objt_edit_helix_parm_set 
			API function. Note that the same restrictions apply for this object 
			as for the one used to construct the helix initially. When getting 
			this parameter from an existing helix object, a copy of the 
			source 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.
			Type: fz_objt_ptr
		FZ_OBJT_HELIX_PARM_PATH_OBJ
			Editing - Helix path object, if object is a wire helix along path. 
			After creating a wire helix object, the path object itself can be 
			replaced by passing in a new object using the fz_objt_edit_helix_parm_set 
			API function. Note that the same restrictions apply for this object 
			as for the one used to construct the helix initially. When getting 
			this parameter from an existing helix object, a copy of the 
			path 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.
			Type: fz_objt_ptr
		FZ_OBJT_HELIX_PARM_NCYCLE
			Editing - Number of cycles. Equal to the revolution angle / 2PI
			Type: double
			Range: 0.0
		FZ_OBJT_HELIX_PARM_LENGTH
			Editing - Helix length, if helix is not a wire along path helix.
			Type: double
			Range: 0.0
		FZ_OBJT_HELIX_PARM_RADIUS
			Editing - Helix radius, if helix is a wire helix.
			Type: double
			Range: 0.0
		FZ_OBJT_HELIX_PARM_AXIS_PNT1
			Editing - Axis point 1, if helix is not a wire along path helix.
			Type: fz_xyz_td
		FZ_OBJT_HELIX_PARM_AXIS_PNT2
			Editing - Axis point 2, if helix is not a wire along path helix.
			Type: fz_xyz_td
		FZ_OBJT_HELIX_PARM_AXIS_REF
			Editing - Axis reference point, if helix is not a wire along path helix. 
			This is a third point, not located on the axis. It determines, where 
			the helix starts.
			Type: fz_xyz_td
		FZ_OBJT_HELIX_PARM_ANGLE
			Editing - Revolution angle. Equal to the number of cycles * 2PI
			Type: double
			Range: 0.0

	Availability	5.0.0.0


	See Also
		fz_objt_cnstr_helix_opts_get, fz_objt_cnstr_helix_opts_set, fz_objt_edit_helix_parm_get,  
		fz_objt_edit_helix_parm_set

 ****************************************************************/
typedef enum fz_objt_helix_parm_enum
{
	
	FZ_OBJT_HELIX_PARM_CAP_START = 0,
													
	FZ_OBJT_HELIX_PARM_CAP_END,
											
	FZ_OBJT_HELIX_PARM_FACT_TRIANG,
											
	FZ_OBJT_HELIX_PARM_PATH_SCL_ON,
											
	FZ_OBJT_HELIX_PARM_PATH_SCL,
											
	FZ_OBJT_HELIX_PARM_SRC_SCL_ON,

	FZ_OBJT_HELIX_PARM_SRC_SCL,
											
											
	FZ_OBJT_HELIX_PARM_SRC_ROT_ON,

	FZ_OBJT_HELIX_PARM_ROT_1STPT_ON,

	FZ_OBJT_HELIX_PARM_SRC_ROT,
											
	FZ_OBJT_HELIX_PARM_CLOCKWISE,
											
	FZ_OBJT_HELIX_PARM_FACT_STEPS,
											
	FZ_OBJT_HELIX_PARM_NRBZ_DEG_U,

	
	
	FZ_OBJT_HELIX_PARM_TYPE,
											
	FZ_OBJT_HELIX_PARM_MODEL_TYPE,
											
	FZ_OBJT_HELIX_PARM_SMOOTH_TYPE,
											
	FZ_OBJT_HELIX_PARM_SRC_OBJ,

	FZ_OBJT_HELIX_PARM_PATH_OBJ ,


	FZ_OBJT_HELIX_PARM_NCYCLE,
											
	FZ_OBJT_HELIX_PARM_LENGTH,
											
	FZ_OBJT_HELIX_PARM_RADIUS,
											
	FZ_OBJT_HELIX_PARM_AXIS_PNT1,
											
	FZ_OBJT_HELIX_PARM_AXIS_PNT2,
											
	FZ_OBJT_HELIX_PARM_AXIS_REF,

	FZ_OBJT_HELIX_PARM_ANGLE,
	FZ_OBJT_HELIX_PARM_MAX

} fz_objt_helix_parm_enum;

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

	fz_objt_cnstr_helix_from_src



	Description
		Creates a helix object from a source profile. The 
		source object must have a single face. It can be an open or 
		closed wire or a single face surface object.

	Parameters
		windex  [Input]
			project window index
		src_obj  [Input]
			source object
		model_type  [Input]
			model type
		smooth_type  [Input]
			smooth type
		ax_p1  [Input]
			first point on helix axis
		ax_p2  [Input]
			second point on helix axis
		n_cycles  [Input]
			number of cycles
			Range: 0.0
		length  [Input]
			helix length
			Range: 0.0
		helx_opts  [Input, Optional]
			construction options. For defaults see fz_objt_helix_parm_enum
		refn_opts  [Input, Optional]
			display resolution options For defaults see fz_attr_refn_parm_enum
		obj  [Result]
			new object

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_helix_parm_set,fz_objt_edit_helix_parm_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_from_src_func) (
	fzrt_int 					windex,
	fz_objt_ptr			src_obj,
	fz_objt_model_type_enum			model_type,
	fz_objt_smooth_type_enum	smooth_type,
	fz_xyz_td					*ax_p1,
	fz_xyz_td					*ax_p2,
	double					n_cycles,
	double					length,
	fz_objt_helix_cnstr_opts_ptr		helx_opts,
	fz_attr_refn_ptr		refn_opts,
	fz_objt_ptr			*obj
	);

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

	fz_objt_cnstr_helix_around_axis



	Description
		Creates a wire helix around an axis.

	Parameters
		windex  [Input]
			project window index
		model_type  [Input]
			model type
		ax_p1  [Input]
			first point on helix axis
		ax_p2  [Input]
			second point on helix axis
		ax_ref  [Input]
			third point. Must be off the axis defined by 
			ax_p1 and ax_p2. This point determines where the helix starts.
		n_cycles  [Input]
			number of cycles.
			Range: 0.0
		length  [Input]
			helix length
			Range: 0.0
		radius  [Input]
			helix radius
			Range: 0.0
		helx_opts  [Input, Optional]
			construction options. For defaults see fz_objt_helix_parm_enum
		refn_opts  [Input, Optional]
			display resolution options. For defaults see fz_attr_refn_parm_enum
		obj  [Result]
			new object

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_helix_parm_set,fz_objt_edit_helix_parm_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_around_axis_func) (
	fzrt_int 					windex,
	fz_objt_model_type_enum			model_type,
	fz_xyz_td					*ax_p1,
	fz_xyz_td					*ax_p2,
	fz_xyz_td					*ax_ref,
	double					n_cycles,
	double					length,
	double					radius,
	fz_objt_helix_cnstr_opts_ptr		helx_opts,
	fz_attr_refn_ptr		refn_opts,
	fz_objt_ptr			*obj
	);

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

	fz_objt_cnstr_helix_around_wire



	Description
		Creates a wire helix around a wire path.

	Parameters
		windex  [Input]
			project window index
		path_obj  [Input]
			path object. Must be an open or closed wire or 
			a surface object with a single face and single curve.
		model_type  [Input]
			model type
		n_cycles  [Input]
			number of cycles
			Range: 0.0
		radius  [Input]
			helix radius
			Range: 0.0
		helx_opts  [Input, Optional]
			construction options. For defaults see fz_objt_helix_parm_enum
		refn_opts  [Input, Optional]
			display resolution options. For defaults see fz_attr_refn_parm_enum
		obj  [Result]
			new object

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_helix_parm_set,fz_objt_edit_helix_parm_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_around_wire_func) (
	fzrt_int 					windex,
	fz_objt_ptr			path_obj,
	fz_objt_model_type_enum			model_type,
	double					n_cycles,
	double					radius,
	fz_objt_helix_cnstr_opts_ptr		helx_opts,
	fz_attr_refn_ptr		refn_opts,
	fz_objt_ptr			*obj
	);

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

	fz_objt_cnstr_helix_opts_init



	Description
		Allocates helix construction options and fills them with defaults.

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

	See Also
		fz_objt_cnstr_helix_opts_finit,fz_objt_cnstr_helix_opts_get,fz_objt_cnstr_helix_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_opts_init_func) (
	fzrt_int				windex,
	fz_objt_helix_cnstr_opts_ptr	*opts
	);

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

	fz_objt_cnstr_helix_opts_get



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

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_helix_opts_init,fz_objt_cnstr_helix_opts_finit,fz_objt_cnstr_helix_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_opts_get_func) (
	fzrt_int					windex,
	fz_objt_helix_cnstr_opts_ptr		opts,
	fz_objt_helix_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_cnstr_helix_opts_set



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

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_helix_opts_init,fz_objt_cnstr_helix_opts_finit,fz_objt_cnstr_helix_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_opts_set_func) (
	fzrt_int					windex,
	fz_objt_helix_cnstr_opts_ptr		opts,
	fz_objt_helix_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_cnstr_helix_opts_finit



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

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

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_cnstr_helix_opts_init,fz_objt_cnstr_helix_opts_get,fz_objt_cnstr_helix_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_helix_opts_finit_func) (
	fzrt_int				windex,
	fz_objt_helix_cnstr_opts_ptr	*opts
	);

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

	fz_objt_edit_helix_parm_get



	Description
		Gets a parameter of a helix object. When getting the 
		source or path object using the FZ_OBJT_HELIX_PARM_SRC_OBJ or 
		FZ_OBJT_HELIX_PARM_PATH_OBJ parameter id, 
		fz_objt_edit_helix_parm_get creates the object as a copy from 
		its internally stored source object. It is the responsibility 
		of the calling function to delete this object.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_helix_parm_set,fz_objt_cnstr_helix_from_src, 
		fz_objt_cnstr_helix_around_axis,fz_objt_cnstr_helix_around_wire, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_helix_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_helix_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_helix_parm_set



	Description
		Sets a parameter of a helix object. When setting a new 
		source or path object using the FZ_OBJT_HELIX_PARM_SRC_OBJ or 
		FZ_OBJT_HELIX_PARM_PATH_OBJ parameter id, 
		the calling code must create and delete this 
		object. fz_objt_edit_helix_parm_set() makes an internal copy.

		Note that the shape of the helix object is not changed until 
		the function fz_objt_edit_parm_regen has been called.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_helix_parm_get,fz_objt_cnstr_helix_from_src, 
		fz_objt_cnstr_helix_around_axis,fz_objt_cnstr_helix_around_wire, 
		fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_helix_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_helix_parm_enum	which,
	fz_type_td				*data
	);
	
#ifdef __cplusplus
}
#endif

#endif
