///////////////////////////////////////////////////////////////////////////////
/// @file deLine.hpp
///
/// @brief Mathematical Line Representations
///
/// @author Assassin
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Nov 2001
/// @author Assassin
/// @remarks Creation
///
///////////////////////////////////////////////////////////////////////////////

#ifndef DELINE_HPP
#define DELINE_HPP

#include "deGlobalTypes.hpp"
#include "deArray.hpp"
#include "deMath.hpp"
#include "deBrush.hpp"

class IdeLine;
class IdeSplinePatch;

// factory functions
	DEBRUSH_API IdeLine * IdeLine_CreateStraightLine();
	DEBRUSH_API IdeLine * IdeLine_CreateBezierLine();
	DEBRUSH_API IdeLine * IdeLine_CreateArcLine();
	DEBRUSH_API IdeLine * IdeLine_CreateGroupLine(); 
	DEBRUSH_API deBoolean IdeLine_GroupLineAdd(IdeLine * Group, IdeLine * ToAdd);
	DEBRUSH_API long		IdeLine_GroupLineRemoveLast(IdeLine * Group);
	DEBRUSH_API IdeSplinePatch* IdeLine_CreateSplinePatch();

//class IdeLine
DE3D_INTERFACE_(IdeLine)
{
protected:
	virtual ~IdeLine() {}

public:
	virtual long Release() = 0;

	// feed it a float between 0.0 and 1.0
	virtual void GetPointOnLine(deDouble Fraction, deVec3d & point) = 0;
	virtual void GetTangentAtPoint(deDouble Fraction, deVec3d & point) = 0;
	// GetLength only useful for combined lines, but very useful there
	virtual long GetLength() = 0;

	virtual long GetNumCVs() = 0;
	virtual void GetCVList(deVec3d buffer[]) = 0;
	virtual deVec3d GetCV(long num) = 0;
	virtual void SetCV(long num, deVec3d & CV) = 0;
	virtual void SetCVList(long num, deVec3d CVList[]) = 0;
	virtual void AddCV(deVec3d & point) = 0;

	virtual IdeLine * Copy() = 0;
};

//class IdeSplinePatch
DE3D_INTERFACE_(IdeSplinePatch)
{
protected:
	~IdeSplinePatch() {}
	
public:
	virtual long Release() = 0;
	
	virtual deBoolean SetNumControls(long Num) = 0;
	virtual deBoolean SetNumControlSamples(long Num) = 0;
	virtual deBoolean SetNumInterSamples(long Num) = 0;
	virtual long GetNumControls() const = 0;
	virtual long GetNumControlSamples() const = 0;
	virtual long GetNumInterSamples() const = 0;
	
	virtual deBoolean SetControl(long index, IdeLine * control) = 0;
	virtual deBoolean SetAllControls(long Num, IdeLine * controls[]) = 0;
	
	virtual long GetNumVertices() = 0;
	virtual long GetNumIndices() = 0;
	virtual deVec3d * GetVertices() = 0;
	virtual unsigned short * GetIndices() = 0;
};

#endif

