[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/interfaces/ -> driver.php (summary)

File containing the abstract ezcGraphDriver class

Copyright: Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
License: http://ez.no/licenses/new_bsd New BSD License
Version: 1.5
File Size: 740 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  __set()
  __get()
  reducePolygonSize()
  reduceEllipseSize()
  testFitStringInTextBox()
  tryFitShortenedString()
  renderToOutput()

Functions
Functions that are not part of a class:

__set( $propertyName, $propertyValue )   X-Ref
Options write access

param: mixed $propertyName   Option name
param: mixed $propertyValue  Option value;
return: mixed

__get( $propertyName )   X-Ref
__get

param: mixed $propertyName
return: mixed

reducePolygonSize( array $points, $size )   X-Ref
Reduces the size of a polygon

The method takes a polygon defined by a list of points and reduces its
size by moving all lines to the middle by the given $size value.

The detection of the inner side of the polygon depends on the angle at
each edge point. This method will always work for 3 edged polygones,
because the smaller angle will always be on the inner side. For
polygons with more then 3 edges this method may fail. For ezcGraph this
is a valid simplification, because we do not have any polygones which
have an inner angle >= 180 degrees.

param: array(ezcGraphCoordinate) $points
param: float $size
return: array( ezcGraphCoordinate )

reduceEllipseSize( ezcGraphCoordinate $center, $width, $height, $startAngle, $endAngle, $size )   X-Ref
Reduce the size of an ellipse

The method returns a the edgepoints and angles for an ellipse where all
borders are moved to the inner side of the ellipse by the give $size
value.

The method returns an
array (
'center' => (ezcGraphCoordinate) New center point,
'start' => (ezcGraphCoordinate) New outer start point,
'end' => (ezcGraphCoordinate) New outer end point,
)

param: ezcGraphCoordinate $center
param: float $width
param: float $height
param: float $startAngle
param: float $endAngle
param: float $size
return: array

testFitStringInTextBox( $string, ezcGraphCoordinate $position, $width, $height, $size )   X-Ref
Test if string fits in a box with given font size

This method splits the text up into tokens and tries to wrap the text
in an optimal way to fit in the Box defined by width and height.

If the text fits into the box an array with lines is returned, which
can be used to render the text later:
array(
// Lines
array( 'word', 'word', .. ),
)
Otherwise the function will return false.

param: string $string Text
param: ezcGraphCoordinate $position Topleft position of the text box
param: float $width Width of textbox
param: float $height Height of textbox
param: int $size Fontsize
return: mixed Array with lines or false on failure

tryFitShortenedString( $string, ezcGraphCoordinate $position, $width, $height, $size )   X-Ref
If it is allow to shortened the string, this method tries to extract as
many chars as possible to display a decent amount of characters.

If no complete token (word) does fit, the largest possible amount of
chars from the first word are taken. If the amount of chars is bigger
then strlen( shortenedStringPostFix ) * 2 the last chars are replace by
the postfix.

If one complete word fits the box as many words are taken as possible
including a appended shortenedStringPostFix.

param: mixed $string
param: ezcGraphCoordinate $position
param: mixed $width
param: mixed $height
param: mixed $size
return: void

renderToOutput()   X-Ref
Render image directly to output

The method renders the image directly to the standard output. You
normally do not want to use this function, because it makes it harder
to proper cache the generated graphs.

return: void



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7