/****************************************************************************************************

		IEdge.h
		Copyright: (c) 2004 Eovia Corp. All rights reserved.

		Author:	Jeremy
		Date:	5/10/2004

****************************************************************************************************/

#ifndef __IEdge__
#define __IEdge__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCBasicTypes.h"
#include "VMTypes.h"

struct IFacet;
struct IEdge;
struct I3DExVertex;
struct IPolymesh;
struct IPolygon;
class  TBBox3D;


/// \addtogroup ExternalInterface
/// \{

/// IEdge is the interface to access an edge of the vertex primitive (see I3DExVertexPrimitive).
///
struct IEdge: public IMCUnknown
{
public:
	// ****************************************************************************
	//								GetVertex
	// 
	/// Returns a pointer to the vertices of the edge.
	/// 
	/// \param index  The index of the vertices (0 or 1).
	/// 
	virtual I3DExVertex*	MCCOMAPI GetVertex(long index) =0;
	
	// ****************************************************************************
	//								Delete
	// 
	/// Deletes the edge.
	/// 
	virtual void			MCCOMAPI Delete()=0;
	
	virtual void			MCCOMAPI GetBoundingBox(TBBox3D &bbox) =0;

	// ****************************************************************************
	//								SetSelection
	// 
	/// Select or unselect the edge. Depending on the mode used, edges
	///	and polygons around can be selected
	/// 
	/// \param selected       True if the edge is selected.
	/// \param autoSelection  
	/// 
	virtual void			MCCOMAPI SetSelection(boolean selected, boolean autoSelection=true ) =0;
	
	virtual boolean			MCCOMAPI GetSelection(boolean useSymmetry=false)=0;
	virtual I3DExVertex*	MCCOMAPI Subdivide( const real32 ratio=kRealOneHalf )=0;
	virtual void			MCCOMAPI GetPolymesh(IPolymesh** iPolymesh)=0;
	virtual I3DExVertex*	MCCOMAPI GetOtherVertex(I3DExVertex *vertex) =0;
	virtual boolean			MCCOMAPI GetCrease() const=0;
	virtual void			MCCOMAPI SetCrease(boolean crease) =0;
    virtual boolean         MCCOMAPI GetSeam()const=0;
    virtual void            MCCOMAPI SetSeam(boolean seam)=0;
    virtual IPolygon*		MCCOMAPI GetPolygon(long index) =0;
	virtual long			MCCOMAPI GetNbPolygons()=0;
	virtual real			MCCOMAPI Length()=0;
	virtual IPolygon*		MCCOMAPI GetOtherPolygon(IPolygon *polygon) =0;
	virtual IEdge*			MCCOMAPI CloneConjugate()=0;
	virtual void			MCCOMAPI UnlinkDelete()=0;
	
	// ****************************************************************************
	//								GetName
	// 
	/// Returns the name of edge.
	/// 
	/// \param name  The name of the edge.
	virtual void			MCCOMAPI GetName(char* name)=0;
	
	// ****************************************************************************
	//								SetName
	// 
	/// Sets the name of edge.
	/// 
	/// \param name  The name of the edge.
	/// 
	virtual void			MCCOMAPI SetName(char* name)=0;

	// ****************************************************************************
	//								GetBestPlane
	// 
	/// Returns a coordinate system based on the edge and the 
	/// adjacents polygons
	/// 
	/// \param ii      vector in the plane
	/// \param jj      vector in the plane
	/// \param kk      returned vector perpendicular to the plane
	/// \param center  returned the mid edge point
	/// 
	/// \return false if couldn't build a consistant system
	///
	virtual boolean			MCCOMAPI GetBestPlane(TVector3 &ii,TVector3 &jj,TVector3 &kk,TVector3 &center) =0;

	virtual void			MCCOMAPI PropagateEdgeSelection(real angle) =0;

	// ****************************************************************************
	//								GetSelectedPolylinePositions
	// 
	/// 
	virtual int32			MCCOMAPI GetSelectedPolylinePositions(	TMCArray<TVector3>& selectedPolylinePos, TVector3& normal, TVector3& center, int32 constraints, boolean useSymmetry )=0;

	/// Gets the symmetrical edge if any in the mesh and if the symmetrical modeling is enabled
	virtual IEdge*			MCCOMAPI GetSymmetricalEdge() = 0;
};

/// \}




#endif
