1 // File: GLViewer_Tools.h
2 // Created: April, 2005
5 #ifndef GLVIEWER_TOOLS_H
6 #define GLVIEWER_TOOLS_H
13 #include "GLViewer_Defs.h"
15 class GLViewer_LineField;
17 /****************************************************************************
18 ** Class: GLViewer_Tools
19 ** Descr: Tools for Viewer
21 ** Created: UI team, 27.10.05
22 *****************************************************************************/
23 class GLVIEWER_API GLViewer_Tools
27 //virtual ~GLViewer_Tools();
38 /****************************************************************************
39 ** Class: GLViewer_LineList
40 ** Descr: Tools for distinct line
42 ** Created: UI team, 27.10.05
43 *****************************************************************************/
44 class GLViewer_LineList
47 GLViewer_LineList( int );
48 virtual ~GLViewer_LineList();
50 int count() const { return mySegmentNumber; }
51 int size() const { return myRealSize; }
53 bool addSegment( double coord1, double coord2 );
54 bool removeSegment( int index );
55 bool removeSegment( double coord1, double coord2 );
57 bool readSegment( int index, double&, double& );
59 int contains( double thePoint ) const;
61 void setMainCoord( double theVal ) { myMainCoord = theVal; }
62 double mainCoord() const { return myMainCoord; }
67 void show( FieldDim );
69 GLViewer_LineList& operator = ( GLViewer_LineList );
85 int prevNodeIndex; //feedback for searching for solution
97 /****************************************************************************
98 ** Class: GLViewer_LineField
99 ** Descr: Tools for solving
101 ** Created: UI team, 27.10.05
102 *****************************************************************************/
103 class GLViewer_LineField
127 GLViewer_LineField();
128 GLViewer_LineField( const int theMAXSize, const int xn, const int yn );
129 virtual ~GLViewer_LineField();
131 //best way, if line is already sorted
132 void addLine( FieldDim, GLViewer_LineList* );
133 void addLine( FieldDim theDim, double theMC, double theBegin, double theEnd );
134 // void addLine( FieldDim, double theMainCoord, double theBegin, double theEnd ):
136 int insertLine( FieldDim theDim, GLViewer_LineList*, int thePosition ); // return position
137 int insertLine( FieldDim theDim, double theMC, double theBegin, double theEnd, int thePosition ); // return position
139 static FieldDim invertDim( FieldDim );
141 GLViewer_LineList* getLine( int index, FieldDim );
143 void setBorders( double X1, double X2, double Y1, double Y2 );
144 void addRectangle( double top, double right, double bottom, double left );
146 int* intersectIndexes( FieldDim theDim, int theIndex, const GLViewer_LineList* theLL , int& theSize );
152 int getDimSize( FieldDim );
155 bool setPoint( FieldPoint, double, double );
158 void initialize();//needs call setPoint before
159 EndStatus startAlgorithm();//main method
161 double* solution( int& );
165 IterationStatus checkComplete();
167 int* findByCount( int& theParam );
168 int findBySegment( FieldDim, int, int, bool inCurArray = true );
170 GraphNode* getCurArray();
171 GraphNode* getSecArray();
175 GLViewer_LineList** getLLArray( FieldDim );
178 GLViewer_LineList** myXLineArray,
184 GraphNode* myGraphArray1,
188 SearchPoint myStartPoint,
193 #endif //GLVIEWER_TOOLS_H