canvasBuilder Class Reference
[Building canvasses]

Builder class interface for displaying a canvas or writing canvas files. More...

#include <canvasBuilder.h>

Inheritance diagram for canvasBuilder:

managedObject goblinRootObject exportToDot exportToTk exportToXFig

Public Types

enum  TArrowDir {
  ARROW_NONE = 0,
  ARROW_FORWARD = 1,
  ARROW_BACKWARD = 2,
  ARROW_BOTH = 3
}
enum  TLineStyle {
  LINE_STYLE_SOLID = 0,
  LINE_STYLE_DOT = 1,
  LINE_STYLE_DASH = 2,
  LINE_STYLE_DASH_DOT = 3,
  LINE_STYLE_ZIG_ZAG = 8,
  LINE_STYLE_WAVED = 16
}
enum  TArcVisibilityMode {
  ARC_DISPLAY_HIDE_ALL = 0,
  ARC_DISPLAY_SUBGRAPH = 1,
  ARC_DISPLAY_PREDECESSORS = 2,
  ARC_DISPLAY_PRED_SUB = 3,
  ARC_DISPLAY_SHOW_ALL = 4
}
enum  TArcShapeMode {
  ARC_SHAPE_POLYGONES = 0,
  ARC_SHAPE_SMOOTH = 1
}
enum  TArcWidthMode {
  ARC_WIDTH_UNIFORM = 0,
  ARC_WIDTH_PREDECESSORS = 1,
  ARC_WIDTH_SUBGRAPH = 2,
  ARC_WIDTH_FLOW_LINEAR = 3,
  ARC_WIDTH_FLOW_LOGARITHMIC = 4,
  ARC_WIDTH_EMPTY_FREE_FULL = 5
}
enum  TArcStippleMode {
  ARC_STIPPLE_OFF = 0,
  ARC_STIPPLE_PREDECESSORS = 1,
  ARC_STIPPLE_FREE = 2,
  ARC_STIPPLE_FRACTIONAL = 3,
  ARC_STIPPLE_COLOURS = 4,
  ARC_STIPPLE_VOID = 5,
  ARC_STIPPLE_SUBGRAPH = 6
}
enum  TArcColourMode {
  ARCS_UNCOLOURED = 0,
  ARCS_FIXED_COLOURS = 1,
  ARCS_REPEAT_COLOURS = 2,
  ARCS_FLOATING_COLOURS = 3,
  ARCS_COLOUR_PRED = 4
}
enum  TArrowDisplayMode {
  ARROWS_ARC_ORIENTATION = 0,
  ARROWS_OFF = 1,
  ARROWS_IMPL_ORIENTATION = 2,
  ARROWS_FLOW_DIRECTION = 3,
  ARROWS_LIKE_PREDECESSORS = 4
}
enum  TArrowPosMode {
  ARROWS_AT_ENDS = 0,
  ARROWS_CENTERED = 1
}
enum  TNodeShapeMode {
  NODE_SHAPE_POINT = 0,
  NODE_SHAPE_CIRCULAR = 1,
  NODE_SHAPE_BOX = 2,
  NODE_SHAPE_BY_COLOUR = 3
}
enum  TNodeColourMode {
  NODES_UNCOLOURED = 0,
  NODES_COLOUR_BY_DISTANCE = 1,
  NODES_FIXED_COLOURS = 2,
  NODES_COLOUR_BY_DEMAND = 3,
  NODES_FLOATING_COLOURS = 4
}
enum  TGridDisplayMode {
  GRID_DISPLAY_OFF = 0,
  GRID_DISPLAY_ALL = 1
}
enum  TXFigFontType {
  FONT_TIMES_ROMAN = 0,
  FONT_TIMES_ITALIC = 1,
  FONT_TIMES_BOLD = 2,
  FONT_TIMES_BOLD_ITALIC = 3,
  FONT_AVANTGARDE_BOOK = 4,
  FONT_AVANTGARDE_BOOK_OBLIQUE = 5,
  FONT_AVANTGARDE_DEMI = 6,
  FONT_AVANTGARDE_DEMI_OBLIQUE = 7,
  FONT_BOOKMAN_LIGHT = 8,
  FONT_BOOKMAN_LIGHT_ITALIC = 9,
  FONT_BOOKMAN_DEMI = 10,
  FONT_BOOKMAN_DEMI_ITALIC = 11,
  FONT_COURIER = 12,
  FONT_COURIER_OBLIQUE = 13,
  FONT_COURIER_BOLD = 14,
  FONT_COURIER_BOLD_OBLIQUE = 15,
  FONT_HELVETICA = 16,
  FONT_HELVETICA_OBLIQUE = 17,
  FONT_HELVETICA_BOLD = 18,
  FONT_HELVETICA_BOLD_OBLIQUE = 19,
  FONT_HELVETICA_NARROW = 20,
  FONT_HELVETICA_NARROW_OBLIQUE = 21,
  FONT_HELVETICA_NARROW_BOLD = 22,
  FONT_HELVETICA_NARROW_BOLD_OBLIQUE = 23,
  FONT_NEW_CENTURY_SCHOOLBOOK_ROMAN = 24,
  FONT_NEW_CENTURY_SCHOOLBOOK_ITALIC = 25,
  FONT_NEW_CENTURY_SCHOOLBOOK_BOLD = 26,
  FONT_NEW_CENTURY_SCHOOLBOOK_BOLD_ITALIC = 27,
  FONT_PALATINO_ROMAN = 28,
  FONT_PALATINO_ITALIC = 29,
  FONT_PALATINO_BOLD = 30,
  FONT_PALATINO_BOLD_ITALIC = 31,
  FONT_SYMBOL = 32,
  FONT_ZAPF_CHANCERY_MEDIUM_ITALIC = 33,
  FONT_ZAPF_DINGBATS = 34
}
enum  {
  PRED_COLOUR = 0,
  INFTY_COLOUR = 1,
  NO_COLOUR = 2,
  OUTLINE_COLOUR = 3,
  GRID_COLOUR = 4,
  ZERO_COLOUR = 5,
  MAX_COLOUR = 25
}

Public Member Functions

 canvasBuilder (const abstractMixedGraph &GC) throw (ERRejected)
virtual ~canvasBuilder () throw ()
unsigned long Allocated () const throw ()
void ComputeBoundingBox () throw ()
double ScaleDisplayParameters (double zoomCalibration, double sizeX, double sizeY) throw ()
TFloat CX (TNode v) throw ()
TFloat CY (TNode v) throw ()
int RoundToInt (double val) const throw ()
long RoundToLong (double val) const throw ()
long CanvasCX (double cx) throw ()
long CanvasCY (double cy) throw ()
long CanvasCXOfPoint (TNode v) throw (ERRange)
long CanvasCYOfPoint (TNode v) throw (ERRange)
long PortCX (TNode u, TNode v) throw ()
long PortCY (TNode u, TNode v) throw ()
goblinControllerConfiguration () throw ()
virtual void DisplayGraph () throw (ERRejected)
void ExtractParameters () throw ()
void DisplayArc (TArc) throw ()
TArrowDir ArrowDirections (TArc a) throw ()
void DisplayArrow (TArc, TNode, TNode) throw ()
void DisplayArcLabel (TArc a, TNode u, TNode v, TArrowDir displayedCenteredArrows) throw ()
void ComposeArcLabel (TArc a, ofstream &expFile) throw ()
char * ArcLabel (TArc, int) throw (ERRejected)
void ComposeNodeLabel (TNode v, ofstream &expFile) throw ()
char * NodeLabel (TNode, int) throw (ERRejected)
char * ArcLegenda (int) throw (ERRejected)
char * NodeLegenda (char *, int) throw (ERRejected)
char * FixedNodeColour (TIndex c) throw ()
char * FixedEdgeColour (TIndex c) throw ()
char * SmoothColour (TIndex c, TIndex maxColour, TIndex undefColour) throw ()
virtual void WriteArc (TArc, TNode, TNode, TLineStyle, int, TArrowDir, TIndex colourIndex, int) throw ()
void WriteArcSegment (vector< double > &cx, vector< double > &cy, TLineStyle lineStyle, int width, TArrowDir displayedArrows, TIndex colourIndex, int depth) throw ()
virtual void WritePolyLine (vector< double > &cx, vector< double > &cy, TLineStyle lineStyle, int width, TArrowDir displayedArrows, TIndex colourIndex, int depth)=0 throw ()
void WriteStraightLine (double cx1, double cy1, double cx2, double cy2, TLineStyle lineStyle, int width, TArrowDir displayedArrows, TIndex colourIndex, int depth) throw ()
virtual void WriteArrow (TArc a, long xtop, long ytop, double dx, double dy)=0 throw ()
virtual void WriteArcLabel (TArc a, long xm, long ym)=0 throw ()
virtual void DisplayNode (TNode)=0 throw ()
virtual void DisplayLegenda (long xm, long ym, long radius)=0 throw ()
void DisplayGrids () throw ()

Protected Types

enum  { LABEL_BUFFER_SIZE = 256 }

Protected Attributes

const abstractMixedGraphG
goblinController CFG
char nodeLabelFormat [LABEL_BUFFER_SIZE]
char arcLabelFormat [LABEL_BUFFER_SIZE]
char tmpLabelBuffer [LABEL_BUFFER_SIZE]
char predColour [8]
char inftyColour [8]
char nodeColour [8]
TArc maxNodeColour
TArc maxEdgeColour
const TFloatpiG
double zoom
double minX
double maxX
double minY
double maxY
double nodeSize
double arrowSize
double arcLabelSep
TPortMode portMode
TArcWidthMode arcWidthMode
int arcWidthMin
int arcWidthMax
TArcStippleMode arcStippleMode
TArcVisibilityMode arcVisibilityMode
TArcShapeMode arcShapeMode
TArcColourMode arcColourMode
TArrowDisplayMode arrowDisplayMode
TArrowPosMode arrowPosMode
double arrowSizeRel
TXFigFontType arcFontType
double arcFontSize
TNodeShapeMode nodeShapeMode
TNodeColourMode nodeColourMode
double nodeSizeRel
TXFigFontType nodeFontType
double nodeFontSize
TGridDisplayMode gridDisplayMode
double fineSpacing
double bendSpacing
double nodeSpacing

Detailed Description

Builder class interface for displaying a canvas or writing canvas files.

This class partially implements the drawing of graph objects in an unspecified file format of graphical tool kit. The class interface also declares the methods which must be implemented by concrete canvas buiders.


Member Enumeration Documentation

anonymous enum [protected]
 

Enumerator:
LABEL_BUFFER_SIZE 

anonymous enum
 

Indices for adressing colours with a special meaning.

Enumerator:
PRED_COLOUR  Index representing the colour used for predecessor arcs.
INFTY_COLOUR  Colour index indicating unreachable nodes (dist == InfFloat).
NO_COLOUR  Colour index matching the node colour NoNode.
OUTLINE_COLOUR  Index representing the colour used for outlining.
GRID_COLOUR  Index representing the colour used for grid lines and the bounding box.
ZERO_COLOUR  Colour index matching the node and / or edge colour 0.
MAX_COLOUR  First colour index exeeding the colour table.

enum TArcColourMode
 

Enumerator:
ARCS_UNCOLOURED 
ARCS_FIXED_COLOURS 
ARCS_REPEAT_COLOURS 
ARCS_FLOATING_COLOURS 
ARCS_COLOUR_PRED 

enum TArcShapeMode
 

Enumerator:
ARC_SHAPE_POLYGONES 
ARC_SHAPE_SMOOTH 

enum TArcStippleMode
 

Enumerator:
ARC_STIPPLE_OFF 
ARC_STIPPLE_PREDECESSORS 
ARC_STIPPLE_FREE 
ARC_STIPPLE_FRACTIONAL 
ARC_STIPPLE_COLOURS 
ARC_STIPPLE_VOID 
ARC_STIPPLE_SUBGRAPH 

enum TArcVisibilityMode
 

Enumerator:
ARC_DISPLAY_HIDE_ALL 
ARC_DISPLAY_SUBGRAPH 
ARC_DISPLAY_PREDECESSORS 
ARC_DISPLAY_PRED_SUB 
ARC_DISPLAY_SHOW_ALL 

enum TArcWidthMode
 

Enumerator:
ARC_WIDTH_UNIFORM 
ARC_WIDTH_PREDECESSORS 
ARC_WIDTH_SUBGRAPH 
ARC_WIDTH_FLOW_LINEAR 
ARC_WIDTH_FLOW_LOGARITHMIC 
ARC_WIDTH_EMPTY_FREE_FULL 

enum TArrowDir
 

Enumerator:
ARROW_NONE 
ARROW_FORWARD 
ARROW_BACKWARD 
ARROW_BOTH 

enum TArrowDisplayMode
 

Enumerator:
ARROWS_ARC_ORIENTATION 
ARROWS_OFF 
ARROWS_IMPL_ORIENTATION 
ARROWS_FLOW_DIRECTION 
ARROWS_LIKE_PREDECESSORS 

enum TArrowPosMode
 

Enumerator:
ARROWS_AT_ENDS 
ARROWS_CENTERED 

enum TGridDisplayMode
 

Enumerator:
GRID_DISPLAY_OFF 
GRID_DISPLAY_ALL 

enum TLineStyle
 

Enumerator:
LINE_STYLE_SOLID 
LINE_STYLE_DOT 
LINE_STYLE_DASH 
LINE_STYLE_DASH_DOT 
LINE_STYLE_ZIG_ZAG 
LINE_STYLE_WAVED 

enum TNodeColourMode
 

Enumerator:
NODES_UNCOLOURED 
NODES_COLOUR_BY_DISTANCE 
NODES_FIXED_COLOURS 
NODES_COLOUR_BY_DEMAND 
NODES_FLOATING_COLOURS 

enum TNodeShapeMode
 

Enumerator:
NODE_SHAPE_POINT 
NODE_SHAPE_CIRCULAR 
NODE_SHAPE_BOX 
NODE_SHAPE_BY_COLOUR 

enum TXFigFontType
 

Font types as expected in the *.fig file format.

Enumerator:
FONT_TIMES_ROMAN 
FONT_TIMES_ITALIC 
FONT_TIMES_BOLD 
FONT_TIMES_BOLD_ITALIC 
FONT_AVANTGARDE_BOOK 
FONT_AVANTGARDE_BOOK_OBLIQUE 
FONT_AVANTGARDE_DEMI 
FONT_AVANTGARDE_DEMI_OBLIQUE 
FONT_BOOKMAN_LIGHT 
FONT_BOOKMAN_LIGHT_ITALIC 
FONT_BOOKMAN_DEMI 
FONT_BOOKMAN_DEMI_ITALIC 
FONT_COURIER 
FONT_COURIER_OBLIQUE 
FONT_COURIER_BOLD 
FONT_COURIER_BOLD_OBLIQUE 
FONT_HELVETICA 
FONT_HELVETICA_OBLIQUE 
FONT_HELVETICA_BOLD 
FONT_HELVETICA_BOLD_OBLIQUE 
FONT_HELVETICA_NARROW 
FONT_HELVETICA_NARROW_OBLIQUE 
FONT_HELVETICA_NARROW_BOLD 
FONT_HELVETICA_NARROW_BOLD_OBLIQUE 
FONT_NEW_CENTURY_SCHOOLBOOK_ROMAN 
FONT_NEW_CENTURY_SCHOOLBOOK_ITALIC 
FONT_NEW_CENTURY_SCHOOLBOOK_BOLD 
FONT_NEW_CENTURY_SCHOOLBOOK_BOLD_ITALIC 
FONT_PALATINO_ROMAN 
FONT_PALATINO_ITALIC 
FONT_PALATINO_BOLD 
FONT_PALATINO_BOLD_ITALIC 
FONT_SYMBOL 
FONT_ZAPF_CHANCERY_MEDIUM_ITALIC 
FONT_ZAPF_DINGBATS 


Constructor & Destructor Documentation

canvasBuilder const abstractMixedGraph GC  )  throw (ERRejected)
 

~canvasBuilder  )  throw () [virtual]
 


Member Function Documentation

unsigned long Allocated  )  const throw ()
 

Reimplemented from managedObject.

Reimplemented in exportToDot, exportToTk, and exportToXFig.

char * ArcLabel TArc  ,
int 
throw (ERRejected)
 

char * ArcLegenda int   )  throw (ERRejected)
 

canvasBuilder::TArrowDir ArrowDirections TArc  a  )  throw ()
 

void ComposeArcLabel TArc  a,
ofstream &  expFile
throw ()
 

void ComposeNodeLabel TNode  v,
ofstream &  expFile
throw ()
 

void ComputeBoundingBox  )  throw ()
 

goblinController& Configuration  )  throw ()
 

TFloat CX TNode  v  )  throw ()
 

TFloat CY TNode  v  )  throw ()
 

void DisplayArc TArc   )  throw ()
 

void DisplayArcLabel TArc  a,
TNode  u,
TNode  v,
TArrowDir  displayedCenteredArrows
throw ()
 

void DisplayArrow TArc  ,
TNode  ,
TNode 
throw ()
 

void DisplayGraph  )  throw (ERRejected) [virtual]
 

void DisplayGrids  )  throw ()
 

virtual void DisplayLegenda long  xm,
long  ym,
long  radius
throw () [pure virtual]
 

Implemented in exportToDot, exportToTk, and exportToXFig.

virtual void DisplayNode TNode   )  throw () [pure virtual]
 

Implemented in exportToDot, exportToTk, and exportToXFig.

void ExtractParameters  )  throw ()
 

Extract the layout parameters from the attribute pool.

char * FixedEdgeColour TIndex  c  )  throw ()
 

Translate an edge colour index to a string representing fixed colours.

Parameters:
c An internal edge colour index
Returns:
A 6 digit hexadecimal RGB string

char * FixedNodeColour TIndex  c  )  throw ()
 

Translate a node colour index to a string representing fixed colours.

Parameters:
c An internal node colour index
Returns:
A 6 digit hexadecimal RGB string

char * NodeLabel TNode  ,
int 
throw (ERRejected)
 

char * NodeLegenda char *  ,
int 
throw (ERRejected)
 

long PortCX TNode  u,
TNode  v
throw ()
 

Determine the canvas X coordinate value of a virtual port node.

Arcs are not routed in the canvas between the center points of its two graph end nodes. Instead, two virtual port nodes are introduced which occur on the border line of the visualization of the end nodes. This procedure is necessary for the correct alignment of arrow heads, but works perfectly only if the graph nodes are visualized by circles.

Parameters:
u A layout point index ranged [0,1,..,n+ni-1]. This point is considered to be the control point adjacent with v on the processed arc
v A graph node index ranged [0,1,..,n-1]
Returns:
The ordinate value of the virtual port node in the canvas

long PortCY TNode  u,
TNode  v
throw ()
 

Determine the canvas Y coordinate value of a virtual port node.

This is the analogue of PortCX() for the canvas abscissa

Parameters:
u A layout point index ranged [0,1,..,n+ni-1]. This point is considered to be the control point adjacent with v on the processed arc
v A graph node index ranged [0,1,..,n-1]
Returns:
The abscissa value of the virtual port node in the canvas

int RoundToInt double  val  )  const throw ()
 

long RoundToLong double  val  )  const throw ()
 

double ScaleDisplayParameters double  zoomCalibration,
double  sizeX,
double  sizeY
throw ()
 

char * SmoothColour TIndex  c,
TIndex  maxColour,
TIndex  undefColour
throw ()
 

Translate a colour index to a string representing floating colours.

Parameters:
c A colour to be translated
maxColour The maximal representable colour index
undefColour The default colour for unhandled colour indices
Returns:
A 6 digit hexadecimal RGB string

void WriteArc TArc  ,
TNode  ,
TNode  ,
TLineStyle  ,
int  ,
TArrowDir  ,
TIndex  colourIndex,
int 
throw () [virtual]
 

virtual void WriteArcLabel TArc  a,
long  xm,
long  ym
throw () [pure virtual]
 

Implemented in exportToDot, exportToTk, and exportToXFig.

void WriteArcSegment vector< double > &  cx,
vector< double > &  cy,
TLineStyle  lineStyle,
int  width,
TArrowDir  displayedArrows,
TIndex  colourIndex,
int  depth
throw ()
 

virtual void WriteArrow TArc  a,
long  xtop,
long  ytop,
double  dx,
double  dy
throw () [pure virtual]
 

Implemented in exportToDot, exportToTk, and exportToXFig.

virtual void WritePolyLine vector< double > &  cx,
vector< double > &  cy,
TLineStyle  lineStyle,
int  width,
TArrowDir  displayedArrows,
TIndex  colourIndex,
int  depth
throw () [pure virtual]
 

void WriteStraightLine double  cx1,
double  cy1,
double  cx2,
double  cy2,
TLineStyle  lineStyle,
int  width,
TArrowDir  displayedArrows,
TIndex  colourIndex,
int  depth
throw ()
 


Field Documentation

TArcColourMode arcColourMode [protected]
 

Applied arc colour mode.

double arcFontSize [protected]
 

Arc font size, as percents of the default value.

TXFigFontType arcFontType [protected]
 

Arc postscript font type as required by xfig / fig2dev.

char arcLabelFormat[LABEL_BUFFER_SIZE] [protected]
 

double arcLabelSep [protected]
 

TArcShapeMode arcShapeMode [protected]
 

Applied arc shape mode.

TArcStippleMode arcStippleMode [protected]
 

Applied arc stipple mode.

TArcVisibilityMode arcVisibilityMode [protected]
 

Applied arc display mode.

int arcWidthMax [protected]
 

Maximum arc width value.

int arcWidthMin [protected]
 

Minimum arc width value.

TArcWidthMode arcWidthMode [protected]
 

Applied arc width mode.

TArrowDisplayMode arrowDisplayMode [protected]
 

Applied arrow display mode.

TArrowPosMode arrowPosMode [protected]
 

Applied arrow position mode.

double arrowSize [protected]
 

double arrowSizeRel [protected]
 

Arrow size, as percents of the default value.

double bendSpacing [protected]
 

Spacing between adjacent bend control points.

goblinController CFG [protected]
 

The context of the displayed object.

double fineSpacing [protected]
 

Spacing between arc label and line display.

const abstractMixedGraph& G [protected]
 

The graph object to be displayed.

TGridDisplayMode gridDisplayMode [protected]
 

Applied grid display mode.

char inftyColour[8] [protected]
 

TArc maxEdgeColour [protected]
 

TArc maxNodeColour [protected]
 

double maxX [protected]
 

double maxY [protected]
 

double minX [protected]
 

double minY [protected]
 

char nodeColour[8] [protected]
 

TNodeColourMode nodeColourMode [protected]
 

Applied node colour mode.

double nodeFontSize [protected]
 

Node font size, as percents of the default value.

TXFigFontType nodeFontType [protected]
 

Node postscript font type as required by xfig / fig2dev.

char nodeLabelFormat[LABEL_BUFFER_SIZE] [protected]
 

TNodeShapeMode nodeShapeMode [protected]
 

Applied node shape mode.

double nodeSize [protected]
 

double nodeSizeRel [protected]
 

Node size, as percents of the default value.

double nodeSpacing [protected]
 

Spacing between adjacent graph nodes.

const TFloat* piG [protected]
 

TPortMode portMode [protected]
 

Applied port mode, depending on the layout model of this graph object.

char predColour[8] [protected]
 

char tmpLabelBuffer[LABEL_BUFFER_SIZE] [protected]
 

double zoom [protected]