IBM ILOG Solver Debugger User's Manual > IlcDrawingBoard

Category

C++ class

Description

The class IlcDrawingBoard provides a 2D representation of the search algorithm.

Include File

<ilsolver/drawingboard.h>

Synopsis

class IlcDrawingBoard 
{ 
public: 
  IlcDrawingBoard(IlcSolverDebugger debugger,
                  IloInt width = 100,
                  IloInt height = 100,
                  IloNum scaleH = 1.0,
                  IloNum scaleV = 1.0); 
  IlcDrawingBoard(IlcDrawingBoardI* impl = 0); 
  void clean(); 
  IlcIntExp constantInt(IloInt value) const; 
  IlcFloatExp constantNum(IloNum value) const; 
  void drawArc(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,
               IloInt rectWidth, IloInt rectHeight, 
               IlcFloat startAngle, IlcFloat angleRange,
               IloInt th);
  void drawArrow(IloInt id, IloInt x1, IloInt y1,
                 IloInt x2, IloInt y2, IloInt th, 
                 const char* col = "black");
  void drawEllipse(IloInt id, IloInt xLowerLeft,
                   IloInt yLowerLeft, IloInt rectWidth,
                   IloInt rectHeight, IloInt th);
  void drawFilledArc(IloInt id, IloInt xLowerLeft, 
                     IloInt yLowerLeft, IloInt rectWidth,
                     IloInt rectHeight, IlcFloat startAngle,
                     IlcFloat angleRange,
                     const char* col, IloInt th);
  void drawFilledEllipse(IloInt id, IloInt xLowerLeft, 
                         IloInt yLowerLeft, IloInt rectWidth,
                         IloInt rectHeight, const char* col,
                         IloInt th);
  void drawFilledLabel(IloInt id, IloInt x, IloInt y,
                       const char* str, const char* col);
  void drawFilledPolygon(IloInt id, IloInt x[], IloInt y[],
                         IloInt count, const char* col,
                         IloInt th, IloInt fillRule);
  void drawFilledRectangle(IloInt id, IloInt xLowerLeft, 
                           IloInt yLowerLeft,
                           IloInt rectWidth, 
                           IloInt rectHeight,
                           const char* col, IloInt th);
  void drawFilledRoundedRectangle(IloInt id,  IloInt xLowerLeft,
                                  IloInt yLowerLeft,
                                  IloInt rectWidth,
                                  IloInt rectHeight, 
                                  IlcFloat rc, 
                                  const char* col,
                                  IloInt th);
  void drawGrid(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,
                IloInt rectWidth, IloInt rectHeight, 
                IloInt cols, IloInt rows, IloInt th);
  void drawLabel(IloInt id, IloInt x, IloInt y, const char* str);
  void drawLine(IloInt id, IloInt x1, IloInt y1,
                IloInt x2, IloInt y2, IloInt th,
                const char* col = "black");
  void drawPolyline(IloInt id, IloInt x[], IloInt y[],
                    IloInt count, IloInt th);
  void drawRectangle(IloInt id, IloInt xLowerLeft,
                     IloInt yLowerLeft, IloInt rectWidth,
                     IloInt rectHeight, IloInt th);
  void drawRoundedRectangle(IloInt id, IloInt xLowerLeft,
                            IloInt yLowerLeft,
                            IloInt rectWidth,
                            IloInt rectHeight,
                            IlcFloat rc, IloInt th);
  void eraseGraphic(IloInt id);
  void makeArc(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,
               IlcIntExp rectWidth, IlcIntExp rectHeight,
               IlcFloatExp startAngle, 
               IlcFloatExp angleRange,IlcIntExp th);
  void makeArrow(IlcIntExp x1, IlcIntExp y1,
                 IlcIntExp x2, IlcIntExp y2,
                 IlcIntExp th, const char* col = "black"); 
  void makeEllipse(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,
                   IlcIntExp rectWidth, IlcIntExp rectHeight, 
                   IlcIntExp th);
  void makeFilledArc(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,
                     IlcIntExp rectWidth, IlcIntExp rectHeight,
                     IlcFloatExp startAngle, 
                     IlcFloatExp angleRange,
                     const char* col, IlcIntExp th); 
  void makeFilledEllipse(IlcIntExp xLowerLeft, 
                         IlcIntExp yLowerLeft,
                         IlcIntExp rectWidth, 
                         IlcIntExp rectHeight,
                         const char* col, IlcIntExp th); 
  void makeFilledLabel(IlcIntExp x, IlcIntExp y,
                       const char* str, const char* col); 
  void makeFilledPolygon(IlcIntVarArray x,IlcIntVarArray y,
                         const char* col, IlcIntExp th,
                         IlcIntExp fillRule); 
  void makeFilledRectangle(IlcIntExp xLowerLeft, 
                           IlcIntExp yLowerLeft,
                           IlcIntExp rectWidth, 
                           IlcIntExp rectHeight,
                           const char* col, IlcIntExp th); 
  void makeFilledRoundedRectangle(IlcIntExp xLowerLeft, 
                                  IlcIntExp yLowerLeft,
                                  IlcIntExp rectWidth, 
                                  IlcntExp rectHeight,
                                  IlcFloatExp rc,
                                  const char* col,
                                  IlcIntExp th); 
  void makeGrid(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,
                IlcIntExp rectWidth, IlcIntExp rectHeight,
                IlcIntExp cols, IlcIntExp rows,
                IlcIntExp th); 
  void makeLabel(IlcIntExp x, IlcIntExp y,const char* str); 
  void makeLine(IlcIntExp x1, IlcIntExp y1,
                IlcIntExp x2, IlcIntExp y2,
                IlcIntExp th,const char* col = "black"); 
  int  makeNewGraphicObject();
  void makePolyline(IlcIntVarArray x, IlcIntVarArray y,
                    IlcIntExp th); 
  void makeRectangle(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,
                     IlcIntExp rectWidth, IlcIntExp rectHeight,
                     IlcIntExp th); 
  void makeRoundedRectangle(IlcIntExp xLowerLeft, 
                            IlcIntExp yLowerLeft,
                            IlcIntExp rectWidth, 
                            IlcIntExp rectHeight,
                            IlcFloatExp rc, IlcIntExp th); 
  void setBackgroundColor(const char* col); 
}; 

Constructors

IlcDrawingBoard(IlcSolverDebugger debugger,

IloInt width = 100,

IloInt height = 100,

IloNum scaleH = 1.0,

IloNum scaleV = 1.0);

Creates a new Drawing Board. The width parameter indicates the width of the panel when undocked. The height parameter indicates the height of the panel when undocked. The parameter scaleH has a value between 0 and 2. It indicates the horizontal scale factor. The parameter scaleV has a value between 0 and 2. It indicates the vertical scale factor.

IlcDrawingBoard(IlcDrawingBoardI* impl = 0);

Creates a new handle class on the same Drawing Board implementation object.

Member Functions

void clean();

Deletes all information from the Drawing Board.

IlcIntExp constantInt(IloInt value) const;

Creates an IlcIntExp object containing an integer constant.

IlcFloatExp constantNum(IloNum value) const;

Creates an IlcFloatExp object containing a floating-point constant.

void drawArc(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,

IloInt rectWidth, IloInt rectHeight,

IlcFloat startAngle, IlcFloat angleRange,

IloInt th);

Creates a nonbacktrackable arc identified byid and embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The angle of the arc begins at position startAngle and moves, in a clockwise direction, the number of degrees indicated by angleRange. The line of the arc is of thickness th.

void drawArrow(IloInt id, IloInt x1, IloInt y1, IloInt x2, IloInt y2,

IloInt th, const char* col="black");

Creates a nonbacktrackable arrow identified by id. The arrow starts at (x1,y1) and ends at (x2,y2). The thickness of the line is th and the default color of the arrow is black.

void drawEllipse(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,

IloInt rectWidth, IloInt rectHeight, IloInt th);

Creates a nonbacktrackable empty ellipse identified by id and embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The outline of the ellipse is of thickness th.

void drawFilledArc(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,

IloInt rectWidth, IloInt rectHeight,

IlcFloat startAngle, IlcFloat angleRange,

const char* col, IloInt th);

Creates a nonbacktrackable filled arc identified byid and embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The angle of the arc begins at position startAngle and moves, in a clockwise direction, the number of degrees indicated by angleRange. The line of the arc is of thickness th and the segment is filled with the color col.

void drawFilledEllipse(IloInt id, IloInt xLowerLeft,

IloInt yLowerLeft, IloInt rectWidth,

loInt rectHeight, const char* col,

IloInt th);

Creates a nonbacktrackable filled ellipse identified byid and embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The outline of the ellipse is of thickness th and the ellipse is filled with the color col

void drawFilledLabel(IloInt id, IloInt x, IloInt y,

const char* str, const char* col);

Creates a nonbacktrackable filled label identified byid. The label is anchored at the point (x,y), contains the character string str and is of the color specified by col.

void drawFilledPolygon(IloInt id, IloInt x[], IloInt y[],

IloInt count, const char* col,

IloInt th, IloInt fillRule);

Creates a nonbacktrackable polygon identified byid and filled with the color col. The parameter th indicates the thickness of the line. The two integer array parameters x[], y[] specifying the X and Y coordinates must be of the same size. The count parameter indicates the number of point coordinates. The fillRule parameter indicates which points are to be considered as being inside the polygon, depending on the number of crossing segments that define the shape of the area to be filled. There are two rules to define the shape:

images/boardfillrule.gif

void drawFilledRectangle(IloInt id, IloInt xLowerLeft,

IloInt yLowerLeft, IloInt rectWidth,

IloInt rectHeight, const char* col,

IloInt th);

Creates a nonbacktrackable rectangle identified byid and filled with the color col. The rectangle is anchored at the point (xLowerLeft, yLowerLeft) and its dimensions are rectWidth, rectHeight. The outline of the rectangle is of thickness th.

void drawFilledRoundedRectangle(IloInt id, IloInt xLowerLeft,

IloInt yLowerLeft,

IloInt rectWidth,

IloInt rectHeight,

IlcFloat rc, const char* col,

IloInt th);

Creates a nonbacktrackable rectangle with rounded corners and filled with the color col. The rectangle is identified byid. The parameters are similar to those of drawFilledRectangle above, except for rc, which specifies the amplitude of the arc used for the rounded corners.

void drawGrid(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,

IloInt rectWidth, IloInt rectHeight,

IloInt cols, IloInt rows, IloInt th);

Creates a nonbacktrackable grid identified byid and embedded in a rectangle. The rectangle is specified by the anchor points xLowerLeft, yLowerLeft, and the dimensions rectWidth, rectHeight. The columns and rows in the grid are specified by the integers cols and rows. The lines of the grid are of thickness th.

void drawLabel(IloInt id, IloInt x, IloInt y, const char* str);

Creates a nonbacktrackable label identified byid. The label is anchored at the point (x,y) and contains the character string str.

void drawLine(IloInt id, IloInt x1, IloInt y1, IloInt x2, IloInt y2,

IloInt th, const char* col = "black");

Creates a nonbacktrackable line identified byid. The line, drawn between the two points (x1,y1) and (x2,y2), is of thickness th and default color black.

void drawPolyline(IloInt id, IlcInt x[], IlcInt y[],

IlcInt count, IlcInt th);

Creates a nonbacktrackable polyline identified byid. The two integer array parameters x[], y[] specifying the X and Y coordinates must be of the same size. The count parameter indicates the number of point coordinates. The th parameter indicates the thickness of the line. To obtain an empty polygon, give the same value to the first X and last X and to the first Y and last Y.

void drawRectangle(IloInt id, IloInt xLowerLeft, IloInt yLowerLeft,

IloInt rectWidth, IloInt rectHeight, IloInt th);

Creates a nonbacktrackable empty rectangle identified byid. The rectangle is anchored at the point (xLowerLeft, yLowerLeft) and its dimensions are rectWidth, rectHeight. The outline of the rectangle is of thickness th.

void drawRoundedRectangle(IloInt id, IloInt xLowerLeft,

IloInt yLowerLeft, IloInt rectWidth,

IloInt rectHeight, IlcFloat rc,

IloInt th);

Creates a nonbacktrackable empty rectangle with rounded corners, identified byid. The parameters are similar to those of drawRectangle above, except for rc, which specifies the amplitude of the arc used for the rounded corners.

void eraseGraphic(IloInt id);

Erases a nonbacktrackable graphic identified byid.

void makeArc(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcFloatExp startAngle, IlcFloatExp angleRange,

IlcIntExp th);

Creates a backtrackable arc embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The angle of the arc begins at position startAngle and moves, in a clockwise direction, the number of degrees indicated by angleRange. The line of the arc is of thickness th.

void makeArrow(IlcIntExp x1, IlcIntExp y1, IlcIntExp x2, IlcIntExp y2,

IlcIntExp th, const char* col = "black");

Creates a backtrackable arrow that starts at the point (x1,y1) and ends at the point (x2,y2). The thickness of the line is th and the default color of the arrow is black.

void makeEllipse(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcIntExp th);

Creates a backtrackable empty ellipse embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The outline of the ellipse is of thickness th.

void makeFilledArc(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcFloatExp startAngle, IlcFloatExp angleRange,

const char* col, IlcIntExp th);

Creates a backtrackable filled arc embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The angle of the arc begins at position startAngle and moves, in a clockwise direction, the number of degrees indicated by angleRange. The line of the arc is of thickness th and the segment is filled with the color col.

void makeFilledEllipse(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

const char* col, IlcIntExp th);

Creates a backtrackable filled ellipse embedded in a rectangle. The rectangle is specified by the lower left coordinates xLowerLeft, yLowerLeft, the width rectWidth and the height rectHeight. The outline of the ellipse is of thickness th and the ellipse is filled with the color col

void makeFilledLabel(IlcIntExp x, IlcIntExp y,

const char* str, const char* col);

Creates a backtrackable filled label. The label is anchored at the point (x,y), contains the character string str and has the background color specified by col.

void makeFilledPolygon(IlcIntVarArray x, IlcIntVarArray y,

const char* col, IlcIntExp th,

IlcIntExp fillRule);

Creates a backtrackable polygon filled with the color col. The th parameter indicates the line thickness. The two integer array parameters x, y specifying the X and Y coordinates, must be of the same size. The fillRule parameter indicates which points are to be considered as being inside the polygon, depending on the number of crossing segments that define the shape of the area to be filled. There are two rules to define the shape:

See the method drawFilledPolygon for an explanation of these rules.

void makeFilledRectangle(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

const char* col, IlcIntExp th);

Creates a backtrackable rectangle filled with the color col. The rectangle is anchored at the point (xLowerLeft, yLowerLeft) and its dimensions are rectWidth, rectHeight. The outline of the rectangle is th pixels thick.

void makeFilledRoundedRectangle(IlcIntExp xLowerLeft,

IlcIntExp yLowerLeft,

IlcIntExp rectWidth,

IlcIntExp rectHeight,

IlcFloatExp rc,

const char* col, IlcIntExp th);

Creates a backtrackable rectangle with rounded corners. The parameters are similar to those of makeFilledRectangle above, except for rc, which specifies the amplitude of the arc used for the rounded corners.

void makeGrid(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcIntExp cols, IlcIntExp rows, IlcIntExp th);

Creates a backtrackable grid embedded in a rectangle. The rectangle is specified by the anchor points xLowerLeft, yLowerLeft, and the dimensions rectWidth, rectHeight. The columns and rows in the grid are specified by the integers cols and rows. The lines of the grid are of thickness th.

void makeLabel(IlcIntExp x, IlcIntExp y, const char* str);

Creates a backtrackable label anchored at the point (x,y) and containing the character string str.

void makeLine(IlcIntExp x1, IlcIntExp y1, IlcIntExp x2, IlcIntExp y2,

IlcIntExp th, const char* col = "black");

Creates a backtrackable line between the two points (x1,y1) and (x2,y2), of thickness th and default color black.

int makeNewGraphicObject();

Creates a new nonbacktrackable 2D graphic object.

void makePolyline(IlcIntVarArray x, IlcIntVarArray y, IlcIntExp th);

Creates a backtrackable polyline.The two integer array parameters x, y, specifying the X and Y coordinates, must be of the same size. The th parameter indicates the thickness of the line. To obtain an empty polygon, give the same value to the first X and last X and to the first Y and last Y.

void makeRectangle(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcIntExp th);

Creates a backtrackable empty rectangle. The rectangle is anchored at the point (xLowerLeft, yLowerLeft) and its dimensions are rectWidth, rectHeight. The outline of the rectangle is th pixels thick.

void makeRoundedRectangle(IlcIntExp xLowerLeft, IlcIntExp yLowerLeft,

IlcIntExp rectWidth, IlcIntExp rectHeight,

IlcFloatExp rc, IlcIntExp th);

Creates a backtrackable empty rectangle with rounded corners. The parameters are similar to those of makeRectangle above, except for rc, which specifies the amplitude of the arc used for the rounded corners.

void setBackgroundColor(const char* col);

The parameter col sets the background color for the Drawing Board.