//////////////////////////////////////////////////////////////////////////////
//
// Tools_Object_NodeSplinePoint.h
//
// Created by KOR - 23/01/2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// 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_OBJECT_NODESPLINEPOINT_H__
#define __TOOLS_OBJECT_NODESPLINEPOINT_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/Asura_ServerNode_Spline.h"

// tools
#include "Entity/Locations/Spline/Tools_EntityNode_Spline.h"
#include "Entity/Locations/Spline/Tools_Object_SplinePoint.h"

//////////////////////////////////////////////////////////////////////////////
//
// Tools_Object_NodeSplinePoint
//
//////////////////////////////////////////////////////////////////////////////

class Tools_Object_NodeSplinePoint: public Tools_Object_SplinePoint
{
    typedef Tools_Object_SplinePoint PARENT;

public:
    Tools_Object_NodeSplinePoint( class Asura_ServerNode_Spline* pxParentSplineNode,
        Tools_EntityNode_Spline* pxParentSplineTools,
        int iIndex,
		bool bIsEndPoint );
	virtual ~Tools_Object_NodeSplinePoint() {}

	virtual void UpdatePositionInAsuraData(bool /*updateLinkedObjects*/);
	virtual const char* GetTypeDescription(){return "Spline Node Control Point";}
    virtual void Destroy();
    virtual bool CanBeMoved();
    virtual void AddOverlayControls(class Asura_Overlay* pxOverlay, class Asura_Vector_2& xOffset);
	virtual void OnSelection();
	virtual void OnDeselection();
	virtual void UpdateWhileSelected();
	virtual void Update();

	void SetOrientationToTangent();
	void UpdateRenderMeshScaling();

protected:
    static void EditLinkProperties();
	virtual void CreateNew(const Asura_Vector_3& xPosition, const int iIndexAfter);

private:
    class Asura_ServerNode_Spline* m_pxParentSplineNode;
    Tools_EntityNode_Spline* m_pxParentTools; //private, as derivations will have their own pointer to their derivation of the spline tool class

    static Tools_Object_NodeSplinePoint* s_pxThisSplinePoint;
};

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

#endif //__TOOLS_OBJECT_NODESPLINEPOINT_H__
