phpDocumentor SMap
Objects
[ class tree: SMap ] [ index: SMap ] [ all elements ]

Class: SMap_Object_Area_Rec

Source Location: /SMap/Object.php

Class SMap_Object_Area_Rec

Direct descendents
Child Class Description
SMap_Object_Area_PanZoom A specialized panning and zooming primitive
SMap_Object_Area_Class A specialized classification primitive
SMap_Object_Area_Raster A raster image
SMap_Object_Area_Label Label an object

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SMap_Object_Area

SMap_Object_Area::$borderColor

Inherited From SMap_Object

SMap_Object::$alt
SMap_Object::$color
SMap_Object::$label
SMap_Object::$layer
SMap_Object::$map
SMap_Object::$tile
SMap_Object::$url
SMap_Object::$view

Inherited From SMap_Object_Area

SMap_Object_Area::setBrdrColor()
Set the border color for this image

Inherited From SMap_Object

SMap_Object::__construct()
Give the object a context
SMap_Object::applyTile()
Apply a tile to this object
SMap_Object::draw()
Draw this object on a canvas
SMap_Object::getInnerBounds()
Get the rough inner rectangular bounds for this object.
SMap_Object::label()
Are we drawing a label for this object?
SMap_Object::map()
Return a map of this object
SMap_Object::setColor()
Set the color for this object
SMap_Object::setLink()
Set this to link to something

[ Top ]
Property Summary
mixed   $overlaps   Overlapping value set.
mixed   $rectBounds   The bounds

[ Top ]
Method Summary
static void   drawBox()   Draw this rectangle
static void   drawShadow()   Draw a shadow around an area, prepare for the main rect to be drawn
static array   findOverlap()   Finds if and how a viewport falls on an rectangle
static void   handleWrap()   Handle wrapping of an rectangle in a viewport
SMap_Object_Area_Rec   __construct()   Give the object a context
void   applyTile()  
void   draw()   Draw this rectangle on an image
void   getInnerBounds()  
void   label()   Place the label on the rectangle
void   map()   Retrn the appropriate image map for this rectangle

[ Top ]
Properties
mixed   $overlaps = array() [line 696]

Overlapping value set.

API Tags:
Usedby:  SMap_Object_Area_Label::copyOver()
Usedby:  SMap_Object_Area_Label::fetchCachedLayout()
Access:  protected
See:  SMap_Object_Area_Rec::findOverlap()


[ Top ]
mixed   $rectBounds [line 689]

The bounds

API Tags:
Access:  protected


[ Top ]
Methods
static method drawBox  [line 978]

  static void drawBox( SMap_Canvas $canvas, $xy, $color, $borderColor  )

Draw this rectangle

Parameters:
SMap_Canvas   $canvas: 
   $xy: 
   $color: 
   $borderColor: 

API Tags:
Access:  protected


[ Top ]
static method drawShadow  [line 1035]

  static void drawShadow( SMap_Canvas $canvas, $xy  )

Draw a shadow around an area, prepare for the main rect to be drawn

Parameters:
SMap_Canvas   $canvas: 
   $xy: 

API Tags:
Usedby:  SMap_Object_Area_Label::drawBegin()
Access:  protected


[ Top ]
static method findOverlap  [line 734]

  static array findOverlap( array $rB, integer $scale, $wrap, $vB, [ $sD = 0]  )

Finds if and how a viewport falls on an rectangle

Used to find if the rect falls within a view area, and then how to crop said rect. All parameters are in SMap Units.

The returned array is a set of bounds arrays (with pixel corners). The reason that there might be more than one return bound array is if the rect bounds wrap, and appear again. Example: one image for the globe; and we are viewing the International Date Line.

The returned arrays have integers at: ['w'] & ['h'] for width and height of the overlapping rectangle in pixels. ['vx'] & ['vy'] for view x and y offset in pixels. ['rx'] & ['ry'] for the rectangle offset in pixels (where in the rectangle are we viewing).

Parameters:
array   $rB:  View bounds (SMap Units)
integer   $scale:  Stack depth
   $wrap: 
   $vB: 
   $sD: 

API Tags:
Return:  Crop directions
Usedby:  SMap_Object_Area_Label::fetchCachedLayout()
Usedby:  SMap_Object_Area_Label::drawBegin()
Access:  protected


[ Top ]
static method handleWrap  [line 877]

  static void handleWrap( array $rB, integer $scale, array $wrap, integer $vB, integer $sD, &$sets, $thisSide, $otherSide  )

Handle wrapping of an rectangle in a viewport

Called by self::findOverlap() when wrapping is detected. Preforms some adjustments on the view bounds, recursively calls self::findOverlap(), and adjusts the results back into the correct place.

I'm not sure if this seperate function is the best way to handle this because half the function is a switch statement that could have been avoided. The calculations are annoying and this shouldn't be called often, though.

Parameters:
array   $rB:  View bounds
integer   $scale:  Stack depth
array   $wrap:  Current set of overlapping rectangle parts
integer   $vB:  Index of this side
integer   $sD:  Index of the other side
   &$sets: 
   $thisSide: 
   $otherSide: 

API Tags:
Access:  protected


[ Top ]
Constructor __construct  [line 701]

  SMap_Object_Area_Rec __construct( SMap_View $view, SMap_Layer $layer, $rectBounds  )

Give the object a context

Parameters:
SMap_View   $view: 
SMap_Layer   $layer: 
   $rectBounds: 

API Tags:
Access:  public


Redefinition of:
SMap_Object::__construct()
Give the object a context

Redefined in descendants as:

[ Top ]
applyTile  [line 940]

  void applyTile( SMap_Tile $tile  )

Parameters:
SMap_Tile   $tile: 

API Tags:
Access:  public


Redefinition of:
SMap_Object::applyTile()
Apply a tile to this object

Redefined in descendants as:

[ Top ]
draw  [line 960]

  void draw( SMap_Canvas $canvas  )

Draw this rectangle on an image

Parameters:
SMap_Canvas   $canvas: 

API Tags:
Access:  public


Redefinition of:
SMap_Object::draw()
Draw this object on a canvas

Redefined in descendants as:

[ Top ]
getInnerBounds  [line 933]

  void getInnerBounds( )


API Tags:
Access:  public


Redefinition of:
SMap_Object::getInnerBounds()
Get the rough inner rectangular bounds for this object.

[ Top ]
label  [line 953]

  void label( SMap_Object_Area_Label $label  )

Place the label on the rectangle

Parameters:
SMap_Object_Area_Label   $label: 

API Tags:
Access:  public


Redefinition of:
SMap_Object::label()
Are we drawing a label for this object?

[ Top ]
map  [line 1070]

  void map( )

Retrn the appropriate image map for this rectangle

All returned parameters are strings appropriate for drawing an (X)HTML image map.


API Tags:
Access:  public


Redefinition of:
SMap_Object::map()
Return a map of this object

Redefined in descendants as:

[ Top ]

Documentation generated on Mon, 09 Apr 2007 18:55:01 -0500 by phpDocumentor 1.3.0