/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_NCRV_API_H
#define _FORMZ_NCRV_API_H

#include "fz_objt_nrbz_api.h"

#ifdef __cplusplus
extern "C" {
#endif


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

	Nurbs Curve


	Description
		This module has low-level functionality to model complex free form 
		NURBS (Non Uniform Rational B-Splines) curves in formZ. It consists of utility 
		functions to construct, access and manipulate NURBS curves.
 ****************************************************************/

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

	fz_nurbs_cur_ptr


	Description
		Data structure to hold a NURBS curve.

	Availability	5.0.0.0


	See Also
		fz_ncrv_are_two_crvs_equal, fz_ncrv_calculate_length, fz_ncrv_copy,  
		fz_ncrv_delete_control_point, fz_ncrv_delete_knot, fz_ncrv_evaluate_derivatives_at_parm,  
		fz_ncrv_evaluate_point_at_parm, fz_ncrv_get_closure, fz_ncrv_get_control_points,  
		fz_ncrv_get_degree, fz_ncrv_get_domain, fz_ncrv_get_ith_control_point,  
		fz_ncrv_get_ith_weight, fz_ncrv_get_knots, fz_ncrv_get_npts,  
		fz_ncrv_get_weights, fz_ncrv_insert_control_point, fz_ncrv_insert_knot,  
		fz_ncrv_intersect_2_crvs_func, fz_ncrv_is_degenerate, fz_ncrv_merge_align,  
		fz_ncrv_merge_smooth, fz_ncrv_offset_planar_crv, fz_ncrv_reverse,  
		fz_ncrv_sample_crv_angle_based2, fz_ncrv_sample_crv_arclength_based2, fz_ncrv_sample_crv_parameter_based2,  
		fz_ncrv_set_ith_control_point, fz_ncrv_set_ith_weight, fz_ncrv_set_knots,  
		fz_ncrv_split_at_parm, fz_objt_cnstr_objt_from_ncur, fz_objt_set_ncrv

 ****************************************************************/
typedef struct nurbs_cur_td				*fz_nurbs_cur_ptr;

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

	fz_ncrv_which_end_enum


	Description
		Identifier of a NURBS curve end. Used to identify one of the 
		two ends of a NURBS curve.

	Members
		FZ_NCRV_START
			start of curve
		FZ_NCRV_END
			end of curve

	Availability	5.0.0.0


	See Also
		fz_objt_edit_nrbz_curve_attach, fz_objt_edit_nrbz_curve_blend

 ****************************************************************/
typedef enum fz_ncrv_which_end_enum
{
	FZ_NCRV_START = 0,
	FZ_NCRV_END
	
} fz_ncrv_which_end_enum;

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

	fz_nurbs_algn_type_enum


	Description
		Identifier of an alignment type. Used to identify one of the 
		four types of alignments available (CO,G1,C1,C2)..

	Members
		FZ_NURBS_ALGN_C0
			CO alignment type
		FZ_NURBS_ALGN_G1
			G1 alignment type
		FZ_NURBS_ALGN_C1
			C1 alignment type
		FZ_NURBS_ALGN_C2
			C2 alignment type

	Availability	5.0.0.0


	See Also
		fz_ncrv_merge_align, fz_nsrf_merge_align

 ****************************************************************/
typedef enum fz_nurbs_algn_type_enum
{
	FZ_NURBS_ALGN_C0 = 0,
	FZ_NURBS_ALGN_G1,
	FZ_NURBS_ALGN_C1,
	FZ_NURBS_ALGN_C2
	
} fz_nurbs_algn_type_enum;

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

	fz_ncrv_get_degree



	Description
		Gets the degree of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		degree  [Result]
			Degree

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_degree

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_degree_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			*degree
	);

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

	fz_ncrv_get_npts



	Description
		Gets the number of control points of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		npts  [Result]
			Number of control points

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_npts_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			*npts
	);

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

	fz_ncrv_get_control_points



	Description
		Gets the control points of a NURBS curve. The control points 
		array is allocated by the user and must be of size npts, 
		the number of control points obtained from function	fz_ncrv_get_npts().

	Parameters
		crv  [Input]
			NURBS curve
		ctrlpts  [Result]
			control points

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_weights

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_control_points_func)(
	fz_nurbs_cur_ptr	crv,
	fz_xyz_td 			*ctrlpts
	);

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

	fz_ncrv_get_weights



	Description
		Gets the weights of a NURBS curve.  The weights 
		array is allocated by the user and must be of size npts, 
		the number of control points obtained from function	fz_ncrv_get_npts().

	Parameters
		crv  [Input]
			NURBS curve
		weights  [Result]
			weights

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_weights_func)(
	fz_nurbs_cur_ptr	crv,
	double 			*weights
	);

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

	fz_ncrv_get_ith_control_point



	Description
		Gets the ith control point of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		i  [Input]
			Number
		ctrlpt  [Result]
			Control point

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_ith_control_point_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			i,
	fz_xyz_td 			*ctrlpt
	);

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

	fz_ncrv_get_ith_weight



	Description
		Gets the ith weight of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		i  [Input]
			Number
		weight  [Result]
			Weight

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_ith_weight_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			i,
	double 			*weight
	);

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

	fz_ncrv_get_knots



	Description
		Gets the knots of a NURBS curve. The knots array is allocated by 
		the user and must be of size npts+degree+1. npts is the number of control points 
		obtained from function fz_ncrv_get_npts().	degree is the degree of curve 
		obtained from function fz_ncrv_get_degree().

	Parameters
		crv  [Input]
			NURBS curve
		knots  [Result]
			Knot array

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_knots_func)(
	fz_nurbs_cur_ptr	crv,
	double 			*knots
	);

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

	fz_ncrv_get_domain



	Description
		Gets the parameter domain of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		tmin  [Result]
			min value
		tmax  [Result]
			max value

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_domain_func)(
	fz_nurbs_cur_ptr	crv,
	double 			*tmin,
	double 			*tmax
	);

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

	fz_ncrv_get_closure



	Description
		Gets the closure information of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		u_closed  [Result]
			is closed

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_get_domain,fz_ncrv_get_npts, fz_ncrv_get_control_points

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_get_closure_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_boolean 	*u_closed
	);
	

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

	fz_ncrv_set_ith_control_point



	Description
		Sets the ith control point of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		i  [Input]
			number
		ctrlpt  [Input]
			control point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_set_ith_control_point_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			i,
	fz_xyz_td 			*ctrlpt
	);

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

	fz_ncrv_set_ith_weight



	Description
		Sets the ith weight of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		i  [Input]
			number
		weight  [Input]
			weight value

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_set_ith_weight_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			i,
	double 			weight
	);

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

	fz_ncrv_set_knots



	Description
		Sets knots of a NURBS curve. 
		The knots array must be	of size npts+degree+1.

	Parameters
		crv  [Input]
			NURBS curve
		knots  [Input]
			knots

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_set_knots_func)(
	fz_nurbs_cur_ptr	crv,
	double 			*knots
	);

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

	fz_ncrv_evaluate_point_at_parm



	Description
		Evaluates a point on a NURBS curve at t.

	Parameters
		crv  [Input]
			NURBS curve
		t  [Input]
			parameter
		point  [Result]
			Point on curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_evaluate_point_at_parm_func)(
	fz_nurbs_cur_ptr	crv,
	double 			t,
	fz_xyz_td 			*point
	);

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

	fz_ncrv_evaluate_derivatives_at_parm



	Description
		Evaluates a point and tangent on a NURBS curve at t.

	Parameters
		crv  [Input]
			NURBS curve
		t  [Input]
			parameter
		point  [Result]
			Point on curve
		tangent  [Result]
			Tangent vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_evaluate_derivatives_at_parm_func)(
	fz_nurbs_cur_ptr	crv,
	double 			t,
	fz_xyz_td 			*point,
	fz_xyz_td 			*tangent
	);

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

	fz_ncrv_create_nurbs_curve



	Description
		Create a NURBS curve from control points, knots and weights. 
		Weights and knots are optional and NULL can be specified for defaults.

	Parameters
		cpts  [Input]
			Control points
		npts  [Input]
			Number of control points
		degree  [Input]
			Degree
		weights  [Input, Optional]
			Weights
		knots  [Input, Optional]
			Knots
		closed  [Input]
			Closed
		crv  [Result]
			NURBS curve created

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_create_nurbs_curve_func)(
	fz_xyz_td				*cpts,
	fzrt_int				npts,
	fzrt_int				degree,
	double				*weights,
	double				*knots,
	fzrt_boolean		closed,
	fz_nurbs_cur_ptr		*crv
	);

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

	fz_ncrv_insert_control_point



	Description
		Adds a control point to a NURBS curve after the nth control point. 
		The new control point is added in between the (n)th and (n+1)th point at a distance interpolated 
		by the specified ratio. For instance, a ratio of 0.5 would add a control point exactly in between the 
		(n)th and (n+1)th points. A ratio < 0.5 would make a new control point closer to the (n)th point than 
		the (n+1)th point while a ratio > 0.5 would make it closer to the (n+1)th point.

	Parameters
		crv  [Input]
			NURBS curve
		npt  [Input]
			nth control point
		ratio  [Input]
			ratio

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_insert_control_point_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int			npt,
	double			ratio
	);

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

	fz_ncrv_delete_control_point



	Description
		Deletes a nth point line of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		npt  [Input]
			nth control point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_delete_control_point_func)(
	fz_nurbs_cur_ptr	crv,
	fzrt_int 			npt
	);

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

	fz_ncrv_insert_knot



	Description
		Inserts knot to a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		t  [Input]
			Parameter value

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_insert_knot_func)(
	fz_nurbs_cur_ptr	crv,
	double 			t
	);

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

	fz_ncrv_delete_knot



	Description
		Deletes knot of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		t  [Input]
			Parameter value

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_delete_knot_func)(
	fz_nurbs_cur_ptr	crv,
	double 			t
	);

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

	fz_ncrv_change_degree



	Description
		Changes the degree of a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve
		degree  [Input]
			Degree
		keep_shape  [Input]
			if TRUE, the shape of curve is preserved

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_change_degree_func)(
	fz_nurbs_cur_ptr	*crv,
	fzrt_int 			degree,
	fzrt_boolean	keep_shape
	);

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

	fz_ncrv_change_number_of_ctrlpts_angle_based



	Description
		Changes the number of control points of NURBS curve based on angular tolerance.

	Parameters
		crv  [Input]
			NURBS curve
		angtol  [Input]
			Angular tolerance

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_change_number_of_ctrlpts_angle_based_func)(
	fz_nurbs_cur_ptr	*crv,
	double 			angtol
	);

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

	fz_ncrv_change_number_of_ctrlpts_number_based



	Description
		Changes the number of control points of NURBS curve based on given number of points.

	Parameters
		crv  [Input]
			NURBS curve
		npts  [Input]
			Number of points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_change_number_of_ctrlpts_number_based_func)(
	fz_nurbs_cur_ptr	*crv,
	fzrt_int 			npts
	);

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

	fz_ncrv_split_at_parm



	Description
		Splits a NURBS curve at the given parameter value.

	Parameters
		crv  [Input]
			NURBS curve
		t  [Input]
			Parameter value
		lcrv  [Result]
			NURBS curve 1
		rcrv  [Result]
			NURBS curve 2

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_split_at_parm_func)(
	fz_nurbs_cur_ptr	crv,
	double 			t,
	fz_nurbs_cur_ptr 	*lcrv,
	fz_nurbs_cur_ptr 	*rcrv
	);

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

	fz_ncrv_merge_align



	Description
		Merges two NURBS curves using alignment.

	Parameters
		crv1  [Input]
			NURBS curve 1
		crv2  [Input]
			NURBS curve 2
		align_type  [Input]
			alignment type when smooth curves is FALSE (C0, G1, C1, C2)
		merge_crv  [Result]
			NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_merge_align_func)(
	fz_nurbs_cur_ptr 				crv1,
	fz_nurbs_cur_ptr 				crv2,
	fz_nurbs_algn_type_enum		align_type,
	fz_nurbs_cur_ptr 				*merge_crv
	);

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

	fz_ncrv_merge_smooth



	Description
		Merges two NURBS curves using smoothness.

	Parameters
		crv1  [Input]
			NURBS curve 1
		crv2  [Input]
			NURBS curve 2
		smoothness  [Input]
			amount of smoothness
		merge_crv  [Result]
			NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_merge_smooth_func)(
	fz_nurbs_cur_ptr 				crv1,
	fz_nurbs_cur_ptr 				crv2,
	double						smoothness,
	fz_nurbs_cur_ptr 				*merge_crv
	);

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

	fz_ncrv_reverse



	Description
		Reverses a NURBS curve.

	Parameters
		crv  [Input]
			NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_reverse_func)(
	fz_nurbs_cur_ptr	crv
	);

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

	fz_ncrv_copy



	Description
		Copies a NURBS curve into another.

	Parameters
		crv  [Input]
			NURBS curve
		copy_crv  [Result]
			Copied NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_copy_func)(
	fz_nurbs_cur_ptr crv,
	fz_nurbs_cur_ptr *copy_crv
	);

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

	fz_ncrv_make_two_crvs_compatible



	Description
		Makes two NURBS curves compatible.

	Parameters
		crv1  [Input]
			NURBS curve 1
		crv2  [Input]
			NURBS curve 2

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_make_two_crvs_compatible_func)(
	fz_nurbs_cur_ptr	*crv1,
	fz_nurbs_cur_ptr	*crv2
	);
	
/****************************************************************

	fz_ncrv_delete



	Description
		Deletes a NURBS curve

	Parameters
		crv  [Input]
			NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_delete_func)(
	fz_nurbs_cur_ptr *crv
	);

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

	fz_ncrv_sample_crv_parameter_based



	Description
		Samples a NURBS curve along the parameter domain to obtain points. 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function.

	Parameters
		crv  [Input]
			NURBS curve
		npts  [Input]
			Number of points
		plist  [Result]
			Sample points list

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_sample_crv_arclength_based,fz_ncrv_sample_crv_angle_based, 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_parameter_based_func)(
	fz_nurbs_cur_ptr 		crv,
	fzrt_int				npts,
	fz_type_list_ptr 	plist
	);

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

	fz_ncrv_sample_crv_arclength_based



	Description
		Samples a NURBS curve based on arclength to obtain points. 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function.

	Parameters
		crv  [Input]
			NURBS curve
		len  [Input]
			Maximum segment length
		plist  [Result]
			Sample points list

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_sample_crv_parameter_based,fz_ncrv_sample_crv_angle_based 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_arclength_based_func)(
	fz_nurbs_cur_ptr 		crv,
	double				len,
	fz_type_list_ptr 	plist
	);

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

	fz_ncrv_sample_crv_angle_based



	Description
		Samples a NURBS curve based on angular tolerance to obtain points 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function.

	Parameters
		crv  [Input]
			NURBS curve
		angtol  [Input]
			angle
		plist  [Result]
			Sample points list

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_ncrv_sample_crv_parameter_based,fz_ncrv_sample_crv_arclength_based 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_angle_based_func)(
	fz_nurbs_cur_ptr		crv,
	double				angtol,
	fz_type_list_ptr 	plist
	);

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

	fz_ncrv_offset_planar_crv



	Description
		Offsets a NURBS curve by the given distance. 
		The curve is offset outwards, if the distance is positive else inwards. 
		The number of control points of the offset curve would be the same as that 
		of the original curve, if use_tol is FALSE. 
		If use_tol is TRUE, the number of control points of the offset curve would be 
		calculated using angtol, the maximum normal deviation, specified in radians.

	Parameters
		crv  [Input]
			NURBS curve
		distance  [Input]
			Offset distance
		use_tol  [Input]
			Use angular tolerance
		angtol  [Input]
			Angular tolerance
		offset_crv  [Result]
			Offset NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_offset_planar_crv_func)(
	fz_nurbs_cur_ptr	crv,
	double			distance,
	fzrt_boolean	use_tol,
	double			angtol,
	fz_nurbs_cur_ptr	*offset_crv
	);

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

	fz_ncrv_calculate_length



	Description
		Calculates the length of a NURBS curve.

	Parameters
		crv1  [Input]
			NURBS curve
		length  [Result]
			Length

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_calculate_length_func)(
	fz_nurbs_cur_ptr	crv1,
	double				*length
	);

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

	fz_ncrv_are_two_crvs_equal



	Description
		Checks if two NURBS curves are the same.

	Parameters
		crv1  [Input]
			NURBS curve	1
		crv2  [Input]
			NURBS curve	2

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_boolean	 (*fz_ncrv_are_two_crvs_equal_func)(
	fz_nurbs_cur_ptr	crv1,
	fz_nurbs_cur_ptr	crv2
	);
	
/****************************************************************

	fz_ncrv_is_degenerate



	Description
		Checks if a NURBS curve is degenerate.

	Parameters
		crv  [Input]
			NURBS curve

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_boolean	 (*fz_ncrv_is_degenerate_func)(
	fz_nurbs_cur_ptr	crv
	);

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

	fz_ncrv_intersect_2_crvs_func



	Description
		Intersect two NURBS curves and return intersection parameters

	Parameters
		crv1  [Input]
			NURBS curve	1
		crv2  [Input]
			NURBS curve	2
		n_intr  [Result]
			Number of intersections
		intr_tt1  [Result]
			Intersection parameters on curve 1
		intr_tt2  [Result]
			Intersection parameters on curve 2

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_ncrv.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_intersect_2_crvs_func)(
	fz_nurbs_cur_ptr	crv1,
	fz_nurbs_cur_ptr	crv2,
	fzrt_int			*n_intr,
	double 			**intr_tt1,
	double 			**intr_tt2
	);

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

	fz_ncrv_sample_crv_parameter_based2



	Description
		Samples a NURBS curve along the parameter domain to obtain points. 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function. 
		The sample parameters are returned in the given list(tlist) if not NULL. 
		This list is parallel to the point list and also needs to be intialised.

	Parameters
		crv  [Input]
			NURBS curve
		npts  [Input]
			Number of points
		plist  [Result]
			Sample points list
		tlist  [Result, Optional]
			Parameters list

	Returns
		Error codes


	Availability	6.5.7.0

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

	See Also
		fz_ncrv_sample_crv_arclength_based,fz_ncrv_sample_crv_angle_based, 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_parameter_based2_func)(
	fz_nurbs_cur_ptr 	crv,
	fzrt_int				npts,
	fz_type_list_ptr 	plist,
	fz_type_list_ptr 	tlist
	);

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

	fz_ncrv_sample_crv_arclength_based2



	Description
		Samples a NURBS curve based on arclength to obtain points. 
		The points are spaced evenly along the length of the curve. 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function. 
		The sample parameters are returned in the given list(tlist) if not NULL. 
		This list is parallel to the point list and also needs to be intialised.

	Parameters
		crv  [Input]
			NURBS curve
		npts  [Input]
			Number of points
		plist  [Result]
			Sample points list
		tlist  [Result, Optional]
			Parameters list

	Returns
		Error codes


	Availability	6.5.7.0

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

	See Also
		fz_ncrv_sample_crv_parameter_based2,fz_ncrv_sample_crv_angle_based2 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_arclength_based2_func)(
	fz_nurbs_cur_ptr 	crv,
	fzrt_int				npts,
	fz_type_list_ptr 	plist,
	fz_type_list_ptr 	tlist
	);

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

	fz_ncrv_sample_crv_angle_based2



	Description
		Samples a NURBS curve based on angular tolerance to obtain points 
		The sample points are returned in the given list(fz_type_list_ptr). 
		This list needs to be initialized before calling this function. 
		The sample parameters are returned in the given list(tlist) if not NULL. 
		This list is parallel to the point list and also needs to be intialised.

	Parameters
		crv  [Input]
			NURBS curve
		angtol  [Input]
			angle
		plist  [Result]
			Sample points list
		tlist  [Result, Optional]
			Parameters list

	Returns
		Error codes


	Availability	6.5.7.0

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

	See Also
		fz_ncrv_sample_crv_parameter_based2,fz_ncrv_sample_crv_arclength_based2 
		fz_type_list_init,fz_type_list_finit,fz_type_list_count, 
		fz_type_list_get_item,fz_type_list_add_item,fz_type_list_delete_item, 
		fz_type_list_pre_allocate,fz_type_list_clear

 ****************************************************************/
typedef fzrt_error_td	 (*fz_ncrv_sample_crv_angle_based2_func)(
	fz_nurbs_cur_ptr	crv,
	double				angtol,
	fz_type_list_ptr 	plist,
	fz_type_list_ptr 	tlist
	);

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

	fz_ncrv_fset


	FZ_NCRV_FSET_TYPE
		NURBS Curve function set UUID.

	FZ_NCRV_FSET_NAME
		NURBS Curve function set name.

	FZ_NCRV_FSET_VERSION
		NURBS Curve function set version.

	Description
		NURBS Curve Function Set

	Availability	5.0.0.0

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


#define FZ_NCRV_FSET_TYPE		"\xc4\xce\x63\xfe\x85\x2f\x4b\x56\x99\xa7\xb7\xad\x38\xa9\x2a\x93"


#define FZ_NCRV_FSET_NAME		"NURBS Curve functions"
#define FZ_NCRV_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct
{
	fzpl_fset_prvt_data_td				prvt_data;

	fz_ncrv_get_degree_func								fz_ncrv_get_degree;
	fz_ncrv_get_npts_func									fz_ncrv_get_npts;
	fz_ncrv_get_control_points_func						fz_ncrv_get_control_points;
	fz_ncrv_get_weights_func								fz_ncrv_get_weights;
	fz_ncrv_get_ith_control_point_func						fz_ncrv_get_ith_control_point;
	fz_ncrv_get_ith_weight_func							fz_ncrv_get_ith_weight;
	fz_ncrv_get_knots_func									fz_ncrv_get_knots;
	fz_ncrv_get_domain_func								fz_ncrv_get_domain;
	fz_ncrv_get_closure_func								fz_ncrv_get_closure;
	fz_ncrv_set_ith_control_point_func						fz_ncrv_set_ith_control_point;
	fz_ncrv_set_ith_weight_func							fz_ncrv_set_ith_weight;
	fz_ncrv_set_knots_func									fz_ncrv_set_knots;
	fz_ncrv_evaluate_point_at_parm_func					fz_ncrv_evaluate_point_at_parm;
	fz_ncrv_evaluate_derivatives_at_parm_func				fz_ncrv_evaluate_derivatives_at_parm;
	fz_ncrv_create_nurbs_curve_func						fz_ncrv_create_nurbs_curve;
	fz_ncrv_insert_control_point_func						fz_ncrv_insert_control_point;
	fz_ncrv_delete_control_point_func						fz_ncrv_delete_control_point;
	fz_ncrv_insert_knot_func								fz_ncrv_insert_knot;
	fz_ncrv_delete_knot_func								fz_ncrv_delete_knot;
	fz_ncrv_change_degree_func								fz_ncrv_change_degree;
	fz_ncrv_change_number_of_ctrlpts_angle_based_func		fz_ncrv_change_number_of_ctrlpts_angle_based;
	fz_ncrv_change_number_of_ctrlpts_number_based_func		fz_ncrv_change_number_of_ctrlpts_number_based;
	fz_ncrv_split_at_parm_func								fz_ncrv_split_at_parm;
	fz_ncrv_reverse_func									fz_ncrv_reverse;
	fz_ncrv_copy_func										fz_ncrv_copy;
	fz_ncrv_make_two_crvs_compatible_func					fz_ncrv_make_two_crvs_compatible;
	fz_ncrv_delete_func									fz_ncrv_delete;
	fz_ncrv_sample_crv_parameter_based_func				fz_ncrv_sample_crv_parameter_based;
	fz_ncrv_sample_crv_arclength_based_func				fz_ncrv_sample_crv_arclength_based;
	fz_ncrv_sample_crv_angle_based_func					fz_ncrv_sample_crv_angle_based;
	fz_ncrv_offset_planar_crv_func							fz_ncrv_offset_planar_crv;
	fz_ncrv_are_two_crvs_equal_func						fz_ncrv_are_two_crvs_equal;
	fz_ncrv_merge_align_func								fz_ncrv_merge_align;
	fz_ncrv_merge_smooth_func								fz_ncrv_merge_smooth;
	fz_ncrv_is_degenerate_func								fz_ncrv_is_degenerate;
	fz_ncrv_calculate_length_func							fz_ncrv_calculate_length;
	
	
	fz_ncrv_sample_crv_parameter_based2_func				fz_ncrv_sample_crv_parameter_based2;
	fz_ncrv_sample_crv_arclength_based2_func				fz_ncrv_sample_crv_arclength_based2;
	fz_ncrv_sample_crv_angle_based2_func					fz_ncrv_sample_crv_angle_based2;
}  fz_ncrv_fset;

#ifdef __cplusplus
}
#endif

#endif
