/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_MORF_API_H
#define _FORMZ_MODEL_MORF_API_H

#include "fz_model_core_api.h"

#ifdef __cplusplus
extern "C" {
#endif


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

	Morph Object


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

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

	FZ_OBJT_TYPE_MORF


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

#define FZ_OBJT_TYPE_MORF	"\xf7\x4c\x2c\x9b\xfe\xe8\x11\xd9\xa9\x27\x00\x30\x65\xd2\xb5\xb2"

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

	fz_objt_morf_parm_enum


	Description
		Parameter identifiers for a parametric morph object. Used for the 
		"which" argument of fz_objt_edit_morf_parm_get, fz_objt_edit_morf_parm_set. 
		After creating a morph object, the source and destination objects can be 
		retrieved using the fz_objt_edit_morf_parm_get API function. 
		Note, that a copy of the source or destination 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_MORF_PARM_PCENT
			Editing - Morph percentage.
			Type: double
			Default Value: 0.5
		FZ_OBJT_MORF_PARM_IGNORE_ORIENT
			Editing - TRUE, to morph directly between source and destination object. FALSE to 
			align source and destination objects by their axes first and then morph.
			Type: fzrt_boolean
		FZ_OBJT_MORF_PARM_PLACE_AT_SOURCE
			Editing - TRUE, to place morphed object at the origin of the source object. FALSE to 
			move the morphed object between source and destination, according to morph percentage.
			Type: fzrt_boolean
		FZ_OBJT_MORF_PARM_SRC_OBJ
			Editing - Morph source object.
			Type: fz_objt_ptr
		FZ_OBJT_MORF_PARM_DST_OBJ
			Editing - Morph destination object.
			Type: fz_objt_ptr

	Availability	6.0.0.2


	See Also
		fz_objt_edit_morf_parm_get,fz_objt_edit_morf_parm_set

 ****************************************************************/
typedef enum fz_objt_morf_parm_enum
{
	
	FZ_OBJT_MORF_PARM_PCENT = MODEL_PARM_EDIT_START,

	FZ_OBJT_MORF_PARM_IGNORE_ORIENT,
	
	FZ_OBJT_MORF_PARM_PLACE_AT_SOURCE,

	FZ_OBJT_MORF_PARM_SRC_OBJ,
	
	FZ_OBJT_MORF_PARM_DST_OBJ,
	FZ_OBJT_MORF_PARM_MAX
	
} fz_objt_morf_parm_enum;

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

	fz_objt_cnstr_morf



	Description
		Creates a Morph object. 
		This function constructs a Morph object interpolating a shape between 
		a source and a destination object. The factor argument determines how 
		far to interpolate. Values less than 0 and greater than 1 are acceptable.

	Parameters
		windex  [Input]
			Project window index
		src_obj  [Input]
			Source object
		dst_obj  [Input]
			Destination object
		factor  [Input]
			Morph factor. 0.0 = shape of source, 1.0 = shape of destination
		place_at_source  [Input]
			TRUE, to place morphed object at the origin of the source object. FALSE to 
			move the morphed object between source and destination, according to morph percentage.
		ignore_orientation  [Input]
			TRUE, to morph directly between source and destination object. FALSE to 
			align source and destination objects by their axes first and then morph
		refn_opts  [Input, Optional]
			Display resolution
		obj  [Result]
			New object

	Returns
		Error codes


	Availability	6.0.0.2

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

	See Also
		fz_objt_edit_morf_parm_get,fz_objt_edit_morf_parm_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_cnstr_morf_func)(
	fzrt_int						windex,
	fz_objt_ptr					src_obj,
	fz_objt_ptr					dst_obj,
	double						factor,
	fzrt_boolean				place_at_source,
	fzrt_boolean				ignore_orientation,
	fz_attr_refn_ptr			refn_opts,
	fz_objt_ptr					*obj
	);

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

	fz_objt_edit_morf_parm_get



	Description
		Gets a parameter of a Morph object.

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

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


	Availability	6.0.0.2

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

	See Also
		fz_objt_edit_morf_parm_set,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_morf_parm_get_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_morf_parm_enum	which,
	fz_type_td				*data
	);

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

	fz_objt_edit_morf_parm_set



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

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

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


	Availability	6.0.0.2

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

	See Also
		fz_objt_edit_morf_parm_get,fz_objt_edit_parm_regen

 ****************************************************************/
typedef fzrt_error_td  (*fz_objt_edit_morf_parm_set_func) (
	fzrt_int					windex,
	fz_objt_ptr				obj,
	fz_objt_morf_parm_enum	which,
	fz_type_td				*data
	);

#ifdef __cplusplus
}
#endif

#endif
