/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_SYMB_API_H
#define _FORMZ_MODEL_SYMB_API_H

#ifdef __cplusplus
extern "C" {
#endif



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

	Symbol


	Description
		formZ Model Symbols.  These functions deal with the symbol object type.
 ****************************************************************/

#include "fz_model_core_api.h"
#include "fz_symb_api.h"

#include "fz_lite_api.h"



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

	FZ_OBJT_TYPE_SYMB


	Description
		Unique identifier for the symbol instance object type.
 ****************************************************************/
#define FZ_OBJT_TYPE_SYMB		"\xff\x56\x27\x8d\xa4\x31\x47\x9c\x9e\x46\x37\xc9\x71\xe9\x9c\xd4"

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

	fz_objt_symb_parm_enum


	Description
		Parameter identifiers for a parametric symbol object. Used for the 
		"which" argument of fz_objt_edit_symb_parm_get and fz_objt_edit_symb_parm_set.

	Members
		FZ_OBJT_SYMB_PARM_LEVPTR
			Editing - Symbol level.
			Type: symb_lev_ptr
		FZ_OBJT_SYMB_PARM_ORIGIN
			Editing - Symbol origin.
			Type: fz_xyz_td
		FZ_OBJT_SYMB_PARM_SCALE
			Editing - Symbol scale. This can be any value except zero.
			Type: fz_xyz_td
		FZ_OBJT_SYMB_PARM_ROTATION
			Editing - Symbol rotation. 
			Rotation angles are applied in z y x order to transform 
			the symbol from alignment with the world axes to it's 
			3d orientation.
			Type: fz_xyz_td
		FZ_OBJT_SYMB_PARM_COLOR_OPT
			Editing - Symbol color option.
			Type: fz_symb_ins_color_opt_enum
		FZ_OBJT_SYMB_PARM_LAYER_OPT
			Editing - Symbol layer option.
			Type: fz_symb_ins_layer_opt_enum
		FZ_OBJT_SYMB_PARM_USE_LIGHTS
			Editing - Symbol use lights on (TRUE) or off (FALSE).
			Type: fzrt_boolean

	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_symb_parm_get,fz_objt_edit_symb_parm_set, 

 ****************************************************************/
typedef enum fz_objt_symb_parm_enum
{
	FZ_OBJT_SYMB_PARM_LEVPTR = 0,
																
	FZ_OBJT_SYMB_PARM_ORIGIN,
												
	FZ_OBJT_SYMB_PARM_SCALE,
												
	FZ_OBJT_SYMB_PARM_ROTATION,
										
	FZ_OBJT_SYMB_PARM_COLOR_OPT,
												
	FZ_OBJT_SYMB_PARM_LAYER_OPT,
												
	FZ_OBJT_SYMB_PARM_USE_LIGHTS,

	MODEL_SYMB_PARM_MAX
	
} fz_objt_symb_parm_enum;


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

	fz_objt_symb_ins_place



	Description
		Places a new symbol instance object. The referenced definition 
		level is passed in as lev_ptr. Origin, scale and rotation are 
		optional and substituted by (0,0,0) for origin, (1,1,1) for scale 
		and (0,0,0) for rotation.

	Parameters
		windex  [Input]
			project window index
		lev_ptr  [Input]
			definition level
		origin_ptr  [Input, Optional]
			origin (placement point).
			Default Value: {0.0, 0.0, 0.0}
		scale_ptr  [Input, Optional]
			scale factor.
			Default Value: {1.0, 1.0, 1.0}
		rotation_ptr  [Input, Optional]
			3d rotation angles, applies in z y x order.
			Default Value: {0.0, 0.0, 0.0}
		color_opts  [Input]
			color options
		layer_opts  [Input]
			layer options
		use_lights  [Input]
			use lights
		new_objt  [Result]
			symbol object

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_symb_def_model_create, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_symb_ins_place_func) (
	fzrt_int					windex,
	fz_symb_lev_ptr				lev_ptr,
	fz_xyz_td					*origin_ptr,
	fz_xyz_td					*scale_ptr,
	fz_xyz_td					*rotation_ptr,
	fz_symb_ins_color_opt_enum	color_opts,
	fz_symb_ins_layer_opt_enum	layer_opts,
	fzrt_boolean			use_lights,
	fz_objt_ptr			*new_objt
	);

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

	fz_objt_symb_ins_explode



	Description
		Explodes a symbol instance object into its component objects. 
		The object passed in as sym_obj must be a symbol instance. 
		If flatten is TRUE, all nested symbol instances are exploded 
		as well. That is, no symbol instances remain in the resulting 
		list of objects. If flatten is FALSE, the symbol instance is 
		exploded on level of nesting deep.

		The pointers of the resulting objects are stored in the 
		entity list passed in. If the resulting objects are to become 
		part of the project's object list, each must be added via 
		a call to fz_objt_add_objt_to_project.

		Note, that the symbol instance object passed in remains unchanged 
		(i.e. it is not deleted).

	Parameters
		windex  [Input]
			project window index
		sym_obj  [Input]
			symbol object
		flatten  [Input]
			explode nested symbols
		ent_list  [Result]
			list with resulting objects

	Returns
		Error codes


	Availability	5.0.0.0

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

	See Also
		fz_symb_def_model_create, 

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_symb_ins_explode_func) (
	fzrt_int			windex,
	fz_objt_ptr	sym_obj,
	fzrt_boolean	flatten,
	fz_enty_list_ptr	ent_list
	);

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

	fz_objt_symb_ins_get_matrix



	Description
		Gets the matrix of a symbol instance object, which represents it 
		transformation from the definition objects into 
		world space. The matrix is the combination of the scale, rotation 
		and origin parameters of the symbol instance.

	Parameters
		windex  [Input]
			project window index
		sym_obj  [Input]
			symbol object
		mat  [Result]
			The symbol instance's matrix.

	Returns
		Error codes


	Availability	5.0.0.0

 ****************************************************************/
typedef fzrt_error_td 	 (*fz_objt_symb_ins_get_matrix_func)(
	fzrt_int				windex,
	fz_objt_ptr			sym_obj,
	fz_mat4x4_td		*mat
	);


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

	fz_objt_edit_symb_parm_get



	Description
		Gets a parameter of a symbol object.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_symb_parm_set,fz_symb_def_model_create,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_symb_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_symb_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_symb_parm_set



	Description
		Sets a parameter of a symbol object.

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

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


	Availability	5.0.0.0

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

	See Also
		fz_objt_edit_symb_parm_get,fz_symb_def_model_create,fz_objt_edit_parm_regen, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_symb_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr			obj,
	fz_objt_symb_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_grup_cmpt_parm_enum


	Description
		Parameter identifiers for a parametric symbol object. Used for the 
		"which" argument of fz_objt_edit_cmpt_parm_get and fz_objt_edit_cmpt_parm_set.

	Members
		FZ_GRUP_CMPT_PARM_TAG
			Editing - Component tag.
			Type: fz_tag_td
		FZ_GRUP_CMPT_PARM_ORIGIN
			Editing - Symbol origin.
			Type: fz_xyz_td
		FZ_GRUP_CMPT_PARM_SCALE
			Editing - Symbol scale. This can be any value except zero.
			Type: fz_xyz_td
		FZ_GRUP_CMPT_PARM_ROTATION
			Editing - Symbol rotation. 
			Rotation angles are applied in z y x order to transform 
			the symbol from alignment with the world axes to it's 
			3d orientation.
			Type: fz_xyz_td

	Availability	7.0.0.0

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

	See Also
		fz_grup_edit_cmpt_parm_get,fz_grup_edit_cmpt_parm_set, fz_grup_edit_cmpt_parm_get

 ****************************************************************/
typedef enum fz_grup_cmpt_parm_enum
{
	FZ_GRUP_CMPT_PARM_TAG = 0,

	FZ_GRUP_CMPT_PARM_ORIGIN,

	FZ_GRUP_CMPT_PARM_SCALE,

	FZ_GRUP_CMPT_PARM_ROTATION,

	MODEL_CMPT_PARM_MAX

}	fz_grup_cmpt_parm_enum;

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

	fz_grup_edit_cmpt_parm_get



	Description
		Gets a parameter of a component group.

	Parameters
		windex  [Input]
			project window index
		grup  [Input]
			component group
		which  [Input]
			parameter identifier
		data  [Result]
			parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- group passed in is not a component


	Availability	7.0.0.0

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

	See Also
		fz_grup_edit_cmpt_parm_set, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_grup_edit_cmpt_parm_get_func) (
	fzrt_int						windex,
	fz_grup_ptr					grup,
	fz_grup_cmpt_parm_enum		which,
	fz_type_td					*data
	);

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

	fz_grup_edit_cmpt_parm_set



	Description
		Sets a parameter of a component group.

	Parameters
		windex  [Input]
			project window index
		grup  [Input]
			component group
		which  [Input]
			parameter identifier
		data  [Input]
			parameter data

	Returns
		Error codes 
		MODEL_ERR_WRONG_OBJT_TYPE	- group passed in is not a component


	Availability	7.0.0.0

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

	See Also
		fz_grup_edit_cmpt_parm_get, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_grup_edit_cmpt_parm_set_func) (
	fzrt_int						windex,
	fz_grup_ptr					grup,
	fz_grup_cmpt_parm_enum		which,
	fz_type_td					*data
	);

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

	fz_objt_cmpt_place



	Description
		Places a new component group. The component tag 
		is passed in as lev_ptr. Origin, scale and rotation are 
		optional and substituted by (0,0,0) for origin, (1,1,1) for scale 
		and (0,0,0) for rotation.

	Parameters
		windex  [Input]
			project window index
		cmpt_tag  [Input]
			definition level
		origin_ptr  [Input, Optional]
			origin (placement point).
			Default Value: {0.0, 0.0, 0.0}
		scale_ptr  [Input, Optional]
			scale factor.
			Default Value: {1.0, 1.0, 1.0}
		rotation_ptr  [Input, Optional]
			3d rotation angles, applies in z y x order.
			Default Value: {0.0, 0.0, 0.0}
		color_opts  [Input]
			color options
		layer_opts  [Input]
			layer options
		use_lights  [Input]
			use lights
		new_grup  [Result]
			component group

	Returns
		Error codes


	Availability	7.0.0.0

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

	See Also
		fz_symb_def_model_create, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cmpt_place_func) (
	fzrt_int						windex,
	fz_tag_td					*cmpt_tag,
	fz_xyz_td					*origin_ptr,
	fz_xyz_td					*scale_ptr,
	fz_xyz_td					*rotation_ptr,
	fz_symb_ins_color_opt_enum	color_opts,
	fz_symb_ins_layer_opt_enum	layer_opts,
	fzrt_boolean				use_lights,
	fz_grup_ptr					*new_grup
	);

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

	fz_objt_cmpt_delete



	Description
		Deletes a component group.

	Parameters
		windex  [Input]
			project window index
		grup  [Input]
			component group

	Returns
		Error codes


	Availability	7.0.0.0


	See Also
		fz_symb_def_model_create, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cmpt_delete_func) (
	fzrt_int						windex,
	fz_grup_ptr					grup
	);

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

	fz_objt_cmpt_get_name



	Description
		Deletes a component group.

	Parameters
		windex  [Input]
			project window index
		cmpt_tag  [Input]
			component tag
		name  [Result]
			component name

	Returns
		Error codes


	Availability	7.0.0.0


	See Also
		fz_symb_def_model_create, 

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_cmpt_get_name_func) (
	fzrt_int					windex,
	fz_tag_td				*cmpt_tag,
	fz_string_td			name
	);

#ifdef __cplusplus
}
#endif


#endif
