/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_SPID_API_H
#define _FORMZ_MODEL_SPID_API_H

#ifdef __cplusplus
extern "C" {
#endif

#include "fz_model_core_api.h"


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

	Spherical Object


	Description
		formZ Model spheroid objects.
 ****************************************************************/



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

	FZ_OBJT_TYPE_SPID


	Description
		Unique identifier for the spheroid object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_SPID		"\x86\xb7\x89\xef\xfb\x54\x4b\xd5\x9d\x63\x99\x94\x58\xac\xaa\xfb"



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

	fz_objt_spid_cnstr_opts_ptr


	Description
		data structure to hold options for the constructions of a spheroid. 
		This type is used to pass additional construction options to the 
		function fz_objt_cnstr_spid. The individual fields of this type 
		can be accessed and set via fz_objt_cnstr_spid_opts_get and 
		fz_objt_cnstr_spid_opts_set.

	Availability	5.0.0.0


	See Also
		fz_objt_cnstr_spid,fz_objt_cnstr_spid_opts_get,fz_objt_cnstr_spid_opts_set

 ****************************************************************/
typedef struct	spid_cnstr_opts_td *fz_objt_spid_cnstr_opts_ptr;

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

	fz_objt_spid_parm_enum


	Description
		Parameter identifiers for a parametric spheroid object. Used for the 
		"which" argument of fz_objt_edit_spid_parm_get and fz_objt_edit_spid_parm_set.

	Members
		FZ_OBJT_SPID_PARM_GEO_BY_LEVEL
			Construction and Editing - Geodesic sphere construct by level on/off.
			Type: fzrt_boolean
		FZ_OBJT_SPID_PARM_GEO_LEVEL
			Editing - This is the old geodesic sphere level of subdivision and should not be used anymore. FZ_OBJT_SPID_PARM_GEO_NUM_SUBDIV 
			should be used instead. 
			Type: fzrt_int
			Range: 1
		FZ_OBJT_SPID_PARM_GEO_ESIZE
			Construction and Editing - Geodesic sphere max edge size.
			Type: double
			Range: 0.0
		FZ_OBJT_SPID_PARM_REVL_U_RES
			Construction and Editing - Revolved sphere horizontal resolution.
			Type: fzrt_int
			Range: 4
		FZ_OBJT_SPID_PARM_REVL_V_RES
			Construction and Editing - Revolved sphere vertical resolution.
			Type: fzrt_int
			Range: 2
		FZ_OBJT_SPID_PARM_GEO_NUM_SUBDIV
			Construction and Editing - Geodesic sphere number of subdivisions. 
			It indicates how many times a triangle of an icosahedron is subdivided 
			to create the geodesic sphere. This parameter supersedes the old FZ_OBJT_SPID_PARM_GEO_LEVEL 
			paramter, which only gave 2, 4, 8 and 16 subdivisions (called level 1, 2, 3 and 4). 
			Type: fzrt_int
			Range: 2
		FZ_OBJT_SPID_PARM_TYPE
			Editing - Spheroid type.
			Type: fz_objt_spid_type_enum
		FZ_OBJT_SPID_PARM_RADII
			Editing - Spheroid radii.
			Type: fz_xyz_td
			Range: 0
		FZ_OBJT_SPID_PARM_ORIGIN
			Editing - Spheroid origin.
			Type: fz_xyz_td
		FZ_OBJT_SPID_PARM_ROTATION
			Editing - Spheroid rotation.
			Type: fz_xyz_td
			Range: -2PI

	Availability	5.0.0.0


	See Also
		fz_objt_edit_spid_parm_get,fz_objt_edit_spid_parm_set

 ****************************************************************/
typedef enum fz_objt_spid_parm_enum
{	FZ_OBJT_SPID_PARM_GEO_BY_LEVEL = MODEL_PARM_CSED_START,
	FZ_OBJT_SPID_PARM_GEO_LEVEL,
	FZ_OBJT_SPID_PARM_GEO_ESIZE,
	FZ_OBJT_SPID_PARM_REVL_U_RES,
	FZ_OBJT_SPID_PARM_REVL_V_RES,

	FZ_OBJT_SPID_PARM_GEO_NUM_SUBDIV,

	
	FZ_OBJT_SPID_PARM_TYPE = MODEL_PARM_EDIT_START,
	FZ_OBJT_SPID_PARM_RADII,
	FZ_OBJT_SPID_PARM_ORIGIN,
	FZ_OBJT_SPID_PARM_ROTATION,


	MODEL_SPID_PARM_MAX
} fz_objt_spid_parm_enum;

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

	fz_objt_spid_type_enum


	Description
		Type identifiers for a parametric spheroid object. Used for the 
		FZ_OBJT_SPID_PARM_TYPE parameter of fz_objt_edit_spid_parm_get and fz_objt_edit_spid_parm_set.

	Members
		FZ_OBJT_SPID_TYPE_TETRA
			Tetrahedron
		FZ_OBJT_SPID_TYPE_HEXA
			Hexahedron
		FZ_OBJT_SPID_TYPE_OCTA
			Octahedron
		FZ_OBJT_SPID_TYPE_DODECA
			Dodecahedron
		FZ_OBJT_SPID_TYPE_ICOSA
			Icosahedron
		FZ_OBJT_SPID_TYPE_SOCCER
			Soccer ball
		FZ_OBJT_SPID_TYPE_REVL
			Revolved sphere
		FZ_OBJT_SPID_TYPE_GEO
			Geodesic sphere

	Availability	5.0.0.0


	See Also
		fz_objt_edit_spid_parm_get,fz_objt_edit_spid_parm_set

 ****************************************************************/
typedef enum fz_objt_spid_type_enum
{
	FZ_OBJT_SPID_TYPE_TETRA = 0,
	FZ_OBJT_SPID_TYPE_HEXA,
	FZ_OBJT_SPID_TYPE_OCTA,
	FZ_OBJT_SPID_TYPE_DODECA,
	FZ_OBJT_SPID_TYPE_ICOSA,
	FZ_OBJT_SPID_TYPE_SOCCER,
	FZ_OBJT_SPID_TYPE_REVL,
	FZ_OBJT_SPID_TYPE_GEO,
	
	MODEL_SPID_TYPE_MAX

} fz_objt_spid_type_enum;


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

	fz_objt_cnstr_spid



	Description
		Creates a spheroid

	Parameters
		windex  [Input]
			project window index
		rx_ry_rz  [Input]
			radius x, radius y, radius z
			Range: (0,0,0)
		type  [Input]
			spheroid type
		origin  [Input, Optional]
			origin
			Default Value: {0,0,0}
		rotation  [Input, Optional]
			rotation angles, applied in z,y,x order
			Default Value: {0,0,0}
		opts  [Input, Optional]
			construction options
			Default Value: see fz_objt_spid_parm_enum
		obj  [Result]
			new object

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_spid_parm_set,fz_objt_edit_spid_parm_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_spid_func) (
	fzrt_int 					windex,
	fz_xyz_td					*rx_ry_rz,
	fz_objt_spid_type_enum	type,
	fz_xyz_td					*origin,
	fz_xyz_td					*rotation,
	fz_objt_spid_cnstr_opts_ptr		opts,
	fz_objt_ptr			*obj
	);

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

	fz_objt_cnstr_spid_opts_init



	Description
		Allocates spheroid construction options. Fills all options 
		with default values.

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

	See Also
		fz_objt_cnstr_spid_opts_finit,fz_objt_cnstr_spid_opts_get,fz_objt_cnstr_spid_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_spid_opts_init_func) (
	fzrt_int				windex,
	fz_objt_spid_cnstr_opts_ptr	*opts
	);

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

	fz_objt_cnstr_spid_opts_get



	Description
		Gets a spheroid construction option. Note, that 
		only those values in fz_objt_spid_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_spid_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_spid.fsl

	See Also
		fz_objt_cnstr_spid_opts_init,fz_objt_cnstr_spid_opts_finit,fz_objt_cnstr_spid_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_spid_opts_get_func) (
	fzrt_int					windex,
	fz_objt_spid_cnstr_opts_ptr		opts,
	fz_objt_spid_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_cnstr_spid_opts_set



	Description
		Set the value of a spheroid's construction option. Note, that 
		only those values in fz_objt_spid_parm_enum are accepted 
		which are tagged for the construction options. See 
		fz_objt_spid_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_spid.fsl

	See Also
		fz_objt_cnstr_spid_opts_init,fz_objt_cnstr_spid_opts_finit,fz_objt_cnstr_spid_opts_get

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_spid_opts_set_func) (
	fzrt_int					windex,
	fz_objt_spid_cnstr_opts_ptr		opts,
	fz_objt_spid_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_cnstr_spid_opts_finit



	Description
		Frees spheroid 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_spid.fsl

	See Also
		fz_objt_cnstr_spid_opts_init,fz_objt_cnstr_spid_opts_get,fz_objt_cnstr_spid_opts_set

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cnstr_spid_opts_finit_func) (
	fzrt_int				windex,
	fz_objt_spid_cnstr_opts_ptr	*opts
	);

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

	fz_objt_edit_spid_parm_get



	Description
		Gets a parameter of a spheroid.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_spid_parm_set,fz_objt_cnstr_spid,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_edit_spid_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_spid_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_spid_parm_set



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

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_spid_parm_get,fz_objt_cnstr_spid,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_edit_spid_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_spid_parm_enum	which,
	fz_type_td				*data
	);


#ifdef __cplusplus
}
#endif

#endif
