/******************************************************************************
 CLinkProjectionPanorama.h

				Header for CLinkProjectionPanorama Panorama/EditText Class
	
	Copyright © 1995 Jeff Weeks, Geometry Center. All rights reserved.

	Generated by Visual Architectª 12:26 PM Mon, Nov 27, 1995

	This file is only generated once. You can modify it by filling
	in the placeholder functions and adding any new functions you wish.

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

#include "CLinkProjectionWrapper.h"

extern "C"{
#include "kernel.h"
}
typedef struct LPComponent	LPComponent;
typedef struct LPVertex		LPVertex;
typedef struct LPEdge		LPEdge;
typedef struct LPCrossing	LPCrossing;


class Point
{
 public:
  int h;
  int v;
};

class Rect{
 public:
  int left;
  int right;
  int top;
  int bottom;
};

class test
{
 public:
  int fake;
    test(void);
    ~test(void);
};

class CLinkProjectionPanorama
{
public:
						   CLinkProjectionPanorama(void);
	virtual					~CLinkProjectionPanorama(void);

	virtual KLPProjection	*CreateKLPProjection(void);
	virtual void			FreeKLPProjection(KLPProjection *aKLPProjection);
	virtual	void			ContentsToWindow(CLinkProjectionWrapper *aContents);

protected:

	//	Link components may be circular (complete) or linear (incomplete).
	//	All are kept on the same NULL-terminated singly linked list.
	LPComponent			*itsComponentList;

	//	Keep track of the number of components so we know what index
	//	should be assigned next.
	int					itsNumComponents;

	//	While the user is actively drawing a component, itsHotVertex
	//	is the vertex to which a new vertex will be connected.
	//	By convention, itsHotVertex must be the last LPVertex in a
	//	linear component.  (So if the user selects the first vertex
	//	in a linear component, the program redirects the component to
	//	make the selected vertex the last one.)  When no hot vertex is
	//	selected, itsHotVertex is NULL.
	LPVertex			*itsHotVertex;

	//	The crossings are kept on a NULL-terminated, singly linked list.
	LPCrossing			*itsCrossingList;


	virtual Boolean		AllComponentsComplete(void);
	virtual int			CountCrossings(void);
	virtual int			CountFreeLoops(void);
	virtual void		AssignKLPCrossings(KLPCrossing *theKLPCrossings);
	virtual void		InitKPCCrossings(void);
	virtual void		TransferCrossingData(void);
	virtual void		TransferHandednessData(LPCrossing *aCrossing);
	virtual void		TransferStrandData(LPCrossing *aCrossing);
	virtual void		FindNextCrossing(LPCrossing *aFromCrossing, LPEdge *aFromEdge, LPCrossing **aToCrossing, LPEdge **aToEdge);
	virtual LPCrossing	*FindCrossingJustAfter(LPEdge *anEdge, int aMinimumDistance);
	virtual void		RecordNeighbors(LPCrossing *aFromCrossing, LPEdge *aFromEdge, LPCrossing *aToCrossing, LPEdge *aToEdge);
	virtual KLPStrandType	GetStrandType(LPCrossing *aCrossing, LPEdge *anEdge);
	virtual void		TransferComponentData(LPCrossing *aCrossing);
	virtual void		EraseKLPCrossingPointers(void);
	virtual void		MaybeCreateOneCrossing(LPEdge *anOverstrand, LPEdge *anUnderstrand);
	virtual void		CalculateEquation(LPEdge *aNewEdge);

	virtual void		FreeLinkProjection(void);
	virtual void		FreeComponent(LPComponent *aComponent);
};

void SetRect(Rect* r, int a, int b, int c, int d);
