/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   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_TCTL_API_H
#define _FORMZ_MODEL_TCTL_API_H

#ifdef __cplusplus
extern "C" {
#endif



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

	fz_attr_tctl_parm_enum


	Description
		Parameter identifiers for the texture map control attribute. 
		Used for the "which" argument of fz_objt_attr_get_objt_tctl_parm 
		and fz_objt_attr_set_objt_tctl_parm

	Members
		FZ_ATTR_TCTL_PARM_NAME
			Texture group name. The name cannot be longer than 32 characters.
			Type: char*
		FZ_ATTR_TCTL_PARM_CENTER_HORIZ
			Center the horizontal tile
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_CENTER_VERT
			Center the vertical tile
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_MIRROR_HORIZ
			mirror the horizontal tile
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_MIRROR_VERT
			Mirror the vertical tile
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_FLIP
			Flip the horizontal and vertical direction of the texture
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_SOLID_SIZE
			The size of a solid texture.
			Type: double
			Range: 0.0
		FZ_ATTR_TCTL_PARM_MAP_TYPE
			Mapping type. Certain restrictions apply when 
			switching the mapping type of a texture map control. 
			For more details see fz_objt_attr_set_objt_tctl_parm.
			Type: fz_map_space_type_enum
		FZ_ATTR_TCTL_PARM_ORIGIN
			The origin of the texture map control
			Type: fz_xyz_td
			Range: 0.0
		FZ_ATTR_TCTL_PARM_ROTATION
			The rotation of the texture map control in 3d space. The angles are 
			applied in z y x order. 
			FZ_MAP_SPACE_UV_CORDS and FZ_MAP_SPACE_PARAMETRIC do 
			not have a rotation parameter.
			Type: fz_xyz_td
		FZ_ATTR_TCTL_PARM_SIZE_X
			The horizontal size of a texture tile. For FZ_MAP_SPACE_PARAMETRIC 
			the tile size is a factor of the length/depth of the parametric surface. At a 
			factor of 1.0 the texture occupies the surface with one tile. For 
			FZ_MAP_SPACE_UV_CORDS mapping, the tile size is a factor of the texture 
			size, when FZ_MAP_SPACE_UV_CORDS was first assigned. For 
			FZ_MAP_SPACE_FLAT, FZ_MAP_SPACE_CUBIC and the 
			vertical size of FZ_MAP_SPACE_CYLINDER mapping, the tile 
			size is a linear dimension, which must be greater than 0.0. For the 
			horizontal size of FZ_MAP_SPACE_CYLINDER and for 
			FZ_MAP_SPACE_SPHERE the tile size is an angular dimension 
			in the range 0.0 < value < 2PI. The FZ_ATTR_TCTL_PARM_SIZE_X/Y and 
			FZ_ATTR_TCTL_PARM_REPS_X/Y parameters are interdependent. When changing 
			one, the other parameter will automatically be updated.
			Type: double
			Range: 0.0
		FZ_ATTR_TCTL_PARM_SIZE_Y
			The vertical size of a texture tile.
			Type: double
			Range: 0.0
		FZ_ATTR_TCTL_PARM_REPS_X
			The # of horizontal repetitions of a texture tile. 
			For FZ_MAP_SPACE_CUBIC and FZ_MAP_SPACE_UV_CORDS 
			this parameter does not apply. The MODEL_ATTR_TCTL_REPS and 
			MODEL_ATTR_TCTL_SIZE parameters are interdependent. When changing 
			one, the other parameter will automatically be updated.
			Type: double
			Range: 0.0
		FZ_ATTR_TCTL_PARM_REPS_Y
			The # of vertical repetitions of a texture tile.
			Type: double
			Range: 0.0
		FZ_ATTR_TCTL_PARM_SCALE_WITH_OBJ
			Scale the texture size, when uniform scaling is applied to the object.
			Type: fzrt_boolean
		FZ_ATTR_TCTL_PARM_SIZE_LOCK
			The size lock option. Only, None, Square and Current are available.
			Type: fz_map_space_size_lock_enum

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_get_objt_tctl_parm,fz_objt_attr_set_objt_tctl_parm, fz_objt_attr_get_objt_tctl_parm

 ****************************************************************/
typedef enum fz_attr_tctl_parm_enum
{
	FZ_ATTR_TCTL_PARM_NAME = 0,

	FZ_ATTR_TCTL_PARM_CENTER_HORIZ,
													
	FZ_ATTR_TCTL_PARM_CENTER_VERT,
											
	FZ_ATTR_TCTL_PARM_MIRROR_HORIZ,
													
	FZ_ATTR_TCTL_PARM_MIRROR_VERT,
													
	FZ_ATTR_TCTL_PARM_FLIP,
													
	FZ_ATTR_TCTL_PARM_SOLID_SIZE,
													
	FZ_ATTR_TCTL_PARM_MAP_TYPE,
													
	FZ_ATTR_TCTL_PARM_ORIGIN,
													
	FZ_ATTR_TCTL_PARM_ROTATION,
													
	FZ_ATTR_TCTL_PARM_SIZE_X,
													
	FZ_ATTR_TCTL_PARM_SIZE_Y,
	
	FZ_ATTR_TCTL_PARM_REPS_X,
													
	FZ_ATTR_TCTL_PARM_REPS_Y,

	FZ_ATTR_TCTL_PARM_SCALE_WITH_OBJ,
	
	FZ_ATTR_TCTL_PARM_SIZE_LOCK,
	
	MODEL_ATTR_TCTL_MAX
} fz_attr_tctl_parm_enum;


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

	fz_objt_attr_get_objt_tctl_count



	Description
		Gets the number of texture groups of a texture map control attribute. 
		This number does not include the object level texture group. If 
		the object does not have a texture map control attribute an error 
		is returned.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		n_tcntl  [Result]
			The number of texture groups of the texture 
			map control attribute

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_add_objt_tctl_fgrp

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_get_objt_tctl_count_func) (
	fzrt_int 				windex,
	fz_objt_ptr		obj,
	fzrt_int				*n_tcntl
	);
											
/****************************************************************

	fz_objt_attr_add_objt_tctl_fgrp



	Description
		Adds a new texture group to the texture map control attribute 
		of an object. If the object does not have a texture map control 
		attribute an error is returned. A new texture map control 
		attribute can be created with fz_objt_attr_create_objt_tctl.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		fgrp_index  [Result, Optional]
			The index of the new texture group.

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_delete_objt_tctl_fgrp,fz_objt_attr_create_objt_tctl,fz_objt_attr_clear_objt_tctl

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_add_objt_tctl_fgrp_func) (
	fzrt_int 				windex,
	fz_objt_ptr		obj,
	fzrt_int				*fgrp_index
	);
												
/****************************************************************

	fz_objt_attr_delete_objt_tctl_fgrp



	Description
		Deletes a texture group from the texture map control attribute 
		of an object. If the object does not have a texture map control 
		attribute an error is returned. The fgrp_index parameter 
		passed in is used to identify the texture group. It must 
		be greater than -1 and less than the # of texture groups in 
		the texture map control attribute.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		fgrp_index  [Input]
			texture group index

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_add_objt_tctl_fgrp

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_delete_objt_tctl_fgrp_func) (
	fzrt_int 				windex,
	fz_objt_ptr		obj,
	fzrt_int				fgrp_index
	);
												
/****************************************************************

	fz_objt_attr_set_face_tctl_indx



	Description
		Sets the texture group index of a face. If the object does 
		not have a texture map control attribute an error is returned. 
		The index must be greater than or equal to -1 and less than 
		the # of texture groups in the texture map control attribute. 
		If passed as -1, the face will use the object level texture 
		group. Otherwise it will use the texture group identified by 
		the index.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		findx  [Input]
			face index
		fgrup_indx  [Input]
			texture group index

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_get_face_tctl_indx

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_set_face_tctl_indx_func) (
	fzrt_int 				windex,
	fz_objt_ptr		obj,
	fzrt_int				findx,
	fzrt_int				fgrup_indx
	);
											
/****************************************************************

	fz_objt_attr_get_face_tctl_indx



	Description
		Gets the texture group index of a face. If the object does 
		not have a texture map control attribute an error is returned. 
		if -1 is returned, the face uses the object level texture 
		group. Otherwise, the face uses the texture group identified by 
		the index.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		findx  [Input]
			face index
		fgrup_indx  [Result]
			texture group index

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_set_face_tctl_indx

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_get_face_tctl_indx_func) (
	fzrt_int 				windex,
	fz_objt_ptr		obj,
	fzrt_int				findx,
	fzrt_int				*fgrup_indx
	);
											
/****************************************************************

	fz_objt_attr_objt_has_tctl



	Description
		Checks whether an object has a texture map control attribute.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		has_tcntl  [Result]
			TRUE if object has a texture map control attribute, 
			FALSE otherwise

	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_attr_tctl.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_objt_has_tctl_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_boolean			*has_tcntl
	);
										
/****************************************************************

	fz_objt_attr_create_objt_tctl



	Description
		Creates a new texture map control attribute for an object. 
		The default values are taken from the default settings of the 
		texture map tool. If an object already has a texture map control 
		attribute, it will be overwritten.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_add_objt_tctl_fgrp

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_create_objt_tctl_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj
	);
											
/****************************************************************

	fz_objt_attr_clear_objt_tctl



	Description
		Removes the texture map control attribute from an object.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_add_objt_tctl_fgrp

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_clear_objt_tctl_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj
	);
											
/****************************************************************

	fz_objt_attr_set_objt_tctl_parm



	Description
		Sets the parameter of a texture map control attribute of an object. 
		The tgrp_indx argument identifies the texture group within the 
		texture map control attribute. If -1 is passed, the object 
		level texture group is used. Otherwise, the face level texture 
		group identified by tgrp_indx is used.

		When assigning the name parameter, a face texture group must be 
		selected (i.e. tgrp_indx must not be passed as -1). No checks 
		are made whether the texture group name is unique. It is up to the 
		calling function to assure this. The name cannot be larger 
		than 32 characters.

		When setting the origin parameter and the texture group uses 
		parametric mapping, the x and y value of the fz_xyz_td passed in 
		must be in the range of 0.0 to 1.0. If the texture group uses 
		uv coordinates mapping, no origin needs specified and the values 
		passed in  are ignored.

		When setting the rotation parameter and the texture group uses 
		parametric or uv coordinates mapping, the rotation values are 
		ignored.

		When setting the map type parameter, the following rules apply :

		Only nurbz and analytic primitives can be assigned the parametric 
		mapping type. 
		When setting the mapping type to uv coordinates, parametric and 
		smooth objects are dropped to plain facetted objects. 
		Size and repetition parameters are adjusted to conform to the 
		mapping type selected.

		When setting the size parameters, the repetition parameters 
		are automatically updated and vice versa.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		tgrp_indx  [Input]
			texture group index
		which  [Input]
			parameter identifier
		data  [Input]
			parameter data

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_get_objt_tctl_parm

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_set_objt_tctl_parm_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					tgrp_indx,
	fz_attr_tctl_parm_enum	which,
	fz_type_td				*data
	);
												
											
/****************************************************************

	fz_objt_attr_get_objt_tctl_parm



	Description
		Gets a parameter of a texture map control attribute of an object. 
		The texture group is identified by tgrp_indx. If tgrp_indx is passed 
		as -1, the object level texture group is used.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		tgrp_indx  [Input]
			texture group index
		which  [Input]
			parameter identifier
		data  [Result]
			parameter data

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_set_objt_tctl_parm

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_get_objt_tctl_parm_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fzrt_int					tgrp_indx,
	fz_attr_tctl_parm_enum	which,
	fz_type_td				*data
	);


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

	fz_objt_attr_set_objt_tctl_uv



	Description
		Sets the uv texture coordinates of an object. The object must have 
		a texture map control attribute and the mapping type must be set 
		to MAP_SPACE_UV_CORDS. The object also must be a plain facetted object. 
		The uv_pts array passed in must be allocated to and filled with as many 
		uv's as there are segments in the object. 
		In other words, the uv_pts array passed in is parallel to the segment 
		list of an object, not the point list. This is necessary, because 
		a different uv value may be assigned to a point when it is part of 
		one face, as opposed to another face.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		uv  [Input]
			uv points array, allocated to the number of segments of the 
			object and filled parallel to the segment list of the object

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_get_objt_tctl_uv

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_set_objt_tctl_uv_func) (
	fzrt_int 					windex,
	fz_objt_ptr			obj,
	fz_xy_td					*uv
	);

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

	fz_objt_attr_get_objt_tctl_uv



	Description
		Gets the uv texture coordinates of an object. If the object uses the 
		MAP_SPACE_UV_CORDS mapping type, the uv coordinates are used directly 
		from the values stored with the object. If the object uses other mapping 
		types, the uv coordinates are generated from the existing mapping type, 
		so that the uv coordinate at each topological point (start and end point 
		of each segment) corresponds to the uv value of the point when rendered. 
		The uv_pts array passed in must be allocated to as many uv's as there 
		are segments of the facetted topology in the object. In other words, the 
		uv_pts array passed in is parallel to the segment list of an object, not the point list. 
		This is necessary, because a different uv value may be assigned to a point 
		when it is part of one face, as opposed to another face.

	Parameters
		windex  [Input]
			project window index
		obj  [Input]
			object
		uv  [Result]
			uv points array, allocated to the number of segments of the 
			object. It will be filled parallel to the segment list of the object

	Availability	5.0.0.0

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

	See Also
		fz_objt_attr_set_objt_tctl_uv

 ****************************************************************/
typedef fzrt_error_td	 (*fz_objt_attr_get_objt_tctl_uv_func) (
	fzrt_int 					windex,
	fz_objt_ptr				obj,
	fz_xy_td				*uv
	);


#ifdef __cplusplus
}
#endif

#endif
