HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / Edge.h
blob012c23cc4b8b7f74e0f8151a716ef22f464bf9a1
1 // CEdge class
2 // Copyright © 2009 The University of Chicago
3 #ifndef EDGE_H
4 #define EDGE_H
6 #include <q3canvas.h>
7 #include <qrect.h>
8 #include <Q3PtrList>
10 #include "Parse.h"
12 class CGrammarRule;
14 class CEdge : public CParse
16 int m_Start;
17 int m_End;
18 int m_DotLocation;// the number of the Parse piece to the right of the dot.
19 double m_X, m_Y; // coordinates for display;
20 bool m_InFinalParse;
21 int m_MinimumLength;
22 int m_Depth;
23 Q3PtrList<Q3CanvasItem> m_CanvasItems;
25 public:
27 CEdge* m_Parent;
28 Q3PtrList<CEdge> m_Daughters;
30 public:
32 CEdge();
33 CEdge( CEdge& );
34 CEdge( CGrammarRule*, CParse*, int DotLocation );
35 CEdge( CParse& Cat, QString Word, int i, int End ); // for Scanner
38 int GetDotLocation();
39 void SetDotLocation(int n);
40 void SetEnd (int n ) { m_End = n; }
41 virtual ~CEdge();
44 QString LHS();
45 CStringSurrogate GetLHS();
46 void SetLHS( QString );
47 QString RHS();
49 int GetStart();
50 int GetEnd();
51 CStringSurrogate GetNextNode(); // the one to the right of the dot, which is m_DotLocation + 1;
52 void SetStart(int n );
53 void GetParse( CParse*, bool clearParse = TRUE );
54 int getDepth() const { return m_Depth; }
55 void setDepth( int d ) { m_Depth = d; }
56 bool Complete();
57 bool Incomplete();
58 void MoveDotToTheRight();
59 bool NextNodeIsNonterminal();
60 bool NextNodeIsTerminal();
62 QString Display();
63 QString DisplayParse( QMap<QString, QString>* filter = NULL );
64 QRect drawTree( Q3Canvas*, int, int, QMap<QString, QString>* filter = NULL );
65 void shiftTree( Q3Canvas*, int, int );
66 int getMinimumLength() { return m_MinimumLength; }
67 void setMinimumLength( int, QMap<QString,int>* = NULL );
70 #endif // EDGE_H