Main Page Class Hierarchy Compound List File List Compound Members

# graph.h

    00001 /*
    00002 Program GRAPH.H
    00003 Purpose Used to Intercect and other process functions
    00004 Last Update     03-04-1996
    00005 */
    00006
    00007 #ifndef GRAPH_H
    00008 #define GRAPH_H
    00009
    00010 #ifdef __GNUG__
    00011 #pragma interface
    00012 #endif
    00013
    00014 #include <assert.h>
    00015 #include "misc.h"
    00016 #include "link.h"
    00017 #include "line.h"
    00018 #include "scanbeam.h"
    00019 #include "_lnk_itr.h"
    00020
    00021 class Node;
    00022
    00023 class GraphList;
    00024
    00025 class Graph
    00026
    00027 {
    00028         public:
    00029       friend class Debug_driver;
    00030       Graph();
    00031       Graph(Link*);
    00032       ~Graph();
    00033
    00034       bool               GetBin()                                                       { return _bin; };
    00035       void                       SetBin(bool b)                                         { _bin = b; };
    00036
    00037                 void                     Prepare();
    00038                 void         Round(B_INT grid);
    00039                 void                     Rotate(bool plus90);
    00040                 void                     AddLink(Node *begin,Node *end);                        // adds a link to the linklist
    00041                 void                     AddLink(Link *a_link);                                 // adds a link to the linklist
    00042                 bool             AreZeroLines(B_INT Marge);     // are ther zero lines ?
    00043                 void                     DeleteDoubles();                         // Delete parallel lines
    00044                 bool             DeleteZeroLines(B_INT Marge);// delete zerolines
    00045                 bool             RemoveNullLinks();
    00046
    00047                 void                     ProcessCrossings();                                            // Process found intersections
    00048                 void         Set_Operation_Flags();                   // set flags for operations based on group
    00049                                                                                                                                                                 // Left Right values
    00050                 void                     Remove_IN_Links();                                                             // Remove unused links
    00051                 void                     ReverseAllLinks();
    00052
    00053                 bool             Simplify(B_INT Marge );                                        // Simplify the graph
    00054
    00055                 bool             Smoothen(B_INT Marge);
    00056
    00057                 void                     TakeOver(Graph*);                        // Takes over all links of the argument
    00058
    00059                 // function for maximum performance
    00060
    00061                 Link*                   GetFirstLink();                                                                 // Get the First link from the graph
    00062                 Node*                   GetTopNode();
    00063                 void                    SetBeenHere(bool);
    00064            void                         Graph::Reset_flags();
    00065                 void                    SetGroup(GroupType);                                    // Set the group of a graph
    00066                 void                    SetNumber(const int);                           // Set the number of the graph
    00067                 void                    Reset_Mark_and_Bin();
    00068                 bool            GetBeenHere();
    00069                 int                     GetGraphNum();
    00070                 int                     GetNumberOfLinks();
    00071
    00072                 void        Boolean(BOOL_OP operation,GraphList* Result);
    00073                 void        Correction(GraphList* Result,B_INT factor);
    00074                 void        MakeRing(GraphList* Result,B_INT factor);
    00075                 void        CreateRing(GraphList *ring,B_INT factor);
    00076                 void        CreateRing_fast(GraphList *ring,B_INT factor);
    00077                 void        CreateArc(Node* center, Line* incoming, Node* end,double radius,double aber);
    00078                 void        CreateArc(Node* center, Node* begin, Node* end,double radius,bool clock,double aber);
    00079                 void        MakeOneDirection();
    00080                 void        Make_Rounded_Shape(Link* a_link, B_INT factor);
    00081                 bool            MakeClockWise();
    00082                 bool            writegraph(bool linked);
    00083                 bool            writeintersections();
    00084
    00085         protected:
    00086                 void                     Extract_Simples(BOOL_OP operation, bool detecthole);
    00087                                                                                               // Extracts partical polygons from the graph
    00088                 void                     Split(GraphList* partlist);
    00089                 void                     CollectGraph(Node *current_node, BOOL_OP operation, bool detecthole,int graphnumber);
    00090                                                                                                         // Collect a graph by starting at argument link
    00091                 Node*                    GetMostTopLeft(TDLI<Link>* _LI);
    00092                 void                     CalculateCrossings(B_INT Marge);
    00093                 int                      Merge_NodeToNode(B_INT Marge);
    00094                 int                      ScanGraph2(SCANTYPE scantype);
    00095                 void                     DeleteNonCond(BOOL_OP operation);
    00096            bool                  checksort();
    00097                 bool             Small(B_INT howsmall);
    00098
    00099
    00100                 bool             _bin;
    00101
    00102                 DL_List<void*>*         _linklist;
    00103
    00104 };
    00105
    00106 #endif
    00107

graph.h Source File -- Thu Nov 28 21:24:56 2002 -- 28 Nov 2002 -- 1.2.18 -- -- . -- Main Page