Class: GeomObj

GeomObj

Abstract class for geometrical object

new GeomObj(params,)

Abstract class for simple geometrical objects [Raphael.path]
This:
Parameters:
Name Type Argument Description
params, Object <optional>
see below
params.x number <optional>
x coordinate [pixel]
params.y number <optional>
y coordinate [pixel]
params.size number <optional>
size [pixel]
params.angle number <optional>
rotation angle from initial position
Properties:
Name Type Description
x number x coordinate of the object
y number y coordinate of the object
size number size of the object
angle number angle of the object
pathList Array svg array (list) of the object
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 62

Extends

  • Raphael.fn

Methods

copy(shifts)

Copy receiver
Parameters:
Name Type Description
shifts Array.<Array.<number>> array of [x,y] couple of copies shifts
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 160

cos()

Compute cos from stored angle
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 83

makeCopy()

Make a copy of itself (each derived class to be copied have to define its own makeCopy method)
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 170

rotate(phi)

Rotate receiver by given angle (this.angle += phi)
Parameters:
Name Type Description
phi number angle of rotation
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 144

setAngle(phi)

Set angle of receiver (this.angle = phi)
Parameters:
Name Type Description
phi number angle of rotation
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 152

setPathList()

Set new this.pathList of receiver (each derived class must define its own setPathList method)
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 89

setX(x)

Sets new x position of receiver (this.x = x)
Parameters:
Name Type Description
x number new x coordinate [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 104

setXY(x, y)

Sets new x and y position of receiver (this.x = x; this.y = y)
Parameters:
Name Type Description
x number new x coordinate [pixel]
y number new y coordinate [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 95

setY(y)

Sets new y position of receiver (this.y = y)
Parameters:
Name Type Description
y number new y coordinate [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 112

sin()

Compute sin from stored (anti-clockwise) angle
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 77

translateX(dx)

Translate receiver in x direction (this.x += x)
Parameters:
Name Type Description
dx number distance to be translated [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 130

translateXY(dx, dy)

Translate receiver in x and y direction (this.x += dx; this.y += dy)
Parameters:
Name Type Description
dx number distance to be translated in x direction [pixel]
dy number distance to be translated in y direction [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 121

translateY(dy)

Translate receiver in x direction (this.y += dy)
Parameters:
Name Type Description
dy number distance to be translated [pixel]
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 137

update()

Update receiver (set this.pathList for given internal variables - x,y,angle... - as well as its copies)
Source:
  • /var/www/html/software/raphaelsm/raphaelsm.src.js, line 174