//////////////////////////////////////////////////////////////////////
// Tools_VolumeCylinderEdit_Object.h							//
// SJL 19/11/07														//
// Copyright (C) 2007 Rebellion, All Rights Reserved.			    //
//////////////////////////////////////////////////////////////////////


#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef _TOOLS_VOLUMECYLINDEREDIT_OBJECT_H_
#define _TOOLS_VOLUMECYLINDEREDIT_OBJECT_H_

#include "Core/Asura_String.h"
#include "Objects/Tools_Object.h"
#include "Volume/Asura_Volume.h"
#include "Volume/Asura_Volume_Cylinder.h"
#include "Objects/Tools_VolumeBaseEdit_Object.h"

enum ASURA_VOLUMECYLINDER_FACE
{
	FACE_UNSET =0 ,
	FACE_TOP,
	FACE_BOTTOM,
	FACE_SIDE,
	FACE_NUM_OF_ASURA_VOLUMECYLINDER_FACES
};

class Tools_VolumeCylinderEdit_Object : public Tools_VolumeBaseEdit_Object
{
private:
	typedef Tools_VolumeBaseEdit_Object PARENT;
public :

	Tools_VolumeCylinderEdit_Object(const char* name, Asura_Volume_Cylinder* pxVolume, bool* pbModifiedFlag = 0);
	~Tools_VolumeCylinderEdit_Object();

	virtual bool ObjectIsInLOS(const Asura_Vector_3& xStart, const Asura_Vector_3& xDir, float& fLowest);
	virtual void Displace(const Asura_Vector_3& xOffset);
	virtual void RotateAbout(const Asura_Vector_3& xCentre, const Asura_Matrix_3x3& xOri);

	virtual void UpdatePositionInAsuraData(bool /*updateLinkedObjects*/);	// Update game entities position from tools objects position.

protected :
	void SetToolsDataFromVolumeData();
	void SetVolumeDataFromToolsData();
	virtual void SetDefaultPositionFromVolume() { SetToolsDataFromVolumeData(); }

	virtual void AddOverlayControls(class Asura_Overlay* pxOverlay,Asura_Vector_2& xOffset);

	virtual void Render();

	virtual void UpdateWhileSelected();

	virtual void SelectFaceUnderCursor( const bool bGetFurthest );
	virtual void SnapFaceToCursor(const bool bAlsoExpandOppositeFace);

	ASURA_VOLUMECYLINDER_FACE   m_eSelectedFace;
	//u_char						m_ucSelectedFace;

	Asura_Vector_3*				m_pxPosition;
	float*						m_pfRadius;
	float*						m_pfHeight;

	Asura_Vector_3				m_xOverlayPosition;
	float						m_fOverlayRadius;
	float						m_fOverlayHeight;

	bool						m_bOverlayPositionChanged;
	bool					    m_bOverlayRadiusChanged;
	bool						m_bOverlayHeightChanged;

};

#endif _TOOLS_VOLUMECYLINDEREDIT_OBJECT_H_