00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CONROUTER_H
00012 #define CONROUTER_H
00013
00014 #include "cells.h"
00015
00016 #include <qpoint.h>
00017 #include <qvaluelist.h>
00018
00019 class ICNDocument;
00020 class Cell;
00021
00022 typedef QValueList<QPoint> QPointList;
00023 typedef QValueList<QPointList> QPointListList;
00024
00036
00037
00038
00039
00040
00041
00042 class ConRouter
00043 {
00044 public:
00045 ConRouter( ICNDocument *cv );
00046 ~ConRouter();
00047
00051 void mapRoute( int sx, int sy, int ex, int ey );
00055 void translateRoute( int dx, int dy );
00060 void setPoints( const QPointList &pointList, bool reverse = false );
00064 void setRoutePoints( const QPointList &pointList );
00068 bool needsRouting( int sx, int sy, int ex, int ey ) const;
00072 QPointList pointList( bool reverse ) const;
00076 QPointList *cellPointList() { return &m_cellPointList; }
00082 QPointListList splitPoints( const QPoint &pos ) const;
00087 QPointListList dividePoints( uint n ) const;
00088
00089 protected:
00093 bool checkLineRoute( int scx, int scy, int ecx, int ecy, int maxConScore, int maxCIScore );
00094 void checkACell( int x, int y, Cell *prev, int prevX, int prevY, int nextScore );
00095 void checkCell( int x, int y );
00099 void removeDuplicatePoints();
00100
00101 int xcells, ycells;
00102 int m_lcx, m_lcy;
00103 Cells *cellsPtr;
00104 TempLabelMap tempLabels;
00105 ICNDocument *p_icnDocument;
00106 QPointList m_cellPointList;
00107 };
00108
00109 #endif