/*=========================================================================
*
* Merge.h	- merge functions
*
* Version			1.0
* Revision date
*
*=======================================================================*/
#ifndef __MERGE_H__
#define __MERGE_H_

//--- Includes --------------------------------------------------------

#include "MTH.h"
#include "SCR.h"

#include "geoobj.h"
#include "sprobj.h"


//--- Structure ---------------------------------------------------------

typedef struct tdstMergeData_
{
	char						szSOName[ SCR_CV_ui_Cfg_MaxLenName ];
	MLT_tdxHandleToSuperObject	*d_hSO;
	long						*d_lIndex;
	long						lNumberOfSO;
	MTH3D_tdstVector			stOrigin;
	char						szObjName[ SCR_CV_ui_Cfg_MaxLenName ];
	MLT_tdstGeometricObject		**d_p_stObject;
	MLT_tdstGeometricObject		*p_stMergedObject;
} tdstMergeData;


//--- Functions ---------------------------------------------------------

// merge function
extern void MLT_vMergeObjectsInHierarchy (MLT_tdxHandleToSuperObject _hSO);
// geometric
extern void MLT_vComputeNewGeometric	(tdstMergeData *_p_stMergeData);
extern void MLT_vMergeGeometric			(tdstMergeData *_p_stMergeData);
// merge data
extern tdstMergeData *	MLT_pstMergeDataCreate	(char *_szName, long _lNumberMax);
extern void				MLT_vMergeDataFree		(tdstMergeData *_p_stMergeData);
extern void				MLT_vMergeDataAddSO		(tdstMergeData *_p_stMergeData, MLT_tdxHandleToSuperObject _hSO, long _lGroupIndex);
// merge index
extern long MLT_lMergeDataGetSOIndex	(tdstMergeData *_p_stMergeData, MLT_tdxHandleToSuperObject _hSO);
extern long MLT_lMergeGetIndexAndName	(char *_szName, char *_szResultName);


#endif //__MERGE_H__

