#ifndef GRAPHH
#define GRAPHH

#include "stdio.h"
#include "stdlib.h"
#include "cudd/include/cudd.h" 
#include "cudd/include/util.h"
#include "cudd/include/cuddInt.h"


#define MAXNODENAME 60		
#define MD_SIMPY 0
#define MD_GREED 1
#define MD_BARYCENTERS 2


// -----------------------------------------------------------------
// struktura obsahujici informace o uzlech grafu

typedef struct {
	unsigned int FONTSIZE;
}GRAPHINFO;

typedef struct Node{
	char *name;
	Node *pThen;
	Node *pElse;
	POINT loc;	// souradnice, kde je uzel umisteny v grafu
	int type;	// typ uzlu, 0 uzel 1 koren 2 dummy pThen hrany  3 dummy pElse hrany 4 dummy hrany vstupniho uzlu
	bool comp;	// true pokud je pElse hrana negovana
}NODE, *PNODE;

typedef struct insNode{
	DdNode *pBDNode;
	Node *newNode;
	insNode *next;
}INSNODE;


typedef struct {
	NODE ***graph;
	POINT size;
	POINT shift;
	NODE *one;
	INSNODE *inserted;
	unsigned int grid;
	unsigned int border;
}GRAPH, *PGRAPH;


extern void Cudd_GraphSavePs(GRAPH *g, char *path);
extern bool Cudd_GraphMake(GRAPH *g, DdManager *manager, 
				DdNode **f, int out, int in, char **oNames, char **iNames);
extern double Cudd_GraphEvaluate(GRAPH *g, bool ignored);
extern void Cudd_GraphDelete(GRAPH *g);
extern void Cudd_GraphOptimalize(GRAPH *g, int method, int iter);
extern POINT GetCoord(GRAPH *g, POINT A);
extern void GetNameRect(GRAPH *g, POINT witch, POINT *retA, POINT *retB);

#endif