//===========================================================================//
// File:	ArmatureExport.h                                                 
// Project: MechWarrior 4
// Contents: Plugin to adjust height of max anmiations
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 04/28/99  TAS  Initial coding, 
//---------------------------------------------------------------------------//
// Copyright (C) 1999, Fasa Interactive, Inc.
// All Rights reserved worldwide
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL
//===========================================================================//

#if !defined(AFX_ARMEXPORT_H__68E70A2D_B863_11D1_98AD_0040051EDCE7__INCLUDED_)
#define AFX_ARMEXPORT_H__68E70A2D_B863_11D1_98AD_0040051EDCE7__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif


class ArmatureExporter;
class LODArmatureExporter;

#include "AnimationSuite.h"
#include "GeoExport.h"

class ArmatureExporter: public GeoExporter 
{
public:

    ArmatureExporter(const char *str): GeoExporter(str), m_first_write(true) {}
    ~ArmatureExporter() {}

    int WriteOutArmatureFile(const CString& path, const CString& filename, INode *node);
    int WriteOutContentFile(const CString& path, const CString& filename, INode *node);
    int WriteOutGeometry_Video_Data_Files(const CString& directoryPath, INode *node, const CString& strCage="", bool bSetUniqueYes=false);

	int	DoExportWrap(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts=FALSE,bool firstwrite=true);

private:
   	bool m_first_write;
	bool GetLocalToParent(INode *node, Stuff::LinearMatrix4D *matrix);
	int TraverseTreeContent(INode *node, Stuff::NotationFile *armature_file);
	int TraverseTree(INode *node, Stuff::NotationFile *armature_file);
};

#define MAXLODLEVELS 256

class MeshInfo
{
public:
	CString MeshName;
	Stuff::LinearMatrix4D ObjectToWorld;
};

class ArmatureExp : public SceneExport 
{
protected:
	ArmatureExporter m_Expt;

public:
    ArmatureExp() : m_Expt("") {}
    ~ArmatureExp() {}
    int ExtCount() { return 1; }
    const TCHAR * Ext(int n) {
        switch(n) {
        case 0:
            // This cause a static string buffer overwrite
            // return GetString(IDS_EXTENSION1);
            return _T("armature");
        }
        return _T("");
    }
    
    const TCHAR * LongDesc() { return GetString(IDS_LONGDESC); }
    const TCHAR * ShortDesc() { return _T("MW4 Armature"); }
    const TCHAR * AuthorName() { return _T("Jerry Edsall,Thomas Steinke"); }
    const TCHAR * CopyrightMessage() { return GetString(IDS_COPYRIGHT); }
    const TCHAR * OtherMessage1() { return _T(""); }
    const TCHAR * OtherMessage2() { return _T(""); }
    unsigned int Version() { return 100; }
    void ShowAbout(HWND hWnd) { 
        CAbout dlg;
	    dlg.DoModal();
    }

	int		DoExport(const TCHAR *name,ExpInterface *ei,Interface *i, BOOL suppressPrompts=FALSE,DWORD options=0);	
};


/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ANIMEXPORT_H__68E70A2D_B863_11D1_98AD_0040051EDCE7__INCLUDED_)
