//////////////////////////////////////////////////////////////////////////////
//
// Tools_EntityNode_LiftSpline.h
//
// Copyright (c) 2006 Rebellion. All rights reserved.
//
// Description:
//
//     spline class for lift entities to follow
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ___TOOLS_ENTITYNODE_LIFTSPLINE_H___
#define ___TOOLS_ENTITYNODE_LIFTSPLINE_H___ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

// asura
#include "Entity/Locations/Spline/LiftSpline/Asura_ServerNode_LiftSpline.h"

// tools
#include "Entity/Locations/Spline/Tools_EntityNode_Spline.h"
#include "Objects/Tools_Object_System.h"
#include "Interface/Asura_Graph_Dialog.h"

//////////////////////////////////////////////////////////////////////////////
//
// Tools_EntityNode_LiftSpline
//
//////////////////////////////////////////////////////////////////////////////

class Tools_EntityNode_LiftSpline : public Tools_EntityNode_Spline
{
	typedef Tools_EntityNode_Spline PARENT;

public:
	Tools_EntityNode_LiftSpline(Asura_Entity* pxEntity);

	const char* GetTypeDescription(){return "Lift Spline";}
	virtual bool IsBaseOrDerivativeOf( int iToolsObjectType ) const;
	virtual void OnSelection();
	virtual void OnDeselection();
	virtual void UpdateWhileSelected();
	virtual void AddOverlayControls(class Asura_Overlay* pxNewOverlay,class Asura_Vector_2& xOffset);
	virtual void Render();
	virtual bool CanBeCopied() const { return false; }
	virtual bool CanBePasted() const { return false; }
	virtual bool CanBePastedOverAnother() const { return false; }

	virtual void CreateAllToolsPathObjects( const int iSelectIndexAfter = -1, const bool bShowEndPoints = true );

	virtual const char* GetMyNamePrefix() const { return Tools_EntityNode_LiftSpline::GetNamePrefix(); }

	static void Create(Asura_Guid uStartGuid, Asura_Guid uEndGuid)	{ CreateAndReturn(uStartGuid, uEndGuid); }
	static Tools_EntityNode_LiftSpline* CreateAndReturn(Asura_Guid uStartGuid, Asura_Guid uEndGuid);

	static void SetToDefaultOrientations();

	// Speed graph editing
	static void AutoSetStartSpeed();
	static bool CanAutoSetStartSpeed();
	static void AutoSetEndSpeed();
	static bool CanAutoSetEndSpeed();

	// Node manipulation functions...
	virtual void UpdateSplinePoint(const int iIndex, const Asura_Vector_3& xPosition, const Asura_Matrix_3x3& xOrientation);

	Asura_ServerNode_LiftSpline* GetGameLiftSpline() const { return static_cast< Asura_ServerNode_LiftSpline* >( GetGameSpline() ); }

	static const char* GetNamePrefix() { return "LiftS_"; }

protected:
	virtual Tools_ChooseObject* CreateSourceNodeChooseObject( Asura_Guid* pxGuid ) const;
	virtual Tools_ChooseObject* CreateTargetNodeChooseObject( Asura_Guid* pxGuid ) const;

    bool m_bTakeOrientationFromPoints;
	bool m_bOverrideDuration;
	float m_fDurationOverride;
	float m_fLength;
	bool m_bDistanceVsTimeGraph;
	class Tools_Lift_Base* m_pxLiftBaseData;

	static bool        s_bChangedSpeedGraph;

	Asura_Graph_Dialog<float> *m_pxGraphDialog;

private:
	bool m_bChanged;

	static Tools_EntityNode_LiftSpline* s_pxThisToolsLiftSpline;
};

//////////////////////////////////////////////////////////////////////////////
//
// 
//
//////////////////////////////////////////////////////////////////////////////

#endif // #ifndef ___TOOLS_ENTITYNODE_LIFTSPLINE_H___