
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Christian Fremuth-Paeger, August 2000.
**  
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/             


#if !defined(_DISPLAY_H_)

#define _DISPLAY_H_

#include <absmix.h>


class goblinDisplay : protected goblinDataObject
{
protected:

    abstractMixedGraph &G;
    goblinController CFG;
    
    char* label;
    
    char* predColour;
    char* inftyColour;

    long int width;
    long int height;

public:

    goblinDisplay(abstractMixedGraph &GC,float magnification) throw(ERRejected);
    virtual ~goblinDisplay() throw();

    unsigned long   Allocated() throw();
    
    TFloat          CX(TNode v) throw()
                        {return G.C(v,0);};
    TFloat          CY(TNode v) throw()
                        {return G.C(v,1);};
    TFloat          MaxX() throw()
                        {return G.CMax(0);};
    TFloat          MaxY() throw()
                        {return G.CMax(1);};
    
    long int        CanvasCX(TNode v) throw()
                        {return (long int)(CFG.xShift+G.C(v,0)*CFG.xZoom);};
    long int        CanvasCY(TNode v) throw()
                        {return (long int)(CFG.yShift+G.C(v,1)*CFG.yZoom);};
    long int        AlignedCX(TNode u,TNode v) throw();
    long int        AlignedCY(TNode u,TNode v) throw();
    
    goblinController &Configuration() throw() {return CFG;};
    
    virtual void    DisplayGraph() throw(ERRejected);
    
    char*           ArcLabel(TArc,int) throw(ERRejected);
    char*           NodeLabel(TNode) throw(ERRejected);
    char*           ArcLegenda(int) throw(ERRejected);
    char*           NodeLegenda(char*) throw(ERRejected);
    char*           Colour(TNode) throw();

    
    // *************************************************************** //
    //                Prototypes                                       //
    // *************************************************************** //

    virtual void    DisplayArc(TArc) = 0;
    virtual void    DisplayNode(TNode) = 0;
    virtual void    DisplayLegenda(long int xm,long int ym,long int radius) = 0;

};


#endif
